// Dynamic Layer Object Common Extensions
// DynLayer write(), load(), setbg(), img() addon methods
// 19990531

// Copyright (C) 1999 Dan Steinman
// Distributed under the terms of the GNU Library General Public License
// Available at http://www.dansteinman.com/dynapi/

// updated 20011228 by Bob Clary <bc@bclary.com>
// to support Gecko

function DynLayerLoad(url,fn) {
	this.loadFinish = DynLayerLoadFinish
	if (is.ns4) this.css.load(url,this.w);
	else if (is.ie || is.ns5) parent.bufferFrame.document.location = url;
	this.evalfn = fn
}
function DynLayerLoadFinish() {
	if (is.ie||is.ns5) this.event.innerHTML = parent.bufferFrame.document.body.innerHTML;
	eval(this.evalfn)
}
DynLayer.prototype.load = DynLayerLoad

function DynLayerSetbg(color) {
	if (is.ns4) this.doc.bgColor = color
	else this.css.backgroundColor = color
}
DynLayer.prototype.setbg = DynLayerSetbg

function DynLayerImg(imgName,imgObj) {
	this.doc.images[imgName].src = eval(imgObj+'.src')
}
DynLayer.prototype.img = DynLayerImg

function DynLayerGetRelativeX() {
	return (is.ns4)? this.css.pageX : this.elm.offsetLeft
}
function DynLayerGetRelativeY() {
	return (is.ns4)? this.css.pageY : this.elm.offsetTop
}
DynLayer.prototype.getRelativeX = DynLayerGetRelativeX
DynLayer.prototype.getRelativeY = DynLayerGetRelativeY

function DynLayerGetContentWidth() {
	return (is.ns4)? this.doc.width : this.elm.offsetWidth
}
function DynLayerGetContentHeight() {
	return (is.ns4)? this.doc.height : this.elm.offsetHeight
}
DynLayer.prototype.getContentWidth = DynLayerGetContentWidth
DynLayer.prototype.getContentHeight = DynLayerGetContentHeight

