function vote_game(vote, id){
	if(id){
		$.post(
		base_url+'votes.php',
		{
			'id':id,
			'vote':vote,
			'noCache':new Date().getTime()
		},
		function(html){
			var gh=html.split('#~#~#');
			if(gh[0]=='KO'){
				alert(gh[1]);
			}else{
				top.location.reload();
			}
		});
	}
}
function show_star(i){
	var x=-(95-((19*i)));
	document.getElementById('votes_game').style.backgroundPosition=x+'px 0px';
}
function showTab(id){
	for(var i=1; i<=3; i++)
	document.getElementById('bloque'+i).style.display='none';
	if(id){
		document.getElementById('bloque'+id).style.display='block';
	}
}
function sendGame(form){	
	var name1=form.nombre1.value;
	var name2=form.nombre2.value;
	var mail1=form.email1.value;
	var mail2=form.email2.value;
	var game=form.idGame.value;
	var noCache=Math.round(Math.random()*999999*game);
	var urlF=base_url+"get_viral.php";
	$.post(urlF,{"name1":name1,"name2":name2,"mail1":mail1,"mail2":mail2,"idGame":game,"noCache":noCache},
		function(html){
			var gh=html.split('#~#~#');
			if(gh[0]=='KO'){
				alert(gh[1]);
			}else{
				alert(gh[1]);
				//top.location.reload();
			}
		}
	);
}
