$(document).ready(function(){
	$('img[src*="__roll."]').each(function() {
		var onImages = $(this).attr('src').replace('__roll.','__rollon.');
		$(this).parent().css({'background-image':'url(' + onImages + ')','background-repeat':'no-repeat','height':'auto','overflow':'hidden','display':'inline-block'});
	});
	$('img[src*="__roll."]').hover(function() {	
		$(this).parent().addClass('a_hover');	
		$(this).stop(true,false).animate({opacity:0},200);
		}, function() {
		$(this).stop(true,false).animate({opacity:1},200,function(){$(this).parent().removeClass('a_hover');});
        });
	$("a img").hover(function(){
		if(!$(this).attr('src').match("__roll.")){
			$(this).parent().addClass('a_hover');
			$(this).fadeTo(200,0.5);
		}
	},
	function(){
		$(this).fadeTo("normal",1.0,function(){$(this).parent().removeClass('a_hover');});
	});
	$('a[href*=#],area[href*=#]').click(function() {  
		var target = $(this.hash);  
		target = target.length && target;  
		if (target.length) {  
			var sclpos = 30;  
			var scldurat = 1200;  
			var targetOffset = target.offset().top - sclpos;  
			$('html,body')  
			.animate({scrollTop: targetOffset},200);  
			return false;  
		} 
	});
	
	
	
});
