// Helper DHTML library
// DynApi extentions
// Code: Andrey Potekhin
// (c) Taitl

// Prerequisites

if (!is)
	alert('Assertion fault in dynapix.js: DynAPI is not included. Please include DynAPI.')

if (!Debug)
	alert('Assertion fault in dynapix.js: Debug object undefined. Please include debug.js.')

// Extentions
function getLayer(divname) 
{
	Debug.assert(divname.indexOf("Div") != -1)
	Debug.assert(eval(divname.substr(0,divname.indexOf("Div"))))	
	return eval(divname.substr(0,divname.indexOf("Div")))
}

// DynLayerX DynLayerResetSize Method
// Resets layer w and h to actual layer dimentions. 
// Useful after changing layer's content, e.g. through layer.write()
Debug.assert(!DynLayer.prototype.resetSize, 'Assertion fault in dynapix.js: DynLayer.prototype.resetSize is already defined.')

function DynLayerResetSize() {
	if (is.ns) {
		this.w = this.css.clip.width
		this.h = this.css.clip.height
	}
	else if (is.ie) {
		this.w = (is.ie4)? this.css.pixelWidth : this.elm.offsetWidth
		this.h = (is.ie4)? this.css.pixelHeight : this.elm.offsetHeight
	}
}
DynLayer.prototype.resetSize = DynLayerResetSize

