function editAddress(addressID) {
        
	var URL = "/editAddress.asp?addressID=" + addressID;
	window.open(URL, "shippingAddress", 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=500,height=400,left=262,top=234');    
}	

function submitBillingAddress() {

	var frm = document.getElementById("addressForm");

	if (validateAddressForm(frm, false)) {
		frm.submit();
		return true;
	} else {
		return false;
	}
}

function submitAccountInfo() {

	var frm = document.getElementById("accountForm");
	    
	var msg = "";
	var val = document.getElementById("name").value;
	if (!val || val.length == 0) {
		msg += "Your name is required.<br/>";
	}
	
	val = document.getElementById("emailAddress").value;
	if (!val || val.length == 0) {
		msg += "Email address is required.<br/>";
	} else {
		if (!isValidEmail(val)) {
			msg += "Enter a valid email address.<br/>";
		}
	}
	
	val = document.getElementById("password").value;
	var val2 = document.getElementById("password").value;
	if (val != val2) {
		msg += "Passwords do now match.<br/>";
	}				
	if (val && val.length > 0) {
		if (!validatePassword(frm)) {
			msg += "Invalid passwords.<br />";
		}
	}
	
	// if there were errors show the error msg
	if (msg != "") {
		var msgSpan = document.getElementById("error_info");
		msgSpan.innerHTML = msg;
		msgSpan.style.display = "inline";
							
	// no errors, submit form
	} else {
		var msgSpan = document.getElementById("error_info");
		msgSpan.innerHTML = "We are validating your changes, we will forward you to your updated account center in a few seconds.";
		msgSpan.style.display = "inline";
				
		frm.submit();
	}
}
