// -- open CMS admin window:
function OpenAdmin(theURL){
	LeftPosition = (screen.width) ? (screen.width)-510 : 0;
	cmsheight = (screen.height) ? (screen.height)*.75 : 550;
	settings = 'height='+cmsheight+',width=500,top=0,left='+LeftPosition+',scrollbars=yes,resizable=yes'
	win = window.open(theURL,'viewit',settings)
}

// -- required form fields for "Contact" form:
function checkContactFields() {
missinginfo = "";
if (document.formContact.name.value == "") {
missinginfo += "\n     -  name";
}
if (document.formContact.address.value == "") {
missinginfo += "\n     -  address";
}
if ((document.formContact.email.value == "") || 
(document.formContact.email.value.indexOf('@') == -1) || 
(document.formContact.email.value.indexOf('.') == -1)) {
missinginfo += "\n     -  valid email";
}
if (document.formContact.phone.value == "") {
missinginfo += "\n     -  phone";
}
if (document.formContact.fax.value == "") {
missinginfo += "\n     -  fax";
}
if (document.formContact.profession.value == "") {
missinginfo += "\n     -  profession";
}
if (document.formContact.reason.value == "") {
missinginfo += "\n     -  reason for contact";
}
if (missinginfo != "") {
missinginfo ="Please fill in the following fields:\n" +
missinginfo + "\n\nThanks!";
alert(missinginfo);
return false;
}
else return true;
}

//---- show/hide div on contact.php (for "other" field):
function showExtra(theCombo) {
	//get a reference to the control
	var myText = document.getElementById("otherInfo");
	
	//now check to what the new selection is
	if (theCombo.options[theCombo.selectedIndex].value == "Other-ref") {
		myText.style.display = "";
	}
	else {
		myText.value="";
		myText.style.display = "none";
	}
}
	
function showExtra2(theCombo2) {
	//get a reference to the control
	var myText = document.getElementById("otherInfo2");
	
	//now check to what the new selection is
	if (theCombo2.options[theCombo2.selectedIndex].value == "Other") {
		myText.style.display = "";
	}
	else {
		myText.value="";
		myText.style.display = "none";
	}
}