var xhr;function ajax_validateNewletterForm(event){var parameter=document.getElementById("ajax_email").value;NewsletterForm.ajaxValidateEmail(parameter,validate)}function validate(str){if(str=="error.newsletter.email"){document.getElementById("errorDiv").style.cssText="color: white; background-color: red";setText("Bitte gültige E-Mail eingeben")}else{document.getElementById("errorDiv").style.cssText="color: white; background-color: grey";setText("E-Mail prüfen....");registerToNewsletter(document.newsletterForm.email.value,document.newsletterForm.newsletter.value)}}function registerToNewsletter(email,list){NewsletterAction.ajaxRegisterNewsletter(email+"|"+list,action)}function action(str){if(str=="success"){document.getElementById("errorDiv").style.cssText="color: white; background-color: #2F2929";setText("bitte warten...");setTimeout(function(){setText("Aktivierungsmail senden")},2000);setTimeout(function(){setText("Vielen Dank!")},3000)}else{document.getElementById("errorDiv").style.cssText="color: white; background-color: #2F2929";setText("bitte warten...");setTimeout(function(){setText("Es ist ein Fehler aufgetreten")},2000)}setTimeout(function(){resetEmail()},4000);document.getElementById("ajax_email").value="Ihre E-Mail-Adresse"}function setText(str){document.getElementById("errorDiv").innerHTML=str}function resetEmail(){setText("Newsletter anmelden");document.getElementById("errorDiv").style.cssText="color: black;"};