function collectionRegister(collectionItemName)
{
	var collectionItemObject = document.getElementById(collectionItemName);

	if (typeof (collectionItemObject) == 'object')
	{
		counter = collectionObject.length;

		collectionObject[counter] = new Object();
		collectionObject[counter].name = collectionItemName;
		collectionObject[counter].height = 0;
		collectionObject[counter].offset = 0;

	}
}

function collectionCheck()
{
	WindowComplete ? collectionInit() : setTimeout("collectionCheck()",collectionCheckDelay);
}

function collectionInit()
{
	switch (collectionType)
	{
		case "ticker":
			for (i=0;i<collectionObject.length;i++)
			{
				var collectionItemObject = document.getElementById(collectionObject[i].name);

				if (typeof (collectionItemObject) == 'object')
				{
					height = collectionItemObject.offsetHeight;

					collectionObject[i].height = height;
					collectionObject[i].offset = collectionOffset;

					collectionItemObject.style.position = 'absolute';
					collectionItemObject.style.left = '0px';
					collectionItemObject.style.top = collectionOffset + 'px';

					collectionOffset += collectionDirection * (height + (collectionOffset == 0 ? 20 : 0));
				}
			}

			break;
	}

	setInterval("collectionRun()",collectionDelay)
}

function collectionRun()
{
	var i, j;

	switch (collectionType)
	{
		case "ticker":
			for (i=0;i<collectionObject.length;i++)
			{
				j = (collectionObject.length + i - 1) % collectionObject.length;

				collectionObject[i].offset -= collectionStep; Math.abs(collectionObject[i].offset) == collectionObject[i].height && (collectionObject[i].offset = collectionObject[j].offset + collectionDirection * collectionObject[j].height)

				eval('document.getElementById("collection" + i).style.' + collectionOrientation + ' = collectionObject[i].offset + "px";');
			}

			break;
		case "rotator":
			for (i=0;i<collectionObject.length;i++)
			{
				document.getElementById("collection" + i).style.display == "block" && (j = (collectionObject.length + i + 1) % collectionObject.length);
				document.getElementById("collection" + i).style.display = "none";
			}

			document.getElementById("collection" + j).style.display = "block";

			break;
	}
}