/* AUTHOR: Mario Alberto Ramírez Monrreal */
window.onload=inicioEstructura;
//window.onresize=inicioEstructura;
document.onclick=dclic;
document.onmousedown=dclic;
document.onkeypress=dpress;
var xNavegador="MS"
var winAncho=0; var winAlto=0
var altoCuerpo=0; var anchoCuerpo=0
var xObjClic=null
var xObjClicMI=null
var xTxtObjClic=""
function dclic(e){
	var xId=""; var xLang=""
	if(window.event){
		xObjClic=window.event.srcElement
		xTxtObjClic=window.event.srcElement.innerHTML
		xId=window.event.srcElement.id
		xLang=window.event.srcElement.lang}
	else{
		xObjClic=e.target
		xTxtObjClic=e.target.innerHTML
		xId=e.target.id
		xLang=e.target.lang}
	if(xId!="tdOpcionTabla" && xId!='aMenuAplicacion' && xId!='tdLista' && xId!='xCMes' && xId!="xCAnio" && xLang!="txtayuda" && xLang!="txtsugiere"){
		msgQuita('divLista|divMenuAplicacion|')		
		xLnkAplicacionClic=false;
	}
}
var xTecla=0
function dpress(e){	
	if(window.event){
		xTecla=window.event.keyCode}
	else{
		xTecla=e.keyCode}
	if(xTecla==27){
		if(document.getElementById('divLista').style.display==''){
			msgQuita('divLista|')
		}
		else{
			var xD=$("divContenidos")			
			if(xRenSel!=null && xD.childNodes.length==1){xRenSel.className=xRenSelClass; xRenSel=null; xRenSelClass=''; }
			msgQuita('divLista|divMenuAplicacion|divVentanaFormato|divVentanaEsperaFormato|')
		}
		return false;				
	}
}

function inicioEstructura(){	
	if(navigator.appName=="Microsoft Internet Explorer"){xNavegador="IE"}		
	top.window.moveTo(0,0);
	if (document.all) {
		top.window.resizeTo(screen.availWidth,screen.availHeight);
		winAncho=document.body.clientWidth - 15
		winAlto=document.body.clientHeight - 10
	}
	else if (document.layers||document.getElementById) {
			if (top.window.outerHeight<screen.availHeight||top.window.outerWidth<screen.availWidth){
				top.window.outerHeight = screen.availHeight;
				top.window.outerWidth = screen.availWidth;
			}
			winAncho=window.innerWidth - 17
			winAlto=window.innerHeight - 12
	}	
	msgQuita("divPanelAbre|divMsg|divLista|divEspera|divCuerpoRestaura|divVentanaFormatoEspera|divRespuestaServer|divCerrar|divNombreUsuario|")
	xOpcionRegresar='cargaFormato(\'inicio\',\'\',\'A_Contenidos.php\',0,\'\',\'\',\'\',\'\',\'\')';
	cargaFormato('inicio','','A_Contenidos.php',0,'','','','','')
	//organizaEstructura()
}


