var xmlHttp;
function mailer(str)
{ 
	document.getElementById("Loading").style.display='block';
	xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
{
	alert ("Your browser does not support AJAX!");
	return;
} 
	var url="common_mailer.php";
	url=url+"?emailid="+str;
	url=url+"&num="+0;
	url=url+"&unSub="+0;
	url=url+"&site="+'worldcup';
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
	xmlHttp.onreadystatechange=function()
	{
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	 { 
	     var returntext=parseInt(xmlHttp.responseText);
		 if( returntext==2)
		 {
		 document.getElementById("Loading").style.display='none';
		 document.getElementById("emailAddr").value='';
		 document.mailingform.emailAddr.focus();
		 document.getElementById("Sucess").style.display='block';
		 setTimeout("delayset()",6000);
		 }
		 else if( returntext==1)
		 {
		  document.getElementById("Loading").style.display='none';
		  document.getElementById("emailAddr").value='';
		  document.mailingform.emailAddr.focus();
		  document.getElementById("eExists").style.display='block';
		 }
	 } 
	 else
	 {
		  document.getElementById("Exists").style.display='block';
	 }
	}
}

function delayset()
{
	 document.getElementById("Sucess").style.display='none';
}

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


