var winOnLoad=new Array();
window.onload = function() {
win_load();
}
function win_load() {
//alert("Loaded");
for (var i=0; i<winOnLoad.length; i++) {
	//		alert(winOnLoad[i]);
			eval (''+winOnLoad[i]+'()');
		}

}

function encode(str) {
	var result = "";

	for (i = 0; i < str.length; i++) {
		if (str.charAt(i) == " ") result += "+";
		else result += str.charAt(i);
	}

	return escape(result);
}

function decode(str) {
//	var result = "";

 	var result = str.replace(/\+/g, " ");

/*
	for (i = 0; i< str.length; i++) {
		if (str.charAt(i) == "+") result += " ";
		else result += str.charAt(i);
	}
*/
	return unescape(result);
}
function debugOut(string){
	alert(string);
}
function systemError(string){
	alert("error: "+string);
}


function createXMLRequest(){
var request = null; //GXmlHttp.create();
				try {
 					 request = new XMLHttpRequest();
				} catch (trymicrosoft) {
  					try {
    					request = new ActiveXObject("Msxml2.XMLHTTP");
  					} catch (othermicrosoft) {
    					try {
      						request = new ActiveXObject("Microsoft.XMLHTTP");
    					} catch (failed) {
      						request = false;
    					}
  					}
				}
				if(!request) alert("ERROR: Failed to create XML request.");
				return request;
}