//window.onerror = null;
var menuColor = "#E3E9F4";
var menuBorderColor = "#4682F4";

function showMenu(menucall){
    i=infoOfBrowser();
    if (i==1){
		return true;
    }
    for (argument=0;argument<arguments.length;argument++){
        a = document.getElementById(arguments[argument]);
        clearTimeout(a.hidelink);
	a.style.visibility='visible';
		if (i>3){
			a.firstChild.style.filter='alpha(opacity=100)';
			a.firstChild.opacity=100;
		}
		if (i==3){
			a.style.MozOpacity=0.99;
		}
    }
} 

function hideMenu(menucall){
    i=infoOfBrowser();
    if (i==1){
		return true;
    }

    for (argument=0;argument<arguments.length;argument++){
    	a = document.getElementById(arguments[argument]);
	clearTimeout(a.hidelink);
       	a.hidelink=setTimeout("fadeMenu('"+arguments[argument]+"')",200);
    }
}

function fadeMenu(uniqueid){
     i=infoOfBrowser();
     a = document.getElementById(uniqueid);
        switch (i){
		case   3:a.style.MozOpacity = a.style.MozOpacity - 0.1
			 if (parseFloat(a.style.MozOpacity)>0){
				 a.hidelink=setTimeout("fadeMenu('"+uniqueid+"')",50);
			 }else{
				 a.style.visibility='hidden';
			 }
			 break;
		case   2:a.style.visibility='hidden';
			 break;
		default :a.firstChild.opacity=a.firstChild.opacity>20?parseFloat(parseFloat(a.firstChild.opacity)-20):0;
			 a.firstChild.style.filter='alpha(opacity='+document.getElementById(uniqueid).firstChild.opacity+')';
			 if (a.firstChild.opacity>0){
				 a.hidelink=setTimeout("fadeMenu('"+uniqueid+"')",50);
			 }else{
				 a.style.visibility='hidden';
			 }
			 break;
	}
}

function infoOfBrowser(){
 	if (window.clipboardData)          { return  5 }
	else if (window.clientInformation) { return  4 }
	else if (window.sidebar)           { return  3 }
	else if (window.opera)             { return  2 }
	else if (window.crypto)            { return  1 }
	else if (window.alert)             { return  0 }
	else                               { return -1 }
}

// Создание меню
function menuOut(menuVar){
 n = ""
 topTable = "<div ID='" + menuVar + "' style='position: absolute; ";
 if(arguments.length>1) {
   if(arguments[1]=='r') {topTable +="top: -30px; left: -306px;";}
   else {topTable += "top: -4px; left: 202px;"}
 }else {topTable +="top: -5px; left: 202px;"; }
 topTable +=" -moz-opacity: 0; visibility: hidden; z-index:10'><table border='1' cellpadding='0' cellspacing='0' style='border-collapse: collapse' bgcolor='" + menuColor +"' bordercolor='" + menuBorderColor +"' >";
 topTable += "<tr><td width='100%' onmouseover='javascript:showMenu(\"" + menuVar + "\");' onmouseout='javascript:hideMenu(\"" + menuVar + "\");' style='padding: 0px'>";
 btmTable = "</td></tr></table></div>";
 n += topTable
 n += eval(menuVar)
 n += btmTable
 return n;
}
