function menu_create(sd,v,ts,th,oc,rl,sh,fl,ft,aux,l){
	var w="onmouseover";
	var ww=w;
	var e="onclick";
	if(oc){
		if(oc.indexOf("all")+1||(oc=="lev2"&&l>=2)){
			w=e;
			ts=0;
		}
		if(oc.indexOf("all")+1||oc=="main"){
			ww=e;
			th=0;
		}
	}
	if(!l){
		l=1;
		sd=document.getElementById("menu"+sd);
		if(window.menu_pure) sd=menu_pure(sd);
		sd[w]=function(e){
			try{menu_kille(e)}
			catch(e){}
		};
		if(oc!="all-always-open") document[ww]=menu_bo;
		if(oc=="main"){
			menu_ib+=sd.id;
			sd[e]=function(event){
				menu_ic=true;
				menu_oo(new Object(),menu_la,1);
				menu_kille(event)
			};
		}
		sd.style.zoom=1;
		if(sh) x2("menush",sd,1);
		if(!v) sd.ch=1;
	    } else if(sh) sd.ch=1;
	if(oc) sd.oc=oc;
	if(sh) sd.sh=1;
	if(fl) sd.fl=1;
	if(ft) sd.ft=1;
	if(rl) sd.rl=1;
	sd.th=th;
	sd.style.zIndex=l+""+1;
	var lsp;
	var sp=sd.childNodes;
	for(var i=0;i<sp.length;i++){
		var b=sp[i];
		if(b.tagName=="A"){
			lsp=b;
			b[w]=menu_oo;
			if(w==e) b.onmouseover=function(event){
				clearTimeout(menu_tt);
				menu_tt=null;
				menu_la=null;
				menu_kille(event);
			};
			b.menuts=ts;
			if(l==1&&v){
				b.style.styleFloat="none";
				b.style.cssFloat="none";
			}
		    } else if(b.tagName=="DIV"){
		    	if(window.showHelp&&!window.XMLHttpRequest) sp[i].insertAdjacentHTML("afterBegin","<span class='menuclear'> </span>");
		    	x2("menuparent",lsp,1);
		    	lsp.cdiv=b;
		    	b.idiv=lsp;
		    	if(menu_n&&menu_v<8&&!b.style.width) b.style.width=b.offsetWidth+"px";
		    	new menu_create(b,null,ts,th,oc,rl,sh,fl,ft,aux,l+1);
		}
	}
}

function menu_bo(e){
	e=e||event;
	if(e.type=="click") menu_ic=false;
	menu_la=null;
	clearTimeout(menu_tt);
	menu_tt=null;
	var i;
	for(i in menu_li){
		if(menu_li[i]&&!((menu_ib.indexOf(i)+1)&&e.type=="mouseover")) menu_tt=setTimeout("x0('"+i+"')",menu_li[i].th);
	}
}

function menu_co(t){
	var f;
	for(f in menu_li){
		if(f!=t&&menu_li[f]) x0(f);
	}
}

function x0(id){
	var i;
	var a;
	var a;
	if((a=menu_li[id])&&menu_li[id].oc!="all-always-open"){
		do{
			menu_uo(a);
		} while((a=a[qp])&&!menu_a(a))
		menu_li[id]=null;
	}
}

function menu_a(a){
	if(a[qc].indexOf("menumc")+1) return 1;
}

function menu_uo(a,go){
	if(!go&&a.menutree) return;
	if(window.menuad&&menuad.bhide) eval(menuad.bhide);
	a.style.visibility="";
	x2("menuactive",a.idiv);
}

function menu_oo(e,o,nt){
	try{
		if(!o) o=this;
		if(menu_la==o&&!nt) return;
		if(window.menuv_a&&!nt)
		menuv_a(o);
		if(window.menuwait){
			menu_kille(e);
			return;
		}
		clearTimeout(menu_tt);
		menu_tt=null;
		menu_la=o;
		if(!nt&&o.menuts){
			menu_si=o;
			menu_tt=setTimeout("menu_oo(new Object(),menu_si,1)",o.menuts);
			return;
		}
		var a=o;
		if(a[qp].isrun){
			menu_kille(e);
			return;
		}
		while((a=a[qp])&&!menu_a(a)){}
		var d=a.id;
		a=o;
		menu_co(d);
		if(menu_ib.indexOf(d)+1&&!menu_ic) return;
		var go=true;
		while((a=a[qp])&&!menu_a(a)){
			if(a==menu_li[d]) go=false;
		}
		if(menu_li[d]&&go){
			a=o;
			if((!a.cdiv)||(a.cdiv&&a.cdiv!=menu_li[d])) menu_uo(menu_li[d]);
			a=menu_li[d];
			while((a=a[qp])&&!menu_a(a)){
				if(a!=o[qp]&&a!=o.cdiv) menu_uo(a); else break;
			}
		}
		var b=o;
		var c=o.cdiv;
		if(b.cdiv){
			var aw=b.offsetWidth;
			var ah=b.offsetHeight;
			var ax=b.offsetLeft;
			var ay=b.offsetTop;
			if(c[qp].ch){
				aw=0;
				if(c.fl) ax=0;
			    }else {
			    	if(c.ft) ay=0;
			    	if(c.rl){
			    		ax=ax-c.offsetWidth;
			    		aw=0;
			    	}
			    	ah=0;
			}
			if(menu_o){
				ax-=b[qp].clientLeft;
				ay-=b[qp].clientTop;
			}
			if(menu_s2&&!menu_s3){
				ax-=menu_gcs(b[qp],"border-left-width","borderLeftWidth");
				ay-=menu_gcs(b[qp],"border-top-width","borderTopWidth");
			}
			if(!c.ismove){
				c.style.left=(ax+aw)+"px";
				c.style.top=(ay+ah)+"px";
			}
			x2("menuactive",o,1);
			if(window.menuad&&menuad.bvis )eval(menuad.bvis);
			if(menu_ie8) c.style.visibility="visible"; else c.style.visibility="inherit";
			menu_li[d]=c;
		    } else if(!menu_a(b[qp])) menu_li[d]=b[qp]; else menu_li[d]=null;
		menu_kille(e);
	}
	catch(e){};
}

function menu_gcs(obj,sname,jname){
	var v;
	if(document.defaultView&&document.defaultView.getComputedStyle) v=document.defaultView.getComputedStyle(obj,null).getPropertyValue(sname); else if(obj.currentStyle) v=obj.currentStyle[jname];
	if(v&&!isNaN(v=parseInt(v))) return v; else return 0;
}

function x2(name,b,add){
	var a=b[qc];
	if(add){
		if(a.indexOf(name)==-1) b[qc]+=(a?' ':'')+name;
	    } else {
	    	b[qc]=a.replace(" "+name,"");
	    	b[qc]=b[qc].replace(name,"");
	}
}

function menu_kille(e){
	if(!e) e=event;
	e.cancelBubble=true;
	if(e.stopPropagation&&!(menu_s&&e.type=="click")) e.stopPropagation();
}

function qa(a,b){
	return String.fromCharCode(a.charCodeAt(0)-(b-(parseInt(b/2)*2)));
}

function menu_pure(sd){
	if(sd.tagName=="UL"){
		var nd=document.createElement("DIV");
		nd.menupure=1;
		var c;
		if(c=sd.style.cssText) nd.style.cssText=c;
		menu_convert(sd,nd);
		var csp=document.createElement("SPAN");
		csp.className="menuclear";
		csp.innerHTML=" ";
		nd.appendChild(csp);
		sd=sd[qp].replaceChild(nd,sd);
		sd=nd;
	}
	return sd;
}

function menu_convert(a,bm,l){
	if(!l) bm[qc]=a[qc];
	bm.id=a.id;
	var ch=a.childNodes;
	for(var i=0;i<ch.length;i++){
		if(ch[i].tagName=="LI"){
			var sh=ch[i].childNodes;
			for(var j=0;j<sh.length;j++){
				if(sh[j]&&(sh[j].tagName=="A"||sh[j].tagName=="SPAN")) bm.appendChild(ch[i].removeChild(sh[j]));
				if(sh[j]&&sh[j].tagName=="UL"){
					var na=document.createElement("DIV");
					var c;
					if(c=sh[j].style.cssText) na.style.cssText=c;
					if(c=sh[j].className) na.className=c;
					na=bm.appendChild(na);
					new menu_convert(sh[j],na,1)
				}
			}
		}
	}
}

function menu_slide_a(a,hide){
	var z;
	if((a.style.visibility=="inherit"&&!hide)||(menuad.slide_off)||((z=window.menuv)&&(z=z.addons)&&(z=z.slide_effect)&&!z["on"+menu_index(a)])) return;
	var ss;
	if(!a.settingsid){
		var v=a;
		while((v=v.parentNode)){
			if(v.className.indexOf("menumc")+1){
				a.settingsid=v.id;
				break;
			}
		}
	}
	ss=menuad[a.settingsid];
	if(!ss) return;
	if(!ss.slide_animation_frames) return;
	var steps=ss.slide_animation_frames;
	var b=new Object();
	b.obj=a;
	b.offy=ss.slide_offxy;
	b.left_right=ss.slide_left_right;
	b.sub_subs_left_right=ss.slide_sub_subs_left_right;
	b.drop_subs=ss.slide_drop_subs;
	if(!b.offy) b.offy=0;
	if(b.sub_subs_left_right&&a.parentNode.className.indexOf("menumc")==-1) b.left_right=true;
	if(b.left_right) b.drop_subs=false;
	b.drop_subs_height=ss.slide_drop_subs_height;
	b.drop_subs_disappear=ss.slide_drop_subs_disappear;
	b.accelerator=ss.slide_accelerator;
	if(b.drop_subs&&!b.accelerator) b.accelerator=1;
	if(!b.accelerator) b.accelerator=0;
	b.tb="top";
	b.wh="Height";
	if(b.left_right){
		b.tb="left";
		b.wh="Width";
	}
	b.stepy=a["offset"+b.wh]/steps;
	b.top=parseInt(a.style[b.tb]);
	if(!hide)
		a.style[b.tb]=(b.top - a["offset"+b.wh])+"px";
	    else {
	    	b.stepy=-b.stepy;
	    	x2("menufv",a,1);
	}
	a.isrun=true;
	menu_slide_ai(menu_slide_am(b,hide),hide);
}

function menu_slide_ai(id,hide){
	var a=menuad.slide["_"+id];
	if(!a) return;
	var cy=parseInt(a.obj.style[a.tb]);
	if(a.drop_subs)
		a.stepy+=a.accelerator;
	    else {
	    	if(hide) a.stepy -=a.accelerator; else a.stepy+=a.accelerator;
	}
	if((!hide&&cy+a.stepy<a.top)||(hide&&!a.drop_subs&&cy+a.stepy>a.top-a.obj["offset"+a.wh])||(hide&&a.drop_subs&&cy<a.drop_subs_height)){
		var bc=2000;
		if(hide&&a.drop_subs&&!a.drop_subs_disappear&&cy+a.stepy+a.obj["offset"+a.wh]>a.drop_subs_height) bc=a.drop_subs_height-cy+a.stepy;
		var tc=Math.round(a.top-(cy+a.stepy)+a.offy);
		if(a.left_right) a.obj.style.clip="rect(auto 2000px 2000px "+tc+"px)"; else a.obj.style.clip="rect("+tc+"px 2000px "+bc+"px auto)";
		a.obj.style[a.tb]=Math.round(cy+a.stepy)+"px";
		a.timer=setTimeout("menu_slide_ai("+id+","+hide+")",10);
	    } else {
	    	a.obj.style[a.tb]=a.top+"px";
		a.obj.style.clip="rect(0 auto auto auto)";
		if(a.obj.style.removeAttribute) a.obj.style.removeAttribute("clip"); else a.obj.style.clip="auto";
		if(!window.showHelp) a.obj.style.clip="";
		if(hide){
			x2("menufv",a.obj);
			if(menuad.br_ie&&!a.obj.style.visibility){
				a.obj.style.visibility="hidden";
				a.obj.style.visibility="";
			}
		    } else {
			var ah;
			if(ah=a.obj.hasselectfix){
				ah.style.top=a.obj.style.top;
				ah.style.left=a.obj.style.left;
			}
		}
		menuad.slide["_"+id]=null;
		a.obj.isrun=false;
	}
}

function menu_slide_am(obj,hide){
	var k;
	for(k in menuad.slide){
		if(menuad.slide[k]&&obj.obj==menuad.slide[k].obj){
			if(menuad.slide[k].timer){
				clearTimeout(menuad.slide[k].timer);
				menuad.slide[k].timer=null;
			}
			obj.top=menuad.slide[k].top;
			menuad.slide[k].obj.isrun=false;
			menuad.slide[k]=null;
		}
	}
	var i=0;
	while(menuad.slide["_"+i]) i++;
	menuad.slide["_"+i]=obj;
	return i;
}

function menu_over_select(a,hide){
	var z;
	if((z=window.menuv)&&(z=z.addons)&&(z=z.over_select)&&!z["on"+menu_index(a)]) return;
	if(!a.settingsid){
		var v=a;
		while(!menu_a(v)) v=v[qp];
		a.settingsid=v.id;
	}
	var ss=menuad[a.settingsid];
	if(!ss) return;
	if(!ss.overselects_active) return;
	if(!hide&&!a.hasselectfix){
		var f=document.createElement("IFRAME");
		f.style.position="absolute";
		f.style.filter="alpha(opacity=0)";
		f.src="javascript:false;";
		f=a.parentNode.appendChild(f);
		f.frameborder=0;
		a.hasselectfix=f;
	}
	var b=a.hasselectfix;
	if(b){
		if(hide)
			b.style.display="none";
		    else {
		 	var oxy=0;
		 	if(a.hasshadow&&a.hasshadow.style.visibility=="inherit") oxy=parseInt(ss.shadow_offset);
		 	if(!oxy) oxy=0;
		 	b.style.width=a.offsetWidth+oxy;
		 	b.style.height=a.offsetHeight+oxy;
		 	b.style.top=a.style.top;
		 	b.style.left=a.style.left;
		 	b.style.margin=a.currentStyle.margin;
		 	b.style.display="block";
		}
	}
}

menuad=new Object();
menuad.bvis="";
menuad.bhide="";

var a = menuad.menu0 = new Object();
a.slide_animation_frames = 15;
a.overselects_active = true;

var menu_si,menu_lo,menu_tt,menu_ts,menu_la,menu_ic,menu_ff;
var menu_li=new Object();
var menu_ib='';
var qp="parentNode";
var qc="className";
var menu_t=navigator.userAgent;
var menu_o=menu_t.indexOf("Opera")+1;
var menu_s=menu_t.indexOf("afari")+1;var menu_s2=menu_s&&menu_t.indexOf("ersion/2")+1;
var menu_s3=menu_s&&menu_t.indexOf("ersion/3")+1;
var menu_n=menu_t.indexOf("Netscape")+1;
var menu_v=parseFloat(navigator.vendorSub);
var menu_ie8=menu_t.indexOf("MSIE 8.")+1;

menuad.slide=new Object();
if(menuad.bvis.indexOf("menu_slide_a(b.cdiv);")==-1) menuad.bvis+="menu_slide_a(b.cdiv);";
if(menuad.bhide.indexOf("menu_slide_a(a,1);")==-1) menuad.bhide+="menu_slide_a(a,1);";
menuad.br_navigator=navigator.userAgent.indexOf("Netscape")+1;
menuad.br_version=parseFloat(navigator.vendorSub);
menuad.br_oldnav=menuad.br_navigator&&menuad.br_version<7.1;
menuad.br_ie=window.showHelp;
menuad.br_mac=navigator.userAgent.indexOf("Mac")+1;
menuad.br_old_safari=navigator.userAgent.indexOf("afari")+1&&!window.XMLHttpRequest;
menuad.slide_off=menuad.br_oldnav||(menuad.br_mac&&menuad.br_ie)||menuad.br_old_safari;
if(window.showHelp&&!window.XMLHttpRequest){
	if(menuad.bvis.indexOf("menu_over_select(b.cdiv);")==-1){
		menuad.bvis+="menu_over_select(b.cdiv);";
		menuad.bhide+="menu_over_select(a,1);";
	}
}

menu_create(0,false,200,200,false,false,false,false,false);
