// JavaScript Document
	/* Set maanden array */
	var Maanden	= new Array("dummy", "Januari", "Februari", "Maart", "April", "Mei", "Juni", "Juli", "Augustus", "September", "Oktober", "November", "December");

	function BGC(Elm,Color,border) {
		Elm.style.backgroundColor = Color;
		if(border == 1) {
			Elm.style.border = '1px SOLID #000000';
		} else {
			Elm.style.border = '1px SOLID ' + Color;
		}
	}

	function OnCLK(affQuery,Start,Stop,CN,CID) {
		document.location = 'maincontent.php?' + affQuery + 'Start=' + Start + '&amp;Stop=' + Stop + '&amp;CN=' + CN + '&amp;CID=' + CID;
	}
		
	function popup(imgsrc,PopupName) {
		var venster = window.open('','imageviewer','scrollbars=no,resizable=0,top=' + ((screen.height / 2) - 100) + ',left=' + ((screen.width / 2) - 100) + ',width=400,height=380,scrollbars=no,status=no');
		var img = new Image();
		img.src = imgsrc;
		with (venster.document) {
			write("<html><head><title><\/title><\/head>");
			write("<body style=\"margin:0px\">");
			write("<img src=\"" + imgsrc + "\" alt=\"" + img.src + "\" width=\"" + img.width + "\" height=\"" + img.height + "\" border=\"0\">");
			write("<\/body><\/html>");
			close();
		}
		venster.resizeTo((img.width + 10), (img.height + 49));
		venster.focus();
	}

	function popupMapLarge(imgsrc) {
		var venster = window.open('http://' + imgsrc ,'imageviewer','scrollbars=no,resizable=0,top=' + ((screen.height / 2) - 205) + ',left=' + ((screen.width / 2) - 205) + ',width=416,height=396');
		venster.focus();
	}

	function HotelInfo(aff,AID,Start,Stop,HID,URL,DIR) {
		/* Set popup size */
		var popupHeight = (screen.height / 100) * 80; // 550
		var popupWidth  = (screen.width / 100) * 80; // 720
		/* Affiliate check */
		var affQuery = '';
		if(aff != '') { affQuery = 'aff=' + aff + '&'; }
		/* Airport check */
		var AIDQuery = '';
		if(AID != '') { AIDQuery = '&AID=' + AID; }
		/* Open popup */
//		newwindow = window.open("maincontent.php?" + affQuery + "Start=" + Start + "&Stop=" + Stop + "&HID=" + HID + AIDQuery + "", "HotelInfo", "width=" + popupWidth + ",height=" + popupHeight + ",top=" + ((screen.height / 2) - (popupHeight / 2)) + ",left=" + ((screen.width / 2) - (popupWidth / 2)) + ",scrollbars=yes,toolbar=no");
//		top.location = URL + DIR + '?' + affQuery + 'Start=' + Start + '&Stop=' + Stop + '&HID=' + HID + AIDQuery;
		alert(URL + DIR + '?' + affQuery + 'Start=' + Start + '&Stop=' + Stop + '&HID=' + HID + AIDQuery);
		/* Focus on popup. */
//		if (window.focus) { newwindow.focus(); }
	}
	
	function LPG(aff) {
		/* Set popup size */
		var popupHeight = 460; // 550
		var popupWidth  = 380; // 720
		/* Affiliate check */
		var affQuery = '';
		if(aff != '') { affQuery = '?aff=' + aff; }
		/* Open popup */
		lpgwindow = window.open("laagsteprijsgarantie.php" + affQuery, "laagsteprijsgarantie", "width=" + popupWidth + ",height=" + popupHeight + ",top=50,left=50,scrollbars=no,toolbar=no");
		/* Focus on popup. */
		if (window.focus) { lpgwindow.focus(); }
	}
	
	function changeHinfoDate(aff,Start,Stop,SelectedDate,BID,HID,URL,DIR,Inframe) {
		/* Affiliate check */
		var affQuery = ''; 		if(aff != '') { affQuery = 'aff=' + aff + '&'; }
		var BIDQuery = '';		if(BID != '') { BIDQuery = '&BID=' + BID; 	   }
		/* Open document */
		var	datums = SelectedDate.split("/");
		if(aff != '') {
			parent.location = URL + DIR + 'mainFrame.php?' + affQuery + 'Start=' + datums[0] + '&Stop=' + datums[1] + '&Inframe=Y&HID=' + HID;
		} else {
			top.location = URL + DIR + '?' + affQuery + 'Start=' + datums[0] + '&Stop=' + datums[1] + '&HID=' + HID;
		}
	}

	function DateRange(SelectedBox,aff) {
		/* Affiliate check */
		var affQuery = '';
		if(aff != '') { affQuery = 'aff=' + aff + '&'; }
		/* Split datums */
		if(document.getElementById) {
			var dates = document.getElementById(SelectedBox).value.split("/");
		} else {
			var dates = document.all(SelectedBox).value.split("/");
		}
		var	datum1 = dates[0].split("-");
		var	datum2 = dates[1].split("-");
		if(document.getElementById) {
			/* Set Start */
			document.getElementById('Start').value = datum1[2] + ' ' + Maanden[parseInt(datum1[1],10)];
			/* Set Stop */
			document.getElementById('Stop').value = datum2[2] + ' ' + Maanden[parseInt(datum2[1],10)];
			/* Reset selectbox to default option */
			document.getElementById(SelectedBox).options[0].selected = true;
		} else if (document.all) {
			/* Set Start */
			document.all('Start').value = datum1[2] + ' ' + Maanden[parseInt(datum1[1],10)];
			/* Set Stop */
			document.all('Stop').value = datum2[2] + ' ' + Maanden[parseInt(datum2[1],10)];
			/* Reset selectbox to default option */
			document.all(SelectedBox).options[0].selected = true;
		}
		/* Set content location */
		parent.mainContent.location = 'maincontent.php?' + affQuery + 'Start=' + dates[0] + '&Stop=' + dates[1] + '&H=lijst';
	}

	function SubmitDate(SelDatum,URL,Aff,AID,Inframe) {
		var ScriptFile 	= "";
		var AffCode 	= "";
		var InframeCode = "";
		var	datum = SelDatum.split("/");
		if(Aff != '') {
			var ScriptFile = "mainFrame.php";
			var InframeCode = "";
		}
		if(Aff != "") {
			AffCode = "aff=" + Aff + "&";
		}
		document.Selectform.action = URL + '/' + ScriptFile + '?' + AffCode + InframeCode + 'Start=' + datum[0] + '&Stop=' + datum[1];
		if(AID != "") {
			document.Selectform.action += '&AID=' + AID;
		}
		document.Selectform.submit();
	}

	function PreloadImg() { 
		var args = PreloadImg.arguments;
		document.imageArray = new Array(args.length);
		for(var i = 0; i < args.length; i++) {
			document.imageArray[i]     = new Image;
			document.imageArray[i].src = args[i];
		}
	}

