//====================== Browser checks var Opera = window.opera ? true : false; var IE = (document.all && document.getElementById && !Opera) ? true:false; //====================== //====================== Initialiseer de volgende functies function init(){ //voegt mouseover/mouseouts fases en css voor wetkalender toe //zonder js zijn alle fases gewoon onder elkaar te zien var head = document.getElementsByTagName("head")[0]; var stylesheet = document.createElement("link"); stylesheet.setAttribute("type","text/css"); stylesheet.setAttribute("rel","stylesheet"); stylesheet.setAttribute("media","all"); stylesheet.setAttribute("href","/css/wetkalender.css"); head.appendChild(stylesheet); //alleen uitvoeren op foto-module pagina if(document.getElementById("foto-module")) { startFotoModule(); //toon bladeren functie toonBladeren(); } tekstGrootte(); printKnop(); wetkalender(); initAankeilers(); externalLinks(); initBrongegevens(); codeExamples(); if (document.getElementById("organogram")) { initOrganogram(); } if (document.getElementById("nieuwsbrieven")) { initNieuwsbrieven(); } } //onderaan js file: //====================== selecteer inhoud van tekstbox bij focus/click function codeExamples() { var codeAreas = $$('.code'); if (codeAreas.length > 0) { codeAreas[0].onfocus = codeAreas[0].onclick = function() { this.focus(); this.select(); } } } //====================== tabel met brongegevens laden bij grafiek function initBrongegevens() { var bronLinks = $$('.brongegevens'); var addClicks = function(self) { //var self = this; self.blur(); self.onclick = function() { return false; } var xmlCall = new Ajax(self.href, { method : 'get', onComplete : function(dataTXT) { var t1 = dataTXT.indexOf(""); var t2 = dataTXT.indexOf(""); var theTable = dataTXT.substring(t1+6,t2); var objTable = document.createElement("div"); objTable.className = "brontabel"; objTable.innerHTML = theTable; self.parentNode.parentNode.insertBefore(objTable,self.parentNode); // slide effect if (objTable.scrollHeight) { $(objTable).setStyle('overflow','hidden'); $(objTable).setStyle('height','1px'); var fx = $(objTable).effects({ duration: 500, transition: Fx.Transitions.sineInOut }); fx.custom({ 'height': [0, objTable.scrollHeight] }); } self.innerHTML = "Sluit tabel en definities"; // sluiten self.onclick = function() { this.blur(); // slide effect if (objTable.scrollHeight) { var fx = $(objTable).effects({ duration: 500, transition: Fx.Transitions.sineInOut, onComplete: function() { self.parentNode.parentNode.removeChild(objTable); } }); fx.custom({ 'height': [objTable.scrollHeight, 0] }); } else { this.parentNode.parentNode.removeChild(objTable); } this.innerHTML = "Toon tabel en definities"; this.onclick = function() { addClicks(this); return false; } return false; } } }).request(); return false; } for (var i=0; i 0) { spans[0].onclick = function() { if (this.parentNode.className.indexOf("open") > -1) { removeClass(this.parentNode,"open"); } else { addClass(this.parentNode,"open"); } } } } } } //====================== //====================== voegt rollover en click functie toe aan class="aankeiler" function externalLinks() { var extLinks = getElementsByClassName("extern"); for (var i=0; i 0) { var anchor = anchors[anchors.length-1]; if (anchor.parentNode.tagName.toLowerCase() != "li") { if (document.implementation) { // not IE5 aankeilers[i].style.cursor = 'pointer'; } else { aankeilers[i].style.cursor = 'hand'; } aankeilers[i].ref = anchor.getAttribute("href"); aankeilers[i].onclick = function() { document.location.href = this.ref; } aankeilers[i].onmouseover = function() { window.status = this.ref; addClass(this,"over"); } aankeilers[i].onmouseout = function() { window.status = ""; removeClass(this,"over"); } } else { aankeilers[i].style.backgroundImage = "none"; } } else { aankeilers[i].style.backgroundImage = "none"; } } } //====================== //====================== voegt rollover functie toe aan span class="fase" function wetkalender() { var huidigeToelichtingen = $$('.fase-nummers li.huidige .toelichting'); for (var i=huidigeToelichtingen.length-1; i>-1; i--) { var actieveToelichting = new Element('p', { 'class': 'actieve-toelichting' }); actieveToelichting.innerHTML = huidigeToelichtingen[i].innerHTML; var fasen = huidigeToelichtingen[i].parentNode.parentNode.parentNode.parentNode; fasen.parentNode.insertBefore(actieveToelichting, fasen.nextSibling); huidigeToelichtingen[i].parentNode.removeChild(huidigeToelichtingen[i]); } var fasenummers = $$('.fase-nummers li'); for (var i=0; iPrint function printKnop() { if (document.getElementsByTagName && window.print && document.getElementById("voet-zone") && document.getElementById("naarboven-knop")) { var pk = document.createElement("li"); pk.setAttribute("id","print-knop"); var pk_a = document.createElement("a"); pk_a.setAttribute("href","#"); pk_a.onclick = function () { window.print(); return false; } var pk_text = document.createTextNode("Print"); pk_a.appendChild(pk_text); pk.appendChild(pk_a); var vz_menu = document.getElementById("voet-zone").getElementsByTagName("ul")[0]; var naar_boven = document.getElementById("naarboven-knop"); vz_menu.insertBefore(pk,naar_boven); } } //====================== Zet mouseover/mouseout functionaliteit op knoppen (buttons) function knopMuisOver() { var alleInputTags=document.getElementsByTagName('input'); for(var i=0;i