var BlindEffect =
{
						measureItem: function(item)
	{
						var itemParent = item.parentNode;
		var measure = document.createElement("div");
		itemParent.appendChild(measure);

		measure.style.visibility = "hidden";
		measure.style.overflow = "hidden";
		measure.height = "1px";

		var clone = item.cloneNode(true);
		clone.style.display = "block";
		measure.appendChild(clone);

		var height = clone.offsetHeight;
		itemParent.removeChild(measure);

				return height + 2;
	},

	setOpacity: function(item, opac)
	{
		if ((navigator.appVersion.indexOf("MSIE")!= -1) && !window.opera)
			item.style.filter = "alpha(opacity=" + parseInt(opac * 100.0) + ")";
		else
			item.style.opacity = opac;
	},

	toggle: function(id)
	{
		var item = document.getElementById(id);
		if (item.timer)
						return;

		if (!item.offsetHeight || item.offsetHeight <= 1)
		{
			var expanding = true;
			var from_height = 1;
			var to_height = BlindEffect.measureItem(item);
			var from_opac = 0.0;
			var to_opac = 1.0;
			item.style.height = "1px";
			item.style.display = "block";
			item.style.overflow = "hidden";

		} else
		{
			var expanding = false;
			var from_height = item.offsetHeight;
			var to_height = 1;
			var from_opac = 1.0;
			var to_opac = 0.0;
		}

		var update_rate = 25;
		var duration = 1000.0;
		var d = new Date();
		var start_time = d.getTime();

		item.timer = window.setInterval
		(
			function()
			{
				var d = new Date();
				var passed_time = d.getTime() - start_time;

				if (passed_time >= duration)
				{
					if (expanding)
					{
						item.style.height = to_height + "px";

					} else
					if (!expanding)
					{
																								item.style.height = "";
						item.style.display = "none";
					}

					window.clearInterval(item.timer);
					item.timer = null;
					BlindEffect.setOpacity(item, to_opac);

				} else
				{
					var t = Math.sin(passed_time / duration * Math.PI/2.0);
					var height = from_height + (to_height - from_height) * t;
					item.style.height = height + "px";
					BlindEffect.setOpacity(item, from_opac + (to_opac - from_opac) * t);
				}
				// if (window.CustomHeightForCountdowncontainer)
				//	window.CustomHeightForCountdowncontainer();
			},
			update_rate
		);
	}
}