IBSYS.using("media");IBSYS.media.loadImg=function(b){var a=new Image();a.src=b};IBSYS.media.vidPlayModule={clearMsgAndTimers:function(){clearTimeout(this.promptTimer);clearTimeout(this.liveTimer);if(this.wmp){this.wmp.style.height=this.height+"px"}if(this.messageBox){this.messageBox.style.visibility="hidden"}},init:function(b,a){if(!swfobject.hasFlashPlayerVersion("6.0.65")){var e=this.getArchiveURL(a.video_coid);b.innerHTML='<div align="center" valign="middle"><p style="font-family:Arial, Helvetica, sans-serif; font-size:12px; color:#444444; line-height:1.5;">To watch videos, you need a newer version of <strong>Flash.</strong><br /><br />After you install Flash, you may need to restart your browser.<br />Copy this URL first, so that you can find your way back:<br /><form><input id=thisPage name="this_page_url" type="text" size="30" maxlength="256" readonly="true" align="middle" value='+document.location.href+' /></form></p><br /><div id="FlashInstallPromptDiv"><a href="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash"><img src="/sh/flex3MediaPlayer/images/getflash.jpg" alt="Get Flash" border="0" /></a></div><br /><p style="font-family:Arial, Helvetica, sans-serif; font-size:12px; color:#444444; line-height:1.5;">If you cannot install the latest version of Flash,<br />you may be able to view videos on our <strong><a href='+e+">legacy player page</a>.</strong></p><br /></div>"}else{if(!swfobject.hasFlashPlayerVersion("9.0.28")){document.title=document.title.slice(0,47)+" - Flash Player Installation";var e=this.getArchiveURL(a.video_coid);var c="/sh/flex3MediaPlayer/expressinstall_custom.swf?legacy="+e;var d={MMredirectURL:window.location.href,MMplayerType:(typeof ActiveXObject=="function"?"ActiveX":"PlugIn"),MMdoctitle:document.title};var f={id:b.id};swfobject.embedSWF(c,b.id,a.width||"320",a.height||"225","6.0.65",c,d,{},f)}else{IBSYS.application.Application.addEventListener(this.onIBEvent,this);this.playerType=a.playerType||"playbackModule";this.loadMediaOnly=(!a.play_first_editorial_video)||true;this.width=a.width;this.height=a.height;this.renderPlayer(b,a);IBSYS.ad.AdManager.registerPosition({element:this,type:"asxProxy"});YAHOO.util.Event.addListener(window,"unload",this.destroy,this,true);IBSYS.media.flashPlayer=IBSYS.media.flashPlayer||{};IBSYS.media.flashPlayer.setBandwidth=this.setBandwidth}}},getArchiveURL:function(a){var b=(a?a+"/":"");return window.location.protocol+"//"+window.location.host+"/video_legacy/"+b+"index.html"+window.location.search},renderPlayer:function(d,b){this.rel=document.getElementById(d.id+"_rel");this.wmParent=document.getElementById(d.id+"_wmParent");var c=navigator.userAgent.toLowerCase();var h=(c.indexOf("webkit")!=-1||c.indexOf("msie")!=-1)?0:1;this.flashPlaybackSwf=YAHOO.util.Dom.getElementsByClassName("videoplayerSWF","object",d)[h];this.flParent=document.getElementById(d.id+"_flParent");var e=this;if(this.checkForPlugins()){if(this.userOS!="mac"){var a=document.createElement("object");a.id=d.id+"_wmp";this.styleWMP(a);if(window.ActiveXObject){a.setAttribute("classid","CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6")}else{a.type="video/x-ms-wmv"}var g=document.createElement("param");g.setAttribute("name","SendPlayStateChangeEvents");g.setAttribute("value","True");a.appendChild(g);var f=document.createElement("param");f.setAttribute("name","autoStart");f.setAttribute("value","True");a.appendChild(f);this.addPluginFrame(a);this.wmParent.appendChild(a);this.wmp=a;this.wmp.style.position="absolute";this.wmp.style.left="-9999px"}}else{this.wmpOpen=function(){e.addPluginFrame(e.wmParent)}}},userOS:"",checkForPlugins:function(){if(navigator.appVersion.indexOf("Mac")>=0){this.userOS="mac";return this.searchPluginList("Flip4Mac WMV Plugin.plugin")}else{if(navigator.appVersion.indexOf("Win")>=0){this.userOS="win";if(YAHOO.env.ua.gecko&&navigator.plugins.length>0){return this.searchPluginList("np-mswmp.dll")}}}return true},searchPluginList:function(a){if(navigator.plugins&&navigator.plugins.length>0){for(var b=0;b<navigator.plugins.length;b++){if(navigator.plugins[b].filename==a){return true}}}return false},onIBEvent:function(a){switch(a.getName()){case"movieLoaded":if(a.eventData.name=="flashPlayback"){this.setBandwidth();if(this.adData){this.tellPlaybackSwf(this.adData)}}break;case"newMediaContent":this.currentVideo=a.eventData;this.setBandwidth();if(!a.eventData.showAds){if(a.eventData.stream[0].mimetype=="video/x-ms-wmv"&&!a.eventData.loadMediaOnly){this.wmpStop();this.trackVideo(this.currentVideo,"both");this.tryWMP(a.eventData.contentId)}else{this.tellPlaybackSwf()}}else{if(this.adData){this.tellPlaybackSwf(this.adData)}}break;case"videoAdSkipped":this.trackVideo(this.currentVideo,"both");this.tryWMP(a.eventData.contentId);break;case"playingVideoAd":this.trackVideo(this.currentVideo,"webTrends");break;case"startWMVVideo":this.trackVideo(this.currentVideo,"nielsen");this.tryWMP(a.eventData.contentId);break;case"startFlashVideo":this.trackVideo(this.currentVideo,"nielsen");break}},setBandwidth:function(a){var b=this.flashPlaybackSwf.getBandwidth();this.bitsPerSec=(a)?(a*1000):((b==0)?56000:b);IBSYS.application.Application.setProperty("userBitsPerSec",this.bitsPerSec);IBSYS.log(this.bitsPerSec)},setAdUrl:function(a,b){this.adData={url:a,coid:b}},showMessage:function(d,c){if(!this.messageBox){var b=document.createElement("div");b.style.width=(this.width)-10+"px";b.style.height="35px";b.style.position="absolute";b.style.backgroundColor="black";YAHOO.util.Dom.setStyle(b,"opacity",0.5);b.style.color="white";b.style.textAlign="center";b.style.padding="5px";b.style.fontSize="10px";b.style.fontWeight="bold";b.style.fontFamily="Arial,sans-serif";b.style.cursor="pointer";this.rel.appendChild(b);this.messageBox=b}this.messageBox.innerHTML=d;this.messageBox.style.visibility="visible";var a=this.height-45;this.messageBox.style.top=a+"px";this.wmp.style.height=a+"px";YAHOO.util.Event.purgeElement(this.messageBox,"click");YAHOO.util.Event.addListener(this.messageBox,"click",c)},tellPlaybackSwf:function(d){var g=typeof this.flashPlaybackSwf;if((g=="function"||g=="object")&&this.flashPlaybackSwf.contentSelected&&this.currentVideo&&((!this.currentVideo.showAds&&!d)||(this.currentVideo.contentId==d.coid&&!this.currentVideo.loaded))){this.flParent.style.left="0px";this.clearMsgAndTimers();if(this.slMediaEl&&this.slMediaEl.CurrentState=="Playing"){this.slMediaEl.Stop();this.slMediaEl.source=""}if(this.wmp){this.wmp.style.left="-9999px"}this.wmpStop();var j=this.currentVideo.content;var b;var a=this;if(j&&j.length>0){for(var f=0;f<j.length;f++){if(j[f].role=="urn:ibsys:role:mainImage"){j[f].resolvedContent.image.rendition.sort(function(i,c){var k=i.width-a.flashPlaybackSwf.width;var l=c.width-a.flashPlaybackSwf.width;if(k<0^l<0){return l-k}else{if(i.width==c.width&&(i.role=="urn:ibsys:role:rendition:reduced"^c.role=="urn:ibsys:role:rendition:reduced")){return(i.role=="urn:ibsys:role:rendition:reduced"?-1:1)}else{return Math.abs(k)-Math.abs(l)}}});b=j[f].resolvedContent.image.rendition[0].href;break}}}var h=this.currentVideo.stream[0];h=(h.mimetype=="video/x-flv"?h.href+h.streamId:null);try{this.flashPlaybackSwf.contentSelected(this.currentVideo.headline,b,this.currentVideo.contentId,this.currentVideo.showAds?d.url:null,(typeof this.currentVideo.loadMediaOnly=="boolean"?this.currentVideo.loadMediaOnly:this.loadMediaOnly),h)}catch(e){IBSYS.log(e.message)}if(this.currentVideo.loadMediaOnly){this.currentVideo.loaded=true}this.loadMediaOnly=false}else{if(d){this.adData=d}}},tryWMP:function(c){if(this.currentVideo.contentId==c&&this.currentVideo.stream[0].mimetype=="video/x-ms-wmv"){var b=typeof this.flashPlaybackSwf;if(b=="function"||b=="object"){this.flashPlaybackSwf.stopFlashPlayback()}this.flParent.style.left="-9999px";var a=this.currentVideo.stream[0].href;if(this.wmp){this.wmp.style.left="0px";this.wmp.style.position="absolute";this.wmp.style.zIndex="9999"}this.wmpOpen(a);if(this.currentVideo.isLive){this.startLiveTimer()}}},onLiveTimeout:function(){var a=this;this.showMessage("This live stream will close in 20 seconds. Click here to continue watching.",function(){a.clearMsgAndTimers();a.startLiveTimer()});this.promptTimer=setTimeout(function(){a.onPromptTimeout()},20000)},onPromptTimeout:function(){this.wmpStop();var a=this;this.showMessage("The live stream has closed due to inactivity. Click to resume.",function(){a.wmpStart();a.clearMsgAndTimers();a.startLiveTimer()})},startLiveTimer:function(){var a=this;this.liveTimer=setTimeout(function(){a.onLiveTimeout()},600000)},trackVideo:function(f,e){var d;var a;var c=(f.stream[0].mimetype=="video/x-flv")?"flv":"wmv";for(var b=0;b<f.metadata.length;b++){switch(f.metadata[b].type){case"urn:ibsys:taxonomy:pool":d=f.metadata[b].tag;break;case"urn:ibsys:taxonomy:topic":a=f.metadata[b].tag.replace(/\//g,"");break}}if(e=="webTrends"||e=="both"){this.trackInWebTrends(d,a,f,c)}if(e=="nielsen"||e=="both"){this.trackInNeilson("start","false",f,c,d,a)}},trackInWebTrends:function(e,b,d,c){var f=(d.metadata[0].tag).replace(/\//g,"").charAt(0).toUpperCase()+(d.metadata[0].tag).replace(/\//g,"").slice(1).toLowerCase();var a=YAHOO.util.Dom.getElementsBy(function(g){return g.name==="WT.cg_s"?true:false},"meta");a.length>0?a=a[0].content:a="Video";DCSext={};dcsMultiTrack("DCS.dcsuri","/video/"+d.coidValue+"/index.html","WT.ti",d.headline,"DCSext.mtype","video","DCSext.ib_coid",d.coidValue,"DCSext.ib_pool",e,"DCSext.ib_media_category",b,"DCSext.ib_creation_time",d.dateCreated,"DCSext.ib_media_location","index","WT.cg_n",f,"WT.cg_s",a,"DCSext.ib_media_file_format",c,"DCSext.ib_media_format",(d.isLive?"live_stream":"video_on_demand"),"DCSext.vtype","clickplay","DCSext.ib_media_action",this.origin,"WT.ed",IBSYS.tracking.clientData.screenColorDepth,"WT.fi",IBSYS.tracking.clientData.isFlashInstalled,"WT.fv",IBSYS.tracking.clientData.flashVersion)},trackInNeilson:function(a,g,j,f,c,d){var b=Math.ceil(Math.random()*1000000000);var e=escape(j.headline);var i;i="http://secure-us.imrworldwide.com/cgi-bin/m";i+="?ci=us-600552";i+="&cg="+d;i+=a==="start"?"&tl=dav0-"+e:"&tl=dav2-"+e;i+=g==="true"?"&c3=st,a"+escape("StreamType"):"";i+="&c6=vc,c01"+escape("");i+="&cc=1";i+="&rnd="+b;var h=new Image();h.src=i},wmpStop:function(){var a=this.wmp;if(a&&a.controls){a.controls.stop()}else{this.wmParent.innerHTML=""}},wmpStart:function(){var a=this.wmp;if(a&&a.controls){a.controls.play()}else{this.wmpOpen(this.currentVideo.stream[0].href)}},wmpOpen:function(b){var a=this.wmp;if(a&&typeof a.URL=="string"){a.URL=b}else{var c=document.createElement("embed");c.setAttribute("showControls","true");c.setAttribute("scale","ASPECT");c.type="application/x-mplayer2";c.src=b;this.styleWMP(c);this.addPluginFrame(c);this.wmParent.appendChild(c);this.wmp=c}},styleWMP:function(a){a.width=this.width;a.height=this.height;a.style.cssText="padding:0px; margin:0px; overflow:hidden; width:"+this.width+"px; height:"+this.height+"px; border:none; background-color: #F1F1F1;"},addPluginFrame:function(c,d){var b=document.createElement("iframe");b.src="/sh/flex3MediaPlayer/wmpInstallFlexible.html";this.styleWMP(b);if(c){try{c.appendChild(b)}catch(a){}}return b},stopVideo:function(){if(this.flashPlaybackSwf){this.flashPlaybackSwf.stopFlashPlayback()}if(this.wmp&&this.wmp.controls){this.wmpStop()}},destroy:function(){this.flashPlaybackSwf=null;this.wmp=null}};