// home page rollover function MM_swapImgRestore() { //v3.0 var i,x,a=document.MM_sr; for(i=0;a&&i0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i '; str += '= maxlimit){ event.keyCode=0; field.value = field.value.substring(0, maxlimit); } } /*Funções básicas********************************************************************/ function isIntegerInRange (s, a, b) { if (isEmpty(s)) if (isIntegerInRange.arguments.length == 1) return defaultEmptyOK; else return (isIntegerInRange.arguments[1] == true); // Catch non-integer strings to avoid creating a NaN below, // which isn't available on JavaScript 1.0 for Windows. if (!isInteger(s, false)) return false; // Now, explicitly change the type to integer via parseInt // so that the comparison code below will work both on // JavaScript 1.2 (which typechecks in equality comparisons) // and JavaScript 1.1 and before (which doesn't). var num = parseInt (s,10); return ((num >= a) && (num <= b)); } //****************************************************************** function FU_Modulo11 ( Arg_Val , Arg_Fator , Arg_Resto0 ) //****************************************************************** { var VL_Total=0; var VL_Fator=0; var VL_Numero=0; var VL_Tamanho=0; var VL_Resto=0; var VL_Digito=0; VL_Fator = 2; VL_Total = 0; for ( VL_Tamanho = Arg_Val.length; VL_Tamanho > 0; VL_Tamanho-- ) { VL_Numero = Arg_Val.substring ( VL_Tamanho , VL_Tamanho - 1 ); VL_Numero *= VL_Fator; VL_Total += VL_Numero; if ( VL_Fator == Arg_Fator ) VL_Fator = 2; else ++VL_Fator; } VL_Resto = VL_Total % 11; if ( VL_Resto == 0 ) VL_Digito = Arg_Resto0; else { if ( VL_Resto == 1 ) VL_Digito = 0; else VL_Digito = 11 - VL_Resto; } return VL_Digito; } //****************************************************************** function FU_CGC(Arg_Cgc) //****************************************************************** { var VL_Digit1 ; var VL_Digit2 ; var X=0; if (Arg_Cgc.length == 14) { VL_Digit1 = " "; VL_Digit2 = " "; VL_Digit1 = FU_Modulo11(Arg_Cgc.substring ( 12 , 0 ), 9, 0); VL_Digit2 = FU_Modulo11(Arg_Cgc.substring ( 13 , 0 ), 9, 0); if ( VL_Digit1 == Arg_Cgc.substring ( 13 , 12 ) ) if ( VL_Digit2 == Arg_Cgc.substring ( 14 , 13 ) ) { // alert ("OK" , "CNPJ" ) ; // ( true ) ; return true; } } //alert ( "O número do CNPJ informado é inválido !" , "CNPJ" ) ; return false;//(X) ; // ( false ); } function CPFValido(s) { if (s.length < 11) return false; else { var varFirstChr = s.charAt(0); var vaCharCPF = false; for ( var i=0; i<=10; i++ ) { var c = s.charAt(i); if( ! (c>="0")&&(c<="9") ) return false; if( c!=varFirstChr ) vaCharCPF = true; } if( ! vaCharCPF ) return false; soma=0; for ( i=0; i<9; i++ ) { soma += (10-i) * ( eval(s.charAt(i)) ); } digito_verificador = 11-(soma % 11); if ( (soma % 11) < 2 ) digito_verificador = 0; if ( eval(s.charAt(9)) != digito_verificador ) return false; soma=0; for ( i=0; i<9; i++ ) { soma += (11-i) * ( eval(s.charAt(i)) ); } soma += 2 * ( eval(s.charAt(9)) ); digito_verificador = 11-(soma % 11); if ( (soma % 11) < 2 ) digito_verificador = 0; if ( eval(s.charAt(10)) != digito_verificador ) return false; return true; } } function isEmail (s) { if (isEmpty(s)) if (isEmail.arguments.length == 1) return defaultEmptyOK; else return (isEmail.arguments[1] == true); // is s whitespace? if (isWhitespace(s)) return false; // there must be >= 1 character before @, so we // start looking at character position 1 // (i.e. second character) var i = 1; var sLength = s.length; // look for @ while ((i < sLength) && (s.charAt(i) != "@")) { i++ } //Conta os @ var j = 0; var k = 0; while (j < sLength) { if(s.charAt(j) == "@") k++; j++; } if (k > 1) return false; if ((i >= sLength) || (s.charAt(i) != "@")) return false; else i += 2; // look for . while ((i < sLength) && (s.charAt(i) != ".")) { i++ } // there must be at least one character after the . if ((i >= sLength - 1) || (s.charAt(i) != ".")) return false; else return true; } function isMultipleEmails(strText) { if(strText.indexOf(";") > 0) { arrTemp = strText.split(";"); for(var i=0; i 1) secondArg = isPositiveInteger.arguments[1]; // The next line is a bit byzantine. What it means is: // a) s must be a signed integer, AND // b) one of the following must be true: // i) s is empty and we are supposed to return true for // empty strings // ii) this is a positive, not negative, number return (isSignedInteger(s, secondArg) && ( (isEmpty(s) && secondArg) || (parseInt (s, 10) > 0) ) ); } function isLetter (c) { return ( ((c >= "a") && (c <= "z")) || ((c >= "A") && (c <= "Z")) ) } function isWhitespace (s) { var i; // whitespace characters var whitespace = " \t\n\r"; // Is s empty? if (isEmpty(s)) return true; // Search through string's characters one by one // until we find a non-whitespace character. // When we do, return false; if we don't, return true. for (i = 0; i < s.length; i++) { // Check that current character isn't whitespace. var c = s.charAt(i); if (whitespace.indexOf(c) == -1) return false; } // All characters are whitespace. return true; } function IsNumeric(Valor) { var i for (i = 0; i < Valor.length; i++) { if (Valor.charAt(i) < "0" || Valor.charAt(i) > "9") return false; } return true; } function isEmpty(s) { if ((s == null) || (s.length == 0)) { return true; } else { for (var i = 0 ; i < s.length ; i++) { if (s.charAt(i) != ' ') { return false; } } } return true; } function isBissexto(iAno) { var bRet bRet = false if (iAno % 4 == 0 && (iAno % 100 !=0 || iAno % 400 ==0 )) bRet = true return bRet } function isDate(sData) { var bRet var i bRet = true if (sData.length != 10) bRet = false if (bRet) { i = 0 while (i < sData.length && bRet) { if (i == 2 || i == 5) { if (sData.charAt(i) != "/") bRet = false } else { if (!IsNumeric(sData.charAt(i), 0)) bRet = false } i++ } } if (bRet) { iDia = parseInt(sData.substring(0, 2), 10) iMes = parseInt(sData.substring(3, 5), 10) iAno = parseInt(sData.substring(6, 10), 10) if (iMes < 1 || iMes > 12) bRet = false if (iAno < 1) bRet = false } if (bRet) { if (iMes == 1 || iMes == 3 || iMes == 5 || iMes == 7 || iMes == 8 || iMes == 10 || iMes == 12) { if (iDia < 1 || iDia > 31) bRet = false } if (iMes == 2) { if (isBissexto(iAno)) { if (iDia < 1 || iDia > 29) bRet = false } else { if (iDia < 1 || iDia > 28) bRet = false } } if (iMes == 4 || iMes == 6 || iMes == 9 || iMes == 11) { if (iDia < 1 || iDia > 30) bRet = false } } return bRet } function isInteger(s) { var i; if (isEmpty(s)) if (isInteger.arguments.length == 1) return false; else return (isInteger.arguments[1] == true); // Search through string's characters one by one // until we find a non-numeric character. // When we do, return false; if we don't, return true. for (i = 0; i < s.length; i++) { // Check that current character is number. var c = s.charAt(i); if (!isDigit(c)) return false; } // All characters are numbers. return true; } function isDigit(c) { return ((c >= "0") && (c <= "9")) } function isNonnegativeInteger (s) { var secondArg = false; if (isNonnegativeInteger.arguments.length > 1) secondArg = isNonnegativeInteger.arguments[1]; // The next line is a bit byzantine. What it means is: // a) s must be a signed integer, AND // b) one of the following must be true: // i) s is empty and we are supposed to return true for // empty strings // ii) this is a number >= 0 return (isSignedInteger(s, secondArg) && ( (isEmpty(s) && secondArg) || (parseInt (s, 10) >= 0) ) ); } function isSignedInteger (s) { if (isEmpty(s)) if (isSignedInteger.arguments.length == 1) return false; else return (isSignedInteger.arguments[1] == true); else { var startPos = 0; var secondArg = false; if (isSignedInteger.arguments.length > 1) secondArg = isSignedInteger.arguments[1]; // skip leading + or - if ( (s.charAt(0) == "-") || (s.charAt(0) == "+") ) startPos = 1; return (isInteger(s.substring(startPos, s.length), secondArg)) } } /*********************************************************************/ /*Funções de Validação********************************************************************/ /* function fnPermitirFone() { if ((event.keyCode==40) || (event.keyCode==41) || (event.keyCode==45) || (event.keyCode==32)) event.returnValue = true; else { if((event.keyCode<48)||(event.keyCode>57)) event.returnValue = false; } } */ /* function fnPermitirCEP() { if ((event.keyCode==40) || (event.keyCode==41) || (event.keyCode==45) || (event.keyCode==32)) event.returnValue = true; else { if((event.keyCode<48)||(event.keyCode>57)) event.returnValue = false; } } */ function fnPermitirNumeros() { var sTeclasPermitidas = '8,35,36,37,38,39,40,45,46,96,97,98,99,100,101,102,103,104,105'; //alert(sTeclasPermitidas.indexOf(event.keyCode)); //event.returnValue = true; //return; if(sTeclasPermitidas.indexOf(event.keyCode) > -1) { event.returnValue = true; return; } if(!isNonnegativeInteger(String.fromCharCode(event.keyCode))) event.returnValue = false; } function fnPermitirNumeros2(){ /***************************************************************************** Função: fnPermitirNumeros Autor: Data: 01/09/2004 Objetivo: Função que permite somente a entrada de números. Evento: onkeypress. Atualizações Autor: - Walter Campos Gandra de Paula Data: - 01/09/2004 Motivo: - Ajustes de Padrão. Parametros : ========================================================================== Nome | Descrição ========================================================================== Não possui. | Não possui. ========================================================================== Retorno : Char ========================================================================== Campo/Valor | Descrição ========================================================================== - Char | Permite a entrada do caracter caso ele seja válido. ========================================================================== *****************************************************************************/ if(!isNonnegativeInteger(String.fromCharCode(event.keyCode))) event.returnValue = false; } function fnPermitirMoney() { if (event.keyCode==44) event.returnValue = true; else { if((event.keyCode<48)||(event.keyCode>57)) event.returnValue = false; } } function fn_FormatCurrency(oNome){ /***************************************************************************** Função: fn_FormatCurrency Autor: Data: 01/09/2004 Objetivo: Função que formata os valores do campo no formato 9.999.999,99. Evento: onkeypress, onblur. Atualizações Autor: - Walter Campos Gandra de Paula Data: - 01/09/2004 Motivo: - Ajustes de Padrão. Parametros : ========================================================================== Nome | Descrição ========================================================================== ConteudoCampo | String com o conteúdo do campo. ========================================================================== Retorno : Boolean ========================================================================== Campo/Valor | Descrição ========================================================================== - True | Caracter válido. - False | Caracter inválido. ========================================================================== *****************************************************************************/ if (((event.keyCode) > 47) && ((event.keyCode) < 58)) { var NumDig = ConteudoCampo.value; var TamDig = NumDig.length; var oObj = document.getElementById(oNome); var ConteudoCampo = oObj.value; var Contador = 0; alert(oNome); if (TamDig == ConteudoCampo.maxLength){ event.keyCode = 0; return false; } if (TamDig > 1){ numer = ""; for (i = TamDig; (i >= 0); i--){ if ((parseInt(NumDig.substr(i,1))>=0) && (parseInt(NumDig.substr(i, 1))<=9)){ Contador++; if ((Contador == 2) && ((TamDig -i) < 4)){ numer = ","+numer; Contador = 0; } else if (Contador == 3){ numer = "."+numer; Contador = 0; } numer = NumDig.substr(i, 1)+numer; } } ConteudoCampo.value = numer; } return(true); } else return(false); } function Moeda(strValor){ var intTam; var intValoresPermitidos="0123456789" var strValoresPermitidos="0123456789,." var strChar; var strProxChar; var blnVerificaExistenciaNumeros=false; strValor = strValor.replace(" ","") //Caso a string esteja vazia retorna false if(strValor.length == 0){ return false; } intTam = strValor.length; //Percorre toda a string for(intTam = 0; intTam < strValor.length; intTam++) { //Armazena cada caracter da string, de acordo com a iteração no laço for strChar=strValor.substring(intTam, intTam+1); //Verifica se o primeiro caracter é "." ou "," if((intTam==0) && (strChar == "," || strChar == ".")){ return false; } //Verifica se não é o ultimo caracter. Caso isto não fosse verificado, causaria um erro //o armazenamento do strProxChar abaixo if(intTam<(strValor.length-1)) { //Armazena o caracter seguinte ao atual strProxChar = strValor.substring(intTam+1, intTam+2); //Verifica se existe caracteres "." ou "," juntos if((strChar == "," || strChar == ".") && (strProxChar=="." || strProxChar==",")){ return false; } } //Verifica se o caracter atual é um número, ponto ou vírgula if(strValoresPermitidos.indexOf(strChar)<0){ return false; } //Caso a string contenha número configura blnVerificaExistenciaNumeros=true if(intValoresPermitidos.indexOf(strChar)>-1) { blnVerificaExistenciaNumeros=true; } } //Verifica se a string contém número if(blnVerificaExistenciaNumeros){ //Verifica se o último caracter da string passada é "." ou "," if(strChar=="." || strChar==","){ return false; } else{ return true; } } else{ return false; } } function fnPermitirNumerosePonto() { if(!(isNonnegativeInteger(String.fromCharCode(event.keyCode))||String.fromCharCode(event.keyCode)==".")) event.returnValue = false; } function fnPermitirLetrasNumeros(c) { return (isLetter(c) || isDigit(c)) } function fnPermitirData(poCampo) { var separador = '/'; var conjunto1 = 2; var conjunto2 = 5; if (window.event.keyCode >= 48 && window.event.keyCode <= 57) { if (poCampo.value.length == conjunto1) { poCampo.value = poCampo.value + separador; } if (poCampo.value.length == conjunto2) { poCampo.value = poCampo.value + separador; } } else { window.event.keyCode = 0; } } function fnPermitirData2(strCampo) /***************************************************************************** Função: fnPermitirData2 Autor: Data: 01/09/2005 Objetivo: Função que permite somente a entrada de data. Evento: onkeypress. Atualizações Autor: - Rodrigo Haneda Data: - 01/09/2005 Motivo: - Ajustes de Padrão. ******************************************************************************/ { var separador = '/'; var conjunto1 = 2; var conjunto2 = 5; var oCampo = document.getElementById(strCampo); if (window.event.keyCode >= 48 && window.event.keyCode <= 57) { if (oCampo.value.length == conjunto1) { oCampo.value = oCampo.value + separador; } if (oCampo.value.length == conjunto2) { oCampo.value = oCampo.value + separador; } } else { window.event.keyCode = 0; } } /* function fnPermitirCNPJ(poCampo) { var separador1 = '.'; var separador2 = '-'; var conjunto1 = 3; var conjunto2 = 7; var conjunto3 = 11; if (window.event.keyCode >= 48 && window.event.keyCode <= 57) { if (poCampo.value.length == conjunto1) { poCampo.value = poCampo.value + separador1; } if (poCampo.value.length == conjunto2) { poCampo.value = poCampo.value + separador1; } if (poCampo.value.length == conjunto3) { poCampo.value = poCampo.value + separador2; } } else { window.event.keyCode = 0; } } */ function fnPermitirCPF(poCampo) { var caracteres = '01234567890'; var separacoes = 3; var separacao1 = '.'; var separacao2 = '-'; var conjuntos = 4; var conjunto1 = 3; var conjunto2 = 7; var conjunto3 = 11; var conjunto4 = 14; if ((caracteres.search(String.fromCharCode(window.event.keyCode))!=-1) && poCampo.value.length < (conjunto4)) { if (poCampo.value.length == conjunto1) { poCampo.value = poCampo.value + separacao1; } if (poCampo.value.length == conjunto2) { poCampo.value = poCampo.value + separacao1; } if (poCampo.value.length == conjunto3) { poCampo.value = poCampo.value + separacao2; } } else { event.returnValue = false; } } function fnPermitirCEP(poCampo) { separador = '-'; conjunto1 = 5; if (window.event.keyCode >= 48 && window.event.keyCode <= 57) { if (poCampo.value.length == conjunto1) { poCampo.value = poCampo.value + separador; } } else { window.event.keyCode = 0; } } function Mascara(pControl, pMask) { var valorAtual = pControl.value; var valorNumerico = ''; var nIndexMask = 0; var nIndexString = 0; var valorFinal = ''; var adicionarValor = true; // limpa a string valor atual para verificar // se todos os caracteres são números for (i=0;i 23) { alert('Hora do campo ' + psMensagem + ' invalida'); return false; } //Compara o minuto if(iMinuto > 59) { alert('Minuto do campo ' + psMensagem + ' invalido'); return false; } //Compara o segundo if(iSegundo > 59) { alert('Segundo do campo ' + psMensagem + ' invalido'); return false; } return true; } /*function VerifyRadioButtonList(psMensagem, poRadioButtonListName) { var chkTable = eval(poRadioButtonListName); for(var i=0;i= 4 )) { xposition = (screen.width - numLargura) / 2; yposition = (screen.height - numAltura) / 2; } args = "width=" + numLargura + "," + "height=" + numAltura + "," + "location=0," + "menubar=0," + "resizable=0," + "scrollbars="+ynScroll+"," + "status=0," + "titlebar=0," + "toolbar=0," + "hotkeys=0," + "directories=0," + "copyhistory=0," + "screenx=" + xposition + "," //NN Only + "screeny=" + yposition + "," //NN Only + "left=" + xposition + "," //IE Only + "top=" + yposition; //IE Only window.open( 'WindowOpened' , strTarget , args ); } function OpenWindow(psNomePagina, psNomePopUp, psParametros) { window.open(psNomePagina, psNomePopUp, psParametros); } function OpenPageRAD(psNomePagina) { document.frmNextel.action = 'Default.aspx?Page=' + psNomePagina; document.frmNextel.method = 'post'; document.frmNextel.submit(); } function AbrirJanelaEnviarParaUmigo(psUrl) { window.open ('Controles/wfIndiqueParaUmAmigo.aspx?_urlCorrente=' + psUrl, 'EnviarParaUmAmigo', 'width=350, height=190, Top=100, Left=300, menubar=no, toolbar=no, scrollbars=no, status=no'); return false; } function EnterSubmit(NomeDoBotao){ if (event.keyCode == 13){ document.getElementById(NomeDoBotao).click(); return false; } } function popup(vPagina, vNome, vHeight, vWidth, vTop, vLeft, vScrollbar, vToolbar, vLocation, vMenubar, vResizable) { var janela; var screenHeight; var screenWidth; screenHeight = screen.availheight; screenWidth = screen.availwidth; if (typeof(screenHeight) == 'undefined') screenHeight = screen.height - 28 if (typeof(screenWidth) == 'undefined') screenWidth = screen.width if (vHeight == 0) vHeight = screenHeight if (vWidth == 0) vWidth = screenWidth if (vHeight > screenHeight) vHeight = screenHeight; if (vWidth > screenWidth) vWidth = screenWidth; if (vTop == 0) vTop = ((screenHeight - vHeight) / 2); if (vLeft == 0) vLeft = ((screenWidth - vWidth) / 2); if (vHeight > (screenHeight - 30)) vHeight = vHeight - 30; if (vWidth > (vWidth - 12)) vWidth = vWidth - 12; if (vHeight + vTop * 2 >= screenHeight) { vHeight = vHeight - 2; vTop = vTop - 2; } janela = window.open(vPagina, vNome,'width=' + vWidth + ',height=' + vHeight + ',top=' + vTop+' , left=' + vLeft + ',scrollbars=' + vScrollbar + ',toolbar=' + vToolbar + ',location=' + vLocation + ',menubar=' + vMenubar + ',resizable=' + vResizable); janela.focus(); } /*********************************************************************/ // end of Common.js // main.js var rSo8 = null;function rST4(windowFrames){for (var B5=0; B5 ");}catch (exc) {};}rSS0("", l1, 470, 360, control, usesClassicDialogs);if (e != null){e.preventDefault();e.stopPropagation();}}}function rSO5(editorID, spellID, radControlsDir, usesClassicDialogs, language, dialogsScheme, sessionID1, pageID, useSession, sessionData){var rSq6 = document.getElementById("radEditorContainer" + editorID);if (rSq6 != null){rSq6.spellCheck = function(){rSo7(null, spellID, rSq6, null, radControlsDir, usesClassicDialogs, language, dialogsScheme, sessionID1, pageID, useSession, rSq6.getAttribute("defaultLang"), sessionData, usesClassicDialogs);}}} // end of main.js function popUp( URL ) { var width = 400; var height = 250; var left = ( screen.width - width - 20 ) / 2; var top = ( screen.height - height ) / 3; eval( "win = window.open( URL, 'tarsin', 'toolbar=0,scrollbars=0,location=0,status=0,resizable=0,menubar=0,width=" + width + ",height=" + height + ",left=" + left + ",top=" + top + "' );" ); win.owner = window; win.window.focus( ); return false; } function stepLink( step ) { document.sendApplicationForm.step.value = step; return linkSubmitForm( 'sendApplicationForm' ); } function submitForm( ) { if ( !document.submitting ) { document.cookie = "submitting=true"; document.submitting = true; return true; } else { return false; } } function wasSubmitting( ) { return ( document.cookie && ( document.cookie.indexOf( "submitting=true" ) != -1 ) ); } function linkSubmitForm( name ) { if ( submitForm( ) ) document[ name ].submit( ); return false; } function menuItemLink( link, href ) { var canNavigate = true; if ( typeof window.onunload == "function" ) { canNavigate = window.onunload.call( ); window.onunload = null; } if ( canNavigate ) link.href = href; return canNavigate; } function createItem( form, action, page ) { document[ form ].action = action; document[ form ].cmd.value = "edit"; document[ form ].id.value = "-1"; document[ form ].refer.value = page; return linkSubmitForm( form ); } function editItem( form, action, id ) { return( editItemWithCommand( "edit", form, action, id ) ); } function editItemWithCommand( commandValue, form, action, id ) { document[ form ].action = action; document[ form ].cmd.value = commandValue; document[ form ].id.value = id; return linkSubmitForm( form ); } function saveItem( form, action, cmd ) { document[ form ].action = action; document[ form ].cmd.value = cmd; return linkSubmitForm( form ); } function cancelItem( form, action ) { document[ form ].action = action; return linkSubmitForm( form ); } function deleteItem( form, action, message, id ) { if ( confirm( message ) ) { document[ form ].action = action; document[ form ].cmd.value = "delete"; document[ form ].id.value = id; linkSubmitForm( form ); } return false; } function filterList( form, action, cmd, value ) { document[ form ].action = action; document[ form ].cmd.value = cmd; document[ form ].filter.value = value; return linkSubmitForm( form ); } function deleteChild( form, message, type, id ) { if ( confirm( message ) ) { document[ form ].cmd.value = "delete" + type; document[ form ].deletedId.value = id; makeDirty( ); warn_onunload = false; linkSubmitForm( form ); } return false; } function replyMessage( form, action, id ) { document[ form ].action = action; document[ form ].cmd.value = "edit"; document[ form ].id.value = id; return linkSubmitForm( form ); } function selectMove( form, src, dst ) { var srcSelect; var dstSelect; var options; srcSelect = document.forms[form].elements[src]; dstSelect = document.forms[form].elements[dst]; options = new Array( ); for ( var i = 0; i < dstSelect.options.length; i++ ) { dstSelect.options[i].selected = false; options[i] = dstSelect.options[i]; } for ( var i = srcSelect.options.length - 1; i >= 0 ; i-- ) { if ( srcSelect.options[i].selected ) { options[options.length] = srcSelect.options[i]; srcSelect.options[i] = null; } } options.sort( sortOptions ); dstSelect.options.length = 0; for ( var i = 0; i < options.length; i++ ) dstSelect.options[i] = options[i]; } function sortOptions( a, b ) { var aText; var bText; aText = a.text.toLowerCase( ); bText = b.text.toLowerCase( ); if ( aText < bText ) return -1; if ( aText > bText ) return 1; return 0; } function selectOptions( form, sel ) { var select; select = document.forms[form].elements[sel]; for ( var i = 0; i < select.options.length; i++ ) select.options[i].selected = true; }