

function validateFormAppointment()

{

	if($('#first_name').val()=='')

	{

		alert('First Name field can not be empty.');

		$('#first_name').focus();

		return false;

	}	

	if($('#last_name').val()=='')

	{

		alert('Last Name field can not be empty.');

		$('#last_name').focus();

		return false;

	}	

	if($('#day_phone').val()=='')

	{

		alert('Day Phone field can not be empty.');

		$('#day_phone').focus();

		return false;

	}	

	if(!echeck($('#email').val()))

	{

		$('#email').focus();

		return false;

	}

	if($('#captchastring').val()=='')

	{

		alert('Please enter the sucurity text.');

		$('#captchastring').focus();

		return false;

	}	

	

	return true;

}





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("Invalid E-mail ID")

		   return false

		}



		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){

		   alert("Invalid E-mail ID")

		   return false

		}



		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){

		    alert("Invalid E-mail ID")

		    return false

		}



		 if (str.indexOf(at,(lat+1))!=-1){

		    alert("Invalid E-mail ID")

		    return false

		 }



		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){

		    alert("Invalid E-mail ID")

		    return false

		 }



		 if (str.indexOf(dot,(lat+2))==-1){

		    alert("Invalid E-mail ID")

		    return false

		 }

		

		 if (str.indexOf(" ")!=-1){

		    alert("Invalid E-mail ID")

		    return false

		 }



 		 return true					

	}





function makeBlank(id,val,check)

	{

		

		var trimmed = val.replace(/^\s+|\s+$/g, '') ;

		if(trimmed==check)

		{

			eval("document.getElementById('"+id+"').value=''");

		}

	}

	function putValue(id,val,check)

	{

		

		var trimmed = val.replace(/^\s+|\s+$/g, '') ;

		

		if(trimmed=='')

		{

			eval("document.getElementById('"+id+"').value='"+check+"'");



		}	

		

	}



function validateFormEmployment()
{
	if($('#first_name').val()=='')
	{
		alert('Name field can not be empty.');
		$('#first_name').focus();
		return false;
	}	
	if($('#day_phone').val()=='')
	{
		alert('Day Phone field can not be empty.');
		$('#day_phone').focus();
		return false;
	}	
	if($('#address').val()=='')
	{
		alert('Address field can not be empty.');
		$('#address').focus();
		return false;
	}	

	if($('#city').val()=='')
	{
		alert('City field can not be empty.');
		$('#city').focus();
		return false;
	}	
	if($('#state').val()=='')
	{
		alert('State field can not be empty.');
		$('#state').focus();
		return false;
	}	
	if($('#zip').val()=='')
	{
		alert('Zip field can not be empty.');
		$('#zip').focus();
		return false;
	}	
	if(isNaN($('#zip').val()))
	{
		alert('Zip field should have a numeric value.');
		$('#zip').focus();
		return false;
	}	

	if(!echeck($('#email').val()))
	{
		$('#email').focus();
		return false;
	}
	if($('#desired_position').val()=='')
	{
		alert('Please let us know what is your desired position');
		$('#desired_position').focus();
		return false;
	}
	
	if($('#certification').val()=='')
	{
		alert('Plese let us know about your certifications');
		$('#certification').focus();
		return false;
	}	
	if($('#desired_income').val()=='')
	{
		alert('Please let us know what is your desired income');
		$('#desired_income').focus();
		return false;
	}	
	if(isNaN($('#desired_income').val()))
	{
		alert('Desired income should have a numeric value.');
		$('#desired_income').focus();
		return false;
	}	
	if($('#captchastring').val()=='')
	{
		alert('Please enter the sucurity text.');
		$('#captchastring').focus();
		return false;
	}	
	
	
	return true;
}





