<!--
//--[AZlink Custom ver0.3]
//----関数AZcstm--AZlink_Customの呼び出し---------------------------------------------------//
function AZcstm(kind,sp_dir,sp_item){
	//基本的な編集部分はここから------------------------------------------------------------
	//変数設定(共通設定) これ以下を編集して使用します

	//作った人へのアソシエイトIDになる確率(0で寄付しません。0でもOKです)
	var donation_rate = 10; //この確率で、生成されるAZlinkが私orAZlink作成者様のアソシエイトIDになります。
	
	var def_amazon_ID = 'mitituna-22'; //amazonアソシエイトID
	var def_item_num = 6; //表示する商品数(呼び出し時に引数指定可能)
	var def_direction_type = 'horizontal'; //horizontal=横方向に並べる vertical=縦方向に並べる(呼び出し時に引数指定可能)
	var win_target = '_blank'; //リンク押下時のターゲット(htmlと一緒の書き方でOK)
	
	//表示したいAZlinkWidgetのノードとかを登録する
	//node=node+RSS_URL asin=[]内にasinを記述 その他=sreach
	var node_param = new Array();
	node_param.push("node_bestsellers/toys");
	node_param.push(['B001UE7GNO','B001QCYFUW','B002KKBVW4','B002AMVCTE','B002EVOKGS','B003H9LKYG']);
	node_param.push("ツクール");
	node_param.push("node_bestsellers/dvd");
	node_param.push("node_bestsellers/books");
	node_param.push("node_bestsellers/videogames");
	//上記ノード等にタイトルを付ける場合に記述 表示したくない場合は""で空にする
	//配列数はnode_paramと一緒にする
	var title_name = new Array();
	title_name.push("Top Sale on Toys");
	title_name.push("asin用テスト");
	title_name.push("ツクール関連");
	title_name.push("Top Sale on DVD(movies)");
	title_name.push("Top Sale on Comics");
	title_name.push("Top Sale on Games");
	//asin指定呼び出しのタイトルとURL
	var asin_title = "Amazon Links";
	var asin_url = "";	
	//上記タイトルにリンクを付ける場合に記述 リンクしない場合は""で空にする
	//配列数はnode_paramと一緒にする amazonへのリンクの場合後方に&tag=amazon_IDを付与する
	var title_URL = new Array();
	title_URL.push("http://www.amazon.co.jp/gp/bestsellers/toys/ref=pd_zg_rss_ts_t_toys_c");
	title_URL.push("http://www.amazon.co.jp/gp/bestsellers/toys/ref=pd_zg_rss_ts_t_toys_c");
	title_URL.push("http://www.amazon.co.jp/s/ref=nb_sb_noss?__mk_ja_JP=%83J%83%5E%83J%83i&url=search-alias%3Daps&field-keywords=%83c%83N%81%5B%83%8B&x=0&y=0");
	title_URL.push("http://www.amazon.co.jp/gp/bestsellers/dvd/562016/ref=pd_ts_d_nav");
	title_URL.push("http://www.amazon.co.jp/gp/bestsellers/dvd/562016/ref=pd_ts_d_nav");
	title_URL.push("http://www.amazon.co.jp/gp/bestsellers/dvd/562016/ref=pd_ts_d_nav");
	//最後に「もっと見る」を追加するかどうか(デフォルトはfalse)
	var more_veiw = true;
	//「もっと見る」に表示する文字列(デフォルトで「もっと見る」)
	var more_veiw_title_a = "Amazonへ"; //asinのとき
	var more_veiw_title_n = "もっと見る"; //nodeのとき
	var more_veiw_title_s = "もっと見る"; //sreachのとき
	//もっと見るのURL
	//配列数はnode_paramと一緒にする amazonへのリンクの場合後方に&tag=amazon_IDを付与する
	var more_veiw_URL = new Array();
	more_veiw_URL.push("http://www.amazon.co.jp/");
	more_veiw_URL.push("http://www.amazon.co.jp/gp/bestsellers/toys/ref=pd_zg_rss_ts_t_toys_c");
	more_veiw_URL.push("http://www.amazon.co.jp/s/ref=nb_sb_noss?__mk_ja_JP=%83J%83%5E%83J%83i&url=search-alias%3Daps&field-keywords=%83c%83N%81%5B%83%8B&x=0&y=0");
	more_veiw_URL.push("http://www.amazon.co.jp/gp/bestsellers/dvd/562016/ref=pd_ts_d_nav");
	more_veiw_URL.push("http://www.amazon.co.jp/gp/bestsellers/dvd/562016/ref=pd_ts_d_nav");
	more_veiw_URL.push("http://www.amazon.co.jp/gp/bestsellers/dvd/562016/ref=pd_ts_d_nav");
	//基本的な編集部分はここまで------------------------------------------------------------
	
	//ややこしい編集部分はここから----------------------------------------------------------
	//表示する商品情報を表示する順番に記述(popup以外)
	//image(商品画像),item(商品名),maker(メーカー),date(リリース日),
	//list_price(定価),new_price(新品価格),used_price(中古価格),sales_rank(セールス順位)
	//off_price(値引き価格)
	//注意：サイズ関係を変更する際には、CSSもそれに応じて編集してください。
	var visible_data_v = new Array("image","item","new_price","used_price");
	var visible_data_h = new Array("image","item","new_price");
	var link_begin = "image"; //商品へのリンクを開始する情報
	var link_end = "item"; //商品へのリンクを終了する情報
	//表示項目のセパレータ(デフォルト=<br>)
	var separater = '<br>';
	//表示項目のSPセパレータ(デフォルト=<hr class='AZcstm'>)
	var sp_separater = "<hr class='AZcstm'>";
	//表示項目のセパレータをSPにする項目
	var sp_separater_data = new Array();
	var img_discount = true; //商品画像にディスカウントマーク(1%とか)を表示 true=する false=しない(デフォルト=true)
	var name_length_v = 0;//商品名の最大文字数を指定 0=制限しない(デフォルト=28)
	var name_length_h = 28;//商品名の最大文字数を指定 0=制限しない(デフォルト=28)
	//商品画像のサイズ 常に正方形になる(デフォルト=160px、画像サイズは172p*172p)
	var img_size = 160; //+2が商品ごとのboxサイズ,*text_left_width_rateがtext_left時のwidth
	//画像の左に商品情報を true=表示する false=しない（情報は下に表示する）
	//trueの場合、呼び出す順番(visible_data[0])はimageからがおすすめ
	var text_left_v = true; //縦表示の場合(デフォルト=true)
	var text_left_h = false; //横表示の場合(デフォルト=false)
	var text_left_width_rate = 2; //商品情報true時のwidth倍率(少数指定OK,デフォルトは2)
	
	//価格関係
	var figure = true; //価格を桁区切り true=する false=しない(デフォルト=true)
	var list_p_head = "定価："; //ListPrice表示時、前方につける単語
	var list_p_foot = "円"; //ListPrice表示時、後方につける単語
	var new_p_head = "新品："; //NewPrice表示時、前方につける単語
	var new_p_foot = "円から"; //NewPrice表示時、後方につける単語
	var used_p_head = "中古："; //UsedPrice表示時、前方につける単語
	var used_p_foot = "円から"; //UsedPrice表示時、後方につける単語
	var off_p_head = "　"; //OffPrice表示時、前方につける単語
	var off_p_foot = "円OFF"; //OffPrice表示時、後方につける単語
	
	//popupの情報表示
	var popup = true; //popupを true=する flase=しない(デフォルト=true)
	//表示する商品情報(popup内 詳細はvisible_dataと一緒)
	var popup_data_v = new Array("item","maker","date","new_price","off_price","used_price");
	var popup_data_h = new Array("item","maker","date","new_price","off_price","used_price");
	var popup_img_size = 120; //popupの画像サイズ
	//popupのセパレータ(デフォルト=<br>)
	var popup_separater = '<br>';
	//表示項目のSPセパレータ(デフォルト=<hr class='AZcstm'>)
	var popup_sp_separater = "<hr class='AZcstm'>";
	//表示項目のセパレータをSPにする項目
	var popup_sp_separater_data = new Array("item","date");
	var popup_width_v = 160; //vertical版のpopupの幅(デフォルトは160)
	var popup_width_h = 140; //horizontal版のpopupの幅(デフォルトは140)
	//popupの表示位置関係
	var popup_top_v = 6; //vertical版のpopup縦表示位置(デフォルトは144)
	var popup_left_v = 60; //vertical版のpopupの横表示位置(デフォルトは60)
	var popup_top_h = 144; //horizontal版のpopup縦表示位置(デフォルトは144=imageを最初に表示したらいい感じ)
	var popup_left_h = 6; //horizontal版のpopupの横表示位置(デフォルトは6)
	//text_left=trueかつverticalの場合、left_vに加算する値(デフォルトは160)
	var popup_left_plus = 160;
	
	//loading画像の使用可否
	var loading = true;
	//loading画像のURL
	var loading_img = "http://www.mitituna.com/img/loading01.gif"
	
	//ややこしい編集部分はここまで----------------------------------------------------------

	//ここ以下は、javascriptがわかる人でないと面倒です--------------------------------------
	//定数(編集しなくてOK...だと思う)
	var URL_head = "'http://www.amazon.co.jp/exec/obidos/ASIN/"; //リンク用URLの生成
	var URL_foot = "/ref=nosim/'"; //リンク用URLの生成
	var def_box_width = img_size + 2; //商品ごとの幅(画像サイズ+2)
	//画像の横に説明文版の商品ごとの幅(画像サイズ*text_left_width_rate)
	var box_width_right = Math.floor(img_size * text_left_width_rate);
	var amazon_ID = def_amazon_ID;
	var item_num = def_item_num;
	var direction_type = def_direction_type;
	var text_left_v = text_left_v;
	//def_direction_typeに応じて text_leftをグローバル化
	if (def_direction_type == "vertical"){
		var text_left = text_left_v;
		var visible_data = visible_data_v;
		var popup_data = popup_data_v;
		var name_length = name_length_v;
	} else {
		var text_left = text_left_h;
		var visible_data = visible_data_h;
		var popup_data = popup_data_h;
		var name_length = name_length_h;
	}
	//node_paramがasin（配列）の場合、ユニーク化しておかないと、item_numより少ない場合エラーを吐く
	for (var i=0; i<node_param.length; i++){
		if (node_param[i] instanceof Array){
			node_param[i] = unique_array(node_param[i]);
		}
	}

	//各種変数を設定する
	//寄付率からアソシエイトIDを決定
	amazon_ID = def_amazon_ID;
	if (donation_rate > 0){
		if (donation_rate > Math.floor(Math.random() * 100)){
			if (50 > Math.floor(Math.random() * 100)){
				amazon_ID = 'mitituna-22'; //私のヤツ
			} else {
				amazon_ID = 'sakuratan05-22'; //azlinkの製作者様の
			}
		}
	}
	//kind(呼び出すリンクの引数を決定) load_num(呼び出す個数)
	var load_num = 0;
	if (kind == undefined){
		//kind未定義(引数がない)場合、表示するリストをランダム選択
		kind = Math.floor( Math.random() * node_param.length);
	} else if (kind instanceof Array){
		if (kind[0] == "asin"){
			//asin_アサインで呼び出す場合
			item_num = kind.length;
			var temp_param = new Array();
			for (var i=1; i<item_num; i++){
				temp_param.push(kind[i]);
			}
			kind = "asin";
			sp_item = temp_param.length;
		} else {
			//kindが配列なら、配列からランダム選択
			kind = kind[Math.floor( Math.random() * kind.length)];
		}
	} else if (kind < 0){
		//kindが負の値場合、(方向、アイテム数を任意にする場合で)表示するリストをランダム選択
		kind = Math.floor( Math.random() * node_param.length);
	}

	//呼び出すlistの表示方向が渡された場合(sp_dirがある)
	direction_type = def_direction_type;
	if (sp_dir == 0){
		//縦表示の場合
		direction_type = 'vertical';
	} else if (sp_dir == 1){
		//横表示の場合
		direction_type = 'horizontal';
	}
	
	//呼び出すlistの商品数が渡された場合(sp_itemがある)
	item_num = def_item_num;
	if (sp_item > 0){
		//表示個数が指定されている場合
		item_num = sp_item;
	}
	//こっから本格的な呼び出しの処理
	//呼び出す範囲(AZcstm_range)を指定する
	var print1 = "<div class='AZcstm_range' style='width:";
	var box_width = def_box_width;
	if (direction_type == 'vertical') {
		if (text_left_v) {
			box_width = box_width_right;
		}
		var range_width = box_width + 1; //+1はCSS padding-left分
		//ついでに表示するデータを再設定
		visible_data = visible_data_v;
		popup_data = popup_data_v;
		name_length = name_length_v;
	} else {
		if (text_left_h) {
			box_width = box_width_right;
		}
		if (node_param[kind] instanceof Array) {
			var n = node_param[kind].length;
		} else {
			var n = item_num
		}			
		var range_width = box_width * n + (1 * n);  //+ (1 * n)はCSS padding-left分
		//ついでにデータを再設定
		visible_data = visible_data_h;
		popup_data = popup_data_h;
		name_length = name_length_h;
	}
	print1 += range_width + "px;'";
	print1 += ">"
	//タイトルのHTMLを生成
	if (kind == "asin"){
		if (asin_title != "") {
			print1 += "<h4 class='AZcstm_title'><B>";
			if (asin_url != "") {
				var url = url_cstm(asin_url);
				print1 += "<a class='AZcstm_title' href='" + url + "' target='" + win_target + "'>";
				print1 += title_name[kind] + "</a></B></h4>";
			} else {
				print1 += asin_title + "</B></h4>";
			}
		}
	} else if (title_name[kind] != ""){
		print1 += "<h4 class='AZcstm_title'><B>";
		if (title_URL[kind] != ""){
			var url = url_cstm(title_URL[kind]);
			print1 += "<a class='AZcstm_title' href='" + url + "' target='" + win_target + "'>";
			print1 += title_name[kind] + "</a></B></h4>";
		} else {
			print1 += title_name[kind] + "</B></h4>";
		}
	}
	//loadingがtrueならloading画像を表示
	if (loading){
		var div_id = "load" + kind;
		document.write("<div id='load" + kind + "' style='text-align:center;'>");
		document.write("<img src='" + loading_img + "'>");
		document.write("</div>");
	}
	//何故か変動するので、格納しておく(なんで？)
	var dir = direction_type;
	var item_n = item_num;
	var v_data = visible_data;
	var vp_data = popup_data;
	var name_l = name_length;
	var load_k = kind;
	//引数asinで呼び出す場合
	if (kind == "asin") {
		var veiw_kind = 0;
		AZlink.Widget.blogParts({
			associateId: amazon_ID,
			asin: temp_param,
			direction: direction_type,
			widgetHook: function(params,data) {
				item_num = data.length; //dataの配列がユニークになるためエラー抑止しておく
				direction_type = dir;
				item_num = item_n;
				visible_data = v_data;
				popup_data = vp_data;
				name_length = name_l;
				kind = load_k;
				var print2 = AZcstm_load(kind,params,data);
				return print1 + print2;
			},
			onload: function() { $('#load' + kind).remove(); }
		});
	//asinで呼び出す場合
	} else if (node_param[kind] instanceof Array){
		var veiw_kind = 0;
		AZlink.Widget.blogParts({
			associateId: amazon_ID,
			asin: node_param[kind],
			direction: direction_type,
			widgetHook: function(params,data) {
				item_num = data.length; //dataの配列がユニークになるためエラー抑止しておく
				direction_type = dir;
				item_num = item_n;
				visible_data = v_data;
				popup_data = vp_data;
				name_length = name_l;
				kind = load_k;
				var print2 = AZcstm_load(kind,params,data);
				return print1 + print2;
			},
			onload: function() { $('#load' + kind).remove(); }
		});
	//nodeで呼び出す場合
	} else if (node_param[kind].substring(0, 5) == "node_"){
		var veiw_kind = 1;
		AZlink.Widget.blogParts({
			associateId: amazon_ID,
			node: node_param[kind].substring(5),
			direction: direction_type,
			limit: item_num,
			widgetHook: function(params,data) {
				direction_type = dir;
				item_num = item_n;
				visible_data = v_data;
				popup_data = vp_data;
				name_length = name_l;
				kind = load_k;
				var print2 = AZcstm_load(kind,params,data);
				return print1 + print2;
			},
			onload: function() { $('#load' + kind).remove(); }
		});
	//検索結果で呼び出す場合
	} else {
		var veiw_kind = 2;
		AZlink.Widget.blogParts({
			associateId: amazon_ID,
			search: node_param[kind],
			direction: direction_type,
			limit: item_num,
			widgetHook: function(params,data) {
				direction_type = dir;
				item_num = item_n;
				visible_data = v_data;
				popup_data = vp_data;
				name_length = name_l;
				kind = load_k;
				var print2 = AZcstm_load(kind,params,data);
				return print1 + print2;
			},
			onload: function() { $('#load' + kind).remove(); }
		});
	}
//----関数AZcstm_load--AZlink/widgetからの値を利用してhtmlを書き出す------------------------//
	function AZcstm_load(kind,params,data){
		//item数がdata数より多い場合はdata数に合わせる
		if (item_num > data.length){
			item_num = data.length;
		}
		//以下、商品情報のHTMLを生成
		var html_content = "";
		for (var i=0; i<item_num; i++){
			var item_URL = URL_head + data[i]["asin"] + "/" + amazon_ID + URL_foot;
			var box_width = def_box_width;
			if (direction_type == 'vertical') {
				var popup_width = popup_width_v;
				var popup_top = popup_top_v;
				var popup_left = popup_left_v;
				if (text_left_v) {
					text_left = text_left_v;
					box_width = box_width_right;
					popup_left += popup_left_plus;
				}
				html_content += "<div class='AZcstm_box' style='float:none;width:" + box_width + "px;'>";
			} else {
				var popup_width = popup_width_h;
				var popup_top = popup_top_h;
				var popup_left = popup_left_h;
				if (text_left_h) {
					text_left = text_left_h;
					box_width = box_width_right;
				}
				html_content += "<div class='AZcstm_box' style='float:left;width:" + box_width + "px;'>";
			}
			for (var j=0; j<visible_data.length; j++){
				if (visible_data[j] == link_begin) {
					html_content += "<a class='AZcstm_link' href=" + item_URL + " target='" + win_target + "'>";
				}
				html_content += data_description(visible_data[j],data,i,j);
				if (visible_data[j] == link_end) {
					if (popup){
						html_content += "<span class='AZcstm_detail'";
						html_content += " style='width:" + popup_width + "px; top:" + popup_top + "px; left:" + popup_left + "px;'";
						html_content += ">";
						for (var k=0; k<popup_data.length; k++){
							html_content += popup_data_description(popup_data[k],data,i,k);
						}
						html_content += "</span>";
					}
				html_content += "</a>";
				}
			}
		if (text_left){
			html_content += "<br clear='all'>";
		}
		html_content += "</div>";
		}
		//もっと見るのHTMLを生成
		if (more_veiw){
			if (kind == "asin"){
			} else if (more_veiw_URL[kind] != ""){
				var url = url_cstm(title_URL[kind]);
				html_content += "<div class='dummy'></div><div class='more_veiw'>";
				html_content += "<a class='AZcstm_title' href='" + url + "' target='" + win_target + "'>";
				if (veiw_kind == 0){
					html_content += more_veiw_title_a + "</a></div>";
				} else if (veiw_kind == 1){
					html_content += more_veiw_title_n + "</a></div>";
				} else {
					html_content += more_veiw_title_s + "</a></div>";
				}
			}
		}
		html_content += "</div><div class='dummy'></div>";
		return html_content;
	}
//----関数data_description--項目毎のhtml書き出し--------------------------------------------//
	function data_description(str,data,i,j){
		var word = "";
		switch (str) {
		case "image":
			var n =  "";
			if (data[i]["image"] == undefined){
				var n =  "'";
			} else if (img_discount){
				n = data[i]["image"].replace(".jpg", ".09._AA160_PE01_.jpg'");
			} else {
				n = data[i]["image"].replace(".jpg", ".09._AA160_.jpg'");
			}
			word += "<img class='AZcstm_img' width='" + img_size + "px' height='" + img_size + "px'";
			word += "src='" + n;
			if (text_left){
				word += " align='left'";
			}
			word += ">";
			if (text_left == false){
				word += separat(str,j);
			}
			return word;
		case "item":
			word = data[i]["item"]
			if (name_length > 0){
				if (data[i]["item"].length > name_length){
					word = data[i]["item"].substring(0,name_length - 1) + "...";
				}
			}
			word += separat(str,j);
			return word;
		case "maker":
			word  += data[i]["maker"]
			word += separat(str,j);
			return word;
		case "date":
			var n = String(data[i]["date"])
			word += n.split("-").join("/") + " 発売";
			word += separat(str,j);
			return word;
		case "list_price":
			if (data[i]["list_price"]){
				if (figure) {
					word += list_p_head + addFigure(data[i]["list_price"]) + list_p_foot;
				} else {
					word += list_p_head + data[i]["list_price"] + list_p_foot;
				}
			} else {return "";}
			word += separat(str,j);
			return word;
		case "new_price":
			if (data[i]["new_price"]){
				if (figure) {
					word += new_p_head + addFigure(data[i]["new_price"]) + new_p_foot;
				} else {
					word += new_p_head + data[i]["new_price"] + new_p_foot;
				}
			} else {
				word += "- 受付中 -";
			}
			word += separat(str,j);
			return word;
		case "used_price":
			if (data[i]["used_price"]){
				if (figure) {
					word += used_p_head + addFigure(data[i]["used_price"]) + used_p_foot;
				} else {
					word += used_p_head + data[i]["used_price"] + used_p_foot;
				}
			} else {return "";}
			word += separat(str,j);
			return word;
		case "off_price":
			if (data[i]["new_price"]){
				if (data[i]["list_price"]) {
					if (data[i]["list_price"] > data[i]["new_price"]) {
						if (figure) {
							word += "　" + addFigure(data[i]["list_price"] - data[i]["new_price"]) + "円OFF";
						} else {
							word += "　" + (data[i]["list_price"] - data[i]["new_price"]) + "円OFF";
						}
					} else {return "";}
				} else {return "";}
			} else {return "";}
			word += separat(str,j);
			return word;
		}
	}
//----関数popup_data_description--popup中の項目の書き出し-----------------------------------//
	function popup_data_description(str,data,i,k){
		var word = "";
		switch (str) {
		case "image":
			var n =  "";
			if (img_discount){
				n = data[i]["image"].replace(".jpg", ".09._AA160_PE01_.jpg'");
			} else {
				n = data[i]["image"].replace(".jpg", ".09._AA160_.jpg'");
			}
			word += "<img class='AZcstm_img' width='" + popup_img_size + "px' height='" + popup_img_size + "px'";
			word  += "src='" + n + ">";
			return word;
		case "item":
			word = data[i]["item"]
			word += popup_separat(str,k);
			return word;
		case "maker":
			word  += data[i]["maker"]
			word += popup_separat(str,k);
			return word;
		case "date":
			var n = String(data[i]["date"])
			word += n.split("-").join("/") + " 発売";
			word += popup_separat(str,k);
			return word;
		case "list_price":
			if (data[i]["list_price"]){
				if (figure) {
					word += list_p_head + addFigure(data[i]["list_price"]) + list_p_foot;
				} else {
					word += list_p_head + data[i]["list_price"] + list_p_foot;
				}
			} else {return "";}
			word += popup_separat(str,k);
			return word;
		case "new_price":
			if (data[i]["new_price"]){
				if (figure) {
					word += new_p_head + addFigure(data[i]["new_price"]) + new_p_foot;
				} else {
					word += new_p_head + data[i]["new_price"] + new_p_foot;
				}
			} else {
				word += "- 受付中 -";
			}
			word += popup_separat(str,k);
			return word;
		case "used_price":
			if (data[i]["used_price"]){
				if (figure) {
					word += used_p_head + addFigure(data[i]["used_price"]) + used_p_foot;
				} else {
					word += used_p_head + data[i]["used_price"] + used_p_foot;
				}
			} else {return "";}
			word += popup_separat(str,k);
			return word;
		case "off_price":
			if (data[i]["new_price"]){
				if (data[i]["list_price"]) {
					if (data[i]["list_price"] > data[i]["new_price"]) {
						if (figure) {
							word += off_p_head + addFigure(data[i]["list_price"] - data[i]["new_price"]) + off_p_foot;
						} else {
							word += off_p_head + (data[i]["list_price"] - data[i]["new_price"]) + off_p_foot;
						}
					} else {return "";}
				} else {return "";}
			} else {return "";}
			word += popup_separat(str,k);
			return word;
		}
	}
//----関数separat--セパレータを追記する-----------------------------------------------------//
	function separat(str,j){
		var sep = "";
		if (j < visible_data.length - 1) {
			if (sp_separater_data.indexOf(str) != -1){
				var sep = sp_separater;
			} else {
				var sep = separater;
			}
		} else if (text_left){
			var sep = "<br clear='all'>";
		}
		return sep;
	}
//----関数popup_separat--popup内のセパレータを追記------------------------------------------//
	function popup_separat(str,k){
		var sep = "";
		if (k < popup_data.length - 1) {
			if (popup_sp_separater_data.indexOf(str) != -1){
				var sep = popup_sp_separater;
			} else {
				var sep = popup_separater;
			}
		}
		return sep;
	}
//----関数url_cstm--amazonへのurlにamazon_IDを付与------------------------------------------//
	function url_cstm(url_str){
		if (url_str.indexOf("http://www.amazon") != -1){
			url_str += "&tag=" + amazon_ID;
		}
		return url_str;
	}
}
//--[plug-in]
//--javascript桁区切り
//----http://webdev.seesaa.net/article/22769178.html
function addFigure(str) {
	var num = new String(str).replace(/,/g, "");
	while(num != (num = num.replace(/^(-?\d+)(\d{3})/, "$1,$2")));
	return num;
}
//--重複を取り除く関数
//----http://blog.macaroniworks.net/2009/06/javascript%E3%81%AE%E9%85%8D%E5%88%97%E5%86%85%E3%81%AE%E9%87%8D%E8%A4%87%E3%82%92%E9%99%A4%E3%81%8F/
function unique_array(array) {
	var storage = {};
	var uniqueArray = [];
	var i,value;
	for ( i=0; i<array.length; i++) {
		value = array[i];
		if (!(value in storage)) {
			storage[value] = true;
			uniqueArray.push(value);
		}
	}
	return uniqueArray;
}
-->

