var $j = jQuery.noConflict();

$j(function(){

    //start xhtml valid target="_blank"
	$j("a[href*='http://']:not([href*='"+location.hostname+"'])").click( function() {
	window.open(this.href);
	return false;
	});
	//end xhtml valid target="_blank"
	
	// Adds .first and .last classes to the first & last main navigation items
	$j('ul.sidenav li:first-child').addClass( 'first' );
	$j('ul.sidenav li:last-child').addClass( 'last' );
	
	
	$j("a[rel=fancybox]").fancybox({
		'transitionIn'		: 'elastic',
		'transitionOut'		: 'elastic',
		'speedIn'		:	200, 
		'speedOut'		:	200,
		'overlayShow'	:	true,
		'titlePosition' 	: 'over',
		'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
			return '<span id="fancybox-title-over">Image ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>';
		}
	});
	
	
	// http://buildinternet.com/2009/03/sliding-boxes-and-captions-with-jquery/
	
	//Full Caption Sliding (Hidden to Visible)
	
	$j('.boxgrid.captionfull').hover(function(){
		$j(".cover", this).stop().animate({top:'97px'},{queue:false,duration:160});
	}, function() {
		$j(".cover", this).stop().animate({top:'187px'},{queue:false,duration:160});
	});


});




