framework.widget.floatingWindow = {
show:function(windowElementId, htmlElementId, windowPosition, windowWidth, windowHeight, hasClose)
{
	if ((!framework.util.isType(windowElementId, framework.DataType.STRING)) ||
		(!framework.util.isType(htmlElementId, framework.DataType.STRING)) ||
		(!framework.util.isType(windowPosition, framework.DataType.STRING)) ||
		(!framework.util.isType(windowWidth, framework.DataType.NUMBER)) ||
		(!framework.util.isType(windowHeight, framework.DataType.NUMBER)) ||
		(!framework.util.isType(hasClose, framework.DataType.BOOLEAN)))
	{
		
		return framework.Status.UNDEFINED_ARGUMENT;
	}
	var floatingWindowElement = document.getElementById(windowElementId);
	if (framework.util.isUndefinedOrNull(floatingWindowElement))
	{
		
		return framework.Status.ELEMENT_DOES_NOT_EXIST;
	}
	var htmlElement = document.getElementById(htmlElementId);
	if (framework.util.isUndefinedOrNull(htmlElement))
	{
		
		return framework.Status.ELEMENT_DOES_NOT_EXIST;
	}
	var windowPos = framework.util.getElementPosition(htmlElementId);
	var windowLeft = windowPos[0];
	var windowTop = windowPos[1];
	if (windowPosition == framework.WidgetConstants.POSITION_BELOW)
	{
		windowTop = windowTop + htmlElement.offsetHeight; 
	}
	else if (windowPosition == framework.WidgetConstants.POSITION_ABOVE)
	{
		if (windowHeight != framework.WidgetConstants.AUTO_HEIGHT)
		{
			windowTop = windowTop - htmlElement.offsetHeight - windowHeight; 
		}
	}
	else if (windowPosition == framework.WidgetConstants.POSITION_LEFT)
	{
		windowLeft = windowLeft - windowWidth; 
	}
	else if (windowPosition == framework.WidgetConstants.POSITION_RIGHT)
	{
		windowLeft = windowLeft + htmlElement.offsetWidth; 
	}
	else if (windowPosition == framework.WidgetConstants.POSITION_BELOWRIGHTJUSTIFIED)
	{
		windowTop = windowTop + htmlElement.offsetHeight;
		windowLeft = windowLeft + htmlElement.offsetWidth - windowWidth;
	}
	floatingWindowElement.style.top = windowTop + "px";
	floatingWindowElement.style.left = windowLeft + "px";
	floatingWindowElement.style.width = windowWidth + "px";
	if (windowHeight != framework.WidgetConstants.AUTO_HEIGHT)
	{
		floatingWindowElement.style.height = windowHeight + "px";
	}
	var windowCloseElementId = windowElementId + "._headerClose" ;
	if (hasClose)
	{
		framework.util.showElement(windowCloseElementId);
		var closeElementId = windowElementId + "._headerClose";
		framework.eventmodel.addElementEvent(closeElementId, framework.EventType.CLICK, framework.widget.floatingWindow._closeEventHandler);
	}
	else
	{
		framework.util.hideElement(windowCloseElementId);
	}
	framework.util.showElement(windowElementId);
	if (windowPosition == framework.WidgetConstants.POSITION_ABOVE)
	{
		if (windowHeight == framework.WidgetConstants.AUTO_HEIGHT)
		{
			windowTop = windowTop - floatingWindowElement.offsetHeight; 
			floatingWindowElement.style.top = windowTop + "px";
		}
	}
	return framework.Status.SUCCESS;
},
showAt:function(windowElementId, windowLeft, windowTop, windowWidth, windowHeight, hasClose)
{
	if ((!framework.util.isType(windowElementId, framework.DataType.STRING)) ||
		(!framework.util.isType(windowLeft, framework.DataType.NUMBER)) ||
		(!framework.util.isType(windowTop, framework.DataType.NUMBER)) ||
		(!framework.util.isType(windowWidth, framework.DataType.NUMBER)) ||
		(!framework.util.isType(windowHeight, framework.DataType.NUMBER)) ||
		(!framework.util.isType(hasClose, framework.DataType.BOOLEAN)))
	{
		
		return framework.Status.UNDEFINED_ARGUMENT;
	}
	var windowElement = document.getElementById(windowElementId);
	if (framework.util.isUndefinedOrNull(windowElement))
	{
		
		return framework.Status.ELEMENT_DOES_NOT_EXIST;
	}
	windowElement.style.top = windowTop + "px";
	windowElement.style.left = windowLeft + "px";
	windowElement.style.width = windowWidth + "px";
	if (windowHeight != framework.WidgetConstants.AUTO_HEIGHT)
	{
		windowElement.style.height = windowHeight + "px";
	}
	var windowCloseElementId = windowElementId + "._headerClose" ;
	if (hasClose)
	{
		framework.util.showElement(windowCloseElementId);
		var closeElementId = windowElementId + "._headerClose";
		framework.eventmodel.addElementEvent(closeElementId, framework.EventType.CLICK, framework.widget.floatingWindow._closeEventHandler);
	}
	else
	{
		framework.util.hideElement(windowCloseElementId);
	}
	framework.util.showElement(windowElementId);
	return framework.Status.SUCCESS;
},
hide:function(windowElementId)
{
	if (!framework.util.isType(windowElementId, framework.DataType.STRING))
	{
		
		return framework.Status.UNDEFINED_ARGUMENT;
	}
	var windowElement = document.getElementById(windowElementId);
	if (framework.util.isUndefinedOrNull(windowElement))
	{
		
		return framework.Status.ELEMENT_DOES_NOT_EXIST;
	}
	framework.util.hideElement(windowElementId);
	framework.util.showSelects(windowElementId);
	return framework.Status.SUCCESS;
},
setHTML:function(windowElementId, titleText, innerHTMLText)
{
	if ((!framework.util.isType(windowElementId, framework.DataType.STRING)) ||
		(!framework.util.isType(titleText, framework.DataType.STRING)) ||
		(!framework.util.isType(innerHTMLText, framework.DataType.STRING)))
	{
		
		return framework.Status.UNDEFINED_ARGUMENT;
	}
	var windowElement = document.getElementById(windowElementId);
	if (framework.util.isUndefinedOrNull(windowElement))
	{
		
		return framework.Status.ELEMENT_DOES_NOT_EXIST;
	}
	var windowHeaderTitleElementId = windowElementId + "._headerTitle";
	document.getElementById(windowHeaderTitleElementId).innerHTML = titleText;
	var windowContentElementId = windowElementId + "._content";
	document.getElementById(windowContentElementId).innerHTML = innerHTMLText;
	return framework.Status.SUCCESS;
},
setHTMLContent:function(windowElementId, innerHTMLText)
{
	if ((!framework.util.isType(windowElementId, framework.DataType.STRING)) ||
		(!framework.util.isType(innerHTMLText, framework.DataType.STRING)))
	{
		
		return framework.Status.UNDEFINED_ARGUMENT;
	}
	var windowElement = document.getElementById(windowElementId);
	if (framework.util.isUndefinedOrNull(windowElement))
	{
		
		return framework.Status.ELEMENT_DOES_NOT_EXIST;
	}
	var windowContentElementId = windowElementId + "._content";
	document.getElementById(windowContentElementId).innerHTML = innerHTMLText;
	return framework.Status.SUCCESS;
},
hideSelects:function(floatingWindowId)
{
	if (!framework.util.isInternetExplorer() || framework.util.isIE7())
	{
		return framework.Status.SUCCESS;
	}
	if (!framework.util.isType(floatingWindowId, framework.DataType.STRING))
	{
		
		return framework.Status.UNDEFINED_ARGUMENT;
	}
	if (framework.util.isEmpty(floatingWindowId))
	{
		
		return framework.Status.INVALID_ARGUMENT_VALUE;
	}
	var rect = new Array();
	var element = document.getElementById(floatingWindowId);
	var elementPosition = framework.util.getElementPosition(floatingWindowId);
	rect[0] = elementPosition[1];
	rect[2] = rect[0] + element.offsetHeight;
	rect[3] = elementPosition[0];
	rect[1] = rect[2] + element.offsetWidth;
	return framework.util.hideSelects(floatingWindowId, rect);
},
_closeEventHandler:function(event)
{
	var windowElementId = this.id.split("._headerClose")[0];
	framework.util.hideElement(windowElementId);
	event.stopPropagation();
	framework.util.showSelects(windowElementId);
},
loaded:true
};
//Version 3.4
