var buscadorAvanzado_url = "/masqueaire/servlet/BuscadorAvanzado_srv"; var buscadorLittle_url = "/masqueaire/servlet/BuscadorLittle_srv"; var comparativa_url = "/masqueaire/servlet/Comparativa_srv"; var shoppingcart_url = "/masqueaire/servlet/ShoppingCart_srv"; var simpleSearch_url = "/masqueaire/servlet/SimpleSearch_srv"; var compra_url = "/masqueaire/servlet/Compra_srv"; var cliente_url = "/masqueaire/servlet/Cliente_srv"; var register_url = "/masqueaire/servlet/Register_srv"; var mail_url = "/masqueaire/servlet/Mail_srv"; var SERVLET_BASE = "/masqueaire/"; var SERVLET_XMLInlineLoader = SERVLET_BASE + "servlet/es.krama.services.common.util.XMLInlineLoader"; var URL_USER_LOGON = "/masqueaire/frontend/venta/cliente/srv/logon.jsp"; var URL_USER_HOME = "/masqueaire/frontend/venta/cliente/home.jsp"; var URL_NEW_USER = "/masqueaire/frontend/venta/cliente/new-user.jsp"; var URL_USER_DATA = "/masqueaire/frontend/venta/cliente/home.jsp"; var URL_USER_DISCONNECT = "/masqueaire/frontend/venta/cliente/srv/logout.jsp"; var URL_USER_REMEMBER_PASSWORD = "/masqueaire/frontend/venta/cliente/remember-password.jsp"; var VAR_FILE = "/masqueaire/frontend/shared/file/"; var VAR_HOME_FRONTEND = "/masqueaire/frontend/"; var EMPTY_STRING = ""; var ZERO_STRING = "0"; var SPACE_STRING = " "; var SEPARATOR_DOT = "."; var SEPARATOR_COMMA = ","; var ERR_NOT_A_NUMBER = "El valor no es un número válido"; var SCREEN_DATE = 1; var BBDD_DATE = 2; var SCREEN_DATE_RE = "/\d{2}\/\d{2}\/\d{4}/g"; var BBDD_DATE_RE = "/\d{8}/g"; //LIBGENERAL.JS function leftPad(str, chr, times) { var str2 = new String(EMPTY_STRING); if (str == null) str = EMPTY_STRING; var realTimes = times - str.length; for (var i = 0; i < realTimes; i++) str2 = str2.concat(chr); return (str2.concat(str)); } function rightPad(str, chr, times) { var str2 = new String(EMPTY_STRING); if (str == null) str = EMPTY_STRING; str2 = str2.concat(str); var realTimes = times - str.length; for (var i = 0; i < realTimes; i++) str2 = str2.concat(chr); return str2; } function reverseString(str) { if (str == undefined) return ""; var str2 = new String(EMPTY_STRING); var count = str.length - 1; for (var i = count ; i > -1; i--) { str2 = str2.concat(str.substring(i, i+1)); } return str2; } function replace(str, strReplace, strWith) { var i; var str2 = str; do { i = str2.indexOf(strReplace); if (i > 0) { str2 = str2.substring(0, i) + strWith + str2.substring(i + strReplace.length, str2.length); } else { break; } } while(true); return str2; } function trim(cadena) { return ltrim(rtrim(cadena)); } function ltrim(strvar) { if (strvar == undefined) return ""; var str = strvar; if ( str == EMPTY_STRING ) return EMPTY_STRING; for (var i = 0; i < str.length; i++) { if ( str.substring(0, 1) == SPACE_STRING ) { if (str.length > 1) { str = str.substring(1); } else { str = EMPTY_STRING; } } } return str; } function rtrim(strvar) { if (strvar == undefined) return ""; var str = reverseString(strvar); return reverseString(ltrim(str)); } function greaterThan(varnumber, greaterThan, includeBounds) { var num1 = parseFloat(screen2Number(varnumber)); var num2 = parseFloat(screen2Number(greaterThan)); if (includeBounds) { return ( parseFloat(num1) >= parseFloat(num2) ); } else { return ( parseFloat(num1) > parseFloat(num2) ); } } function lessThan(varnumber, lessThan, includeBounds) { var num1 = parseFloat(screen2Number(varnumber)); var num2 = parseFloat(screen2Number(greaterThan)); if (includeBounds) { return ( parseFloat(num1) <= parseFloat(num2) ); } else { return ( parseFloat(num1) < parseFloat(num2) ); } } function outsideBounds(varnumber, lowerLimit, upperLimit, includeBounds) { if (includeBounds == undefined) { includeBounds = false; } return ( greaterThan(varnumber, upperLimit, includeBounds) || lessThan(varnumber, lowerLimit, includeBounds) ); } function insideBounds(varnumber, lowerLimit, upperLimit, includeBounds) { if (includeBounds == undefined) { includeBounds = false; } return !outsideBounds(varnumber, lowerLimit, upperLimit, includeBounds); } function dateBBDD2Screen(datevar) { if ( datevar.length > 8 ) { return null; } else if ( datevar.match(/\d{8}/g) == null ) { return null; } else { return datevar.substring(6, 10) + "/" + datevar.substring(4, 6) + "/" + datevar.substring(0,4); } } function dateScreen2BBDD(datevar) { if ( datevar.length > 10 ) { return null; } else if ( datevar.match(/\d{2}\/\d{2}\/\d{4}/g) == null ) { return null; } else { return datevar.substring(6) + datevar.substring(3,5) + datevar.substring(0,2); } } function screen2Number(varstrnumber) { var strNumber = trim(varstrnumber); var fNegative = false; if (strNumber == EMPTY_STRING || strNumber == null || strNumber == undefined) return null; if (strNumber.substring(0,1) == "-") { strNumber = strNumber.substring(1); fNegative = true; } var str = reverseString(strNumber); var count = str.length; var chr = null; var decimalSeparator = null; var thousandsSeparator = null; for (var i = 0; i < count; i++) { chr = str.substr(i, 1); if (chr > '9' || chr < '0') { decimalSeparator = chr; break; } } str = strNumber; if (decimalSeparator != null) { if ( decimalSeparator != SEPARATOR_DOT && decimalSeparator != SEPARATOR_COMMA ) { return null; } if (decimalSeparator == SEPARATOR_DOT) { thousandsSeparator = SEPARATOR_COMMA; } else { thousandsSeparator = SEPARATOR_DOT; } } else { decimalSeparator = ","; thousandsSeparator = "."; } str = replace(str, thousandsSeparator, EMPTY_STRING); if (decimalSeparator != SEPARATOR_DOT) { str = replace(str, decimalSeparator, SEPARATOR_DOT); } try { if ( isNaN(str) ) { return null; } } catch (e) { return null; } str = trimZeros(str); if (fNegative) { return "-" + str; } else { return str; } } function trimZeros(varnumber) { //PRIVATE (no invocar) var str = varnumber; while (str.substring(0, 1) == ZERO_STRING) str = str.substring(1); while (str.substring(str.length - 1, str.length) == ZERO_STRING && str.indexOf(SEPARATOR_DOT) > 0 ) str = str.substring(0, str.length - 1); if (str.substring(0, 1) == SEPARATOR_DOT) str = ZERO_STRING.concat(str); if (str.substring(str.length - 1) == SEPARATOR_DOT) str = str.substring(0, str.length - 1); if (str == EMPTY_STRING) return ZERO_STRING; return str; } function number2Screen(varnumber, useThousands, decimalPositions, bRound) { var str = screen2Number(varnumber); if (str == null) { return null; } var fNegative = false; if (str.substring(0,1) == "-") { str = str.substring(1); fNegative = true; } var bEuro = false; if ( bRound != undefined && bRound == true) { bEuro = true; } var i = str.indexOf(SEPARATOR_DOT); var realPart = EMPTY_STRING; var decimalPart = EMPTY_STRING; if (i > 0) { realPart = str.substring(0, i); decimalPart = str.substring(i + 1, str.length); } else { realPart = str; } if (decimalPositions != undefined) { decimalPart = rightPad(decimalPart, ZERO_STRING, decimalPositions); if (bEuro && decimalPart.length > decimalPositions) { var s1 = Math.round( parseFloat( decimalPart.substr(0, decimalPositions) + "." + decimalPart.substring(decimalPositions) ) ); decimalPart = "" + s1; } } if (useThousands) { realPart = reverseString(realPart); var formattedRealPart = EMPTY_STRING; var j = realPart.length; var k = 0; for (i = 0; i < j; i++) { formattedRealPart += realPart.substring(i, i+1); k++; if ( k == 3 && i < j - 1) { formattedRealPart += SEPARATOR_DOT; k = 0; } } realPart = reverseString(formattedRealPart); } if (decimalPart != EMPTY_STRING) { decimalPart = SEPARATOR_COMMA.concat(decimalPart); } if (!fNegative) { return realPart.concat(decimalPart); } else { return "-" + realPart.concat(decimalPart); } } function validateNumber(varnumber, realPositions, decimalPositions) { var str = screen2Number(varnumber); if (str == null) return false; if (str.substring(0,1) == "-") { str = str.substring(1); } var i = str.indexOf(SEPARATOR_DOT); var realPart = EMPTY_STRING; var decimalPart = EMPTY_STRING; if (i > 0) { realPart = str.substring(0, i); decimalPart = str.substring(i + 1, str.length); } else { realPart = str; } return((realPart.length <= realPositions )&& (decimalPart.length <= decimalPositions )); } //Retorna: // -1 - Indefinido // 0 - Entero positivo (Natural) // 1 - Entero (negativo) // 2 - Real positivo // 3 - Real (negativo) function getClassOfNumber(varnumber) { var str = screen2Number(varnumber); if (str == null) return -1; var i = 0; if (str.indexOf(".") > -1) i += 2; if (str.indexOf("-") > -1) i += 1; return "" + i; } function isNegative(varnumber) { var str = getClassOfNumber(varnumber); if ( str == "1" || str == "3" ) return true; return false; } function roundNumber(varnumber, decimalPositions) { var str = screen2Number(varnumber); if (str == null) return null; if (decimalPositions == undefined) decimalPositions = 0; if (decimalPositions == 0) return "" + Math.round(parseFloat(str)); return "" + ( Math.round( parseFloat(str) * Math.pow( 10, parseInt(decimalPositions) ) ) / Math.pow(10, parseInt(decimalPositions) ) ); } 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 // Devuelve: // - Verdadero si el relleno del combo concluyó con éxito y falso en caso contrario. //function rellenaCombo(cboDestino, xml, formatString){ function XMLInlineLoader_fillCombo(cboDestino, xml, formatString){ try { while (cboDestino.options.length > 1) { cboDestino.options[0] = null; } var c = xml.selectSingleNode("//Combo").childNodes.length; var xmlOption; var code; var description; var newOption; for (var i = 0;i < c; i++){ xmlOption = xml.documentElement.childNodes(i); code = xmlOption.attributes.getNamedItem('C').nodeValue; description = xmlOption.attributes.getNamedItem('D').nodeValue; newOption = document.createElement("OPTION"); newOption.text = description; newOption.value = code; cboDestino.add(newOption); } return true; } catch(e) { return false; } } function httpBooleanInvoker(url, desc) { try { var xml = new ActiveXObject("Microsoft.XMLDOM"); var request = new ActiveXObject("Microsoft.XMLHTTP"); request.open("POST", url, false); request.send(); var xmlObject = request.responseXML; var str = xmlObject.selectSingleNode("error").text; if (str == "0") return true; return false; } catch(e) { alert("Error de comunicaciones. Imposible conectar con el servidor.\n\nOperación:\t" + desc); return null; } } function httpIntInvoker(url, desc) { try { var xml = new ActiveXObject("Microsoft.XMLDOM"); var request = new ActiveXObject("Microsoft.XMLHTTP"); request.open("POST", url, false); request.send(); var xmlObject = request.responseXML; var str = xmlObject.selectSingleNode("error").text; return parseInt(str); } catch(e) { alert("Error de comunicaciones. Imposible conectar con el servidor.\n\nOperación:\t" + desc); return null; } } function httpStringInvoker(url, desc) { try { var xml = new ActiveXObject("Microsoft.XMLDOM"); var request = new ActiveXObject("Microsoft.XMLHTTP"); request.open("POST", url, false); request.send(); var xmlObject = request.responseXML; var str = xmlObject.selectSingleNode("error").text; return str; } catch(e) { alert("Error de comunicaciones. Imposible conectar con el servidor.\n\nOperación:\t" + desc); return null; } } // funcion que comprueba que el campo ha sido rellenado function esBlanco(campo) { if (campo.length == 0) return true; else return false; } /*************************************************************************************** VALIDAR NUMERO DE TELEFONO (OMS) Segun los siguientes criterios: - con prefijo del país: un signo y 11 dígitos numéricos (+XXXXXXXXXXX). - sin prefijo del país: 9 dígitos numéricos (XXXXXXXXX). ***************************************************************************************/ function esTelefono(elemento) { var strAux = Trim(elemento.value); var tam = strAux.length; if ((tam != 9) && (tam != 12)) { return false; } if ((tam == 9) && (!esNumeros(strAux))) { return false; } if (tam == 12) { var strAux2 = strAux.substring(1,tam); if ((strAux.substr(0,1) != "+") || (!esNumeros(strAux2))) { return false; } } return true; } /*************************************************************************************** VALIDAR DIRECCION DE CORREO ELECTRONICO (OMS) Segun los siguientes criterios: - la cadena contiene una @. - la cadena contiene algo antes de la @. - la cadena contiene algo después de la @. ***************************************************************************************/ function esEmail(variable) { var strAux = Trim(variable); var posArr = strAux.indexOf("@"); if ((posArr == -1) || (posArr == 0) || (posArr == (strAux.length-1))) { return false; } else { return true; } } /*************************************************************************************** VALIDA SI UNA CADENA DE CARACTERES ESTA FORMADA UNICAMENTE POR DIGITOS NUMERICOS - Entrada: cadena de caracteres - Devuelve: true/false ***************************************************************************************/ function esNumeros(variable) { var patron = /^\d+$/; return patron.test(variable); } //****************************************************** //Función que devuelve una cadena //sin espacios por la derecha y la izquierda. //Elemento:Es el objecto a validar(la caja de texto). //****************************************************** function Trim(str) { var resultStr = ''; resultStr = TrimLeft(str); resultStr = TrimRight(resultStr); return resultStr; } //*************************************************************** //Función que quita los espacios por la izquierda. //str:la cadena a limpiar. //*************************************************************** function TrimLeft(str) { var resultStr = ''; var i = 0; var len = 0 ; if (str+'' == 'undefined' || str == null){return null;} str += ''; if (str.length == 0){ resultStr = ''; }else{ len = str.length; while ((i <= len) && (str.charAt(i) == " ")){i++;} resultStr = str.substring(i, len); } return resultStr; } //********************************************************** //Función que quita los espacios por la derecha. //str:la cadena a limpiar. //********************************************************** function TrimRight(str) { var resultStr=''; var i=0; if (str+'' == 'undefined' || str == null){return null;} str += ''; if (str.length == 0){ resultStr = ''; }else{ i = str.length - 1; while ((i >= 0) && (str.charAt(i) == ' ')){i--;} resultStr = str.substring(0, i + 1); } return resultStr; } // funcion que comprueba si el campo es numerico decimal (positivo o negativo) // El caracter del decimal es el punto o la coma. function esDecimal(campo) { if (esEntero(campo) || esBlanco(campo)) return true; var posPunto = campo.indexOf("."); if (posPunto < 0) posPunto = campo.indexOf(","); if (posPunto < 0) return false; if (!esEntero(campo.substring(0, posPunto))) return false; if (!esEntero(campo.substring(posPunto + 1))) return false; if (campo.charAt(posPunto + 1) == '-') return false; return true; } // funcion que comprueba si el campo es numerico entero (positivo o negativo) function esEntero(campo) { var inLen = campo.length; for (var i=0; i < inLen; i++) { var ch = campo.substring(i, i + 1); if ((ch < "0") || ("9" < ch)) { if (i != 0) return false; else if (ch != "-") return false; } } return true; } function compara_fechas(fechaDesde, fechaHasta){ var fecha1, fecha2 fecha1 = parseInt(fechaDesde.slice(6,10) + fechaDesde.slice(3,5) + fechaDesde.slice(0,2), 10); fecha2 = parseInt(fechaHasta.slice(6,10) + fechaHasta.slice(3,5) + fechaHasta.slice(0,2), 10); if (fecha1 > fecha2) return true; else return false; } // funcion que comprueba si el campo es numerico decimal (positivo o negativo) // El caracter del decimal es la coma y los miles pueen ir separadoa por punto. function esDecimalFormateado(campo) { if (esEntero(campo) || esBlanco(campo)) return true; var posComa = campo.indexOf(","); if (!esEntero(campo.substring(0, posComa))) { var posPunto = campo.indexOf("."); if (!esEntero(campo.substring(0, posPunto))) return false; if (!esEntero(campo.substring(posPunto + 1, posComa-1))) return false; } if (!esEntero(campo.substring(posComa + 1))) return false; if (campo.charAt(0) == '-') return false; return true; } //BEGIN - BUSCADOR AVANZADO //var buscadorAvanzado_url = "servlet/BuscadorAvanzado_srv"; //EN INTEGRATION.JSP function buscadorAvanzado_onLoad( ) { var odocument = global_XMLInvoke( buscadorAvanzado_url, "action=getvalues", false ); buscadorAvanzado_paint( odocument ); } function buscadorAvanzado_paintCombo( odocument, combo, nodo, porDefecto ) { if ( odocument.documentElement.selectSingleNode( nodo ) != undefined ) { seleccionaCombo( combo, odocument.documentElement.selectSingleNode( nodo ).selectSingleNode( "code" ).text ); } else { seleccionaCombo( combo, porDefecto ); } } function buscadorAvanzado_paintCheck( odocument, check, nodo ) { if ( odocument.documentElement.selectSingleNode( nodo ) != undefined ) { if ( odocument.documentElement.selectSingleNode( nodo ).selectSingleNode( "code" ).text == "true" ) { check.checked = true; } else { check.checked = false; } } else { check.checked = false; } } function buscadorAvanzado_paint( odocument ) { var cboTipoProducto = document.all( "buscadorAvanzado_cboTipoProducto" ); var cboMarca = document.all( "buscadorAvanzado_cboMarca" ); var cboFrigorias = document.all( "buscadorAvanzado_cboFrigorias" ); var cboCalorias = document.all( "buscadorAvanzado_cboCalorias" ); // var cboConsumoMaximo = document.all( "buscadorAvanzado_cboConsumoMaximo" ); var cboImporte = document.all( "buscadorAvanzado_cboImporte" ); var checkOferta = document.all( "buscadorAvanzado_checkOferta" ); var checkNovedad = document.all( "buscadorAvanzado_checkNovedad" ); var checkPromocion = document.all( "buscadorAvanzado_checkPromocion" ); var familias; // buscadorAvanzado_paintCombo( odocument, cboTipoProducto, "type", -1 ); var comboXML = global_XMLInvoke( buscadorAvanzado_url, "action=setvalues&idTipoProducto=" + idTipoProducto, false ); buscadorAvanzado_paint_cboFamilia( comboXML ); // buscadorAvanzado_paint_cboFamilia( odocument ); if ( odocument.documentElement.selectSingleNode( "descripcion" ) != undefined ){ document.all( "buscadorAvanzado_txtDescripcion" ).value = odocument.documentElement.selectSingleNode( "descripcion" ).text; } buscadorAvanzado_paintCombo( odocument, cboMarca, "marca", -1 ); buscadorAvanzado_paintCombo( odocument, cboFrigorias, "frigorias", 0 ); buscadorAvanzado_paintCombo( odocument, cboCalorias, "calorias", 0 ); // buscadorAvanzado_paintCombo( odocument, cboConsumoMaximo, "consumoMaximo", 0 ); buscadorAvanzado_paintCombo( odocument, cboImporte, "importe", 0 ); // buscadorAvanzado_paintCheck( odocument, checkOferta, "oferta" ); // buscadorAvanzado_paintCheck( odocument, checkNovedad, "novedad" ); // buscadorAvanzado_paintCheck( odocument, checkPromocion, "promocion" ); } function buscadorAvanzado_paint_cboFamilia( odocument ) { var familias; var cboFamilia = document.all( "buscadorAvanzado_cboFamilia" ); if ( odocument.documentElement.selectSingleNode( "familia" ) != undefined ){ var i; familias = odocument.documentElement.selectSingleNode( "familia" ).selectSingleNode( "familias" ).childNodes; cboFamilia.length = ( familias.length + 1 ); for ( i = 0; i < familias.length; i++ ) { cboFamilia.options[i + 1].text = familias.item( i ).selectSingleNode( "description" ).text; cboFamilia.options[i + 1].value = familias.item( i ).selectSingleNode( "code" ).text; } if ( odocument.documentElement.selectSingleNode( "familia" ).selectSingleNode( "code" ) != undefined ) { seleccionaCombo( cboFamilia, odocument.documentElement.selectSingleNode( "familia" ).selectSingleNode( "code" ).text ); } else { seleccionaCombo( cboFamilia, -1 ); } } else { cboFamilia.length = 1; seleccionaCombo( cboFamilia, -1 ); } } function buscadorAvanzado_cboOnChange( num ) { //var combo = new Array( "TipoProducto", "Familia", "Marca", "Frigorias", "Calorias", "ConsumoMaximo", "Importe" ); //var parameter = new Array( "idTipoProducto", "idFamilia", "idMarca", "frigorias", "calorias", "consumoMaximo", "importe" ); var combo = new Array( "TipoProducto", "Familia", "Marca", "Frigorias", "Calorias", "Importe" ); var parameter = new Array( "idTipoProducto", "idFamilia", "idMarca", "frigorias", "calorias", "importe" ); var cbo = document.all( "buscadorAvanzado_cbo" + combo[num] ); var parameterValue = cbo.options[cbo.options.selectedIndex].value; var odocument = global_XMLInvoke( buscadorAvanzado_url, "action=setvalues&" + parameter[num] + "=" + parameterValue, false ); if ( num == 0 ) { buscadorAvanzado_paint_cboFamilia( odocument ); } } function buscadorAvanzado_checkOnClick( num ) { var check = new Array( "Oferta", "Novedad", "Promocion" ); var parameter = new Array( "oferta", "novedad", "promocion" ); var chk = document.all( "buscadorAvanzado_check" + check[num] ); var parameterValue = chk.checked; var odocument = global_XMLInvoke( buscadorAvanzado_url, "action=setvalues&" + parameter[num] + "=" + parameterValue, false ); buscadorAvanzado_paint( odocument ); } function buscadorAvanzado_txtDescripcion_onChange( ) { var txtDescripcion = document.all( "buscadorAvanzado_txtDescripcion" ); var odocument = global_XMLInvoke( buscadorAvanzado_url, "action=setvalues&descripcion=" + txtDescripcion.value ); } function buscadorAvanzado_buscarAvanzado( ) { // document.all( "buscadorAvanzado_frm" ).action = "listadoReferencias.jsp"; document.all( "buscadorAvanzado_frm" ).action = "search-advanced-results.jsp"; document.all( "buscadorAvanzado_frm" ).submit( ); } //END - BUSCADOR AVANZADO //BEGIN - RESULTADO BÚSQUEDA AVANZADA V2 function resultadoBusquedaAvanzada_referenciasAnterior( numPagina ) { document.all('resultadoBusquedaAvanzada_frm').action = "listadoReferencias.jsp"; document.all('numPaginaReferencia').value = numPagina; document.all('resultadoBusquedaAvanzada_frm').submit(); } function resultadoBusquedaAvanzada_referenciasSiguiente( numPagina ) { document.all('resultadoBusquedaAvanzada_frm').action = "listadoReferencias.jsp"; document.all('numPaginaReferencia').value = numPagina; document.all('resultadoBusquedaAvanzada_frm').submit(); } function resultadoBusquedaAvanzada_irAPagina( numPagina ) { document.all( "numPaginaReferencia" ).value = numPagina - 1; document.all( "resultadoBusquedaAvanzada_frm" ).action = "listadoReferencias.jsp"; document.all( "resultadoBusquedaAvanzada_frm" ).submit( ); } function resultadoBusquedaAvanzada_irAModelo( id ){ document.all( "resultadoBusquedaAvanzada_frm" ).action = "model.jsp"; document.all( "idModelo" ).value = id; document.all( "resultadoBusquedaAvanzada_frm" ).submit(); } //END - RESULTADO BÚSQUEDA AVANZADA V2 //BEGIN - BUSCADOR SIMPLE //var buscadorLittle_url = "servlet/BuscadorLittle_srv"; //EN INTEGRATION.JSP function buscadorLittle_onLoad( ) { var odocument = global_XMLInvoke( buscadorLittle_url, "action=getvalues", false ); buscadorLittle_paint( odocument ); } function buscadorLittle_paint( odocument ) { var cboTipoProducto = document.all( "buscadorLittle_cboTipoProducto" ); var cboFamilia = document.all( "buscadorLittle_cboFamilia" ); var cboMarca = document.all( "buscadorLittle_cboMarca" ); var txt = document.all( "buscadorLittle_txt" ); var familias; var tipos; //rellenamos el combo de Tipo de Producto var typeNode = odocument.documentElement.selectSingleNode("type"); var typeNodes = typeNode.selectSingleNode("types").childNodes; var typeNodeCode = typeNode.selectSingleNode("code").text; var i; cboTipoProducto.length = ( typeNodes.length + 1 ); for ( i = 0; i < typeNodes.length; i++ ) { cboTipoProducto.options[i + 1].text = typeNodes.item( i ).selectSingleNode( "description" ).text; cboTipoProducto.options[i + 1].value = typeNodes.item( i ).selectSingleNode( "code" ).text; } if ( typeNodeCode != undefined && typeNodeCode != "" ) { seleccionaCombo( cboTipoProducto, typeNodeCode ); if (typeNodeCode == 10) { document.all("buscadorLittle_TR_buscarAvanzado").style.display = ""; } else { document.all("buscadorLittle_TR_buscarAvanzado").style.display = "none"; } } else { seleccionaCombo( cboTipoProducto, -1 ); document.all("buscadorLittle_TR_buscarAvanzado").style.display = "none"; } //rellenamos el combo de Familias var familiaNode = odocument.documentElement.selectSingleNode("familia"); var familiaNodes = familiaNode.selectSingleNode("familias").childNodes; var familiaNodeCode = familiaNode.selectSingleNode("code").text; cboFamilia.length = ( familiaNodes.length + 1 ); for ( i = 0; i < familiaNodes.length; i++ ) { cboFamilia.options[i + 1].text = familiaNodes.item( i ).selectSingleNode( "description" ).text; cboFamilia.options[i + 1].value = familiaNodes.item( i ).selectSingleNode( "code" ).text; } if ( familiaNodeCode != undefined && familiaNodeCode != "" ) { seleccionaCombo( cboFamilia, familiaNodeCode ); } else { seleccionaCombo( cboFamilia, -1 ); } //rellenamos el combo de Marcas var marcaNode = odocument.documentElement.selectSingleNode("marca"); var marcaNodes = marcaNode.selectSingleNode("marcas").childNodes; var marcaNodeCode = marcaNode.selectSingleNode("code").text; cboMarca.length = ( marcaNodes.length + 1 ); for ( i = 0; i < marcaNodes.length; i++ ) { cboMarca.options[i + 1].text = marcaNodes.item( i ).selectSingleNode( "description" ).text; cboMarca.options[i + 1].value = marcaNodes.item( i ).selectSingleNode( "code" ).text; } if ( marcaNodeCode != undefined && marcaNodeCode != "" ) { seleccionaCombo( cboMarca, marcaNodeCode ); } else { seleccionaCombo( cboMarca, -1 ); } if ( odocument.documentElement.selectSingleNode( "fulltext" ) != undefined ) { txt.value = odocument.documentElement.selectSingleNode( "fulltext" ).selectSingleNode( "text" ).text ; } } function buscadorLittle_cboTipoProducto_onChange() { var combo = document.all( "buscadorLittle_cboTipoProducto" ); var idTipoProducto = combo.options[combo.options.selectedIndex].value; var odocument = global_XMLInvoke( buscadorLittle_url, "action=setvalues&idTipoProducto=" + idTipoProducto, false ); buscadorLittle_paint( odocument ); } function buscadorLittle_cboFamilia_onChange( ) { var combo = document.all( "buscadorLittle_cboFamilia" ); var idFamilia = combo.options[combo.options.selectedIndex].value; var odocument = global_XMLInvoke( buscadorLittle_url, "action=setvalues&idFamilia=" + idFamilia, false ); buscadorLittle_paint( odocument ); } function buscadorLittle_cboMarca_onChange( ) { var combo = document.all( "buscadorLittle_cboMarca" ); var idMarca = combo.options[combo.options.selectedIndex].value; var odocument = global_XMLInvoke( buscadorLittle_url, "action=setvalues&idMarca=" + idMarca, false ); buscadorLittle_paint( odocument ); } function seleccionaCombo(combo, valor) { combo.options[0].selected = true; for(var i = 0; i < combo.options.length; i++) { if(combo.options[i].value == valor) { combo.options[i].selected = true; return; } } } function buscadorLittle_buscarAvanzado() { // document.all( "buscadorLittle_frm" ).action = "buscadorAvanzado.jsp"; /* if ( document.all( "buscadorLittle_cboTipoProducto" ).selectedIndex == 0 ) { alert( "Por favor seleccione algún tipo de producto para realizar una búsqueda avanzada." ); return; } */ document.all( "buscadorLittle_cboTipoProducto" ).selectedIndex = 1; document.all( "buscadorLittle_frm" ).action = "search-advanced.jsp"; document.all( "buscadorLittle_frm" ).submit( ); } function buscadorLittle_txt_onSearch() { var txt = document.all( "buscadorLittle_txt" ); var odocument = global_XMLInvoke( buscadorLittle_url, "action=setvalues&txt=" + txt.value, false ); } function buscadorLittle_buscar() { buscadorLittle_txt_onSearch(); var txt = document.all( "buscadorLittle_txt" ).value; var cboTipo = document.all( "buscadorLittle_cboTipoProducto" ) var cboFamilia = document.all( "buscadorLittle_cboFamilia" ) var cboMarca = document.all( "buscadorLittle_cboMarca" ) var valorTipo = cboTipo.options[cboTipo.options.selectedIndex].value; var valorFamilia = cboFamilia.options[cboFamilia.options.selectedIndex].value; var valorMarca = cboMarca.options[cboMarca.options.selectedIndex].value; if ( ( txt == "" ) && ( valorTipo == -1 ) && ( valorFamilia == -1 ) && ( valorMarca == -1 ) ) { alert( "Por favor, seleccione algún criterio para realizar la búsqueda." ); } else { document.all( "buscadorLittle_frm" ).submit(); } } //END - BUSCADOR SIMPLE //BEGIN - COMPARATIVA //var comparativa_url = "servlet/Comparativa_srv"; //EN INTEGRATION.JSP function comparativa_add( referencia_id ) { var odocument = global_XMLInvoke( comparativa_url, "action=add&id=" + referencia_id, false ); try { var error = odocument.documentElement.selectSingleNode( "error" ).text; } catch( e ) { comparativa_paint( odocument ); return; } alert( error ); } function comparativa_paint( odocument ) { var nodes = odocument.documentElement.selectSingleNode( "lines" ).childNodes; var c = nodes.length; var i; var node; for( i = 0; i < c; i++ ) { node = nodes( i ); // document.all( "comparativa_text_id" + ( i + 1 ) ).value = node.selectSingleNode( "branch" ).text + ": " + document.all( "comparativa_text_id" + ( i + 1 ) ).value = node.selectSingleNode( "reference" ).text; document.all( "comparativa_hidden_id" + ( i + 1 ) ).value = node.selectSingleNode( "id" ).text; } for( ; i < 3; i++ ) { document.all( "comparativa_text_id" + ( i + 1 ) ).value = ""; document.all( "comparativa_hidden_id" + ( i + 1 ) ).value = ""; } } function comparativa_onLoad( ) { var odocument = global_XMLInvoke(comparativa_url, "action=loadall", false); comparativa_paint(odocument); } function comparativa_cmdDelete_onClick(index) { var id = document.all( "comparativa_hidden_id" + index ).value; if ( id == "" ) return; var odocument = global_XMLInvoke( comparativa_url, "action=delete&id=" + id, false ); try { var error = odocument.documentElement.selectSingleNode( "error" ).text; } catch( e ) { var odocument = global_XMLInvoke(comparativa_url, "action=loadall", false); comparativa_paint( odocument ); return; } alert( error ); } function comparativa_compare(){ var i = 0; if (document.all("comparativa_hidden_id1").value != "") i++; if (document.all("comparativa_hidden_id2").value != "") i++; if (document.all("comparativa_hidden_id3").value != "") i++; if (i > 1) { document.all( "comparativa_frm" ).action = VAR_HOME_FRONTEND + "tienda/comparativa.jsp"; document.all( "comparativa_frm" ).submit(); return; } //alert( "Debe seleccionar al menos dos productos a comparar." ); } //END - COMPARATIVA //BEGIN - FICHA DATOS REGISTRO function fichaDatosRegistro_continuar() { if (esBlanco(document.all("txtNombre").value)) { alert("Por favor, introduzca su nombre"); document.all("txtNombre").focus(); return; } if (esBlanco(document.all("txtApellidos").value)) { alert("Por favor, introduzca sus apellidos"); document.all("txtApellidos").focus(); return; } if (esBlanco(document.all("txtCif").value)) { alert("Por favor, introduzca el NIF/CIF"); document.all("txtCif").focus(); return; } if (esBlanco(document.all("txtDireccion").value)) { alert("Por favor, introduzca la dirección"); document.all("txtDireccion").focus(); return; } if (esBlanco(document.all("txtCp").value)) { alert("Por favor, introduzca el código postal"); document.all("txtCp").focus(); return; } if (document.all("txtProvincia").value == 0) { alert("Por favor, introduzca la provincia"); document.all("txtProvincia").focus(); return; } if (document.all("txtLocalidad").value == 0) { alert("Por favor, introduzca la localidad"); document.all("txtLocalidad").focus(); return; } if (esBlanco(document.all("txtTelefono").value)) { alert("Por favor, introduzca un teléfono de contacto"); document.all("txtTelefono").focus(); return; } if (esBlanco(document.all("txtEmail").value)) { alert("Por favor, introduzca su e-mail"); document.all("txtEmail").focus(); return; } if (esBlanco(document.all("txtContrasena").value)) { alert("Por favor, introduzca una contraseña para el registro"); document.all("txtContrasena").focus(); return; } if (esBlanco(document.all("txtContrasena2").value)) { alert("Por favor, repita la contraseña"); document.all("txtContrasena2").focus(); return; } if (document.all("txtContrasena2").value != document.all("txtContrasena").value) { alert("La contraseña introducida debe ser igual en los dos cuadros"); document.all("txtContrasena").focus(); return; } if ( document.all( "info" ).checked == true ) { document.all( "info" ).value = "1"; } else { document.all( "info" ).value = "0"; } document.fichaDatosRegistro_frm.action = "registrar.jsp"; document.fichaDatosRegistro_frm.submit(); } function fichaDatosRegistro_cambiaProvincia() { var combo = document.all("txtProvincia"); clearCombo(document.all("txtLocalidad")); cargaCombo(document.all("txtLocalidad"), "localidades", "&provincia=" + combo.options[combo.options.selectedIndex].value); } function fichaDatosRegistro_seleccionaCombo(combo, valor) { for(var i=0; i < combo.options.length; i ++) { if(combo.options[i].value == valor) { combo.options[i].selected = true; return; } } } //END - FICHA DATOS REGISTRO //BEGIN - FICHA DATOS USUARIO (MODIFICACIÓN) function fichaDatosUsuario_continuar() { if (esBlanco(document.all("txtNombre").value)) { alert("Por favor, introduzca su nombre"); document.all("txtNombre").focus(); return; } if (esBlanco(document.all("txtApellidos").value)) { alert("Por favor, introduzca sus apellidos"); document.all("txtApellidos").focus(); return; } if (esBlanco(document.all("txtCif").value)) { alert("Por favor, introduzca el NIF/CIF"); document.all("txtCif").focus(); return; } if (esBlanco(document.all("txtDireccion").value)) { alert("Por favor, introduzca la dirección"); document.all("txtDireccion").focus(); return; } if (esBlanco(document.all("txtCp").value)) { alert("Por favor, introduzca el código postal"); document.all("txtCp").focus(); return; } if (document.all("txtProvincia").value == 0) { alert("Por favor, introduzca la provincia"); document.all("txtProvincia").focus(); return; } if (document.all("txtLocalidad").value == 0) { alert("Por favor, introduzca la localidad"); document.all("txtLocalidad").focus(); return; } if (esBlanco(document.all("txtTelefono").value)) { alert("Por favor, introduzca un teléfono de contacto"); document.all("txtTelefono").focus(); return; } if ((((!esBlanco(document.all("txtContrasena").value)) && (esBlanco(document.all("txtContrasena2").value)))) || (((esBlanco(document.all("txtContrasena").value)) && (!esBlanco(document.all("txtContrasena2").value))))) { alert("Por favor, repita la contraseña"); document.all("txtContrasena2").focus(); return; } if (document.all("txtContrasena2").value != document.all("txtContrasena").value) { alert("La contraseña introducida debe ser igual en los dos cuadros"); document.all("txtContrasena").focus(); return; } if ( document.all( "info" ).checked == true ) { document.all( "info" ).value = "1"; } else { document.all( "info" ).value = "0"; } document.fichaDatosUsuario_frm.action = "modificarDatos.jsp"; document.fichaDatosUsuario_frm.submit(); } function fichaDatosUsuario_cambiaProvincia() { var combo = document.all("txtProvincia"); clearCombo(document.all("txtLocalidad")); cargaCombo(document.all("txtLocalidad"), "localidades", "&provincia=" + combo.options[combo.options.selectedIndex].value); } function fichaDatosUsuario_seleccionaCombo(combo, valor) { for(var i=0; i < combo.options.length; i ++) { if(combo.options[i].value == valor) { combo.options[i].selected = true; return; } } } //END - FICHA DATOS USUARIO (MODIFICACIÓN) //BEGIN - LOGON function logon_desconectar() { document.all("logon_frm").action = URL_USER_DISCONNECT; document.all("logon_frm").submit(); } function logon_modificarDatos() { document.all("logon_frm").action = URL_USER_DATA; document.all("logon_frm").submit(); } function logon_pwdOlvidada() { document.all("logon_frm").action = "recordarContrasena.jsp"; document.all("logon_frm").submit(); } function logon_registrar() { document.all("logon_frm").action = URL_NEW_USER; document.all("logon_frm").submit(); } function logon_entrar() { if ((document.all("WEB_USER_MAIL").value) == "") { alert("Por favor, introduzca su e-mail."); document.all("WEB_USER_MAIL").focus(); return; } if ((document.all("WEB_USER_PWD").value) == "") { alert("Por favor, introduzca su contraseña."); document.all("WEB_USER_PWD").focus(); return; } document.logon_frm.action = URL_USER_LOGON; document.logon_frm.submit(); } function logon_tecla() { if (!event.keyCode) return; if (event.keyCode == 13) { logon_entrar(); } } //END - LOGON //BEGIN - MODEL SEARCH VIEW (BÚSQUEDA DE MODELOS) function modelSearchView_modelosAnterior( numPagina ) { document.all( "modelSearchView_numPaginaModelo" ).value = numPagina; document.all( "modelSearchView_numPaginaModelo" ).action = "listadoModelos.jsp"; document.all( "modelSearchView_frm" ).submit( ); } function modelSearchView_modelosSiguiente( numPagina ) { document.all( "modelSearchView_numPaginaModelo" ).value = numPagina; document.all( "modelsearchView_frm" ).action = "listadoModelos.jsp"; document.all( "modelsearchView_frm" ).submit( ); } function modelSearchView_irAPagina( numPagina ) { document.all( "modelSearchView_numPaginaModelo" ).value = numPagina - 1; document.all( "modelSearchView_frm" ).action = "listadoModelos.jsp"; document.all( "modelSearchView_frm" ).submit( ); } function modelSearchView_irAModelo(id){ document.all( "modelSearchView_frm" ).action = "model.jsp"; document.all( "idModelo" ).value = id; document.all( "modelsearchView_frm" ).submit(); } //END - MODEL SEARCH VIEW (BÚSQUEDA DE MODELOS) //BEGIN - SHOPPINGCART //var shoppingcart_url = "servlet/ShoppingCart_srv"; //EN INTEGRATION.JSP var SHOPPINGCART_MIN_SIZE = 8; var SHOPPINGCART_DESCRIPTION_CELL_INDEX = 0; var SHOPPINGCART_AMOUNT_CELL_INDEX = 1; var SHOPPINGCART_PRICE_CELL_INDEX = 2; var SHOPPINGCART_TRASH_CELL_INDEX = 3; var SHOPPINGCART_TRID_PREFIX = "sctrid_"; function shoppingCart_cmdDetails_Click() { alert("Debe agregar algún producto al carrito para realizar un pedido"); } function shoppingCart_getInsertionPoint() { var table = document.all("tableShoppingCart"); var c = table.rows.length; var i = 1; var tr; for (; i < c; i++) { tr = table.rows(i); if (tr.id == "") { return i; } } return i; } function shoppingCart_add(id) { var odocument = global_XMLInvoke(shoppingcart_url, "action=add&id=" + id, false); var table = document.all("tableShoppingCart"); var c = table.rows.length; var i = 1; var bFlag = false; var node; node = odocument.documentElement.selectSingleNode("lines").childNodes(0); for (; i < c; i++) { if (table.rows(i).id == SHOPPINGCART_TRID_PREFIX + id) { shoppingCart_modifyRow( node.selectSingleNode("id").text, node.selectSingleNode("reference").text, node.selectSingleNode("description").text, node.selectSingleNode("amount").text, node.selectSingleNode("price").text, node.selectSingleNode("branch").text ); bFlag = true; } } if (!bFlag) { shoppingCart_addRow( node.selectSingleNode("id").text, node.selectSingleNode("reference").text, node.selectSingleNode("description").text, node.selectSingleNode("amount").text, node.selectSingleNode("price").text, node.selectSingleNode("branch").text ); } shoppingCart_paint(); shoppingCart_writeTotal(odocument); } function shoppingCart_cmdDelete_onClick(id) { var odocument = global_XMLInvoke(shoppingcart_url, "action=delete&id=" + id, false); shoppingCart_onLoad(); return; var table = document.all("tableShoppingCart"); var c = table.rows.length; var i = 1; var tr; var price; var amount; var node; for (; i < c; i++) { if (table.rows(i).id == "") break; if (table.rows(i).id == SHOPPINGCART_TRID_PREFIX + id) { if ( odocument.documentElement.selectSingleNode("lines").childNodes.length == 0 ) { table.deleteRow(i); } else { node = odocument.documentElement.selectSingleNode("lines").childNodes(0); price = node.selectSingleNode("price").text; amount = parseInt(node.selectSingleNode("amount").text); table.rows(i).cells(SHOPPINGCART_AMOUNT_CELL_INDEX).innerHTML = "" + amount; table.rows(i).cells(SHOPPINGCART_PRICE_CELL_INDEX).innerHTML = number2Screen(price, true, 2, true); } } } shoppingCart_writeTotal(odocument); shoppingCart_paint(); } function shoppingCart_writeTotal(odocument) { var td = document.all("shoppingCart_total"); td.innerHTML = number2Screen(odocument.documentElement.selectSingleNode("global").selectSingleNode("price").text, true, 2, true); td = document.all("shoppingCart_sh"); td.innerHTML = number2Screen(odocument.documentElement.selectSingleNode("global").selectSingleNode("sh").text, true, 2, true); } function shoppingCart_cmdBuy_Click() { var shoppingCartXML = global_XMLInvoke( shoppingcart_url, "action=loadall", false ); if ( shoppingCartXML.documentElement.selectSingleNode( "lines" ).childNodes.length > 0 ) { window.location = VAR_HOME_FRONTEND + "venta/shopping.jsp"; } else { alert("Debe agregar algún producto al carrito para realizar un pedido"); } } function shoppingCart_onLoad() { var odocument = global_XMLInvoke(shoppingcart_url, "action=loadall", false); var table = document.all("tableShoppingCart"); shoppingCart_deleteTable(table, 1, 0); shoppingCart_paint(odocument); } function shoppingCart_paint(odocument) { var i = 0; if (odocument != undefined) { var nodes = odocument.documentElement.selectSingleNode("lines").childNodes; var c = nodes.length; var node; for (;i < c; i++) { node = nodes(i); shoppingCart_addRow( node.selectSingleNode("id").text, node.selectSingleNode("reference").text, node.selectSingleNode("description").text, node.selectSingleNode("amount").text, node.selectSingleNode("price").text, node.selectSingleNode("branch").text ); } } else { i = document.all("tableShoppingCart").rows.length - 1; } for (;i < SHOPPINGCART_MIN_SIZE; i++) { shoppingCart_addRow("", "", "", "", ""); } i = document.all("tableShoppingCart").rows.length - 1; if (i > SHOPPINGCART_MIN_SIZE) { if (document.all("tableShoppingCart").rows(i).id == "") { document.all("tableShoppingCart").deleteRow(i); } } if (odocument != undefined) { shoppingCart_writeTotal(odocument); } } function shoppingCart_modifyRow(id, reference, description, amount, price, branch) { var table = document.all("tableShoppingCart"); var tr = document.all(SHOPPINGCART_TRID_PREFIX + id); tr.title = branch + ": " + description; var td = tr.cells(SHOPPINGCART_DESCRIPTION_CELL_INDEX); td.innerHTML = reference; td = tr.cells(SHOPPINGCART_AMOUNT_CELL_INDEX); td.innerHTML = amount; td = tr.cells(SHOPPINGCART_PRICE_CELL_INDEX); td.innerHTML = number2Screen(price, true, 2, true); td = tr.cells(SHOPPINGCART_TRASH_CELL_INDEX); if (reference != "") { td.innerHTML = "Borrar"; } else { td.innerHTML = ""; } } function shoppingCart_addRow(id, reference, description, amount, price, branch) { var table = document.all("tableShoppingCart"); var tr = table.insertRow(shoppingCart_getInsertionPoint()); tr.className = "txtDatos"; tr.style.backgroundColor = "#FFFFFF"; tr.height = 13; if (id != "") { tr.title = branch + ": " + description; tr.id = SHOPPINGCART_TRID_PREFIX + id; } var td = tr.insertCell(); td.style.textAlign = "left"; if (id != "") { td.innerHTML = reference; } td = tr.insertCell(); td.style.textAlign = "center"; td.innerHTML = amount; td = tr.insertCell(); td.style.textAlign = "right"; if (price != "") { td.innerHTML = number2Screen(price, true, 2, true); } td = tr.insertCell(); td.style.textAlign = "center"; if (reference != "") { td.innerHTML = "Borrar"; } else { td.innerHTML = ''; } } function shoppingCart_deleteTable(oTable, headerRows, footerRows ) { var hiBound = oTable.rows.length - footerRows - 1; var loBound = headerRows; var i; for (i=loBound; i <= hiBound; i++) { oTable.deleteRow(1); } } //END - SHOPPINGCART //var compra_url con la dirección del servlet --> definida en integration.jsp var fichasXML; var accion; function shopping_cancel() { if ( confirm( "¿Está seguro de que desea anular el pedido en curso?" ) ) { window.location = VAR_HOME_FRONTEND + "venta/include/cancel-shopping.jsp"; } } function shopping_saveFicha(accion, idFicha) { var parametros = ""; var mensaje = ""; if (document.all('editarAtt').value == "") { mensaje += "Debe rellenar el campo \"Att\"."; } else if (document.all('editarTfn').value == "") { mensaje += "Debe rellenar el campo \"Teléfono\"."; } else if (isNaN(parseInt(document.all('editarTfn').value))) { error = "El campo \"Teléfono\" debe ser un valor numérico."; } else if (document.all('editarDir').value == "") { mensaje += "Debe rellenar el campo \"Dirección\"."; } if (mensaje != "") { alert(mensaje); } else { parametros += "action=" + accion; parametros += "&att=" + escape( document.all('editarAtt').value ); parametros += "&tfn=" + escape( document.all('editarTfn').value ); parametros += "&dir=" + escape( document.all('editarDir').value ); parametros += "&obs=" + escape( document.all('editarObs').value ); parametros += "&idficha=" + idFicha; fichasXML = global_XMLInvoke(compra_url, parametros, false); try { if (!window.opener.modoResumen()) { if (idFicha == 0) { shopping_paintFichas(fichasXML, idFicha); } else { window.opener.shopping_paintFichas(fichasXML, idFicha); window.close(); } } else { resumen_openComponent("2&modo=resumen", 640, 480); } } catch( e ) { shopping_paintFichas(fichasXML, idFicha); } } } function shopping_fichasOnLoad( idFicha ) { fichasXML = global_XMLInvoke(compra_url, "action=getfichas", false); shopping_paintFichas(fichasXML, idFicha); } function shopping_deleteFicha(idFicha) { for (var j = 0; j < dirEnvio.length; j++) { if (dirEnvio[j].value == idFicha){ dirEnvio[j].checked = true; break; } } if (confirm("Está a punto de eliminar la dirección de envío seleccionada.\n¿Quiere continuar?") == 1) { fichasXML = global_XMLInvoke(compra_url, "action=deleteficha&idficha=" + idFicha, false); shopping_paintFichas(fichasXML, 0); } } function shopping_updateFicha(idFicha) { var dirEnvio = document.all('dirEnvio'); for (var j = 0; j < dirEnvio.length; j++) { if (dirEnvio[j].value == idFicha){ dirEnvio[j].checked = true; break; } } resumen_openComponent("4&idficha=" + idFicha, 640, 250); } function shopping_updateFicha_onLoad(idFicha) { var fichasXML = global_XMLInvoke(compra_url, "action=getfichas", false); var nodos = fichasXML.documentElement.childNodes; for (var j = 0; j < nodos.length; j++) { if (nodos[j].selectSingleNode("id").text == idFicha) { break; } } document.all('editarAtt').value = unescape( nodos[j].selectSingleNode("att").text ); document.all('editarTfn').value = unescape( nodos[j].selectSingleNode("tfn").text ); document.all('editarDir').value = unescape( nodos[j].selectSingleNode("dir").text ); document.all('editarObs').value = unescape( nodos[j].selectSingleNode("obs").text ); } function shopping_paintFichas(odocument, idFicha) { var tabla = document.all('tablaDirEnvio'); var nodos = odocument.documentElement.childNodes; while(tabla.rows[1].id == "tr") { tabla.deleteRow(1); } for (var j = 0; j < nodos.length; j++) { var tr = tabla.insertRow(tabla.rows.length - 1); tr.id = "tr"; var td = tr.insertCell(); td.height = 60; var table = document.createElement("table"); table.width = "550"; table.border = "0"; table.cellpadding = "2"; table.cellspacing = "0"; row = table.insertRow(table.rows.length); var cell = row.insertCell(); cell.width = "10"; cell.align = "right"; cell.vAlign = "top"; cell.className = "txtDatosTabla"; var radio = document.createElement(""); radio.type = "radio"; radio.value = nodos[j].selectSingleNode("id").text; cell.appendChild(radio); cell = row.insertCell(); var textarea = document.createElement("textarea"); textarea.name = "ficha"; textarea.cols = "90"; textarea.rows = "4"; var texto = ""; texto += unescape( nodos[j].selectSingleNode("att").text) + "\n"; texto += unescape( nodos[j].selectSingleNode("tfn").text) + "\n"; texto += unescape( nodos[j].selectSingleNode("dir").text) + "\n"; texto += unescape( nodos[j].selectSingleNode("obs").text); textarea.value = texto; textarea.readOnly = true; cell.appendChild(textarea); cell = row.insertCell(); var html = ""; html += "Modificar"; html += "
"; html += "Borrar"; cell.innerHTML = html; td.appendChild(table); } if (document.all('dirEnvio')[0]){ var dirEnvio = document.all( "dirEnvio" ); for (var j = 0; j < dirEnvio.length; j++) { if (dirEnvio[j].value == idFicha) { dirEnvio[j].checked = true; break; } } } else { document.all('dirEnvio').checked = true; } document.all( 'editarAtt' ).value = ""; document.all( 'editarTfn' ).value = ""; document.all( 'editarDir' ).value = ""; document.all( 'editarObs' ).value = ""; } function shopping_sendFicha(modo) { var frm = document.all("frmDatosEnvio"); var dirEnvio = document.all('dirEnvio'); var idDirEnvio; for (var j = 0; j < dirEnvio.length; j++) { if (dirEnvio[j].checked) { idDirEnvio = dirEnvio[j].value; break; } } var fichaXML = global_XMLInvoke( compra_url, "action=setficha&idficha=" + idDirEnvio, false ); // frm.submit(); if (modo == "resumen") { window.opener.resumenFicha_onLoad(idDirEnvio); window.opener.refreshCarrito(); if (idDirEnvio != "0") { formaPagoXML = global_XMLInvoke(compra_url, "action=getformapago", false); if (formaPagoXML.documentElement.selectSingleNode("id").text == "4") { resumen_openComponent(3, 640, 250); } else { window.close(); } } else { window.close(); } } else { frm.submit(); } } function resumenFicha_onLoad(idFicha) { if (idFicha == "0") { var txtFicha = "Recoger en los almacenes de masqueaire"; } else { var fichasXML = global_XMLInvoke(compra_url, "action=getfichas", false); var nodos = fichasXML.documentElement.childNodes; for (var j = 0; j < nodos.length; j++) { if (nodos[j].selectSingleNode("id").text == idFicha) { break; } } var txtFicha = ""; txtFicha += unescape( "Att.: " + nodos[j].selectSingleNode("att").text ) + "\n"; txtFicha += unescape( nodos[j].selectSingleNode("tfn").text ) + "\n"; txtFicha += unescape( nodos[j].selectSingleNode("dir").text ) + "\n"; txtFicha += unescape( nodos[j].selectSingleNode("obs").text ); } document.all('pFicha').innerText = txtFicha; } function resumen_openComponent(idComponent, ancho, alto) { var componente = window.open(VAR_HOME_FRONTEND + 'venta/shoppingsteps/component/component-container.jsp?COMPONENT_ID=' + idComponent, 'ventana', 'left=100, top=100, scrollbars=yes, menubar=no, width=' + ancho + ',height=' + alto); } function resumenFactura_onLoad() { var facturaXML = global_XMLInvoke(compra_url, "action=getdatosfactura", false); var cliente = facturaXML.documentElement; document.all("txtFacturaNombre").innerText = cliente.selectSingleNode("nombre").text; document.all("txtFacturaApellidos").innerText = cliente.selectSingleNode("apellidos").text; document.all("txtFacturaTfno").innerText = cliente.selectSingleNode("tfno").text; document.all("txtFacturaMovil").innerText = cliente.selectSingleNode("movil").text; document.all("txtFacturaFax").innerText = cliente.selectSingleNode("fax").text; document.all("txtFacturaEmail").innerText = cliente.selectSingleNode("email").text; document.all("txtFacturaEmpresa").innerText = cliente.selectSingleNode("empresa").text; document.all("txtFacturaRazon").innerText = cliente.selectSingleNode("razon").text; document.all("txtFacturaNif").innerText = cliente.selectSingleNode("nif").text; document.all("txtFacturaDireccion").innerText = cliente.selectSingleNode("direccion").text; document.all("txtFacturaProvincia").innerText = cliente.selectSingleNode("provincia").text; document.all("txtFacturaLocalidad").innerText = cliente.selectSingleNode("localidad").text; document.all("txtFacturaCp").innerText = cliente.selectSingleNode("cp").text; } function resumenFormaPago_onLoad() { var formaPagoXML = global_XMLInvoke(compra_url, "action=getformapago", false); document.all( "txtFormaPago" ).innerText = formaPagoXML.documentElement.selectSingleNode("dsc").text; var html = ""; if ( formaPagoXML.documentElement.selectSingleNode( "id" ).text == "1" ) { html = "  Tarjeta financiera"; document.all( "txtFormaPago" ).innerHTML = html; } else { document.all( "txtFormaPago" ).innerHTML = html; document.all( "txtFormaPago" ).innerText = formaPagoXML.documentElement.selectSingleNode("dsc").text; } } function doClock(){ var t=new Date(),a=doClock.arguments,str="",i,a1,lang="5"; var month=new Array('enero','enero', 'febrero','feb', 'marzo','marzo', 'abril','abr', 'mayo','mayo', 'junio','jun', 'julio','jul', 'agosto','agosto', 'septiembre','sept', 'octubre','oct', 'noviembre','nov', 'diciembre','dic'); var tday= new Array('Domingo','dom','Lunes','lun', 'Martes','mar', 'Miércoles','mié','Jueves','jue','Viernes','vie','Sábado','sáb'); for(i=0;i1)?t.getMonth()+1:month[t.getMonth()*2+Number(a1)];break; case "D": if ((Number(a1)==1) && (t.getDate()<10)) str+="0";str+=t.getDate();break; case "Y": str+=(a1=='0')?t.getFullYear():t.getFullYear().toString().substring(2);break; case "W":str+=tday[t.getDay()*2+Number(a1)];break; default: str+=unescape(a[i]);}}return str; } //var simpleSearch_url = "servlet/SimpleSearch_srv"; //EN INTEGRATION.JSP function simpleCMSSearch_onLoad() { var odocument = global_XMLInvoke( simpleSearch_url, "action=getvalues", false ); simpleCMSSearch_paint( odocument ); } function simpleCMSSearch_paint(odocument) { var cboSeccion = document.all( "SimpleCMSSearch_V_SEARCHSECCION" ); var txt = document.all( "SimpleCMSSearch_V_SEARCHTXT" ); if ( odocument.documentElement.selectSingleNode("lines").selectSingleNode("line").selectSingleNode("section") != undefined ){ simpleCMSSearch_seleccionaCombo( cboSeccion, odocument.documentElement.selectSingleNode("lines").selectSingleNode("line").selectSingleNode( "section" ).text ); } else { simpleCMSSearch_seleccionaCombo( cboSeccion, -1 ); } if ( odocument.documentElement.selectSingleNode("lines").selectSingleNode("line").selectSingleNode("txt") != undefined ) { txt.value = ""; //odocument.documentElement.selectSingleNode("lines").selectSingleNode("line").selectSingleNode("txt").text; } } function simpleCMSSearch_V_SEARCHSECCION_onChange( ) { var combo = document.all( "SimpleCMSSearch_V_SEARCHSECCION" ); var idSeccion = combo.options[combo.options.selectedIndex].value; if (idSeccion == "SECC/NO") idSeccion = "2emptyvalues"; var odocument = global_XMLInvoke( simpleSearch_url, "action=setvalues§ion=" + idSeccion, false ); var contenido = global_XMLInvoke( simpleSearch_url, "action=getvalues", false ); simpleCMSSearch_paint( odocument ); } function simpleCMSSearch_seleccionaCombo(combo, valor) { combo.options[0].selected = true; for(var i = 0; i < combo.options.length; i++) { if(combo.options[i].value == valor) { combo.options[i].selected = true; return; } } } function simpleCMSSearch_txt_onSearch() { var txt = document.all("SimpleCMSSearch_V_SEARCHTXT").value; if (txt == "") txt = "2emptyvalues"; var odocument = global_XMLInvoke( simpleSearch_url, "action=setvalues&txt=" + txt, false ); } function SimpleCMSSearch_search() { simpleCMSSearch_txt_onSearch(); if (document.all("SimpleCMSSearch_V_SEARCHTXT").value == "") { alert("Debe indicar algún criterio de búsqueda."); return; } document.all( "SimpleCMSSearch_FRM_SEARCHCONTENT" ).submit(); } function simpleCMSSearch_txt_Clear() { var odocument = global_XMLInvoke( simpleSearch_url, "action=setvalues&txt=2emptyvalues", false ); } function searchOne_Search() { var txt = document.all('searchOne_txt').value; var frm = document.all('searchOne_frm'); if (txt != "") { frm.txtSearch.value = txt; frm.submit(); } else { alert("Debe indicar algún criterio de búsqueda."); } } //\////////////////////////////////////////////////////////////////////////////////// //\ overLIB 3.51 -- This notice must remain untouched at all times. //\ Copyright Erik Bosrup 1998-2002. All rights reserved. //\ //\ By Erik Bosrup (erik@bosrup.com). Last modified 2002-11-01. //\ Portions by Dan Steinman (dansteinman.com). Additions by other people are //\ listed on the overLIB homepage. //\ //\ Get the latest version at http://www.bosrup.com/web/overlib/ //\ //\ This script is published under an open source license. Please read the license //\ agreement online at: http://www.bosrup.com/web/overlib/license.html //\ If you have questions regarding the license please contact erik@bosrup.com. //\ //\ This script library was originally created for personal use. By request it has //\ later been made public. This is free software. Do not sell this as your own //\ work, or remove this copyright notice. For full details on copying or changing //\ this script please read the license agreement at the link above. //\ //\ Please give credit on sites that use overLIB and submit changes of the script //\ so other people can use them as well. This script is free to use, don't abuse. //\////////////////////////////////////////////////////////////////////////////////// //\mini //////////////////////////////////////////////////////////////////////////////////// // CONSTANTS // Don't touch these. :) //////////////////////////////////////////////////////////////////////////////////// var INARRAY = 1; var CAPARRAY = 2; var STICKY = 3; var BACKGROUND = 4; var NOCLOSE = 5; var CAPTION = 6; var LEFT = 7; var RIGHT = 8; var CENTER = 9; var OFFSETX = 10; var OFFSETY = 11; var FGCOLOR = 12; var BGCOLOR = 13; var TEXTCOLOR = 14; var CAPCOLOR = 15; var CLOSECOLOR = 16; var WIDTH = 17; var BORDER = 18; var STATUS = 19; var AUTOSTATUS = 20; var AUTOSTATUSCAP = 21; var HEIGHT = 22; var CLOSETEXT = 23; var SNAPX = 24; var SNAPY = 25; var FIXX = 26; var FIXY = 27; var FGBACKGROUND = 28; var BGBACKGROUND = 29; var PADX = 30; // PADX2 out var PADY = 31; // PADY2 out var FULLHTML = 34; var ABOVE = 35; var BELOW = 36; var CAPICON = 37; var TEXTFONT = 38; var CAPTIONFONT = 39; var CLOSEFONT = 40; var TEXTSIZE = 41; var CAPTIONSIZE = 42; var CLOSESIZE = 43; var FRAME = 44; var TIMEOUT = 45; var FUNCTION = 46; var DELAY = 47; var HAUTO = 48; var VAUTO = 49; var CLOSECLICK = 50; var CSSOFF = 51; var CSSSTYLE = 52; var CSSCLASS = 53; var FGCLASS = 54; var BGCLASS = 55; var TEXTFONTCLASS = 56; var CAPTIONFONTCLASS = 57; var CLOSEFONTCLASS = 58; var PADUNIT = 59; var HEIGHTUNIT = 60; var WIDTHUNIT = 61; var TEXTSIZEUNIT = 62; var TEXTDECORATION = 63; var TEXTSTYLE = 64; var TEXTWEIGHT = 65; var CAPTIONSIZEUNIT = 66; var CAPTIONDECORATION = 67; var CAPTIONSTYLE = 68; var CAPTIONWEIGHT = 69; var CLOSESIZEUNIT = 70; var CLOSEDECORATION = 71; var CLOSESTYLE = 72; var CLOSEWEIGHT = 73; //////////////////////////////////////////////////////////////////////////////////// // DEFAULT CONFIGURATION // You don't have to change anything here if you don't want to. All of this can be // changed on your html page or through an overLIB call. //////////////////////////////////////////////////////////////////////////////////// // Main background color (the large area) // Usually a bright color (white, yellow etc) if (typeof ol_fgcolor == 'undefined') { var ol_fgcolor = "#CCCCFF";} // Border color and color of caption // Usually a dark color (black, brown etc) if (typeof ol_bgcolor == 'undefined') { var ol_bgcolor = "#333399";} // Text color // Usually a dark color if (typeof ol_textcolor == 'undefined') { var ol_textcolor = "#000000";} // Color of the caption text // Usually a bright color if (typeof ol_capcolor == 'undefined') { var ol_capcolor = "#FFFFFF";} // Color of "Close" when using Sticky // Usually a semi-bright color if (typeof ol_closecolor == 'undefined') { var ol_closecolor = "#9999FF";} // Font face for the main text if (typeof ol_textfont == 'undefined') { var ol_textfont = "Verdana,Arial,Helvetica";} // Font face for the caption if (typeof ol_captionfont == 'undefined') { var ol_captionfont = "Verdana,Arial,Helvetica";} // Font face for the close text if (typeof ol_closefont == 'undefined') { var ol_closefont = "Verdana,Arial,Helvetica";} // Font size for the main text // When using CSS this will be very small. if (typeof ol_textsize == 'undefined') { var ol_textsize = "1";} // Font size for the caption // When using CSS this will be very small. if (typeof ol_captionsize == 'undefined') { var ol_captionsize = "1";} // Font size for the close text // When using CSS this will be very small. if (typeof ol_closesize == 'undefined') { var ol_closesize = "1";} // Width of the popups in pixels // 100-300 pixels is typical if (typeof ol_width == 'undefined') { var ol_width = "200";} // How thick the ol_border should be in pixels // 1-3 pixels is typical if (typeof ol_border == 'undefined') { var ol_border = "1";} // How many pixels to the right/left of the cursor to show the popup // Values between 3 and 12 are best if (typeof ol_offsetx == 'undefined') { var ol_offsetx = 10;} // How many pixels to the below the cursor to show the popup // Values between 3 and 12 are best if (typeof ol_offsety == 'undefined') { var ol_offsety = 10;} // Default text for popups // Should you forget to pass something to overLIB this will be displayed. if (typeof ol_text == 'undefined') { var ol_text = "Default Text"; } // Default caption // You should leave this blank or you will have problems making non caps popups. if (typeof ol_cap == 'undefined') { var ol_cap = ""; } // Decides if sticky popups are default. // 0 for non, 1 for stickies. if (typeof ol_sticky == 'undefined') { var ol_sticky = 0; } // Default background image. Better left empty unless you always want one. if (typeof ol_background == 'undefined') { var ol_background = ""; } // Text for the closing sticky popups. // Normal is "Close". if (typeof ol_close == 'undefined') { var ol_close = "Close"; } // Default vertical alignment for popups. // It's best to leave RIGHT here. Other options are LEFT and CENTER. if (typeof ol_hpos == 'undefined') { var ol_hpos = RIGHT; } // Default status bar text when a popup is invoked. if (typeof ol_status == 'undefined') { var ol_status = ""; } // If the status bar automatically should load either text or caption. // 0=nothing, 1=text, 2=caption if (typeof ol_autostatus == 'undefined') { var ol_autostatus = 0; } // Default height for popup. Often best left alone. if (typeof ol_height == 'undefined') { var ol_height = -1; } // Horizontal grid spacing that popups will snap to. // 0 makes no grid, anything else will cause a snap to that grid spacing. if (typeof ol_snapx == 'undefined') { var ol_snapx = 0; } // Vertical grid spacing that popups will snap to. // 0 makes no grid, andthing else will cause a snap to that grid spacing. if (typeof ol_snapy == 'undefined') { var ol_snapy = 0; } // Sets the popups horizontal position to a fixed column. // Anything above -1 will cause fixed position. if (typeof ol_fixx == 'undefined') { var ol_fixx = -1; } // Sets the popups vertical position to a fixed row. // Anything above -1 will cause fixed position. if (typeof ol_fixy == 'undefined') { var ol_fixy = -1; } // Background image for the popups inside. if (typeof ol_fgbackground == 'undefined') { var ol_fgbackground = ""; } // Background image for the popups frame. if (typeof ol_bgbackground == 'undefined') { var ol_bgbackground = ""; } // How much horizontal left padding text should get by default when BACKGROUND is used. if (typeof ol_padxl == 'undefined') { var ol_padxl = 1; } // How much horizontal right padding text should get by default when BACKGROUND is used. if (typeof ol_padxr == 'undefined') { var ol_padxr = 1; } // How much vertical top padding text should get by default when BACKGROUND is used. if (typeof ol_padyt == 'undefined') { var ol_padyt = 1; } // How much vertical bottom padding text should get by default when BACKGROUND is used. if (typeof ol_padyb == 'undefined') { var ol_padyb = 1; } // If the user by default must supply all html for complete popup control. // Set to 1 to activate, 0 otherwise. if (typeof ol_fullhtml == 'undefined') { var ol_fullhtml = 0; } // Default vertical position of the popup. Default should normally be BELOW. // ABOVE only works when HEIGHT is defined. if (typeof ol_vpos == 'undefined') { var ol_vpos = BELOW; } // Default height of popup to use when placing the popup above the cursor. if (typeof ol_aboveheight == 'undefined') { var ol_aboveheight = 0; } // Default icon to place next to the popups caption. if (typeof ol_capicon == 'undefined') { var ol_capicon = ""; } // Default frame. We default to current frame if there is no frame defined. if (typeof ol_frame == 'undefined') { var ol_frame = self; } // Default timeout. By default there is no timeout. if (typeof ol_timeout == 'undefined') { var ol_timeout = 0; } // Default javascript funktion. By default there is none. if (typeof ol_function == 'undefined') { var ol_function = null; } // Default timeout. By default there is no timeout. if (typeof ol_delay == 'undefined') { var ol_delay = 0; } // If overLIB should decide the horizontal placement. if (typeof ol_hauto == 'undefined') { var ol_hauto = 0; } // If overLIB should decide the vertical placement. if (typeof ol_vauto == 'undefined') { var ol_vauto = 0; } // If the user has to click to close stickies. if (typeof ol_closeclick == 'undefined') { var ol_closeclick = 0; } // This variable determines if you want to use CSS or inline definitions. // CSSOFF=no CSS CSSSTYLE=use CSS inline styles CSSCLASS=use classes if (typeof ol_css == 'undefined') { var ol_css = CSSOFF; } // Main background class (eqv of fgcolor) // This is only used if CSS is set to use classes (ol_css = CSSCLASS) if (typeof ol_fgclass == 'undefined') { var ol_fgclass = ""; } // Frame background class (eqv of bgcolor) // This is only used if CSS is set to use classes (ol_css = CSSCLASS) if (typeof ol_bgclass == 'undefined') { var ol_bgclass = ""; } // Main font class // This is only used if CSS is set to use classes (ol_css = CSSCLASS) if (typeof ol_textfontclass == 'undefined') { var ol_textfontclass = ""; } // Caption font class // This is only used if CSS is set to use classes (ol_css = CSSCLASS) if (typeof ol_captionfontclass == 'undefined') { var ol_captionfontclass = ""; } // Close font class // This is only used if CSS is set to use classes (ol_css = CSSCLASS) if (typeof ol_closefontclass == 'undefined') { var ol_closefontclass = ""; } // Unit to be used for the text padding above // Only used if CSS inline styles are being used (ol_css = CSSSTYLE) // Options include "px", "%", "in", "cm" if (typeof ol_padunit == 'undefined') { var ol_padunit = "px";} // Unit to be used for height of popup // Only used if CSS inline styles are being used (ol_css = CSSSTYLE) // Options include "px", "%", "in", "cm" if (typeof ol_heightunit == 'undefined') { var ol_heightunit = "px";} // Unit to be used for width of popup // Only used if CSS inline styles are being used (ol_css = CSSSTYLE) // Options include "px", "%", "in", "cm" if (typeof ol_widthunit == 'undefined') { var ol_widthunit = "px";} // Font size unit for the main text // Only used if CSS inline styles are being used (ol_css = CSSSTYLE) if (typeof ol_textsizeunit == 'undefined') { var ol_textsizeunit = "px";} // Decoration of the main text ("none", "underline", "line-through" or "blink") // Only used if CSS inline styles are being used (ol_css = CSSSTYLE) if (typeof ol_textdecoration == 'undefined') { var ol_textdecoration = "none";} // Font style of the main text ("normal" or "italic") // Only used if CSS inline styles are being used (ol_css = CSSSTYLE) if (typeof ol_textstyle == 'undefined') { var ol_textstyle = "normal";} // Font weight of the main text ("normal", "bold", "bolder", "lighter", ect.) // Only used if CSS inline styles are being used (ol_css = CSSSTYLE) if (typeof ol_textweight == 'undefined') { var ol_textweight = "normal";} // Font size unit for the caption // Only used if CSS inline styles are being used (ol_css = CSSSTYLE) if (typeof ol_captionsizeunit == 'undefined') { var ol_captionsizeunit = "px";} // Decoration of the caption ("none", "underline", "line-through" or "blink") // Only used if CSS inline styles are being used (ol_css = CSSSTYLE) if (typeof ol_captiondecoration == 'undefined') { var ol_captiondecoration = "none";} // Font style of the caption ("normal" or "italic") // Only used if CSS inline styles are being used (ol_css = CSSSTYLE) if (typeof ol_captionstyle == 'undefined') { var ol_captionstyle = "normal";} // Font weight of the caption ("normal", "bold", "bolder", "lighter", ect.) // Only used if CSS inline styles are being used (ol_css = CSSSTYLE) if (typeof ol_captionweight == 'undefined') { var ol_captionweight = "bold";} // Font size unit for the close text // Only used if CSS inline styles are being used (ol_css = CSSSTYLE) if (typeof ol_closesizeunit == 'undefined') { var ol_closesizeunit = "px";} // Decoration of the close text ("none", "underline", "line-through" or "blink") // Only used if CSS inline styles are being used (ol_css = CSSSTYLE) if (typeof ol_closedecoration == 'undefined') { var ol_closedecoration = "none";} // Font style of the close text ("normal" or "italic") // Only used if CSS inline styles are being used (ol_css = CSSSTYLE) if (typeof ol_closestyle == 'undefined') { var ol_closestyle = "normal";} // Font weight of the close text ("normal", "bold", "bolder", "lighter", ect.) // Only used if CSS inline styles are being used (ol_css = CSSSTYLE) if (typeof ol_closeweight == 'undefined') { var ol_closeweight = "normal";} //////////////////////////////////////////////////////////////////////////////////// // ARRAY CONFIGURATION // You don't have to change anything here if you don't want to. The following // arrays can be filled with text and html if you don't wish to pass it from // your html page. //////////////////////////////////////////////////////////////////////////////////// // Array with texts. if (typeof ol_texts == 'undefined') { var ol_texts = new Array("Text 0", "Text 1"); } // Array with captions. if (typeof ol_caps == 'undefined') { var ol_caps = new Array("Caption 0", "Caption 1"); } //////////////////////////////////////////////////////////////////////////////////// // END CONFIGURATION // Don't change anything below this line, all configuration is above. //////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////// // INIT //////////////////////////////////////////////////////////////////////////////////// // Runtime variables init. Used for runtime only, don't change, not for config! var o3_text = ""; var o3_cap = ""; var o3_sticky = 0; var o3_background = ""; var o3_close = "Close"; var o3_hpos = RIGHT; var o3_offsetx = 2; var o3_offsety = 2; var o3_fgcolor = ""; var o3_bgcolor = ""; var o3_textcolor = ""; var o3_capcolor = ""; var o3_closecolor = ""; var o3_width = 100; var o3_border = 1; var o3_status = ""; var o3_autostatus = 0; var o3_height = -1; var o3_snapx = 0; var o3_snapy = 0; var o3_fixx = -1; var o3_fixy = -1; var o3_fgbackground = ""; var o3_bgbackground = ""; var o3_padxl = 0; var o3_padxr = 0; var o3_padyt = 0; var o3_padyb = 0; var o3_fullhtml = 0; var o3_vpos = BELOW; var o3_aboveheight = 0; var o3_capicon = ""; var o3_textfont = "Verdana,Arial,Helvetica"; var o3_captionfont = "Verdana,Arial,Helvetica"; var o3_closefont = "Verdana,Arial,Helvetica"; var o3_textsize = "1"; var o3_captionsize = "1"; var o3_closesize = "1"; var o3_frame = self; var o3_timeout = 0; var o3_timerid = 0; var o3_allowmove = 0; var o3_function = null; var o3_delay = 0; var o3_delayid = 0; var o3_hauto = 0; var o3_vauto = 0; var o3_closeclick = 0; var o3_css = CSSOFF; var o3_fgclass = ""; var o3_bgclass = ""; var o3_textfontclass = ""; var o3_captionfontclass = ""; var o3_closefontclass = ""; var o3_padunit = "px"; var o3_heightunit = "px"; var o3_widthunit = "px"; var o3_textsizeunit = "px"; var o3_textdecoration = ""; var o3_textstyle = ""; var o3_textweight = ""; var o3_captionsizeunit = "px"; var o3_captiondecoration = ""; var o3_captionstyle = ""; var o3_captionweight = ""; var o3_closesizeunit = "px"; var o3_closedecoration = ""; var o3_closestyle = ""; var o3_closeweight = ""; // Display state variables var o3_x = 0; var o3_y = 0; var o3_allow = 0; var o3_showingsticky = 0; var o3_removecounter = 0; // Our layer var over = null; var fnRef; // Decide browser version var ns4 = (navigator.appName == 'Netscape' && parseInt(navigator.appVersion) == 4); var ns6 = (document.getElementById)? true:false; var ie4 = (document.all)? true:false; if (ie4) var docRoot = 'document.body'; var ie5 = false; if (ns4) { var oW = window.innerWidth; var oH = window.innerHeight; window.onresize = function () {if (oW!=window.innerWidth||oH!=window.innerHeight) location.reload();} } // Microsoft Stupidity Check(tm). if (ie4) { if ((navigator.userAgent.indexOf('MSIE 5') > 0) || (navigator.userAgent.indexOf('MSIE 6') > 0)) { if(document.compatMode && document.compatMode == 'CSS1Compat') docRoot = 'document.documentElement'; ie5 = true; } if (ns6) { ns6 = false; } } // Capture events, alt. diffuses the overlib function. if ( (ns4) || (ie4) || (ns6)) { document.onmousemove = mouseMove if (ns4) document.captureEvents(Event.MOUSEMOVE) } else { overlib = no_overlib; nd = no_overlib; ver3fix = true; } // Fake function for 3.0 users. function no_overlib() { return ver3fix; } //////////////////////////////////////////////////////////////////////////////////// // PUBLIC FUNCTIONS //////////////////////////////////////////////////////////////////////////////////// // overlib(arg0, ..., argN) // Loads parameters into global runtime variables. function overlib() { // Load defaults to runtime. o3_text = ol_text; o3_cap = ol_cap; o3_sticky = ol_sticky; o3_background = ol_background; o3_close = ol_close; o3_hpos = ol_hpos; o3_offsetx = ol_offsetx; o3_offsety = ol_offsety; o3_fgcolor = ol_fgcolor; o3_bgcolor = ol_bgcolor; o3_textcolor = ol_textcolor; o3_capcolor = ol_capcolor; o3_closecolor = ol_closecolor; o3_width = ol_width; o3_border = ol_border; o3_status = ol_status; o3_autostatus = ol_autostatus; o3_height = ol_height; o3_snapx = ol_snapx; o3_snapy = ol_snapy; o3_fixx = ol_fixx; o3_fixy = ol_fixy; o3_fgbackground = ol_fgbackground; o3_bgbackground = ol_bgbackground; o3_padxl = ol_padxl; o3_padxr = ol_padxr; o3_padyt = ol_padyt; o3_padyb = ol_padyb; o3_fullhtml = ol_fullhtml; o3_vpos = ol_vpos; o3_aboveheight = ol_aboveheight; o3_capicon = ol_capicon; o3_textfont = ol_textfont; o3_captionfont = ol_captionfont; o3_closefont = ol_closefont; o3_textsize = ol_textsize; o3_captionsize = ol_captionsize; o3_closesize = ol_closesize; o3_timeout = ol_timeout; o3_function = ol_function; o3_delay = ol_delay; o3_hauto = ol_hauto; o3_vauto = ol_vauto; o3_closeclick = ol_closeclick; o3_css = ol_css; o3_fgclass = ol_fgclass; o3_bgclass = ol_bgclass; o3_textfontclass = ol_textfontclass; o3_captionfontclass = ol_captionfontclass; o3_closefontclass = ol_closefontclass; o3_padunit = ol_padunit; o3_heightunit = ol_heightunit; o3_widthunit = ol_widthunit; o3_textsizeunit = ol_textsizeunit; o3_textdecoration = ol_textdecoration; o3_textstyle = ol_textstyle; o3_textweight = ol_textweight; o3_captionsizeunit = ol_captionsizeunit; o3_captiondecoration = ol_captiondecoration; o3_captionstyle = ol_captionstyle; o3_captionweight = ol_captionweight; o3_closesizeunit = ol_closesizeunit; o3_closedecoration = ol_closedecoration; o3_closestyle = ol_closestyle; o3_closeweight = ol_closeweight; fnRef = ''; // Special for frame support, over must be reset... if ( (ns4) || (ie4) || (ns6) ) { if (over) cClick(); o3_frame = ol_frame; if (ns4) over = o3_frame.document.overDiv if (ie4) over = o3_frame.overDiv.style if (ns6) over = o3_frame.document.getElementById("overDiv"); } // What the next argument is expected to be. var parsemode = -1, udf, v = null; var ar = arguments; udf = (!ar.length ? 1 : 0); for (i = 0; i < ar.length; i++) { if (parsemode < 0) { // Arg is maintext, unless its a PARAMETER if (typeof ar[i] == 'number') { udf = (ar[i] == FUNCTION ? 0 : 1); i--; } else { o3_text = ar[i]; } parsemode = 0; } else { // Note: NS4 doesn't like switch cases with vars. if (ar[i] == INARRAY) { udf = 0; o3_text = ol_texts[ar[++i]]; continue; } if (ar[i] == CAPARRAY) { o3_cap = ol_caps[ar[++i]]; continue; } if (ar[i] == STICKY) { o3_sticky = 1; continue; } if (ar[i] == BACKGROUND) { o3_background = ar[++i]; continue; } if (ar[i] == NOCLOSE) { o3_close = ""; continue; } if (ar[i] == CAPTION) { o3_cap = ar[++i]; continue; } if (ar[i] == CENTER || ar[i] == LEFT || ar[i] == RIGHT) { o3_hpos = ar[i]; continue; } if (ar[i] == OFFSETX) { o3_offsetx = ar[++i]; continue; } if (ar[i] == OFFSETY) { o3_offsety = ar[++i]; continue; } if (ar[i] == FGCOLOR) { o3_fgcolor = ar[++i]; continue; } if (ar[i] == BGCOLOR) { o3_bgcolor = ar[++i]; continue; } if (ar[i] == TEXTCOLOR) { o3_textcolor = ar[++i]; continue; } if (ar[i] == CAPCOLOR) { o3_capcolor = ar[++i]; continue; } if (ar[i] == CLOSECOLOR) { o3_closecolor = ar[++i]; continue; } if (ar[i] == WIDTH) { o3_width = ar[++i]; continue; } if (ar[i] == BORDER) { o3_border = ar[++i]; continue; } if (ar[i] == STATUS) { o3_status = ar[++i]; continue; } if (ar[i] == AUTOSTATUS) { o3_autostatus = (o3_autostatus == 1) ? 0 : 1; continue; } if (ar[i] == AUTOSTATUSCAP) { o3_autostatus = (o3_autostatus == 2) ? 0 : 2; continue; } if (ar[i] == HEIGHT) { o3_height = ar[++i]; o3_aboveheight = ar[i]; continue; } // Same param again. if (ar[i] == CLOSETEXT) { o3_close = ar[++i]; continue; } if (ar[i] == SNAPX) { o3_snapx = ar[++i]; continue; } if (ar[i] == SNAPY) { o3_snapy = ar[++i]; continue; } if (ar[i] == FIXX) { o3_fixx = ar[++i]; continue; } if (ar[i] == FIXY) { o3_fixy = ar[++i]; continue; } if (ar[i] == FGBACKGROUND) { o3_fgbackground = ar[++i]; continue; } if (ar[i] == BGBACKGROUND) { o3_bgbackground = ar[++i]; continue; } if (ar[i] == PADX) { o3_padxl = ar[++i]; o3_padxr = ar[++i]; continue; } if (ar[i] == PADY) { o3_padyt = ar[++i]; o3_padyb = ar[++i]; continue; } if (ar[i] == FULLHTML) { o3_fullhtml = 1; continue; } if (ar[i] == BELOW || ar[i] == ABOVE) { o3_vpos = ar[i]; continue; } if (ar[i] == CAPICON) { o3_capicon = ar[++i]; continue; } if (ar[i] == TEXTFONT) { o3_textfont = ar[++i]; continue; } if (ar[i] == CAPTIONFONT) { o3_captionfont = ar[++i]; continue; } if (ar[i] == CLOSEFONT) { o3_closefont = ar[++i]; continue; } if (ar[i] == TEXTSIZE) { o3_textsize = ar[++i]; continue; } if (ar[i] == CAPTIONSIZE) { o3_captionsize = ar[++i]; continue; } if (ar[i] == CLOSESIZE) { o3_closesize = ar[++i]; continue; } if (ar[i] == FRAME) { opt_FRAME(ar[++i]); continue; } if (ar[i] == TIMEOUT) { o3_timeout = ar[++i]; continue; } if (ar[i] == FUNCTION) { udf = 0; if (typeof ar[i+1] != 'number') v = ar[++i]; opt_FUNCTION(v); continue; } if (ar[i] == DELAY) { o3_delay = ar[++i]; continue; } if (ar[i] == HAUTO) { o3_hauto = (o3_hauto == 0) ? 1 : 0; continue; } if (ar[i] == VAUTO) { o3_vauto = (o3_vauto == 0) ? 1 : 0; continue; } if (ar[i] == CLOSECLICK) { o3_closeclick = (o3_closeclick == 0) ? 1 : 0; continue; } if (ar[i] == CSSOFF) { o3_css = ar[i]; continue; } if (ar[i] == CSSSTYLE) { o3_css = ar[i]; continue; } if (ar[i] == CSSCLASS) { o3_css = ar[i]; continue; } if (ar[i] == FGCLASS) { o3_fgclass = ar[++i]; continue; } if (ar[i] == BGCLASS) { o3_bgclass = ar[++i]; continue; } if (ar[i] == TEXTFONTCLASS) { o3_textfontclass = ar[++i]; continue; } if (ar[i] == CAPTIONFONTCLASS) { o3_captionfontclass = ar[++i]; continue; } if (ar[i] == CLOSEFONTCLASS) { o3_closefontclass = ar[++i]; continue; } if (ar[i] == PADUNIT) { o3_padunit = ar[++i]; continue; } if (ar[i] == HEIGHTUNIT) { o3_heightunit = ar[++i]; continue; } if (ar[i] == WIDTHUNIT) { o3_widthunit = ar[++i]; continue; } if (ar[i] == TEXTSIZEUNIT) { o3_textsizeunit = ar[++i]; continue; } if (ar[i] == TEXTDECORATION) { o3_textdecoration = ar[++i]; continue; } if (ar[i] == TEXTSTYLE) { o3_textstyle = ar[++i]; continue; } if (ar[i] == TEXTWEIGHT) { o3_textweight = ar[++i]; continue; } if (ar[i] == CAPTIONSIZEUNIT) { o3_captionsizeunit = ar[++i]; continue; } if (ar[i] == CAPTIONDECORATION) { o3_captiondecoration = ar[++i]; continue; } if (ar[i] == CAPTIONSTYLE) { o3_captionstyle = ar[++i]; continue; } if (ar[i] == CAPTIONWEIGHT) { o3_captionweight = ar[++i]; continue; } if (ar[i] == CLOSESIZEUNIT) { o3_closesizeunit = ar[++i]; continue; } if (ar[i] == CLOSEDECORATION) { o3_closedecoration = ar[++i]; continue; } if (ar[i] == CLOSESTYLE) { o3_closestyle = ar[++i]; continue; } if (ar[i] == CLOSEWEIGHT) { o3_closeweight = ar[++i]; continue; } } } if (udf && o3_function) o3_text = o3_function(); if (o3_delay == 0) { return overlib351(); } else { o3_delayid = setTimeout("overlib351()", o3_delay); return false; } } // Clears popups if appropriate function nd() { if ( o3_removecounter >= 1 ) { o3_showingsticky = 0 }; if ( (ns4) || (ie4) || (ns6) ) { if ( o3_showingsticky == 0 ) { o3_allowmove = 0; if (over != null) hideObject(over); } else { o3_removecounter++; } } return true; } //////////////////////////////////////////////////////////////////////////////////// // OVERLIB 3.51 FUNCTION //////////////////////////////////////////////////////////////////////////////////// // This function decides what it is we want to display and how we want it done. function overlib351() { // Make layer content var layerhtml; if (o3_background != "" || o3_fullhtml) { // Use background instead of box. layerhtml = ol_content_background(o3_text, o3_background, o3_fullhtml); } else { // They want a popup box. // Prepare popup background if (o3_fgbackground != "" && o3_css == CSSOFF) { o3_fgbackground = "BACKGROUND=\""+o3_fgbackground+"\""; } if (o3_bgbackground != "" && o3_css == CSSOFF) { o3_bgbackground = "BACKGROUND=\""+o3_bgbackground+"\""; } // Prepare popup colors if (o3_fgcolor != "" && o3_css == CSSOFF) { o3_fgcolor = "BGCOLOR=\""+o3_fgcolor+"\""; } if (o3_bgcolor != "" && o3_css == CSSOFF) { o3_bgcolor = "BGCOLOR=\""+o3_bgcolor+"\""; } // Prepare popup height if (o3_height > 0 && o3_css == CSSOFF) { o3_height = "HEIGHT=" + o3_height; } else { o3_height = ""; } // Decide which kinda box. if (o3_cap == "") { // Plain layerhtml = ol_content_simple(o3_text); } else { // With caption if (o3_sticky) { // Show close text layerhtml = ol_content_caption(o3_text, o3_cap, o3_close); } else { // No close text layerhtml = ol_content_caption(o3_text, o3_cap, ""); } } } // We want it to stick! if (o3_sticky) { if (o3_timerid > 0) { clearTimeout(o3_timerid); o3_timerid = 0; } o3_showingsticky = 1; o3_removecounter = 0; } // Write layer layerWrite(layerhtml); // Prepare status bar if (o3_autostatus > 0) { o3_status = o3_text; if (o3_autostatus > 1) { o3_status = o3_cap; } } // When placing the layer the first time, even stickies may be moved. o3_allowmove = 0; // Initiate a timer for timeout if (o3_timeout > 0) { if (o3_timerid > 0) clearTimeout(o3_timerid); o3_timerid = setTimeout("cClick()", o3_timeout); } // Show layer disp(o3_status); // Stickies should stay where they are. if (o3_sticky) o3_allowmove = 0; return (o3_status != ''); } //////////////////////////////////////////////////////////////////////////////////// // LAYER GENERATION FUNCTIONS //////////////////////////////////////////////////////////////////////////////////// // Makes simple table without caption function ol_content_simple(text) { if (o3_css == CSSCLASS) txt = "
"+text+"
"; if (o3_css == CSSSTYLE) txt = "
"+text+"
"; if (o3_css == CSSOFF) txt = "
"+text+"
"; set_background(""); return txt; } // Makes table with caption and optional close link function ol_content_caption(text, title, close) { closing = ""; closeevent = "onMouseOver"; if (o3_closeclick == 1) closeevent = "onClick"; if (o3_capicon != "") o3_capicon = " "; if (close != "") { if (o3_css == CSSCLASS) closing = ""+close+""; if (o3_css == CSSSTYLE) closing = ""+close+""; if (o3_css == CSSOFF) closing = ""+close+""; } if (o3_css == CSSCLASS) txt = "
"+closing+"
"+o3_capicon+title+"
"+text+"
"; if (o3_css == CSSSTYLE) txt = "
"+closing+"
"+o3_capicon+title+"
"+text+"
"; if (o3_css == CSSOFF) txt = "
"+closing+"
"+o3_capicon+title+"
"+text+"
"; set_background(""); return txt; } // Sets the background picture, padding and lots more. :) function ol_content_background(text, picture, hasfullhtml) { var txt; if (hasfullhtml) { txt = text; } else { var pU, hU, wU; pU = (o3_padunit == '%' ? '%' : ''); hU = (o3_heightunit == '%' ? '%' : ''); wU = (o3_widthunit == '%' ? '%' : ''); if (o3_css == CSSCLASS) txt = "
"+text+"
"; if (o3_css == CSSSTYLE) txt = "
"+text+"
"; if (o3_css == CSSOFF) txt = "
"+text+"
"; } set_background(picture); return txt; } // Loads a picture into the div. function set_background(pic) { if (pic == "") { if (ns4) over.background.src = null; if (ie4) over.backgroundImage = "none"; if (ns6) over.style.backgroundImage = "none"; } else { if (ns4) { over.background.src = pic; } else if (ie4) { over.backgroundImage = "url("+pic+")"; } else if (ns6) { over.style.backgroundImage = "url("+pic+")"; } } } //////////////////////////////////////////////////////////////////////////////////// // HANDLING FUNCTIONS //////////////////////////////////////////////////////////////////////////////////// // Displays the popup function disp(statustext) { if ( (ns4) || (ie4) || (ns6) ) { if (o3_allowmove == 0) { placeLayer(); showObject(over); o3_allowmove = 1; } } if (statustext != "") { self.status = statustext; } } // Decides where we want the popup. function placeLayer() { var placeX, placeY; // HORIZONTAL PLACEMENT if (o3_fixx > -1) { // Fixed position placeX = o3_fixx; } else { winoffset = (ie4) ? eval('o3_frame.'+docRoot+'.scrollLeft') : o3_frame.pageXOffset; if (ie4) iwidth = eval('o3_frame.'+docRoot+'.clientWidth'); if (ns4 || ns6) iwidth = o3_frame.innerWidth; // If HAUTO, decide what to use. if (o3_hauto == 1) { if ( (o3_x - winoffset) > ((eval(iwidth)) / 2)) { o3_hpos = LEFT; } else { o3_hpos = RIGHT; } } // From mouse if (o3_hpos == CENTER) { // Center placeX = o3_x+o3_offsetx-(o3_width/2); if (placeX < winoffset) placeX = winoffset; } if (o3_hpos == RIGHT) { // Right placeX = o3_x+o3_offsetx; if ( (eval(placeX) + eval(o3_width)) > (winoffset + iwidth) ) { placeX = iwidth + winoffset - o3_width; if (placeX < 0) placeX = 0; } } if (o3_hpos == LEFT) { // Left placeX = o3_x-o3_offsetx-o3_width; if (placeX < winoffset) placeX = winoffset; } // Snapping! if (o3_snapx > 1) { var snapping = placeX % o3_snapx; if (o3_hpos == LEFT) { placeX = placeX - (o3_snapx + snapping); } else { // CENTER and RIGHT placeX = placeX + (o3_snapx - snapping); } if (placeX < winoffset) placeX = winoffset; } } // VERTICAL PLACEMENT if (o3_fixy > -1) { // Fixed position placeY = o3_fixy; } else { scrolloffset = (ie4) ? eval('o3_frame.'+docRoot+'.scrollTop') : o3_frame.pageYOffset; // If VAUTO, decide what to use. if (o3_vauto == 1) { if (ie4) iheight = eval('o3_frame.'+docRoot+'.clientHeight'); if (ns4 || ns6) iheight = o3_frame.innerHeight; iheight = (eval(iheight)) / 2; if ( (o3_y - scrolloffset) > iheight) { o3_vpos = ABOVE; } else { o3_vpos = BELOW; } } // From mouse if (o3_vpos == ABOVE) { if (o3_aboveheight == 0) { var divref = (ie4) ? o3_frame.document.all['overDiv'] : over; o3_aboveheight = (ns4) ? divref.clip.height : divref.offsetHeight; } placeY = o3_y - (o3_aboveheight + o3_offsety); if (placeY < scrolloffset) placeY = scrolloffset; } else { // BELOW placeY = o3_y + o3_offsety; } // Snapping! if (o3_snapy > 1) { var snapping = placeY % o3_snapy; if (o3_aboveheight > 0 && o3_vpos == ABOVE) { placeY = placeY - (o3_snapy + snapping); } else { placeY = placeY + (o3_snapy - snapping); } if (placeY < scrolloffset) placeY = scrolloffset; } } // Actually move the object. repositionTo(over, placeX, placeY); } // Moves the layer function mouseMove(e) { if ( (ns4) || (ns6) ) {o3_x=e.pageX; o3_y=e.pageY;} if (ie4) {o3_x=event.x; o3_y=event.y;} if (ie5) {o3_x=eval('event.x+o3_frame.'+docRoot+'.scrollLeft'); o3_y=eval('event.y+o3_frame.'+docRoot+'.scrollTop');} if (o3_allowmove == 1) { placeLayer(); } } // The Close onMouseOver function for stickies function cClick() { hideObject(over); o3_showingsticky = 0; return false; } // Makes sure target frame has overLIB function compatibleframe(frameid) { if (ns4) { if (typeof frameid.document.overDiv =='undefined') return false; } else if (ie4) { if (typeof frameid.document.all["overDiv"] =='undefined') return false; } else if (ns6) { if (frameid.document.getElementById('overDiv') == null) return false; } return true; } //////////////////////////////////////////////////////////////////////////////////// // LAYER FUNCTIONS //////////////////////////////////////////////////////////////////////////////////// // Writes to a layer function layerWrite(txt) { txt += "\n"; if (ns4) { var lyr = o3_frame.document.overDiv.document lyr.write(txt) lyr.close() } else if (ie4) { o3_frame.document.all["overDiv"].innerHTML = txt } else if (ns6) { range = o3_frame.document.createRange(); range.setStartBefore(over); domfrag = range.createContextualFragment(txt); while (over.hasChildNodes()) { over.removeChild(over.lastChild); } over.appendChild(domfrag); } } // Make an object visible function showObject(obj) { if (ns4) obj.visibility = "show"; else if (ie4) obj.visibility = "visible"; else if (ns6) obj.style.visibility = "visible"; } // Hides an object function hideObject(obj) { if (ns4) obj.visibility = "hide"; else if (ie4) obj.visibility = "hidden"; else if (ns6) obj.style.visibility = "hidden"; if (o3_timerid > 0) clearTimeout(o3_timerid); if (o3_delayid > 0) clearTimeout(o3_delayid); o3_timerid = 0; o3_delayid = 0; self.status = ""; } // Move a layer function repositionTo(obj,xL,yL) { if ( (ns4) || (ie4) ) { obj.left = (ie4 ? xL + 'px' : xL); obj.top = (ie4 ? yL + 'px' : yL); } else if (ns6) { obj.style.left = xL + "px"; obj.style.top = yL+ "px"; } } function getFrameRef(thisFrame, ofrm) { var retVal = ''; for (var i=0; i 0) { retVal = getFrameRef(thisFrame[i],ofrm); if (retVal == '') continue; } else if (thisFrame[i] != ofrm) continue; retVal = '['+i+']' + retVal; break; } return retVal; } //////////////////////////////////////////////////////////////////////////////////// // PARSER FUNCTIONS //////////////////////////////////////////////////////////////////////////////////// // Defines which frame we should point to. function opt_FRAME(frm) { o3_frame = compatibleframe(frm) ? frm : ol_frame; if (o3_frame != ol_frame) { var tFrm = getFrameRef(top.frames, o3_frame); var sFrm = getFrameRef(top.frames, ol_frame); if (sFrm.length == tFrm.length) { l = tFrm.lastIndexOf('['); if (l) { while(sFrm.substring(0,l) != tFrm.substring(0,l)) l = tFrm.lastIndexOf('[',l-1); tFrm = tFrm.substr(l); sFrm = sFrm.substr(l); } } var cnt = 0, p = '', str = tFrm; while((k = str.lastIndexOf('[')) != -1) { cnt++; str = str.substring(0,k); } for (var i=0; i