var cssdropdown={disappeardelay:250,enablereveal:[true,5],enableiframeshim:1,dropmenuobj:null,asscmenuitem:null,domsupport:document.all||document.getElementById,standardbody:null,iframeshimadded:false,revealtimers:{},getposOffset:function(a,b){var c=b=="left"?a.offsetLeft:a.offsetTop;var d=a.offsetParent;while(d!=null){c=b=="left"?c+d.offsetLeft:c+d.offsetTop;d=d.offsetParent}return c},css:function(a,b,c){var d=new RegExp("(^|\\s+)"+b+"($|\\s+)","ig");if(c=="check")return d.test(a.className);else if(c=="remove")a.className=a.className.replace(d,"");else if(c=="add"&&!d.test(a.className))a.className+=" "+b},showmenu:function(a,b){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,b){var c=a._curheight,d=a._trueheight,e=this.enablereveal[1];if(c<d){var f=Math.min(c,d);a.style.height=f+"px";a._curheight=f+Math.round((d-f)/e)+1}else{a.style.height="auto";a.style.overflow="hidden";clearInterval(this.revealtimers[a.id])}},clearbrowseredge:function(a,b){var c=0;if(b=="rightedge"){var d=document.all&&!window.opera?this.standardbody.scrollLeft+this.standardbody.clientWidth-15:window.pageXOffset+window.innerWidth-15;var e=this.dropmenuobj.offsetWidth;if(d-this.dropmenuobj.x<e)c=e-a.offsetWidth}else{var f=document.all&&!window.opera?this.standardbody.scrollTop:window.pageYOffset;var d=document.all&&!window.opera?this.standardbody.scrollTop+this.standardbody.clientHeight-15:window.pageYOffset+window.innerHeight-18;var g=this.dropmenuobj._trueheight;if(d-this.dropmenuobj.y<g){c=g+a.offsetHeight;if(this.dropmenuobj.y-f<g)c=this.dropmenuobj.y+a.offsetHeight-f}}return c},dropit:function(a,b,c){if(this.dropmenuobj!=null)this.hidemenu();this.clearhidemenu();this.dropmenuobj=document.getElementById(c);this.asscmenuitem=a;this.showmenu(this.dropmenuobj,b);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){if(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,b){var b=window.event||b;var c=b.relatedTarget||(b.type=="mouseover"?b.fromElement:b.toElement);while(c&&c!=a)try{c=c.parentNode}catch(b){c=a}if(c==a)return true;else return false},dynamichide:function(a,b){if(!this.isContained(a,b)){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(){if(this.delayhide!="undefined")clearTimeout(this.delayhide)},addEvent:function(a,b,c){if(a.addEventListener)a.addEventListener(c,b,false);else if(a.attachEvent)a.attachEvent("on"+c,function(){return b.call(a,window.event)})},startchrome:function(){if(!this.domsupport)return;this.standardbody=document.compatMode=="CSS1Compat"?document.documentElement:document.body;for(var a=0;a<arguments.length;a++){var b=document.getElementById(arguments[a]).getElementsByTagName("a");for(var c=0;c<b.length;c++){if(b[c].getAttribute("rel")){var d=b[c].getAttribute("rel");var e=document.getElementById(d);this.addEvent(e,function(){cssdropdown.clearhidemenu()},"mouseover");this.addEvent(e,function(a){cssdropdown.dynamichide(this,a)},"mouseout");this.addEvent(e,function(){cssdropdown.delayhidemenu()},"click");try{b[c].innerHTML=b[c].innerHTML+" "}catch(f){}this.addEvent(b[c],function(a){if(!cssdropdown.isContained(this,a)){var b=window.event||a;cssdropdown.dropit(this,b,this.getAttribute("rel"))}},"mouseover");this.addEvent(b[c],function(a){cssdropdown.dynamichide(this,a)},"mouseout");this.addEvent(b[c],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}}}
