
  /* This function creates a jump menu from a menu box */
  
  function jumpPage(LabelType)
  {
    newPage = LabelType.options[LabelType.selectedIndex].value
      if (newPage != "")
        {
         window.location = newPage
        }
  }

 /* This function checks for a valid email address */

   function validEmail(email)
    {
      invalidChars = " /:,;"       /* array containing invalid chars */

      /* Checks for email address not blank */
      if (email=="")
       {
        return false
       }

      /* Checks for invalid characters */

      for (i = 0; i < invalidChars.length; i++)
       {
         badChar = invalidChars.charAt(i)
         if (email.indexOf(badChar,0)>-1)   /* ,0 ensures search starts at pos 0 each time!! */
          {
            return false
          }
       }

      /* check for @ */

      atPos = email.indexOf("@",1)      /* @ must be in pos 1 or greater */
      if (atPos == -1)
        {
          return false
        }

     /* There must only be 1 @ in an email address */

     if (email.indexOf("@",atPos+1) != -1)
       {
         return false
       }

     /* There must be a . after the @ symbol */

     periodPos = email.indexOf(".",atPos+2)   /* 'cos there can't be @. in an address */
     if (periodPos == -1)
      {
       return false
      }

     /* checks for at at least 2 chars after the . */

     if (periodPos+3 > email.length)
      {
        return false
      }

      return true
    }



   function checkLogin(customerLoginForm)
    {

      /* To check email address was valid */

      if (customerLoginForm.name.value=="")
        {
          alert("If you already have a USER NAME you must enter it here.")
          customerLoginForm.name.focus()
          return false
        }


      /* to check if password has been entered*/

      if (customerLoginForm.password.value=="")
        {
          alert("If you already have a PASSWORD you must enter it here.")
          customerLoginForm.password.focus()
          return false
        }


      return true    /* if everything is alright */
    }

