
$(document).ready(function(){
	if (!$.browser.mobile){
		var bottomOffset=$('#footer-wrapper').height();
		bottomOffset-=15;
		
		$('#footer-wrapper').css({
			'position':'fixed',
			'bottom':'-'+bottomOffset+'px'
		});
		
		$('#footer-wrapper').mouseenter(function(){
			$(this).stop();
			$(this).animate({
				'bottom':'0px'
			});
			
		});
		
		$('#footer-wrapper').mouseleave(function(){
			var posBottom=$(document).scrollTop()+$(window).height();
			if (posBottom != $(document).height()){
				$(this).stop();
				$(this).animate({
					'bottom':'-'+bottomOffset+'px'
				});
			}
			
		});
		
		$(document).scroll(function(){
			var posBottom=$(document).scrollTop()+$(window).height();
			if (posBottom == $(document).height()){
				$('#footer-wrapper').stop();
				$('#footer-wrapper').animate({
					'bottom':'0px'
				});
			
			}else if($('#footer-wrapper').css('bottom') == '0px'){
				$('#footer-wrapper').stop();
				$('#footer-wrapper').animate({
					'bottom':'-'+bottomOffset+'px'
				});
			}
		})
		
	}
});

