//------------ Methods ------------//
function LqcResizeFrame_getElement( objDocument, strElementId ){
	if( objDocument.getElementById ){
		return  objDocument.getElementById( strElementId );
	} else {
		return  objDocument.all[ strElementId ];
	}
}

function LqcResizeFrame_setWidth( objElement, intWidth ){
	objElement.style.width = intWidth + 'px';
}

function LqcResizeFrame_setHeight( objElement, intHeight ){
	objElement.style.height = intHeight + 'px';
}

function LqcResizeFrame_getWidth( objElement ){
	return objElement.offsetWidth;
}

function LqcResizeFrame_getHeight( objElement ){
	return objElement.offsetHeight;
}

function LqcResizeFrame_init( objFrame, objContent, boolProcessWidth, boolProcessHeight, intMinimumWidth, intMinimumHeight, intOffsetWidth, intOffsetHeight ){
	this.objTopFrame = objFrame;
	this.objContent = objContent;
	this.processWidth = boolProcessWidth;
	this.processHeight = boolProcessHeight;
	this.minimumWidth = intMinimumWidth;
	this.minimumHeight = intMinimumHeight;
	this.offsetWidth = intOffsetWidth;
	this.offsetHeight = intOffsetHeight;
}

function LqcResizeFrame_resize(){
	try{
		if( this.processWidth ){
			var intCurrentWidth = this.getWidth( this.objContent );
			if( this.minimumWidth > 0 ){
				if( intCurrentWidth < this.minimumWidth  ){
					intCurrentWidth = this.minimumWidth ;
				}
			}
			intCurrentWidth += this.offsetWidth;
			this.setWidth( this.objTopFrame, intCurrentWidth );
		}
		if( this.processHeight ){
			var intCurrentHeight = this.getHeight( this.objContent );
			if( this.minimumHeight > 0 ){
				if( intCurrentHeight < this.minimumHeight ){
					intCurrentHeight = this.minimumHeight;
				}
			}
			intCurrentHeight += this.offsetHeight;
			this.setHeight( this.objTopFrame, intCurrentHeight );
		}
	} catch(e) {
		alert( "Unable to resize : " + e );
	}
}

//------------ Constructor ------------//
function LqcResizeFrame(){
	//Properties
	this.objTopFrame = null;
	this.objContent = null;
	
	this.processWidth = false;
	this.processHeight = true;
	
	this.minimumWidth = 0;
	this.minimumHeight = 0;
	
	this.offsetWidth = 0;
	this.offsetHeight = 0;
	
	//Methods
	this.getElement = LqcResizeFrame_getElement;
	this.setWidth = LqcResizeFrame_setWidth;
	this.setHeight = LqcResizeFrame_setHeight;
	this.getWidth = LqcResizeFrame_getWidth;
	this.getHeight = LqcResizeFrame_getHeight;
	this.init = LqcResizeFrame_init;
	this.resize = LqcResizeFrame_resize;
}
