/************************************************************************************************************
(C) www.dhtmlgoodies.com, September 2005

This is a script from www.dhtmlgoodies.com. You will find this and a lot of other scripts at our website.	

Terms of use:
You are free to use this script as long as the copyright message is kept intact. However, you may not
redistribute, sell or repost it without our permission.

Thank you!

www.dhtmlgoodies.com
Alf Magne Kalleland

************************************************************************************************************/	

/**
 * Locates a object
 *
 * @param   object name    the object you want returned
 * @param   document  the area to  look in
 *
 * @return  object  the requested object
 */
function getObj(n,d) {

  var p,i,x;

  if(!d)

      d=document;


  if((p=n.indexOf("?"))>0&&parent.frames.length) {

    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);

  }



  if(!(x=d[n])&&d.all)

      x=d.all[n];



  for(i=0;!x&&i<d.forms.length;i++)

      x=d.forms[i][n];



  for(i=0;!x&&d.layers&&i<d.layers.length;i++)

      x=getObj(n,d.layers[i].document);



  if(!x && d.getElementById)

      x=d.getElementById(n);



  return x;

}

function showToolTip(e,text){
	nondefaultpos=true;
	if(document.all)e = event;
	var obj = getObj('bubble_tooltip');
	var obj2 = getObj('bubble_tooltip_content');
        if(obj != null && obj2 != null) {
            obj2.innerHTML = text;
            obj.style.display = 'block';
            
            var st = Math.max(document.body.scrollTop,document.documentElement.scrollTop);
            if(navigator.userAgent.toLowerCase().indexOf('safari')>=0)st=0; 
            var leftPos = e.clientX - 100;
            if(leftPos<0)leftPos = 0;
            obj.style.left = leftPos + 'px';
            obj.style.top = e.clientY - obj.offsetHeight -1 + st + 'px';	
            shimit(obj);
        }
	//if (obj) document.onmousemove = function (evt) {moveToolTip(evt)};
}	

function hideToolTip()
{
	var myObject = getObj('bubble_tooltip');
        if(myObject != null) {
            myObject.style.display = 'none';	
            noshim();
        }
}

function moveToolTip(evt) {
	var x=0, y=0;
	var obj = getObj('bubble_tooltip');
	if (document.all) {//IE
		x = (document.documentElement && document.documentElement.scrollLeft) ? document.documentElement.scrollLeft : document.body.scrollLeft;
		y = (document.documentElement && document.documentElement.scrollTop) ? document.documentElement.scrollTop : document.body.scrollTop;
		x += window.event.clientX;
		y += window.event.clientY;
		
	} else {//Good Browsers
		x = evt.pageX;
		y = evt.pageY;
	}
	
	x = x - 100;
	y = y - obj.offsetHeight -1;
	if(x<0) x = 0;
	obj.style.left = x + "px";
	obj.style.top = y + "px";
}

function shimit(obj){
if (typeof shim=='undefined')
return;
var shimobj=document.getElementById('shim').style;

shimobj.height=obj.offsetHeight+'px'
shimobj.width=obj.offsetWidth+'px'
var obj=obj.style
shimobj.left=obj.left
shimobj.top=obj.top
shimobj.zIndex=99
shimobj.display='block'
}

function noshim(){
if (typeof shim=='undefined')
return;
document.getElementById('shim').style.display='none';
}