function getState(con_id,updatingID){

	$.post("/js_register_ajax.html", { "con_id": con_id , ajaxOp: 'getState' },
    function(data){
     $('#'+updatingID).html(data);
   });
	 $('#loc_select').html('<option value="-1">Select</option>');
}
function getLocation(st_id,updatingID){

	$.post("/js_register_ajax.html", { "st_id": st_id , ajaxOp: 'getLocation' },
    function(data){
     $('#'+updatingID).html(data);
   });

}
function getLocationWithoutOther(st_id,updatingID){

	$.post("/js_register_ajax.html", { "st_id": st_id , ajaxOp: 'getLocationWithoutOther' },
    function(data){
     $('#'+updatingID).html(data);
   });

}
function getSpecialisation(qual_id,updatingID,grad_short_name,newrow){

	newqualdiv = grad_short_name+"_rgd_qual_"+newrow;
	newspecdiv = grad_short_name+"_rgd_spec_"+newrow;
	$("#"+newqualdiv).val('');
	$("#"+newspecdiv).val('');
	if(qual_id==0){
	$("#"+newqualdiv).removeClass('hideloc').addClass('showloc');

  	$("#"+newqualdiv).focus();
	}
	else{
	$("#"+newqualdiv).removeClass('showloc').addClass('hideloc');
	$("#"+newspecdiv).removeClass('showloc').addClass('hideloc');
	}

	$.post("/js_register_ajax.html", { "qual_id": qual_id ,ajaxOp: 'getSpecialisation' },
    function(data){
     $('#'+updatingID).html(data);

   });
	checkValidation(grad_short_name,newrow);
}
function getnewSpec(spec_id,grad_short_name,newrow){

	newspecdiv = grad_short_name+"_rgd_spec_"+newrow;
	$("#"+newspecdiv).val('');

	if(spec_id==0){
	$("#"+newspecdiv).removeClass('hideloc').addClass('showloc');

  	$("#"+newspecdiv).focus();
	}
	else{
	$("#"+newspecdiv).removeClass('showloc').addClass('hideloc');
	}
	checkValidation(grad_short_name,newrow);
}

function getnewUni(uni_id,grad_short_name,newrow){

	newunidiv = grad_short_name+"_rgd_uni_"+newrow;
	$("#"+newunidiv).val('');

	if(uni_id==0){
	$("#"+newunidiv).removeClass('hideloc').addClass('showloc');

  	$("#"+newunidiv).focus();
	}
	else{
	$("#"+newunidiv).removeClass('showloc').addClass('hideloc');
	}
	checkValidation(grad_short_name,newrow);
}
/*
function getnewBoard(seeb_id,edu_class){

	neweduclassdiv = edu_class+"_seeb_name";
	neweduclassdivtd = edu_class+"_seeb_name_td";
	$("#"+neweduclassdiv).val('');

	if(seeb_id==0){
	$("#"+neweduclassdiv).removeClass('hideloc').addClass('showloc');
	$("#"+neweduclassdivtd).removeClass('hideloc').addClass('showloc');

  	$("#"+neweduclassdiv).focus();
	}
	else{
	$("#"+neweduclassdiv).removeClass('showloc').addClass('hideloc');
	$("#"+neweduclassdivtd).removeClass('showloc').addClass('hideloc');
	}

}


function getBoard(con_id,updatingID){

	$.post("/js_register_ajax.html", { "con_id": con_id ,ajaxOp: 'getBoard' },
    function(data){
     $('#'+updatingID).html(data);
   });

}
*/

function checkSecondaryValidation(edu_class){


		var rse_board = $("#"+edu_class+"_rse_board").val();
		var rse_mark = $("#"+edu_class+"_rse_mark").val();
		var rse_passout_year = $("#"+edu_class+"_rse_passout_year").val();
		var seem_id = $("#"+edu_class+"_seem_id").val();


		if(rse_mark != '' || rse_board !='' || rse_passout_year >0 || seem_id > 0){
		
				$("#"+edu_class+"_rse_board").rules("add", {
					validateSelectBlank: true
				});

				$("#"+edu_class+"_rse_mark").rules("add", {
					required: true
				});
		}
		else{

			$("#"+edu_class+"_rse_board").rules("remove");
			$("#"+edu_class+"_rse_mark").rules("remove");
		}


}

function getUniversity(con_id,updatingID){

	$.post("/js_register_ajax.html", { "con_id": con_id ,ajaxOp: 'getUniversity' },
    function(data){
     $('#'+updatingID).html(data);
   });

}
function loadCovData(cov_id)
{
$.post("/js_register_ajax.html", { "cov_id": cov_id ,ajaxOp: 'loadCovData' },
function(data){
     $('#cov_content').html(data);
   });
} 

$().ready(function() {
	jQuery.validator.addMethod("NameValidate", function(value, element) { 
		return this.optional(element) ||  /^[a-z A-Z]+$/i.test(value);
	}, "Please Enter Valid Data.");

	jQuery.validator.addMethod("NameDotValidate", function(value, element) { 
		return this.optional(element) ||  /^[a-z A-Z.]+$/i.test(value);
	}, "Please Enter Valid Data.");
        jQuery.validator.addMethod("EmailValidate", function(value, element) {
		return this.optional(element) ||  /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/.test(value);
	}, "Please Enter Valid Data.");
jQuery.validator.addMethod("validateSelectBlank", function(value, element) { 
  	if(value == ''){
	 return false;
	}
	else return true;
}, "This field is required.");
});


