function newWindow( menubar, toolbar, width, height, url, title, bCentered, x, y, resizable, scrollbars )
{
	newWindow2=null;
	var Options = '';

	var strX = x.toString();
	var strY = y.toString();

	if ( bCentered )
	{
		strY = (screen.availHeight/2 - height/2 ).toString();
		strX = (screen.availWidth/2 - width/2 ).toString();
	}

	Options += "menubar=" + menubar + ",toolbar=" + toolbar + ",width=" + width + ",height=" + height + ",left=" + strX;
	Options += ",top=" + strY + ",screenX=" + strX + ",screenY=" + strY +",resizable=" + resizable + ",scrollbars=" + scrollbars;

	newWindow2 = window.open( url, title, Options );

	newWindow2.focus();
	return newWindow2;
};

function GetRadWindow() {
    var oWindow = null;
    if (window.radWindow) oWindow = window.radWindow;
    else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;
    return oWindow;
}

function Close() {
    GetRadWindow().close();
}

function Trim(s) {
    return s.replace(/^\s+|\s+$/g, "");
}
function LTrim(s) {
    return s.replace(/^\s+/, "");
}
function RTrim(s) {
    return s.replace(/\s+$/, "");
}

onDateClick = function (d) {
    if (d) {
        try {
            var now = new Date();
            var fromDate = new Date();
            switch (d) {
                case "today":
                    SetSelectedDates(now, now);
                    break;
                case "month":
                    fromDate.setDate(1);
                    SetSelectedDates(fromDate, now);
                    break;
                case "year":
                    fromDate.setDate(1);
                    fromDate.setMonth(0);
                    SetSelectedDates(fromDate, now);
                    break;
                case "all":
                    fromDate.setDate(1);
                    fromDate.setMonth(0);
                    fromDate.setYear(2010);
                    SetSelectedDates(null, null);
                    break;
                default:
            }
        } catch (e) { }
    }
    return false;
}
