
	window.handlers = {};

	window.addHandler = function (eventName, eventHandler)
	{
		if (window.handlers[eventName] == undefined)
			window.handlers[eventName] = new Array;

		var argList = new Array;
		for (var i = 2; i < arguments.length; i++)
			argList.push(arguments[i]);

		window.handlers[eventName].push([eventHandler, argList]);
	}

	window.onload = function ()
	{
		if (window.handlers.onload != undefined)
		{
			for (var i = 0; i < window.handlers.onload.length; i++)
				window.handlers.onload[i][0].apply(window.handlers.onload[i][0], window.handlers.onload[i][1]);
		}
	}

	function hideAllFocus()
	{
		for (var i = 0; i < document.links.length; i++)
			document.links[i].hideFocus = true;

		var arrInputs = document.getElementsByTagName("INPUT");

		for (var i = 0; i < arrInputs.length; i++)
			arrInputs[i].hideFocus = true;
	}

	function trapError(strText, strFile, strLine)
	{
		window.status = strText + " (" + strFile + " on line " + strLine + ")";
		window.setTimeout("window.status = ''", 5000);

		if (window.event != null)
			event.returnValue = true;
		return true;
	}

	function swapImage(imageName, imageSrc)
	{
		var image = document[imageName];
		if (image && image.src != null)
			image.src = imageSrc;
	}

	function openLargeImage(productID)
	{
		large = window.open('?page=image&ID=' + productID, 'lrg', 'toolbar=0,status=0,width=100,height=100');
		large.focus();
	}

	function random_homeImage()
	{
		return '<img src="/dfd/images/home/home0' + (Math.round((2) * Math.random()) + 1) + '.gif" width="349" height="214">';
	}

	window.addHandler("onload", hideAllFocus);
	window.onerror = trapError;
