/*
 * EasyGUI XP 1.0.293
 * Copyright(c) 2006-2008 Gaetan Lauff <glauff@plansoft.de>.
 * 
 * This code is licensed under BSD license. Use it as you wish, 
 * but keep the copyright intact.
 * 
 * ========================================================
 * 
 * Prototype JavaScript framework, version 1.6.0.2
 * (c) 2005-2008 Sam Stephenson
 * 
 * ========================================================
 * 
 * script.aculo.us scriptaculous.js v1.8.1
 * Copyright (c) 2005-2008 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
 * 
 * ========================================================
 */

/**
 * @fileoverview Fixed Header Class
 
 *
 * @author	Gaetan Lauff	<glauff@plansoft.de>
 * @package	js.widgets.table
 *
 * @version	$Id: class.fixedheader.js 286 2007-12-13 15:30:41Z glauff $
 */
var EasyGUI_TableFixedHeader = Class.create();
/**
 * @class	EasyGUI_TableFixedHeader
 * @constructor
 * A fixed Header is positioned over all other headers
 * Used when a table has fixed Columns and Lines
 *
 * @param	{object}	table	The Table Object
 * @returns	void
 * @private
 */
Object.extend( Object.extend( EasyGUI_TableFixedHeader.prototype, EasyGUI_TableHeader.prototype ), 
{
	render: function()
	{
		this.zIndex 	= 400;	
		this.header.id 	= this.id + '_FIX';
		
		var header = $(this.header.id);
		
		if ( header != null ) {
			header.remove();
		}
		
		this.container.parentNode.appendChild( this.header );
		
		Element.setDimension( this.header, this.width, this.height );
	},
	
	/**
	 * @private
	 */
	setWidth: function() {
		for (var i=0; i < this.fc; i++)
			this.width += parseInt(this.element.rows[0].cells[i].offsetWidth);
	}
});
