/**
* Function:	DMC_preloadImages
* Version:	1.0
* Date:		19/03/2004
*/
function DMC_preloadImages()
{
	if(document.images)
	{
		var iNumImages = DMC_preloadImages.arguments.length;
		
		document.aImages = new Array();
		
		for(var iImage = 0; iImage < iNumImages; ++iImage)
		{
			document.aImages[iImage] = new Image();
			document.aImages[iImage].src = DMC_preloadImages.arguments[iImage];
		}
	}
}

/**
* Function:	DMC_swapImage
* Version:	1.0
* Date:		19/03/2004
*/
function DMC_swapImage(strImage, strSource)
{
	if(document.getElementById){ document.getElementById(strImage).src = strSource; }
}

/**
* Function:	DMC_openWinCentred
* Version:	1.0
* Date:		19/03/2004
*/
function DMC_openWinCentred(strURL, strWinName, iWidth, iHeight, iTop, iLeft, bCentre)
{
	if(bCentre == true)
	{
		if(screen.Width >= parseInt(iWidth))
		{
			iTop = parseInt((screen.Height / 2) - (iHeight / 2));
			iLeft = parseInt((screen.Width / 2) - (iWidth / 2));
		}
		else
		{
			iTop = 0;
			iLeft = 0;
		}
	}
	
	window.open(strURL, strWinName, "status=no,toolbar=no,menubar=no,scrollbars=no,resizable=yes,top=" 
				+ iTop + ",left=" + iLeft + ",width=" + iWidth + ",height=" + iHeight);
}
/**
* Function:	DMC_openWinCentredMenu
* Version:	1.0
* Date:		19/03/2007
*/
function DMC_openWinCentredMenu(strURL, strWinName, iWidth, iHeight, iTop, iLeft, bCentre)
{
	if(bCentre == true)
	{
		if(screen.Width >= parseInt(iWidth))
		{
			iTop = parseInt((screen.Height / 2) - (iHeight / 2));
			iLeft = parseInt((screen.Width / 2) - (iWidth / 2));
		}
		else
		{
			iTop = 0;
			iLeft = 0;
		}
	}
	
	window.open(strURL, strWinName, "status=1,toolbar=1,menubar=1,scrollbars=1,resizable=1,top=" 
				+ iTop + ",left=" + iLeft + ",width=" + iWidth + ",height=" + iHeight);
}
/**
* Function:	DMC_openWinFullscreen
* Version:	1.0
* Date:		19/03/2004
*/
function DMC_openWinFullscreen(strURL, strWinName, strOptions)
{
	var iWidth = screen.availWidth();
	var iHeight = screen.availHeight();
	
	window.open(strURL, strWinName, strOptions + ",width=" + iWidth + ",height=" + iHeight);
}