var gameres = {
	
	init: function() {
		
		$("ul.gameres li").bind("click", function() {
			if ($(this).attr("id") > 0 && !$(this).hasClass("active"))
				gameres.change(this);
				
			return false;
		});
		
		$("ul.gameres li").bind("focus", function() {
			if(this.blur) this.blur();
		});
		
		gameres.change($("ul.gameres li.active"));
	},
	
	change: function(element) {
		
		$("div.gameres-tab").each(function() {
			if ($(this).attr("id") == $(element).attr("id")) {
				$(this).fadeIn(650);
			} else {
				$(this).hide();
			}
		});
		
		$("ul.gameres li").each(function() {
			if ($(this).attr("id") == $(element).attr("id")) {
				$(this).addClass("active");
			} else {
				$(this).removeClass("active");
			}
		});
	}
}
