
$(window).load(function(){$('a.blank').click(function(){$(this).attr("target","_blank");});$('a.self').click(function(){$(this).attr("target","_self");});$('a.parent').click(function(){$(this).attr("target","_parent");});$('input:text').focus(function(){if($(this).val()==$(this).attr("title")){$(this).val("");if($(this).hasClass("password")){$(this).attr("type","password");}
$(this).bind("blur",function(){if($(this).val()==''){if($(this).hasClass("password")){$(this).attr("type","text");}
$(this).val($(this).attr("title"));}});}});anterior="#conteudoProdutosMaisProcurados1";$('#abaConteudoProdutosMaisProcurados1, #abaConteudoProdutosMaisProcurados2').click(function(e){e.preventDefault();$img=$("img",$(this))[0];$('div.boxProdutosAcessados ul li a img').each(function(){if($img==$(this)[0]){var imgOver=$(this).attr("src",$(this).attr("src").replace("_off","_on"));}else{$(this).attr("src",$(this).attr("src").replace("_on","_off"));}});if($(this).attr("title")!=anterior){$($(this).attr("title")).show();$(anterior).hide();}
anterior=$(this).attr("title");});$('li.mais_link a').hover(function(){$(this,'img').css("opacity","0.7");},function(){$(this,'img').css('opacity','1.0');});$('li.bgLogoLojas a img').hover(function(){$(this).css("opacity","0.5");},function(){$(this).css('opacity','1.0');});var browser=navigator.appVersion;version=browser.search('MSIE');$('img#MeuCarrinho').mouseover(function(){if(version=='-1'){$(this).css("opacity","0.7");}});$('img#MeuCarrinho').mouseout(function(){if(version=='-1'){$(this).css("opacity","1.0");}});$('div#close_NavMeuCarrinho img').hover(function(){$(this).css("opacity","0.4");},function(){$(this).css("opacity","1.0");});$('div#box_showProdutos ul li img.fg_Produto').hover(function(){$(this).css("opacity","0.7");},function(){$(this).css("opacity","1.0");});$('div#close_NavMeuCarrinho').click(function(){$('div.bg_NavCarrinho').fadeOut('normal');$('div.navCarrinho').fadeOut('normal');});var $produtoItem=$('div.produtoItem');var $produtoAmpliado=$('div.produtoAmpliado');$produtoItem.mouseover(function(){$(this).addClass('produtoEmDestaque');});$produtoItem.mouseout(function(){$(this).removeClass('produtoEmDestaque');});$produtoAmpliado.mouseover(function(){$(this).addClass('bgprodutoAmpliado');});$produtoAmpliado.mouseout(function(){$(this).removeClass('bgprodutoAmpliado');});$("#divAncoras a").click(function(){var e=$(this).attr("href");$(window).scrollTop($(e).offset().top+30);return false;});fitInWindow();$('div.boxProdutosAcessadosIndividual').hover(function(){$(this).css({'background':"url('util/img/bgBoxProdutosAcessadosIndividual.gif')"});},function(){$(this).css({'background':"none"});});$(window).bind('resize',fitInWindow);});function getFlashMovieObject(movieName){if(window.document[movieName]){return window.document[movieName];}
if(navigator.appName.indexOf("Microsoft Internet")==-1){if(document.embeds&&document.embeds[movieName])return document.embeds[movieName];}
else{return document.getElementById(movieName);}}
function fitInWindow(){var minWidth=999;var windowWidth=document.body.clientWidth;var headerWidth=$('#headerSuperiorId').width();var logoWidth=$('div.logo').width();var basketOpenerWidth=$('div.carrinho').width();var leftMenuWidth=$('div.column-navigation').width();var rightMenuWidth=$('div.menuDireita').width();if(windowWidth<minWidth){windowWidth=minWidth;}
var searchWidth=windowWidth-logoWidth-basketOpenerWidth-15;var columnContentWidth=windowWidth;if(leftMenuWidth){columnContentWidth=windowWidth-leftMenuWidth-15;}
var homeGridWidth=columnContentWidth;if(rightMenuWidth){homeGridWidth=(homeGridWidth-rightMenuWidth-15);}
$('#searchControl').width(searchWidth);$('#produtosHomeControle').width(homeGridWidth);$('#columncontentControl').width(columnContentWidth);$('#divConteinerPrincipal').width(windowWidth);$("#menuControle span.spanBloco a").each(function(){var $li=$(this).parents("li:first");$li.css("width",($(this).width()+20)+"px");});}
function toggle(i){if($(i).is(":hidden"))$(i).show();else $(i).hide();}
function mouse_over_menu(objDiv){objDiv.className='itemOver';}
function mouse_out_menu(objDiv){objDiv.className='itemOn';}
function RedirProductList(url,value){window.location.href=url+'&'+value;}
function AbrirJanelaCentralizada(strWindowURL,strWindowName,intWindowWidth,intWindowHeight,boolScrollbars,boolResizable,boolMenubar,boolToolbar,boolAddressbar,boolStatusbar,boolFullscreen){var intWindowLeft=(screen.width-intWindowWidth)/2;var intWindowTop=(screen.height-intWindowHeight)/2;var strWindowProperties='height='+intWindowHeight+',width='+intWindowWidth
+',top='+intWindowTop+',left='+intWindowLeft
+',scrollbars='+boolScrollbars+',resizable='+boolResizable
+',menubar='+boolMenubar+',toolbar='+boolToolbar+',location='
+boolAddressbar+',statusbar='+boolStatusbar+',fullscreen='
+boolFullscreen+'';var obj_window=window.open(strWindowURL,strWindowName,strWindowProperties)
if(parseInt(navigator.appVersion)>=4){obj_window.window.focus();}}
function AutoTab(objEvent){var evt=new CrossKeyPress(objEvent);var element=evt.target;var filter=[0,8,9,16,17,18,37,38,39,40,46];var keyCode=evt.crossKeyCode;if(element.value.length>=element.maxLength&&!containsElement(filter,keyCode)){element.value=element.value.slice(0,element.maxLength);for(var i=(getIndex(element)+1);i<element.form.length;i++){if(element.form[i].type!="hidden"&&element.form[i].readOnly==false){try{element.form[i].focus();i=element.form.length;}catch(e){}}}}
function containsElement(aFilter,iKeyCode){var found=false,index=0;while(!found&&index<aFilter.length){found=(aFilter[index]==iKeyCode);index++;}
return found;}
function getIndex(input){var index=-1,i=0,found=false;while(i<input.form.length&&index==-1)
if(input.form[i]==input)index=i;else i++;return index;}
return true;}
function CrossKeyPress(evt){evt=evt?evt:(window.event?window.event:null);if(evt){this.isIE=navigator.appName=='Netscape'?false:true;this.target=evt.target?evt.target:evt.srcElement;this.crossKeyCode=this.isIE?evt.keyCode:(evt.ctrlKey?13:evt.which);}}
function ApenasNumeros(tirarHifen,objEvent){var evt=new CrossKeyPress(objEvent);if(!(evt.crossKeyCode>=48&&evt.crossKeyCode<=57)){if((evt.crossKeyCode==45&&!tirarHifen)||isBasicKeys(evt.crossKeyCode))return;if(evt.isIE)
event.returnValue=false;else{objEvent.preventDefault();objEvent.stopPropagation();}}}
function ApenasLetras(objEvent){var evt=new CrossKeyPress(objEvent);if(evt.crossKeyCode>=33&&evt.crossKeyCode<=64){if(evt.isIE)
objEvent.returnValue=false;else{objEvent.preventDefault();objEvent.stopPropagation();}}}
function campoTelefone(campo,tamanho,posicaoSeparador,objEvent){try{var zeroOitocentos=false;var tamanhoAtual=campo.value.length;if((campo.maxLength==13)&&(tamanhoAtual>=4)){zeroOitocentos=campo.value.substring(0,4)=='0800'?true:false;}
tamanho=zeroOitocentos?11:8;var evt=new CrossKeyPress(objEvent);if((evt.crossKeyCode<48||evt.crossKeyCode>57)&&evt.crossKeyCode!=45&&evt.crossKeyCode!=8&&evt.crossKeyCode!=0){if(evt.isIE){objEvent.returnValue=false;}
else{objEvent.preventDefault();objEvent.stopPropagation();}}
if((evt.crossKeyCode==45||evt.crossKeyCode==0)&&((!zeroOitocentos&&campo.value.indexOf('-')!=-1)||tamanhoAtual==0)){if(evt.isIE){event.returnValue=false;}
else{objEvent.preventDefault();objEvent.stopPropagation();}}
if(((evt.crossKeyCode>=48&&evt.crossKeyCode<=57)||evt.crossKeyCode==45||evt.crossKeyCode==0)&&(campo.value.replace('-','').replace('-','').length==tamanho)&&(campo.value.indexOf('-')!=-1)){if(evt.isIE){event.returnValue=false;}
else{objEvent.preventDefault();objEvent.stopPropagation();}}
if(zeroOitocentos){if((tamanhoAtual==4||tamanhoAtual==8)&&(evt.crossKeyCode!=45)&&(evt.crossKeyCode!=08)&&(evt.crossKeyCode!=00)){campo.value+='-';}}
else{if((tamanhoAtual==(tamanho-posicaoSeparador))&&(campo.value.indexOf('-')==-1)&&(evt.crossKeyCode!=45)&&(evt.crossKeyCode!=08)&&(evt.crossKeyCode!=00)){campo.value+='-';}
else if((evt.crossKeyCode==45)&&(campo.value.indexOf('-')==-1)&&(campo.value.replace('-','').replace('-','').length==tamanho)){campo.value=campo.value.substring(0,4)+'-'+campo.value.substring(4);}}}
catch(e){}}
function ValidaEntradaUsuario(e){var nav4;var keyPressed;var nav4=e.which?true:false;keyPressed=nav4?e.which:e.keyCode;var returnValue=ValidaCaracteresWithEvent(keyPressed);if(!nav4){e.returnValue=returnValue;e.cancelBubble=!returnValue;}
else if(!returnValue){e.preventDefault();e.stopPropagation();}}
function ApenasNumerosLetrasWithEvent(keyPressed){var lista='!@#$%�&*()-+[]{}<>|\/=_:;.';if(lista.indexOf(String.fromCharCode(keyPressed))>-1)
return false;else
return true;}
function ValidaCaracteresWithEvent(keyPressed){var lista='<>';if(lista.indexOf(String.fromCharCode(keyPressed))>-1)
return false;else
return true;}
function isBasicKeys(myKey){if(myKey==0||myKey==8||myKey==13)
return true;else
return false;}
function validateKey(evt){if(evt.keyCode=='17'){return false}
return true}
function getQueryString(variavel){var variaveis=location.search.replace(/\x3F/,"").replace(/\x2B/g," ").split("&")
var nvar
if(variaveis!=""){var qs=[]
for(var i=0;i<variaveis.length;i++){nvar=variaveis[i].split("=")
qs[nvar[0]]=unescape(nvar[1])}
return qs[variavel]}
return null}
function ApenasNumerosLetrasGSA(objEvent){var lista='!@#$%�*[]{}<>|\=_:;^~�\'';var evt=new CrossKeyPress(objEvent);if(lista.indexOf(String.fromCharCode(evt.crossKeyCode))>-1){if(evt.isIE)
event.returnValue=false;else{objEvent.preventDefault();objEvent.stopPropagation();}}}
function writeFlash(idContainer,idFlash,bgcolor,width,height,flashvars){str="<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000'";str+="codebase='https://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0'";str+=" width='"+width+"' height='"+height+"' id='"+idFlash+"' align='middle'>";str+="<param name='allowScriptAccess' value='always' />"
str+="<param name='movie' value='"+idFlash+"' />";str+="<param name='flashvars' value='urlXML="+flashvars+"'/>";str+="<param name='quality' value='high' /><param name='wmode' value='transparent' />";str+="<embed flashvars='urlXML="+flashvars+"' src='"+idFlash+"' quality='high' wmode=transparent width='"+width+"' height='"+height+"' name='"+idFlash+"' align='middle' ";str+="allowScriptAccess='always' type='application/x-shockwave-flash' pluginspage='https://www.macromedia.com/go/getflashplayer' /></object>";document.getElementById(idContainer).innerHTML=str;}