function autotab(original,destination){
if (original.getAttribute&&original.value.length==original.getAttribute("maxlength"))
destination.focus()
}

function submitForm(){
var frm = document.onlineapplication;
	if(frm.units.value == ""){
	alert("Number Of units is required to process this form");
	frm.units.focus();
	return ;
	}
	if(frm.city.value == ""){
	alert("City is required to process this form");
	frm.city.focus();
	return ;
	}
	if(frm.name.value == ""){
	alert("name is required to process this form");
	frm.name.focus();
	return ;
	}
	if(frm.email.value == ""){
	alert("email is required to process this form");
	frm.email.focus();
	return ;
	}
	if(frm.email.value != ""){
		if(!checkMailAddress(frm.email.value)){
		alert("Please enter valid email");
		frm.email.value = "";
		frm.email.focus();
		return ;
		}
	}
/*	if(frm.loanamount.value != ""){
	var value =frm.loanamount.value;
	amount = value.split("$");
	if(!amount[1]) value1 = parseInt(value) -250000;
	else value1 = parseInt(amount[1]) -250000;
	if(value1 < 0){
		alert("Loan amount should be greater than $250,000");
		frm.loanamount.value = "";
		frm.loanamount.focus();
		return ;
		}
	}
*/
frm.submit();
}
