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

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

TLAB_RECOMMEND.Beacon = function (arg1) {
	var colledurl = 'http://' + window.location.host + window.location.pathname;
	colledurl = colledurl.replace(/#[^/]+$/, "");
	colledurl = colledurl.replace(/\?[^/]+$/, "");
	colledurl = colledurl.replace(/\/index\.[^/]+$/, "/");
	colledurl = colledurl.replace(/\.htm$/, ".html");
	this.divtag = arg1;
	this.itemcd = escape(colledurl);
	this.imgurl = "http://www.nissay.rec.team-lab.com/cl000/beacon.gif?item=" +this.itemcd;
	return this;
}

TLAB_RECOMMEND.Beacon.prototype.sendRequest = function () {
	var imgElement=document.createElement("img");
	imgElement.src=this.imgurl;
	document.getElementById(this.divtag).appendChild(imgElement);
}

document.write('<div id="tlab-recommend-beacon"></div>');
(new TLAB_RECOMMEND.Beacon("tlab-recommend-beacon")).sendRequest();
