$(document).ready(function(){

	// a image rollover fadeIn/Out
	$("a img").not(".rollover").hover(function(){
		$(this).css("opacity","0.6");
	},function(){
		$(this).fadeTo(200, 1);
	});

	// image rollover
	var image_cache = new Object();
	$("img.rollover").each(function(i) {
		var imgsrc = this.src;
		var dot = this.src.lastIndexOf('.');
		var imgsrc_on = this.src.substr(0, dot) + '_o' + this.src.substr(dot, 4);
		image_cache[this.src] = new Image();
		image_cache[this.src].src = imgsrc_on;
		$(this).hover(
			function(){this.src = imgsrc_on;},
			function(){this.src = imgsrc;});
	});

	// anchor scroller
	$('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}, 250);
				return false;
			}
		}
	});


});



