var isIE = (window.navigator.userAgent.indexOf("MSIE") > 0);

if (! isIE) 
{
	HTMLElement.prototype.__defineGetter__("innerText", function () { return(this.textContent); });
	HTMLElement.prototype.__defineSetter__("innerText", function (txt) { this.textContent = txt; });
}	

//Trim
String.prototype.trim = function() {return (this.replace(/^[\s\xA0]+/, "").replace(/[\s\xA0]+$/, ""));}

//Format
String.prototype.format = function()
{
    var str = this;

    for(var i=0;i<arguments.length;i++)
    {
        var re = new RegExp('\\{' + (i) + '\\}','gm');
        str = str.replace(re, arguments[i]);
    }
    return str;
}

String.format = function()
{
    if( arguments.length == 0 )
        return null;

    var str = arguments[0];

    for(var i=1;i<arguments.length;i++)
    {

        var re = new RegExp('\\{' + (i-1) + '\\}','gm');

        str = str.replace(re, arguments[i]);
    }
    return str;
}