/* Script by Alex Rubinov */
	IdTimer=null;
	
	IdPosEl="menuID";
	MenuLev1="popup1";
	MenuLevel0=0;
	function InitMenu(){
	ObjMenulev1=document.getElementById(MenuLev1);
	isMinIE = (document.all) ? 1 : 0;
	IE=(isMinIE && navigator.userAgent.toLowerCase().indexOf("opera") == -1)
	loading=1;
	}
	onload=InitMenu;	
	
	function WriteIt(obj,text){
		obj.innerHTML=text;
	}
	function Validate(text){
		try {eval(text); return 1;}
		catch(e) {return 0;}
	}	

	function MakeMenu1(id){
		if(!Validate("MnLev1text"+id)){text="";}
		else{
			TmpArtext = eval("MnLev1text"+id)	
			TmpArlink = eval("MnLev1link"+id);
			
			head='<table border="0" cellspacing="0" cellpadding="0"><tr><td colspan="3" class="popup-cont'+ ((IE)?"-ie":"") + '">';	
			footer='</td></tr><tr><td><img src="pic/pop_con_b_l.gif" width="3" height="3" alt="" border="0"></td><td width="1000"  class="popup-f'+ ((IE)?"-ie":"") + '"><img src="pic/x.gif" width="140" height="1" alt="" class="x"></td><td><img src="pic/pop_con_b_r.gif" width="3" height="3" alt="" border="0"></td></tr></table>';
			content="";
			for (i=0; i<TmpArtext.length; i++){
				if(ActElmMenu1==(id*10+i+1)){
				content+='<div><img src="pic/bul_popup.gif" width="13" height="7" alt="" border="0"> + TmpArtext[i] + </div>';
				}
				else{
				content+='<a href="' + TmpArlink[i] + '">' + TmpArtext[i] + '</a>';
				}
			}
		text = head+content+footer;		
		}	
		WriteIt(ObjMenulev1,text);
	}
		
	function ShowMenu1(id){
		clearTimeout(IdTimer);
		obj=document.getElementById(IdPosEl+id);
		if(MenuLevel0!=id){MakeMenu1(id);}
		x=0;
		while(obj){
			x+=obj.offsetLeft;
			obj=obj.offsetParent;
		}
		if(x+ObjMenulev1.offsetWidth>document.body.clientWidth){
		x=document.body.clientWidth-ObjMenulev1.offsetWidth;
		}
		ObjMenulev1.style.left=x;

		MenuLevel0=id;	
		ObjMenulev1.style.visibility="visible";
	}
	
	function EnableMenu1(){
		clearTimeout(IdTimer);
		ObjMenulev1.style.visibility="visible";
	}		
	
	function HideMenu(){
	IdTimer=setTimeout("HideMenuAct()",100);
	}	
	function HideMenuAct(){
		ObjMenulev1.style.visibility="hidden";
	}	
	
