function getIFrameDocument(aID)
{ 
	var rv = null; 

	// if contentDocument exists, W3C compliant (Mozilla) 
	if (document.getElementById(aID).contentDocument)
	{ 
		rv = document.getElementById(aID).contentDocument; 
	} else { 
		// IE 
		rv = document.frames[aID].document; 
	} 

	return rv; 
} 



// Title: Tigra Hints
// URL: http://www.softcomplex.com/products/tigra_hints/
// Version: 1.3
// Date: 09/03/2003 (mm/dd/yyyy)
// Note: Permission given to use this script in ANY kind of applications if
//    header lines are left unchanged.

var THintsS = [];
function THints (o_cfg, items) {
	this.n_id = THintsS.length;
	THintsS[this.n_id] = this;
	this.top = o_cfg.top ? o_cfg.top : 0;
	this.left = o_cfg.left ? o_cfg.left : 0;
	this.n_dl_show = o_cfg.show_delay;
	this.n_dl_hide = o_cfg.hide_delay;
	this.x = 0;
	this.y = 0;
	this.HTMLs = [];
	this.show  = TTipShow;
	this.hide = TTipHide;
	this.move = TTipMove;
	this.myDiv = null;
	this.myIframe = null;
	this.visible = false;
	// register the object in global collection
	this.n_id = THintsS.length;
	THintsS[this.n_id] = this;

	// filter Netscape 4.x out
	if (document.layers) return;
	
	
	var b_IE = navigator.userAgent.indexOf('MSIE') > -1,
	s_tag = ['<div class="', o_cfg.css, '" id="TDiv', this.n_id ,'" name="TDiv', this.n_id ,'"><iframe id="TiFrame', this.n_id , '" name="TiFrame', this.n_id ,'" src="includes/hints_iframe.htm" scrolling="no" frameborder="0" width="98%" height="98%"></iframe></div>'].join('');

	this.getElem = 
		function (id) 
		{
			return document.all ? document.all[id] : document.getElementById(id); 
		};
		
	this.showElem = 
		function (hide) 
		{ 
			this.myDiv.o_css.visibility = hide ? 'hidden' : 'visible'; 
		};
		
	if (window.opera) 
	{
		document.onmousemove = 
			function () 
			{
				for (var n_i in THintsS) 
				{
					THintsS[n_i].x = event.clientX;
					THintsS[n_i].y = event.clientY;
					THintsS[n_i].move();
				};
				return true;
			};
	}
	else 
	{
		document.onmousemove = b_IE
			? function () {
				for (var n_i in THintsS) 
				{
					THintsS[n_i].x = event.clientX + document.body.scrollLeft;
					THintsS[n_i].y = event.clientY + document.body.scrollTop;
					THintsS[n_i].move();
				};
				return true;
			} 
			: function (e) {
				for (var n_i in THintsS) 
				{
					THintsS[n_i].x = e.pageX;
					THintsS[n_i].y = e.pageY;
					THintsS[n_i].move();
				};
				return true;
			};
	};
	

	document.write(s_tag);
	
	//alert( 'TDiv' + this.n_id );
	this.myDiv = { 'o_obj' : this.getElem('TDiv'+ this.n_id) };
	this.myDiv.o_css = this.myDiv.o_obj.style;
	this.myDiv.o_css.visibility = 'hidden';
	this.myIframe = getIFrameDocument('TiFrame'+this.n_id).body;

	for (i in items) {
		this.HTMLs[i] = items[i];
	};
	
}

function TTipShow (id) 
{
	if (this.visible) return;
	this.visible = true;
	if (document.layers) return;
	//document.frames('TiFrame'+ this.n_id).document.body.innerHTML = this.HTMLs[id];
	//TiFrame.document.body.innerHTML = this.HTMLs[id];
	//alert(this.HTMLs[id]);
	getIFrameDocument('TiFrame'+this.n_id).body.innerHTML = this.HTMLs[id];

	if (this.timer) clearTimeout(this.timer);
	this.timer = setTimeout('THintsS[' + this.n_id + '].showElem(false)', 10);
}

function TTipMove () 
{
	if (!this.visible) return;
	this.myDiv.o_css.left = this.x + 12;
	this.myDiv.o_css.top = this.y + 12;
}

function TTipHide () 
{
	if (!this.visible) return;
	this.visible = false;
	if (this.timer) clearTimeout(this.timer);
	setTimeout('THintsS[' + this.n_id + '].showElem(true)', 10);
}

