//<script>
function lObj (_loId, _loPh)
{	var _loObj;
	var _loPath;
	if (_loPh && document.layers)
		_loPath = document.layers[_loPh].document;
	else
		_loPath = document;

	if (document.all && (_loObj=document.all[_loId]) || document.layers && (_loObj=_loPath.layers[_loId]) || document.getElementById && (_loObj=document.getElementById(_loId)))
	{	_loObj.l = function (evt){return (parseInt ((_loObj.style)? _loObj.style.left : _loObj.left));};
		_loObj.t = function (evt){return (parseInt ((_loObj.style)? _loObj.style.top : _loObj.top));};
		_loObj.h = function (evt){return (parseInt ((_loObj.style)? _loObj.offsetHeight : _loObj.clip.height));};
		_loObj.w = function (evt){return (parseInt ((_loObj.style)? _loObj.offsetWidth : _loObj.clip.width));};
		_loObj.child = new Array ();
		_loObj.childId = new Array ();
		_loObj.newChild = newChildForMe;
		_loObj.Id;
		_loObj.Name;
		_loObj.L = !_loObj.L? _loObj.l() : _loObj.L;
		_loObj.T = !_loObj.T? _loObj.t() : _loObj.T;
		_loObj.H = !_loObj.H? _loObj.h() : _loObj.H;
		_loObj.W = !_loObj.W? _loObj.w() : _loObj.W;
		_loObj.reDimTo = reDimensionTo;
		_loObj.moveTo = moveMeTo;
		_loObj.moveBy = moveMeBy;
		_loObj.clipTo = clipMeTo;
		_loObj.clipBy = clipMeBy;
		_loObj.reClip = reClipToMe;
		_loObj.show = setMyVisTo;
		_loObj.rewrite = replaceMyHTML;
	}
	return _loObj;
}

function newChildForMe (_ncfmObj, _ncfmName)
{	this.childId[this.childId.length]=_ncfmObj;
	this.child[_ncfmName]=_ncfmObj;
	_ncfmObj.Name = _ncfmName;
	
	_ncfmObj.moveTo (this.l()+_ncfmObj.L, this.t()+_ncfmObj.T);
	
	_ncfmW = (_ncfmObj.W+_ncfmObj.L >= this.w())? _ncfmObj.W+_ncfmObj.L : this.w() ;
	_ncfmH = (_ncfmObj.H+_ncfmObj.T >= this.h())? _ncfmObj.H+_ncfmObj.T : this.h() ;

	this.reDimTo (_ncfmW, _ncfmH);
}

function reDimensionTo (_rdW, _rdH)
{	if (this.clip)
	{	this.clip.width=this.W=_rdW;
		this.clip.height=this.H=_rdH;
	}
	else
	{	this.style.width=(this.W=_rdW)+'px ';
		this.style.height=(this.H=_rdH)+'px ';
	}
}

function moveMeTo (_mmtLeft, _mmtTop, _mmtRL)
{	var _mmtObj = this.style? this.style : this;
	var _mmtByL = _mmtLeft - this.l();
	var _mmtByT = _mmtTop - this.t();
	if (_mmtRL)
	{	this.L=_mmtLeft;
		this.T=_mmtTop;
	}
	if (this.style)
	{	_mmtLeft += 'px ';
		_mmtTop += 'px ';
	}
	_mmtObj.left = _mmtLeft;
	_mmtObj.top = _mmtTop;
	if (this.childId.length!=0)
		for(_mmtI=0; _mmtI<this.childId.length; _mmtI++)
			this.childId[_mmtI].moveBy(_mmtByL, _mmtByT);
}

function moveMeBy (_mmbLeft, _mmbTop, _mmbRL)
{	var _mmbObj = this.style? this.style : this;
	this.moveTo (parseInt (_mmbObj.left)+_mmbLeft, parseInt (_mmbObj.top)+_mmbTop, _mmbRL)
}

function clipMeTo (_cmtLeft, _cmtRight, _cmtTop, _cmtBottom)
{	var _cmtObj = this.style? this.style : this;
	if (document.layers)
	{	_cmtObj.clip.left=_cmtLeft;
		_cmtObj.clip.right=_cmtRight;
		_cmtObj.clip.top=_cmtTop;
		_cmtObj.clip.bottom=_cmtBottom;
	}
	else
		_cmtObj.clip = 'rect(' + _cmtTop + 'px ' + _cmtRight + 'px ' + _cmtBottom  + 'px ' + _cmtLeft + 'px)';
}

function clipMeBy (_cmbLeft, _cmbRight, _cmbTop, _cmbBottom)
{	var _cmbObj = this.style? this.style : this;
	if (document.layers)
	{	_cmbObj.clip.left = parseInt (_cmbObj.clip.left,10) + _cmbLeft;
		_cmbObj.clip.right = parseInt (_cmbObj.clip.right,10) - _cmbRight;
		_cmbObj.clip.top = parseInt (_cmbObj.clip.top,10) + _cmbTop;
		_cmbObj.clip.bottom = parseInt (_cmbObj.clip.bottom,10) - _cmbBottom;
	}
	else
	{	if(!_cmbObj.clip || _cmbObj.clip=='')
			_cmbObj.clip = 'rect(0px ' + parseInt(_cmbObj.width,10)+'px ' + parseInt(_cmbObj.height,10) + 'px 0px)';
		var _cmbC = _cmbObj.clip, _cmbClip = 'rect(';
		_cmbClip += (parseInt (_cmbC.substring (_cmbC.indexOf ('(') + 1, _cmbC.indexOf (' ')), 10) + _cmbTop) + 'px ';
		_cmbC = _cmbC.substring (_cmbC.indexOf (' ') + 1, _cmbC.length);
		_cmbClip += (parseInt (_cmbC.substring (0, _cmbC.indexOf ('px')), 10) - _cmbRight) + 'px ';
		_cmbC = _cmbC.substring ( _cmbC.indexOf (' ') + 1, _cmbC.length);
		_cmbClip += (parseInt (_cmbC.substring (0, _cmbC.indexOf ('px')), 10) - _cmbBottom) + 'px ';
		_cmbC = _cmbC.substring (_cmbC.indexOf (' ') + 1, _cmbC.length);
		_cmbClip += (parseInt (_cmbC.substring (0, _cmbC.indexOf ('px')), 10) + _cmbLeft) + 'px';
		_cmbClip += ')';
		_cmbObj.clip = _cmbClip;
	}
	this.moveBy(0,-1);
}

function reClipToMe ()
{	if (document.layers)
	{	this.clipTo(this.clip.left, this.clip.right, this.clip.top, this.clip.bottom);
		if (this.childId.length!=0)
			for(_mmtI=0; _mmtI<this.childId.length; _mmtI++)
				this.childId[_mmtI].reClip();
	}
}

function setMyVisTo (_smvt)
{	var _smvtObj = this.style? this.style : this;
	if (_smvt)
		_smvtObj.visibility = (document.layers)? "show" : "visible";
	else
		_smvtObj.visibility = (document.layers)? "hide" : "hidden";
	if (this.childId.length!=0)
		for(_mmtI=0; _mmtI<this.childId.length; _mmtI++)
		{	_smvtObj = this.childId[_mmtI].style? this.childId[_mmtI].style : this.childId[_mmtI];
			if (_smvt)
				_smvtObj.visibility = (document.layers)? "show" : "visible";
			else
				_smvtObj.visibility = (document.layers)? "hide" : "hidden";
		}
}

function replaceMyHTML (_rmHTMLString)
{	_rmHTMLString = unescape (_rmHTMLString);
	if (document.layers)
	{	this.document.open();
		this.document.write(_rmHTMLString);
		this.document.close();
	}
	else
		this.innerHTML = _rmHTMLString;
}

function visible(objeto) {
	if (objeto.style) {
		if (objeto.style.visibility=='hidden'){
			return false;
		}
		else if (objeto.style.visibility=='visible'){
			return true;
		}
	}
	else {
		if (objeto.visibility=='hide'){
			return false;
		}
		else if (objeto.visibility=='show'){
			return true;
		}
	}
}
