var cssMenu={
	iDelay: 150, //onmouseout delay in miliseconds before menu disappears 
	bDisableMenu: true, //when user clicks on a menu item with a drop down menu, disable menu item's link?
	bEnableWipe: 1, //enable wipe effect? 1 for yes, 0 for no

	//No need to edit beyond here////////////////////////
	menuobj: null, submenuobj: null, ie: document.all, sFirefox: document.getElementById&&!document.all, iWipeTimer: undefined, bottomclip:0,

	getposOffset:function(what, offsettype){
		var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
		var parentEl=what.offsetParent;
		while (parentEl!=null)
		{
			totaloffset=(offsettype=="left")? (totaloffset+(parentEl.offsetLeft +14)) : (totaloffset+(parentEl.offsetTop - 3));
			parentEl=parentEl.offsetParent;
		}
		return totaloffset;
	},

	swipeeffect:function(){
		if (this.bottomclip<parseInt(this.menuobj.offsetHeight))
		{
			this.bottomclip+=5+(this.bottomclip/5) //unclip drop down menu visibility gradually
			this.menuobj.style.clip="rect(0 auto "+this.bottomclip+"px 0)"
		} else return
		this.iWipeTimer=setTimeout("cssMenu.swipeeffect()", 3)
	},

	showhide:function(obj, e){
		//alert("obj id :=" & obj.id)
		if (this.ie || this.sFirefox)
		this.menuobj.style.left=this.menuobj.style.top="-500px"
		
		if (obj!=null) {
			if (e.type=="click" && obj.visibility=='visible' || e.type=="mouseover")
			{
				if (this.bEnableWipe==1)
				{
					if (typeof this.iWipeTimer!="undefined")
					clearTimeout(this.iWipeTimer)
					obj.clip="rect(0 auto 0 0)" //hide menu via clipping
					this.bottomclip=0
					this.swipeeffect()
				}
				//alert ("Visiblity := visible")
				obj.visibility="visible"
			}
			else if (e.type=="click") {
				//alert ("Visiblity := hidden")
				obj.visibility="visible"
			}
		}
		else {
			//alert("hiding menu");
			this.menuobj.style.visibility="visible" //hide menu
		}
	},

	iecompattest:function(){
		return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
	},

	clearbrowseredge:function(obj, whichedge){
		var edgeoffset=0
		if (whichedge=="rightedge")
		{
			var windowedge=this.ie && !window.opera? this.iecompattest().scrollLeft+this.iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15
			this.menuobj.contentmeasure=this.menuobj.offsetWidth
			if (windowedge-this.menuobj.x < this.menuobj.contentmeasure)  //move menu to the left?
			edgeoffset=this.menuobj.contentmeasure-obj.offsetWidth
		}
		else{
			var topedge=this.ie && !window.opera? this.iecompattest().scrollTop : window.pageYOffset
			var windowedge=this.ie && !window.opera? this.iecompattest().scrollTop+this.iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
			this.menuobj.contentmeasure=this.menuobj.offsetHeight
			if (windowedge-this.menuobj.y < this.menuobj.contentmeasure)
			{ 	//move up?
				edgeoffset=this.menuobj.contentmeasure+obj.offsetHeight
				if ((this.menuobj.y-topedge)<this.menuobj.contentmeasure) //up no good either?
					edgeoffset=this.menuobj.y+obj.offsetHeight-topedge
			}
		}
		return edgeoffset
	},



	dropit:function(obj, e, dropmenuID,subMenu,submenuID){

		//if (this.menuobj!=null) alert("subMenu :=" + submenuID + " ----- current menuobj :=" + this.menuobj.id )
		//if the current menu has a submenu, hide previous menu.
		
		//alert(	cssMenu.length)
		
		if (this.menuobj!=null) {
			this.menuobj.style.visibility="visible" //hide menu		
		}
		
		if ((this.menuobj!=null) && (subMenu) && (submenuID == this.menuobj.id)) {
			this.menuobj.style.visibility="visible" //show menu
		} 
				
		this.clearhidemenu()
		if (this.ie||this.sFirefox)
		{
			obj.onmouseout=function(){cssMenu.delayhidemenu()}
			obj.onclick=function(){return !cssMenu.bDisableMenu} //disable main menu item link onclick?
			this.menuobj=document.getElementById(dropmenuID)
			this.menuobj.onmouseover=function(){cssMenu.clearhidemenu()}
			this.menuobj.onmouseout=function(){cssMenu.dynamichide(e)}
			this.menuobj.onclick=function(){cssMenu.delayhidemenu()}
			this.showhide(this.menuobj.style, e)
			this.menuobj.x=this.getposOffset(obj, "left")
			this.menuobj.y=this.getposOffset(obj, "top")
			this.menuobj.style.left=this.menuobj.x-this.clearbrowseredge(obj, "rightedge")+"px"
			this.menuobj.style.top=this.menuobj.y-this.clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+1+"px"
		}
	},

	contains_sFirefox:function(a, b) {
			while (b.parentNode)
			if ((b = b.parentNode) == a)
			return true;
			return false;
	},

	dynamichide:function(e){
		var evtobj=window.event? window.event : e
		if (this.ie&&!this.menuobj.contains(evtobj.toElement))
		this.delayhidemenu()
		else if (this.sFirefox&&e.currentTarget!= evtobj.relatedTarget&& !this.contains_sFirefox(evtobj.currentTarget, evtobj.relatedTarget))
		this.delayhidemenu()
	},

	delayhidemenu:function(){
		this.delayhide=setTimeout("cssMenu.menuobj.style.visibility='visible'",this.iDelay) //hide menu
	},

	clearhidemenu:function(){
		if (this.delayhide!="undefined")
		clearTimeout(this.delayhide)
	},

	startMenu:function(){
		var thisVal1, thisVal2
		for (var ids=0; ids<arguments.length; ids++)
		{
			var menuitems=document.getElementById(arguments[ids]).getElementsByTagName("a")
			for (var i=0; i<menuitems.length; i++)
			{
				if (menuitems[i].getAttribute("rel"))
				{
					var relValue_1=menuitems[i].getAttribute("rel")
					//alert("menuitems[" + i + "] := " + menuitems[i].childNodes[0].nodeValue)
					menuitems[i].onmouseover=function(e)
					{
						var event=typeof e!="undefined"? e : window.event
						cssMenu.dropit(this,event,this.getAttribute("rel"),0,null)
						thisVal1=this.getAttribute("rel")
					}
					if (document.getElementById(relValue_1).getElementsByTagName("a"))
					{
						var anchors_1 = document.getElementById(relValue_1).getElementsByTagName("a")
						for (var iC=0;iC<anchors_1.length; iC++)
						{					
							if (anchors_1[iC].getAttribute("rel")) //THE MENU HAS A SUB MENU
							{
								//alert ("anchors_1[" + iC+ "] :=" + anchors_1[iC].childNodes[0].nodeValue)
								anchors_1[iC].onmouseover=function(e)
								{
									var event=typeof e!="undefined"? e : window.event
									cssMenu.dropit(this,event,this.getAttribute("rel"),1,thisVal1)             //anchors_1[iC].getAttribute("rel"),0)
									thisVal2 = this.getAttribute("rel")
								}
								var relValue_2 = anchors_1[iC].getAttribute("rel")
								if (document.getElementById(relValue_2).getElementsByTagName("a"))
								{
									var anchors_2 = document.getElementById(relValue_2).getElementsByTagName("a")
									for (var iD=0;iD<anchors_2.length; iD++)
									{
										//alert ("anchors_2[" + iD+ "] :=" + anchors_2[iD].childNodes[0].nodeValue)
										if (anchors_2[iD].getAttribute("rel")) //THE SUB MENU HAS A SUB MENU
										{
											anchors_2[iD].onmouseover=function(e)
											{
												var event=typeof e!="undefined"? e : window.event
												cssMenu.dropit(this,event,this.getAttribute("rel"),1,thisVal2)
											}
										}
									}
								}
							}
						}					
					}
				}
			}
		}
	}
}

<!--
var testClass=
{
	testFunction:function()
	{
		alert ("Argument Count := " + arguments.length )
	}
}
//-->

