$.fancybox.init();
$(document).ready(function (){
	
});

function mostrarToolTip(e) {
	var d=document.getElementById('divmensaje');
	d.style.visibility="visible";
	if (window.event)
		e=window.event;
	d.style.left = e.clientX + document.body.scrollLeft + 15;
	d.style.top = e.clientY + document.body.scrollTop + 15;
	var ref;
	if (window.event)
		ref=window.event.srcElement;
	else
		if (e)
			ref=e.target;
	if (ref.getAttribute('id')=="eva2"){
		traertooltip(ref.getAttribute('id'));
	}
}

function actualizarToolTip(e) {
	if (window.event) 
		e=window.event;
	var d = document.getElementById("divmensaje");
	d.style.left = e.clientX + document.body.scrollLeft + 15;
	d.style.top = e.clientY + document.body.scrollTop + 15;
}

function ocultarToolTip(e){
	var d = document.getElementById("divmensaje");
	d.style.visibility = "hidden";
}

var conexion;
function traertooltip(id2){
	$.get("http://sangerardo.edu.ec/apps/tooltips.php",{id:id2},function (datos){
		$("#divmensaje").html(datos);
	});
}

function procesarEventos(){
	var d=document.getElementById('divmensaje');
	d.style.visibility = 'visible';
	if (conexion.readyState == 4){
		d.innerHTML=conexion.responseText;
	}
	else {
		d.innerHTML=' ';
	}
}

//Comunes:
function addEvent(elemento,nomevento,funcion,captura)
{
  if (elemento.attachEvent)
  {
    elemento.attachEvent('on'+nomevento,funcion);
    return true;
  }
  else  
    if (elemento.addEventListener)
    {
      elemento.addEventListener(nomevento,funcion,captura);
      return true;
    }
    else
      return false;
}

function crearXMLHttpRequest() 
{
  var xmlHttp=null;
  if (window.ActiveXObject) 
    xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
  else 
    if (window.XMLHttpRequest) 
      xmlHttp = new XMLHttpRequest();
  return xmlHttp;
}
