//  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.fname.value=='')		return setErm(s['fname'],	'You must enter your first name to continue.');
   if (s.lname.value=='')		return setErm(s['lname'],	'You must enter your last name to continue.');
   if (s.addr1.value=='')		return setErm(s['addr1'],	'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 Zip Code to continue.');
   if (s.email.value=='')		return true;
   if (s.email.value.indexOf('@')==-1)	return setErm(s['email'],'Your E-mail address appears to be invalid. Plaese check!');
   if (s.email.value.indexOf('.')==-1)	return setErm(s['email'],'Your E-mail address appears to be invalid. Plaese check!');
   return true;
}
  
function editStaff(staffid) {
  window.open('admin_staff_edit.php?staffid='+staffid,'staff','height=550,width=700,scrollbars,resizable'); return false; }

function editOrder(staffid) {
  window.open('admin_staff_order.php?staffid='+staffid,'order','height=250,width=400,scrollbars,resizable'); return false; }

