/* Create a new XMLHttpRequest object to talk to the Web server */
var xmlHttp = false;
try
{
	xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e)
{
	try
	{
		xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
	}
	catch (e2)
	{
		xmlHttp = false;
	}
}
if (!xmlHttp && typeof XMLHttpRequest != 'undefined')
{
	xmlHttp = new XMLHttpRequest();
}
/********************* ADD COUPON TO LIST ****************/
function addCouponToFav(prodid)
{
	 
	 if(prodid!="")
	 {
			var url="ajax/addtofav.php?prodid="+ prodid;
			xmlHttp.open("GET", url, true);
			// Setup a function for the server to run when it's done
			xmlHttp.onreadystatechange = updateFavStatus;
			// Send the request
			xmlHttp.send(null);
	 }
}
function updateFavStatus()
{
	if (xmlHttp.readyState == 4)
	{
		var response = xmlHttp.responseText;		
		alert(response);
		 
	}
}
/***************** ADD ORG TO FAV *****************/
function addOrgToFav(orgid)
{
	 
	 if(orgid!="")
	 {
			var url="ajax/addorgtofav.php?orgid="+ orgid;
			xmlHttp.open("GET", url, true);
			// Setup a function for the server to run when it's done
			xmlHttp.onreadystatechange = updateOrgFavStatus;
			// Send the request
			xmlHttp.send(null);
	 }
}
function updateOrgFavStatus()
{
	if (xmlHttp.readyState == 4)
	{
		var response = xmlHttp.responseText;		
		alert(response);
		 
	}
}
