function SwapImage(pImage, pUrl) { if ((pImage != null) && (pUrl != null)) { pImage.src = pUrl; } }
function PreloadImage(pUrl) { var oImage = new Image(); oImage.src = pUrl; }

function GetObject(pId) 
{
	var oSource;
	
	if (document.all)
		oSource = document.all(pId);
	else
	{
		if (document.layers)
			oSource = document.layers(pId);
		else if (document.getElementById)
			oSource = document.getElementById(pId);
	}
	
	return oSource;
}

function GetPosX(pSource)
{
	var PosX;
	PosX = 0;
	
	if (pSource.offsetParent)
	{
		while (pSource.offsetParent) 
		{
			PosX += pSource.offsetLeft;
			pSource = pSource.offsetParent;
		}
	}
	else if (pSource.x)
		PosX += pSource.x;
		
	return PosX;
}

function GetPosY(pSource)
{
	var PosY;
	PosY = 0;
	
	if (pSource.offsetParent)
	{
		while (pSource.offsetParent)
		{
			PosY += pSource.offsetTop;
			pSource = pSource.offsetParent;
		}
	}
	else if (pSource.y)
		PosY += pSource.y;
		
	return PosY;
}

function GetWidth(pSource)
{
	var Width;
	Width = 0;
	
	if (pSource.offsetWidth)
		Width = pSource.offsetWidth;
	else if (pSource.clip)
		Width = pSource.clip.width;
	 
	return Width;
}

function GetHeight(pSource)
{
	var Height;
	Height = 0;
	
	if (pSource.offsetHeight)
		Height = pSource.offsetHeight;
	else if (pSource.clip)
		Height = pSource.clip.height;
	 
	return Height;
}

function FindItem(pItems, pItem) 
{
	var Result;
	Result = false;
	
	for (i=0;i<pItems.length;i++) 
	{
		if (pItems[i] == pItem)
			Result = true;
	}
			
	return Result;
}

