function getViewportHeight() {
	if (window.innerHeight!=window.undefined) return window.innerHeight;
	if (document.compatMode=='CSS1Compat') return document.documentElement.clientHeight;
	if (document.body) return document.body.clientHeight;
	return window.undefined;
}
function getViewportWidth() {
	var offset = 17;
	var width = null;
	if (window.innerWidth!=window.undefined) return window.innerWidth;
	if (document.compatMode=='CSS1Compat') return document.documentElement.clientWidth;
	if (document.body) return document.body.clientWidth;
}
function openDialog(url, width, height, parms, returnFunc, args) {

	// Generate a popup window.
	// Parameters:
	//    url -- URL of the page/frameset to be loaded into dialog
	//    width -- pixel width of the dialog window
	//    height -- pixel height of the dialog window
	//    returnFunc -- reference to the function (on this page)
	//                  that is to act on the data returned from the dialog
	//    args -- [optional] any data you need to pass to the dialog

	if (returnFunc==null ) { returnFunc = "";}
	if (args==null ) { args = "";}

	var dialogWin = new Object()
	var Nav4 = ((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) == 4))

	dialogWin.returnFunc = returnFunc
	dialogWin.returnedValue = ""
	dialogWin.args = args
	dialogWin.url = url
	dialogWin.width = width
	dialogWin.height = height
	// Keep name unique so Navigator doesn't overwrite an existing dialog.
	dialogWin.name = (new Date()).getSeconds().toString()
	// Assemble window attributes and try to center the dialog.

	if (parms==null || parms=="") {	parms = "resizable=no";}

	if (Nav4) {
		// Center on the main window.
		dialogWin.left = window.screenX + ((window.outerWidth - dialogWin.width) / 2)
		dialogWin.top = window.screenY + ((window.outerHeight - dialogWin.height) / 2)
		var attr = "screenX=" + dialogWin.left + ",screenY=" + dialogWin.top + "," + parms + ",width=" + dialogWin.width + ",height=" + dialogWin.height
	} else {
		// The best we can do is center in screen.
		dialogWin.left = (screen.width - dialogWin.width) / 2
		dialogWin.top = (screen.height - dialogWin.height) / 2
		var attr = "left=" + dialogWin.left + ",top=" + dialogWin.top + "," + parms + ",width=" + dialogWin.width + ",height=" + dialogWin.height
	}
	// Generate the dialog and make sure it has focus.
	dialogWin.win=window.open(dialogWin.url, dialogWin.name, attr)
	dialogWin.win.focus()
}
function GetRandom() {
    var axel = Math.random() + "";
    var num = axel * 1000000000000000000;
    return num;
}
