function ticker_start() { ticker = document.getElementById("rssticker"); ticker_content = ticker.innerHTML; ticker_width = ticker.style.width; // Firefox/Safari/Opera if (navigator.userAgent.indexOf("Firefox")!=-1 || navigator.userAgent.indexOf("Safari")!=-1 || navigator.userAgent.indexOf("Opera")!=-1) { ticker.innerHTML = "<table cellspacing='0' cellpadding='0' width='100%'><tr><td nowrap='nowrap' style='"+style+"' id='TICKER_BODY' width='100%'> </span></td></tr></table>"; tickerSupported = true; } // IE if (navigator.userAgent.indexOf("MSIE")!=-1 && navigator.userAgent.indexOf("Opera")==-1) { ticker.innerHTML = "<div style='width:100%'><span style='"+style+"' id='TICKER_BODY' width='100%'></span></div>"; tickerSupported = true; } if(!tickerSupported) ticker.outerHTML = ""; else { ticker.scrollLeft = ticker_righttoleft ? ticker.scrollWidth - ticker.offsetWidth : 0; document.getElementById("TICKER_BODY").innerHTML = ticker_content; ticker.style.display="block"; ticker_tick(); } } function getFeed(url){ if(url == undefined) url = "/feeds/ticker_feed"; $.getJSON(url, function(data){ $("div#ticker").fadeOut(500,function(){ if(data != undefined){ $("div#rssticker").html(data.feed); $("div#tickerlogo img").attr("src", "/images/icons/" + data.title.toLowerCase() + ".gif"); $("div#ticker").fadeIn(500); ticker_start(); window.clearTimeout(feedLoopIntervalID); feedLoopIntervalID = window.setTimeout(getFeed, 300000); } else { $.ajaxSetup ({cache: false}); $("div#rssticker").html("Fout tijdens ophalen feeds… nieuwe poging in 5 seconde <a href='' id='retry_feed'>of nu</a>"); $("div#ticker").fadeIn(500); feedIntervalID = window.setTimeout(function(){getFeed()}, 5000); } }); }); } function ticker_tick() { if(++tickerCount == 3){ if(!paused) ticker.scrollLeft += speed * (ticker_righttoleft ? -1 : 1); if(ticker_righttoleft && ticker.scrollLeft <= 0) ticker.scrollLeft = ticker.scrollWidth - ticker.offsetWidth; if(!ticker_righttoleft && ticker.scrollLeft >= ticker.scrollWidth - ticker.offsetWidth) ticker.scrollLeft = 0; tickerCount = 0; } window.clearTimeout(tickerIntervalID); tickerIntervalID = window.setTimeout("ticker_tick()", 10); }
var body, wrapper, width, height; window.onresize = function (evt) { setWrapper(); } window.onload = function() { body = document.getElementsByTagName('body'); wrapper = document.getElementById("wrapper"); setWrapper(); } function getSize() { if( typeof( window.innerWidth ) == 'number' ) { //Non-IE width = window.innerWidth; height = window.innerHeight; } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) { //IE 6+ in 'standards compliant mode' width = document.documentElement.clientWidth; height = document.documentElement.clientHeight; } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) { //IE 4 compatible width = document.body.clientWidth; height = document.body.clientHeight; } } function setWrapper(){ getSize(); if(height < 700){ wrapper.className = "wrapper"; //document.getElementById("content").style.height = height + "px"; body.style.overflowY = "scroll"; } else { wrapper.className = "wrapperVCenter"; body.style.overflowY = "hidden"; } }