function checkLen(x,y) {
	var form = document.getElementById("localaccess.LocalAccessForm");
	
	if (y.length == x.maxLength) {
		var _v_next = x.tabIndex;
		_v_next = _v_next - 6 + 2; // cause tabIndex stats at 7 in the localaccess form we substract 1 and have hidden element so add 1
			form.elements[_v_next].focus();
	}
	
}

function submitLocalAccess() {
    var laForm = document.forms["localaccess.LocalAccessForm"];
    if (laForm) {
        if (!laForm.npa || !laForm.npa.value || laForm.npa.value.length != 3 || isNaN(laForm.npa.value) 
            || !laForm.nxx || !laForm.nxx.value || laForm.nxx.value.length != 3 || isNaN(laForm.nxx.value)
            || !laForm.number || !laForm.number.value || laForm.number.value.length != 4 || isNaN(laForm.number.value)) {
            
            alert("Please enter a valid phone number!");
            return false;
        }
        laForm.action = laForm.action + "#localaccess";
        return true;
    }
}
