//  v3.0
function verifyDelete(s) { return(confirm("Are you sure you want to delete " + s + "?")); }

// 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;
}

function chkContact(s) {
   if ((s.contacthow.value=='Phone')&&(s.dayphone.value=='')&&(s.evephone.value=='')) return setErm(s['dayphone'],	'You must enter a phone number to continue.');
   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.zipcode.value=='')		return setErm(s['zipcode'],	'You must enter your Zip Code to continue.');
   //if (s.dayphone.value=='')		return setErm(s['dayphone'],	'You must enter your daytime phone number to continue.');
// if (s.evephone.value=='')		return setErm(s['evephone'],	'You must enter your evening phone number to continue.');
   if ((s.contacthow.value=='E-Mail')&&(s.email.value==''))		{
     if ((s.email.value.indexOf('@')==-1) || (s.email.value.indexOf('.')==-1)) return setErm(s['email'],'Your E-mail address appears to be invalid. Plaese check!');
     return setErm(s['email'],	'You must enter your email address to continue.');
   }
   return true;
}

function editEvent(eid) {
  window.open('admin_event.php?eid='+eid,'event','height=180,width=500,scrollbars');
  return false;
}

function editPhoto(eid,epid) {
  window.open("admin_photos_edit.php?eid="+eid+"&epid="+epid,'photo','height=600,width=800,scrollbars,resize');
  return false; 
}

function editTestimonial(tmid)		{ window.open('admin_edit_testimonial.php?tmid='+tmid,'testimonial','height=500,width=500,scrollbars,resizable'); return false; }
