// JavaScript Document

//___________________________________________________________________________________________________________

function CallAjax()
{
	AjaxLodPage("SupportOnline", "", "supportOnline/mysStatus.asp");
}

//___________________________________________________________________________________________________________

function setIntervalAt()
{
	setInterval("CallAjax()", 5555);
}

//___________________________________________________________________________________________________________

function abrirChat(address)
{
	var width = 450;
	var height = 350;
	var esquerda = (screen.width/2) - (width/2);
	var topo = (screen.height/2) - (height/2);
	window.open(address + "/mysAtendimento.asp","MySupport","top="+topo+",left="+esquerda+",width="+width+",height="+height+",scrollbars=yes, menu=0,status=yes");
}

//___________________________________________________________________________________________________________

function CompleteAjaxLoadPage(DivLinked, ContentForAjax)
{
	if (!ContentForAjax)
	{
		document.getElementById(DivLinked).innerHTML = "";
	}
	else
	{
		document.getElementById(DivLinked).innerHTML =  ContentForAjax;
	}
}

//___________________________________________________________________________________________________________

function AjaxLodPage(Div, Message, LoadPage) 
{
	if (LoadPage.length != 0)
	{
		//new ajax Object
		var ajax = new Ajax();
		
		//Linked menssage in Div
		CompleteAjaxLoadPage(Div, Message);
		
		//set content in Ajax Object.Method
		ajax.set_receive_handler
		( 
			function(load)
			{ 
				CompleteAjaxLoadPage(Div, load); 
			} 
		);
		
		//send for ajax
		ajax.send(LoadPage); 
	}
	else
	{
		//Linked menssage in Div
		CompleteAjaxLoadPage(Div, null);

	}
} 

//___________________________________________________________________________________________________________


function OpenFtp(bool)
{
	if(bool)
	{
		document.getElementById("ftpURL").src = "isFTP.php";
		document.getElementById("isFtp").style.display = "block";
	}
	else
	{
		document.getElementById("ftpURL").src = "nothing.html";
		document.getElementById("isFtp").style.display = "none";
	}
}