﻿//  ========================================================
//  tlab-recommend.js ---- recommend view class
//  Copyright 2009 TEAM-LAB
//  ========================================================

if ( typeof(TLAB) == 'undefined' ) TLAB = function() {};

TLAB.Host = window.location.protocol + "//www.seikyo.team-rec.jp";

TLAB.newsId = function (){
	paths = window.location.href.split("/");
	filename = paths[paths.length-1].split("_");
	return filename[0];
	}

TLAB.ComatchNews = function (arg1) {
	this.divtag = arg1;
	this.jsurl = TLAB.Host + "/cl000/contentmatch.js?elem=" + this.divtag 
		+ "&item=" + TLAB.newsId() + "&ctype=1" ;
	return this;
}

TLAB.ComatchNews.prototype.sendRequest = function () {
	var jsElement=document.createElement("script");
	jsElement.type="text/javascript";
	jsElement.src=this.jsurl;
	jsElement.characterSet="UTF-8";
	document.getElementById(this.divtag).appendChild(jsElement);
}


TLAB.ComatchBook3 = function (arg1) {
	this.divtag = arg1;
	this.jsurl = TLAB.Host + "/cl000/contentmatch.js?elem=" + this.divtag 
		+ "&item=" + TLAB.newsId() + "&ctype=2" + "&design=3";
	return this;
}

TLAB.ComatchBook3.prototype.sendRequest = function () {
	var jsElement=document.createElement("script");
	jsElement.type="text/javascript";
	jsElement.src=this.jsurl;
	jsElement.characterSet="UTF-8";
	document.getElementById(this.divtag).appendChild(jsElement);
}

TLAB.ComatchBook5 = function (arg1) {
	this.divtag = arg1;
	this.jsurl = TLAB.Host + "/cl000/contentmatch.js?elem=" + this.divtag 
		+ "&item=" + TLAB.newsId() + "&ctype=2" + "&design=5";
	return this;
}

TLAB.ComatchBook5.prototype.sendRequest = function () {
	var jsElement=document.createElement("script");
	jsElement.type="text/javascript";
	jsElement.src=this.jsurl;
	jsElement.characterSet="UTF-8";
	document.getElementById(this.divtag).appendChild(jsElement);
}
