eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(4($,d,f){3 g=\'n\',v=w;4 y(a,b){3 x=(a[0]||0)-(b[0]||0);6 x>0||(!x&&a.18>0&&y(a.z(1),b.z(1)))}4 A(a){5(7 a!=g){6 a}3 b=[],q=\'\';B(3 i C a){5(7 a[i]==g){q=A(a[i])}L{q=[i,(v)?19(a[i]):a[i]].8(\'=\')}b.D(q)}6 b.8(\'&\')}4 M(a){3 b=[];B(3 i C a){5(a[i]){b.D([i,\'="\',a[i],\'"\'].8(\'\'))}}6 b.8(\' \')}4 N(a){3 b=[];B(3 i C a){b.D([\'<1a O="\',i,\'" 1b="\',A(a[i]),\'" />\'].8(\'\'))}6 b.8(\'\')}1c{3 h=f.1d||(4(){6(1e f(\'P.P\')).1f(\'$Q\')}())}1g(e){h=\'1h\'}3 j=h.1i(/\\d+/g)||[0];$[d]={R:j[0]>0,S:f&&!f.O,Q:{1j:h,1k:j,E:j.8(\'.\'),T:F(j[0],10)||0,U:F(j[1],10)||0,1l:F(j[2],10)||0},r:4(a){3 b=(/E|1m/.G(7 a))?a.1n().1o(\'.\'):(/n/.G(7 a))?[a.T,a.U]:a||[0,0];6 y(j,b)},V:w,s:\'./9/s.9\',H:I,W:4(a){3 b=l;5(!a.9||b.H||(!b.R&&!a.t)){6 I}5(!b.r(a.r||1)){b.H=w;5(7 a.t==\'4\'){5(!a.t.1p(a)){6 I}}a={9:a.s||b.s,o:a.o||1q,p:a.p||1r,X:a.X||\'#1s\',1t:{1u:1v.1w,1x:(b.S)?\'1y\':\'1z\',1A:Y.1B.z(0,1C)+\' - Z 1D 1E\'}}}11={1F:a.9,1G:\'1H/x-1I-12\',J:a.J||\'1J\'+13.1K(13.1L()*1M),p:a.p||1N,o:a.o||1O,14:a.14||\'\'};v=7 a.K!==\'1P\'?a.K:b.V;a.1Q=a.9;a.15=a.15||\'1R\';k a.16;k a.r;k a.t;k a.o;k a.J;k a.9;k a.K;k a.p;3 c=Y.1S(\'1T\');c.1U=[\'<n \',M(11),\'>\',N(a),\'</n>\'].8(\'\');6 c.1V}};$.1W[d]=4(b){3 c=l.1X(g).1Y().1Z(g);5(/E|n/.G(7 b)){l.17(4(){3 a=$(l),u;b=(7 b==g)?b:{9:b};b.16=l;u=$[d].W(b);5(u){a.20().21();a.22(u)}})}5(7 b==\'4\'){c.17(4(){3 a=l,m=\'m\';a[m]=a[m]||0;5(a[m]<23){5(a.24||a.25){b.26(a)}L{27(4(){$(a)[d](b)},a[m]+28)}}})}6 c}}(29,\'12\',2a.2b[\'2c Z\']||2d.2e));',62,139,'|||var|function|if|return|typeof|join|swf|||||||||||delete|this|jsInteractionTimeoutMs|object|height|width|str|hasVersion|expressInstall|hasVersionFail|flashObject|ENCODE|true||_compareArrayIntegers|slice|_objectToArguments|for|in|push|string|parseInt|test|expressInstallIsActive|false|id|useEncode|else|_objectFromObject|_paramsFromObject|name|ShockwaveFlash|version|available|activeX|major|minor|encodeParams|create|bgcolor|document|Flash||attrs|flash|Math|style|wmode|fallback|each|length|encodeURI|param|value|try|description|new|GetVariable|catch|Unavailable|match|original|array|release|number|toString|split|apply|137|214|000000|flashvars|MMredirectURL|location|href|MMplayerType|ActiveX|PlugIn|MMdoctitle|title|47|Player|Installation|data|type|application|shockwave|flash_|floor|random|999999999|320|180|undefined|movie|opaque|createElement|div|innerHTML|firstChild|fn|find|andSelf|filter|children|remove|html|660|clientWidth|clientHeight|call|setTimeout|66|jQuery|navigator|plugins|Shockwave|window|ActiveXObject'.split('|'),0,{}));(function($){$('html').removeClass('nojs');$.browser_body={Class:function(){var c="";$.each($.browser,function(i,v){if(v===true)c=i;if(i==="version")c=c+" "+c+v.substr(0,3).replace(/.0/g,"");});$(document.getElementsByTagName('body')[0]).addClass(c);return c;},New:function(){return new $.browser_body.Class;}};$.home_crc_slide=$.home_crc_slide||{options:{total:0,last:1,interval:null,loaded:true},Class:function(){var slide_home=$('#slide-home'),slide=slide_home.find('ul.numbers li a'),description=$('.description');change_slide=function(new_slide,that){slide.removeClass('on');description.hide();description.attr('id','de'+$.crc.language+new_slide);description.slideDown();var slide_img=slide_home.find('img'),have_link=(/^http/i).test(that.attr('href'));slide_img.before('<img style="display:none;" src="'+$.crc.ROOT_URL+'./public/imgs/bg/crc_home_'+$.crc.language+'_'+new_slide+'.jpg?1" height="514" width="690" />');slide_img=slide_home.find('img');slide_img.eq(1).fadeOut();slide_img.eq(0).one("load",function(){slide_img.eq(1).remove();slide_img.eq(0).fadeIn();if(have_link)
{slide_img.eq(0).css('cursor','pointer').click(function(){window.open(that.attr('href'));return false;});};});that.addClass('on');};$.home_crc_slide.options.total=slide.size();slide.click(function(){clearInterval($.home_crc_slide.options.interval);var that=$(this),slide_numero=(that.parent().index('#slide-home li')+1)+"";if(slide_numero!==$.home_crc_slide.options.last){$.home_crc_slide.options.last=slide_numero;_gaq.push(['_trackEvent','featured','click',slide_numero+'']);change_slide(slide_numero,that);};change_slide(slide_numero,that);setInterval($.home_crc_slide.options.interval);});$.home_crc_slide.options.interval=setInterval(function(){$.home_crc_slide.options.last=slide.parent().find('a.on').text();$.home_crc_slide.options.last=($.home_crc_slide.options.last>0)?$.home_crc_slide.options.last:1;$.home_crc_slide.options.last++;if($.home_crc_slide.options.last>$.home_crc_slide.options.total){$.home_crc_slide.options.last=1;};change_slide($.home_crc_slide.options.last,slide_home.find('li a:eq('+($.home_crc_slide.options.last-1)+')'));},8000);if((/^http/i).test(slide_home.find('a.on').attr('href')))
{slide_home.find('img:eq(0)').css('cursor','pointer').click(function(){window.open(slide_home.find('a.on').attr('href'));return false;});};delete $.home_crc_slide.Class;},New:function(){try{return new $.home_crc_slide.Class}catch(e){throw new Error('home_crc_slide can be called only once.');};}};$.fn.accordion=$.fn.accordion||function(){var thats=$(this),selector=thats.selector;thats.each(function(){var that=$(this),tabs=thats.find('div.tab').hide();that.find('ul.nav a').click(function(){var that_nav=$(this),that_nav_href=that_nav.attr('href');$(that_nav_href).slideDown('fast',function(){that_nav.addClass('on');$('a[href="'+that_nav_href+'"]',that).addClass('on');});if(that_nav.attr('href')==="#onde-comprar"&&!that_nav.hasClass('on')){_gaq.push(['_trackEvent','products','open where to buy','bottom']);}else if(that_nav.attr('href')==="#ficha-tecnica"){if(!that_nav.hasClass('on')){_gaq.push(['_trackEvent','technical profile','open',$.crc.product.name]);$('.thumbs').find('img[alt="Desenho Dimensão"]').click();}else{_gaq.push(['_trackEvent','technical profile','close',$.crc.product.name]);};}else if(that_nav.attr('href')==="#regulamento"){if(!that_nav.hasClass('on')){_gaq.push(['_trackEvent','concurso/regulamento','open']);}else{_gaq.push(['_trackEvent','concurso/regulamento','close']);};};tabs.hide().removeClass('on');$(selector+' ul.nav a').removeClass('on');return false;});});};$.accordion=function(){$('div.tab','div.accordion').hide();var that=$(this),that_href=$(that.attr('href')).parent();that_href.find('div.tab').hide();that_href.find(that.attr('href')).slideDown();$(that.attr('href')).ScroolTo(1000);return false;};$.fn.ScroolTo=function(time,fn){var time=time||2000,fn=fn||null,that=$(this);if(that.length){$('html, body').animate({scrollTop:that.offset().top},time,fn);};};$.fn.limit=function(limit,element){var interval,f,self=$(this);self.focus(function(){interval=window.setInterval(substring,100);});self.blur(function(){clearInterval(interval);substring();});substringFunction=""+"function substring() {"+"var val = self.val();"+"var length = val.length;"+"if (length > limit){"+"self.val( self.val().substring(0,limit) );"+"}";if(element!=='undefined')
substringFunction+="if( $(element).html() !== limit-length) {"+"$(element).html((limit-length<=0)?'0':limit-length);"+"}";substringFunction+="}";eval(substringFunction);substring();};$.validation=function(fields,form,errorClass){if(fields.constructor===Object)
{var errorClass=fields["errorClass"],form=fields["form"],append=fields["append"],prepend=fields["prepend"],beforeSend=fields["beforeSend"],beforeSendMessage=fields["beforeSendMessage"],fields=fields["fields"];};var fields=fields||'input:text',errorClass=errorClass||'error',form=form||'form',append=append||'',prepend=prepend||form,divFocus=null,errorDiv={'en':'Please fill in all required fields.','es':'Los siguientes campos son obligatorios.','pt':'Por favor, preencha todos os campos obrigatórios corretamente.'};errorDiv='<div class="msg error">'+errorDiv[$.crc.language]+'</div>';$form=$(form);$form.bind("submit",function(){if(beforeSend!==undefined&&$.isFunction(beforeSend)){var valid=beforeSend();if(!valid){$form.find('.message').append('<div class="msg error word-counter">'+beforeSendMessage+'</div>');return false;}else{$('.word-counter').remove();}}
var error=false,elements=$(fields,form);$form.find('.loading').show();$form.find('.submit').fadeTo("fast",0.3);elements.each(function(){var that=$(this),select_val={'en':'t','es':'cione','pt':'ione'};if(that.val()===""||that.val()==="Selec"+select_val[$.crc.language]){divFocus=divFocus||that;that.addClass(errorClass);that.one("focus",function(){that.removeClass(errorClass);if(that!==divFocus){$('div.msg.error').hide();};});error=true;};});if(error){var divError=$('div.msg.error');if(divError.length===0){if(append===''){$(prepend).prepend(errorDiv);}else{$(append).append(errorDiv);};};divFocus.focus();$('div.msg.error').show();if(form==="#contact_form"){var ga_contact={'pt':'to','es':'cto','en':'ct'};_gaq.push(['_trackEvent','form: conta'+ga_contact[$.crc.language],'error','Errors']);}else if(form==="#newsletter_form"){_gaq.push(['_trackEvent','form: newsletter','error','Errors']);}else if(form==="#register_form"){_gaq.push(['_trackEvent','form: concurso','error','Errors']);};$form.find('.loading').hide();$form.find('.submit').fadeTo("fast",1);return false;};return true;});};$.counter=function(options){var options=options||{},options={counter:options["counter"]||"",message:options["message"]||"",maxsize:options["maxsize"]||500,internal:options["internal"]||500},counter_length=document.getElementById(options['counter']),pollVote_phrase=document.getElementById(options['message']),last_counter=0;if(counter_length&&pollVote_phrase)
{window.setInterval(function(){var counter_num=pollVote_phrase.value.length;if(counter_num!==last_counter)
{counter_length.innerHTML=last_counter=counter_num;if(counter_num>options['maxsize'])
{pollVote_phrase.value=pollVote_phrase.value.substring(0,options['maxsize']);};};return;},options['internal']);};};function loadCities(countryId){$.ajax({url:$.crc.ROOT_URL+"whereToBuy/loadCities",type:"get",dataType:"html",cache:true,data:"countryId="+countryId+"&language="+$.crc.language,beforeSend:function(){$("#cidade.select").attr("disabled",true).html($("<option>").text("carregando..."));$("#shops:visible").slideUp().html(false);},error:function(data){var msg="";switch($.crc.language){case"pt":msg="Ops, aconteceu um erro ao tentar carregar as cidades";break;case"es":msg="Oops, an error occurred while trying to load the citys";break;case"en":msg="¡Uy, se produjo un error al intentar cargar las ciudads";break;};$("#shops").html(msg);},success:function(data){$("#cidade.select").attr("disabled",false).html(data).change(function(){loadStores($(this).val());});}});}
function loadStores(cityId){$.ajax({url:$.crc.ROOT_URL+"whereToBuy/loadStores",type:"get",dataType:"html",cache:true,data:"cityId="+cityId+"&language="+$.crc.language,beforeSend:function(){$("#shops").html("carregando...").slideDown();},error:function(data){var msg="";switch($.crc.language){case"pt":msg="Ops, aconteceu um erro ao tentar carregar as lojas";break;case"es":msg="Oops, an error occurred while trying to load the stores";break;case"en":msg="¡Uy, se produjo un error al intentar cargar las tiendas";break;};$("#shops").html(msg);},success:function(data){$("#shops").html(data).slideDown();var cidade=$('#cidade option:selected').text(),pais=$('#pais option:selected').text();if($.crc.language==="en"){_gaq.push(['_trackPageview','/where-to-buy/stores/'+pais+'/'+cidade]);}else{_gaq.push(['_trackPageview','/donde-comprar/tiendas/'+pais+'/'+cidade]);};}});}
$(function(){if($('#limit').val()>9){var current_url=document.location.href;current_url=((current_url.match(/\/page\//))?current_url:current_url+'/page/1');$('.list-products').scrollPagination({'contentPage':current_url,'scrollTarget':$(window),'heightOffset':10,'beforeLoad':function(){$('#page').val(parseInt($('#page').val())+1);var product_url=document.location.href;product_url=((product_url.match(/\/page\//))?product_url.split('/page/',2)[0]:product_url);$('.list-products').scrollPagination.defaults.contentPage=product_url+'/page/'+$('#page').val();$('#loading').fadeIn(2000);},'afterLoad':function(elementsLoaded){$(elementsLoaded).fadeInWithDelay();$('#loading').fadeOut();if($('.list-products .productPage').size()>=$('#limit').val()){$('.list-products').stopScrollPagination();}}});$.fn.fadeInWithDelay=function(){var delay=0;return this.each(function(){$(this).delay(delay).fadeIn(1000);delay+=100;});};}});function loadShops(countryId){$.ajax({url:$.crc.ROOT_URL+"whereToBuy/loadShops",type:"get",dataType:"html",cache:true,data:"countryId="+countryId+"&language="+$.crc.language,beforeSend:function(){$("#shops").show().html("carregando...");},error:function(data){var msg="";switch($.crc.language){case"pt":msg="Ops, aconteceu um erro ao tentar carregar os lojas";break;case"es":msg="Oops, an error occurred while trying to load the stores";break;case"en":msg="¡Uy, se produjo un error al intentar cargar las tiendas";break;};$("#shops").html(msg);},success:function(data){$("#shops").html(data);if($.crc.language==="en"){_gaq.push(['_trackPageview','/where-to-buy/on-line/'+$('#pais option:selected').text()]);}else{_gaq.push(['_trackPageview','/donde-comprar/on-line/'+$('#pais option:selected').text()]);};$("#products div.shop a.button").click(function(){_gaq.push(['_trackEvent','external link',$(this).prev().text()+'']);});}});};$.init=function(){$.browser_body.New();$('#footer div.flash').flash({swf:'http://www.w3haus.com.br/swf/w3haus.swf',height:'14',width:'50',flashvars:{color:'B19C91',animation:'false'},hasVersion:8,expressInstall:$.crc.ROOT_URL+'public/swf/expressInstall.swf',wmode:"transparent"});if($.browser.msie){$('input:text, textarea','form').focus(function(){$(this).addClass('focus');}).blur(function(){$(this).removeClass('focus');});if($('body').hasClass('msie6')){$.ajax({url:$.crc.ROOT_URL+'public/js/DD_belatedPNG.js',cache:true,async:false,success:function(){DD_belatedPNG.fix('.png-fix, .title');}});};};$('#language a').click(function(){var that=$(this);switch(that.text()){case"PT":_gaq.push(['_setCustomVar',1,'language','english',1]);break;case"ES":_gaq.push(['_setCustomVar',1,'language','portuguese',1]);break;case"EN":_gaq.push(['_setCustomVar',1,'language','spanish',1]);break;};});$('#footer a.crc-main-sprite').click(function(){_gaq.push(['_trackEvent','external link','tramontina']);});$('#footer div.right').click(function(){_gaq.push(['_trackEvent','external link','w3haus']);});$('#participate').click(function(){_gaq.push(['_trackPageview','/promocao/minha-faca/participe']);window.location=$.crc.ROOT_URL+'concurso';return false;});if($.init[$.crc.section]!==undefined)
{$.init[$.crc.section]();};};$.extend($.init,{"home":function(){$.home_crc_slide.New();$('a#thumb-video').click(function(){$('div#modal-group').show();$('#video').show();_gaq.push(['_trackPageview','/destaque/churrasco-e-tramontina;']);return false;});$('*','#modal-group').click(function(){$('#video').css('display','none');$('div#modal-group').hide();_gaq.push(['_trackPageview']);return false;});},"products":function(){$('div.accordion').accordion();$('a.onde-comprar').click($.accordion);$('.where-to-buy.offline #pais.select').change(function(){var that=$(this);if(that.attr("value")){loadCities(that.val());};$('.where-to-buy.offline #cidade').removeAttr('disabled');});$('.where-to-buy.online #pais.select').change(function(){var that=$(this);if(that.attr("value")){loadShops(that.val());};});var product_image=$('#products div.product div.image img'),product_thumbs=$('#products div.product div.thumb a');product_thumbs.last().addClass('on');product_thumbs.click(function(){var that=$(this);if(!that.hasClass('on')){product_thumbs.removeClass('on');that.addClass('on');product_image.attr({'src':that.attr('href'),'style':''}).one("load",function(){var p_height=product_image.height(),p_width=product_image.width(),p_height=((p_height<385)?p_height:385),p_width=((p_width<668)?p_width:668);product_image.css({'height':p_height,'margin-top':Math.round((385-p_height)/2),'width':p_width});});_gaq.push(['_trackEvent','products','images',that.parent().attr('class').replace('thumb ','')+'']);}
return false;});var product_name=$('div.product h1').text();$('#product-pagination li').click(function(){var Class=$(this).attr('class').replace(" on","");_gaq.push(['_trackEvent','products',Class,product_name]);});$('a.onde-comprar').click(function(){_gaq.push(['_trackEvent','products','open where to buy','top button']);});$('a.button[rel=external]').attr('target','_blank');$('#products div.shop a.button').click(function(){_gaq.push(['_trackEvent','external link',$(this).prev().text(),product_name]);});if($('#onde-comprar').length){$('#whereToBuyOff_state').change(function(){$('#whereToBuyOff_city').removeAttr('disabled').html("<option value=''>Carregando...</option>").load($.crc.ROOT_URL+"whereToBuyOffline/loadCities",{reference:$.crc.product.reference,productId:$.crc.product.productId,uf:$('#whereToBuyOff_state').val()});});$('#list-offline-stores').submit(function(){if($('#storeResults').length){document.getElementById('storeResults').innerHTML='';}
ok=true;formList=$(this);msgForm='Preencha todos os campos';if($('#whereToBuyOff_state').val()==''){ok=false;}
if($('#whereToBuyOff_city').val()==''){ok=false;}
if(ok){$('#storeResults').after('<div id="loaderStore">Carregando...</div>');$.post($.crc.ROOT_URL+'products/loadStores',{id:$('#idProduct').val(),reference:$('#whereToBuyOff_reference').val(),state:$('#whereToBuyOff_state').val(),city:$('#whereToBuyOff_city').val()},function(data){$('#loaderStore').remove();if($('#storeResults').length){$('#storeResults').html(data);}else{$('#storeResults').html('<div id="storeResults">'+data+'</div>');};_gaq.push(['_trackEvent','where to buy',$('#whereToBuyOff_state').val(),$('#whereToBuyOff_city').val()]);});}else{$('#storeResults').html('<p>'+msgForm+'</p>');}
return false;});};},"contact":function(){var contact_message=$('#contact_message');if(contact_message.length){contact_message.limit('250','#num');};$.validation('input, textarea, select','#contact_form');},"newsletter":function(){$('#register_day, #register_month','#newsletter_form').keyup(function(){var that=$(this),input=that.val(),quant=input.length;if(quant===2){switch(that.attr('id')){case"register_day":$('#register_month').focus();break;case"register_month":$('#register_year').focus();break;};};});$('#register_day, #register_month, #register_year, #register_phone','#newsletter_form').keypress(function(e){if(e.charCode&&(e.charCode<48||e.charCode>57)){e.preventDefault();};});$.validation('#register_name, #register_country, #register_city, #register_city, #register_email, #register_day, #register_month, #register_year, #register_phone, #register_knowledge','#newsletter_form');},"promotion":function(){$('div.accordion').accordion();$.validation({form:'#register_form',append:'.message',fields:'input, select, textarea',beforeSend:function(){var input='#register_message';var count='#counter_length';return word_count(input,count,150);},beforeSendMessage:'A mensagem possui mais de 150 palavras.'});$('#register_message').each(function(){var input='#register_message';var count='#counter_length';$(count).show();word_count(input,count);$(this).keydown(function(){word_count(input,count,150);});});$('.numeric').keypress(function(e){if(e.which!=8&&e.which!=0&&(e.which<48||e.which>57))return false;}).bind('cut copy paste',function(e){e.preventDefault();});}});$(window).ready($.init);})(jQuery);function word_count(field,count,size){var number=0;var matches=$(field).val().match(/\b/g);if(matches){number=matches.length/2;}
$(count).text(number);if(number>size)
return false;return true;}
