var marked_row = new Array; function marcar(theRow, theRowNum, theAction, theDefaultColor, thePointerColor, theMarkColor) { var theCells = null; if ((thePointerColor == '' && theMarkColor == '') || typeof(theRow.style) == 'undefined') { return false; } if (typeof(document.getElementsByTagName) != 'undefined') { theCells = theRow.getElementsByTagName('td'); } else if (typeof(theRow.cells) != 'undefined') { theCells = theRow.cells; } else { return false; } var rowCellsCnt = theCells.length; var domDetect = null; var currentColor = null; var newColor = null; if (typeof(window.opera) == 'undefined' && typeof(theCells[0].getAttribute) != 'undefined') { currentColor = theCells[0].getAttribute('bgcolor'); domDetect = true; } else { currentColor = theCells[0].style.backgroundColor; domDetect = false; } if (currentColor == '' || currentColor.toLowerCase() == theDefaultColor.toLowerCase()) { if (theAction == 'over' && thePointerColor != '') { newColor = thePointerColor; } else if (theAction == 'click' && theMarkColor != '') { newColor = theMarkColor; marked_row[theRowNum] = true; } } else if (currentColor.toLowerCase() == thePointerColor.toLowerCase() && (typeof(marked_row[theRowNum]) == 'undefined' || !marked_row[theRowNum])) { if (theAction == 'out') { newColor = theDefaultColor; } else if (theAction == 'click' && theMarkColor != '') { newColor = theMarkColor; marked_row[theRowNum] = true; } } else if (currentColor.toLowerCase() == theMarkColor.toLowerCase()) { if (theAction == 'click') { newColor = (thePointerColor != '') ? thePointerColor : theDefaultColor; marked_row[theRowNum] = (typeof(marked_row[theRowNum]) == 'undefined' || !marked_row[theRowNum]) ? true : null; } } if (newColor) { var c = null; // 5.1 ... with DOM compatible browsers except Opera if (domDetect) { for (c = 0; c < rowCellsCnt; c++) { theCells[c].setAttribute('bgcolor', newColor, 0); } } else { for (c = 0; c < rowCellsCnt; c++) { theCells[c].style.backgroundColor = newColor; } } } return true; } //Abre y cierra los elementos de menú function openClose(sel) { elemento = document.getElementById(sel); if (elemento.style['display'] == "none") { elemento.style['display'] = "block"; } else { elemento.style['display'] = "none"; } } function abre_popup(tipo) { alto = 390; ancho = 465; izquierda = (screen.width / 2) - (ancho / 2); superior = (screen.height / 2) - (alto / 2); newwin=window.open("popup_foto.php?idB=&tp=" + tipo,"interior","height="+alto+",width="+ancho+",location=no,directories=no,menubar=no,resizable=auto,copyhistory=no,scrollbars=no,status=no,titlebar=no,toolbar=no,left=" + izquierda + ",top=" + superior) } function isla() { alto = 240; ancho = 465; izquierda = (screen.width / 2) - (ancho / 2); superior = (screen.height / 2) - (alto / 2); newwin=window.open("popup_isla.php?idB=","isla","height="+alto+",width="+ancho+",location=no,directories=no,menubar=no,resizable=auto,copyhistory=no,scrollbars=no,status=no,titlebar=no,toolbar=no,left=" + izquierda + ",top=" + superior) } function tarifas() { alto = 310; ancho = 570; izquierda = (screen.width / 2) - (ancho / 2); superior = (screen.height / 2) - (alto / 2); newwin=window.open("popup_tarifa.php?idB=","tarifas","height="+alto+",width="+ancho+",location=no,directories=no,menubar=no,resizable=auto,copyhistory=no,scrollbars=yes,status=no,titlebar=no,toolbar=no,left=" + izquierda + ",top=" + superior) } function checkEmail(str) { if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/.test(str)){ return true; } return false; } function validaForm(formulario) { if (formulario.formContacto.value == "" || formulario.formTelefono.value == "") { alert('Debe indicarnos una persona de contacto y un número de teléfono válidos.'); return false; } else { if (!checkEmail(formulario.formMail.value)) { alert('Debe indicarnos una dirección de correo electrónico correcta.'); return false; } else { if (typeof(formulario.formImagen)!="undefined" && formulario.formImagen.value=="") { alert('Debe repetir el texto de la imagen'); return false; } else { return true; } } } } function validaForm2(formulario) { document.getElementById('accion').value="contacto"; if (formulario.formContacto.value == "" || formulario.formTelefono.value == "") { alert('Debe indicarnos una persona de contacto y un número de teléfono válidos.'); return false; } else { if (!checkEmail(formulario.formMail.value)) { alert('Debe indicarnos una dirección de correo electrónico correcta.'); return false; } else { if (typeof(formulario.formImagen)!="undefined" && formulario.formImagen.value=="") { alert('Debe repetir el texto de la imagen'); return false; } else { return true; } } } } function abreFilas(fila) { if (document.getElementById(fila).style.display == "none") { document.getElementById(fila).style.display = "table-row"; } else { document.getElementById(fila).style.display = "none"; } } //FUNCION BUSCADOR BROKER/CHARTER function buscador() { if(document.getElementById('idPrincipal').value == 1) //si le llega el valor 1 = opciones broker { document.getElementById('idModelo').style.display = "block"; document.getElementById('idEstado').style.display = "block"; document.getElementById('idTipo').style.display = "block"; document.getElementById('idEslora').style.display = "block"; document.getElementById('idAnyo').style.display = "block"; document.getElementById('idPrecio').style.display = "block"; document.getElementById('idBase').style.display = "none"; document.getElementById('idCamarotes').style.display = "none"; document.getElementById('idZona').style.display = "none"; } else { document.getElementById('idZona').style.display = "block"; document.getElementById('idBase').style.display = "block"; //sino = opciones charter document.getElementById('idTipo').style.display = "block"; document.getElementById('idEslora').style.display = "block"; document.getElementById('idCamarotes').style.display = "block"; document.getElementById('idModelo').style.display = "none"; document.getElementById('idEstado').style.display = "none"; document.getElementById('idAnyo').style.display = "none"; document.getElementById('idPrecio').style.display = "none"; } } //FUNCION QUE DISTINGUE ENTRE ZONAS DE CHARTER function action_buscador() { if(document.getElementById('idPrincipal').value == 1) //si le llega el valor 1 = opciones broker { var rediBroker = 'venta-de-barcos.html'; document.getElementById('idBusca').action = rediBroker; //para que nos muestre la página de ventas/broker } else //sino = opciones charter { if(document.getElementById('idBase').value !=0){ var valorBase = document.getElementById('idBase').value; var rediCharter = 'alquiler-de-barcos.html?idB='+valorBase; var base_sin_espacios = document.getElementById('idBase').options[document.getElementById('idBase').selectedIndex].text; base_sin_espacios = base_sin_espacios.replace(" ", "-"); //var rediCharter = 'alquiler-de-barcos-en-'+document.getElementById('idBase').options[document.getElementById('idBase').selectedIndex].text+'-'+valorBase+'.html'; document.getElementById('idBusca').action = rediCharter; }else{ var rediCharterBusca = 'buscador-alquiler.html'; document.getElementById('idBusca').action = rediCharterBusca; } } document.getElementById('idBusca').submit(); } //FUNCION COMBO DINAMICO EN CHARTER function cambio_zona(ruta) { document.getElementById('idBusca').action=ruta; document.getElementById('idBusca').submit(); }