//*******************************************************************
// AJMS Layout Manager JavaScript Class Def. & Variable Declaration.
//			// (c) 2000-2004 Kappa Solutions Ltd.
//*******************************************************************
//
// Constructor. *****************************************************
function LayoutMgr() {
	// The Layout Manager contains utility functions to resize and 
	// hide/show page elements.
	this._topMargin = 0;
	this._sideMargin = 0;
	
	this._minPageHeight = 600;
	this._minPageWidth = 750;
}
// Get Page Height. *************************************************
LayoutMgr.prototype._getPageHeight = function () {
	// This function returns the height of the page. In IE this is 
	// "clientHeight", in NN "innerHeight".
	try {
		var height = document.body.clientHeight;
	} catch (e) {
		try {
			var height = document.innerHeight;
		} catch (e) {
			var height = this._minPageHeight;
		}
	}
	//if (height <  this._minPageHeight) height = this._minPageHeight;
	return height;
}
// Get Page Width. *************************************************
LayoutMgr.prototype._getPageWidth = function () {
	// This function returns the width of the page. In IE this is 
	// "clientWidth", in NN "innerWidth".
	try {
		var width = document.body.clientWidth;
	} catch (e) {
		try {
			var width = document.innerWidth;
		} catch (e) {
			var width = this._minPageWidth;
		}
	}
	//if (width <  this._minPageWidth) width = this._minPageWidth;
	return width;
}

// Resize. **********************************************************
LayoutMgr.prototype.resize = function () {
	// Place the main panel in the centre of the page.
	var elem = document.getElementById("Main");
	if (elem) {
		var top = 0.5*(this._getPageHeight()-this._minPageHeight);
		if (top < 10) top = 10;
		
		var left = 0.5*(this._getPageWidth()-this._minPageWidth);
		if (left < 10) left = 10;

		try {
			elem.style.top  = top + "px";
			elem.style.left = left + "px";
		} catch (e) {};
	
		elem.style.visibility = "visible";	
	}
}

// Mouse Over. ****************************************************
LayoutMgr.prototype.mOver = function (id) {
	try {
		var m = document.getElementById(id);
		m.src = "resources/arrowovr.gif";
	} catch (e) {};
}
// Mouse Out. ****************************************************
LayoutMgr.prototype.mOut = function (id) {
	try {
		var m = document.getElementById(id);
		m.src = "resources/arrowout.gif";

	} catch (e) {};
}
if (!lm) var lm = new LayoutMgr();

//*******************************************************************
