// JavaScript Document
var imagen;

function disable_opt1(privilegio)
{
	if(privilegio < '005')
	{
		this.document.getElementById('serie').disabled = true;
	}
	this.document.getElementById('ref').disabled = true;
	this.document.getElementById('tipo').disabled = false;
	this.document.getElementById('marca').disabled = false;
	this.document.getElementById('modelo').disabled = false;
	/*this.document.getElementById('pais').disabled = false;
	this.document.getElementById('estado').disabled = false;*/
	this.document.getElementById('precio1').disabled = false;
	this.document.getElementById('precio2').disabled = false;
	this.document.getElementById('ano1').disabled = false;
	this.document.getElementById('ano2').disabled = false;
	
	document.getElementById('opt_Busqueda').value = 2;
}

function disable_opt2(privilegio)
{
	if(privilegio < '005')
	{
		this.document.getElementById('serie').disabled = true;
	}
	this.document.getElementById('ref').disabled = false;
	this.document.getElementById('tipo').disabled = true;
	this.document.getElementById('marca').disabled = true;
	this.document.getElementById('modelo').disabled = true;
	/*this.document.getElementById('pais').disabled = true;
	this.document.getElementById('estado').disabled = true;*/
	this.document.getElementById('precio1').disabled = true;
	this.document.getElementById('precio2').disabled = true;
	this.document.getElementById('ano1').disabled = true;
	this.document.getElementById('ano2').disabled = true;
	
	document.getElementById('opt_Busqueda').value = 1;
}

function disable_opt3()
{
	this.document.getElementById('serie').disabled = false;
	this.document.getElementById('ref').disabled = true;
	this.document.getElementById('tipo').disabled = true;
	this.document.getElementById('marca').disabled = true;
	this.document.getElementById('modelo').disabled = true;
	/*this.document.getElementById('pais').disabled = true;
	this.document.getElementById('estado').disabled = true;*/
	this.document.getElementById('precio1').disabled = true;
	this.document.getElementById('precio2').disabled = true;
	this.document.getElementById('ano1').disabled = true;
	this.document.getElementById('ano2').disabled = true;
	
	document.getElementById('opt_Busqueda').value = 3;
}

// PROCESO PARA GUARDAR LOS HITS QUE GENERA LA INMOBILIARIA

function objetoAjax(){
	var xmlhttp=false;
	try {
		xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
	} catch (e) {
		try {
		   xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
		} catch (E) {
			xmlhttp = false;
  		}
	}

	if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
		xmlhttp = new XMLHttpRequest();
	}
	return xmlhttp;
}

function datosDesarrollo(desarrollo, sitio){  
	//donde se mostrarál formulario con los datos
	//divFormulario = document.getElementById('datos');
	
	//instanciamos el objetoAjax
	ajax=objetoAjax();
	//uso del medotod POST
	ajax.open("POST", "/scrollCarrousel/guardarHits.php");
	/*ajax.onreadystatechange=function() {
		if (ajax.readyState==4) {
			//mostrar resultados en esta capa
			divFormulario.innerHTML = ajax.responseText
			//mostrar el formulario
			divFormulario.style.display="block";
		}
	}*/
	//como hacemos uso del metodo GET
	//colocamos null
	ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
	//enviando los valores
	ajax.send("noDesarrollo="+desarrollo+"&noSitio="+sitio)
}

function opcImagen(opcion)
{
	for (i=1; i<=14; i++)
	{
		if(opcion == i)
		{
			document.getElementById('top'+i).style.display='block';
		}
		else
		{
			document.getElementById('top'+i).style.display='none';
		}
	}
}

// TERMINA EL PROCESO

function nuevaVentana()
{
	window.open("http://www.imcancun.com","IMCancun","resizable=yes, scrollbars=yes, location=yes, directories=yes, menubar=yes, toolbar=yes, width=800,height=600");
}

