
YUI({gallery:'gallery-2011.11.17-14-56'}).use('node','widget','gallery-carousel','substitute','json-parse','io',function(Y){YUI.add('sheknows-whatshot',function(Y){var FeedItems=function(el,owner){this.element=el;this.owner=owner;};FeedItems.prototype={clear:function(){this.element.setContent('');},hasItems:function(){return this.getItems().size()>0;},getItems:function(){return this.element.all('li');},setItems:function(items){this.clear();for(var i=0,len=items.length;i<len;i++){if(items[i].tagName&&items[i].tagName.toUpperCase()=='LI'){this.element.appendChild(items[i]);}
else{this.addItem(items[i]);}}},addItem:function(data){var li,tmpl=this.owner.get('itemTemplate'),maxLength=this.owner.get('maxLength');if(!data.text&&data.title){data.text=data.title;}
if(data.text.length>maxLength){data.text=data.text.substr(0,maxLength-3).replace(/\s+\S{0,2}$/,'')+'...';}
li=Y.Node.create('<li>'+Y.Lang.sub(tmpl,data)+'</li>');this.element.appendChild(li);}};function WhatsHot(element,config){this.element=Y.one('#'+element);WhatsHot.superclass.constructor.call(this,config);}
WhatsHot.NAME='whatsHot';WhatsHot.ATTRS={extended:{value:false,validator:Y.Lang.isBoolean},isCircular:{value:true,validator:Y.Lang.isBoolean},itemTemplate:{value:'<a href="{url}">{text}</a>'},footerLink:{setter:function(value){if(!this._footerLink){this._footerLink=this.footer.one('a');}
this._footerLink.setAttribute('href',value.url);if(!this._footerTitle){this._footerTitle=this._footerLink.one('em');}
this._footerTitle.setContent(value.text);}},title:{setter:function(value){if(!this._title){this._title=this.element.one('h2');}
this._title.setContent(value);}},limit:{value:7,validator:Y.Lang.isNumber},prefix:{value:''},maxLength:{value:30,validator:Y.Lang.isNumber,getter:function(varName,value){if(!this._maxLength){this._maxLength=value;if(this.body.ancestor('.subchannel-layout')){this._maxLength=41;}}
return this._maxLength;}}};Y.extend(WhatsHot,Y.Widget,{_carousel:null,_feedItems:null,_initialLoad:true,cache:{},handleSuccessResponse:function(id,response,argument){try{var data=Y.JSON.parse(response.responseText);this.updateState(data.results,argument);}
catch(e){}},updateState:function(items,link){this.set('footerLink',{url:link.getAttribute('href'),text:link.getContent()});if(this.get('extended')){this.set('title',link.getContent());}
if(items){if(items.length>this.get('limit')){items=items.slice(0,this.get('limit'));}
this._feedItems.setItems(items);link._feedItems=items;}},onItemSelected:function(){var index=this._carousel.get('selectedItem'),el=this._carousel.getElementForItem(index),link=el.one('a');if(this._initialLoad==true&&this._feedItems.hasItems()){this._initialLoad=false;link._feedItems=Array.prototype.slice.call(this._feedItems.getItems());return true;}
this._initialLoad=false;if(link._feedItems&&Y.Lang.isArray(link._feedItems)){return this.updateState(link._feedItems,link);}
try{var rawItems=link.getAttribute('data-items');if(rawItems&&rawItems.length>0){var items=Y.JSON.parse(rawItems);return this.updateState(items,link);}}
catch(e){}
Y.io(link.getAttribute('data-feed'),{on:{success:this.handleSuccessResponse},context:this,arguments:link});},renderUI:function(){var children;this.footer=this.element.one('.ft');this.header=this.element.one('.hd');this.body=this.element.one('.bd');children=this.body.get('children');this.elCarousel=children.item(0);this.elList=children.item(1);this._feedItems=new FeedItems(this.elList,this);this._initCarousel(this.elCarousel);this.element.one('.yui-carousel').setStyle('visibility','visible');},_initCarousel:function(el){this._carousel=new Y.Carousel({boundingBox:el,contentBox:el.one('ol'),numVisible:2,isCircular:this.get('isCircular'),hidePagination:false,width:217});el.all('a').each(function(el){el.on('click',function(evt){evt.preventDefault();});});this._carousel.on('itemSelected',this.onItemSelected,this);this._carousel.render();el.setStyle('width','');el.setStyle('height','');this._carousel.set('selectedItem',0);if(this._carousel.get('numItems')>this._carousel.get('numVisible')){this._carousel.get('contentBox').setStyle('marginLeft','14px');}
this.onItemSelected();}});Y.WhatsHot=WhatsHot;},'1.0',{requires:['node','widget','gallery-carousel','substitute','json-parse','io']});});YUI({gallery:'gallery-2011.11.17-14-56'}).use('node','widget','gallery-carousel','overlay','substitute',function(Y){var startAutoPlayEvent="startAutoPlay";var stopAutoPlayEvent="stopAutoPlay";var completeAutoPlayEvent="completeAutoPlay";var carousel,spotlight,oChildren,modules={},curModule;var autoScroll=function(){var index,currIndex=this.get('selectedItem');if(currIndex>=this.get("numItems")-1){index=0;}else{index=currIndex+1;}
this.scrollTo(Math.floor(index/this.get('numVisible'))*this.get('numVisible'));this.set('selectedItem',index);this.fire(completeAutoPlayEvent);}
var createCarousel=function(el,userConfig){if(!createCarousel.module){var Carousel=function(userConfig){Carousel.superclass.constructor.call(this,userConfig);};Carousel.NAME='carousel';Y.extend(Carousel,Y.Carousel,{startAutoPlay:function(){var self=this,timer=this.get("autoPlayInterval");if(timer>0){if(!Y.Lang.isUndefined(this._autoPlayTimer)){return;}
this.fire(startAutoPlayEvent);this._autoPlayTimer=setTimeout(function(){delete self._autoPlayTimer;autoScroll.call(self);},timer);}},stopAutoPlay:function(){if(!Y.Lang.isUndefined(this._autoPlayTimer)){clearTimeout(this._autoPlayTimer);this._autoPlayTimer=null;this.set("autoPlayInterval",0);this.fire(stopAutoPlayEvent);}},focus:function(){}});userConfig.boundingBox=el;userConfig.contentBox=el.one('ol');createCarousel.module=Carousel;}
return new createCarousel.module(userConfig);};function createOverlay(el){var oOverlay=new Y.Overlay({srcNode:el,visible:false,context:spotlight});oOverlay.render();return oOverlay;};YUI.add('sheknows-flashpanel',function(Y){function FlashPanel(element,config){this.element=Y.one('#'+element);FlashPanel.superclass.constructor.call(this,config);}
FlashPanel.NAME='flashPanel';Y.extend(FlashPanel,Y.Widget,{defaultConfig:{autoPlayInterval:6000,numVisible:4,isCircular:true,scrollIncrement:1},initializer:function(userConfig){this._oConfig=Y.merge(this.defaultConfig,userConfig||{});},renderUI:function(){var element_children=this.element.get('children');var carousel=createCarousel(element_children.item(0),this._oConfig);var spotlight=element_children.item(element_children.size()-1);oChildren=spotlight.get('children');oChildren.addClass('yui-overlay');carousel.on("itemSelected",this.carouselItemSelected,this);carousel.on(completeAutoPlayEvent,carousel.startAutoPlay);carousel.on("afterScroll",this._renderEvent);carousel.render();this.element.setStyle('width','');carousel.startAutoPlay();this.element.on('click',carousel.stopAutoPlay,carousel);this.fp=carousel;Y.one(element_children.item(1)).get('children').setStyle('visibility','visible');Y.one(element_children.item(0)).setStyle('visibility','visible');this.fp.scrollTo(1);this.fp.scrollTo(0);},syncUI:function(){this.element.one('.yui3-carousel-content').wrap('<div class="yui3-carousel-wrapper"></div>');},_renderEvent:function(){if(this.get('boundingBox').ancestor('.subchannel-layout')){this.get('boundingBox').setStyle('width','');}},carouselItemSelected:function(){var index=this.fp.get('selectedItem');var oId=oChildren.item(index).getAttribute('id')||oChildren.item(index).generateID();if(!modules[oId]){modules[oId]=createOverlay(oId);}
if(curModule==modules[oId]){return;}
if(curModule){curModule.hide();}
curModule=modules[oId];oChildren.hide();oChildren.item(index).show();curModule.show();var nextIndex=index+1;if(nextIndex==oChildren.size()){return;}
var nextPanel=oChildren.item(nextIndex);var className='slide_'+nextIndex;this.addSlideClass(nextPanel,className);},addSlideClass:function(elm,className)
{if(!elm.hasClass(className))
{elm.addClass(className);}}});Y.FlashPanel=FlashPanel;},'1.0',{requires:['node','widget','gallery-carousel','overlay','substitute']});});YUI().use('node','node-style','event-base','event-delegate','event-mouseenter','anim','anim-scroll',function(Y){window['MainNav']=(function(){var exports={},prettyDate,delayExecution,action_delay=310,page_width=764,selected_channel=null,Templater,clearMenu,ContentManager,navbar,active_channel_element,menu_el,menu_items,contentbox,channel_links,slider_container,slider_panels,slider_pagination,slider_pagination,slider_pagination_buttons,scroll_animation,prettyDate,isTouchSupported;prettyDate=function(time){var date=new Date((time||"").replace(/-/g,"/").replace(/[TZ]/g," ")),diff=(((new Date()).getTime()-date.getTime())/1000),day_diff=Math.floor(diff/86400);if(isNaN(day_diff)||day_diff<0){return;}
return day_diff==0&&(diff<60&&"just now"||diff<120&&"1 minute ago"||diff<3600&&Math.floor(diff/60)+" minutes ago"||diff<7200&&"1 hour ago"||diff<86400&&Math.floor(diff/3600)+" hours ago")||day_diff==1&&"Yesterday"||day_diff<7&&day_diff+" days ago"||day_diff<31&&Math.ceil(day_diff/7)+" weeks ago"||'on '+date.toGMTString().replace(/\s\d{2}:.*/,'');};isTouchSupported=function(eventName){var el=document.createElement('div');el.onclick=function(){};var isSupported=('ontouchstart'in el);if(!isSupported){el.setAttribute(eventName,'return;');isSupported=typeof el[eventName]=='function';}
el=null;return isSupported;};delayExecution=(function(){var delay_timer=null;return function(target_function,delay,target_args,context){if(delay_timer!==null){clearTimeout(delay_timer);delay_timer=null;}
if(target_args instanceof Array===false){if(typeof target_args!=='undefined'){target_args=[target_args];}else{target_args=[];}}
delay_timer=setTimeout((function(){target_function.apply(context,target_args);}),delay);};})();Templater=(function(){var templates={},formatters={};templates.ArticleColumn='<a href="/tags/{{tag}}"><img src="{{header}}" /></a>\
    <ul class="article-list">\
     {{#data}}<li>\
      {{#thumbnail}}<div class="article-image"><a href="{{url}}"> <img alt="thumb" src="{{thumbnail}}"></a></div>{{/thumbnail}}\
      <a class="article-heading" href="{{url}}">{{{title}}}</a>\
      <span class="date-posted">Posted {{prettydate}}</span>\
     </li>{{/data}}\
     <li class="more no-border center"><a href="/tags/{{tag}}" class="see-more-articles">View all articles &raquo;</a></li>\
    </ul>';templates.ContentList='<h4>{{title}}</h4>\
    <ul class="article-list">\
     {{#data}}<li><a href="{{url}}">{{{title}}}</a></li>{{/data}}\
    </ul>';templates.Contests='<h4>Contests</h4>\
    <a href="/contests/category/{{category}}" class="subtitle">{{human_category}}</a>\
    <ul class="article-list">\
     {{#data}}\
      <li>\
       {{#thumbnail}}<div class="article-image"><a href="{{url}}"><img alt="thumb" src="{{thumbnail}}"></a></div>{{/thumbnail}}\
       <a href="{{url}}" class="article-heading">{{{title}}}</a>\
       <span class="date-posted">Posted {{prettydate}}</span>\
      </li>\
     {{/data}}\
     <li class="bottom no-border"><a href="#" data-page="{{page}}" data-category="{{category}}" class="load-more-contests">See more contests</a><a href="/contests" class="see-more-contests">View all contests &raquo;</a></li>\
    </ul>';templates.Dare='<h4>Dare</h4>\
   <a href="{{channel_link}}" class="subtitle">{{channel_name}}</a>\
    {{#data}}<div class="dares-container">\
     <img src="http://cdn.womensunitedonline.com/{{dirname}}/s/{{basename}}" style="float: left"/><p>{{{title}}}</p>\
     <a href="/dares/{{id}}/{{slug}}" class="button">Go</a>\
    </div>{{/data}}';templates.EditorsPick='{{#data}}<h4>Editor\'s Pick</h4>\
    <a class="subtitle" href="{{url}}">{{{title}}}</a>\
    <div class="editor-img"><a href="{{url}}"><img src="http://cdn.womensunitedonline.com/{{dirname}}/{{basename}}"></a></div>{{/data}}';templates.ExternalLink='{{#data}}<h4>{{{title}}}</h4>\
    <ul class="feed-item center">\
     <li class="image-container"><a href="{{url}}"><img src="http://cdn.womensunitedonline.com/{{dirname}}/{{basename}}"></a></li>\
     <li><p class="description"><a href="{{url}}">{{blurb}}</a></p></li>\
     <li class="nav-more more"><a href="{{url}}">Visit website &raquo;</a></li>\
    </ul>{{/data}}';templates.Featured='{{#content_feed}}<h4>{{title}}</h4>{{/content_feed}}\
    {{#data}}<div class="editor-img"><a href="{{url}}"><img src="http://cdn.womensunitedonline.com/{{dirname}}/{{basename}}"></a></div>{{/data}}';templates.Galleries='<h4>Galleries</h4>\
    <ul class="nav-photo-gallery">\
    {{#galleries}}{{#Gallery}}\
    <li>\
     <a class="gallery-image" href="{{url}}"><img src="{{thumbnail}}" border="0" alt="{{title}}"></a>\
     <a class="gallery-title" href="{{url}}">{{{title}}</a>\
     <a class="gallery-number" href="{{url}}">({{photo_count}} photos)</a>\
    </li>\
    {{/Gallery}}{{/galleries}}\
    </ul>';templates.GiftGuide='<h4>Gift Guides</h4>\
    <a class="subtitle" href="{{channel_url}}">{{{channel_title}}}</a>\
    <ul class="nav-photo-gallery">\
    {{#data}}\
    <li>\
     <a class="gallery-image" href="{{url}}"><img src="http://cdn.womensunitedonline.com/{{dirname}}/view/{{basename}}" border="0" alt="{{title}}"></a>\
     <a class="gallery-title" href="{{url}}">{{{title}}</a>\
    </li>\
    {{/data}}\
    </ul>\
    <div class="view-all more">\
     <a href="{{channel_url}}" class="view-all">View all &raquo;</a><br />\
    </div>';templates.LatestArticles='<h4>Latest Articles</h4>\
    <a href="{{channel_link}}" class="subtitle">{{channel_name}}</a>\
    <ul class="article-list">\
    {{#articles}}{{#Article}}<li>\
    {{#image_115x115}}<div class="article-image"><a href="{{url}}"> <img alt="thumb" src="{{image_115x115}}"></a></div>{{/image_115x115}}\
    <a href="{{url}}" class="article-heading" title="{{title_full}}">{{{title}}}</a>\
    <span class="date-posted">Posted {{prettydate}}</span>\
    </li>{{/Article}}{{/articles}}\
    <li class="bottom no-border"><a href="#" data-page="{{page}}" data-channel="{{channel_url}}" class="load-more-articles">See more articles</a><a href="{{channel_link}}" class="see-more-articles">View all articles &raquo;</a></li>\
    </ul>';templates.Printable='<h4>Printables</h4>\
    <a class="subtitle" href="{{channel_url}}">{{{channel_title}}}</a>\
    <ul class="nav-photo-gallery">\
    {{#data}}\
    <li>\
     <a class="gallery-image" href="{{url}}"><img src="http://cdn.womensunitedonline.com/{{dirname}}/thumb/{{basename}}" border="0" alt="{{title}}"></a>\
     <a class="gallery-title" href="{{url}}">{{{title}}</a>\
    </li>\
    {{/data}}\
    </ul>\
    <div class="center more"><a class="view-all" href="/kids-activity-center/coloring-pages">View all printables &raquo;</a></div>';templates.Quiz='<h4>Quizzes</h4>\
    <ul>\
    {{#data}}\
    <li>\
     <p class="question"><a href="/{{channel}}/quizzes/{{slug}}">{{{title}}}</a></p>\
    </li>\
    {{/data}}\
    </ul>\
    <div class="center no-border more">\
     <a href="/quizzes" class="view-all">View all quizzes &raquo;</a><br />\
    </div>';templates.StealTheLook='{{#data}}<h4>Steal the Look</h4>\
     <a class="subtitle" href="/steal-the-look/{{type}}">{{{type}}}</a>\
     <a href="/steal-the-look/{{type}}/{{slug}}">\
     <img src="http://cdn.womensunitedonline.com/{{dirname}}/{{basename}}" />\
     <div>\
      <span class="title">{{{title}}}</span>\
      <span class="blurb">{{{blurb}}}</span>\
     </div></a>{{/data}}';templates.SKTVShow='{{#data}}<ul class="nav-videos" data-feed="{{rssfeed}}" data-thumbnail="http://cdn.womensunitedonline.com/{{video_dirname}}/{{video_basename}}">\
     <li class="image-container">\
       <a href="{{url}}"><img src="{{logo}}" border="0"></a>\
     </li>\
     <li class="video-container">\
       <p class="title"><a href="{{url}}">{{video_title}}</a></p>\
       <div class="insertvideo"></div>\
     </li>\
     <li class="center more">\
      <a href="{{url}}" class="view-all">See all episodes &raquo;</a><br />\
     </li>\
    </ul>{{/data}}';templates.Videos='{{#data}}<h4>Watch</h4>\
    <ul class="nav-videos">\
     <li class="video-container">\
      <object id="videoplayer_'+(player_id=Math.ceil(Math.random()*10000))+'" class="SpringboardPlayer" type="application/x-shockwave-flash" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" height="115" width="180">\
       <param name="movie" value="http://cdn.springboard.gorillanation.com/mediaplayer/springboard/mediaplayer.swf?config={\'externalConfiguration\':\'http://cdn.springboard.gorillanation.com/superconfig/sk038.js\',\'playlist\':\'{{rssfeed}}?limit=1\'}">\
       <param name="allowFullScreen" value="true">\
       <param name="allowscriptaccess" value="always">\
       <param name="wmode" value="transparent">\
       <param name="autoplay" value="true">\
       <embed src="http://cdn.springboard.gorillanation.com/mediaplayer/springboard/mediaplayer.swf?config={\'externalConfiguration\':\'http://cdn.springboard.gorillanation.com/superconfig/sk038.js\',\'playlist\':\'{{rssfeed}}?limit=1\'}" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" wmode="transparent" height="115" width="180">\
      </object>\
      <p class="description"><a href="{{url}}">{{video_title}}</a></p>\
     </li>\
     <li class="image-container">\
       <a href="{{url}}"><img src="{{logo}}" border="0"></a>\
       <p class="description"><a href="{{url}}">{{description}}</a></p>\
     </li>\
    </ul>{{/data}}';formatters.defaultFormatter=function(module,channel){return Mustache.to_html(templates[module['name']],{data:module['data'],channel_name:channel.channel_name,channel_link:channel.articles_url});};formatters.ArticleColumn=function(module,channel){var i,articles=module['data'];channel=module.Channel||channel;for(i=0;i<articles.length;i++){if(i!=0){articles[i].thumbnail=null;delete articles[i].thumbnail;}
articles[i].prettydate=prettyDate(articles[i].date_active);}
return Mustache.to_html(templates.ArticleColumn,{data:articles,tag:module['tag'],header:module['header']});};formatters.ContentList=function(module,channel){return Mustache.to_html(templates.ContentList,{category:module['category'],title:module['title'],data:module['data']});};formatters.Contests=function(module,channel){var i,contests=module['data'];for(i=0;i<contests.length;i++){contests[i].prettydate=prettyDate(contests[i].start_date);}
return Mustache.to_html(templates.Contests,{category:module['category'],human_category:module['human_category'],data:contests,page:module['page']});};formatters.Featured=function(module,channel){return Mustache.to_html(templates.Featured,{data:module['data'],content_feed:module['ContentFeed'],channel_name:channel.channel_name,channel_link:channel.articles_url});};formatters.Galleries=function(module,channel){var i,galleries=module['data'];for(i=0;i<galleries.length;i++){galleries[i].Gallery.thumbnail='http://cdn.womensunitedonline.com/filter/s/gallery/'+galleries[i].Image.Image.basename;galleries[i].Gallery.photo_count=galleries[i].Image.Album.albums_image_count;}
return Mustache.to_html(templates.Galleries,{galleries:galleries,channel_name:channel.channel_name});};formatters.GiftGuide=function(module,channel){return Mustache.to_html(templates[module['name']],{data:module['data'],channel_title:module['channel_title'],channel_url:module['channel_url'],channel_name:channel.channel_name,channel_link:channel.articles_url});};formatters.LatestArticles=function(module,channel){var i,articles=module['data'];channel=module.Channel||channel;for(i=0;i<articles.length;i++){if(i!=0){articles[i].Article.image_115x115=null;delete articles[i].Article.image_115x115;}
articles[i].Article.prettydate=prettyDate(articles[i].Article.date_active);articles[i].Article.title_full=articles[i].Article.title;if(i!==0&&articles[i].Article.title.length>60){articles[i].Article.title=articles[i].Article.title.match(/([^\s][\s\S]{0,60}(?!=[^\s]))([\s]|$)/)[1]+'...';}}
return Mustache.to_html(templates.LatestArticles,{articles:articles,page:module['page'],channel_name:channel.channel_name,channel_url:channel.url_name,channel_link:channel.articles_url});};formatters.Printable=function(module,channel){return Mustache.to_html(templates[module['name']],{data:module['data'],channel_title:module['channel_title'],channel_url:module['channel_url'],channel_name:channel.channel_name,channel_link:channel.articles_url});};formatters.StealTheLook=function(module,channel){return Mustache.to_html(templates.StealTheLook,{type:module['type'],data:module['data']});};return{formatModule:function(module,channel){var module_el=document.createElement('DIV');module_el.className=module['name']+' '+(module['class']||'');if(formatters[module['name']]){module_el.innerHTML=formatters[module['name']](module,channel);}else{module_el.innerHTML=formatters.defaultFormatter(module,channel);}
return module_el;}};})();ContentManager=(function(){var exports={},cache={},request=null;getContent=function(cache_key,data_url,callback){var script_tag,done=false;if(request&&request.conn&&request.readyState!==4){request.conn.abort();}
if(typeof cache[cache_key]!=='undefined'){callback(cache[cache_key]);return;}
data_url='http://cdn.womensunitedonline.com/nav/dropdown/?r='+data_url+'&t='+Math.floor(new Date().getTime()/600000);script_tag=document.createElement('SCRIPT');script_tag.src=data_url;script_tag.onload=script_tag.onreadystatechange=function(){if(!done&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){done=true;cache[cache_key]=ContentManager.latest_data;}}
document.body.appendChild(script_tag);};exports.latest_data=null;exports.target_module=null;exports.abort=function(){if(request&&request.conn&&request.readyState!==4)request.conn.abort();};exports.getChannelContent=function(channel_name,callback){var cache_key='channels-channel:'+channel_name,data_url='/nav/'+channel_name+'.js';getContent(cache_key,data_url,callback);};exports.getArticles=function(channel_name,page,callback){var cache_key='articles-channel:'+channel_name+'-page:'+page,data_url='/nav/'+channel_name+'/articles/page:'+page+'.js';getContent(cache_key,data_url,callback);};exports.getContests=function(category_name,page,callback){var cache_key='contests-channel:'+category_name+'-page:'+page,data_url='/nav/contests/'+category_name+'/page:'+page+'.js';getContent(cache_key,data_url,callback);};exports.getSKTVShow=function(show_slug,callback){var cache_key='sktvshow-show:'+show_slug,data_url='/nav/sktvshow/'+show_slug+'.js';getContent(cache_key,data_url,callback);};exports.getStealTheLook=function(category_slug,callback){var cache_key='stealthelook-category:'+category_slug,data_url='/nav/stealthelook/'+category_slug+'.js';getContent(cache_key,data_url,callback);};exports.updateModule=function(module_index,content){slider_panels.removeChild(slider_panels.get('children').item(module_index));slider_panels.insertBefore(content,slider_panels.get('children').item(module_index));};exports.whichPanelAmI=function(element){var i;element;while(element.get('parentNode')!==slider_panels){element=element.get('parentNode');}
for(i=0;i<slider_panels.get('children').size();i++){if(slider_panels.get('children').item(i)===element){return i;}}};exports.selectPage=function(page,easing,duration){if(typeof easing==='undefined'){easing='easeBoth';}
if(typeof duration==='undefined'){duration=.5;}
for(i=1;i<slider_pagination_buttons.get('children').size()-1;i++){if(i===page){slider_pagination_buttons.get('children').item(i).addClass('selected');}else{slider_pagination_buttons.get('children').item(i).removeClass('selected');}}
scroll_animation.stop(false);scroll_animation.set('to.scroll.0',(page-1)*page_width);scroll_animation.set('easing',easing);scroll_animation.set('duration',duration);scroll_animation.run();if(page===1){slider_pagination_buttons.get('children').item(0).setStyle('opacity','.4');}else{slider_pagination_buttons.get('children').item(0).setStyle('opacity','1');}
if(page===slider_pagination_buttons.get('children').size()-2){slider_pagination_buttons.get('children').item(slider_pagination_buttons.get('children').size()-1).setStyle('opacity','.4');}else{slider_pagination_buttons.get('children').item(slider_pagination_buttons.get('children').size()-1).setStyle('opacity','1');}
var feed_url,thumbnail_url,video_container;for(i=0;i<slider_panels.get('children').size();i++){if(slider_panels.get('children').item(i).hasClass('SKTVShow')){feed_url=slider_panels.get('children').item(i).one('ul').getAttribute('data-feed');thumbnail_url=slider_panels.get('children').item(i).one('ul').getAttribute('data-thumbnail');video_container=slider_panels.get('children').item(i).one('.video-container .insertvideo')
if(i>=(page-1)*3&&i<page*3){video_container.setContent('<object id="videoplayer_'+(player_id=Math.ceil(Math.random()*10000))+'" class="SpringboardPlayer" type="application/x-shockwave-flash" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" height="153" width="239">\
        <param name="movie" value="http://cdn.springboard.gorillanation.com/mediaplayer/springboard/mediaplayer.swf?config={\'externalConfiguration\':\'http://cdn.springboard.gorillanation.com/superconfig/sk038.js\',\'playlist\':\''+feed_url+'\'}">\
        <param name="allowFullScreen" value="true">\
        <param name="allowscriptaccess" value="always">\
        <param name="wmode" value="transparent">\
        <param name="autoplay" value="true">\
        <embed src="http://cdn.springboard.gorillanation.com/mediaplayer/springboard/mediaplayer.swf?config={\'externalConfiguration\':\'http://cdn.springboard.gorillanation.com/superconfig/sk038.js\',\'playlist\':\''+feed_url+'\'}" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" wmode="transparent" height="153" width="239">\
       </object>');}else{video_container.setContent('<img src="'+thumbnail_url+'" />');}}}
sbhtml.createSpringboards(null);};exports.selectChannelLink=function(link_el){var i;for(i=0;i<channel_links.get('children').size();i++){if(channel_links.get('children').item(i)===link_el.get('parentNode')){channel_links.get('children').item(i).addClass('selected');}else{channel_links.get('children').item(i).removeClass('selected');}}}
return exports;})();clearMenu=function(clear_color){var i;selected_channel=null;for(i=0;i<menu_items.size();i++){if(menu_items.item(i).hasClass('selected')){menu_items.item(i).removeClass('selected');break;}}
if(active_channel_element){active_channel_element.addClass('active');}
contentbox.setStyle('display','none');slider_pagination_buttons.setStyle('display','none');if(clear_color){navbar.setStyle('backgroundColor','');menu_items.setStyle('borderLeftColor','');}};exports.renderMenu=function(subnav){var i,link_item,link_el,module,page_button,modules_width=0;for(i=0;i<menu_items.size();i++){if(menu_items.item(i).hasClass('selected')){if(menu_items.item(i).getAttribute('data-menuname')!==subnav.Channel.url_name){return;}
break;}}
ContentManager.latest_data=subnav;slider_container.removeClass('loading');selected_channel=subnav.Channel;if(contentbox.getStyle('display')==='block'&&selected_channel.colors){window.navbar=navbar;navbar.setStyle('backgroundColor','#'+selected_channel.colors.primary);menu_items.setStyle('borderLeftColor','#'+selected_channel.colors.darkened);}
for(i=0;i<subnav.NavItems.length;i++){link_item=document.createElement('LI');link_el=document.createElement('A');link_el.setAttribute('href',subnav.NavItems[i].url);link_el.setAttribute('data-title',subnav.NavItems[i].title);link_el.setAttribute('data-blurb',subnav.NavItems[i].blurb);link_el.setAttribute('data-basename',subnav.NavItems[i].basename);link_el.setAttribute('data-dirname',subnav.NavItems[i].dirname);link_span=document.createElement('SPAN');link_span.innerHTML=subnav.NavItems[i].title;link_el.appendChild(link_span);link_item.appendChild(link_el);channel_links.appendChild(link_item);}
for(i in subnav.Modules){if(subnav.Modules[i].name.length===0){continue;}
module=Templater.formatModule(subnav.Modules[i],selected_channel);if((parseInt(i,10)-1)%3===0){module.className+=' middle';}
slider_panels.appendChild(module);modules_width+=module.offsetWidth;if(modules_width%page_width===0){page_button=document.createElement('DIV');page_button.className=(modules_width===page_width)?'button selected':'button';page_button.setAttribute('data-page',(modules_width/page_width));slider_pagination_buttons.insertBefore(page_button,slider_pagination_buttons.get('children').item(slider_pagination_buttons.get('children').size()-1));}}
slider_panels.setStyle('width',modules_width+'px');slider_pagination_buttons.setStyle('width',((modules_width/page_width)*17)+(32*2)+'px');slider_container.set('scrollLeft',0);if(modules_width/page_width>1){slider_pagination_buttons.setStyle('display','block');}
slider_pagination_buttons.get('children').item(0).setStyle('opacity','.4');ContentManager.selectPage(1);};exports.renderModule=function(module){ContentManager.latest_data=module;selected_channel=module.Channel||selected_channel;if(ContentManager.target_module!==null){module=Templater.formatModule(module,selected_channel);if((ContentManager.target_module-1)%3===0){module.className+=' middle';}
ContentManager.updateModule(ContentManager.target_module,module);ContentManager.selectPage(Math.floor(ContentManager.target_module/3)+1);ContentManager.target_module=null;}};exports.selectMenu=function(menu_item){var i,menuname=menu_item.getAttribute('data-menuname');if(selected_channel&&selected_channel.url_name===menuname)return false;clearMenu();if(active_channel_element){active_channel_element.removeClass('active');}
if(!menuname){clearMenu(true);return false;}
slider_container.set('className','slider-container '+menuname);menu_item.addClass('selected');contentbox.setStyle('display','block');channel_links.setContent('');slider_panels.setContent('');var children_count=slider_pagination_buttons.get('children').size();for(i=0;i<children_count-2;i++){slider_pagination_buttons.removeChild(slider_pagination_buttons.get('children').item(1));}
slider_container.addClass('loading');ContentManager.getChannelContent(menuname,MainNav.renderMenu);};Y.on('domready',function(){navbar=Y.one('#navbar');if(!navbar){return;}
active_channel_element=navbar.one('.ui-navbaritem.active');menu_el=navbar.one('#mainnav-menus');if(menu_el===null){return;}
menu_items=menu_el.all('li');contentbox=navbar.one('#mainnav-contentbox');channel_links=contentbox.one('.channel-links');slider_container=contentbox.one('.slider-container');slider_panels=contentbox.one('.slider-panels');slider_pagination=contentbox.one('#mainnav_pagination');slider_pagination_buttons=slider_pagination.one('#pagination_buttons');scroll_animation=new Y.Anim({node:slider_container,duration:.5,easing:'easeBoth',to:{scroll:[0,0]}});slider_pagination_buttons.delegate('click',function(e){var i,next_page;ContentManager.selectPage(parseInt(e.currentTarget.getAttribute('data-page'),10));},'div.button');slider_pagination_buttons.delegate('click',function(e){var i,next_page;direction=this.hasClass('left')?-1:1;for(i=1;i<slider_pagination_buttons.get('children').size()-1;i++){if(slider_pagination_buttons.get('children').item(i).hasClass('selected')){slider_pagination_buttons.get('children').item(i).removeClass('selected');next_page=i+direction;if(next_page<1){next_page=1;}else if(next_page===slider_pagination_buttons.get('children').size()-1){next_page=slider_pagination_buttons.get('children').size()-2;}
break;}}
ContentManager.selectPage(next_page);},'div.arrow');channel_links.delegate('mouseenter',function(e){delayExecution(function(){var channel,category,show,url=e.currentTarget.getAttribute('href');if(selected_channel.url_name==='sheknowstv'){return false;}
ContentManager.abort();ContentManager.selectChannelLink(e.currentTarget);if(channel=url.match(/^(\/.*\/([a-zA-Z0-9-]+)\/articles|\/channels\/([a-zA-Z0-9-_]+))/)){channel=channel[2]||channel[3];if(selected_channel.url_name!==channel){slider_panels.get('children').item(0).setContent('<img src="http://cdn.womensunitedonline.com/interface/ajaxSpinner.gif" class="loading_spinner" />');}
ContentManager.target_module=0;ContentManager.getArticles(channel,1,MainNav.renderModule);}else if(category=url.match(/\/contests\/category\/(.*)/)){category=category[1];slider_panels.get('children').item(0).setContent('<img src="http://cdn.womensunitedonline.com/interface/ajaxSpinner.gif" class="loading_spinner" />');ContentManager.target_module=0;ContentManager.getContests(category,1,MainNav.renderModule);}else if(show=url.match(/\/sheknowstv\/([a-zA-Z0-9-]+)/)){show=show[1];slider_panels.get('children').item(0).setContent('<img src="http://cdn.womensunitedonline.com/interface/ajaxSpinner.gif" class="loading_spinner" />');ContentManager.target_module=0;ContentManager.getSKTVShow(show,MainNav.renderModule);}else if(category=url.match(/\/steal-the-look\/([a-zA-Z-0-9-]+)/)){category=category[1];slider_panels.get('children').item(0).setContent('<img src="http://cdn.womensunitedonline.com/interface/ajaxSpinner.gif" class="loading_spinner" />');ContentManager.target_module=0;ContentManager.getStealTheLook(category,MainNav.renderModule);}else{ContentManager.updateModule(0,Templater.formatModule({'name':'ExternalLink','class':'sk-w-5','data':{title:e.currentTarget.getAttribute('data-title'),url:url,dirname:e.currentTarget.getAttribute('data-dirname'),basename:e.currentTarget.getAttribute('data-basename'),blurb:e.currentTarget.getAttribute('data-blurb')}},selected_channel));}},action_delay);},'li a');channel_links.delegate('mouseleave',function(e){delayExecution(function(){},1);},'li a');slider_panels.delegate('click',function(e){var channel,next_page;e.currentTarget.addClass('loading');next_page=parseInt(e.currentTarget.getAttribute('data-page'),10)+1;ContentManager.target_module=ContentManager.whichPanelAmI(e.currentTarget);ContentManager.getArticles(e.currentTarget.getAttribute('data-channel'),next_page,MainNav.renderModule);e.preventDefault();e.stopPropagation();return false;},'a.load-more-articles');slider_panels.delegate('click',function(e){var channel,next_page;e.currentTarget.addClass('loading');next_page=parseInt(e.currentTarget.getAttribute('data-page'),10)+1;ContentManager.target_module=ContentManager.whichPanelAmI(e.currentTarget);ContentManager.getContests(e.currentTarget.getAttribute('data-category'),next_page,MainNav.renderModule);e.preventDefault();e.stopPropagation();return false;},'a.load-more-contests');menu_el.all('a').on('click',function(e){var i,el=e.currentTarget,block_request=true,menuname=el.get('parentNode').getAttribute('data-menuname');if(isTouchSupported()&&menuname){if(selected_channel!==null&&menuname===selected_channel.url_name){block_request=false;}
if(block_request){e.preventDefault();e.stopPropagation();return false;}}});(function(){var is_swiping=false,swipe_start=null,start_coords={x:null,y:null},last_coords={x:null,y:null},change={x:null,y:null},preventdefault=false,update;update=function(e){if(preventdefault){e.preventDefault();}
if(!is_swiping){return false;}
if(last_coords.x!==null){change.x=last_coords.x-e.touches[0].pageX;change.y=last_coords.y-e.touches[0].pageY;slider_container.set('scrollLeft',slider_container.get('scrollLeft')+=change.x);}
last_coords.x=e.touches[0].pageX;last_coords.y=e.touches[0].pageY;};if(isTouchSupported()){slider_panels.getDOMNode().addEventListener('touchstart',function(e){swipe_start=new Date().getTime();is_swiping=true;start_coords.x=e.touches[0].pageX;start_coords.y=e.touches[0].pageY;update(e);});slider_panels.getDOMNode().addEventListener('touchmove',function(e){preventdefault=true;update(e);});slider_panels.getDOMNode().addEventListener('touchend',function(e){var swipe_duration,direction,target_page;swipe_duration=new Date().getTime()-swipe_start;if(swipe_duration<=350&&Math.abs(last_coords.x-start_coords.x)>=150){direction=(last_coords.x-start_coords.x>0)?-1:1;for(i=1;i<slider_pagination_buttons.get('children').size()-1;i++){if(slider_pagination_buttons.get('children').item(i).hasClass('selected')){slider_pagination_buttons.get('children').item(i).removeClass('selected');target_page=i+direction;if(target_page<1){target_page=1;}else if(target_page===slider_pagination_buttons.get('children').size()-1){target_page=slider_pagination_buttons.get('children').size()-2;}
break;}}
ContentManager.selectPage(target_page,'easeNone',.1);}else{target_page=Math.round(slider_container.scrollLeft/page_width)+1;ContentManager.selectPage(target_page,'easeNone');}
is_swiping=false;preventdefault=false;last_coords.x=last_coords.y=null;});}})();Y.one('#mainnav-menus').delegate('mouseenter',function(e){delayExecution(exports.selectMenu,action_delay,e.currentTarget);},'li');contentbox.on('mouseenter',function(e){delayExecution(function(){},1);});menu_el.on('mouseleave',function(e){delayExecution(function(e){if(!e.relatedTarget.ancestor('.contentbox')){clearMenu(true);}},action_delay,e);});contentbox.on('mouseleave',function(e){delayExecution(clearMenu,action_delay+50,true);});});return exports;})();});YUI.add('skui-block',function(Y){var js=Y.Lang,dom=Y.Node;Y.namespace('skui').Block=Y.Base.create('skui-block',Y.Widget,[Y.WidgetStdMod],{CSS_CLASS:'ui-block',bindUI:function(){var block=this,tmpl=block.get('itemTemplate'),bd=Y.Node.create("<ul></ul>");block.set('headerContent',this.createHeader(block.get('title')||" "));block.get('links').each(function(link){bd.append(Y.substitute(tmpl,link));})
block.set('bodyContent',bd);if(this.get('image')){var img=this.get('image');block.addClass(this.getClassName('image'));block.headerNode.setStyle('backgroundImage','url('+img+')');}
block.addClass(block.CSS_CLASS);},createHeader:function(title){var hd;if(this.get('url')){hd=document.createElement('a');hd.href=this.get('url');hd.setAttribute('target','_parent');}
else{hd=document.createElement('span');}
hd.className=this.getClassName('title');hd.innerHTML=title;return hd;},addClass:function(name){this.get('boundingBox').addClass(name);}},{ATTRS:{title:{},image:{setter:function(val){return val;}},url:{value:null},links:{setter:function(val){return new Y.ArrayList(val);}},parent:{setter:function(val){return this.parent=val;}},itemTemplate:{value:'<li><a href="{url}" rel="nofollow">{title}</a></li>'},maxLength:{getter:function(){return this.parent.get('maxLength');}}}});Y.namespace('skui').BlockList=Y.Base.create('skui-blocklist',Y.Widget,[],{CSS_CLASS:'ui-blocks',bindUI:function(){var blockList=this,boundingBox=blockList.get('boundingBox');boundingBox.addClass(blockList.CSS_CLASS);boundingBox.addClass(blockList.get('class'))
blockList.element=blockList.get('contentBox');if(boundingBox.get('winHeight')>=boundingBox.get('docHeight')){blockList.sendRequest();}
else{Y.once("scroll",Y.bind(blockList.initRequest,blockList));}},initRequest:function(){this.sendRequest();},sendRequest:function(){var url=this.get('url'),cb={on:{success:Y.bind(this.processResponse,this),failure:Y.bind(this.processFailure,this)}};this._tid=Y.io(url,cb);},processResponse:function(id,o,args){try{var data=Y.JSON.parse(o.responseText);this.setItems(data.results);if(this.size()>0){this.show();}}
catch(e){this.processFailure(o);}},processFailure:function(o){this.hide();},setItems:function(items){var max=Math.min(this.get('maxItems'),items.length);for(var i=0,len=max;i<len;i++){var child=this.addItem(items[i]);if(i==0){child.addClass('first-child');}}},addItem:function(item){var block=this.get('childBlock'),child=new block(item);child.set('parent',this);child.render(this.element);return child;},size:function(){return this.element.get('children').size();}},{ATTRS:{maxItems:{value:8},maxLength:{value:65},itemTemplate:{value:'<a href="{url}">{title}</a>'},childBlock:{value:Y.skui.Block},url:{value:'/blogs/entertainment-footer.json'},"class":{validator:js.isString,setter:function(val){if(this.element&&this.element.addClass){this.element.addClass(val);}
return val;}}}});},'@VERSION@',{requires:['node','io-base','base','json','substitute','widget-stdmod','arraylist']});YUI().use("node","event-mouseenter",function(Y){Y.on('domready',function(){var subNav=Y.one('div.ui-control-select #video-nav-list');var node=Y.one('div.ui-control-select');if(node){node.on('click',function(e){if(subNav.getStyle('display')=='none'){subNav.setStyle('display','block');e.preventDefault();e.stopPropagation();return false;}else if(subNav.getStyle('display')=='block'){subNav.setStyle('display','none');}});subNav.on('mouseleave',function(){subNav.setStyle('display','none');});Y.one(document.body).on('click',function(){subNav.setStyle('display','none');});}});});YUI.add('skui-rating',function(Y){var Lang=Y.Lang,Node=Y.Node,Event=Y.Event,WIDGET_NAME='skui-rating',CONTENT_BOX='contentBox',Rating;Rating=Y.Base.create(WIDGET_NAME,Y.Widget,[],{lastXY:[0,0],running:false,_moveHandler:null,initializer:function(){var widget=this;widget.element=widget.get(CONTENT_BOX);widget.averageNode=widget.get('averageNode');widget.activeNode=widget.get('activeNode');widget.totalNode=widget.get('totalNode');widget.inputNode=widget.get('inputNode');widget.after({'ratingChange':widget._afterRatingChange,'averageRatingChange':widget._afterAverageRatingChange});},bindUI:function(){var widget=this,elm=widget.element;elm.on({'mouseover':Y.bind(widget._onMouseOverEvent,widget),'click':Y.bind(widget._onMouseClickEvent,widget)});},_onMouseOverEvent:function(e){var widget=this,elm=widget.element,handler;widget._moveHandler=elm.on('mousemove',Y.bind(widget._onMouseMoveEvent,widget));elm.on('mouseout',Y.bind(widget._stop,widget));widget.xy=elm.getXY();widget.width=widget.get('width');widget.activeNode.show();widget.averageNode.hide();},_stop:function(){var widget=this,elm=widget.element,timeout;timeout=function(){if(widget._moveHandler){widget._moveHandler.detach();widget._moveHandler=null;}
widget.activeNode.hide();widget.averageNode.show();widget.running=false;};timeout.call(this);},_update:function(){var widget=this,delta,rating;if(widget.running){return;}
delta=[widget.lastXY[0]-widget.xy[0],widget.lastXY[1]-widget.xy[1]];widget.set('rating',(delta[0]/widget.get('width'))*100);},_onMouseClickEvent:function(evt){var widget=this,target=evt.target,el=widget.element,form,rating;if(el.contains(target)){rating=widget.inputNode;if(rating){form=rating.ancestor('form');Node.getDOMNode(form).submit();}}},_onMouseMoveEvent:function(evt){this.lastXY=[evt.clientX,evt.clientY];this._update();},_afterRatingChange:function(e){this._uiSetRating(e.newVal);},_afterAverageRatingChange:function(e){this._uiSetAverageRating(e.newVal);},_setNode:function(val,name){this[name]=Y.one(val);},_setRating:function(rating,name){var widget=this,snapTo=widget.get('snapTo'),mod;if(rating%snapTo===0){return rating;}
mod=rating%snapTo;if(mod>snapTo/2||widget.roundTo=='ceil'){return Math.round(rating-mod+snapTo);}
return Math.round(rating-mod);},_setAverageRating:function(val,name){return val;},_uiSetRating:function(val){var widget=this;widget._setWidth(widget.activeNode,val);if(!widget.inputNode){return;}
widget.inputNode.set('value',val);},_uiSetAverageRating:function(val){this._setWidth(this.averageNode,val);},_setWidth:function(node,width){node.setStyle('width',width+'%');}},{NAME:WIDGET_NAME,ATTRS:{snapTo:{value:20},roundTo:{value:'ceil'},averageNode:{setter:"_setNode"},totalNode:{setter:"_setNode"},activeNode:{setter:"_setNode"},inputNode:{setter:"_setNode"},width:{broadcast:false,getter:function(){return this.get('contentBox').get('clientWidth');}},rating:{setter:"_setRating"},averageRating:{setter:"_setAverageRating"}},HTML_PARSER:{averageNode:'.rtg-stars-average',totalNode:'.rtg-stars-total',activeNode:'.rtg-stars-active',inputNode:function(srcNode){var form=srcNode.ancestor('form');if(form){return form.one('#RatingRating');}}}});Y.namespace('skui').Rating=Rating;},'@VERSION@',{requires:['node','event','widget','widget-stdmod']});YUI.add('skui-accordion',function(Y){var Lang=Y.Lang,Node=Y.Node,SKUI=Y.skui,CONTENT_BOX='contentBox',WIDGET_NAME='skui-accordion',ITEM_CHOSEN='itemChosen';var Accordion=Y.Base.create(WIDGET_NAME,Y.Widget,[],{initializer:function(config){this._initEvents();this.after('render',Y.bind(this._afterRender,this));},bindUI:function(){var contentBox=this.get(CONTENT_BOX);contentBox.delegate('click',Y.bind(this._onClick,this),'li');},hideAll:function(){var contentBox=this.get(CONTENT_BOX),children=contentBox.get('children');children.removeClass(this.get('expandedClass'));return;},_onClick:function(e){var elm=e.currentTarget,exp=this.get('expandedClass'),contentBox=this.get(CONTENT_BOX),children=contentBox.get('children');if(contentBox.get('id')!==elm.get('parentNode').get('id')){e.stopPropagation();return;}
if(elm.hasClass(exp)){this.hideAll();}else{this.hideAll();elm.addClass(exp);this.fire(ITEM_CHOSEN,{item:e.currentTarget});}},_initEvents:function(){this.publish(ITEM_CHOSEN,{defaultFn:this._onItemChosen});},_afterRender:function(e){}},{ATTRS:{expandedClass:{value:'expanded'}}});Y.namespace('skui').Accordion=Accordion;},'@VERSION@',{requires:['event','widget','widget-stdmod']});YUI.add('sk-tabview',function(Y){var ACTIVE_CLASS='selected';Y.Plugin.TabView=Y.Base.create('tabview',Y.Plugin.Base,[],{history:null,initializer:function(){this.history=new Y.HistoryHash();this.renderUI();this.bindUI();this.syncUI();},renderUI:function(){var host=this.get('host'),tabS=this.get('tabSelector'),panelS=this.get('panelSelector'),tabCount=0;host.addClass('tabView');host.all(tabS).each(function(tab){var a=tab.one('a'),id=null,tabId='';if(!a||a.getAttribute('href').indexOf('#')<0){tabCount++;return;}
id=a.getAttribute('name')||a.getAttribute('id');if(id===''||id.indexOf('yui_')===0){tabId=tab.get('id');if(tabId===''||tabId.indexOf('yui_')===0){id=tabCount;}else{id=tabId;}}
a.setAttribute('href',a.getAttribute('href').replace(/#(.)*/,'#tab='+id));tabCount++;});host.all(panelS).each(function(panel){if(panel.one('*:first-child').hasClass('liner')){return;}
var liner=Y.Node.create('<div class="liner" />'),c=panel.get('children').remove(),i,l;for(i=0,l=c.size();i<l;i++){liner.append(c.item(i));}
panel.append(liner);});},bindUI:function(){var host=this.get('host');host.delegate('click',function(e){var tab=e.currentTarget;e.preventDefault();this.history.addValue('tab',host.all(tab.get('tagName')).indexOf(tab));},this.get('tabSelector'),this);this.history.on('change',function(e){if(e.changed.tab){var tab_index=parseInt(e.changed.tab.newVal,10)>=0?parseInt(e.changed.tab.newVal,10):0;this._updateActiveTab(host.all(this.get('tabSelector')).item(tab_index));}},this);},syncUI:function(){var host=this.get('host'),tabS=this.get('tabSelector'),activeTab=0,hashId=null,tabSearch=null;if(window.location.hash){hashId=window.location.hash.replace('#','');if(hashId.indexOf('=')>0){activeTab=hashId.substring(hashId.indexOf('=')+1);tabSearch=host.all(tabS).item(activeTab);}else{tabSearch=host.one('#'+hashId+', '+tabS+'[name='+hashId+'], '+tabS+' *[name='+hashId+']');if(tabSearch){if(tabSearch.get('tagName')!==tabS.toUpperCase()){tabSearch=tabSearch.ancestor(tabS);}
activeTab=host.all(tabS).indexOf(tabSearch);}}}
this.history.addValue('tab',activeTab);this._updateActiveTab(tabSearch);},_updateActiveTab:function(tab){var host=this.get('host');if(tab.hasClass(ACTIVE_CLASS)){return;}
host.all('.'+ACTIVE_CLASS).removeClass(ACTIVE_CLASS);tab.addClass(ACTIVE_CLASS);host.all(this.get('panelSelector')).item(parseInt(tab.one('a').getAttribute('href').match(/\d+$/)[0],10)).addClass(ACTIVE_CLASS);}},{NS:'tabview',ATTRS:{tabSelector:{value:'dt'},panelSelector:{value:'dd'}}});},'sk1.0',{requires:['plugin','base-build','node','event','history']});
