function OpenNewWindow(WindowNaam,Link,Breedte,Hoogte) {
  Xpositie = (screen.width/2)-(Breedte/2);
  Ypositie = (screen.height/2)-(Hoogte/2);
  window.open(Link,WindowNaam,"toolbar=no,location=0,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=0,width="+Breedte+",height="+Hoogte+",top="+Ypositie+",left="+Xpositie);
};	


function getCookieVal (offset) {
  var endstr = document.cookie.indexOf (";", offset);
  if (endstr == -1)
    endstr = document.cookie.length;
  return unescape(document.cookie.substring(offset, endstr));
}

function GetCookie (name) {
  var arg = name + "=";
  var alen = arg.length;
  var clen = document.cookie.length;
  var i = 0;
  while (i < clen) {
    var j = i + alen;
    if (document.cookie.substring(i, j) == arg)
      return getCookieVal (j);
    i = document.cookie.indexOf(" ", i) + 1;
    if (i == 0) break; 
  }
  return null;
}

function SetCookie (name, value) {
//	alert(name + '*' + value);
  var argv = SetCookie.arguments;
  var argc = SetCookie.arguments.length;
  var expires = (argc > 2) ? argv[2] : null;
//	var expires = new Date (); 
//	expires.setTime(expires.getTime() + (365 * 24 * 60 * 60 * 1000)); 
//	var expires = '05 Jan 2005 00:00:00 GMT';
//  var path = (argc > 3) ? argv[3] : null;
  var path = "/";
//  var domain = (argc > 4) ? argv[4] : null;
	var domain = 'ertussenuit.com';	
//  var secure = (argc > 4) ? argv[5] : false;
  document.cookie = name + "=" + escape (value) + ((expires == null) ? "" : ("; expires=" + expires.toGMTString())) + ((path == null) ? "" : ("; path=" + path)) + ((domain == null) ? "" : ("; domain=" + domain));
}

/**function GoToURL(BungalowID,Wat,Ref){
	if (Wat=='B'){window.location.href = 'http://www2.ertussenuit.com/services/brochureaanvragen/default.asp?BungalowID=' + BungalowID + '&ref=' + Ref;};
	if (Wat=='BH'){window.location.href = 'http://www2.ertussenuit.com/services/brochureaanvragen/default.asp?HotelID=' + BungalowID + '&ref=' + Ref;};
	if (Wat=='I'){window.location.href = 'http://www2.ertussenuit.com/services/infoaanvragen/default.asp?BungalowID=' + BungalowID + '&ref=' + Ref;};
	if (Wat=='IH'){window.location.href = 'http://www2.ertussenuit.com/services/infoaanvragen/default.asp?HotelID=' + BungalowID + '&ref=' + Ref;};
	if (Wat=='P'){window.location.href = 'http://www2.ertussenuit.com/parken/prijzen/' + BungalowID + '.htm';};
	if (Wat=='RH'){window.location.href = 'http://www2.ertussenuit.com/services/reshotel/default.asp?HotelID=' + BungalowID ;};	
}
**/


function Klapper(DivID) {
		if (document.all[DivID].style.display=='inline'){document.all[DivID].style.display='none'}else{document.all[DivID].style.display='inline'}
}


function SetStijl(NewStijlID){
	SetCookie('Stijl',NewStijlID)
}




function ApplyStijl(){
//groen
kleurM0 = "000000";
kleurM1 = "55D527";
kleurM2 = "7BC761";
kleurM3 = "F3FDEF";
kleurM4 = "FFFFFF";

Stijl = GetCookie('Stijl');
if (Stijl==null)
{
	Stijl=1; //groen oud
	if (screen.width<=800){Stijl=2}else{Stijl=3};
};  


if (Stijl==1){ //groen
kleurM0 = "000000";
kleurM1 = "55D527";
kleurM2 = "7BC761";
kleurM3 = "F3FDEF";
kleurM4 = "FFFFFF";
};

//blauw 800 / 1024
if ((Stijl==2)||(Stijl==3)) {//blauw
kleurM0 = "000000";
kleurM1 = "90BBE6"; 
kleurM2 = "91BCE7";//90BBE6
kleurM3 = "F1F6FA"; //  "F5F8FD";
kleurM4 = "FFFFFF";
};


//use color from selected template
google_color_bg = kleurM3;
google_color_border = kleurM3; //kleurM2;


if (document.getElementById('us')!=null) //stylesheet ID us bestaat
{
	if (screen.width<=800)
	{	
	document.getElementById('us').href='/800.css'; 
	}
	if (screen.width>1025)
	{	
	document.getElementById('us').href='/1280.css'; 
	}
};

//	if (parent.FramesLoaded==true)	{	document.getElementById('us').href='/4.css'; 	}



document.write('<style ID="etu" type="text/css">');
document.write('.tabelprijzen {	background-color: #' + kleurM3 + ';}');
document.write('.tabelprijzen tbody {	background-color: #' + kleurM3 + ';}');
document.write('.tabelprijzen thead {	background-color: #' + kleurM2 + ';}');
document.write('</style>');

};


ApplyStijl();

var ProvID  = 0;
//var LandID= 0;





//begin iframe code:
//Input the IDs of the IFRAMES you wish to dynamically resize to match its content height:
//Separate each ID with a comma. Examples: ["myframe1", "myframe2"] or ["myframe"] or [] for none:
var iframeids=["frmEV"]

//Should script hide iframe from browsers that don't support this script (non IE5+/NS6+ browsers. Recommended):
var iframehide="yes"

var getFFVersion=navigator.userAgent.substring(navigator.userAgent.indexOf("Firefox")).split("/")[1]
var FFextraHeight=parseFloat(getFFVersion)>=0.1? 16 : 0 //extra height in px to add to iframe in FireFox 1.0+ browsers

function resizeCaller() {
var dyniframe=new Array()
for (i=0; i<iframeids.length; i++){
if (document.getElementById)
resizeIframe(iframeids[i])
//reveal iframe for lower end browsers? (see var above):
if ((document.all || document.getElementById) && iframehide=="no"){
var tempobj=document.all? document.all[iframeids[i]] : document.getElementById(iframeids[i])
tempobj.style.display="block"
}
}
}

function resizeIframe(frameid){
var currentfr=document.getElementById(frameid)
if (currentfr && !window.opera){
currentfr.style.display="block"
if (currentfr.contentDocument && currentfr.contentDocument.body.offsetHeight) //ns6 syntax
currentfr.height = currentfr.contentDocument.body.offsetHeight+FFextraHeight; 
else if (currentfr.Document && currentfr.Document.body.scrollHeight) //ie5+ syntax
currentfr.height = currentfr.Document.body.scrollHeight;
if (currentfr.addEventListener)
currentfr.addEventListener("load", readjustIframe, false)
else if (currentfr.attachEvent){
currentfr.detachEvent("onload", readjustIframe) // Bug fix line
currentfr.attachEvent("onload", readjustIframe)
}
}
}

function readjustIframe(loadevt) {
var crossevt=(window.event)? event : loadevt
var iframeroot=(crossevt.currentTarget)? crossevt.currentTarget : crossevt.srcElement
if (iframeroot)
resizeIframe(iframeroot.id);
}

function loadintoIframe(iframeid, url){
if (document.getElementById)
document.getElementById(iframeid).src=url
}

if (window.addEventListener)
window.addEventListener("load", resizeCaller, false)
else if (window.attachEvent)
window.attachEvent("onload", resizeCaller)
else
window.onload=resizeCaller
//end iframe code


