var xmlHttp

function followme(tname, tid, var1){	
	var1.innerHTML = '<img src="http://www.tweetidol.in/images/following.png" width="72" height="26" border="0" class="heading2" />';
	xmlHttp = GetXmlHttpObject()
	var url="follow.php"
	url=url+"?id="+tid+"&name="+tname+"&sid="+Math.random()
	xmlHttp.onreadystatechange=stateChanged
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null);
}

function stateChanged() { 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){			
		alert(xmlHttp.responseText);
	}
}

function addfavourites(tname, tid, var1,type){
	var1.innerHTML = 'Your Favourite';
	xmlHttp = GetXmlHttpObject()
	var url="favourite.php"
	url=url+"?id="+tid+"&name="+tname+"&sid="+Math.random()+"&type="+type
	xmlHttp.onreadystatechange=stateChanged1
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null);
}

function stateChanged1() { 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){			
		alert(xmlHttp.responseText);

	}
}

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;
}
