if(window['FD']) {
  FD.getSiteAdvertDesc = function(adObj) {
    // Custom getter for siteAdvertDesc
    var area;
    var p = adObj.params; 
    if(p && p.site) {
      p.site = p.site.toUpperCase();
      if(p.site in siteLookup) {
        siteName = (siteLookup[p.site].site) ? siteLookup[p.site].site : p.site;
      }

      // Strip non-word chars from adSection
      if(p.cat) {
        p.cat = p.cat.replace(/\W/g, "").toUpperCase();
        if(siteLookup[p.site] && siteLookup[p.site].cat) {
          section = siteLookup[p.site].cat;
        } else if(p.cat && p.cat in catSectionLookup) {
          section = (catSectionLookup[p.cat] != '') ? catSectionLookup[p.cat] : p.cat;
        }
        area = p.cat;
      }
      
      if(p.cat1) {
        p.cat1 = p.cat1.toUpperCase();
        area += "."+p.cat1;
      }

      if(p.adspace) {
        var adspace = p.adspace.toLowerCase();
        if(adspace in adSizes) {
          p.adspace = adSizes[adspace];
          delete p.adspace;
        }
      }
      
      // Determine whether this section has additionally appended properties on its AREA prop
      if(section in areaExtend) {
        var x = 0, pName;
        while(pName = areaExtend[section][x]) {
          if(p[pName]) {
            area += "."+p[pName].toUpperCase();
          }
          x++;
        }
      }
    }
    
    adObj.siteName = siteName;
    adObj.site = (siteAdvertDesc.group+"."+siteName+"."+section).toUpperCase();
    adObj.area = (section+"."+siteName+((area) ? "."+area : "")).toUpperCase();
    adObj.redir = siteAdvertDesc.redir;
    
    return adObj
  };
} 
 
if(window.FD){if(window.Fx&&Fx.Styles){Fx.Morph=Fx.Styles}if(!window.Client&&window.Browser){Client=Browser}FD.smhage=new Class({options:{aSHeight:366,duration:250,classCurrent:"current"},initialize:function(){this._initSlider();this._initQuotes();this._initAllSections();this._initTabs();this._initTempTVWrapOverlay();this._initShareLinks()},_initQuotes:function(){var A=$("masthead").getElements("blockquote");
if(A){var B=(A.length>1)?Math.floor(Math.random()*(A.length)+1)-1:0;if(A[B]){A[B].setStyles({display:"block",visibility:"visible"})}}},_initAllSections:function(){var A=$("allSections");var C=$("allSectionsWrap");var B=$("allSectionsContent");if(A&&C&&B){this.options.aSOpenText=A.innerHTML;A.addEvent("click",this.toggleAllSections.bindWithEvent(this));C.empty().innerHTML=B.innerHTML}},getASW:function(){return $("allSectionsWrap")
},toggleAllSections:function(B){new Event(B).stop();var A=this.getASW();if(A&&!this.asChanging){if(A.getStyle("height").toInt()==0){this.openAllSections(A)}else{this.closeAllSections(A)}}},openAllSections:function(B){this.asChanging=true;B.setStyle("border-width","1px 1px 1px 1px");var A=new Fx.Morph(B,$extend(this.options,{onComplete:this.allSectionsComplete.bind(this)}));A.start({height:[0,this.options.aSHeight]})
},closeAllSections:function(B){this.asChanging=true;var A=new Fx.Morph(B,$extend(this.options,{onComplete:this.allSectionsComplete.bind(this,B)}));A.start({height:[this.options.aSHeight,0]})},allSectionsComplete:function(A){if(A){this.asChanging=false;var B=A.innerHTML;if(A.getStyle("height").toInt()!=this.options.aSHeight){A.empty().innerHTML=B.replace(/Hide/ig,"Show");A.setStyle("border-width","1px 0 0 0")
}else{A.empty().innerHTML=B.replace(/Show/ig,"Hide")}}},_initSlider:function(){this.sliderPos=0;var A=$("woffRotator_parent");if(A){this.slCount=A.getElements("li").length;this.addSliderTimeout();A.addEvent("mouseover",function(){$clear(this.sliderTimeout)}.bind(this));A.addEvent("mouseleave",this.addSliderTimeout.bind(this));A.getElements("a.fdScrollPrevItem").addEvent("click",this._moveSlider.bind(this,-1));
A.getElements("a.fdScrollNextItem").addEvent("click",this._moveSlider.bind(this,1))}},_moveSlider:function(A){if(!this.sliding&A){this.sliding=true;var B=new Fx.Morph($("woffRotator_holder"),$merge(this.options,{duration:550,onComplete:this._moveSliderComplete.bind(this,A)})).start({opacity:0})}},_moveSliderComplete:function(B){var C=this.sliderPos+B;var F=0;var E=$("woffRotator");var A=E.getElements("li");
A[this.sliderPos].removeClass(this.options.classCurrent);if(C==this.slCount){C=0}else{if(C<0){C=this.slCount-1}}this.sliderPos=C;A[this.sliderPos].addClass(this.options.classCurrent);var D=new Fx.Morph($("woffRotator_holder"),$merge(this.options,{duration:450,onComplete:this._setFadeComplete.bind(this)})).start({opacity:1})},_setFadeComplete:function(){this.sliding=false},addSliderTimeout:function(){this.sliderTimeout=this._moveSlider.periodical(7000,this,1)
},_initTabs:function(){var B=$$("ul.fdTabs");this.tabIDs=[];if(B){for(var A=0,C=B.length;A<C;A++){B[A].addEvent("click",this._swapTab.create({bind:this,event:true,arguments:B[A].id}));this.tabIDs.push(B[A].id)}}},_swapTab:function(E,F){if(E&&E.target&&$(F)){new Event(E).stop();var B=$(E.target);var D=$(F).getChildren().removeClass("selected");if(!B.href){B=B.getFirst()}B.getParent().addClass("selected");
var A=$(F+"Pane");var C=$(B.href.substr(B.href.lastIndexOf("#")+1));if(A&&C){A.getChildren().setStyle("display","none");C.setStyle("display","block")}}},_initShareLinks:function(){var C=$("shareLink");if(C){var B=C.getElement("ul");var A=$("mobileLinks");C.addEvent("mouseenter",function(){B.setStyle("visibility","visible");A.setStyle("visibility","hidden")});C.addEvent("mouseleave",function(){B.setStyle("visibility","hidden");
A.setStyle("visibility","visible")})}},_initTempTVWrapOverlay:function(){var A=$("tvWrap");if(A&&A.getElements("span.overlay-button").length==0){var C=A.getElement("a.video-play");if(C){var B=new Element("span",{"class":"overlay-button"}).inject(C).innerHTML="Play"}}}});var smhage;function initSMHAGE(){smhage=new FD.smhage()}FD.register("SMHAGE")};

