String.prototype.trim = function(){return this.replace(/^\s+|\s+$/g,"");}
String.prototype.ltrim = function(){return this.replace(/^\s+/,"");}
String.prototype.rtrim = function(){return this.replace(/\s+$/,"");}

String.prototype.lpad = function (n,c) {var i; var a = this.split(''); len=this.length; for (i = 0; i < n - len; i++) {a.unshift (c)}; return a.join('')}
String.prototype.rpad = function (n,c) {var i; var a = this.split(''); len=this.length; for (i = 0; i < n - len; i++) {a.push (c)}; return a.join('')}
Date.prototype.DateFormat=function(){ var str='';
   str=String(this.getDate()).lpad(2,'0')+'.'+String(this.getMonth()+1).lpad(2,'0')+'.'+String(this.getFullYear()).lpad(4,'0');
   return(str);
};

function String2XML(text)
{ if (window.ActiveXObject)
  { var doc=new ActiveXObject('Microsoft.XMLDOM');
    doc.async='false';
    doc.loadXML(text);
  } 
  else 
  { var parser=new DOMParser();
    var doc=parser.parseFromString(text,'text/xml');
  }
  return doc;
}
 
	    
