	function openCenteredWindow(url, name, width, height, parms) {
	   var left = Math.floor( (screen.width - width) / 2);
	   var top = Math.floor( (screen.height - height) / 2);
	   var winParms = "top=" + top + ",left=" + left + ",height=" + height + ",width=" + width;
	   if (parms) { winParms += "," + parms; }
	   var win = window.open(url, name, winParms);
	   if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
	   return win;
	}

	function navegar(link, popup, width, height) {
		if (popup == "true") {
			openCenteredWindow(link, "_blank", width, height, "menubar=0,toolbar=0,location=0,status=0,resizeable=0,scroll=auto");
		} else {
			document.location.href = link;
		}
	}
	
	function abrirPopMinisterio(url, width, height) {
		openCenteredWindow(url, "popMinisterio", 970, 700, "menubar=0,toolbar=0,location=0,status=0,resizeable=0,scrollbars=yes");
	}

	function abrirPopup(url, width, height) {
		openCenteredWindow(url, "_blank", width, height, "menubar=0,toolbar=0,location=0,status=0,resizeable=0,scrollbars=0");
	}

	function addLoadEvent(func) {
	    var oldonload = window.onload;
	    if (typeof window.onload != 'function') {
	      window.onload = func;
	    } else {
	      window.onload = function() {
	        if (oldonload) {
	          oldonload();
	        }
	        func();
	      }
	    }
	  }