// lee datos

var objeto = false;

function crearObjeto() {
  // --- Crear el Objeto dependiendo los diferentes Navegadores y versiones ---
  try { objeto = new ActiveXObject("Msxml2.XMLHTTP");  }
  catch (e) {
  try { objeto = new ActiveXObject("Microsoft.XMLHTTP"); }
  catch (E) {
  objeto = false; }
  }
  // --- Si no se pudo crear... intentar este ultimo metodo ---
  if (!objeto && typeof XMLHttpRequest!='undefined') {
    objeto = new XMLHttpRequest();
  }
} 

// ------------------------------






function muestra_opciones_idio(){
	$(document).ready(function(){  
	$("#contenidos_combo").animate({
		height: "40px",
		opacity:"1.0",
		marginTop:"0px"
	});
}); 


	setTimeout('ocultar_combo_idio()',10000);
}



function ocultar_combo_idio(){
	
	$(document).ready(function(){  
	$("#contenidos_combo").animate({
		height: "0px",
		opacity:"0.0",
		marginTop:"-80px"
	});
});  
	
		
}

//
 var st;
 var selectIntervalo = 5000;


function seleccionadorTLD(){
	
	selector = document.getElementById("select_dominio").className;
	
	if (selector == "select_dominio"){
		abrirseleccionador();
	}else{
		escondeseleccionador();
	}
	
}


function abrirseleccionador(){
	clearTimeout(st);
	document.getElementById("select_dominio").className="select_dominio_activo";
	document.getElementById("select_tld").style.display="block";
	st= setTimeout("escondeseleccionador();", selectIntervalo);
}

function escondeseleccionador(){
	clearTimeout(st);
	document.getElementById("select_dominio").className="select_dominio";
	document.getElementById("select_tld").style.display="none";
}

function overTLD(){
	clearTimeout(st);
	st= setTimeout("escondeseleccionador();", selectIntervalo);
	}

function selectTld(tld){
	clearTimeout(st);
	document.getElementById("tld_select").innerHTML=tld;
	document.getElementById("ext").value = tld;
	escondeseleccionador();
}

function carga_sitio(){

  crearObjeto();
    
  if (objeto.readyState != 0) {
    alert('Error al crear el objeto XML. El Navegador no soporta AJAX');
  } else {
    // Preparar donde va a recibir el Resultado
    objeto.onreadystatechange = procesasitio;
    // Enviar la consulta
    objeto.open("GET", "cuerpo.php", true);
    objeto.send(null);
  }
}

// ------------------------------

function procesasitio() {
// Si aun esta revisando los datos...
if (objeto.readyState == 1) {
  document.getElementById("cuerpo").innerHTML="<center><img src=\"img/loading.gif\"></center>";
}
// Si el estado es 4 significa que ya termino
if (objeto.readyState == 4) {
  // objeto.responseText trae el Resultado que metemos al DIV de arriba
  //document.getElementById('resultado').innerHTML = objeto.responseText;
  var resultado = objeto.responseText;
  
  
  var resultador = document.getElementById("cuerpo");
 	  resultador.innerHTML = resultado;
  
} 
}

/*//SETTING UP OUR POPUP  
//0 means disabled; 1 means enabled;  
var popupStatus = 0;  
//loading popup with jQuery magic!  
function loadPopup(){  
//loads popup only if it is disabled  
if(popupStatus==0){  
$("#backgroundPopup").css({  
"opacity": "0.7"  
});  
$("#backgroundPopup").fadeIn("slow");  
$("#popupContact").fadeIn("slow");  
popupStatus = 1;  
}  
}  

//disabling popup with jQuery magic!  
function disablePopup(){  
//disables popup only if it is enabled  
if(popupStatus==1){  
$("#backgroundPopup").fadeOut("slow");  
$("#popupContact").fadeOut("slow");  
popupStatus = 0;  
}  
}  

//centering popup  
function centerPopup(){  
//request data for centering  
var windowWidth = document.documentElement.clientWidth;  
var windowHeight = document.documentElement.clientHeight;  
var popupHeight = $("#popupContact").height();  
var popupWidth = $("#popupContact").width();  
//centering  
$("#popupContact").css({  
"position": "absolute",  
"top": windowHeight/2-popupHeight/2,  
"left": windowWidth/2-popupWidth/2  
});  
//only need force for IE6  
  
$("#backgroundPopup").css({  
"height": windowHeight  
});  
  
}  


$(document).ready(function(){  
//following code will be here  
  
//LOADING POPUP  
//Click the button event!  
$("#button").click(function(){  
//centering with css  
centerPopup();  
//load popup  
loadPopup();  
});  


//CLOSING POPUP  
//Click the x event!  
$("#popupContactClose").click(function(){  
disablePopup();  
});  
//Click out event!  
$("#backgroundPopup").click(function(){  
disablePopup();  
});  
//Press Escape event!  
$(document).keypress(function(e){  
if(e.keyCode==27 && popupStatus==1){  
disablePopup();  
}  
});  


});
*/







