/********************************** Validation *******************************************************/
function gap_validation()
{
	
    var start = document.getElementById("start").value;
	if(start=='')
	{
		document.getElementById("gap_name_validation_div").innerHTML="* This field is Required.";
		document.getElementById("start").focus();
		return false;
	}
	
	 var end = document.getElementById("end").value;
	if(end=='')
	{
		//alert();
		document.getElementById("gap_particulas_validation_div").innerHTML="* This field is Required.";
		document.getElementById("end").focus();
		return false;
	}
	
	
	
}

function consumable_validation_clear(str)
{
	if(str!='')
	{
		document.getElementById("gap_name_validation_div").innerHTML="";
	}
	
	if(str!='')
	{
		document.getElementById("gap_particulas_validation_div").innerHTML="";
	}
	
	
	
	
}

/********************************** Mainlist Add *******************************************************/
function gap_mainlist_add(start,end,description,edit_id,action)
{
	
if((start!='')&&(end!=''))
 {
  jQuery.ajax({
		type: "POST",
		url: "gapinterval_entry_db.php",
		data: "start="+start+"&end="+end+"&description="+description+"&edit_id="+edit_id+"&action="+action,
		success: function(msg){jQuery("#gap_list_div").html(msg);	
		alert(msg);
		window.close();
		window.opener.location.reload(true);
 }
		});
 }
else
{
    gap_validation();
}
}

/********************************** Mainlist Delete *******************************************************/
function gap_delete(id)
{
	
	if(confirm('Are You Sure! You Want To Delete?'))
	{
		jQuery.ajax({
		type: "POST",
		url: "master_entry/gap_interval_creation/gapinterval_entry_db.php",
		data: "id="+id+"&action=delete",
		success: function(msg){
			jQuery("#gap_list_div").html(msg);
		
				window.location.reload(true);

	}
	});
    }
}

    



