function isEmailAddr(email)
{
  var result = false
  var theStr = new String(email)
  var index = theStr.indexOf("@");
  if (index > 0)
  {
    var pindex = theStr.indexOf(".",index);
    if ((pindex > index+1) && (theStr.length > pindex+1))
	result = true;
  }
  return result;
}

function checkEmail(frmSignup)
{

  if (document.frmSignup.txtEmail.value == "")
  {
    alert("Please enter an EMAIL ADDRESS to subscribe to our newsletter.");
    document.frmSignup.txtEmail.focus();
    return (false);
  }

  if (!isEmailAddr(document.frmSignup.txtEmail.value))
  {
    alert("Please enter a VALID EMAIL ADDRESS in the form: yourname@yourdomain.com");
    document.frmSignup.txtEmail.focus();
    return (false);
  }
   
  if (document.frmSignup.txtEmail.value.length < 3)
  {
    alert("Please make sure you enter at least 3 characters that make up a VALID EMAIL ADDRESS.");
    document.frmSignup.txtEmail.focus();
    return (false);
  }
  return (true);
}

function whatWeDo(){

   var highNum=3;  //1 + highest number of images (if 5 returns 0-4)
   aRandomNum = Math.round(Math.random() * highNum-1);
   if (aRandomNum < 0) aRandomNum = 0;
      document.write('<img src="images/whatwedo'+aRandomNum+'.jpg" border="0" height="200" width="215">');
}

function whoWeAre(){

   var highNum=2;  //1 + highest number of images (if 5 returns 0-4)
   aRandomNum = Math.round(Math.random() * highNum-1);
   if (aRandomNum < 0) aRandomNum = 0;
      document.write('<img src="images/whoweare'+aRandomNum+'.jpg" border="0" height="200" width="215">');
}
