function num2str(num) {
	return (num < 10) ? "0" + num : num;
}
function Trim(s) {
	if (s == "") {
		return "";
	}
	while (s.charAt(0) == " ") {
		s = s.substring(1, s.length);
	}
	if (s == "") {
		return "";
	}
	while (s.charAt(s.length - 1) == " ") {
		s = s.substring(0, s.length - 1);
	}
	return s;
}
function GetXmlHttpObject() {
	var xmlHttp = null;
	try {
		xmlHttp = new XMLHttpRequest();
	} catch (e) {
		try {
			xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
		}
	}
	return xmlHttp;
}
function centeropen(url, winwidth, winheight) {
 var centerwin = window.open(url, "", "toolbar=0, resize=0, scrollbars=0, status=0");
 centerwin.resizeTo(winwidth, winheight);
 centerwin.moveTo(screen.width / 2 - winwidth / 2, screen.height / 2 - winheight / 2); //center window on user's screen
}
