function vote_game(game_id, game_note, mode) {
	var myAjax = new Ajax('/jeux-flash/vote/'+game_id+'/'+game_note+'/'+mode, {method: 'get', update: 'tmp', evalScripts: true}).request();
}

function update_vote_area(note, small) {
	myEffect2 = $('starrater').effect('opacity');
	var myEffect = $('starrater').effect('opacity', {duration: 700,onComplete: function() {
		msg  = 'Merci d\'avoir voté ! ';
		if ( small != 1 ) {
			msg += '<br/>';
		}
		msg += 'Moyenne du jeu '+note+'/5';
		
		$('starrater').innerHTML = msg;
		myEffect2.start(0,1);
		
	}});
	myEffect.start(1,0);
}

function tabAppear(tab, end_height) {
	$('tabsend').setOpacity(0);
	$('tabsend').setStyle('display','none');
	
	$('tabsite').setOpacity(0);
	$('tabsite').setStyle('display','none');
	$('tabreport').setOpacity(0);
	$('tabreport').setStyle('display','none');
	
	mytab = $(tab);
	tabcontainer = $('toolbarexpand');
	tabcontainer.setStyle('display','block');

	

	start_height = tabcontainer.getStyle('height').toInt();
	expand = tabcontainer.effect('height', {duration: 700, onComplete: function() {

		mytab.setStyle('display','block');
		opacityEffect = mytab.effect('opacity', {duration:700} );
		opacityEffect.start(0,1);

		
	} });
	expand.start(start_height,end_height);

}


function add_favorite(game_id) {
	var myAjax = new Ajax('/jeux-flash/add_favoris/'+game_id, {method: 'get', update: 'tmp', evalScripts: true}).request();
	
}
function delete_game(game_id) {
	sure = confirm('Etes-vous sure de vouloir supprimer ce jeu ?');
	if ( sure ) {
		var myAjax = new Ajax('/jeux-flash/delete_favoris/'+game_id, {method: 'get', update: 'tmp', evalScripts: true}).request();
	}
	
}

function trigger_error() {
		diverror = document.getElementById('error');
		var myEffect = new Fx.Style(diverror , 'opacity', {transition:Fx.Transitions.sineInOut, duration: 2000});
		myEffect.custom(0,1);
}

function delete_game_effect(id) {
	var deleteEffect = new Fx.Style('g'+id, 'opacity', {duration: 700, onComplete: function() {$('g'+id).remove();}});
	deleteEffect.start(1,0);
}
