// Initializes a new instance of the StringBuffer class
// and appends the given value if supplied
function StringBuffer(value)
{
	this.strings = new Array("");
	this.append(value);
}

// Appends the given value to the end of this instance.
StringBuffer.prototype.append = function (value)
{
	if (value)
	{
		this.strings.push(value);
	}
}

// Clears the string buffer
StringBuffer.prototype.clear = function ()
{
	this.strings.length = 1;
}

// Converts this instance to a String.
StringBuffer.prototype.toString = function ()
{
	return this.strings.join("");
}
//Return length of object
StringBuffer.prototype.length = function()
{
    return this.strings.length;
}