var oW=window;
var oD=oW.document;
/*Object.prototype.inherit=function(oBaseClass){
	this.prototype=new oBaseClass();
	this.prototype.constructor=oBaseClass;
	this.superClass=oBaseClass;
};*/
String.prototype.endsWith=function(sSF){
	return(this.substr(this.length-sSF.length)==sSF);
};
String.prototype.startsWith=function(sPF){
	return(this.substr(0,sPF.length)==sPF);
};
String.prototype.lTrim=String.prototype.trimLeft=function(){
	return(this.replace(/^\s+/,""));
};
String.prototype.rTrim=String.prototype.trimRight=function(){
	return(this.replace(/\s+$/,""));
};
String.prototype.trim=function(){
	return(this.trimRight().trimLeft());
};
String.prototype.isEmpty=function(){
	return(this.trim().length==0);
};
String.prototype.formatVersion=function(){
	var sV=new KX.Sys.StringBuilder();
	var bD=false;
	var n=this.length;
	var k=n;
	while(n){
		var i=k-n--;
		if(this.charAt(i)!="."||!bD){
			sV.append(this.charAt(i));
			if(this.charAt(i)=="."&&!bD){
				bD=true;
			};
		};
	};
	return(sV.toString());
};
Array.prototype.clear=function(){
	if(this.length>0){
		this.splice(0,this.length);
	};
};
Array.prototype.contains=Array.prototype.exists=function(oI){
	return(this.indexOf(oI)>=0);
};
if(!Array.prototype.indexOf){
	Array.prototype.indexOf=function(oI,iSX){
		var iL=this.length;
		if(iL!==0){
			iSX=iSX-0;
			if(isNaN(iSX)){
				iSX=0;
			}
			else{
				if(isFinite(iSX)){
					iSX=iSX-(iSX%1);
        };
        if(iSX<0){
					iSX=Math.max(0,iL+iSX);
				};
			};
			for(var i=iSX;i<iL;i++){
				if(this[i]===oI){
					return(i);
				};
			};
		};
		return(-1);
	};
};
function $(sE){
	return(oD.getElementById(sE));
};
if(typeof(KX)=="undefined"){
	KX={};
};
KX={
	namespace:function(sNS){
		if(!sNS||!sNS.length){
			return(null);
		};
		var oNSP=sNS.split(".");
		var oNS=KX;
		var n=oNSP.length;
		var k=n;
		while(n>(oNSP=="KX")?1:0){
			var i=k-n--;
			this.namespaceExist(oNSP[i]);
			oNS[oNSP[i]]=oNS[oNSP[i]]||{};
			oNS=oNS[oNSP[i]];
		};
		return(oNS);
	},
	namespaceExist:function(sNS){
		if(!sNS||!sNS.length){
			return(false);
		};
		var oNSP=sNS.split(".");
		var oNS=KX;
		var n=oNSP.length;
		var k=n;
		while(n>(oNSP=="KX")?1:0){
			var i=k-n--;
			if(typeof(oNS[oNSP[i]])!="undefined"){
				return(true);
			};
		};
		return(false);
	}
};
KX.namespace("Sys");
KX.namespace("Util");
KX.Sys.StringBuilder=function(sT){
	var oP=[];  
	if((typeof(sT)=="string")&&(sT.length!=0)){
		oP.push(sT);
	};
	this.append=function(sT){
		if((sT==null)||(typeof(sT)=="undefined")){
			return;
		};
		if((typeof(sT)=="string")&&(sT.length==0)){
			return;
		};  
		oP.push(sT);
	};
	this.appendLine=function(sT){
		this.append(sT);
		oP.push('\r\n');
	};
	this.clear=function(){
		oP.clear();
	};
	this.isEmpty=function(){
		return(oP.length==0);
	};
	this.toString=function(sD){
		return(oP.join(sD||""));
	};
};
