function nuevoAjax(){
	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 pause(millisecondi) {

  var now = new Date();

  var exitTime = now.getTime() + millisecondi;
  while(true)
  {
      now = new Date();
      if(now.getTime() > exitTime) return;
  }
}
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function abreVentana(elemento){

	var indice = elemento.selectedIndex;	
	var valor = elemento.options[indice].value;

	//alert(valor)
	if(valor !='nada'){
	window.open('cursos.php?idCurso='+valor,'','height=600,width=770,status=1,scrollbars=yes');
	}
}

function getBrowserHeight() {
	var intH = 0;
	var intW = 0;
   
	if(typeof window.innerWidth  == 'number' ) {
	   intH = window.innerHeight;
	   intW = window.innerWidth;
	} 
	else if(document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) {
		intH = document.documentElement.clientHeight;
		intW = document.documentElement.clientWidth;
	}
	else if(document.body && (document.body.clientWidth || document.body.clientHeight)) {
		intH = document.body.clientHeight;
		intW = document.body.clientWidth;
	}
	else {
		intH = screen.height;
		intW = screen.width;
	}



	return { width: parseInt(intW), height: parseInt(intH) };
}  

function setLayerPosition() {
	var shadow = document.getElementById("shadow");
	var question = document.getElementById("question");
	//var question2 = document.getElementById("question2");

	var bws = getBrowserHeight();
	shadow.style.width = bws.width + "px";
	shadow.style.height = bws.height + "px";
	//shadow.style.height = "800px";

	question.style.left = parseInt((bws.width - (bws.width - 300)) / 2);
	//question.style.top = parseInt((bws.height - 650) / 2);
	question.style.width = parseInt(bws.width - 300);
	question.style.top = 50;

	shadow = null;
	question = null;
}

function showLayer(id) {
	setLayerPosition();
	//alert('algo');
	var shadow = document.getElementById("shadow");
	var question = document.getElementById("question");

	shadow.style.display = "block"; 
	question.style.display = "block";
	
	getInfo(id);

	shadow = null;
	question = null;             
}


function hideLayer() {
	var shadow = document.getElementById("shadow");
	var question = document.getElementById("question");
	var flash1 = document.getElementById("flash1");
	var flash2 = document.getElementById("flash2");
	shadow.style.display = "none"; 
	question.style.display = "none";
	flash1.style.display = "block";
	flash2.style.display = "block";

	shadow = null;
	question = null; 
}



function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
