/* Author: 
*/

$(document).ready(function(){

	
/*Scroll to top*/
	$('a[href=#top]').click(function(){
        $('html, body').animate({scrollTop:0}, 'slow');
        return false;
    });
    
/*Image caption*/    
    $('img.captify').captify({
		// all of these options are... optional
		// ---
		// speed of the mouseover effect
		speedOver: 'fast',
		// speed of the mouseout effect
		speedOut: 'normal',
		// how long to delay the hiding of the caption after mouseout (ms)
		hideDelay: 500,	
		// 'fade', 'slide', 'always-on'
		animation: 'slide',		
		// text/html to be placed at the beginning of every caption
		prefix: '',		
		// opacity of the caption on mouse over
		opacity: '0.7',					
		// the name of the CSS class to apply to the caption box
		className: 'caption-bottom',	
		// position of the caption (top or bottom)
		position: 'bottom',
		// caption span % of the image
		spanWidth: '100%'
	});	


/*Fixed scroll*/	
	$( window ).scroll( function( ){ 

		var scroller_object = $( "#desc" );

		if( document.documentElement.scrollTop >= 225 || window.pageYOffset >= 225 )
		{
			if( $.browser.msie && $.browser.version == "6.0" )
			{
				scroller_object.css( "top", ( document.documentElement.scrollTop + 20 ) + "px" );
			}
			else
			{
				scroller_object.css( { position: "fixed", top: "20px" } );
			}
		}
		else if( document.documentElement.scrollTop < 225 || window.pageYOffset < 225 )
		{
			scroller_object.css( { position: "absolute", top: "225px" } );
		}
	} );
	
	//$("p:has(img)").css('margin' , '20px 0px 20px 0px');
});



