function showinfo(id) {
	var elem = document.getElementById('balloon');
	if (!elem) {
		return 0;
	}
	elem.style.display = 'block';
	// elem.className = 'prog-info ' + type;
	elem.className = 'prog-info';
	elem.innerHTML = document.getElementById('prog-info-' + id).innerHTML;
}

function hideinfo() {
	var elem = document.getElementById('balloon');
	if (!elem) {
		return 0;
	}
	elem.style.display = "none";
}

function getNavigatorWidth() {
	if (document.body) {
		return document.body.clientWidth;
	} else {
		return window.innerWidth;
	}
}

function getNavigatorHeight() {
	if (document.body) {
		return document.body.clientHeight;
	} else {
		return window.innerHeight;
	}
}

function getScrollX() {
	if (typeof(window.pageXOffset) == 'number' ) {
		// Netscape compliant
		return window.pageXOffset;
	} else if (document.body && document.body.scrollLeft) {
		// DOM compliant
		return document.body.scrollLeft;
	} else if (document.documentElement && document.documentElement.scrollLeft) {
		// IE6 standards compliant mode
		return document.documentElement.scrollLeft;
	} else {
		return 0;
	}
}

function getScrollY() {
	if (typeof(window.pageYOffset) == 'number' ) {
		// Netscape compliant
		return window.pageYOffset;
	} else if (document.body && document.body.scrollTop) {
		// DOM compliant
		return document.body.scrollTop;
	} else if (document.documentElement && document.documentElement.scrollTop) {
		// IE6 standards compliant mode
		return document.documentElement.scrollTop;
	} else {
		return 0;
	}
}

function mouseMove(evt) {
	if (!document.getElementById('balloon')) {
		return 0;
	}
	var disp = document.getElementById('balloon').style.display;
	if (disp == 'none') {
		return 0;
	}
	var style = document.getElementById('balloon').style;
	var width = getNavigatorWidth();
	var height = getNavigatorHeight();
	var balloon_width = document.getElementById('balloon').offsetWidth;
	var balloon_height = document.getElementById('balloon').offsetHeight;
	var x = 0;
	var y = 0;
	var plusX;
	var plusY;
	if (document.layers) {
		x = evt.x;
		y = evt.y;
	} else if (document.all) {
		x = event.clientX;
		y = event.clientY;
	} else if (document.getElementById) {
		x = evt.clientX;
		y = evt.clientY;
	}
	plusX = getScrollX();
	plusY = getScrollY();
	if ((x + 25 + balloon_width) > width ) {
		trop = (x + 25 + balloon_width) - width;
		style.left = (x + 15 - trop + plusX) + 'px';
	} else {
		style.left = (x + 15 + plusX) + 'px';
	}
	if ((y - balloon_height - 25) < 0 ) {
		style.top = (y + 25 + plusY) + 'px';
	} else {
		style.top = (y - balloon_height - 25 + plusY) + 'px';
	}
}

if (document.layers) {
	document.captureEvents(Event.MOUSEMOVE);
}

if (document.layers || document.all) {
	document.onmousemove = mouseMove;
}

if (document.addEventListener) {
	document.addEventListener('mousemove', mouseMove, true);
}