if (typeof(Kayac) == "undefined") {
	var Kayac = {};
}
if (typeof(Kayac.ART_Meter) == "undefined") {
	Kayac.ART_Meter = {};
}
if (typeof(Kayac.ART_Meter.Profile) == "undefined") {
	Kayac.ART_Meter.Profile = {};
}

Kayac.ART_Meter.Profile.Statics = {
	loadPage: function (url, objID) {
		
		// キャッシュ対策
		url = url + "&nocache=" + (new Date().getTime());
		
		var objTarget = $(objID);
		var myAjax = new Ajax.Request(
			url, 
			{
				method: 'get', 
				asynchronous: true,
				onComplete: function(originalRequest) {
					if (objTarget) {
						objTarget.innerHTML = originalRequest.responseText;
					}
				}
			});
	}
};

Event.observe(window, 'load', function(e) {
	
	var ids = [
		{objID : 'profArtlist', url : '/profile/sub_works.php' + window.location.search},                          // 応募作品一覧
		{objID : 'profFav', url : '/profile/sub_favorites.php' + window.location.search},                          // 画家掲示板投稿履歴
		{objID : 'profHystory', url : '/profile/sub_recentviews.php' + window.location.search},                    // フォトギャラリー投稿履歴
		{objID : 'profBBS', url : '/profile/sub_bbs.php' + window.location.search}                                 // 掲示板表示
	];
	
	ids.each(function(targetID) {
		Kayac.ART_Meter.Profile.Statics.loadPage(targetID.url, $(targetID.objID));
	});
	
}, false);
