
function openCalendarPop(path, control, beginDate, endDate, visibleDate)
{
	var features = new String();
	var Xpoint = getScreenLeftX();
	var Ypoint = getScreenTopY();
	var availHeight = window.screen.height;
	var availWidth = window.screen.width;
	Xpoint = Xpoint + ((availWidth - 260)/2);
	Ypoint = ((availHeight - 180)/2);
	features += 'channelmode=no,';
	features += 'directories=no,';
	features += 'fullscreen=no,';
	features += 'location=no,';
	features += 'menubar=no,';
	features += 'resizable=no,';
	features += 'scrollbars=no,';
	features += 'status=no,';
	features += 'titlebar=no,';
	features += 'toolbar=no,';
	features += 'top=' + Ypoint + ',';
	features += 'left=' + Xpoint + ',';
	features += 'width=260,';
	features += 'height=180';
	if (visibleDate == '')
	{
		visibleDate = beginDate;
	}
	
	var beginEncoded = encodeURIComponent(beginDate)
	var endEncoded = encodeURIComponent(endDate)
	var visEncoded = encodeURIComponent(visibleDate)
	path += 'PopCalendar.aspx';
	hWnd = window.open(path+'?begin=' + beginEncoded + "&end=" + endEncoded + "&cntrl=" + control + "&visDate=" + visEncoded, "_blank", features);
}

function getScreenLeftX()
{
	var x;
	try
	{
		x = parseInt(window.screenX);
        if (isNaN(x))
        {
			x = parseInt(window.screenLeft);
			if (isNaN(x))
			{
				x = 0;
			}
        }
	}
	catch(e)
	{
	  x = 0;
	}
	return x;
}

function getScreenTopY()
{
	var y;
	try
	{
		y = parseInt(window.screenY);
        if (isNaN(y))
        {
			y = parseInt(window.screenTop);
			if (isNaN(y))
			{
				y = 0;
			}
        }
	}
	catch(e)
	{
	  y = 0;
	}
	return y;
}
