var curshow;

function OpenTree()
{
for (i=1;i<=5;i++)
{
	if (i==MenuID)
	{
		var ThisTree=document.all.item('R'+i+'tree');
		var TreeImg=document.all.item('R'+i+'img1');
		ThisTree.style.display='';
		TreeImg.src='/console/images/minuS.gif';
	}
}
}

function toggle(thebut,layerid)
{
	var theimg1=document.all.item(thebut.id+'img1');
	var img = theimg1.src.substring(theimg1.src.lastIndexOf('/')+1);
	if (img=='plus.gif')
	{
		openbutton(thebut,theimg1,layerid)
	}
	else
	{
		closebutton(thebut,theimg1)
	}
}

function openbutton(thebut,theimg1,layerid)
{
var thetree=document.all.item(thebut.id+'tree');

	thetree.style.display='';
	theimg1.src='/console/images/minus.gif';
	for(i=1;i<=layercount;i++)
	if (thebut.id.indexOf('R')==0)
	{
		if (i!=layerid)
		{
			var thetree=document.all.item('R'+i+'tree');
			thetree.style.display='none';
			var theimg1=document.all.item('R'+i+'img1');
			theimg1.src='/console/images/plus.gif';
		}
	}
}

function closebutton(thebut,theimg1)
{
	var thetree= document.all.item(thebut.id+'tree');
	thetree.style.display='none';
	theimg1.src='/console/images/plus.gif';
}


function msMenuOver(msel){
var obj=event.srcElement;
obj.parentElement.style.backgroundColor="#666666";
//if (curshow!=null) curshow.style.visibility="hidden";
if (msel==null) return;
msel.style.visibility="visible";
}

function msMenuOut(msel){
var obj=event.srcElement;
obj.parentElement.style.backgroundColor="#000000";
if (msel==null) return;
msel.style.visibility="hidden";
//curshow=msel;
}

function TreeMenuOver(msel){
//if (curshow!=null) curshow.style.visibility="hidden";
msel.style.visibility="visible";
}

function TreeMenuOut(msel){
msel.style.visibility="hidden";
}

function OverMenuBG(){
var obj=event.srcElement;
obj.parentElement.style.backgroundColor="#8A8A8A";
}

function OutMenuBG(){
var obj=event.srcElement;
obj.parentElement.style.backgroundColor="#666666";
}

function BeHref(obj)
{
	obj.style.cursor='hand';
}
	
function DeHref(obj)
{
	obj.style.textDecoration='none';
}

HelpWindow=null
function OpenHelp(HelpUrl){
	if(! HelpWindow|| HelpWindow.closed){
		HelpWindow=window.open(HelpUrl,'Help','width=420,height=400,scrollbars=yes,resizable=no,top='+(screen.height-300)/2+',left='+(screen.width-400)/2)
	}else{
		HelpWindow.focus()
		HelpWindow=window.open(HelpUrl,'Help','width=420,height=400,scrollbars=yes,resizable=no,top='+(screen.height-300)/2+',left='+(screen.width-400)/2)
	}
}

