  var email

  function isBlank(s)

  {

    var len=s.length

    var i

    for(i=0;i<len;++i)

    {

      if(s.charAt(i)!=" ") return false;

    }

    return true;

  }



  function validate(fieldName,fieldValue)

  {

    if(isBlank(fieldValue))

    {

      alert(fieldName+" cannot be left blank.");

          document.exim.Email.focus();

      return false

    }

    x=mailcheck(document.exim.Email.value,0);

    if (x==false)

    {

      document.exim.Email.focus();

        return false;

    }

    return true

  }



  function validateform()

  {
    var str = document.exim.Email.value;
    var posemail = str.lastIndexOf("blocked_isp");
    var posvemail = str.lastIndexOf("BLOCKED_ISP");

    if(!validate("The ForeName field",document.exim.forename.value))

        {

                document.exim.forename.focus();

                return false

        }

        if(!validate("The SurName field",document.exim.surname.value))

        {

                document.exim.surname.focus();

                return false

        }

    if(!validate("The Organization field",document.exim.Orgn.value))

        {

                document.exim.Orgn.focus();

            return false

        }

        if(!validate("The Address field",document.exim.Address.value))

        {

                document.exim.Address.focus();

                return false

        }

        if(!validate("The City field",document.exim.City.value))

        {

                document.exim.City.focus();

                return false

        }

        if(!validate("The Country field",document.exim.Country.value))

        {

                document.exim.Country.focus();

                return false

        }

        if(!validate("The ZIP field",document.exim.Zip.value))

    {

                document.exim.Zip.focus();

                return false

        }

        if(!validate("The Telephone field",document.exim.Tel.value))

        {

                document.exim.Tel.focus();

                return false

        }

    if(!validate("The E-mail field",document.exim.Email.value))

        {

                document.exim.Email.focus();

            return false

        }

       if ((posemail >= 0) || (posvemail >= 0))
       {
            alert("We do not accept blocked_isp mail address, because of mail bounce. Please suggest any other e-mail.");
            document.exim.Email.focus();
            return false;
       }

        if(!validate("The Requirement field",document.exim.Requirement.value))

        {

                document.exim.Requirement.focus();

                return false

        }

         if(!validate("The Background Profile field",document.exim.Background.value))

        {

                document.exim.Background.focus();

                return false

        }

        if(!validate("The Product Name field",document.exim.p_name.value))

        {

                document.exim.p_name.focus();

                return false

        }

    //if(!b_validate("Please click the 'I'm Done' button",document.resume.res.value))

    // return false

  }



  function mailcheck(valmail, valtype)

  {

    var n,atCount,dotCount,temp_1,temp_2,temp_ascii;

    var temp_3=0;

    atCount=0;

    dotCount=0;

    n=0;

    var st=new String;

    st = valmail.split(" ");

    st = st.join("");

    st = st.toLowerCase();

    if (valtype==0)

    {

      document.exim.Email.value=st;

    }

    else

    {

      document.myexim.E2.value=st;

    }



    temp_1=st.charAt(0);

    temp_ascii = st.charCodeAt(0);

    for(n=0;n<st.length;n++)

    {

      temp_2=st.charCodeAt(n);

      if ((temp_2<48)||(temp_2>57))

      {

        if((temp_2<97)||(temp_2>122))

        {

          if ((temp_2==95)||(temp_2==46)||(temp_2==64)||(temp_2==45))

          {

            //alert("special but correct");

          }

          else

          {

            alert("Please enter a valid Email Address");

            count=0;

                        document.exim.Email.focus();

            return false;

          }

        }

      }



      if(st.charAt(n)=='@'&&n==0) atCount=atCount+1;

      if(st.charAt(n)=='@'&&st.charAt(n+1)=='.')atCount=atCount+1;

      if(st.charAt(n)=='@')atCount=atCount+1;

      if(st.charAt(n)=='.')

      {

        if(st.charAt(n+1)=='.'||n==st.length-1)atCount=2;

        dotCount=dotCount+1;

      }



      if(st.charAt(n)=='.')

      {

        if((st.charAt(n+1)=='@')||(st.charAt(n-1)=='@'))

        {

          alert("Please enter a valid Email address");

          return false;

        }

      }

    }



    if (atCount!=1 || dotCount<1)

    {

      alert("Please enter a valid Email address");

      return false;

    }



    /*changed here so that it accepts number as that First Character

    */



    else if((temp_ascii<48)||(temp_ascii>122))

    {

      alert("Please enter a valid Email address");

      count=0;

      return false;

    }
    else

    {

      x=st.lastIndexOf("@");

      y=st.lastIndexOf(".");

      if (y<x)

      {

        alert("Please enter a valid Email address");

        return false;

      }

    }

  }

