function ampliarFoto(urlfoto,width,height) {
	window.open(urlfoto,'ampliarFoto', 'scrollbars=no,width=' + width + ',height=' + height);
}
function filaIn(src,color_entrada) { 
    src.bgColor=color_entrada;src.style.cursor="hand"; 
} 
function filaOut(src,color_default) { 
    src.bgColor=color_default;src.style.cursor="default"; 
} 
function abrirVentanaCentrada(url, nombre, width, height, features) {
	window.open(url, nombre, "width=" + width + ",height=" + height + ",left=" +((screen.availWidth - width) / 2)+ ",top=" +((screen.availHeight - height) / 2)+(features!='' ? ','+features : ''));
}
function fichaInmobiliaria() {
	abrirVentanaCentrada("ficha_inmobiliaria.htm", "ficha", 400, 150)
}
function searchEstateAgent() {
	if(document.forms[0].selectEstateAgent.selectedIndex == 0 || document.forms[0].selectEstateAgent.selectedIndex == -1) {
		document.location.href = "paginas/resultado_busqueda_inmobiliaria_lista.htm";
	} else {
		document.location.href = "paginas/resultado_busqueda_inmobiliaria_ficha.htm";		
	}
}
function dondeSPA(idioma) {
	abrirVentanaCentrada("paginas/dondeSPA.htm", "dondeSPA", 400, 175)
	stickyhide()
}
function abrirPromocion(publicacion) {
	abrirVentanaCentrada("../paginas/promocion_" + publicacion + ".htm", "promocion", 400, 480)
}
//Funcion Donde encontrar la revista
function donde(publicacion, en) {
	abrirVentanaCentrada('../paginas/donde_encontrar.htm', 'enviarcliente', 500, 200);
}
// Funciones que estaban en pagina principal
function do_accion(accion) {
	document.frmGoto.accion.value = accion
	document.frmGoto.submit()
}
function do_accion_cod(accion, cod) {
	document.frmGoto.accion.value = accion
	document.frmGoto.cod.value = cod
	document.frmGoto.submit()
}
function mostrarPublicacion(publicacion) {
	do_accion_cod('publicacion', publicacion)
}
function mostrarSoftware(parte) {
	do_accion_cod('software', parte)
}
function do_accion_buscador(accion) {
	document.frmBuscador.accion.value = accion
	document.frmBuscador.inmo_codigo_inmu.value = ''
	document.frmBuscador.submit()
}
function do_accion_buscador_inmo_codigo(accion, inmo_codigo) {
	document.frmBuscador.reset()
	document.frmBuscador.accion.value = accion
	document.frmBuscador.inmo_codigo_inmu.value = inmo_codigo
	document.frmBuscador.submit()
}
function do_accion_cod_w(accion, cod, w_properties) {
	document.frmGoto.accion.value = accion
	document.frmGoto.cod.value = cod
	var win_properties = 'left=' + ((screen.availWidth - 400) / 2) + ',top=' + ((screen.availHeight - 300) / 2)
	if (w_properties != '')
		win_properties += ',' + w_properties
	window.open('blank.html', accion, win_properties)
	var old_target = document.frmGoto.target
	document.frmGoto.target = accion
	document.frmGoto.submit()
	document.frmGoto.target = old_target
}
function do_accion_resultado(accion) {
	document.frmResultado.accion.value = accion
	document.frmResultado.submit()
}
function do_accion_resultado_cod(accion, cod) {
	document.frmResultado.accion.value = accion
	document.frmResultado.cod.value = cod
	document.frmResultado.submit()
}
function do_send_mail(frm) {
	if (frm.text.value == '') {
		frm.text.focus()
		alert('Indique el texto a enviar')
		return
	} else if (frm.text.value.length > 500) {
		frm.text.focus()
		alert('El texto es demasiado largo')
		return
	}
	if (frm.name.value == '') {
		frm.name.focus()
		alert('Indique su nombre')
		return
	}
	if (frm.email.value == '' && frm.telephone.value == '') {
		frm.email.focus()
		alert('Indique su email o tel?fono')
		return
	}
	if (frm.email.value != '') {
		var er_mail = /^[a-zA-Z0-9\.\-_]+[@][a-zA-Z0-9\-_]+[\.][a-zA-Z0-9\-_\.]+$/
		if (!er_mail.test(frm.email.value)) {
			frm.email.focus()
			alert('Indique una direcci?n de correo electr?nico v?lida')
			return
		}
	}
	if (!frm.cb_avisolegal.checked) {
		alert('Debe aceptar las condiciones descritas en el aviso legal para realizar esta acci?n');
		return
	}
	var accion = 'sendmail'
	var win_properties = 'left=' + ((screen.availWidth - 400) / 2) + ',top=' + ((screen.availHeight - 300) / 2)
	win_properties += ',width=450,height=200,status=yes,resizable=yes,scrollbars=yes'
	window.open('blank.html', accion, win_properties)
	var old_target = frm.target
	frm.target = accion
	frm.submit()
	frm.target = old_target
}
function do_send_friend(frm) {
	if (frm.text.value == '') {
		frm.text.focus()
		alert('Indique el texto a enviar')
		return
	} else if (frm.text.value.length > 500) {
		frm.text.focus()
		alert('El texto es demasiado largo')
		return
	}
	if (frm.email_friend.value == '') {
		frm.email_friend.focus()
		alert('Indique el correo de un amigo')
		return
	}
	if (frm.email_friend.value != '') {
		var er_mail = /^[a-zA-Z0-9\.\-_]+[@][a-zA-Z0-9\-_]+[\.][a-zA-Z0-9\-_\.]+$/
		if (!er_mail.test(frm.email_friend.value)) {
			frm.email_friend.focus()
			alert('Indique una direcci?n de correo electr?nico v?lida')
			return
		}
	}
	var accion = 'sendmail'
	var win_properties = 'left=' + ((screen.availWidth - 400) / 2) + ',top=' + ((screen.availHeight - 300) / 2)
	win_properties += ',width=450,height=200,status=yes,resizable=yes,scrollbars=yes'
	window.open('blank.html', accion, win_properties)
	var old_target = frm.target
	frm.target = accion
	frm.submit()
	frm.target = old_target
}
function imprimirInmueble(cod) {
	var frm = document.frmGoto
	var accion = 'imprimir_inmueble'
	var win_properties = 'left=' + ((screen.availWidth - 400) / 2) + ',top=' + ((screen.availHeight - 300) / 2)
	win_properties += ',width=600,height=400,status=yes,resizable=yes,scrollbars=yes'
	window.open('blank.html', accion, win_properties)
	var old_target = frm.target
	frm.target = accion
	frm.cod.value = cod
	frm.accion.value = accion
	frm.submit()
	frm.target = old_target
}
function anunciesuinmueble() {
	var frm = document.frmGoto
	var accion = 'anunciesuinmueble'
	var win_properties = 'left=' + ((screen.availWidth - 400) / 2) + ',top=' + ((screen.availHeight - 300) / 2)
	win_properties += ',width=600,height=400,status=yes,resizable=yes,scrollbars=yes'
	window.open('blank.html', accion, win_properties)
	var old_target = frm.target
	frm.target = accion
	frm.accion.value = accion
	frm.submit()
	frm.target = old_target
}
function buscamosporusted() {
	var frm = document.frmGoto
	var accion = 'buscamosporusted'
	var win_properties = 'left=' + ((screen.availWidth - 400) / 2) + ',top=' + ((screen.availHeight - 300) / 2)
	win_properties += ',width=600,height=400,status=yes,resizable=yes,scrollbars=yes'
	window.open('blank.html', accion, win_properties)
	var old_target = frm.target
	frm.target = accion
	frm.accion.value = accion
	frm.submit()
	frm.target = old_target
}

	

