/*!======================================================================*\
|| #################################################################### ||
|| # vBulletin 4.0.6 Patch Level 1
|| # ---------------------------------------------------------------- # ||
|| # Copyright ©2000-2010 vBulletin Solutions Inc. All Rights Reserved. ||
|| # This file may not be redistributed in whole or significant part. # ||
|| # ---------------- VBULLETIN IS NOT FREE SOFTWARE ---------------- # ||
|| # http://www.vbulletin.com | http://www.vbulletin.com/license.html # ||
|| #################################################################### ||
\*======================================================================*/

// ######################################################
// THIS STUFF IS IE ONLY FOR DISPLAY:TABLE-CELL EMULATION


function vB_Liquid_Cells()
{
	this.cells = new Array();
	
	YAHOO.util.Event.on(window, "resize", this.resize, this, true);
}

vB_Liquid_Cells.prototype.add_cell = function(element)
{
	var values = this.calculate(element);
	
	this.cells.push(YAHOO.util.Dom.generateId(element));
	
	element.style.width = values.width;
	element.style.marginBottom = values.marginBottom;
}

vB_Liquid_Cells.prototype.calculate = function(element)
{
	var childcells, i, cell, extraWidth, totalWidth = 0;
	
	childcells = YAHOO.util.Dom.getElementsByClassName("td", "*", element.parentNode);
		
	for (i = 0; i < childcells.length; i++)
	{
		cell = childcells[i];
		if (cell != element && cell.currentStyle.display != "none")
		{
			totalWidth += parseFloat(cell.offsetWidth);
		}
	}
	
	/*if (typeof element.extraWidth == "undefined")
	{
		var plw = parseFloat(element.currentStyle.paddingLeft);
		var prw = parseFloat(element.currentStyle.paddingRight);
		var blw = parseFloat(element.currentStyle.borderLeftWidth);
		var brw = parseFloat(element.currentStyle.borderRightWidth);
			
		element.extraWidth = (isNaN(plw) ? 0 : plw) + (isNaN(prw) ? 0 : prw) + (isNaN(blw) ? 0 : blw) + (isNaN(brw) ? 0 : brw);
		
		output.value = element.extraWidth;
	}*/
	
	return {
		"marginBottom" : -9999 + parseFloat(element.currentStyle.paddingTop),
		"width" : parseFloat(element.parentNode.offsetWidth) - totalWidth/* - element.extraWidth*/
	};
}

vB_Liquid_Cells.prototype.resize = function(e)
{
	var element, values;
	
	for (var i = 0; i < this.cells.length; i++)
	{
		element = YAHOO.util.Dom.get(this.cells[i]);
		values = this.calculate(element);		
		element.style.width = values.width;
	}
}

var LCF = new vB_Liquid_Cells();

/*======================================================================*\
|| ####################################################################
|| # Downloaded: 10:52, Thu Aug 19th 2010
|| # CVS: $RCSfile$ - $Revision: 26385 $
|| ####################################################################
\*======================================================================*/