	
	function clear_status() {
		string = '';
		i = 0;
		write_status_('');
	}

	function write_status(text) {
		string = '';
		i = 0;
		write_status_(text);
	}

	function write_status_(text) {
		string = string + text.substring(i,i+1); 
		status = string;
		string_ = text;
		i++;
		if (i<=text.length) timer = setTimeout("write_status_(string_)",1);
		return true;
	}

	function resize_window(width,height) {
		if (width > screen.availWidth) width = screen.availWidth;
		if (height > screen.availHeight) height = screen.availHeight;
		self.moveTo((screen.availWidth-width)/2,(screen.availHeight-height)/2);
		self.resizeTo(width,height);
		focus();
	}

	function window_max_height() {
		self.resizeTo(600,screen.availHeight-20);
		self.moveTo((screen.availWidth-600)/2,0);
		focus();
	}

	function show_properties(obj) {
		var e = "";
		for (var i in obj)
			if (obj[i] != null) e += i + " = " + obj[i] + "\t";
		alert(e);
	}


	// megnyit egy popup ablakot a paraméter tulajdonságainak megfelelően
	// a paraméter tulajdonságai lehetnek:
	// url = string
	// name = string
	// width = n | max, height = n | max
	// hpos = n | left | center | right , vpos = n | top | center | bottom
	// location = yes | no
	// menubar = yes | no
	// resizable = yes | no
	// scrollbars = yes | no
	// status = yes | no
	// toolbar = yes | no
	// 2004.08.23.
	function popup(params) {

		if (!params) {
			return false;
		}

		// default értékek
		if (!params.url) params.url = '';
		if (!params.name) {
			var random_num = 1 + Math.floor(Math.random()*1000000);
			params.name = 'win_'+random_num;
		}
		if (!params.width) params.width = 600;
		if (!params.height) params.height = 460;
		if (!params.hpos) params.hpos = "center";
		if (!params.vpos) params.vpos = "center";
		if (!params.location) params.location = "no";
		if (!params.menubar) params.menubar = "no";
		if (!params.resizable) params.resizable = "no";
		if (!params.scrollbars) params.scrollbars = "yes";
		if (!params.status) params.status = "no";
		if (!params.toolbar) params.toolbar = "no";

		if (params.hpos == "left") params.hpos = 0;
		if (params.vpos == "top") params.vpos = 0;
		if (screen.availWidth) {
			if (screen.availWidth < params.width) params.width = screen.availWidth;
			if (screen.availHeight < params.height) params.height = screen.availHeight;
			if (params.width == "max") params.width = screen.availWidth;
			if (params.height == "max") params.height = screen.availHeight - 40;
			if (params.hpos == "right") params.hpos = screen.availWidth - params.width;
			if (params.vpos == "bottom") params.vpos = screen.availHeight - params.height;
			if (params.hpos == "center") params.hpos = (screen.availWidth - params.width) / 2;
			if (params.vpos == "center") params.vpos = (screen.availHeight - params.height) / 2;
		}
		else {
			if (params.width == "max") params.width = 600;
			if (params.height == "max") params.height = 460;
			if (params.hpos == "right") params.hpos = 10;
			if (params.vpos == "bottom") params.vpos = 10;
			if (params.hpos == "center") params.hpos = 10;
			if (params.vpos == "center") params.vpos = 10;
		}

		popupwin = window.open(params.url,params.name,'location='+params.location+',menubar='+params.menubar+',resizable='+params.resizable+',scrollbars='+params.scrollbars+',status='+params.status+',toolbar='+params.toolbar+',width='+params.width+',height='+params.height+',left='+params.hpos+',top='+params.vpos);
		return popupwin;

	}

