;(function($) {

$(document).ready(function() {
	$("#GameDetailsPane2").show();
	$("#GameDetailsPane3").show();
	$("#GameDetailsPane4").show();
	$("#GameDetailsPane5").show();
	$("#GameDetailsPane1").height($("#GameDetailsPane1").height()+3); //corner() erases 3px and we want to keep the same size to avoid scrollbar flickering
	$("#GameDetails .tabs").tabs("#GameDetails .panes > div",{"tabs":"li"})/*.history()*/;	
	$("#GameDetails .panes").corner();
	
	$("#GameInfoPane2").show();
	
	$("#SeeAlso .tabs").tabs("#SeeAlso .panes > div",{"tabs":"li"})/*.history()*/;
	

	var tab2 = $("#GameDetailsTab2");
	var tab3 = $("#GameDetailsTab3");
	var tab4 = $("#GameDetailsTab4");
	var tab5 = $("#GameDetailsTab5");
	var left = 0;
		
	if(tab2[0]){left-=20; tab2.css('left',left + 'px');}
	if(tab3[0]){left-=20; tab3.css('left',left + 'px');}
	if(tab4[0]){left-=20; tab4.css('left',left + 'px');}
	if(tab5[0]){left-=20; tab5.css('left',left + 'px');}
	
	$('#Buy_Now a').click(function(e) {
	    e.preventDefault();
	});
	$("#Buy_Now").tooltip({
		events: {def:"click,click"},
		relative: true,
		offset: [-10,125],
	    opacity: 1,
	    delay: 10000,
	    effect: "fade",
	    tip: '#Buy_Now_Tooltip'
	});
	
	
	$(".SeeAlsoImage").hover(function() {
			var cur = "#"+$(this).attr('id')+"_Content";
			//$(this).animate({"opacity": "1"}, 400);
			$(cur).fadeIn(400);
			//$(".SeeAlsoImage").not("#"+$(this).attr('id')).animate({"opacity": "0.7"}, 400);
			$(".SeeAlsoContent").not(cur).fadeOut(400);		
		}
	);
	$("#SeeAlso").mouseleave(function() {
			var cur = "#"+$(this).attr('id')+"_Content";
			//$(".SeeAlsoImage").animate({"opacity": "0.7"}, 400);
			$(".SeeAlsoContent").fadeOut(400);
		}
	);
	
	
	$("#GameInfoBox .tabs").tabs("#GameInfoBox .panes > div",{"tabs":"li"})/*.history()*/;
	$("#GameInfoBox .panes").corner();
	
	var api = $("#MediaBox .tabs").tabs("#MediaBox .panes > div",{"tabs":"li","initialIndex":1,onBeforeClick: function (event, tabIndex) {	
		if(this.getTabs().eq(tabIndex).hasClass("disabled"))return false;
	}})/*.history()*/;


	$(".left_hidden").removeClass("left_hidden");
	
	
	
})
})(jQuery);
