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