//  ========================================================
//  tlab-recommend.js ---- recommend view class
//  Copyright 2008 TEAM-LAB
//  ========================================================

/*************************************************************
//sumple
<html>
<head>
<script type="text/javascript" src="http://www.teamlab-recommend.jp/musashiya/js/tlab-recommend.js"></script>
</head>
<body>
    <div id="recommend_divid">
        write recommend here!
    </div>
    <script>(new TLAB.Recommend("recommend_divid", "item10")).sendRequest();</script>

    <div id="history_divid">
        write history here!
    </div>
    <script>(new TLAB.History("history_divid")).sendRequest();</script>

    <div id="personal_divid">
        write history here!
    </div>
    <script>(new TLAB.Personal("personal_divid")).sendRequest();</script>

    <div id="ranking_divid">
        write ranking here!
    </div>
    <script>(new TLAB.RankingAll("ranking_divid", "1")).sendRequest();</script>

</body>
</html>
*************************************************************/


if ( typeof(TLAB) == 'undefined' ) TLAB = function() {};

TLAB.Recommend = function (arg1, arg2) {
	this.divtag = arg1;
	this.itemid = escape(arg2);
	this.width = 480;
	this.height = 270;
	this.url = "http://www.teamlab-recommend.jp/musashiya/recommend.html?item=" + this.itemid;
	return this;
}

TLAB.Recommend.prototype.sendRequest = function () {
	document.getElementById(this.divtag).innerHTML = "<iframe id='teamlab_recommend_frame' width='" + this.width + "' height='" + this.height + "' name='teamlab_recommend_frame' frameborder='0' scrolling='no' src='" + this.url + "'></iframe>";
}

TLAB.History = function (arg1) {
	this.divtag = arg1;
	this.width = 480;
	this.height = 300;
	this.url = "http://www.teamlab-recommend.jp/musashiya/history.html";
	return this;
}

TLAB.History.prototype.sendRequest = function () {
	document.getElementById(this.divtag).innerHTML = "<iframe id='teamlab_recommend_frame' width='" + this.width + "' height='" + this.height + "' name='teamlab_recommend_frame' frameborder='0' scrolling='no' src='" + this.url + "'></iframe>";
}

TLAB.Personal = function (arg1) {
	this.divtag = arg1;
	this.width = 480;
	this.height = 300;
	this.url = "http://www.teamlab-recommend.jp/musashiya/personal.html";
	return this;
}

TLAB.Personal.prototype.sendRequest = function () {
	document.getElementById(this.divtag).innerHTML = "<iframe id='teamlab_recommend_frame' width='" + this.width + "' height='" + this.height + "' name='teamlab_recommend_frame' frameborder='0' scrolling='no' src='" + this.url + "'></iframe>";
}

TLAB.RankingAll = function (arg1) {
	this.divtag = arg1;
	this.url = "http://www.teamlab-recommend.jp/musashiya/ranking.html";
	this.width = 180;
	this.height = 710;
	return this;
}

TLAB.RankingAll.prototype.sendRequest = function () {
	document.getElementById(this.divtag).innerHTML = "<iframe id='teamlab_recommend_frame' width='" + this.width + "' height='" + this.height + "' name='teamlab_recommend_frame' frameborder='0' scrolling='no' src='" + this.url + "'></iframe>";
}

TLAB.RankingCategory = function (arg1, arg2, arg3) {
	this.divtag = arg1;
	this.category_type = escape(arg2);
	this.category = escape(arg3);
	this.url = "http://www.teamlab-recommend.jp/musashiya/ranking.html?category_type=" + this.category_type + "&category=" + this.category;
	this.width = 180;
	this.height = 710;
	return this;
}

TLAB.RankingCategory.prototype.sendRequest = function () {
	document.getElementById(this.divtag).innerHTML = "<iframe id='teamlab_recommend_frame' width='" + this.width + "' height='" + this.height + "' name='teamlab_recommend_frame' frameborder='0' scrolling='no' src='" + this.url + "'></iframe>";
}
