// Defilement doux
	
function goTo(ancre){jQuery('html,body').animate({scrollTop:jQuery(ancre).offset().top},500,'swing',function(){
	if(ancre != 'body')
		window.location.hash = ancre;
	else
		window.location.hash = '#';
	jQuery(ancre).attr('tabindex','-1');
	jQuery(ancre).removeAttr('tabindex');
});
}

$(document).ready(function() {
    $('.toggle_loginform').bind('click', function(event) {
    	event.preventDefault();
    	goTo("#header");
  		$('#login_form').fadeToggle(100);
 		$(this).toggleClass('sfHoverForce'); 		
	});
	$('body').click(function(event) {
    	if (!$(event.target).closest('#login_form').length && !$(event.target).closest('.toggle_loginform').length) {
        	$('#login_form').fadeOut(100);
        	$('.toggle_loginform').removeClass('sfHoverForce');
    	};
	});
});
