//document.onload = ResetearCuenta();
//document.onmousedown = ResetearCuenta;

function doAtInit(funct)
{
	//reinicio la inactividad
	try{
			//eventos utilizados para resetear la inactividad de la sesión
			document.onmousemove = window.parent.frames.resetearContador;
			//document.onkeypress = window.parent.frames.resetearContador;
			document.onkeydown = window.parent.frames.resetearContador;
			document.onkeyup = window.parent.frames.resetearContador;
			document.onload = window.parent.frames.resetearContador;
			
			//seteo el título de la página
			window.parent.frames[1].div_titulo.innerHTML = top.right.document.title;
			window.parent.frames.resetearContador();
	}
	catch(e){}

	if (funct)
	{
		eval(funct);
	}
}

/******************SACADO EL 04/09/2008**************************************************
function doAtInit222(funct)
{
//alert("2");
var UsuId = window.top.session;
	try
	{
		//alert(document.location);
		top.superiord.location.reload();
		var varCodigoTarea = String(document.location).split("?")[1];
		varCodigoTarea = varCodigoTarea.split("&");
		var homePage = getSessAttrib(window.top.session,'homePage');
		var TieneCod = "SI";
		if (varCodigoTarea[0].split('=')[0] == "COD")
			{varCodigoTarea = varCodigoTarea[0].split('=')[1];}
		else
			{TieneCod="NO"; alert(varCodigoTarea[0].split('=')[0]);}
		var varUsuId = 	getSessAttrib(window.top.session,'UID');

		//alert(varUsuId);

		var Tareas = getSessAttrib(window.top.session,'Tareas').split('$');
//		alert(Tareas);
		if ((varUsuId=="" || Tareas=="")) {TieneCod="NO"};
		var permitido = 'NO';
		for (var i=0;i<(Tareas.length-1);i++)
		{
			if (Tareas[i] == varCodigoTarea)
				{permitido = 'SI'}
		}
		if ((permitido == 'NO') || (TieneCod=="NO"))
		{
			alert("Su Sesión ha caducado por el tiempo de inactividad.\n\nSi quiere seguir operando, ingrese al sistema nuevamente.");
			top.window.document.location = '../../menu/menu/logout.asp?sess=' + UsuId;
			//top.window.document.location = '../../menu/prueba/logout.asp?sess=' + UsuId;
		}
		else
		{
			if (funct)
			{
				eval(funct);
			}
		}
	}
	catch(x)
	{
		alert("Existió algún problema.\n\nSi quiere seguir operando, ingrese al sistema.");
		top.window.document.location = '../../menu/menu/logout.asp?sess=' + UsuId;
		//top.window.document.location = '../../menu/prueba/logout.asp?sess=' + UsuId;
	}
}
*********************************************************************************/

/*
	Función utilizada para resetear el tiempo de la sesión
	y que se renueve el tiempo de inactividad.
*/
/*
function ResetearCuenta(){
	//reseteo el atributo del Objeto Session
	var dx = new ActiveXObject("Microsoft.XMLHTTP");
	dx.open('POST','../../../data/resetSession.asp',false);
	dx.setRequestheader('Content-type','text-html');
	dx.send();
	if (dx.responseText != "OK")
	    {
		alert("ERROR!: Se ha producido un error en su sesión.\nPor favor, ingrese nuevamente a los sistemas.");
	    }
}
*/
