var gop='';
var flg=0;
var con=6;
var consub=1;
bgco="#95001E";

function cht(x,y)
{
	flg=0;
	clearTimeout(gop);

	for (i=1;i<consub;i++)
	{
		n="g"+i;
		document.all[n].style.visibility="hidden";
	}
	if(document.all)
	{
		dr=document.all[x];
		dr1=document.all[y];
	}
	if(!document.all  && document.getElementById)
	{
		dr=document.getElementById(x);
		dr1=document.getElementById(y);
	}
	
	if(y!='0')	dr1.style.visibility='visible';

	dr.style.backgroundColor=bgco;
	dr.style.color="#FFFFFF";
	dr.style.cursor="hand";
}

function cho(x)
{
	if(document.all)
	{
		dr=document.all[x];
	}
	if(!document.all && document.getElementById)
	{
		dr=document.getElementById(x);
	}
	dr.style.backgroundColor="#737F97";
	dr.style.color="#FFFFFF";
}

function srcel()
{
	flg=1
	if( (window.event.toElement.id.indexOf("1") == '-1' ) && (window.event.toElement.id.indexOf("2") == '-1' ) && (window.event.toElement.id.indexOf("3") == '-1' ) && (window.event.toElement.id.indexOf("4") == '-1' ) && (window.event.toElement.id.indexOf("5") == '-1' ) && (window.event.toElement.id.indexOf("6") == '-1' ) && (window.event.toElement.id.indexOf("7") == '-1' ) && (window.event.toElement.id.indexOf("8") == '-1' ) && (window.event.toElement.id.indexOf("9") == '-1' ) && (window.event.toElement.id.indexOf("10") == '-1' ) && (window.event.toElement.id.indexOf("11") == '-1' ) && (window.event.toElement.id.indexOf("12") == '-1' ) && (window.event.toElement.id.indexOf("13") == '-1' ) && (window.event.toElement.id.indexOf("14") == '-1' ) && (window.event.toElement.id.indexOf("15") == '-1' ) && (window.event.toElement.id.indexOf("16") == '-1' ) && (window.event.toElement.id.indexOf("17") == '-1' ) && (window.event.toElement.id.indexOf("18") == '-1' ) && (window.event.toElement.id.indexOf("19") == '-1' ) )
	{
		gop = setTimeout('closesd1()',0);
	}
}

function closesd1()
{
	if(flg==1)
	{
		closesd();
	}
}

function closesd()
{
	tabb=document.all.tags("select");

	for(i=0;i<tabb.length;i++)
	{
		tabb[i].style.visibility='visible';
	}
	if(document.all)
	{
		for (i=1;i<consub;i++)
		{
			n="g"+i;
			document.all[n].style.visibility="hidden";
		}
		
		for (i=1;i<con;i++)
		{
			n="f"+i;
			document.all[n].style.visibility="hidden";
		}
	}
	if(!document.all && document.getElementById)
	{
		for (i=1;i<consub;i++)
		{
			n="g"+i;
			document.getElementById(n).style.visibility="hidden";
		}
		for (i=1;i<con;i++)
		{
			n="f"+i;
			document.getElementById(n).style.visibility="hidden";
		}
	}
}

function f(x)
{
	flg=0;
	if(document.all )
	{
		tabb=document.all.tags("select");
		for(i=0;i<tabb.length;i++)
		{
			tabb[i].style.visibility='hidden';
		}
		for (i=1;i<con;i++)
		{
			n="f"+i;
			document.all[n].style.visibility="hidden";
		}
		for (i=1;i<consub;i++)
		{
			n="g"+i;
			document.all[n].style.visibility="hidden";
		}
		var b="f"+x;
		document.all[b].style.visibility="visible";
	}
	if(!document.all && document.getElementById)
	{
		tabb=document.getElementsByTagName("select");
		for(i=0;i<tabb.length;i++)
		{
			tabb[i].style.visibility='hidden';
		}
		for (i=1;i<con;i++)
		{
			n="f"+i;
			document.getElementById(n).style.visibility="hidden";
		}
		if(x!=7)
		{
			for (i=1;i<consub;i++)
			{
				n="g"+i;
				document.getElementById(n).style.visibility="hidden";
			}
		}
		var b="f"+x;
		document.getElementById(b).style.visibility="visible";
	}
}

function g(x,path)
{
	tabb=document.all.tags("select");
	for(i=0;i<tabb.length;i++)
	{
		tabb[i].style.visibility='hidden';
	}
	if(document.all)
	{
		document.all[x].style.visibility="hidden";
	}
	if(!document.all && document.getElementById )
	{
		document.getElementById(x).style.visibility="hidden";
	}
	if(path!="")	window.location=path;
}

function d(x,path)
{
	if(document.all)
	{
		var b="f"+x;
		document.all[b].style.visibility="hidden";
	}
	if(!document.all && document.getElementById )
	{
		var b="f"+x;
		document.getElementById(b).style.visibility="hidden";
	}
	if(path!="")	window.location=path;
}

document.onmouseup	=	closesd;
