﻿var text1 = '今のちゃんと検索できてないんじゃない？<br><span style="color:orange">"';
var text2 = '"</span>って<br><a class=ceo href="http://yahuu.blog.shinobi.jp/">もしかすると</a><span style="font-size:200%; color:green">';
var text3 = '</span>なんじゃないかなぁ？<br><br>';
var text4 = '<a onClick=urchinTracker("/amazonLink"); type=amzn search="';
var text5 = '">';
var text5_2 = '</a>';
var text6 = '<div style="font-size:80%"><br>関連リンク</div><br>';
var text7 = '<a href="';
var text8 = '">';
var text9 = '</a><br>';
var text10 = '<div style="font-size:80%"> 関連商品 </div><br>';

var linktxt1 = '<a class=ceo href="http://yahuu.blog.shinobi.jp/" style="color:orange">';
var linktxt2 = '</a>';

var ad = '';
var button = '';

amazon_ad_tag = "neetreder-22";
amazon_ad_width = "300";
amazon_ad_height = "250";
amazon_ad_logo = "hide";
amazon_ad_border = "hide";
amazon_color_border = "31F766";
amazon_color_link = "2884DF";
amazon_color_logo = "4E3012";

function createEntry(argment) {
	array = String(argment).split("\t");
	

	words = String(array[1]).split(" ");
	word = "";
	for (i = 0;i<words.length;i++) {
	word += linktxt1 + words[i] + linktxt2 + " ";
	}

	result = text1 + word + text2 + text4 + array[0] + text5 + array[0] + text5_2 + text3;

	// リンク部分
	if (array.length > 3) {
		result += text6;
		for (i = 3; array.length > i; i++) {
			if (array[i].indexOf("<br />") == -1) {
				result += text7 + array[i] + text8 + array[i] + text9;
			} else {
				link = array[i].split("<br />");
				result += '<div><div>' + link[0] + '</div>';
				result += '<div>' + text7 + link[1] + text8 + link[1] + text9 + '</div></div>';
			}
		}
	}

	// アマゾン部分
	if (array.length < 3 || array[2] == "") {
		ad = text10 + '<div><script type="text/javascript" src="http://www.assoc-amazon.jp/s/ads.js"></script></div>';
	} else {
		ad = text10 + array[2];
	}

	button = '<input type="button" value="キーワードをコピー" onClick=copyWord("' + array[0] + '")>';

	return result;
}

function createAd() {
return ad;
}

function createCopyButton() {
	result = '<form>' + button + '</form>';
	return result;
}

function copyWord(param) {
	urchinTracker('/pushCopyButton');
	document.forms[2].elements[0].value = param;
}

