
//Chrome Drop Down Menu- Author: Dynamic Drive (http://www.dynamicdrive.com)
//Last updated: June 14th, 06' v2.0

var cssdropdownLeft={
disappeardelay: 500, //set delay in miliseconds before menu disappears onmouseout
disablemenuclick: false, //when user clicks on a menu item with a drop down menu, disable menu item's link?
enableswipe: 1, //enable swipe effect? 1 for yes, 0 for no

//No need to edit beyond here////////////////////////
dropmenuobjLeft: null, ie: document.all, firefox: document.getElementById&&!document.all, swipetimer: undefined, bottomclip:0,

getposOffsetLeft:function(what, offsettype){
var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
var parentEl=what.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
},

swipeeffectLeft:function(){
if (this.bottomclip<parseInt(this.dropmenuobjLeft.offsetHeight)){
this.bottomclip+=10+(this.bottomclip/10) //unclip drop down menu visibility gradually
this.dropmenuobjLeft.style.clip="rect(0 auto "+this.bottomclip+"px 0)"
}
else
return
this.swipetimer=setTimeout("cssdropdownLeft.swipeeffectLeft()", 10)
},

showhideLeft:function(obj, e){
if (this.ie || this.firefox)
this.dropmenuobjLeft.style.left=this.dropmenuobjLeft.style.top="-500px"
if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover"){
if (this.enableswipe==1){
if (typeof this.swipetimer!="undefined")
clearTimeout(this.swipetimer)
obj.clip="rect(0 auto 0 0)" //hide menu via clipping
this.bottomclip=0
this.swipeeffectLeft()
}
obj.visibility="visible"
}
else if (e.type=="click")
obj.visibility="hidden"
},

iecompattestLeft:function(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
},

clearbrowseredgeLeft:function(obj, whichedge){
var edgeoffset=0
if (whichedge=="rightedge"){
var windowedge=this.ie && !window.opera? this.iecompattestLeft().scrollLeft+this.iecompattestLeft().clientWidth-15 : window.pageXOffset+window.innerWidth-15
this.dropmenuobjLeft.contentmeasure=this.dropmenuobjLeft.offsetWidth
if (windowedge-this.dropmenuobjLeft.x < this.dropmenuobjLeft.contentmeasure)  //move menu to the left?
edgeoffset=this.dropmenuobjLeft.contentmeasure-obj.offsetWidth
}
else{
var topedge=this.ie && !window.opera? this.iecompattestLeft().scrollTop : window.pageYOffset
var windowedge=this.ie && !window.opera? this.iecompattestLeft().scrollTop+this.iecompattestLeft().clientHeight-15 : window.pageYOffset+window.innerHeight-18
this.dropmenuobjLeft.contentmeasure=this.dropmenuobjLeft.offsetHeight
if (windowedge-this.dropmenuobjLeft.y < this.dropmenuobjLeft.contentmeasure){ //move up?
edgeoffset=this.dropmenuobjLeft.contentmeasure+obj.offsetHeight
if ((this.dropmenuobjLeft.y-topedge)<this.dropmenuobjLeft.contentmeasure) //up no good either?
edgeoffset=this.dropmenuobjLeft.y+obj.offsetHeight-topedge
}
}
return edgeoffset
},

dropitLeft:function(obj, e, dropmenuID){
if (this.dropmenuobjLeft!=null) //hide previous menu
this.dropmenuobjLeft.style.visibility="hidden" //hide menu
this.clearhidemenuLeft()
if (this.ie||this.firefox){
obj.onmouseout=function(){cssdropdownLeft.delayhidemenuLeft()}
obj.onclick=function(){return !cssdropdownLeft.disablemenuclick} //disable main menu item link onclick?
this.dropmenuobjLeft=document.getElementById(dropmenuID)
this.dropmenuobjLeft.onmouseover=function(){cssdropdownLeft.clearhidemenuLeft()}
this.dropmenuobjLeft.onmouseout=function(e){cssdropdownLeft.dynamichideLeft(e)}
this.dropmenuobjLeft.onclick=function(){cssdropdownLeft.delayhidemenuLeft()}
this.showhideLeft(this.dropmenuobjLeft.style, e)
this.dropmenuobjLeft.x=this.getposOffsetLeft(obj, "left")+obj.offsetWidth
this.dropmenuobjLeft.y=this.getposOffsetLeft(obj, "top")-obj.offsetHeight
this.dropmenuobjLeft.style.left=this.dropmenuobjLeft.x-0+0-this.clearbrowseredgeLeft(obj, "rightedge")+"px"
this.dropmenuobjLeft.style.top=this.dropmenuobjLeft.y-1-this.clearbrowseredgeLeft(obj, "bottomedge")+obj.offsetHeight+1+"px"
}
},

contains_firefoxLeft:function(a, b) {
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
},

dynamichideLeft:function(e){
var evtobj=window.event? window.event : e
if (this.ie&&!this.dropmenuobjLeft.contains(evtobj.toElement))
this.delayhidemenuLeft()
else if (this.firefox&&e.currentTarget!= evtobj.relatedTarget&& !this.contains_firefoxLeft(evtobj.currentTarget, evtobj.relatedTarget))
this.delayhidemenuLeft()
},

delayhidemenuLeft:function(){
this.delayhide=setTimeout("cssdropdownLeft.dropmenuobjLeft.style.visibility='hidden'",this.disappeardelay) //hide menu
},

clearhidemenuLeft:function(){
if (this.delayhide!="undefined")
clearTimeout(this.delayhide)
},

startchromeLeft:function(){
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=menuitems[i].getAttribute("rel")
menuitems[i].onmouseover=function(e){
var event=typeof e!="undefined"? e : window.event
cssdropdownLeft.dropitLeft(this,event,this.getAttribute("rel"))
}
}
}
}
}

}