// JavaScript Document
function laventana(valor, lenguaje)
{
	var ventana;
	if(valor=="financiero")
	{
		if(lenguaje=="_Ingles")
		{
			ventana = window.open("bmv_Ingles/home.html","Asesor_Financiero","width=800,height=600,scrollbars=no");
		}
				else
		{
			ventana = window.open("bmv/home.html","Asesor_Financiero","width=800,height=600,scrollbars=no");
		}
		
	}
	else if(valor=="alerta")
	{
		if(lenguaje=="_Ingles")
		{
			ventana = window.open("alert/alert.html","Alerta_Accion","width=395,height=295,scrollbars=no");
		}
		else
		{
			ventana = window.open("alerta/alerta.html","Alerta_Accion","width=395,height=295,scrollbars=no");
		}
	}
	else if(valor=="calc")
	{
		if(lenguaje=="_Ingles")
		{
			ventana = window.open("calculator/calculator.html","calculator","width=420,height=310,scrollbars=no");
		}
		else
		{
			ventana = window.open("calculadora/calculadora.html","calculadora","width=420,height=310,scrollbars=no");
		}
	}
}

function pase(Menu_Id, Sbme_Id, lenguaje) {
	window.parent.frames['principal'].location.href = "contenidohome.aspx?Menu_Id=" + Menu_Id + "&lenguaje=" + lenguaje + "&Sbme_Id=" + Sbme_Id;
}

function configura(Menu_Id, lenguaje)
{
	parent.frames['principal'].location.href = "contenido.aspx?Menu_Id=" + Menu_Id + "&lenguaje=" + lenguaje;
}

function confdoctos(Sbme_Id,lenguaje,contenido,documento,id)
{
	var url = "confdoctos.asp?Sbme_Id=" + Sbme_Id + "&lenguaje=" + lenguaje + "&tblcontenido=" + contenido + "&tbldoctos=" + documento + "&elid=" + id;
	http.open("GET", url, true);
	http.onreadystatechange = handleHttpResponse;
	http.send(null);	
}

function showWin(lenguaje)
{
	if(lenguaje=='_Ingles')
	{
		foo = new Window('dialog', {className: "dialog", title: " PDF documents", top:10, left:10, zIndex:100, opacity:1, resizable:false, maximizable:false, minimizable:false});
	}
	else
	{
		foo = new Window('dialog', {className: "dialog", title: " Documentos Relacionados", top:10, left:10, zIndex:100, opacity:1, resizable:false, maximizable:false, minimizable:false});
	}
	foo.getContent().innerHTML=datos;
	foo.setDestroyOnClose();
	foo.show();
	foo.toFront();
	foo.updateWidth();
	foo.updateHeight();
}

function handleHttpResponse() 
{
	if (http.readyState == 4)
	{
		if (http.status == 200)
		{
			if (http.responseText.indexOf('invalid') == -1)
			{
				var results = http.responseText.split("|");
				if(parseInt(results[1]) > 0)
				{
					document.getElementById("divdoctos").style.display="block";
					datos = unescape(results[0]);
				}
				else
				{
					document.getElementById("divdoctos").style.display="none";
				}
			}
		}
	}
}

function getHTTPObject()
{
	var xmlhttp = null;
	if(navigator.appName == 'Netscape')
	{
		try
		{
			xmlhttp = new XMLHttpRequest();
		}
		catch (e)
		{
			xmlhttp = null;
		}
	}
	else
	{
		try
		{
			xmlhttp = new ActiveXObject("MSXML2.XMLHTTP");
		}
		catch (e)
		{
			try
			{
				xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch (e)
			{
				xmlhttp = null;
			}
		}
	}
	return xmlhttp;
}

var	http = getHTTPObject();
var datos = null;