function Validation(frm)
{
   if(frm.fname.value == "")
   {
		alert("Please enter the first name");
		frm.fname.focus();
		return false;
   }

   if(!isAlphabetic(frm.fname.value))
   {
		alert("Invalid Firstname");
		frm.fname.focus();
		return false;
   }

   if(frm.lname.value == "")
   {
		alert("Please enter the last name");
		frm.lname.focus();
		return false;
   }

   if(!isAlphabetic(frm.lname.value))
   {
		alert("Invalid last name");
		frm.lname.focus();
		return false;
   }    

   if ((frm.email.value == "" || frm.email.value.indexOf('@', 0) == -1) || frm.email.value.indexOf('.') == -1)
   {
		alert("Invalid email");
		frm.email.focus();
		return false;
   }

   if ((frm.confirm_email.value == "" || frm.confirm_email.value.indexOf('@', 0) == -1) || frm.confirm_email.value.indexOf('.') == -1)
   {
		alert("Invalid confirm email");
		frm.confirm_email.focus();
		return false;
   }

   if(frm.email.value != frm.confirm_email.value)
   {
		alert("Email not matching");
		frm.confirm_email.focus();
		return false;

   }

   if(frm.country_code.value=="")
   {
		alert("Please enter the country code");
		frm.country_code.focus();
		return false;
   }

   if(isNaN(frm.country_code.value))
   {
		alert("Please enter numeric value only");
		frm.country_code.focus();
		return false;
   }

   if(frm.phone_no.value=="")
   {
		alert("Please enter the phone no");
		frm.phone_no.focus();
		return false;
   }

   if(isNaN(frm.phone_no.value))
   {
		alert("Please enter numeric value only");
		frm.phone_no.focus();
		return false;
   }

   if(frm.address.value=="")
   {
		alert("Please enter the address");
		frm.address.focus();
		return false;
   }

   if(frm.zip_code.value=="")
   {
		alert("Please enter the zip code");
		frm.zip_code.focus();
		return false;
   }

   if(isNaN(frm.zip_code.value))
   {
		alert("Please enter numeric value only");
		frm.zip_code.focus();
		return false;
   }

   if(frm.age.value=="")
   {
		alert("Please enter the age");
		frm.age.focus();
		return false;
   }

   if(isNaN(frm.age.value))
   {
		alert("Please enter numeric value only");
		frm.age.focus();
		return false;
   }

  if ((frm.way_of_request[0].checked == false ) && ( frm.way_of_request[1].checked == false ) && (frm.way_of_request[2].checked == false)) 
  {
     alert ( "Please select your option");
	 frm.way_of_request[0].focus();	 
	 return false; 
  }   
   
   return true;

}


function isAlphabetic(val)
{
	if (val.match(/^[a-zA-Z]+$/))
	{
		return true;
	}
	else
	{
		return false;
	}	
}


function isAlphaNumeric(val)
{

	if (val.match(/^[a-zA-Z0-9]+$/))
	{
		return true;
	}
	else
	{
		return false;
	}	
}