/* set game clicks */
$(function() {
		$('#'+genreName).addClass('selected');
		$.post(siteurl+'application/views/Set_click.php?t='+Math.random(), {id: gameId});
		$('#gameStat').load(siteurl+'application/views/Get_gamestat.php?t='+Math.random(), {id: gameId});
	}
);
/* set recently played cookie */
$(function() {
		var today = new Date();
		var expire = new Date();
		expire.setTime(today.getTime() + 3600000*24*7);
		var cookie = 'playedgames=' + gameData;
		var oldcookie = readCookie();
		if (oldcookie != null) {
			var arr = oldcookie.split('|');
			for (var i=0; i<arr.length; i++) {
				if (arr[i] != gameData) {
					cookie += '|' + arr[i];	
				}
			}
		}
		cookie += ';expires=' + expire.toGMTString()+';path=/';
		document.cookie = cookie;
	}
);
function setVotes(type) {
	$.post(siteurl+'application/views/Set_vote.php?t='+Math.random(), {id: gameId, type: type});
	alert('Thank you!');
}