<!--

/***********************************************
* Required field(s) validation v1.10- By NavSurf
* Visit Nav Surf at http://navsurf.com
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

function formCheck(formobj){
	// Enter name of mandatory fields
	var fieldRequired = Array("purchased", 
							"spent_get_gc_bag",
							"participate_gc_again", 
							"referral",
							"how_often_purchase_beauty",
							"email_permission",
							"name_first", 
							"name_last", 
							"city", 
							"state", 
							"zip",
							"email",
							"agreement");
	// Enter field description to appear in the dialog box
	var fieldDescription = Array("Which products did you purchase to receive your free Glam Camp gift bag?", 
							"How much did you spend to receive your free Glam Camp gift bag?", 
							"Would you participate in a Glam Camp promotion again?",
							"How did you hear about this Glam Camp promotion?",
							"How often do you purchase GLAM (beauty) products?",
							"Would you like to sign up to receive emails on future promotions that you may be interested in?",
							"Enter First Name", 
							"Enter Last Name", 
							"Enter City", 
							"Select Your State", 
							"Enter Zip Code",
							"Enter Email Address",
							"You Must Agree to the rules to enter.");
	// dialog message
	var alertMsg = "Please complete the following fields & questions:\n\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\n";
				}
				break;
			case "select-multiple":
				if (obj.selectedIndex == -1){
					alertMsg += " - " + fieldDescription[i] + "\n\n";
				}
				break;
			case "text":
			case "textarea":
				if (obj.value == "" || obj.value == null){
					alertMsg += " - " + fieldDescription[i] + "\n\n";
				}
				break;
			default:
			}
			if (obj.type == undefined){
				var blnchecked = false;
				for (var j = 0; j < obj.length; j++){
					if (obj[j].checked){
						blnchecked = true;
					}
				}
				if (!blnchecked){
					alertMsg += " - " + fieldDescription[i] + "\n\n";
				}
			}
		}
	}

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