var runOnLoad = new Array();
function OnLoad() {
    var func;
    for (var i=0; i < runOnLoad.length; i++) {
        func = runOnLoad[i];
        func();
    }
    return true;
}
function setTimezoneCookie() {
    if (document.cookie.indexOf('timezone=') == -1)
        document.cookie = "timezone=" + (new Date()).getTimezoneOffset() / 60;
}
function NotYet() {
    alert('Not yet implemented.');
    return false;
}

/* Window opener */
function OpenWin(windowURL, windowWidth, windowHeight, windowName, windowFeatures, noPopup) {

	// Add popup flag to querystring
	if (typeof(noPopup) == "undefined") {
		if (windowURL.lastIndexOf("?") >= 0)
			windowURL = windowURL + "&popup=true";
		//else if (windowURL.substr(windowURL.length-1, 1) != "/")
		//	windowURL = windowURL + "/?popup=true";
		else
			windowURL = windowURL + "?popup=true";
	}

	// Default window sizes
	if (typeof(windowWidth) == "undefined" || windowWidth == "default")
		windowWidth = "550";
	if (typeof(windowHeight) == "undefined" || windowHeight == "default")
		windowHeight = "400";

	// Default window name
	if (typeof(windowName) == "undefined" || windowName == "default")
		windowName = "popup";

	// Default window features
	if (typeof(windowFeatures) == "undefined" || windowFeatures == 'default')
		windowFeatures = "top=50,left=50,toolbar=no,location=no,menubar=no,scrollbars=yes,status=no,resizable=yes";

	// Open and focus
	popupWindow = window.open(windowURL, windowName, windowFeatures + ',width=' + windowWidth + ',height=' + windowHeight);
	popupWindow.focus();

	return false;
}

function trim(s) {
	return rtrim(ltrim(s));
}
function ltrim(s) {
	var w = " \n\t\f";
	while (w.indexOf(s.charAt(0)) != -1 && s.length != 0)
		s = s.substring(1);
	return s;
}
function rtrim(s) {
	var w = " \n\t\f";
	while (w.indexOf(s.charAt(s.length-1)) != -1 && s.length != 0)
		s = s.substring(0, s.length-1);
	return s;
}


//runOnLoad.push(setTimezoneCookie);
//OnLoad();

