// $Id: ad_shop.js,v 1.4 2007/02/26 07:13:09 suwahara Exp $

Hyjax.Component.AdShop = Class.create();
Hyjax.Component.AdShop.prototype = {
	initialize: function(url) {
		Hyjax.EventHandler.register(this);
		this.url = url;
	},
	eLoad: function(node) {
		new Ajax.Request(this.url, {method: 'post', onComplete: this.advertiseDataDisplay});
	},
	advertiseDataDisplay: function(responseHttpObj) {
		var str = responseHttpObj.responseText;
		str.substring(0,str.indexOf("___ThisIsSeparator1___"));
		$("ad_shop_right_slot").innerHTML = str.substring(0,str.indexOf("___ThisIsSeparator1___"));
		$("ad_shop_bottom_slot").innerHTML = str.substring(str.indexOf("___ThisIsSeparator1___")+23,str.indexOf("___ThisIsSeparator2___"));

		var displayCountUrl = str.substring(str.indexOf("___ThisIsSeparator2___")+23,str.length);
		new Ajax.Request(displayCountUrl, {method: 'get'});
	}
}
