function reservation_validator(theForm) {
	var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþ-' ";
	var checkStr = theForm.fname.value;
	var allValid = true;
	if (theForm.email.value!=theForm.email2.value) {
		alert("Your email does not appear to have been entered the same. Please check and enter your email address again.");
		theForm.email.focus();
		theForm.email2.value='';
		return false;
	}

	if (theForm.fname.value == "") {
		alert("Please enter a value for the \"First Name\" field.");
		theForm.fname.focus();
		return (false);
	}

	if (theForm.age.value == "x") {
		alert("Please select the Drivers age.");
		theForm.age.focus();
		return (false);
	}

	for (i = 0;  i < checkStr.length;  i++) {
    	ch = checkStr.charAt(i);
    	for (j = 0;  j < checkOK.length;  j++)
      		if (ch == checkOK.charAt(j))
        		break;
    	if (j == checkOK.length) {
      		allValid = false;
      		break;
    	}
  }
  if (!allValid) {
    alert("Please enter only letters, spaces and \" - ' \" characters in the \"First Name\" field.");
    theForm.fname.focus();
    return (false);

  }
  
   if (theForm.lname.value == "")
    {
      alert("Please enter a value for the \"Last Name\" field.");
      theForm.lname.focus();
      return (false);
    }
  
    var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþ-' ";
    var checkStr = theForm.lname.value;
    var allValid = true;
    for (i = 0;  i < checkStr.length;  i++)
    {
      ch = checkStr.charAt(i);
      for (j = 0;  j < checkOK.length;  j++)
        if (ch == checkOK.charAt(j))
          break;
      if (j == checkOK.length)
      {
        allValid = false;
        break;
      }
    }
    if (!allValid)
    {
      alert("Please enter only letters, spaces and \" - ' \" characters in the \"Last Name\" field.");
      theForm.lname.focus();
      return (false);
  
  }
  
   if (theForm.add1.value == "")
    {
      alert("Please enter a value for the \"First Address Field\" field.");
      theForm.add1.focus();
      return (false);
    }
  
    var checkOK = "1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþ-' ";
    var checkStr = theForm.add1.value;
    var allValid = true;
    for (i = 0;  i < checkStr.length;  i++)
    {
      ch = checkStr.charAt(i);
      for (j = 0;  j < checkOK.length;  j++)
        if (ch == checkOK.charAt(j))
          break;
      if (j == checkOK.length)
      {
        allValid = false;
        break;
      }
    }
    if (!allValid)
    {
      alert("Please enter only letters, spaces and \" - ' \" characters in the \"First Address Field\" field.");
      theForm.add1.focus();
      return (false);
  
  }
  
   if (theForm.add2.value == "")
    {
    }
  
    var checkOK = "1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþ-' ";
    var checkStr = theForm.add2.value;
    var allValid = true;
    for (i = 0;  i < checkStr.length;  i++)
    {
      ch = checkStr.charAt(i);
      for (j = 0;  j < checkOK.length;  j++)
        if (ch == checkOK.charAt(j))
          break;
      if (j == checkOK.length)
      {
        allValid = false;
        break;
      }
    }
    if (!allValid)
    {
      alert("Please enter only letters, spaces and \" - ' \" characters in the \"Second Address Field\" field.");
      theForm.add2.focus();
      return (false);
  
  }
  
  
   if (theForm.add3.value == "")
    {
      alert("Please enter a value for the \"Post Town\" field.");
      theForm.add3.focus();
      return (false);
    }
  
    var checkOK = "1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþ-' ";
    var checkStr = theForm.add3.value;
    var allValid = true;
    for (i = 0;  i < checkStr.length;  i++)
    {
      ch = checkStr.charAt(i);
      for (j = 0;  j < checkOK.length;  j++)
        if (ch == checkOK.charAt(j))
          break;
      if (j == checkOK.length)
      {
        allValid = false;
        break;
      }
    }
    if (!allValid)
    {
      alert("Please enter only letters, spaces and \" - ' \" characters in the \"Post Town\" field.");
      theForm.add3.focus();
      return (false);
  
  }

if (theForm.postcode.value=="")
  {
    alert("Please enter a value for the \"Post code\" field.");
    theForm.postcode.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþ0123456789 ";
  var checkStr = theForm.postcode.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Please enter only letters, digits and spaces in the \"Post code\" field.");
    theForm.postcode.focus();
    return (false);
  }  

  if (theForm.tel_no.value == "")
  	{
      alert("Please enter a value for the \"Telephone\" field.");
      theForm.tel_no.focus();
      return (false);
    }
  
    var checkOK = "0123456789-+() ";
    var checkStr = theForm.tel_no.value;
    var allValid = true;
    for (i = 0;  i < checkStr.length;  i++)
    {
      ch = checkStr.charAt(i);
      for (j = 0;  j < checkOK.length;  j++)
        if (ch == checkOK.charAt(j))
          break;
      if (j == checkOK.length)
      {
        allValid = false;
        break;
      }
    }
    if (!allValid)
    {
      alert("Please enter only digits, spaces and \" + ( ) \" characters in the \"Telephone\" field.");
      theForm.tel_no.focus();
      return (false);
  }
  
if (theForm.email.value=="")
  {
    alert("Please enter a value for the \"Email\" field.");
    theForm.email.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþ0123456789-_@.";
  var checkStr = theForm.email.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Please enter only letter, digit and \" @ . \" characters in the \"Email\" field.");
    theForm.email.focus();
    return (false);

  }

  if ((theForm.email.value.length < 6)|| (theForm.email.value.indexOf('@') == -1)||
(theForm.email.value.indexOf('.') == -1)||
    ((theForm.email.value.indexOf('@')+1) == theForm.email.value.length)||
((theForm.email.value.indexOf('.')+1) ==theForm.email.value.length)){
    alert("Please enter a valid email address");
    theForm.email.focus();
    return false;
  }


}

function proform_validator(frm) {

	if ((frm.drop_date.value == frm.pick_date.value) && (frm.dep_time.value >= frm.ret_time.value)) {
    	alert("You have selected the same date to drop the car back and the time of pick up is less than or equal to the time you want to return the car.\nPlease adjust the return time.");
    	frm.ret_time.focus();
    	return (false);
  	}

  
  	if (frm.drop_date.value=="") {
    	alert("Please select a date to drop off your rental car.");
    	frm.drop_date.focus();
    	return (false);
  	}

	var checkOK = "/0123456789";
	var checkStr = frm.drop_date.value;
	var allValid = true;
	for (i = 0;  i < checkStr.length;  i++) {
    	ch = checkStr.charAt(i);
    	for (j = 0;  j < checkOK.length;  j++)
      	if (ch == checkOK.charAt(j))
        	break;
    	if (j == checkOK.length) {
      		allValid = false;
      		break;
    	}
  	}
  	if (!allValid) {
    	alert("Date format is incorrect, format should be d/m/y.");
    	frm.drop_date.focus();
    	return (false);
  	}
     
  	return (true);
}


function popXE(Amount,Cid) {
	window.open('xe.php?Amount='+Amount+'&Cid='+Cid,'popXE','width=650,height=500,scrollbars=yes,resizable=yes');
}

function popXEcomplete(Amount,CurrencyTo,CurrencyFrom) {
	window.open('http://www.xe.com/ucc/convert.cgi?Amount='+Amount+'&From='+CurrencyFrom+'&To='+CurrencyTo,'popXE','width=650,height=500,scrollbars=yes,resizable=yes');
}

function popWindow(Address) {
	window.open(Address,'popWindow','width=650,height=500,scrollbars=yes,resizable=yes');
}

function Hide() {
	document.getElementById("PleaseWait").style.display='none';
}

