var hintTimeout = 0;
var hintLast = '';
var hints = new Array;

function showHint(event,obj,hid) {

	var d = document.getElementById('hint');
	if (!d) {
		d = document.createElement('DIV');
		d.className = 'hint';
		d.id = 'hint';
		document.body.appendChild(d);
	}

	if (hid!=hintLast) {
		d.innerHTML = hints[hid];
		hintLast = hid;
	}

	d.style.display = 'block';
    d.style.width = '400px';
	d.style.border = '1px #333333 solid';
	d.style.backgroundColor = '#ffffe1';
    d.style.filter = 'alpha(opacity=80)';
    d.style.opacity = '0.8';
    d.style.color = '#000000';
    d.style.fontFamily = 'verdana';
    d.style.fontSize = '11px';
    d.style.padding = '3px';
//    d.style.fontSize = '11px';
    //d.style.

	var pos = findCursorPos(event);
	d.style.position = 'absolute';
	d.style.left = (screen.width/2-100)+'px';
	d.style.top = pos[1]+20+'px';
    
    //border: 1px #333333 solid; display:none; position: absolute; width: 400px; background-color: #ffffe1; filter:alpha(opacity=80); opacity: 0.8; padding: 3px; margin-top: 60px; margin-left: 45px; color: #000000; font-weight: normal;'

	if (hintTimeout) clearTimeout(hintTimeout);
	hintTimeout = setTimeout("hideHint()",3000);

}

function hideHint() {
	var d = document.getElementById('hint');
	if (d) d.style.display = "none";	
}

function MyBrowser() {

	var ua, s, i;

	this.isIE    = false;
	this.isNS    = false;
	this.version = null;

	ua = navigator.userAgent;

	s = "MSIE";
	if ((i = ua.indexOf(s)) >= 0) {
		this.isIE = true;
		this.version = parseFloat(ua.substr(i + s.length));
		return;
	}

	s = "Opera";
	if ((i = ua.indexOf(s)) >= 0) {
		this.isIE = true;
		return;
	}

	s = "Netscape6/";
	if ((i = ua.indexOf(s)) >= 0) {
		this.isNS = true;
		this.version = parseFloat(ua.substr(i + s.length));
		return;
	}

	// Treat any other "Gecko" browser as NS 6.1.
	s = "Gecko";
	if ((i = ua.indexOf(s)) >= 0) {
		this.isNS = true;
		this.version = 6.1;
		return;
	}
}

var userBrowser = new MyBrowser();

function findCursorPos(event) {
	var x, y;
	if (userBrowser.isIE) {
		x = window.event.clientX + document.documentElement.scrollLeft + document.body.scrollLeft;
		y = window.event.clientY + document.documentElement.scrollTop + document.body.scrollTop;
	} else if (userBrowser.isNS) {
		x = event.clientX + window.scrollX;
		y = event.clientY + window.scrollY;
	}
	return (new Array(x,y));
}

function showSoftDiv(event,div_id)
{
	var pos = findCursorPos(event);
	d = document.getElementById(div_id);
	d.style.left = pos[0]+5+'px';
	d.style.top = pos[1]+20+'px';
	d.style.display = '';
}

function hideSoftDiv(div_id)
{
    document.getElementById(div_id).style.display = 'none';
}
