
function OpenModal(Page, Width, Height)
{
	if (window.showModalDialog)
	{
		window.showModalDialog(
			Page,
			'noname',
			'dialogWidth:' + Width.toString() + 'px; dialogHeight:' + Height.toString() + 'px'
		);
	}
	else
	{
		window.open(
			Page,
			'noname',
			'height=' + Width.toString() + ', width=' + Height.toString() + ', toolbar=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, modal=yes'
		);
	}
}

function OpenInline(ElementID, Width, Height, e)
{
	var element = _$(ElementID);
	var positionLeft = 0;
	var positionTop = 0;
		
	if (Width != null && Height != null)
	{
		positionLeft = ((GetClientWidth() - Width) / 2);
				
		if (arguments.length == 3)
		{			
			positionTop = (((GetClientHeight() - Height) / 2) + 50);
		}
		else if (arguments.length == 4)
		{
			positionTop = GetMousePositionY(e) - 90;
		}		
		
		element.style.top = positionTop.toString() + 'px';
		element.style.left = positionLeft.toString() + 'px';
	}	
	
	element.style.display = '';
}

function CloseInline(ElementID)
{
	var e = _$(ElementID);

	e.style.display = 'none';
}