$(document).ready(function() {


  // ACCORDIONS
  $('.accordionButton').click(function() {
    $('.accordionButton').removeClass('on');  
    $('.accordionContent').slideUp('normal');
    if($(this).next().is(':hidden') == true) {
      $(this).addClass('on');
      $(this).next().slideDown('normal');
	  } 
	});
	
	$('.accordionButton').mouseover(function() {
	  $(this).addClass('over');
	}).mouseout(function() {
		$(this).removeClass('over');										
	});
								
	$('.accordionContent').hide();
	
	
	// LIGHTBOX
  $(function() {
     $('a.lightbox').lightBox();
  })
  
  
  // TRUNCATE ALBUM BIO IN ACCORDION
  $(function() {
    $('.album_bio').truncate({max_length: 500});
  });
  
  
  // LATEST RELEASES SLIDESHOW ON HOME PAGE
  $("#latest_releases").verticaltabs({
      speed: 0,
      slideShow: true,
      slideShowSpeed: 5000,
      activeIndex: 0,
      pauseOnHover: false
  }); 
  
  $(".verticalslider_tabs li:last").parent().parent().addClass("last");
  
  
  // LOAD PLAYLISTS VIA AJAX
  loadURL1 = "latest-releases-playlist.html";
  loadURL2 = "home-playlist.html";
  loadURL5 = "shop-playlist.html";
  loadURL7 = "downloads-playlist.html";
  
  $("#latest_releases_tracklist").load(loadURL1);
  $("#home_player_tracklist").load(loadURL2);
  $("#shop_playlist_wrapper").load(loadURL5);
  $("#downloads_playlist_wrapper").load(loadURL7);
  

                                                        
  // DROP-DOWN ON DOWNLOADS PAGE                             
  $('.downloadLink').hover(function() {
    $(this).parent().parent().children('.product_downloads').show(); 
    }, 
    function() {
    $('.product_downloads').delay(500).hide();   
  });
  
  $('.downloadLink').click(function(e) {
    e.preventDefault();
  });
  
  $('.product_downloads').hover(function() {
    $(this).show();
    },
    function() {
    $(this).hide();
  });


  // DROP-DOWN ON STORE PAGE                             
  $('.purchase_link').hover(function() {
    $(this).parents('.product').children('.product_menu').show(); 
    }, 
    function() {
    $('.product_menu').delay(500).hide();   
  });
  
  $('.purchase_link').click(function(e) {
    e.preventDefault();
  });
  
  $('.product_menu').hover(function() {
    $(this).show();
    },
    function() {
    $(this).hide();
  });
  

}); // end $(document).ready(function()
