cfxprivate_preinit('cfx.hotwin = "5.0";');

function cfx_hotwin() {
	// args: url,name,wid,hei,flags
	// scrolling, locbar, menubar, resize, statusbar, full, bare
	var url = cfx_hotwin.arguments[0];
	var name = cfx_hotwin.arguments[1];
	var width = cfx_hotwin.arguments[2];
	var height = cfx_hotwin.arguments[3];
	var setfocus = false;
	var scrolling = "no";
	var locbar = "no";
	var menubar = "no";
	var tlbar = "no";
	var resize = "no";
	var statbar = "no";
	var wincenter = false;
	var screencenter = false;
	var normalize = true;
	if (cfx_hotwin.arguments.length > 4) {
		for (var i = 4; i < cfx_hotwin.arguments.length; i++) {
			var currentarg = cfx_hotwin.arguments[i].toLowerCase();
			if (currentarg == "scrolling") {
				scrolling = "yes";
			} //endif
			if (currentarg == "locbar") {
				locbar = "yes";
			} //endif
			if (currentarg == "menubar") {
				menubar = "yes";
			} //endif
			if (currentarg == "resize") {
				resize = "yes";
			} //endif
			if (currentarg == "statusbar") {
				statbar = "yes";
			} //endif
			if (currentarg == "toolbar") {
				tlbar = "yes";
			} //endif
			if (currentarg == "focus") {
				setfocus = true;
			} //endif
			if (currentarg == "center" || currentarg == "screencenter") {
				screencenter = true;
			} //endif
			if (currentarg == "wincenter") {
				wincenter = true;
			} //endif
			if (currentarg == "full") {
					tlbar = "yes";
					scrolling = "yes";
					locbar = "yes";
					menubar = "yes";
					resize = "yes";
					statbar = "yes";
					i = cfx_hotwin.arguments.length+1;
			} //endif
			if (currentarg == "bare") {
					tlbar = "no";
					scrolling = "no";
					locbar = "no";
					menubar = "no";
					resize = "no";
					statbar = "no";
					i = cfx_hotwin.arguments.length+1;
			} //endif
		} //endfor
	} //endif
	var flags = "width=" + width;
	flags += ",height=" + height;
	flags += ",scrollbars=" + scrolling;
	flags += ",location=" + locbar;
	flags += ",menubar=" + menubar;
	flags += ",resizable=" + resize;
	flags += ",toolbar=" + tlbar;
	flags += ",status=" + statbar;
	newwin = window.open(url,name,flags);
	if (wincenter == true) {
		if (window.screenX) {
			var winx = window.screenX + Math.round((window.outerWidth / 2) - (width / 2));
			var winy = window.screenY + Math.round((window.outerHeight / 2) - (height / 2));
			newwin.moveTo(winx,winy);
			screencenter = false;
			normalize = false;
		} else {
			screencenter = true;
		} //endif
	} //endif
	if (screencenter == true) {
		if (window.moveTo) {
			var winx = Math.round((screen.availWidth / 2) - (width / 2));
			var winy = Math.round((screen.availHeight / 2) - (height / 2));
			newwin.moveTo(winx,winy);
			normalize = false;
		} //endif
	} //endif
	if (normalize == true) {
		if (window.moveTo) {
			newwin.moveTo(30,30);
		} //endif
	} //endif
	if (setfocus) {
		window.setTimeout("newwin.focus();",100);
	} //endif
} //endfunction

