		var retval;
		var gFormName;
				
function submit_form(formName)
		{
			var blnIsValid;	
			blnIsValid = false;
			gFormName = formName;
			blnIsValid = validate();

			// Determine if the form has been successfully validated
			if( blnIsValid ) 
			{
				// The form has been successfully validated, so submit it
				document.forms[0].action = gFormName;
				document.forms[0].method = "post";
				document.forms[0].submit();
			}
		}

function check_name()
	{
		var visitor_name;
		visitor_name = document.forms[0]["txtName"].value;
			if (visitor_name == '')
			{
				alert("Please specify your name");
				document.forms[0]["txtName"].focus();
				return false;
			} else {
				return true;
			}
	}

function check_number_in_party()
	{
		var number_in_party;
		number_in_party = document.forms[0]["txtNumberInParty"].value;
		//retval = grillTextBox(number_in_party, "zerolen; noalpha; nosymbol;");
		if (isNaN(number_in_party) || number_in_party == '') 
		//if(retval)
		{	
			alert("Please enter the number in your party");
			document.forms[0]["txtNumberInParty"].focus();
			return false
		}
	
	return true;	
	}
	

function check_phone_no()
	{
		var phone_no;
		phone_no = document.forms[0]["txtTel"].value;
			if (phone_no == '')
			{
				alert("Please specify a contact telephone number");
				document.forms[0]["txtTel"].focus();
				return false;
			} else {
				return true;
			}
	}

function check_email(){
	var email;
	email = document.forms[0]["txtEmail"].value;
	if (email != "")
	{
		if(!hasAtSymbol(email))
		{
			alert("The e-mail address you have specified is invalid. Please re-enter");
			document.forms[0]["txtEmail"].focus();
			return false;
		}
	} else {
		alert("Please specify your email address");
		document.forms[0]["txtEmail"].focus();
		return false;
	}
	return true;
}

function check_booking_date()
	{	
		var dateToday = new Date();
		var d = 0;
		var m = 0;
		var day, month, year			
		d = document.forms[0]["selDate"].selectedIndex;
		day = document.forms[0]["selDate"].options[d].value;
		m = document.forms[0]["selMonth"].selectedIndex;
		month = document.forms[0]["selMonth"].options[m].value;
		year  = document.forms[0]["selYear"].value;
//		alert(day & month & year);
//		alert(month);
		retval = grillDateA(day, month, year, "required; nopast;");
		
		if (dateToday.getDate()==day && dateToday.getMonth()+1==month && dateToday.getYear()==year)
		{
			retval = 10;
		}
		
		if(retval)
		{	
			ShowErrorMsgForGrillDateA(retval, "Booking date");
			return false;
		} else {
			return true;
		}		
	}
	
function check_time()
	{
		var hour;
		var mins;
		var h = 0;
		var m = 0;
		
		h = document.reservation_form.selHour.selectedIndex;
		hour = document.reservation_form.selHour.options[h].value;
		m = document.reservation_form.selMinute.selectedIndex;
		mins = document.reservation_form.selMinute.options[m].value;
		if (hour == "23" && mins == "45")
		{
			alert("Booking time must be earlier than this");
			document.reservation_form.selMinute.focus();
			return false;
		} else {
			return true;
		}
	}
	
function hasAtSymbol(vChar) {   // used in quotation request
	var blnIsSafe;
	var intLength = vChar.length;
	var Count;

	for (Count = 0; Count < intLength; Count++) {
		if (vChar.substring(Count, Count + 1) == "@") {
			return(true);
		} else {
			//alert("The e-mail address you have specified is invalid");
			//document.forms[0]["txt_email"].focus();
			blnIsSafe = false;
		}
	}

	return(blnIsSafe);
}

function check_occasion()
	{
		var number_in_party;
		var occasion;
		var i;
		
		number_in_party = document.forms[0]["txtNumberInParty"].value;
		
		i = document.forms[0]["sel_occasion"].selectedIndex;

		if (number_in_party > 9 && i == 0) 

		{	
			alert("Please specify the occasion");
			document.forms[0]["sel_occasion"].focus();
			return false
		}
	
	return true;	
	}
	
function check_other_occasion() 
	{
		var occasion;
		var i;
		var other_occasion;
		
		i = document.forms[0]["sel_occasion"].selectedIndex;
		occasion = document.forms[0]["sel_occasion"].options[i].value;
		
		other_occasion = document.forms[0]["txt_other_occasion"].value;

		if (occasion == 'Other' && other_occasion == '') 

		{	
			alert("Please further specify the occasion");
			document.forms[0]["txt_other_occasion"].focus();
			return false
		}
	
	return true;
	}
	
function oldBrowserCheck(NSvers,NSpass,NSnoPass,IEvers,IEpass,IEnoPass,OBpass,URL,altURL) { //v5.0
  var newURL='', userAgent=navigator.userAgent, version=0;
  if (userAgent.indexOf('Firefox') != -1) {
  	version = parseFloat(userAgent.substring(userAgent.indexOf('Firefox')+8,userAgent.length));
    if (version >= NSvers) {if (NSpass>0) newURL=(NSpass==1)?URL:altURL;}
    else {if (NSnoPass>0) newURL=(NSnoPass==1)?URL:altURL;}
  } else if (userAgent.indexOf('MSIE') != -1) {
  	version = parseFloat(userAgent.substring(userAgent.indexOf('MSIE')+4,userAgent.length));
    if (version >= IEvers)
     {if (IEpass>0) newURL=(IEpass==1)?URL:altURL;}
    else {if (IEnoPass>0) newURL=(IEnoPass==1)?URL:altURL;}
  } else if (OBpass>0) newURL=(OBpass==1)?URL:altURL;
  if (newURL) { 
  	//alert('old browser');
  	return true;
  } else {
	  //alert('new browser');
	  return false;
  }
}
