isMac = (navigator.appVersion.indexOf("Mac")!=-1) ? true : false;
NS4 = (document.layers) ? true : false;
IEmac = ((document.all)&&(isMac)) ? true : false;
IE4plus = (document.all) ? true : false;
IE4 = ((document.all)&&(navigator.appVersion.indexOf("MSIE 4.")!=-1)) ? true : false;
IE5 = ((document.all)&&(navigator.appVersion.indexOf("MSIE 5.")!=-1)) ? true : false;
IE6 = ((document.all)&&(navigator.appVersion.indexOf("MSIE 6.")!=-1)) ? true : false;
IE7 = ((document.all)&&(navigator.appVersion.indexOf("MSIE 7.")!=-1)) ? true : false;
ver4 = (NS4 || IE4plus) ? true : false;
NS6 = (!document.layers) && (navigator.userAgent.indexOf('Netscape'));

function menu_item_on_mouseover(el)
{
	el.style.backgroundColor = "#EEEEEE";
	ShowMenu(el);
}

function menu_item_on_mouseover1(el, i)
{
	el.style.backgroundColor = "#EEEEEE";
	ShowMenu1(el, i);
}

function menu_item_on_mouseout(el)
{
	el.style.backgroundColor = "#FFFFFF";
	HideMenu(el.id);
}

function findPos(obj) 
{
	var curleft = curtop = 0;
	if (obj.offsetParent) 
	{
		curleft = obj.offsetLeft;
		curtop = obj.offsetTop;
		while (obj = obj.offsetParent) 
		{
			curleft += obj.offsetLeft;
			curtop += obj.offsetTop;
		}
	}
	return [curleft,curtop];
}

function findPos1(obj) 
{
	var curleft = curtop = 0;
	if (obj.clientParent) 
	{
		curleft = obj.clientLeft;
		curtop = obj.clientTop;
		while (obj = obj.clientParent) 
		{
			curleft += obj.clientLeft;
			curtop += obj.clientTop;
		}
	}
	return [curleft,curtop];
}

function d(el)
{
	return document.getElementById(el);
}

function ShowMenu1(el, i)
{
	eval('try{if(shm_'+el.id+') clearTimeout(shm_'+el.id+')}catch(err){}');

	//var p = findPos(el);
	var p1 = findPos(d('3'));
	var m = d('menu_' + el.id);
	if (m)
	{
		m.style.display = '';	
		if (typeof document.body.style.maxHeight != "undefined") 
		{
		  	// IE 7, mozilla, safari, opera 9
		  	if(IE7)
		  	{
				//IE7
				m.style.top = (i*23) + 1 + 'px';
				m.style.left = 177 + 'px';
			}
			else
			{
				//alert('check mate 1');
				m.style.top = p1[1] + (i*25) + 2 + 'px';
				m.style.left = p1[0] + 150 + 185 + 'px';
			}
		  
		} 
		else 
		{
		  	// IE6, older browsers
			//alert('check mate 2');
			m.style.top = (i*23) + 1 + 'px';
			m.style.left = 177 + 'px';
		}
	}
}

function ShowMenu(el)
{
	eval('try{if(shm_'+el.id+') clearTimeout(shm_'+el.id+')}catch(err){}');

	var p = findPos(el);
	var m = d('menu_' + el.id);
	if (m)
	{
		m.style.top = p[1] + 1 + 'px';
		m.style.left = p[0] + el.clientWidth - 2 + 'px';
		m.style.display = '';
	}
}

function HideMenu(el_id)
{
	eval('shm_' + el_id + ' = setTimeout("HM(\''+el_id+'\')", 50);');
}

function HM(el_id)
{
	var m = d('menu_' + el_id);
	if (m != null)
		m.style.display = 'none';
}