/**
* Function to resize an image used with the [IMG] bbcode tag
*
* @param	string	Image object
* @param	string	Image link
* @param	integer	Image max width
*/
function resize_image(obj, link, maxwidth)
{
	if (obj.width > maxwidth)
	{
		obj.style.cursor = 'pointer';
		obj.style.width = maxwidth + 'px';
		obj.style.height = parseInt(obj.height * maxwidth / obj.width) + 'px';
		obj.onclick = function()
		{
			window.location.href = link;
			return false;
		};
	}
}

/**
* Function to emulate document.getElementById
