var $j = jQuery.noConflict();

$j(function(){

    // XHTML valid target="_blank"
	$j("a[href*='http://']:not([href*='"+location.hostname+"'])").click( function() {
	window.open(this.href);
	return false;
	});
	
	// for https...
	$j("a[href*='https://']:not([href*='"+location.hostname+"'])").click( function() {
	window.open(this.href);
	return false;
	});
	
	
	// Adds .first and .last classes to the first & last main navigation items
	//add first and last classes for main-navigation
	
	$j('ul#menu-main-navigation li:first-child').addClass( 'first' );
	$j('ul#menu-main-navigation li:last-child').addClass( 'last' );
	
	$j('ul#menu-top-nav li:first-child').addClass( 'first' );
	$j('ul#menu-top-nav li:last-child').addClass( 'last' );
	
	
	// Fancy scroll to top
	$j('a[href=#top]').click(function(){
        $('html, body').animate({scrollTop:0}, 600);
        return false;
    });


});
