var xmlhttp=null;
	if (window.createRequest) {
	xmlHttp = window.createRequest();
}
else {

if (window.ActiveXObject) {
    
	xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
}else{
	
	xmlHttp = new XMLHttpRequest();
}
}


function favourite(idea_id, user_id)
{
	if (xmlHttp.readyState == 4 || xmlHttp.readyState == 0)
 	{
		xmlHttp.open("GET", "favourite_idea.php?idea_id=" + idea_id + "&user_id="+ user_id, true);  
		xmlHttp.onreadystatechange = LoadContaints;
		xmlHttp.send(null);
  }

}

function LoadContaints()
{
	if (xmlHttp.readyState == 4) 
	{
		if (xmlHttp.status == 200) 
		{
			alert("You have successfully added this idea in your favourite list!");//document.getElementById("inbox").innerHTML = xmlHttp.responseText ;
		} 
		else 
		{
		  alert("You have already added this idea in your favourite list!");//alert("here was a problem accessing the server: " + xmlHttp.statusText);
		}
	}
}
