// JavaScript Document

function ajaxFunction(){
	var ajaxRequest;  
	//alert('test');
	try{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	} catch (e){
		// Internet Explorer Browsers
		try{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e){
				// Something went wrong
				alert("Your browser broke!");
				return false;
			}
		}
	}
// Create a function that will receive data sent from the server
ajaxRequest.onreadystatechange = function(){
  if(ajaxRequest.readyState == 4){
		
		/*	var response = ajaxRequest.responseText;
			var ajaxDisplay = document.getElementById('the_result');
			ajaxDisplay.innerHTML  = response;
			ajaxDisplay = document.getElementById('the_result');
			val = "Email Added!";
			if(ajaxDisplay.innerText != val)
			{
				//ajaxDisplay.className = "form_bad";
				ajaxDisplay.style.color = "#FFFFFF";
				ajaxDisplay.style.backgroundColor = "#FF0000";
				
				
			}
			else 
			{ 
				//ajaxDisplay.className = "form_good";
				ajaxDisplay.style.color = "#000066";
				ajaxDisplay.style.backgroundColor = "#D6D6AB";
				pst = setTimeout("parting_shot()", 2000);
			}
			*/
		//alert('test');
		/*var response = '';
		response = ajaxRequest.responseText;
		alert(response);*/
		}
	}
	//alert('test');
		
	var email = document.f1.email2.value;
	//alert(email);
	email = escape(email);
  	var myRand=parseInt(Math.random()*99999999);  // cache buster
	var queryString = "?therand=" + myRand + "&bname=" + email;
	ajaxRequest.open("GET", "notify_don.php" + queryString, true);
	ajaxRequest.send(null); 
	
}

function handleKeyPress(e,form)
{
	var key=e.keyCode || e.which;
	if (key==13) 
	return ajaxFunction();
	
}