// JavaScript Document
//function checks telephone field to make sure the entry is a number
function checkForNumber(fieldValue) {
	var numberCheck = isNaN(fieldValue);
	if (numberCheck == true) {
	window.alert("enter a number!");
	return false;
	}
}

//function checks individual fields to make sure an entry has been made
//before allowing the form to be submitted
function checkEntry() {
if (document.forms[0].name.value == "")
	window.alert("You didn't enter your name ");
if (document.forms[0].address.value == "")
	window.alert("You didn't enter your address");
if (document.forms[0].city.value == "")
	window.alert("You didn't enter your city");
if (document.forms[0].province.value == "")
	window.alert("You didn't enter your province");
if ((document.forms[0].area.value == "") ||
   (document.forms[0].exchange.value == "") ||
   (document.forms[0].phone.value == ""))
	window.alert("You didn't enter your phone number");
if (document.forms[0].e_mail.value == "")
	window.alert("You didn't enter your e-mail address");
}

function updatesum() {
document.forms[0].subtotal.value = (document.forms[0].quantity.value -0) * (document.forms[0].price.value -0);
}
function updatesum2() {
document.forms[0].subtotal2.value = (document.forms[0].quantity2.value -0) * (document.forms[0].price2.value -0);
}
function updatesum3() {
document.forms[0].subtotal3.value = (document.forms[0].quantity3.value -0) * (document.forms[0].price3.value -0);
}
function updatesum4() {
document.forms[0].subtotal4.value = (document.forms[0].quantity4.value -0) * (document.forms[0].price4.value -0);
}
function updatesum5() {
document.forms[0].subtotal5.value = (document.forms[0].quantity5.value -0) * (document.forms[0].price5.value -0);
}
function updatesum6() {
document.forms[0].subtotal6.value = (document.forms[0].quantity6.value -0) * (document.forms[0].price6.value -0);
}
function updatesum7() {
document.forms[0].subtotal7.value = (document.forms[0].quantity7.value -0) * (document.forms[0].price7.value -0);
}
function updatesum8() {
document.forms[0].subtotal8.value = (document.forms[0].quantity8.value -0) * (document.forms[0].price8.value -0);
}
function updatesum9() {
document.forms[0].subtotal9.value = (document.forms[0].quantity9.value -0) * (document.forms[0].price9.value -0);
}
function updatesum10() {
document.forms[0].subtotal10.value = (document.forms[0].quantity10.value -0) * (document.forms[0].price10.value -0);
}

function itemTotal() {
document.forms[0].item_total.value = (document.forms[0].subtotal.value -0) + (document.forms[0].subtotal2.value -0) + (document.forms[0].subtotal3.value -0) + (document.forms[0].subtotal4.value -0) + (document.forms[0].subtotal5.value -0);
}

/*auto change field focus */

			function focusField(me) {
				if (me.className == 'formInputField') me.value='';
				me.className = 'formInputFieldSelected';
			}
			
			function blurField(me) {
				me.className = 'formInputFieldFilled';
			}
			
			function firstField(formName,formField) {
				document[formName][formField].focus();
			
			}

			function nextField(me,formName) {
				if (me.value.length == me.maxLength) {
					var next = me.tabIndex;
					if (next < formName.elements.length) formName.elements[next].focus();
				}
			}
