function FIND(item) {
	if (document.all) return(document.all[item]);
	if (document.getElementById) return(document.getElementById(item));
	return(false);
}

function round_decimals(original_number, decimals) {
    var result1 = original_number * Math.pow(10, decimals)
    var result2 = Math.round(result1)
    var result3 = result2 / Math.pow(10, decimals)
    return pad_with_zeros(result3, decimals)
}

function pad_with_zeros(rounded_value, decimal_places) {
    var value_string = rounded_value.toString()
    var decimal_location = value_string.indexOf(".")
    if (decimal_location == -1) {
        decimal_part_length = 0
        value_string += decimal_places > 0 ? "." : ""
    }
    else {
        decimal_part_length = value_string.length - decimal_location - 1
    }
    var pad_total = decimal_places - decimal_part_length
    if (pad_total > 0) {
        for (var counter = 1; counter <= pad_total; counter++) 
            value_string += "0"
        }
    return value_string
}

function toDollarsAndCents(n) {
var s = "" + Math.round(n * 100) / 100
var subString = 0;
	switch(s.split('.')[0].length){
		case 4:
			subString = 1;
		break;
		case 5:
			subString = 2;
		break;
		case 6:
			subString = 3;
		break;
		default:
			subString = 0;
		break;
	}
var start = s.substring(0,subString)
var end = s.substring(subString, s.length)
var i = end.indexOf('.')
	if (i < 0){
		return ((subString > 0) ? start + ',' + end : s) + ".00"
	}
var t = ((subString > 0) ? (start + ',' + end.substring(0, i + 1) + end.substring(i + 1, i + 3)) : (s.substring(0, i + 1) + s.substring(i + 1, i + 3)))
	if (i + 2 == ((subString > 0) ? end.length : s.length)){
		t += "0"
	}
	return t
}

/*
//INSCRIPTION
function updateOptionPrice2(thisform,thisinput){
var spanTag = thisform.getElementsByTagName('span');
var spanLen = spanTag.length;
var spanInc = 0;
var spanText = '';
var spanPrice = 0;
	if(thisinput.value != ''){
		while(spanInc < spanLen){
			if(spanTag[spanInc].id.indexOf('optInput') > -1){
				spanText = spanTag[spanInc].innerHTML;
				if(spanText.indexOf("($") > -1) {
					var spanPriceSplit1 = spanText.split("($");
					var spanPriceSplit2 = spanPriceSplit1[1].split(")");
					spanPrice = parseFloat(spanPriceSplit2[0].replace(',',''));
				}
			}
			spanInc++;
		}
	}else{
		thisinput.value = '';
	}
	updateOptionPrice(thisform,thisinput,spanPrice)
}
//INSCRIPTION
*/

function updateOptionPrice(thisform,thisinput){
	var price = basePrice;
	var thedifference = 0;
	var pricevalAr = new Array();
	var direction = "add";
	var modPrice = "";
	var spanPrice = 0;
	if(price != "")
		price = parseFloat(price);
	else
		price = 0;

	for(i=0;i<thisform.elements.length;i++){ 
		priceval = 0;
		pricevalAr = 0;
		var optId = thisform[i].id;
		if(typeof optId != 'undefined'){
			if(optId.indexOf('optInscription') > -1){
				var pos = optId.substring(14)
				if(document.getElementById(optId).value != ''){
					var spanText = document.getElementById('optInput'+pos).innerHTML;
					if(spanText.indexOf("($") > -1) {
						var spanPriceSplit1 = spanText.split("($");
						var spanPriceSplit2 = spanPriceSplit1[1].split(")");
						spanPrice += parseFloat(spanPriceSplit2[0].replace(',',''));
						//alert(spanPrice)
					}
				}
			}
		}
		if(thisform.elements[i].type == "select-one"){
			priceval = thisform.elements[i].options[thisform.elements[i].selectedIndex].value
			
			if(priceval.indexOf("(+$") > -1) {
				pricevalAr = priceval.split("(+$");
				direction = "add";
			}else if(priceval.indexOf("(+") > -1) {
				pricevalAr = priceval.split("(+");
				direction = "add";
			}else if(priceval.indexOf("(-") > -1) {
				pricevalAr = priceval.split("(-");
				direction = "sub";
			}else if(priceval.indexOf("(-$") > -1) {
				pricevalAr = priceval.split("(-$");
				direction = "sub";
			}else if(priceval.indexOf("(*") > -1) {
				pricevalAr = priceval.split("(*");
				direction = "mult";
			}
			if(pricevalAr.length > 1){
				priceval = pricevalAr[1].split(")");
				priceval = parseFloat(priceval[0].replace('$','').replace(',',''));
			} else {
				priceval = 0;
			} 
			if(direction == "add")
				price = price + priceval
			else if(direction == "sub")
				price = price - priceval
			else {
				thedifference = (price * priceval) - price;
				price = price * priceval;
				if(thisinput) thisinput.value = "(+" + thedifference + ")";
			}
		} else {
			if(thisform.elements[i].type == "radio"){
				if(thisform.elements[i].checked){
					priceval = thisform.elements[i].value;
					fullinput = priceval;
					if(priceval.indexOf("(+$") > -1) {
						pricevalAr = priceval.split("(+$");
						direction = "add";
					} else if(priceval.indexOf("(+") > -1) {
						pricevalAr = priceval.split("(+");
						direction = "add";
					} else if(priceval.indexOf("(-") > -1) {
						pricevalAr = priceval.split("(-");
						direction = "sub";
					}else if(priceval.indexOf("(-$") > -1) {
						pricevalAr = priceval.split("(-$");
						direction = "sub";
					}else if(priceval.indexOf("(*") > -1) {
						pricevalAr = priceval.split("(*");
						direction = "mult";
					}
					if(pricevalAr.length > 1){
						priceval = pricevalAr[1].split(")");
						priceval = parseFloat(priceval[0].replace(',',''));
					}else
						priceval = 0;
					if(direction == "add")
						price = price + priceval
					else if(direction == "sub")
						price = price - priceval
					else {
						thedifference = (price * priceval) - price;
						price = price * priceval;
						if(thisinput) thisinput.value = "(+" + round_decimals(thedifference,2) + ")";
					}
				}
			}
		}
	}
	
	modPrice = modPrice + "Your Total Price: $" + toDollarsAndCents(price+spanPrice);

	if (document.all) {
	   dispprice.innerHTML = modPrice;
	} else if (document.getElementById) {
		document.getElementById("dispprice").innerHTML = modPrice;
        }
}



function containsTestimonial(tmp, newid) {
	for(x=0;x<tmp.length;x++){
		if(tmp[x]==newid){
			return true;
		}
	}
	return false;
}

function Testimonials(){
var testimonialLen = testimonial.length;
var testimonialsDiv = document.getElementById('testimonials');
var newid = new Array();
	if(testimonialLen > 0){
		if(testimonialLen <= testimonialsToShow){
			for(x=0;x<testimonialsToShow;x++){
				if(window.testimonial[x]){
					testimonialsDiv.innerHTML += testimonial[x];
				}
			}
		}else{
			for(x=0;x<testimonialsToShow;x++){
				c = Math.floor(Math.random()*testimonialLen);
				if(!containsTestimonial(newid, testimonial[c])){
					newid.push(testimonial[c]);
					testimonialsDiv.innerHTML += newid[x];
				}
			}
		}
	}
}
function expandingNav(id){
var x = document.getElementById(id);
if(x.style.display=='none'){
x.style.display='block';
}else{
x.style.display='none';
}; 
}

function disablePromo(thisel, which){
var promocheck = document.getElementById('promocheck');
var promoText = document.getElementById('promoText');
	if(promocheck){
		if(thisel.checked && which == 'bml'){
			promocheck.checked = true;
			promocheck.disabled = false;
			if(promoText){
				promoText.className = '';
			}
		}
		if(thisel.checked && which == 'cc'){
			promocheck.checked = false;
			promocheck.disabled = true;
			if(promoText){
				promoText.className = 'promoTextDisable';
			}
		}
	}
}

function bmlResultsCheck(thisform){
var today = new Date();
var fullYear = today.getFullYear();
var day = today.getDate();
var month = today.getMonth();
var febLen = 28;
var mLen = 30;
	if (((fullYear % 4 == 0) && (fullYear % 100 != 0)) || (fullYear % 400 == 0)){
		febLen = 29; 
	}
	if(thisform['bdmonth'].selectedIndex == 0){
		alert('Please select a birth month');
		return false;
	}else if(thisform['bdday'].selectedIndex == 0){
		alert('Please select a birth day');
		return false;
	}else if(thisform['bdyear'].selectedIndex == 0){
		alert('Please select a birth year');
		return false;
	}else{
		if((thisform['bdmonth'].options[thisform['bdmonth'].selectedIndex].value == '02') && (thisform['bdday'].options[thisform['bdday'].selectedIndex].value > febLen)){
			alert('Please select a valid day for this month.');
			return false;
		}
		if(
			((thisform['bdmonth'].options[thisform['bdmonth'].selectedIndex].value == '04') && (thisform['bdday'].options[thisform['bdday'].selectedIndex].value > mLen)) || 
			((thisform['bdmonth'].options[thisform['bdmonth'].selectedIndex].value == '06') && (thisform['bdday'].options[thisform['bdday'].selectedIndex].value > mLen)) || 
			((thisform['bdmonth'].options[thisform['bdmonth'].selectedIndex].value == '09') && (thisform['bdday'].options[thisform['bdday'].selectedIndex].value > mLen)) || 
			((thisform['bdmonth'].options[thisform['bdmonth'].selectedIndex].value == '11') && (thisform['bdday'].options[thisform['bdday'].selectedIndex].value > mLen))
		){
			alert('Please select a valid day for this month.');
			return false;
		}
		if(
			((thisform['bdyear'].selectedIndex == 1) && 
			(thisform['bdmonth'].options[thisform['bdmonth'].selectedIndex].value > (month+1))) || 
			((thisform['bdyear'].selectedIndex == 1) && 
			(thisform['bdmonth'].options[thisform['bdmonth'].selectedIndex].value == (month+1)) && 
			(thisform['bdday'].options[thisform['bdday'].selectedIndex].value > day)))
		{
				alert('You must be 18 years of age to use Bill Me Later... Please select another payment...')
				return false;
		}
		
		if(thisform['ssn'].value == ''){
			alert('Last 4 digits of Social Security Number cannot be blank.');
			return false;
		}else if(isNaN(thisform['ssn'].value)){
			alert('Last 4 digits of Social Security Number must be numeric.');
			return false;
		}else if(thisform['ssn'].value.length < 4){
			alert('Last 4 digits of Social Security Number cannot have fewer then 4 digits.');
			return false;
		}
		/*var checkSSNZeros = 0;
		for(x=0;x<thisform['ssn'].value.length;x++){
			var parseIntVal = parseInt(thisform['ssn'].value[x]);
			checkSSNZeros = (checkSSNZeros+parseIntVal);
		}*/
		if(isSSNAllZeros(thisform['ssn'].value)){
			alert('Last 4 digits of Social Security Number cannot have all zeros\'s.');
			return false;
		}
	}
	if(thisform['consent'].checked == false){
		alert('You must agree to the Terms and Conditions to complete your order.');
		return false;
	}
	document.getElementById('bmlUpdateInfo').style.display = 'none'
	document.getElementById('bmlAgree').style.display = 'none'
	document.getElementById('bmlOtherPaymentDiv').style.display = 'none'
	document.getElementById('processingBML').innerHTML = 'One moment while we process your information...<br />Please DO NOT refresh the page or click the back browser button... Thank you!'
	return true;
}

function swapShippingVals(){
	var regForm = document.forms['register'];
	if(regForm){
		if(regForm.shipBillSameFlag){
			if(regForm.shipBillSameFlag.checked){
				if(regForm.shipFirstName){
					regForm.billFirstName.value = regForm.shipFirstName.value;
					regForm.billFirstName.disabled = true;
				}
				if(regForm.shipLastName){
					regForm.billLastName.value = regForm.shipLastName.value;
					regForm.billLastName.disabled = true;
				}
				if(regForm.shipAddress1){
					regForm.billAddress1.value = regForm.shipAddress1.value;
					regForm.billAddress1.disabled = true;
				}
				if(regForm.shipAddress2){
					regForm.billAddress2.value = regForm.shipAddress2.value;
					regForm.billAddress2.disabled = true;
				}
				if(regForm.shipCity){
					regForm.billCity.value = regForm.shipCity.value;
					regForm.billCity.disabled = true;
				}
				if(regForm.shipState){
					regForm.billState.value = regForm.shipState.value;
					regForm.billState.disabled = true;
				}
				if(regForm.shipZip){
					regForm.billZip.value = regForm.shipZip.value;
					regForm.billZip.disabled = true;
				}
				if(regForm.shipPhone){
					regForm.billPhone.value = regForm.shipPhone.value;
					regForm.billPhone.disabled = true;
				}
				/*if(regForm.shipPhone1){
					regForm.billPhone1.value = regForm.shipPhone1.value;
					regForm.billPhone1.disabled = true;
				}
				if(regForm.shipPhone2){
					regForm.billPhone2.value = regForm.shipPhone2.value;
					regForm.billPhone2.disabled = true;
				}
				if(regForm.shipPhone3){
					regForm.billPhone3.value = regForm.shipPhone3.value;
					regForm.billPhone3.disabled = true;
				}*/
				if(regForm.shipCountry){
					regForm.billCountry.selectedIndex = regForm.shipCountry.selectedIndex;
					regForm.billCountry.disabled = true;
				}
			}else{
				regForm.billFirstName.disabled = false;
				regForm.billLastName.disabled = false;
				regForm.billAddress1.disabled = false;
				regForm.billAddress2.disabled = false;
				regForm.billCity.disabled = false;
				regForm.billState.disabled = false;
				regForm.billZip.disabled = false;
				regForm.billPhone.disabled = false;
				//regForm.billPhone1.disabled = false;
				//regForm.billPhone2.disabled = false;
				//regForm.billPhone3.disabled = false;
				regForm.billCountry.disabled = false;
			}
		}
	}
}

function isEmail(str) {
var supported = 0;
	if (window.RegExp) {
		var tempStr = "a";
		var tempReg = new RegExp(tempStr);
		if (tempReg.test(tempStr))
			supported = 1;
	}
	if (!supported){
		return (str.indexOf(".") > 2) && (str.indexOf("@") > 0);
	}
var r1 = new RegExp("(@.*@)|(\\.\\.)|(@\\.)|(^\\.)");
var r2 = new RegExp("^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,4}|[0-9]{1,3})(\\]?)$");
return (!r1.test(str) && r2.test(str));
}

function isPhoneNumber(str){
	var regexp = new RegExp("((\\()+\\d{3}(\\))+\\d{3}-\\d{4})|(\\d{3}-\\d{3}-\\d{4})");
	return(regexp.test(str))
}

function isSSNAllZeros(str){
	var regexp = new RegExp("[0]{4}");
	return(regexp.test(str))
}

function isPhoneNumberAllOnes(str){
	var regexp = new RegExp("((\\()+\\d{3}(\\))+[1][1][1]-[1][1][1][1])|(\\d{3}-[1][1][1]-[1][1][1][1])");
	return(regexp.test(str))
}

function isValidAreaCode(str){
var re = new RegExp("(\\()+\\d{3}(\\))|\\d{3}-"); 
var regReplace = re.exec(str)[0].replace(/\(/, "");
	regReplace = regReplace.replace(/\)/, "");
	regReplace = regReplace.replace(/\-/, "");
	return (regReplace)
}

/*NEW*/
function isAreaCodeAndExchange(str){
	var re = new RegExp("\\d{3}"); 
	return (re.test(str))
}
function isValidAreaCodeAndExchange(str){
	var re = new RegExp("\\d{3}"); 
	var regReplace = re.exec(str)[0];
	return (regReplace);
}
function isAllOnes(str, ac){
var regexp;
	if(ac){
		regexp = new RegExp("([1]{3})");
	}else{
		regexp = new RegExp("([1]{4})");
	}
	return(regexp.test(str))
}
function isValidLastFour(str){
	var re = new RegExp("\\d{4}"); 
	return (re.test(str))
}
/*NEW*/

function isValidExchange(str){
var re = new RegExp("(\\()+\\d{3}(\\))+\\d{3}|\\d{3}-\\d{3}");
var regReplace;
	if(re.exec(str)[0].indexOf(')') > -1){
		regReplace = re.exec(str)[0].split(')');
	}else if(re.exec(str)[0].indexOf('-') > -1){
		regReplace = re.exec(str)[0].split('-');		
	}
	return(regReplace[1])
}

function hasVowel(str){
	var regexp = new RegExp("[Aa]|[Ee]|[Ii]|[Oo]|[Uu]|[Yy]");
	return(regexp.test(str))
}

function validStateChars(str){
	var regexp = new RegExp("^[a-zA-Z]+$");
	return(regexp.test(str))
}

function validZipChars(str){
	var regexp = new RegExp("^[0-9]+$");
	return(regexp.test(str))
}

function hasForeignChars(str){
	var regexp = new RegExp("^[a-zA-Z\\.\\-\\']+$");
	return(regexp.test(str))
}

function numAlphaChars(str){
	var regexp = new RegExp("((\\s.*)?[0-9]{1}(\\s.*)?[a-zA-Z]{1}(\\s.*)?)|((\\s.*)?[a-zA-Z]{1}(\\s.*)?[0-9]{1}(\\s.*)?)");
	return(regexp.test(str))
}

function validateRegForm(){
var theform = document.forms['register'];

var shipfname = theform['shipFirstName'];
var shiplname = theform['shipLastName'];
var shipadd1 = theform['shipAddress1'];
var shipadd2 = theform['shipAddress2'];
var shipcity = theform['shipCity'];
var shipstate = theform['shipState'];
var shipzip = theform['shipZip'];
var shipphone = theform['shipPhone'];

var shipphone1 = theform['shipPhone1'];
var shipphone2 = theform['shipPhone2'];
var shipphone3 = theform['shipPhone3'];

var shipemail = theform['email'];

var shipbillsame = theform['shipBillSameFlag'];

var billfname = theform['billFirstName'];
var billlname = theform['billLastName'];
var billadd1 = theform['billAddress1'];
var billadd2 = theform['billAddress2'];
var billcity = theform['billCity'];
var billstate = theform['billState'];
var billzip = theform['billZip'];
var billphone = theform['billPhone'];

var billphone1 = theform['billPhone1'];
var billphone2 = theform['billPhone2'];
var billphone3 = theform['billPhone3'];

	//validate shipping
	if(shipfname.value == ''){
		alert('Please enter a shipping address first name');
		shipfname.focus();
		return false;
	}else if(shipfname.value.length < 2){
		alert('Shipping address first name must consist of two or more characters');
		shipfname.focus();
		return false;
	}else if(shipfname.value.length >= 3){
		if(!hasVowel(shipfname.value)){
			alert('Shipping address first name must contain a vowel');
			shipfname.focus();
			return false;
		}else if(!hasForeignChars(shipfname.value)){
			alert('Shipping address first name contains invalid characters or a space');
			shipfname.focus();
			return false;
		}
	}
	if(shiplname.value == ''){
		alert('Please enter a shipping address last name');
		shiplname.focus();
		return false;
	}else if(shiplname.value.length < 2){
		alert('Shipping address last name must consist of two or more characters');
		shiplname.focus();
		return false;


	}else if(shiplname.value.length >= 3){
		if(!hasVowel(shiplname.value)){
			alert('Shipping address last name must contain a vowel');
			shiplname.focus();
			return false;
		}else if(!hasForeignChars(shiplname.value)){
			alert('Shipping address last name contains invalid characters or a space');
			shiplname.focus();
			return false;
		}/*else if(
			(shiplname.value.toLowerCase().indexOf('inc') > -1) ||
			(shiplname.value.toLowerCase().indexOf('incorporated') > -1) ||
			(shiplname.value.toLowerCase().indexOf('corp') > -1) || 
			(shiplname.value.toLowerCase().indexOf('corporation') > -1))
		{
				alert('Shipping address last name cannot be "Inc", "Incorporated", "Corp" or "Corporation"');
				shiplname.focus();
				return false;
		}*/
	}
	if(shipadd1.value == ''){
		alert('Shipping address line 1 cannot be blank');
		shipadd1.focus();
		return false;
	}else if(!numAlphaChars(shipadd1.value)){
		alert('Shipping address line 1 must contain a numeric and an alphabetical character');
		shipadd1.focus();
		return false;
	}
	if(shipcity.value == ''){
		alert('Please enter a shipping address city');
		shipcity.focus();
		return false;
	}
	if((shipstate.value == '') || (shipstate.value.length != 2) || !validStateChars(shipstate.value) ){
		alert('Please enter a shipping address state');
		shipstate.focus();
		return false;
	}
	if(shipzip.value == '' || !validZipChars(shipzip.value) || shipzip.value.length != 5){
		alert('Please enter a shipping address zip');
		shipzip.focus();
		return false;
	}
	
/*OLD*/
	if(isPhoneNumber(shipphone.value) == ''){
		alert('Please enter a valid shipping address phone number\ne.g) 123-456-7890');
		shipphone.focus();
		return false;
	}
	if((isValidAreaCode(shipphone.value) <= 200) || (isValidAreaCode(shipphone.value) >= 990) || (isValidAreaCode(shipphone.value) == 666)){
		alert('Shipping address phone number area code entered is invalid');
		shipphone.focus();
		return false;
	}
	if(isValidExchange(shipphone.value) == 555){
		alert('The exchange you entered for shipping address phone number is invalid\ne.g) xxx-555-xxxx');
		shipphone.focus();
		return false;
	}
	if(isPhoneNumberAllOnes(shipphone.value)){
		alert('The shipping address phone number you entered cannot contain all ones\ne.g) xxx-111-1111');
		shipphone.focus();
		return false;
	}
	if(isValidExchange(shipphone.value).substring(0,1) == 1){
		alert('The exchange you entered for shipping address phone number is invalid, it cannot start with "1"\ne.g) xxx-1xx-xxxx');
		shipphone.focus();
		return false;
	}
/*OLD*/	

/*NEW
	if(isAreaCodeAndExchange(shipphone1.value) == ''){
		alert('Please enter a valid shipping address area code');
		shipphone1.focus();
		return false;
	}
	if((isValidAreaCodeAndExchange(shipphone1.value) <= 200) || (isValidAreaCodeAndExchange(shipphone1.value) >= 990) || (isValidAreaCodeAndExchange(shipphone1.value) == 666)){
		alert('Shipping address area code entered is invalid');
		shipphone1.focus();
		return false;
	}
	if(isAreaCodeAndExchange(shipphone2.value) == ''){
		alert('Please enter a valid shipping address exchange');
		shipphone2.focus();
		return false;
	}
	if(isValidAreaCodeAndExchange(shipphone2.value) == 555){
		alert('The exchange you entered for shipping address phone number is invalid\ne.g) xxx-555-xxxx');
		shipphone2.focus();
		return false;
	}
	if(isValidAreaCodeAndExchange(shipphone2.value).substring(0,1) == 1){
		alert('The exchange you entered for shipping address phone number is invalid, it cannot start with "1"\ne.g) xxx-1xx-xxxx');
		shipphone2.focus();
		return false;
	}
	if(isValidLastFour(shipphone3.value) == ''){
		alert('Please enter valid shipping address last four digits');
		shipphone3.focus();
		return false;
	}
	if(isAllOnes(shipphone2.value, true) && isAllOnes(shipphone3.value, false)){
		alert('Shipping address phone number cannot contain all ones');
		shipphone2.focus();
		return false;
	}
NEW*/

	
	if(isEmail(shipemail.value)  == ''){
		alert('Please enter a valid shipping address email');
		shipemail.focus();
		return false;
	}
	
//validate billing
	if(!shipbillsame.checked){
		if(billfname.value == ''){
			alert('Please enter a billing address first name');
			billfname.focus();
			return false;
		}else if(billfname.value.length < 2){
			alert('Billing address first name must consist of two or more characters');
			billfname.focus();
			return false;
		}else if(billfname.value.length >= 3){
			if(!hasVowel(billfname.value)){
				alert('Billing address first name must contain a vowel');
				billfname.focus();
				return false;
			}else if(!hasForeignChars(billfname.value)){
				alert('Billing address first name contains invalid characters or a space');
				billfname.focus();
				return false;
			}
		}
		if(billlname.value == ''){
			alert('Please enter a billing address last name');
			billlname.focus();
			return false;
		}else if(billlname.value.length < 2){
			alert('Billing address last name must consist of two or more characters');
			billlname.focus();
			return false;
		}else if(billlname.value.length >= 3){
			if(!hasVowel(billlname.value)){
				alert('Billing address last name must contain a vowel');
				billlname.focus();
				return false;
			}else if(!hasForeignChars(billlname.value)){
				alert('Billing address last name contains invalid characters or a space');
				billlname.focus();
				return false;
			}/*else if(
				(billlname.value.toLowerCase().indexOf('inc') > -1) ||
				(billlname.value.toLowerCase().indexOf('incorporated') > -1) ||
				(billlname.value.toLowerCase().indexOf('corp') > -1) || 
				(billlname.value.toLowerCase().indexOf('corporation') > -1))
			{
					alert('Billing address last name cannot be "Inc", "Incorporated", "Corp" or "Corporation"');
					billlname.focus();
					return false;
			}*/
		}

		if(billadd1.value == ''){
			alert('billing address line 1 cannot be blank');
			billadd1.focus();
			return false;
		}else if(!numAlphaChars(billadd1.value)){
			alert('Billing address must contain a numeric and an alphabetical character');
			billadd1.focus();
			return false;
		}
		if(billcity.value == ''){
			alert('Please enter a billing address city');
			billcity.focus();
			return false;
		}
		if((billstate.value == '') || (billstate.value.length != 2) || !validStateChars(billstate.value) ){
			alert('Please enter a billing address state');
			billstate.focus();
			return false;
		}
		if(billzip.value == '' || !validZipChars(billzip.value) || billzip.value.length != 5){
			alert('Please enter a billing address zip');
			billzip.focus();
			return false;
		}
/*OLD*/
		if(isPhoneNumber(billphone.value) == ''){
			alert('Please enter a valid billing address phone number\ne.g) 123-456-7890');
			billphone.focus();
			return false;
		}
		if((isValidAreaCode(billphone.value) <= 200) || (isValidAreaCode(billphone.value) >= 990) || (isValidAreaCode(billphone.value) == 666)){
			alert('Billing address phone number area code entered is invalid');
			billphone.focus();
			return false;
		}
		if(isValidExchange(billphone.value) == 555){
			alert('The exchange you entered for billing address phone number is invalid\ne.g) xxx-555-xxxx');
			billphone.focus();
			return false;
		}
		if(isPhoneNumberAllOnes(billphone.value)){
			alert('The billing address phone number you entered cannot contain all ones\ne.g) xxx-111-1111');
			billphone.focus();
			return false;
		}
		if(isValidExchange(billphone.value).substring(0,1) == 1){
			alert('The exchange you entered for billing address phone number is invalid, it cannot start with "1"\ne.g) xxx-1xx-xxxx');
			billphone.focus();
			return false;
		}
/*OLD*/
/*NEW
		if(isAreaCodeAndExchange(billphone1.value) == ''){
			alert('Please enter a valid billing address area code');
			billphone1.focus();
			return false;
		}
		if((isValidAreaCodeAndExchange(billphone1.value) <= 200) || (isValidAreaCodeAndExchange(billphone1.value) >= 990) || (isValidAreaCodeAndExchange(billphone1.value) == 666)){
			alert('Billing address area code entered is invalid');
			billphone1.focus();
			return false;
		}
		if(isAreaCodeAndExchange(billphone2.value) == ''){
			alert('Please enter a valid billing address exchange');
			billphone2.focus();
			return false;
		}
		if(isValidAreaCodeAndExchange(billphone2.value) == 555){
			alert('The exchange you entered for billing address phone number is invalid\ne.g) xxx-555-xxxx');
			billphone2.focus();
			return false;
		}
		if(isValidAreaCodeAndExchange(billphone2.value).substring(0,1) == 1){
			alert('The exchange you entered for billing address phone number is invalid, it cannot start with "1"\ne.g) xxx-1xx-xxxx');
			billphone2.focus();
			return false;
		}
		if(isValidLastFour(billphone3.value) == ''){
			alert('Please enter valid billing address last four digits');
			billphone3.focus();
			return false;
		}
		if(isAllOnes(billphone3.value, false) && isAllOnes(billphone2.value, true)){
			alert('Billing address phone number digits cannot contain all ones');
			billphone3.focus();
			return false;
		}
NEW*/

	}
	theform['bmlSubmitInfo'].style.display = 'none'
	document.getElementById('bmlCancelTD').innerHTML = '&nbsp;'
	document.getElementById('processingUserData').innerHTML = 'One moment while we process your information...<br />Please DO NOT refresh the page or click the back browser button... Thank you!'
return true;
}

function bmlSelect(select, option){
var theform = document.forms["register"];
var theSelect = theform[select].options
	if(option != ''){
		for(opt=0;opt<theSelect.length;opt++){
			if(theSelect[opt].value == option){
				theform[select].selectedIndex = opt;
			}
		}
	}
}

