String.prototype.replaceAll=function(sOld,sNew){return this.replace(eval('/'+sOld+'/g'),sNew);};
String.prototype.stringUTF8=function(sOld){return this.replaceAll(' ','%20').replaceAll('\\+','%2B').replaceAll('\&','%26');};
//String.prototype.ltrim=function(){return this.replace(/^\s*(.*?)/,'$1');};
String.prototype.ltrim=function(){return this.replace(/^\s*/,'');};
//String.prototype.rtrim=function(){return this.replace(/(.*?)\s*$/,'$1')};
String.prototype.rtrim=function(){return this.replace(/\s*$/,'')};
//String.prototype.trim=function(){return this.replace(/^\s*(.*?)\s*$/,'$1');};
String.prototype.trim=function(){return this.replace(/^\s*|\s*$/g,'');};
function replaceAll(sText,sOld,sNew)
{
	return sText.replace(eval('/'+sOld+'/g'),sNew);
}
function stringUTF8(sText)
{
	sText=replaceAll(sText,' ','%20');
	sText=replaceAll(sText,'\\+','%2B');
	sText=replaceAll(sText,'\&','%26');
	return sText;
}
function ltrim(sText)
{
	return sText.replace(/^\s*/gi,'');
}
function rtrim(sText)
{
	return sText.replace(/\s*$/gi,'');
}
function trim(sText)
{
	return sText.replace(/^\s*|\s*$/gi,'');
}
function returnTextTo(sText,nChar,sChar)
{
	return sText.substring(nChar,sText.toUpperCase().indexOf(sChar,nChar));
}
function returnTextToExp(sText,nChar,sChar)
{
	return sText.substr(nChar,sText.search(/$/)).substring(0,sText.substr(nChar,sText.search(/$/)).search(sChar));
}
function HTMLContent(sId)
{
	var oSpan=document.createElement('SPAN');
	oSpan.appendChild(d(sId).cloneNode(true));
	return oSpan.innerHTML;
}
function TextContent(sId)
{
	var oSpan=document.createElement('SPAN');
	oSpan.appendChild(d(sId).cloneNode(true));
	//return oSpan.innerHTML.replace(/<(.*?)>/g,'');
	var oSelection=oSpan.getElementsByTagName('*');
	var sText='';
	for(x=0;x<oSelection.length;x++)
	{
		if(oSelection[x].getElementsByTagName('*').length==0&&oSelection[x].innerHTML.length>0)
		{
			sText+=trim(oSelection[x].innerHTML)+';';
		}
	}
	return sText;
}