(function($){
$(function() {
var _timeout,
_wait = 15000; // 15 seconds
$(document).mousemove(function() {
clearTimeout(_timeout);
_timeout = setTimeout(function() {
alert("you havent moved for " + _wait + " seconds!");
}, _wait);
});
});
})(jQuery);
The above code provides the idle logic. I would recommend though to bind the mousemove event to a certain element rather than to the document, because this can cause performance issues.
For the popup I would recommend the jQuery dialog/ modal plugins.