function resizeWrap(){
	var wrapH = $("#wrap").height();
	var windowH = $(window).height();
	var differ = parseInt(windowH)-parseInt(wrapH);
	var mrgn = 0;
	
	if(differ >= 0){
		mrgn = differ/parseInt(2);
		jQuery("#wrap").css({ height: (parseInt(windowH) - mrgn) + "px", marginTop: mrgn + "px" }); 
	}
}

jQuery(window).resize(resizeWrap);
jQuery(document).ready(function($){
	resizeWrap();
	$(".ngg-gallery-thumbnail img").hover(function(){
		$(".ngg-gallery-thumbnail img").stop().animate({ opacity:"0.5" });
		$(this).stop().animate({ opacity:"1" });
	}, function(){
		$(".ngg-gallery-thumbnail img").stop().animate({ opacity:"1" });
	});
	$(".ngg-album-compact").hover(function(){
		$(".ngg-album-compact img").stop().animate({ opacity:"0.5" });
		$("img", this).stop().animate({ opacity:"1" });
	}, function(){
		$(".ngg-album-compact img").stop().animate({ opacity:"1" });
	});

});
