jQuery(document).ready(function($) {


	// http://buildinternet.com/2009/03/sliding-boxes-and-captions-with-jquery/
	// 	Full Caption Sliding (Hidden to Visible)
	$('.boxgrid.captionfull').hover(function(){
		$('.cover', this).stop().animate({top:'160px'},{queue:false,duration:250});
	}, function() {
		$('.cover', this).stop().animate({top:'260px'},{queue:false,duration:250});
	});
	
	$('a#inlinevideo').fancybox({
		'showCloseButton': true,
		'hideOnOverlayClick': true,
		'hideOnContentClick': false,
		'frameWidth':  576,
		'frameHeight':  322,
		'centerOnScroll': false
	});
	
	
	$('a#peka-video').attr( 'href', '#peka-video-hd');
	$('a#peka-video').fancybox({
		'showCloseButton': true,
		'hideOnOverlayClick': true,
		'hideOnContentClick': false,
		'frameWidth':  960,
		'frameHeight':  570,
		'centerOnScroll': false
	});
	
	
	// smooth scrolling for internal links
    $('a[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) {

                var targetOffset = $target.offset().top;

                $('html,body').animate({scrollTop: targetOffset}, 1000);

                return false;

            }

        }

    });
    
    
    // attachment slider 
    $('.attachment-slider img:gt(0)').hide();
		setInterval(function(){
			$('.attachment-slider :first-child').fadeOut()
			.next('img').fadeIn()
		.end().appendTo('.attachment-slider');
		}, 5000
	);


// end jQuery(document).ready 
});

