// JavaScript Document
var tempX = 0;
var tempY = 0;

// Detecting Internet Explorer
var IE = document.all?true:false

// If NS -- that is, !IE -- then set up for mouse capture
if (!IE) document.captureEvents(Event.MOUSEUP)

// Set-up to use getMouseXY function onMouseMove
document.onmouseup = getMouseXY;


// Main function to retrieve mouse x-y pos.s

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;
//	alert("Left: " + document.body.scrollLeft + "   Top: " + 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}  
  // show the position values in the form named Show
  // in the text fields named MouseX and MouseY
  return true;
}

function closeInternal(itemId){
    document.getElementById(itemId).innerHTML = '';
    document.getElementById(itemId).style.left = '0px';
    document.getElementById(itemId).style.top = '0px';
	document.getElementById(itemId).style.width = '1px';
	document.getElementById(itemId).style.height = '1px';
    document.getElementById(itemId).style.visibility = 'hidden';
}

function openInternal(par, div_id, id_array){
    int_div = document.getElementById(div_id);
	int_div.style.width = '';
	int_div.style.height = '';

	int_div.style.left = (tempX - 30) + "px";
	int_div.style.top = (tempY - 100) + "px";
    int_div.style.visibility = 'visible';
	int_div.innerHTML = "<center>Cargando...</center>";

    getPageHTML(div_id,'getMoreInfo.php?id_array='+id_array);
    int_div.style.left = (tempX - 200) + "px";
    int_div.style.top = (tempY - 150) + "px";
}
