
var PickupKikaku = function(
		elm, url, vmPath, entityClass, numOfItems,
		rootProductCd, searchCondition, optData){
	if(window == this || !this.init){
		return new PickupKikaku(
			elm, url, vmPath, entityClass, numOfItems,
			rootProductCd, searchCondition, optData);
	}
	return this.init(
		elm, url, vmPath, entityClass, numOfItems,
		rootProductCd, searchCondition, optData);
};

PickupKikaku.prototype.init = function(
		elm, url, vmPath, entityClass, numOfItems,
		rootProductCd, searchCondition, optData){
	this.elm = elm;
	this.url = url;
	this.vmPath = vmPath;
	this.entityClass = entityClass;
	this.numOfItems = numOfItems;
	this.rootProductCd = rootProductCd;
	this.searchCondition = searchCondition;
	this.optData = optData;
};

PickupKikaku.prototype.load = function(){
	var elm = this.elm;
	$.ajax({
		url: this.url,
		type: "post",
		cache: false,
		data: {
			"vmPath": this.vmPath,
			"entityClass" : this.entityClass,
			"numOfItems" : this.numOfItems,
			"rootProductCd" : this.rootProductCd,
			"searchCondition" : this.searchCondition,
			"optData" : this.optData
		},
		success: function(html){
			$('#' + elm).empty().append(html);
			//EventHandler.unbind('#' + elm);
			EventHandler.bind('#' + elm);
		}
	});
};

var PickupKokishinByGakumonCd = function(
		elm, url, vmPath, numOfItems, gakumonCd){
	if(window == this || !this.init){
		return new PickupKokishinByGakumonCd(
			elm, url, vmPath, numOfItems, gakumonCd);
	}
	return this.init(
		elm, url, vmPath, numOfItems, gakumonCd);
};

PickupKokishinByGakumonCd.prototype.init = function(
		elm, url, vmPath, numOfItems, gakumonCd){
	this.url = url;
	this.elm = elm;
	this.vmPath = vmPath;
	this.numOfItems = numOfItems;
	this.gakumonCd = gakumonCd;
};

PickupKokishinByGakumonCd.prototype.load = function(){
	var elm = this.elm;
	$.ajax({
		url: this.url,
		type: "post",
		cache: false,
		data: {
			"vmPath": this.vmPath,
			"numOfItems" : this.numOfItems,
			"gakumonCd" : this.gakumonCd
		},
		success: function(html){
			$('#' + elm).empty().append(html);
			//EventHandler.unbind('#' + elm);
			EventHandler.bind('#' + elm);
		}
	});
};

var PickupShinzosetsu = function(
		elm, url, vmPath, numOfItems, 
		gakubuKeitoCd, keitoCd, koshuCategoryLCd, shinzosetsuShubetsuCd){
	if(window == this || !this.init){
		return new PickupShinzosetsu(
			elm, url, vmPath, numOfItems, 
			gakubuKeitoCd, keitoCd, koshuCategoryLCd, shinzosetsuShubetsuCd);
	}
	return this.init(
		elm, url, vmPath, numOfItems, 
		gakubuKeitoCd, keitoCd, koshuCategoryLCd, shinzosetsuShubetsuCd);
};

PickupShinzosetsu.prototype.init = function(
		elm, url, vmPath, numOfItems, 
		gakubuKeitoCd, keitoCd, koshuCategoryLCd, shinzosetsuShubetsuCd){
	this.url = url;
	this.elm = elm;
	this.vmPath = vmPath;
	this.numOfItems = numOfItems;
	this.gakubuKeitoCd = gakubuKeitoCd;
	this.keitoCd = keitoCd;
	this.koshuCategoryLCd = koshuCategoryLCd;
	this.shinzosetsuShubetsuCd = shinzosetsuShubetsuCd;
};

PickupShinzosetsu.prototype.load = function(){
	var elm = this.elm;
	$.ajax({
		url: this.url,
		type: "post",
		cache: false,
		data: {
			"vmPath": this.vmPath,
			"numOfItems" : this.numOfItems,
			"gakubuKeitoCd" : this.gakubuKeitoCd,
			"keitoCd" : this.keitoCd,
			"koshuCategoryLCd" : this.koshuCategoryLCd,
			"shinzosetsuShubetsuCd" : this.shinzosetsuShubetsuCd
		},
		success: function(html){
			$('#' + elm).empty().append(html);
			//EventHandler.unbind('#' + elm);
			EventHandler.bind('#' + elm);
		}
	});
};

var PickupKikakuWithAction = function(
		elm, url, vmPath, entityClass, numOfItems,
		rootProductCd, searchCondition, optData, action){
	if(window == this || !this.init){
		return new PickupKikakuWithAction(
			elm, url, vmPath, entityClass, numOfItems,
			rootProductCd, searchCondition, optData, action);
	}
	return this.init(
		elm, url, vmPath, entityClass, numOfItems,
		rootProductCd, searchCondition, optData, action);
};

PickupKikakuWithAction.prototype.init = function(
		elm, url, vmPath, entityClass, numOfItems,
		rootProductCd, searchCondition, optData, action){
	this.elm = elm;
	this.url = url;
	this.vmPath = vmPath;
	this.entityClass = entityClass;
	this.numOfItems = numOfItems;
	this.rootProductCd = rootProductCd;
	this.searchCondition = searchCondition;
	this.optData = optData;
	this.action = action;
};

PickupKikakuWithAction.prototype.load = function(){
	var elm = this.elm;
	var action = this.action;
	$.ajax({
		url: this.url,
		type: "post",
		cache: false,
		data: {
			"vmPath": this.vmPath,
			"entityClass" : this.entityClass,
			"numOfItems" : this.numOfItems,
			"rootProductCd" : this.rootProductCd,
			"searchCondition" : this.searchCondition,
			"optData" : this.optData
		},
		success: function(html){
			if (html.match(/<!-- doAction -->/)) {
				action();
			}
			$('#' + elm).empty().append(html);
			//EventHandler.unbind('#' + elm);
			EventHandler.bind('#' + elm);
		}
	});
};

var PickupBanner = function(
		elm, url, dispType, searchCode, vmPath, numOfItems, optData){
	if(window == this || !this.init){
		return new PickupBanner(
			elm, url, dispType, searchCode, vmPath, numOfItems, optData);
	}
	return this.init(
		elm, url, dispType, searchCode, vmPath, numOfItems, optData);
};


PickupBanner.prototype.init = function(
		elm, url, dispType, searchCode, vmPath, numOfItems, optData){
	this.elm = elm;
	this.url = url;
	this.dispType = dispType;
	this.searchCode = searchCode;
	this.vmPath = vmPath;
	this.numOfItems = numOfItems;
	this.optData = optData;
};

PickupBanner.prototype.load = function(){
	var elm = this.elm;
	$.ajax({
		url: this.url,
		type: "post",
		cache: false,
		data: {
			"dispType": this.dispType,
			"searchCode": this.searchCode,
			"vmPath": this.vmPath,
			"numOfItems" : this.numOfItems,
			"optData" : this.optData
		},
		success: function(html){
			$('#' + elm).empty().append(html);
			//EventHandler.unbind('#' + elm);
			EventHandler.bind('#' + elm);
		}
	});
};

var PickupKokishin = function(
		elm, url, vmPath, numOfItems, key, cd, optData){
	if(window == this || !this.init){
		return new PickupKokishin(
			elm, url, vmPath, numOfItems, key, cd, optData);
	}
	return this.init(
		elm, url, vmPath, numOfItems, key, cd, optData);
};

PickupKokishin.prototype.init = function(
		elm, url, vmPath, numOfItems, key, cd, optData){
	this.url = url;
	this.elm = elm;
	this.vmPath = vmPath;
	this.numOfItems = numOfItems;
	this.key = key;
	this.cd = cd;
	this.optData = optData;
};

PickupKokishin.prototype.load = function(){
	var elm = this.elm;
	var data;
	if (this.key == "gakumonCd") {
		data = {
			"vmPath": this.vmPath,
			"numOfItems" : this.numOfItems,
			"gakumonCd" : this.cd,
			"optData" : this.optData
		}
	} else if (this.key == "shigotoCd") {
		data = {
			"vmPath": this.vmPath,
			"numOfItems" : this.numOfItems,
			"shigotoCd" : this.cd,
			"optData" : this.optData
		}
	}
	$.ajax({
		url: this.url,
		type: "post",
		cache: false,
		data: data,
		success: function(html){
			$('#' + elm).empty().append(html);
			//EventHandler.unbind('#' + elm);
			EventHandler.bind('#' + elm);
		}
	});
};


