	function ValidateEmail(Email)
	{
		var atCharPresent = false;
		var dotPresent = false;
		for ( var Idx = 0; Idx <= Email.length; Idx++ )
		{
			if ( Email.charAt ( Idx ) == '@' )
				atCharPresent = true;
			if ( Email.charAt ( Idx ) == '.' )
				dotPresent = true;
		}
		if ( !atCharPresent || !dotPresent )
			return false;
		return true;
	}
function Validate()
	{
		if(document.applynow.position.value=="")
		{
			alert("Please Select Position");
			document.applynow.position.focus();
			return false;
		}
		if(document.applynow.txt_name.value=="")
		{
			alert("Please Enter Your Name");
			document.applynow.txt_name.focus();
			return false;
		}
		else
		{
		
			splitstring = document.applynow.txt_name.value;
		
			for(i = 0; i < splitstring.length; i++)
			{
				if(splitstring.charAt ( 0 ) == ' ')
				{
					alert( "Please Enter Your Name" );
					document.applynow.txt_name.focus( );
					return (false);
				
				}
			}
				
		}


		if(document.applynow.txt_Age.value=="")
		{
			alert("Please Enter Your Age");
			document.applynow.txt_Age.focus();
			return false;
		}
		else
		{
		
			splitstring = document.applynow.txt_Age.value;
		
			for(i = 0; i < splitstring.length; i++)
			{
				if(splitstring.charAt ( 0 ) == ' ')
				{
					alert( "Please Enter Your Age" );
					document.applynow.txt_Age.focus( );
					return (false);
				
				}
			}
				
		}
		if(document.applynow.txt_Residential_Contact_No.value=="")
		{
			alert("Please Enter Your Residential Contact No");
			document.applynow.txt_Residential_Contact_No.focus( );
			return false;
		}
		else
		{
		
			splitstring = document.applynow.txt_Residential_Contact_No.value;
		
			for(i = 0; i < splitstring.length; i++)
			{
				if(splitstring.charAt ( 0 ) == ' ')
				{
					alert( "Please Enter Your Residential Contact No" );
					document.applynow.txt_Residential_Contact_No.focus( );
					return (false);
				
				}
			}
				
		}

		/*if(document.applynow.txt_Mobile_No.value=="")
		{
			alert("Please Enter Mobile Number");
			document.applynow.txt_Mobile_No.focus();
			return false;
		}
		else
		{
		
			splitstring = document.applynow.txt_Mobile_No.value;
		
			for(i = 0; i < splitstring.length; i++)
			{
				if(splitstring.charAt ( 0 ) == ' ')
				{
					alert( "Please Enter Mobile Number" );
					document.applynow.txt_Mobile_No.focus( );
					return (false);
				
				}
			}
				
		}*/

		if(!ValidateEmail(document.applynow.txt_email.value))
		{
			alert("Enter Valid E-Mail");
			document.applynow.txt_email.focus();			
			return false;
		}
	
		if(document.applynow.txt_address.value=="")
		{
			alert("Please Enter Current Address")
			document.applynow.txt_address.focus();
			return false;
		}
		else
		{
		
			splitstring = document.applynow.txt_address.value;
		
			for(i = 0; i < splitstring.length; i++)
			{
				if(splitstring.charAt ( 0 ) == ' ')
				{
					alert( "Please Enter Current Address" );
					document.applynow.txt_address.focus( );
					return (false);
				
				}
			}
				
		}

		if(document.applynow.txt_Highest_Education_Level.value=="")
		{
			alert("Please Enter your Education Detail")
			document.applynow.txt_Highest_Education_Level.focus();
			return false;
		}
		else
		{
		
			splitstring = document.applynow.txt_Highest_Education_Level.value;
		
			for(i = 0; i < splitstring.length; i++)
			{
				if(splitstring.charAt ( 0 ) == ' ')
				{
					alert( "Please Enter your Education Detail" );
					document.applynow.txt_Highest_Education_Level.focus( );
					return (false);
				
				}
			}
				
		}

		if(document.applynow.txt_Previous_Job_Profile.value=="")
		{
			alert("Please Enter Current Job Profile")
			document.applynow.txt_Previous_Job_Profile.focus();
			return false;
		}
		else
		{
		
			splitstring = document.applynow.txt_Previous_Job_Profile.value;
		
			for(i = 0; i < splitstring.length; i++)
			{
				if(splitstring.charAt ( 0 ) == ' ')
				{
					alert( "Please Enter Current Job Profile" );
					document.applynow.txt_Previous_Job_Profile.focus( );
					return (false);
				
				}
			}
				
		}


//if(document.applynow.txt_Current_Employer_Name.value=="")
	//	{
	//		alert("Please Enter Current Employer Detail")
	//		document.applynow.txt_Current_Employer_Name.focus();
	//		return false;
	//	}

if(document.applynow.txt_Upload_Resume.value=="")
		{
			alert("Please Upload Your Resume")
			document.applynow.txt_Upload_Resume.focus();
			return false;
		}
else
{
		var fileName=document.applynow.txt_Upload_Resume.value;
		var ext;
		ext=fileName.substr(fileName.lastIndexOf('.')).toLowerCase();
		
		if((ext=='.txt') || (ext=='.doc') || (ext=='.docx') || (ext=='.pdf'))
		{
		}
		else
		{
			alert('Please Choose only (doc,.docx,.txt,.pdf) files');
			return false;
		}
	}


		return true;
	}
