﻿tt=function(a){return document.getElementById(a);}
var mtags;

var onmouseovertime=false;
var menud;

function menutags(a,b){
  cmenu();
  for(var i=1;i<=mtags.length;i++){
	  tt('menuchilds_'+i).className=tt('menuchilds_'+i).className.replace(new RegExp(" on\\b"), "");
	  mtags[i-1].className=mtags[i-1].className.replace(new RegExp(" on\\b"), "");
  }
  a.className+=" on";
  tt('menuchilds_'+b).className+=" on";
}
function menutags1(a,b){
  cmenu();
  for(var i=1;i<=mtags.length;i++){
	  tt('menuchilds_'+i).className=tt('menuchilds_'+i).className.replace(new RegExp(" on\\b"), "");
	  mtags[i - 1].className = mtags[i - 1].className.replace(new RegExp(" onred\\b"), "");
	  tt('menuchilds_' + i).style.display = 'none';
  }
  a.className+=" onred";
//  tt('menuchilds_' + b).className += " on";

  $('#menuchilds_' + b).fadeIn("slow");

}

function Show(divid) {
    divid.filters.revealTrans.apply();
    divid.style.visibility = "visible";
    divid.filters.revealTrans.play();
}

function Hide(b) {
    var obj = document.getElementById('menuchilds_' + b);
    obj.filters.revealTrans.apply();
    obj.style.visibility = "hidden";
    obj.filters.revealTrans.play();
} 

function cmenu(){
    clearInterval(menud);
}

function cmenuout() {
  menud = setTimeout("menutags1(mtags[menuIndex-1],menuIndex)", 500);
//    menud2 = setTimeout("Hide(menuIndex+1);", 500);
}

function stuHover() {
    if (document.getElementById("langli").getElementsByTagName('ul')[0].style.display == "none") {
        document.getElementById("langli").getElementsByTagName('ul')[0].style.display = "";
    }
    else {
        document.getElementById("langli").getElementsByTagName('ul')[0].style.display = "none";
    }
}
/*stuHover = function() {
	var cssRule;
	var newSelector;
	
		for (var x = 0; x < document.styleSheets[1].rules.length ; x++)
			{
			cssRule = document.styleSheets[1].rules[x];
			if (cssRule.selectorText.indexOf("LI:hover") != -1)
			{
				 newSelector = cssRule.selectorText.replace(/LI:hover/gi, "LI.iehover");
				document.styleSheets[1].addRule(newSelector , cssRule.style.cssText);
			}
		}
	var getElm = document.getElementById("langSelect").getElementsByTagName("LI");
	for (var i=0; i<getElm.length; i++) {
		getElm[i].onmouseover=function() {
			this.className+=" iehover";
		}
		getElm[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" iehover\\b"), "");
		}
	}
}*/
//if (window.attachEvent) window.attachEvent("onload", stuHover);
