// JavaScript Document var sRepeat=null; function doScroller(src, amount) { if (amount==null) amount=10; if (src == "scrolleadorimg") { //document.getElementById(src).scrollLeft-=amount; document.getElementById(src).scrollTop-=amount; } else { document.getElementById(src).scrollTop-=amount; } if (sRepeat==null) sRepeat=setInterval("doScroller('"+src+"',"+amount+")",100); return false } window.document.onmouseout = new Function("clearInterval(sRepeat);sRepeat=null"); window.document.ondragstart = new Function("return false"); function checkEmail(str) { if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/.test(str)){ return true; } return false; } function validaAyuda() { if (!checkEmail(document.frmAyuda.formEmail.value) || document.frmAyuda.formNombre.value == "" || document.frmAyuda.formTelefono.value == "") { alert('Por favor, rellena correctamente todos los campos marcados con *.'); return false; } else { if (document.frmAyuda.formCompra.checked == false && document.frmAyuda.formVenta.checked == false && document.frmAyuda.formAlquiler.checked == false && document.frmAyuda.formOpcionCompra.checked == false && document.frmAyuda.formTraspaso.checked == false) { alert("Por favor, selecciona al menos un tipo de operación al que se refiere tu consulta."); return false; } else { return true; } } } function ventana(nombre,codigo,extra){ if (nombre == "condiciones"){ window.open('condiciones.php','condiciones','toolbar=no,location=no,status=yes,menubar=no, scrollbars=yes,resizable=yes,width=500,height=550,top=50,left=50'); } else if (nombre == "gasNatural"){ window.open('promo_gas_natural.php','gasNatural','toolbar=no,location=no,status=yes,menubar=no, scrollbars=yes,resizable=yes,width=500,height=550,top=50,left=50'); } else if (nombre == "insercion_vivienda"){ window.open('condiciones_viviendas.php','condiciones','toolbar=no,location=no,status=yes,menubar=no, scrollbars=yes,resizable=yes,width=500,height=550,top=50,left=50'); } } function imprimir(codigo){ window.open('ficha.php?cd='+codigo,'Impresion','toolbar=no,location=no,status=yes,menubar=no, scrollbars=yes,resizable=yes,width=800,height=600,top=50,left=50'); } function validaRecomendar() { if (document.frmDatos.formNombre.value == "" || document.frmDatos.formNombreDestinatario_1.value == "" || !checkEmail(document.frmDatos.formEmailDestinatario_1.value)) { alert("Por favor, introduce al menos tu nombre y el nombre y email correctos del destinatario."); return false; } else { if (document.frmDatos.formNombreDestinatario_2.value != "" || document.frmDatos.formEmailDestinatario_2.value != "") { if (document.frmDatos.formNombreDestinatario_2.value == "" || !checkEmail(document.frmDatos.formEmailDestinatario_2.value )) { alert("Por favor, introduce nombre y un email correctos para el destinatario 2."); return false; } } if (document.frmDatos.formNombreDestinatario_3.value != "" || document.frmDatos.formEmailDestinatario_3.value != "") { if (document.frmDatos.formNombreDestinatario_3.value == "" || !checkEmail(document.frmDatos.formEmailDestinatario_3.value)) { alert("Por favor, introduce nombre y un email correctos para el destinatario 3."); return false; } } return true; } } 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; window.status = 'Ver detalles de este inmueble'; } 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; window.status = ''; } else if (theAction == 'click' && theMarkColor != '') { newColor = theMarkColor; marked_row[theRowNum] = true; } } else if (currentColor.toLowerCase() == theMarkColor.toLowerCase()) { if (AtheAction == '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; } 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&&i0) { ajax.requestFile = 'utils/dame_precios_filtro.php?operacion='+operacion; ajax.onCompletion = creaPreciosFiltro; ajax.runAJAX(); } } function creaPreciosFiltro() { var obj = document.getElementById('precio'); eval(ajax.response); }