function GetXHO() {
	var xmlHttp;

	/*@cc_on @*/
	/*@if (@_jscript_version >= 5)
	try {
		xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
	} catch (e) {
		try {
    		xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
		} catch (e2) {
			xmlHttp = false;
		}
	}
	@end @*/

	if (!xmlHttp && typeof XMLHttpRequest != 'undefined') {
		xmlHttp = new XMLHttpRequest();
	}
	return xmlHttp;
}

function $(el) {
  return document.getElementById(el);
}

function getX(e) {
  var x = 0;
  while(e) {
    x += e.offsetLeft;
    e = e.offsetParent;
  }
  return x;
}
String.prototype.trim = function() {
    val = this;
    if(val)
    {
        return val.replace(/(^\s*)|(\s*$)/g, "");
    }
    else
    {
        return "";
    }
};
String.prototype.contains = function(text) {
    return this.indexOf(text) > -1;
};
String.prototype.startsWith = function(text, caseinsensitive) {
    if (caseinsensitive) return this.toLowerCase().indexOf(text.toLowerCase()) == 0;
    return this.indexOf(text) == 0;
};
Array.prototype.contains = function(text, caseinsensitive) {
    for (var x=0;x<this.length;x++) {
        if (caseinsensitive) {
            if (this[x].toLowerCase() == text.toLowerCase()) return true;
        } else if (this[x] == text) return true;
    }
    return false;
}
