// JavaScript Document

/*var tooltip_container = document.createElement('div');
var divIdName = 'tooltip';
tooltip_container.setAttribute('id',divIdName);
tooltip_container.setAttribute('class',divIdName);          
_setStyle(tooltip_container, 'position:absolute; display:none; z-index:100005;');
*/
//--
/*
var divIdName = 'tooltipSmall';
tooltip_container2.setAttribute('id',divIdName);
tooltip_container2.setAttribute('class',divIdName);
//tooltip_container.setAttribute('style','z-index:100003;');
_setStyle(tooltip_container2, 'position:absolute; display:none;');
*/
//--

/*tooltip_container.innerHTML = "<img src='images/tooltipBox_top.png' width='200' height='10' /><div id='tooltip_content' style='width:180px; padding:0px 10px; color:#000; background-image:url(images/tooltipBox_body.png); background-repeat:repeat-y; ' ></div><img src='images/tooltipBox_bottom.png' width='200' height='10' />";

addEvent( window, 'load', function() { document.body.appendChild(tooltip_container); }, false );
*/
var IE
var desc
var created_by
function show_tooltip(id)
{
	//desc = document.getElementById('description'+id).value;
	//created_by = document.getElementById('created_by'+id).value;
	desc = id;
	/* */
	// Detect if the browser is IE or not.
	// If it is not IE, we assume that the browser is NS.
	IE = document.all?true:false
	
	// If NS -- that is, !IE -- then set up for mouse capture
	if (!IE) document.captureEvents(Event.MOUSEMOVE);
	
	// Set-up to use getMouseXY function onMouseMove
	document.onmousemove = getMouseXY;
	
	// Temporary variables to hold mouse x-y pos.s
	
}  
var tempX = 0;
var tempY = 0;
function getMouseXY (e) {
	
	//alert(e); 
	//alert(description);
	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;} 
	// show the position values in the form named Show
	// in the text fields named MouseX and MouseY
	//document.Show.MouseX.value = tempX
	//document.Show.MouseY.value = tempY
	/* */
	//tempX = tempX/2;
	//tempY = tempY/2;
	//document.getElementById('presunto').value = tempX+'x'+tempY;
	document.getElementById('tooltip').style.left = (tempX-150)+"px";
	document.getElementById('tooltip').style.top = (tempY-125)+"px";
    //document.getElementById('tooltip').style.z-index = "100005";
	//document.getElementById('tooltip_content').innerHTML = desc;
	
}

function tooltipOver (text) {
	show_tooltip(text); 
	//alert("this");
    document.getElementById('tooltip').style.display = 'block'; 
    //document.getElementById('tooltip').style.zIndex = 100005;
    
    //alert(document.getElementById('tooltip').style.zIndex);
	}
	
function  tooltipOut () {
	document.getElementById('tooltip').style.display = 'none';
	}
	

function rzCC(s){
// thanks http://www.ruzee.com/blog/2006/07/\
// retrieving-css-styles-via-javascript/
for(var exp=/-([a-z])/;
exp.test(s);
s=s.replace(exp,RegExp.$1.toUpperCase()));
return s;
}

function _setStyle(element, declaration) {
if (declaration.charAt(declaration.length-1)==';')
declaration = declaration.slice(0, -1);
var k, v;
var splitted = declaration.split(';');
	for (var i=0, len=splitted.length; i<len; i++) {
	k = rzCC(splitted[i].split(':')[0]);
	v = splitted[i].split(':')[1];
	eval("element.style."+k+"='"+v+"'");
	
	}
}
