// JavaScript Document
function fom_validate()
{
	var letters=/^(0?[1-9]|[12][0-9]|3[01])[\/\-](0?[1-9]|1[012])[\/\-]\d{4}$/;
	if(document.getElementById('lob').value=='')
	{
		alert('Please Enter Entry Date');  
		document.getElementById('lob').focus();  
		return false; 
	}
	else if(letters.test(document.getElementById('lob').value)==false)  
	{
		alert('Entry Date must be in the given Format');  
		document.getElementById('lob').focus();  
		return false;  
	}
	
	var letters=/^\d+(?:\.\d+)?$/;
	if(document.getElementById('sil_wght').value=='')
	{
		alert('Please Enter Silver Weight');  
		document.getElementById('sil_wght').focus();  
		return false; 
	}
	else if(letters.test(document.getElementById('sil_wght').value)==false)  
	{
		alert('Silver Weight Should have only Decimal');  
		document.getElementById('sil_wght').focus();  
		return false;  
	}
	if(document.getElementById('pur_wght').value=='')
	{
		alert('Please Enter Pure Weight');  
		document.getElementById('pur_wght').focus();  
		return false; 
	}
	else if(letters.test(document.getElementById('pur_wght').value)==false)  
	{
		alert('Pure Weight Should have only Decimal');  
		document.getElementById('pur_wght').focus();  
		return false;  
	}
	
	
	 var where_to= confirm("Do you really want to Submit the Data?");
	 if (where_to== true)
	 {
		 document.checklist.submit();			 
	   
	 }
	 else
	 {
		 return false;
	  
	 }		
}

function form_rest() //this is for reset the forms
{
	var where_to= confirm("Do you really want to Reset the Data?");
	if (where_to== true)
	{
		window.location.reload();
	}
	else
	{
	 	return false;	
	}
}

function foc(ids)
{
	document.getElementById(ids).style.border="2px solid #0099FF";
	
}

function stnon(ids)
{
	document.getElementById(ids).style.border="thin solid #CCCCCC";
}
