//once the field is changed, don't clear it the next time
function clearField(iPrev, iField){ 
	if(iPrev == iField.value){
		iField.value = "";
	}
}

/* validate email addr */
function validEmail(theField){
	if (theField.value == ""){
		theField.focus();
		alert("Email address is invalid.");
		return false;
	}
	if (theField.value.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) == -1){
		theField.focus();
		alert("Email address is invalid.");
		return false;
	}
	return true;
}

/* validate select box */
function validSelect(theField,msg){
	if(theField.options[theField.selectedIndex].value == "" || theField.options[theField.selectedIndex].value == 0){
		theField.focus();
		alert(msg);
		return false;
	  }
	return true;
}

/* popup */

function popup(vURL, vTarget, vOption){
	vFeature = "status," + vOption + ",scrollbars,resizable";
	vPage = window.open(vURL, vTarget, vFeature);
	vPage.focus();
}