<!--

FirstPart = '<img src="images/access';
LastPart = '.jpg" height="50" width="150">';
FirstInput = '<input type="hidden" name="imageid" value="';
LastInput = '" />';
r = Math.ceil(Math.random() * 6);


function printImage() {
document.write(FirstPart + r + LastPart);
}

function printInput() {
document.write(FirstInput + r + LastInput);
}

function Validate(depoForm)
{
  if( document.forms.depoForm.Name.value == "" )
  {
    alert("Please enter contact person's name.")
    depoForm.Name.focus()
    depoForm.Name.select()
    return false
  }
  
  else
  {

    if(!validEmail(depoForm.email.value))
    {
      alert("Missing or invalid e-mail address.")
      depoForm.email.focus()
      depoForm.email.select()
      return false
    }

    else
    {
      if(!validPhone(depoForm.phone.value))
      {
        alert("Please enter your telephone number.")
        depoForm.phone.focus()
        depoForm.phone.select()
        return false
      }
 
      else
      {
        document.forms.depoForm.submit();
      }
	}
  }
}

function validPhone(entry)
{
  invalidChars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUV!@%^&*+=;"

  if (entry == "")
  {
    return false
  }

  for (i=0; i<invalidChars.length; i++)
  {
    badChar = invalidChars.charAt(i)
    if (entry.indexOf(badChar,0) > -1)
    {
      return false
    }
  }

  return true
}

function validEmail(email)
{
  invalidChars = " /:,;"

  if (email == "")
  {
    return false
  }

  for (i=0; i<invalidChars.length; i++)
  {
    badChar = invalidChars.charAt(i)
    if(email.indexOf(badChar,0) > -1)
    {
      return false
    }
  }

  atPos = email.indexOf("@",1)
  if (atPos == -1)
  {
    return false
  }

  if (email.indexOf("@",atPos+1) > -1)
  {
    return false
  }

  periodPos = email.indexOf(".",atPos)
  if (periodPos == -1)
  {
    return false
  }

  if (periodPos+3 > email.length)
  {
    return false
  }
  return true
}

//-->

