/* 
	Author: Brian Wong 2011
*/
/***********************************************
Jquery Smooth Page Scrolling/David Martin
http://designwoop.com/2011/01/using-jquery-to-create-smooth-page-scrolling/
***********************************************/

$(document).ready(function(){
 
 $('a.scrollToTop').click(function(){
 
 $('html, body').animate({scrollTop:0}, 'slow');
 
 return false;
 
 });
 
})

/***********************************************
jQuery and Quicksand Portfolio Filter: 
http://www.evoluted.net/thinktank/web-development/jquery-quicksand-tutorial-filtering
***********************************************/

$(document).ready(function() {

  // get the action filter option item on page load
  var $filterType = $('#filters li.active a').attr('class');
	
  // get and assign the ourHolder element to the
	// $holder varible for use later
  var $holder = $('div.work_container');

  // clone all items within the pre-assigned $holder element
  var $data = $holder.clone();

  // attempt to call Quicksand when a filter option
	// item is clicked
	$('#filters li a').click(function(e) {
		// reset the active class on all the buttons
		$('#filters li').removeClass('active');
		
		// assign the class of the clicked filter option
		// element to our $filterType variable
		var $filterType = $(this).attr('class');
		$(this).parent().addClass('active');
		
		if ($filterType == 'all') {
			// assign all li items to the $filteredData var when
			// the 'All' filter option is clicked
			var $filteredData = $data.find('article');
		} 
		else {
			// find all li elements that have our required $filterType
			// values for the data-type element
			var $filteredData = $data.find('article[data-type=' + $filterType + ']');
		}
		
		// call quicksand and assign transition parameters
		$holder.quicksand($filteredData, {
			duration: 800,
			easing: 'easeInOutQuad'
		});
		return false;
	});
});

/***********************************************
FitVids.js  :  http://fitvidsjs.com/
***********************************************/

$(document).ready(function(){
    // Target your .container, .wrapper, .post, etc.
    $(".project_samples").fitVids();
});

