function doFavourite(gameId,offset){
//non facebook


	
	var xmlHttp;

try
	 {  // Firefox, Opera 8.0+, Safari  
		xmlHttp=new XMLHttpRequest();  
	}
catch (e)
  {  // Internet Explorer  
	try
		{    
			xmlHttp=new ActiveXObject("msxml2.XMLHTTP"); 
		}
	  catch (e)
		{    
			try
				{    
					xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");      
				}
			catch (e)
				{     
					alert("Your browser does not support AJAX!");      return false;      
				} 
		} 
	}
 updateLink.innerHTML='';
  addIt = document.getElementById('addItValue').value
  xmlHttp.onreadystatechange=function()
		{
				if(xmlHttp.readyState==4)
				  {//deal with response

						

							updateLink.innerHTML=xmlHttp.responseText
						if(addIt=='true')
							{
								document.getElementById('addItValue').value='false';
							}
						else
							{
								document.getElementById('addItValue').value='true'
							}
					//	
				  }
		}




	xmlHttp.open("POST",'../favourite.php?gameId='+gameId+ '&addIt='+addIt+'&sid='+sid,true);

	xmlHttp.send();

}


function getCommentsPage(gameId,offset){
//non facebook



	var xmlHttp;

try
	 {  // Firefox, Opera 8.0+, Safari  
		xmlHttp=new XMLHttpRequest();  
	}
catch (e)
  {  // Internet Explorer  
	try
		{    
			xmlHttp=new ActiveXObject("msxml2.XMLHTTP"); 
		}
	  catch (e)
		{    
			try
				{    
					xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");      
				}
			catch (e)
				{     
					alert("Your browser does not support AJAX!");   
					return false;      
				} 
		} 
	}

  xmlHttp.onreadystatechange=function()
		{
			if(xmlHttp.readyState==4)
				{//deal with response.
						
					document.getElementById('gameComments').innerHTML=xmlHttp.responseText;
				}
		}




	xmlHttp.open("POST",'../gameComments.php?gameId='+gameId+'&offset='+offset,true);

	xmlHttp.send();

}


function submitComment(gameId,sid){
//non facebook


	
	var xmlHttp;

try
	 {  // Firefox, Opera 8.0+, Safari  
		xmlHttp=new XMLHttpRequest();  
	}
catch (e)
  {  // Internet Explorer  
	try
		{    
			xmlHttp=new ActiveXObject("msxml2.XMLHTTP"); 
		}
	  catch (e)
		{    
			try
				{    
					xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");      
				}
			catch (e)
				{     
					alert("Your browser does not support AJAX!");   
					return false;      
				} 
		} 
	}

  xmlHttp.onreadystatechange=function()
		{
			if(xmlHttp.readyState==4)
				{//deal with response.	
					document.getElementById('gameCommentsInput').innerHTML='';;
					document.getElementById('submitCommentButton').disabled=false;
					document.getElementById('gameComments').innerHTML=xmlHttp.responseText;
				}
		}


var comment=document.getElementById('gameCommentsInput').innerHTML;


document.getElementById('submitCommentButton').disabled=true;
	xmlHttp.open("POST",'../gameComments.php?gameId='+gameId+'&sid='+sid+'&add=true&comment='+comment,true);

	xmlHttp.send();

}
