//v1.7 // Flash Player Version Detection // Detect Client Browser type // Copyright 2005-2007 Adobe Systems Incorporated. All rights reserved. var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false; var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false; var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false; function ControlVersion() { var version; var axo; var e; // NOTE : new ActiveXObject(strFoo) throws an exception if strFoo isn't in the registry try { // version will be set for 7.X or greater players axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7"); version = axo.GetVariable("$version"); } catch (e) { } if (!version) { try { // version will be set for 6.X players only axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6"); // installed player is some revision of 6.0 // GetVariable("$version") crashes for versions 6.0.22 through 6.0.29, // so we have to be careful. // default to the first public version version = "WIN 6,0,21,0"; // throws if AllowScripAccess does not exist (introduced in 6.0r47) axo.AllowScriptAccess = "always"; // safe to call for 6.0r47 or greater version = axo.GetVariable("$version"); } catch (e) { } } if (!version) { try { // version will be set for 4.X or 5.X player axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3"); version = axo.GetVariable("$version"); } catch (e) { } } if (!version) { try { // version will be set for 3.X player axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3"); version = "WIN 3,0,18,0"; } catch (e) { } } if (!version) { try { // version will be set for 2.X player axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash"); version = "WIN 2,0,0,11"; } catch (e) { version = -1; } } return version; } // JavaScript helper required to detect Flash Player PlugIn version information function GetSwfVer(){ // NS/Opera version >= 3 check for Flash plugin in plugin array var flashVer = -1; if (navigator.plugins != null && navigator.plugins.length > 0) { if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) { var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : ""; var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description; var descArray = flashDescription.split(" "); var tempArrayMajor = descArray[2].split("."); var versionMajor = tempArrayMajor[0]; var versionMinor = tempArrayMajor[1]; var versionRevision = descArray[3]; if (versionRevision == "") { versionRevision = descArray[4]; } if (versionRevision[0] == "d") { versionRevision = versionRevision.substring(1); } else if (versionRevision[0] == "r") { versionRevision = versionRevision.substring(1); if (versionRevision.indexOf("d") > 0) { versionRevision = versionRevision.substring(0, versionRevision.indexOf("d")); } } var flashVer = versionMajor + "." + versionMinor + "." + versionRevision; } } // MSN/WebTV 2.6 supports Flash 4 else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4; // WebTV 2.5 supports Flash 3 else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3; // older WebTV supports Flash 2 else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2; else if ( isIE && isWin && !isOpera ) { flashVer = ControlVersion(); } return flashVer; } // When called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision) { versionStr = GetSwfVer(); if (versionStr == -1 ) { return false; } else if (versionStr != 0) { if(isIE && isWin && !isOpera) { // Given "WIN 2,0,0,11" tempArray = versionStr.split(" "); // ["WIN", "2,0,0,11"] tempString = tempArray[1]; // "2,0,0,11" versionArray = tempString.split(","); // ['2', '0', '0', '11'] } else { versionArray = versionStr.split("."); } var versionMajor = versionArray[0]; var versionMinor = versionArray[1]; var versionRevision = versionArray[2]; // is the major.revision >= requested major.revision AND the minor version >= requested minor if (versionMajor > parseFloat(reqMajorVer)) { return true; } else if (versionMajor == parseFloat(reqMajorVer)) { if (versionMinor > parseFloat(reqMinorVer)) return true; else if (versionMinor == parseFloat(reqMinorVer)) { if (versionRevision >= parseFloat(reqRevision)) return true; } } return false; } } function AC_AddExtension(src, ext) { if (src.indexOf('?') != -1) return src.replace(/\?/, ext+'?'); else return src + ext; } function AC_Generateobj(objAttrs, params, embedAttrs) { var str = ''; if (isIE && isWin && !isOpera) { str += ' '; } str += ''; } else { str += ''); } /* PATROCÍNIOS COMPETICAO */ function competicaoPatrocinios (ID,GERAL,WHAT) { if ( WHAT == 'OPEN' ) { document.getElementById(ID).style.display = "block"; document.getElementById(GERAL).style.display = "none"; } else if ( WHAT == 'CLOSE') { document.getElementById(ID).style.display = "none"; document.getElementById(GERAL).style.display = "block"; } } /* IMGS */ function galeria(ID,WHAT) { if ( WHAT == 'OVER' ) { document.getElementById(ID).className = "galeria select"; } else if ( WHAT == 'OUT') { document.getElementById(ID).className = "galeria"; } } function goodies(ID,WHAT) { if ( WHAT == 'OVER' ) { document.getElementById(ID).className = "goodies select"; } else if ( WHAT == 'OUT') { document.getElementById(ID).className = "goodies"; } } function acessorios(ID,WHAT) { if ( WHAT == 'OVER' ) { document.getElementById(ID).className = "item select"; } else if ( WHAT == 'OUT') { document.getElementById(ID).className = "item"; } } function cores(ID,WHAT) { if ( WHAT == 'OVER' ) { document.getElementById(ID).className = "cores select"; } else if ( WHAT == 'OUT') { document.getElementById(ID).className = "cores"; } } /* MENUS */ function menu(ID,WHAT) { if ( WHAT == 'OVER' ) { document.getElementById(ID).className = "area_menu select"; } else if ( WHAT == 'OUT') { document.getElementById(ID).className = "area_menu"; } } function submenu(ID,WHAT) { if ( WHAT == 'OVER' ) { document.getElementById(ID).className = "submenu select"; } else if ( WHAT == 'OUT') { document.getElementById(ID).className = "submenu"; } } /* ÁREAS */ /*function areaItem(ID,WHAT) { if ( WHAT == 'OVER' ) { document.getElementById(ID).className = "area_modeloSelect"; document.getElementById(ID+'_img').className = "area_imgSelect"; } else if ( WHAT == 'OUT') { document.getElementById(ID).className = "area_modelo"; document.getElementById(ID+'_img').className = "area_img"; } }*/ function areaItem(id) { div = new Array() var n=0; while (document.getElementById("area_item_"+(n+1))!=null){ div[n]="area_item_"+(n+1); n++; } /* div[0] = "area_item_1" div[1] = "area_item_2" div[2] = "area_item_3" div[3] = "area_item_4" div[4] = "area_item_5" div[5] = "area_item_6" div[6] = "area_item_7" div[7] = "area_item_8" div[8] = "area_item_9" div[9] = "area_item_10" div[10] = "area_item_11" */ //alert(div.length); for ( var i = 0; i < div.length; i++) { var modelo_itemSel = document.getElementById(id); var modelo_item = document.getElementById(div[i]); //alert(div[i]); var modelo_item_img = document.getElementById(div[i]+'_img'); if (id != div[i]) { modelo_item.className = "area_modeloNselect"; modelo_item_img.className = "area_imgNselect"; } else if (id == div[i]) { modelo_item_img.className = "area_imgSelect"; modelo_item.className = "area_modeloSelect"; } } } function TEAMitem(ID,EVENT) { if ( EVENT == 'OVER' ) { document.getElementById(ID).className = "team_elementoSelect"; } else if ( EVENT == 'OUT') { document.getElementById(ID).className = "team_elementoNselect"; } } function openPesquisaAvancada (ID) { document.getElementById(ID).style.display = "block"; document.getElementById(ID+'_btn').style.display = "none"; } function areaItemOut(id) { div = new Array() var n=0; while (document.getElementById("area_item_"+(n+1))!=null){ div[n]="area_item_"+(n+1); n++; } for ( var i = 0; i < div.length; i++) { document.getElementById(div[i]).className = "area_modelo"; document.getElementById(div[i]+'_img').className= "area_img"; /* alert(div[i] + 'oiouo');*/ } } /*abrir pop up comparaçao produtos*/ function open_win_compara(id,area) { window.open("/comparar.asp?id=" + id + "&area=" + area ,"_blank","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, copyhistory=yes, width=660, height=770"); } function open_win_recomenda(id) { window.open("/pop_recomendar.asp?id=" + id,"_blank","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, copyhistory=yes, width=490, height=460"); } function open_win_imprime(id) { window.open("/produto_print.asp?id=" + id,"_blank","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, copyhistory=yes, width=740, height=770"); } function imprime() { window.print(); } function popIcons(id) { centeredPopup("/inc/pop_icons.asp?id=" + id,"a",300,400,""); } /* Function To Make The Pop Up Windows *************/ function centeredPopup(mypage,myname,w,h,features) { /*if(screen.width){ var winl = (screen.width-w)/2; var wint = (screen.height-h)/2; }else{winl = 0;wint =0;} if (winl < 0) winl = 0; if (wint < 0) wint = 0; var settings = 'height=' + h + ','; settings += 'width=' + w + ','; settings += 'top=' + wint + ','; settings += 'left=' + winl + ','; settings += features; win = window.open(mypage,myname,settings); */ window.open(mypage,myname,'scrollbars=auto,menubar=no,' + h + ',' + w +',resizable=no,toolbar=no,location=no,status=no'); } function popWallpaper(id,file) { centeredPopup("pop_wallp.asp?id=" + id + "&file=" +file,"a","width=460","height=510",""); } function popWallpaperCompeticao(type) { centeredPopup("pop_wallp_competicao.asp?t=" + type,"a","width=460","height=510",""); } function checkEmail(str) { var at = "@" var dot = "." var lat = str.indexOf(at) var lstr = str.length var ldot = str.indexOf(dot) if (str.indexOf(at) == -1) { return false } if (str.indexOf(at) == -1 || str.indexOf(at) == 0 || str.indexOf(at) == lstr) { return false } if (str.indexOf(dot) == -1 || str.indexOf(dot) == 0 || str.indexOf(dot) == lstr) { return false } if (str.indexOf(at, (lat + 1)) != -1) { return false } if (str.substring(lat - 1, lat) == dot || str.substring(lat + 1, lat + 2) == dot) { return false } if (str.indexOf(dot, (lat + 2)) == -1) { return false } if (str.indexOf(" ") != -1) { return false } return true } function trim(str, chars) { return ltrim(rtrim(str, chars), chars); } function ltrim(str, chars) { chars = chars || "\\s"; return str.replace(new RegExp("^[" + chars + "]+", "g"), ""); } function rtrim(str, chars) { chars = chars || "\\s"; return str.replace(new RegExp("[" + chars + "]+$", "g"), ""); } //alert("teste"); var Input = { initialize: function() { if(document.getElementsByTagName("form")) { var divs = document.getElementsByTagName("div"); for(var i = 0; i < divs.length; i++) { if(divs[i].className.match("checkbox") || divs[i].className.match("checkbox2") || divs[i].className.match("radio2") || divs[i].className.match("radio")) { divs[i].onmousedown = Input.effect; divs[i].onmouseup = Input.handle; window.onmouseup = Input.clear; } } } }, effect: function() { if(this.className == "checkbox" || this.className == "checkbox2" || this.className == "radio2" || this.className == "radio") { this.style.backgroundPosition = "0 0px"; } else { this.style.backgroundPosition = "0 0px"; } }, handle: function() { selector = this.getElementsByTagName("input")[0]; if(this.className == "checkbox") { selector.checked = true; this.className = "checkbox selected"; this.style.backgroundPosition = "0 0px"; } else if(this.className == "checkbox selected") { selector.checked = false; this.className = "checkbox"; this.style.backgroundPosition = "0 0"; //*** ***// } else if(this.className == "checkbox2") { selector.checked = true; this.className = "checkbox2 selected2"; this.style.backgroundPosition = "0 0px"; } else if(this.className == "checkbox2 selected2") { selector.checked = false; this.className = "checkbox2"; this.style.backgroundPosition = "0 0"; //*** ***// } else if(this.className == "radio2" || this.className == "radio2 selected2") { selector.checked = true; this.className = "radio2 selected2"; this.style.backgroundPosition = "0 0px"; inputs = document.getElementsByTagName("input"); for(i = 0; i < inputs.length; i++) { if(inputs[i].getAttribute("name") == selector.getAttribute("name")) { if(inputs[i] != selector) { inputs[i].parentNode.className = "radio2"; inputs[i].parentNode.style.backgroundPosition = "0 0"; } } } //*** ***// } else { selector.checked = true; this.className = "radio selected"; this.style.backgroundPosition = "0 0px"; inputs = document.getElementsByTagName("input"); for(i = 0; i < inputs.length; i++) { if(inputs[i].getAttribute("name") == selector.getAttribute("name")) { if(inputs[i] != selector) { inputs[i].parentNode.className = "radio"; inputs[i].parentNode.style.backgroundPosition = "0 0"; } } } } }, clear: function() { divs = document.getElementsByTagName("div"); for(var i = 0; i < divs.length; i++) { if(divs[i].className == "checkbox" || divs[i].className == "checkbox2" || divs[i].className == "radio2" || divs[i].className == "radio") { divs[i].style.backgroundPosition = "0 0"; } else if(divs[i].className == "checkbox selected" || divs[i].className == "checkbox2 selected2" || divs[i].className == "radio2 selected2" || divs[i].className == "radio selected") { divs[i].style.backgroundPosition = "0 0px"; } } } } window.onload = Input.initialize;