/* -- Adobe GoLive JavaScript Library */

function chkFormular()
{
    if(document.Formular.Name.value == ""){alert("Vul a.u.b. uw naam in");document.Formular.Name.focus();return false;}
	if(document.Formular.City.value == ""){alert("Vul a.u.b. uw woonplaats in");document.Formular.City.focus();return false;}
	if(document.Formular.Email.value == ""){alert("Graag Uw E-mail invullen ?");document.Formular.Email.focus();return false;}
	if(document.Formular.Phone.value == ""){alert("Vul a.u.b. uw telefoon / mobiel in");document.Formular.Phone.focus();return false;}
	if(document.Formular.Age.value == ""){alert("Vul a.u.b. uw leeftijd in");document.Formular.Age.focus();return false;}
}
 

function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImagesArray(array) {
	
		var d = document; var img;
		for (var i=0; i<array.length; i+=2) {
			img = null; var n = array[i];
			if (d.images) {img = d.images[n];}
			if (!img && d.getElementById) {img = d.getElementById(n);}
			if (img) {img.src = array[i+1];}
		}
	
}

function changeImages() {
	changeImagesArray(changeImages.arguments);
}

function ShowImage(Thumb,anaam,aprijs){
	var BigImage = document.getElementById('aktie_big');
	var BigNaam = document.getElementById('aktie_naam');
	var BigPrijs = document.getElementById('aktie_prijs');
	BigImage.src = Thumb.src;
	BigNaam.value = anaam;
    BigPrijs.value = aprijs;
}

function BigImagePopup(Thumb){
	var sfile = Thumb;
	var s="toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=no, resizable=no,width=660,height=500,curmbox=ACTIVE";
	var hWnd = window.open(sfile,"CA",s);
	
	if ((document.window != null) && (!hWnd.opener))
		hWnd.opener = document.window;
	hWnd.focus();	
}

function MyPopup(sFile)
{
	var s="toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=no, resizable=no,width=660,height=500,curmbox=ACTIVE";
	var hWnd = window.open(sFile,"HST",s);
	if ((document.window != null) && (!hWnd.opener))
		hWnd.opener = document.window;
	hWnd.focus();	
}

function powerhostel()
{ 

if(document.formular.night.value == "")
	{alert("Missing night(s)");
	document.formular.night.focus();
	return false;
	}
if(document.formular.arrday.value == "")
	{alert("Missing day");
	document.formular.arrday.focus();
	return false;
	}
if(document.formular.arrmonth.value == "")
	{alert("Missing month");
	document.formular.arrmonth.focus();
	return false;
	}
if(document.formular.arryear.value == "")
	{alert("Missing year");
	document.formular.arryear.focus();
	return false;
	}
	
if(document.formular.night.value == "#Night(s)")
	{alert("Missing night(s)");
	document.formular.night.focus();
	return false;
	}
if(document.formular.arrday.value == "Day")
	{alert("Missing day");
	document.formular.arrday.focus();
	return false;
	}
if(document.formular.arrmonth.value == "Month")
	{alert("Missing month");
	document.formular.arrmonth.focus();
	return false;
	}
if(document.formular.arryear.value == "Year")
	{alert("Missing year");
	document.formular.arryear.focus();
	return false;
	}

night = document.formular.night.value;
day = document.formular.arrday.value;
month = document.formular.arrmonth.value;
year = document.formular.arryear.value;


txt = "http://www.powerhostels.com/hbaffiliate/index.cfm?fuseaction=hostelavail&hostel=15373&affid=15373&nights="
txt = txt + night
txt = txt + "&arrival="
txt = txt + day + "-" + month + "-" + year
txt = txt + "&currency=EUR&lan=en"
window.open(txt);

}
	
function fout()
{ 
alert("Missing");
}

function booknow()
{ 

if(document.bookformular.night.value == "")
	{alert("Missing night(s)");
	document.bookformular.night.focus();
	return false;
	}
if(document.bookformular.arrday.value == "")
	{alert("Missing day");
	document.bookformular.arrday.focus();
	return false;
	}
if(document.bookformular.arrmonth.value == "")
	{alert("Missing month");
	document.bookformular.arrmonth.focus();
	return false;
	}
if(document.bookformular.arryear.value == "")
	{alert("Missing year");
	document.bookformular.arryear.focus();
	return false;
	}
	
if(document.bookformular.night.value == "#Night(s)")
	{alert("Missing night(s)");
	document.bookformular.night.focus();
	return false;
	}
if(document.bookformular.arrday.value == "Day")
	{alert("Missing day");
	document.bookformular.arrday.focus();
	return false;
	}
if(document.bookformular.arrmonth.value == "Month")
	{alert("Missing month");
	document.bookformular.arrmonth.focus();
	return false;
	}
if(document.bookformular.arryear.value == "Year")
	{alert("Missing year");
	document.bookformular.arryear.focus();
	return false;
	}

night = document.bookformular.night.value;
day = document.bookformular.arrday.value;
month = document.bookformular.arrmonth.value;
year = document.bookformular.arryear.value;


txt = "http://www.powerhostels.com/hbaffiliate/index.cfm?fuseaction=hostelavail&hostel=15373&affid=15373&nights="
txt = txt + night
txt = txt + "&arrival="
txt = txt + day + "-" + month + "-" + year
txt = txt + "&currency=EUR&lan=en"
window.open(txt);

}	
