/* Author: Andy Hutchins for Seven Layers Design
*/

// Start of Document Code
$(document).ready(function() {
    //attach click events for sort options
    $('#photoSection .sortOptions a').click(function(){
        //remove current classe first
        $('#photoSection .sortOptions a').removeClass('current');        
        $(this).addClass('current');//add current to clicked item
        //call isotope to filter
        if($(this).hasClass('all')){
            $('#photoList').isotope({ filter: '*' });
        } else if ($(this).hasClass('wedding')){
            $('#photoList').isotope({ filter: '.wedding' });
        } else if ($(this).hasClass('commercial')){
            $('#photoList').isotope({ filter: '.commercial' });
        } else if ($(this).hasClass('architecture')){
            $('#photoList').isotope({ filter: '.architecture' });
        } else if ($(this).hasClass('special')){
            $('#photoList').isotope({ filter: '.special' });
        }
        return false;
    });
    
    //fadeOut images
    $('#photoSection img, #videoSection img').fadeTo(250, 0.75);
    //fade img to 1 on hover
    $('#photoSection img, #videoSection img').hover(function(){
        $(this).fadeTo(250, 1);        
    }, function(){
        $(this).fadeTo(250, .75);        
    });
    
});

