// JavaScript Document



// XML Setup 

    var xmlHttpReq = false;
    var self = this;
    if (window.XMLHttpRequest) {
        self.xmlHttpReq = new XMLHttpRequest();
    }
    else if (window.ActiveXObject) {
        self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
    }
	
///////////

	function addMail(){
			var addy=document.getElementById('mailer').value;
			
			if (addy=='Enter Email' || addy=='')
			{
			window.alert('Please enter your email address!');	

			}
			else {
			
			document.getElementById('mailBox').innerHTML="Adding your email address...";
		
		  /// runXML
		  
			self.xmlHttpReq.open('POST', '/ajaxfeed.php', true);
			self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
			self.xmlHttpReq.onreadystatechange = function() {
				if (self.xmlHttpReq.readyState == 4) {	
	
			  document.getElementById('mailBox').innerHTML=self.xmlHttpReq.responseText;
					 }	 
			}
			qstr ='action=addMail&addy=' + escape(addy);  
			self.xmlHttpReq.send(qstr);
			}
	}
	
	////////////////////
	
