// (c) RTL Nederland Interactief
var RTLPlayerPage=true;function PluginInfo(silverlight_version,allow_non_wmp_plugins){this.forceWMP=(location.href.indexOf('forcewmp')!=-1);this.noSilverlight=(location.href.indexOf('nosilverlight')!=-1);this.WIN=(typeof navigator.platform=='string'&&navigator.platform.toLowerCase().indexOf('win')!=-1);this.MAC=(typeof navigator.platform=='string'&&navigator.platform.toLowerCase().indexOf('mac')!=-1);this.Linux=(typeof navigator.platform=='string'&&navigator.platform.toLowerCase().indexOf('linux')!=-1);this.IE=(typeof ActiveXObject!='undefined'&&this.WIN);this.Gecko=(typeof document.addBinding=='function');this.Safari=(typeof navigator.vendor=='string'&&navigator.vendor.indexOf('Apple')!=-1);this.Chrome=(navigator.userAgent.indexOf('Chrome')!=-1);this.Opera=(typeof window.opera!='undefined');this.SilverlightWindowless=this.determineSilverlightWindowless();this.WMPScriptable=false;this.WMPVersion=-1;this.WMPOtherBrowser=false;this.WMPFirefoxPlugin=false;this.WMVPluginName=this.detectWMVPlugin('WMPlayer.OCX.7');this.WMVPluginInstalled=(this.WMVPluginName!='');this.Flash9Installed=this.detectFlash(9);this.Flash8Installed=this.detectFlash(8);this.SilverlightInstalled=(this.noSilverlight?false:this.detectSilverlight(silverlight_version));this.WMVPluginQuality=this.determinePluginQuality();this.validMediaPlugin=(this.WMVPluginQuality<=(allow_non_wmp_plugins?4:3));this.validDRMPlugin=(this.WMVPluginName=='windows media player'||this.IE);this.defaultControlName=(this.SilverlightInstalled&&!this.forceWMP)?'silverlightInfo':'wmvInfo'}PluginInfo.prototype={determinePluginQuality:function(){if(this.SilverlightInstalled&&!this.forceWMP){return 1}else if(this.WMPScriptable){return 2}else if(this.WMPFirefoxPlugin){return 2.5}else if(this.IE||this.WMPOtherBrowser){return 3}else if(this.WMVPluginInstalled){return 4}else{return 99}},determineSilverlightWindowless:function(){if(this.Opera){return false}else if(this.Gecko&&this.MAC){return false}else if(this.Safari&&(this.WIN||typeof window.XSLTProcessor=='undefined')){return false}else if(this.Chrome&&!this.WIN){return false}else if(!this.WIN&&!this.MAC){return false}return true},detectWMVPlugin:function(wmp_progid){if(this.IE){var wmp_obj=null;var err=false;var wmp_version_string;var wmp_version_int;try{wmp_obj=new ActiveXObject(wmp_progid);wmp_version_string=wmp_obj.versionInfo}catch(e){err=true}finally{wmp_obj=null}if(!err){wmp_version_int=(typeof wmp_version_string=='string')?parseInt(wmp_version_string):NaN;this.WMPVersion=(!isNaN(wmp_version_int))?wmp_version_int:-1;this.WMPScriptable=(this.WMPVersion>-1);return'windows media player'}}else if(typeof navigator.mimeTypes=='object'){var plugin_available=(typeof navigator.mimeTypes['video/x-ms-wvx']!='undefined'&&navigator.mimeTypes['video/x-ms-wvx'].enabledPlugin&&typeof navigator.mimeTypes['video/x-ms-wvx'].enabledPlugin.name=='string');var plugin_name=plugin_available?navigator.mimeTypes['video/x-ms-wvx'].enabledPlugin.name.toLowerCase():'';if(plugin_name.indexOf('windows media player')>-1&&this.WIN){if(plugin_name.indexOf('firefox plugin')>-1){this.WMPFirefoxPlugin=true}else{this.WMPOtherBrowser=true}plugin_name='windows media player'}return plugin_name}return''},detectSilverlight:function(version){if(this.Linux){return false}var isVersionSupported=false;try{var control=null;try{control=new ActiveXObject('AgControl.AgControl');if(control.IsVersionSupported(version)){isVersionSupported=true}control=null}catch(e){var plugin=navigator.plugins["Silverlight Plug-In"];if(plugin){var actualVer=plugin.description;if(actualVer==="1.0.30226.2")actualVer="2.0.30226.2";var actualVerArray=actualVer.split(".");while(actualVerArray.length>3)actualVerArray.pop();while(actualVerArray.length<4)actualVerArray.push(0);var reqVerArray=version.split(".");while(reqVerArray.length>4)reqVerArray.pop();var requiredVersionPart ;var actualVersionPart
var index=0;do{requiredVersionPart=parseInt(reqVerArray[index]);actualVersionPart=parseInt(actualVerArray[index]);index++}while(index<reqVerArray.length&&requiredVersionPart===actualVersionPart);if(requiredVersionPart<=actualVersionPart&&!isNaN(requiredVersionPart)){isVersionSupported=true}}}}catch(e){isVersionSupported=false}return isVersionSupported},detectFlash:function(version){var flash_version=-1;if(typeof window.ActiveXObject!='undefined'&&navigator.platform.indexOf('Win')!=-1){try{var flash_obj=new ActiveXObject('ShockwaveFlash.ShockwaveFlash.'+version);flash_version=version}catch(e){flash_version=-1}flash_obj=null}else if(typeof navigator.plugins=='object'){var flash_obj=navigator.plugins['Shockwave Flash'];if(flash_obj&&typeof flash_obj.description=='string'){var version_nr=flash_obj.description.match(/\d+\.\d/);flash_version=version_nr?parseInt(version_nr[0],10):flash_version}}return(flash_version>=version)}};function ClientInfo(){this.volumeCookie='rtl_player_volume';this.qualityCookie='rtl_player_quality';this.volume=Cookies.get(this.volumeCookie);this.volume=/^\d{1,2}|100$/.test(this.volume)?Number(this.volume):80;this.quality=Cookies.get(this.qualityCookie);this.quality=/^(low|medium|high)$/.test(this.quality)?this.quality:'high'}ClientInfo.prototype={setVolume:function(new_volume){this.volume=new_volume;Cookies.set(this.volumeCookie,new_volume,365)},setQuality:function(new_quality){var new_q=(new_quality=='mid'?'medium':new_quality);this.quality=new_q;Cookies.set(this.qualityCookie,new_q,365)}};function MediaInfo(clip_info){this.ns_PixelUrlBase='http://nl.sitestat.com/rtl/rt-nl/s?';this.doDebug=(location.href.indexOf('debugplayer')>-1);this.initialPath='';this.filePath='';this.clipInfoValidation=this.validateClipInfo(clip_info,true);this.clipInfo=this.clipInfoValidation.info;this.setInitialPixelUrl(clip_info);this.defaultControl=window[pluginInfo.defaultControlName];this.timeStamp=0;this.initialTweenDone=false;this.isTweening=false;this.tweenHeight=(MediaInfo.customHeight!=null?MediaInfo.customHeight:(this.defaultControl==wmvInfo?404+wmvInfo.controlsHeight:404));this.bannerContainer=document.getElementById('rtlpp_banner');this.bannerIframe=null;this.bannerTimer=null;this.bannerClipInfo=null;this.trackingPixel=null;this.prestate='\/(\/channels\/player\/ajax_video\/)';if(this.defaultControl==wmvInfo){this.wvxDomain=(location.href.indexOf('htt'+'ps:\/\/')>-1?'htt'+'p:\/\/ww'+'w.rt'+'l.nl':'htt'+'p:\/\/'+location.hostname)}else{this.wvxDomain=(location.href.indexOf('htt'+'ps:\/\/')>-1?'htt'+'ps:\/\/':'htt'+'p:\/\/')+location.hostname}this.currentScroll=document.body.scrollTop;this.xmlhttp=this.createXMLHTTPObject()}MediaInfo.customStart=null;MediaInfo.customHeight=null;MediaInfo.prototype={start:function(){if(this.tweenHeight!=404){document.getElementById('media_top_container').style.height=this.tweenHeight+'px'}var func;if(typeof MediaInfo.customStart=='function'){this.doTween(MediaInfo.customStart)}else if(pluginInfo.forceWMP&&!pluginInfo.validDRMPlugin){func=function(){errorInfo.showNoDRMPluginMessage()};this.doTween(func)}else if(!pluginInfo.validMediaPlugin){func=function(){errorInfo.showNoValidPluginMessage()};this.doTween(func)}else if(this.clipInfo){func=function(){mediaInfo.playItem(true)};this.doTween(func)}},doTween:function(func){this.isTweening=true;var player_container=document.getElementById('rtlpp_player');var related_container=document.getElementById('rtlpp_related_container');var related_title=document.getElementById('rtlpp_related_title');var related_content=document.getElementById('rtlpp_related_content');var player_new_height=this.tweenHeight;var related_new_height=(related_title?44:0)+((typeof max_mod=='number'&&parseInt(max_mod)>0?parseInt(max_mod):3)*(pluginInfo.IE?66:67));var player_tween=new Tween(player_container.style,'height',Tween.strongEaseInOut,1,player_new_height,2,'px');player_tween.onMotionFinished=function(){mediaInfo.isTweening=false;mediaInfo.initialTweenDone=true;related_content.style.height=max_related_mod+'px';related_content.style.overflow='auto';func()};player_tween.start();player_container.style.visibility='visible';if(window.related_active=='yes'){var related_tween=new Tween(related_container.style,'height',Tween.strongEaseInOut,1,related_new_height,2,'px');related_tween.start();related_container.style.visibility='visible'}},isDRMOrInvalid:function(){if(this.clipInfo&&typeof this.clipInfo.path=='string'&&this.clipInfo.path!=''){location.href=this.clipInfo.path+'?forcewmp'}},playItem:function(is_initial){this.currentScroll=document.body.scrollTop;this.doScroll();if(!this.initialTweenDone){var func=function(){mediaInfo.playItem(false)};this.doTween(func);return}if(!pluginInfo.validMediaPlugin){errorInfo.showNoValidPluginMessage()}else if(this.clipInfo){this.timeStamp=(new Date).getTime();this.editClipInfo();if(typeof this.clipInfo.dart1=='string'&&this.clipInfo.dart1.length>0&&!pluginInfo.forceWMP&&location.href.indexOf('https://')!=0){this.defaultControl.shutUp();streamspotInfo.showStreamspot(this.clipInfo.dart1,"prerollPlayer")}else{streamspotInfo.playing=false;streamspotInfo.resetBase();this.defaultControl.showClip(this.clipInfo);this.playBanner(this.clipInfo)}this.setPixels(this.clipInfo,is_initial);shareInfo.refresh(this.clipInfo);overlayInfo.clearState()}else{this.debug('ongeldige clip info')}},setInitialPixelUrl:function(clip_info){if(typeof clip_info!='object'||clip_info==null){window.ns_pixelUrl=this.ns_PixelUrlBase;return}if(typeof clip_info.counter=='string'&&typeof clip_info.channel=='string'&&typeof clip_info.context=='string'){window.ns_pixelUrl=this.ns_PixelUrlBase+clip_info.counter+'&ns_channel='+clip_info.channel+'&ns_context='+clip_info.context+'&ns__t='+(new Date()).getTime();if(location.href.indexOf('debugstats')!=-1){alert('MediaInfo.prototype.setInitialPixelUrl (NO pixel):\n'+window.ns_pixelUrl)}}},setPixels:function(clip_info,is_initial){if(is_initial||clip_info==window.clipInfo){return}var debugstats=(location.href.indexOf('debugstats')!=-1);if(typeof clip_info.trackingPixel=='string'&&clip_info.trackingPixel.length>4){this.trackingPixel=new Image();this.trackingPixel.src=clip_info.trackingPixel;if(debugstats){alert('MediaInfo.prototype.setPixels (tracking pixel):\n'+clip_info.trackingPixel)}}if(typeof clip_info.counter=='string'&&typeof clip_info.channel=='string'&&typeof clip_info.context=='string'){window.ns_pixelUrl=this.ns_PixelUrlBase+clip_info.counter+'&ns_channel='+clip_info.channel+'&ns_context='+clip_info.context+'&ns__t='+(new Date()).getTime();var image=new Image();image.src=window.ns_pixelUrl;try{window.ns_API.streaming.setURL(this.ns_PixelUrlBase+clip_info.counter)}catch(e){}if(debugstats){alert('MediaInfo.prototype.setPixels (sitestat pixel):\n'+window.ns_pixelUrl)}}if(!window.editor){this.sitestatCountNew(clip_info,clip_info.path,debugstats)}},sitestatCountNew:function(clip_info,path,debugstats){if(typeof location.protocol=='string'&&typeof location.hostname=='string'){window.rtl_source=(typeof clip_info.rtlSource=='string')?clip_info.rtlSource:'unknown';var input_url=location.protocol+'//'+location.hostname+path;var pixel_url=rtlnav_trackingurl(input_url);var image=new Image();image.src=pixel_url.replace(/&amp;/g,'&');if(debugstats){alert('MediaInfo.prototype.sitestatCountNew (sitestat new pixel):\n'+pixel_url.replace(/&amp;/g,'&'))}}},playBanner:function(clip_info){if(!this.bannerContainer||typeof clip_info!='object'||clip_info==null||typeof clip_info.dartURL!='string'||clip_info.dartURL.indexOf('http://')!=0)return;if(clip_info==this.bannerClipInfo){return}this.bannerClipInfo=clip_info;if(this.bannerIframe==null){while(this.bannerContainer.hasChildNodes()){this.bannerContainer.removeChild(this.bannerContainer.lastChild)}this.bannerIframe=document.createElement('iframe');this.bannerIframe.setAttribute('frameBorder',0);this.bannerIframe.setAttribute('marginWidth',0);this.bannerIframe.setAttribute('marginHeight',0);this.bannerIframe.setAttribute('scrolling','no');this.bannerIframe.style.width='468px';this.bannerIframe.style.height='60px';this.bannerIframe.style.filter='alpha(opacity=100)';this.bannerContainer.appendChild(this.bannerIframe)}this.bannerIframe.setAttribute('src',clip_info.dartURL)},doScroll:function(){if(document.body.scrollTop!=this.currentScroll||this.currentScroll==0)return;this.currentScroll-=(this.currentScroll>25?25:this.currentScroll);document.body.scrollTop=this.currentScroll;if(this.currentScroll>0){setTimeout("mediaInfo.doScroll()",25)}},createXMLHTTPObject:function(){try{if(window.XMLHttpRequest){this.xmlhttp=new XMLHttpRequest()}else{this.xmlhttp=new ActiveXObject('Microsoft.XMLHTTP')}}catch(e){this.xmlhttp=null}return this.xmlhttp},loadClipInfo:function(file_path){if(typeof file_path!='string'||file_path==''){return}if(this.isTweening){return}if(this.filePath==file_path){return}if(pluginInfo.forceWMP){location.href=file_path;return}if(!RTLPlayerPage){location.href=file_path;return}if(pluginInfo.WMVPluginQuality>2.6){location.href=file_path;return}this.filePath=file_path;var compare_result=this.comparePaths();if(!compare_result){location.href=file_path;return}if(this.xmlhttp==null){this.debug('Het xmlhttp object is null.');location.href=file_path;return}if(!pluginInfo.SilverlightInstalled&&!pluginInfo.WMPScriptable){location.href=file_path;return}try{this.xmlhttp.onreadystatechange=function(){};this.xmlhttp.abort();this.xmlhttp.onreadystatechange=function(){mediaInfo.handleClipInfo()};this.xmlhttp.open('GET',this.prestate+this.filePath+location.search,true);this.xmlhttp.send(null)}catch(e){this.debug('Fout bij uitvoeren xmlhttp request.');location.href=file_path}if(window.ActiveXObject){document.body.setActive()}},handleClipInfo:function(){if(this.xmlhttp.readyState<4){return}if((this.xmlhttp.status!=200&&this.xmlhttp.status!=304)){this.debug('Ongeldige status xmlhttp object ('+this.xmlhttp.status+').');location.href=this.filePath;return}var clip_info;try{eval('clip_info = '+this.xmlhttp.responseText)}catch(e){clip_info=null}if(clip_info==null){this.debug('Ongeldige syntax JSON string:\n\n'+this.xmlhttp.responseText);location.href=this.filePath;return}var validation_result=this.validateClipInfo(clip_info,false);if(validation_result.error!=''){this.debug('JSON string is niet valide:\n\n'+validation_result.error);location.href=this.filePath;return}this.clipInfoValidation=validation_result;this.clipInfo=this.clipInfoValidation.info;this.playItem(false)},comparePaths:function(){var initial_list=this.initialPath.split('/');var file_list=this.filePath.split('/');var check_length=4;check_length=(initial_list.length<check_length)?initial_list.length:check_length;check_length=(file_list.length<check_length)?file_list.length:check_length;for(var i=0;i<check_length;i++){if(initial_list[i]!=file_list[i]){return false}}return true},validateClipInfo:function(clip_info,is_initial){var result={error:'',warnings:[],info:null};if(typeof clip_info!='object'||clip_info==null){result.error+='clip info is null or not an object';return result}if(is_initial&&typeof clip_info.path=='string'){this.initialPath=clip_info.path}if(typeof clip_info.path!='string'){result.error+='path property is missing\n'}if(typeof clip_info.title!='string'){result.error+='title property is missing\n'}if(typeof clip_info.date!='string'){result.error+='date property is missing\n'}if(typeof clip_info.items!='object'||!(clip_info.items instanceof Array)){result.error+='items property is not an array\n';return result}var valid_items=[];var item;var nr;for(var i=0;i<clip_info.items.length;i++){item=clip_info.items[i];if(typeof item!='object'||item==null){result.warnings.push('item '+i+' in items array is null or not an object');continue}nr=(typeof item.bandwidth=='string'||typeof item.bandwidth=='number')?parseInt(item.bandwidth,10):NaN;if(isNaN(nr)||nr<1){result.warnings.push('item '+i+' in items array has missing or invalid bandwidth property');continue}item.bandwidth=nr;if(typeof item.format!='string'){result.warnings.push('item '+i+' in items array has missing or invalid format property');continue}if(item.format.toLowerCase().indexOf('wm')!=0){result.warnings.push('item '+i+' in items array is not a windows media item');continue}nr=(typeof item.width=='string'||typeof item.width=='number')?parseInt(item.width,10):NaN;if(isNaN(nr)||nr<0){result.warnings.push('item '+i+' in items array has missing or invalid width property');nr=0}item.width=nr;nr=(typeof item.height=='string'||typeof item.height=='number')?parseInt(item.height,10):NaN;if(isNaN(nr)||nr<0){result.warnings.push('item '+i+' in items array has missing or invalid height property');nr=0}item.height=nr;valid_items.push(item)}if(valid_items.length==0){result.error+='no valid items found';return result}valid_items.sort(function(a,b){return a.bandwidth-b.bandwidth});clip_info.items=valid_items;result.info=clip_info;return result},editClipInfo:function(){var index;switch(clientInfo.quality){case'low':this.clipInfo.selectedIndex=0;break;case'high':this.clipInfo.selectedIndex=this.clipInfo.items.length-1;break;default:this.clipInfo.selectedIndex=Math.floor((this.clipInfo.items.length-1)/2);break}for(var i=0;i<this.clipInfo.items.length;i++){this.clipInfo.items[i].wvxPath=this.wvxDomain+'/(ord='+this.timeStamp+')/system/video/wvx'+this.clipInfo.path+'/'+this.clipInfo.items[i].bandwidth+'.wvx'}if(typeof this.clipInfo.dartURL=='string'){var clip_info=this.clipInfo;clip_info.dartURL=clip_info.dartURL.replace("rtl4.rtl.nl","rtlgemist.rtl.nl");clip_info.dartURL=clip_info.dartURL.replace("rtl5.rtl.nl","rtlgemist.rtl.nl");clip_info.dartURL=clip_info.dartURL.replace("rtl7.rtl.nl","rtlgemist.rtl.nl");clip_info.dartURL=clip_info.dartURL.replace("rtl8.rtl.nl","rtlgemist.rtl.nl");clip_info.dartURL=clip_info.dartURL.replace("yorin.rtl.nl","rtlgemist.rtl.nl");clip_info.dartURL=clip_info.dartURL.replace("service.rtl.nl","rtlgemist.rtl.nl");var parts=clip_info.dartURL.split(';');var dart_url="";var new_keys=new Array();for(var a=0;a<parts.length;a++){var key_val=parts[a].split("=");if(key_val.length==2){if(key_val[0]=="xprog"||key_val[0]=="url"||key_val[0]=="chan"||key_val[0]=="dcopt")continue}new_keys[new_keys.length]=parts[a]}dart_url+=new_keys.join(';')+';ord='+this.timeStamp;this.clipInfo.dartURL=dart_url}if(typeof this.clipInfo.dart1=='string'&&this.clipInfo.dart1.length>0){this.clipInfo.dart1+=';ord='+this.timeStamp}return this.clipInfo},debug:function(msg){if(this.doDebug){alert(msg)}}};function ControlInfo(container_id){if(typeof container_id=='string'){this.doDebug=(location.href.indexOf('debugplayer')>-1);this.controlContainerID=container_id;this.controlContainer=document.getElementById(container_id);this.controlWritten=null;this.control=null;ControlInfo.instances.push(this)}}ControlInfo.prototype={resetBase:function(){this.controlWritten=null;this.control=null;this.controlContainer.innerHTML=''},write:function(object_string){this.controlContainer.innerHTML=object_string;this.controlWritten=true},show:function(){var style_obj=this.controlContainer.style;style_obj.left='0px';style_obj.visibility='visible'},hide:function(){var style_obj=this.controlContainer.style;style_obj.left='-2000px'},debug:function(msg){if(this.doDebug){alert(msg)}},addEvent:function(object,eventstring,func){if(typeof window.addEventListener=='function'){object.addEventListener(eventstring,func,false)}else{object.attachEvent('on'+eventstring,func)}}};ControlInfo.baseWidth=720;ControlInfo.baseHeight=404;ControlInfo.instances=[];ControlInfo.instanceShown=null;ControlInfo.showInstance=function(instance){ControlInfo.instanceShown=instance;for(var i=0;i<ControlInfo.instances.length;i++){ControlInfo.instances[i][(ControlInfo.instances[i]==instance?'show':'hide')]()}};function StreamspotInfo(container_id){ControlInfo.call(this,container_id);this.fallbackTime=20;this.playing=false;this.swfPath=defaultSWFPath}StreamspotInfo.prototype=new ControlInfo;StreamspotInfo.prototype.writeControl=function(streamspot,volume,playerID){var flash_vars='streamspot='+encodeURIComponent(streamspot)+'&volume='+volume+'&playerid='+playerID;var w=ControlInfo.baseWidth;var h=ControlInfo.baseHeight;var object_string='<obj'+'ect classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="'+w+'" height="'+h+'" id="streamspot_flash_object" align="middle">'+'<par'+'am name="allowScriptAccess" value="always" />'+'<par'+'am name="flashvars" value="'+flash_vars+'" />'+'<par'+'am name="allowFullScreen" value="false" />'+'<par'+'am name="movie" value="'+this.swfPath+'" />'+'<par'+'am name="wmode" value="opaque" />'+'<par'+'am name="quality" value="high" />'+'<par'+'am name="bgcolor" value="#000000" />'+'<emb'+'ed sr'+'c="'+this.swfPath+'" flashvars="'+flash_vars+'" wmode="opaque" quality="high" bgcolor="#000000" width="'+w+'" height="'+h+'" name="streamspot_flash_embed" align="middle" allowScriptAccess="always" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />'+'<\/obj'+'ect>';this.write(object_string)};StreamspotInfo.prototype.testInterfaceCaller=function(){var method_name='showStreamspot';var embs=document.embeds;var flash_el=(embs&&embs['streamspot_flash_embed']&&embs['streamspot_flash_embed'][method_name])?embs['streamspot_flash_embed']:document.getElementById('streamspot_flash_object');var result;try{result=flash_el.testInterfaceCalled()}catch(e){result='Error'}var interface_supported=(result=='ResponseFromFlash');this.control=(interface_supported?flash_el:null)};StreamspotInfo.prototype.showStreamspot=function(streamspot,playerID){this.playing=true;if(!pluginInfo.Flash9Installed||window.opera){setTimeout("openNext('prerollPlayer')",10);return}ControlInfo.showInstance(this);this.resetBase();this.writeControl(streamspot,clientInfo.volume,playerID)};StreamspotInfo.prototype.showStreamspotControls=function(activate){if(!this.control)return;try{this.control.showControls(activate)}catch(e){}};StreamspotInfo.prototype.setStreamspotVolume=function(new_volume){if(!this.control)return;try{this.control.setVolume(new_volume)}catch(e){}};function testInterfaceCalled(interface_supported){setTimeout(function(){streamspotInfo.testInterfaceCaller()},50)}function registerVolume(new_volume){clientInfo.setVolume(new_volume)}function streamspotReady(){mediaInfo.playBanner(mediaInfo.clipInfo)}function openNext(streamspotPlayerId){var whitelisted_for_audit=[];for(var i=0 ;i<whitelisted_for_audit.length;i++){if(mediaInfo.clipInfo.path.indexOf(whitelisted_for_audit[i].path)!=-1){setTimeout(function(){streamspotInfo.playing=false;streamspotInfo.resetBase()},25);auditObject.programIdent=whitelisted_for_audit[i].ident;if(!auditObject.getCookie()){auditObject.doRegistrationAudit()}else{auditObject.onCompleteCallback()}return}}openNext_2(streamspotPlayerId)}function openNext_2(streamspotPlayerId){if(streamspotPlayerId=='prerollPlayer'){try{mediaInfo.playBanner(mediaInfo.clipInfo)}catch(e){}setTimeout(function(){streamspotInfo.playing=false;streamspotInfo.resetBase()},25);setTimeout(function(){mediaInfo.defaultControl.showClip(mediaInfo.clipInfo)},50)}if(streamspotPlayerId=='postRollPlayer'){setTimeout(function(){hidePlayer()},25)}}function AuditObject(oncomplete){this.onCompleteCallback=oncomplete;this.timer=null;this.channel='registratietest_07_2009';this.programIdent='';this.REGISTRATION_LITE='pc';this.REGISTRATION_MP='mp'};AuditObject.prototype={doRegistrationAudit:function(){switch(this.getCookieRetry()){case this.REGISTRATION_LITE:this.doNedStatCount("pc.retry");this.do_registration_lite();//pc.retry
break;case this.REGISTRATION_MP:this.doNedStatCount("mp.retry");this.do_registration_mp();//mp.retry
break;default:var mp_status=Cookies.get('mediapaspoort_loggedin');this[(Math.floor(Math.random()*2)==0||mp_status=='yes'?'do_registration_lite':'do_registration_mp')]();break}},do_registration_lite:function(){this.setCookieRetry(this.REGISTRATION_LITE);this.doNedStatCount("pc.init");var ifrm=document.createElement("iframe");ifrm.setAttribute("id","iframegen_registration_lite");ifrm.setAttribute("src","/demo/onderzoek/lite_registratie_popup.html");ifrm.setAttribute('allowTransparency','true');ifrm.setAttribute('frameBorder',0);ifrm.setAttribute("scrolling","no");var styleoptions=ifrm.style;styleoptions.zIndex=10000;styleoptions.position='absolute';styleoptions.border='0px solid transparent';styleoptions.left='150px';styleoptions.width='450px';styleoptions.top='295px';document.body.appendChild(ifrm)},close_litereg_window:function(completed_the_audit){if(completed_the_audit){this.onCompleteCallback();this.setCookie();//pc.done
this.doNedStatCount("pc.done")}else{this.reloadPage()}document.getElementById('iframegen_registration_lite').parentNode.removeChild(document.getElementById('iframegen_registration_lite'))},do_registration_mp:function(){this.setCookieRetry(this.REGISTRATION_MP);this.doNedStatCount("mp.init");RTLPlayerPage=false;show_mp_iframe(true,'close_and_notify',auditObject.channel,true)},getCookie:function(){this.doNedStatCount("pcmp.cookiecheck");return(Cookies.get('participatedcookie')=='true')},setCookie:function(){Cookies.set('participatedcookie',true,365)},setCookieRetry:function(mp_or_pc){Cookies.set('mp_or_pc',mp_or_pc,365)},getCookieRetry:function(){var retval=Cookies.get('mp_or_pc');return retval},doNedStatCount:function(type){var sitestatURLbase='http://nl.sitestat.com/rtl/test/s?service.registratietest.';var sitestatRequestURL=sitestatURLbase+auditObject.programIdent+'.'+type+'&ns__t='+(new Date).getTime();var img=new Image();img.src=sitestatRequestURL;if(location.href.indexOf('debugstats')!=-1){alert('AuditObject.prototype.doNedStatCount (pixel):\n'+sitestatRequestURL)}},reloadPage:function(){location.reload(true)}};var auditObject=new AuditObject(openNext_2);var hide_mp_iframe=function(){try{document.getElementById('mp_login_iframe').style.display='none';document.getElementById('mp_login_iframe').setAttribute('src','/internal-roxen-unit');rtlnav_banner(1)}catch(e){}clearTimeout(auditObject.timer);auditObject.timer=setTimeout(function(){location.reload(true)},600)};function mp_notify(channel){if(channel==auditObject.channel){clearTimeout(auditObject.timer);RTLPlayerPage=true;auditObject.setCookie();auditObject.doNedStatCount("mp.done");auditObject.onCompleteCallback()}};function OverlayInfo(container_id,instance_id){if(typeof container_id!='undefined'){ControlInfo.call(this,container_id);this.instanceID=instance_id;this.compatible=this.determineCompatibility();this.proxyContainer=null;this.proxyControl=null;this.proxyPath='/system/scripts/overlayproxy.swf';this.proxyVars='TestInterfaceJSFunction='+this.instanceID+'.testInterfacePassive';this.proxyInitError='';this.requestIdentifiers={};this.requestsDone=0;this.streamspotDoneInfoRequest=false;this.streamspotParams=null;this.streamspotShowing=false;this.streamspotShowingTimeout=null;this.streamspotAsxUrl='';this.start()}}OverlayInfo.createInstance=function(container_id,instance_id){if(pluginInfo.defaultControlName=='silverlightInfo'){return new OverlayInfo(container_id,instance_id)}else{return new OverlayInfoWMP(container_id,instance_id)}};OverlayInfo.prototype=new ControlInfo;OverlayInfo.prototype.start=function(){if(!this.compatible)return;this.writeProxy()};OverlayInfo.prototype.determineCompatibility=function(){if(!pluginInfo.Flash9Installed){return false}return pluginInfo.SilverlightWindowless};OverlayInfo.prototype.writeProxy=function(){this.proxyContainer=document.createElement('div');var stl=this.proxyContainer.style;stl.position='absolute';stl.width='1px';stl.height='1px';stl.zIndex=500;stl.backgroundColor='pink';document.body.appendChild(this.proxyContainer);var object_string='<obj'+'ect classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="1" height="1" id="'+this.instanceID+'_obj" align="middle">'+'<par'+'am name="allowScriptAccess" value="always" />'+'<par'+'am name="allowFullScreen" value="false" />'+'<par'+'am name="movie" value="'+this.proxyPath+'" />'+'<par'+'am name="quality" value="high" />'+'<par'+'am name="wmode" value="transparent" />'+'<par'+'am name="bgcolor" value="#ffffff" />'+'<par'+'am name="flashvars" value="'+this.proxyVars+'" />'+'<emb'+'ed src="'+this.proxyPath+'" flashvars="'+this.proxyVars+'" quality="high" wmode="transparent" bgcolor="#ffffff" width="1" height="1" name="'+this.instanceID+'_emb" align="middle" allowScriptAccess="always" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />'+'<\/object>';this.proxyContainer.innerHTML=object_string};OverlayInfo.prototype.testInterfacePassive=function(string){if(string!='CallFromFlash'){}else{var self=this;setTimeout(function(){self.testInterfaceActive()},50)}};OverlayInfo.prototype.testInterfaceActive=function(){var embs=document.embeds;var embid=this.instanceID+'_emb';var flash_obj=(embs&&embs[embid]&&embs[embid].testInterfacePassive)?embs[embid]:document.getElementById(this.instanceID+'_obj');var return_value;try{return_value=flash_obj.testInterfacePassive()}catch(e){return_value='Error'}if(return_value!='ResponseFromFlash'){}else{this.proxyControl=flash_obj}};OverlayInfo.prototype.getInfo=function(){if(!this.compatible){return}if(this.streamspotDoneInfoRequest){return}else{this.streamspotDoneInfoRequest=true}if(!mediaInfo.clipInfo||typeof mediaInfo.clipInfo.dartURL!='string'||mediaInfo.clipInfo.dartURL.indexOf('http://')!=0){return}this.streamspotAsxUrl=this.createAsxUrl(mediaInfo.clipInfo.dartURL);if(this.streamspotAsxUrl==''){return}if(location.href.indexOf('testoverlays')!=-1){this.streamspotAsxUrl='http://www.rtl.nl/demo/player_streamspot_test/test.asx'}var req_ident=this.createRequestIdentifier();this.requestIdentifiers[req_ident]={nr:++this.requestsDone,clipInfo:mediaInfo.clipInfo,url:this.streamspotAsxUrl};this.debug('OverlayInfo.prototype.getInfo\nurl: '+this.streamspotAsxUrl);try{this.proxyControl.getRequest(this.streamspotAsxUrl,req_ident,this.instanceID+'.handleInfo')}catch(e){}};OverlayInfo.prototype.handleInfo=function(obj){try{var request_info=(obj&&typeof obj.requestIdentifier=='string'&&obj.requestIdentifier!=''&&this.requestIdentifiers.hasOwnProperty(obj.requestIdentifier))?this.requestIdentifiers[obj.requestIdentifier]:null;if(!request_info){return}if(request_info.clipInfo!=mediaInfo.clipInfo){return}else{request_info.clipInfo=null}var data_string_encoded=(typeof obj.dataStringEncoded=='string')?obj.dataStringEncoded:'';if(!data_string_encoded||data_string_encoded.length>30000){return}var data_string_decoded=decodeURIComponent(data_string_encoded);var asx_rx=/<ASX[^>]*>([\s\S]+?)<\/ASX>/i;var asx_match=data_string_decoded.match(asx_rx);if(!asx_match){this.debug('Overlay streamspots error: geen ASX element gevonden.\n\n'+data_string_decoded);return}var ref_rx=/<REF\s+HREF=['"]([^'"]+)['"]\s*\/>/i;var ref_match=asx_match[1].match(ref_rx);if(!ref_match){return}var ref_val=ref_match[1].replace(/^\s+/g,'').replace(/\s+$/g,'');if(ref_val.indexOf('http://')!=0){return}if(!/\.swf(\?|$)/.test(ref_val)){this.debug('Overlay streamspots error: URL lijkt niet te verwijzen naar SWF.\n\n'+data_string_decoded);return}var starttime_rx=/<STARTTIME\s*VALUE=['"]([^'"]+)['"]\s*\/>/i;var starttime_match=asx_match[1].match(starttime_rx);if(!starttime_match){starttime_match=['','0:40'];this.debug('Overlay streamspots error: Geen of ongeldige STARTTIME gevonden.\nSTARTTIME gezet op default (40 sec.).\n\n'+data_string_decoded);return}var starttime_val=this.numberFromTimespan(starttime_match[1].replace(/^\s+/g,'').replace(/\s+$/g,''));if(starttime_val==-1){this.debug('Overlay streamspots error: Ongeldige STARTTIME gevonden.\n\n'+data_string_decoded);return}var duration_rx=/<DURATION\s+VALUE=['"]([^'"]+)['"]\s*\/>/i;var duration_match=asx_match[1].match(duration_rx);if(!duration_match){this.debug('Overlay streamspots error: Geen of ongeldige DURATION gevonden.\n\n'+data_string_decoded);return}var duration_val=this.numberFromTimespan(duration_match[1].replace(/^\s+/g,'').replace(/\s+$/g,''));if(duration_val<1){this.debug('Overlay streamspots error: Ongeldige DURATION gevonden.\n\n'+data_string_decoded);return}this.streamspotParams={clipInfo:mediaInfo.clipInfo,url:ref_val,beginTime:starttime_val,duration:duration_val};this.beginWaiting()}catch(e){}};OverlayInfo.prototype.beginWaiting=function(){try{silverlightInfo.control.Content.ControllerBase.set_s_OverLayTriggerAtSeconds(this.streamspotParams.beginTime)}catch(e){}};OverlayInfo.prototype.beginStreamspot=function(){if(!this.streamspotParams)return;if(ControlInfo.instanceShown!=silverlightInfo)return;var sl_fullscreen=(silverlightInfo.control&&silverlightInfo.control.content&&silverlightInfo.control.content.fullScreen);if(sl_fullscreen)return;this.writeStreamspot();try{silverlightInfo.control.Content.asxlister.sl_controller('0')}catch(e){}};OverlayInfo.prototype.writeStreamspot=function(){var scope=this;if(this.streamspotShowing){return}else{this.streamspotShowing=true;this.streamspotShowingTimeout=setTimeout(function(){scope.stats('http://nl.sitestat.com/rtl/test/s?overlay.finish');scope.endStreamspot(true)},this.streamspotParams.duration*1000)}this.stats('http://nl.sitestat.com/rtl/test/s?overlay.start');var w=ControlInfo.baseWidth;var h=ControlInfo.baseHeight;var url=this.streamspotParams.url;var object_string='<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="'+w+'" height="'+h+'" id="overlay_control_obj" align="middle">'+'<param name="allowScriptAccess" value="always" />'+'<param name="allowFullScreen" value="false" />'+'<param name="movie" value="'+url+'" />'+'<param name="quality" value="high" />'+'<param name="wmode" value="transparent" />'+'<param name="bgcolor" value="#ffffff" />'+'<embed src="'+url+'" quality="high" wmode="transparent" bgcolor="#ffffff" width="720" height="404" name="overlay_control_embed" align="middle" allowScriptAccess="always" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />'+'<\/object>';this.streamspotParams=null;this.write(object_string);this.show()};OverlayInfo.prototype.endStreamspot=function(till_finish){this.streamspotShowing=false;try{silverlightInfo.control.Content.asxlister.sl_controller('2')}catch(e){}this.resetBase();this.hide()};OverlayInfo.prototype.pauseVideoAndDeleteOverlay=function(){var scope=this;setTimeout(function(){scope.deleteOverlay(true)},1000);try{silverlightInfo.control.Content.ControllerBase.PauseMedia()}catch(e){}};OverlayInfo.prototype.deleteOverlay=function(has_clicked){this.stats((has_clicked?'http://nl.sitestat.com/rtl/test/s?overlay.click':'http://nl.sitestat.com/rtl/test/s?overlay.close'));clearTimeout(this.streamspotShowingTimeout);this.endStreamspot()};OverlayInfo.prototype.clearState=function(){if(this.requestsDone==0)return;clearTimeout(this.streamspotShowingTimeout);this.endStreamspot();this.streamspotDoneInfoRequest=false};OverlayInfo.prototype.stats=function(url){var source_url=url+(url.indexOf('?')==-1?'?':'&')+'ns__t='+(new Date).getTime();var img=new Image();img.src=source_url;if(location.href.indexOf('debugstats')!=-1){alert('OverlayInfo.prototype.stats (pixel):\n'+source_url)}};OverlayInfo.prototype.createAsxUrl=function(dart_url){var url=dart_url;var matches=[{rx:/sz=\d{2,3}x\d{2,3}/,match:false,str:'sz=62x91'},{rx:/pos=top/,match:false,str:'pos=streamspot'},{rx:/tile=\d/,match:false,str:'tile=3'}];var func=function(t){matches[i].match=true;return matches[i].str};for(var i=0;i<matches.length;i++){url=url.replace(matches[i].rx,func);if(!matches[i].match)return''}return url};OverlayInfo.prototype.createRequestIdentifier=function(){var request_identifier;do{request_identifier='id'+(new Date()).getTime()}while(this.requestIdentifiers.hasOwnProperty(request_identifier));return request_identifier};OverlayInfo.prototype.numberFromTimespan=function(timespan){var test=timespan.match(/^([0-1]\d:|2[0-3]:|\d:)?([0-5]\d:|\d:)([0-5]\d|[0-5]\d\.\d+|\d|\d.\d+)$/);return test?(test[1]?parseInt(test[1],10)*3600:0)+(parseInt(test[2],10)*60)+Number(test[3]):-1};function OverlayInfoWMP(container_id,instance_id){OverlayInfo.apply(this,arguments);var scope=this;this.pollTimer=(this.compatible?setInterval(function(){scope.pollPosition()},750):null)}OverlayInfoWMP.prototype=new OverlayInfo;OverlayInfoWMP.prototype.determineCompatibility=function(){if(!pluginInfo.Flash9Installed){return false}return(pluginInfo.IE&&pluginInfo.WMPScriptable)};OverlayInfoWMP.prototype.beginWaiting=function(){};OverlayInfoWMP.prototype.beginStreamspot=function(){if(!this.streamspotParams){return}if(ControlInfo.instanceShown!=wmvInfo){return}var wmp_fullscreen=(wmvInfo.control&&wmvInfo.control.fullScreen);if(wmp_fullscreen){return}this.writeStreamspot()};OverlayInfoWMP.prototype.endStreamspot=function(){this.streamspotShowing=false;this.resetBase();this.hide()};OverlayInfoWMP.prototype.pauseVideoAndDeleteOverlay=function(){var scope=this;setTimeout(function(){scope.deleteOverlay(true)},1000);try{wmvInfo.control.controls.pause()}catch(e){}};OverlayInfoWMP.prototype.pollPosition=function(){try{if(typeof wmvInfo!='object'||!wmvInfo.control||!wmvInfo.control.currentMedia){return}if(!this.streamspotDoneInfoRequest){if(wmvInfo.control.currentMedia.getItemInfo("streamtype")=='vod'){this.getInfo()}return}if(this.streamspotParams){var position=wmvInfo.control.controls.currentPosition;position=isNaN(position)?-1:position;if(position>=this.streamspotParams.beginTime&&position<this.streamspotParams.beginTime+1.5){this.beginStreamspot()}}}catch(e){}};function SilverlightInfo(container_id){ControlInfo.call(this,container_id);this.initArgs=null;this.selectedIndex=null;this.silverlightErrors=[];this.xapPath=defaultXAPPath}SilverlightInfo.ControllerSize=2;SilverlightInfo.prototype=new ControlInfo;SilverlightInfo.prototype.show=function(){if(overlayInfo.streamspotShowing){overlayInfo.show()}ControlInfo.prototype.show.call(this)};SilverlightInfo.prototype.writeControl=function(clip_info,items_string){var selected_item=clip_info.items[clip_info.selectedIndex];var init_params_obj={keep_alive:20,STREAMSENSE_ONLY_WHEN_URL_CONTAINS_SKO_:0,ControllerSize:SilverlightInfo.ControllerSize,JavascriptClientInfoObjectQualityProperty:'quality',quality:clientInfo.quality,ssense_host_prefix:mediaInfo.ns_PixelUrlBase+clip_info.counter,SessionStreamSenseTimestamp:(new Date()).getTime(),JavascriptClientInfoObjectVolumeProperty:'volume',JavascriptClientInfoObjectName:'clientInfo',debug:0,DefaultVolumeValue:clientInfo.volume,asxurl:items_string};var init_params='%SILVERLIGHT_SEND_POSTROLL_TRIGGER%=1,';for(var i in init_params_obj){if(!init_params_obj.hasOwnProperty(i))continue;init_params+=i+'='+init_params_obj[i]+','}var w=ControlInfo.baseWidth;var h=ControlInfo.baseHeight;var object_string='<obj'+'ect id="silverlight_control" data="data:application/x-silverlight," type="application/x-silverlight-2" width="'+w+'" height="'+h+'">'+'<pa'+'ram name="source" value="'+this.xapPath+'" />'+'<pa'+'ram name="onerror" value="onerrorSilverlight" />'+'<pa'+'ram name="onload" value="onloadSilverlight" />'+'<pa'+'ram name="background" value="white" />'+'<pa'+'ram name="enableHtmlAccess" value="true" />'+'<pa'+'ram name="minRuntimeVersion" value="3.0.40624.0" />'+'<pa'+'ram name="EnableGPUAcceleration" value="true" />'+'<pa'+'ram name="splashscreensource" value="/system/videoplayer/plugin_files/sl_init_1.0/init.xaml"/>'+'<pa'+'ram name="Windowless" value="'+pluginInfo.SilverlightWindowless+'" />'+'<pa'+'ram name="initParams" value="'+init_params+'" />'+'<\/obj'+'ect>';object_string+='<ifr'+'ame style="visibility:hidden;height:0;width:0;border:0;"><\/ifr'+'ame>';this.write(object_string);var scope=this;this.addEvent(window,'beforeunload',function(){scope.beforeUnload()})};SilverlightInfo.prototype.showClip=function(clip_info){ControlInfo.showInstance(silverlightInfo);var selected_item=clip_info.items[clip_info.selectedIndex];var items_string=this.createItemsString(clip_info.items);try{if(silverlightInfo.control){silverlightInfo.control.Content.asxlister.loadasx(items_string)}else{throw{}}}catch(e){this.resetBase();this.writeControl(clip_info,items_string)}};SilverlightInfo.prototype.createItemsString=function(items){var filler='';var seperator='|';var items_string;switch(items.length){case 0:items_string='';break;case 1:if(items[0].bandwidth<780)items_string=items[0].wvxPath+seperator+filler+seperator+filler;else if(items[0].bandwidth>=780&&items[0].bandwidth<820)items_string=filler+seperator+items[0].wvxPath+seperator+filler;else
items_string=filler+seperator+filler+seperator+items[0].wvxPath;break;case 2:if(items[1].bandwidth<1480){items_string=items[0].wvxPath+seperator+items[1].wvxPath+seperator+filler}else{items_string=filler+seperator+items[0].wvxPath+seperator+items[1].wvxPath}break;default:items_string='';for(var i=items.length-3;i<items.length;i++){items_string+=items[i].wvxPath+(i<items.length-1?seperator:'')}break}return items_string};SilverlightInfo.prototype.beforeUnload=function(){return;try{this.control.Content.asxlister.OnBeforeUnloadSL()}catch(e){}};SilverlightInfo.prototype.shutUp=function(){this.resetBase()};function onloadSilverlight(sender,args){try{silverlightInfo.control=sender.getHost()}catch(e){silverlightInfo.control=null}silverlightInfo.initArgs=args}function onerrorSilverlight(sender,args){var errMsg;try{var appSource="";if(sender!=null&&sender!=0){appSource=sender.getHost().Source}var errorType=args.ErrorType;var iErrorCode=args.ErrorCode;errMsg="Unhandled error in Silverlight 2 Application "+appSource+"<br />";errMsg+="Code: "+iErrorCode+"<br />";errMsg+="Category: "+errorType+"<br />";errMsg+="Message: "+args.ErrorMessage+"<br />";if(errorType=="ParserError"){errMsg+="File: "+args.xamlFile+"<br />";errMsg+="Line: "+args.lineNumber+"<br />";errMsg+="Position: "+args.charPosition+"<br />"}else if(errorType=="RuntimeError"){if(args.lineNumber!=0){errMsg+="Line: "+args.lineNumber+"<br />";errMsg+="Position: "+args.charPosition+"<br />"}errMsg+="MethodName: "+args.methodName+"<br />"}}catch(e){errMsg="Unhandled error in Silverlight 2 Application. Unable to read additional information."}silverlightInfo.silverlightErrors.push(errMsg);silverlightInfo.debug(errMsg)}function onSourceDownloadProgressChanged(sender,eventArgs){}function f_showswf(streamspot,duration,selected_index){}function f_startedWMVfile(){try{overlayInfo.getInfo()}catch(e){}}function f_startOverlay(player_id){overlayInfo.beginStreamspot()}function registerBitrate(new_bitrate){clientInfo.setQuality(new_bitrate)}function showHyves(){shareInfo.doHyves()}function showMailShare(){shareInfo.showContainer(true)}function isDRM(){mediaInfo.isDRMOrInvalid()}function handleScriptCommand(scType,Param){if(window.rtlchat){rtlchat.handleScriptCommand(scType,Param,silverlightInfo)}else if(location.href.indexOf('debugplayer')!=-1&&typeof chatDebugAlert=='undefined'){window.chatDebugAlert=true;alert('Er is geen chat handler gevonden.')}}function mediaEnded(r_StrPlayerID){f_StartPostRoll(r_StrPlayerID)}function f_StartPostRoll(r_StrPlayerID){doPostRoll()}function f_status(playerID,source,status,volume){}function doPostRoll(){var newDartSpot=mediaInfo.clipInfo.dart1.replace(/rtlgemist.rtl.nl/,"rtlgemist.postroll.rtl.nl");mediaInfo.clipInfo.dartURL=mediaInfo.clipInfo.dartURL.replace(/rtlgemist.rtl.nl/,"rtlgemist.postroll.rtl.nl");streamspotInfo.showStreamspot(newDartSpot,"postRollPlayer")}function hidePlayer(){streamspotInfo.resetBase();var player_container=document.getElementById('rtlpp_player');var player_close_tween=new Tween(player_container.style,'height',Tween.strongEaseInOut,parseInt(player_container.style.height),1,2,'px');//tween to 0 fails in ie
player_close_tween.onMotionFinished=function(){player_container.style.visibility='hidden';mediaInfo.initialTweenDone=false;mediaInfo.isTweening=false};if(!mediaInfo.isTweening){mediaInfo.isTweening=true;player_close_tween.start()}}function WMVInfo(container_id,do_clicktag_id){ControlInfo.call(this,container_id);this.writes=0;this.defaultControlsHeight=60;this.controlsHeight=this.determineControlsHeight();this.doClicktagDiv=document.getElementById(do_clicktag_id);this.streamSense=null;this.onBeforeUnloadAttached=false;this.doingLicenseAcquisition=false}WMVInfo.prototype=new ControlInfo;WMVInfo.prototype.show=function(){if(overlayInfo.streamspotShowing){overlayInfo.show()}ControlInfo.prototype.show.call(this)};WMVInfo.prototype.hide=function(){ControlInfo.prototype.hide.call(this)};WMVInfo.prototype.writeControl=function(clip_info){ControlInfo.showInstance(wmvInfo);var selected_item=clip_info.items[clip_info.selectedIndex];var sizes=this.calculateRenderSize(selected_item);var object_string;if(pluginInfo.WMPFirefoxPlugin){object_string='<emb'+'ed name="wmv_control_embed" sr'+'c="'+selected_item.wvxPath+'" width="'+sizes.w+'" height="'+sizes.h+'" autoplay="1" controller="1" showstatusbar="1"><\/emb'+'ed>'}else{object_string='<obj'+'ect id="wmv_control_object" width="'+sizes.w+'" height="'+sizes.h+'" classid="clsid:6BF52A52-394A-11d3-B153-00C04F79FAA6" type="application/x-oleobject">'+'<par'+'am name="URL" value="'+selected_item.wvxPath+'">'+'<par'+'am name="autoStart" value="true">'+'<par'+'am name="uiMode" value="full">'+'<par'+'am name="volume" value="'+clientInfo.volume+'">'+'<par'+'am name="stretchToFit" value="true">'+'<par'+'am name="windowlessVideo" value="true">'+'<emb'+'ed name="wmv_control_embed" sr'+'c="'+selected_item.wvxPath+'" width="'+sizes.w+'" height="'+sizes.h+'" autoplay="1" controller="1" showstatusbar="1"><\/emb'+'ed>'+'<\/obj'+'ect>'}this.controlContainer.innerHTML='';if(pluginInfo.WMPOtherBrowser){var div=document.createElement('div');div.style.position='absolute';div.style.visibility='visible';div.style.left=sizes.x+'px';div.style.top=sizes.y+'px';this.controlContainer.appendChild(div);div.innerHTML=object_string;this.controlWritten=true}else{this.write(object_string)}this.writes++;if(pluginInfo.WMPScriptable){try{this.control=document.getElementById('wmv_control_object');this.control.attachEvent('MediaChange',mediaChangeWMV);this.control.attachEvent('ScriptCommand',handleScriptCommandWMV);this.control.attachEvent('OpenStateChange',handleOpenStateChange);this.control.attachEvent('PlayStateChange',handlePlayStateChange);this.control.attachEvent('DoubleClick',handleDoubleClickWMV);if(!this.onBeforeUnloadAttached){this.onBeforeUnloadAttached=true;window.attachEvent('onbeforeunload',function(){wmvInfo.registerVolume()})}if(window.ns_API&&ns_API.streaming&&!this.streamSense){try{this.streamSense=new ns_API.streaming.mediaPlayer(this.control);this.streamSense.onInit()}catch(e){}}}catch(e){this.control=null}}else if(pluginInfo.WMPFirefoxPlugin){setTimeout(function(){wmvInfo.afterWriteActions()},1000)}if(pluginInfo.WMVPluginQuality>=2.4){this.controlContainer.style.width='732px';this.controlContainer.style.height=(mediaInfo.tweenHeight+12)+'px';document.getElementById('rtlpp_player').style.overflow='visible'}};WMVInfo.prototype.showClip=function(clip_info){ControlInfo.showInstance(this);try{if(this.control){this.control.close();this.control.URL=clip_info.items[clip_info.selectedIndex].wvxPath;try{}catch(err){}}else{throw{}}}catch(e){this.resetBase();this.writeControl(clip_info)}this.doingLicenseAcquisition=false};WMVInfo.prototype.afterWriteActions=function(){try{document.wmv_control_embed.settings.volume=clientInfo.volume;if(!this.onBeforeUnloadAttached){this.onBeforeUnloadAttached=true;this.addEvent(window,'beforeunload',function(){wmvInfo.registerVolume()})}}catch(e){}};WMVInfo.prototype.registerVolume=function(){if(this!=mediaInfo.defaultControl)return;var ctrl=this.control||document.wmv_control_embed;var new_volume;try{new_volume=ctrl.settings.volume}catch(e){new_volume=NaN}if(!isNaN(new_volume)){clientInfo.setVolume(new_volume)}};WMVInfo.prototype.calculateRenderSize=function(selected_item){if(!pluginInfo.WMPOtherBrowser){return{x:0,y:0,w:ControlInfo.baseWidth,h:(ControlInfo.baseHeight+this.controlsHeight)}}var x,y,w,h,tmp;w=selected_item.width;h=selected_item.height;if(w==0||h==0){w=720;h=404}if(w>ControlInfo.baseWidth){tmp=(ControlInfo.baseWidth/w);w=ControlInfo.baseWidth;h=Math.round(tmp*h)}h=h+this.controlsHeight;x=(w==ControlInfo.baseWidth)?0:Math.round((ControlInfo.baseWidth/2)-(w/2));y=(h>=ControlInfo.baseHeight)?0:Math.round((ControlInfo.baseHeight/2)-(h/2));return{x:x,y:y,w:w,h:h}};WMVInfo.prototype.determineControlsHeight=function(){if(pluginInfo.WMVPluginName.indexOf('windows media player')!=-1)return 66;else if(pluginInfo.WMVPluginName.indexOf('flip4mac')!=-1)return 15;else
return this.defaultControlsHeight};WMVInfo.prototype.openClicktagURL=function(div_el){var clicktag_rx=/clickTag=([^&]+)/;var cm_url=(wmvInfo.control&&wmvInfo.control.currentMedia?wmvInfo.control.currentMedia.sourceURL:'');var clicktag_matches=cm_url.match(clicktag_rx);if(clicktag_matches){var clicktag_url=unescape(clicktag_matches[1]).replace(/^\s+/g,'').replace(/\s+$/g,'');if(clicktag_url.indexOf('http://')!=0)clicktag_url='http://'+clicktag_url;window.open(clicktag_url,'_blank')}};WMVInfo.prototype.shutUp=function(){var do_reset_base=true;if(pluginInfo.WMPScriptable&&this.control){do_reset_base=false;try{this.control.controls.stop()}catch(e){do_reset_base=true}}if(do_reset_base){this.resetBase()}};function mediaChangeWMV(Item){}function handleScriptCommandWMV(scType,Param){if(window.rtlchat){rtlchat.handleScriptCommand(scType,Param,wmvInfo)}else if(location.href.indexOf('debugplayer')!=-1&&typeof chatDebugAlert=='undefined'){window.chatDebugAlert=true;alert('Er is geen chat handler gevonden.')}}function handlePlayStateChange(NewState){if(NewState==8){doPostRoll()}}function handleOpenStateChange(NewState){switch(NewState){case 16:if(wmvInfo.doingLicenseAcquisition){try{wmvInfo.doingLicenseAcquisition=false;wmvInfo.control.controls.stop()}catch(e){}}else{wmvInfo.doingLicenseAcquisition=true}break;case 17:wmvInfo.doingLicenseAcquisition=false;break}}function handleDoubleClickWMV(nButton,nShiftState,fX,fY){try{if(!wmvInfo.control.fullScreen){wmvInfo.control.fullScreen=true}}catch(e){}}function ShareInfo(container_id){ControlInfo.call(this,container_id);this.taf=null;this.extenderTopContainer=document.getElementById('extender_share_top_container');this.extenderSubContainer=document.getElementById('extender_share_sub_container');this.extenderContainer=document.getElementById('extender_share_container');this.extenderTafExtraContainer=document.getElementById('extender_share_tafextra_top_container');this.extenderImageLinkText=document.getElementById('extender_share_imagelink_text');this.extenderSiteTitle=document.getElementById('extender_share_site_title');this.extenderClipTitle=document.getElementById('extender_share_clip_title');this.extenderQualityLow=document.getElementById('extender_share_quality_select_low_button');this.extenderQualityHigh=document.getElementById('extender_share_quality_select_high_button');this.extenderSelectedEl=null;this.flashLinkHTML='<object width="377" height="314" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000">\n<param name="movie" value="http://www.rtl.nl/system/video/swf##component_path##" />\n<param name="wmode" value="transparent" />\n<embed src="http://www.rtl.nl/system/video/swf##component_path##" type="application/x-shockwave-flash" wmode="transparent" width="377" height="314" />\n<\/object>';this.imageLinkHTML='<a href="http://www.rtl.nl##component_path##"><img src="##image_path##" border="0" /><\/a>';this.usedLinkHTML='flashLinkHTML';this.useExtender=(!pluginInfo.SilverlightInstalled||pluginInfo.forceWMP);this.useExtenderTween=(pluginInfo.WMVPluginQuality<3);this.extenderPositions={closed:-272,open:0};this.extenderHasFocus=false;this.extenderMouseOver=false;this.extenderExplicitClosing=false;this.extenderIsOpen=false;this.extenderCloseTimer=null;this.extenderCloseTimeout=2000;this.extenderLastMousemove=(new Date()).getTime();this.extenderMouseMoveTimer=null;this.silverlightDownloadUrl='http://www.microsoft.com/SILVERLIGHT/resources/install.aspx';if(this.useExtender){this.prepareExtender()}this.tween=null;this.tweenDirection=0}ShareInfo.prototype=new ControlInfo;ShareInfo.prototype.show=function(){if(!this.useExtender){this.taf.taf_top_container.style.display='block'}ControlInfo.prototype.show.call(this)};ShareInfo.prototype.hide=function(){if(!this.useExtender){this.taf.tafextra_top_container.style.visibility='hidden';this.taf.taf_top_container.style.display='none'}ControlInfo.prototype.hide.call(this)};ShareInfo.prototype.resetBase=function(){if(this.useExtender){this.resetExtender()}};ShareInfo.prototype.prepareExtender=function(){if(!pluginInfo.IE){this.extenderTopContainer.addEventListener('focus',function(e){shareInfo.onFocus(e)},true);this.extenderTopContainer.addEventListener('blur',function(e){shareInfo.onBlur(e)},true)}else{this.extenderTopContainer.onfocusin=function(){shareInfo.onFocus()};this.extenderTopContainer.onfocusout=function(){shareInfo.onBlur()}}if(this.useExtenderTween){this.extenderSubContainer.style.left=this.extenderPositions.closed+'px'}};ShareInfo.prototype.refresh=function(clip_info){switch(clip_info.items.length){case 1:this.extenderQualityLow.className=(clip_info.items[0].bandwidth<850?'extender_share_quality_select_button_active':'extender_share_quality_select_button_hidden');this.extenderQualityHigh.className=(clip_info.items[0].bandwidth<850?'extender_share_quality_select_button_hidden':'extender_share_quality_select_button_active');this.extenderSelectedEl=(clip_info.items[0].bandwidth<850?this.extenderQualityLow:this.extenderQualityHigh);break;default:this.extenderQualityLow.className=(clip_info.selectedIndex==clip_info.items.length-1?'extender_share_quality_select_button':'extender_share_quality_select_button_active');this.extenderQualityHigh.className=(clip_info.selectedIndex==clip_info.items.length-1?'extender_share_quality_select_button_active':'extender_share_quality_select_button');this.extenderSelectedEl=(clip_info.selectedIndex==clip_info.items.length-1?this.extenderQualityHigh:this.extenderQualityLow);break}var title_no_entities=clip_info.title.removeHtmlEntities();document.title=title_no_entities;this.extenderSiteTitle.innerHTML=window.siteTitle;this.extenderClipTitle.firstChild.nodeValue=title_no_entities;this.extenderImageLinkText.value=this[this.usedLinkHTML].replace(/##component_path##/g,clip_info.path).replace(/##image_path##/g,clip_info.label);this.taf.sendMessageURL=clip_info.taf};ShareInfo.prototype.showContainer=function(activate){if(activate){ControlInfo.showInstance(this)}else{ControlInfo.showInstance((streamspotInfo.playing?streamspotInfo:mediaInfo.defaultControl))}};ShareInfo.prototype.showExtender=function(){this.extenderIsOpen=true;clearInterval(this.extenderMouseMoveTimer);clearTimeout(this.extenderCloseTimer);this.extenderLastMousemove=(new Date()).getTime();this.extenderMouseMoveTimer=setInterval(function(){shareInfo.pollMouseMove()},1000);this.extenderTopContainer.style.visibility='visible';this.extenderContainer.style.visibility='inherit';this.extenderTafExtraContainer.style.visibility='hidden';if(!this.useExtenderTween)return;var left_pos=parseInt(this.extenderSubContainer.style.left,10);this.tweenDirection=1;this.tween=new Tween(this.extenderSubContainer.style,'left',Tween.strongEaseOut,left_pos,this.extenderPositions.open,0.5,'px');this.tween.shareInfo=this;this.tween.onMotionFinished=function(){this.shareInfo.tweenDirection=0;this.shareInfo.taf.positionAddressBook()};this.tween.start()};ShareInfo.prototype.hideExtender=function(){this.extenderIsOpen=false;clearInterval(this.extenderMouseMoveTimer);clearTimeout(this.extenderCloseTimer);if(!this.useExtenderTween){this.resetExtender();return}var left_pos=parseInt(this.extenderSubContainer.style.left,10);this.tweenDirection=-1;this.tween=new Tween(this.extenderSubContainer.style,'left',Tween.strongEaseIn,left_pos,this.extenderPositions.closed,0.5,'px');this.tween.shareInfo=this;this.tween.onMotionFinished=function(){this.shareInfo.resetExtender();this.shareInfo.tweenDirection=0};this.tween.start()};ShareInfo.prototype.hideExtenderExplicit=function(){if(this.taf.busy)return;this.extenderExplicitClosing=true;this.hideExtender()};ShareInfo.prototype.resetExtender=function(){this.extenderTopContainer.style.visibility='hidden';this.extenderContainer.style.visibility='hidden';this.extenderTafExtraContainer.style.visibility='hidden';this.extenderExplicitClosing=false};ShareInfo.prototype.doMouseMove=function(e){this.extenderLastMousemove=(new Date()).getTime()};ShareInfo.prototype.pollMouseMove=function(){if(!this.extenderIsOpen||this.extenderHasFocus||this.taf.busy)return;if((new Date()).getTime()-this.extenderLastMousemove>5000){this.hideExtenderExplicit()}};ShareInfo.prototype.doMouseOver=function(el){if(!this.useExtender||this.extenderExplicitClosing)return;this.extenderMouseOver=true;clearTimeout(this.extenderCloseTimer);if(this.extenderIsOpen)return;if(this.tweenDirection==-1){this.tween.stop()}this.showExtender()};ShareInfo.prototype.doMouseOut=function(el){if(!this.useExtender)return;this.extenderMouseOver=false;clearTimeout(this.extenderCloseTimer);if(this.extenderHasFocus||this.taf.busy||this.extenderExplicitClosing)return;this.extenderCloseTimer=setTimeout(function(){shareInfo.hideExtender()},this.extenderCloseTimeout)};ShareInfo.prototype.onFocus=function(e){if(this.extenderExplicitClosing)return;if(pluginInfo.IE){var active_nodename=event.srcElement.nodeName.toLowerCase();if(active_nodename=='input'||active_nodename=='textarea'||active_nodename=='select'){this.extenderHasFocus=true}}else{this.extenderHasFocus=true}if(this.extenderHasFocus){clearTimeout(this.extenderCloseTimer)}};ShareInfo.prototype.onBlur=function(e){this.extenderHasFocus=false;if(this.extenderMouseOver||this.taf.busy||this.extenderExplicitClosing)return;this.extenderCloseTimer=setTimeout(function(){shareInfo.hideExtender()},this.extenderCloseTimeout)};ShareInfo.prototype.changeQuality=function(evt){if(!mediaInfo.clipInfo||!mediaInfo.clipInfo.path)return;var source=(window.event?event.srcElement:evt.target);source=(source.nodeType==3?source.parentNode:source);var rel=source.getAttribute('rel');if(!rel||this.extenderSelectedEl==this['extenderQuality'+rel])return;this.extenderSelectedEl.className='extender_share_quality_select_button';this.extenderSelectedEl=this['extenderQuality'+rel];this.extenderSelectedEl.className='extender_share_quality_select_button_active';clientInfo.setQuality(rel.toLowerCase());if(pluginInfo.WMVPluginQuality>=4){location.href=mediaInfo.clipInfo.path}else{mediaInfo.playItem(false)}};ShareInfo.prototype.doHyves=function(){if(!mediaInfo.clipInfo)return;var open_url='/system/videoplayer/derden/hyves/?video='+encodeURIComponent(mediaInfo.clipInfo.path)+'&titel='+encodeURIComponent(document.title);try{var win=window.open(open_url,'add_to_hyves');win.focus()}catch(e){}};ShareInfo.prototype.doSilverlightDownload=function(){try{var win=window.open(this.silverlightDownloadUrl,'download_sl');win.focus()}catch(e){}};function ErrorInfo(container_id){ControlInfo.call(this,container_id);this.silverlightDownloadUrl='http://www.microsoft.com/SILVERLIGHT/resources/install.aspx'}ErrorInfo.prototype=new ControlInfo;ErrorInfo.prototype.resetBase=function(){};ErrorInfo.prototype.showNoValidPluginMessage=function(){ControlInfo.showInstance(this);var no_plugin_string='<h3 style="font-size:12px;">Je hebt waarschijnlijk niet de juiste software ge&#239;nstalleerd waardoor wij de video niet kunnen afspelen.<\/h3>';no_plugin_string+='De videos van RTL zijn het best te bekijken met Microsoft Silverlight. Download <a href="'+this.silverlightDownloadUrl+'" target="_blank" style="font-size:11px;text-decoration:underline;">hier<\/a> de nieuwste versie van dit programma.';document.getElementById('error_message').innerHTML=no_plugin_string};ErrorInfo.prototype.showNoDRMPluginMessage=function(){ControlInfo.showInstance(this);var no_drm_add=(pluginInfo.WIN?'Download <a href="http://www.microsoft.com/windows/windowsmedia/player/11/default.aspx" target="_blank" style="font-size:11px;text-decoration:underline;">hier<\/a> de nieuwste versie.':'Deze is helaas niet beschikbaar voor dit systeem.');var no_drm_string='<h3 style="font-size:12px;">Deze video kan alleen worden afgespeeld in Windows Media Player. '+no_drm_add+'<\/h3>';document.getElementById('error_message').innerHTML=no_drm_string};function CustomInfo(container_id,callback_func,custom_height){ControlInfo.call(this,container_id);if(typeof callback_func=='function'){this.overrideStart(callback_func)}if(typeof custom_height=='number'&&custom_height>0){MediaInfo.customHeight=custom_height}}CustomInfo.prototype=new ControlInfo;CustomInfo.prototype.resetBase=function(){};CustomInfo.prototype.overrideStart=function(callback_func){var scope=this;var start_func=function(){ControlInfo.showInstance(scope);try{callback_func()}catch(e){}};MediaInfo.customStart=start_func;this.overrideLoadClipInfo()};CustomInfo.prototype.showAndDeleteOtherControls=function(){if(mediaInfo.isTweening)return;var instance;for(var i=0;i<ControlInfo.instances.length;i++){var instance=ControlInfo.instances[i];if(instance!=this){instance.hide();instance.resetBase()}}ControlInfo.instanceShown=this;this.show();this.overrideLoadClipInfo()};CustomInfo.prototype.setHeight=function(new_height){if(mediaInfo.isTweening)return;if(typeof new_height!='number'||new_height<0)return;document.getElementById('rtlpp_player').style.height=new_height+'px'};CustomInfo.prototype.overrideLoadClipInfo=function(){MediaInfo.prototype.loadClipInfo=function(file_path){if(typeof file_path!='string'||file_path=='')return;location.href=file_path}};var Cookies={set:function(name,value,days){var date=new Date();date.setTime(date.getTime()+(days*24*60*60*1000));document.cookie=name+'='+value+'; expires='+date.toGMTString()+'; path=/; domain=.rtl.nl'},get:function(name){var rx=eval('/'+name+'=([^;]+)/');var cookie_nv=document.cookie.match(rx);return(cookie_nv?cookie_nv[1]:'')},remove:function(name){this.set(name,'',-1)}};String.prototype.removeHtmlEntities=function(){var html_entities={nbsp:160,iexl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,copy:169,ordf:170,laquo:171,not:172,shy:173,reg:174,macr:175,deg:176,plusmn:177,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,supl:185,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,Agrave:192,Aacute:193,Acirc:194,Atilde:195,Auml:196,Aring:197,AElig:198,Ccedil:199,Egrave:200,Eacute:201,Ecirc:202,Euml:203,Igrave:204,Iacute:205,Icirc:206,Iuml:207,ETH:208,Ntilde:209,Ograve:210,Oacute:211,Ocirc:212,Otilde:213,Ouml:214,times:215,Oslash:216,Ugrave:217,Uacute:218,Ucirc:219,Uuml:220,Yacute:221,THORN:222,szlig:223,agrave:224,aacute:225,acirc:226,atilde:227,auml:228,aring:229,aelig:230,ccedil:231,egrave:232,eacute:233,ecirc:234,euml:235,igrave:236,iacute:237,icirc:238,iuml:239,eth:240,ntilde:241,ograve:242,oacute:243,ocirc:244,otilde:245,ouml:246,divide:247,oslash:248,ugrave:249,uacute:250,ucirc:251,uuml:252,yacute:253,thorn:254,yuml:255,apos:39,quot:34,amp:38,lt:60,gt:62,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,circ:710,tilde:732,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,permil:8240,lsaquo:8249,rsaquo:8250,euro:8364};return this.replace(/&([a-z0-9]{3,7});/gi,function(t){var entity_name=t.replace('&','').replace(';','');return(html_entities.hasOwnProperty(entity_name)?String.fromCharCode(html_entities[entity_name]):'')}).replace(/&#([0-9]+|x[0-9A-F]+);/g,function(t){return(t.indexOf('x')!=-1)?String.fromCharCode(parseInt(t.replace(/[^0-9A-F]/gi,''),16)):String.fromCharCode(Number(t.replace(/[^0-9]/g,'')))})};if(typeof Node!='undefined'&&typeof Node.prototype.outerHTML=='undefined'&&typeof Node.prototype.__defineGetter__!='undefined'&&typeof XMLSerializer=='function'){Node.prototype.__defineGetter__('outerHTML',function(){return(new XMLSerializer()).serializeToString(this)})}function new_video(vid_url,vid_nr_id,type,el){if(typeof window.mediaInfo=='undefined')return;mediaInfo.loadClipInfo(vid_url)}