// JavaScript Document function onLoad(){} // google maps can overwrite this function function addBookmark(title,url) { if (window.sidebar) { window.sidebar.addPanel(title, url,""); } else if( document.all ) { window.external.AddFavorite( url, title); } else if( window.opera && window.print ) { return true; } } function tellAfriend() { var url = document.location.href.split('/'); var id = url[url.length-2]; if( !isNaN(id) ) show_overlay('tellafriend.html?id='+id, 370, 400); else show_overlay('tellafriend.html', 370, 400); } function addKantoor() { show_overlay('nieuwkantoor.html', 370, 430); } if (!window.XMLHttpRequest) { window.XMLHttpRequest = function() { var types = ['MSXML2.XMLHTTP.6.0', 'MSXML2.XMLHTTP.3.0']; for (var i = 0; i < types.length; i++) { try { return new ActiveXObject(types[i]); } catch(e) {} } return undefined; } } function showBlok(key) { // we gaan uit van de status van intro! if(document.getElementById('intro'+key)) { var _key=0; var _tmp = document.getElementById('intro'+key).style.display; while(document.getElementById('intro'+_key)) { document.getElementById('intro'+_key).style.display = 'block'; document.getElementById('subBLok'+_key).style.display = 'none'; document.getElementById('img'+_key).src = 'http://hypotheek.adviseursvergelijk.nl/img/switch_down.gif'; _key++; } // nu unhiden we onze if(_tmp == 'block') { document.getElementById('intro'+key).style.display = 'none'; document.getElementById('subBLok'+key).style.display = 'block'; document.getElementById('img'+key).src = 'http://hypotheek.adviseursvergelijk.nl/img/switch_up.gif'; } else { document.getElementById('intro'+key).style.display = 'block'; document.getElementById('subBLok'+key).style.display = 'none'; document.getElementById('img'+key).src = 'http://hypotheek.adviseursvergelijk.nl/img/switch_down.gif'; } } } function show_overlay(location, width, height) { var arrayPageSize = getPageSize(); // overlay var objOverlay = document.getElementById("overlay"); var objContent= document.getElementById("overlayContent"); // create Iframe var iframe = document.createElement('iframe'); iframe.frameBorder = 0; iframe.scrolling = "no"; objContent.appendChild(iframe); iframe.src = location; // set height of Overlay to take up whole page and show objOverlay.style.height = (arrayPageSize[1] + 'px'); objOverlay.style.display = 'block'; objContent.style.display = 'block'; if(width) { objContent.style.width = width+'px'; objContent.style.marginLeft = '-'+Math.ceil(width/2)+'px'; } if(height) { objContent.style.height = (height+20)+'px'; } // Hide select boxes as they will 'peek' through the image in IE selects = document.getElementsByTagName("select"); for (i = 0; i != selects.length; i++) { selects[i].style.visibility = "hidden"; } // scroll to top! scroll(0,0); } function hide_overlay() { objOverlay = document.getElementById("overlay"); objContent= document.getElementById("overlayContent"); // hide lightbox and overlay objOverlay.style.display = 'none'; objContent.style.display = 'none'; objContent.innerHTML = ''; // make select boxes visible selects = document.getElementsByTagName("select"); for (i = 0; i != selects.length; i++) { selects[i].style.visibility = "visible"; } } // // getPageSize() // Returns array with page width, height and window width, height // Core code from - quirksmode.org // Edit for Firefox by pHaez // function getPageSize(){ var xScroll, yScroll; if (window.innerHeight && window.scrollMaxY) { xScroll = document.body.scrollWidth; yScroll = window.innerHeight + window.scrollMaxY; } else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac xScroll = document.body.scrollWidth; yScroll = document.body.scrollHeight; } else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari xScroll = document.body.offsetWidth; yScroll = document.body.offsetHeight; } var windowWidth, windowHeight; if (self.innerHeight) { // all except Explorer windowWidth = self.innerWidth; windowHeight = self.innerHeight; } else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode windowWidth = document.documentElement.clientWidth; windowHeight = document.documentElement.clientHeight; } else if (document.body) { // other Explorers windowWidth = document.body.clientWidth; windowHeight = document.body.clientHeight; } // for small pages with total height less then height of the viewport if(yScroll < windowHeight){ pageHeight = windowHeight; } else { pageHeight = yScroll; } // for small pages with total width less then width of the viewport if(xScroll < windowWidth){ pageWidth = windowWidth; } else { pageWidth = xScroll; } arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight) return arrayPageSize; } /* Cookie! */ function createCookie(name,value,days) { if (days) { var date = new Date(); date.setTime(date.getTime()+(days*24*60*60*1000)); var expires = "; expires="+date.toGMTString(); } else var expires = ""; document.cookie = name+"="+value+expires+"; path=/"; } function readCookie(name) { var nameEQ = name + "="; var ca = document.cookie.split(';'); for(var i=0;i < ca.length;i++) { var c = ca[i]; while (c.charAt(0)==' ') c = c.substring(1,c.length); if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length); } return null; } function eraseCookie(name) { createCookie(name,"",-1); }