var isPlaying = 0;

$(document).ready(function() {		
		// Preload all rollovers
		$("#nav img, #photo1 img, #photo2 img, #photo3 img, #photo4 img, #photo5 img, #reviews_link img, #bio_link img, .music_player img, #discog img, #buy_link img, #logo img, #email_container img").each(function() {
			// Set the original src
			rollsrc = $(this).attr("src");
			rollON = rollsrc.replace('_off', '_on');
			newImg = new Image(); // create new image obj
			$(newImg).attr("src", rollON); // set new obj's src
		});

		
		// Navigation rollovers
		$("#nav a, #photo1 a, #photo2 a, #photo3 a, #photo4 a, #photo5 a, #reviews_link, #bio_link, .music_player a, #discog, #buy_link, #logo, #email_container a").mouseover(function(){
			imgsrc = $(this).children("img").attr("src");
			
			if (typeof(imgsrc) != 'undefined') {
			imgsrcON = imgsrc.replace('_off', '_on');
			$(this).children("img").attr("src", imgsrcON);
			}
			
		});

		// Handle mouseout
		$("#nav a, #photo1 a, #photo2 a, #photo3 a, #photo4 a, #photo5 a, #reviews_link, #bio_link, .music_player a, #discog, #buy_link, #logo, #email_container a").mouseout(function(){
			if (typeof(imgsrc) != 'undefined') {
			$(this).children("img").attr("src", imgsrc);
			}
		});

	$('#thumbs .next').click(function(event)
		{
		$('#thumbs_inner').scrollTo('+=200px',
			{
			axis:'y',
			duration: 400
			});
		});

	$('#thumbs .prev').click(function(event)
		{
		$('#thumbs_inner').scrollTo('-=200px',
			{
			axis:'y',
			duration: 400
			});
		});	

	$('#thumbs_container .next').click(function(event)
		{
		$('#thumbs_inner').scrollTo('+=200px',
			{
			axis:'x',
			duration: 400
			});
		});

	$('#thumbs_container .prev').click(function(event)
		{
		$('#thumbs_inner').scrollTo('-=200px',
			{
			axis:'x',
			duration: 400
			});
		});	

	$('#thumbs img, #thumbs2 img, #photos1 a, #photos2 a').mouseover(function()
		{
		$(this).fadeTo('fast', 0.5);
		});
		
	$('#thumbs img, #thumbs2 img, #photos1 a, #photos2 a').mouseout(function()
		{
		$(this).fadeTo('fast', 1);
		});

	$('#content1 a[href^="http://"]').attr("target", "_blank");
/*
	$('.music_player a, .video_link a').click(function(event)
			{
			if (!mixtapeWin.closed)
				{
				mixtapeWin = window.open("mixtape2.php","mixtape","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width=450, height=300");	
				}
			});	
*/
	}); // end docuent ready
	
function openPlayer()
	{
	mixtapeWin = window.open("mixtape.php","mixtape","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width=450, height=300");	
	}

$('#content1').ready(function()
	{
	$("#content1_inner").hide().delay(1000).slideDown('slow');
	});
