var isN4 = (document.layers) ? true : false; var isIE = (document.all) ? true : false; var isDOM = (document.getElementById && !document.all) ? true : false; var secs; var timerID = null; var timerRunning = false; var delay = 1000; function PhoneFormat(campo) { var tamanho = document.getElementById(campo.id).value.length; if (tamanho == 4) { document.getElementById(campo.id).value += '-' } } function PrintPage() { if (isIE) window.print(); else alert('Por favor selecione a opcao "Arquivo -> Imprimir" do menu superior para imprimir.') } function ChangeFieldFocus(textbox1, textbox2, nuLength) { var txt1; var txt2; if (isDOM) { txt1 = document.getElementById(textbox1.id); txt2 = document.getElementById(textbox2.id) } else if (isN4) { txt1 = document.layers[textbox1.id]; txt2 = document.layers[textbox2.id] } else if (isIE) { txt1 = document.all[textbox1.id]; txt2 = document.all[textbox2.id] } if (txt1.value != null && txt1.value.length >= nuLength) txt2.focus() } function GoToNext(size, obj1, obj2) { if (document.getElementById(obj1.id).value.length >= size) { document.getElementById(obj2.id).focus() } } function ChangeClientType() { if (isDOM) { if (arguments[0] == 'F') { document.getElementById('trPF').className = 'visiblediv'; document.getElementById('trPJ').className = 'invisiblediv' } else if (arguments[0] == 'J') { document.getElementById('trPF').className = 'invisiblediv'; document.getElementById('trPJ').className = 'visiblediv' } } else if (isN4) { if (arguments[0] == 'F') { document.layers['trPF'].className = 'visiblediv'; document.layers['trPJ'].className = 'invisiblediv' } else if (arguments[0] == 'J') { document.layers['trPF'].className = 'invisiblediv'; document.layers['trPJ'].className = 'visiblediv' } } else if (isIE) { if (arguments[0] == 'F') { document.all['trPF'].className = 'visiblediv'; document.all['trPJ'].className = 'invisiblediv' } else if (arguments[0] == 'J') { document.all['trPF'].className = 'invisiblediv'; document.all['trPJ'].className = 'visiblediv' } } } function OpenPopup(idPopup, url, popupW, popupH) { window.open(url, idPopup, 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=no,width=' + popupW + ',height=' + popupH + ',top=55,left=55') } function OpenProductRememberPopup(idProduct) { OpenPopup('productremember', 'productremember.aspx?idproduct=' + idProduct, 330, 300) } function OpenGiftCardPopup(idPopup, url, popupW, popupH) { window.open(url, idPopup, 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width=' + popupW + ',height=' + popupH + ',top=55,left=55') } function oPenPopupShipCost(zipCode, zipCodeComplement) { var zipfull = zipCode + zipCodeComplement; window.open('popupshipcost.aspx?zip=' + zipfull, null, 'width=500,height=200'); return false } function ValidateNumberOfChars(textBox, limit, divResponse) { var validKey = true; var obj = document.getElementById(textBox); var divResponse = document.getElementById(divResponse); var diff = limit - obj.value.length; if (diff < 0 && window.event.keyCode != 8 && window.event.keyCode != 17 && !(window.event.keyCode >= 33 && window.event.keyCode <= 40) && window.event.keyCode != 46) { obj.value = obj.value.substr(0, limit); alert('Atenção: Você não pode exceder ' + limit + ' caracteres neste campo!'); validKey = false } divResponse.innerHTML = "Total de <font color=\"red\"><strong>" + obj.value.length + "</strong></font> caracteres digitados de no máximo <strong>" + limit + "</strong>."; return validKey } function ProductZoom(imageUrl, fgType, idProduct) { pLX = 400; pAY = 600; xx = parseInt(((screen.width - pLX - 8) / 2)); yy = parseInt(((screen.height - pAY - 15) / 2)); pUrl = 'popup_productzoom.aspx?productId=' + idProduct + '&img=' + imageUrl + '&type=' + fgType; pTit = 'Roika'; s = window.open(pUrl, '', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=no,width=' + pLX + ', height=' + pAY + ', top=' + yy + ', left=' + xx + ', screenX=' + xx + ', screenY=' + yy) } function ChangeImage(path, imgDetalhe, imgZoom, idProduct, imgBig, href, hdn) { if (isDOM) { document.getElementById(imgBig).src = path + "/images/product/" + imgDetalhe; if (imgZoom != "") document.getElementById(href).setAttribute("href", "javascript:ProductZoom('" + imgZoom + "','1'," + hdn + ");"); else document.getElementById(href).removeAttribute("href") } else if (isN4) { document.layers[imgBig].src = path + "/images/product/" + imgDetalhe; if (imgZoom != "") document.layers[href].setAttribute("href", "javascript:ProductZoom('" + imgZoom + "','1');"); else document.layers[href].removeAttribute("href") } else if (isIE) { document.all[imgBig].src = path + "/images/product/" + imgDetalhe; if (imgZoom != "") document.all[href].setAttribute("href", "javascript:ProductZoom('" + imgZoom + "','1');"); else document.all[href].removeAttribute("href") } } function RememberMe(idProduct) { pLX = 305; pAY = 400; xx = parseInt(((screen.width - pLX - 8) / 2)); yy = parseInt(((screen.height - pAY - 15) / 2)); pUrl = 'popup_remember.aspx?productId=' + idProduct; pTit = 'MyTime'; s = window.open(pUrl, '', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width=' + pLX + ', height=' + pAY + ', top=' + yy + ', left=' + xx + ', screenX=' + xx + ', screenY=' + yy) } function ShowMetadataGroup(action, imageWebPath) { if (isDOM) { if (action == 1) { document.getElementById('trGroupDescription').className = 'visiblediv bg_conteudo_info_detalhe'; document.getElementById('trGroupDescription1').className = 'visiblediv float_left'; document.getElementById('trGroupFunction').className = 'invisiblediv'; document.getElementById('trGroupFunction1').className = 'invisiblediv'; document.getElementById('trGroupGuarantee').className = 'invisiblediv'; document.getElementById('trGroupGuarantee1').className = 'invisiblediv'; document.getElementById('trGroupIncludeItens').className = 'invisiblediv'; document.getElementById('trGroupIncludeItens1').className = 'invisiblediv'; document.getElementById('dadostecnicos').src = imageWebPath + 'bt_descricao_2.gif'; document.getElementById('funcoes').src = imageWebPath + 'bt_funcoes.gif'; document.getElementById('itens').src = imageWebPath + 'bt_itens_inclusos.gif'; document.getElementById('garantia').src = imageWebPath + 'bt_garantia.gif' } else if (action == 2) { document.getElementById('trGroupDescription').className = 'invisiblediv'; document.getElementById('trGroupDescription1').className = 'invisiblediv'; document.getElementById('trGroupFunction').className = 'visiblediv bg_conteudo_info_detalhe'; document.getElementById('trGroupFunction1').className = 'visiblediv float_left'; document.getElementById('trGroupGuarantee').className = 'invisiblediv'; document.getElementById('trGroupGuarantee1').className = 'invisiblediv'; document.getElementById('trGroupIncludeItens').className = 'invisiblediv'; document.getElementById('trGroupIncludeItens1').className = 'invisiblediv'; document.getElementById('dadostecnicos').src = imageWebPath + 'bt_descricao.gif'; document.getElementById('funcoes').src = imageWebPath + 'bt_funcoes_2.gif'; document.getElementById('itens').src = imageWebPath + 'bt_itens_inclusos.gif'; document.getElementById('garantia').src = imageWebPath + 'bt_garantia.gif' } else if (action == 3) { document.getElementById('trGroupDescription').className = 'invisiblediv'; document.getElementById('trGroupDescription1').className = 'invisiblediv'; document.getElementById('trGroupFunction').className = 'invisiblediv'; document.getElementById('trGroupFunction1').className = 'invisiblediv'; document.getElementById('trGroupGuarantee').className = 'visiblediv bg_conteudo_info_detalhe'; document.getElementById('trGroupGuarantee1').className = 'visiblediv float_left'; document.getElementById('trGroupIncludeItens').className = 'invisiblediv'; document.getElementById('trGroupIncludeItens1').className = 'invisiblediv'; document.getElementById('dadostecnicos').src = imageWebPath + 'bt_descricao.gif'; document.getElementById('funcoes').src = imageWebPath + 'bt_funcoes.gif'; document.getElementById('itens').src = imageWebPath + 'bt_itens_inclusos.gif'; document.getElementById('garantia').src = imageWebPath + 'bt_garantia_2.gif' } else if (action == 4) { document.getElementById('trGroupDescription').className = 'invisiblediv'; document.getElementById('trGroupDescription1').className = 'invisiblediv'; document.getElementById('trGroupFunction').className = 'invisiblediv'; document.getElementById('trGroupFunction1').className = 'invisiblediv'; document.getElementById('trGroupGuarantee').className = 'invisiblediv'; document.getElementById('trGroupGuarantee1').className = 'invisiblediv'; document.getElementById('trGroupIncludeItens').className = 'visiblediv bg_conteudo_info_detalhe'; document.getElementById('trGroupIncludeItens1').className = 'visiblediv float_left'; document.getElementById('dadostecnicos').src = imageWebPath + 'bt_descricao.gif'; document.getElementById('funcoes').src = imageWebPath + 'bt_funcoes.gif'; document.getElementById('itens').src = imageWebPath + 'bt_itens_inclusos_2.gif'; document.getElementById('garantia').src = imageWebPath + 'bt_garantia.gif' } else if (action == 5) { document.getElementById('trCustomerOpinions').className = 'bg_conteudo_info_detalhe visiblediv'; document.getElementById('trOpinions').className = 'invisiblediv' } else if (action == 6) { document.getElementById('trCustomerOpinions').className = 'invisiblediv'; document.getElementById('trOpinions').className = 'bg_conteudo_info_detalhe visiblediv' } else if (action == 7) { document.getElementById('trCustomerOpinions').className = 'bg_conteudo_info_detalhe visiblediv'; document.getElementById('trOpinions').className = 'invisiblediv' } } else if (isN4) { if (action == 1) { document.layers['trGroupDescription'].className = 'bg_conteudo_info_detalhe visiblediv'; document.layers['trGroupDescription1'].className = 'float_left visiblediv'; document.layers['trGroupFunction'].className = 'invisiblediv'; document.layers['trGroupFunction1'].className = 'invisiblediv'; document.layers['trGroupGuarantee'].className = 'invisiblediv'; document.layers['trGroupGuarantee1'].className = 'invisiblediv'; document.layers['trGroupIncludeItens'].className = 'invisiblediv'; document.layers['trGroupIncludeItens1'].className = 'invisiblediv'; document.layers['dadostecnicos'].src = imageWebPath + 'bt_descricao_2.gif'; document.layers['funcoes'].src = imageWebPath + 'bt_funcoes.gif'; document.layers['itens'].src = imageWebPath + 'bt_itens_inclusos.gif'; document.layers['garantia'].src = imageWebPath + 'bt_garantia.gif' } else if (action == 2) { document.layers['trGroupDescription'].className = 'invisiblediv'; document.layers['trGroupDescription1'].className = 'invisiblediv'; document.layers['trGroupFunction'].className = 'bg_conteudo_info_detalhe visiblediv'; document.layers['trGroupFunction1'].className = 'float_left visiblediv'; document.layers['trGroupGuarantee'].className = 'invisiblediv'; document.layers['trGroupGuarantee1'].className = 'invisiblediv'; document.layers['trGroupIncludeItens'].className = 'invisiblediv'; document.layers['trGroupIncludeItens1'].className = 'invisiblediv'; document.layers['dadostecnicos'].src = imageWebPath + 'bt_descricao.gif'; document.layers['funcoes'].src = imageWebPath + 'bt_funcoes_2.gif'; document.layers['itens'].src = imageWebPath + 'bt_itens_inclusos.gif'; document.layers['garantia'].src = imageWebPath + 'bt_garantia.gif' } else if (action == 3) { document.layers['trGroupDescription'].className = 'invisiblediv'; document.layers['trGroupDescription1'].className = 'invisiblediv'; document.layers['trGroupFunction'].className = 'invisiblediv'; document.layers['trGroupFunction1'].className = 'invisiblediv'; document.layers['trGroupGuarantee'].className = 'bg_conteudo_info_detalhe visiblediv'; document.layers['trGroupGuarantee1'].className = 'float_left visiblediv'; document.layers['trGroupIncludeItens'].className = 'invisiblediv'; document.layers['trGroupIncludeItens1'].className = 'invisiblediv'; document.layers['dadostecnicos'].src = imageWebPath + 'bt_descricao.gif'; document.layers['funcoes'].src = imageWebPath + 'bt_funcoes.gif'; document.layers['itens'].src = imageWebPath + 'bt_itens_inclusos.gif'; document.layers['garantia'].src = imageWebPath + 'bt_garantia_2.gif' } else if (action == 4) { document.layers['trGroupDescription'].className = 'invisiblediv'; document.layers['trGroupDescription1'].className = 'invisiblediv'; document.layers['trGroupFunction'].className = 'invisiblediv'; document.layers['trGroupFunction1'].className = 'invisiblediv'; document.layers['trGroupGuarantee'].className = 'invisiblediv'; document.layers['trGroupGuarantee1'].className = 'invisiblediv'; document.layers['trGroupIncludeItens'].className = 'bg_conteudo_info_detalhe visiblediv'; document.layers['trGroupIncludeItens1'].className = 'float_left visiblediv'; document.layers['dadostecnicos'].src = imageWebPath + 'bt_descricao.gif'; document.layers['funcoes'].src = imageWebPath + 'bt_funcoes.gif'; document.layers['itens'].src = imageWebPath + 'bt_itens_inclusos_2.gif'; document.layers['garantia'].src = imageWebPath + 'bt_garantia.gif' } else if (action == 5) { document.layers['trCustomerOpinions'].className = 'bg_conteudo_info_detalhe visiblediv'; document.layers['trOpinions'].className = 'invisiblediv' } else if (action == 6) { document.layers['trCustomerOpinions'].className = 'invisiblediv'; document.layers['trOpinions'].className = 'bg_conteudo_info_detalhe visiblediv' } else if (action == 7) { document.layers['trCustomerOpinions'].className = 'bg_conteudo_info_detalhe visiblediv'; document.layers['trOpinions'].className = 'invisiblediv' } } else if (isIE) { if (action == 1) { document.all['trGroupDescription'].className = 'bg_conteudo_info_detalhe visiblediv'; document.all['trGroupDescription1'].className = 'float_left visiblediv'; document.all['trGroupFunction'].className = 'invisiblediv'; document.all['trGroupFunction1'].className = 'invisiblediv'; document.all['trGroupGuarantee'].className = 'invisiblediv'; document.all['trGroupGuarantee1'].className = 'invisiblediv'; document.all['trGroupIncludeItens'].className = 'invisiblediv'; document.all['trGroupIncludeItens1'].className = 'invisiblediv'; document.all['dadostecnicos'].src = imageWebPath + 'bt_descricao_2.gif'; document.all['funcoes'].src = imageWebPath + 'bt_funcoes.gif'; document.all['itens'].src = imageWebPath + 'bt_itens_inclusos.gif'; document.all['garantia'].src = imageWebPath + 'bt_garantia.gif' } else if (action == 2) { document.all['trGroupDescription'].className = 'invisiblediv'; document.all['trGroupDescription1'].className = 'invisiblediv'; document.all['trGroupFunction'].className = 'bg_conteudo_info_detalhe visiblediv'; document.all['trGroupFunction1'].className = 'float_left visiblediv'; document.all['trGroupGuarantee'].className = 'invisiblediv'; document.all['trGroupGuarantee1'].className = 'invisiblediv'; document.all['trGroupIncludeItens'].className = 'invisiblediv'; document.all['trGroupIncludeItens1'].className = 'invisiblediv'; document.all['dadostecnicos'].src = imageWebPath + 'bt_descricao.gif'; document.all['funcoes'].src = imageWebPath + 'bt_funcoes_2.gif'; document.all['itens'].src = imageWebPath + 'bt_itens_inclusos.gif'; document.all['garantia'].src = imageWebPath + 'bt_garantia.gif' } else if (action == 3) { document.all['trGroupDescription'].className = 'invisiblediv'; document.all['trGroupDescription1'].className = 'invisiblediv'; document.all['trGroupFunction'].className = 'invisiblediv'; document.all['trGroupFunction1'].className = 'invisiblediv'; document.all['trGroupGuarantee'].className = 'bg_conteudo_info_detalhe visiblediv'; document.all['trGroupGuarantee1'].className = 'float_left visiblediv'; document.all['trGroupIncludeItens'].className = 'invisiblediv'; document.all['trGroupIncludeItens1'].className = 'invisiblediv'; document.all['dadostecnicos'].src = imageWebPath + 'bt_descricao.gif'; document.all['funcoes'].src = imageWebPath + 'bt_funcoes.gif'; document.all['itens'].src = imageWebPath + 'bt_itens_inclusos.gif'; document.all['garantia'].src = imageWebPath + 'bt_garantia_2.gif' } else if (action == 4) { document.all['trGroupDescription'].className = 'invisiblediv'; document.all['trGroupDescription1'].className = 'invisiblediv'; document.all['trGroupFunction'].className = 'invisiblediv'; document.all['trGroupFunction1'].className = 'invisiblediv'; document.all['trGroupGuarantee'].className = 'invisiblediv'; document.all['trGroupGuarantee1'].className = 'invisiblediv'; document.all['trGroupIncludeItens'].className = 'bg_conteudo_info_detalhe visiblediv'; document.all['trGroupIncludeItens1'].className = 'float_left visiblediv'; document.all['dadostecnicos'].src = imageWebPath + 'bt_descricao.gif'; document.all['funcoes'].src = imageWebPath + 'bt_funcoes.gif'; document.all['itens'].src = imageWebPath + 'bt_itens_inclusos_2.gif'; document.all['garantia'].src = imageWebPath + 'bt_garantia.gif' } else if (action == 5) { document.all('trCustomerOpinions').className = 'bg_conteudo_info_detalhe visiblediv'; document.all('trOpinions').className = 'invisiblediv' } else if (action == 6) { document.all('trCustomerOpinions').className = 'invisiblediv'; document.all('trOpinions').className = 'bg_conteudo_info_detalhe visiblediv' } else if (action == 7) { document.all('trCustomerOpinions').className = 'bg_conteudo_info_detalhe visiblediv'; document.all('trOpinions').className = 'invisiblediv' } } } function ShowMetadataGroup2(action, totalItems) { if (isDOM) { for (a = 1; a <= totalItems; a++) { if (a == action) { document.getElementById('divValues' + a).className = 'visiblediv bg_conteudo_info_detalhe'; document.getElementById('divValuesFooter' + a).className = 'visiblediv float_left'; document.getElementById('divAba' + a).className = 'bg_aba_descr_selected'; document.getElementById('divEsqAba' + a).className = 'curva_esq_ext_aba_descr_selected'; document.getElementById('divDirAba' + a).className = 'curva_dir_int_aba_descr_selected' } else { document.getElementById('divValues' + a).className = 'invisiblediv'; document.getElementById('divValuesFooter' + a).className = 'invisiblediv'; document.getElementById('divAba' + a).className = 'bg_aba_descr'; document.getElementById('divEsqAba' + a).className = 'curva_esq_ext_aba_descr'; document.getElementById('divDirAba' + a).className = 'curva_dir_int_aba_descr' } } } else if (isN4) { for (a = 1; a <= totalItems; a++) { if (a == action) { document.layers['divValues' + a].className = 'visiblediv bg_conteudo_info_detalhe'; document.layers['divValuesFooter' + a].className = 'visiblediv float_left'; document.layers['divAba' + a].className = 'bg_aba_descr_selected'; document.layers['divEsqAba' + a].className = 'curva_esq_ext_aba_descr_selected'; document.layers['divDirAba' + a].className = 'curva_dir_int_aba_descr_selected' } else { document.layers['divValues' + a].className = 'invisiblediv'; document.layers['divValuesFooter' + a].className = 'invisiblediv'; document.layers['divAba' + a].className = 'bg_aba_descr'; document.layers['divEsqAba' + a].className = 'curva_esq_ext_aba_descr'; document.layers['divDirAba' + a].className = 'curva_dir_int_aba_descr' } } } else if (isIE) { for (a = 1; a <= totalItems; a++) { if (a == action) { document.all['divValues' + a].className = 'visiblediv bg_conteudo_info_detalhe'; document.all['divValuesFooter' + a].className = 'visiblediv float_left'; document.all['divAba' + a].className = 'bg_aba_descr_selected'; document.all['divEsqAba' + a].className = 'curva_esq_ext_aba_descr_selected'; document.all['divDirAba' + a].className = 'curva_dir_int_aba_descr_selected' } else { document.all['divValues' + a].className = 'invisiblediv'; document.all['divValuesFooter' + a].className = 'invisiblediv'; document.all['divAba' + a].className = 'bg_aba_descr'; document.all['divEsqAba' + a].className = 'curva_esq_ext_aba_descr'; document.all['divDirAba' + a].className = 'curva_dir_int_aba_descr' } } } } function OpenNewsLetter() { pLX = 305; pAY = 350; xx = parseInt(((screen.width - pLX - 8) / 2)); yy = parseInt(((screen.height - pAY - 15) / 2)); pUrl = 'popup_newsletter.aspx'; pTit = 'MyTime'; s = window.open(pUrl, '', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width=' + pLX + ', height=' + pAY + ', top=' + yy + ', left=' + xx + ', screenX=' + xx + ', screenY=' + yy) } function OpenPopupStaticText(url, vwidth, vheight) { window.open(url, 'StaticText', 'toolbar=no,status=no,menubar=no,scrollbars=no,resizeable=no,top=100,left=50,width=' + vwidth + ',height=' + vheight + '') } function Trim(str) { return str.replace(/^\s+|\s+$/g, "") } function ShowPhones(show) { if (isDOM) { if (show) document.getElementById("televendas").style.visibility = "visible"; else document.getElementById("televendas").style.visibility = "hidden" } else if (isN4) { if (show) document.layers["televendas"].style.visibility = "visible"; else document.layers["televendas"].style.visibility = "hidden" } else if (isIE) { if (show) document.all['televendas'].style.visibility = "visible"; else document.all['televendas'].style.visibility = "hidden" } } function InitializeTimer() { secs = 5; StopTheClock(); StartTheTimer() } function StopTheClock() { if (timerRunning) clearTimeout(timerID); timerRunning = false } function StartTheTimer() { if (secs == 0) { StopTheClock(); if (isDOM) { document.getElementById('evaluationMessage').className = "invisiblediv" } else if (isN4) { document.layers['evaluationMessage'].className = "invisiblediv" } else if (isIE) { document.all['evaluationMessage'].className = "invisiblediv" } ShowMetadataGroup(7, '') } else { if (secs < 4) { if (isDOM) { document.getElementById('evaluationMessage').className = "bg_conteudo_info_detalhe arial_12_cinza_escuro_bold"; document.getElementById('lnkEvaluation').href = "#" } else if (isN4) { document.layers['evaluationMessage'].className = "bg_conteudo_info_detalhe arial_12_cinza_escuro_bold"; document.layers['lnkEvaluation'].href = "#" } else if (isIE) { document.all['evaluationMessage'].className = "bg_conteudo_info_detalhe arial_12_cinza_escuro_bold"; document.all['lnkEvaluation'].href = "#" } } secs = secs - 1; timerRunning = true; timerID = self.setTimeout("StartTheTimer()", delay) } }
