function array_length(arr) { var length = 0; for(val in arr) { if(!(val in Array.prototype)) length++; } return length; } var playlist = 0; var interval; function lib_bwcheck() { this.ver = navigator.appVersion; this.agent = navigator.userAgent; this.dom = document.getElementById ? 1 : 0; this.opera5 = (navigator.userAgent.indexOf("Opera")>-1 && document.getElementById) ? 1 : 0; this.ie5 = (this.ver.indexOf("MSIE 5") > -1 && this.dom && !this.opera5) ? 1 : 0; this.ie6 = (this.ver.indexOf("MSIE 6") > -1 && this.dom && !this.opera5) ? 1 : 0; this.ie4 = (document.all && !this.dom && !this.opera5) ? 1 : 0; this.ie = this.ie4 || this.ie5 || this.ie6 this.mac = this.agent.indexOf("Mac") > -1 this.ns6 = (this.dom && parseInt(this.ver) >= 5) ? 1 : 0; this.ns4 = (document.layers && !this.dom) ? 1 : 0; this.bw = (this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns6 || this.opera5); return this } var bw = lib_bwcheck(); function layerSwitch(whichLayer,state) { if (document.getElementById) { // this is the way the standards work var style2 = document.getElementById(whichLayer).style; if (bw.ie5 == 1 || bw.ie6 == 1) { style2.visibility = (state == 1 ? "visible" : "hidden"); } else style2.display = (state == 1 ? "block" : ""); } else if (document.all) { // this is the way old msie versions work var style2 = document.all[whichLayer].style; style2.display = (state == 1 ? "block" : ""); } else if (document.layers) { // this is the way nn4 works var style2 = document.layers[whichLayer].style; style2.display = (state == 1 ? "block" : ""); } } function showImageToggle() { //promoimage en promoheadline moeten juiste waarde krijgen document.getElementById('promoimage').src = webroot + 'images/promo/' + promoimage[promoid[active]]; document.getElementById('promoimage').alt = promotext[promoid[active]]; document.getElementById('promoheadline').innerHTML = promotext[promoid[active]]; if (document.getElementById('newslink' + promoid[active])) { if (typeof document.getElementById('promoheadline').href != 'undefined') { document.getElementById('promoheadline').href = document.getElementById('newslink' + promoid[active]).href; document.getElementById('playlink').href = document.getElementById('newslink' + promoid[active]).href; document.getElementById('promolink').href = document.getElementById('newslink' + promoid[active]).href; } document.getElementById('newslink' + promoid[1]).className = active == 1 ? 'blacktext' : 'graytext'; document.getElementById('newslink' + promoid[2]).className = active == 2 ? 'blacktext' : 'graytext'; document.getElementById('newslink' + promoid[3]).className = active == 3 ? 'blacktext' : 'graytext'; } } function startShowLoop() { if (active > 0) clearInterval(interval); active++; if (active > 3) active = 1; showImageToggle(); interval = window.setInterval("startShowLoop()", 5 * 1000); } function pauseShowLoop(mouseid) { clearInterval(interval); active = mouseid; showImageToggle(); } function resumeShowLoop() { interval = window.setInterval("startShowLoop()", 5 * 1000); } function clickBack() { active = active == 1 ? array_length(promoimage) : active - 1; pauseShowLoop(active); } function clickNext() { active = active >= array_length(promoimage) ? 1 : active + 1; pauseShowLoop(active); } function init() { for(i in promoimage) { menubutton1_over = newImage(webroot + 'images/promo/' + promoimage[i]); } if (active == 0) startShowLoop(); else interval = window.setInterval("startShowLoop()", 5 * 1000); }