$(document).ready(function(){
  $(".top10 li").hover(
    function() { $(this).addClass("hover"); },
    function() { $(this).removeClass("hover"); }
  );
   $(".today img").tooltip({
	 effect: 'slide',
	 position: 'center left'
  });
  $(".music-icon a").click(function () {
	$(".tooltip2").show();
  });
  $("a.tooltip-close").click(function () {
	$(".tooltip2").hide();
  });
  $("div.scrollable").scrollable();
  $(".items img").click(function() {

	// calclulate large image's URL based on the thumbnail URL (flickr specific)
	var url = $(this).attr("src").replace("small", "big");
	var url2 = $(this).attr("game");

	// get handle to element that wraps the image and make it semitransparent
	var wrap = $("#image_wrap").fadeTo("medium", 0.5);

	// the large image from flickr
	var img = new Image();

	// call this function after it's loaded
	img.onload = function() {

		// make wrapper fully visible
		wrap.fadeTo("fast", 1);

		// change the image
		wrap.find("img").attr("src", url);
		wrap.find("a").attr("href", 'games.php?game='+url2);

	};

	// begin loading the image from flickr
	img.src = url;

// when page loads simulate a "click" on the first image
}).filter(":first").click();

});

$(window).load(function(){
});


