/******************************************************************************
 * page_effects.js
 *
 * [Require]
 *	jquery-1.3.2.min.js
 ******************************************************************************/

/*
 * Changes opacity of link images on hover.
 */
$(function() {
	$('a > img').hover(
		function() {
			//$(this).fadeTo('slow', 0.5);
			$(this).animate({ opacity: 0.5 }, "fast");
		},
		function() {
			//$(this).fadeTo('slow', 1);
			$(this).animate({ opacity: 1.0 }, "fast");
		}
	);
});

/*
 * Smooth scrolling internal links.	
 */
$(function() {
	$('a[href*=#]').click(function() {
		if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') 
				&& location.hostname == this.hostname) {
			var target = $(this.hash);
			target = target.length && target;
			if (target.length) {
				$('html,body').animate({scrollTop: target.offset().top});
				return false;
			}
		}
	});
});
