(function(){var b,f,a,e,d,c,g;b=function(h){var j=box.get("lop:capsule.Cap_110623_Trailer_Video").rootElm.find("div.playlist-nav").find("a"),i=h.currentIndex;j.filter(".on").removeClass("on");j.eq(i).addClass("on");};f=function(i){var h=i.getCurrentDatas();if(h&&h.startScreenId){$(h.startScreenId).css("display","block");box.getWin().setTimeout(function(){$(h.startScreenId).css("display","none");i.play();},2500);}};a=function(j,i){var h="video-"+j.file;j.startScreenId="#"+h;return('<div id="'+h+'" class="start-screen" style="display:none;"><img alt="'+j.title+" "+j.subtitle+'" src="'+i+j.startScreenUrl+'"></div>');};e=function(j,i){var h=j.linkTarget?' target="'+j.linkTarget+'"':"";return('<li><a href="'+j.linkUrl+'"'+h+'><img alt="" src="'+i+j.thumbUrl+'"><strong>'+j.title+"</strong> "+j.subtitle+"</a></li>");};d=function(k,j,h){return'<li><a href="#playlist-'+(h+1)+'">'+k.menu+' <span class="thumb"><img alt="" src="'+j+k.thumbUrl+'"></span></a></li>';};c=function(n){var h="",q="",r="",p=n.imgPath,k=n.playlist,j,o=-1,m=k.length;q+='<div class="playlist-summary"><h2>'+n.summaryTitle+"</h2><ul>";r+='<div class="playlist-nav"><ul>';while(++o<m){j=k[o];h+=a(j,p,o);q+=e(j,p,o);r+=d(j,p,o);}q+="</ul></div>";r+='<li class="summary"><a href="#playlist-summary">i <span class="thumb"><img alt="" src="'+p+n.infosThumbUrl+'"></span></a></li></ul></div>';return h+q+r;};g=function(){return'<li class="sound"><div id="Cap_110623_Trailer_Video_Sound"></div></li>';};box.subscribe({name:"load>lop:capsule.Cap_110623_Trailer_Video.home",handler:function(){var h=this.contentElm,l=box.dom("#video-intro"),k=box.get("Cap_110623_Trailer_Video:videos"),j,i;h.append(c(k));j=box.get("ui").create("player.Cap_110623_Trailer_Video",{player:{id:"Cap_110623_Trailer_Video_Flash",width:950,height:534,controls:{restart:false,timeline:false,time:false,mute:false,volume:false}},medias:k,l10n:box.get("l10n:player"),flash:{params:{menu:"false",allowFullScreen:"true",allowScriptAccess:"always",bgcolor:"#070707"}}});if(j.mode==="flash"){h.find("div.playlist-nav ul").append(g());i=box.get("ui").create("player.Cap_110623_Trailer_Audio",{player:{id:"Cap_110623_Trailer_Video_Sound",controls:{restart:false,play:false,timeline:false,time:false,volume:false}},medias:box.get("Cap_110623_Trailer_Video:audio"),l10n:box.get("l10n:player"),flash:{params:{menu:"false",allowFullScreen:"true",allowScriptAccess:"always"}}});}this.registerMediaPlayer(["ui:player.Cap_110623_Trailer_Video","ui:player.Cap_110623_Trailer_Audio"]);h.find("div.playlist-nav").css("display","block").click(function(o){o.preventDefault();if(o.target.tagName==="A"&&o.target.className!=="on"){var m=o.target.href.replace(/^[^#]+#/,""),n=parseInt(m.replace("playlist-",""),10)-1;if(!isNaN(n)){l.css("display","none");h.find("div.playlist-summary").css("display","none");if(i){i.play();}j.loadInPlaylist(n);}else{if(m==="playlist-summary"){j.pause();l.css("display","none");h.find("div.playlist-summary").css("display","block");box.dom(this).find("a.on").removeClass("on");box.dom(o.target).addClass("on");}}}});l.click(function(m){m.preventDefault();this.style.display="none";b(j);if(i){i.play();}box.getWin().setTimeout(function(){f(j);},100);});}},{name:"beforeload>ui:player.Cap_110623_Trailer_Video",handler:function(h){if(h.source.currentIndex===0&&h.data.init){return;}b(h.source);f(h.source);}},{name:"load>ui:player.Cap_110623_Trailer_Video",handler:function(h){h.preventDefault();}},{name:"endplaylist>ui:player.Cap_110623_Trailer_Video",handler:function(i){var h=box.get("lop:capsule.Cap_110623_Trailer_Video").rootElm,k=h.find("div.playlist-nav").find("a"),j=i.source.currentIndex;h.find("div.playlist-summary").css("display","block");k.filter(".on").removeClass("on");k.eq(j+1).addClass("on");}});}());(function(){var c,b,a=function(d){this.rootElm.find("div.item").hover(function(){box.dom(this).addClass("hovered");},function(){box.dom(this).removeClass("hovered");});};box.subscribe({name:"reset>lop:capsule.Cap_110623_Backstage.home",handler:a},{name:"load>lop:capsule.Cap_110623_Backstage.home",handler:a},{name:"clicklink>lop:capsule.Cap_110623_Backstage",handler:function(d){c=d.data.boxDatas.video;b=d.data.boxDatas.tag;}},{name:"load>lop:capsule.Cap_110623_Backstage.video",handler:function(d){box.store("stats").addDatas("Cap_110623_Backstage",b);box.get("lop:swf").add({player:{id:"Cap_110623_Backstage_Flash",width:950,height:534},flash:{url:"/_fi/_fi/caps/flash/swf/player.swf",variables:{configXml:"/_fi/_fi/caps/Cap_110623_Backstage/flash/xml/config.xml",video:c},params:{menu:"false",allowFullScreen:"true",allowScriptAccess:"always",bgcolor:"#070707",wmode:"transparent"}}});this.registerMediaPlayer(["Cap_110623_Backstage_Flash"]);this.contentElm.append('<a href="'+this.getDefaultURL()+'" class="close box[target=self]">'+box.get("l10n:capsule").close+"</a>");}},{name:"unload>lop:capsule.Cap_110623_Backstage_TV.video",handler:function(){this.stopPlaying();}},{name:"complete>lop:capsules-players.Cap_110623_Backstage",handler:function(d){box.get("lop:capsule."+d.data.target).reset();}});}());box.subscribe({name:"load>lop:capsule.Cap_110623_Experts_TV.home",handler:function(a){this.rootElm.find("div.item").hover(function(){box.dom(this).addClass("hovered");},function(){box.dom(this).removeClass("hovered");});}});box.subscribe({name:"load>lop:capsule.Cap_110629_Spokes.video",handler:function(){box.store("stats").addDatas("Cap_110629_Spokes","Cap_Spokes_Jennifer_Lopez");box.get("lop:swf").add({player:{id:"Cap_110629_Spokes_Flash",width:950,height:534},flash:{url:"/_fi/_fi/caps/flash/swf/player.swf",variables:{configXml:"/_fi/_fi/caps/Cap_110629_Spokes/flash/xml/config.xml"},params:{menu:"false",allowFullScreen:"true",allowScriptAccess:"always",bgcolor:"#070707",wmode:"transparent"}}});this.registerMediaPlayer(["Cap_110629_Spokes_Flash"]);this.contentElm.append('<a href="'+this.getDefaultURL()+'" class="close box[target=self]">'+box.get("l10n:capsule").close+"</a>");}},{name:"unload>lop:capsule.Cap_110629_Spokes.video",handler:function(){this.stopPlaying();}},{name:"complete>lop:capsules-players.Cap_110629_Spokes",handler:function(a){box.get("lop:capsule."+a.data.target).reset();}});box.get("ui").modifyConfig("scroll",{bar:'<a href="#" class="{$barCls}"><span class="start"></span><span class="end"></span></a>'});box.subscribe({name:"beforefirstcompute>ui:scroll.products-glam-shine",handler:function(b){var c=box.dom("#glam-shine-shades-listing li"),a=(c.length*c.eq(0).getSize("margin-box").width),d=box.dom("#glam-shine-shades-listing");d.width(a).parent().width(d.prev().outerWidth(true)+a);}},{name:"beforefirstcompute>ui:scroll.spokes-glam-shine",handler:function(b){var c=box.dom("#glam-shine-spokes-listing li"),a=c.parent(),d=(c.length*c.eq(0).getSize("margin-box").width),e=box.dom("#glam-shine-spokes-listing");e.width(d).parent().width(d+(parseInt(e.eq(0).css("margin-right"),10))+(parseInt(e.eq(0).css("margin-left"),10)));}},{name:"load>lop:capsule.Cap_110629_Glam_Shine.mixes",handler:function(b){var a,c=box.get("ui").create("carousel.mixes-glam-shine",{rootElm:"#glam-shine-mixes-listing",display:1,duration:600,btnPrevText:box.get("l10n:generic").prev,btnNextText:box.get("l10n:generic").next});a=box.get("l10n:url-audio-glam-shine")+c.items.eq(0).data("id");b.source.coreElm.find("div.actions a.btn").attr("href",a);}},{name:"load>lop:capsule.Cap_110629_Glam_Shine.audio",handler:function(d){var c=box.get("l10n:glam-shine-mix"),f=[],e=c.current,b=".mp3",a;for(a in c){if(c.hasOwnProperty(a)&&a!=="current"){c[a].file=c[a].file.replace(b,"");if(a!==e){f[f.length]=a;}}}box.get("ui").create("player.Cap_110629_Glam_Shine",{player:{id:"glam-shine-audio-player",controls:{restart:false,time:false,mute:false,volumeHidden:false,volumeOrientation:"horizontal"}},medias:{autoplay:true,exts:["mp3"],playlist:[c[e]]},l10n:box.get("l10n:player"),flash:{params:{menu:"false",allowScriptAccess:"always",bgcolor:"#070707"}}});this.registerMediaPlayer(["ui:player.Cap_110629_Glam_Shine"]);box.dom("#glam-shine-random-mix").click(function(g){g.preventDefault();var i=box.get("lop:capsule.Cap_110629_Glam_Shine"),k=Math.floor(Math.random()*f.length),j=f[k],h=i.currentURL.replace(/id=.+/,"id="+j);i.startLoading(h);});}},{name:"unload>lop:capsule.Cap_110629_Glam_Shine.audio",handler:function(a){box.get("ui").destroy("player.Cap_110629_Glam_Shine");}},{name:"load>lop:capsule.Cap_110629_Glam_Shine.spokes",handler:function(b){var e=box.get("l10n:generic").fbShare,a=box.get("l10n:url-spokes-glam-shine-fb-share"),d=b.source.getExportURL(a),c=box.getWin().encodeURIComponent;b.source.contentElm.find("a.fb-share").each(function(){$(this).attr("href",e+c(d.replace("post=","post="+$(this).data().id)));});box.get("ui").create("scroll.spokes-glam-shine",{rootElm:"#Cap_110629_Glam_Shine div.scroll",buttons:true,bar:true,horizontal:true,barMinSize:70});box.dom("#glam-shine-spokes-listing > ul > li").hover(function(){box.dom(this).addClass("hovered");},function(){box.dom(this).removeClass("hovered");});}},{name:"load>lop:capsule.Cap_110629_Glam_Shine.products",handler:function(a){box.get("ui").create("mask.products-glam-shine",{html:'<div id="products-glam-shine-mask"></div>',insertTarget:"#Cap_110629_Glam_Shine div.main",insertStyles:{opacity:0,width:"#Cap_110629_Glam_Shine div.main:content-box",height:"#Cap_110629_Glam_Shine div.main:content-box"},insertAnimStyles:{opacity:0.8},insertAnimDuration:200,removeAnimStyles:{opacity:0},removeAnimDuration:150});box.get("ui").create("popin.products-glam-shine",{mask:"products-glam-shine",insertTarget:"#Cap_110629_Glam_Shine div.main",insertStyles:{opacity:0,top:"#Cap_110629_Glam_Shine div.main:in-middle","min-top":0,left:"#Cap_110629_Glam_Shine div.main:in-middle","min-left":0},insertAnimStyles:{opacity:1},insertAnimDuration:200,removeAnimStyles:{opacity:0},removeAnimDuration:200,openTest:function(b){return(b.tagName==="A"&&$(b).getBoxDatas("target")==="products-glam-shine");},closeTest:function(b){return(b.tagName==="A"&&$(b).getBoxDatas("target")==="products-glam-shine-close");}});box.get("ui:popin.products-glam-shine").addToCache("#products-glam-shine");box.get("ui").create("scroll.products-glam-shine",{rootElm:"#Cap_110629_Glam_Shine div.scroll",buttons:true,bar:true,horizontal:true,barMinSize:70});}},{name:"beforeopen>ui:popin.products-glam-shine",handler:function(a){a.source.datas.hash="#"+a.source.id;}},{name:"addtodom>ui:popin.products-glam-shine",handler:function(b){var g=b.source.element,f=b.source,c=b.source.datas.opener,h=c.data(),e=box.get("l10n:generic").fbShare,a=box.get("l10n:url-products-glam-shine-fb-share")+h.id,d=box.get("lop:capsule.Cap_110629_Glam_Shine").getExportURL(a);g.find("h2 strong").html(h.number);g.find("p.product").eq(0).html(h.name);g.find("div.visual img").attr("src",c.find("img").attr("src").replace("70x350","95x275"));g.find("a.fb-share").eq(0).attr("href",e+box.getWin().encodeURIComponent(d));g.find("a.more").eq(0).attr("href",b.source.datas.url);g.find("a.more").eq(1).click(function(i){i.preventDefault();f.close();});}},{name:"endmove>ui:carousel.mixes-glam-shine",handler:function(b){var a=box.get("l10n:url-audio-glam-shine")+this.items.eq(this.current).data("id");box.dom("#Cap_110629_Glam_Shine div.actions a.btn").attr("href",a);}});
