Object.extend(String.prototype, {
	///////////////////////////////////////////////////////////////////
	// "X".clone(5) => "XXXXX"
	clone: function(count) {
		var rst = '';
		for	(var cnt = 0; cnt < count; cnt++) rst += this;
		return rst;
	},
	///////////////////////////////////////////////////////////////////
	// "123".zeroFormat(5) => "00123"
	zeroFormat: function(column) {
		var tmp = '0'.clone(column) + this;
		return tmp.substr(tmp.length - column, column);
	},
	///////////////////////////////////////////////////////////////////
	// "12345".left(2) => "12"
	left: function(column) {
		return this.substr(0, column);
	},
	///////////////////////////////////////////////////////////////////
	// "12345".right(2) => "45"
	right: function(column) {
		return this.substr(this.length - column > 0 ? this.length - column : 0, column);
	}
});

var AttachInnerHTML = Class.create();
AttachInnerHTML.prototype = {
	initialize: function() {
		this.id = null;
		this.html = '';
	},

	attachInnerHTML: function(id, html) {
		this.id = id;
		this.html = html;
		this.attachInnerHTML_callback();
	},

	attachInnerHTML_callback: function() {
		var element = document.getElementById(this.id);
		if	(element != null) {
			element.innerHTML = this.html;
		}
		else {
			window.setTimeout(this.attachInnerHTML_callback.bind(this), 100);
		}
	}
}

