var coords = $(window).width()/2
window.onmousemove = function(e){
$("#layer-2").animate({"left" : ((coords - e.pageX) ) / 10}, 100 );
}
var windowCenter = $(window).width()/2,
layer = $("#layer-2"),
timeout;
$(window).on('mousemove', function(e){
clearTimeout(timeout);
timeout = setTimeout(function(){
var newLeft = ((windowCenter - e.originalEvent.pageX) ) / 10;
layer.animate({"left" : newLeft}, 100 );
}, 50);
});