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;
	this.fullscreen = false;

	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)
	{
		thisPage.setCookie("logincookie","");
		thisPage.setCookie("id","");
		thisPage.setCookie("siteid","");
		if ((typeof(url) == "undefined") || (url == ""))
			url = "/lms/templates/blank.htm";
			
		open(url,0);
	}
	
	
	function open(url,scrollable)
	{
		var resize = thisPage.isNav ? "0" : "1";
		if (typeof(scrollable) == "undefined")
			scrollable = 0;
			
		var features;
		
		if (this.fullscreen)
			features = "fullscreen=yes";
		else features = "status=1,resizable=" + resize + ",width=" + this.getWidth() + ",height=" + this.getHeight() + 
			",top=" + this.getTop() + ",left=" + this.getLeft()+",scrollbars="+scrollable;
			
		return thisPage.floatWin(url,"Lms", features);
	
	}
	
	

	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>");
	}
}  
