function fnSubmitEmailForList()
{
	var email = document.getElementById("txtEmail").value; 
	var params = "email=" + email;
	
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
 		return;
		
	xmlHttp.open("POST","submit_email_address.php",true);
	xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	xmlHttp.setRequestHeader("Content-length", params.length);
	xmlHttp.setRequestHeader("Connection", "close");
	xmlHttp.onreadystatechange = fnSentMail;
	xmlHttp.send(params);
}

function fnSentMail()
{
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{
		var text = xmlHttp.responseText;
		if(text == "true")
		{
			alert("Successfully submitted to GZ mailing list.");
			document.getElementById("txtEmail").value = "";
		}
		else
		{
			alert("ERROR: Failed to submit e-mail to list.");
			alert(text);
		}
			
	}
}

function GetXmlHttpObject()
{
	var xmlHttp=null;
	try
	{   // Firefox, Opera 8.0+, Safari
	 	xmlHttp=new XMLHttpRequest();
	}
	catch (e)
	{
		//Internet Explorer
	 	try {xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); }
	 	catch (e) { xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); }
	 }
	return xmlHttp;
}