var xmlHttp

function AddFav(str, id, basepage)
{

xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
  {
  alert ("Browser does not support HTTP Request")
  return
  } 
var url="fav_prod.asp"
url=url+"?str="+str
url=url+"&id="+id
url=url+"&uid="+basepage
url=url+"&m=1"


xmlHttp.onreadystatechange=function() 
{
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{ 
document.getElementById(str).innerHTML = xmlHttp.responseText 
} 
if(xmlHttp.readyState==1)
{
document.getElementById(str).innerHTML = "<img src='icons/heart.gif' hspace='0' vspace='0' width='16' height='16' align='absmiddle' hspace='0' vspace='0' border='0'> <a href='product.asp?i="+basepage+"' class='fav'>Adding...</a> "
}

}
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}


function RemFav(str, id, basepage)
{

xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
  {
  alert ("Browser does not support HTTP Request")
  return
  } 
var url="fav_prod.asp"
url=url+"?str="+str
url=url+"&id="+id
url=url+"&uid="+basepage
url=url+"&m=2"

xmlHttp.onreadystatechange=function() 
{
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{ 
document.getElementById(str).innerHTML = xmlHttp.responseText 
} 	
if(xmlHttp.readyState==1)
{
document.getElementById(str).innerHTML = "<img src='icons/heart.gif' width='16' height='16' align='absmiddle' hspace='0' vspace='0' border='0'> <a href='product.asp?i="+basepage+"' class='fav'>Removing...</a>"
}


}
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
} 






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;
}
