// if not a number, toss an alert and reset the field to 0
function validateInt(field,orig)
{
  if(isNaN(field.value))
  {
    alert("That is not a valid quantity.")
    field.value = orig;
    return false;
  }
}

// if blank, toss an alert
function validateNotBlank(field,desc){
  if(field.value == "")
  {
    alert("The " + desc + " can not be blank.");
    return false;
  }
}



  var re;
  re = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,})+$/;
  var errors = "";



  function validateWinWellnessForm(form)
  {
    if(form. Contact0FirstName.value == "")
    {
      errors += " - First Name\n";
    }
    if(form. Contact0LastName.value == "")
    {
      errors += " - Last Name\n";
    }
    if (re.test(form. Contact0Email.value) == false)
    {
      errors += " - A valid email address\n";
    }
    if(form. Contact0Phone1.value == "")
    {
      errors += " - Phone\n";
    }
    if (errors.length > 0)
    {
      alert("Please enter the following information: \n\n" + errors);
      errors = "";
      return false;
    }
    return true;
}


  function validate10PercentForm(form)
  {
    if(form. Contact0FirstName.value == "")
    {
      errors += " - First Name\n";
    }
    if (re.test(form. Contact0Email.value) == false)
    {
      errors += " - A valid email address\n";
    }
    if (errors.length > 0)
    {
      alert("Please enter the following information:\n\n " + errors);
      errors = "";
      return false;
    }
    return true;
 }


  function delayer(){
  	top.location='/';
  }

  function redirectToHome()
  {
  	setTimeout('delayer()', 10000);
  }
  

var isNN = (navigator.appName.indexOf("Netscape") != -1);
var isIE = (navigator.appName.indexOf("Microsoft") != -1);

// condence this and showHideDiv2 when you can
function showHideDiv(obj,show)
{
  if(show == 0)
  {
	if(isIE)
	{
	  document.all[obj].style.display = 'none';
	}else{
	  obj = document.getElementById(obj);
	  obj.setAttribute('style','display:none');
	}
  }else{
	if(isIE)
	{
	  document.all[obj].style.display = 'block';
	}else{
	  obj = document.getElementById(obj);
	  obj.setAttribute('style','display:block');
	}
  }
}

function validateTherapistForm(form)
{
  var re;
  re = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,})+$/;
  var errors = "";
if(form.Contact0FirstName.value == "")
{
  errors += " - First Name\n";
}
if(form.Contact0LastName.value == "")
{
  errors += " - Last Name\n";
}
if (re.test(form.Contact0Email.value) == false)
{
  errors += " - A valid email address\n";
}
if(form.Contact0_ContactFormLaurelAlexander0.value == "")
{
  errors += " - Your Question\n";
}
if (errors.length > 0)
{
  alert("Please enter the following information: \n\n" + errors);
  errors = "";
  return false;
}
return true;
}

function validateNewsletterForm(form)
{
  var re;
  re = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,})+$/;
  var errors = "";
if(form.Contact0FirstName.value == "")
{
  errors += " - First Name\n";
}
if(form.Contact0LastName.value == "")
{
  errors += " - Last Name\n";
}
if (re.test(form.Contact0Email.value) == false)
{
  errors += " - A valid email address\n";
}
if (errors.length > 0)
{
  alert("Please enter the following information: \n\n" + errors);
  errors = "";
  return false;
}
return true;
}


function validateContactForm(form)
{
  var re;
  re = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,})+$/;
  var errors = "";
if(form.Contact0FirstName.value == "")
{
  errors += " - First Name\n";
}
if(form.Contact0LastName.value == "")
{
  errors += " - Last Name\n";
}
if (re.test(form.Contact0Email.value) == false)
{
  errors += " - A valid email address\n";
}
if(form.Contact0_ContactUsMessage0.value == "")
{
  errors += " - Your Question\n";
}
if(form['captcha.typed'].value == "")
{
  errors += " - Security Code\n";
}
if (errors.length > 0)
{
  alert("Please enter the following information: \n\n" + errors);
  errors = "";
  return false;
}
return true;
}