// JavaScript Document
/***********************************************************************************
*	(c) Firecast Web Solutions 2003 version 1.01 28 February 2003	          *
*	For info write to info@firecast.co.uk		          *
*	You may remove all comments for faster loading	          *		
***********************************************************************************/
function validateForm(form)
{ 
//var emailID = form.email.value;
//alert(Card_ExpMon);
//alert(expyr);
//alert(nowMonth);
//alert(nowYear);
//alert(Card_CardType);

	
	if ((form.txt_firstname.value=="")){
		alert("Please enter your first name.")
		form.txt_firstname.focus()
		return false;
	}
	if ((form.txt_lastname.value=="")){
		alert("Please enter your surname.")
		form.txt_lastname.focus()
		return false;
	}
	if ((form.txt_address.value=="")){
		alert("Please enter your address.")
		form.txt_address.focus()
		return false;
	}	
}

//email validation function, called from within above validateForm function
function echeck(str) {

		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
		   alert("The E-mail that you have entered is not valid")
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("The E-mail that you have entered is not valid")
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    alert("The E-mail that you have entered is not valid")
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    alert("The E-mail that you have entered is not valid")
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert("The E-mail that you have entered is not valid")
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    alert("The E-mail that you have entered is not valid")
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		    alert("The E-mail that you have entered is not valid")
		    return false
		 }
		 return true					
	}