if (document.images) //preload menu rollovers - novaurora
{   
    var menu_01_on = new Image(); // for the inactive image
    menu_01_on.src = "images/new_menu_graphics/menu_02_on_15.gif";
	var menu_01_off = new Image(); // for the active image
    menu_01_off.src = "images/new_menu_graphics/menu_02_15.gif";
    
    var menu_02_on = new Image(); // for the inactive image
    menu_02_on.src = "images/new_menu_graphics/menu_02_on_16.gif";
	var menu_02_off = new Image(); // for the active image
    menu_02_off.src = "images/new_menu_graphics/menu_02_16.gif";

    var menu_03_on = new Image(); // for the inactive image
    menu_03_on.src = "images/new_menu_graphics/menu_02_on_17.gif";
	var menu_03_off = new Image(); // for the active image
    menu_03_off.src = "images/new_menu_graphics/menu_02_17.gif";
    
    var menu_04_on = new Image(); // for the inactive image
    menu_04_on.src = "images/new_menu_graphics/menu_02_on_18.gif";
	var menu_04_off = new Image(); // for the active image
    menu_04_off.src = "images/new_menu_graphics/menu_02_18.gif";
    
    var menu_05_on = new Image(); // for the inactive image
    menu_05_on.src = "images/new_menu_graphics/menu_02_on_19.gif";
	var menu_05_off = new Image(); // for the active image
    menu_05_off.src = "images/new_menu_graphics/menu_02_19.gif";
    
    var menu_06_on = new Image(); // for the inactive image
    menu_06_on.src = "images/new_menu_graphics/menu_02_on_20.gif";
	var menu_06_off = new Image(); // for the active image
    menu_06_off.src = "images/new_menu_graphics/menu_02_20.gif";
    
    var menu_07_on = new Image(); // for the inactive image
    menu_07_on.src = "images/new_menu_graphics/menu_02_on_21.gif";
	var menu_07_off = new Image(); // for the active image
    menu_07_off.src = "images/new_menu_graphics/menu_02_21.gif";
	
    var menu_08_on = new Image(); // for the inactive image
    menu_08_on.src = "images/new_menu_graphics/menu_02_on_22.gif";
	var menu_08_off = new Image(); // for the active image
    menu_08_off.src = "images/new_menu_graphics/menu_02_22.gif";
}

function glossary(n) //popup glossary function, see glossary.php - novaurora
{
	window.open("glossary.php?n="+n, "Glossary","width=400,height=350,scrollbars=yes");
}

function plandescription(n) //popup plan description function, see glossary.php - novaurora
{
	window.open("plandescription.php?n="+n, "Description","width=400,height=350,scrollbars=yes");
}

function rollOn( imgName ) //image rollover - novaurora
{
    if ((document.images)) {
    	document.images[imgName].src = eval(imgName+'_on.src');
    }
}

function rollOff( imgName ) //image rollover - novaurora
{
    if ((document.images)) {
		document.images[imgName].src = eval(imgName+'_off.src');
    }
}

function Doit(here) //input checker - areas.php - FSN
{
	var X
	var Area
	var Exchange
	var Lastnum

	X=document.plandetails;
	Area=X.AC.value;
	Exchange=X.Exch.value;
	LastNum=X.Pnum.value;

	if (Area.length<3 || isNaN(Area))  {
 		alert("This must be a valid phone number in the form of: (###) ###-####");
		document.plandetails.AC.focus();
 		return false;
	}
	if (Exchange.length<3 || isNaN(Exchange))  {
 		alert("This must be a valid phone number in the form of: (###) ###-####");
		document.plandetails.Exch.focus();
 		return false;
	}
	if (LastNum.length<4 || isNaN(LastNum))  {
 		alert("This must be a valid phone number in the form of: (###) ###-####");
		document.plandetails.Pnum.focus();
 		return false;
	}
	else
	{
		return true;
	}

}

function Doitjoin(here) //input checker - join.php - FSN
{
	// check line one
	if (document.plandetails.NewService1.checked == false && document.plandetails.ExistingService1.checked == false) {
		alert ("Please choose either changing service or new service on the top of the form");
		return false;
	} else {

		var X
		var Area
		var Exchange
		var Lastnum

		X=document.plandetails;
		Area=X.AC1.value;
		Exchange=X.Exch1.value;
		Lastnum=X.Pnum1.value;
		if (document.plandetails.NewService1.checked == false) {
			if (Area.length<3 || isNaN(Area))  {
				alert("This must be a valid phone number in the form of: (###) ###-####");
				document.plandetails.AC1.focus();
				return false;
			}
			if (Exchange.length<3 || isNaN(Exchange))  {
				alert("This must be a valid phone number in the form of: (###) ###-####");
				document.plandetails.Exch1.focus();
				return false;
			}
			if (Lastnum.length<4 || isNaN(Lastnum))  {
				alert("This must be a valid phone number in the form of: (###) ###-####");
				document.plandetails.Pnum1.focus();
				return false;
			} else {
				// check line two
				if (document.plandetails.NewService2.checked == false && document.plandetails.ExistingService2.checked == false) {
					return true;
				} else {

					var X
					var Area
					var Exchange
					var Lastnum

					X=document.plandetails;
					Area=X.AC2.value;
					Exchange=X.Exch2.value;
					LastNum=X.Pnum2.value;
					if (document.plandetails.NewService2.checked == false) {
						if (Area.length<3 || isNaN(Area))  {
							alert("This must be a valid phone number in the form of: (###) ###-####");
							document.plandetails.AC2.focus();
							return false;
						}
						if (Exchange.length<3 || isNaN(Exchange))  {
							alert("This must be a valid phone number in the form of: (###) ###-####");
							document.plandetails.Exch2.focus();
							return false;
						}
						if (LastNum.length<4 || isNaN(LastNum))  {
							alert("This must be a valid phone number in the form of: (###) ###-####");
							document.plandetails.Pnum2.focus();
							return false;
						} else {												
							return true;
						}
					}
				}
			}
		}
	}
}



function checkrequired_compare(which) //input checker - compare.php - FSN
{
	var Area;
	var Exchange;
	var Lastnum;
    var EmailAt=0;
    var EmailDot=0;
    var Name;
    var point;

	Area=document.OneRateCompare.AC.value;
	Exchange=document.OneRateCompare.Exch.value;
	LastNum=document.OneRateCompare.Pnum.value;
    Name=document.OneRateCompare.requiredRequestor.value;

	if (Area.length<3 || isNaN(Area))  {
 		alert("This must be a valid phone number in the form of: (###) ###-####");
		document.OneRateCompare.AC.focus();
 		return false;
	}
	if (Exchange.length<3 || isNaN(Exchange))  {
 		alert("This must be a valid phone number in the form of: (###) ###-####");
		document.OneRateCompare.Exch.focus();
 		return false;
	}
	if (LastNum.length<4 || isNaN(LastNum))  {
 		alert("This must be a valid phone number in the form of: (###) ###-####");
		document.OneRateCompare.Pnum.focus();
 		return false;
	}

    EmailAt=document.OneRateCompare.requiredEMail.value.indexOf("@");
    EmailDot=document.OneRateCompare.requiredEMail.value.indexOf(".");
    if ((EmailAt < 0) || (EmailDot < 0)) {
        alert("Entered an invalid Email address. Be sure to enter the complete email address. Try again...");
        document.OneRateCompare.requiredEMail.focus();
        return false;
    }
	if (Name.length<3)  {
 		alert("Please enter your name.");
		document.OneRateCompare.requiredRequestor.focus();
 		return false;
	}

	// ****** Radio Source choice processing ******
   	point="";
    for (x=0 ; x<5 ; x++) {
        if (document.OneRateCompare.requiredSource[x].checked == true)  {
            point=document.OneRateCompare.requiredSource[x].value;
        }
    }

        switch (point) {
        case "":
		        alert("\nPlease choose how you heard about us and re-submit.");
            return false;
            break
        case "OTHER":
						if (document.OneRateCompare.OtherSource.value.length < 1)  {
		        			alert("\nPlease enter the name of the Other source and re-submit.");
					        document.OneRateCompare.OtherSource.focus();
      			      return false;
						}
            break
        default:
        }
}

function checkrequired_join(which, israms, iscenter, plan, existingservice, mainexch, newserv, pc) //input checker - join.php - FSN
{
	if (document.forms["PlanSelect"].firstname.value.length < 1)  {
		alert("There was an ERROR in the form. Fill in FIRST NAME and re-SUBMIT.");
		document.forms["PlanSelect"].firstname.focus();
		return false;
	}
	if (document.forms["PlanSelect"].lastname.value.length < 1)  {
		alert("There was an ERROR in the form. Fill in LAST NAME and re-SUBMIT.");
		document.forms["PlanSelect"].lastname.focus();
		return false;
	}
	if (document.forms["PlanSelect"].address1.value.length < 1)  {
		alert("There was an ERROR in the form. Fill in STREET ADDRESS and re-SUBMIT.");
		document.forms["PlanSelect"].address1.focus();
		return false;
	}
	if (document.forms["PlanSelect"].city.value.length < 1)   {
		alert("There was an ERROR in the form. Fill in CITY and re-SUBMIT.");
		document.forms["PlanSelect"].city.focus();
		return false;
	}
	if (document.forms["PlanSelect"].state.value.length < 2) {
		alert("There was an ERROR in the form. Select a STATE from the list and re-SUBMIT.");
		document.forms["PlanSelect"].state.focus();
		return false;
	}

	if(document.forms["PlanSelect"].Origin.value == "NOCODE") {
		alert("Please select an Origin Code and re-SUBMIT.");
		document.forms["PlanSelect"].Origin.focus();
		return false;
	}



// ************* Make sure no commas in address *********//
//	document.forms["PlanSelect"].address1.replace(",", " ")
//	document.forms["PlanSelect"].address2.replace(",", " ")

// ****** ZipCode processing ******
    ziplen=document.forms["PlanSelect"].zip_code.value.length;
    zipval=new Number(document.forms["PlanSelect"].zip_code.value);
    zip10digit=document.forms["PlanSelect"].zip_code.value.indexOf("-");
    if ((isNaN(zipval)) || (ziplen < 5)) {
        alert("Invalid Zip Code. Re-enter Zip Code as 5 numeric digits");
        document.forms["PlanSelect"].zip_code.focus();
        return false;
   }

// ****** Email processing ******
	if(israms != "Y" && iscenter != "Y" && pc < 0) {
		EmailAt=document.forms["PlanSelect"].Email.value.indexOf("@");
		EmailDot=document.forms["PlanSelect"].Email.value.indexOf(".");
		if ((EmailAt < 0) || (EmailDot < 0)) {
			alert("Entered an invalid Email address. Try again...");
			document.forms["PlanSelect"].Email.focus();
			return false;
		}
	}

// ****** Install Date processing ******
	if(newserv == "Y") {
		instDate = document.forms["PlanSelect"].install_date.value;
		if(instDate.length == 0) {
			// no install date requested - ok
		} else if(instDate.length != 10) {
			alert("Please enter service install date in mm-dd-yyyy format.");
			document.forms["PlanSelect"].install_date.focus();
			return false;
		} else {
			if((instDate.charAt(2) == "-") && (instDate.charAt(5) == "-")) {
				// valid format atleast
			} else {
				alert("Please enter service install date in mm-dd-yyyy format.");
				document.forms["PlanSelect"].install_date.focus();
				return false;			
			}
		}
	}

// *****  SS # Processing  *****
    SS1=document.forms["PlanSelect"].SS_num1.value.length;
    SS2=document.forms["PlanSelect"].SS_num2.value.length;
    SS3=document.forms["PlanSelect"].SS_num3.value.length;

    SSn1=new Number(document.forms["PlanSelect"].SS_num1.value);
    SSn2=new Number(document.forms["PlanSelect"].SS_num2.value);
    SSn3=new Number(document.forms["PlanSelect"].SS_num3.value);

    if (isNaN(SSn1) || isNaN(SSn2) || isNaN(SSn3)) {
        alert("Invalid SS #. Re-enter numbers only");
        document.forms["PlanSelect"].SS_num1.focus();
        return false;
   }
    if (SS1 < 3) {
        if (SS1 < 1) {
            alert("Entered an invalid Social Security Number. Try again...\n\n\nIf you do not have a Social Security number please call\nour Service Center 800 line for further information");
        }
        else {
            alert("Entered an invalid Social Security Number. Try again...");
        }
        document.forms["PlanSelect"].SS_num1.focus();
        return false;
    }
    if (SS2 < 2) {
        alert("Entered an invalid Social Security Number. Try again...");
        document.forms["PlanSelect"].SS_num2.focus();
        return false;
    }
    if (SS3 < 4) {
        alert("Entered an invalid Social Security Number. Try again...");
        document.forms["PlanSelect"].SS_num3.focus();
        return false;
    }

// ****** Telephone number processing ******
 //   TNsize=document.forms["PlanSelect"].Contact_info1.value.length;
 //   TN=new Number(document.forms["PlanSelect"].Contact_info1.value);

 //   if (TNsize < 10) {
 //       alert("Invalid Telephone Number. Re-enter all 10 digits");
 //       document.forms["PlanSelect"].Contact_info1.focus();
  //      return false;
  // }
  //  if (isNaN(TN)) {
 //       alert("Invalid Telephone Number. Re-enter 10 numbers only");
  //      document.forms["PlanSelect"].Contact_info1.focus();
  //      return false;
  // }

	// validate LSP selection
	if (((israms == "Y") || (iscenter == "Y") || (pc > -1)) && (existingservice == "Y")) {
		var x=document.getElementById("LSP")
		if((x.options[x.selectedIndex].text == "")) {
			document.forms["PlanSelect"].LSP.focus();
			alert("Please select Customer's Local Provider.");
			return false;
		} else if(x.options[x.selectedIndex].text == "Other") {
			if(document.forms["PlanSelect"].LSPOTHER.value.length < 2) {
				document.forms["PlanSelect"].LSPOTHER.focus();
				alert("Please specify OTHER Local Provider.");
				return false;
			}
		}
	}


	// decide which quickstart nbr to display (if at all)	
	if ((israms != "Y") && (existingservice == "Y") && (iscenter != "Y")) {
		if ((mainexch == "412") || (mainexch == "724")) {
			Subscript = "a";
		} else {
			Subscript = "b";
		}
		
		server="http://www.paeasybill.com/";
		server="";
		switch (plan) {
		case "LOCLINE":
			//var Socket=server+"qs1195"+Subscript+".htm";
			respStr = "qs1195"+Subscript+".htm";
			FormResponse(respStr);
			break
		case "LOCPACK":
			//var Socket=server+"qs2495"+Subscript+".htm";
			respStr = "qs2495"+Subscript+".htm";
			FormResponse(respStr);
			break
		case "METPACK":
			//var Socket=server+"qs3995"+Subscript+".htm";
			respStr = "qs3995"+Subscript+".htm";
			FormResponse(respStr);
			break
		case "NATPACK":
			//var Socket=server+"qs4995"+Subscript+".htm";
			respStr = "qs4995"+Subscript+".htm";
			FormResponse(respStr);
			break
		case "AMPLAN":
			respStr = "qsALL.htm";
			FormResponse(respStr);
			break
                case "STPLAN":
                        respStr = "qsALL.htm";
                        FormResponse(respStr);
                        break 
                case "REPLAN":
                        respStr = "qsALL.htm";
                        FormResponse(respStr);
                        break 
                case "EXPLAN":
                        respStr = "qsALL.htm";
                        FormResponse(respStr);
                        break 
                case "LOPLAN":
                        respStr = "qsALL.htm";
                        FormResponse(respStr);
                        break 
		default:
		}
	}
}



//join check to make sure plan is picked
function checkPlanPick(which) {
   point="";
    for (x=0 ; x<document.form1.radiogroup.length ; x++) {
        if (document.forms["form1"].radiogroup[x].checked == true)  {
            point=document.forms["form1"].radiogroup[x].value;
        }
    }
    if (point == "") {
        alert("\nPlease pick the plan for you and re-submit.");
        return false;
    }  //endif
}
	


function FormResponse(Socketin) //form response - FSN
{
        win1=open(Socketin,"window1","Width=640,Height=480,screenX=0,screenY=0,scrollbars=1,resizable=1");
        win1.focus();
}

var crap = "racp";

