function valEmail(email)
{
  var invalidChars=" /:;,'";
  if(!email){return false;}
for(i=0;i<invalidChars.length;i++)
{
  var badChar=invalidChars.charAt(i);

if(email.indexOf(badChar,0)>-1){return false;}
}
	var atPos=email.indexOf("@",0);
	if(atPos==-1){return false;}
	if(email.indexOf("@",atPos+1)>-1){return false;}    //check do they enter more then one @ or not
	var periodPos=email.indexOf(".",atPos+1);
	if(periodPos==-1){return false;}
	while(email.indexOf(".",periodPos+1)>-1)
	{periodPos=email.indexOf(".",periodPos+1);}

return true;
}

function validate()
        {
          if(!valEmail(document.frm.email.value))
          {
            alert("Please enter your email!");return false;
          }
		  else
		  { 
		  alert("Email send!");
		  }
		  return true;
		  
	 //   else
     //   {
	 //     confirmEmail();
     //   }
    }

function confirmEmail()
{
  if(nwin){nwin.close()};
  else
  {
    var nwin=window.open("","nwin","left=400,top=200,width=600,height=200,scrollbars=yes");
    nwin.document.write("<table border='2'><tr><td><b style={font-family:georgia;font-weight:bold;letter-spacing:1px;font-size:12px;}");
    nwin.document.write("<br />E-mail: " + document.frm.email.value);
    nwin.document.write("</b></td></tr></table>");
    nwin.document.write("<br /><h3 style={font-size:13pt;}>Confirm Email? </h3>");
    nwin.document.write("<input type='button' value='Submit' onclick='opener.frm.submit();window.close();' />");
    nwin.document.write("<input type='button' value='Close' onclick='window.close();'>");
  }
}

















