function checkOther(){
	if (document.DSLForm.Telco.value != 'Other'){
		document.DSLForm.otherNetwork.disabled = true;
		document.DSLForm.otherNetwork.value = document.DSLForm.Telco.value
		}
	else {
		document.DSLForm.otherNetwork.disabled = false;
		document.DSLForm.otherNetwork.value = 'Please specify....';
		document.DSLForm.otherNetwork.focus();
		document.DSLForm.otherNetwork.select();
		}
}

function checkTelco(){
	if (document.DSLForm.otherNetwork.value.length >= 1){
		document.DSLForm.Telco.value = 'Other';
		}
	else {document.DSLForm.Telco.value = ''}
	}


function clearBox(n){
	document.getElementById(n).value = '';
}


function selectBox(n){
	document.getElementById(n).select();
}



var switchBoxActive = new Array
switchBoxActive[0] = false
switchBoxActive[1] = false

function toNextBox(elmnt,content)
{
if (content.length==elmnt.maxLength)
	{
	next=elmnt.tabIndex;
	
	if (next<document.DSLForm.elements.length && switchBoxActive[i] == false)
		{
		document.DSLForm.elements[next].focus();
		document.DSLForm.elements[next].select();
		}
	switchBoxActive[i] = true;
	}
	else 
	{
	switchBoxActive[i] = false;
	}
}



function submitDSLForm()
	{
var form = document.DSLForm;

if (form.FirstName.value.length == 0)
	{
	alert('Please enter your first name');
	form.FirstName.focus();
	return false;
	}
else if (form.LastName.value.length == 0)
	{
	alert('Please enter your last name');
	form.LastName.focus();
	return false;
	}
else if (form.address.value.length == 0)
	{
	alert('Please enter your street address');
	form.address.focus();
	return false;
	}
else if (form.city.value.length == 0)
	{
	alert('Please enter your city');
	form.city.focus();
	return false;
	}
else if (form.state.value.length == 0)
	{
	alert('Please enter your state');
	form.state.focus();
	return false;
	}
else if (form.zip.value.length == 0)
	{
	alert('Please enter your zip code');
	form.zip.focus();
	return false;
	}
else if (form.phoneArea.value.length == 0)
	{
	alert('Please enter a phone number where the DSL will be installed');
	form.phoneArea.focus();
	return false;
	}
else if (form.email.value.length == 0)
	{
	alert('Please enter an e-mail address where your qualifications results will be sent.');
	form.email.focus();
	return false;
	}
else
{
var phoneval
var phoneval1
var phoneval2

var zipval
zipval=form.zip.value
        for(i = 0; i < zipval.length; i++)
        {
                if((!(zipval.charAt(i) >= "0") || !(zipval.charAt(i) <= "9")) && !((zipval.charAt(i)=="(") || (zipval.charAt(i)==")") || (zipval.charAt(i)=="-")))
                {
				alert("The zip code may contain numbers only.  Please Retry!")
				form.zip.focus()
				form.zip.select()
				return false;
                }
        }




phoneval=form.phoneArea.value

        for(i = 0; i < phoneval.length; i++)
        {
                if((!(phoneval.charAt(i) >= "0") || !(phoneval.charAt(i) <= "9")) && !((phoneval.charAt(i)=="(") || (phoneval.charAt(i)==")") || (phoneval.charAt(i)=="-")))
                {
				alert("The Area Code may contain numbers only.  Please Retry!")
				form.phoneArea.focus()
				form.phoneArea.value =''
				return false;
                }
        }
	   if(phoneval.length<3)
	   {
				alert("The Area Code you entered is too short. Please Retry!")
				form.phoneArea.focus()
				form.phoneArea.value = ''
				return false;
	   }
	   
	   
	   
	   
phoneval1=form.phonePre.value
        for(i = 0; i < phoneval1.length; i++)
        {
                if((!(phoneval1.charAt(i) >= "0") || !(phoneval1.charAt(i) <= "9")) && !((phoneval1.charAt(i)=="(") || (phoneval1.charAt(i)==")") || (phoneval1.charAt(i)=="-")))
                {
				alert("The Phone Number prefix may contain numbers only.  Please Retry!")
				form.phonePre.focus()
				form.phonePre.value = ''
				return false;
                }
        }
	   if(phoneval1.length<3)
	   {
				alert("The Phone Number prefix you entered is too short. Please Retry!")
				form.phonePre.focus()
				form.phonePre.value = ''
				return false;
	   }
	   
	   
	   
phoneval2=form.phoneLast.value
        for(i = 0; i < phoneval2.length; i++)
        {
                if((!(phoneval2.charAt(i) >= "0") || !(phoneval2.charAt(i) <= "9")) && !((phoneval2.charAt(i)=="(") || (phoneval2.charAt(i)==")") || (phoneval2.charAt(i)=="-")))
                {
				alert("The last 4 digits of the Phone Number may contain numbers only.")
				form.phoneLast.focus()
				form.phoneLast.value = ''
				return false;
                }
        }
	   if(phoneval2.length<4)
	   {
				alert("The last 4 digits of the Phone Number you entered is too short.")
				form.phoneLast.focus()
				form.phoneLast.value = ''
				return false;
	   }
	   
	emat = form.email.value.indexOf("@")
	emcom = form.email.value.indexOf(".")
	if (emat == -1 || emcom == -1)
		{
		alert("Please enter a valid e-mail address, your results will be e-mailed to you.");
		form.email.focus()
		form.email.select()
		return false;
		}
	{
	return true;
	}
}

}
