function initPage()

{

	var nodes = document.getElementById("thumbnails").getElementsByTagName("li");

	var drop = document.getElementById("drop-blocks").getElementsByTagName("li");



	for (var i = 0; i < nodes.length; i++)

	{

		if (nodes[i].className.indexOf("drop-holder") != -1)

		{

			var b = drop[i];

			var a = nodes[i].getElementsByTagName("a").item(0);

			if (a)

			{

				a.onclick = function ()

				{

					var p = this.parentNode;

					if (p.className.indexOf("select") != -1)

						{

							p.className = p.className.replace("select", "");

							b.className = b.className.replace("select", "");

						}

					else

						{

							p.className += " select";

							b.className += " select";

						}

				}

			}

		}

	}

}



if (window.addEventListener)

	window.addEventListener("load", initPage, false);

else if (window.attachEvent)

	window.attachEvent("onload", initPage);