function cnendb()
{
window.open("about:blank","cnendb","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,top=10000,left=10000,width=1,height=1");
}
function CheckOthers(form)
{
	for (var i=0;i<form.elements.length;i++)
	{
		var e = form.elements[i];
//		if (e.name != 'chkall')
			if (e.checked==false)
			{
				e.checked = true;// form.chkall.checked;
			}
			else
			{
				e.checked = false;
			}
	}
}

function CheckAll(form)
{
	for (var i=0;i<form.elements.length;i++)
	{
		var e = form.elements[i];
//		if (e.name != 'chkall')
			e.checked = true// form.chkall.checked;
	}
}
var curshow;

function OpenTree()
{
for (i=1;i<=3;i++)
{
	if (i==ParentID)
	{
		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="";
//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="";
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 killErrors() { 
return true; 
} 
window.onerror = killErrors; 