function cambiarPestana(id) {
	idPrecio = document.getElementById('div_precio');
	idMetros = document.getElementById('div_metros');
	idZona = document.getElementById('div_zona');		
	idliPrecio = document.getElementById('li_precio');
	idliMetros = document.getElementById('li_metros');
	idliZona = document.getElementById('li_zona');		
	switch(id) {
		case 'metros':
			idPrecio.style.display = 'none';
			idZona.style.display = 'none';
			idMetros.style.display = 'inline';
			idliPrecio.innerHTML = '<a href="javascript:;" onclick="cambiarPestana(\'precio\')" style="text-decoration:underline;">Precio</a>';
			idliZona.innerHTML = '<a href="javascript:;" onclick="cambiarPestana(\'zona\')" style="text-decoration:underline;">Zona</a>';
			idliMetros.innerHTML = '<span>Metros</span>';
		break;
		case 'precio':
			idPrecio.style.display = 'inline';
			idZona.style.display = 'none';
			idMetros.style.display = 'none';
			idliMetros.innerHTML = '<a href="javascript:;" onclick="cambiarPestana(\'metros\')" style="text-decoration:underline;">Metros</a>';
			idliZona.innerHTML = '<a href="javascript:;" onclick="cambiarPestana(\'zona\')" style="text-decoration:underline;">Zona</a>';
			idliPrecio.innerHTML = '<span>Precio</span>';
		break;
		case 'zona':
			idPrecio.style.display = 'none';
			idZona.style.display = 'inline';
			idMetros.style.display = 'none';
			idliPrecio.innerHTML = '<a href="javascript:;" onclick="cambiarPestana(\'precio\')" style="text-decoration:underline;">Precio</a>';
			idliMetros.innerHTML = '<a href="javascript:;" onclick="cambiarPestana(\'metros\')" style="text-decoration:underline;">Metros</a>';
			idliZona.innerHTML = '<span>Zona</span>';
		break;
	}
	return true;
}
function validarAviso(form) {
	if (form.email.value=="") {
		alert("Debe insertar su email")
		form.email.focus()
		return false
	}
	if (form.precio.value=="") {
		alert("Debe insertar un precio estimado")
		form.precio.focus()
		return false
	}
	if (isNaN(form.precio.value)==true) {
		alert("Debe insertar un precio estimado numerico, sin letras")
		form.precio.focus()
		return false
	}
	if (parseInt(form.precio.value)>=parseInt(form.precio_actual.value)) {
		alert("Debe insertar un precio estimado inferior al precio actual")
		form.precio.focus()
		return false
	}
	if (form.acepto.checked==false) {
		alert("Debe aceptar las condiciones generales")
		return false
	}
	return true
}
function SetPhoto(url)
{	    
	document.getElementById("lienzo").src = url;
}
function anyadirPunto(map,lat,lng,icono,ruta,titulo,dormitorios,precio,i) {
	var point	= new GLatLng(lat, lng);
	var marker = new GMarker(point,icono);
	map.addOverlay(marker);
	GEvent.addListener(marker, "click", function() {
		marker.openInfoWindowHtml('<div style="padding:7px;"><table border="0" cellspacing="0" cellpadding="0"><tr><td colspan="2"><span style="font-size:11px;font-weight:bold"><a href="'+ruta+'">'+titulo+'</a></span></td></tr><tr><td width="50%" align="left"><span style="font-size:11px;padding:9px 9px 3px 3px"><strong style="color:#666666;font-weight:normal;"><br />'+dormitorios+'</strong></span></td><td width="50%" align="right" style="color:#000000"><br /><strong>'+precio+'</strong></td></tr></table></div>');
	});
}