/*
	functions.js: by Joel Firestone (4/30/01)
	
	These functions comprise all of the DHTML/JavaScript functionality across 
	delmarvaonline.com. It verifies form submissions, handles image pre-loading 
	and rollover, window pop-ups, etc.
*/

// =============================================================================
// 		generic functions (rollOn(), rollOff(), etc.
// =============================================================================

function launchWelcome() {
	var myWelcome = window.open("welcome.html", "welcome", "width=500,height=440,menu=0,scrollbars=1,status=0");
}

function preLoad() {
	// set our array of image names that we're going to load
	var arrImages = new Array ("signup","account","access","business","support","company","home","areainfo");
	var arrImage = new Array(6);
	
	// loop through arrImages, setting a new image and preloading it
	for (i = 0; i < arrImages.length; i++) {
		strName = "/images/nav." + arrImages[i] + ".on.gif";
		arrImage[i] = new Image();
		arrImage[i].src = strName;
	}
	
	// throw up our alert box
	// launchWelcome();
}

function rollOn(name) {
	// rollover our images, based on the passed image name
	var strImage = "/images/nav." + name + ".on.gif";
	document.images[name].src = strImage;
}

function rollOff(name) {
	// rollover our images, based on the passed image name
	var strImage = "/images/nav." + name + ".gif";
	document.images[name].src = strImage;
}

function valLogin() {
	if (document.login.username.value == "" || document.login.password.value == "") {
		alert("Both a username and password are required to access this area.");
		return false;
	}
	return true;
}

function deliverMSG(number) {
	// display a pop-up, based on the chosen delivery method
	if (number == 1)
		alert("Gift certificate will be emailed to the recipient to the email address provided.\nThis is the fastest way to get your family and friends online the same day! The\nrecipient has the option to redeem the gift certificate online, in person or by\nmail. Call 1-800-220-9262 if you have any questions.")
	else if (number == 2)
		alert("The recipient will receive a gift certificate in the mail to the address provided\nby you. The recipient has the option to redeem the gift certificate online, in\nperson or by mail. Call 1-800-220-9262 if you have any questions.")
	else if (number == 3)
		alert("A gift certificate will be mailed to you. Once the recipient receives this\ncertificate, s/he has the option to redeem the gift certificate online, in\nperson or by mail. Call 1-800-220-9262 if you have any questions.")
}

function onSearch() {
	document.theform.opcode.value = "lookup";
	document.theform.submit();
}

function OnNext() {
	
	document.theform.opcode.value = "next";
	document.theform.submit();
}

function startPremium() {
	 window.location="http://updates.virtdom.com/localspeed/localspeednoslip.EXE";
}

function startXtreme() {
	 window.location="http://updates.virtdom.com/localspeed/localspeedslip.exe";
}

function startPremiumMac() {
	 window.location="selectuser_mac.php?id=230";
}

function startXtremeMac() {
	 window.location="selectuser_mac.php?id=276";
}

function clearForm() {
    document.theform.LookupNPA.value='';
    document.theform.LookupNXX.value='';
    document.theform.LookupLast4.value='';
    document.theform.Phone.value='';
}
