(function(){
$("#menu-close").click(function(e) {
	e.preventDefault();
	$("#sidebar-wrapper").toggleClass("active");
});
$("#menu-toggle").click(function(e) {
	e.preventDefault();
	$("#sidebar-wrapper").toggleClass("active");
});
$('a[href*=#]:not([href=#])').click(function() {
  if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') 
	|| location.hostname == this.hostname) {

	var target = $(this.hash);
	target = target.length ? target : $('[name=' + this.hash.slice(1) +']');
	if (target.length) {
	  $('html,body').animate({
		scrollTop: target.offset().top
	  }, 1000);
	  return false;
	}
  }
});


//$("[rel='tooltip']").tooltip();
 //function
imgHover();
boxHeight();
lightboxPhoto(); 
 
})();
$(window).load(function(){
 //$('body').fadeIn(3000);
$('#filterOptions a').click(function (e) {
    e.preventDefault();
 
    // set active class
    $('#filterOptions').find('.cur').removeClass('cur');
    $(this).parent().addClass('cur');
 
    // get group name from clicked item
    var groupName = $(this).attr('data-group');
 
    // reshuffle grid
    $grid.shuffle('shuffle', groupName );
	});
    /* initialize shuffle plugin */
    var $grid = $('#grid'),
	$sizer = $grid.find('.shuffle__sizer');
 
    $grid.shuffle({
        itemSelector: '.box', // the selector for the items in the grid
		sizer: $sizer
    });
});

$(window).scroll(function(){
navScroll();
});
$(window).resize(function(){
boxHeight();
});
function navScroll(){
 
var top = $(window).scrollTop();

if (top > 300) {
$('#menu-toggle').css('color','#242424');

}else {

$('#menu-toggle').css('color','#fff');
}

}
function imgHover(){
 $('.thumb-img').hover(function(){
      $(this).find('.thumb-mask').fadeIn();
    
 }, function(){
    $(this).find('.thumb-mask').fadeOut();
 });   
}
function boxHeight(){
var wHeight = $(window).height();
$('.header').css('min-height', wHeight); 
}
function lightboxPhoto() {
    $(document).delegate('*[data-toggle="lightbox"]', 'click', function(event) {
    event.preventDefault();
    $(this).ekkoLightbox();
    }); 
}