(function(b){var a=function(i,m){var d=b(i);var h=this;var c=b.extend({dias:0,horas:0,minutos:5,segundos:0,intervalo:1000,tempoExpirou:function(n){alert("tempo esgotado!");n.hide();return}},m||{});var j=c.dias;var e=c.horas;var g=c.minutos;var l=c.segundos;this.timer=null;this.initTimer=function(){var n=this;this.timer=setInterval(function(){k()},c.intervalo);return this.timer};var f=function(){clearInterval(this.timer)};var k=function(){l--;if(l<0){l=59;g--;if(g<0){g=59;e--;if(e<0){e=23;j--;if(j<0){f();c.tempoExpirou(d);return}}}}if(j<=9){xdd="0"+j}else{xdd=j}if(e<=9){xhh="0"+e}else{xhh=e}if(g<=9){xmm="0"+g}else{xmm=g}if(l<=9){xss="0"+l}else{xss=l}d.html(xdd+"&nbsp;&nbsp;&nbsp;"+xhh+"&nbsp;&nbsp;&nbsp;"+xmm+"&nbsp;&nbsp;&nbsp;"+xss)}};b.fn.contador=function(c){var d=0;return this.each(function(){var e=b(this);if(e.data("contador"+d)){return}var f=new a(this,c);f.initTimer();d++;e.data("contador"+d,f)})}})(jQuery);
