function NewsLetter(email,id){ connection = new AjaxConnection(); opts = new Array("newsletters.php","email="+email,"id="+id); connection.setOptions(opts); connection.connect("ResponseNewsLetter"); } function SendNewsletter(email,newsletter,flash,partners,firstname,lastname,email_type,gender,id,submitted){ var Nlgo = document.getElementById('Nlgo'); var NLEmail = document.getElementById('Nlgo') var NLemail = document.getElementById('NLemail'); var passed = false; var blnRetval, intAtSign, intDot, intComma, intSpace, intLastDot, intDomain, intStrLen; if (NLemail){ intAtSign=NLemail.value.indexOf("@"); intDot=NLemail.value.indexOf(".",intAtSign); intComma=NLemail.value.indexOf(","); intSpace=NLemail.value.indexOf(" "); intLastDot=NLemail.value.lastIndexOf("."); intDomain=intDot-intAtSign; intStrLen=NLemail.value.length; if (NLemail.value == "" ) { alert("JS_BLANK_EMAIL"); NLemail.focus(); passed = false; } else if (intAtSign == -1) { alert("JS_MISSING_AROB"); NLemail.focus(); passed = false; } else if (intComma != -1) { alert("JS_HAVE_COMMA"); NLemail.focus(); passed = false; } else if (intSpace != -1) { alert("JS_HAVE_SPACE"); NLemail.focus(); passed = false; } else if ((intDot <= 2) || (intDomain <= 1) || (intStrLen-(intLastDot+1) < 2)) { alert("JS_ENTER_VALID1\n" + NLemail.value + "JS_ENTER_VALID2"); NLemail.focus(); passed = false; } else { Nlgo.disabled=true; Nlgo.value='Please wait... Patientez...'; connection = new AjaxConnection(); opts = new Array("newsletters.php","email="+email,"firstname="+firstname,"lastname="+lastname,"email_type="+email_type,"gender="+gender,"id="+id,"newsletter="+newsletter,"flash="+flash,"partners="+partners,"submitted=true"); connection.setOptions(opts); connection.connect("ResponseNewsLetter"); } } else { } } function ResponseNewsLetter(content) { return overlib(content, STICKY, CAPTION,' ', CENTERPOPUP, WIDTH, 551); }