function getDescription(game_id){ 
	
	var xhr; 
    try{  
    	xhr = new ActiveXObject('Msxml2.XMLHTTP');   
    }
    catch(e){
        try{   
        	xhr = new ActiveXObject('Microsoft.XMLHTTP');    
        }
        catch(e2){
    		try{  
				xhr = new XMLHttpRequest();
    		}
    		catch(e3){  
    			xhr = false;   
    		}
        }
	}
 
    xhr.open("GET", "description.php?game_id="+game_id, true); 

    xhr.onreadystatechange = function(){ 
    	if(xhr.readyState  == 4 && xhr.status  == 200){
			document.getElementById('fiche').innerHTML = xhr.responseText;			
    	}
    	else{
    		document.getElementById('fiche').innerHTML = '<img src="images/ajax-loader.gif" />';
    	}
    }; 

   
	xhr.send(null);
	
} 

var pas = 1
var h_fen = "70px"
	
function scrollmrq(){
	
	if(parseInt(mrq.style.top) > -h_mrq) 
		mrq.style.top = parseInt(mrq.style.top)-pas+"px";
	else 
		mrq.style.top = parseInt(h_fen)+"px";
	
}

function init_mrq(){
	
	mrq = document.getElementById("menu_defile");
	fen = document.getElementById("menu_deroulant");
	if(mrq != undefined && fen != undefined){
		fen.onmouseover = function(){stoc=pas;pas=0};
		fen.onmouseout = function(){pas=stoc};fen.style.height=h_fen;
		h_mrq = mrq.offsetHeight;
		with(mrq.style){position="absolute";top=h_fen;}
		setInterval("scrollmrq()", 50);
	}
	
	
}

function redirect(page){
	window.location = page;	
}

function submit_this(){
	  
	// the fields that are to be processed
	var mg_message = document.getElementById('mg_message').value;
	var user_id = document.getElementById('user_id').value;
 
	// ajax call to itself 
	$.post("ajout_jeu_ok.php", {mg_message: mg_message, user_id: user_id}, function(data){$("#message").text(data);});
 
	return false;

}

function addUserGameGet(game_id){
	
	var xhr; 
    try{  
    	xhr = new ActiveXObject('Msxml2.XMLHTTP');   
    }
    catch(e){
        try{   
        	xhr = new ActiveXObject('Microsoft.XMLHTTP');    
        }
        catch(e2){
    		try{  
				xhr = new XMLHttpRequest();
    		}
    		catch(e3){  
    			xhr = false;   
    		}
        }
	}
 
    xhr.open("GET", "addGetGame.php?game_id="+game_id, true); 

    xhr.onreadystatechange = function(){ 
    	if(xhr.readyState  == 4 && xhr.status  == 200){
    		switch(xhr.responseText){
    			case '0':
	    			alert('Vous devez vous connecter pour pouvoir choisir');
	    			break;
    			case '1':
	    			alert('Vous avez d\351j\340 ce jeu en votre possession');
	    			//window.location = 'mon_profil.php';
	    			break;
    			case '2':
	    			alert('Ce jeu a bien \351t\351 ajout\351.');
	    			//window.location = 'mon_profil.php';
	    			break;
    			case '3':
	    			alert('Probl\350me technique');
	    			break;
    		}
    	}
    }; 

   
	xhr.send(null);	

}

function addUserGameWant(game_id){
	
	var xhr; 
    try{  
    	xhr = new ActiveXObject('Msxml2.XMLHTTP');   
    }
    catch(e){
        try{   
        	xhr = new ActiveXObject('Microsoft.XMLHTTP');    
        }
        catch(e2){
    		try{  
				xhr = new XMLHttpRequest();
    		}
    		catch(e3){  
    			xhr = false;   
    		}
        }
	}
 
    xhr.open("GET", "addWantGame.php?game_id="+game_id, true); 

    xhr.onreadystatechange = function(){ 
    	if(xhr.readyState  == 4 && xhr.status  == 200){
    		switch(xhr.responseText){
    			case '0':
	    			alert('Vous devez vous connecter pour pouvoir choisir');
	    			break;
    			case '1':
	    			alert('Vous avez d\351j\340 ce jeu en votre possession');
	    			//window.location = 'mon_profil.php';
	    			break;
    			case '2':
	    			alert('Ce jeu a bien \351t\351 ajout\351. Un email a \351t\351 envoy\351 \340 toutes les personnes poss\351\dant ce jeu.');
	    			//window.location = 'mon_profil.php';
	    			break;
    			case '3':
	    			alert('Probl\350me technique');
	    			break;
    		}
    	}
    }; 

   
	xhr.send(null);	
}
