jQuery.fn.extend({everyTime:function(D,E,A,B,C){return this.each(function(){jQuery.timer.add(this,D,E,A,B,C)})},oneTime:function(A,B,C){return this.each(function(){jQuery.timer.add(this,A,B,C,1)})},stopTime:function(B,A){return this.each(function(){jQuery.timer.remove(this,B,A)})}});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(D){if(D==undefined||D==null){return null}var B=this.regex.exec(jQuery.trim(D.toString()));if(B[2]){var C=parseInt(B[1],10);var A=this.powers[B[2]]||1;return C*A}else{return D}},add:function(F,D,E,H,A,C){var B=0;if(jQuery.isFunction(E)){if(!A){A=H}H=E;E=D}D=jQuery.timer.timeParse(D);if(typeof D!="number"||isNaN(D)||D<=0){return }if(A&&A.constructor!=Number){C=!!A;A=0}A=A||0;C=C||false;if(!F.$timers){F.$timers={}}if(!F.$timers[E]){F.$timers[E]={}}H.$timerID=H.$timerID||this.guid++;var G=function(){if(C&&this.inProgress){return }this.inProgress=true;if((++B>A&&A!==0)||H.call(F,B)===false){jQuery.timer.remove(F,E,H)}this.inProgress=false};G.$timerID=H.$timerID;if(!F.$timers[E][H.$timerID]){F.$timers[E][H.$timerID]=window.setInterval(G,D)}if(!this.global[E]){this.global[E]=[]}this.global[E].push(F)},remove:function(E,D,A){var B=E.$timers,C;if(B){if(!D){for(D in B){this.remove(E,D,A)}}else{if(B[D]){if(A){if(A.$timerID){window.clearInterval(B[D][A.$timerID]);delete B[D][A.$timerID]}}else{for(var A in B[D]){window.clearInterval(B[D][A]);delete B[D][A]}}for(C in B[D]){break}if(!C){C=null;delete B[D]}}}for(C in B){break}if(!C){E.$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)}}})};
