var DFMT = ''; var ACTMN = '';

if 	(document.getElementById)	var DOMS = 3	// Supports Web Standard (getElementById)
else if	(document.all)		 	var DOMS = 2	// Supports MS document.all
else if	(document.layers)	 	var DOMS = 1	// Supports NS layers
else				 	var DOMS = 0;	// No DOM gateway support

// Return DOM Handle for specified DOM object ID
function getObj(oid) {
  switch(DOMS) {					// Check for various browsers
    case 1: return(document[oid]);			// Supports Layers (NS4)
    case 2: return(document.all[oid]);			// Supports document.all (ie4)
    case 3: return( ((document.getElementById(oid))?document.getElementById(oid):'') );	// Supports getElementById
  }
}

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 common address and contact information on contact forms
function chkContact(s) {
   if (s.Name.value=='')		return setErm(s['Name'],		'You must enter your name to continue.');
   if (s.Address1.value=='')		return setErm(s['Address1'],		'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.Country[s.Country.selectedIndex].value=="US") && (s.State.selectedIndex==0))  return setErm(s['State'],'You must indicate a state to continue.');
   if (s.ZipCode.value=='')		return setErm(s['ZipCode'],		'You must enter your ZipCode to continue.');
   if (s.Telephone.value=='')		return setErm(s['Telephone'],		'You must enter your daytime phone number to continue.');
   if (s.EveTelephone.value=='')	return setErm(s['EveTelephone'],	'You must enter your evening phone number to continue.');
   if (s['MM_EMAILTO[]'][1].value=='')	return setErm(s['MM_EMAILTO[]'][1],	'You must enter your email address to continue.');
   s.Email.value = s['MM_EMAILTO[]'][1].value;
   return true;
}

// Check 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 chkStart(s) {
   if (s.email.value=='') return setErm(s['email'],'You must enter your email address to continue.');
   return true;
}
