$(document).ready(function(){
	/* This code is executed after the DOM has been completely loaded
	-----------------------------------------------------------------
	custom content by lee clarke / alernatingfrequencies.com / 2011
	----------------------------------------------------------------- */
	
	// animates vinyl logo slide in & out
	$('#vinylme').hover(function(){
		$("#nav").fadeOut('slow')
		$(this).animate({'left':-550},1000, function(){
			$(this).animate({'left':-250},1250)
		});
	},function(){
		$(this).stop().animate({'left':-550},1250, function(){
			$("#nav").fadeIn(1250)
		});
	});
	/*
	$('#vinylme').click(function(){
		$("#nav").fadeOut('slow')
		$(this).animate({'left':-550},1000, function(){
			$(this).animate({'left':-250},1250, function(){
				$(this).animate({'left':-250},1500, function(){
					$(this).animate({'left':-550},1000, function(){
						$("#nav").fadeIn('slow')
						});
					});
				});
			});
		});
	*/
	// animates fade in & out of about section notation
	$('#info_wrapper').hover(function(){
		$('#infonotation').fadeIn(500);
	},function(){
		$('#infonotation').fadeOut(500);
	});
	
	// animates fade in & out of updates section notation
	$('#up_wrapper').hover(function(){
		$('#upnotation').fadeIn(500);
	},function(){
		$('#upnotation').fadeOut(500);
	});
	
	// animates fade in & out of artist section notation
	$('#art_wrapper').hover(function(){
		$('#artnotation_001').fadeIn(500);
		$('#artnotation_002').fadeIn(750);
	},function(){
		$('#artnotation_001').fadeOut(500);
		$('#artnotation_002').fadeOut(500);
	});
	
	// animates fade in & out of release section notation
	$('#rel_wrapper').hover(function(){
		$('#relnotation_001').fadeIn(500);
		$('#relnotation_002').fadeIn(750);
	},function(){
		$('#relnotation_001').fadeOut(500);
		$('#relnotation_002').fadeOut(500);
	});
	
	// animates fade in & out of free release section notation
	$('#free_wrapper').hover(function(){
		$('#freenotation_001').fadeIn(500);
		$('#freenotation_002').fadeIn(750);
	},function(){
		$('#freenotation_001').fadeOut(500);
		$('#freenotation_002').fadeOut(500);
	});
	
	// animates fade in & out of sample pack section notation
	$('#samp_wrapper').hover(function(){
		$('#sampnotation_001').fadeIn(500);
		$('#sampnotation_002').fadeIn(750);
	},function(){
		$('#sampnotation_001').fadeOut(500);
		$('#sampnotation_002').fadeOut(500);
	});

	// animates fade in & out of distribution section notation
	$('#dist_wrapper').hover(function(){
		$('#saucenotation').fadeIn(500);
	},function(){
		$('#saucenotation').fadeOut(500);
	});	
	
	// animates fade in & out of facebook menu notation
	$('#spaz_button').hover(function(){
		$('#spaznotation').fadeIn(500);
	},function(){
		$('#spaznotation').fadeOut(500);
	});	
	
	// animates fade in & out of twatter menu notation
	$('#twatter_button').hover(function(){
		$('#twatnotation').fadeIn(500);
	},function(){
		$('#twatnotation').fadeOut(500);
	});	

	// animates fade in & out of soundcloud menu notation
	$('#cloud_button').hover(function(){
		$('#cloudnotation').fadeIn(500);
	},function(){
		$('#cloudnotation').fadeOut(500);
	});	
	
	// animates fade in & out of youtube menu notation
	$('#tube_button').hover(function(){
		$('#tubenotation').fadeIn(500);
	},function(){
		$('#tubenotation').fadeOut(500);
	});

	// animates fade in & out of forum menu notation
	$('#forum_button').hover(function(){
		$('#forumnotation').fadeIn(500);
	},function(){
		$('#forumnotation').fadeOut(500);
	});
	
	// animates fade in & out of dropbox menu notation
	$('#dropme_button').hover(function(){
		$('#dropmenotation').fadeIn(500);
	},function(){
		$('#dropmenotation').fadeOut(500);
	});
	
	// animates fade in & out of email menu notation
	$('#live_button').hover(function(){
		$('#livenotation').fadeIn(500);
	},function(){
		$('#livenotation').fadeOut(500);
	});
	
	// animates fade in & out of soundcloud menu notation
	$('#aim_button').hover(function(){
		$('#aimnotation').fadeIn(500);
	},function(){
		$('#aimnotation').fadeOut(500);
	});	
	
	// animates the fade in & out of clouds & twatter feed
	$('#twatternotation').hover(function(){
			$('#cloud_sml').fadeIn(1000);
				$('#cloud_med').fadeIn(2000);
					$('#cloud_lrg').fadeIn(3000);
						$('#cloud_wrapper').fadeIn(4500);
	},function(){
		$('#cloud_wrapper').fadeOut(3500);
			$('#cloud_lrg').fadeOut(5000);
				$('#cloud_med').fadeOut(4000);
					$('#cloud_sml').fadeOut(3000);
	});
	
	// animates artist section size (when more than 4 artists)
	$('#art_more').click(function(){
			$('#art_m').fadeOut('slow', function() {
				$('#art_wrapper').animate({'height':490}, 'slow').css('overflow', 'visible') /* css visible fixes disappearing borders */
					$('#artcent').animate({'height':490}, 'slow')
						$('#artcent_cont').animate({'height':490}, 'slow', function() {
							$('#art_links').fadeIn('slow')
						$('#art_l').fadeIn('slow')
					});
			});
	});
	$('#art_less').click(function(){
			$('#art_l').fadeOut('slow')
				$('#art_links').fadeOut('slow', function() {
					$('#art_wrapper').animate({'height':265}, 'slow').css('overflow', 'visible') /* css visible fixes disappearing borders */
						$('#artcent').animate({'height':265}, 'slow')
							$('#artcent_cont').animate({'height':265}, 'slow', function() {
						$('#art_m').fadeIn('slow')
					});
			});
	});
	
	// animates release section size (when more than 4 releases)
	$('#rel_more').click(function(){
			$('#rel_m').fadeOut('slow', function() {
				$('#rel_wrapper').animate({'height':490}, 'slow').css('overflow', 'visible') /* css visible fixes disappearing borders */
					$('#relcent').animate({'height':490}, 'slow')
						$('#relcent_cont').animate({'height':490}, 'slow', function() {
							$('#rel_links').fadeIn('slow')
						$('#rel_l').fadeIn('slow')
					});
			});
	});
	$('#rel_less').click(function(){
			$('#rel_l').fadeOut('slow')
				$('#rel_links').fadeOut('slow', function() {
					$('#rel_wrapper').animate({'height':265}, 'slow').css('overflow', 'visible') /* css visible fixes disappearing borders */
						$('#relcent').animate({'height':265}, 'slow')
							$('#relcent_cont').animate({'height':265}, 'slow', function() {
						$('#rel_m').fadeIn('slow')
					});
			});
	});
	
	// animates free release section size (when more than 4 free releases)
	$('#free_more').click(function(){
			$('#free_m').fadeOut('slow', function() {
				$('#free_wrapper').animate({'height':490}, 'slow').css('overflow', 'visible') /* css visible fixes disappearing borders */
					$('#freecent').animate({'height':490}, 'slow')
						$('#freecent_cont').animate({'height':490}, 'slow', function() {
							$('#free_links').fadeIn('slow')
						$('#free_l').fadeIn('slow')
					});
			});
	});
	$('#free_less').click(function(){
			$('#free_l').fadeOut('slow')
				$('#free_links').fadeOut('slow', function() {
					$('#free_wrapper').animate({'height':265}, 'slow').css('overflow', 'visible') /* css visible fixes disappearing borders */
						$('#freecent').animate({'height':265}, 'slow')
							$('#freecent_cont').animate({'height':265}, 'slow', function() {
						$('#free_m').fadeIn('slow')
					});
			});
	});

	
	// animates sample pack section size (when more than 4 sample packs)
	$('#samp_more').click(function(){
			$('#samp_m').fadeOut('slow', function() {
				$('#samp_wrapper').animate({'height':490}, 'slow').css('overflow', 'visible') /* css visible fixes disappearing borders */
					$('#sampcent').animate({'height':490}, 'slow')
						$('#samp_cont').animate({'height':490}, 'slow', function() {
							$('#samp_links').fadeIn('slow')
						$('#samp_l').fadeIn('slow')
					});
			});
	});
	$('#samp_less').click(function(){
			$('#samp_l').fadeOut('slow')
				$('#samp_links').fadeOut('slow', function() {
					$('#samp_wrapper').animate({'height':265}, 'slow').css('overflow', 'visible') /* css visible fixes disappearing borders */
						$('#sampcent').animate({'height':265}, 'slow')
							$('#samp_cont').animate({'height':265}, 'slow', function() {
						$('#samp_m').fadeIn('slow')
					});
			});
	});
	
	// begin automatic animations on page load
	setTimeout(function(){$('#vinylme').animate({'left':-550},'slow', function() {
		$('#nav').fadeIn(2000)});
	},8000);
	setTimeout(function(){$('#play_js').animate({'right':-200},'slow');},8000);
	setTimeout(function(){$('#ap_me').fadeIn(4000);},3000);
	setTimeout(function(){$('#spaz_button').fadeIn(500, function() {
		$('#twatter_button').fadeIn(500, function() {
			$('#cloud_button').fadeIn(500, function() {
				$('#tube_button').fadeIn(500, function() {
					$('#forum_button').fadeIn(500, function() {
						$('#dropme_button').fadeIn(500, function() {
							$('#live_button').fadeIn(500, function() {
								$('#aim_button').fadeIn(500)
								});
							});
						});
					});
				});
			});
		});
	},5000);

	
});
