// Temporary variables to hold mouse x-y pos.s
var tempX = 0;
var tempY = 0;
rightX = 0;
rightY = 0;
leftY = 0;
leftX = 0;
// Detectamos  if el browser es netscape o no.
var IE = document.all? true:false;
// If es netscape entonces seteamos la captura del mouse
if (!IE) document.captureEvents(Event.MOUSEMOVE);
// Set-up to use getMouseXY function onMouseMove
document.onmousemove = getMouseXY;

function getMouseXY(e)
{
  if (IE) { // grab the x-y pos.s if browser is IE
    tempX = event.clientX + document.body.scrollLeft
    tempY = event.clientY + document.body.scrollTop
  } else {  // grab the x-y pos.s if browser is NS
    tempX = e.pageX;
    tempY = e.pageY;
  }  
  // catch possible negative values in NS4
  if (tempX < 0){tempX = 0};
  if (tempY < 0){tempY = 0};
  return true; 	
}

function calculateSumOffset(idItem, offsetName)
{
	var totalOffset = 0;
	var item = eval('idItem');
	do
	{
		totalOffset += eval('item.'+offsetName);
		item = eval('item.offsetParent');
	} while (item != null);
	return totalOffset;
}

/*	Funciones para mostrar las noticias. */

function MuestraEvento(numEvento)
{
if (numEvento > 0) ventanaEvento=window.open("/Sic/evento_en_linea_a.asp?codigo="+numEvento,"replace","height=350,width=475");	
}

function Evento()
{
 numevento= document.all['Eventos'].value;
 MuestraEvento(numevento);
}
	
function Nada()
{
}
/* Funciones de las Estadisticas Anuales*/
function Oculta()
{k=0;
	  while (1)
	   {	if(typeof(document.all['sub'+k])!="undefined")
	   	 {	document.all['sub'+k].style.visibility='hidden';
	   	 	//alert("oculta");
	   	 }
		else {break;}
		k++;
		
	 }
}

function OcusubMenu(id)
{
 document.body.onclick=Oculta;//hideAll;
 document.body.onscroll=Oculta;//hideAll;
 document.body.onmousemove=Actualizado;
}

function Actualizado()
{
	var x = window.event.clientX;
	var y = window.event.clientY;
	if (x > rightX || x < leftX) Oculta();
	else if (y > rightY || y <leftY) Oculta();
	//else Oculta();
document.body.onmousemove=null;	
}

function MusubMenu(id,men)
{
  k=0;

  while (1)
   {	if(typeof(document.all['sub'+k])!="undefined")
   	 {	document.all['sub'+k].style.visibility='hidden';
   	 }
	else {break;}
	k++;
    }

 if (typeof(id) != "undefined"){
  menu = eval(id);
  document.all[id].style.left=calculateSumOffset(menu, 'offsetLeft');
  leftX  = document.all[id].style.posLeft;
  rightX = leftX + document.all[id].offsetWidth ;
  leftY  = document.all[id].style.posTop; 
  rightY = leftY + document.all[id].offsetHeight;
  menu = eval(men);
  document.all[id].style.left=calculateSumOffset(menu, 'offsetLeft')+178;
  document.all[id].style.top=calculateSumOffset(menu,'offsetTop')-8;
  document.all[id].style.visibility='visible';
}
}
 
<!--
// Desactiva SUBMIT una vez clickeado. 2003 http://www.ultimorender.com.ar/funkascript/
// Funciona en navegadores DOM, PC & Mac (Explorer 5+, Netscape 6+, Mozilla.)
// 1. Coloca el <script> entre los tags <head> del HTML
// 2. No hace falta agregar nada a los inputs o al form. Ya está listo. Funcionará solo.
//
// OPCIONAL:
// La función disable() también puede llamarse manualmente, por ejemplo si usas una función más compleja con otros eventos onSubmit u onLoad.
// Para esto, setea autoDetect=false y llama a la función desde el tag FORM, asi:
// <form name="form1" action="xxxxx.cgi" onSubmit="disable(this)">

autoDetect = true;
timeOutSecs = 5; 	// luego de 5 segundos, el botón se habilitará de nuevo, 
					// para el caso de que el servidor deje de responder y el usuario 
					// necesite volver a submitir. 

window.onload = init; // esta linea puede borrarse si autoDetect=false

function init(e){
	if (autoDetect){
		for (var a=0;a<document.forms.length;a++){
			document.forms[a].onsubmit = disable; // adjunta la función disable a todos los forms
		}
	}
}

function disable(e){ // asigna función al submit y pasa el evento como argumento
	if (document.getElementById) { // chekea que el navegador soporte. Sino lo hace, se ignora el efecto.
		if (autoDetect){ // toma el objeto FORM desde el evento
			if (!e) {e = document.parentWindow.event;} // mozilla pasa (e) pero IE no, así que también usamos su forma de obtener el evento
			var el = e.target || e.srcElement; // obtener el elemento de donde salió el evento, para mozilla o explorer
		} else { // toma el objeto FORM si se pasa manualmente
			el = e;
		}
		while (el.tagName != "FORM"){ el = el.parentNode;} // mozilla pasa el input como source del submit. busco entonces el form de ese input.
		for (var b=0;b<el.elements.length;b++){ // por cada elemento del form
			var formEl = el.elements[b];
			// si el elemento es un botón de submit
			if ((formEl.tagName == "INPUT") && (formEl.getAttribute("type") != null) && ((formEl.getAttribute("type").toLowerCase() == "submit") )) {
				formEl.disabled = true; // desactivar botón
				document.body.style.cursor = 'wait'; // relojito
				setTimeout(function(){formEl.disabled = false;document.body.style.cursor = 'default';},timeOutSecs*1000)
			}
		}
	}
	return true;
}
//-->

function OpenBrWindow(theURL,winName,features, myWidth, myHeight, isCenter) { //v3.0
  if(window.screen)if(isCenter)if(isCenter=="true"){
    var myLeft = (screen.width-myWidth)/2;
    var myTop = (screen.height-myHeight)/2;
    features+=(features!='')?',':'';
    features+=',left='+myLeft+',top='+myTop;
  }
  window.open(theURL,winName,features+((features!='')?',':'')+'width='+myWidth+',height='+myHeight);
}

function highlight(which,color){
if (document.all||document.getElementById)
which.style.backgroundColor=color
}
function piedepagina()
{
document.write("<div class=derechos style='text-align:center;'><div style='width:91%; POSITION: relative; background-color:#f1f1f1;'>C. Manuel Roaud y Paz Soldan 364. San Isidro, Lima - PER&Uacute;<br />Tel&eacute;fono: (511) 611-8585</div>");
<!--document.write("<div style='width:91%; background-color:#f1f1f1;'>Tel&eacute;fono: (511) 221-8585 Telefax (511) 421-7923<BR></div></div>");-->
}
