/*----------------------------------------------------------------
Write status text to browser status bar on bottom
----------------------------------------------------------------*/
function setStatusBarText(strText){
  var strText;
  
  window.defaultStatus = "Bill Warren";  
  window.status = strText;
  
}

/*----------------------------------------------------------------
Replace the current URI of any web page with a new one using the
following function
----------------------------------------------------------------*/
function directUser(refURL){
  var refURL;
  
  location.replace(refURL);
}


/*----------------------------------------------------------------
Verify if the email address value passed is valid.
We are not using an SMTP validation. We cann't control totally
what people actually write down as email addresses
----------------------------------------------------------------*/
function isEmail(refEmail){
  var refEmail;
  
  if(refEmail.indexOf("@") == -1 || refEmail.indexOf(".") == -1){
     return false;
    }
  return true;
}

/*----------------------------------------------------------------
Clear form input fields
----------------------------------------------------------------*/
function clearForm(refForm){
  var refForm;
  var objForm;
  
  objForm = eval("document." + refForm);
  
  return true;
 }
  
/*----------------------------------------------------------------
Validate form input on the contact us form <content_contact.php>
----------------------------------------------------------------*/
function validateForm(refForm){
  var refForm;
  var objForm;
  
  objForm = eval("document." + refForm);
  
  if(objForm.last_name && objForm.last_name.value == ""){
    alert("Please enter your Last Name!");
	objForm.last_name.focus();
    return false
  }
  
  if(objForm.full_name && objForm.full_name.value == ""){
    alert("Please enter your Full Name!");
	objForm.full_name.focus();
    return false
  }
  
  if(objForm.first_name && objForm.first_name.value == ""){
    alert("Please enter your First Name!");
	objForm.first_name.focus();
    return false
  }
  
  if(objForm.address1 && objForm.address1.value == ""){
    alert("Please enter your Street Address!");
	objForm.address1.focus();
    return false
  }
    
  if(objForm.city && objForm.city.value == ""){
    alert("Please enter your City Name!");
	objForm.city.focus();
    return false
  }
  
  if(objForm.state && objForm.state.value == ""){
    alert("Please select your State Name!");
	objForm.state.focus();
    return false
  }
   
  if(objForm.zip_code && objForm.zip_code.value == ""){
    alert("Please Enter your Zip Code!");
	objForm.zip_code.focus();
    return false
  }  
  
  if(objForm.phone && objForm.phone.value == ""){
    alert("Please enter your Phone Number!");
	objForm.phone.focus();
    return false
  }
  
   if((objForm.email && objForm.email.value == "") || !isEmail(objForm.email.value)){
    alert("Please enter your Email Account!");
	objForm.email.focus();
    return false
  }
  
  if(objForm.comments && objForm.comments.value == ""){
    alert("Please enter your Message");
	objForm.comments.focus();
    return false
  }
  
  return true; 
}