<!--

function openVent(winName, theURL, features) {
	window.open(theURL,winName,features);
}

function openFicha(id, direccion, tipoFicha) {
	var urlFicha;
	if (id != "") {
		urlFicha = tipoFicha+"ficha.php?id="+id;
		if (direccion != "") urlFicha += "&dir="+direccion;
		openVent("FichaPropiedad", urlFicha, "status=no, scrollbars=yes,resizable=yes,width=800,height=550");
		return true;
	}
	return false;
}

function openFotos(id) {
	var urlFicha;
	if (id != "") {
		urlFicha = "index.php?id="+id+"&cont=prop_imagenes.inc.php&ps=Imagenes";
		//openVent("FotosPropiedad", urlFicha, "status=no, scrollbars=no,resizable=no,width=780,height=550");
		window.location.href=urlFicha;
		return true;
	}
	return false;
}

function showHiddenVna(txt) {
	obj = document.getElementById(txt);
	objLn = document.getElementById(txt+"Ln");
	if (obj.style.display == "block") {
		obj.style.display = "none";
		objLn.style.display = "block";
	} else {
		obj.style.display = "block";
		objLn.style.display = "none";
	}
}

function manejaComentario(obj, objDest, indice) {
	document.getElementsByName(objDest)[indice].disabled = !obj.checked;
}

function controlAgrupador(obj){
	if (soloNumeros(obj.value)) {
		//
		document.forms[0].action = "cambiaElementoAgrupador.php";
		document.forms[0].method = "GET";
		//
		var loc = "";
		var locat = document.location;
		locat = locat.toString();
		var locArr = locat.split("&");
		//	
		for (var i=0; i<locArr.length; i++)
		{
			loc += (locArr[i].indexOf("rel=") == -1) ? locArr[i] +"&": "";
		}
		document.forms[0].locat.value = loc.substring(0,loc.length-1);
		document.forms[0].submit();
		//
		return true;
	}
	else {
		txt = obj.value;
		obj.value = txt.substring(0,txt.length-1);
	}
}

function soloNumeros(txt){
	var charPermitido = "1234567890";
	for (var i=0; i < txt.length; i++) {
		if (charPermitido.indexOf(txt.charAt(i)) == -1) return false;
	}
	return true;
}

function openWindowTipol(ide, idt){
	openVent("Tipologias", "copyTipologiaScr.php?id="+ide+"&idt="+idt, "status=yes, scrollbars=yes,resizable=yes,width=300,height=450");
	return true;
}
//-->
