/********************************** Validation *******************************************************/
function job_type_validation()
{
    var job_type = document.getElementById("job_type_name").value;
	if(job_type=='')
	{
		document.getElementById("job_type_validation_div").innerHTML="* This field is Required.";
		document.getElementById("job_type_name").focus();
		return false;
	}
}

function job_type_clear_validation(str)
{
	if(str!='')
	{
		document.getElementById("job_type_validation_div").innerHTML="";
	}
}

/********************************** Mainlist Add *******************************************************/
function job_type_mainlist_add(job_type,job_type_status,printer_production_status,fusing_production_status,edit_id,action)
{

if((job_type!=''))
 {
  jQuery.ajax({
		type: "POST",
		url: "job_type_entry_db.php",
		data: "job_type="+job_type+"&job_type_status="+job_type_status+"&printer_production_status="+printer_production_status+"&fusing_production_status="+fusing_production_status+"&edit_id="+edit_id+"&action="+action,
		success: function(msg){jQuery("#job_type_list_div").html(msg);	
		alert(msg);
		window.close();
		window.opener.location.reload(true);
		
 }
		});
 }
else
{
    job_type_validation();
}
}

/********************************** Mainlist Delete *******************************************************/
function job_type_delete_row(id)
{
	if(confirm('Are You Sure! You Want To Delete?'))
	{
		jQuery.ajax({
		type: "POST",
		url: "job_type_creation/job_type_entry_db.php",
		data: "id="+id+"&action=delete_job_type",
		success: function(msg){jQuery("#job_type_list_div").html(msg);
	}
	});
    }
}


