$(function()  {
	var background = Math.floor(Math.random()*6) +1;
	var resFolder;
	if (screen.width > 1700)
		resFolder=2100;
	else if (screen.width > 1300)
		resFolder=1700;
	else if (screen.width > 1050)
		resFolder=1300;
	else
		resFolder=1050;
	
	$("body").css({"backgroundImage":"url('http://2010.galamaestro.com/images/background/" + resFolder+ "/background_large" + background + ".jpg')"});

	//Function so the menu gracefully stick
	$(window).scroll(function () { 
		if ($("#leftCol").height() > $("#pageContent").height())
			return;
		$("#leftCol").stop().animate({top:$(window).scrollTop()}, 500, "swing");
    });
    
	//These ui-hover things needs magic to work in IE/webkit
 $('.ui-hover').hover(
	function() { $(this).addClass('ui-state-hover'); },
	function() { $(this).removeClass('ui-state-hover'); }
	);

});  