var w3c = document.getElementById ? true : false;
var iex = document.all ? true : false;
var ns4 = document.layers ? true : false;
var isOver = false;
var timer = null;

function subMenu(isOpen) {
	this.isOpen = isOpen;
	return this;
}

subMenus = new Array();
subMenus['subMenu1']=new subMenu(false);
subMenus['subMenu2']=new subMenu(false);
subMenus['subMenu3']=new subMenu(false);
subMenus['subMenu4']=new subMenu(false);
subMenus['subMenu5']=new subMenu(false);

function getStyle(name, nest){
	nest = nest ? 'document.'+nest+'.' : '';
	return w3c ? document.getElementById(name).style : iex ? document.all[name].style : ns4 ? eval(nest+'document.'+name) : false;
}

function hideSubMenus() {
	for (i=1; i<=5; i++) {
		if (subMenus['subMenu'+i].isOpen) {
			getStyle('subMenu'+i).visibility = 'hidden';
		}
	}
}

function hideLayer(which) {
	timer = setTimeout('hideIt( \'' + which + '\' )',300);
}

function showLayer(which) {
	clearTimeout(timer);
	hideSubMenus();
	getStyle(which).visibility = 'visible';
	subMenus[which].isOpen=true;
}

function hideIt(which) {
	getStyle(which).visibility = 'hidden';
	subMenus[which].isOpen=false;
	hideSubMenus();
}

function open_img(img, x_r, y_r) {
  newWindow = open('','newWindow','height=' + (y_r + 10) + ',width=' + (x_r + 10) + ',resizable=no,status=yes,toolbar=no,location=no,menubar=no,scrollbars=no');
  newWindow.document.open();
  newWindow.document.write('<html><title></title><body leftmargin=0 topmargin=0 marginheight=0 marginwidth=0 bgcolor=white onBlur=\"self.close()\" onClick=\"self.close()\">');
  newWindow.document.write('<table height=' + (y_r + 10) + ' width=' + (x_r + 10) + ' border=0 cellspacing=0 cellpadding=0 align=center><tr><td align=center valign=middle>');
  newWindow.document.write('<img src=' + img + ' alt=\"Click screen to close\">');
  newWindow.document.write('</td></tr></table></body></html>');
  newWindow.document.close();
  newWindow.focus();
}

function open_window(page, x_r, y_r) {
	self.name='main';
	newWindow = open(page,'newWindow','height=' + y_r + ',width=' + x_r + ',resizable=no,status=yes,toolbar=no,location=no,menubar=no,scrollbars=yes');
  newWindow.focus();
}


function treeMouseOver(id) {
	id.style.backgroundColor = '#C3E0FA';
}

function treeMouseOut(id) {
	id.style.backgroundColor = '';
}

function over(id)
{
 id.style.backgroundColor='#E6F0FF';
}

function out(id)
{
 id.style.backgroundColor='';
}
