function isValidEmail(str) {
   return (str.indexOf(".") > 2) && (str.indexOf("@") > 0);
 
}

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 validations()
{
mail=document.getElementById("email").value;
if(mail=="") { alert ("Please Enter Your Email id"); return false;}
if (!isValidEmail(mail)){ alert("Invalid E-mail Address! Please re-enter."); return false; }
else
  document.newsletter.submit();
}
function formvalidations()
{
name=document.getElementById("name").value;
mail=document.getElementById("mail").value;
if(name=="") { alert("Please Enter Your Name"); return false; }
if(mail=="") { alert ("Please Enter Your Email id"); return false;}
if (!isValidEmail(mail)){ alert("Invalid E-mail Address! Please re-enter."); return false; }
else 
 return true;
}
