function confirmaLogout( caminho ) {
	if ( confirm("Voc\xEA tem certeza que deseja sair do Painel de Controle?") )
		window.location.replace( caminho );
}
function confirmaLogout_en( caminho ) {
	if ( confirm("Are you sure that you wish to leave the Control Panel?") )
		window.location.replace( caminho );
}
function confirmaLogout_pt( caminho ) {
	confirmaLogout( caminho );
}

function confirmaExclusao( msg, caminho ) {
	if ( confirm("Voc\xEA tem certeza que deseja excluir "+msg+"?") )
		window.location.replace( caminho );
}
function confirmaExclusao_en( msg, caminho ) {
	if ( confirm("Are you sure about the deletion of "+msg+"?") )
		window.location.replace( caminho );
}
function confirmaExclusao_pt( msg, caminho ) {
	confirmaExclusao( msg, caminho );
}
function confirmaExclusaoEmCascata( msg, msg2, caminho ) {
	if ( confirm("Voc\xEA tem certeza que deseja excluir "+msg+"?\n"+
				 "\n"+
				 msg2) )
		window.location.replace( caminho );
}
function confirmaExclusaoEmCascata_en( msg, msg2, caminho ) {
	if ( confirm("Are you sure about the deletion of "+msg+"?\n"+
				 "\n"+
				 msg2) )
		window.location.replace( caminho );
}
function confirmaExclusaoEmCascata_pt( msg, msg2, caminho ) {
	confirmaExclusaoEmCascata( msg, msg2, caminho );
}

function getById( elemento ) {
	return document.getElementById( elemento );
}
function elemento( elemento ) {
	return getById( elemento );
}

function isVisivel( elemento ) {
	return getById( elemento ).style.display == 'block';
}

function mostra( elemento ) {
	getById( elemento ).style.display = 'block';
}
function esconde( elemento ) {
	getById( elemento ).style.display = 'none';
}

function mostraEsconde( elemento ) {
	if ( isVisivel(elemento) )
		esconde( elemento );
	else
		mostra( elemento );
}

function escondeArray( elementos ) {
	for ( i=0 ; i < elementos.length ; i++ )
		esconde( elementos[i] );
}
function mostraArray( elementos ) {
	for ( i=0 ; i < elementos.length ; i++ )
		mostra( elementos[i] );
}

function escondeObjeto( elemento ) {
	elemento.style.display = 'none';
}
function mostraObjeto( elemento ) {
	elemento.style.display = 'block';
}

function numeroAleatorio( limInf, limSup ) {
	return Math.floor( Math.random()*(1 + limSup - limInf) + limInf );
}

function getRequestAJAX() {
	if ( window.XMLHttpRequest )
		return new XMLHttpRequest();
	else if ( window.ActiveXObject )
		return new ActiveXObject( "Microsoft.XMLHTTP" );
	else {
		// alert( "Seu browser n\xE3o suporta AJAX!" );
		return null;
	}
}

/** Retorna o objeto flash.
 */
function getObjetoFlash( objetoFlash ) {
	if ( navigator.appName == "Netscape" )
		return document.embeds[0];
	else
		return window[ objetoFlash ];
}
function abreMenu( objetoFlash, quadro ) {
	// Vai para o quadro especificado pelo Numero
	//getObjetoFlash( objetoFlash ).GotoFrame( quadro );

	// Vai para o quadro especificado pelo Label
	getObjetoFlash( objetoFlash ).TGotoLabel( "_root", quadro );
	//getObjetoFlash( objetoFlash ).Play();
}

/** Elemento visivel. */
var elementoVisivel;
/** Esconde o elemento visivel atualmente, exibe outro elemento e atualiza a variavel 'elementoVisivel'.
 */
function escondeVisivelEMostra( elemento ) {
	esconde( elementoVisivel );
	mostra( elemento );
	elementoVisivel = elemento;
}
