function ValidateForm()
{	
	var alertMessage = "";	 
	var error = false;

	/******************************/
	error = false;	
	var strFirstName = (document.getElementById("strFirstName")).value;
	if(isEmptyString(strFirstName))
	{
		alertMessage = alertMessage + "\n" + FIRST_NAME_BLANK_ERROR;		
		error  = true;		
	}
	
	if (chkAlphabetChr(strFirstName)==true)
	{
		alertMessage = alertMessage + "\n" + FIRST_NAME_ALPHABET_ERROR;		
		error  = true;
	}
	/*********************************/

	error = false;	
	var strLastName = (document.getElementById("strLastName")).value
		
	if(isEmptyString(strLastName))
	{
		alertMessage = alertMessage + "\n" + LAST_NAME_BLANK_ERROR;		
		error  = true;		
	}

	if (chkAlphabetChr(strLastName)==true)
	{
		alertMessage = alertMessage + "\n" + LAST_NAME_ALPHABET_ERROR;		
		error  = true;
	}	

	/*******************************/
	error = false;
	emailErrorFlag=false;	
	var strEmail = (document.getElementById("strEmail")).value	
	if(isEmptyString(strEmail))
	{
		alertMessage = alertMessage + "\n" + EMAIL_ERROR_BLANK;		
		error  = true;		
		emailErrorFlag=true;
	}

	if (emailErrorFlag==false)
	{
		if(eMailIDcheck(strEmail))
		{
			alertMessage = alertMessage + "\n" + EMAIL_ERROR_FORMAT;		
			error  = true;
		}
	}
	
	/******************************************************************/
	if(document.getElementById("strPassword"))
	{
		error = false;		
		var strPassword = (document.getElementById("strPassword")).value;
		var pat=/^[a-z0-9]{4,}$/gi;
		if(!pat.test(strPassword))
		{
			alertMessage = alertMessage + "\n" + INVALID_PASSWORD;			
		}
		else
		{			
			var strConfirmPassword = (document.getElementById("strConfirmPassword")).value;
			if(strConfirmPassword!=strPassword)
			{
				alertMessage = alertMessage + "\n" + CONFIRM_NEW_PASSWORD_ERROR;				
			}
		}
	}
	
	/******************************************************************/



    error = false;
	errorflag=false;	
	var strBirthYear = (document.getElementById("strBirthYear")).value;


	if(isEmptyString(strBirthYear))
	{
		alertMessage = alertMessage + "\n" + FREEFOODCAMPAIGN_ERROR_INVALIDBIRTHDATE;		
		error  = true;
		errorflag=true;

	}
	if (errorflag==false)
	{
		if(isNumeric(strBirthYear)==false)
		{
			alertMessage = alertMessage + "\n" + FREEFOODCAMPAIGN_ERROR_INVALIDBIRTHDATE;		
			error  = true;
		}
	}		

	/******************************************************************/
	error = false;	
	var strMaillingAddress = (document.getElementById("strMaillingAddress")).value	
	if(isEmptyString(strMaillingAddress))
	{
		alertMessage = alertMessage + "\n" + FREEFOODCAMPAIGN_ERROR_MAILINGADDRESSBLANK;		
		error  = true;		
	}		
	
	error = false;	
	var strState = (document.getElementById("strState")).value		
	if(strState == "")
	{
		alertMessage = alertMessage + "\n" + FREEFOODCAMPAIGN_ERROR_STATEBLANK;		
		error  = true;		
	}
	/************************************************************/

	error = false;	
	var strZip = (document.getElementById("strZip")).value;

	if (validateZIP(strZip)==false)
	{
			alertMessage = alertMessage + "\n" + FREEFOODCAMPAIGN_ERROR_POSTALCODEINVALID;
			error  = true;
	}

	var numberOfCats = document.form1.numberOfCats.value ;
	 if(numberOfCats == "" ){
	   alertMessage = alertMessage + "\n" + "Please select number of cats you have";
			error  = true;
	 }			
     
   if(numberOfCats != ""){     
	   for(k=0;k<numberOfCats;k++)
	   {
		 catName  = "catName" + k ; 
		 catBirthMonth = "birthMonthCat" + k;
		 catBirthYear = "birthYearCat" + k ;  
		 catNameInput = document.getElementById(catName).value;
		 catBirthMonthInput = document.getElementById(catBirthMonth).value;
		 catBirthYearInput = document.getElementById(catBirthYear).value;
		 if(isEmptyString(catNameInput)){
             alertMessage = alertMessage + "\n" + "Cat Name "+(k+1) +" cannot be blank";
		 }
		 else if(chkAlphabetChr(catNameInput)){
             alertMessage = alertMessage + "\n" + "Cat name "+(k+1) +" can only contain alphabet and space.";
		 }
		 if(catBirthMonthInput==""){
              alertMessage = alertMessage + "\n" + "Month of Birth for Cat "+(k+1) +"  should be selected.";
		 }
		 if(catBirthYearInput==""){
              alertMessage = alertMessage + "\n" + "Year of Birth for Cat "+(k+1) +"  should be selected.";
		 }
		
	   }
   }

	/******************************************************/

	if(alertMessage == "")
	{
		return true; 
	}
	else
	{
			alert(alertMessage);
			return false;
	}
}


















 



 























