$(document).ready(function(){
   
   
   if($('#carousel').length != 0){
        $('#carousel').featureCarousel({
          trackerIndividual: false,
	  trackerSummation: false,
	  sidePadding: 0,
	  topPadding: 35,
	  animationEasing: 'easeOutQuint',
	  largeFeatureWidth:    550,
          largeFeatureHeight:   230,
          smallFeatureWidth:    275,
          smallFeatureHeight:   115
        });   
	
    }
    
    /* portfolio item hover */
    
    if($('.p_item-hover').length != 0){
	$('#portfolio-list li').hover(function(){
	    $('.p_item-hover', this).stop().animate({top:'-183'},200);
	},function(){
	    $('.p_item-hover', this).stop().animate({top:'0'},200);
	});

 };
 
 /* portfolio isotope filtre */
    if($('#portfolio-filter').length != 0){
	
	$('#portfolio-container').isotope({
	    filter: '.all'
	}); 
	
	var $container = $('#portfolio-container');
	// initialize isotope
	$container.isotope({
	    // options...
	    itemSelector : '.isotope-item',
	    animationOptions: {
		duration: 750,
		easing: 'linear',
		queue: false
	    }
	});
	
	// filter items when filter link is clicked
		$('#portfolio-filter a').click(function(){
		    var selector = $(this).attr('data-filter');
		    $container.isotope({ filter: selector });
		    return false;
		});
		
	// make selected active
	var $optionSets = $('#portfolio-filter'),
          $optionLinks = $optionSets.find('a');

      $optionLinks.click(function(){
        var $this = $(this);
        // don't proceed if already selected
        if ( $this.hasClass('current') ) {
          return false;
        }
        var $optionSet = $this.parents('#portfolio-filter');
        $optionSet.find('.current').removeClass('current');
        $this.addClass('current');
  
        // make option object dynamically, i.e. { filter: '.my-filter-class' }
        var options = {},
            key = $optionSet.attr('data-option-key'),
            value = $this.attr('data-option-value');
        // parse 'false' as false boolean
        value = value === 'false' ? false : value;
        options[ key ] = value;
        if ( key === 'layoutMode' && typeof changeLayoutMode === 'function' ) {
          // changes in layout modes need extra logic
          changeLayoutMode( $this, options )
        } else {
          // otherwise, apply new options
          $container.isotope( options );
        }
        
        return false;
      });
      
      // animation for portfolio hover
      
	$('.item-content').hover(function(){
	    $('.up-portfolio-item', this).stop().animate({top:'0'},200);
	},function(){
	    $('.up-portfolio-item', this).stop().animate({top:'-100'},200);
	});
	
	$('.item-content').hover(function(){
	    $('.down-portfolio-item', this).stop().animate({top:'-29'},200);
	},function(){
	    $('.down-portfolio-item', this).stop().animate({top:'0'},200);
	});
     // end animation for portfolio hover
      
    };

    /* Front page recent project */
    if($('.fp-item-hover').length != 0){
	$('.fp-recent-projects li').hover(function(){
		$('.fp-item-hover', this).stop().animate({top:'-145'},200);
	    },function(){
		$('.fp-item-hover', this).stop().animate({top:'0'},200);
	    });
    };

/* Pretty Photo Lightbox clone */
    if($(".item-content > a").length != 0){
	$(".item-content > a").prettyPhoto();
    };

});/* end body */
   
   



