function ExibeErro()
{
    var TErro = document.getElementById('TErro');
    var ErroMSG = document.getElementById('Header_lblErrorMSG');
    
    if (ErroMSG.innerHTML != "")
    {
        TErro.style.display = "block";
    }
}

function ExibeInfoPrincipal()
{
    var TRAuxInfo = document.getElementById('TRAuxInfo');
    var lblInfo = document.getElementById('lblInfo');
    
    if (lblInfo.innerHTML != "")
    {
        TRAuxInfo.style.display = "block";
    }
}

function OnlyNumber(e)
{
    var tecla = (window.event)?event.keyCode:e.which;
    
    if((tecla > 47 && tecla < 58)) return true;
    
    else
    {
        if (tecla != 8) return false;
        else return true;
    }
}

function OpenWindow(URL, Lang, CSS, Width, Height) 
{
    window.open(URL + "?Lang=" + Lang + "&CSS=" + CSS, 'PopUp', 'width='+ Width +', height='+ Height +', scrollbars=yes');     
    window.focus();
}

function SetQuestionType(Mail, Chat)
{
    var TMail = document.getElementById('TMail');
    var TChat = document.getElementById('TChat');
    var TMode = document.getElementById('TMode');
    
    if (Mail)
    {
        TMail.style.display = "block";
        TChat.style.display = "none";
    }
    else if (Chat)
    {
        TMail.style.display = "none";
        TChat.style.display = "block";
    }
    else
    {
        TMail.style.display = "none";
        TChat.style.display = "none";
        TMode.style.display = "none";
    }
}

//Sessao
var xmlHttp;

function createHttp() 
{
	if (window.XMLHttpRequest) 
	{
		xmlHttp = new XMLHttpRequest();
	} 
	else if (window.ActiveXObject) 
	{
        xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
	} 
}

function FinishSession(pEvento) 
{
	createHttp();
	xmlHttp.open("POST", "FinishSession.aspx?x=" + pEvento, true);
	xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	xmlHttp.send(null);
	
	//alert("x=" + pEvento);

	//if (sndReq.readyState == 4 || sndReq.readyState == 0)
	//{
	//}
}
