/* The following function creates an XMLHttpRequest object... */
function createRequestObject()
{
	var request_o;
	var browser = navigator.appName; //find the browser name
	if(browser == "Microsoft Internet Explorer"){
		request_o = new ActiveXObject("Microsoft.XMLHTTP");
	}else{
		request_o = new XMLHttpRequest();
	}
	return request_o; //return the object
}
/* The variable http will hold our new XMLHttpRequest object. */
var http = createRequestObject(); 
/* Function called to subscribe and unsubscribe */
function getsubunsub(email)
{
	//alert(email);
	http.open('get', 'intermediate_news.php?email='+email+'');
	http.onreadystatechange = handlesubunsub; 
	http.send(null);
}

/* Function called to handle the list that was returned from the internal_request.php file.. */
function handlesubunsub()
{
	if(http.readyState == 4)
	{ 
		var response = http.responseText;
		//alert(response);
		var res=response.split(":");
		if(res[0]=="SUCCESS")
		{
			document.getElementById('nlemail').value="";	
		}
		//alert(response);
		document.getElementById('divsubunsub').innerHTML = response;
	}
}


