// -- required form fields for "Contact" form:
function checkContactFields() {
missinginfo = "";
if (document.formContact.name.value == "") {
missinginfo += "\n     -  name";
}
if ((document.formContact.email.value == "") || 
(document.formContact.email.value.indexOf('@') == -1) || 
(document.formContact.email.value.indexOf('.') == -1)) {
missinginfo += "\n     -  valid email";
}
if (document.formContact.message.value == "") {
missinginfo += "\n     -  message";
}
if (missinginfo != "") {
missinginfo ="Please fill in the following fields:\n" +
missinginfo + "\n\nThanks!";
alert(missinginfo);
return false;
}
else return true;
}

// -- Open 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)
}

//---- forgot password popup:
function pwpop(URL) { 
  window.open(URL,'pw','scrollbars=yes,resizable=yes,width=325,height=300');
}

// -- toggle home page alert box --
function toggleDiv(divid){
	if(document.getElementById(divid).style.display == 'none'){
		document.getElementById(divid).style.display = 'block';
	}else{
		document.getElementById(divid).style.display = 'none';
	}
}


