Array.prototype.inArray=function(b){var a;for(a=0;a<this.length;a++){if(this[a]===b){return true}}return false};String.prototype.formatCurrency=function(f){var a=this;if(f==undefined){f=2}var b,e=(a=a.split("."))[1].substr(0,f);for(b=(a=a[0]).length;(b-=3)>=1;){a=a.substr(0,b)+"."+a.substr(b)}return a+","+e+Array(f+1-e.length).join(0)};String.prototype.capitalize=function(){return this.charAt(0).toUpperCase()+this.slice(1)};String.prototype.reverse=function(){return this.split("").reverse().join("")};String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")};function $(){var c=new Array;for(var b=0;b<arguments.length;b++){var a=arguments[b];a=(typeof a=="string")?document.getElementById(a):a;if(arguments.length==1){return a}c.push(a)}return c}function $arr_filtros(b){var d=SetEvent.target(b).id,a="/arrematantes",c={filtro_i:$("filtro_i").value,filtro_uf:$("filtro_uf").value};if(c[d]){a+="/"+d.split("_")[1]+"="+c[d]}window.location=a}function $aviso(g,d,m,a){var h=$("leilao_j"),k=$("overlay"),f=document.documentElement.clientHeight,c=($body().scrollTop)?$body().scrollTop:document.documentElement.scrollTop;k.style.height=(($("full").clientHeight>f)?$("full").clientHeight:f)+"px";if(a=="s"){var b=d+16;var l="overflow-x:hidden;overflow-y:scroll"}else{var b=d;var l="overflow-x:hidden;overflow-y:hidden"}h.style.height=(m+40)+"px";h.style.width=(b+40)+"px";h.style.left=(($viewport()[0]/2)-(d/2))+"px";h.style.top=((f/2)-(m/2))+"px";var e='<div style="float:left;margin:20px;height:'+m+"px;width:"+b+"px;"+l+'">'+g+"</div>";h.style.display="inline";h.innerHTML=e+'<div id="leilao_j_close"></div>';SetEvent.add(k,"click",$avisoClose);SetEvent.add($("leilao_j_close"),"click",$avisoClose)}function $avisoClose(){$("overlay").style.height=0;$("leilao_j").style.display="none"}function $bind(b,a){return function(){return b.apply(a,arguments)}}function $body(){return document.body}function $bodyOnReady(a){done=false;init=function(){if(!done){done=true;a()}};var b=document;if(document.addEventListener){b.addEventListener("DOMContentLoaded",init,false)}if(/msie/i.test(navigator.userAgent)){(function(){try{b.documentElement.doScroll("left")}catch(c){setTimeout(arguments.callee,10);return}init()})()}if(window.opera){b.addEventListener("DOMContentLoaded",function(){if(done){return}for(var c=0;c<b.styleSheets.length;c++){if(b.styleSheets[c].disabled){setTimeout(arguments.callee,10)}return}init()},false)}if(/webkit/i.test(navigator.userAgent)){if(done){return}if(/loaded|complete/i.test(b.readyState)===false){setTimeout(arguments.callee,10);return}init()}if(!done){window.onload=init}}function $busca(){var a=$("buscaq").value;if(a&&a.length>=2){window.location="/busca/q="+a}}function $checkDate(b,a,c){if(typeof(c)=="undefined"||typeof(a)=="undefined"||typeof(b)=="undefined"){return 1}b=Math.abs(b)||0,a=Math.abs(a)||0,c=Math.abs(c)||0;return arguments.length!=3?1:b<1||b>31?2:a<1||a>12?3:/4|6|9|11/.test(a)&&b==31?4:a==2&&(b>((c=!(c%4)&&(c%100)||!(c%400))?29:28))?5+!!c:0}function $create(b){var a=document.createElement(b);if(arguments[1]&&typeof arguments[1]=="object"){for(x in arguments[1]){a.setAttribute(x,arguments[1][x])}}if(arguments[2]&&typeof arguments[2]=="object"){for(x in arguments[2]){a.style[x]=arguments[2][x]}}return a}function $disableSelection(a){if(typeof a.onselectstart!="undefined"){a.onselectstart=function(){return false}}else{if(typeof a.style.MozUserSelect!="undefined"){a.style.MozUserSelect="none"}else{a.onmousedown=function(){return false}}}a.style.cursor="default"}function $escapeHtml(a){return a.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}function $formEnableDisable(c,b){var a=c.elements.length;for(x=0;x<a;x++){c.elements[x].disabled=b}}function $formReturnValuesToArray(b){var a=b.elements.length,c=[];for(x=0;x<a;x++){if(b.elements[x].name&&(b.elements[x].type!="radio"||(b.elements[x].type=="radio"&&b.elements[x].checked))){c.push(b.elements[x].name+"="+b.elements[x].value)}}return c}function $getCumulativeOffset(c){var b,a;b=a=0;if(c.offsetParent){do{b+=c.offsetLeft;a+=c.offsetTop}while(c=c.offsetParent)}return{x:b,y:a}}function $hrc(){var a=hr.getHours(),b=hr.getMinutes(),c=hr.getSeconds(),d;hr.setSeconds(c+1);if(a<10){a="0"+a}if(b<10){b="0"+b}if(c<10){c="0"+c}d=a+":"+b+":"+c;$("bl_clk_h").innerHTML=d;setTimeout("$hrc()",1000)}function $is_numeric(a){return !isNaN(parseFloat(a))&&isFinite(a)}function $mask(q,h,c,b,p){if(!h){var h=window.event}if(h.keyCode){code=h.keyCode}else{if(h.which){code=h.which}}var f=(!b)?q.value.replace(/[^\d]+/gi,""):q.value.replace(/[^\d]+/gi,"").reverse();var s=(!b)?c:c.reverse();var d=(p)?p.pre:"";var n=(p)?p.pos:"";var g="";if(code==9||code==8||f.length==s.replace(/[^#]+/g,"").length){return false}for(var o=0,l=0,k=s.length;o<k&&l<f.length;){if(s.charAt(o)!="#"){g+=s.charAt(o);o++}else{g+=f.charAt(l);l++;o++}}g=(!b)?g:g.reverse();q.value=d+g+n}function $number_format(f,c,h,e){f=(f+"").replace(",","").replace(" ","");var b=!isFinite(+f)?0:+f,a=!isFinite(+c)?0:Math.abs(c),l=(typeof e==="undefined")?",":e,d=(typeof h==="undefined")?".":h,k="",g=function(p,o){var m=Math.pow(10,o);return""+Math.round(p*m)/m};k=(a?g(b,a):""+Math.round(b)).split(".");if(k[0].length>3){k[0]=k[0].replace(/\B(?=(?:\d{3})+(?!\d))/g,l)}if((k[1]||"").length<a){k[1]=k[1]||"";k[1]+=new Array(a-k[1].length+1).join("0")}return k.join(d)}function $objectKeys(c){var a=[];for(var b in c){if(c.hasOwnProperty(b)){a.push(b)}}return a}function $rand(b,a){b=(b)?b:1;a=(a)?a:10;var c=a-b+1;return Math.floor(Math.random()*c+b)}function $realFloat(a){a=a.replace(".","");a=a.replace(",",".");return parseFloat(a)}function $remove(a){if(a.parentNode&&a.nodeType){a.parentNode.removeChild(a);return true}else{return false}}function $round(d,b,h){var a,c,e,g;b|=0;a=Math.pow(10,b);d*=a;g=(d>0)|-(d<0);e=d%1===0.5*g;c=Math.floor(d);if(e){switch(h){case"PHP_ROUND_HALF_DOWN":d=c+(g<0);break;case"PHP_ROUND_HALF_EVEN":d=c+(c%2*g);break;case"PHP_ROUND_HALF_ODD":d=c+!(c%2);break;default:d=c+(g>0)}}return(e?d:Math.round(d))/a}function $scrollTop(){return($body().scrollTop)?$body().scrollTop:document.documentElement.scrollTop}function $sec2hms(d){var b=new Date(d*1000);var a=b.getUTCHours();var c=b.getUTCMinutes();var e=b.getUTCSeconds();if(a<10){a="0"+a}if(c<10){c="0"+c}if(e<10){e="0"+e}return a+":"+c+":"+e}function $setScrollTop(a){if($body().scrollTop){$body().scrollTop=a}else{document.documentElement.scrollTop=a}}function $sizeFormat(a){var b=["B","KB","MB","GB","TB"];a=Math.max(a,0);var c=Math.floor((a?Math.log(a):0)/Math.log(1024));c=Math.min(c,b.length-1);a/=Math.pow(1024,c);return Math.round(a)+" "+b[c]}function $tZoom(a){var b=SetEvent.target(a).id.split("_")[1],c=parseInt($(b).style.fontSize);if(!c){c=110}else{c+=10}$(b).style.fontSize=c+"%"}function $termos_c(){var a=$("overlay"),e=$("termos_c"),d=$("full"),b=document.documentElement.clientHeight,c=($body().scrollTop)?$body().scrollTop:document.documentElement.scrollTop;a.style.height=((d.clientHeight>b)?d.clientHeight:b)+"px";e.style.left=(($viewport()[0]/2)-400)+"px";e.style.top=((b/2)-275)+"px";e.style.display="inline";Ajax.exec({callback:$bind(function(f){if(f.status=="ok"){e.innerHTML=f.html;SetEvent.add($("termo_c_act"),"click",$bind(function(g){$("tlf_1").className="tlf_1 tfl_bg_2";$("tlf_2").className="tlf_2 tfl_bg_2";$("tle").className="tlr tle_bg_2";$("tld").className="tlr tld_bg_2";$("tlf_txt").innerHTML="Aguarde ...";Ajax.exec({callback:$bind(function(h){if(h.status=="ok"){a.style.height=0;e.style.display="none"}else{window.location.reload()}},this),method:"POST",send:$formReturnValuesToArray($("termo_c_form")).join("&"),url:"/termos_c"})},this))}},this),method:"GET",send:null,url:"/termos_c"})}function $valida(a,d){var b="";for(i=0;i<a.value.length;i++){var c=a.value.charAt(i);if(d.indexOf(c,0)!=-1){b+=c}}a.value=b}function $validaCEP(b){var a=/^\d{5}-\d{3}$/;return b.match(a)}function $validaFONE(b){var a=/^\d{2}\ \d{4}-\d{4}$/;return b.match(a)}function $validaCNPJ(f){f=f.replace(/\./g,"");f=f.replace("/","");f=f.replace("-","");var e=[];var d=new Number;var g=[6,5,4,3,2,9,8,7,6,5,4,3,2];for(i=0;i<12;i++){e[i]=f.charAt(i);d+=e[i]*g[i+1]}if((z=d%11)<2){e[12]=0}else{e[12]=11-z}d=0;for(w=0;w<13;w++){d+=(e[w]*g[w])}if((z=d%11)<2){e[13]=0}else{e[13]=11-z}if((f.charAt(12)!=e[12])||(f.charAt(13)!=e[13])){return false}else{return true}}function $validaCPF(b){var a,d,c,e,g,f;b=b.replace(/\./g,"");b=b.replace("-","");f=1;if(b.length<11){return false}for(e=0;e<b.length-1;e++){if(b.charAt(e)!=b.charAt(e+1)){f=0;break}}if(!f){a=b.substring(0,9);d=b.substring(9);c=0;for(e=10;e>1;e--){c+=a.charAt(10-e)*e}g=c%11<2?0:11-c%11;if(g!=d.charAt(0)){return false}a=b.substring(0,10);c=0;for(e=11;e>1;e--){c+=a.charAt(11-e)*e}g=c%11<2?0:11-c%11;if(g!=d.charAt(1)){return false}return true}else{return false}}function $validaEMAIL(a){var b=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;return(b.test(a))?true:false}function $viewport(){return[$body().clientWidth,$body().scrollHeight]}var Drag={movimento:false,status:false,posX:0,posY:0,__init:function(a){if(a){SetEvent.add($("uson_cl"),"mousedown",$bind(this.eventos,this));SetEvent.add($("uson_cl"),"mouseup",$bind(this.eventos,this));SetEvent.add($body(),"mousemove",$bind(this.acao,this))}},acao:function(a){if(this.status){if(!this.movimento){$("uson_mv").className="uson_rp uson_rp_shadow";$("uson_rp_topc").style.background="#505050";this.movimento=true}$("uson_mv").style.left=((a.clientX-175)+this.offsetX)+"px";$("uson_mv").style.top=((a.clientY-25)+this.offsetY)+"px"}},eventos:function(a){switch(a.type){case"mousedown":this.status=true;this.offsetX=a.offsetX?a.offsetX:10;this.offsetY=a.offsetY?a.offsetY:10;break;case"mouseup":this.status=false;break}}};var FormataReais={documentall:document.all,demaskvalue:function(f,m){var h="";var b="0123456789";var l=f.length;if(l==0){return 0}if(m==true){for(var g=0;g<l;g++){if((f.charAt(g)!="0")&&(f.charAt(g)!=",")){break}}for(;g<l;g++){if(b.indexOf(f.charAt(g))!=-1){h+=f.charAt(g)}}if(h.length==0){return"0.00"}if(h.length==1){return"0.0"+h}if(h.length==2){return"0."+h}var c=h.substring(0,h.length-2);var a=h.substring(h.length-2);var d=c+"."+a;return d}else{val3="";for(var e=0;e<l;e++){if(b.indexOf(f.charAt(e))!=-1){val3+=f.charAt(e)}}return val3}},reais:function(f,e){var c=(window.Event)?e.which:e.keyCode;if(c==8&&!this.documentall){if(e.preventDefault){e.preventDefault()}else{e.returnValue=false}var d=f.value;var b=d.substring(0,d.length-1);f.value=this.demaskvalue(b,true).formatCurrency();return false}var d=f.value;var a=d.length;if(a<12){this.formataReais(f,".",",",e)}},backspace:function(e,d){var b=(window.Event)?d.which:d.keyCode;if(b==8&&this.documentall){var c=e.value;var a=c.substring(0,c.length-1);var f=this.demaskvalue(a,true).formatCurrency();e.value="";e.value+=f;if(d.preventDefault){d.preventDefault()}else{d.returnValue=false}return false}},formataReais:function(g,f,b,n){var q=0;var p="";var h=j=0;var m=len2=0;var a="0123456789";var d=aux2="";var o=(window.Event)?n.which:n.keyCode;if(o==0){return true}if(o==9){return true}if(o==13){return true}if(o==16){return true}if(o==17){return true}if(o==27){return true}if(o==34){return true}if(o==35){return true}if(o==36){return true}if(n.preventDefault){n.preventDefault()}else{n.returnValue=false}var p=String.fromCharCode(o);if(a.indexOf(p)==-1){return false}g.value+=p;var m=g.value.length;var l=this.demaskvalue(g.value,true).formatCurrency();g.value=l;if(g.createTextRange){var k=g.createTextRange();k.collapse(false);k.select()}else{if(g.setSelectionRange){g.focus();var c=g.value.length;g.setSelectionRange(c,c)}}return false}};var Foto={ts:false,close:function(){$("overlay").style.height=0;$("galeria").style.display="none"},preload:function(){var a=["m","mm","g","gg"],b=[];for(x=0,lim=foto_data.length;x<lim;x++){var c=foto_basedir+"/"+foto_data[x];for(y=0,lim2=a.length;y<lim;y++){b[x+"_"+a[y]]=new Image(1,1);b[x+"_"+a[y]].src=c.replace("%s",a[y])}}},thumb:function(b){var c=SetEvent.target(b),a=c.id.split("_")[1];if(a&&a!="hold"){for(x=0,lim=foto_data.length;x<lim;x++){if(x==a){c.className="thh_img thh_on";$("prodint_f1").style.backgroundImage="url("+foto_basedir+"/"+foto_data[x].replace("%s","g")+")";$("gal_img").style.backgroundImage="url("+foto_basedir+"/"+foto_data[x].replace("%s","gg")+")"}else{$("thh_"+x).className="thh_img thh_off"}}}},zoom:function(){var f=$("galeria"),b=$("overlay"),c=document.documentElement.clientHeight,e=($body().scrollTop)?$body().scrollTop:document.documentElement.scrollTop;b.style.height=$("full").clientHeight+"px";var d=590,a=530;f.style.height=a+"px";f.style.width=d+"px";f.style.left=(($viewport()[0]/2)-(d/2))+"px";f.style.top=((c/2)-(a/2))+"px";f.style.display="inline";SetEvent.add(b,"click",Foto.close);SetEvent.add($("gal_close"),"click",Foto.close)}};var Frete={txt:'Informe seu CEP abaixo e clique em "Calcular Frete"',close:function(){$("overlay").style.height=0;$("compra_j").style.display="none"},frete:function(c){SetEvent.prevent(c);var a=$("cep").value,b=$("c_uid").value;if(!a||!$validaCEP(a)){$("cjfstat").style.background="#FFFFD7";$("cjfstat").innerHTML="O CEP informado não é válido. Informe o CEP no formato 00000-000."}else{$("cjfstat").style.background="#F0F0F0";$("cjfstat").innerHTML=this.txt;$("cjfload").style.display="inline";$("cjfsub").value="Aguarde ...";$("cjfsub").className="in_off";Ajax.exec({callback:$bind(function(d){$("cjfload").style.display="none";$("cjfsub").value="Calcular Frete";$("cjfsub").className="in_on";if(d.status=="ok"){$("cjf_p1").innerHTML=d.p1;$("cjf_p2").innerHTML=d.p2}else{$("cjf_p1").innerHTML="N/D";$("cjf_p2").innerHTML="N/D"}},this),method:"POST",send:"acao=frete&cep="+a+"&p="+this.p+"&uid="+b,url:"/compra"})}},inicia:function(l,b,f,g){this.p=b;var k=$("overlay"),a=$("compra_j"),d=$("full"),h=document.documentElement.clientHeight,e=($body().scrollTop)?$body().scrollTop:document.documentElement.scrollTop;k.style.height=((d.clientHeight>h)?d.clientHeight:h)+"px";a.style.left=(($viewport()[0]/2)-350)+"px";a.style.top=((h/2)-165)+"px";var m='<form id="pr_frete" method="post"><div class="cj_esq" style="background-image:url('+g+')"></div>';m+='<ul class="cj_dir"><li class="cjt">Calcular o frete para o produto</li><li class="cjtit">'+f+"</li>";m+='<li class="cjf" id="cjfstat">'+this.txt+"</li>";m+='<li class="cjin"><b>CEP</b> <span>(formato 00000-000):</span><input type="text" name="cep" id="cep" value="'+l+'" maxlength="9" onkeyup="javascript:$valida (this, \'1234567890-\')"></li>';m+='<li class="cjsub"><input type="submit" id="cjfsub" class="in_on" value="Calcular Frete"><div id="cjfload"><!-- --></div></li>';m+='<li class="cjfdiv"><div class="cjf_tit">Sedex:</div><div class="cjf_pre" id="cjf_p1">N/D</div></li><li class="cjfdiv cjfdiv2"><div class="cjf_tit">Encomenda Econômica (PAC):</div><div class="cjf_pre" id="cjf_p2">N/D</div></li>';m+='</ul><div id="compra_j_close"></div></form>';a.innerHTML=m;a.style.display="inline";SetEvent.add($("compra_j_close"),"click",$bind(this.close,this));SetEvent.add($("overlay"),"click",$bind(this.close,this));SetEvent.add($("pr_frete"),"submit",$bind(this.frete,this))}};var SetEvent={add:function(b,d,c){if(typeof d=="string"){if(b.addEventListener){b.addEventListener(d,c,false)}else{if(b.attachEvent){b.attachEvent("on"+d,c)}else{b["on"+d]=c}}}else{if(typeof d=="object"){var a=d.length;for(x=0;x<a;x++){this.add(b,d[x],c)}}}},get:function(a){return a?a:window.event},getCharCode:function(a){if(typeof a.charCode=="number"){return a.charCode}else{return a.keyCode}},prevent:function(a){if(a.preventDefault){a.preventDefault()}else{a.returnValue=false}},remove:function(a,c,b){if(a.removeEventListener){a.removeEventListener(c,b,false)}else{if(a.detachEvent){a.detachEvent("on"+c,b)}else{a["on"+c]=null}}},stop:function(a){if(a.stopPropagation){a.stopPropagation()}else{a.cancelBubble=true}},target:function(a){return a.target||a.srcElement}};var SetInfo={hide:function(){SetEvent.remove(window,"mousemove",function(a){SetInfo.move(a)});if($("info_box")){$body().removeChild($("info_box"))}},move:function(a){var c=$("info_box");if(a.clientX<(screen.width/2)){var b=a.clientX+20}else{var b=a.clientX-230}if(c){c.style.left=b+"px";c.style.top=(a.clientY+$scrollTop())+"px"}},show:function(a){var c=SetEvent.target(a);if(a.clientX<(screen.width/2)){var b=a.clientX+20}else{var b=a.clientX-220}var d=$create("div",{id:"info_box"},{left:b+"px",top:(a.clientY+$scrollTop())+"px",zIndex:20});d.innerHTML=c.getAttribute("name");$body().insertBefore(d,$body().firstChild);SetEvent.add(window,"mousemove",SetInfo.move)},topFix:function(b,a){if((b+a)>($viewport()[1]-10)){return($viewport()[1]-a-10)}else{return b}}};var Venda={close:function(){$("overlay").style.height=0;$("compra_j").style.display="none";$("vcs_b").className="vcs_b_on";$("vcs_b").innerHTML="Comprar o Produto"},completa:function(b){var a=SetEvent.target(b).id;$(a).style.background="#FFFFFF";$("load_"+a).style.display="inline";Ajax.exec({callback:$bind(function(c){if(c.status=="ok"){var f=$("pg_completo");f.action=c.d["action"];for(var d in c.d){if(c.d.hasOwnProperty(d)&&d!="s"&&d!="t"&&d!="action"){var e=document.createElement("input");e.type="hidden";e.name=d;e.value=c.d[d];f.appendChild(e)}}f.submit()}else{window.location.reload()}},this),method:"POST",send:"acao=completa&pg="+a.split("_")[1]+"&ID="+this.data.ID+"&desco="+this.data.desco+"&uid="+this.data.uid,url:"/compra"})},desconto:function(g){var c=SetEvent.target(g).id,d=parseFloat($("preco").value),h=parseFloat($("descopreco").value),b=parseFloat($("descomax").value),a=parseFloat($("desco").value);if(c=="vcbot_ma"){var e=a+1;if(e>b){e=b}}else{var e=a-1;if(e<0){e=0}}$("desco").value=e;$("descoshow").innerHTML=$number_format(e,2,",",".");var f=d-(h*e);$("precoshow").innerHTML=$number_format(f,2,",",".")},inicia:function(a){var b=SetEvent.target(a);b.className="vcs_b_off";b.innerHTML="Aguarde ...";if(L.usr){Ajax.exec({callback:$bind(function(g){if(g.status=="ok"){this.data=g.data;var d=$("overlay"),c=$("compra_j"),k=$("full"),f=document.documentElement.clientHeight,h=($body().scrollTop)?$body().scrollTop:document.documentElement.scrollTop;d.style.height=((k.clientHeight>f)?k.clientHeight:f)+"px";c.style.left=(($viewport()[0]/2)-350)+"px";c.style.top=((f/2)-165)+"px";var e='<form id="pg_completo" method="post"></form><div class="cj_esq" style="background-image:url('+g.data.img+')"></div>';e+='<ul class="cj_dir"><li class="cjt">Comprar o Produto</li><li class="cjtit">'+g.data.nome+"</li>";e+='<li class="cjp"><div class="cjp_d">por R$</div><div class="cjp_v">'+$number_format(g.data.preco,2,",",".")+"</div>";if(g.data.desco>0){e+='<div class="cjp_d">(B$ '+$number_format(g.data.desco,2,",",".")+" utilizados como desconto)</div>"}e+='</li><li class="cjf">Escolha abaixo uma forma de pagamento:</li>';e+='<li class="bid_pg_div_e" id="vec_mp"><div class="bid_pg_l" id="load_vec_mp"><p class="lmpt">Aguarde</p><p>Acessando o <span class="mp1">Mo</span><span class="mp2">IP</span></p></div></li>';e+='<li class="bid_pg_div_d" id="vec_ps"><div class="bid_pg_l" id="load_vec_ps"><p class="lmpt">Aguarde</p><p>Acessando o <span class="ps1">Pag</span><span class="ps2">Seguro</span></p></div></li>';e+='<li class="cjb"><ul class="bid_at"><li>Ao clicar em uma das imagens acima, você será redirecionado ao site do MoIP ou ao site do PagSeguro (dependendo de sua escolha) para realizar seu pagamento.</li><li>O envio do produto será realizado em até 3 dias úteis após a confirmação do pagamento.</li></ul></li>';e+='</ul><div id="compra_j_close"></div>';c.innerHTML=e;c.style.display="inline";SetEvent.add($("compra_j_close"),"click",$bind(this.close,this));SetEvent.add($("vec_mp"),"click",$bind(this.completa,this));SetEvent.add($("vec_ps"),"click",$bind(this.completa,this))}else{window.location.reload()}},this),method:"POST",send:$formReturnValuesToArray($("compra")).join("&"),url:"/compra"})}else{window.location=L.loginurl}}};
(function(s){var m={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};s.parseJSON=function(filter){var j;function walk(k,v){var i;if(v&&typeof v==="object"){for(i in v){if(Object.prototype.hasOwnProperty.apply(v,[i])){v[i]=walk(i,v[i])}}}return filter(k,v)}if(/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/.test(this.replace(/\\./g,"@").replace(/"[^"\\\n\r]*"/g,""))){j=eval("("+this+")");return typeof filter==="function"?walk("",j):j}throw new SyntaxError("parseJSON")};s.toJSONString=function(){if(/["\\\x00-\x1f]/.test(this)){return'"'+this.replace(/[\x00-\x1f\\"]/g,function(a){var c=m[a];if(c){return c}c=a.charCodeAt();return"\\u00"+Math.floor(c/16).toString(16)+(c%16).toString(16)})+'"'}return'"'+this+'"'}})(String.prototype);
var Ajax={erro_status:false,timeout:10000,cancel:function(){},create:function(){var d;try{d=new XMLHttpRequest()}catch(c){try{d=new ActiveXObject("Msxml2.XMLHTTP")}catch(b){try{d=new ActiveXObject("Microsoft.XMLHTTP")}catch(a){d=false}}}return d},erro_close:function(){new Tween($("ajax_erro").style,"top",Tween.regularEaseOut,0,-31,0.5,"px").start();this.erro_status=false},erro_show:function(){if(!this.erro_status){$("ajax_erro_txt").innerHTML="Não foi possível realizar a conexão com o servidor";new Tween($("ajax_erro").style,"top",Tween.regularEaseOut,-31,0,0.5,"px").start();window.erro_ajax=setTimeout($bind(this.erro_close,this),3000);this.erro_status=true}else{clearTimeout(window.erro_ajax);window.erro_ajax=setTimeout($bind(this.erro_close,this),3000)}},exec:function(b){var a=this.create();if(a){window.interval_ajax=setTimeout(function(){a.abort()},b.timeout?b.timeout:this.timeout);var c=(b.method)?b.method:"GET";a.open(c,b.url,true);a.setRequestHeader("Cache-Control","no-cache, must-revalidate");a.setRequestHeader("Pragma","no-cache");if(c.toUpperCase()=="POST"){a.setRequestHeader("Content-Type","application/x-www-form-urlencoded")}a.onreadystatechange=$bind(function(){if(a.readyState==4){clearInterval(window.interval_ajax);if(a.status==200){b.callback?b.callback(a.responseText.parseJSON()):alert(a.responseText)}else{this.erro_show()}}},this);a.send((b.send)?b.send:null);delete a}else{this.erro_show()}}};
function Delegate(){}Delegate.create=function(j,h){var d=new Array();var c=arguments.length;for(var e=2;e<c;e++){d[e-2]=arguments[e]}return function(){var a=[].concat(arguments,d);h.apply(j,a)}};Tween=function(h,i,e,d,c,f,a){this.init(h,i,e,d,c,f,a)};var t=Tween.prototype;t.obj=new Object();t.prop="";t.func=function(e,a,h,f){return h*e/f+a};t.begin=0;t.change=0;t.prevTime=0;t.prevPos=0;t.looping=false;t._duration=0;t._time=0;t._pos=0;t._position=0;t._startTime=0;t._finish=0;t.name="";t.suffixe="";t._listeners=new Array();t.setTime=function(a){this.prevTime=this._time;if(a>this.getDuration()){if(this.looping){this.rewind(a-this._duration);this.update();this.broadcastMessage("onMotionLooped",{target:this,type:"onMotionLooped"})}else{this._time=this._duration;this.update();this.stop();this.broadcastMessage("onMotionFinished",{target:this,type:"onMotionFinished"})}}else{if(a<0){this.rewind();this.update()}else{this._time=a;this.update()}}};t.getTime=function(){return this._time};t.setDuration=function(a){this._duration=(a==null||a<=0)?100000:a};t.getDuration=function(){return this._duration};t.setPosition=function(d){this.prevPos=this._pos;var c=this.suffixe!=""?this.suffixe:"";this.obj[this.prop]=Math.round(d)+c;this._pos=d;this.broadcastMessage("onMotionChanged",{target:this,type:"onMotionChanged"})};t.getPosition=function(a){if(a==undefined){a=this._time}return this.func(a,this.begin,this.change,this._duration)};t.setFinish=function(a){this.change=a-this.begin};t.geFinish=function(){return this.begin+this.change};t.init=function(h,i,e,d,c,f,a){if(!arguments.length){return}this._listeners=new Array();this.addListener(this);if(a){this.suffixe=a}this.obj=h;this.prop=i;this.begin=d;this._pos=d;this.setDuration(f);if(e!=null&&e!=""){this.func=e}this.setFinish(c)};t.start=function(){this.rewind();this.startEnterFrame();this.broadcastMessage("onMotionStarted",{target:this,type:"onMotionStarted"})};t.rewind=function(a){this.stop();this._time=(a==undefined)?0:a;this.fixTime();this.update()};t.fforward=function(){this._time=this._duration;this.fixTime();this.update()};t.update=function(){this.setPosition(this.getPosition(this._time))};t.startEnterFrame=function(){this.stopEnterFrame();this.isPlaying=true;this.onEnterFrame()};t.onEnterFrame=function(){if(this.isPlaying){this.nextFrame();setTimeout(Delegate.create(this,this.onEnterFrame),0)}};t.nextFrame=function(){this.setTime((this.getTimer()-this._startTime)/1000)};t.stop=function(){this.stopEnterFrame();this.broadcastMessage("onMotionStopped",{target:this,type:"onMotionStopped"})};t.stopEnterFrame=function(){this.isPlaying=false};t.continueTo=function(a,c){this.begin=this._pos;this.setFinish(a);if(this._duration!=undefined){this.setDuration(c)}this.start()};t.resume=function(){this.fixTime();this.startEnterFrame();this.broadcastMessage("onMotionResumed",{target:this,type:"onMotionResumed"})};t.yoyo=function(){this.continueTo(this.begin,this._time)};t.addListener=function(a){this.removeListener(a);return this._listeners.push(a)};t.removeListener=function(e){var c=this._listeners;var d=c.length;while(d--){if(c[d]==e){c.splice(d,1);return true}}return false};t.broadcastMessage=function(){var c=new Array();for(var h=0;h<arguments.length;h++){c.push(arguments[h])}var j=c.shift();var f=this._listeners;var d=f.length;for(var h=0;h<d;h++){if(f[h][j]){f[h][j].apply(f[h],c)}}};t.fixTime=function(){this._startTime=this.getTimer()-this._time*1000};t.getTimer=function(){return new Date().getTime()-this._time};Tween.backEaseIn=function(h,e,l,k,f,j){if(i==undefined){var i=1.70158}return l*(h/=k)*h*((i+1)*h-i)+e};Tween.backEaseOut=function(h,e,l,k,f,j){if(i==undefined){var i=1.70158}return l*((h=h/k-1)*h*((i+1)*h+i)+1)+e};Tween.backEaseInOut=function(h,e,l,k,f,j){if(i==undefined){var i=1.70158}if((h/=k/2)<1){return l/2*(h*h*(((i*=(1.525))+1)*h-i))+e}return l/2*((h-=2)*h*(((i*=(1.525))+1)*h+i)+2)+e};Tween.elasticEaseIn=function(h,e,l,k,f,j){if(h==0){return e}if((h/=k)==1){return e+l}if(!j){j=k*0.3}if(!f||f<Math.abs(l)){f=l;var i=j/4}else{var i=j/(2*Math.PI)*Math.asin(l/f)}return -(f*Math.pow(2,10*(h-=1))*Math.sin((h*k-i)*(2*Math.PI)/j))+e};Tween.elasticEaseOut=function(h,e,l,k,f,j){if(h==0){return e}if((h/=k)==1){return e+l}if(!j){j=k*0.3}if(!f||f<Math.abs(l)){f=l;var i=j/4}else{var i=j/(2*Math.PI)*Math.asin(l/f)}return(f*Math.pow(2,-10*h)*Math.sin((h*k-i)*(2*Math.PI)/j)+l+e)};Tween.elasticEaseInOut=function(h,e,l,k,f,j){if(h==0){return e}if((h/=k/2)==2){return e+l}if(!j){var j=k*(0.3*1.5)}if(!f||f<Math.abs(l)){var f=l;var i=j/4}else{var i=j/(2*Math.PI)*Math.asin(l/f)}if(h<1){return -0.5*(f*Math.pow(2,10*(h-=1))*Math.sin((h*k-i)*(2*Math.PI)/j))+e}return f*Math.pow(2,-10*(h-=1))*Math.sin((h*k-i)*(2*Math.PI)/j)*0.5+l+e};Tween.bounceEaseOut=function(e,a,h,f){if((e/=f)<(1/2.75)){return h*(7.5625*e*e)+a}else{if(e<(2/2.75)){return h*(7.5625*(e-=(1.5/2.75))*e+0.75)+a}else{if(e<(2.5/2.75)){return h*(7.5625*(e-=(2.25/2.75))*e+0.9375)+a}else{return h*(7.5625*(e-=(2.625/2.75))*e+0.984375)+a}}}};Tween.bounceEaseIn=function(e,a,h,f){return h-Tween.bounceEaseOut(f-e,0,h,f)+a};Tween.bounceEaseInOut=function(e,a,h,f){if(e<f/2){return Tween.bounceEaseIn(e*2,0,h,f)*0.5+a}else{return Tween.bounceEaseOut(e*2-f,0,h,f)*0.5+h*0.5+a}};Tween.strongEaseInOut=function(e,a,h,f){return h*(e/=f)*e*e*e*e+a};Tween.regularEaseIn=function(e,a,h,f){return h*(e/=f)*e+a};Tween.regularEaseOut=function(e,a,h,f){return -h*(e/=f)*(e-2)+a};Tween.regularEaseInOut=function(e,a,h,f){if((e/=f/2)<1){return h/2*e*e+a}return -h/2*((--e)*(e-2)-1)+a};Tween.strongEaseIn=function(e,a,h,f){return h*(e/=f)*e*e*e*e+a};Tween.strongEaseOut=function(e,a,h,f){return h*((e=e/f-1)*e*e*e*e+1)+a};Tween.strongEaseInOut=function(e,a,h,f){if((e/=f/2)<1){return h/2*e*e*e*e*e+a}return h/2*((e-=2)*e*e*e*e+2)+a};ColorTween.prototype=new Tween();ColorTween.prototype.constructor=Tween;ColorTween.superclass=Tween.prototype;function ColorTween(f,h,c,a,d,e){this.targetObject=f;this.targetProperty=h;this.fromColor=a;this.toColor=d;this.init(new Object(),"x",c,0,100,e);this.listenerObj=new Object();this.listenerObj.onMotionChanged=Delegate.create(this,this.onColorChanged);this.addListener(this.listenerObj)}var o=ColorTween.prototype;o.targetObject={};o.targetProperty={};o.fromColor="";o.toColor="";o.currentColor="";o.listenerObj={};o.onColorChanged=function(){this.currentColor=this.getColor(this.fromColor,this.toColor,this._pos);this.targetObject[this.targetProperty]=this.currentColor};o.getColor=function(c,f,h){var e=this.hex2dec(c.slice(0,2));var a=this.hex2dec(c.slice(2,4));var k=this.hex2dec(c.slice(4,6));var d=this.hex2dec(f.slice(0,2));var l=this.hex2dec(f.slice(2,4));var j=this.hex2dec(f.slice(4,6));var i=h/100;r=Math.floor(e+(i*(d-e))+0.5);g=Math.floor(a+(i*(l-a))+0.5);b=Math.floor(k+(i*(j-k))+0.5);return("#"+this.dec2hex(r)+this.dec2hex(g)+this.dec2hex(b))};o.dec2hex=function(a){return(this.hexDigit[a>>4]+this.hexDigit[a&15])};o.hexDigit=new Array("0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F");o.hex2dec=function(a){return(parseInt(a,16))};OpacityTween.prototype=new Tween();OpacityTween.prototype.constructor=Tween;OpacityTween.superclass=Tween.prototype;function OpacityTween(f,c,e,a,d){this.targetObject=f;this.init(new Object(),"x",c,e,a,d)}var o=OpacityTween.prototype;o.targetObject={};o.onMotionChanged=function(a){var c=a.target._pos;var d=this.targetObject;d.style.opacity=c/100;d.style["-moz-opacity"]=c/100;d.style.filter="progid:DXImageTransform.Microsoft.Alpha(opacity="+c+");"};
var L={erro_status:false,i:"ab",l:[],la:0,lan:[],lk:[],lance_at:0,lance_id:0,re_time:[],uid:"",__construct:function(a){this.l=a;this.lk=$objectKeys(this.l);if(this.lk.length){this.send();this.eventos();this.intervalo()}else{this.refreshPage()}this.eventos_insc()},arrematado:function(a,d,b,g){var h=$("l_"+a+"_arrematado"),c=$("l_"+a+"_tempo"),f=$("l_"+a+"_usuario"),e=$("l_"+a+"_valor");$("l_"+a+"_lance").style.display="none";h.innerHTML=(d=="f")?"Arrematado !":"Expirado";h.style.display="inline";f.innerHTML=b;e.innerHTML="R$ "+$number_format(g,2,",",".");c.innerHTML="00:00:00";c.style.color="#999999"},arrematante:function(l,b){var k=600,e=300,g=this.loginurl,a=$("leilao_j"),j=$("overlay"),f=document.documentElement.clientHeight,c=($body().scrollTop)?$body().scrollTop:document.documentElement.scrollTop;var d='<div class="thumb" style="background-image:url('+this.lni[this.ll[l]][1]+')"></div><p class="la_tit">Parabéns !!!</p><p class="la_desc">Você acaba de arrematar o produto <b>'+this.lni[this.ll[l]][0]+"</b> por:</p>";d+='<p class="la_valor">R$ '+$number_format(b,2,",",".")+'</p><p class="la_desc">O produto será despachado assim que o pagamento for confirmado. Para realizar o pagamento, clique no link abaixo:</p>';d+='<p class="la_botao"><input type="button" id="leilao_j_click" value="Realizar o Pagamento" /></p><p class="la_fim">O pagamento pode ser realizado também na seção "Itens Arrematados" do seu Painel de Controle.</p><div id="leilao_j_close"></div>';j.style.height=(($("full").clientHeight>f)?$("full").clientHeight:f)+"px";a.style.width=k+"px";a.style.height=e+"px";a.style.left=(($viewport()[0]/2)-(k/2))+"px";a.style.top=((f/2)-(e/2))+"px";a.style.display="inline";a.innerHTML=d;SetEvent.add(j,"click",function(){$("overlay").style.height=0;$("leilao_j").style.display="none"});SetEvent.add($("leilao_j_close"),"click",function(){$("overlay").style.height=0;$("leilao_j").style.display="none"});SetEvent.add($("leilao_j_click"),"click",$bind(function(){window.location=this.loginurl+"/arrematados/"},this))},bidSet:function(c,a){if(this.l[c]["tp"]=="b"){var f=$("bids");var g=$("bids_b");var d=new OpacityTween(f,Tween.regularEaseOut,100,0,0.1);var e=new OpacityTween(g,Tween.regularEaseOut,100,0,0.1);d.onMotionFinished=function(){f.innerHTML=a;g.innerHTML=a;new OpacityTween(f,Tween.regularEaseOut,0,100,0.1).start();new OpacityTween(g,Tween.regularEaseOut,0,100,0.1).start()};d.start()}else{$("bids_v").innerHTML=a}},dataChange:function(b,g,f){var d={usuario:"666666",preco:"505050",tempo:"#999999"};switch(g){case"usuario":var h=$("l_"+b+"_usuario");if(!f){f="nenhum lance"}if(h.innerHTML!=f){h.innerHTML=f;var a=new ColorTween(h.style,"color",Tween.regularEaseOut,"666666","FFFF00",0.2);a.onMotionFinished=function(){new ColorTween(h.style,"color",Tween.regularEaseOut,"FFFF00","666666",0.2).start()};a.start()}break;case"preco":var h=$("l_"+b+"_valor");h.innerHTML="R$ "+$number_format(f,2,",",".");var a=new ColorTween(h.style,"color",Tween.regularEaseOut,"505050","FFFFFF",0.2);new ColorTween(h.style,"backgroundColor",Tween.regularEaseOut,"FAFAFA","D41C3B",0.2).start();a.onMotionFinished=function(){var j=new ColorTween(h.style,"color",Tween.regularEaseOut,"FFFFFF","505050",1);new ColorTween(h.style,"backgroundColor",Tween.regularEaseOut,"D41C3B","FAFAFA",1).start();j.start()};a.start();if(this.la){var e=this.lp-f,c=$round((e/this.lp)*100,2);$("phll_p").innerHTML="R$ "+$number_format(f,2,",",".");$("phll_e").innerHTML="R$ "+$number_format(e,2,",",".")+" ("+c+"%)"}break;case"tempo":var h=$("l_"+b+"_tempo");h.innerHTML=$sec2hms(f);h.style.color=(f<=10)?"#D41C3B":"#999999";break}},erro_close:function(){new Tween($("ajax_erro").style,"top",Tween.regularEaseOut,0,-31,0.5,"px").start();this.erro_status=false},erro_show:function(a){$("ajax_erro_txt").innerHTML=a;if(!this.erro_status){new Tween($("ajax_erro").style,"top",Tween.regularEaseOut,-31,0,0.5,"px").start();window.erro_ajax=setTimeout($bind(this.erro_close,this),3000);this.erro_status=true}else{clearTimeout(window.erro_ajax);window.erro_ajax=setTimeout($bind(this.erro_close,this),3000)}},eventos:function(){for(x=0;x<this.lk.length;x++){SetEvent.add($("l_"+this.lk[x]+"_lance"),"click",$bind(this.lance,this))}},eventos_insc:function(){var a=$objectKeys(this.lni);var b=a.length;for(x=0;x<b;x++){var c=$("l_"+a[x]+"_ins");if(c){SetEvent.add(c,"submit",$bind(this.inscreve,this))}}},inscreve:function(b){SetEvent.prevent(b);var g=SetEvent.target(b),k=g.id.split("_")[1],m=false,l=400,e=90,a=$("leilao_j"),j=$("overlay"),f=document.documentElement.clientHeight,c=($body().scrollTop)?$body().scrollTop:document.documentElement.scrollTop;j.style.height=(($("full").clientHeight>f)?$("full").clientHeight:f)+"px";a.style.width=l+"px";a.style.height=e+"px";a.style.left=(($viewport()[0]/2)-(l/2))+"px";a.style.top=((f/2)-(e/2))+"px";if(!g.email.value||!$validaEMAIL(g.email.value)){m=true;var d='<div class="ico ico_erro" id="lji_ico"></div><p class="li_tit">Erro</p><p class="li_desc">Informe um e-mail válido.</p>'}else{var d='<div class="ico ico_load" id="lji_ico"></div><p class="li_tit" id="lji_tit">Aguarde</p><p class="li_desc" id="lji_desc">Enviando seu e-mail ...</p>'}d+='<div id="leilao_j_close"></div>';a.style.display="inline";a.innerHTML=d;SetEvent.add(j,"click",function(){$("overlay").style.height=0;$("leilao_j").style.display="none"});SetEvent.add($("leilao_j_close"),"click",function(){$("overlay").style.height=0;$("leilao_j").style.display="none"});if(!m){Ajax.exec({callback:function(h){if(h.s==0){$("lji_ico").className="ico ico_erro";$("lji_tit").innerHTML="Erro"}else{$("lji_ico").className="ico ico_ok";$("lji_tit").innerHTML="Sucesso"}$("lji_desc").innerHTML=h.m},method:"POST",send:"uid="+this.uid+"&prod_id="+k+"&email="+g.email.value,url:"/inscricao"})}},intervalo:function(){var a=this.lk.length;for(x=0;x<a;x++){if(this.l[this.lk[x]].t=="cr"){this.i="cr"}}window.interval=setInterval($bind(this.send,this),this.i=="ab"?5000:1000)},lance:function(a){var c=SetEvent.target(a),b=c.id.split("_");if(this.lance_at!=b[1]){c.className="prod_l_lance_input lance_off";c.innerHTML="Aguarde ...";this.lance_id=b[1];this.send()}},lanceHist:function(c){if(c.m!=this.lan.m){var b=c.d.length,a="";for(x=0;x<b;x++){a+='<div class="plhh_hist"><div class="plhh_uf">'+c.d[x][2]+'</div><p class="plhh_u">'+c.d[x][1]+'</p><p class="plhh_v">R$ '+c.d[x][0]+"</p></div>"}$("plhh_hold").innerHTML=a;this.lan=c}},processa:function(d){if(d.s==0&&d.m){this.erro_show(d.m)}else{if(d.s==1){var e={};var j=this.lk.length;for(x=0;x<j;x++){if(this.l[this.lk[x]]&&d.l[this.lk[x]]){var l=this.lk[x];var h=this.l[l];var k=d.l[l];if(k.s=="f"||k.s=="e"){this.arrematado(l,k.s,k.u,k.p)}else{e[l]=k;if(h.u!=k.u||h.p!=k.p){this.dataChange(l,"usuario",k.u);this.dataChange(l,"preco",k.p)}if(k.t=="cr"){if(h.t=="ab"&&(!this.la||this.la!=l)){var g=$("l_"+l+"_ab");var f=new OpacityTween(g,Tween.regularEaseOut,100,0,0.5);f.onMotionFinished=function(){g.style.display="none"};f.start()}this.dataChange(l,"tempo",k.v-d.t)}}}}var b=$objectKeys(e);if(b.length){this.l=e;this.lk=b;var j=this.lk.length;var c="ab";for(x=0;x<j;x++){if(this.l[this.lk[x]].t=="cr"){c="cr"}}if(this.i=="ab"&&c=="cr"){clearInterval(window.interval);window.interval=setInterval($bind(this.send,this),1000);this.i="cr"}else{if(this.i=="cr"&&c=="ab"){clearInterval(window.interval);window.interval=setInterval($bind(this.send,this),5000);this.i="ab"}}}else{clearInterval(window.interval);this.refreshPage()}if(d.uid){this.uid=d.uid}if(d.r&&d.b){this.bidSet(d.r,d.b)}if(this.la&&d.la){this.lanceHist(d.la)}}else{if(d.s==2){window.location=this.loginurl}}}if(d.r){this.lance_at=0;var a=$("l_"+d.r+"_lance");a.className="prod_l_lance_input lance_on";a.innerHTML="Dê seu lance"}},refreshPage:function(){},send:function(){var b=+new Date().getTime(),a="/data/uid="+this.uid+"/l="+$objectKeys(this.l)+"/la="+this.la;if(this.lance_id){a+="/lance="+this.lance_id;this.lance_at=this.lance_id;this.lance_id=0}Ajax.exec({callback:$bind(function(d){var e=this.re_time.length;this.re_time[e]=new Date().getTime()-b;e++;if(e>5){this.re_time.shift();e=5}sum=0;for(i=0;i<e;i++){sum=sum+this.re_time[i]}var c=Math.floor(sum/e);if(c<500){$("cstatus_ico").style.backgroundColor="#55BE47";$("cstatus_desc").innerHTML="Excelente ("+c+"ms)"}else{if(c>500&&c<1000){$("cstatus_ico").style.backgroundColor="#FFFF00";$("cstatus_desc").innerHTML="Razoável ("+c+"ms)"}else{if(c>1000){$("cstatus_ico").style.backgroundColor="#FF0000";$("cstatus_desc").innerHTML="Precária ("+c+"ms)"}}}this.processa(d)},this),method:"GET",url:a})}};
