
function GetElementById(Id) {
	if (document.all) {
		return document.all(Id);
	} else if (document.getElementById) {
		return document.getElementById(Id);
	} else if (eval) {
		return eval("document." + Id);
	}
}

function SetStatus(Msg) {
	var nDelay = new Number(-1);
	var nTimeout = new Number(-1);
	if ((arguments.length > 1)&&(arguments[1] != null)&&(isNaN(arguments[1]) == false)) {
		nDelay = (parseInt(arguments[1], 10) <= 0) ? -1 : parseInt(arguments[1], 10);
	}
	if ((arguments.length > 2)&&(arguments[2] != null)&&(isNaN(arguments[2]) == false)) {
		nTimeout = (parseInt(arguments[2], 10) <= 0) ? -1 : parseInt(arguments[2], 10);
	}
	
	
	if (nDelay > 0) {
		window.setTimeout("window.status = \'" + JavascriptEncode(Msg) + "\'", nDelay);
	} else {
		window.status = Msg.toString();
	}
	
	if (nTimeout > 0) {
		window.setTimeout("ClearStatus()", nTimeout);
	}
}

function ClearStatus() {
	window.status = "";
}

function JavascriptEncode(value) {
	var s = new String();
	if (value != null) { s = value.toString(); }
	
	s = s.replace(/\\/gi, "\\\\");
	s = s.replace(/(?!\\)\'/gi, "\\\'");
	s = s.replace(/(?!\\)\"/gi, "\\\"");

	return s.toString();
}
