jQuery.fn.extend({everyTime:function(b,c,d,e,a){return this.each(function(){jQuery.timer.add(this,b,c,d,e,a)})},oneTime:function(a,b,c){return this.each(function(){jQuery.timer.add(this,a,b,c,1)})},stopTime:function(a,b){return this.each(function(){jQuery.timer.remove(this,a,b)})}});jQuery.extend({timer:{guid:1,global:{},regex:/^([0-9]+)\s*(.*s)?$/,powers:{ms:1,cs:10,ds:100,s:1000,das:10000,hs:100000,ks:1000000},timeParse:function(c){if(c==undefined||c==null){return null}var b=this.regex.exec(jQuery.trim(c.toString()));if(b[2]){var a=parseInt(b[1],10);var d=this.powers[b[2]]||1;return a*d}else{return c}},add:function(e,c,d,g,h,b){var a=0;if(jQuery.isFunction(d)){if(!h){h=g}g=d;d=c}c=jQuery.timer.timeParse(c);if(typeof c!="number"||isNaN(c)||c<=0){return}if(h&&h.constructor!=Number){b=!!h;h=0}h=h||0;b=b||false;if(!e.$timers){e.$timers={}}if(!e.$timers[d]){e.$timers[d]={}}g.$timerID=g.$timerID||this.guid++;var f=function(){if(b&&this.inProgress){return}this.inProgress=true;if((++a>h&&h!==0)||g.call(e,a)===false){jQuery.timer.remove(e,d,g)}this.inProgress=false};f.$timerID=g.$timerID;if(!e.$timers[d][g.$timerID]){e.$timers[d][g.$timerID]=window.setInterval(f,c)}if(!this.global[d]){this.global[d]=[]}this.global[d].push(e)},remove:function(d,c,e){var a=d.$timers,b;if(a){if(!c){for(c in a){this.remove(d,c,e)}}else{if(a[c]){if(e){if(e.$timerID){window.clearInterval(a[c][e.$timerID]);delete a[c][e.$timerID]}}else{for(var e in a[c]){window.clearInterval(a[c][e]);delete a[c][e]}}for(b in a[c]){break}if(!b){b=null;delete a[c]}}}for(b in a){break}if(!b){d.$timers=null}}}}});if(jQuery.browser.msie){jQuery(window).one("unload",function(){var a=jQuery.timer.global;for(var b in a){var d=a[b],c=d.length;while(--c){jQuery.timer.remove(d[c],b)}}})};