function mostrarCategoria(c)
{
	var cat = document.getElementById(c);
	if(cat.tag)
	{
		cat.style.display = "none";
		cat.tag = false;
	}
	else
	{
		cat.style.display = "block";
		cat.tag = true;
	}
}
function MuestraOculta(id, id_contenido)
{
	if (document.getElementById(id).style.display == "block")
	{
		document.getElementById(id).style.display = "none";
		document.getElementById(id_contenido).childNodes[1].innerHTML = '+';                   
	}
	else
	{
		document.getElementById(id).style.display = "block";
		document.getElementById(id_contenido).childNodes[1].innerHTML = '-';                  
	}
}
function MuestraFrame()
{
	var iFrame = document.getElementById("ifrPopUp");
	var iFrameContent = document.getElementById("iframeContent");
	var iDoc = iFrame.contentWindow.document;
	iFrameContent.style.width = document.documentElement.clientWidth + "px";
	iFrame.style.display = "";
	iFrame.style.height = iDoc.body.offsetHeight + 60 + "px";

	var shadow = document.getElementById("shadow");
	shadow.style.height = Math.max(document.body.offsetHeight + 20, iDoc.body.offsetHeight + 340) + "px";
	
	scrollTo(0, 225);

	if(document.all)
	{
		iFrame.onreadystatechange = function()
		{
			if(iFrame.readyState == "complete")
			{
				iFrame.style.height = iFrame.contentWindow.document.body.offsetHeight + 60 + "px";
				shadow.style.height = Math.max(document.body.offsetHeight + 20, iFrame.contentWindow.document.body.offsetHeight + 340) + "px";
				return true;
			}
		};
	}
	else
	{
		iFrame.onload = function()
		{
			iFrame.style.height = iFrame.contentWindow.document.body.offsetHeight + 60 + "px";
			shadow.style.height = Math.max(document.body.offsetHeight + 20, iFrame.contentWindow.document.body.offsetHeight + 340) + "px";
			return true;
		};
	}

	return true;
}
var start = null;
var timer = null;
var iFrameLoad = false;
function Fade()
{
	var delta = ((new Date()).getTime() - start.getTime()) * 0.001 * 0.75;
	if(delta < 1)
	{
		var opacity = 70 * delta;
		var shadow = document.getElementById("shadow");
		shadow.style.filter = "alpha(opacity=" + opacity + ")";
		shadow.style.opacity = opacity * 0.01;
	}
	else
	{
		clearInterval(timer);
		var iFrame = document.getElementById("ifrPopUp");
		if(iFrameLoad) { MuestraFrame(); }
		else { if(document.all) iFrame.onreadystatechange = function() { if(iFrame.readyState == "complete") MuestraFrame(); }; else iFrame.onload = MuestraFrame; }
	}
}
function CargaFrame(idcurso)
{
	iFrameLoad = false;
	var iFrame = document.getElementById("ifrPopUp");
	if(document.all) { iFrame.onreadystatechange = function() { if(iFrame.readyState == "complete") return iFrameLoad = true; }; }
	else { iFrame.onload = function() { return iFrameLoad = true; }; }
	iFrame.src = "../IngenierosQuimicos_Galicia_Emergente.aspx?identificadorCurso=" + idcurso;
	iFrame.style.top = "225px";

	var shadow = document.getElementById("shadow");
	shadow.style.filter = "alpha(opacity=0);";
	shadow.style.opacity = "0.0;";
	shadow.style.height = document.body.offsetHeight + "px";
	shadow.style.width = document.documentElement.clientWidth + "px";
	shadow.style.display = "";

	start = new Date();
	timer = setInterval(Fade, 10);
}
function OcultaFrame()
{
	document.getElementById("ifrPopUp").style.display = "none";
	document.getElementById("shadow").style.display = "none";
}

