//  ========================================================
//  tlab-juxtaposed-words.js ---- juxtaposed words class
//  Copyright 2009 TEAM-LAB
//  ========================================================

if ( typeof(TLAB_READ_CSS) == 'undefined' )
{
	TLAB_READ_CSS = true;
	$("head").append('<liNK rel="stylesheet" type="text/css" href="../5css/lab_content.css">');
}

if ( typeof(TLAB_S_JPW) == 'undefined' ) TLAB_S_JPW = function() {};

TLAB_S_JPW.Display = function (arg1, arg2) {
	this.divtag = arg1;
	this.keyword = encodeURI(arg2);
	this.jsurl = "http://reco.dospara.co.jp/cl000/juxtaposed_words.js?search_word=" + this.keyword;
	return this;
}

TLAB_S_JPW.Display.prototype.sendRequest = function () {
	$.getJSON("http://reco.dospara.co.jp/cl000/juxtaposed_words.js?search_word="+this.keyword+"&callback=?", function(json){
		var words = json.search_word;
		var url = "http://www.dospara.co.jp/5goods_parts/parts_list.php?h=d&f=d&m=parts&lf=0&ft=";
		if (words.length > 0) {
			var table = '<table style="font-size:12px;"><tr><td style="padding-right:0.3em; vertical-align:top;">\u95a2\u9023\u691c\u7d22</td><td>';
			for (var i=0; i<words.length; i++) {
				table += ' <a href="'+url+encodeURI(words[i])+'" style="margin-right:10px; color:#0000CC;">'+words[i]+'</a>';
			}
			table += '</td></tr></table>';
			$("#juxtaposed_words_divid").append(table);
		}

	});
}
