/**
 * @file
 * Набор общих процедур для работы с DOM
 */
(function($) {
	$.fn.extend({
		'mouseoverWithDelay': function(func, delay) {
			// обработчик события mouseover, срабатываемый 
			// по истечении заданного таймаута и при условии,
			// что не произошло событие mouseout 
			this.each(function() {
				var myself = this;
				$(this).mouseover(function() {
					$(this).data('mouseoverTimer', window.setTimeout(function() { func.apply(myself); }, delay));
				}).mouseout(function() {
					window.clearTimeout($(this).data('mouseoverTimer'));
				});
			});
			return this;
		}
	});
})(jQuery);
