// JavaScript Document
// JavaScript Document

function frmValidationDonate()
{
    var Field= Array();
	var FieldName= Array();
	//var email=document.frmCareer.email.value;
	
	Field[0]=document.frmDonate.fName.value;
	Field[1]=document.frmDonate.lName.value;
	Field[2]=document.frmDonate.address.value;
	Field[3]=document.frmDonate.country.value;
	Field[4]=document.frmDonate.state.value;
	Field[5]=document.frmDonate.city.value;
	Field[6]=document.frmDonate.zip.value;
	Field[7]=document.frmDonate.email.value;
	
	
	FieldName[0]="First Name";
	FieldName[1]="Last Name";
	FieldName[2]="Address";
	FieldName[3]="Country";
	FieldName[4]="State";
	FieldName[5]="City";
	FieldName[6]="Zip";
	FieldName[7]="Email";
	
	
	
	var al="";
	var bval = true;
	
	for(i=0; i<8; i++)
	{
		if(Field[i]=="")
			al=al + ">>" + FieldName[i] + "   " + "\n";
	}
	
	if(al!="")
	{
		alert("Please Fill the following Fields\n\n" + al);
		bval = false;
	} 
	
	if(bval)
	 {
		bval= emailCheck();
	 }
	return bval;
/*	alert("Hi");*/
}
	 
function emailCheck() 
  	{
  	  		var emailPat=/^(.+)@(.+)$/
  	        var matchArray;	
  	  		var emailStr = document.frmDonate.email.value;	
  	  	
  	  		if(emailStr.length > 1)
  	  			{  	  	
			matchArray = emailStr.match(emailPat);
			if (matchArray == null) 
			
			{
				alert("Please Enter Correct Email Address"); 
				return false;
			}	
			else
			{
				return true;
			}  		
  		}
  	  	
    }


