var req;function loadXMLDoc(url,method){req=false;if(window.XMLHttpRequest){try{req=new XMLHttpRequest();}catch(e){req=false;}}else if(window.ActiveXObject){try{req=new ActiveXObject("Msxml2.XMLHTTP");}catch(e){try{req=new ActiveXObject("Microsoft.XMLHTTP");}catch(e){req=false;}}}if(req){if(method==''){req.onreadystatechange=processReqChange;req.open("GET",url,true);req.send("");}else if(method=='post'){req.onreadystatechange=processReqChange;req.open("POST",url,true);req.send("");}}}function processReqChange(){if(req.readyState==4){if(req.status==200){content=req.responseXML.documentElement;userExist=content.getElementsByTagName('userExist');alertUser(userExist[0].firstChild.nodeValue);}else{alert("There was a problem retrieving the XML data:\n"+req.statusText);}}}function checkNewsletterUser(input){url='class/xml/checkNewsLetterUser_xml.php?nlEmail='+input;loadXMLDoc(url,'');}function alertUser(alertValue){var errorContent=document.getElementById('newsletterAlert');var nlButton=document.getElementById('nlButton');if(alertValue=='yes'){nlButton.disabled=true;errorContent.innerHTML='You have already signed up!';errorContent.style.display="inline";errorContent.style.fontWeight="bold";errorContent.style.color="#ffffff";errorContent.style.backgroundColor="#CC0000";errorContent.style.border="#ffffff solid 2px";errorContent.style.padding="5px";t1=new Tween(errorContent.style,'top',Tween.regularEaseInOut,0,-30,.6,'px');t1.start();}else if(alertValue=='notValidEmail'){nlButton.disabled=true;errorContent.innerHTML='Not a valid email!';errorContent.style.display="inline";errorContent.style.fontWeight="bold";errorContent.style.color="#ffffff";errorContent.style.backgroundColor="#CC0000";errorContent.style.border="#ffffff solid 2px";errorContent.style.padding="5px";t1=new Tween(errorContent.style,'top',Tween.regularEaseInOut,0,-30,.6,'px');t1.start();}else if(alertValue=='no'){nlButton.disabled=true;errorContent.innerHTML='You have been added to our mailing list!';errorContent.style.display="inline";errorContent.style.fontWeight="bold";errorContent.style.color="#ffffff";errorContent.style.backgroundColor="#CC0000";errorContent.style.border="#ffffff solid 2px";errorContent.style.padding="5px";t1=new Tween(errorContent.style,'top',Tween.regularEaseInOut,0,-30,.6,'px');t1.start();}else{nlButton.disabled=false;errorContent.style.display="none";}}