//  ========================================================
//  tlab-recommend.js ---- recommendation view classes
//  Copyright 2009-2011 TEAM-LAB
//  ========================================================

if (typeof(TLAB) == 'undefined') TLAB = function() {};
TLAB.BaseUrl = "http://www2.teamlab-recommend.jp/cl002";

TLAB.Recommend = function(elemId, itemCd) {
	this.elemId = elemId;
	this.itemCd = itemCd;
	this.url = TLAB.BaseUrl + "/recommend.js?elem=" + this.elemId +
			"&item=" + encodeURIComponent(this.itemCd);
}

TLAB.Recommend.prototype.sendRequest = function() {
	var jsElement = document.createElement("script");
	jsElement.type = "text/javascript";
	jsElement.src = this.url;
	jsElement.charset = "UTF-8";
	document.getElementById(this.elemId).appendChild(jsElement);
}

TLAB.History = function(elemId) {
	var itemList = TLAB.HistRecord.listItem();
	this.elemId = elemId;
	this.url = TLAB.BaseUrl + "/history.js?elem=" + this.elemId +
			"&item=" + encodeURIComponent(itemList.join(","));
}

TLAB.History.prototype.sendRequest = function() {
	var jsElement = document.createElement("script");
	jsElement.type = "text/javascript";
	jsElement.src = this.url;
	jsElement.charset = "UTF-8";
	document.getElementById(this.elemId).appendChild(jsElement);
}

TLAB.Ranking = function(elemId) {
	this.elemId = elemId;
	this.url = TLAB.BaseUrl + "/ranking.js?elem=" + this.elemId;
}

TLAB.Ranking.prototype.sendRequest = function () {
	var jsElement = document.createElement("script");
	jsElement.type = "text/javascript";
	jsElement.src = this.url;
	jsElement.charset = "UTF-8";
	document.getElementById(this.elemId).appendChild(jsElement);
}

// EOF

