// Copyright © 2008 BITCELLENCE, S.A. DE C.V.
// Juan Soto fsoto@bitcellence.com.mx

/**** Logout ****/
function salir(pageURL){
	if(confirm("\xBFSeguro que deseas salir?")) location.replace(pageURL);}

/**** LAYER DE AYUDA ****/
function help(divName,state) {
	var divObj = document.getElementById(divName);
	if (divObj) {
		if (state) {
			divObj.style.display = 'block';
		}
		else {
			divObj.style.display = 'none';
		}
	}
}

/**** Pop Ups ****/
var WinPopUp = null;
function SetFocus(){
	if(WinPopUp && !WinPopUp.closed)
		WinPopUp.focus();}
function OpenWin(Pagina, Ancho, Alto, ScrBar) {
	if(ScrBar)
		WinPopUp = window.open(Pagina, "WinPopUp", "height=" + Alto + ",width=" + Ancho + ",menubar=0,menubar=no,resizable=false,resizable=no,scrollbar=true,scrollbars=yes,status=0,status=no,toolbar=0,toolbar=no,screenX=" + (screen.width-Ancho) / 2 + ",screenY=" + (screen.height-Alto) / 2 + ",left=" + (screen.width-Ancho) / 2 + ",top=" + (screen.height-Alto) / 2);
	else
		WinPopUp = window.open(Pagina, "WinPopUp", "height=" + Alto + ",width=" + Ancho + ",menubar=0,menubar=no,resizable=false,resizable=no,scrollbar=false,scrollbars=no,status=0,status=no,toolbar=0,toolbar=no,screenX=" + (screen.width-Ancho) / 2 + ",screenY=" + (screen.height-Alto) / 2 + ",left=" + (screen.width-Ancho) / 2 + ",top=" + (screen.height-Alto) / 2);
}

/* Aparece y desaparece un layer o div */
function toggleLayer (id) {
  var obj = document.getElementById(id);
  if (obj) {
	if (layerVisibility(id) == 'hidden') { 
		sLayer (id); 
		obj.style.display = 'inline';
		}
	else { 
		hLayer(id); 
		obj.style.display = 'none';
		}
	}
}
