var timer=new Array()
var TheClickedLayer="Layer0"
function ShowDiv(TheLayer,TheHref)
{
	if(document.getElementById(TheLayer)==null)
		return
	if(document.getElementById(TheLayer).style.display=="")
		return false
	document.getElementById(TheLayer).style.display=""
	StopTimer(TheLayer)
}
function HideDiv(TheLayer,TheI)
{
	MainLayer=TheLayer.replace(/_(\d+)/g,"")
	for(i=0;i<TheDivs.length;i++)
	{
		if(TheDivs[i].id.indexOf(MainLayer)!=-1)
		{
			TheDivs[i].style.display="none"		
			clearInterval(timer[TheDivs[i].id])
		}
	}

	document.getElementById(TheClickedLayer).style.display=""
}

function ShowThis(TheLayer)
{
	HideAll();
	TheClickedLayer=TheLayer;
	document.getElementById(TheLayer).style.display=""
}

function StartTimer(TheLayer)
{
	timer[TheLayer]=setInterval("HideDiv('"+TheLayer+"')",1000)
	if(TheLayer.indexOf("_")!=-1)
	{
		StartTimer(TheLayer.replace(/_\d+$/,""))
	}
}
function StopTimer(TheLayer)
{
	MainLayer=TheLayer.replace(/_(\d+)/g,"")
	for(i=0;i<TheDivs.length;i++)
	{
		if(TheDivs[i].id.indexOf(MainLayer)!=-1)
		{
			clearInterval(timer[TheDivs[i].id])
			timer[TheDivs[i].id]=""
		}
	}
}
function Goto(ThePage)
{
	location.href=ThePage
}

function HideAll()
{
	for(i=0;i<TheDivs.length;i++)
	{
		if(TheDivs[i].id.indexOf("Layer")!=-1)
		{
			TheDivs[i].style.display="none"
			clearInterval(timer[TheDivs[i].id])
			timer[TheDivs[i].id]=""
		}
	}
}

function ShowDesc(Id)
{
	document.getElementById("float_table_"+Id).style.display="block";
	document.getElementById("txtul_"+Id).className="arial11pxgreytxtul";
}
function HideDesc(Id)
{
		document.getElementById("float_table_"+Id).style.display="none";
		document.getElementById("txtul_"+Id).className="arial11pxgrey";
}
function ShowDesc1(Id)
{
	
	if(document.getElementById("float_table_"+Id).style.display=='block')
	{
			document.getElementById("float_table_"+Id).style.display="none";		
			document.getElementById("txtul_"+Id).className="arial11pxgrey";
	}
	else
	{
		document.getElementById("float_table_"+Id).style.display="block";
		document.getElementById("txtul_"+Id).className="arial11pxgreytxtul";
	}
}
function ShowDescription(Id, totalId)
{
	
	if(document.getElementById("float_table_"+Id).style.display=='block')
	{
		for(var i = 1;i <=totalId; i++ )		
			document.getElementById("float_table_"+i).style.display="none";		
		document.getElementById("txtul_"+Id).className="arial11pxgrey";
	}
	else
	{
		for(var i = 1;i <=totalId; i++ )
		{
			if(i == Id)
			{
				document.getElementById("float_table_"+Id).style.display="block";
				document.getElementById("txtul_"+Id).className="arial11pxgreytxtul";
			}
			else
			{
				document.getElementById("float_table_"+i).style.display="none";	
				document.getElementById("txtul_"+i).className="arial11pxgrey";
			}
		}
	}
}
function close(Id){
	document.getElementById("float_table_"+Id).style.display="none";	
}
/*************  Print a Page  **************************/
function printapage(Id)
	{		
		var display = "width=620,height=303,resizable=no,top=0,left=0,addressbar=no,scrollbars=no";
		var value = document.getElementById("float_table_"+Id).innerHTML;
		docprintpage = window.open("","",display);
		docprintpage.document.open();
		docprintpage.document.write('<html><head><title>Inel Power System</title>'); 
		docprintpage.document.write('<link href="../../includes/style.css" type="text/css" rel="stylesheet" />');
		docprintpage.document.write('</head><body onLoad="self.print(); window.close();" class="hideprint" align="center"><table cellspacing="0" border="0" align="center"><tr><td align="center">');          
		docprintpage.document.write(value);          
		docprintpage.document.write('</td></tr></table></body></html>'); 
		docprintpage.document.close();		
		docprintpage.focus();		
	}

