var debug=true;

var imgPairs = [ "sknapman","dogbaby","hoff","fish","hat" ];

function debugAlert(message)
{
	if (debug)
	{
		alert(message);
	}
}

function Test2Init()
{
	if (!document.getElementById)
	{ 
		return; 
	}

	var left	= document.getElementById("leftImageFixup");
	var right	= document.getElementById("rightImageFixup");

	var imgNumToUse	= Math.floor(Math.random()*imgPairs.length);

	if ( left )
	{
		var newElementLeft = document.createElement('img');
		newElementLeft.src="gfx_ff_invert/logos/" + imgPairs[ imgNumToUse ] + "a.png";
		left.parentNode.replaceChild( newElementLeft, left );
	}

	right	= document.getElementById("rightImageFixup");

	if ( right )
	{
		var newElementRight = document.createElement('img');
		newElementRight.src="gfx_ff_invert/logos/" + imgPairs[ imgNumToUse ] + "b.png";
		right.parentNode.replaceChild( newElementRight, right );
	}
}

function addLoadEvent(func)
{
	var oldonload = window.onload;
	if (typeof window.onload != 'function'){
    	window.onload = func;
	} else {
		window.onload = function(){
		oldonload();
		func();
		}
	}

}

addLoadEvent(Test2Init);
