window.jQuery&&(window.jQuery.fn.mediaCatchup||(function(c,b,d){jQuery.plugins={mimetypeDetect:function(e){for(i=0;i<e.length;i++){if(navigator.mimeTypes){if(navigator.mimeTypes[e[i]]){if(navigator.mimeTypes[e[i]].enabledPlugin){return true}else{return false}}}}},pluginDetect:function(h){var j=jQuery.plugins.pluginOptions[h].plugin;var n=jQuery.plugins.pluginOptions[h].mimetypes;var g=jQuery.plugins.pluginOptions[h].mimetypes;var f=false;var k=false;var m=null;try{if(b.ActiveXObject){m=new ActiveXObject(g)}else{if(b.GeckoActiveXObject){m=new GeckoActiveXObject(g)}}if(m.versionInfo){k=true}}catch(l){}if(navigator.plugins&&navigator.plugins.length>0){for(i=0;i<navigator.plugins.length;i++){if(navigator.plugins[i].name.match(j)){f=true;break}}}if(jQuery.plugins.mimetypeDetect(n)&&!f){f=true}if(f||k){return true}return false},pluginOptions:{flash:{plugin:"Shockwave Flash",activex:"",mimetypes:[]},quicktime:{plugin:"QuickTime Plug-in",activex:"",mimetypes:[]},winmedia:{plugin:"Windows Media Player",activex:"WMPlayer.OCX.7",mimetypes:["video/x-ms-asf","application/x-drm-v2","application/x-ms-wmp","application/x-ms-wmd"]},flip4mac:{plugin:"Flip4Mac Windows Media Plugin",activex:"",mimetypes:[]},npmswmp:{plugin:"Microsoft® Windows Media Player Firefox Plugin",activex:"",mimetypes:[]}},pluginError:function(e){var f=['<div class="pluginErrorMsg"><p class="alerte">Vous ne possédez pas le plugin permettant de profiter au maximum des vidéos.</p><p class="telecharger"><a href="http://medias2.francetv.fr/videosread/externe/wmv-firefox-plugin/WindowsMedia-Firefox-Plugin.exe" class="targBlank"><span>Cliquez-ici pour le télécharger</span></a></p><p class="continue"><span>Afficher la vidéo tout de même</span></p></div>','<div class="pluginErrorMsg"><p class="alerte">Vous ne possédez pas le plugin permettant lire cette vidéo.</p><p class="telecharger"><a href="http://dynamic.telestream.net/downloads/download-flip4macwmv.htm" class="targBlank"><span>Cliquez-ici pour télécharger FLIP4MAC</span></a></p><p class="continue"><span>Afficher la vidéo tout de même</span></p></div>'];return f[e]}};var a=(function(){var s="/layoutftv/arches/common/images/video/ecran-PORTAIL.jpg",f="/layoutftv/arches/common/stylesheets/jquery.mediaCatchup.css",e=/\.(asf|avi|wma|wmv|wsx|asx|m3u|php)($|\?)/,o=/^play|pause|stop|fastForward|fastReverse$/,g=/^current(Position(Timecode)?|Item|Marker|AudioLanguage(Index)?)$/,j="mediaLogoBlk",r="mediaPubBlk",p="mediaRebour",t="mediaPlayerBlk",h={france2:285,france5:285},n=typeof ftvi_portail=="string"?ftvi_portail:"france2",m=function(w){var u=this,v=c(jQuery.plugins.pluginError(w));v.prependTo(this.wrapper()).find(".continue").click(function(){v.remove();u.wrapper().trigger("continue");return false}).end().find(".targBlank").attr("target","_blank");return false},l=function(v){var u=v>1;return v+" seconde"+(u?"s":"")+" avant votre vidéo"},k={selectorBlockPub:"#adMiddle03",width:384,height:h[n]||357,activeLogo:true,timeLogo:2,portail:n,activePub:false,timePub:5,activeMedia:true,soustitre:false,samiNode:false,samiId:"soutitre",initAction:false,callback:false,rebourText:l,activePluginError:true,pluginError:m,pluginErrorCss:f},q={autoplay:true,caption:false,bgColor:"transparent",params:{showstatusbar:"1",wmode:"transparent"}};return function(x,w){var E=this,S,C,T,J,B=c.extend({},k,w,((typeof activepub=="boolean")&&activepub)?{activePub:true}:{},(typeof timepub=="number")?{timePub:timepub+1}:{},{forcePluginError:(c.browser.mozilla&&typeof forcepluginerror=="boolean"&&forcepluginerror)}),U=c.extend({},{width:B.width,height:B.height},q,B.optionsMedia),P=B.timePub,H=(B.activeMedia&&x.is("a")),R=(H&&e.test(x.attr("href")||"")),v=(function(){return R&&!c.browser.msie})(),K=s.replace("PORTAIL",B.portail),V=function(){if(typeof B.initAction=="function"&&B.initAction.call(E)===false){return}D.trigger("continue")},G=function(){if(!B.activePub){u()}else{if(!B.activeLogo){Q()}else{b.setTimeout(Q,(B.timeLogo*1000))}}},Q=function(){N.show();z.hide();S=b.setInterval(O,1000)},O=function(){if(--P<=0){b.clearInterval(S);u();return}I.html(B.rebourText(P))},u=function(){N.remove();z.remove();D.one("continue",L);if(R&&(B.activePluginError||B.forcePluginError)){if(navigator.appVersion.indexOf("Win")>0&&c.browser.mozilla&&!jQuery.plugins.pluginDetect("npmswmp")){A(0);return}else{if(navigator.appVersion.indexOf("Mac")>0&&!jQuery.plugins.pluginDetect("flip4mac")){A(1);return}}}D.trigger("continue")},A=function(W){if(B.pluginErrorCss){c("head").append('<link type="text/css" media="screen" href="'+B.pluginErrorCss+'" rel="stylesheet" />')}if(typeof B.pluginError=="function"&&B.pluginError.call(E,W)===false){return}D.trigger("continue")},L=function(){if(H&&!v){M()}else{var W=(new Date().getTime())-T;if(R&&W<500){b.setTimeout(L,600-W);return}}(H?C:x).show();if(typeof B.callback=="function"){B.callback.call(E)}},y=function(){var Y,W,X=String.prototype.match.call(c.isFunction(B.soustitre)?B.soustitre.call(x):B.soustitre,/^(sami):(.*)$/i);if(!X){return}switch(X[1]){case"sami":F=c.isFunction(B.samiNode)?B.samiNode.call(x):B.samiNode;if(!F||c(F).length===0){F=c("<div />").insertAfter(x)}if(!(Y=c(F).attr("id"))){W=1;Y=B.samiId;while(c("#"+Y).length>0){Y=B.samiId+W++}c(F).attr("id",Y)}if(U.params===d){U.params={}}c.extend(U.params,{SAMIFileName:X[2],captioningID:Y,SAMIStyle:"Small Print",SAMILang:"French"});break;default:break}},M=function(){y();x.media(U);T=new Date().getTime();D.children().not(z).not(N).not(F||false).hide().each(function(){C=c(this);if(R){J=function(W,X){C.children("object, embed").each(function(){try{if(o.test(W.type)){this.controls[W.type]()}else{if(g.test(W.type)){this.controls[W.type]=X}}}catch(Y){}})};C.bind("play",J).bind("pause",J).bind("stop",J).bind("fastForward",J).bind("fastReverse",J).bind("currentPosition",J);x.bind("play",J).bind("pause",J).bind("stop",J).bind("fastForward",J).bind("fastReverse",J).bind("currentPosition",J)}})},z=c('<div class="'+j+'" />').css({position:"relative",display:"block",width:B.width+"px",height:B.height+"px",background:"black"}).append(c('<img src="'+K+'" alt="Logo '+B.portail+'" />').css({position:"absolute",top:"50%",left:"50%",margin:"-108px 0 0 -116px"})),N=c('<div class="'+r+'" />').css({position:"relative",display:"none",width:B.width+"px",height:B.height+"px",background:"black","text-align":"center"}).append((function(){if(!c.browser.msie){return c(B.selectorBlockPub).children().not("script").clone()}var Z=c("<div />").append(c(B.selectorBlockPub).children().not("script")),Y=Z.html(),W=parseFloat(c.fn.jquery)<1.3?"@":"",X=Z.find("param["+W+"name=flashvars]").attr("value")||Z.find("param["+W+"name=FlashVars]").attr("value");Z.children().appendTo(B.selectorBlockPub);Z=d;return Y.replace(/<param( name="flashvars"| value="[^"]*"){2}>/ig,'<param name="flashvars" value="'+X+'">')})()).bind("displayContent",u),I=c('<div class="'+p+'">'+B.rebourText(B.timePub)+"</div>").css({position:"absolute",bottom:"2px",left:"0",width:"100%",color:"white","font-weight":"bold","line-height":"1em"}).appendTo(N),F,D=c('<div class="'+t+'" />').insertAfter(x).append(z).append(N).append(x.hide()).one("continue",G);c.extend(this,{content:function(W){return(H&&(W!==true))?C:x},wrapper:function(){return D},pub:function(){return N},logo:function(){return z},soustitre:function(){return F},options:function(){return B},optionsMedia:function(){return U},chrono:function(){return P},isMedia:function(){return H},isWmp:function(){return R}});if(typeof forceactivepub=="boolean"){B.activePub=forceactivepub}else{if(N.children().length===0){B.activePub=false}}if(v){M()}V()}})();c.fn.mediaCatchup=function(e){return this.each(function(){new a(c(this),e)})}})(window.jQuery,this));