/* Declare a namespace for the site */
var Site = window.Site || {};

/* Create a closure to maintain scope of the '$'
   and remain compatible with other frameworks.  */
(function($) {
	
	//same as $(document).ready();
	$(function() {
		
		$('input, textarea').placeholder();
		
		$.backstretch("/_/img/bg/tape-static.jpg", {
			speed: 300,
			centeredY: false
		});
		
		$('#newsroll article:first-of-type').addClass('first');
		$('#releases > figure').addClass('newest');

	// Smooth Scroll for same page anchor links
  
	  $(function(){
    	$('a[href*=#]').click(function() {
  	  if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') 
	      && location.hostname == this.hostname) {
        	var $target = $(this.hash);
      	 $target = $target.length && $target || $('[name=' + this.hash.slice(1) +']');
    	    if ($target.length) {
  	        var targetOffset = $target.offset().top;
	          $('html,body').animate({scrollTop: targetOffset}, 1000);
        	  return false;
      	  }
    	  }
  	  });
	  });
	  
	  
	  // Update Price on Product change
	  
	  $('select[name="format"]').change(function() {
      var price = $('option:selected').attr('data-price');
      $('#price').html(price);
	  });
	  
	  // Add 1 to QTY
	  
	  $('#qty').val(1);
	  
	  // Play tracklist 
	  
    $.playable('/swf/');
    $(function(){
      $('#tracklist a[href$=".mp3"]').playable();
    });

	});


	$(window).bind("load", function() {
		
		
	
	});
	
})(jQuery);
