function LmsPopup()
{
	this.getWidth = getWidth;
	this.getHeight = getHeight;
	this.getTop = getTop;
	this.getLeft = getLeft;
	this.open = open;
	this.openDemo = openDemo;
	this.getCacheElem = getCacheElem;
	this.writeCacheElem = writeCacheElem;
	this.extraHeight = 0;

	function getLeft()
	{
		var left = (ThisPage.getScreenWidth() - this.getWidth()) / 2;
		if (left < 0)
			left = 0;

		return left;
	}

	function getTop()
	{
		var top = (ThisPage.getScreenHeight() - this.getHeight()) / 2;
		if (top < 0)
			top = 0;

		return top;
	}
	
	function getWidth()
	{
		var width = 800;
		if (ThisPage.crsMode == "mlie")
			width = ThisPage.getClientOnlyData("LmsPopupWidth",width,this.getCacheElem());
		width = (ThisPage.getScreenWidth() < width) ? ThisPage.getScreenWidth() : width;

		return width;		
	}

	function getHeight()
	{
		var height = 600 + this.extraHeight;
		if (ThisPage.crsMode == "mlie")
			height = ThisPage.getClientOnlyData("LmsPopupHeight",height,this.getCacheElem());
		height = (ThisPage.getScreenHeight() < height) ? ThisPage.getScreenHeight() : height;

		return height;
	}

	function getCacheElem()
	{
		if (ThisPage.crsMode == "mlie")
			return document.getElementById("MlClientDataCacheElem");
	}

	function open(url)
	{
		if (typeof(url) == "undefined")
			url = "";
			
		var resize = ThisPage.isNav ? "0" : "1";

		return ThisPage.floatWin(url,"Lms","scrollbars=1,status=1,resizable=" + resize + ",width=" + this.getWidth() + ",height=" + this.getHeight() + 
			",top=" + this.getTop() + ",left=" + this.getLeft());
	}

	function openDemo(userid,password)
	{
		this.open("http://courses.mindleaders.com/dpec/login.asp?userid=" + userid + "&password=" + password);
	}

	function writeCacheElem()
	{
		if (ThisPage.crsMode == "mlie")
			document.write("<span id=MlClientDataCacheElem style=\"display:none; behavior:url('#default#userData')\"></span>");
	}
}  

