arrMenu = new Array()
arrMenu[0] = "Menu_Store";
arrMenu[1] = "Menu_Delivery";
arrMenu[2] = "Menu_Special";
arrMenu[3] = "Menu_Contact";

arrForm = new Array()
arrForm[0] = "LastName";
arrForm[1] = "FirstName";
arrForm[2] = "Address";
arrForm[3] = "Zipcode";
arrForm[4] = "HomePhone_AreaCode";
arrForm[5] = "HomePhone_First3";
arrForm[6] = "HomePhone_Last4";
arrForm[7] = "DropLocation";
arrForm[8] = "ReferredBy";

arrFormContact = new Array()
arrFormContact[0] = "Name";
arrFormContact[1] = "Email";
arrFormContact[2] = "Message";

arrFormReferral = new Array()
arrFormReferral[0] = "LastName";
arrFormReferral[1] = "FirstName";
arrFormReferral[2] = "From_Email";
arrFormReferral[3] = "ToList";

arrFormSign1 = new Array()
arrFormSign1[0] = "ID";
arrFormSign1[1] = "Password";

arrTo = new Array()
arrTo[0] = "";
var arrIndex = 0;

function addList()
{
	document.form1.ToList.innerText = document.form1.ToList.innerText + document.form1.To_Email.value + ";";
	document.form1.To_Email.value = "";
	document.form1.To_Email.focus();
}


function expand(s, thelayer)
{
  var td = s;
  var d = td.getElementsByTagName("div").item(0);

  document [arrMenu[thelayer]].src = "images/" + arrMenu[thelayer] + "_Swap.gif";
  td.className = "menuHover";
  d.className = "menuHover";
}

function collapse(s, thelayer)
{
  var td = s;
  var d = td.getElementsByTagName("div").item(0);

  document [arrMenu[thelayer]].src = "images/" + arrMenu[thelayer] + ".gif";
  td.className = "menuNormal";
  d.className = "menuNormal";
}

function Copyright()  
{
	alert("Copyright swan-cleaners.com");
	return false;
}

function confirmPassword() {
	if (document.form1.Password.value != document.form1.ConfirmPassword.value) {
		alert("Please retype your password");
		document.form1.Password.value = "";
		document.form1.ConfirmPassword.value = "";
		document.form1.Password.focus();
		return false; }
	else {
		return true; }}


function VerifySignupForm() 
{
	var temp = true;
	if (document.form1.Disclaimer.checked != true) 
	{
		alert("Please read the term and conditions and check the radio button above submit button!");
		return false; 
	}
	else 
	{
		for (var i=0; i<=8; i++) 
		{
			if (document.form1 [arrForm[i]].value == "") 
			{
				document.form1 [arrForm[i]].style.backgroundColor = '#FFFF66';
				temp = false; 
			}
			else 
			{
				document.form1 [arrForm[i]].style.backgroundColor = 'white'; 
			}
		}
		if (!temp) 
		{
			alert("Incomplete form!  Please fill in the highlighted boxes and submit again."); 
			return false; 
		}
		else 
		{
			return true;
		}
	}
}

function VerifyContactForm()
{
	var temp = true;
	for (var i=0; i<=2; i++) 
	{
		if (document.form1 [arrFormContact[i]].value == "") 
		{
			document.form1 [arrFormContact[i]].style.backgroundColor = '#FFFF66';
			temp = false; 
		}
		else 
		{
			document.form1 [arrFormContact[i]].style.backgroundColor = 'white'; 
		}
	}
	if (!temp) 
	{
		alert("Incomplete form!  Please fill in the highlighted boxes and submit again."); 
		return false; 
	}
	else 
	{
		return true;
	}
}

function VerifyReferralForm()
{
	var temp = true;
	for (var i=0; i<=3; i++) 
	{
		if (document.form1 [arrFormReferral[i]].value == "") 
		{
			document.form1 [arrFormReferral[i]].style.backgroundColor = '#FFFF66';
			temp = false; 
		}
		else 
		{
			document.form1 [arrFormReferral[i]].style.backgroundColor = 'white'; 
		}
	}
	if (!temp) 
	{
		alert("Incomplete form!  Please fill in the highlighted boxes and submit again."); 
		return false; 
	}
	else 
	{
		return true;
	}
}	
	
function VerifySign1Form()
{
	var temp = true;
	for (var i=0; i<=1; i++) 
	{
		if (document.form1 [arrFormSign1[i]].value == "") 
		{
			document.form1 [arrFormSign1[i]].style.backgroundColor = '#FFFF66';
			temp = false; 
		}
		else 
		{
			document.form1 [arrFormSign1[i]].style.backgroundColor = 'white'; 
		}
	}
	if (!temp) 
	{
		alert("Incomplete form!  Please fill in the highlighted boxes and submit again."); 
		return false; 
	}
	else 
	{
		return true;
	}
}	


function verifyForm()
{
	arrForm = new Array()
	arrForm[0] = "LName";
	arrForm[1] = "FName";
	arrForm[2] = "Phone";
	arrForm[3] = "Address";
	arrForm[4] = "CCN";
	arrForm[5] = "CCV";
	arrForm[6] = "CCA";
	arrForm[7] = "CCZ";
	var temp = true;
	var ctype, cnumber, ccv;
	for (var i=0; i<=7; i++) 
	{
		if (document.signup_form [arrForm[i]].value == "") 
		{
			document.signup_form [arrForm[i]].style.backgroundColor = '#FFFF66';
			temp = false; 
		}
		else 
		{
			document.signup_form [arrForm[i]].style.backgroundColor = 'white'; 
		}
	}
	if (!temp) 
	{
		alert("Incomplete form!  Please fill in the highlighted boxes and submit again."); 
		return false; 
	}
	ctype = document.signup_form.CCType.value;
	if (ctype == 'AmEx')
	{
		cnumber = document.signup_form.CCN.value;
		if (cnumber.length == 15)
		{
			ccv = document.signup_form.CCV.value;
			if (cvv.length == 4)
			{
				return true;
			}
			else
			{
				alert("Please check the cvv!  American Express card requires 4 digits");
				return false;
			}
		}
		else
		{
			alert("Please check the credit card number! American Express card requires 15 digits");
			return false;
		}
	}
	else
	{
		cnumber = document.signup_form.CCN.value;
		if (cnumber.length == 16)
		{
			ccv = document.signup_form.CCV.value;
			if (ccv.length == 3)
			{
				return true;
			}
			else
			{
				alert("Please check the cvv!  Visa and Mastercard require 3 digits");
				return false;
			}
		}
		else
		{
			alert("Please check the credit card number! Visa and Mastercard requires 16 digits");
			return false;
		}
	}
}
	
function checkBillingAddress()
{
	if (document.signup_form.BA.checked)
	{
		if ((document.signup_form.Address.value != '') && (document.signup_form.Zipcode.value != ''))
		{
			document.signup_form.CCA.value = document.signup_form.Address.value;
			document.signup_form.CCZ.value = document.signup_form.Zipcode.value;
		}
		else
		{
			alert('Address and zipcode field must be filled in above!');
			document.signup_form.BA.checked = false;
		}
	}
	else
	{
		document.signup_form.CCA.value = '';
		document.signup_form.CCZ.value = '';
	}
}	