isDOM=document.getElementById //DOM1 browser (MSIE 5+, Netscape 6, Opera 5+)
isOpera=isOpera5=window.opera && isDOM //Opera 5+
isOpera6=isOpera && window.print //Opera 6+
isOpera7=isOpera && document.readyState //Opera 7+
isMSIE=document.all && document.all.item && !isOpera //Microsoft Internet Explorer 4+
isMSIE5=isDOM && isMSIE //MSIE 5+
isNetscape4=document.layers //Netscape 4.*
isMozilla=isDOM && navigator.appName=="Netscape" //Mozilla или Netscape 6.*

function is_sp2()
{
	result = (navigator.appVersion.indexOf("SV1") != -1) ? true : false;
	return result;
}
function is_IE55()
{
	res = (navigator.appVersion.indexOf("MSIE 5.5") != -1) ? true : false;
	return res;
}
function is_IE5()
{
	result = ( (navigator.appVersion.indexOf("MSIE 5") != -1) && (is_IE55() === false)) ? true : false;
	return result;
}
function cancelCloseMenu(){
	if(self.tm) clearTimeout(tm) // cancel delayed closing
}
function showMenu(current){

	for (i in larray) {
		larray[i][1].hide();
		//larray[i][0].object.className='';
	}
	if (current!=false) {
		cancelCloseMenu()
		//show
		
		// move second menu relatively
		j = 140;
		if(is_sp2() || navigator.appName == 'Netscape') j=-15;
		if(is_IE5()) j=-169;
		if( navigator.appName == 'Opera' ) j=-6;
		larray[current][1].moveTo(170, larray[current][0].getTop()-j-10)
		larray[current][1].show()
	}

}
function initiateHideMenu(current) {
//  1 second delay to close a submenu
	tm = setTimeout("hideMenu('"+current+"')", 500);
}
function hideMenu(current)
{
//	larray[current][0].object.className='';
	larray[current][1].hide();
}

//Initialize submenu positions
function submenu(m,s)
{
	var layers = new Array(2);
	layers[0] = layer(m);
	layers[1] = layer(s);
	return layers; 
}
//Initialize menu handles

