//eval(function(p, a, c, k, e, r) { e = function(c) { return (c < a ? '' : e(parseInt(c / a))) + ((c = c % a) > 35 ? String.fromCharCode(c + 29) : c.toString(36)) }; if (!''.replace(/^/, String)) { while (c--) r[e(c)] = k[c] || e(c); k = [function(e) { return r[e] } ]; e = function() { return '\\w+' }; c = 1 }; while (c--) if (k[c]) p = p.replace(new RegExp('\\b' + e(c) + '\\b', 'g'), k[c]); return p } ('5(1E W=="2l")7 W=L 7 8={X:C,Y:{2m:["2n/2o-3f.2p",0,0],1F:["2n/2o-3g.2p",0,0],1G:{2q:C,2r:C}},2s:2t,t:{Z:C,17:C,1H:2t},2u:"2v.3h",1j:[],O:{},D:{},3i:{},19:-1,11:-1,1a:{},1I:L,2w:!/3j[\\/\\s](\\d+\\.\\d+)/.1J(3k.3l),1k:b(1b,1l){H(1b.2x)?1b[1l]+3.1k(1b.2x,1l):1b[1l]},1K:b(l){l.E={F:3.1k(l,"3m"),q:3.1k(l,"2y")}},1L:b(){3.2z=k.2A?k.2A-10:3.12.3n-10 3.1M=k.2B?k.2B-15:3.12.3o-18},2C:b(){1m(7 m=0;m<3.1j.1c;m++){7 1N=3.1j[m]1m(7 i=0;i<3.O[1N].1c;i++){7 9=3.O[1N][i]7 4=j.1O(9.1P(\'1Q\'))9.g={w:9.1d,h:9.1n,1e:4.1d,13:4.1n}}}},P:b(m,e){7 e=k.2D||e 7 c=e.3p||((e.3q=="2E")?e.3r:e.3s)3t(c&&c!=m)1R{c=c.2F}1S(e){c=m}5(c==m)H C z H L},1T:b(n,1U,1f,2G){7 M=j.1V("3u")M.2H=1f[0]M.6.I=1f[1]+"u"M.6.J=1f[2]+"u"5(1U=="1W"){M.6.F=n.1d-1f[2]-2+"u"}M.Q=1U 7 1o=n.3v[n.2I.3w!=1?1:0]5(1o&&1o.3x=="3y"){n=1o}5(2G=="1X")n.3z(M,n.2I)z n.1Y(M)},1Z:b(l,20,1p){7 1q=21 3A("(^|\\\\s+)"+20+"($|\\\\s+)","3B")5(1p=="3C")H 1q.1J(l.Q)z 5(1p=="2J")l.Q=l.Q.3D(1q,"")z 5(1p=="2K"&&!1q.1J(l.Q))l.Q+=" "+20},22:b(n){7 R=(!k.3E)?j.1V("3F"):j.1V("3G")R.Q="3H"R.2L("2H",3I.3J=="3K:"?3.2u:"3L:2v")R.2L("3M","0")n.1Y(R)1R{R.6.23=\'2M:2N.2O.3N(6=0,1r=0)\'}1S(e){}H R},24:b(9,4,f,S,A){5(9.r){7 A=k.1s?k.1s:3.12.2P 7 25=9.E.q-A 7 26=A+3.1M-9.E.q-9.g.h 5(25>0){3.o.T.6.F=S+"u"3.o.T.6.q=A+"u"3.o.T.6.I="2Q%"3.o.T.6.J=25+"u"}5(26>0){3.o.U.6.F=S+"u"3.o.U.6.q=9.E.q+9.g.h+"u"3.o.U.6.I="2Q%"3.o.U.6.J=26+"u"}}},27:b(){3.o.T.6.I=3.o.U.6.I=0 3.o.T.6.J=3.o.U.6.J=0},28:b(p,9,4,29,2a,f){9.G=p 9.B=29 9.r=2a 5(2a){3.N(9,b(e){8.14(8.D[3.G][1g(3.B)])},"2R")}3.D[p][29]=4 9.g={w:9.1d,h:9.1n,1e:4.1d,13:4.1n}3.1K(9)4.6.F=0 4.6.q=0 4.6.1t="2b"3.N(9,b(e){5(!8.P(3,e)){7 4=8.D[3.G][1g(3.B)]5(3.r){8.1Z(3,"2S","2K")2T(8.1a[3.G][3.B])}8.1K(9)7 S=k.2U?k.2U:8.12.3O 7 A=k.1s?k.1s:8.12.2P 7 2V=3.E.F+3.g.1e+(3.r&&f=="V"?0:3.g.w)7 2W=3.E.q+3.g.13 7 2c=(3.r?3.E.F+(f=="16"?3.g.w:0):3.g.w)5(2V-S>8.2z){2c+=-3.g.1e+(3.r&&f=="V"?3.g.w:-3.g.w)}4.6.F=2c+"u"7 1u=(3.r?3.E.q+(f=="16"?0:3.g.h):3.2y)5(2W-A>8.1M){5(3.g.13<3.E.q+(f=="16"?3.g.h:0)-A){1u+=-3.g.13+(3.r&&f=="V"?-3.g.h:3.g.h)}z{1u+=-(3.E.q-A)+(3.r&&f=="V"?-3.g.h:0)}}4.6.q=1u+"u"5(8.X&&(8.t.Z==L||8.2w)){8.24(9,4,f,S,A)}z{4.1v={x:S,y:A}}8.2X(9,4,f)}},"2E")3.N(9,b(e){7 4=8.D[3.G][1g(3.B)]5(3.r){5(!8.P(3,e)&&!8.P(4,e))8.14(4)}z 5(!3.r&&!8.P(3,e)){8.14(4)}},"2Y")},1w:b(l,1x){l.6.1r=1x 5(1E l.6.1r!="3P"){l.6.3Q=1x 5(l.3R){l.6.23="2M:2N.2O.3S(1r="+1x*3T+")"}}},2X:b(9,4,f){5(3.t.Z||3.t.17){5(3.t.Z){7 1y=(9.r&&f=="V")?9.g.13:9.g.1e 4.6.I=4.6.J=0 4.6.2Z="2b"}5(3.t.17){3.1w(4,0)}4.1h=0 4.6.1t="2d"2e(4.1z)4.30=21 31().32()4.1z=3U(b(){8.33(9,4,1y,f)},10)}z{4.6.1t="2d"}},33:b(9,4,1y,f){7 2f=21 31().32()-4.30 5(2f<3.t.1H){5(3.t.Z){5(4.1h==0){4.6[9.r&&f=="V"?"I":"J"]="2g"}4.6[9.r&&f=="V"?"J":"I"]=(4.1h*1y)+"u"}5(3.t.17){3.1w(4,4.1h)}}z{2e(4.1z)5(3.t.Z){4.6.I="2g"4.6.J="2g"4.6.2Z="2d"}5(3.t.17){3.1w(4,1)4.6.23=""}5(3.X&&4.1v)3.24(9,4,f,4.1v.x,4.1v.y)}4.1h=(1-34.3V((2f/3.t.1H)*34.3W))/2},14:b(4){5(1E 4.B!="2l"){3.1Z(3.O[4.G][1g(4.B)],"2S","2J")5(3.X)3.27()}2e(4.1z)4.6.F=0 4.6.q="-3X"4.6.1t="2b"},N:b(n,K,2h){5(n.1A)n.1A(2h,K,L);z 5(n.1B)n.1B(\'3Y\'+2h,b(){H K.3Z(n,k.2D)})},35:b(K){5(W){K()H}5(j.1A){j.1A("36",b(){j.40("36",37.38,L)K();W=C},L)}z 5(j.1B){5(j.2i.39&&k==k.q)(b(){5(W){K()H}1R{j.2i.39("F")}1S(41){3a(37.38,0)H}K();W=C})()}5(j.1B&&42.1c>0)3.N(k,b(){K()},"43")},3b:b(p,f){3.12=(j.44=="45")?j.2i:j.1C 3.19=-1 3.11=-1 3.1j.46(p)3.O[p]=[]3.D[p]=[]3.1a[p]=[]5(3.X&&!3.1I){3.o={}3.o.T=3.22(j.1C)3.o.U=3.22(j.1C)3.1I=C}7 3c=j.1O(p)7 1D=3c.2j("a")3.1L()1m(7 i=0;i<1D.1c;i++){5(1D[i].1P(\'1Q\')){3.19++3.11++7 1i=1D[i]3.O[p][3.19]=1i 7 v=j.1O(1i.1P(\'1Q\'))j.1C.1Y(v)v.6.47=48 v.G=p v.B=3.19 3.N(v,b(){8.14(3)},"2R")7 3d=(f=="16")?"1W":"49"7 3e=(f=="16")?3.Y.1F:3.Y.2m 5(3.Y.1G.2q)3.1T(1i,3d,3e,(f=="16")?"1X":"4a")3.28(p,1i,v,3.11,C,f)v.4b=b(){2T(8.1a[3.G][3.B])}3.N(v,b(e){5(!8.P(3,e)&&!8.P(8.O[3.G][1g(3.B)],e)){7 v=3 5(8.X)8.27()8.1a[3.G][3.B]=3a(b(){8.14(v)},8.2s)}},"2Y")7 D=v.2j("4c")1m(7 c=0;c<D.1c;c++){3.11++7 2k=D[c].2F 5(3.Y.1G.2r)3.1T(2k.2j("a")[0],"1W",3.Y.1F,"1X")3.28(p,2k,D[c],3.11,L,f)}}}3.N(k,b(){8.1L();8.2C()},"4d")},4e:b(p,f){3.35(b(){8.3b(p,f)})}}', 62, 263, '|||this|submenu|if|style|var|ddlevelsmenu|header||function||||dir|_dimensions|||document|window|el||target|shimmy|mainmenuid|top|_istoplevel||effects|px|dropul||||else|scrollY|_pos|true|subuls|_offsets|left|_master|return|width|height|functionref|false|pointer|addEvent|topitems|isContained|className|shim|scrollX|topshim|bottomshim|topbar|dd_domreadycheck|enableshim|arrowpointers|enableswipe||ulindex|standardbody|submenuh|hidemenu||sidebar|enablefade||topitemsindex|hidetimers|what|length|offsetWidth|submenuw|imginfo|parseInt|_curanimatedegree|menuitem|topmenuids|getoffset|offsettype|for|offsetHeight|target_firstEl|action|needle|opacity|pageYOffset|visibility|menutop|FFscrollInfo|setopacity|value|endpoint|_animatetimer|addEventListener|attachEvent|body|alllinks|typeof|rightarrow|showarrow|duration|shimadded|test|getoffsetof|getwindowsize|docheight|topmenuid|getElementById|getAttribute|rel|try|catch|addpointer|imgclass|createElement|rightarrowpointer|before|appendChild|css|targetclass|new|addshimmy|filter|positionshim|topgap|bottomgap|hideshim|buildmenu|submenupos|istoplevel|hidden|menuleft|visible|clearInterval|elapsed|auto|tasktype|documentElement|getElementsByTagName|parentli|undefined|downarrow|ddlevelsfiles|arrow|gif|toplevel|sublevel|hideinterval|200|httpsiframesrc|blank|nonFF|offsetParent|offsetTop|docwidth|innerWidth|innerHeight|gettopitemsdimensions|event|mouseover|parentNode|BeforeorAfter|src|firstChild|remove|add|setAttribute|progid|DXImageTransform|Microsoft|scrollTop|99|click|selected|clearTimeout|pageXOffset|submenurightedge|submenubottomedge|showmenu|mouseout|overflow|_starttime|Date|getTime|revealmenu|Math|domready|DOMContentLoaded|arguments|callee|doScroll|setTimeout|init|menubar|arrowclass|arrowpointer|down|right|htm|lastactivesubul|Firefox|navigator|userAgent|offsetLeft|clientWidth|clientHeight|relatedTarget|type|fromElement|toElement|while|img|childNodes|nodeType|tagName|SPAN|insertBefore|RegExp|ig|check|replace|opera|iframe|div|ddiframeshim|location|protocol|https|about|frameborder|Alpha|scrollLeft|string|MozOpacity|filters|alpha|100|setInterval|cos|PI|1000px|on|call|removeEventListener|error|parent|load|compatMode|CSS1Compat|push|zIndex|2000|downarrowpointer|after|onmouseover|ul|resize|setup'.split('|'), 0, {}))

//** All Levels Navigational Menu- (c) Dynamic Drive DHTML code library: http://www.dynamicdrive.com
//** Script Download/ instructions page: http://www.dynamicdrive.com/dynamicindex1/ddlevelsmenu/
//** Usage Terms: http://www.dynamicdrive.com/notice.htm

//** Current version: 2.2 See changelog.txt for details

if (typeof dd_domreadycheck=="undefined") //global variable to detect if DOM is ready
	var dd_domreadycheck=false

var ddlevelsmenu={

enableshim: true, //enable IFRAME shim to prevent drop down menus from being hidden below SELECT or FLASH elements? (tip: disable if not in use, for efficiency)

arrowpointers:{
	downarrow: ["ddlevelsfiles/arrow-down.gif", 0,0], //[path_to_down_arrow, arrowwidth, arrowheight]
	rightarrow: ["ddlevelsfiles/arrow-right.gif", 0,0], //[path_to_right_arrow, arrowwidth, arrowheight]
	showarrow: {toplevel: true, sublevel: true} //Show arrow images on top level items and sub level items, respectively?
},
hideinterval: 200, //delay in milliseconds before entire menu disappears onmouseout.
effects: {enableswipe: true, enablefade: true, duration: 200},
httpsiframesrc: "blank.htm", //If menu is run on a secure (https) page, the IFRAME shim feature used by the script should point to an *blank* page *within* the secure area to prevent an IE security prompt. Specify full URL to that page on your server (leave as is if not applicable).

///No need to edit beyond here////////////////////

topmenuids: [], //array containing ids of all the primary menus on the page
topitems: {}, //object array containing all top menu item links
subuls: {}, //object array containing all ULs
lastactivesubul: {}, //object object containing info for last mouse out menu item's UL
topitemsindex: -1,
ulindex: -1,
hidetimers: {}, //object array timer
shimadded: false,
nonFF: !/Firefox[\/\s](\d+\.\d+)/.test(navigator.userAgent), //detect non FF browsers
getoffset:function(what, offsettype){
	return (what.offsetParent)? what[offsettype]+this.getoffset(what.offsetParent, offsettype) : what[offsettype]
},

getoffsetof:function(el){
	el._offsets={left:this.getoffset(el, "offsetLeft"), top:this.getoffset(el, "offsetTop")}
},

getwindowsize:function(){
	this.docwidth=window.innerWidth? window.innerWidth-10 : this.standardbody.clientWidth-10
	this.docheight=window.innerHeight? window.innerHeight-15 : this.standardbody.clientHeight-18
},

gettopitemsdimensions:function(){
	for (var m=0; m<this.topmenuids.length; m++){
		var topmenuid=this.topmenuids[m]
		for (var i=0; i<this.topitems[topmenuid].length; i++){
			var header=this.topitems[topmenuid][i]
			var submenu=document.getElementById(header.getAttribute('rel'))
			header._dimensions={w:header.offsetWidth, h:header.offsetHeight, submenuw:submenu.offsetWidth, submenuh:submenu.offsetHeight}
		}
	}
},

isContained:function(m, e){
	var e=window.event || e
	var c=e.relatedTarget || ((e.type=="mouseover")? e.fromElement : e.toElement)
	while (c && c!=m)try {c=c.parentNode} catch(e){c=m}
	if (c==m)
		return true
	else
		return false
},

addpointer:function(target, imgclass, imginfo, BeforeorAfter){
	var pointer=document.createElement("img")
	pointer.src=imginfo[0]
	pointer.style.width=imginfo[1]+"px"
	pointer.style.height=imginfo[2]+"px"
	if(imgclass=="rightarrowpointer"){
		pointer.style.left=target.offsetWidth-imginfo[2]-2+"px"
	}
	pointer.className=imgclass
	var target_firstEl=target.childNodes[target.firstChild.nodeType!=1? 1 : 0] //see if the first child element within A is a SPAN (found in sliding doors technique)
	if (target_firstEl && target_firstEl.tagName=="SPAN"){
		target=target_firstEl //arrow should be added inside this SPAN instead if found
	}
	if (BeforeorAfter=="before")
		target.insertBefore(pointer, target.firstChild)
	else
		target.appendChild(pointer)
},

css:function(el, targetclass, action){
	var needle=new RegExp("(^|\\s+)"+targetclass+"($|\\s+)", "ig")
	if (action=="check")
		return needle.test(el.className)
	else if (action=="remove")
		el.className=el.className.replace(needle, "")
	else if (action=="add" && !needle.test(el.className))
		el.className+=" "+targetclass
},

addshimmy:function(target){
	var shim=(!window.opera)? document.createElement("iframe") : document.createElement("div") //Opera 9.24 doesnt seem to support transparent IFRAMEs
	shim.className="ddiframeshim"
	shim.setAttribute("src", location.protocol=="https:"? this.httpsiframesrc : "about:blank")
	shim.setAttribute("frameborder", "0")
	target.appendChild(shim)
	try{
		shim.style.filter='progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)'
	}
	catch(e){}
	return shim
},

positionshim:function(header, submenu, dir, scrollX, scrollY){
	if (header._istoplevel){
		var scrollY=window.pageYOffset? window.pageYOffset : this.standardbody.scrollTop
		var topgap=header._offsets.top-scrollY
		var bottomgap=scrollY+this.docheight-header._offsets.top-header._dimensions.h
		if (topgap>0){
			this.shimmy.topshim.style.left=scrollX+"px"
			this.shimmy.topshim.style.top=scrollY+"px"
			this.shimmy.topshim.style.width="99%"
			this.shimmy.topshim.style.height=topgap+"px" //distance from top window edge to top of menu item
		}
		if (bottomgap>0){
			this.shimmy.bottomshim.style.left=scrollX+"px"
			this.shimmy.bottomshim.style.top=header._offsets.top + header._dimensions.h +"px"
			this.shimmy.bottomshim.style.width="99%"
			this.shimmy.bottomshim.style.height=bottomgap+"px" //distance from bottom of menu item to bottom window edge
		}
	}
},

hideshim:function(){
	this.shimmy.topshim.style.width=this.shimmy.bottomshim.style.width=0
	this.shimmy.topshim.style.height=this.shimmy.bottomshim.style.height=0
},


buildmenu:function(mainmenuid, header, submenu, submenupos, istoplevel, dir){
	header._master=mainmenuid //Indicate which top menu this header is associated with
	header._pos=submenupos //Indicate pos of sub menu this header is associated with
	header._istoplevel=istoplevel
	if (istoplevel){
		this.addEvent(header, function(e){
		ddlevelsmenu.hidemenu(ddlevelsmenu.subuls[this._master][parseInt(this._pos)])
		}, "click")
	}
	this.subuls[mainmenuid][submenupos]=submenu
	header._dimensions={w:header.offsetWidth, h:header.offsetHeight, submenuw:submenu.offsetWidth, submenuh:submenu.offsetHeight}
	this.getoffsetof(header)
	submenu.style.left=0
	submenu.style.top=0
	submenu.style.visibility="hidden"
	this.addEvent(header, function(e){ //mouseover event
		if (!ddlevelsmenu.isContained(this, e)){
			var submenu=ddlevelsmenu.subuls[this._master][parseInt(this._pos)]
			if (this._istoplevel){
				ddlevelsmenu.css(this, "selected", "add")
			clearTimeout(ddlevelsmenu.hidetimers[this._master][this._pos])
			}
			ddlevelsmenu.getoffsetof(header)
			var scrollX=window.pageXOffset? window.pageXOffset : ddlevelsmenu.standardbody.scrollLeft
			var scrollY=window.pageYOffset? window.pageYOffset : ddlevelsmenu.standardbody.scrollTop
			var submenurightedge=this._offsets.left + this._dimensions.submenuw + (this._istoplevel && dir=="topbar"? 0 : this._dimensions.w)
			var submenubottomedge=this._offsets.top + this._dimensions.submenuh
			//Sub menu starting left position
			var menuleft=(this._istoplevel? this._offsets.left + (dir=="sidebar"? this._dimensions.w : 0) : this._dimensions.w)
			if (submenurightedge-scrollX>ddlevelsmenu.docwidth){
				menuleft+= -this._dimensions.submenuw + (this._istoplevel && dir=="topbar" ? this._dimensions.w : -this._dimensions.w)
			}
			submenu.style.left=menuleft+"px"
			//Sub menu starting top position
			var menutop=(this._istoplevel? this._offsets.top + (dir=="sidebar"? 0 : this._dimensions.h) : this.offsetTop)
			if (submenubottomedge-scrollY>ddlevelsmenu.docheight){ //no room downwards?
				if (this._dimensions.submenuh<this._offsets.top+(dir=="sidebar"? this._dimensions.h : 0)-scrollY){ //move up?
					menutop+= - this._dimensions.submenuh + (this._istoplevel && dir=="topbar"? -this._dimensions.h : this._dimensions.h)
				}
				else{ //top of window edge
					menutop+= -(this._offsets.top-scrollY) + (this._istoplevel && dir=="topbar"? -this._dimensions.h : 0)
				}
			}
			submenu.style.top=menutop+"px"
			if (ddlevelsmenu.enableshim && (ddlevelsmenu.effects.enableswipe==false || ddlevelsmenu.nonFF)){ //apply shim immediately only if animation is turned off, or if on, in non FF2.x browsers
				ddlevelsmenu.positionshim(header, submenu, dir, scrollX, scrollY)
			}
			else{
				submenu.FFscrollInfo={x:scrollX, y:scrollY}
			}
			ddlevelsmenu.showmenu(header, submenu, dir)
		}
	}, "mouseover")
	this.addEvent(header, function(e){ //mouseout event
		var submenu=ddlevelsmenu.subuls[this._master][parseInt(this._pos)]
		if (this._istoplevel){
			if (!ddlevelsmenu.isContained(this, e) && !ddlevelsmenu.isContained(submenu, e)) //hide drop down ul if mouse moves out of menu bar item but not into drop down ul itself
				ddlevelsmenu.hidemenu(submenu)
		}
		else if (!this._istoplevel && !ddlevelsmenu.isContained(this, e)){
			ddlevelsmenu.hidemenu(submenu)
		}

	}, "mouseout")
},

setopacity:function(el, value){
	el.style.opacity=value
	if (typeof el.style.opacity!="string"){ //if it's not a string (ie: number instead), it means property not supported
		el.style.MozOpacity=value
		if (el.filters){
			el.style.filter="progid:DXImageTransform.Microsoft.alpha(opacity="+ value*100 +")"
		}
	}
},

showmenu:function(header, submenu, dir){
	if (this.effects.enableswipe || this.effects.enablefade){
		if (this.effects.enableswipe){
			var endpoint=(header._istoplevel && dir=="topbar")? header._dimensions.submenuh : header._dimensions.submenuw
			submenu.style.width=submenu.style.height=0
			submenu.style.overflow="hidden"
		}
		if (this.effects.enablefade){
			this.setopacity(submenu, 0) //set opacity to 0 so menu appears hidden initially
		}
		submenu._curanimatedegree=0
		submenu.style.visibility="visible"
		clearInterval(submenu._animatetimer)
		submenu._starttime=new Date().getTime() //get time just before animation is run
		submenu._animatetimer=setInterval(function(){ddlevelsmenu.revealmenu(header, submenu, endpoint, dir)}, 10)
	}
	else{
		submenu.style.visibility="visible"
	}
},

revealmenu:function(header, submenu, endpoint, dir){
	var elapsed=new Date().getTime()-submenu._starttime //get time animation has run
	if (elapsed<this.effects.duration){
		if (this.effects.enableswipe){
			if (submenu._curanimatedegree==0){ //reset either width or height of sub menu to "auto" when animation begins
				submenu.style[header._istoplevel && dir=="topbar"? "width" : "height"]="auto"
			}
			submenu.style[header._istoplevel && dir=="topbar"? "height" : "width"]=(submenu._curanimatedegree*endpoint)+"px"
		}
		if (this.effects.enablefade){
			this.setopacity(submenu, submenu._curanimatedegree)
		}
	}
	else{
		clearInterval(submenu._animatetimer)
		if (this.effects.enableswipe){
			submenu.style.width="auto"
			submenu.style.height="auto"
			submenu.style.overflow="visible"
		}
		if (this.effects.enablefade){
			this.setopacity(submenu, 1)
			submenu.style.filter=""
		}
		if (this.enableshim && submenu.FFscrollInfo) //if this is FF browser (meaning shim hasn't been applied yet
			this.positionshim(header, submenu, dir, submenu.FFscrollInfo.x, submenu.FFscrollInfo.y)
	}
	submenu._curanimatedegree=(1-Math.cos((elapsed/this.effects.duration)*Math.PI)) / 2
},

hidemenu:function(submenu){
	if (typeof submenu._pos!="undefined"){ //if submenu is outermost UL drop down menu
		this.css(this.topitems[submenu._master][parseInt(submenu._pos)], "selected", "remove")
		if (this.enableshim)
			this.hideshim()
	}
	clearInterval(submenu._animatetimer)
	submenu.style.left=0
	submenu.style.top="-1000px"
	submenu.style.visibility="hidden"
},


addEvent:function(target, functionref, tasktype) {
	if (target.addEventListener)
		target.addEventListener(tasktype, functionref, false);
	else if (target.attachEvent)
		target.attachEvent('on'+tasktype, function(){return functionref.call(target, window.event)});
},

domready:function(functionref){ //based on code from the jQuery library
	if (dd_domreadycheck){
		functionref()
		return
	}
	// Mozilla, Opera and webkit nightlies currently support this event
	if (document.addEventListener) {
		// Use the handy event callback
		document.addEventListener("DOMContentLoaded", function(){
			document.removeEventListener("DOMContentLoaded", arguments.callee, false )
			functionref();
			dd_domreadycheck=true
		}, false )
	}
	else if (document.attachEvent){
		// If IE and not an iframe
		// continually check to see if the document is ready
		if ( document.documentElement.doScroll && window == window.top) (function(){
			if (dd_domreadycheck){
				functionref()
				return
			}
			try{
				// If IE is used, use the trick by Diego Perini
				// http://javascript.nwbox.com/IEContentLoaded/
				document.documentElement.doScroll("left")
			}catch(error){
				setTimeout( arguments.callee, 0)
				return;
			}
			//and execute any waiting functions
			functionref();
			dd_domreadycheck=true
		})();
	}
	if (document.attachEvent && parent.length>0) //account for page being in IFRAME, in which above doesn't fire in IE
		this.addEvent(window, function(){functionref()}, "load");
},


init:function(mainmenuid, dir){
	this.standardbody=(document.compatMode=="CSS1Compat")? document.documentElement : document.body
	this.topitemsindex=-1
	this.ulindex=-1
	this.topmenuids.push(mainmenuid)
	this.topitems[mainmenuid]=[] //declare array on object
	this.subuls[mainmenuid]=[] //declare array on object
	this.hidetimers[mainmenuid]=[] //declare hide entire menu timer
	if (this.enableshim && !this.shimadded){
		this.shimmy={}
		this.shimmy.topshim=this.addshimmy(document.body) //create top iframe shim obj
		this.shimmy.bottomshim=this.addshimmy(document.body) //create bottom iframe shim obj
		this.shimadded=true
	}
	var menubar=document.getElementById(mainmenuid)
	var alllinks=menubar.getElementsByTagName("a")
	this.getwindowsize()
	for (var i=0; i<alllinks.length; i++){
		if (alllinks[i].getAttribute('rel')){
			this.topitemsindex++
			this.ulindex++
			var menuitem=alllinks[i]
			this.topitems[mainmenuid][this.topitemsindex]=menuitem //store ref to main menu links
			var dropul=document.getElementById(menuitem.getAttribute('rel'))
			document.body.appendChild(dropul) //move main ULs to end of document
			dropul.style.zIndex=2000 //give drop down menus a high z-index
			dropul._master=mainmenuid  //Indicate which main menu this main UL is associated with
			dropul._pos=this.topitemsindex //Indicate which main menu item this main UL is associated with
			this.addEvent(dropul, function(){ddlevelsmenu.hidemenu(this)}, "click")
			var arrowclass=(dir=="sidebar")? "rightarrowpointer" : "downarrowpointer"
			var arrowpointer=(dir=="sidebar")? this.arrowpointers.rightarrow : this.arrowpointers.downarrow
			if (this.arrowpointers.showarrow.toplevel)
				this.addpointer(menuitem, arrowclass, arrowpointer, (dir=="sidebar")? "before" : "after")
			this.buildmenu(mainmenuid, menuitem, dropul, this.ulindex, true, dir) //build top level menu
			dropul.onmouseover=function(){
				clearTimeout(ddlevelsmenu.hidetimers[this._master][this._pos])
			}
			this.addEvent(dropul, function(e){ //hide menu if mouse moves out of main UL element into open space
				if (!ddlevelsmenu.isContained(this, e) && !ddlevelsmenu.isContained(ddlevelsmenu.topitems[this._master][parseInt(this._pos)], e)){
					var dropul=this
					if (ddlevelsmenu.enableshim)
						ddlevelsmenu.hideshim()
					ddlevelsmenu.hidetimers[this._master][this._pos]=setTimeout(function(){
						ddlevelsmenu.hidemenu(dropul)
					}, ddlevelsmenu.hideinterval)
				}
			}, "mouseout")
			var subuls=dropul.getElementsByTagName("ul")
			for (var c=0; c<subuls.length; c++){
				this.ulindex++
				var parentli=subuls[c].parentNode
				if (this.arrowpointers.showarrow.sublevel)
					this.addpointer(parentli.getElementsByTagName("a")[0], "rightarrowpointer", this.arrowpointers.rightarrow, "before")
				this.buildmenu(mainmenuid, parentli, subuls[c], this.ulindex, false, dir) //build sub level menus
			}
		}
	} //end for loop
	this.addEvent(window, function(){ddlevelsmenu.getwindowsize(); ddlevelsmenu.gettopitemsdimensions()}, "resize")
},

setup:function(mainmenuid, dir){
	this.domready(function(){ddlevelsmenu.init(mainmenuid, dir)})
}

}
