function windowWidth()
{
	x = 1024;
	if (window.innerWidth) // all except Explorer
	{
		x = window.innerWidth;
	}
	else if (document.documentElement && document.documentElement.clientWidth)
		// Explorer 6 Strict Mode
	{
		x = document.documentElement.clientWidth;
	}
	else if (document.body) // other Explorers
	{
		x = document.body.clientWidth;
	}
	return x;
}

function tooltip(e, imgsrc)
{
	if(!e) e = window.event;
	var o = document.getElementById('tt');
	if(o && o.style.display != 'none') return;

	var targ;
	if (e.target) targ = e.target;
	else if (e.srcElement) targ = e.srcElement;
	if (targ.nodeType == 3) targ = targ.parentNode;

	targ.onmouseout = function() { o.style.display = 'none';}

	var o = document.getElementById('tt');
	if(!o)
	{
	   o = document.createElement('div');
	   o.id = 'tt';
	   o.style.position = "absolute";
	   o.style.padding = "1px";
	   o.style.backgroundColor = "#F0E0C9";
	   o.style.border = "2px outset #F0E0C9";
	   document.body.appendChild( o ) ;
	}

	if (e.clientX || e.clientY)
	{
		// posx = e.clientX;
		posy = e.clientY;
	}
	else
	{
		// posx = document.all ? window.event.x : e.pageX;
		posy = document.all ? window.event.y : e.pageY;
	}
	if (typeof(document.body.scrollLeft) != 'undefined')
	{
		// posx += document.body.scrollLeft;
		posy += document.body.scrollTop;
	}
	
	img = new Image();
	img.src = imgsrc;
	imgwidth = img.width ? img.width : 560;
	winwidth = windowWidth();
	posx = Math.max(0, (winwidth - imgwidth) / 2);
	posy += 20;
	
	o.innerHTML = '<div style="border:1px inset #F0E0C9;background-color:#F0E0C9;padding:2px;"><img src="'+imgsrc+'"></div>';
	o.style.top = ++posy + 'px';
	o.style.left = ++posx + 'px';
	o.style.display = '';
}
