var delay = 2000,
callback = function() {
nextSlide(1);
timeoutId = null;
},
timeoutId = setTimeout(callback, delay),
time = Date.now();;
$("#blok").mouseenter(function() {
clearTimeout(timeoutId);
}).mouseleave(function() {
if(timeoutId) {
var n = Date.now() - time;
if(n > delay) {
callback();
}
else {
timeoutId = setTimeout(callback, delay - n);
}
}
});