var exit=true;
function formfocus()
{
document.DSLForm.DSLPhoneAreaCode.focus();
}
function CheckSizeNPA(FormName)
{
	//alert (FormName.NPA.value.length);
	if (FormName.DSLPhoneAreaCode.value.length==3)
	{
		//document.FormName.NXX.Focus();
		document.DSLForm.DSLPhoneFirst.focus();
	}

}
function CheckSizeNXX(FormName)
{
	//alert (FormName.NPA.value.length);
	if (FormName.DSLPhoneFirst.value.length==3) 
	{
		//document.FormName.NXX.Focus();
		document.DSLForm.DSLPhoneLast.focus();
	}

}
function CheckSizeSuffix(FormName)
{
	//alert (FormName.NPA.value.length);
	if (FormName.DSLPhoneLast.value.length==4)
	{
		//document.FormName.NXX.Focus();
		//document.DSLForm.shopper_email.focus();
	}

}
function openpopupbox(url){
var popurl="popupwindow.htm"
winpops=window.open(url,"","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=700,height=250")
}
function validate(DSLForm) 
 {
	DSLForm.submitButtonName.disabled=true;
		
	var strMsg = "";
	if  (isNaN(DSLForm.DSLPhoneAreaCode.value))
	{
		strMsg = strMsg + "\n" + "The Area Code must be a number!";
	
	
	}
	if  (isNaN(DSLForm.DSLPhoneFirst.value))
	{
		strMsg = strMsg + "\n" + "The Second phone value must be a number!";
	
	
	}
	if  (isNaN(DSLForm.DSLPhoneLast.value))
	{
		strMsg = strMsg + "\n" + "The third phone value must be a number!";
	
	
	}
	if (DSLForm.DSLPhoneAreaCode.value.length < 3)
	{
		strMsg = strMsg + "\n" + "A 3 digit Area Code is required!";
	}
	
	if (DSLForm.DSLPhoneFirst.value.length < 3)  
	{
		strMsg = strMsg + "\n" + "The Second Phone value must be 3 digits long!";
	}
	
	if (DSLForm.DSLPhoneLast.value.length < 4)  
	{
		strMsg = strMsg + "\n" + "The Third Phone value must be 4 digits long!";
	}
	
	
	if (DSLForm.shopper_email.value =="")  
	{
		strMsg = strMsg + "\n" + "An email address is required!";
	}
	
	if (DSLForm.shopper_email.value=="")
	{
		strMsg = strMsg + "\n" + "Missing required field (eMail).";
		//return false;
	}
	else
	{
		var sEmail=new String;
		sEmail=DSLForm.shopper_email.value
		sEmail.toLowerCase();
		if ((sEmail.search("@")==-1) || ((sEmail.search(".net")==-1) && (sEmail.search(".com")==-1) && (sEmail.search(".org")==-1)) )
		{
     		sEmail =  " Invalid email address format. Do you want to submit your information with email address supplied?";
			if (window.confirm(sEmail))
			{
				//window.showModelessDialog("pauseavailability.asp")
       			//return false;
      		}
      		else
      		{
      			DSLForm.submitButtonName.disabled=false;
       			//return false;
			}
		}    
	}
	
	if (strMsg != "")
	{
		alert(strMsg);
		DSLForm.submitButtonName.disabled=false;
		return false;
	}
	//window.showModelessDialog("pauseavailability.asp")
	return true;
	//loadpopup()
}

function MakeArray(n) {
    this.length = n
    return this
}
monthNames = new MakeArray(12)
monthNames[1] = "January"
monthNames[2] = "February"
monthNames[3] = "March"
monthNames[4] = "April"
monthNames[5] = "May"
monthNames[6] = "June"
monthNames[7] = "July"
monthNames[8] = "August"
monthNames[9] = "September"
monthNames[10] = "October"
monthNames[11] = "November"
monthNames[12] = "December"

function customDateString() {
    currentDate = new Date()
    var theMonth = monthNames[currentDate.getMonth() + 1]
    msie4 = ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4 ));
if (msie4) {
    var theYear = currentDate.getYear()
}
else {
    var theYear = currentDate.getYear() +1900
}
    return theMonth + " " + currentDate.getDate() + ", " + theYear
}

function popUpDM(url)
{
	sealWin=window.open(url,"win");
	self.name = "mainWin";
}

function openpopupbox(url)
{
var popurl="popupwindow.htm"
		var centerWidth=(screen.width/2)-(620/2);
		var centerHeight=(screen.height/2)-(600/2);
		window.open(url, "","height=600,width=620,top="+centerHeight+",left="+centerWidth+",location=no,menubar=no,resizable=yes,scrollbars=yes,status=no,titlebar=no,toolbar=no,directories=no");
		
//winpops=window.open(url,"","toolbar=0,location=1,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,width=600,height=300")
}	

function openpopup(url)
{
	var centerWidth=(screen.width/2)-(620/2);
	var centerHeight=(screen.height/2)-(600/2);
	window.open(url, "","height=600,width=620,top="+centerHeight+",left="+centerWidth+",location=no,menubar=no,resizable=yes,scrollbars=yes,status=no,titlebar=no,toolbar=no,directories=no");
}
