function calc_tot()
{
	var pending_previous=parseInt(document.ria_petitions.pending_previous.value);
	var num_app_received=parseInt(document.ria_petitions.num_app_received.value);
	var num_app_disposed=parseInt(document.ria_petitions.num_app_disposed.value);
	
	document.getElementById('total').innerHTML=pending_previous+num_app_received;
	document.getElementById('pending_current').innerHTML=pending_previous+num_app_received-num_app_disposed;
}
function valid_int(id)
{
	var val=id.value;
	if(isNaN(val))
	{
		alert("Please enter numbers");
		id.value="0";
	}
	else if(val.indexOf(".")!=-1)
	{
		alert("Please enter integer values only, No \'.\' s");
		id.value="0";
	}
	else if(val.indexOf("-")!=-1)
	{
		alert("Please enter +ve values only, No \'-\' s");
		id.value="0";
	}


}

function valid_float(id)
{
	var val=id.value;
	if(isNaN(val))
	{
		alert("Please enter an numbers only");
		id.value="0.0";
	}
	else if(val.indexOf("-")!=-1)
	{
		alert("Please enter +ve values only, No \'-\' s");
		id.value="0.0";
	}
}

function insert()
{
	var confirmed=confirm("Do you want to submit data!");

	if(confirmed)
		return true;
	else
		return false;
}
