<!--
// Copyright information must stay intact
// FormCheck v1.10
// Copyright NavSurf.com 2002, all rights reserved
// Creative Solutions for JavaScript navigation menus, scrollers and web widgets
// Affordable Services in JavaScript consulting, customization and trouble-shooting
// Visit NavSurf.com at http://navsurf.com

function neworderCheck(formobj){
	// name of mandatory fields
	var fieldRequired = Array("cname1", "ccity1", "cstate1", "czip1", "cgender1", "chair1", "ceye1", "cht1", "cwt1", "cdob1", "cage1", "cermcon1", "cemerrelation1", "cemerphone1", "cparname1", "cphone11", "cemail1", "bfname", "blname", "bpayment", "bcardnbr", "bccode", "bexpmon", "bexpyr", "bshipping", "sstreet", "sname", "scity", "sstate", "szip", "scountry");
	// field description to appear in the dialog box
	var fieldDescription = Array("First Child's Name", "First Child's City", "First Child's State", "First Child's Zip Code", "First Child's Gender", "First Child's Hair Color", "First Child's Eye Color", "First Child's Height", "First Child's Weight", "First Child's Date of Birth", "First Child's Age When Photo Taken", "First Child's Emergency Contact", "First Child's Emergency Contact Relationship", "First Child's Emergency Contact Phone", "First Childs Parent's Name", "First Childs Parent's Phone", "First Childs Parent's Email Address", "Billing First Name", "Billing Last Name", "Billing Payment Method", "Credit/Debit Card Number", "3 Digit Card Code", "Credit/Debit Card Expiration Date - Month", "Credit/Debit Card Expiration Date - Year", "Shipping Method", "Shipping Street Address", "Name of person to ship to", "City to Ship to", "State to Ship to", "Zip Code of Shipping Address", "Country to Ship to");
	// dialog message
	var alertMsg = "Please complete the following fields:\n";
	
	var l_Msg = alertMsg.length;
	
	for (var i = 0; i < fieldRequired.length; i++){
		var obj = formobj.elements[fieldRequired[i]];
		if (obj){
			if (obj.type == null){
				var blnchecked = false;
				for (var j = 0; j < obj.length; j++){
					if (obj[j].checked){
						blnchecked = true;
					}
				}
				if (!blnchecked){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
				continue;
			}

			switch(obj.type){
			case "select-one":
				if (obj.selectedIndex == -1 || obj.options[obj.selectedIndex].text == ""){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
				break;
			case "select-multiple":
				if (obj.selectedIndex == -1){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
				break;
			case "text":
			case "textarea":
				if (obj.value == "" || obj.value == null){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
				break;
			case "file":
				if (obj.value == "" || obj.value == null){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
				break;
			default:
			}
		}
	}

	if (alertMsg.length == l_Msg){
		return true;
	}else{
		alert(alertMsg);
		return false;
	}
}
// -->


