
// Masonry
$(function(){
   $('#Wrapper').masonry({
       columnWidth: 250, 
       itemSelector: '.Item:visible',
       animate: true
   });
});

// DropPanel
$(document).ready(function(){
	$(".Btn-Slide").toggle(function(){
		$("#Panel").stop().animate({marginTop: "0px"},{queue:false,duration:300});
		$(this).toggleClass("Act"); return false;
	}, function() {
		$("#Panel").stop().animate({marginTop: "-260px"},{queue:false,duration:300});
		$(this).toggleClass("Act"); return false;
	});
});

// Fancy Image Hover
$(document).ready(function() {
	$(".Item .Image").hover(function() { //On hover...
		var thumbOver = $(this).find("img").attr("src"); //Get image url and assign it to 'thumbOver'
		//Set a background image(thumbOver) on the &lt;a&gt; tag 
		$(this).find("a.Thumb").css({'background' : 'url(' + thumbOver + ') no-repeat center bottom'});
		//Fade the image to 0
		$(this).find("span").stop().fadeTo('normal', 0 , function() {
			$(this).hide() //Hide the image after fade
		}); 
	} , function() { //on hover out...
		//Fade the image to 1 
		$(this).find("span").stop().fadeTo('normal', 1).show();
	});
});

// PrettyPhoto
$(document).ready(function(){
	$("a[rel^='prettyPhoto']").prettyPhoto();
});

// Button
$(document).ready(function() {
	$('.Button, .Category a').append('<span class="Hover"></span>').each(function () {
  		var $span = $('> span.Hover', this).css('opacity', 0);
  		$(this).hover(function () {
    		$span.stop().fadeTo('normal', 1);
 		}, function () {
   	$span.stop().fadeTo('normal', 0);
  		});
	});
});