jQuery.noConflict();

jQuery(document).ready(function($){
	$('span.view-large').hide();
	myOp = 1;
		
	$(window).load(function(){
		
		// Grid jQuery plugin: http://desandro.com/resources/jquery-masonry/
		
		/*jQuery('#sort').masonry({ 
			columnWidth: 350,
			animate: true,
			itemSelector: '.box'
			//easing: 'linear'
		}, 
		function() { jQuery(this).css({
			margin: '10px'
			});
		});*/
		
		// MouseOver Events
		
		/*jQuery('.box').hover(function(){
			jQuery('img', this).fadeTo("fast", 0.75).addClass('box-hover');
			jQuery('span.view-large', this).fadeTo("fast", 1)},
			function(){
			jQuery('img', this).fadeTo("fast", myOp).removeClass('box-hover');
			jQuery('span.view-large', this).fadeTo("fast", 0)
		});*/
		
		// Colorbox
		$("a[rel='gallery']").colorbox();
		$("a[rel='lightbox[flickr]']").colorbox();

		var base_path = "/wp-content/themes/shaken-grid/images/backgrounds/bg-"
		//var base_path = "/wp-content/themes/shaken-grid/images/backgrounds/color/bg-"
		var bg_front_image = [base_path+'front1.jpg',
						base_path+'front2.jpg',
						base_path+'front3.jpg',
						base_path+'front4.jpg',
						base_path+'front5.jpg',
						base_path+'front6.jpg',
						base_path+'front7.jpg',
						base_path+'front8.jpg',
						base_path+'front9.jpg',
						base_path+'front10.jpg',
						base_path+'front11.jpg',
						base_path+'front12.jpg',
						base_path+'front13.jpg',
						base_path+'front14.jpg',
						base_path+'front15.jpg',
						base_path+'front16.jpg'];
		
		var bg_image = [base_path+'buy.jpg',
						base_path+'contact.jpg',
						base_path+'links.jpg',
						base_path+'live.jpg'];		
						
		var r = Math.floor(Math.random()*bg_front_image.length);

		if ($('body').hasClass('home')){
			$.backstretch(bg_front_image[r], {speed: 'fast'});
			//$.backstretch("/wp-content/themes/shaken-grid/images/backgrounds/test.jpg", {speed: 'fast'});
		}
		if ($('body').hasClass('page-id-88')){
			$.backstretch(bg_image[0], {speed: 'fast'});
		}
		if ($('body').hasClass('page-id-73')){
			$.backstretch(bg_image[1], {speed: 'fast'});
		}
		if ($('body').hasClass('page-id-83')){
			$.backstretch(bg_image[2], {speed: 'fast'});
		}
		if ($('body').hasClass('page-id-90')){
			$.backstretch(bg_image[3], {speed: 'fast'});
		}


		$('#liner span').html($('.album-songs li:first-child blockquote').clone());

		$('.album-songs li').click(function() {
		    $('#liner span').html($('.liner-notes', this).clone());
		});
		
	});
});

