function MD_buscarIdioma()
{
	var sIdioma = MD_leerCookie("idioma");
	var sURL = "";
	switch(sIdioma)
	{
		case "esp": sURL = "esp/index.php"; break;
		case "eng": sURL = "eng/index.php"; break;
		case "por": sURL = "por/index.php";
	}
	if(sURL.length > 0)
		location.href(sURL);
}

function MD_abrirVentana(sURL, sNombre, iWidth, iHeight, sScroll)
{
	var iLeft = (screen.width - iWidth) / 2;
	var iTop = (screen.height - iHeight) / 2;
	if (sScroll == "") sScroll = "no";
	sPropiedades = "height=" + iHeight + ", width=" + iWidth +
	", top=" + iTop + ",left=" + iLeft +
	", scrollbars=" + sScroll + ", menubar=no, status=no";
	window.open(sURL, sNombre, sPropiedades);
}

function MD_leerCookie(sNombre)
{
	sNombre += "=";
	var aCookies = document.cookie.split(";");
	for(var iJ = 0; iJ < aCookies.length; iJ++)
	{
		var oCookie = aCookies[iJ];
		while(oCookie.charAt(0) == " ")
			oCookie = oCookie.substring(1, oCookie.length);
		if(oCookie.indexOf(sNombre) == 0)
			return oCookie.substring(sNombre.length, oCookie.length);
	}
	return null;
}
