/*
 * working only with jQuery 1.2.6
 */
 
function showPop(e, hintText) {
  var x = 0, y = 0;
  var mousex,mousey;
  if(hintText==undefined) { 
	hidePop();
  } else {
	  if (!e) e = window.event;

	  
	  if (e)
	  { 
		if (e.pageX || e.pageY)
		{ // this doesn't work on IE6!! (works on FF,Moz,Opera7)
		  mousex = e.pageX;
		  mousey = e.pageY;
		  algor = '[e.pageX]';
		  if (e.clientX || e.clientY) algor += ' [e.clientX] '
		}
		else if (e.clientX || e.clientY)
		{ // works on IE6,FF,Moz,Opera7
		  mousex = e.clientX + document.body.scrollLeft;
		  mousey = e.clientY + document.body.scrollTop;
		  algor = '[e.clientX]';
		  if (e.pageX || e.pageY) algor += ' [e.pageX] '
		}  
	  }

	$('#hint').html('');
	var box_w = (hintText.length<100?100:250);
	document.getElementById('hint').style.width = box_w + 'px';
	var x = ($(document).width()<(mousex+20+box_w))?$(document).width()-box_w-230:mousex-20;
	//alert('x='+x+', body='+$(document).width()+', box_w='+box_w+', mouse='+mousex);	

	
	$('#hint').show().html(hintText);
	document.getElementById('hint').style.left = x +'px';
	document.getElementById('hint').style.top = mousey+ 20+'px';
  }
}
   
function hidePop(){
	$('#hint').hide(); 
}


$(document).ready(function() {
	$('#content').prepend( '<span id="hint" style="position:absolute; display:none; border:1px solid silver; background-color:#FFFDDF; padding:4px 9px; font-size:11px; z-index:999;"></span>');
});