// Inman position clearing script

if (!SI) { var SI = new Object(); };
SI.ClearChildren =
{
	control			: null,
	watchInterval	: 50,
	height			: 0,
	initialize		: function()
	{
		// IE Mac chokes on this (width and height assignments in particular). Go fish.
		if (document.createElement && !(document.all && !window.print))
		{
			var c = document.createElement('div'), s = c.style;
			s.position		= 'fixed';
			s.top			= '0';
			s.visibility	= 'hidden';
			s.width			= '1.em';
			s.height		= '1.em';
			this.control = document.body.appendChild(c);
			this.height = 0;
			window.setInterval('SI.ClearChildren.monitor()', this.watchInterval);
		};
		this.clear(); //49
	},
	
	monitor	: function()
	{
		var o = this.height;
		this.height = this.control.offsetHeight;
		if (o != this.height) { this.clear(); };
	},
	
	clear : function()
	{
		if (!document.getElementsByTagName && !document.all) { return; }

		var elems = (document.all) ? document.all : document.getElementsByTagName('*');
		for (var i = elems.length-1; i >= 0; i--)
		{
			var elem = elems[i];
			if (!elem.className.match(/\bclear_children\b/)) { continue; }; //65
			var container = elem;
			var tallest;
			var maxHeight = 0;
			for (var j = 0; j < container.childNodes.length; j++)
			{
				var contained = container.childNodes[j];
				if (contained.nodeType == 1)
				{
					if (contained.offsetHeight > maxHeight)
					{
						maxHeight	= contained.offsetHeight;
						tallest		= contained;
					};
					contained.className = contained.className.replace(/\bcc_tallest\b/, '');
				};
			};
			// Add to the front of the existing classes to appease IE Mac. Save me Jeebus. 
			tallest.className = 'cc_tallest' + ((tallest.className == '') ? '' : ' ' + tallest.className);
		};
	}
};

// Just do it.
SI.ClearChildren.initialize(); //89