function gm(s){
	if(d.getElementById)
		m=d.getElementById(s);
	else if(d.all)
		m=d.all[s];
	else if(d.layers)
		m=d[s];
	return m;
}
function gs(s){
	m=gm(s);
	if(!is.ns4 && m)m=m.style;
	return m;
}
function spos(am,t_,l_,h_,w_){
	px="px";
	if(is.ns4){
		px="";
		gms=am;
		if(w_!=null)gms.clip.width=w_;
		if(h_!=null)gms.clip.height=h_;
	}else if(is.opera){
		px="";
		gms=am.style;
		if(w_!=null)gms.pixelWidth=w_;
		if(h_!=null)gms.pixelHeight=h_;
	}else{
		gms=am.style;
		if(w_!=null)gms.width=w_+px;
		if(h_!=null)gms.height=h_+px;
	}
	if(t_!=null)gms.top=t_+px;
	if(l_!=null)gms.left=l_+px;
}
function gpos(gm){
	if(is.ns4){
		t_=gm.top;
		l_=gm.left;
		h_=gm.clip.height;
		w_=gm.clip.width;
	}else if(is.opera || is.ns6){
		t_=gm.offsetTop;
		l_=gm.offsetLeft;
		h_=gm.offsetHeight;
		w_=gm.offsetWidth;	
	}else{
		if(is.mac){
			topM=gm.offsetParent.topMargin;
			if(!topM)topM=0;
			leftM=gm.offsetParent.leftMargin;
			if(!leftM)leftM=0;
			t_=parseInt(topM)+gm.offsetTop;
			l_=parseInt(leftM)+gm.offsetLeft;
		}else{
			t_=gm.offsetTop;
			l_=gm.offsetLeft;
		}
		h_=gm.offsetHeight;
		w_=gm.offsetWidth;
	}
	if(is.konq){
		w_=parseInt(gm.style.width);
		h_=parseInt(gm.style.height);
	}
	var r=new Array();
	r[0]=t_;	r[1]=l_;
	r[2]=h_;	r[3]=w_;
	return(r);
}
function gMXY(e){
	if(is.ns4||is.ns6){
		MouseX=e.pageX;
		MouseY=e.pageY;
	}else if(event){
		MouseX=event.clientX;
		MouseY=event.clientY;
	}else{
	MouseX=e.clientX;
		MouseY=e.clientY;
	}
	if(!is.opera&&d.all){
		MouseX=MouseX+d.body.scrollLeft;
		MouseY=MouseY+d.body.scrollTop;
		if(IEDtD)MouseY=MouseY+sy;
	}
	return true;
}
function parseLink(txt,what){
	txt=txt+";";
	lt="";
	if(what=="link"){
		if(txt.indexOf("&quot;")>0)
			lt=txt;
		else{
			sp=txt.indexOf(" ");
			lt=txt.substr(0,sp);
		}
	}else{
		sp=txt.indexOf(what)+what.length+1;
		if(sp>what.length){
			lt=txt.substr(sp,999);
			lt=lt.substr(0, lt.indexOf(";"))
		}
	}
	return lt;
}
function cHexColor(c){
	return c.match(/^[0-9a-f]{6,6}$/i) ? '#' + c.toUpperCase() : c;
}
function ws(s){window.status=s;return true;}

function fixForm(divname,show){
	if(is.ie55||is.ns6||is.mac)return;
	mfrms=divname.split(";");
	for(i=0;i<mfrms.length;i++){
		if(is.opera||is.ns4){
			SDiv(mfrms[i],show)
		}else{
			gmf=d.forms[mfrms[i]];
			if(gmf){
				for(j=0;j<gmf.length;j++){
					if(gmf.elements[j].type.substr(0,7)=="select-"){
						fobj=gmf.elements[j].style;
						if(show){
							fobj.visibility="visible";
							fobj.overflow="visible"
						}else{
							fobj.visibility="hidden";
							fobj.overflow="hidden";
						}
					}
				}
			}
		}
	}
}

function SDiv(nm,sh){	
	if(is.ns4&&nm.indexOf(".")>0)tD=eval(nm);else tD=gs(nm);
	if(tD&&sh)
		tD.visibility="visible";
	else{
		tD.visibility="hidden";
		if(is.ie55){
			gmif=gm("if"+nm);
			if(gmif)gmif.style.visibility='hidden';
		}
	}
}
function close_el(){
	for(xa=hlarr.length-1;xa>=0;xa--){
		ti=hlarr[xa];
		if(!ti[2])continue;
		tmenu=eval(ti[2]);
		if(is.ns4)
			shl(ti[2],ti[1],'hide')
		else{
			arg=gm("el"+ti[1]);
			arg.style.background=ti[4];
			arg.style.color=""+ti[5];
			if(ti[4])arg.style.borderColor=ti[6]
		}
		if(ti[2]==hll){
			if(is.ns4)shl(ti[2],hel,'show');
			return;
		}
	}
	hlcnt=0;
	hlarr=new Array();
}
function closeall(){
	ShM=0;
	om="";
	hll="";
	close_el();
	if(ParentMenu&&ParentMenu.closeFel)ParentMenu.close_el();
	if(pf&&pf.ML)pf.closeall();
	if(is.ns4)omv.visibility="hide";
	for(a=1;a<mlen;a++){
		menu=eval("menu"+a);		
		if(menu[17]&&ML>1)fixForm(menu[17],1);
		if(menu[7]!=1)SDiv("menu"+a,0);	else _am="";
	}
}

function popdn(){
	arg=popdn.arguments;
	if(arg[0]){
		if(arg[3].substr(0,5)!="show-"){
			if(is.ns4){
				shl(arg[2],arg[1],"hide")
			}else{
				arg[0].style.background=arg[4];
				arg[0].style.color=arg[5];
				if(arg[6])arg[0].style.borderColor=arg[6]
			}
		}else{
			if(is.ns4)omv=0;
			hlarr[hlcnt]=arg;
			hlcnt++;
		}
		menu=eval(arg[2]);
		if(!menu[12]){
			clearTimeout(MT);
			MT=setTimeout("closeall();resetShM();",timegap)
		}
	}else{
		clearTimeout(MT);
		MT=setTimeout("closeall();resetShM",timegap);
	}
}
function sis(){
	for(a=1;a<imar.length;a++){
		tim=imar[a].split("_");
		if(tim[4]) tim[3]=tim[3]+"_"+tim[4];
		menu=eval(tim[3]);
		if(is.ns4){
			im=d.layers[tim[3]].document.layers["el"+tim[2]];
			imp=gpos(im);
			eln="";
			for(x=0;x<2;x++){
				imo=d.layers[tim[3]].document.layers[eln+"el"+tim[2]].document.layers[imar[a]];
				imop=gpos(imo);
				imL=imp[3]-(imop[3]);				
				imT=(imp[2]/2)-(imop[2]/2);
				if(menu[15])imL=1;
				if(menu[13]=="left")imL=1;
				if(menu[13]=="center")imL=(imp[3]/2);
				eln="m";
				spos(imo,imT,imL,null,null);
			}
		}else{
			imo=gm(imar[a]);
			imop=gpos(imo);
			im=gm("el"+tim[2]);
			imp=gpos(im);
			if(is.mac){
				x=menu[6][9];
				imp[0]=imp[0]-x;
				imop[0]=imo[0]-x
			}if(menu[11]){
				imco=gpos(gm("hel"+tim[2]));
				imc=imco[1];
			}else
				imc=0;
			imT=imp[0]+(imp[2]/2)-(imop[2]/2);
			imL=imc+imp[3]-(imop[3]);
			if(menu[15])imL=imc;
			if(menu[13]=="left")imL=imc;
			if(menu[13]=="center")imL=imc+(imp[3]/2);
			if(is.ns6&&!is.ns61){
				nsC=gpos(gm(tim[3]));
				imT=imT-nsC[0];
				imL=imL-nsC[1];
			}
			spos(imo,imT,imL,null,null);
		}
	}
}
function fb(mnu){
	menu=eval(mnu);
	ic=(menu.length-ac)/5;
	menu[21][2]=1;
	m42=menu[4]*2;
	mn=gm(mnu);
	if(is.ns4){
		if(menu[14]) spos(gm("menuback"+mnu),null,null,mn.clip.height+(menu[14]*2),null);
		if(menu[11]) mn.clip.width=mn.clip.width+menu[4];
		return;
	}
	mp=gpos(mn);
	el=menu[21][1];
	ml=gm("el"+(el-1));
	mlp=gpos(ml);
	tw=null;
	th=null;
	if(menu[11]){
		lf=0;
		tc=0;
		for(y=el-ic;y<el;y++){
			tc++;
			ty=gm("el"+y);
			typ=gpos(ty);
			thy=gm("hel"+y);
			thyp=gpos(thy);
			if(is.mac&&!menu[3]){
				thy.style.width=1+"px";
				ty.style.width=thy.offsetWidth+menu[6][9]+"px";
				typ[3]=thy.offsetWidth
			}if(is.opera){
				ty.style.top=menu[4];
				if(lf==0)lf=menu[4];
				typ[2]=typ[2]+(m42);				
				spos(ty,null,0,null,typ[3]);
			}
			spos(thy,null,lf,typ[2],typ[3]);
			lfL=0;
			if(menu[ac-1+(tc*5)]>0)lfL=menu[ac-1+(tc*5)];
			lf=lf+typ[3]+lfL;
			hsep=gm("hsep"+y);
			if(y<el-1)spos(hsep,null,typ[3],typ[2]); else spos(hsep,null,0,0,0);
		}
		tw=lf-lfL;
		th=typ[2];
		if(d.compatMode!="CSS1Compat"){
			if(is.mac){
				if(!d.doctype){
					th=th+(m42);
					tw=tw+m42
				}else{
					if(d.doctype.name.indexOf(".dtd")<0){
						th=th+(m42);
					}
				}
			}else if(d.all&&!is.opera){
				tw=tw+(m42);
				th=th+(m42)
			}
		}
		if(is.opera)tw=tw+(menu[4])
	}else{
		if(is.ns6)tw=mp[3]-(menu[4]*4);
		if(IEDtD)tw=menu[3]-menu[4];
		if(is.opera)tw=mp[3]-(menu[4]*2);
	}
	spos(mn,null,null,th,tw);
	spos(mn,null,null,th,tw);
	if(menu[14])spos(gm("menuback"+mnu),null,null,th+(menu[14]*2)+m42,null);
}				
function sm(v1){
	menu=eval(v1);
	if((is.opera||is.ns6||menu[11]||IEDtD)&&(!menu[7]&&!menu[21][2]))fb(v1);
	ap=gm(v1);
	gmi++;
	if(!is.ns4)aps=ap.style;else aps=ap;
	aps.zIndex=gmi;
	aps.visibility='visible';
	if(is.ie55){
		gmif=gm("if"+v1);
		ifgp=gpos(ap);
		spos(gmif,ifgp[0],ifgp[1],ifgp[2],ifgp[3]);
		gmif.style.visibility='visible';
	}
	if(menu[17])fixForm(menu[17],0);
}
function popup(mn,mpos){
	if(isNaN(mn)){
		for(a=1;a<mlen;a++){
			if(mn==Mname[a]){
				mn=a;
				break;
			}
		}
	}
	setpos();
	omv.visibility='hide';
	clearTimeout(MT);
	closeall();
	mtxt='menu'+mn;
	mi=gs(mtxt);
	if(is.ns4)d.captureEvents(Event.MOUSEMOVE);
	d.onmousemove=gMXY;
	mn=gm(mtxt);
	gp=gpos(mn);
	if(mpos>0){
		ttop=MouseY+2;
		tleft=MouseX+2
	}else{
		ttop=gp[0];
		tleft=gp[1];
	}
	if((ttop+gp[2])>(wh+sy)){
		ttop=wh-gp[2]+sy;
		if(!mpos&&mpos>0)spos(mn,ttop,null,null,null);
	}
	if((tleft+gp[3])>(ww+sx)){
		tleft=ww-gp[3]+sx;
		if(!mpos&&mpos>0)spos(mn,null,tleft,null,null);
	}
	if(mpos)spos(mn,ttop,tleft,null,null);	
	sm(mtxt);
	_am=mn;
}
function shl(lyr,el,s){
	clearTimeout(MT);
	mt=d.layers[lyr].document.layers["el"+el];
	omv.visibility="hide";
	menu=eval(lyr);
	mt.visibility=s;
	omv=mt;
}
function resetShM(){
	for(a=1;a<mlen;a++){
		menu=eval("menu"+a);
		if(menu[7]&&menu[12]){
			ShM=0;
			return;
		}
	}
	if(ParentMenu)ParentMenu.resetShM();
}

function popi(v1,lyr,el){
	if((loadWait&&ML==0)||inDragMode)return;
	subfound=0;
	nv1=v1;
	for(a=1;a<mlen;a++){
		if(v1.match("show-menu")&&v1.substring(10,99)==Mname[a]){
			v1="show-menu"+a;
			subfound=1;
			a=999;
		}
	}
	if(!om)om=lyr;
	clearTimeout(MT);
	if(ParentMenu)ParentMenu.clearTimeout(ParentMenu.MT);
	kmnu=lyr;
	container=eval(lyr);

	if(subfound){
		v1=v1.substring(5,99);
		menu=eval(v1);		
		omnu=v1;
		mi=gm(v1);		
		gp=gpos(gm(lyr));
		h3="";		
		if(container[11])h3="h";
		if(is.ns4){
			tel=gpos(d.layers[lyr].document.layers["el"+el]);
		}else{
			tel=gpos(gm(h3+"el"+el));
		}
	
		np=gpos(mi);
		if(np[2]<1){
			fb(v1);
			np=gpos(mi);
		}
			
		if(!container[11]){	//VERTICAL MENU
			if(!is.ns61&&is.ns6)tel[0]=tel[0]-gp[0];
			nt=tel[0]+gp[0]+suboffset_top;
			nl=gp[1]+tel[3]-suboffset_left;
			onl=nl;
			ont=nt;
			if((gp[1]+gp[3]+np[3])>=ww+sx||menu[15]) nl=gp[1]-np[3]+suboffset_left;
			if(nl<0)nl=onl;
			if(nt+np[2]>wh+sy){nt=wh-np[2]+sy;}
			if(nt<0)nt=sy+4;
			if(menu[1]>=0)nt=menu[1];
			if(menu[2]>=0)nl=menu[2];
			spos(mi,nt,nl,null,null);
		}
		om+=","+v1;
		
		if(ShM==1){
			sm(v1);
			if(!is.ns4)mi.style.visibility="visible";
		}
	}else if(is.ns4&&v1.indexOf(" "))
		shl(lyr,el,"show");		
		ta=om.split(",")
		strt=0;
		for(a=0;a<ta.length;a++){
			if(ta[a]==v1)strt=0;
			if(strt){
				if(ta[a]){
					hll=lyr;
					hel=el;
					close_el();
					tmnu=eval(ta[a]);
					if(tmnu[17]&&!menu[17])fixForm(tmnu[17],1);
					if(!tmnu[7])SDiv(ta[a],0);
				}
			ta[a]="";
			}
			if(ta[a]==lyr)strt=1;
		}
		
		mmenu=eval(lyr);
		if(mmenu[7]&&lyr!=ta[0]){
			closeall();
			if(v1==ta[ta.length-1]){
				if(is.ns4)shl(lyr,el,'show');
				tmnu=eval(v1)
				if(tmnu[17])fixForm(tmnu[17],0);
				SDiv(v1,1);
			}
		}
		om="";
		mdisp=0;
		for(a=0;a<ta.length;a++){
			if(ta[a]==lyr)frs=a;
			if(ta[a]==v1)fre=a;
			if(mdisp||(a>frs&&a<fre)){
				if(ta[a]&&ta[a]!=v1){
					SDiv(ta[a],0);
					close_el();
					if(is.ns4)shl(lyr,el,'hide');
				}
			}else if(ta[a])om+=ta[a]+",";			
			if (v1==ta[a])mdisp=1;
		}
}

function hl(){
	arg=hl.arguments;	
	imgact="";
	hlnk=arg[1];
	if(!menu[8]&&menu[15])menu[8]="right";
	_am=" "+a;
	_am=_am.length-1;
	subimg="";
	arg[0]+="";
	if(is.ns6)dwd=arg[2][9]*2;else dwd=0;
	if(is.ns4){
		if(el==0){
			st="<style type=\"text/css\">A.m{text-decoration:none;}</style>";
			d.write(st);
			oatop=atop;
		}else{
			mtl=d.layers[omnu].document.layers["el"+(el-1)];
			if(oatop==atop)atop+=mtl.clip.height;else atop=menu[4];
			oatop=atop;
		}
		if(menu[11]){
			atop=menu[4];
			if(oaleft==aleft)
				aleft+=mtl.clip.width+arg[8];
			else{
				aleft=menu[4];
				oaleft=aleft;
			}
			oaleft=aleft
		}else{
			aleft=menu[4];
		}
	}
	if(hlnk.substring(0,5)=="show-"){
		arg[1]=arg[1].toLowerCase();
		if(arg[7]==hlnk)if(arg[6])arg[7]=arg[6];else arg[7]="";
		hlnk="#";
		if(arg[6]+" "!="undefined ")hlnk=arg[6];
	}
	pI="popi('"+arg[1]+"','"+arg[5]+"',"+el+");";
	if(arg[1].substring(0,5)=="show-"&&(!menu[11]||menu[6][16])&&(menu[11]||menu[6][10])){
		im++;
		ims="im_"+a+"_"+el+"_"+arg[5];
		ti=arg[2][10];
		if(menu[6][16]&&menu[11])ti=menu[6][16];
		if(is.ns4){
			sti="<img border=0 src="+ti+">";
			subimg="<layer id="+ims+">"+sti+"</layer>";
		}else{
			if(is.opera)imgact="onmouseover=\"clearTimeout(MT)\"";
			subimg="<img id="+ims+" style=\"position:absolute;\" "+imgact+" border=0 src="+ti+">";
		}
		imar[im]=ims;
	}
	omp=mp;
	ofc=arg[2][0];
	ofb=arg[2][1];
	onc=arg[2][2];
	onb=arg[2][3];
	ltarg=" ";
	lOnfunc="";
	lOffunc="";
	ltype="";
	lalign=menu[8];
	if(!lalign)lalign="left";
	tfborc="";
	nborc="";
	fborc="";
	simg="";
	bimg="";
	sbimg="";
	sbgc="";
	sbgc=menu[6][4];
	if(is.ns4&&ofb=="transparent")ofb="";
	if(!ofb&&(is.mac||is.opera))ofb="transparent";
	if(arg[7]+""=="undefined")arg[7]=hlnk;		
	if(ltype=="form"){
		onc=ofc;
		onb=ofb;
		mp="default";
	}
	if(ltype=="header"&&arg[2][17]){
		ofc=arg[2][17];
		ofb=arg[2][18];
		onc=arg[2][17];
		onb=arg[2][18];
		mp="default"
	}
	smO="ShM=1;";
	smC="";
	if(menu[16]==1){
		smO="";
		if(!arg[1].indexOf("show-menu"))hlnk="javascript:ShM=1;"+pI;
	}	
	if(sty[14]){
		tlen=hlnk.length;
		thlnk=location.href;
		thlnk=thlnk.substring(thlnk.length-tlen,thlnk.length);
		if(hlnk!="#"&&hlnk==thlnk){
			ofc=arg[2][14];
			ofb=arg[2][15];
		}
	}	
	if(ltype=="form"||hlnk=="#"||ltype=="header"){
		mp="default";
		if(is.ns4)hlnk="<a ";else hlnk=" ";
	}else{
		if(is.ns4)
			hlnk="<a href=\""+hlnk+"\" "+ltarg;
		else
			hlnk="<a id=lnk"+el+" href=\""+hlnk+"\" "+ltarg+" style='text-decoration:none;'>";
	}
	
	if(!is.ns4){
		if(bimg)ofb="url("+bimg+") "+ofb;
		if(sbimg){
			if(sbimg!="NONE")onb="url("+sbimg+") "+onb;
		}else if(bimg)onb="url("+bimg+") "+onb;
	}
	
	pd="popdn(this," + el + ", '" + arg[5] + "', '"+arg[1]+"', '"+ofb+"', '"+ofc+"', '"+fborc+"');"
	if(arg[0].toLowerCase().indexOf("<img")>=0){
		ipos=arg[0].toLowerCase().indexOf("<img");
		iefix="";
		if(is.ie6)iefix=" onclick=\"gm('el"+el+"').click()\"";
	 	arg[0]=arg[0].substr(0,ipos+4)+iefix+" id=im"+el+" "+ arg[0].substr(ipos+5,900);
	}
	
	if(!isNaN(arg[2][5]))arg[2][5]+="px";
	dragfunc="";
	if(is.ns4){
		if(bimg)bimg=" background="+bimg;
		if(sbimg){
			if(sbimg!="NONE")sbimg=" background="+sbimg;else sbimg="";
		}else sbimg=bimg;
		tdwd=" width="+(menu[3]-(arg[2][9]*2));
		ns4nwrap="";
		if(menu[11])ns4nwrap="nowrap";
		ls="<table border=0 cellpadding="+arg[2][9]+" cellspacing=0><tr><td "+ns4nwrap+" height=-1 align="+lalign+tdwd+">"+hlnk+" style='color:"
		le=";text-decoration:none;font-size:"+arg[2][5]+";font-weight:"+arg[2][7]+";font-family:"+arg[2][8]+"' onmouseover=\"status='"+arg[7]+"';\">"+arg[0]+"</a>"+subimg+"</td></tr></table></layer>"
		if(menu[11])nswid=menu[3]; else nswid=(menu[3]-(menu[4]*2));
		lv=" left="+aleft+" width="+nswid+" top="+atop;
		nsofb="";if(ofb)nsofb=" BGColor="+ofb;
		nsonb="";if(onb)nsonb=" BGColor="+onb;
		tshl="shl('"+arg[5]+"',"+el+",'show');"
		if(ltype=="form")tshl="";
		mt="<layer id=mel"+el+lv+" "+nsofb+bimg+" onmouseover=\""+smO+tshl+pI+" "+dragfunc+lOnfunc+";return ws('"+arg[7]+"');\">"+ls+ofc+le;
		mt+="<layer id=el"+el+lv+" "+nsonb+sbimg+" onmouseover=\"clearTimeout(MT);"+pI+"ltarg='"+ltarg+"'; nshl='"+arg[1]+"'; this.captureEvents(Event.CLICK); this.onClick=dc;\" onmouseout=\""+pd+"; "+lOffunc+"; return ws('');\" visibility=hidden >"+ls+onc+le;
	}else{
		mt="";
		if(menu[11]){
			bgc=sty[4];
			mt+="<div id=hel"+el+" style=\"text-align:left;background:'"+ofb+"';width:"+(menu[3]-menu[4])+"px;position:absolute;top:0;left:"+dlft+";\">";dlft=dlft+menu[3]-(menu[4]*2)+menu[4];
		}
		rsp=0;
		if(lalign=="right")rsp=7;
		mt+=hlnk;
		dw=(menu[3]-(2*menu[4]+dwd));
		if(dw+" "=="NaN ")dw="";else{dw="width:"+dw+"px"}
		if(is.opera&&menu[3])dw="width:"+(menu[3]-(arg[2][9]*2)-(menu[4]*2))+"px;";
		if(!menu[3]&&is.ie4)dw="width:1px";
		if(menu[11]&&is.opera)dw="position:absolute;";
		if(!menu[11]&&IEDtD)dw="width:"+(menu[3]-menu[4]-(arg[2][9]*2))+"px;";
		if(isNaN(arg[2][9]))padd=arg[2][9];else{psp=arg[2][9]+"px ";padd=psp+psp+psp+psp;}
		if(menu[11]&&menu[3]>0)dw="position:absolute;width:"+menu[3]+"px";
		hms="";
		if(menu[11])hms="<div style=\";top:0;position:absolute;\"><div onmouseover=\"clearTimeout(MT)\" id=hsep"+el+" style=\"position:absolute;background:"+sbgc+";width:"+menu[b]+"px; clip:rect(0 "+menu[b]+"px 100% 0);\">\n</div>\n</div>";
		mt+="<div id=el"+el+" style=\"margin:0px;"+tfborc+"text-align:"+lalign+";"+dw+";padding:"+padd+";font-weight:"+arg[2][7]+";font-style:"+arg[2][6]+";font-family:"+arg[2][8]+";font-size:"+arg[2][5]+";color:"+ofc+";background:"+ofb+";\"";
		mt+=" onMouseOver=\""+nborc+";this.style.background='"+onb+"';style.color='"+onc+"';this.style.cursor='"+mp+"';"+smO+"; "+pI+";"+dragfunc+lOnfunc+";return ws('"+arg[7]+"');\"";
		if(is.mac&&d.all)mt+=" onClick=\"lnk"+el+".click()\"";
		mt+=" onMouseOut=\""+pd+";"+lOffunc+"; return ws('');\">"+(arg[0])+"</div></a>";
		if (menu[11])mt+=hms+"</div>";
		mt+=subimg;
	}
	mp=omp;
	d.write(mt);
	el++;
}


function dmenu(mnu){
	menu=eval(mnu);
	menu[21]=new Array();
	if(menu[7])parr[parr.length]=mnu.substr(4,3);
	if(ac==menu.length)menu[23]="";
	atop=menu[4];
	if(!atop)atop=0;
	sty=menu[6];
	if(!menu[4])menu[4]=0;
	if(is.ns4)eq="=";else eq=":";
	for(z=0;z<21;z++){
		if(z==5)z=12;
		if(z==16)z++;
		if(sty[z]&&sty[z].charAt(0)!="#")sty[z]=cHexColor(sty[z]);
	}
	if(menu[14]){
		m14=";"+menu[14];
		m14ar=m14.split(";");
		if(m14ar[2]){
			m14h=m14ar[1];
			m14w=m14ar[2].substr(6,99)+"px";
			menu[14]=m14h;
		}else{
			m14h=m14ar[1];
			m14w="100%";
		}
		if(d.layers)
			d.write("<layer z-index=1 id=menuback"+mnu+" top="+(menu[1]-m14h)+" height=2 width="+m14w+" left=0 bgcolor="+sty[1]+"></layer>");
		else 
			d.write("<div id=menuback"+mnu+" style=\"position:absolute;top:"+(menu[1]-m14h)+"px;width:"+m14w+";height:2px;background:"+sty[1]+"\">&nbsp;</div>")
	}
	if(el)ns6c=3;else ns6c=2;
	ns6w=0;
	if(menu[8]=="right"&&is.ns6)ns6w=7;
	if (menu[3]<1)menu[3]="undefined";
	if(is.ns4){
		bgc="";
		thw=menu[3];
		if(menu[11]){
			ic=(menu.length-ac)/5;
			thw=(menu[3]*ic)-(menu[4]*ic)+menu[4];
		}
		if(sty[4])bgc="bgColor="+sty[4];
		m18="";
		if(menu[18])m18="background="+menu[18];
		mt="<layer "+m18+" z-index=29 visibility=hidden "+bgc+" id="+mnu+" top="+menu[1]+" left="+menu[2]+" width="+thw+">";
		mt+="<layer id="+mnu+"3d bgcolor="+sty[12]+" top=0 left=0 height=0 width=2></layer>";
	}else{
		m18="";
		if(menu[18])m18="url("+menu[18]+ ") ";
		if(!sty[4]&&(is.mac||is.opera))sty[4]="transparent";
		brd = " border:solid "+menu[4]+"px "+sty[4]+";";
		mt="";
		scrof="";
		if(!is.ns6)scrof="overflow:hidden;";
		dmleft=0;
		if(menu[2])dmleft=menu[2];		
		if(is.ie55){
			ifBlnk="";
			if(location.protocol=="https:")ifBlnk="/blank.htm";
			mt="<IFRAME frameborder=0 id=if"+mnu+" src=\""+ifBlnk+"\" scroll=none style=\"visibility:hidden;height:20;position:absolute;width:"+(menu[3]+ns6w)+"px;left:"+dmleft+"px;top:"+menu[1]+"px;z-index:5\"></iframe>"
		}		
		mt+="<div tabindex=1 id="+mnu+" style=\""+scrof+";z-index:19;visibility:hidden;"+brd+"position:absolute;background:"+m18+sty[1]+";width:"+(menu[3]+ns6w)+"px;left:"+dmleft+"px;top:"+menu[1]+"px;\">";
	}
	d.write(mt);
	x=0;
	dlft=0;
	aleft=0;
	if(menu[3]&&menu[11]&&(is.ns6||is.opera))menu[3]=menu[3]-(sty[9]*2);
	for(b=ac;b<menu.length;b++){	    
		b=b+4;
		if(!menu[b-3])menu[b-3]="#";
		menu[b-3]=menu[b-3].replace(/\"/gi, "&quot;");
		if(menu[b-2])menu[b-2]=menu[b-2].replace(/\"/gi, "&quot;");		
		hl(menu[b-4], menu[b-3],sty,100,100,mnu,menu[b-2],menu[b-1],menu[b-5]);
		txt="";
		if(is.ns4){
			mt=d.layers[mnu].document.layers["el"+(el-1)];
			if(!menu[11]){
				if(menu[b]&&b<menu.length-1){
					x=atop+mt.clip.height;
					if(sbgc)bgc="bgcolor="+sbgc;
					x++;
					txt="<layer top="+(x-2)+" left="+menu[4]+" height="+menu[b]+" "+bgc+" width="+mt.clip.width+" onmouseover=\"clearTimeout(MT)\" ></layer>";
				}
			}else if(sbgc)
				txt="<layer bgcolor="+sbgc+" left="+(aleft+mt.clip.width)+" width="+menu[b]+" top="+x+" height="+(mt.clip.height+(menu[4]))+"></layer>";
		}else{
			mbw=menu[b];
			if(sty[19])bc=sty[19]; else	bc=sty[4];
			if(b+1==menu.length)mbw=0;
			if(mbw>0){
				if(!sbgc)sbgc=bc;
				if(!menu[11]){				   									
					if(IEDtD)dwid=menu[3]-menu[4];else dwid=(menu[3]-menu[4]*2);
					txt="<div style='text-align:left;'><div onmouseout=\"popdn();\" onmouseover=\"clearTimeout(MT)\" style=\"background:"+sbgc+";width:"+dwid
					+"px;position:absolute;clip:rect(0 100% "+mbw+"px 0);height:"+mbw+"px;\"></div></div>";					
				}
			}
		}
		d.write(txt);
		omnu=mnu;
		mt=""
	}
	oatop=-1;
	if (is.ns4)
		mt="</layer>";
	else
		mt+="</div>\n";
	d.write(mt)
	if(is.ns4){
		ml=gm(mnu);
		ml.clip.height += menu[4];
		ml3d=d.layers[mnu].document.layers[mnu+"3d"];
	}
	menu[21][1]=el;
}

function checs(e){
	stopchec=1;
	for(a=1;a<mlen;a++){
		menu=eval("menu"+a);
		if(menu[10]>0){
			stopchec=0;
			if(df!=0||osy!=sy){
				mi=gm("menu"+a);
				tm=gpos(mi);
				mit=tm[0];
				if(isNaN(menu[1]))menu[1]=0;
				df=parseInt(menu[1])-mit;
				if(sy+menu[10]>=menu[1])df=sy-mit+menu[10];
				nt=df/followspeed;
				of1=nt.toString();
				ofr=of1.split("\.");
				if(ofr[1]+" "=="undefined ")ofr[1]=0;
				ofrac=ofrac+parseInt(ofr[1]);
				if(is.mac&&parseInt(nt)==0)return;
				if(ofrac>10){
					ofrac=ofrac-10;
					if(df>=0)nt++;elsent--;
				}
				spos(mi,mit+nt);
				if(menu[14])nt=nt-menu[14];
				if(is.ie55)spos(gm("ifmenu"+a),mit+nt);
				if(menu[14])spos(gm("menubackmenu"+a),mit+nt-menu[14]);
			}else
				return;
			osy=sy;
		}
	}
	if(stopchec){
		osy=sy;
		return;
	}
	pu=setTimeout('checs()',followrate);
}

function setpos(){
	for(a=1;a<mlen;a++){
		menu=eval("menu"+a);
		if(menu[21][0]){
			gm=gm(menu[21][0]);
			if(is.ns4){
				ntp=gm.pageY;
				nlp=gm.pageX;
			}else{
				gp=gpos(gm);
				ntp=gp[0];
				nlp=gp[1];
			}
			mn=gm("menu"+a);
			mnp=gpos(mn);
			if(ntp==0)ntp=null;
			if(nlp==0)nlp=null;
			spos(mn,ntp,nlp,null,null);
			if(is.ie55){
				gmif=gm("ifmenu"+a);
				spos(gmif,ntp,nlp,null,null)
			}
		}
	}
}
function setWRect(){
	sy=self.pageYOffset;	
	sx=self.pageXOffset;
	if(is.opera){
		ww=window.innerWidth;
		wh=window.innerHeight;
	}else if(d.all){
		sy=d.body.scrollTop;
		sx=d.body.scrollLeft;
		if(!is.ie4&&!is.mac){
			if(sy==0)sy=d.documentElement.scrollTop;
			if(sx==0)sx=d.documentElement.scrollLeft;
		}
		if(d.compatMode=="CSS1Compat"){
			ww=document.documentElement.clientWidth;
			wh=document.documentElement.clientHeight;
		}else{
			ww=d.body.clientWidth;
			wh=d.body.clientHeight;
		}
	}else{
		if(is.ns4){
			ww=self.innerWidth-16;
			wh=self.innerHeight-17;
		}else{
			ww=d.body.offsetWidth;
			if(!ww)ww=self.innerWidth-15;
			ww--;
			wh=self.innerHeight;
		}
	}
	if(is.opera&&(owh!=wh||oww!=ww)){
		if(ML>1)location.reload();
		ML++;
		oww=ww;
		owh=wh;
	}
	if(sy!=osy)checs();
	if(!is.mac&&!is.opera&&ML<2)sis();
	setpos();
}
function mOL(){
	if(!is.ns61&&is.ns6) init_menu();
	ML=1;
	if(save_on_load)save_on_load();
	if(loadWait||is.opera){
		for(x=0;x<parr.length;x++){
			fb("menu"+parr[x]);
			popup(parr[x]);
		}
	}
	sis();
	setWRect();
	if(!is.opera)ML++;
}

function init_menu(){
	el=0;
	df=-1;
	for(x=0;x<parr.length;x++){
		if(!is.opera){
			fb("menu"+parr[x]);
			popup(parr[x]);
		}
	}
	if(is.ns4){
		d.captureEvents(Event.MOUSEMOVE);
		oww=self.innerWidth-16;
		owh=self.innerHeight-17;
		window.onresize=function(){
			if(ww!=oww||wh!=owh)window.history.go(0);
		}
	}
	d.onmousemove=gMXY;
	setWRect();
}
