<!--
function validate()
{
  var i, c;
  var docname =  new Array();
  
  docname[0] = document.Gala2010.name.value;
  docname[1] = document.Gala2010.address.value;
  docname[2] = document.Gala2010.email.value;
  docname[3] = document.Gala2010.cardnum.value;
  docname[4] = document.Gala2010.expdate.value;
  docname[5] = document.Gala2010.phone.value;
  
 for (i = 0; i < 6; i++)
  { 
	if(docname[i]=="")
	{	
		
		alert("Please Enter All the required fields (*) in the form.");
			return false;
	}
   }
   

		if (document.Gala2010.email.value !="") {
			 var myEmail = document.Gala2010.email.value;
			 var atIndex = myEmail.indexOf("@");
			 if (atIndex <  0 || (myEmail.indexOf(".", atIndex)<0)) {
					 alert(" E-mail address is invalid");
					return false;
					
	    }
		 }
	var CCardGoodChars = "0123456789- "
	for (c =0; c <= docname[3].length -1; c++) {
		if (CCardGoodChars.indexOf(docname[3].charAt(c)) == -1) {

       alert("The credit card number is not a valid number");
			return false;
		} // End if statement
	} // End for loop
	
	 if (document.Gala2010.visa.checked == false &&
	 	document.Gala2010.master.checked == false &&
		 document.Gala2010.amex.checked == false)
		{
			alert("Please enter your credit card number");
			return false;
		}
	else if (document.Gala2010.visa.checked == true ||
	 	document.Gala2010.master.checked == true)
		{
			if (docname[3].length != 16)
			{
			   alert(" The Credit Card # should be 16 digits long!");
				return false;
			} 
		}
		else if (document.Gala2010.amex.checked == true)
		{
			if (docname[3].length != 15)
			{
			   alert("The Credit Card # should be 15 digits long!");
				return false;
			} 
		}
	
	return true;
}
//-->

