document.onmousemove = function(evt) {
	if (!evt) evt = window.event;
	mousex = evt.clientX;
	mousey = evt.clientY;
	moveTtBox();
}

function toolTipBox(x) {
	create_tip();
	showElement('tip');
	$('tip_content').innerHTML = x;
	if ($('tip_content').clientWidth>300) { $('tip').style.width = '300px'; }
	if ($('tip_content').offsetWidth>300) { $('tip').style.width = '300px'; }
}

function clearToolTipBox() {
	if ($('tip')) {
		hideElement('tip');
	}
}

function moveTtBox(x) {
	if ($('tip')) {
		var left = (mousex + 12);
		var top = (mousey + 10);
		$('tip').style.left = left + 'px';
		$('tip').style.top = top + 'px';
	}
}

function create_tip() {
	if (!$('tip')) {
		var newDiv = document.createElement("div");
		newDiv.id = "tip";
		newDiv.className = "tip";
		newDiv.style.visibility = 'hidden';
		newDiv.style.display = 'none';
		newDiv.style.zIndex = '255';
		newDiv.style.width = 'auto';
		//newDiv.style.maxWidth = '300px';

		tip_content = '<div class="tt_content" id="tip_content"></div>';

		newDiv.innerHTML = tip_content;		
		document.body.appendChild(newDiv);
	}
}