var cssdropdown={disappeardelay:250,dropdownindicator:"",enablereveal:[true,5],enableiframeshim:0,dropmenuobj:null,asscmenuitem:null,domsupport:document.all||document.getElementById,standardbody:null,iframeshimadded:false,revealtimers:{},getposOffset:function(a,c){for(var b=c=="left"?a.offsetLeft:a.offsetTop,d=a.offsetParent;d!=null;)b=c=="left"?b+d.offsetLeft:b+d.offsetTop,d=d.offsetParent;return b},css:function(a,c,b){var d=RegExp("(^|\\s+)"+c+"($|\\s+)","ig");if(b=="check")return d.test(a.className); else b=="remove"?a.className=a.className.replace(d,""):b=="add"&&!d.test(a.className)&&(a.className+=" "+c)},showmenu:function(a){if(this.enablereveal[0]){if(!a._trueheight||a._trueheight<10)a._trueheight=a.offsetHeight;clearTimeout(this.revealtimers[a.id]);a.style.height=a._curheight=0;a.style.overflow="hidden";a.style.visibility="visible";this.revealtimers[a.id]=setInterval(function(){cssdropdown.revealmenu(a)},10)}else a.style.visibility="visible";this.css(this.asscmenuitem,"selected","add")}, revealmenu:function(a){var c=a._curheight,b=a._trueheight,d=this.enablereveal[1];c<b?(c=Math.min(c,b),a.style.height=c+"px",a._curheight=c+Math.round((b-c)/d)+1):(a.style.height="auto",a.style.overflow="hidden",clearInterval(this.revealtimers[a.id]))},clearbrowseredge:function(a,c){var b=0;if(c=="rightedge"){var d=document.all&&!window.opera?this.standardbody.scrollLeft+this.standardbody.clientWidth-15:window.pageXOffset+window.innerWidth-15,e=this.dropmenuobj.offsetWidth;d-this.dropmenuobj.x<e&& (b=e-a.offsetWidth)}else{var e=document.all&&!window.opera?this.standardbody.scrollTop:window.pageYOffset,d=document.all&&!window.opera?this.standardbody.scrollTop+this.standardbody.clientHeight-15:window.pageYOffset+window.innerHeight-18,f=this.dropmenuobj._trueheight;d-this.dropmenuobj.y<f&&(b=f+a.offsetHeight,this.dropmenuobj.y-e<f&&(b=this.dropmenuobj.y+a.offsetHeight-e))}return b},dropit:function(a,c,b){this.dropmenuobj!=null&&this.hidemenu();this.clearhidemenu();this.dropmenuobj=document.getElementById(b); this.asscmenuitem=a.parentNode;this.showmenu(this.dropmenuobj,c);this.dropmenuobj.x=this.getposOffset(a,"left");this.dropmenuobj.y=this.getposOffset(a,"top");this.dropmenuobj.style.left=this.dropmenuobj.x-this.clearbrowseredge(a,"rightedge")+"px";this.dropmenuobj.style.top=this.dropmenuobj.y-this.clearbrowseredge(a,"bottomedge")+a.offsetHeight+1+"px";this.positionshim()},positionshim:function(){if(this.iframeshimadded&&this.dropmenuobj.style.visibility=="visible")this.shimobject.style.width=this.dropmenuobj.offsetWidth+ "px",this.shimobject.style.height=this.dropmenuobj._trueheight+"px",this.shimobject.style.left=parseInt(this.dropmenuobj.style.left)+"px",this.shimobject.style.top=parseInt(this.dropmenuobj.style.top)+"px",this.shimobject.style.display="block"},hideshim:function(){if(this.iframeshimadded)this.shimobject.style.display="none"},isContained:function(a,c){for(var c=window.event||c,b=c.relatedTarget||(c.type=="mouseover"?c.fromElement:c.toElement);b&&b!=a;)try{b=b.parentNode}catch(d){b=a}return b==a?true: false},dynamichide:function(a,c){this.isContained(a,c)||this.delayhidemenu()},delayhidemenu:function(){this.delayhide=setTimeout("cssdropdown.hidemenu()",this.disappeardelay)},hidemenu:function(){this.css(this.asscmenuitem,"selected","remove");this.dropmenuobj.style.visibility="hidden";this.dropmenuobj.style.left=this.dropmenuobj.style.top="-1000px";this.hideshim()},clearhidemenu:function(){this.delayhide!="undefined"&&clearTimeout(this.delayhide)},addEvent:function(a,c,b){a.addEventListener?a.addEventListener(b, c,false):a.attachEvent&&a.attachEvent("on"+b,function(){return c.call(a,window.event)})},startchrome:function(){if(this.domsupport){this.standardbody=document.compatMode=="CSS1Compat"?document.documentElement:document.body;for(var a=0;a<arguments.length;a++)for(var c=document.getElementById(arguments[a]).getElementsByTagName("a"),b=0;b<c.length;b++)if(c[b].getAttribute("rel")){var d=c[b].getAttribute("rel"),d=document.getElementById(d);this.addEvent(d,function(){cssdropdown.clearhidemenu()},"mouseover"); this.addEvent(d,function(a){cssdropdown.dynamichide(this,a)},"mouseout");this.addEvent(d,function(){cssdropdown.delayhidemenu()},"click");try{c[b].innerHTML=c[b].innerHTML+" "+this.dropdownindicator}catch(e){}this.addEvent(c[b],function(a){cssdropdown.isContained(this,a)||cssdropdown.dropit(this,window.event||a,this.getAttribute("rel"))},"mouseover");this.addEvent(c[b],function(a){cssdropdown.dynamichide(this,a)},"mouseout");this.addEvent(c[b],function(){cssdropdown.delayhidemenu()},"click")}if(this.enableiframeshim&& document.all&&!window.XDomainRequest&&!this.iframeshimadded)document.write('<IFRAME id="iframeshim" src="about:blank" frameBorder="0" scrolling="no" style="left:0; top:0; position:absolute; display:none;z-index:90; background: transparent;"></IFRAME>'),this.shimobject=document.getElementById("iframeshim"),this.shimobject.style.filter="progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)",this.iframeshimadded=true}}};
