var xmlHttp

function addEmail(str)
{
  xmlHttp=GetXmlHttpObject();
  if (xmlHttp==null)
  {
	  alert ("Your browser does not support AJAX!");
	  return;
  }
	var url="newsletter/addmail?newsletterList=240&email="+str;
	xmlHttp.onreadystatechange=update;
	xmlHttp.open("GET", url, true);
	xmlHttp.send(null);
}

function update()
{   
	if (xmlHttp.readyState==1) //loading
	{
		document.getElementById("txtHint").innerHTML = "Adding Email...";
		//document.getElementById("txtHint").innerHTML = "<img src='ajax-loader.gif' />";
	}
	
	if (xmlHttp.readyState==4) //complete
	{
		document.getElementById("txtHint").innerHTML = 'Thanks, <br />To ensure that you receive our newsletters please add noreply@hustlernewsletter.com to your email safe list.  <a href="javascript:void(0);" onClick="window.open(\'http://hustlernewsletter.com/safe_list.php?source=hustler.com\',\'mywindow\',\'width=720,height=500,scrollbars=yes, resizable=yes\')">How do I do this</a>';
	}
}

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;
}