function addLoadEvent(func) 
{
	var oldonload = window.onload;	
	if(typeof window.onload != 'function')
	{
		window.onload = func;
	}
	else
	{
		window.onload = function() 
		{
			oldonload();
			func();
		}
	}
}

function fixExternalImages() 
{
	var content = document.getElementById("content");
	if(content != null)
	{
		var images = content.getElementsByTagName("IMG");
		for(var i = 0; i < images.length; i++) 
		{
			var image = images[i];
			image.src = "content/" + loc + "images/" + image.src.substring(image.src.lastIndexOf('/') + 1); 
		}
	}
}

addLoadEvent(fixExternalImages);
