$(function() {
		$('#home li').addClass('selected');
	}
);
$(function() {
		var ref = document.referrer;
		if (ref != null && ref != '') {
			var url = ref.split('/')[2];
			$.post(siteurl+'application/views/Set_referrer.php?t='+Math.random(), {url: url});
		}
	}
);
$(function() {
		$.post(siteurl+'application/auto_gen.php?t='+Math.random());
	}
);
var genreId = 0;
var typeId = 1;
function setNav(id, type) {
	$('#boxNav li').addClass('default');
	$('#boxNav li:eq('+id+')').removeClass('default');
	$('#boxNav li:eq('+id+')').addClass('selected');
	typeId = type;
	getList(genreId);
}
function getList(genre) {
	id = '#homeList';
	$(id).bind('ajaxSend', function() {$(id).addClass('loading');});
	$(id).load(
		siteurl+'games/home-tab'+typeId+'-category'+genre+'.html',
		function () {
			$(id).removeClass('loading');
			$(id).unbind('ajaxSend');
		}
	);
	genreId = genre;
}