/**********************************************************************************
	Layer Show Hide
***********************************************************************************/

function LayerSH(LayerName,Status) {
ns = (document.getElementById)?true:false
ie = (document.all)?true:false

	if (ns) {
		LayerN = document.getElementById(LayerName).style
		if (Status == 'show') LayerN.visibility = 'visible';
		if (Status == 'hide') LayerN.visibility = 'hidden';
	}	
	if (ie) {
		LayerN = document.all[LayerName].style
		if (Status == 'show') LayerN.visibility = 'visible';
		if (Status == 'hide') LayerN.visibility = 'hidden';
	}
}

/**********************************************************************************
	Image Roll Over
***********************************************************************************/

function preload(imgObj,imgSrc) {
	if (document.images) {
		eval(imgObj+' = new Image()')
		eval(imgObj+'.src = "'+imgSrc+'"')
	}
}
function imgChg(imgName,imgObj) {
	if (document.images) {
		document.images[imgName].src = eval(imgObj+".src")
	}
}


/**********************************************************************************
	Toggle Menu
***********************************************************************************/

function MM_toggle(LayerName,LayerName2) { //v6.0
	LayerN = document.getElementById(LayerName).style
	LayerN2 = document.getElementById(LayerName2).style
		if (LayerN.display == "none") {
	LayerN.display = ""
	LayerN2.display = "none"
	}
	else {
	LayerN.display = "none"
	LayerN2.display = ""
	}
}

function MM_toggle3(LayerName,LayerName2,LayerName3) { //v6.0
	LayerN = document.getElementById(LayerName).style
	LayerN2 = document.getElementById(LayerName2).style
	LayerN3 = document.getElementById(LayerName3).style
		if (LayerN.display == "none") {
	LayerN.display = ""
	LayerN2.display = "none"
	LayerN3.display = "none"
	}
	else {
	LayerN.display = "none"
	LayerN2.display = "none"
	LayerN3.display = ""
	}
}

function MM_toggle2(LayerName) { //v6.0
	LayerN = document.getElementById(LayerName).style
	if (LayerN.visibility == "hidden") {
	LayerN.visibility = "visible"
	}
	else {
	LayerN.visibility = "hidden"
	}
}


/**********************************************************************************
	Pop up Window
***********************************************************************************/

function popwin(pop,width,height)
{
	var url = pop;  
	var wd = width;
	var he = height;
	
	window.open(url,"","left=300;top=300,toolbar=0,menubar=0,scrollbars=no,resizable=no,width=" + wd +",height=" + he + ";")
}

function popwin2(pop,width,height)
{
	var url = pop;  
	var wd = width;
	var he = height;
	
	window.open(url,"","left=300;top=300,toolbar=0,menubar=0,scrollbars=yes,resizable=no,width=" + wd +",height=" + he + ";")
}

function popwin3(pop,width,height)
{
	var url = pop;  
	var wd = width;
	var he = height;
	
	window.open(url,"","left=300;top=300,toolbar=0,menubar=0,scrollbars=yes,resizable=yes,width=" + wd +",height=" + he + ";")
}

var newWin = null;
function newWindow(picName) {
	if (newWin!=null)
	{
		newWin.close();
	}
	newWin=window.open('', 'photo_window', 'left=100,top=100,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=300,height=200');
	if (newWin!=null) {
		newWin.document.write('<html><head><title>ÎúêÅéë</title><script language=javascript>function rewin() { window.resizeTo (popimg.width+12,popimg.height+30); }</script></head>\n');
		newWin.document.write('<body bgcolor=white MARGINWIDTH=0 LEFTMARGIN=0 MARGINHEIGHT=0 TOPMARGIN=0>\n');
		newWin.document.write("<img id=popimg src="+ picName+" border=0 style=cursor:hand onclick=self.close();>\n");
		newWin.document.write("<script language=javascript>setTimeout('rewin()', 500); </script>\n");
		newWin.document.write('</body></html>');
	}
	else
		alert("Error : in function newWindow");
	return;
}

	function RWindow(URL,WD,HT) { 
	window.open(URL,'counter','width=430,height=400,scrollbars=yes,resizable=0,status=no,menubar=0'); 
	} 


/**********************************************************************************
	Link Blur
***********************************************************************************/

function allblur() {
for (i = 0; i < document.links.length; i++)
document.links[i].onfocus = document.links[i].blur;
}

document.onfocusin = allblur;

function bluring(){ 
if(event.srcElement.tagName=="A"||event.srcElement.tagName=="IMG") document.body.focus(); 
} 
document.onfocusin=bluring; 
