var contentDispositionFile="";var statisticsFile="";var mediaplayerFile="/behaviour/flash/govvid-mediaplayer.swf";var govvidOpera=window.opera?true:false;var govvidIE=(document.all&&document.getElementById&&!govvidOpera)?true:false;var govvidSafari=(navigator.userAgent.toLowerCase().indexOf("safari")>=0)?true:false;var debug=false;var arAllFileTypes=new Array();arAllFileTypes.jwmedia=new Array("flv","mp3");arAllFileTypes.quicktime=new Array("smil","mp4","mov","mp3");arAllFileTypes.winmedia=new Array("wmv","mp3","wma");var arVideoFileTypes=new Array();arVideoFileTypes.jwmedia=new Array("flv");arVideoFileTypes.quicktime=new Array("smil","mp4","mov");arVideoFileTypes.winmedia=new Array("wmv");var arFileTypes=new Array();GovVid=function(c,b,a){this.id=c;this.width=b;this.height=a;this.movies=new Object();this.audioFiles=new Object();this.captions=new Object();this.image=""};GovVid.prototype.addMovie=function(c){var b=c.split("/");var a=b[b.length-1];var d=a.split(".");var e=d[d.length-1];this.movies[e]=c};GovVid.prototype.addAudio=function(a){var b="mp3";this.audioFiles[b]=a};GovVid.prototype.addImage=function(a){this.image=a};GovVid.prototype.addCaption=function(b,a){this.captions[b]=a};GovVid.prototype.isAudioDescription=function(){if(this.movies.flv!=undefined||this.movies.mp4!=undefined||this.movies.wmv!=undefined){return true}return false};GovVid.prototype.inArray=function(a,d){var b;var c;for(b in d){for(c in a){if(b==a[c]){return b}}}return false};GovVid.prototype.write=function(a,b){b=typeof(b)!="undefined"?b:"choose";var d=document.getElementById(a);if(d&&b=="choose"){d.parentNode.style.width=parseInt(this.width)+"px";GovVid_makeListToggle(a)}else{if(b!="choose"){var c=document.getElementById("govvid_viewwithcaptions");if(c){c.parentNode.removeChild(c)}}}var g=false;var f=GovVid_getFlashPlayerVersion();var k;var h=new Array();if(this.isAudioDescription()){arFileTypes=arVideoFileTypes}else{arFileTypes=arAllFileTypes}if(f.major>7&&(b=="choose"||GovVid_in_array(arFileTypes.jwmedia,b))){if(mediaplayerFile==undefined||mediaplayerFile==""){alert("voor het afspelen met de flash plugin, is de jwmediaplayer vereist.\n vul de variable mediaplayerFile met de juiste waarde.");return false}k=parseInt(this.height)+20;if(g=this.inArray(arFileTypes.jwmedia,this.movies)){var e=new GovVidMovie(mediaplayerFile,this.id,this.width,k);e.addFlashVars("autostart","false");if(this.image!=""){e.addFlashVars("image",this.image)}if(this.captions.flv!=undefined){e.addFlashVars("captions",this.captions.flv)}if(this.audioFiles.mp3!=undefined){e.addFlashVars("audio",this.audioFiles.mp3)}e.addFlashVars("usecaptions","false");e.addFlashVars("overstretch","false");e.addFlashVars("file",this.movies[g]);if(statisticsFile!=undefined&&statisticsFile!=""){e.addFlashVars("callback",statisticsFile);e.addFlashVars("logevents",statisticsFile)}e.addFlashVars("showdigits","total");e.addFlashVars("showbuttons","true");e.addFlashVars("showstop","true");e.addFlashVars("bufferlength","5");e.addFlashVars("backcolor","0x000000");e.addFlashVars("frontcolor","0xFFFFFF");e.addFlashVars("lightcolor","0xFFFFFF");e.showMovie(a,"flash");return true}else{if(g=this.inArray(arFileTypes.jwmedia,this.audioFiles)){var j=new GovVidMovie(mediaplayerFile,this.id,this.width,k);j.addFlashVars("file",this.audioFiles[g]);if(statisticsFile!=undefined&&statisticsFile!=""){j.addFlashVars("callback",statisticsFile);j.addFlashVars("logevents",statisticsFile)}j.addFlashVars("showdigits","total");j.addFlashVars("showbuttons","true");j.addFlashVars("showstop","true");j.addFlashVars("bufferlength","5");j.addFlashVars("backcolor","0x000000");j.addFlashVars("frontcolor","0xFFFFFF");j.addFlashVars("lightcolor","0xFFFFFF");j.showMovie(a,"flash");return true}}}if(GovVid_isQTInstalled()&&!g&&(b=="choose"||GovVid_in_array(arFileTypes.quicktime,b))){k=parseInt(this.height)+16;if(b!="choose"){g=b}else{g=this.inArray(arFileTypes.quicktime,this.movies)}if(g){if(g=="smil"){k=parseInt(this.height)+115}var e=new GovVidMovie(this.movies[g],this.id,this.width,k)}else{if(g=this.inArray(arFileTypes.quicktime,this.audioFiles)){var e=new GovVidMovie(this.audioFiles[g],this.id,this.width,k)}}if(e){e.showMovie(a,"quicktime");return true}}if(GovVid_isWMPInstalled()&&!g&&(b=="choose"||GovVid_in_array(arFileTypes.winmedia,b))){k=parseInt(this.height)+46;if(g=this.inArray(arFileTypes.winmedia,this.movies)){var e=new GovVidMovie(this.movies[g],this.id,this.width,k)}else{if(g=this.inArray(arFileTypes.winmedia,this.audioFiles)){var e=new GovVidMovie(this.audioFiles[g],this.id,this.width,k)}}if(e){e.showMovie(a,"winmedia");if(this.movies.asx){GovVid_addLinkToList(d,this.movies.asx,"Bekijk deze video met ondertiteling")}return true}}return false};GovVidMovie=function(b,d,c,a){this.filename=b;this.id=d;this.width=c;this.height=a;this.flashvars=new Object()};GovVidMovie.prototype.addFlashVars=function(a,b){this.flashvars[a]=b};GovVidMovie.prototype.getFlashVars=function(){return this.flashvars};GovVidMovie.prototype.insertParamTag=function(d,b,c){var a=document.createElement("PARAM");a.setAttribute("name",b);a.setAttribute("value",c);d.appendChild(a)};GovVidMovie.prototype.getQuicktimeHTML=function(){if(govvidIE){var a=document.createElement("<object type='video/quicktime' classid='clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B' />")}else{var a=document.createElement("object");a.setAttribute("type","video/quicktime")}a.setAttribute("id",this.id);a.setAttribute("width",this.width);a.setAttribute("height",this.height);if(govvidIE||govvidSafari){this.insertParamTag(a,"src",this.filename)}else{a.setAttribute("data",this.filename)}this.insertParamTag(a,"autoplay","false");return a};GovVidMovie.prototype.getWinmediaHTML=function(){if(govvidIE){a=document.createElement("<object type='video/x-ms-wmv' />")}else{var a=document.createElement("object");a.setAttribute("type","video/x-ms-wmv")}a.setAttribute("id",this.id);a.setAttribute("width",this.width);a.setAttribute("height",this.height);if(govvidIE||govvidSafari||govvidOpera){this.insertParamTag(a,"src",this.filename)}else{a.setAttribute("data",this.filename)}this.insertParamTag(a,"autostart","0");return a};GovVidMovie.prototype.getFlashHTML=function(){var c="";if(this.flashvars){for(var b in this.getFlashVars()){c+=b+"="+this.flashvars[b]+"&"}}if(govvidIE){var a=document.createElement("<object type='application/x-shockwave-flash' />")}else{var a=document.createElement("object");a.setAttribute("type","application/x-shockwave-flash")}a.setAttribute("id",this.id);a.setAttribute("width",this.width);a.setAttribute("height",this.height);if(govvidIE||govvidSafari){this.insertParamTag(a,"src",this.filename)}else{a.setAttribute("data",this.filename)}this.insertParamTag(a,"flashvars",c);this.insertParamTag(a,"allowfullscreen","true");return a};GovVidMovie.prototype.showMovie=function(a,c){var b=document.getElementById(a);if(c=="flash"){b=GovVid_EmptyNode(b);b.appendChild(this.getFlashHTML())}else{if(c=="quicktime"){b=GovVid_EmptyNode(b);b.appendChild(this.getQuicktimeHTML())}else{if(c=="winmedia"){b=GovVid_EmptyNode(b);b.appendChild(this.getWinmediaHTML())}}}};function GovVid_getFlashPlayerVersion(){var b=new FlashPlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var a=navigator.plugins["Shockwave Flash"];if(a&&a.description){b=new FlashPlayerVersion(a.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."))}}else{try{var c=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7")}catch(d){try{var c=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");b=new FlashPlayerVersion([6,0,21]);c.AllowScriptAccess="always"}catch(d){if(b.major==6){return b}}try{c=new ActiveXObject("ShockwaveFlash.ShockwaveFlash")}catch(d){}}if(c!=null){b=new FlashPlayerVersion(c.GetVariable("$version").split(" ")[1].split(","))}}return b}FlashPlayerVersion=function(a){this.major=a[0]!=null?parseInt(a[0]):0;this.minor=a[1]!=null?parseInt(a[1]):0;this.rev=a[2]!=null?parseInt(a[2]):0};function GovVid_isQTInstalled(){var a=false;var c=false;if(navigator.plugins&&navigator.plugins.length){var d=navigator.plugins.length;for(var b=0;b<d;b++){var f=navigator.plugins[b];if(f.name.indexOf("QuickTime")>-1){a=true}}}else{if(window.ActiveXObject){var h=null;try{h=new ActiveXObject("QuickTime.QuickTime")}catch(g){}if(h){a=true}}else{alert("no active X")}}return a}function GovVid_isWMPInstalled(){var a=false;var d=false;if(navigator.plugins&&navigator.plugins.length){for(var b=0;b<navigator.plugins.length;b++){var c=navigator.plugins[b];if(c.name.indexOf("Windows Media Player")>-1){a=true}}}else{execScript('on error resume next: wmpObj = IsObject(CreateObject("MediaPlayer.MediaPlayer.1"))',"VBScript");a=d}return a}function GovVid_toggle(a){var b=document.getElementById(a);if(b){if(b.className=="close"){b.className="open"}else{b.className="close"}}}function GovVid_toggle_both(b){var a=b.replace(/ToggleLink/,"ToggleMenu");var c=b.replace(/ToggleMenu/,"ToggleLink");GovVid_toggle(a);GovVid_toggle(c)}function GovVid_EmptyNode(b){for(var a=b.childNodes.length-1;a>=0;a--){b.removeChild(b.childNodes[a])}return b}function GovVid_openBinary(){if(contentDispositionFile!=undefined&&contentDispositionFile!=""){var f=new Array("pdf","wmv","mov","mp4","flv","3gp","mp3","srt");var b=document.getElementsByTagName("a");var g=b.length;var h=new String(document.location);var a=h.split("/");var k="";if(h.indexOf("http://")==0&&a.length>2){k="http://"+a[2]}for(i=0;i<g;i++){var e=b[i];var c=String(e.getAttribute("href"));var l=c.split(".");var j=l[l.length-1];if(GovVid_in_array(f,j.toLowerCase())){var d=e.href.substr(k.length);e.href=contentDispositionFile+"?File="+d;e.onclick=function(){this.href=this.href}}else{if(e.className=="transcription"){e.onclick=function(){return newWin(this.href,"500","500")}}}}}}function GovVid_addLinkToList(b,c,f){if(b){var h=GovVid_getParentByClassname("moviecontent",b);if(!h){h=GovVid_getParentByClassname("audiocontent",b)}if(!h){h=GovVid_getParentByClassname("block-audio-video",b)}if(h){var a=h.getElementsByTagName("UL");if(c){var j=document.createElement("LI");j.setAttribute("id","govvid_viewwithcaptions");var d=document.createElement("A");d.setAttribute("href",c);var g=document.createTextNode(f);d.appendChild(g);j.appendChild(d);var e=a[0].getElementsByTagName("LI");a[0].insertBefore(j,e[0])}}}}function GovVid_makeListToggle(e){var g=document.getElementById(e);if(g){var p=GovVid_getParentByClassname("moviecontent",g);if(!p){p=GovVid_getParentByClassname("audiocontent",g)}if(!p){p=GovVid_getParentByClassname("block-audio-video",g)}if(p){var a=GovVid_getElementsByClassName("toggle","LI",p)}else{var a=GovVid_getElementsByClassName("toggle","LI")}var m=a.length;for(var h=0;h<m;h++){var n="govVid_ToggleMenu_"+h+e;var b="";var l="";var q=a[h].childNodes.length;for(var f=0;f<q;f++){var c=a[h].childNodes[f].tagName;if((c=="H2"||c=="H3"||c=="H4"||c=="H5"||c=="H6"||c=="SPAN"||c=="A")&&l==""){l=a[h].childNodes[f];var d="govVid_ToggleLink_"+h+e;var k=document.createElement("span");k.className="facet-button";if(c=="A"){l.id=d;l.onclick=function(){GovVid_toggle_both(this.id);return false}}else{var o=document.createElement("A");o.setAttribute("href","#");o.setAttribute("id",d);l.appendChild(o);o.appendChild(l.firstChild);o.appendChild(k);k=null;o.onclick=function(){GovVid_toggle_both(this.id);return false}}GovVid_toggle(d)}if((c=="UL"||c=="DIV"||c=="P")&&b==""){b=a[h].childNodes[f];b.id=n;GovVid_toggle(n)}}}}else{alert("id '"+e+"'not found!")}}function GovVid_in_array(d,c){var a=d.length;for(var b=0;b<a;b++){if(d[b]==c){return true}}return false}function GovVid_getElementsByClassName(h,j,g){var b=new RegExp("(^|\\s)"+h+"(\\s|$)");var j=j||"*";var g=g||document;var a=(j=="*"&&g.all)?g.all:g.getElementsByTagName(j);var d=[];var f;var c=a.length;for(var e=0;e<c;e++){f=a[e];if(b.test(f.className)){d.push(f)}}return d}function GovVid_getParentByClassname(a,c){var b=new RegExp("(^|\\s)"+a+"(\\s|$)");while(c.tagName!="BODY"){if(b.test(c.className)){return c}c=c.parentNode}return false}var currentPosition;var currentVolume;function loadFile(a){thisMovie("mediaplayer").loadFile(fil)}function thisMovie(a){if(navigator.appName.indexOf("Microsoft")!=-1){return window[a]}else{return document[a]}}function sendEvent(b,a){thisMovie("mediaplayer").sendEvent(b,a)}function getUpdate(c,b,a){if(c=="time"){currentPosition=b}else{if(c=="volume"){currentVolume=b}}};