Date.prototype.getWeek = function (dowOffset) { /*getWeek() was developed by Nick Baicoianu at MeanFreePath: http://www.meanfreepath.com */ dowOffset = typeof(dowOffset) == 'int' ? dowOffset : 1; //default dowOffset to one: monday var newYear = new Date(this.getFullYear(),0,1); var day = newYear.getDay() - dowOffset; //the day of week the year begins on day = (day >= 0 ? day : day + 7); var daynum = Math.floor((this.getTime() - newYear.getTime() - (this.getTimezoneOffset()-newYear.getTimezoneOffset())*60000)/86400000) + 1; var weeknum; //if the year starts before the middle of a week if(day < 4) { weeknum = Math.floor((daynum+day-1)/7) + 1; if(weeknum > 52) { nYear = new Date(this.getFullYear() + 1,0,1); nday = nYear.getDay() - dowOffset; nday = nday >= 0 ? nday : nday + 7; /*if the next year starts before the middle of the week, it is week #1 of that year*/ weeknum = nday < 4 ? 1 : 53; } } else { weeknum = Math.floor((daynum+day-1)/7); } return weeknum; }; var backoffice = false; var siteDiv; function ieHover() { var nav = document.getElementById("nav"); if (nav) { var nodes = nav.getElementsByTagName("li"); for (var i=0; i 0) { backoffice = true; } if(!backoffice){ $('.greenBlock').each(function(){ if($.trim($(this).text()) == 'Momenteel geen berichten.'){ $(this).closest('.contentBlock').remove(); } }); } if(!backoffice && $('body').is('.intra')){ var submenu = $('.submenuBlock'); var ul = submenu .children('.AspNet-TreeView') .children('ul'); ul .children('li') .children('ul') .appendTo(ul.parent()); ul.remove(); submenu .filter(function(){ return $(this).children().length < 1; }).remove(); } $('input').each(function() { $(this).addClass($(this).attr('type')); }); // NewsBlock same size if($('body.startpagina').length){ var newsBlockHeight = 0; $('body.startpagina div.newsBlock').each(function(){ if($(this).height() > newsBlockHeight){ newsBlockHeight = $(this).height(); //console.log($(this).find('h3').text()); } }); $('body.startpagina div.newsBlock').height(newsBlockHeight); //console.log('hoogste = '+newsBlockHeight); }; //Green block if($('div.greenBlock').length){ $('div.greenBlock').parent().css('background-color','#8ec08f'); } if(backoffice && $('div.contentMidden.newsBlock1Nth').length){ $('div.contentMidden.newsBlock1Nth').css('margin-right','16px'); //margin-right: 18px; } siteDiv = $('div#main-container'); repositionContentContainer(); //selectBox //$('body.intra div.sortBlock select').selectbox(); $('body.intra div.statsBlock div.satisfactionStats div.target span').each(function() { var innertext = $(this).text(); value = parseFloat(innertext); if (value >= 0 && value <= 5.5) { $(this).parent().addClass('red'); } if (value > 5.5 && value < 8) { $(this).parent().addClass('orange'); } if (value > 7.9 && value <= 10) { $(this).parent().addClass('green'); } }); $('.newsItemList') .children('div') .addClass('clearfix') .textNodes() .wrap(''); }); if (window.addEventListener) window.addEventListener("load", initPage, false); else if (window.attachEvent) { window.attachEvent("onload", initPage); if (!window.opera) window.attachEvent("onload", ieHover); } /* Flash Fix */ function repositionContentContainer() { // this routine is a complete hack to work around the flash "Allow" button bug if ( siteDiv.length > 0 ) { //Adjust the #content left-margin, since by default it likely isn't an int setLeftMargin(); //If the User resizes the window, adjust the #content left-margin $(window).bind("resize", function() { setLeftMargin(); }); } } function setLeftMargin() { var newWindowWidth = $(window).width(); var mainWellWidth = siteDiv.width(); // create an integer based left_offset number var left_offset = parseInt((newWindowWidth - mainWellWidth)/2.0); if (left_offset < 0) { left_offset = 0; } siteDiv.css("margin-left", left_offset); } $.fn.textNodes = function() { var ret = []; this.contents().each( function() { var fn = arguments.callee; if ( this.nodeType == 3 || $.nodeName(this, "br") ) ret.push( this ); //else $(this).contents().each(fn); }); return $(ret); }