function rollover(thumb, pos)
{
	thumb.out = false;
	if(!thumb.parentNode.clicked)
	{
		if(!document.rolloverImages)
		{
			document.rolloverImages = [];
		}
		if(thumb.parentNode.tagName.toUpperCase() != 'DIV')
		{
			var div = document.createElement('DIV');
			thumb.parentNode.insertBefore(div, thumb);
			thumb.parentNode.removeChild(thumb);
			div.appendChild(thumb);
		}
		if(thumb.parentNode.style.position != 'relative')
		{
			thumb.parentNode.style.position = 'relative';
		}
		if(!thumb.onmouseout)
		{
			thumb.onmouseout = function()
			{
				thumb.out = true;
			}
		}
		thumb.parentNode.style.zIndex = 10000;
		var img = document.createElement('IMG');
		while(document.rolloverImages.length > 0)
		{
			document.rolloverImages.shift().onmouseout();
		}
		document.rolloverImages.push(img);
		img.onmouseout = function() 
		{ 
			thumb.parentNode.clicked = false;
			thumb.parentNode.style.zIndex--;
			if(img.parentNode) 
			{
				img.parentNode.removeChild(img);
			}
		};
		img.onclick = function()
		{
			img.onmouseout();
			thumb.parentNode.clicked = true;
		}
		img.style.visibility = 'hidden';
		img.style.position = 'absolute';
		img.style.width = thumb.clientWidth + 'px';
		img.style.height = thumb.clientHeight + 'px';
		img.onload = function()
		{
			setTimeout(function()
			{
				img.style.width = 'auto';
				img.style.height = 'auto';
				if(pos.indexOf('top') > -1)
				{
					img.style.top = thumb.clientTop + 'px';
				}
				if(pos.indexOf('bottom') > -1)
				{
					img.style.top = (thumb.clientHeight - img.clientHeight) + 'px';
				}
				if(pos.indexOf('left') > -1)
				{
					img.style.left = thumb.clientLeft + 'px';
				}
				if(pos.indexOf('right') > -1)
				{
					img.style.left = (thumb.clientWidth - img.clientWidth) + 'px';
				}
				if(pos.indexOf('center') > -1)
				{
					img.style.left = (thumb.clientWidth - img.clientWidth) / 2 + 'px';
				}
				if(pos.indexOf('middle') > -1)
				{
					img.style.top = (thumb.clientHeight - img.clientHeight) / 2 + 'px';
				}
				img.style.border = 'none';
				if(thumb.out)
				{
					img.onmouseout();
				}
				else
				{
					img.style.visibility = 'visible';
				}
			}, 100);
		};
		img.src = thumb.src;
		thumb.parentNode.style.position = 'relative';
		thumb.parentNode.insertBefore(img, thumb);
	}
	thumb.parentNode.clicked = false;
}