
function IsValidEmail(str)

{

        var at="@"

        var dot="."

        var lat=str.indexOf(at)

        var lstr=str.length

        var ldot=str.indexOf(dot)

        if (str.indexOf(at)==-1){

           alert("Invalid E-mail ID")

           document.form3.field_2.value="";

            document.form3.field_2.focus();

           return false

        }



        if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){

           alert("Invalid E-mail ID")

           document.form3.field_2.value="";

            document.form3.field_2.focus();

           return false

        }



        if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){

            alert("Invalid E-mail ID")

            document.form3.field_2.value="";

            document.form3.field_2.focus();

            return false

        }



         if (str.indexOf(at,(lat+1))!=-1){

            alert("Invalid E-mail ID")

            document.form3.field_2.value="";

            document.form3.field_2.focus();

            return false

         }



         if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){

            alert("Invalid E-mail ID")

            document.form3.field_2.value="";

            document.form3.field_2.focus();

            return false

         }



         if (str.indexOf(dot,(lat+2))==-1){

            alert("Invalid E-mail ID")

            document.form3.field_2.value="";

            document.form3.field_2.focus();

            return false

         }



         if (str.indexOf(" ")!=-1){

            alert("Invalid E-mail ID")

            document.form3.field_2.value="";

            document.form3.field_2.focus();

            return false

         }



          return true

}

function isInteger(s)

{   var i;

    for (i = 0; i < s.length; i++)

    {

         // Check that current character is number.

         var c = s.charAt(i);

         if (((c < "0") || (c > "9")))

  return false;

    }

    // All characters are numbers.

    return true;

}

function check()

{

if(document.form3.field_1.value=="")

{

alert("Please enter the Name");

document.form3.field_1.focus();

return false;


}


if(document.form3.field_2.value=="")

{

alert("Please enter the Email");

document.form3.field_2.focus();

return false;

}
if(document.form3.field_3.value=="")

{

alert("Please enter the Mobile No");

document.form3.field_3.focus();

return false;

}


return true;

}

