function valid(form)
{
var invalidchar1= /\D/g;



 // to check year of establishment
 
 
str60= document.form.year.value;
len5=str60.length;
flag=true;
if (str60.substring(0,1)==" ")
 {
 alert("First character can't be a space");
  document.form.year.value="";
  document.form.year.focus();    
 return false;// used to check empty field busunits
 }
if(len5==0 && flag)
{
	//alert("Please enter the Year Of Establishment");
	// document.form.year.value="";
	// document.form.year.focus();
	//flag=false;
	//return false;
}
 else if( document.form.year.value.search(invalidchar1)>=0)
{
	flag=false;
	alert("Year Of Establishment should contain only Numbers");
	 document.form.year.value="";
	 document.form.year.focus();
	return false;
}



document.form.method="post";
document.form.action="../architect/insertprofile.asp?valid=fullprofile";
document.form.submit();
}

