

/*	****************************************************
				Common Functions
	**************************************************** */

function stick(nav) {

	changeImages(nav, "images/" + nav + "-over.png");
	stuck = nav;
	
}




function surfaceSubNav() {		
	$("#subnavContainer").css("z-index", 200);
	if($.browser.mozilla) $("#subnavContainer").focus();
	
}

function sinkSubNav() {
	$("#subnavContainer").css("z-index", 1).mouseOut();
	if($.browser.mozilla) $("#subnavContainer").focus();
}



function validate() {

	var valid = true;
	var note = "";
	var fields = Array("First Name", "Last Name", "Date(s) Requested", "Number of people in group", "Email Address", "Phone Number", "Mailing Address", "Zip", "State", "City");

	// loop through and check to see if they are blank
	for(var i=0; i<fields.length; i++) {
		
		// define the field/labels
		fieldlbl = document.getElementById(fields[i]);
		field = document.doc_form[fields[i]];

		// if it exists, work with it
		if(field != null && fieldlbl != null) {

			if(field.value == "") {
			
				field.className = "form_hi";
				valid = false;
				note = "Please fill out all of the highlighted fields.";
			
			} else {
			
				field.className = "";
			
			}
		
		} else {
		
			alert("The field or label: " + fields[i] + " was not found.");
		
		}
	
	}
	
	if(valid) {
		form.submit();
	} else {
	
		// uncomment this to alert the user
		alert(note);
	}
	
}
