function winPopup(sURL, sWinName, iWidth, iHeight) {var f="scrollbars=yes,resizable=yes,width=" + iWidth + ",height=" + iHeight + ",top=" + ((screen.height-iHeight)/2) + ",left=" + ((screen.width-iWidth)/2);window.open(sURL,sWinName,f);}

function sendtoafriend(titel,url) {
  var e = document.getElementById('sendtofriend');
  if(e.style.display == 'none') {
    e.style.display = "block";
    e.style.height = getPageSize()[1];
    var f = e.getElementsByTagName("DIV")[0];
    window.onscroll = window.onresize = function() {
      oldheight = 99999;
      e.style.height = getPageSize()[1];
      f.style.top = document.body.scrollTop + (document.body.clientHeight / 2) - 250;
      setTimeout("p()", 0);
    }
    window.onscroll();
  } else {
		e.style.display = "none";
  }
}

var oldheight = 99999;

function p() {
  var e = document.getElementById('sendtofriend');
  var h = getPageSize()[1];
  if (h < oldheight) {
    oldheight = h;
    e.style.height = parseInt(e.style.height)-1;
    setTimeout("p()", 0);
  }
}

String.prototype.endsWith = function(str) {
  return (this.match(str+"$")==str)
}

function checkForm(node) {
  if (!node.Accoord.checked) { alert('Geef a.u.b. aan of u accoord gaat met de Algemene Voorwaarden.'); return false; } else { return true; }
}

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;
}

function getCookie( name ) {
	var start = document.cookie.indexOf( name + "=" );
	var len = start + name.length + 1;
	if ( ( !start ) && ( name != document.cookie.substring( 0, name.length ) ) ) {
		return null;
	}
	if ( start == -1 ) return null;
	var end = document.cookie.indexOf( ';', len );
	if ( end == -1 ) end = document.cookie.length;
	return unescape( document.cookie.substring( len, end ) );
}
