// JavaScript Document

function registervalidation() {
	var err = "Following error(s) occured in your Submission, \n\n";
	
	if(document.form1.fname.value == '') { 
		   err += "Fill the First name \n";
	}
		if(document.form1.company.value == '') { 
		   err += "Fill the First name \n";
	}
	
	if(document.form1.email.value == '') { 
		   err += "Fill Email \n";
	} else if (!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(document.form1.email.value))) {
		 err += "Email ID not valid \n";
	} 
	if(document.form1.mobile.value == '') { 
		   err += "Fill the Mobile number \n";
	}
	if(document.form1.address.value == '') { 
		   err += "Fill the Address \n";
	}
	
	if(document.form1.state.value == '0') { 
		   err += "Fill the State\n";
	}
	if(document.form1.city.value == '0') { 
		   err += "Fill the City\n";
	}
	
	if(document.form1.pin_code.value == '') { 
	   err += "Fill the Pin code\n";
	}
	if(document.form1.description.value == '') { 
		   err += "Fill the Comments\n";
	}
	
	
	if(err !="Following error(s) occured in your Submission, \n\n") {
		alert(err);
		return false;
	} 
	return true;
}

function RestrictInt(val)

{
	 if(isNaN(val)){
		val = val.substring(0, val.length-1);
		document.form1.mobile.value = val;
		return false;
	 }
	return true;
}

function RestrictIntq(val)

{
	 if(isNaN(val)){
		val = val.substring(0, val.length-1);
		document.form1.fax.value = val;
		return false;
	 }
	return true;
}

function RestrictInta(val)

{
	 if(isNaN(val)){
		val = val.substring(0, val.length-1);
		document.form1.pin_code.value = val;
		return false;
	 }
	return true;
}
