$(document).ready(function(){
	$('#socialButtons a').mouseenter(function(){
		$('#socialButtons a').stop().animate({opacity:0},250);
		$(this).stop().animate({opacity:1},250);
	});
	$('#socialButtons a').mouseleave(function(){
		$('#socialButtons a').stop().animate({opacity:0},250);
	});
	
	oheight = $('#menu ul li ul').css('height');
	$('#menu ul li ul').css({height:0,display:"block"});
	$('#menu a[href="#"]').mouseenter(function(){
			$(this).parent().children('ul').stop().animate({height:oheight});
		return false;	
	});
	$('#menu').mouseleave(function(){
		$('#menu ul li ul').stop().animate({height:0});
	});
	
	
	function initSlider(){
		var count = $("#thumbSlider a").size();
		var x = 1;
		
		setTimeout(function(){
			
		$('#thumbSlider ul').stop().animate({marginLeft:(-202 * x)},800);
		},3000);
		
		
		setInterval(function(){
			$('#thumbSlider ul').stop().animate({marginLeft:(-202 * x)},800);
			x = x + 1;
			if(x > (count -3)) {x = 0;}
		},3000);
		
	}
	
	function initSponsorSlider(){
		
		var amount = $('#sponsorBlock ul img').size();
		var x = Math.floor(Math.random()*amount);
		$('#sponsorBlock ul').animate({marginLeft:(-215 * x)},0);

		setInterval(function(){
			$('#sponsorBlock ul').animate({marginLeft:(-215 * x)},0);
			x = x + 1;
			if(x > (amount -1)){ x = 0; }
		},2000);
	}
	
	initSlider();
	
	initSponsorSlider();
	
	$('#thumbSlider li').mouseenter(function(){
		$(this).children('.artistName').stop().animate({marginTop: "143px", height: "52px"});
	});
	$('#thumbSlider li').mouseleave(function(){
		$(this).children('.artistName').stop().animate({marginTop: "153px", height: "16px"});
	});
	
	$('#fullSizeImageWrapper').mouseenter(function(){
		$('#infoOverlay').stop().animate({marginTop: "242px"});
	});
	$('#fullSizeImageWrapper').mouseleave(function(){
		$('#infoOverlay').stop().animate({marginTop: "247px"});
	});
	
});
