



// hover caption

$('.hovercaption').hover(
   function(){ $(this).children('.hover').fadeIn(100);
   },
   function(){ $(this).children('.hover').fadeOut(100);
   }
);


// colorbox


$(".modal_generic").colorbox({
	width:"577px", 
	height:"100%",
	opacity:0.5,
	left:"15%",
	transition:"fade",
	speed:200,
	fixed:true,
	scrolling:true,
	onOpen:function(){ 
		if ( $.browser.msie ) {
		    if(parseFloat(jQuery.browser.version) == 8){
		    	$("body").css("overflow", "hidden");
		    } else{
		    	$("html").css("overflow-y", "hidden");
		    }
		} else {
			$("html").css("overflow-y", "hidden");
		}
	}, 
	onClosed:function() {
		if ( $.browser.msie ) {
		    if(parseFloat(jQuery.browser.version) == 8){
		    	$("body").css("overflow", "auto");
		    } else{
		    	$("html").css("overflow-y", "auto");
		    }
		} else {
			$("html").css("overflow-y", "auto");
		}
	},
	onComplete: function() {	
		if ( $.browser.msie ) {
		    if(parseFloat(jQuery.browser.version) < 9){
				// If < IE9 use ugly scrollbars and fix the height
				$('#cboxLoadedContent, #cboxContent').css('height',$(window).height());
				$("#cboxLoadedContent").css("overflow", "auto");	
		    }	
		} 	
		else {
			// Custom scrollbars for nice browsers
			$('#generic').css('height',$(window).height());	 
    		$('#generic').jScrollPane({verticalGutter :"0", autoReinitialise: true});
        }
    }
});


	
	
	



// masonry for grid

$(function(){

	var $container = $('.gallery');
	
	$container.imagesLoaded( function(){
		$container.masonry({
		itemSelector : '.thumb',
		isAnimated: true ,
		animationOptions: {
			duration: 300,
			easing: 'linear',
			queue: false
		}
		});
	});

});

// blog

$(function(){

	var $container = $('.post-content');
	
	$container.imagesLoaded( function(){
		$container.masonry({
		itemSelector : '.item',
		isAnimated: true ,
		isFitWidth: true , 
		columnWidth: 25
		});
	});		
});

