/*
		Required field(s) validation- By NavSurf
		Visit NavSurf.com at http://navsurf.com
		Visit http://www.dynamicdrive.com for this script
		*/

		function aceresCheck(formobj){
			//1) Enter name of mandatory fields
			var fieldRequired = Array("service", "name", "address", "city", "state", "zip", "email");
			//2) Enter field description to appear in the dialog box
			var fieldDescription = Array("Type of Service", "Name", "Location of the Service", "City", "State", "Zip Code", "E-Mail");
			//3) Enter 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){
					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;
						default:
						if (obj.value == "" || obj.value == null){
							alertMsg += " - " + fieldDescription[i] + "\n";
						}
					}
				}
			}

			if (alertMsg.length == l_Msg){
				return true;
			}else{
				alert(alertMsg);
				return false;
			}
		}
		
		function acecomCheck(formobj){
			//1) Enter name of mandatory fields
			var fieldRequired = Array("name", "company", "address", "city", "state", "zip", "email", "service");
			//2) Enter field description to appear in the dialog box
			var fieldDescription = Array("Name", "Company Name", "Location of the Service", "City", "State", "Zip Code", "E-Mail", "Type of Service");
			//3) Enter 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){
					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;
						default:
						if (obj.value == "" || obj.value == null){
							alertMsg += " - " + fieldDescription[i] + "\n";
						}
					}
				}
			}

			if (alertMsg.length == l_Msg){
				return true;
			}else{
				alert(alertMsg);
				return false;
			}
		}
