function remove_academic_form(){
	if( $('.academic_part > h6').size() > 1 ){
		$('.academic_part > h6:last').remove();
		$('.academic_part > table:last').remove();
	}
}

function remove_professional_form(){
	if( $('.professional_part > h6').size() > 1 ){
		$('.professional_part > h6:last').remove();
		$('.professional_part > table:last').remove();
	}
}

function application_submit()
{
	if ($('#txtName').val() == '') {
		alert('Name is a required field');
		$('#txtName').focus();
		return false;
	}
	if ( $('#birth_day').val() == 0 || $('#birth_month').val() == 0 || $('#birth_year').val() == 0 ) {
		alert('Select Your Birth - day, month, year');
		$('#birth_day').focus();
		return false;
	}
	if ($('#gender').val() == 0) {
		alert('Gender is a required field');
		$('#gender').focus();
		return false;
	}
	if ($('#marital_status').val() == 0) {
		alert('Marital Status is a required field');
		$('#marital_status').focus();
		return false;
	}
	
	if ($('#txtNationality').val() == '') {
		alert('Nationality is a required field');
		$('#txtNationality').focus();
		return false;
	}
	if ($('#txtReligion').val() == '') {
		alert('Religion is a required field');
		$('#txtReligion').focus();
		return false;
	}
	if ($('#txtPresentAdd').val() == '') {
		alert('Enter your Present Address');
		$('#txtPresentAdd').focus();
		return false;
	}
	if ($('#txtPermanentAdd').val() == '') {
		alert('Enter your Permanent Address');
		$('#txtPermanentAdd').focus();
		return false;
	}
	if ( $('#cur_Location').val() == 0) {
		alert('Select Your current location');
		$('#cur_Location').focus();
		return false;
	}
	if ($('#txtHomePhone').val() == '' && $('#txtMobile').val() == '' && $('#txtOfficePhone').val() == '') {
		alert('Enter at least one Contact phone number');
		$('#txtHomePhone').focus();
		return false;
	}
	if ($('#txtEmail').val() == '') {
		alert('Email is a required field');
		$('#txtEmail').focus();
		return false;
	}
	if (!checkEmail($('#txtEmail').val())) {
		alert('Email is not valid, Enter a valid email address');
		$('#txtEmail').focus();
		return false;
	}
	if ($('#txtAlterEmail').val() != '' && !checkEmail($('#txtAlterEmail').val())) {
		alert('Email is not valid, Enter a valid email address');
		$('#txtAlterEmail').focus();
		return false;
	}
	if ($('#txtObjective').val() == '') {
		alert('Objective is a required field');
		$('#txtObjective').focus();
		return false;
	}
	if ($('#txtExperience').val() == '') {
		alert('Experience is a required field');
		$('#txtExperience').focus();
		return false;
	}
	if ($('#txtCareer').val() == '') {
		alert('Enter a summary of your career');
		$('#txtCareer').focus();
		return false;
	}
	if ($('#txtQualification').val() == '') {
		alert('Special Qualification is a required field');
		$('#txtQualification').focus();
		return false;
	}
	if ($('.aca_level').val() == 0) {
		alert('Select a level of your education');
		$('.aca_level').focus();
		return false;
	}
	if ($('.txtQualification_2').val() == '') {
		alert('Enter a special qualification');
		$('.txtQualification_2').focus();
		return false;
	}
	if ($('.aca_major_group').val() == 0) {
		alert('Select a Concentration/Major group');
		$('.aca_major_group').focus();
		return false;
	}
	if ($('.aca_Institute').val() == 0) {
		alert('Select an Institution');
		$('.aca_Institute').focus();
		return false;
	}
	if ($('.aca_result').val() == 0) {
		alert('Select a Result');
		$('.aca_result').focus();
		return false;
	}
	if ($('.txtMarks').val() == '') {
		alert('Enter your obtained marks(%)');
		$('.txtMarks').focus();
		return false;
	}
	if ($('.aca_pass_year').val() == 0) {
		alert('Select year of passing');
		$('.aca_pass_year').focus();
		return false;
	}
	if ($('.txtDuration').val() == '') {
		alert('Enter the duration of the study');
		$('.txtDuration').focus();
		return false;
	}
	if ($('.txtOrganisation_2').val() != '') {
		if ($('.txtOrganisationType').val() == '') {
			alert('Enter the Type of the Organization');
			$('.txtOrganisationType').focus();
			return false;
		}
		if ($('.txtLocation').val() == '') {
			alert('Enter the location of the organization');
			$('.txtLocation').focus();
			return false;
		}
		if ($('.txtPosition').val() == '') {
			alert('Enter your position in that organization');
			$('.txtPosition').focus();
			return false;
		}
		if ($('.pro_from_day').val() == 0 || $('.pro_from_month').val() == 0 || $('.pro_from_year').val() == 0) {
			alert('Select Start date of this job');
			$('.aca_pass_year').focus();
			return false;
		}
		if ($('.pro_to_day').val() == 0 || $('.pro_to_month').val() == 0 || $('.pro_to_year').val() == 0) {
			alert('Select End date of this job');
			$('.aca_pass_year').focus();
			return false;
		}
	}
	return true;
	
}
function checkEmail(emial){
	var str=emial;
	var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;
	if (filter.test(str))
	return true;
	else
	return false;
}
