var OpenId;
var OpenId3;
var OpenIdC;
var CurMId;
var MenID = new String();
var flg3;
var flgC;
var Imgs="/img/";
var isIE=(document.all)?true:false;
isOpera=(navigator.userAgent.substr(navigator.userAgent.indexOf("Opera")+6,1)<=6)?true:false;
isOpera7=(navigator.userAgent.substr(navigator.userAgent.indexOf("Opera")+6,1)>=7)?true:false;
if (isOpera) isIE=false;
if (isOpera7) isIE=false;

function InitMenu(){
    if (isIE){
	MenID=document.getElementById('MenuId').value;
        FaId=MenID;
        flg3=0;
        flgC=0;
        i=0;
        while (FaId!=""){
	    FaId=MenID.substring(0, MenID.length-i);
    	    CurMId='menu'+FaId;
	    if (document.getElementById(CurMId)){
		if (FaId.length==2 || FaId.length==3) {
		    OpenIdC=document.getElementById(CurMId).id;
		    flg3=1;
		}
		else {
		    OpenId=document.getElementById(CurMId);
		}
	    }
	    DivCurMId='div_'+CurMId;
    	    dota='div_'+CurMId;
    	    dotaTR='div_'+CurMId+'tr';
	    if (document.getElementById(dota)){
		img_id=CurMId+'_img';
		docc=document.getElementById(dota);
		docb=document.getElementById(dotaTR);
		docc.style.width='100%';
		docc.style.visibility='visible';
		docc.style.position='relative';
		docb.style.width='100%';
		docb.style.visibility='visible';
		docb.style.position='relative';
		document.getElementById(img_id).src=Imgs+'arrow06_down.gif';
	    }
	    else {
	        if (document.getElementById(CurMId)) {
		    menU = CurMId+'_';
		    document.getElementById(menU).bgColor='#CC0000';
		    doce=document.getElementById(CurMId);
		    doce.children.tags('A')[0].style.fontWeight='bold';
	   	    doce.bgColor='#CC0000';
		}
	    }
    	    i++;
	}	
    }
};


function openM(MId){
    if (MId!=null) {
		img_id=MId.id+'_img';
		if (OpenId!=MId){
	    	if (OpenId!=null){
				old_dota='div_'+OpenId.id;
				old_dotaTR='div_'+OpenId.id+'tr';
				oimg_id=OpenId.id+'_img';
				if (document.getElementById(old_dota)){
			    	document.getElementById(oimg_id).src=Imgs+'arrow06.gif';
					doca=document.getElementById(old_dota);
				    doca.style.visibility='hidden';
				    doca.style.position='absolute';
					docb=document.getElementById(old_dotaTR);
				    docb.style.visibility='hidden';
				    docb.style.position='absolute';
				}
				for (i=1;i<10;i++){
			    	old_dota_dota=old_dota+i;
			    	old_dota_dotaTR=old_dota+i+'tr';
				    if (document.getElementById(old_dota_dota)){
						if (OpenId3){
						    img_id3=OpenId3.id+'_img';
				    		document.getElementById(img_id3).src=Imgs+'arrow06.gif';
						}
						docc=document.getElementById(old_dota_dota);
						docd=document.getElementById(old_dota_dotaTR);
						docc.style.visibility='hidden';
						docc.style.position='absolute';
						docd.style.visibility='hidden';
						docd.style.position='absolute';
						OpenId3=null;
			    	}
				}
			}
			document.getElementById(img_id).src=Imgs+'arrow06_down.gif';
			flgC=1;
			dota='div_'+MId.id;
			dotaTR='div_'+MId.id+'tr';
			doce=document.getElementById(dota);
			doce.style.width='100%';
			doce.style.visibility='visible';
			doce.style.position='relative';
			docf=document.getElementById(dotaTR);
			docf.style.width='100%';
			docf.style.visibility='visible';
			docf.style.position='relative';
			OpenId=MId;
		}
		else {
		    dota='div_'+MId.id;
			dotaTR='div_'+MId.id+'tr';
		    docg=document.getElementById(dota);
			docg.style.visibility='hidden';
		    docg.style.position='absolute';
			doch=document.getElementById(dotaTR);
			doch.style.visibility='hidden';
		    doch.style.position='absolute';
		    document.getElementById(img_id).src=Imgs+'arrow06.gif';
	    	for (i=1;i<10;i++){
				dota_dota=dota+i;
				dota_dotaTR=dota+i+'tr';
				if (document.getElementById(dota_dota)){
				    if(OpenId3){
						img_id3=OpenId3.id+'_img';
						document.getElementById(img_id3).src=Imgs+'arrow06.gif';
						doci=document.getElementById(dota_dota);
						doci.style.visibility='hidden';
						doci.style.position='absolute';
						docj=document.getElementById(dota_dotaTR);
						docj.style.visibility='hidden';
						docj.style.position='absolute';
					}
		    		OpenId3=null
				}
	    	}
		    OpenId=null;
		}
    }
    document.selection.empty();
};

function openM3(MId){
	if (MId!=null) {
		img_id=MId.id+'_img';
		if (OpenId3!=MId){
			if (OpenId3!=null){
				old_dota='div_'+OpenId3.id;
				oimg_id=OpenId3.id+'_img';
				document.getElementById(oimg_id).src=Imgs+'arrow06.gif';
				doca=document.getElementById(old_dota);
				doca.style.visibility='hidden';
				doca.style.position='absolute';
			}
			document.getElementById(img_id).src=Imgs+'arrow06_down.gif';
			flgC=1;
			dota='div_'+MId.id;
			dotaTR='div_'+MId.id+'tr';
			docb=document.getElementById(dotaTR);
			docb.style.width='100%';
		    docb.style.visibility='visible';
		    docb.style.position='relative';
			docc=document.getElementById(dota)
			docc.style.width='100%';
			docc.style.visibility='visible';
			docc.style.position='relative';
			OpenId3=MId;
		}
		else {
			dota='div_'+MId.id;
			dotaTR='div_'+MId.id+'tr';
			docb=document.getElementById(dotaTR);
		    docb.style.visibility='hidden';
		    docb.style.position='absolute';
			docc=document.getElementById(dota)
			docc.style.visibility='hidden';
			docc.style.position='absolute';
			document.getElementById(img_id).src=Imgs+'arrow06.gif';
			OpenId3=null;
		}
	}
	document.selection.empty();
};

function mOut(MId, clr){
	if (flg3!=0){
		if (MId.id!=OpenIdC) {
			if (MId){
				menU = MId.id+'_';
				document.getElementById(menU).bgColor=clr;
				MId.bgColor=clr;
				MId.style.cursor='default';
			}
		}
	}
	else {
		if (MId!=OpenId){
			if (MId){
				menU = MId.id+'_';
				document.getElementById(menU).bgColor=clr;
				MId.bgColor=clr;
				MId.style.cursor='default';
			}
		}
		else {
	    	    if (flgC==1){
			if (MId){
			    menU = MId.id+'_';
			    document.getElementById(menU).bgColor=clr;
			    MId.bgColor=clr;
			    MId.style.cursor='default';
			}
		    }
		}
	}
};

function mOver(MId, clr){
	if (flg3!=0){
		if (MId.id!=OpenIdC) {
			if (MId){
				menU = MId.id+'_';
				document.getElementById(menU).bgColor=clr;
				MId.bgColor=clr;
				MId.style.cursor='hand';
			}
		}
	}
	else {
		if (MId!=OpenId){
			if (MId){
				menU = MId.id+'_';
				document.getElementById(menU).bgColor=clr;
				MId.bgColor=clr;
				MId.style.cursor='hand';
			}
		}
		else {
		    if (flgC==1){
			if (MId){
			    menU = MId.id+'_';
			    document.getElementById(menU).bgColor=clr;
			    MId.bgColor=clr;
			    MId.style.cursor='default';
			}
		    }
		}
	}
};

function openMC(MId){
    if (OpenIdC!=MId.id){
		if (OpenIdC!=null){
			omenU = OpenIdC+'_';
			document.getElementById(omenU).bgColor='#ACACAC';
			doca=document.getElementById(OpenIdC);
			doca.bgColor='#ACACAC';
			doca.children.tags('A')[0].style.fontWeight='normal';
			menU = MId.id+'_';
			MId.bgColor='#CC0000';
			document.getElementById(menU).bgColor='#CC0000';
			document.getElementById(MId.id).children.tags('A')[0].style.fontWeight='bold';
		}
		else {
		    document.getElementById(MId.id).children.tags('A')[0].style.fontWeight='bold';
			menU = MId.id+'_';
			document.getElementById(menU).bgColor='#CC0000';
			MId.bgColor='#CC0000';
		}
		OpenIdC=MId.id;
    }
    document.selection.empty();
    if (MId.children.tags('A')[0]) MId.children.tags('A')[0].click();
};

function openS(MId){
    if (MId){
		if (MId!=OpenId){
		flgC=0;
	    	document.selection.empty();
	    	if (MId.children.tags('A')[0]) MId.children.tags('A')[0].click();
	    	OpenId=MId;
		}
        OpenId=MId;
    }
};

function w(oTEXT){
    document.write (oTEXT);
};
