
function chknumeric()
{
	if(event.keyCode==43 || event.keyCode==45|| event.keyCode==46 || event.keyCode==13){
	    return true;}
	if (event.keyCode < 48 || event.keyCode > 57)
	{
		if (event.keyCode != 8)
		{
			alert("Please specify only numeric value.")
			event.keyCode=0;
			document.company_info.txtTelephone.focus();

		}
	}
}  
function chknumericfax()
{
	if(event.keyCode==43 || event.keyCode==45|| event.keyCode==46 || event.keyCode==13){
	    return true;}
	if (event.keyCode < 48 || event.keyCode > 57)
	{
		if (event.keyCode != 8)
		{
			alert("Please specify only numeric value.")
			event.keyCode=0;
			document.company_info.txtFax.focus();

		}
	}
} 		
function isUrlValid(url) 
{
		if (url.value == '' || url.indexOf('.') == 0 || url.indexOf('.') == -1 || url.indexOf('.') == url.length - 1 || url.indexOf(',') >= 0) 
		{
	    	return false;
		} else 
		{
			return true;
		}
}

function isEmailValid(sEmail) 
{
		if (sEmail.value == '' || sEmail.indexOf('.') == 0 || sEmail.indexOf('.') == -1 || sEmail.indexOf('@') == 0 || sEmail.indexOf('@') == -1 || sEmail.indexOf('.') == sEmail.length - 1 || sEmail.indexOf(',') >= 0) 
		{
	    	return false;
		} else 
		{
			return true;
		}
}


		
		
function validate()
{
	if(document.company_info.txtName.value=="")
	{
		alert("Please Enter Name");
		document.company_info.txtName.focus();
		return false;
	}
	if(!isUrlValid(document.company_info.txtUrl.value))
	{
		alert("Please Enter Valid Url");
		document.company_info.txtUrl.focus();
		return false;
	}
	if(!isEmailValid(document.company_info.txtEmail.value))
	{
		alert("Please Enter Valid E-mail id");
		document.company_info.txtEmail.focus();
		return false;
	}
}
