/* The following function creates an XMLHttpRequest object... */
function createRequestObject()
{
	var request_o; //declare the variable to hold the object.
	var browser = navigator.appName; //find the browser name
	if(browser == "Microsoft Internet Explorer"){
		/* Create the object using MSIE's method */
		request_o = new ActiveXObject("Microsoft.XMLHTTP");
	}else{
		/* Create the object using other browser's method */
		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 get the product categories list */

function dofavourite(id,typ)
{
	//catid = document.getElementById('y');//.value;
//	getElement('debug').innerHTML = ('intermediate2.php?id=' + id +'&memtype='+typ);
	http.open('get', 'intermediate2.php?id=' 
			+ id +'&memtype='+typ);

	http.onreadystatechange = handleProducts; 
	http.send(null);
	
	/*
	var params='wp='+wp+'&mode='+mode+'&name='+name+'&email='+email+'&address='+address+'&phone='+phone+'&total_ids='+total_ids+'&budget='+budget+'&desc='+desc+'&delete_ids='+delete_ids;
	http.open('post', 'quickquote_ops.php');
	http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
http.setRequestHeader("Content-length", params.length);
http.setRequestHeader("Connection", "close");

http.send(params);
	*/
}
function doremovefavourite(id,typ)
{
	//catid = document.getElementById('y');//.value;
	http.open('get', 'intermediate3.php?id=' 
			+ id +'&memtype='+typ);
	http.onreadystatechange = handleProducts1; 
	http.send(null);
}
/* Function called to handle the list that was returned from the internal_request.php file.. */
function handleProducts()
{
	if(http.readyState == 4)
	{ 
		var response = http.responseText;
		alert(response);		
	}
}
function handleProducts1()
{
	if(http.readyState == 4)
	{ 
		var response = http.responseText;
		document.getElementById("divrec"+ response).style.display='none';
	}
}

