<!--
// 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", "bpayemail", "bshipping", "sstreet", "sname", "scity", "sstate", "szip", "scountry");
	// field description to appear in the dialog box
	var fieldDescription = Array("First Pet's Name", "First Pet's City", "First Pet's State", "First Pet's Zip Code", "First Pet's Gender", "First Pet's Hair Color", "First Pet's Eye Color", "First Pet's Height", "First Pet's Weight", "First Pet's Date of Birth", "First Pet's Age When Photo Taken", "First Pet's Emergency Contact", "First Pet's Emergency Contact Relationship", "First Pet's Emergency Contact Phone", "First Pets Owner's Name", "First Pets Owner's Phone", "First Pets Owner's Email Address", "Paypal Email Address to Send Payment Request to", "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;
	}
}
// -->

