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){a=new RegExp(a+"=[^;]+","i");if(document.cookie.match(a))return document.cookie.match(a)[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!")}b!=""&&this.expandtab(b);switch(a){case "tab_1_title":document.getElementById("tab").style.backgroundPosition="0px 0px";break;case "tab_2_title":document.getElementById("tab").style.backgroundPosition= "0px -26px";break;case "tab_3_title":document.getElementById("tab").style.backgroundPosition="0px -53px";break;case "tab_4_title":document.getElementById("tab").style.backgroundPosition="0px -79px";break;case "tab_5_title":document.getElementById("tab").style.backgroundPosition="0px -106px";break}},cycleit:function(a,b){if(a=="next")var c=this.currentTabIndex<this.hottabspositions.length-1?this.currentTabIndex+1:0;else if(a=="prev")c=this.currentTabIndex>0?this.currentTabIndex-1:this.hottabspositions.length- 1;typeof b=="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},urlparamselect:function(a){return window.location.search.match(new RegExp(a+"=(\\d+)","i"))==null?null:parseInt(RegExp.$1)},gototab:function(a){switch(a){case "1":tab.expandit("tab_1_title"); break;case "2":tab.expandit("tab_2_title");break;case "3":tab.expandit("tab_3_title");break;case "4":tab.expandit("tab_4_title");break;case "5":tab.expandit("tab_5_title");break}},expandtab:function(a){var b=a.getAttribute("rel"),c=a.getAttribute("rev")?","+a.getAttribute("rev").replace(/\s+/,"")+",":"";this.expandsubcontent(b);this.expandrevcontent(c);for(c=0;c<this.tabs.length;c++)this.getselectedClassTarget(this.tabs[c]).className=this.tabs[c].getAttribute("rel")==b?"selected":"";this.enabletabpersistence&& ddtabcontent.setCookie(this.tabinterfaceid,a.tabposition);this.setcurrenttabindex(a.tabposition)},expandsubcontent:function(a){for(var b=0;b<this.subcontentids.length;b++){var c=document.getElementById(this.subcontentids[b]);c.style.display=c.id==a?"block":"none"}},expandrevcontent:function(a){for(var b=this.revcontentids,c=0;c<b.length;c++)document.getElementById(b[c]).style.display=a.indexOf(","+b[c]+",")!=-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(){typeof this.autoruntimer!="undefined"&&clearInterval(this.autoruntimer)},init:function(a){var b=ddtabcontent.getCookie(this.tabinterfaceid),c=-1,d=unescape(self.document.location.hash.substring(1)),f=d;if(d!="")f=d-1;this.automodeperiod=a||0;for(a=0;a<this.tabs.length;a++){this.tabs[a].tabposition=a;if(this.tabs[a].getAttribute("rel")){var e=this;this.hottabspositions[this.hottabspositions.length]= a;this.subcontentids[this.subcontentids.length]=this.tabs[a].getAttribute("rel");this.tabs[a].onclick=function(){e.expandtab(this);e.cancelautorun();return false};if(this.tabs[a].getAttribute("rev"))this.revcontentids=this.revcontentids.concat(this.tabs[a].getAttribute("rev").split(/\s*,\s*/));if(f==a||this.enabletabpersistence&&c==-1&&parseInt(b)==a||!this.enabletabpersistence&&c==-1&&this.getselectedClassTarget(this.tabs[a]).className=="selected")c=a}}c!=-1?this.expandtab(this.tabs[c]):this.expandtab(this.tabs[this.hottabspositions[0]]); if(parseInt(this.automodeperiod)>500&&this.hottabspositions.length>1)this.autoruntimer=setInterval(function(){e.autorun()},this.automodeperiod)}};