/*  */ 
 
 
/*  */ 
$(document).ready(function(){
	
	$(".grid_gallery_block").each(function(){
		if($(this).find('li').hasClass('image')) {

			//create unique gallery id
			var $galleryName = $(this).attr('id');
		
			//add shadowbox to all images
			$(this).find('li').each(function(){
				$(this).children("a").attr('rel', 'shadowbox[' + $galleryName + ']');
			});		
		}
	});
	
	//Set layout for full gallery images & videos
	$('.full_gallery_block ul').each(function(j) {
		
		//set unique id for each full gallery
		var galleryId = 'gallery_' + j;
		$(this).attr('id', galleryId);
	
		// if it's a gallery of images
		if ($(this).find('li').hasClass('image')) {
			$(this).before('<div class="loader"><img src="/img/spinner.gif" width="16" height="16" alt="Loading..." /></div>');
			$(this).gallery({imgHeight: '550px', imgSize: '880n', thumbSize: '100'});	
		}
	
		//else if it's a gallery of videos:
		else if ($(this).find('li').hasClass('video')) {		
			$(this).playlist({
				playlistTitle: '<h3>More Videos</h3>'
			});
		}
	});
	
	// Tab project blocks
	$("#project_nav ul").tabs("#main > section", {effect: 'fade', history: true });
	
});

$(window).load(function(){			//fade in full galleries and remove spinner
	$(".loader").remove();
	$(".main_image").fadeIn();
	$(".gallery_nav").fadeIn();
});

//init shadowbox
Shadowbox.init({
	overlayOpacity: 0.9,
	continuous: true
});

 
 
