function BroadBandCheckSizeNPA(FormName)
{
    if ( FormName.DSLPhoneAreaCode.value.length == 3 )
    {
        document.DSLForm.DSLPhoneFirst.focus();
    }
}
function BroadBandCheckSizeNXX(FormName)
{
    if ( FormName.DSLPhoneFirst.value.length == 3 ) 
    {
        document.DSLForm.DSLPhoneLast.focus();
    }
}
function BroadBandCheckSizeSuffix(FormName)
{
}
function BroadBandPageValidate(DSLForm) 
{
    var strMsg = "";
    
    if ((DSLForm.Address.value == "") && (DSLForm.ZipCode.value == "")) {
    
    if  (isNaN(DSLForm.DSLPhoneAreaCode.value))
    {
        strMsg = strMsg + "\n\n" + "- The area code must be a number.";
    }
    
    if  (isNaN(DSLForm.DSLPhoneFirst.value))
    {
        strMsg = strMsg + "\n\n" + "- The 2nd phone value must be a number.";
    }
    
    if  (isNaN(DSLForm.DSLPhoneLast.value))
    {
        strMsg = strMsg + "\n\n" + "- The 3rd phone value must be a number.";
    }
    
    if (DSLForm.DSLPhoneAreaCode.value.length < 3)
    {
        strMsg = strMsg + "\n\n" + "- A 3 digit Area Code is required.";
    }
    
    if (DSLForm.DSLPhoneFirst.value.length < 3)  
    {
        strMsg = strMsg + "\n\n" + "- The 2nd phone value must be 3 digits long.";
    }
    
    if (DSLForm.DSLPhoneLast.value.length < 4)  
    {
        strMsg = strMsg + "\n\n" + "- The 3rd phone value must be 4 digits long.";
    }
    
    } else {
    
    	if ((DSLForm.DSLPhoneAreaCode.value == "") && (DSLForm.DSLPhoneFirst.value == "") && (DSLForm.DSLPhoneLast.value == "")) {
    	
    		if (DSLForm.Address.value == "")
    		{
    			strMsg = strMsg + "\n\n" + "- The Address line is required.";
    		}
    	
    		if (DSLForm.ZipCode.value == "")
    		{
    			strMsg = strMsg + "\n\n" + "- The Zip Code is required.";
    		}
    	
    	}
    
    }
    
    if (strMsg != "")
    {
        alert(strMsg);
        return false;
    } 
    else 
    {
    
    	if ((DSLForm.DSLPhoneAreaCode.value != "") && (DSLForm.DSLPhoneFirst.value != "") && (DSLForm.DSLPhoneLast.value != ""))
    	{
        // preserve existing window's target name to return to
        var redirectLocation = 'http://direct.digitallanding.com/dispatch.aspx?source=hispeedsource'
        + '&campaign=hispeedsource1'
        + '&promoid=5003034'
        + '&email=' + document.DSLForm.Email.value
        + '&phone=' + document.DSLForm.DSLPhoneAreaCode.value + document.DSLForm.DSLPhoneFirst.value + document.DSLForm.DSLPhoneLast.value;
        } else {
        var redirectLocation = 'http://direct.digitallanding.com/dispatch.aspx?source=hispeedsource'
        + '&campaign=hispeedsource1'
        + '&promoid=5003034'
        + '&address=' + document.DSLForm.Address.value
        + '&zip=' + document.DSLForm.ZipCode.value;
        
        }
		var AccellerURI = redirectLocation;

        // BroadBandWindowCreation(AccellerURI,'hispeedsource_acceller');
        BroadBandWindowCreation(AccellerURI,'_self');
        return false;
    }
}
function BroadBandWindowCreation(url, name) 
{
    var width = 1000;
    var height = 700;
    var left = 100;
    var top = 100;
   
    if ( screen.availWidth ) { 
        width = Math.min( width, screen.availWidth );
        left = Math.floor( (screen.width - width)/2 );
    }
    
    if ( screen.availHeight ) {
        height = Math.min( height, screen.availHeight );
        top = Math.floor( (screen.height - height)/2 );
    }
    
    var features = [
        "location=no,scrollbars=yes,status=no,toolbar=no,resizable=yes,width=",
        width,
        ",height=",
        height,
        ",left=",
        left,
        ",top=",
        top
    ];
    accellerwin=window.open( url, name, features.join('') );
    accellerwin.focus();
}
function cursorOnAreacode()
{
  self.focus();
  document.DSLForm.DSLPhoneAreaCode.focus();
}

