function formCheck(formobj){
	// Enter name of mandatory fields
	var fieldRequired = Array("vname", "surname", "nop", "ar_dd", "ar_mm", "ar_yy", "de_dd", "de_mm", "de_yy");
	// Enter field description to appear in the dialog box
	var fieldDescription = Array("First Name", "Last Name", "Number Of People", "Arrival Day", "Arrival Month", "Arrival Year", "Departure Day", "Departure Month", "Departure Year");
	// dialog message
	var alertMsg = "Please complete the following fields:\n";
	
	var l_Msg = alertMsg.length;
	
	for (var i = 0; i < fieldRequired.length; i++){
		var obj = formobj.elements[fieldRequired[i]];
		if (obj){
				if (obj.value == "" || obj.value == null){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
		} 
	}

	if (alertMsg.length == l_Msg){
		return true;
	}
	else{
		alert(alertMsg);
		formobj.elements.vname.focus();
		//formobj.elements.vname.style.backgroundColor='#F0F2D0';
		//which.style.color=color
		return false;
	}
}

function getdates() {
				nw = parseInt(document.form1.nofw.value);
				d = document.form1.ar_dd.value;
				m = document.form1.ar_mm.value - 1;
				y = document.form1.ar_yy.value;
				teraz = new Date(y,m,d);
				data = new Date();
				if (teraz > data){
					teraz.setDate(teraz.getDate() + (7*nw));
					document.form1.de_dd.value = teraz.getDate();
					document.form1.de_mm.value = parseInt(teraz.getMonth() + 1);
					document.form1.de_yy.value = teraz.getYear();
				}
				else {
					alert('Incorrect date!!! Try again.');
				}		
}
	
function enableFax() {
				document.form1.fax.disabled=false;
				document.form1.fax.style.backgroundColor = "white";
}
	
function disableFax() {
				document.form1.fax.disabled=true;
				document.form1.fax.style.backgroundColor = "#cccccc";
}

function disab(val,radioGroup) {
		if(val=="1")
			{
			radioGroup[0].disabled=false;
			radioGroup[1].disabled=false;
			radioGroup[2].disabled=false;
			}
		if(val=="2")
			{
			radioGroup[0].disabled=true;radioGroup[0].checked=false;
			radioGroup[1].disabled=true;radioGroup[1].checked=false;
			radioGroup[2].disabled=true;radioGroup[2].checked=false;
			document.form1.fax.disabled=true;
			document.form1.fax.style.backgroundColor = "#cccccc";
			}
}

function jperiod(t){
	if(t=="1")
		{
			//document.form1.price.disabled=false;
			//pole1 = document.form1.price.value;
			//pole2 = pole1 + (pole1 * 0.5);
			tt = parseInt(document.form1.priceh.value);
			tt1 = tt+(tt*0.5);
			document.form1.price.value = '£'+tt1+'0';
			document.form1.price.style.backgroundColor = "#cccccc";
			
		}
	if(t=="2")
		{
			tt = parseInt(document.form1.priceh.value);
			tt1 = tt;
			document.form1.price.value = '£'+tt1+'.00';
			document.form1.price.style.backgroundColor = "#cccccc";
		}
}

function win_close() {
    window.opener = top;
    window.close();
}
function fixFloat(fld)
{ var val= fld.value;
  if(isNaN(val))
  {
    alert('This field must contain a number.');
    fld.focus();
    return false;
  }
else{
  fld.value= val;
  return true;
}

}
function winOpen(url, breite, hoehe) {
      // Errechnet Koordinaten, um das Popup zentriert zu platzieren
      links = (screen.width/2)-(breite/2);
      oben = (screen.height/2)-(hoehe/2);
      window.open(url,"popup","height="+hoehe+",width="+breite+",status=no,toolbar=no,menubar=no,location=no,resizable=yes,titlebar=no,scrollbars=no,fullscreen=no,top="+oben+",left="+links);
   }
