var ddtabmenu={disabletablinks:false,snap2original:[true,1000],currentpageurl:window.location.href.replace("http://"+window.location.hostname,"").replace(/^\//,""),definemenu:function(a,b){this[a+"-menuitems"]=null;this[a+"-dselected"]=-1;if(undefined!=document.getElementById(a)){ddtabmenu.init(a,b)}this.addEvent(window,function(){ddtabmenu.init(a,b)},"load")},showsubmenu:function(b,a){var c=this[b+"-menuitems"];this.clearrevert2default(b);for(i=0;i<c.length;i++){c[i].className="";if(typeof c[i].hasSubContent!="undefined"){document.getElementById(c[i].getAttribute("rel")).style.display="none"}}a.className="current";if(typeof a.hasSubContent!="undefined"){document.getElementById(a.getAttribute("rel")).style.display="block"}},isSelected:function(a){var a=a.replace("http://"+a.hostname,"").replace(/^\//,"");return(ddtabmenu.currentpageurl==a)},isContained:function(a,b){var b=window.event||b;var d=b.relatedTarget||((b.type=="mouseover")?b.fromElement:b.toElement);while(d&&d!=a){try{d=d.parentNode}catch(b){d=a}}if(d==a){return true}else{return false}},revert2default:function(a,b,c){if(!ddtabmenu.isContained(a,b,c)){window["hidetimer_"+b]=setTimeout(function(){ddtabmenu.showsubmenu(b,ddtabmenu[b+"-dselected"])},ddtabmenu.snap2original[1])}},clearrevert2default:function(a){if(typeof window["hidetimer_"+a]!="undefined"){clearTimeout(window["hidetimer_"+a])}},addEvent:function(b,c,a){var a=(window.addEventListener)?a:"on"+a;if(b.addEventListener){b.addEventListener(a,c,false)}else{if(b.attachEvent){b.attachEvent(a,c)}}},init:function(c,d){var f=document.getElementById(c).getElementsByTagName("a");this[c+"-menuitems"]=f;for(var a=0;a<f.length;a++){if(f[a].getAttribute("rel")){this[c+"-menuitems"][a].hasSubContent=true;if(ddtabmenu.disabletablinks){f[a].onclick=function(){return false}}if(ddtabmenu.snap2original[0]==true){var e=document.getElementById(f[a].getAttribute("rel"));f[a].onmouseout=function(g){ddtabmenu.revert2default(e,c,g)};e.onmouseover=function(){ddtabmenu.clearrevert2default(c)};e.onmouseout=function(g){ddtabmenu.revert2default(this,c,g)}}}else{f[a].onmouseout=function(g){this.className="";if(ddtabmenu.snap2original[0]==true){ddtabmenu.revert2default(this,c,g)}}}f[a].onmouseover=function(){ddtabmenu.showsubmenu(c,this)};if(d=="auto"&&typeof b=="undefined"&&this.isSelected(f[a].href)){ddtabmenu.showsubmenu(c,f[a]);this[c+"-dselected"]=f[a];var b=true}else{if(parseInt(d)==a){ddtabmenu.showsubmenu(c,f[a]);this[c+"-dselected"]=f[a]}}}}};function ddtabcontent(a){this.tabinterfaceid=a;this.tabs=document.getElementById(a).getElementsByTagName("a");this.enabletabpersistence=true;this.hottabspositions=[];this.currentTabIndex=0;this.subcontentids=[];this.revcontentids=[];this.selectedClassTarget="link"}ddtabcontent.getCookie=function(a){var b=new RegExp(a+"=[^;]+","i");if(document.cookie.match(b)){return document.cookie.match(b)[0].split("=")[1]}return""};ddtabcontent.setCookie=function(a,b){document.cookie=a+"="+b+";path=/"};ddtabcontent.prototype={expandit:function(a){this.cancelautorun();var b="";try{if(typeof a=="string"&&document.getElementById(a).getAttribute("rel")){b=document.getElementById(a)}else{if(parseInt(a)!=NaN&&this.tabs[a].getAttribute("rel")){b=this.tabs[a]}}}catch(c){alert("Invalid Tab ID or position entered!")}if(b!=""){this.expandtab(b)}},cycleit:function(b,a){if(b=="next"){var c=(this.currentTabIndex<this.hottabspositions.length-1)?this.currentTabIndex+1:0}else{if(b=="prev"){var c=(this.currentTabIndex>0)?this.currentTabIndex-1:this.hottabspositions.length-1}}if(typeof a=="undefined"){this.cancelautorun()}this.expandtab(this.tabs[this.hottabspositions[c]])},setpersist:function(a){this.enabletabpersistence=a},setselectedClassTarget:function(a){this.selectedClassTarget=a||"link"},getselectedClassTarget:function(a){return(this.selectedClassTarget==("linkparent".toLowerCase()))?a.parentNode:a},expandtab:function(b){var c=b.getAttribute("rel");var d=(b.getAttribute("rev"))?","+b.getAttribute("rev").replace(/\s+/,"")+",":"";this.expandsubcontent(c);this.expandrevcontent(d);for(var a=0;a<this.tabs.length;a++){this.getselectedClassTarget(this.tabs[a]).className=(this.tabs[a].getAttribute("rel")==c)?"selected":""}if(this.enabletabpersistence){ddtabcontent.setCookie(this.tabinterfaceid,b.tabposition)}this.setcurrenttabindex(b.tabposition)},expandsubcontent:function(c){for(var b=0;b<this.subcontentids.length;b++){var a=document.getElementById(this.subcontentids[b]);a.style.display=(a.id==c)?"block":"none"}},expandrevcontent:function(c){var a=this.revcontentids;for(var b=0;b<a.length;b++){document.getElementById(a[b]).style.display=(c.indexOf(","+a[b]+",")!=-1)?"block":"none"}},setcurrenttabindex:function(a){for(var b=0;b<this.hottabspositions.length;b++){if(a==this.hottabspositions[b]){this.currentTabIndex=b;break}}},autorun:function(){this.cycleit("next",true)},cancelautorun:function(){if(typeof this.autoruntimer!="undefined"){clearInterval(this.autoruntimer)}},init:function(a){var e=ddtabcontent.getCookie(this.tabinterfaceid);var d=true;this.automodeperiod=a||0;for(var c=0;c<this.tabs.length;c++){this.tabs[c].tabposition=c;if(this.tabs[c].getAttribute("rel")){var b=this;this.hottabspositions[this.hottabspositions.length]=c;this.subcontentids[this.subcontentids.length]=this.tabs[c].getAttribute("rel");this.tabs[c].onclick=function(){b.expandtab(this);b.cancelautorun();return false};if(this.tabs[c].getAttribute("rev")){this.revcontentids=this.revcontentids.concat(this.tabs[c].getAttribute("rev").split(/\s*,\s*/))}if(this.enabletabpersistence&&parseInt(e)==c||!this.enabletabpersistence&&this.getselectedClassTarget(this.tabs[c]).className=="selected"){this.expandtab(this.tabs[c]);d=false}}}if(d){this.expandtab(this.tabs[this.hottabspositions[0]])}if(parseInt(this.automodeperiod)>500&&this.hottabspositions.length>1){this.autoruntimer=setInterval(function(){b.autorun()},this.automodeperiod)}}};var dropdowncontent={delaybeforehide:200,disableanchorlink:true,ajaxloadingmsg:"Loading content. Please wait...",ajaxbustcache:true,getposOffset:function(b,a){return(b.offsetParent)?b[a]+this.getposOffset(b.offsetParent,a):b[a]},isContained:function(a,b){var b=window.event||b;var d=b.relatedTarget||((b.type=="mouseover")?b.fromElement:b.toElement);while(d&&d!=a){try{d=d.parentNode}catch(b){d=a}}if(d==a){return true}else{return false}},show:function(b,d,f){if(!this.isContained(b,f)){var c=(d.dropposition[0]=="left")?-(d.offsetWidth-b.offsetWidth):0;var a=(d.dropposition[1]=="top")?-d.offsetHeight:b.offsetHeight;d.style.left=this.getposOffset(b,"offsetLeft")+c+"px";d.style.top=this.getposOffset(b,"offsetTop")+a+"px";d.style.clip=(d.dropposition[1]=="top")?"rect(auto auto auto 0)":"rect(0 auto 0 0)";d.style.visibility="visible";d.startTime=new Date().getTime();d.contentheight=parseInt(d.offsetHeight);if(typeof window["hidetimer_"+d.id]!="undefined"){clearTimeout(window["hidetimer_"+d.id])}this.slideengine(d,(d.dropposition[1]=="top")?"up":"down")}},curveincrement:function(a){return(1-Math.cos(a*Math.PI))/2},slideengine:function(e,d){var b=new Date().getTime()-e.startTime;if(b<e.glidetime){var a=(d=="down")?this.curveincrement(b/e.glidetime):1-this.curveincrement(b/e.glidetime);var c=(a*e.contentheight)+"px";e.style.clip=(d=="down")?"rect(0 auto "+c+" 0)":"rect("+c+" auto auto 0)";window["glidetimer_"+e.id]=setTimeout(function(){dropdowncontent.slideengine(e,d)},10)}else{e.style.clip="rect(0 auto auto 0)"}},hide:function(b,a,c){if(!dropdowncontent.isContained(b,c)){window["hidetimer_"+a.id]=setTimeout(function(){a.style.visibility="hidden";a.style.left=a.style.top=0;clearTimeout(window["glidetimer_"+a.id])},dropdowncontent.delaybeforehide)}},ajaxconnect:function(a,b){var f=false;var d="";if(window.XMLHttpRequest){f=new XMLHttpRequest()}else{if(window.ActiveXObject){try{f=new ActiveXObject("Msxml2.XMLHTTP")}catch(c){try{f=new ActiveXObject("Microsoft.XMLHTTP")}catch(c){}}}else{return false}}document.getElementById(b).innerHTML=this.ajaxloadingmsg;f.onreadystatechange=function(){dropdowncontent.loadpage(f,b)};if(this.ajaxbustcache){d=(a.indexOf("?")!=-1)?"&"+new Date().getTime():"?"+new Date().getTime()}f.open("GET",a+d,true);f.send(null)},loadpage:function(b,a){if(b.readyState==4&&(b.status==200||window.location.href.indexOf("http")==-1)){document.getElementById(a).innerHTML=b.responseText}},init:function(a,f,e){var c=document.getElementById(a);var d=document.getElementById(c.getAttribute("rel"));var b=c.getAttribute("rev");if(b!=null&&b!=""){this.ajaxconnect(b,c.getAttribute("rel"))}d.dropposition=f.split("-");d.glidetime=e||1000;d.style.left=d.style.top=0;c.onmouseover=function(g){dropdowncontent.show(this,d,g)};c.onmouseout=function(g){dropdowncontent.hide(d,d,g)};if(this.disableanchorlink){c.onclick=function(){return false}}d.onmouseout=function(g){dropdowncontent.hide(this,d,g)}}};