function menu(bot,accion){
	if (accion == "over"){
	document.getElementById('bot'+bot).className = 'over';
	} else {
	document.getElementById('bot'+bot).className = 'out';
	}
}

// Buscador corporativo ------------------------------------------------

var con_buscador_corporativo = new XHConn();
var fin_buscador_corporativo = function (oXML) { document.getElementById('div_buscador_corporativo').innerHTML = oXML.responseText; };
function include_buscador_corporativo (){
	document.getElementById('div_buscador_corporativo').innerHTML = "<div align=\"center\"><br><br><img src=\"../img/cargando_previo.gif\" width=\"32\" height=\"32\"><br><br></div>";
	con_selec_operacion.connect("../buscador_corporativo.php", "GET", "", fin_buscador_corporativo);
}

function buscar(){
document.form_buscador.idlocalidad.value = document.form_selec_localidad.localidad_ajax.value;
document.form_buscador.idtipo.value = document.form_selec_tipo.tipo_ajax.value;
document.form_buscador.operacion.value = document.form_selec_operacion.operacion_ajax.value;
	if (document.form_buscador.idlocalidad.value == "0"){
	alert ("Seleccione una localidad");
	} else {
		if (document.form_buscador.idtipo.value == "0"){
		alert ("Seleccione el tipo de inmueble que quiere buscar");
		} else {
		document.form_buscador.submit();
		}
	}
}

function selec_operacion_desac(clase){
var selec_operacion_desac = '<select name="operacion_ajax" class="'+clase+'" id="operacion_ajax">';
selec_operacion_desac += '<option value="0" selected>-</option></select>';
document.getElementById('selec_operacion').innerHTML = selec_operacion_desac;
}

var con_selec_tipo = new XHConn();
if (!con_selec_tipo) alert("XMLHTTP no disponible. Navegador web antiguo o incompatible.");
var fin_selec_tipo = function (oXML) { document.getElementById('selec_tipo').innerHTML = oXML.responseText; };
function include_selec_tipo (idlocalidad,op){
	if (idlocalidad != "0"){
	document.getElementById('selec_tipo').innerHTML = "&nbsp;&nbsp;<img src=\"../img/cargando_selec.gif\" width=\"75\" height=\"12\">";
		if (op == 'corp'){
		selec_operacion_desac('campos_busc3');
		}
		if (op == 'main'){
		selec_operacion_desac('campos_busc5');
		}
	window.setTimeout("con_selec_tipo.connect('../buscador/selec_tipo.php', 'GET', 'idlocalidad="+idlocalidad+"&op="+op+"', fin_selec_tipo)", 1000);
	}
}


var con_selec_operacion = new XHConn();
var fin_selec_operacion = function (oXML) { document.getElementById('selec_operacion').innerHTML = oXML.responseText; };
function include_selec_operacion (idlocalidad,idtipo,op){
	if ((idlocalidad != "0") && (idtipo != "0")) {
	document.getElementById('selec_operacion').innerHTML = "&nbsp;&nbsp;<img src=\"../img/cargando_selec.gif\" width=\"75\" height=\"12\">";
	window.setTimeout("con_selec_operacion.connect('../buscador/selec_operacion.php', 'GET', 'idlocalidad="+idlocalidad+"&idtipo="+idtipo+"&op="+op+"', fin_selec_operacion)", 1000);
	}
}

