
function ReloadContent() {
	this.isNoCache = true;
	// 要素ID
	this.contentList = [];
}

ReloadContent.prototype.setProperties = function (props) {
//console.log("ReloadContent.prototype.setProperties")
	for (var key in props) {
		if (typeof this[key] != "undefined") this[key] = props[key];
		else throw new Error("ReloadContent Invalid Property [" + key + "]");
	}
	return this;
};

ReloadContent.prototype.initialize = function () {
	for (var i = 0; i < this.contentList.length; i++) {
		this.contentList[i].obj = document.getElementById(this.contentList[i].id);
	}
};

ReloadContent.prototype.load = function () {
	for (var i = 0; i < this.contentList.length; i++) {
		var url = this.contentList[i].url;
		if (this.isNoCache) {
			var noCache = Math.round((new Date()).getTime() / this.contentList[i].cacheTime);
			url += this.contentList[i].url.indexOf('?') > 0 ? '&' : '?' + noCache;
//alert(noCache + ":" + (new Date()).getTime());
		}
		this.contentList[i].obj.src = url;
	}
};

/*---------------------------------------------------------------------------*/
ReloadContent.prototype.addOnloadListener = function (value) {
	var that = this;
	var listener = function () {
		that.initialize();
		Event.stopObserving(window, 'load', listener, false);
	};
	Event.observe(window, 'load', listener, false);
	return this;
};

