function softScroll(menuID, headerID, footerID, vitesse, delay){

	$(document).ready(function(){			   
		
		//hauteur disponible
		
		var tmp = $("div[id=" + footerID + "]");
		var tmp2 = tmp.offset().top;
		var tmp3 = (tmp.css('marginBottom')).substr(0,3);
		var availableH = tmp2 - parseInt(tmp3);
		
		
		var timeout = setTimeout(function(){},10) ;
		
		//hauteur du menu
		
		var menuH = $("div[id=" + menuID + "]").height();
		
		//hauteur du header
		
		var headH = $("div[id=" + headerID + "]").height();
		
		//hauteur du footer
		
		var footH = $("div[id=" + footerID + "]").height();
							
		$(document).scroll(function(){
			//var margeTop = $(document).scrollTop();
			//var margeBottom = $("div[id=menu]").scrollBottom();
			/*if(margeTop < 0){
				 $("div[id=menu]").css('position', 'fixed');
			}*/
			
			clearTimeout(timeout) ;
			timeout = setTimeout(scrollMenu, delay) ;
			
			
								 
		 });
		
		var scrollMenu = function() {
			var TopNav = $(document).scrollTop();

			var marge = TopNav - headH;
			if((marge>0)&&((TopNav+menuH)<availableH)){
				$("div[id=" + menuID + "]").animate({marginTop:marge}, vitesse,'linear');
			}
			
			if(marge<=0){
				$("div[id=" + menuID + "]").animate({marginTop:0}, vitesse,'linear');
			}
			if((TopNav + menuH) > availableH){
				$("div[id=" + menuID + "]").animate({marginBottom:0}, vitesse,'linear');
			}
		}
		
		$(".clearonfocus").focus(function(){
			$(this).attr("value","");
		});
		
	});
}
