$(document).ready(function(){

		$('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) {
				 $target.ScrollTo(400,null,'elasout');
				 return false;
			 }
		  };
		});

	$('#main_menu ul li a').each(function(){
		this.old_padding_left=parseInt($(this).css('padding-left'));
		this.old_color=$(this).css('color');
	});

	$('#main_menu ul li a').bind('mouseover',function(){
		target_padding=this.old_padding_left+10;
		var anim=$(this).attr('animating');
		if (anim!=1) {
			$(this).attr('animating', 1);
			$(this).animate({
				style: 'color:#000;padding-left:' + target_padding + 'px;text-align:left;',
				backgroundColor: '#A4A16D' //puke
			//backgroundColor: '#771717'  //lighter red
			//backgroundColor: '#3E0E0E' //red
			//backgroundColor: '#38658F' //blue


			}, 'slow');
		}
	});
	$('#main_menu ul li a').bind('mouseout',function(){
		target_padding= this.old_padding_left;

		$(this).animate({
				style: 'color:'+this.old_color+';padding-left:'+target_padding+'px;text-align:left;',
				backgroundColor: '#494949'
		},'slow',stopRollAnimations)
	});

});

function stopRollAnimations(){
	$(this).attr('animating',0);
}
