

function validate(tableform) 

    //
    // Check the Email field to see if any characters were entered
    //
   {

	if (tableform.FirstName.value.length == 0)
    {
        alert("Please enter a booking name");
        tableform.FirstName.focus();
        return false;
    }

	 if ((tableform.FirstName.value.search(/href|\/url|\/link|http/i)) >= 0){
		alert("Links and Urls are not permitted");
		tableform.FirstName.focus();
	    return false;
	}



	 if ((tableform.LastName.value.search(/href|\/url|\/link|http/i)) >= 0){
		alert("Links and Urls are not permitted");
		tableform.LastName.focus();
	    return false;
	}

	
	 if (tableform.BookingDate.value.length == 0)
    {
        alert("Please enter a booking date");
        tableform.BookingDate.focus();
        return false;
    }
	
	 if ((tableform.BookingDate.value.search(/href|\/url|\/link|http/i)) >= 0){
		alert("Links and Urls are not permitted");
		tableform.BookingDate.focus();
	    return false;
	}
	
	 if (tableform.BookingTime.value.length == 0)
    {
        alert("Please enter a booking time");
        tableform.BookingTime.focus();
        return false;
    }

	 if ((tableform.BookingTime.value.search(/href|\/url|\/link|http/i)) >= 0){
		alert("Links and Urls are not permitted");
		tableform.BookingTime.focus();
	    return false;
	}

	 if (tableform.NumberofGuests.value.length == 0)
    {
        alert("Please enter the number of guests");
        tableform.NumberofGuests.focus();
        return false;
    }


	 if ((tableform.NumberofGuests.value.search(/href|\/url|\/link|http/i)) >= 0){
		alert("Links and Urls are not permitted");
		tableform.NumberofGuests.focus();
	    return false;
	}

	
	if (tableform.EmailAddress.value.length == 0)
    {
        alert("Please enter an e-mail address.");
        tableform.EmailAddress.focus();
        return false;
    }


	 if ((tableform.EmailAddress.value.search(/href|\/url|\/link|http/i)) >= 0){
		alert("Links and Urls are not permitted");
		tableform.EmailAddress.focus();
	    return false;
	}


    //
    // Now check the Email field for the "@" symbol
    //
    if (tableform.EmailAddress.value.indexOf("@") == -1)
    {
        alert("Please enter a valid e-mail address.");
        tableform.EmailAddress.focus();
        return false;
    }

	if (tableform.PhoneNumber.value.length == 0)
    {
        alert("Please enter a contact phone number.");
        tableform.PhoneNumber.focus();
        return false;
    }


	 if ((tableform.PhoneNumber.value.search(/href|\/url|\/link|http/i)) >= 0){
		alert("Links and Urls are not permitted");
		tableform.PhoneNumber.focus();
	    return false;
	}

	 if ((tableform.Message.value.search(/href|\/url|\/link|http/i)) >= 0){
		alert("Links and Urls are not permitted");
		tableform.Message.focus();
	    return false;
	}


}


