/* Fancybox */

$(document).ready(function() {
	
	$("a.zoom").fancybox({
		'padding' 			: 0,
		'hideOnContentClick': true, 
		'overlayShow'		: true,
		'overlayOpacity' 	: 0.8,
		'overlayColor'      : '#FFF',
		'titleShow' 		: true,
		"titleFromAlt" 		: true,
		'transitionIn'		: 'elastic',
		'transitionOut'		: 'elastic',
		'speedIn'			: 1000, 
		'speedOut'			: 700,
		'showCloseButton'	: false,
		'showNavArrows' 	: false	
	});
	
	$("a#inline").fancybox({
		'hideOnContentClick': true
	});
});


/* External Links */	

jQuery(document).ready(function() { 
							   
    $('a.external').click( function() {
        window.open(this.href);
        return false;
    });

});


/* 
* Skeleton V1.0.3
* Copyright 2011, Dave Gamache
* www.getskeleton.com
* Free to use under the MIT license.
* http://www.opensource.org/licenses/mit-license.php
* 7/17/2011
*/		

$(document).ready(function() {

/* Tabs Activiation
================================================== */
	var tabs = $('ul.tabs');
	
	tabs.each(function(i) {
		//Get all tabs
		var tab = $(this).find('> li > a');
		tab.click(function(e) {
			
			//Get Location of tab's content
			var contentLocation = $(this).attr('href') + "Tab";
			
			//Let go if not a hashed one
			if(contentLocation.charAt(0)=="#") {
			
				e.preventDefault();
			
				//Make Tab Active
				tab.removeClass('active');
				$(this).addClass('active');
				
				//Show Tab Content & add active class
				$(contentLocation).show().addClass('active').siblings().hide().removeClass('active');
				
			} 
		});
	}); 
	
});


/* js class for Tab content (.js ul.tabs-content > li) 
------------------------------------------------------- 
*/
 $('html').addClass('js');

	 
/* Masonry - David DeSandro
----------------------------
*/

$(function(){
		   
	var $first = $('#first');	   
    
     $first.imagesLoaded( function(){
      $first.masonry({
        itemSelector : '.box',
        columnWidth: 50,
      	isFitWidth: true,
		isAnimated: true,
  			animationOptions: {
			duration: 1000,
			easing: 'linear',
			queue: false
		  }
      });
    });
	
	var $second = $('#second');
  
    $second.imagesLoaded( function(){
      $second.masonry({
        itemSelector : '.box',
        columnWidth: 50,
      	isFitWidth: true,
		isAnimated: true,
  			animationOptions: {
			duration: 1000,
			easing: 'linear',
			queue: false
		  }
      });
    });
	
	var $notfitted = $('#notfitted');
  
    $notfitted.imagesLoaded( function(){
      $notfitted.masonry({
        itemSelector : '.box',
        columnWidth: 50,
      	isFitWidth: false,
		isAnimated: true,
  			animationOptions: {
			duration: 1000,
			easing: 'linear',
			queue: false
		  }
      });
    });
  
});


$(function(){
    
    var $fluid = $('#fluid');
    
    $(window).resize(function(){
      $fluid.masonry({
          itemSelector: '.box',
          isResizable: false,
          // set columnWidth a fraction of the container width
          columnWidth: $fluid.width() / 2
      });
    // trigger resize to set up masonry on start-up
    }).resize();
    
  });
