function admCont(s,qmsg) {
  if (s[s.selectedIndex].value=='delete') return(confirm("Are you sure you want to delete this " + qmsg + "?"));
  return true;
}

// Reset input field color when changed
function fldReset() { this.style.backgroundColor=''; this.style.borderColor='#bbbbbb'; }

// display error message, color error field, set 
function setErm(f,m) {
  alert(m);
  f.onchange = fldReset;
  f.style.backgroundColor="#ff9"; 
  f.style.borderColor="#f00"; 
  f.focus(); 
  return false;
}

// Check field(s) for required input, When a field is found with missing input,
// alert user, set field pink, and set focus to it.
function chkRqrd(s) {
  if (arguments.length<2) return true
  for ( var i = 1; i < arguments.length; i++ ) {
    fptr = s[arguments[i]];								// Get form field pointer
    if ( fptr.value=='' ) return setErm(fptr,'You must enter your name to continue.')	// Check field for content
  }
  return true;
}

function chkEmail(s) {
  if (s.indexOf('@')==-1) return false;
  if (s.indexOf('.')==-1) return false;
  return true;
}

// Check mailto form field(s) for required input, When a field is found with missing input,
// alert user, set field pink, and set focus to it.
function chkContact(s) {
  if (s.firstname.value=='')		return setErm(s['firstname'],		'You must enter your first name to continue.')
//  if (s.lastname.value=='')		return setErm(s['lastname'],		'You must enter your last name to continue.')
//  if (s.street.value=='')		return setErm(s['street'],		'You must enter your street address to continue.')
//  if (s.city.value=='')			return setErm(s['city'],		'You must enter your city to continue.')
//  if (s.state.value=='')		return setErm(s['state'],		'You must enter your state to continue.')
//  if (s.zipcode.value=='')		return setErm(s['zipcode'],		'You must enter your zipcode to continue.')
//  if (s.dayphone.value=='')		return setErm(s['dayphone'],		'You must enter your day time phone number to continue.')
  if (s.email.value=='')		return setErm(s['email'],		'You must enter your email address to continue.')
  if (chkEmail(s.email.value)==false)	return setErm(s['email'],		'Your E-mail address appears to be invalid. Plaese check!')
  return true;
}

function vuphoto(pid,caption) {
  window.open("photo.php?pid="+pid+"&caption="+caption,'photo','height=520,width=500,scrollbars,resize');
  return false; 
}

function verifyDelete(s) { return(confirm("Are you sure you want to delete " + s + "?")); }

function photoedit(pid) {
  window.open("admin_photo.php?pid="+pid,'photo','height=350,width=500,scrollbars,resize');
  return false; 
}

function charteredit(cid) {
  window.open("admin_charter.php?cid="+cid,'charter','height=150,width=500,scrollbars,resize');
  return false; 
}

function reptedit(rid) {
  window.open("admin_report.php?rid="+rid,'report','height=460,width=500,scrollbars,resize');
  return false; 
}

