function xmlhttp_ready(obj) {
	return obj.readyState == 4 || obj.readyState == 0 || !obj.readyState;
}

function param_escape(arg) {
	if (typeof encodeURIComponent != 'undefined')
		return encodeURIComponent(arg);	
	else
		return escape(arg);
}

var notify_hide_timerid = false;
var notify_last_doc = false;

function hide_notify() {
	if (notify_last_doc) {
		var n = notify_last_doc.getElementById("notify");		
		n.style.display = "none";
	}
} 

function notify(msg, no_hide) {
	var n = document.getElementById("notify");
	var nb = document.getElementById("notify_body");
	if (!n || !nb) return;
	if (notify_hide_timerid) {
		window.clearTimeout(notify_hide_timerid);
	}
	notify_last_doc = document;
	notify_opacity = 1;
	if (msg == "") {
		if (n.style.display == "block") {
			notify_hide_timerid = window.setTimeout("hide_notify()", 0);
		}
		return;
	} else {
		n.style.display = "block";
	}
	var wait_timer = "";
	var dlg_style = "";
	if (no_hide) {
		dlg_style = " style='position: relative; top: -4px;'";
	}
	nb.innerHTML = "<span" + dlg_style + ">" + msg + "</span>";
	if (!no_hide) {
		notify_hide_timerid = window.setTimeout("hide_notify()", 3000);
	}
}

