/* hint function */

/* style definition */

d.write(
'<style type="text/css">',
'#hint { ',
'	position: absolute; ',
'	visibility: hidden; ',
'	text-align: left; ',
'	font-size: 12px; ',
'	color: #000; ',
' z-index: 100; ',
'}',
'#shadow { ',
'	position: absolute;',
'	opacity: 0.15; ',
'	background: #000; ',
' z-index: 99; ',
((new BWC).ie?
/* ie styles only */
'	filter: alpha(opacity=15);'
/* ie styles end */
: ''),
'}',
'</style>'
);

/* style definition end */

function hint(o, html)
{
	o.title = '';

	/* show and hide delay in ms */
	var showDelay = 20,
			hideDelay = 20;

	if(typeof ho == 'undefined')
		hintInit = function()
		{
			ho = d.createElement('div');
			sho = d.createElement('div');
		}();

	if(typeof hintTid == 'undefined')
		hintTid = null;
	else if(hintTid)
		clearTimeout(hintTid);

	if($$('hint') == null && o)
	{
		ho.id = 'hint';
		ho.className = 'l';
		sho.id = 'shadow';
		sho.style.visibility = 'visible';

		
		ho.innerHTML = '<table style="width: 330px;" cellspacing="0">' +
		'<tr><td class="tl"></td><td class="top"></td><td class="tr"></td></tr>' +
		'<tr><td colspan="3" class="mid">' +
		html +
		'</td></tr><tr><td class="bl"></td><td class="bot"></td><td class="br"></td></tr></table>';
			
		d.body.appendChild(sho);
		d.body.appendChild(ho);	
			
		setTimeout("$$(ho, 'table', 0).className = 'tip';", showDelay - 1);

		var	oW = ho.offsetWidth,
				oH = ho.offsetHeight,
				scrW = d.body.clientWidth,
				scrH = n.indexOf('Opera') > -1? d.body.clientHeight : d.documentElement.clientHeight,
				scllH = d.documentElement.scrollTop;

		o.onmousemove = function(e)
		{
			e = e? e : window.event;

			var x = e? e.clientX : 0,
					y = e? e.clientY : 0;

				x = x + oW < scrW? x + 10 : x - oW - 10;
				y = y + scllH + 20 + oH < scrH + scllH? y + scllH + 20 : y + scllH - oH - 10;

				ho.style.left = x + 'px';
				ho.style.top = y + 'px';


				
				with(sho.style)
				{
					left = x + 4 + 'px';
					top = y + 4 + 'px';
				/*}
				
				with(sho.style)
				{*/
					width = oW + 'px';
					height = oH + 24 + 'px';
				}

		}

		o.onmouseout = function(){ 
		
			removeHint();
			
			o.title = html;
		
		}

		hintTid = setTimeout(
		function()
		{
			ho.style.visibility = 'visible';
			sho.style.visibility = 'visible';
		}
		, showDelay);

	}
	else if($$('hint') && $$('shadow') && !o)
	{
		hintTid = setTimeout(
		function()
		{
			removeHint();
		}
		, hideDelay);
	}
	else if($$('hint') && $$('shadow') && o)
	{
			removeHint();
			hint(o, html);
	}
	
	function removeHint()
	{
		
		hintTid = setTimeout(
		function()
		{
			d.body.removeChild(sho);
			d.body.removeChild(ho);
		}
		, hideDelay);
		
	}
	
}


function linksInit(o)
{
	var arr = $$(o, 'img'), newArr = [];

		for(var x = 0; x <= arr.length - 1; x++)
			if(arr[x].className.indexOf('h') >- 1)
				newArr[newArr.length] = arr[x];
				
		for(var x in newArr)	
			newArr[x].onmouseover = function() 
			{
				hint(this, this.title.replace(/(\d+)/g,'<b>$&</b>','g')); 
			}
}

/* hint function end */

