function mostra_links(obj) 
{
	 var el = document.getElementById(obj);
	 if ( el.style.display != 'none' )
			el.style.display = 'none';
	 else
			 el.style.display = 'block';
}

function ajustElements()
{
	var boxTool = 61;
	var bll = document.getElementById("bloco_login");
	bll.style.height = 236;
	
	var myWidth  = (agSystem.getWidthVisibilityArea() -364)/2;
	var myHeight = (agSystem.getHeightVisibilityArea()-(parseInt(bll.style.height)+boxTool))/2;

	bll.style.paddingLeft = myWidth  + "px";
	bll.style.marginTop   = myHeight + "px";
	
	document.getElementById("bloco_login_baixo").style.height = (myHeight+boxTool) + "px";
	
	setTimeout("visibleCover()",100);
}

function visibleCover()
{
	document.getElementById("invisible").style.visibility = "visible";
    if (document.form && document.form.username)
   	{
		document.form.username.blur();
		if(showFocus)
   			document.form.username.focus();
   	}
}

function showMaskBlcAlert()
{
	var maskBlcAlert = document.getElementById("maskBlcAlert");
	var blcAlertWhite = document.getElementById("blcAlertWhite");
	var c_blcAlertWhite = document.getElementById("c_blcAlertWhite");
	
	var mLeft  = (agSystem.getWidthVisibilityArea() -376)/2;
	var mTop = (agSystem.getHeightVisibilityArea() -345)/2;
	var c_mLeft  = (agSystem.getWidthVisibilityArea() -320)/2;
	var c_mTop = (agSystem.getHeightVisibilityArea() -143)/2;
	var myHeight = agSystem.getHeightVisibilityArea();
	
	maskBlcAlert.style.height = myHeight + "px";
	blcAlertWhite.style.marginTop = mTop + "px";
	blcAlertWhite.style.marginLeft = mLeft + "px";
	c_blcAlertWhite.style.marginTop = c_mTop + "px";
	c_blcAlertWhite.style.marginLeft = c_mLeft + "px";
	
	maskBlcAlert.style.visibility = "visible";
	blcAlertWhite.style.visibility = "visible";
	c_blcAlertWhite.style.visibility = "visible";
}

function closeMaskBlcAlert()
{
	var a;
	a = new Array($Id("maskBlcAlert"),$Id("blcAlertWhite"), $Id("c_blcAlertWhite"));		

	for(var i in a)
	{
		var obj = a[i];
		if(obj)
			obj.style.visibility = "hidden";
	}
}

function visibleLinks()
{			
	document.getElementById("links").style.display = "block";
	document.getElementById("links_content").style.display = "block";	
}	

function hiddenLinks()
{
	document.getElementById("links").style.display = "none";
	document.getElementById("links_content").style.display = "none";
}

function checkBrowserForLogin()
{
	//var is = new browserCheck();
	//if(!(is.NS2 || is.NS3 || is.IE5 || is.IE6 || is.IE7 || is.IE8))    /*antigo teste de navegador*/
	
	var is = agSystem.getBrowserVersion();
	if(!(is.FF3 || is.FF4 || is.FF6 || is.FF7 || is.FF8 || is.FF9 || is.IE7 || is.IE8 || is.IE9 || is.CH13 || is.CH14 || is.CH15 || is.CH16))
	{
		hiddenLinks();
		var divMask = '<div id="login_alert"><img src="../../core/images/error_Alert.gif" /></div><p class="titulo">'+agMessages.localized_cover2_youbrowserisnotcompatible+'</p><p id="txt_login">'+agMessages.localized_cover2_msgbrowserisnotcompatible+'<p/>';
		var login = document.getElementById("content_alert");
		login.style.color = "red";
		login.style.fontWeight = "normal";
		login.style.textAlign = "center";
		login.innerHTML = divMask;
	}
	
}

//Identifica o browser que o usuário esta utilizando para acessar o lms
/*function browserCheck() {
var b = navigator.userAgent;
if (b.indexOf('Firefox')>0) this.b = "NS";
else if (b.indexOf('MSIE')>0) this.b = "IE";
else this.b = b;
this.v = parseInt(navigator.appVersion);
this.NS = (this.b == "NS" && this.v>=4);
this.NS4 = (this.b == "NS" && this.v == 4);
this.NS5 = (this.b == "NS" && this.v == 5);
this.IE = (this.b == "IE" && this.v>=4);
this.IE4 = (navigator.userAgent.indexOf('MSIE 4')>0);
this.IE5 = (navigator.userAgent.indexOf('MSIE 5')>0);
this.IE6 = (navigator.userAgent.indexOf('MSIE 6')>0);
this.IE7 = (navigator.userAgent.indexOf('MSIE 7')>0);
this.IE8 = (navigator.userAgent.indexOf('MSIE 8')>0);
this.NS2 = (navigator.userAgent.indexOf('Firefox/2')>0);
this.NS3 = (navigator.userAgent.indexOf('Firefox/3')>0);
if (this.IE5 || this.NS5) this.VER5 = true;
if (this.IE4 || this.NS4) this.VER4 = true;
this.OLD = (! this.VER5 && ! this.VER4) ? true : false;
this.min = (this.NS||this.IE);
}*/

