var xmlHttp;

function addMailingList()
{
	 
  xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
 	{
 		alert ("Browser does not support HTTP Request")
 		return
 	} 
  //  Set our destination PHP page "ajaxpost.php"…
  var url = "mailinglist.php";
  var param1 = document.getElementById("name").value;
  var param2 = document.getElementById("email").value;
  url = url + "?name="+param1+"&email="+param2;
  
  xmlHttp.open("GET", url, true);
  xmlHttp.onreadystatechange = mailingListState;

  // Make our POST parameters string…
  

 // // Set our POST header correctly…
 // xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
 // xmlHttp.setRequestHeader("Content-length", params.length);
 // xmlHttp.setRequestHeader("Connection", "close");

  // Send the parms data…
  xmlHttp.send("");

}

function mailingListState() 
{ 
 	
 if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 	document.getElementById("msg").innerHTML=xmlHttp.responseText 
 } 
}


function show(val)
{
	document.getElementById(val).style.display = 'block';
}

function hide(val)
{
	document.getElementById(val).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;
}