// JavaScript Document
function property(url,name)
{
	var newwindow;
	var iMyWidth;
	var iMyHeight;
	iMyWidth = (window.screen.width/2) - (900 + 10);
	iMyHeight = (window.screen.height/2) - (900 + 50);
	newwindow=window.open(url,name,'height=700,width=850,left=' + iMyWidth + ',top=' + iMyHeight + ',screenX=' + iMyWidth + ',screenY=' + iMyHeight + ',toolbar=no,menubar=no,scrollbars=yes,location=no,directories=no,resizable=no,status=yes');
	if (window.focus) {newwindow.focus()}
}




// numbersonly
function numbersonly(myfield, e, dec){
		var key;
		var keychar;

		if (window.event)
		   key = window.event.keyCode;
		else if (e)
		   key = e.which;
		else
		   return true;
		keychar = String.fromCharCode(key);

		if ((key==null) || (key==0) || (key==8) || 
		    (key==9) || (key==13) || (key==27) )
		   return true;

		else if ((("0123456789").indexOf(keychar) > -1))
		   return true;

		else if (dec && (keychar == "-"))
		   {
		   myfield.form.elements[dec].focus();
		   return false;
		   }
		else
		   return false;
	}
function decision(message, url){
	if(confirm(message)) location.href = url;
}


// print

function doClick()
{
window.print();
}





function checkAlluncheckAll(field)
{
for (i = 0; i < field.length; i++)
if(field[i].checked == true) 
field[i].checked = false;
else 
field[i].checked = true
}
function checkAll(field)
{
for (i = 0; i < field.length; i++)
field[i].checked = true ;
}

function uncheckAll(field)
{
for (i = 0; i < field.length; i++)
	field[i].checked = false ;
}


function location1()
{
location1.checked = true ;	
}


function additional(mySelect,name,key) {
      myIndex = mySelect.selectedIndex;
      myValue = mySelect.options[myIndex].value;
      var obj = (document.getElementById)? document.getElementById(name) : eval("document.all[name]");
      if (myValue == key){
		obj.style.display="";
	} else {
		obj.style.display="none";
	}
}

function transparent(element)
{
	if(/MSIE (5\.5|6).+Win/.test(navigator.userAgent)) 
	{
		var src = element.src;
		element.src = config.spacerPath; 
		if (src) element.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + src + "',sizingMethod='scale')";
	}
}

function showPic(pic, width, height)
{ 
	sDesrc = "width=" + width + ", height=" + height + ", status=no, toolbar=no, menubar=no, scrollbars=no";
	win = window.open("gallery_image.php?pic=" + pic, "", sDesrc);
}

function showVideo(video_id, width, height)
{ 
	sDesrc = "width=" + width + ", height=" + height + ", status=no, toolbar=no, menubar=no, scrollbars=no";
	win = window.open("video.php?video_id=" + video_id + "&width=" + width + "&height=" + height, "", sDesrc);
}

var send = function(link)
{
 	var dataToSend = document.getElementById('calendar_y').value + "." + document.getElementById('calendar_m').value;
 	var ajax = new httpAjaxRequest(); 
	if(ajax)
	{  
		ajax.prepareHash({date:dataToSend}); 
		ajax.open("GET", "ajax.php");
		ajax.send();
		ajax.getData();
		ajax.onreadystatechange = function()
		{ 
			data = ajax.getResult();
			document.getElementById("calendar_div").innerHTML = data.calendar; 
		}  
	}
 	else 
 	{
 		window.location = link + document.getElementById('calendar_y').value + "." + document.getElementById('calendar_m').value;
 	}
}

function showhidediv(name){
	var obj = (document.getElementById)? document.getElementById(name) : eval("document.all[name]");
	if (obj.style.display=="none"){
		obj.style.display="";
	} else {
		obj.style.display="none";
	}
}
function showdiv(name){
	var obj = (document.getElementById)? document.getElementById(name) : eval("document.all[name]");
	obj.style.display="";
}
function hidediv(name){
	var obj = (document.getElementById)? document.getElementById(name) : eval("document.all[name]");
	obj.style.display="none";
}


function show_player(filename)
{
	var width=300;
	var height=220;
	document.write("<embed name='player' type='application/x-mplayer2' pluginspage='http://microsoft.com/windows/mediaplayer/en/download/' width='"+width+"' height='"+height+"' showcontrols='true' autostart='false' src='../js/"+filename+"'></embed>");
}
function show_player2(filename)
{
	var width=540;
	var height=380;
	document.write("<embed name='player' type='application/x-mplayer2' pluginspage='http://microsoft.com/windows/mediaplayer/en/download/' width='"+width+"' height='"+height+"' showcontrols='true' autostart='false' src='../js/"+filename+"'></embed>");
}
function playerWindow(filename)
{
	var width=500;
	var height=285;
	
	var myBars = 'directories=no,location=no,menubar=no,status=no,titlebar=no,toolbar=no'; 
	var myOptions = 'scrollbars=yes,width=500,height=285,resizeable=yes'; 
	var myFeatures = myBars + ',' + myOptions; 
	var wnd = open('','',myFeatures);
	wnd.document.write("<html><head><meta http-equiv='Content-Type' content='text/html; charset=utf-8' /><title>title</title><style type='text/css'><!-- body,td,th {	font-size: 12px;} body { background-color: #000000; margin-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; } --></style></head><body><embed name='player' type='application/x-mplayer2' pluginspage='http://microsoft.com/windows/mediaplayer/en/download/' width='500' height='285' showcontrols='true' autostart='true' src='../js/"+filename+"'></embed></body></html>");
}




