$(document).ready(function () {
	$.localScroll({
		target: '#content',
		axis: 'xy',
		queue:true,
		duration:1000,
		hash:true,
		easing: 'swing'
	});
	
	function selectNav() {
        $(this)
            .parents('ul:first')
                .find('a')
                    .removeClass('selected')
                .end()
            .end()
            .addClass('selected');
    }

    $('#navSub .navSub').find('a').click(selectNav);

    // go find the navigation link that has this target and select the nav
    function trigger(data) {
        var el = $('#navSub .navSub').find('a[href$="' + data.id + '"]').get(0);
        selectNav.call(el);
    }

    if (window.location.hash) {
        trigger({ id : window.location.hash.substr(1) });
    } else {
        $('ul.navSub a:first').click();
    }
	
	
	
	
	$("img.fade").hover(function() {
		$(this).stop().animate({"opacity": "0"},  250);
	},
	function() {
		$(this).stop().animate({"opacity": "1"},  450);
	});
	
	$("img.fade-icon").hover(function() {
		$(this).stop().animate({"opacity": "0"},  200);
	},
	function() {
		$(this).stop().animate({"opacity": "1"},  400);
	});

	$(window).unload( function () {} );
});
