var op1;
var fadeel;

onerror=handleErr

function handleErr(msg,url,l)
{
//txt="There was an error on this page.\n\n"
//txt+="Error: " + msg + "\n"
//txt+="URL: " + url + "\n"
//txt+="Line: " + l + "\n\n"
//txt+="Click OK to continue.\n\n"
//alert(txt)
return true
}

function xstooltip_findPosX(obj) 
{
  var curleft = 0;
  if (obj.offsetParent) 
  {
    while (obj.offsetParent) 
        {
            curleft += obj.offsetLeft
            obj = obj.offsetParent;
        }
    }
    else if (obj.x)
        curleft += obj.x;
    return curleft;
}

function xstooltip_findPosY(obj) 
{
    var curtop = 0;
    if (obj.offsetParent) 
    {
        while (obj.offsetParent) 
        {
            curtop += obj.offsetTop
            obj = obj.offsetParent;
        }
    }
    else if (obj.y)
        curtop += obj.y;
    return curtop;
}

function xstooltip_show(tooltipId, parentId)
{

    it = document.getElementById(tooltipId);

        // need to fixate default size (MSIE problem)
        it.style.width = it.offsetWidth + 'px';
        it.style.height = it.offsetHeight + 'px';
        
        img = document.getElementById(parentId); 



  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
  if( typeof( window.pageYOffset ) == 'number' ) {
    //Netscape compliant
    scrOfY = window.pageYOffset;
    scrOfX = window.pageXOffset;
  } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
    //DOM compliant
    scrOfY = document.body.scrollTop;
    scrOfX = document.body.scrollLeft;
  } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
    //IE6 standards compliant mode
    scrOfY = document.documentElement.scrollTop;
    scrOfX = document.documentElement.scrollLeft;
  }

it.style.top = (scrOfY + (myHeight/2)) - (it.height/2) ;
it.style.left = (myWidth/2) - (it.width/2);
	
if (document.getElementById && document.all) { 
it.style.visibility = 'visible';
it.filters.alpha.opacity = 0;
} 
else if (document.getElementById) { 
it.style.MozOpacity = 0;
it.style.visibility = 'visible';
} 
else if (document.layers) { 
it.style.visibility = 'visible';
it.filters.alpha.opacity = 0;
} 
else if (document.all) { 
it.style.visibility = 'visible';
it.filters.alpha.opacity = 0;
}
op1=0;
fadeel=tooltipId;
fadein();
//alert(it.filters.alpha.opacity);
//alert(it.style.visibility);
}

function fadein()
{
it = document.getElementById(fadeel); 
	op1=op1+5;
//alert(op1);
if (document.getElementById && document.all) { 
it.filters.alpha.opacity = op1;
} 
else if (document.getElementById) { 
it.style.MozOpacity = op1 / 100;
} 
else if (document.layers) { 
it.filters.alpha.opacity = op1;
} 
else if (document.all) { 
it.filters.alpha.opacity = op1;
} 
	if(op1<=100)
	{
		setTimeout('fadein()', 0);
	}
}

function xstooltip_hide(id)
{
	it = document.getElementById(id); 
	it.style.visibility = 'hidden'; 
}
