// *********************************************************************************************
// System functions
// *********************************************************************************************
function lib_bwcheck() {
	this.ver=navigator.appVersion;
	this.agent=navigator.userAgent;
	this.dom=document.getElementById?1:0;
	this.opera5=this.agent.indexOf("Opera 5")>-1;
	this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom && !this.opera5)?1:0; 
	this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom && !this.opera5)?1:0;
	this.ie4=(document.all && !this.dom && !this.opera5)?1:0;
	this.ie=this.ie4||this.ie5||this.ie6;
	this.mac=this.agent.indexOf("Mac")>-1;
	this.ns6=(this.dom && parseInt(this.ver) >= 5) ?1:0; 
	this.ns4=(document.layers && !this.dom)?1:0;
	this.bw= (this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns6 || this.opera5);
	return this;
}
var bw=new lib_bwcheck();

function IsLowResolution() {
	if (self.screen) {
		return (screen.height <= 600);
	} else { 
		return true;
	}
}
// *********************************************************************************************
// Graphic functions
// *********************************************************************************************

function ShowLoad() {
	//document.write("Laden route...");
	//alert("Route laden...");
	
	// pre-set to the current time and date
	var expdate = new Date ();
	// add one year to it
	expdate.setTime(expdate.getTime() + 1000 * 60 * 60 * 24 * 365);
	// 365 days/year * 24 hours/day * 60 minutes/hour * 60 seconds/minute * 1000 milliseconds/second
	// = howevermany milliseconds/year. So this adds one year, it'll expire in one year.
	street=document.route.street.value;
	city=document.route.city.value;
	start=document.route.start.value;
	if (street) {
		SetCookie("street",street,expdate);
	}
	if (city) {
		SetCookie("city",city,expdate);
	}
	if (start) {
		SetCookie("start",start,expdate);
	}
}

function ShowRoute(id,xCoord,yCoord,country){
	street=GetCookie("street");
	city=GetCookie("city");
	start=GetCookie("start");
	
	text='<input name="x" type="hidden" value="'+xCoord+'">';
	text=text+'<input name="y" type="hidden" value="'+yCoord+'">';
	text=text+'<input name="stop" type="hidden" value="'+country+'">';
	text=text+'Straat: <input name="street" type="text" size="20"><br>';
	text=text+'Plaats: <input name="city" type="text" size="20"><br>';

	var arrCountry = ['NL,Nederland','B,Belgie'];
	text=text+'<select name="start">';
	
	for(i=0;i<=arrCountry.length-1;i++) {
		tmpCountry = arrCountry[i].split(",");
		if(start==tmpCountry[0]) {
			text=text+'<option value="'+tmpCountry[0]+'" selected>'+tmpCountry[1]+'</option>';
		}
		else {
			text=text+'<option value="'+tmpCountry[0]+'">'+tmpCountry[1]+'</option>';
		}
	}
	text=text+'</select><br>';

	text=text+'<a href="#" onClick="ShowLoad(); submit();" target="_self">Plan route</a></form>';

	if (document.getElementById){
		x = document.getElementById(id);
		x.innerHTML = text;
	} else if (document.all) {
		x = document.all[id];
		x.innerHTML = text;
	} else if (document.layers) {
		x = document.layers[id];
		text2 = '<p>' + text + '</p>';
		x.document.open();
		x.document.write(text2);
		x.document.close();
	}

	if (street) {
		document.route.street.value=street;
	}
	if (city) {
		document.route.city.value=city;
	}
}

function Replace(entry,out,add) {
	temp = "" + entry; // temporary holder
	while (temp.indexOf(out)>-1) {
		pos= temp.indexOf(out);
		temp = "" + (temp.substring(0, pos) + add + 
		temp.substring((pos + out.length), temp.length));
	}
	return temp;
}

function changestyle(identifier,classnaam) {
	document.getElementById(identifier).className=classnaam;
}

function stylesheet(partner) {
	var season = '';
	if (partner.indexOf("sessionid") != -1) {
		partner = '';
	}
	if (partner != '') {
		season = partner;
	} else {
		var now = new Date();
		var month = now.getMonth() + 1;
		var date = now.getDate();
		var year = now.getYear();
		var season;
		if (month > 1 && month <= 3) season = "winter";
		if (month == 3 && date > 19) season = "lente";
		if (month > 3 && month <= 6) season = "lente";
		if (month == 6 && date > 20) season = "zomer";
		if (month > 6 && month <= 9) season = "zomer";
		if (month == 9 && date > 21) season = "herfst";
		if (month > 9 && month <= 12) season = "herfst";
		if (month == 12 && date > 20) season = "winter";
		if (year < 2000) year = year + 1900;
		if (season == "Winter") year = year - 1;
		season = "zomer";
		document.write('<link rel="stylesheet" type="text/css" href="../css/default.css">');
	}
	document.write('<link rel="stylesheet" type="text/css" href="../css/'+season+'.css">');
}

function ShowPhoto(endImage,photo) {
	if(bw.ie6) {
		document[photo].filters(0).Apply();
		document[photo].src = endImage;
	    document[photo].filters(0).Play();
	} else {
		document[photo].src = endImage;
	}
}

function showSlide(slidePosition) {

	if(bw.ie6) {
		if(slidePosition <= 100) {
			slidePosition = slidePosition + 5;
			window.parent.innerFrame.rows = "" + slidePosition + ",*";
			setTimeout('showSlide('+slidePosition+')', 1);
		} else {
			document.updown.title = "Maak het scherm groter";			
			ShowPhoto("../image/frame_up.gif","updown");
		}
	} else {
		window.parent.innerFrame.rows = "105,*";
		document.updown.title = "Maak het scherm groter";			
		ShowPhoto("../image/frame_up.gif","updown");
	}
}

function hideSlide(slidePosition) {
	if(bw.ie6) {
		if(slidePosition > -100) {
			slidePosition = slidePosition - 5;
			window.parent.innerFrame.rows = "" + slidePosition + ",*";
			setTimeout('hideSlide('+slidePosition+')', 1);
		} else {
			document.updown.title = "Maak het scherm kleiner";
			ShowPhoto("../image/frame_down.gif","updown");
		}
	} else {
		window.parent.innerFrame.rows = "0,*";
		document.updown.title = "Maak het scherm kleiner";
		ShowPhoto("../image/frame_down.gif","updown");
	}
}

function toggleframe(value) {
	if(value) {
		bln=false;
		showSlide(0);
	}else{
		bln=true;
		hideSlide(100);
	}
}
// *********************************************************************************************
// Control functions
// *********************************************************************************************
function CheckDataGuide(){
   lcNietOk ="";
   with (document.frmAanvraag){ 
      if (!chkZomer2004.checked)			{lcNietOk = ((lcNietOk=="") ? "" : lcNietOk+", ") + "brochure"}
      //if (!chkZomer2003.checked && !chkZomer2004.checked)   {lcNietOk = ((lcNietOk=="") ? "" : lcNietOk+", ") + "brochure"}
      // zoek de waarde van de radiobutton
			ischecked = -1;
			for	(var i = 0; i < Titel.length; i++) { 
				if (Titel[i].checked) { 
					ischecked = i
				}
			}
			if (ischecked == -1)						{lcNietOk = ((lcNietOk=="") ? "" : lcNietOk+", ") + "aanhef"}	
      if (Voorletters.value.length<1)	{lcNietOk = ((lcNietOk=="") ? "" : lcNietOk+", ") + "voorletter(s)"}
      if (Naam.value.length<2)				{lcNietOk = ((lcNietOk=="") ? "" : lcNietOk+", ") + "achternaam"}
      if (Postcode.value.length<4)		{lcNietOk = ((lcNietOk=="") ? "" : lcNietOk+", ") + "postcode"}
      if (Huisnummer.value.length<1)	{lcNietOk = ((lcNietOk=="") ? "" : lcNietOk+", ") + "huisnummer"}
      if (Adres.value.length<2)				{lcNietOk = ((lcNietOk=="") ? "" : lcNietOk+", ") + "straat"}
      if (Plaats.value.length<2)			{lcNietOk = ((lcNietOk=="") ? "" : lcNietOk+", ") + "plaats"}
      if (Email.value.length<4)				{lcNietOk = ((lcNietOk=="") ? "" : lcNietOk+", ") + "email adres"}
			if (cBron.value.length<2)				{lcNietOk = ((lcNietOk=="") ? "" : lcNietOk+", ") + "hoe u deze site gevonden heeft"}
      if (lcNietOk=="")								{submit()} else {alert("De volgende gegevens moeten nog ingevoerd worden: "+lcNietOk);}
   }
}

function CheckDataReservation() {
  	lcNietOk ="";
   	with (document.frmAanvraag){ 
      	ischecked = -1;
				for	(var i = 0; i < Titel.length; i++) { 
					if (Titel[i].checked) { 
						ischecked = i
					}
				}
				if (ischecked == -1)								{lcNietOk = ((lcNietOk=="") ? "" : lcNietOk+", ") + "aanhef"}	
      	if (Voorletters.value.length<1)			{lcNietOk = ((lcNietOk=="") ? "" : lcNietOk+", ") + "voorletter(s)"}
      	if (Naam.value.length<2)						{lcNietOk = ((lcNietOk=="") ? "" : lcNietOk+", ") + "achternaam"}
      	if (Postcode.value.length<4)				{lcNietOk = ((lcNietOk=="") ? "" : lcNietOk+", ") + "postcode"}
				if (Huisnummer.value.length<1)			{lcNietOk = ((lcNietOk=="") ? "" : lcNietOk+", ") + "huisnummer"}
      	if (Adres.value.length<2)						{lcNietOk = ((lcNietOk=="") ? "" : lcNietOk+", ") + "straat"}
     		if (Plaats.value.length<2)					{lcNietOk = ((lcNietOk=="") ? "" : lcNietOk+", ") + "plaats"}
     		if (GebDatum.value.length<5)				{lcNietOk = ((lcNietOk=="") ? "" : lcNietOk+", ") + "geboortedatum"}
     		if (Email.value.length<4)						{lcNietOk = ((lcNietOk=="") ? "" : lcNietOk+", ") + "email adres"}
      	if (Telo.value.length<7)						{lcNietOk = ((lcNietOk=="") ? "" : lcNietOk+", ") + "telefoonnummer"}
      	if (PersonenV.value<1)							{lcNietOk = ((lcNietOk=="") ? "" : lcNietOk+", ") + "aantal personen"}
       	if (cBron.value.length<2)						{lcNietOk = ((lcNietOk=="") ? "" : lcNietOk+", ") + "hoe u deze site gevonden heeft"}
      	if (!chkGeneralConditions.checked)	{lcNietOk = ((lcNietOk=="") ? "" : lcNietOk+", ") + "de reserveringsvoorwaarden lezen"}
				if (lcNietOk=="")										{submit()} else {alert("De volgende gegevens moeten nog ingevoerd worden: "+lcNietOk);}
   	}
}

function CheckReisKort() {
	lcNietOk ="";
	with (document.reisv) { 
		if (achternaam.value.length<2)	{lcNietOk = ((lcNietOk=="") ? "" : lcNietOk+", ") + "achternaam"}
		if (voorletters.value.length<1)	{lcNietOk = ((lcNietOk=="") ? "" : lcNietOk+", ") + "voorletters"}
		if (postcode.value.length<4)		{lcNietOk = ((lcNietOk=="") ? "" : lcNietOk+", ") + "postcode"}
		if (woonplaats.value.length<2)	{lcNietOk = ((lcNietOk=="") ? "" : lcNietOk+", ") + "woonplaats"}
		if (volwassenen.value.length<1)	{lcNietOk = ((lcNietOk=="") ? "" : lcNietOk+", ") + "aantal volwassenen"}
		if (kinderen.value.length<1)		{lcNietOk = ((lcNietOk=="") ? "" : lcNietOk+", ") + "aantal kinderen"}
		if (teloverdag.value.length<2)	{lcNietOk = ((lcNietOk=="") ? "" : lcNietOk+", ") + "telefoon overdag"}
		// zoek de waarde van de radiobutton
		ischecked = -1
		for	(var i = 0; i < document.reisv.dekking.length; i++) { 
			if (document.reisv.dekking[i].checked) { 
				ischecked = i
			}
		}
		if (ischecked == -1)						{lcNietOk = ((lcNietOk=="") ? "" : lcNietOk+", ") + "gewenste dekking"}		
		if (ingangsdatum.value.length<2){lcNietOk = ((lcNietOk=="") ? "" : lcNietOk+", ") + "ingangsdatum"}
		if (einddatum.value.length<2)		{lcNietOk = ((lcNietOk=="") ? "" : lcNietOk+", ") + "einddatum"}
		if (vervoer.checked) {
			if (bouwjaar.value.length<2)	{lcNietOk = ((lcNietOk=="") ? "" : lcNietOk+", ") + "bouwjaar"}
			if (kenteken.value.length<2)	{lcNietOk = ((lcNietOk=="") ? "" : lcNietOk+", ") + "kenteken"}
		}
		/*
		if (anwb.checked) {
			if (lidnr.value.length<2)			{lcNietOk = ((lcNietOk=="") ? "" : lcNietOk+", ") + "ANWB lidnummer"}
		}
		*/
		if (lcNietOk=="") {
			submit()
		} else {
			alert("De volgende gegevens moeten nog ingevoerd worden: "+lcNietOk);
		}
	}
}

function CheckReisLang() {
	lcNietOk ="";
	with (document.reisv) { 
		if (achternaam.value.length<2)		{lcNietOk = ((lcNietOk=="") ? "" : lcNietOk+", ") + "achternaam"}
		if (voorletters.value.length<1)		{lcNietOk = ((lcNietOk=="") ? "" : lcNietOk+", ") + "voorletters"}
		if (postcode.value.length<4)			{lcNietOk = ((lcNietOk=="") ? "" : lcNietOk+", ") + "postcode"}
		if (woonplaats.value.length<2)		{lcNietOk = ((lcNietOk=="") ? "" : lcNietOk+", ") + "woonplaats"}
		if (teloverdag.value.length<2)		{lcNietOk = ((lcNietOk=="") ? "" : lcNietOk+", ") + "telefoon overdag"}
		if (geboortedatum.value.length<2)	{lcNietOk = ((lcNietOk=="") ? "" : lcNietOk+", ") + "geboortedatum"}
		// zoek de waarde van de radiobutton
		ischecked = -1
		for	(var i = 0; i < document.reisv.dekking.length; i++) { 
			if (document.reisv.dekking[i].checked) { 
				ischecked = i
			}
		}
		if (ischecked == -1)							{lcNietOk = ((lcNietOk=="") ? "" : lcNietOk+", ") + "gewenste dekking"}
		// zoek de waarde van de radiobutton
		ischecked = -1
		for	(var i = 0; i < document.reisv.medische.length; i++) { 
			if (document.reisv.medische[i].checked) { 
				ischecked = i
			}
		}
		if (ischecked == -1)							{lcNietOk = ((lcNietOk=="") ? "" : lcNietOk+", ") + "medische kosten"}
		if (bagageverzekering.checked) {
			// zoek de waarde van de radiobutton
			ischecked = -1
			for	(var i = 0; i < document.reisv.risico.length; i++) { 
				if (document.reisv.risico[i].checked) { 
					ischecked = i
				}
			}
			if (ischecked == -1)						{lcNietOk = ((lcNietOk=="") ? "" : lcNietOk+", ") + "bagageverzekering"}
		}
		if (vervoer.checked) {
			if (bouwjaar.value.length<2)		{lcNietOk = ((lcNietOk=="") ? "" : lcNietOk+", ") + "bouwjaar"}
			if (kenteken.value.length<2)		{lcNietOk = ((lcNietOk=="") ? "" : lcNietOk+", ") + "kenteken"}
		}	
		if (ingangsdatum.value.length<2)	{lcNietOk = ((lcNietOk=="") ? "" : lcNietOk+", ") + "ingangsdatum"}	
		// zoek de waarde van de radiobutton
		ischecked = -1
		for	(var i = 0; i < document.reisv.ziekenfonds.length; i++) { 
			if (document.reisv.ziekenfonds[i].checked) { 
				ischecked = i
			}
		}
		if (ischecked == -1)							{lcNietOk = ((lcNietOk=="") ? "" : lcNietOk+", ") + "ziekenfonds- of ziektekostenverzekering"}
		// zoek de waarde van de radiobutton
		ischecked = -1
		for	(var i = 0; i < document.reisv.gevaarverhogend.length; i++) { 
			if (document.reisv.gevaarverhogend[i].checked) { 
				ischecked = i
			}
		}
		if (ischecked == -1)							{lcNietOk = ((lcNietOk=="") ? "" : lcNietOk+", ") + "gevaarverhogende omstandigheden"}
		if (lcNietOk=="") {
			submit()
		} else {
			alert("De volgende gegevens moeten nog ingevoerd worden: "+lcNietOk);
		}
	}
}
  
function f(postcode,huisnr,valueto) {
	var pc = document.getElementById(postcode).value;
	var hn = document.getElementById(huisnr).value;
	var x = pc.indexOf(" ");
	if(x != -1){pc=pc.substring(0,x)+pc.substring(x+1,pc.length);}
	document.getElementById(postcode).value=pc.toUpperCase();
	if((pc!="")&&(hn!="")&&(pc.length==6)) {
		  f_createIFRAME("../bin/get.dll?HappyHomeProcess~GetStreetAndTown~"+pc+"~"+hn+'~'+valueto)
	}
}

function f_createIFRAME (URL) {
	this.frameName = 'FileLoader' + this.id;
	if (document.all) {
		var html = '';
		html += '<IFRAME ID="' + this.frameName + '"';
		html += ' NAME="' + this.frameName + '"';
		html += ' STYLE="display: none;"';
		html += ' SRC="'+URL+'">';
		html += '<\/IFRAME>';
		document.body.insertAdjacentHTML('beforeEnd', html);
	} else if (document.getElementById) {
		var ifr = document.createElement('IFRAME');
		ifr.id = ifr.name = this.frameName;
		ifr.style.visibility = 'visible';
		ifr.src = URL;
		document.body.appendChild(ifr);
	}
}

function checkpostcode(pcode) {
	var pclen=pcode.value.length,result=false;
	if(pclen==4){
		return true;
	} else {
		if(pclen<=7) {
			var pcnum=pcode.value.substr(0,3);
			var pcanum=pcode.value.substr(4,pclen);
			if(!isNaN(pcnum)&&isNaN(pcanum)) result=true;
		}
		if(!result) {alert("Voer juiste postcode in");pcode.focus();}
		return result;
	}
}

// *********************************************************************************************
// Normal functions
// *********************************************************************************************

function RefreshTabel(){
   document.frmWeken.submit();
}

function SubmitIt(){
   	document.frmCriteria.submit();
}

function SubmitCode(){
	document.frmCode.submit();
}

function GebiedToevoegen(tiValue,tcGebied){
   	document.frmCriteria.cGebied.length=document.frmCriteria.cGebied.length+1;
  	document.frmCriteria.cGebied.options[document.frmCriteria.cGebied.length-1].value=tiValue;
   	document.frmCriteria.cGebied.options[document.frmCriteria.cGebied.length-1].text=replaceCharacters(tcGebied);
}

function replaceCharacters(html) {
	// Special characters and their HTML equivelent
	var set = [["&euro;","&lsquo;","&rsquo;","&rsquo;","&ldquo;","&rdquo;","&ndash;","&mdash;","&iexcl;","&cent;","&pound;","&pound;","&curren;","&yen;","&brvbar;","&sect;","&uml;","&copy;","&ordf;","&laquo;","&not;","­","&reg;","&macr;","&deg;","&plusmn;","&sup2;","&sup3;","&acute;","&micro;","&para;","&middot;","&cedil;","&sup1;","&ordm;","&raquo;","&frac14;","&frac12;","&frac34;","&iquest;","&Agrave;","&Aacute;","&Acirc;","&Atilde;","&Auml;","&Aring;","&AElig;","&Ccedil;","&Egrave;","&Eacute;","&Ecirc;","&Euml;","&Igrave;","&Iacute;","&Icirc;","&Iuml;","&ETH;","&Ntilde;","&Ograve;","&Oacute;","&Ocirc;","&Otilde;","&Ouml;","&times;","&Oslash;","&Ugrave;","&Uacute;","&Ucirc;","&Uuml;","&Yacute;","&THORN;","&szlig;","&agrave;","&aacute;","&acirc;","&atilde;","&auml;","&aring;","&aelig;","&ccedil;","&egrave;","&eacute;","&ecirc;","&euml;","&igrave;","&iacute;","&icirc;","&iuml;","&eth;","&ntilde;","&ograve;","&oacute;","&ocirc;","&otilde;","&ouml;","&divide;","&oslash;","&ugrave;","&uacute;","&ucirc;","&uuml;","&uuml;","&yacute;","&thorn;","&yuml;"],
		["€","‘","’","’","“","”","–","—","¡","¢","£","£","¤","¥","¦","§","¨","©","ª","«","¬","­","®","¯","°","±","²","³","´","µ","¶","·","¸","¹","º","»","¼","½","¾","¿","À","Á","Â","Ã","Ä","Å","Æ","Ç","È","É","Ê","Ë","Ì","Í","Î","Ï","Ð","Ñ","Ò","Ó","Ô","Õ","Ö","×","Ø","Ù","Ú","Û","Ü","Ý","Þ","ß","à","á","â","ã","ä","å","æ","ç","è","é","ê","ë","ì","í","î","ï","ð","ñ","ò","ó","ô","õ","ö","÷","ø","ù","ú","û","ü","ü","ý","þ","ÿ"]];

	// Replace each instance of one of the above special characters with it's HTML equivelent
	if (html) {
		for(var j=0; j<set[0].length; j++){
			html = html.replace(eval("/"+set[0][j]+"/g"),set[1][j]);
		}
	}

	// Return the HTML or an empty string if no HTML was supplied
	return html || "";
}

function RefreshPrijsWindow() {
   	/*
	var lcTitle
   	with (parent.main) {
      	lcTitle=document.title;
//      	if(lcTitle.indexOf('ProductFree')==-1)  {location.reload()};
		var url=location.href;
		test = url.split("~")
		alert(test(0));
      	if(lcTitle.indexOf('ProductPrice')==0)  {location.href=""};
   	}
   	return true;
	*/
}
/*
function GetCookie(Name){
   	var search = Name + "=";
   	if (document.cookie.length > 0){
	  	offset = document.cookie.indexOf(search) ;
     	if (offset != -1){
         	offset += search.length;
         	end = document.cookie.indexOf(";", offset);
         	if (end == -1){
            	end = document.cookie.length;
         		return unescape(document.cookie.substring(offset, end));
			}
      	} 
   	}
}

function SetCookie(name, value, expire){
	document.cookie = name + "=" + escape(value) + ((expire == null) ? "" : ("; expires=" + expire.toGMTString()));
}
*/

function SetCookie(name, value, expires) {
	// no expiration date specified? use this date and it will just be deleted soon.
	if (!expires) expires = new Date();
	document.cookie = name + "=" + escape(value) + "; expires=" + expires.toGMTString() + "; path=/";
}

function GetCookie(name) {
	var cookies = document.cookie;
	if (cookies.indexOf(name) != -1){
		var startpos = cookies.indexOf(name)+name.length+1;
		var endpos = cookies.indexOf(";",startpos)-1;
		if (endpos == -2) {
			endpos = cookies.length;
		} else {
			endpos = endpos+1;
		}
		return unescape(cookies.substring(startpos,endpos));
	} else {
		// the cookie couldn't be found! it was never set before, or it expired.
		return false;
	}
}

function SaveCriteria() {
   	var today = new Date()
   	var expires = new Date()
   	expires.setTime(today.getTime() + 1000*60*60*24*365)
   	with (document.frmCriteria){
      	SetCookie("ZoekLand",					cLand.options[cLand.selectedIndex].value, expires)
      	SetCookie("ZoekGebied",				cGebied.options[cGebied.selectedIndex].value, expires)
      	SetCookie("ZoekPersonen",			cPersonen.options[cPersonen.selectedIndex].value, expires)
      	SetCookie("ZoekKamers",				cKamers.options[cKamers.selectedIndex].value, expires)
      	SetCookie("ZoekDatum",				cDatum.options[cDatum.selectedIndex].value, expires)
      	SetCookie("ZoekDagen",				cDagen.options[cDagen.selectedIndex].value, expires)
				SetCookie("ZoekBungalowpark",	SymboolBungalowpark.value, expires)
      	SetCookie("ZoekWasmachine",		SymboolWasmachine.value, expires)
      	SetCookie("ZoekHuisdier",			chkHuisdier.value, expires)
   	}
   	return true;
}

function LoadCriteria(){
		SetCriteria('ZoekLand',					'document.frmCriteria.cLand');
   	VulGebiedPopup();
   	SetCriteria('ZoekGebied',				'document.frmCriteria.cGebied');
   	SetCriteria('ZoekPersonen',			'document.frmCriteria.cPersonen');
   	SetCriteria('ZoekKamers',				'document.frmCriteria.cKamers');
   	SetCriteria('ZoekDatum',				'document.frmCriteria.cDatum');
   	SetCriteria('ZoekDagen',				'document.frmCriteria.cDagen');
   	SetChkValue('ZoekBungalowpark',	'document.frmCriteria.SymboolBungalowpark');
   	SetChkValue('ZoekWasmachine',		'document.frmCriteria.SymboolWasmachine');
   	SetChkValue('ZoekHuisdier',			'document.frmCriteria.chkHuisdier');
}

function SetCriteria(tcCookie,tcName){
   	var lcValue=GetCookie(tcCookie) ;
   	if (lcValue != null){
   		for (var i=0; i < eval(tcName+'.length'); i++){
       		if (eval(tcName+'.options[i].text==lcValue') || eval(tcName+'.options[i].value==lcValue')){
          		eval(tcName+'.selectedIndex=i');
       		}
   		}   
   	}
}

function SetChkValue(tcCookie,tcName){
   	var lcValue=GetCookie(tcCookie) ;
   	if (lcValue != null) { (eval(tcName+'.value==lcValue'))}
}

function GoEV(){
	if (confirm("Are you sure you want to block this accommodation?")) {
		document.frmDays.submit();
	}
}

function OpenWindow(lcUrl){
	consoleRef = window.open(lcUrl,"w","fullscreen=no,width=500,height=420");
}

function OpenWindowUnload(lcUrl){
	if (GetCookie("popup")==""){
		consoleRef = window.open(lcUrl,"w","fullscreen=no,width=500,height=420");
	}
}

function PageQuery(q) {
	if(q.length > 1) this.q = q.substring(1, q.length);
	else this.q = null;
	this.keyValuePairs = new Array();
	if(q) {
		for(var i=0; i < this.q.split("&").length; i++) {
			this.keyValuePairs[i] = this.q.split("&")[i];
		}
	}
	this.getKeyValuePairs = function() { return this.keyValuePairs; }
	this.getValue = function(s) {
		for(var j=0; j < this.keyValuePairs.length; j++) {
			if(this.keyValuePairs[j].split("=")[0] == s)
				return this.keyValuePairs[j].split("=")[1];
		}
		return false;
	}
	this.getParameters = function() {
		var a = new Array(this.getLength());
		for(var j=0; j < this.keyValuePairs.length; j++) {
			a[j] = this.keyValuePairs[j].split("=")[0];
		}
		return a;
	}
	this.getLength = function() { return this.keyValuePairs.length; }	
}

function queryString(key){
	var page = new PageQuery(window.location.search); 
	return unescape(page.getValue(key)); 
}

//function RObj(ea){var LS="";var QS=new Object();var un="undefined";var f="function";var n="number";var r="string";var e1="ERROR:Index out of range in\r\nRequest.QueryString";var e2="ERROR:Wrong number of arguments or invalid property assignment\r\nRequest.QueryString";var e3="ERROR:Object doesn't support this property or method\r\nRequest.QueryString.Key";function Err(arg){if(ea)alert("Request Object:\r\n"+arg)};function URID(t){var d="";if(t){for(var i=0;i<t.length;++i){var c=t.charAt(i);d+=(c=="+"?" ":c);};};return unescape(d);};function OL(o){var l=0;for(var i in o){if(typeof(o[i])!=f) l++;};return l;};function AK(key){var auk=true;for(var u in QS){if(typeof(QS[u])!=f&&u.toString().toLowerCase()==key.toLowerCase()){auk=false;return u;}};if(auk){QS[key]=new Object();QS[key].toString=function(){return TS(QS[key])};QS[key].Count=function(){return OL(QS[key])};QS[key].Count.toString=function(){return OL(QS[key]).toString()};QS[key].Item=function(e){if(typeof(e)==un) return QS[key];else {if(typeof(e)==n){var a=QS[key][Math.ceil(e)];if(typeof(a)==un) Err(e1+"(\""+key+"\").Item("+e+")");return a;}else Err("ERROR:Expecting numeric input in\r\nRequest.QueryString(\""+key+"\").Item(\""+e+"\")");}};QS[key].Item.toString=function(e){if(typeof(e)==un) return QS[key].toString();else {var a=QS[key][e];if(typeof(a)==un) Err(e1+"(\""+key+"\").Item("+e+")");return a.toString();};};QS[key].Key=function(e){var t=typeof(e);if(t==r){var a=QS[key][e];return(typeof(a)!=un&&a&&a.toString()?e:"");}else Err(e3+"("+(e?e:"")+")");};QS[key].Key.toString=function(){return un};};return key};function AVTK(key,val){if(key!=""){var key=AK(key);var l=OL(QS[key]);QS[key][l+1]=val;}};function TS(o){var s="";for(var i in o){var ty=typeof(o[i]);if(ty=="object") s+=TS(o[i]);else if(ty!=f) s+=o[i]+", ";};var l=s.length;if(l>1)return(s.substring(0,l-2));return(s==""?un:s);};function KM(k,o){var k=k.toLowerCase();for(var u in o){if(typeof(o[u])!=f&&u.toString().toLowerCase()==k) return u;};}if(window.location&&window.location.search){LS=window.location.search;var l=LS.length;if(l>0){LS=LS.substring(1,l);var preAmpAt=0;var ampAt=-1;var eqAt=-1;var k=0;var skip=false;for(var i=0;i<l;++i){var c=LS.charAt(i);if(LS.charAt(preAmpAt)=="="||(preAmpAt==0&&i==0&&c=="=")) skip=true;if(c=="="&&eqAt==-1&&!skip) eqAt=i;if(c=="&"&&ampAt==-1){if(eqAt!=-1) ampAt=i;if(skip) preAmpAt=i+1;skip=false;};if(ampAt>eqAt){AVTK(URID(LS.substring(preAmpAt,eqAt)),URID(LS.substring(eqAt+1,ampAt)));preAmpAt=ampAt+1;eqAt=ampAt=-1;++k;};};if(LS.charAt(preAmpAt)!="="&&(preAmpAt!=0||i!=0||c!="=")){if(preAmpAt!=l){if(eqAt!=-1) AVTK(URID(LS.substring(preAmpAt,eqAt)),URID(LS.substring(eqAt+1,l)));else if(preAmpAt!=l-1) AVTK(URID(LS.substring(preAmpAt,l)),"");};if(l==1) AVTK(LS.substring(0,1),"");};};};var TC=OL(QS);if(!TC) TC=0;QS.toString=function(){return LS.toString()};QS.Count=function(){return(TC?TC:0)};QS.Count.toString=function(){return(TC?TC.toString():"0")};QS.Item=function(e){if(typeof(e)==un) return LS;else {if(typeof(e)==n){var e=Math.ceil(e);var c=0;for(var i in QS){if(typeof(QS[i])!=f&&++c==e) return QS[i];};Err(e1+"().Item("+e+")");}else return QS[KM(e,QS)];};return un;};QS.Item.toString=function(){return LS.toString()};QS.Key=function(e){var t=typeof(e);if(t==n){var e=Math.ceil(e);var c=0;for(var i in QS){if(typeof(QS[i])!=f&&++c==e) return i;}}else if(t==r){var e=KM(e,QS);var a=QS[e];return(typeof(a)!=un&&a&&a.toString()?e:"");}else Err(e2+"().Key("+(e?e:"")+")");Err(e1+"().Item("+e+")");};QS.Key.toString=function(){Err(e2+"().Key");};this.QueryString=function(k){if(typeof(k)==un) return QS;else {var k=KM(k,QS);if(typeof(QS[k])==un){t=new Object();t.Count=function(){return 0};t.Count.toString=function(){return "0"};t.toString=function(){return un};t.Item=function(e){return un};t.Item.toString=function(){return un};t.Key=function(e){Err(e3+"("+(e?e:"")+")");};t.Key.toString=function(){return un};return t;}if(typeof(k)==n) return QS.Item(k);else return QS[k];}};this.QueryString.toString=function(){return LS.toString();};this.QueryString.Count=function(){return(TC?TC:0)};this.QueryString.Count.toString=function(){return(TC?TC.toString():"0")};this.QueryString.Item=function(e){if(typeof(e)==un) return LS.toString();else {if(typeof(e)==n){var e=Math.ceil(e);var c=0;for(var i in QS){if(typeof(QS[i])!=f&&++c==e) return QS[i];};Err(e1+".Item("+e+")");}else return QS[KM(e,QS)];}if(typeof(e)==(n)) Err(e1+".Item("+e+")");return un;};this.QueryString.Item.toString=function(){return LS.toString()};this.QueryString.Key=function(e){var t=typeof(e);if(t==n){var e=Math.ceil(e);var c=0;for(var i in QS){if(typeof(QS[i])=="object"&&(++c==e)){return i;}}}else if(t==r){var e=KM(e,QS);var a=QS[e];return(typeof(a)!=un&&a&&a.toString()?e:"");}else Err(e2+".Key("+(e?e:"")+")");Err(e1+".Item("+e+")");};this.QueryString.Key.toString=function(){Err(e2+".Key");};this.Version=1.2;this.Author="Andrew Urquhart (www.andrewu.co.uk)";};var Request=new RObj(false);
