PageExpand

All Image Download. Image Zoom. Expand Thumbnail and Audio and Video. Expand the short URL. Generate a link from text. Extend BBS. etc...

// -
// PageExpand
//
// Hakuhin 2010-2019  https://hakuhin.jp
// -


// -
// ユーザースクリプトメタデータ
// -
// ==UserScript==
// @name           PageExpand
// @name:ja        PageExpand
// @name:zh        PageExpand
// @version        1.5.20
// @namespace      http://hakuhin.jp/page_expand
// @description    All Image Download. Image Zoom. Expand Thumbnail and Audio and Video. Expand the short URL. Generate a link from text. Extend BBS. etc...
// @description:ja 画像の一括ダウンロード、画像のポップアップ、サムネイルやビデオの展開、短縮URLの展開、URL文字列のリンク化、2chなどの主要掲示板の拡張表示など...
// @description:zh 下载所有图片、图片缩放、扩展缩略图以及音频和视频、展开短网址、从文本生成链接、扩展BBS,等等...
// @include        http://*
// @include        https://*
// @include        ftp://*
// @connect        *
// @icon           https://hakuhin.github.io/PageExpand/GreaseMonkey/icon32.png
// @icon64         https://hakuhin.github.io/PageExpand/GreaseMonkey/icon64.png
// @author         hakuhin
// @grant          GM.xmlHttpRequest 
// @grant          GM_xmlhttpRequest
// @grant          GM.getValue
// @grant          GM_getValue
// @grant          GM.setValue
// @grant          GM_setValue
// @grant          GM.deleteValue
// @grant          GM_deleteValue
// @grant          GM.openInTab
// @grant          GM_openInTab
// @grant          GM_registerMenuCommand
// @grant          GM_unregisterMenuCommand
// @grant          GM_download
// ==/UserScript==



(function(page_expand_arguments){


	// -
	// 手動インポート
	//
	// 設定からエクスポートした文字列を記述すると、その設定値で動作します。
	// -
	var project_import_manual = null;


	// -
	// プライベート変数
	// -
	// 特権 オブジェクト
	var admin = page_expand_arguments.admin;

	// Window オブジェクト
	var window = page_expand_arguments.window;

	// Document オブジェクト
	var document = window.document;

	// PageExpand 関数
	var PageExpand = arguments.callee;

	// PageExpand プロジェクト
	var page_expand_project;

	// プロジェクト
	var project;

	// PageExpand ノード
	var page_expand_root;
	var page_expand_node;

	// イベントディスパッチャー
	var page_expand_event_dispatcher;

	// マウス入力
	var input_mouse;

	// タッチ入力
	var input_touch;

	// 実行キュー関連
	var execute_queue;

	// ローダーキュー関連
	var loader_queue;

	// ダウンローダーキュー関連
	var downloader_queue;

	// ダウンロードリスト
	var download_list_image;
	var download_list_user;

	// アドレス関連
	var address_collection;

	// タスク関連
	var task_container;
	var task_execute_level;

	// 最速実行
	var page_expand_execute_faster;

	// デバッグ関連
	var page_expand_debug;

	// DOMノードが外れたか監視
	var document_observer_remove_node;

	// DOMノードの変更を監視
	var document_observer_modify_node;

	// スクロール監視
	var document_observer_scroll;

	// 進捗通知
	var notify_progress;

	// イメージ管理
	var element_limitter_image;
	var popup_image_container;

	// サウンド管理
	var element_limitter_sound;

	// ビデオ管理
	var element_limitter_video;

	// リダイレクト辞書
	var redirect_url_dictionary;

	// 解析辞書
	var analyze_work_dictionary;

	// 掲示板辞書
	var bbs_dictionary;

	// 掲示板拡張
	var expand_bbs;

	// プリセットスクリプト辞書
	var preset_script_dictionary;

	// 拡張機能通信
	var extension_message;

	// ウィンドウ管理
	var window_manager;

	// 開始済み
	var started = false;

	// 解析が有効か
	var enable_analyze = true;


	// -
	// 定数
	// -
	// タスクレベル
	var TASK_EXECUTE_LEVEL_POPUP = 0x00000001;


	// -
	// PageExpand 初期化
	// -
	function PageExpandInitialize(){

		// PageExpand ノード
		if(!page_expand_node){
			page_expand_node = new PageExpandNode();
			if(page_expand_arguments.page_expand_parent){
				page_expand_arguments.page_expand_parent.attachChild(page_expand_node);
			}
			page_expand_root = page_expand_node.getPageExpandRoot();
		}

		// イベントディスパッチャー
		if(!page_expand_event_dispatcher){
			page_expand_event_dispatcher = new EventDispatcher();

			// アンロード監視
			if(WindowIsChild(window)){
				PageExpandObserverUnload();
			}
		}

	}

	// -
	// PageExpand コンストラクタ
	// -
	function PageExpandConstructor(){

		// マウス入力
		if(!input_mouse){
			input_mouse = new InputMouse(window);
		}

		// 実行キュー
		if(!execute_queue){
			execute_queue = new ExecuteQueue();
		}

		// ローダーキュー
		if(!loader_queue){
			loader_queue = new LoaderQueue();
		}

		// ダウンローダーキュー
		if(!downloader_queue){
			downloader_queue = new LoaderQueue();
		}

		// アドレスコレクション
		if(!address_collection){
			address_collection = new AddressCollection();
		}

		// ダウンロードリスト
		if(!download_list_image){
			download_list_image = new DownloadList();
		}
		if(!download_list_user){
			download_list_user = new DownloadList();
		}

		// タスクコンテナを生成
		if(!task_container){
			task_container = new TaskContainer();
			task_execute_level = 0xffffffff;

			// -
			// 実行ループ
			// -
			(function(){
				var time_handle = null;

				// 開始関数をセット
				task_container.setStartFunc(function(){
					if(time_handle !== null) return;
					time_handle = setInterval(function (){
						task_container.execute(task_execute_level);
					}, 1000 / 60);
				});

				// 終了関数をセット
				task_container.setEndFunc(function(){
					if(time_handle === null) return;
					clearInterval(time_handle);
					time_handle = null;
				});
			})();
		}

		// 最速実行
		if(!page_expand_execute_faster){
			page_expand_execute_faster = new PageExpandExecuteFaster();
		}

		// デバッグ
		if(!page_expand_debug){
			page_expand_debug = new PageExpandDebug();
		}

		// DOMノードが外れたか監視
		if(!document_observer_remove_node){
			document_observer_remove_node = new DocumentObserverRemoveDomNode();
		}

		// プロパティ変更を監視
		if(!document_observer_modify_node){
			document_observer_modify_node = new DocumentObserverModifyProperty();
		}

		// スクロール監視
		if(!document_observer_scroll){
			document_observer_scroll = new DocumentObserverScroll();
		}

		// 進捗通知
		if(!notify_progress){
			notify_progress = new NotifyProgress();
		}

		// イメージ管理
		if(!element_limitter_image){
			element_limitter_image = new ElementLimiterByByteSize();
		}
		if(!popup_image_container){
			popup_image_container = new PopupImageContainer();
		}

		// サウンド管理
		if(!element_limitter_sound){
			element_limitter_sound = new ElementLimiterByCount();
		}

		// ビデオ管理
		if(!element_limitter_video){
			element_limitter_video = new ElementLimiterByCount();
		}

		// リダイレクト辞書
		if(!redirect_url_dictionary){
			redirect_url_dictionary = new RedirectUrlDictionary();
		}

		// 解析辞書
		if(!analyze_work_dictionary){
			analyze_work_dictionary = new AnalyzeWorkDictionary();
		}

		// 掲示板辞書
		if(!bbs_dictionary){
			bbs_dictionary = new BbsDictionary();
		}

		// ウィンドウ管理
		if(!window_manager){
			window_manager = new WindowManager(window);
		}

		// 掲示板拡張
		if(!expand_bbs){
			expand_bbs = {
				enable:false,
				initialized:false,
				node_queue:new Array(),
				work:new Object()
			};
		}

	}

	// -
	// PageExpand から実行されるか調べる
	// -
	function WindowIsExecutedByPageExpand(window_obj){
		try{
			var re = new RegExp("^(data|blob|about):","i");
			if(window_obj.location.href){}
			if(window_obj.document.URL.match(re)){
				return true;
			}
		}catch(e){
		}

		return false;
	}


	// -
	// PageExpand 開放
	// -
	function PageExpandRelease(){

		// 開放イベント発火
		if(page_expand_event_dispatcher){
			page_expand_event_dispatcher.dispatchEvent("release",null);
		}

		// ウィンドウ管理
		if(window_manager){
			window_manager.release();
			window_manager = null;
		}

		// 拡張機能通信
		if(extension_message){
			extension_message.release();
			extension_message = null;
		}

		// 最速実行
		if(page_expand_execute_faster){
			page_expand_execute_faster.release();
			page_expand_execute_faster = null;
		}

		// デバッグ関連
		if(page_expand_debug){
			page_expand_debug.release();
			page_expand_debug = null;
		}

		// 掲示板辞書
		if(bbs_dictionary){
			bbs_dictionary.release();
			bbs_dictionary = null;
		}

		// プリセットスクリプト辞書
		if(preset_script_dictionary){
			preset_script_dictionary.release();
			preset_script_dictionary = null;
		}

		// 解析辞書
		if(analyze_work_dictionary){
			analyze_work_dictionary.release();
			analyze_work_dictionary = null;
		}

		// リダイレクト辞書
		if(redirect_url_dictionary){
			redirect_url_dictionary.release();
			redirect_url_dictionary = null;
		}

		// ビデオ管理
		if(element_limitter_video){
			element_limitter_video.release();
			element_limitter_video = null;
		}

		// サウンド管理
		if(element_limitter_sound){
			element_limitter_sound.release();
			element_limitter_sound = null;
		}

		// イメージ管理
		if(element_limitter_image){
			element_limitter_image.release();
			element_limitter_image = null;
		}
		if(popup_image_container){
			popup_image_container.release();
			popup_image_container = null;
		}

		// 進捗通知
		if(notify_progress){
			notify_progress.release();
			notify_progress = null;
		}

		// スクロール監視
		if(document_observer_scroll){
			document_observer_scroll.release();
			document_observer_scroll = null;
		}

		// DOMノードの変更を監視
		if(document_observer_modify_node){
			document_observer_modify_node.release();
			document_observer_modify_node = null;
		}

		// DOMノードが外れたか監視
		if(document_observer_remove_node){
			document_observer_remove_node.release();
			document_observer_remove_node = null;
		}

		// タスク関連
		if(task_container){
			task_container.release();
			task_container = null;
		}

		// アドレス関連
		if(address_collection){
			address_collection.release();
			address_collection = null;
		}

		// ダウンロードリスト
		if(download_list_image){
			download_list_image.release();
			download_list_image = null;
		}
		if(download_list_user){
			download_list_user.release();
			download_list_user = null;
		}

		// ダウンローダーキュー関連
		if(downloader_queue){
			downloader_queue.release();
			downloader_queue = null;
		}

		// ローダーキュー関連
		if(loader_queue){
			loader_queue.release();
			loader_queue = null;
		}

		// 実行キュー関連
		if(execute_queue){
			execute_queue.release();
			execute_queue = null;
		}

		// タッチ入力
		if(input_touch){
			input_touch.release();
			input_touch = null;
		}

		// マウス入力
		if(input_mouse){
			input_mouse.release();
			input_mouse = null;
		}

		// イベントディスパッチャー
		if(page_expand_event_dispatcher){
			page_expand_event_dispatcher.release();
			page_expand_event_dispatcher = null;
		}

		// PageExpand ノード
		if(page_expand_node){
			page_expand_node.release();
			page_expand_node = null;
			page_expand_root = null;
		}

		// プロジェクト
		if(project){
			project.release();
			project = null;
		}

		// PageExpand プロジェクト
		page_expand_project = null;

		// Document オブジェクト
		document = null;

		// Window オブジェクト
		window = null;

		// 特権 オブジェクト
		admin = null;
	}

	// -
	// アンロード監視
	// -
	function PageExpandObserverUnload(){
		var event_handler_release;

		var removeEvent = function (e){
			if(event_handler_release){
				event_handler_release.release();
				event_handler_release = null;
			}
			if(window.removeEventListener){
				window.removeEventListener("unload",unload);
			}else if(window.detachEvent){
				window.detachEvent("onunload",unload);
			}
		};

		var unload = function (e){
			removeEvent();
			PageExpandRelease();
		};

		// アンロード監視
		if(window.addEventListener){
			window.addEventListener("unload",unload);
		}else if(window.attachEvent){
			window.attachEvent("onunload",unload);
		}

		// 開放イベント
		event_handler_release = page_expand_event_dispatcher.createEventHandler("release");
		event_handler_release.setFunction(function(){
			removeEvent();
		});
	}


	// -
	// PageExpand 実行開始
	// -
	function PageExpandStart(){

		if(started)	return;
		started = true;

		// -
		// 設定
		// -
		loader_queue.setMaxThread(project.getLoadThreadMax());
		downloader_queue.setMaxThread(project.getDownloadThreadMax());
		element_limitter_image.setEnableUnload(project.getEnableUnloadExpandImage());
		element_limitter_image.setByteSizeMax(project.getSizeMoreThenAllowUnloadExpandImage());
		element_limitter_sound.setMaxUse(project.getSoundMaxInlineSound());
		element_limitter_video.setMaxUse(project.getVideoMaxInlineVideo());
		execute_queue.setOccupancyTime(project.getExecuteQueueOccupancyTime());
		execute_queue.setSleepTime(project.getExecuteQueueSleepTime());

		// -
		// タッチ入力
		// -
		(function(){
			if(project.enableInputTouch()){
				var virtual_mouse_pointer;
				var touch_assist;

				// 開放イベント
				var event_handler_release = page_expand_event_dispatcher.createEventHandler("release");
				event_handler_release.setFunction(function(){
					if(virtual_mouse_pointer){
						virtual_mouse_pointer.release();
						virtual_mouse_pointer = null;
					}
					if(touch_assist){
						touch_assist.release();
						touch_assist = null;
					}
				});

				// タッチ入力
				input_touch = new InputTouch();

				// 仮想マウスポインタ
				virtual_mouse_pointer = new VirtualMousePointer(document);

				// タッチ補助
				if(project.enableDoubleTouchAssist()){
					touch_assist = new DoubleTouchAssist();
				}

				var enable_old = false;
				var touch_max = 0;

				// タッチ入力更新
				var event_update = input_touch.createEventHandler("update");
				event_update.setFunction(function (e){
					var enable_now = e.getEnableTouch();
					if(enable_now){
						var touch_list = e.getTouchList();
						var touch_num = touch_list.length;
						if(touch_max <= 1){
							if(touch_num == 1){
								input_mouse.setInputTouch(e);
								virtual_mouse_pointer.setPosition(input_touch.getPositionAverage());
							}else if(touch_num == 2){
								var touch0 = touch_list[0];
								var touch1 = touch_list[1];
								if(touch0 && touch1){
									var pos = {
										x:touch0.clientX,
										y:touch0.clientY
									};
									var vec = {
										x:touch1.clientX - touch0.clientX,
										y:touch1.clientY - touch0.clientY
									};
									virtual_mouse_pointer.setPosition(pos);
									virtual_mouse_pointer.addVector(vec);

									if(touch_assist){
										touch_assist.setShow(pos,vec);
									}
								}
							}
							touch_max = touch_num;
						}
					}else{
						touch_max = 0;
					}
					enable_old = enable_now;
				});
			}
		})();

		// -
		// ルートウィンドウのマウス操作
		// -
		(function(){
			if(!window_manager.existWindowRoot()) return;

			function mouseMove (e){
				if(!(task_container.getCountTask())) return;

				var offset = window_manager.getPositionFromRoot();

				// マウス入力を更新
				input_mouse.setMouseEvent({
					clientX:e.clientX - offset.x,
					clientY:e.clientY - offset.y,
					detail:e.detail,
					screenX:e.screenX,
					screenY:e.screenY,
					ctrlKey:e.ctrlKey,
					shiftKey:e.shiftKey,
					altKey:e.altKey,
					metaKey:e.metaKey,
					button:e.button
				});
			}

			var document_obj = window_manager.getWindowRoot().document;

			// 開放イベント
			var event_handler_release = page_expand_event_dispatcher.createEventHandler("release");
			event_handler_release.setFunction(function(){
				if(document_obj.removeEventListener){
					document_obj.removeEventListener("mousemove",mouseMove);
				}else if(document_obj.detachEvent){
					document_obj.detachEvent("onmousemove",mouseMove);
				}
			});

			if(document_obj.addEventListener){
				document_obj.addEventListener("mousemove",mouseMove);
			}else if(document_obj.attachEvent){
				document_obj.attachEvent("onmousemove",mouseMove);
			}
		})();

		// -
		// 変更オブザーバー未対応
		// -
		if(!MutationObserverSupported()){
			(function(){
				// アンカー監視
				var task = task_container.createTask();
				task.setExecuteFunc(function(task){
					document_observer_modify_node.execute();
					document_observer_remove_node.execute();
				});
			})();
		}

		// -
		// 更新イベント
		// -
		// ロード完了時に実行
		function DocumentLoaded(){
			if(project.getEnableDebugMode()){
				// デバッグモード
				page_expand_debug.setVisible(true);
			}

			// 掲示板拡張初期化
			if(project.getEnableExpandBbs()){
				project.initializeScriptCallbackExpandBbs(function(response){
					expand_bbs.initialized = true;
					expand_bbs.enable = response.result;

					var ary = expand_bbs.node_queue;
					var num = ary.length;
					var i;
					for(i=0;i<num;i++){
						execute_queue.attachForExpandBbs(ElementAnalyzeBbs,ary[i]);
					}
					expand_bbs.node_queue.length = 0;
				});
			}

			if(document.addEventListener){
				if(MutationObserverSupported()){

					(function(){
						var mutation_observer;
						var event_handler_release;

						mutation_observer = MutationObserverCreate(function(mutations) {
							var i;
							var num = mutations.length;
							for(i=0;i<num;i++){
								var nodes = mutations[i].addedNodes;
								if(nodes){
									var j;
									var node_num = nodes.length;
									for(j=0;j<node_num;j++){
										execute_queue.attachLastForInsertDomNode(DomNodeAnalyzeRoot,nodes[j]);
									}
								}
							}
						});
						mutation_observer.observe(document.documentElement,{subtree:true,childList:true});

						event_handler_release = page_expand_event_dispatcher.createEventHandler("release");
						event_handler_release.setFunction(function(){
							if(mutation_observer){
								mutation_observer.disconnect();
								mutation_observer = null;
							}
						});
					})();

				}else{

					(function(){
						var event_handler_release;

						function DomNodeInsertedFunc(e){
							if(enable_analyze){
								execute_queue.attachLastForInsertDomNode(DomNodeAnalyzeRoot,e.target);
							}
						}

						// 動的追加時に発生するイベント
						document.addEventListener('DOMNodeInserted', DomNodeInsertedFunc, false);

						event_handler_release = page_expand_event_dispatcher.createEventHandler("release");
						event_handler_release.setFunction(function(){
							document.removeEventListener('DOMNodeInserted', DomNodeInsertedFunc, false);
						});
					})();

				}
			}else{
				// DOM の更新を検出できないのでタイマーによるチェック
				(function(){
					var frame = 0;
					var elements = [];
					var element_pos = 0;
					var task = task_container.createTask();
					task.setExecuteFunc(function(task){
						if(frame <= 0){
							var i;
							var num = 5;
							if(num > element_pos)	num = element_pos;
							for(i=0;i<num;i++){
								var element = elements[element_pos];
								element_pos -= 1;
								if(element){
									if(!DomNodeGetInserted(element)){
										execute_queue.attachLastForInsertDomNode(DomNodeAnalyzeRoot,element);
									}
								}
							}
							if(element_pos <= 0){
								elements = ElementGetElementsByTagName(document.body,"*");
								element_pos = elements.length;
								if(element_pos > 0)	element_pos -= 1;
								frame = 60;
							}
						}else if(execute_queue.getCountQueue() <= 0){
							frame -= 1;
						}
					});
				})();
			}

			// 解析開始
			execute_queue.attachLastForInsertDomNode(DomNodeAnalyzeRoot,document.documentElement);
			page_expand_execute_faster.startedAnalyze();
		}

		// DOM 構築完了
		DocumentGetLoadedDomContent(document,function(){
			DocumentLoaded();
		});
	}



	// -
	// PageExpand 最速実行
	// -
	function PageExpandExecuteFaster(){
		var _this = this;

		// -
		// 解放
		// -
		_this.release = function (){
			if(_task){
				_task.release();
				_task = null;
			}
		};

		// -
		// 開始
		// -
		_this.start = function (){
			if(!_started_analyze){
				_request = true;
				return;
			}
			start();	
		};

		// -
		// 解析を開始
		// -
		_this.startedAnalyze = function (){
			_started_analyze = true;
			if(_request){
				_request = false;
				start();
			}
		};
		
		// -
		// 開始
		// -
		function start(){
			if(_executing) return;
			_executing = true;
			var scroll_pos = WindowGetScrollPosition(window);
			var html = document.documentElement;
			var style_display = html.style.display;
			html.style.display = "none";

			setTimeout(function(){
				execute_queue.setOccupancyTime(1000);
				execute_queue.setSleepTime(0);

				_task = task_container.createTask();
				_task.setExecuteFunc(function(task){
					if(execute_queue.getCountQueue() <= 0){
						task.release();
					}
				});
				_task.setDestructorFunc(function(task){
					if(style_display === undefined){
						StyleDeclarationRemoveProperty(html.style,"display");
					}else{
						StyleDeclarationSetProperty(html.style,"display",style_display);
					}
					WindowSetScrollPosition(window,scroll_pos);
					execute_queue.setOccupancyTime(project.getExecuteQueueOccupancyTime());
					execute_queue.setSleepTime(project.getExecuteQueueSleepTime());
					_executing = false;
					_task = null;
				});
			},0);
		};
		
		var _started_analyze = false;
		var _request = false;
		var _executing = false;
		var _task = null;
	}
	function PageExpandExecuteFastest(){
		if(page_expand_execute_faster){
			page_expand_execute_faster.start();
		}
	}


	// -
	// PageExpand プロジェクト
	// -
	function PageExpandProject(){
		var _this = this;

		// -
		// ローカルストレージからロード
		// -
		_this.loadLocalStorage = function(func){
			_proj_src = null;

			function projUpdate(){
				try{
					_proj_src = PageExpandProjectObjectAppendPreset(_proj_src);
					_proj_src = PageExpandProjectObjectUpdate(_proj_src,null);
					// 辞書生成
					createDictionary();
				}catch(e){
					projDefault();
					return;
				}
				func({result:true});
			}

			function projDefault(){
				_proj_src = PageExpandProjectObjectUpdate(null,null);
				// 辞書生成
				createDictionary();
				func({result:true});
			}

			if(project_import_manual){
				// 手動のインポート設定を使用
				_proj_src = project_import_manual;
				projUpdate();
			}else{
				// ローカルストレージから読み込み
				LocalStorageGetItem(_key,function(e){
					if(e.result){
						try{
							_proj_src = JsonParse(e.value);
						}catch(e){}
						projUpdate();
					}else{
						projDefault();
					}
				});
			}
		};

		// -
		// ローカルストレージへセーブ
		// -
		_this.saveLocalStorage = function(func){
			var obj = _this.exportObject();
			obj = PageExpandProjectObjectRemovePreset(obj);
			LocalStorageSetItem(_key,JsonStringify(obj),function(e){
				func(e);
			});
		};

		// -
		// ローカルストレージから削除
		// -
		_this.removeLocalStorage = function(func){
			LocalStorageRemoveItem(_key,function(e){
				func(e);
			});
		};

		// -
		// 同期ストレージからロード
		// -
		_this.loadSyncStorage = function(func){
			SyncStorageGetItem(_key,function(e){
				if(e.result){
					var obj = null;
					if(e.value){
						obj = JsonParse(e.value);
						obj = PageExpandProjectObjectAppendPreset(obj);
					}
					_proj_src = PageExpandProjectObjectUpdate(obj,null);
					// 辞書生成
					createDictionary();
					func({result:true});
				}else{
					func(e);
				}
			});
		};

		// -
		// 同期ストレージへセーブ
		// -
		_this.saveSyncStorage = function(func){
			var obj = ObjectCopy(_this.getObject());
			obj = PageExpandProjectObjectRemovePreset(obj);
			SyncStorageSetItem(_key,JsonStringify(obj),function(e){
				func(e);
			});
		};

		// -
		// 同期ストレージから削除
		// -
		_this.removeSyncStorage = function(func){
			SyncStorageRemoveItem(_key,function(e){
				func(e);
			});
		};

		// -
		// 初期化
		// -
		_this.initialize = function(json){
			_proj_src = null;
			_proj_src = PageExpandProjectObjectUpdate(_proj_src,null);
			// 辞書生成
			createDictionary();
		};

		// -
		// JSON 文字列からインポート
		// -
		_this.importJSON = function(json){
			_proj_src = JsonParse(json);
			_proj_src = PageExpandProjectObjectUpdate(_proj_src,null);
			// 辞書生成
			createDictionary();
		};

		// -
		// オブジェクトからインポート
		// -
		_this.importObject = function(obj){
			_proj_src = ObjectCopy(obj);
			_proj_src = PageExpandProjectObjectUpdate(_proj_src,null);
			// 辞書生成
			createDictionary();
		};

		// -
		// JSON 文字列をエクスポート
		// -
		_this.exportJSON = function(){
			return JsonStringify(_proj_src);
		};

		// -
		// オブジェクトをエクスポート
		// -
		_this.exportObject = function(){
			return ObjectCopy(_proj_src);
		};

		// -
		// オブジェクトを直接取得
		// -
		_this.getObject = function (){
			return _proj_src;
		};

		// -
		// プロジェクトオブジェクトを取得
		// -
		_this.getProject = function (url){
			var i;
			var j;
			var k;
			
			if(!url){
				return _project_unknown.getInstance();
			}

			// -
			// キャッシュ有効
			// -
			if(_enable_urlcache){
				var cache_obj = _url_cache.getObject(url);
				if(!(cache_obj.project)){
					var proj_obj = new Object();

					// 基本設定
					proj_obj.standard = _proj_src.standard;

					// ダウンロード設定
					proj_obj.download = _proj_src.download;

					// 簡易フィルタ
					if(cache_obj.enable === undefined){
						cache_obj.enable = getEnable(url);
					}
					proj_obj.enable = cache_obj.enable;

					if(proj_obj.enable){
						var expand_bbs;
						var urlmap;

						var expand_bbs_num = _dictionary_expand_bbs.length;
						for(i=0;i<expand_bbs_num;i++){
							var filter = _dictionary_expand_bbs[i].filter;
							var filter_num = filter.length;
							for(j=0;j<filter_num;j++){
								if(StringUrlMatchRegExpList(url,filter[j])){
									expand_bbs = _dictionary_expand_bbs[i];
									break;
								}
							}
							if(expand_bbs) break;
						}
						cache_obj.expand_bbs = expand_bbs;

						urlmap = cache_obj.urlmap;
						if(urlmap === undefined){
							urlmap = null;
							var urlmap_num = _dictionary_urlmap.length;
							for(i=0;i<urlmap_num;i++){
								var filter = _dictionary_urlmap[i].filter;
								var filter_num = filter.length;
								for(j=0;j<filter_num;j++){
									if(StringUrlMatchRegExpList(url,filter[j])){
										urlmap = _dictionary_urlmap[i];
										break;
									}
								}
								if(urlmap) break;
							}
							cache_obj.urlmap = urlmap;
						}

						if(urlmap){
							var urlmap_proj;
							if(_enable_instance){
								urlmap_proj = urlmap.proj_ins;
							}else{
								urlmap_proj = urlmap.proj_src;
							}
							for(var p in urlmap_proj){
								proj_obj[p] = urlmap_proj[p];
							}
							proj_obj.enable_unsecure = urlmap.urlmap.enable_unsecure;
							proj_obj.enable_mixed_content = urlmap.urlmap.enable_mixed_content;
						}
						if(expand_bbs){
							proj_obj.expand_bbs = expand_bbs.expand_bbs;
						}

						// セキュアページ
						if(url.indexOf("https://") == 0){
							proj_obj.current_secure = true;
						}else{
							proj_obj.current_secure = false;
						}
					}

					cache_obj.project = proj_obj;
				}

				return cache_obj.project;

			// -
			// キャッシュ無効
			// -
			}else{
				var proj_obj = new Object();

				// 基本設定
				proj_obj.standard = _proj_src.standard;

				// ダウンロード設定
				proj_obj.download = _proj_src.download;

				// 簡易フィルタ
				proj_obj.enable = getEnable(url);
				if(proj_obj.enable){
					// インスタンス化リスト(コンテント)
					var instantiate_content = [
						{ asset:"access_block" , func:ProjectObjectInstantiateAccessBlock },
						{ asset:"replacement_to_element" , func:ProjectObjectInstantiateReplacementToElement },
						{ asset:"replacement_to_text" , func:ProjectObjectInstantiateReplacementToText },
						{ asset:"replacement_to_anchor" , func:ProjectObjectInstantiateReplacementToAnchor },
						{ asset:"replacement_to_link" , func:ProjectObjectInstantiateReplacementToLink },
						{ asset:"make_link_to_text" , func:ProjectObjectInstantiateMakeLinkToText },
						{ asset:"expand_short_url" , func:ProjectObjectInstantiateExpandShortUrl },
						{ asset:"expand_text" , func:ProjectObjectInstantiateExpandText },
						{ asset:"expand_image" , func:ProjectObjectInstantiateExpandImage },
						{ asset:"expand_sound" , func:ProjectObjectInstantiateExpandSound },
						{ asset:"expand_video" , func:ProjectObjectInstantiateExpandVideo },
						{ asset:"expand_iframe" , func:ProjectObjectInstantiateExpandIframe },
						{ asset:"style_sheet" , func:ProjectObjectInstantiateStyleSheet },
						{ asset:"experimental" , func:ProjectObjectInstantiateExperimental }
					];
					var instantiate_content_num = instantiate_content.length;

					// URLマッピング
					var urlmap;
					var urlmap_src = _proj_src.urlmap;
					var urlmap_num = urlmap_src.length;
					for(i=0;i<urlmap_num;i++){
						var d = urlmap_src[i];
						var u;
						if(d.user){
							u = d.user;
						}else if(d.preset){
							u = d.preset;
						}

						// 有効
						if(!(u.enable)) continue;

						if(u.filter.type == "asterisk"){
							var filter = u.filter.asterisk.filter;
							var filter_num = filter.length;
							for(j=0;j<filter_num;j++){
								if(StringUrlMatchAsteriskWord(url,filter[j])){
									urlmap = u;
									break;
								}
							}
						}else if(u.filter.type == "regexp"){
							var filter = u.filter.regexp.filter;
							var filter_num = filter.length;
							for(j=0;j<filter_num;j++){
								var regexp = RegExpObjectGetRegExp(filter[j]);
								if(regexp){
									if(StringUrlMatchRegExpList(url,[regexp])){
										urlmap = u;
										break;
									}
								}
							}
						}
						if(urlmap) break;
					}
					if(urlmap){
						for(j=0;j<instantiate_content_num;j++){
							var asset = instantiate_content[j].asset;
							var p = urlmap[asset];
							if(p.enable){
								var define_src = _dictionary_define_src[asset];
								var id = p.id;
								if((id) && (typeof(id) == "object")){
									var ary_src = new Array();
									var id_num = id.length;
									for(k=0;k<id_num;k++){
										ary_src.push(define_src[id[k]]);
									}
									if(_dictionary_wildcard_src[asset]){
										ary_src.push(_dictionary_wildcard_src[asset]);
									}
									proj_obj[asset] = ary_src;
								}else{
									proj_obj[asset] = define_src[id];
								}
							}
						}
						proj_obj.enable_unsecure = urlmap.enable_unsecure;
						proj_obj.enable_mixed_content = urlmap.enable_mixed_content;
					}

					// 掲示板拡張
					var expand_bbs;
					var expand_bbs_src = _proj_src.expand_bbs;
					var expand_bbs_num = expand_bbs_src.length;
					for(i=0;i<expand_bbs_num;i++){
						var d = expand_bbs_src[i];
						var b;
						if(d.user){
							b = d.user;
						}else if(d.preset){
							b = d.preset;
						}

						// 有効
						if(!(b.enable)) continue;

						var obj = new Object();
						obj.expand_bbs = b;

						if(b.filter.type == "asterisk"){
							var filter = b.filter.asterisk.filter;
							var filter_num = filter.length;
							for(j=0;j<filter_num;j++){
								if(StringUrlMatchAsteriskWord(url,filter[j])){
									expand_bbs = b;
									break;
								}
							}
						}else if(b.filter.type == "regexp"){
							var filter = b.filter.regexp.filter;
							var filter_num = filter.length;
							for(j=0;j<filter_num;j++){
								var regexp = RegExpObjectGetRegExp(filter[j]);
								if(regexp){
									if(StringUrlMatchRegExpList(url,[regexp])){
										expand_bbs = b;
										break;
									}
								}
							}
						}
						if(expand_bbs) break;
					}
					proj_obj.expand_bbs = expand_bbs;
				}

				// セキュアページ
				if(url.indexOf("https://") == 0){
					proj_obj.current_secure = true;
				}else{
					proj_obj.current_secure = false;
				}

				return proj_obj;
			}
		};


		// -
		// ウェブリクエスト用オブジェクトを取得
		// -
		_this.getWebRequest = function(current_url,url){
			var web_request_obj;
			var cache_obj;

			if(current_url){
				cache_obj = _url_cache.getObject(current_url);

				var urlmap = cache_obj.urlmap;
				if(urlmap === undefined){
					urlmap = null;
					var i;
					var j;
					var urlmap_num = _dictionary_urlmap.length;
					for(i=0;i<urlmap_num;i++){
						var filter = _dictionary_urlmap[i].filter;
						var filter_num = filter.length;
						for(j=0;j<filter_num;j++){
							if(StringUrlMatchRegExpList(current_url,filter[j])){
								urlmap = _dictionary_urlmap[i];
								break;
							}
						}
						if(urlmap) break;
					}
					cache_obj.urlmap = urlmap;
				}
				if(urlmap){
					web_request_obj = urlmap.web_request;
				}
			}
			if(!web_request_obj){
				cache_obj = {
					enable:true
				};
				web_request_obj = _wildcard_webrequest;
			}

			var url_cache = web_request_obj.url_cache;
			var obj = url_cache.getObject(url);
			if(!(obj.web_request)){
				var web_request = new Object();

				if(cache_obj.enable === undefined){
					cache_obj.enable = getEnable(current_url);
				}

				if(cache_obj.enable){
					var access_block = web_request_obj.access_block;
					var replacement_to_useragent = web_request_obj.replacement_to_useragent;
					var replacement_to_referer = web_request_obj.replacement_to_referer;

					// アクセスブロック
					if(access_block){
						var i;
						var j;
						var filters;
						var filter_num;
						var define;
						var define_num = access_block.length;
						for(i=0;i<define_num;i++){
							define = access_block[i];
							filters = define.filter;
							filter_num = filters.length;
							for(j=0;j<filter_num;j++){
								if(StringUrlMatchRegExpList(url,filters[j])){
									web_request.access_block = true;
									break;
								}
							}
							if(web_request.access_block) break;
						}
					}

					// リファラ
					if(replacement_to_referer){
						var filter = ProjectInstanceDefinesGetFilterFromURL(replacement_to_referer,url);
						if(filter){
							var referer_obj = new Object();
							var send_referer = filter.send_referer;

							referer_obj.send_referer = send_referer;
							referer_obj.cached = false;

							switch(send_referer.type){
							case "default":
								referer_obj.cached = true;
								break;
							case "link_url":
								referer_obj.referer = url;
								referer_obj.cached = true;
								break;
							case "custom":
								referer_obj.referer = send_referer.custom;
								referer_obj.cached = true;
								break;
							}

							if(send_referer.regexp.pattern){
								referer_obj.regexp = RegExpObjectGetRegExp(send_referer.regexp);
								if(referer_obj.referer !== undefined){
									referer_obj.referer = RegExpReplacementDollarWord(referer_obj.regexp,referer_obj.referer,send_referer.replacement);
								}
							}

							web_request.replacement_to_referer = referer_obj;
						}
					}

					// ユーザーエージェント
					if(replacement_to_useragent){
						var filter = ProjectInstanceDefinesGetFilterFromURL(replacement_to_useragent,url);
						if(filter){
							web_request.replacement_to_useragent = filter.send_useragent.custom;
						}
					}
				}

				obj.web_request = web_request;
			}

			// リファラ
			var referer_obj = obj.web_request.replacement_to_referer;
			if(referer_obj){
				if(!(referer_obj.cached)){
					var send_referer = referer_obj.send_referer;
					switch(send_referer.type){
					case "current_url":
						referer_obj.referer = current_url;
						break;
					}

					if(referer_obj.regexp){
						if(referer_obj.referer !== undefined){
							referer_obj.referer = RegExpReplacementDollarWord(referer_obj.regexp,referer_obj.referer,send_referer.replacement);
						}
					}
				}
			}

			return obj.web_request;
		};

		// -
		// 辞書生成(内部用)
		// -
		function createDictionary(){
			var i;
			var j;
			var k;

			// インスタンス化リスト(コンテント)
			var instantiate_content = [
				{ asset:"access_block" , func:ProjectObjectInstantiateAccessBlock },
				{ asset:"replacement_to_element" , func:ProjectObjectInstantiateReplacementToElement },
				{ asset:"replacement_to_text" , func:ProjectObjectInstantiateReplacementToText },
				{ asset:"replacement_to_anchor" , func:ProjectObjectInstantiateReplacementToAnchor },
				{ asset:"replacement_to_link" , func:ProjectObjectInstantiateReplacementToLink },
				{ asset:"make_link_to_text" , func:ProjectObjectInstantiateMakeLinkToText },
				{ asset:"expand_short_url" , func:ProjectObjectInstantiateExpandShortUrl },
				{ asset:"expand_text" , func:ProjectObjectInstantiateExpandText },
				{ asset:"expand_image" , func:ProjectObjectInstantiateExpandImage },
				{ asset:"expand_sound" , func:ProjectObjectInstantiateExpandSound },
				{ asset:"expand_video" , func:ProjectObjectInstantiateExpandVideo },
				{ asset:"expand_iframe" , func:ProjectObjectInstantiateExpandIframe },
				{ asset:"style_sheet" , func:ProjectObjectInstantiateStyleSheet },
				{ asset:"experimental" , func:ProjectObjectInstantiateExperimental }
			];
			// インスタンス化リスト(ウェブリクエスト)
			var instantiate_webrequest = [
				{ asset:"access_block" , func:ProjectObjectInstantiateAccessBlock },
				{ asset:"replacement_to_referer" , func:ProjectObjectInstantiateReplacementToReferer },
				{ asset:"replacement_to_useragent" , func:ProjectObjectInstantiateReplacementToUseragent }
			];
			var instantiate_content_num = instantiate_content.length;
			var instantiate_webrequest_num = instantiate_webrequest.length;

			// -
			// URLキャッシュ辞書を作成
			// -
			if(_enable_urlcache){
				_url_cache = new UrlCacheDictionary();
				_url_cache.setCacheMax(32);
			}

			// -
			// 基本プロジェクト
			// -
			_project_unknown = new Project();
			_project_unknown.importObjectForBackground({
				enable:true,
				standard:_proj_src.standard,
				download:_proj_src.download,
				expand_bbs:null
			});

			// -
			// 基本設定をインスタンス化
			// -
			var std_src = _proj_src.standard;
			var std_ins = new Object();
			switch(std_src.filter_type){
			case "deny":
				std_ins.filter_allow = false;
				std_ins.filter = std_src.filter_deny;
				break;
			case "allow":
				std_ins.filter_allow = true;
				std_ins.filter = std_src.filter_allow;
				break;
			}
			if(_enable_urlcache){
				var filter_src = std_ins.filter;
				var filter_ins = new Array();
				var filter_num = filter_src.length;
				for(i=0;i<filter_num;i++){
					filter_ins[i] = StringRegExpListFromAsteriskWord(filter_src[i]);
				}
				std_ins.filter = filter_ins;
			}
			_standard = std_ins;

			// -
			// 定義を辞書化
			// -
			_dictionary_define_src = new Object();
			_dictionary_define_ins = new Object();
			_dictionary_wildcard_src = new Object();
			_dictionary_wildcard_ins = new Object();
			for(i=0;i<instantiate_content_num;i++){
				var asset = instantiate_content[i].asset;
				var dic = new Object();
				var ary = _proj_src[asset];
				for(var p in ary){
					var d = ary[p];
					if(d.user){
						dic[d.id] = d.user;
					}else if(d.preset){
						dic[d.id] = d.preset;
					}
				}
				_dictionary_define_src[asset] = dic;
				_dictionary_define_ins[asset] = new Object();
			}
			if(_enable_webrequest){
				for(i=0;i<instantiate_webrequest_num;i++){
					var asset = instantiate_webrequest[i].asset;
					if(_dictionary_define_ins[asset]) continue;

					var dic = new Object();
					var ary = _proj_src[asset];
					for(var p in ary){
						var d = ary[p];
						if(d.user){
							dic[d.id] = d.user;
						}else if(d.preset){
							dic[d.id] = d.preset;
						}
					}
					_dictionary_define_src[asset] = dic;
					_dictionary_define_ins[asset] = new Object();
					if(dic.wildcard){
						_dictionary_wildcard_src[asset] = dic.wildcard;
					}
				}
			}

			// -
			// 定義をインスタンス化
			// -
			if(_enable_instance){
				for(i=0;i<instantiate_content_num;i++){
					var asset = instantiate_content[i].asset;
					var func = instantiate_content[i].func;
					var src = _dictionary_define_src[asset];
					var ins = _dictionary_define_ins[asset];
					for(var p in src){
						ins[p] = func(src[p]);
					}
				}
			}
			if(_enable_webrequest){
				for(i=0;i<instantiate_webrequest_num;i++){
					var asset = instantiate_webrequest[i].asset;
					var func = instantiate_webrequest[i].func;
					var src = _dictionary_define_src[asset];
					var ins = _dictionary_define_ins[asset];
					for(var p in src){
						if(ins[p]) continue;
						ins[p] = func(src[p]);
					}
					if(ins.wildcard){
						_dictionary_wildcard_ins[asset] = ins.wildcard;
					}
				}
			}

			if(_enable_urlcache){

				// -
				// URLマッピングを辞書化
				// -
				_dictionary_urlmap = new Array();
				var urlmap_src = _proj_src.urlmap;
				var urlmap_num = urlmap_src.length;
				for(i=0;i<urlmap_num;i++){
					var d = urlmap_src[i];
					var u;
					if(d.user){
						u = d.user;
					}else if(d.preset){
						u = d.preset;
					}

					// 有効
					if(!(u.enable)) continue;

					var obj = new Object();
					obj.urlmap = u;
					obj.filter = ProjectObjectInstantiateUrlEditContainer(u.filter);

					var proj_src = new Object();
					var proj_ins = new Object();
					for(j=0;j<instantiate_content_num;j++){
						var asset = instantiate_content[j].asset;
						var p = u[asset];
						if(p.enable){
							var define_src = _dictionary_define_src[asset];
							var define_ins = _dictionary_define_ins[asset];
							var id = p.id;
							if((id) && (typeof(id) == "object")){
								var ary_src = new Array();
								var ary_ins = new Array();
								var id_num = id.length;
								for(k=0;k<id_num;k++){
									ary_src.push(define_src[id[k]]);
									ary_ins.push(define_ins[id[k]]);
								}
								proj_src[asset] = ary_src;
								proj_ins[asset] = ary_ins;
							}else{
								proj_src[asset] = define_src[id];
								proj_ins[asset] = define_ins[id];
							}
						}
						if(_dictionary_wildcard_src[asset]){
							if(proj_src[asset]){
								proj_src[asset].push(_dictionary_wildcard_src[asset]);
							}else{
								proj_src[asset] = [_dictionary_wildcard_src[asset]];
							}
						}
					}
					obj.proj_src = proj_src;
					obj.proj_ins = proj_ins;

					if(_enable_webrequest){
						var web_request = new Object();
						for(j=0;j<instantiate_webrequest_num;j++){
							var asset = instantiate_webrequest[j].asset;
							var p = u[asset];
							if(p.enable){
								var define_ins = _dictionary_define_ins[asset];
								var id = p.id;
								if((id) && (typeof(id) == "object")){
									var ary_ins = new Array();
									var id_num = id.length;
									for(k=0;k<id_num;k++){
										ary_ins.push(define_ins[id[k]]);
									}
									web_request[asset] = ary_ins;
								}else{
									web_request[asset] = define_ins[id];
								}
							}
							if(_dictionary_wildcard_ins[asset]){
								if(web_request[asset]){
									web_request[asset].push(_dictionary_wildcard_ins[asset]);
								}else{
									web_request[asset] = [_dictionary_wildcard_ins[asset]];
								}
							}
						}

						// URLキャッシュ辞書を作成
						var url_cache = new UrlCacheDictionary();
						url_cache.setCacheMax(64);
						web_request.url_cache = url_cache;
						obj.web_request = web_request;
					}
					_dictionary_urlmap.push(obj);
				}

				// -
				// ワイルドカードウェブリクエスト
				// -
				if(_enable_webrequest){
					_wildcard_webrequest = new Object();
					for(i=0;i<instantiate_webrequest_num;i++){
						var asset = instantiate_webrequest[i].asset;
						if(_dictionary_wildcard_ins[asset]){
							_wildcard_webrequest[asset] = [_dictionary_wildcard_ins[asset]];
						}
					}

					var url_cache = new UrlCacheDictionary();
					url_cache.setCacheMax(128);
					_wildcard_webrequest.url_cache = url_cache;
				}

				// -
				// BBS拡張を辞書化
				// -
				_dictionary_expand_bbs = new Array();
				var expand_bbs_src = _proj_src.expand_bbs;
				var expand_bbs_num = expand_bbs_src.length;
				for(i=0;i<expand_bbs_num;i++){
					var d = expand_bbs_src[i];
					var b;
					if(d.user){
						b = d.user;
					}else if(d.preset){
						b = d.preset;
					}

					// 有効
					if(!(b.enable)) continue;

					var obj = new Object();
					obj.expand_bbs = b;

					obj.filter = ProjectObjectInstantiateUrlEditContainer(b.filter);

					// インスタンス化
					if(_enable_instance){
						obj.expand_bbs = ProjectObjectInstantiateExpandBbs(obj.expand_bbs);
					}

					_dictionary_expand_bbs.push(obj);
				}
			}
		}

		// -
		// 言語を習得
		// -
		_this.getLanguage = function(){
			var language = _proj_src.language;
			if(!(language.auto)){
				return language.code;
			}

			// 自動判定
			var code = NavigatorGetBrowserLanguage();

			return code;
		};

		// -
		// 有効であるかを取得(内部用)
		// -
		function getEnable(url){
			var filter = _standard.filter;

			var i;
			var filter_num = filter.length;
			if(_enable_urlcache){
				for(i=0;i<filter_num;i++){
					if(StringUrlMatchRegExpList(url,filter[i])){
						if(_standard.filter_allow)	return true;
						return false;
					}
				}
			}else{
				for(i=0;i<filter_num;i++){
					if(StringUrlMatchAsteriskWord(url,filter[i])){
						if(_standard.filter_allow)	return true;
						return false;
					}
				}
			}
			if(_standard.filter_allow)	return false;
			return true;
		}

		// -
		// プライベート変数
		// -
		var _proj_src;
		var _key;
		var _standard;
		var _dictionary_urlmap;
		var _dictionary_expand_bbs;
		var _dictionary_wildcard_src;
		var _dictionary_wildcard_ins;
		var _dictionary_define_src;
		var _dictionary_define_ins;
		var _url_cache;
		var _project_unknown;
		var _wildcard_webrequest;
		var _enable_urlcache;
		var _enable_webrequest;
		var _enable_instance;

		// -
		// 初期化
		// -
		(function(){
			_key = "PageExpandProject";
			_enable_urlcache = false;
			_enable_webrequest = false;
			_enable_instance = false;
		})();
	}

	// -
	// プロジェクト
	// -
	function Project(){
		var _this = this;

		// -
		// 開放
		// -
		_this.release = function(){
			_replacement_to_link_dictionary.release();
			_replacement_to_link_dictionary = null;
			_proj_src = null;
			_proj_ins = null;
		};

		// -
		// JSON 文字列からインポート
		// -
		_this.importJSON = function(json){
			_this.importObject(JsonParse(json));
		};

		// -
		// オブジェクトからインポート
		// -
		_this.importObject = function(obj){
			_proj_src = obj;
			instantiate();
		};

		// -
		// オブジェクトからインポート(バックグラウンド用)
		// -
		_this.importObjectForBackground = function(obj){
			_proj_src = obj;
			_proj_ins = {
				enable:_proj_src.enable,
				standard:_proj_src.standard,
				download:_proj_src.download,
				expand_bbs:_proj_src.expand_bbs
			};
		};

		// -
		// インスタンスを取得
		// -
		_this.getInstance = function(){
			return _proj_ins;
		};

		// -
		// インスタンスをセット
		// -
		_this.setInstance = function(obj){
			_proj_ins = obj;
		};

		// -
		// インスタンス化(内部用)
		// -
		function instantiate(){
			_proj_ins = new Object();
			_proj_ins.enable = _proj_src.enable;
			_proj_ins.current_secure = _proj_src.current_secure;
			_proj_ins.enable_unsecure = _proj_src.enable_unsecure;
			_proj_ins.enable_mixed_content = _proj_src.enable_mixed_content;
			_proj_ins.standard = _proj_src.standard;
			_proj_ins.download = _proj_src.download;

			// インスタンス化リスト(コンテント)
			var instantiate_project = [
				{ asset:"access_block" , func:ProjectObjectInstantiateAccessBlock },
				{ asset:"replacement_to_element" , func:ProjectObjectInstantiateReplacementToElement },
				{ asset:"replacement_to_text" , func:ProjectObjectInstantiateReplacementToText },
				{ asset:"replacement_to_anchor" , func:ProjectObjectInstantiateReplacementToAnchor },
				{ asset:"replacement_to_link" , func:ProjectObjectInstantiateReplacementToLink },
				{ asset:"make_link_to_text" , func:ProjectObjectInstantiateMakeLinkToText },
				{ asset:"expand_short_url" , func:ProjectObjectInstantiateExpandShortUrl },
				{ asset:"expand_text" , func:ProjectObjectInstantiateExpandText },
				{ asset:"expand_image" , func:ProjectObjectInstantiateExpandImage },
				{ asset:"expand_sound" , func:ProjectObjectInstantiateExpandSound },
				{ asset:"expand_video" , func:ProjectObjectInstantiateExpandVideo },
				{ asset:"expand_iframe" , func:ProjectObjectInstantiateExpandIframe },
				{ asset:"style_sheet" , func:ProjectObjectInstantiateStyleSheet },
				{ asset:"experimental" , func:ProjectObjectInstantiateExperimental },
				{ asset:"expand_bbs" , func:ProjectObjectInstantiateExpandBbs }
			];
			var instantiate_project_num = instantiate_project.length;

			var i;
			var j;
			for(i=0;i<instantiate_project_num;i++){
				var asset = instantiate_project[i].asset;
				var func = instantiate_project[i].func;
				var define = _proj_src[asset];
				if(!define) continue;
				if(typeof(define) != "object") continue;

				if(define.constructor == Array){
					var ary_src = define;
					var ary_ins = new Array();
					var num = ary_src.length;
					for(j=0;j<num;j++){
						ary_ins[j] = func(ary_src[j]);
					}
					_proj_ins[asset] = ary_ins;
				}else{
					_proj_ins[asset] = func(_proj_src[asset]);
				}
			}
		}

		// -
		// 実行可能であるか取得
		// -
		_this.getEnable = function(){
			return _proj_ins.enable;
		};

		// -
		// デバッグモードが有効であるか
		// -
		_this.getEnableDebugMode = function(){
			return _proj_ins.standard.enable_debug_mode;
		};

		// -
		// ログ出力が有効であるか
		// -
		_this.getEnableOutputLog = function(){
			return _proj_ins.standard.enable_output_log;
		};

		// -
		// アドレスバーアイコンが有効であるか
		// -
		_this.getEnableIconAddressBar = function(){
			return _proj_ins.standard.enable_icon_address_bar;
		};

		// -
		// コンテキストメニューが有効か
		// -
		_this.getEnableContextMenu = function(){
			return _proj_ins.standard.enable_context_menu;
		};

		// -
		// ロード完了時から動作を開始するか
		// -
		_this.getEnableStartup = function(){
			return _proj_ins.standard.enable_startup;
		};

		// -
		// ロードスレッドの最大数
		// -
		_this.getLoadThreadMax = function(){
			var v = _proj_ins.download.load.thread_max;
			if(v < 1)	v = 1;
			return v;
		};

		// -
		// ロードのタイムアウト
		// -
		_this.getLoadTimeout = function(){
			var v = _proj_ins.download.load.timeout;
			if(v < 0)	v = 0;
			return v;
		};

		// -
		// ダウンロードスレッドの最大数
		// -
		_this.getDownloadThreadMax = function(){
			var v = _proj_ins.download.download.thread_max;
			if(v < 1)	v = 1;
			return v;
		};

		// -
		// ダウンロードファイル名衝突時
		// -
		_this.getDownloadConflict = function(){
			return _proj_ins.download.download.conflict_type;
		};

		// -
		// ダウンロードファイル先を取得
		// -
		_this.getSaveFileDownload = function(url){
			var save_file = _proj_ins.download.download.save_file;
			var detail = null;
			if(save_file.type == "simple"){
				detail = "PageExpand/" + ProjectDownloadSaveFile_DetailFromSimple(save_file.simple);
			}else{
				detail = save_file.detail;
			}
			if(!detail){
				detail = "PageExpand/" + ProjectDownloadSaveFile_DetailFromSimple("url");
			}
			return ProjectDownloadSaveFile_GetFileNameFromDetail(detail , url);
		};

		// -
		// 一括ダウンロードファイル先を取得
		// -
		_this.getSaveFileBatchDownload = function(url){
			var save_file = _proj_ins.download.batch_download.save_file;
			var detail = null;
			if(save_file.type == "simple"){
				detail = ProjectDownloadSaveFile_DetailFromSimple(save_file.simple);
			}else{
				detail = save_file.detail;
			}
			if(!detail){
				detail = ProjectDownloadSaveFile_DetailFromSimple("url");
			}
			return ProjectDownloadSaveFile_GetFileNameFromDetail(detail , url);
		};

		// -
		// 実行キューの占有時間
		// -
		_this.getExecuteQueueOccupancyTime = function(){
			var v = _proj_ins.standard.execute_queue.time_occupancy;
			if(v < 0)		v = 0;
			if(v > 5000)	v = 5000;
			return v;
		};
		
		// -
		// 実行キューのスリープ時間
		// -
		_this.getExecuteQueueSleepTime = function(){
			var v = _proj_ins.standard.execute_queue.time_sleep;
			if(v < 0)		v = 0;
			if(v > 1000)	v = 1000;
			return v;
		};

		// -
		// セキュアなページか
		// -
		_this.getSecureCurrent = function(){
			return _proj_ins.current_secure;
		};

		// -
		// アンセキュアなアクセスが許可されているか
		// -
		_this.checkAllowUnsecure = function(url){
			if(_proj_ins.enable_unsecure)	return true;

			if(_proj_ins.current_secure){
				if(url.indexOf("http://") == 0){
					return false;
				}
			}
			return true;
		};

		// -
		// IFRAME 要素の展開が可能か
		// -
		_this.checkAllowExpandIframeElement = function(url){
			return true;
		};

		// -
		// EMBED 要素の展開が可能か
		// -
		_this.checkAllowExpandEmbedElement = function(url){
			return true;
		};

		// -
		// タッチ入力を使用するか
		// -
		_this.enableInputTouch = function(){
			if(!(window.TouchEvent)) return false;
			return _proj_ins.standard.enable_input_touch;
		};

		// -
		// ダブルタッチ補助線を使用するか
		// -
		_this.enableDoubleTouchAssist = function(){
			if(!(window.TouchEvent)) return false;
			return _proj_ins.standard.enable_double_touch_assist;
		};

		// -
		// アクセス遮断対象か調べる
		// -
		_this.checkAccessBlock = function(url){
			if(!(_proj_ins.access_block)){
				return false;
			}

			var i;
			var j;
			var filters;
			var filter_num;
			var define;
			var defines = _proj_ins.access_block;
			var define_num = defines.length;
			for(i=0;i<define_num;i++){
				define = defines[i];
				filters = define.filter;
				filter_num = filters.length;
				for(j=0;j<filter_num;j++){
					if(StringUrlMatchRegExpList(url,filters[j])){
						return true;
					}
				}
			}
			return false;
		};

		// -
		// エレメントの置換が可能であるか取得
		// -
		_this.getEnableReplacementToElement = function(){
			return _proj_ins.replacement_to_element;
		};

		// -
		// エレメントの置換用関数を実行
		// -
		_this.executeScriptReplacementToElement = function(request,response){
			var defines = _proj_ins.replacement_to_element;
			var count = 0;
			var define_num = defines.length;
			var info = {element:request.element};
			var result = {};

			function func(param){
				if((param) && (typeof(param) == "object")){
					var k;
					for(k in param){
						result[k] = param[k];
					}
				}
				if(define_num <= count){
					response(result);
					return;
				}

				var define = defines[count];
				count++;

				var ary = define.script;
				var i;
				var num = ary.length;
				if(num){
					for(i=0;i<num;i++){
						if(ary[i](info,func)){
							break;
						}
					}
				}else{
					func({});
				}
			}

			func({});
		};

		// -
		// テキストの置換が可能であるか取得
		// -
		_this.getEnableReplacementToText = function(){
			return _proj_ins.replacement_to_text;
		};

		// -
		// テキストの置換用関数を実行
		// -
		_this.executeScriptReplacementToText = function(element,response){
			var defines = _proj_ins.replacement_to_text;
			var count = 0;
			var define_num = defines.length;
			var info = {text_node:element};
			var result = {};

			function func(param){
				if((param) && (typeof(param) == "object")){
					var k;
					for(k in param){
						result[k] = param[k];
					}
				}
				if(define_num <= count){
					response(result);
					return;
				}

				var define = defines[count];
				count++;

				var ary = define.script;
				var i;
				var num = ary.length;
				if(num){
					for(i=0;i<num;i++){
						if(ary[i](info,func)){
							break;
						}
					}
				}else{
					func({});
				}
			}

			func({});
		};

		// -
		// アンカーの置換が可能であるか取得
		// -
		_this.getEnableReplacementToAnchor = function(){
			return _proj_ins.replacement_to_anchor;
		};

		// -
		// アンカーの置換用関数を実行
		// -
		_this.executeScriptReplacementToAnchor = function(element,event_dispatcher,response){
			var defines = _proj_ins.replacement_to_anchor;
			var count = 0;
			var define_num = defines.length;
			var info = {anchor_element:element,event_dispatcher:event_dispatcher};
			var result = {};

			function func(param){
				if((param) && (typeof(param) == "object")){
					var k;
					for(k in param){
						result[k] = param[k];
					}
				}
				if(define_num <= count){
					response(result);
					return;
				}

				var define = defines[count];
				count++;

				var ary = define.script;
				var i;
				var num = ary.length;
				if(num){
					for(i=0;i<num;i++){
						if(ary[i](info,func)){
							break;
						}
					}
				}else{
					func({});
				}
			}

			func({});
		};

		// -
		// ハイパーリンクの置換が可能であるか取得
		// -
		_this.getEnableReplacementToLink = function(){
			return _proj_ins.replacement_to_link;
		};

		// -
		// リンク置換用オブジェクト取得
		// -
		_this.getReplacementToLink = function(element){
			var _link_container = new Object();

			// -
			// アイテムを作成
			// -
			function createItem(){
				var _page = new Object();

				// -
				// 完了状態を取得
				// -
				_page.getCompleted = function(){
					return _page.completed;
				};

				// -
				// 完了状態をセット
				// -
				_page.setCompleted = function(){
					_page.completed = true;
				};

				// -
				// リザルトデータを取得
				// -
				_page.getResult = function(){
					return _page.result;
				};

				// -
				// リザルトデータをセット
				// -
				_page.setResult = function(result){
					_page.result = result;
				};

				// -
				// フィルタをセット
				// -
				_page.setFilter = function(filter){
					_page._filter = filter;
				};

				// -
				// リンクの変更をアンカーに反映するか
				// -
				_page.getEnableReflectToAnchor = function(){
					if(_page._filter){
						return _page._filter.enable_reflect_to_anchor;
					}
					return false;
				};

				// -
				// キャッシュが有効か
				// -
				_page.getEnableCache = function(){
					if(_page._filter){
						return _page._filter.enable_cache;
					}
					return false;
				};

				// -
				// イベントディスパッチャーを開放
				// -
				_page.releaseEventDispatcher = function(){
					if(_page.event_dispatcher){
						_page.event_dispatcher.release();
						_page.event_dispatcher = null;
					}
				};

				// -
				// イベントハンドラを作成
				// -
				_page.createEventHandler = function(type){
					return _page._event_dispatcher.createEventHandler(type);
				};

				// -
				// 発火
				// -
				_page.dispatchEvent = function(name,param){
					_page._event_dispatcher.dispatchEvent(name,param);
				};

				// -
				// 初期化
				// -
				(function(){
					_page.completed = false;
					_page.result = null;
					_page._event_dispatcher = new EventDispatcher();
					_page._filter = null;
				})();

				return _page;
			}

			// -
			// ハイパーリンクの置換用関数を実行
			// -
			_link_container.executeScript = function(callback){

				var info = {anchor_element:element};
				var filter = null;
				var filter_pos = 0;

				// 結果
				function response(r){
					if(r.result){
						callback({
							result:r,
							filter:filter
						});
						return;
					}
					execute();
				}

				// 失敗
				function failure(){
					callback({
						result:{result:false},
						filter:filter
					});
				}

				// 実行
				function execute(){
					filter = _filters[filter_pos];
					filter_pos += 1;
					if(!filter){
						failure();
						return;
					}

					var ary = filter.script;
					var i;
					var num = ary.length;
					if(num){
						for(i=0;i<num;i++){
							if(ary[i](info,response)){
								break;
							}
						}
						return;
					}
					execute();
				}

				if(_filters){
					execute();
					return;
				}
				failure();
			};

			// -
			// 結果を取得
			// -
			_link_container.getResult = function(callback){

				function executeScript(page){
					_link_container.executeScript(function(r){
						page.setFilter(r.filter);
						page.setResult(r.result);

						callback(page);

						// 初回実行
						if(!page.getCompleted()){
							page.setCompleted();

							// イベント発火
							if(page.getEnableCache()){
								page.dispatchEvent("complete",page);
							}else{
								page.dispatchEvent("execute",page);
							}

							// イベント開放
							page.releaseEventDispatcher();
						}
					});
				}

				var url = element.href;

				// ページを取得
				var page = _replacement_to_link_dictionary.getObject(url);

				// キャッシュ無し
				if(!page){
					// ページを登録
					page = createItem();
					_replacement_to_link_dictionary.setObject(url,page);

					// 初回実行
					executeScript(page);

				// 実行完了済み
				}else if(page.getCompleted()){

					if(page.getEnableCache()){
						callback(page);
					}else{
						executeScript(page);
					}

				// 実行完了待ち
				}else{
					// 実行イベント登録
					var event_handler = page.createEventHandler("execute");
					event_handler.setFunction(function(page){
						executeScript(page);
					});
					// 完了イベント登録
					var event_handler = page.createEventHandler("complete");
					event_handler.setFunction(function(page){
						callback(page);
					});
				}
			};

			// -
			// プライベート変数
			// -
			var _filters;

			// -
			// 初期化
			// -
			(function(){
				_filters = ProjectInstanceDefinesGetAllFiltersFromURL(_proj_ins.replacement_to_link,element.href);
			})();

			return _link_container;
		};

		// -
		// リンク置換用辞書
		// -
		function ReplacementToLinkDictionary(){
			var _this = this;

			// -
			// 開放
			// -
			_this.release = function(){
				_dictionary = null;
			};

			// -
			// オブジェクトを取得
			// -
			_this.getObject = function(key){
				return _dictionary[key];
			};

			// -
			// オブジェクトをセット
			// -
			_this.setObject = function(key,obj){
				_dictionary[key] = obj;
			};

			// -
			// プライベート変数
			// -
			var _dictionary;

			// -
			// 初期化
			// -
			_dictionary = new Object();
		}

		// -
		// リファラの置換が可能であるか取得
		// -
		_this.getEnableReplacementToReferer = function(){
			return _proj_ins.replacement_to_referer;
		};

		// -
		// ユーザーエージェントの置換が可能であるか取得
		// -
		_this.getEnableReplacementToUserAgent = function(){
			return _proj_ins.replacement_to_useragent;
		};

		// -
		// ハイパーリンク化が可能であるか取得
		// -
		_this.getEnableMakeLinkToText = function(){
			return _proj_ins.make_link_to_text;
		};

		// -
		// ハイパーリンク化用関数を実行
		// -
		_this.executeScriptMakeLinkToText = function(element,response){
			var info = {text_node:element};
			var ary = _proj_ins.make_link_to_text.script;
			var i;
			var num = ary.length;
			if(num){
				for(i=0;i<num;i++){
					if(ary[i](info,response)){
						break;
					}
				}
			}else{
				response({});
			}
		};

		// -
		// 短縮 URL の展開が可能であるか取得
		// -
		_this.getEnableExpandShortUrl = function(){
			return _proj_ins.expand_short_url;
		};

		// -
		// 短縮 URL の展開対象か調べる
		// -
		_this.checkExpandShortUrl = function(url){
			if(!(_proj_ins.expand_short_url)){
				return false;
			}

			var a = _proj_ins.expand_short_url.filter;
			var i;
			var num = a.length;
			for(i=0;i<num;i++){
				if(StringUrlMatchRegExpList(url,a[i])){
					return true;
				}
			}
			return false;
		};

		// -
		// BBSの展開が可能であるか取得
		// -
		_this.getEnableExpandBbs = function(){
			if(_proj_ins.expand_bbs){
				return true;
			}
			return false;
		};

		// -
		// 掲示板拡張ポップアップアニメーションが有効であるか取得
		// -
		_this.getEnableAnimationPopupBbsResponse = function(){
			return _proj_ins.expand_bbs.popup.enable_animation;
		};

		// -
		// 掲示板拡張ポップアップの表示座標系を取得
		// -
		_this.getOriginPopupExpandBbsResponse = function(){
			return _proj_ins.expand_bbs.popup.origin_type;
		};

		// -
		// 掲示板拡張ポップアップの表示基点を取得
		// -
		_this.getStylePositionPopupBbsResponse = function(){
			return _proj_ins.expand_bbs.popup.position_type;
		};

		// -
		// 掲示板拡張ポップアップの表示基点を取得
		// -
		_this.getPercentPopupBbsResponse = function(){
			return _proj_ins.expand_bbs.popup.percent;
		};

		// -
		// 掲示板拡張ポップアップの開くまでに待機する時間を取得
		// -
		_this.getTimeWaitOpenPopupExpandBbsResponse = function(){
			return _proj_ins.expand_bbs.popup.time_wait_open;
		};

		// -
		// 掲示板拡張ポップアップの閉じるまでに待機する時間を取得
		// -
		_this.getTimeWaitClosePopupExpandBbsResponse = function(){
			return _proj_ins.expand_bbs.popup.time_wait_close;
		};

		// -
		// 掲示板拡張レスポンスポップアップ表示のスタイルシート
		// -
		_this.getStyleSheetExpandBbsPopupResponse = function(){
			return _proj_ins.expand_bbs.popup.style_sheet;
		};

		// -
		// 掲示板拡張用初期化関数
		// -
		_this.initializeScriptCallbackExpandBbs = function(response){
			var info = {work:expand_bbs.work};
			var ary = _proj_ins.expand_bbs.script_initialize;
			var i;
			var num = ary.length;
			for(i=0;i<num;i++){
				if(ary[i](info,response)){
					break;
				}
			}
		};

		// -
		// 掲示板拡張用コールバック関数
		// -
		_this.executeScriptCallbackExpandBbs = function(element,response){
			var info = {element:element,work:expand_bbs.work};
			var ary = _proj_ins.expand_bbs.script_callback;
			var i;
			var num = ary.length;
			if(num){
				for(i=0;i<num;i++){
					if(ary[i](info,response)){
						break;
					}
				}
			}else{
				response({useful:false});
			}
		};

		// -
		// テキストの展開が可能であるか取得
		// -
		_this.getEnableExpandText = function(){
			return _proj_ins.expand_text;
		};

		// -
		// 同一のテキストはインライン展開しない
		// -
		_this.getDisableSameInlineText = function(){
			if(_proj_ins.expand_text){
				return _proj_ins.expand_text.inline.disable_same_text;
			}
			return false;
		};

		// -
		//テキストのインライン展開を許可するかコールバック関数
		// -
		_this.executeScriptAllowInlineText = function(element,url,content_type,response){
			var info = {anchor_element:element,current_element:element,url:url,content_type:content_type};
			var ary = _proj_ins.expand_text.inline.script_allow;
			var i;
			var num = ary.length;
			if(num){
				for(i=0;i<num;i++){
					if(ary[i](info,response)){
						break;
					}
				}
			}else{
				response({result:false});
			}
		};

		// -
		// テキストのインライン展開の挿入コールバック実行
		// -
		_this.executeScriptInsertInlineText = function(element,textarea,event_dispatcher,response){
			var info = {anchor_element:element,current_element:element,textarea_element:textarea,event_dispatcher:event_dispatcher};
			var ary = _proj_ins.expand_text.inline.script_insert;
			var i;
			var num = ary.length;
			if(num){
				for(i=0;i<num;i++){
					if(ary[i](info,response)){
						break;
					}
				}
			}else{
				response();
			}
		};

		// -
		// イメージの展開が可能であるか取得
		// -
		_this.getEnableExpandImage = function(){
			return _proj_ins.expand_image;
		};

		// -
		// 同一の画像はサムネイル化しない
		// -
		_this.getDisableSameThumbnailImage = function(){
			if(_proj_ins.expand_image){
				return _proj_ins.expand_image.thumbnail.disable_same_image;
			}
			return false;
		};

		// -
		// ポップアップイメージを表示するか取得
		// -
		_this.getEnablePopupImage = function(){
			if(_proj_ins.expand_image){
				return _proj_ins.expand_image.popup.enable_popup_mouseover;
			}
			return false;
		};

		// -
		// ポップアップアニメーションが有効であるか取得
		// -
		_this.getEnableAnimationPopupImage = function(){
			if(_proj_ins.expand_image.popup.enable_animation_scale)	return true;
			if(_proj_ins.expand_image.popup.enable_animation_alpha)	return true;
			return false;
		};

		// -
		// ポップアップアニメーションが有効であるか取得(スケール)
		// -
		_this.getEnableScaleAnimationPopupImage = function(){
			return _proj_ins.expand_image.popup.enable_animation_scale;
		};

		// -
		// ポップアップアニメーションが有効であるか取得(アルファ)
		// -
		_this.getEnableAlphaAnimationPopupImage = function(){
			return _proj_ins.expand_image.popup.enable_animation_alpha;
		};

		// -
		// サムネイルイメージを表示するか取得
		// -
		_this.getEnableThumbnailImage = function(){
			if(_proj_ins.expand_image){
				return _proj_ins.expand_image.thumbnail.enable_thumbnail;
			}
			return false;
		};

		// -
		// サムネイルイメージをポップアップ化するか取得
		// -
		_this.getEnablePopupMouseoverToThumbnailImage = function(){
			return _proj_ins.expand_image.thumbnail.enable_popup_mouseover;
		};

		// -
		// サムネイルイメージの表示拡大率を取得
		// -
		_this.getScalePercentThumbnailImage = function(){
			return _proj_ins.expand_image.thumbnail.scale_percent;
		};

		// -
		// サムネイルイメージの最小許容限界値を取得
		// -
		_this.getWidthMinThumbnailImage = function(){
			return _proj_ins.expand_image.thumbnail.width_min;
		};

		// -
		// サムネイルイメージの最大許容限界値を取得
		// -
		_this.getWidthMaxThumbnailImage = function(){
			return _proj_ins.expand_image.thumbnail.width_max;
		};

		// -
		// イメージのサムネイル展開を許可するかコールバック関数
		// -
		_this.executeScriptAllowThumbnailImage = function(request,response){
			var info = {
				anchor_element:request.element,
				current_element:request.element,
				url:request.url,
				content_type:request.content_type,
				is_overridden_url:request.is_overridden_url
			};
			var ary = _proj_ins.expand_image.thumbnail.script_allow;
			var i;
			var num = ary.length;
			if(num){
				for(i=0;i<num;i++){
					if(ary[i](info,response)){
						break;
					}
				}
			}else{
				response({result:false});
			}
		};

		// -
		// サムネイルイメージの挿入コールバック実行
		// -
		_this.executeScriptInsertThumbnailImage = function(element,image,event_dispatcher,response){
			var info = {anchor_element:element,current_element:element,image_element:image,event_dispatcher:event_dispatcher};
			var ary = _proj_ins.expand_image.thumbnail.script_insert;
			var i;
			var num = ary.length;
			if(num){
				for(i=0;i<num;i++){
					if(ary[i](info,response)){
						break;
					}
				}
			}else{
				response();
			}
		};

		// -
		// サムネイルイメージのプリロード設定を取得
		// -
		_this.getEnablePreLoadThumbnailImage = function(){
			if(_proj_ins.expand_image.thumbnail.load_type == "preload")	return true;
			return false;
		};

		// -
		// ポップアップイメージのプリロード設定を取得
		// -
		_this.getEnablePreLoadPopupImage = function(){
			if(_proj_ins.expand_image.popup.load_type == "preload")	return true;
			return false;
		};

		// -
		// ポップアップイメージの表示座標系を取得
		// -
		_this.getOriginPopupImage = function(){
			return _proj_ins.expand_image.popup.origin_type;
		};

		// -
		// ポップアップイメージの表示基点を取得
		// -
		_this.getStylePositionPopupImage = function(){
			return _proj_ins.expand_image.popup.position_type;
		};

		// -
		// ポップアップイメージの表示サイズを取得
		// -
		_this.getScalePercentPopupImage = function(){
			return _proj_ins.expand_image.popup.scale_percent;
		};

		// -
		// ポップアップイメージを開くまでに待機する時間を取得
		// -
		_this.getTimeWaitOpenPopupImage = function(){
			return _proj_ins.expand_image.popup.time_wait_open;
		};

		// -
		// ポップアップイメージを閉じるまでに待機する時間を取得
		// -
		_this.getTimeWaitClosePopupImage = function(){
			return _proj_ins.expand_image.popup.time_wait_close;
		};

		// -
		// イメージのポップアップ展開を許可するかコールバック関数
		// -
		_this.executeScriptAllowPopupImage = function(request,response){
			var info = {
				anchor_element:request.element,
				current_element:request.element,
				url:request.url,
				content_type:request.content_type,
				is_overridden_url:request.is_overridden_url
			};
			var ary = _proj_ins.expand_image.popup.script_allow;
			var i;
			var num = ary.length;
			if(num){
				for(i=0;i<num;i++){
					if(ary[i](info,response)){
						break;
					}
				}
			}else{
				response({result:false});
			}
		};

		// -
		// 縮小イメージのポップアップが可能であるか取得
		// -
		_this.getEnablePopupReducedImage = function(){
			if(_proj_ins.expand_image){
				return _proj_ins.expand_image.reduced_image.enable_popup;
			}
			return false;
		};

		// -
		// 縮小イメージのポップアップが有効となる縮小値
		// -
		_this.getScaleLessThenAllowPopupReducedImage = function(){
			if(_proj_ins.expand_image){
				return _proj_ins.expand_image.reduced_image.popup_allow_slcale_less_then;
			}
			return false;
		};

		// -
		// イメージのロード通知が有効であるか取得
		// -
		_this.getEnableLoadNotifyExpandImage = function(){
			if(_proj_ins.expand_image){
				return _proj_ins.expand_image.load.enable_notify;
			}
			return false;
		};

		// -
		// イメージのソースタイプを取得
		// -
		_this.getSourceLoadExpandImage = function(){
			if(_proj_ins.expand_image){
				return _proj_ins.expand_image.load.src_type;
			}
			return "mixed_content";
		};

		// -
		// イメージのアンロードが有効であるか取得
		// -
		_this.getEnableUnloadExpandImage = function(){
			if(_proj_ins.expand_image){
				return _proj_ins.expand_image.load.enable_unload;
			}
			return false;
		};

		// -
		// イメージのアンロードサイズを取得
		// -
		_this.getSizeMoreThenAllowUnloadExpandImage = function(){
			if(_proj_ins.expand_image){
				return _proj_ins.expand_image.load.unload_allow_size_more_then;
			}
			return false;
		};

		// -
		// サウンドの展開が可能であるか取得
		// -
		_this.getEnableExpandSound = function(){
			return _proj_ins.expand_sound;
		};

		// -
		// 同一のオーディオはインライン展開しない
		// -
		_this.getDisableSameInlineSound = function(){
			if(_proj_ins.expand_sound){
				return _proj_ins.expand_sound.inline.disable_same_audio;
			}
			return false;
		};

		// -
		// インライン表示オーディオの最大表示数
		// -
		_this.getSoundMaxInlineSound = function(){
			if(_proj_ins.expand_sound){
				return _proj_ins.expand_sound.inline.sound_max;
			}
			return 0;
		};

		// -
		//オーディオのインライン展開を許可するかコールバック関数
		// -
		_this.executeScriptAllowInlineSound = function(request,response){
			var info = {
				anchor_element:request.element,
				current_element:request.element,
				url:request.url,
				content_type:request.content_type,
				is_overridden_url:request.is_overridden_url
			};
			var ary = _proj_ins.expand_sound.inline.script_allow;
			var i;
			var num = ary.length;
			if(num){
				for(i=0;i<num;i++){
					if(ary[i](info,response)){
						break;
					}
				}
			}else{
				response({result:false});
			}
		};

		// -
		// オーディオのインライン展開の挿入コールバック実行
		// -
		_this.executeScriptInsertInlineSound = function(element,audio,event_dispatcher,response){
			var info = {anchor_element:element,current_element:element,element:audio,event_dispatcher:event_dispatcher};
			var ary = _proj_ins.expand_sound.inline.script_insert;
			var i;
			var num = ary.length;
			if(num){
				for(i=0;i<num;i++){
					if(ary[i](info,response)){
						break;
					}
				}
			}else{
				response();
			}
		};

		// -
		// AudioElement の展開を許可するかコールバック関数
		// -
		_this.executeScriptAllowAudioElement = function(element,url,content_type,response){
			var info = {anchor_element:element,current_element:element,url:url,content_type:content_type};
			var ary = _proj_ins.expand_sound.audio_element.script_allow;
			var i;
			var num = ary.length;
			if(num){
				for(i=0;i<num;i++){
					if(ary[i](info,response)){
						break;
					}
				}
			}else{
				response({result:false});
			}
		};

		// -
		// SoundCloud のプレイヤー (HTML5 版) を表示するか
		// -
		_this.getVisiblePlayerHtml5Soundcloud = function(){
			return _proj_ins.expand_sound.soundcloud.visible_player_html5;
		};

		// -
		// MixCloud のプレイヤーを表示するか
		// -
		_this.getVisiblePlayerMixcloud = function(){
			return _proj_ins.expand_sound.mixcloud.visible_player;
		};

		// -
		// ビデオの展開が可能であるか取得
		// -
		_this.getEnableExpandVideo = function(){
			return _proj_ins.expand_video;
		};

		// -
		// 同一のビデオはインライン展開しない
		// -
		_this.getDisableSameInlineVideo = function(){
			if(_proj_ins.expand_video){
				return _proj_ins.expand_video.inline.disable_same_video;
			}
			return false;
		};

		// -
		// インライン表示ビデオの最大表示数
		// -
		_this.getVideoMaxInlineVideo = function(){
			if(_proj_ins.expand_video){
				return _proj_ins.expand_video.inline.video_max;
			}
			return 0;
		};

		// -
		// ビデオのインライン展開を許可するかコールバック関数
		// -
		_this.executeScriptAllowInlineVideo = function(request,response){
			var info = {
				anchor_element:request.element,
				current_element:request.element,
				url:request.url,
				content_type:request.content_type,
				is_overridden_url:request.is_overridden_url
			};
			var ary = _proj_ins.expand_video.inline.script_allow;
			var i;
			var num = ary.length;
			if(num){
				for(i=0;i<num;i++){
					if(ary[i](info,response)){
						break;
					}
				}
			}else{
				response({result:false});
			}
		};

		// -
		// ビデオのインライン展開の挿入コールバック実行
		// -
		_this.executeScriptInsertInlineVideo = function(element,video,event_dispatcher,response){
			var info = {anchor_element:element,current_element:element,element:video,event_dispatcher:event_dispatcher};
			var ary = _proj_ins.expand_video.inline.script_insert;
			var i;
			var num = ary.length;
			if(num){
				for(i=0;i<num;i++){
					if(ary[i](info,response)){
						break;
					}
				}
			}else{
				response();
			}
		};

		// -
		// VideoElement の展開を許可するかコールバック関数
		// -
		_this.executeScriptAllowVideoElement = function(element,url,content_type,response){
			var info = {anchor_element:element,current_element:element,url:url,content_type:content_type};
			var ary = _proj_ins.expand_video.video_element.script_allow;
			var i;
			var num = ary.length;
			if(num){
				for(i=0;i<num;i++){
					if(ary[i](info,response)){
						break;
					}
				}
			}else{
				response({result:false});
			}
		};

		// -
		// youtube のビデオを表示するか
		// -
		_this.getVisibleVideoYoutube = function(){
			return _proj_ins.expand_video.youtube.visible_video;
		};

		// -
		// nicovideo のビデオを表示するか
		// -
		_this.getVisibleVideoNicovideo = function(){
			return _proj_ins.expand_video.nicovideo.visible_video;
		};

		// -
		// nicovideo のビデオサムネイルを表示するか
		// -
		_this.getVisibleThumbnailVideoNicovideo = function(){
			return _proj_ins.expand_video.nicovideo.visible_thumbnail_video;
		};

		// -
		// nicovideo のマイリストサムネイルを表示するか
		// -
		_this.getVisibleThumbnailMylistNicovideo = function(){
			return _proj_ins.expand_video.nicovideo.visible_thumbnail_mylist;
		};

		// -
		// nicovideo のユーザーサムネイルを表示するか
		// -
		_this.getVisibleThumbnailUserNicovideo = function(){
			return _proj_ins.expand_video.nicovideo.visible_thumbnail_user;
		};

		// -
		// nicovideo のコミュニティサムネイルを表示するか
		// -
		_this.getVisibleThumbnailCommunityNicovideo = function(){
			return _proj_ins.expand_video.nicovideo.visible_thumbnail_community;
		};

		// -
		// nicovideo の生放送サムネイルを表示するか
		// -
		_this.getVisibleThumbnailLiveNicovideo = function(){
			return _proj_ins.expand_video.nicovideo.visible_thumbnail_live;
		};

		// -
		// nicovideo の静画サムネイルを表示するか
		// -
		_this.getVisibleThumbnailSeigaNicovideo = function(){
			return _proj_ins.expand_video.nicovideo.visible_thumbnail_seiga;
		};

		// -
		// dailymotion の録画ビデオを表示するか
		// -
		_this.getVisibleVideoDailymotion = function(){
			return _proj_ins.expand_video.dailymotion.visible_video;
		};

		// -
		// vimeo の録画ビデオを表示するか
		// -
		_this.getVisibleVideoVimeo = function(){
			return _proj_ins.expand_video.vimeo.visible_video;
		};

		// -
		// fc2video の録画ビデオを表示するか
		// -
		_this.getVisibleVideoFc2video = function(){
			return _proj_ins.expand_video.fc2video.visible_video;
		};

		// -
		// LiveLeak の録画ビデオを表示するか
		// -
		_this.getVisibleVideoLiveleak = function(){
			return _proj_ins.expand_video.liveleak.visible_video;
		};

		// -
		// テキストインライン表示のスタイルシート
		// -
		_this.getStyleSheetExpandTextInline = function(){
			if(_proj_ins.style_sheet){
				return _proj_ins.style_sheet.expand_text.inline;
			}
			return "";
		};

		// -
		// サムネイルイメージのスタイルシート
		// -
		_this.getStyleSheetExpandImageThumbnail = function(){
			if(_proj_ins.style_sheet){
				return _proj_ins.style_sheet.expand_image.thumbnail;
			}
			return "";
		};

		// -
		// ポップアップイメージのスタイルシート
		// -
		_this.getStyleSheetExpandImagePopup = function(){
			if(_proj_ins.style_sheet){
				return _proj_ins.style_sheet.expand_image.popup;
			}
			return "";
		};

		// -
		// サウンドインライン表示のスタイルシート
		// -
		_this.getStyleSheetExpandSoundInlineAudioElement = function(){
			if(_proj_ins.style_sheet){
				return _proj_ins.style_sheet.expand_sound.inline.audio_element.audio;
			}
			return "";
		};

		// -
		// SoundCloud インライン表示 HTML5 版プレイヤーのスタイルシート
		// -
		_this.getStyleSheetExpandSoundSoundcloudInlinePlayerHtml5 = function(){
			if(_proj_ins.style_sheet){
				return _proj_ins.style_sheet.expand_sound.inline.soundcloud.player_html5;
			}
			return "";
		};

		// -
		// MixCloud インライン表示プレイヤーのスタイルシート
		// -
		_this.getStyleSheetExpandSoundMixcloudInlinePlayer = function(){
			if(_proj_ins.style_sheet){
				return _proj_ins.style_sheet.expand_sound.inline.mixcloud.player;
			}
			return "";
		};

		// -
		// ビデオインライン表示のスタイルシート
		// -
		_this.getStyleSheetExpandVideoInlineVideoElement = function(){
			if(_proj_ins.style_sheet){
				return _proj_ins.style_sheet.expand_video.inline.video_element.video;
			}
			return "";
		};

		// -
		// youtube インライン表示ビデオのスタイルシート
		// -
		_this.getStyleSheetExpandVideoYoutubeInlineVideo = function(){
			if(_proj_ins.style_sheet){
				return _proj_ins.style_sheet.expand_video.inline.youtube.video;
			}
			return "";
		};

		// -
		// nicovideo ビデオのインライン表示のスタイルシート
		// -
		_this.getStyleSheetExpandVideoNicovideoInlineVideo = function(){
			if(_proj_ins.style_sheet){
				return _proj_ins.style_sheet.expand_video.inline.nicovideo.video;
			}
			return "";
		};

		// -
		// nicovideo ビデオサムネイルのインライン表示のスタイルシート
		// -
		_this.getStyleSheetExpandVideoNicovideoInlineThumbnailVideo = function(){
			if(_proj_ins.style_sheet){
				return _proj_ins.style_sheet.expand_video.inline.nicovideo.thumbnail_video;
			}
			return "";
		};

		// -
		// nicovideo マイリストサムネイルのインライン表示のスタイルシート
		// -
		_this.getStyleSheetExpandVideoNicovideoInlineThumbnailMylist = function(){
			if(_proj_ins.style_sheet){
				return _proj_ins.style_sheet.expand_video.inline.nicovideo.thumbnail_mylist;
			}
			return "";
		};

		// -
		// nicovideo ユーザーサムネイルのインライン表示のスタイルシート
		// -
		_this.getStyleSheetExpandVideoNicovideoInlineThumbnailUser = function(){
			if(_proj_ins.style_sheet){
				return _proj_ins.style_sheet.expand_video.inline.nicovideo.thumbnail_user;
			}
			return "";
		};

		// -
		// nicovideo コミュニティサムネイルのインライン表示のスタイルシート
		// -
		_this.getStyleSheetExpandVideoNicovideoInlineThumbnailCommunity = function(){
			if(_proj_ins.style_sheet){
				return _proj_ins.style_sheet.expand_video.inline.nicovideo.thumbnail_community;
			}
			return "";
		};

		// -
		// nicovideo 生放送サムネイルのインライン表示のスタイルシート
		// -
		_this.getStyleSheetExpandVideoNicovideoInlineThumbnailLive = function(){
			if(_proj_ins.style_sheet){
				return _proj_ins.style_sheet.expand_video.inline.nicovideo.thumbnail_live;
			}
			return "";
		};

		// -
		// nicovideo 静画サムネイルのインライン表示のスタイルシート
		// -
		_this.getStyleSheetExpandVideoNicovideoInlineThumbnailSeiga = function(){
			if(_proj_ins.style_sheet){
				return _proj_ins.style_sheet.expand_video.inline.nicovideo.thumbnail_seiga;
			}
			return "";
		};

		// -
		// dailymotion インライン表示ビデオのスタイルシート
		// -
		_this.getStyleSheetExpandVideoDailymotionInlineVideo  = function(){
			if(_proj_ins.style_sheet){
				return _proj_ins.style_sheet.expand_video.inline.dailymotion.video;
			}
			return "";
		};

		// -
		// vimeo インライン表示ビデオのスタイルシート
		// -
		_this.getStyleSheetExpandVideoVimeoInlineVideo = function(){
			if(_proj_ins.style_sheet){
				return _proj_ins.style_sheet.expand_video.inline.vimeo.video;
			}
			return "";
		};

		// -
		// fc2video インライン表示ビデオのスタイルシート
		// -
		_this.getStyleSheetExpandVideoFc2videoInlineVideo = function(){
			if(_proj_ins.style_sheet){
				return _proj_ins.style_sheet.expand_video.inline.fc2video.video;
			}
			return "";
		};

		// -
		// LiveLeak インライン表示ビデオのスタイルシート
		// -
		_this.getStyleSheetExpandVideoLiveleakInlineVideo = function(){
			if(_proj_ins.style_sheet){
				return _proj_ins.style_sheet.expand_video.inline.liveleak.video;
			}
			return "";
		};

		// -
		// インラインフレームのインライン表示のスタイルシート
		// -
		_this.getStyleSheetExpandIframeInline = function(){
			if(_proj_ins.style_sheet){
				return _proj_ins.style_sheet.expand_iframe.inline;
			}
			return "";
		};

		// -
		// インラインフレームの展開が可能であるか取得
		// -
		_this.getEnableExpandIframe = function(){
			return _proj_ins.expand_iframe;
		};

		// -
		// 同一のインラインフレームはインライン展開しない
		// -
		_this.getDisableSameInlineIframe = function(){
			if(_proj_ins.expand_iframe){
				return _proj_ins.expand_iframe.inline.disable_same_iframe;
			}
			return false;
		};

		// -
		// インラインフレームのインライン展開を許可するかコールバック関数
		// -
		_this.executeScriptAllowInlineIframe = function(element,url,content_type,response){
			var info = {anchor_element:element,current_element:element,url:url,content_type:content_type};
			var ary = _proj_ins.expand_iframe.inline.script_allow;
			var i;
			var num = ary.length;
			if(num){
				for(i=0;i<num;i++){
					if(ary[i](info,response)){
						break;
					}
				}
			}else{
				response({result:false});
			}
		};

		// -
		// インラインフレームのインライン展開の挿入コールバック実行
		// -
		_this.executeScriptInsertInlineIframe = function(element,iframe,event_dispatcher,response){
			var info = {anchor_element:element,current_element:element,iframe_element:iframe,event_dispatcher:event_dispatcher};
			var ary = _proj_ins.expand_iframe.inline.script_insert;
			var i;
			var num = ary.length;
			if(num){
				for(i=0;i<num;i++){
					if(ary[i](info,response)){
						break;
					}
				}
			}else{
				response();
			}
		};

		// -
		// プライベート変数
		// -
		var _proj_src;
		var _proj_ins;
		var _replacement_to_link_dictionary;

		// -
		// 初期化
		// -
		(function(){
			_replacement_to_link_dictionary = new ReplacementToLinkDictionary();
		})();
	}

	// -
	// 基本設定をインスタンス化
	// -
	function ProjectObjectInstantiateStandard(src){
		return src;
	}

	// -
	// 掲示板拡張をインスタンス化
	// -
	function ProjectObjectInstantiateExpandBbs(src){
		var ins = ObjectCopy(src);
		ins.script_initialize = PageExpandProjectScriptObject_EvalArrayFunction(ins.script_initialize);
		ins.script_callback = PageExpandProjectScriptObject_EvalArrayFunction(ins.script_callback);
		return ins;
	}

	// -
	// アクセス遮断をインスタンス化
	// -
	function ProjectObjectInstantiateAccessBlock(src){
		return {
			filter:ProjectObjectInstantiateUrlEditContainer(src.filter)
		};
	}

	// -
	// エレメント置換をインスタンス化
	// -
	function ProjectObjectInstantiateReplacementToElement(src){
		return {
			script:PageExpandProjectScriptObject_EvalArrayFunction(src.script)
		};

	}

	// -
	// テキスト置換をインスタンス化
	// -
	function ProjectObjectInstantiateReplacementToText(src){
		return {
			script:PageExpandProjectScriptObject_EvalArrayFunction(src.script)
		};
	}

	// -
	// アンカー置換をインスタンス化
	// -
	function ProjectObjectInstantiateReplacementToAnchor(src){
		return {
			script:PageExpandProjectScriptObject_EvalArrayFunction(src.script)
		};
	}

	// -
	// ハイパーリンク置換をインスタンス化
	// -
	function ProjectObjectInstantiateReplacementToLink(src){
		var i;
		var filter_src;
		var filter_ins = new Array();
		var filters = src.filter;
		var filter_num = filters.length;
		for(i=0;i<filter_num;i++){
			filter_src = filters[i];
			filter_ins[i] = {
				filter:ProjectObjectInstantiateUrlEditContainer(filter_src.filter),
				enable_reflect_to_anchor:filter_src.enable_reflect_to_anchor,
				enable_cache:filter_src.enable_cache,
				script:PageExpandProjectScriptObject_EvalArrayFunction(filter_src.script)
			};
		}
		return {
			filter:filter_ins
		};
	}

	// -
	// リファラ置換をインスタンス化
	// -
	function ProjectObjectInstantiateReplacementToReferer(src){
		var i;
		var filter_src;
		var filter_ins = new Array();
		var filters = src.filter;
		var filter_num = filters.length;
		for(i=0;i<filter_num;i++){
			filter_src = filters[i];
			filter_ins[i] = {
				filter:ProjectObjectInstantiateUrlEditContainer(filter_src.filter),
				send_referer:filter_src.send_referer
			};
		}
		return {
			filter:filter_ins
		};
	}

	// -
	// ユーザーエージェント置換をインスタンス化
	// -
	function ProjectObjectInstantiateReplacementToUseragent(src){
		var i;
		var filter_src;
		var filter_ins = new Array();
		var filters = src.filter;
		var filter_num = filters.length;
		for(i=0;i<filter_num;i++){
			filter_src = filters[i];
			filter_ins[i] = {
				filter:ProjectObjectInstantiateUrlEditContainer(filter_src.filter),
				send_useragent:filter_src.send_useragent
			};
		}
		return {
			filter:filter_ins
		};
	}

	// -
	// ハイパーリンク化をインスタンス化
	// -
	function ProjectObjectInstantiateMakeLinkToText(src){
		return {
			script:PageExpandProjectScriptObject_EvalArrayFunction(src.script)
		};
	}

	// -
	// 短縮 URL の展開をインスタンス化
	// -
	function ProjectObjectInstantiateExpandShortUrl(src){
		return {
			filter:ProjectObjectInstantiateUrlEditContainer(src.filter)
		};
	}

	// -
	// テキストの展開をインスタンス化
	// -
	function ProjectObjectInstantiateExpandText(src){
		var ins = ObjectCopy(src);
		ins.inline.script_allow = PageExpandProjectScriptObject_EvalArrayFunction(ins.inline.script_allow);
		ins.inline.script_insert = PageExpandProjectScriptObject_EvalArrayFunction(ins.inline.script_insert);
		return ins;
	}

	// -
	// イメージの展開をインスタンス化
	// -
	function ProjectObjectInstantiateExpandImage(src){
		var ins = ObjectCopy(src);
		ins.thumbnail.script_allow = PageExpandProjectScriptObject_EvalArrayFunction(ins.thumbnail.script_allow);
		ins.thumbnail.script_insert = PageExpandProjectScriptObject_EvalArrayFunction(ins.thumbnail.script_insert);
		ins.popup.script_allow = PageExpandProjectScriptObject_EvalArrayFunction(ins.popup.script_allow);
		return ins;
	}

	// -
	// サウンドの展開をインスタンス化
	// -
	function ProjectObjectInstantiateExpandSound(src){
		var ins = ObjectCopy(src);
		ins.inline.script_allow = PageExpandProjectScriptObject_EvalArrayFunction(ins.inline.script_allow);
		ins.inline.script_insert = PageExpandProjectScriptObject_EvalArrayFunction(ins.inline.script_insert);
		ins.audio_element.script_allow = PageExpandProjectScriptObject_EvalArrayFunction(ins.audio_element.script_allow);
		return ins;
	}

	// -
	// ビデオの展開をインスタンス化
	// -
	function ProjectObjectInstantiateExpandVideo(src){
		var ins = ObjectCopy(src);
		ins.inline.script_allow = PageExpandProjectScriptObject_EvalArrayFunction(ins.inline.script_allow);
		ins.inline.script_insert = PageExpandProjectScriptObject_EvalArrayFunction(ins.inline.script_insert);
		ins.video_element.script_allow = PageExpandProjectScriptObject_EvalArrayFunction(ins.video_element.script_allow);
		return ins;
	}

	// -
	// インラインフレームの展開をインスタンス化
	// -
	function ProjectObjectInstantiateExpandIframe(src){
		var ins = ObjectCopy(src);
		ins.inline.script_allow = PageExpandProjectScriptObject_EvalArrayFunction(ins.inline.script_allow);
		ins.inline.script_insert = PageExpandProjectScriptObject_EvalArrayFunction(ins.inline.script_insert);
		return ins;
	}

	// -
	// スタイルシートをインスタンス化
	// -
	function ProjectObjectInstantiateStyleSheet(src){
		return src;
	}

	// -
	// 試験運用をインスタンス化
	// -
	function ProjectObjectInstantiateExperimental(src){
		return src;
	}

	// -
	// URLエディットコンテナをインスタンス化
	// -
	function ProjectObjectInstantiateUrlEditContainer(src){
		var filter_ins = new Array();
		var filter_src;
		var filter_num;
		var j;

		switch(src.type){
		case "asterisk":
			filter_src = src.asterisk.filter;
			filter_num = filter_src.length;
			for(j=0;j<filter_num;j++){
				filter_ins[j] = StringRegExpListFromAsteriskWord(filter_src[j]);
			}
			break;
		case "regexp":
			filter_src = src.regexp.filter;
			filter_num = filter_src.length;
			for(j=0;j<filter_num;j++){
				filter_ins[j] = [RegExpObjectGetRegExp(filter_src[j])];
			}
			break;
		}

		return filter_ins;
	}

	// -
	// プロジェクトの定義リストからフィルタを取得
	// -
	function ProjectInstanceDefinesGetFilterFromURL (defines,url){
		var i;
		var j;
		var k;
		var filters;
		var filter;
		var filter_num;
		var url_filters;
		var url_filter_num;
		var define;
		var define_num = defines.length;
		for(i=0;i<define_num;i++){
			define = defines[i];
			filters = define.filter;
			filter_num = filters.length;
			for(j=0;j<filter_num;j++){
				filter = filters[j];
				url_filters = filter.filter;
				url_filter_num = url_filters.length;
				for(k=0;k<url_filter_num;k++){
					if(StringUrlMatchRegExpList(url,url_filters[k])){
						return filter;
					}
				}
			}
		}
		return null;
	}

	// -
	// プロジェクトの定義リストからすべてのフィルタを取得
	// -
	function ProjectInstanceDefinesGetAllFiltersFromURL (defines,url){
		var ary = new Array();
		var i;
		var j;
		var k;
		var filters;
		var filter;
		var filter_num;
		var url_filters;
		var url_filter_num;
		var define;
		var define_num = defines.length;
		for(i=0;i<define_num;i++){
			define = defines[i];
			filters = define.filter;
			filter_num = filters.length;
			for(j=0;j<filter_num;j++){
				filter = filters[j];
				url_filters = filter.filter;
				url_filter_num = url_filters.length;
				for(k=0;k<url_filter_num;k++){
					if(StringUrlMatchRegExpList(url,url_filters[k])){
						ary.push(filter);
						break;
					}
				}
			}
		}
		return ary;
	}

	// -
	// プロジェクトオブジェクトに掲示板拡張をインポート
	// -
	function PageExpandProjectObjectImportExpandBbs(proj_obj,user_obj,asset){
		if(user_obj.version === undefined)	return;
		if(!(user_obj.expand_bbs))	return;

		var preset_obj = PageExpandProjectObjectUpdate(null,{version:user_obj.version});

		var user_dictionary = new Object();
		var preset_dictionary = new Object();
		var proj_dictionary = new Object();
		var user_asset = new Array();

		// ユーザー辞書
		(function(){
			var expand_bbs = user_obj.expand_bbs;
			var num = expand_bbs.length;
			var i;
			for(i=0;i<num;i++){
				var o = expand_bbs[i];
				if(o.id !== undefined){
					user_dictionary[o.id] = o;
					if(o.user){
						user_asset.push(o.id);
					}
				}
			}
		})();

		// プリセット辞書
		(function(){
			var expand_bbs = preset_obj.expand_bbs;
			var num = expand_bbs.length;
			var i;
			for(i=0;i<num;i++){
				var o = expand_bbs[i];
				if(o.id !== undefined){
					preset_dictionary[o.id] = o;
				}
			}
		})();

		// ユーザー設定をプリセット設定にマージ
		(function(){
			var expand_bbs = preset_obj.expand_bbs;
			var num = expand_bbs.length;
			var i;
			for(i=0;i<num;i++){
				var o = expand_bbs[i];
				if(user_dictionary[o.id]){
					o.user = user_dictionary[o.id].user;
				}
			}

			var user_id;
			for(user_id in user_dictionary){
				if(!(preset_dictionary[user_id])){
					expand_bbs.push(user_dictionary[user_id]);
				}
			}
			preset_obj = PageExpandProjectObjectUpdate(preset_obj,null);
		})();

		// プロジェクト辞書
		(function(){
			var expand_bbs = preset_obj.expand_bbs;
			var num = expand_bbs.length;
			var i;
			for(i=0;i<num;i++){
				var o = expand_bbs[i];
				if(o.id !== undefined){
					proj_dictionary[o.id] = o;
				}
			}
		})();

		// プロジェクトにインポート
		(function(){
			var expand_bbs = proj_obj.expand_bbs;
			var define_dictionary = new Object();

			var i;
			var num = expand_bbs.length;
			for(i=0;i<num;i++){
				var d = expand_bbs[i];
				define_dictionary[d.id] = d;
			}

			num = user_asset.length;
			for(i=num-1;i>=0;i--){
				var d = proj_dictionary[user_asset[i]];
				if(d.preset){
					define_dictionary[d.id].user = d.user;
				}else{
					var user_id = PageExpandProjectObjectDefineGenerateNewUserId(proj_obj.expand_bbs);
					expand_bbs.unshift(d);
					d.id = user_id;
				}
			}
		})();
	}

	// -
	// プロジェクトオブジェクトに定義をインポート
	// -
	function PageExpandProjectObjectImportDefine(proj_obj,user_obj,asset){
		if(user_obj.version === undefined)	return;

		var preset_obj = PageExpandProjectObjectUpdate(null,{version:user_obj.version});

		var user_dictionary = new Object();
		var preset_dictionary = new Object();
		var proj_dictionary = new Object();
		var user_asset = new Object();

		// ユーザー辞書
		(function(){
			var p;
			for(p in user_obj){
				var a = user_obj[p];
				if((a) && (typeof(a) == "object")){
					if(a.constructor == Array){
						user_dictionary[p] = new Object();
						var ary = new Array();
						var i;
						var num = a.length;
						for(i=0;i<num;i++){
							var o = a[i];
							if(o.id !== undefined){
								user_dictionary[p][o.id] = o;
								if(o.user){
									ary.push(o.id);
								}
							}
						}
						if(ary.length){
							user_asset[p] = ary;
						}
					}
				}
			}
		})();

		// 更新なし
		if(!(user_asset[asset])){
			return;
		}

		// プリセット辞書
		(function(){
			var p;
			for(p in preset_obj){
				var a = preset_obj[p];
				if((a) && (typeof(a) == "object")){
					if(a.constructor == Array){
						preset_dictionary[p] = new Object();
						var i;
						var num = a.length;
						for(i=0;i<num;i++){
							var o = a[i];
							if(o.id !== undefined){
								preset_dictionary[p][o.id] = o;
							}
						}
					}
				}
			}
		})();

		// ユーザー設定をプリセット設定にマージ
		(function(){
			var p;
			for(p in preset_obj){
				var a = preset_obj[p];
				if((a) && (typeof(a) == "object")){
					if(a.constructor == Array){
						if(!user_asset[p])	continue;

						var i;
						var num = a.length;
						for(i=0;i<num;i++){
							var o = a[i];
							if(user_dictionary[p][o.id]){
								o.user = user_dictionary[p][o.id].user;
							}
						}

						var user_obj = user_dictionary[p];
						var user_id;
						for(user_id in user_obj){
							if(!(preset_dictionary[p][user_id])){
								a.push(user_obj[user_id]);
							}
						}
					}
				}
			}

			preset_obj = PageExpandProjectObjectUpdate(preset_obj,null);
		})();

		// プロジェクト辞書
		(function(){
			var p;
			for(p in preset_obj){
				var a = preset_obj[p];
				if((a) && (typeof(a) == "object")){
					if(a.constructor == Array){
						proj_dictionary[p] = new Object();
						var i;
						var num = a.length;
						for(i=0;i<num;i++){
							var o = a[i];
							if(o.id !== undefined){
								proj_dictionary[p][o.id] = o;
							}
						}
					}
				}
			}
		})();

		// プロジェクトにインポート
		(function(){
			var define_ary = proj_obj[asset];
			var define_dictionary = new Object();

			var i;
			var num = define_ary.length;
			for(i=0;i<num;i++){
				var d = define_ary[i];
				define_dictionary[d.id] = d;
			}

			var asset_ary = user_asset[asset];
			num = asset_ary.length;
			for(i=num-1;i>=0;i--){
				var d = proj_dictionary[asset][asset_ary[i]];
				if(d.preset){
					define_dictionary[d.id].user = d.user;
				}else{
					var user_id = PageExpandProjectObjectDefineGenerateNewUserId(proj_obj[asset]);
					define_ary.unshift(d);
					d.id = user_id;
				}
			}
		})();
	}

	// -
	// プロジェクトオブジェクトから最新のフィルタを取得
	// -
	function PageExpandProjectObjectGetDefineFilterLatest(user_obj,asset){
		if(user_obj.version === undefined)	return;
		if(!user_obj[asset])	return;

		var preset_obj = PageExpandProjectObjectUpdate(null,{version:user_obj.version});
		var user_define = user_obj[asset][0];
		preset_obj[asset].push(user_define);
		preset_obj = PageExpandProjectObjectUpdate(preset_obj,null);
		return user_define.user.filter;
	}

	// -
	// プロジェクトオブジェクトにプリセットを付加
	// -
	function PageExpandProjectObjectAppendPreset(proj_obj){
		if(proj_obj.version === undefined)	return null;

		var p;
		var preset = PageExpandProjectObjectUpdate(null,{version:proj_obj.version});

		// 辞書を作成
		var dictionary = new Object();
		for(p in preset){
			var a = preset[p];
			if((a) && (typeof(a) == "object")){
				if(a.constructor == Array){
					dictionary[p] = new Object();
					var i;
					var num = a.length;
					for(i=0;i<num;i++){
						var o = a[i];
						if(o.id !== undefined){
							dictionary[p][o.id] = o;
						}
					}
				}
			}
		}

		// マージ
		for(p in proj_obj){
			var a = proj_obj[p];
			if((a) && (typeof(a) == "object")){
				if(a.constructor == Array){
					var i;
					var num = a.length;
					for(i=0;i<num;i++){
						var o = a[i];
						if(o.id !== undefined){
							if(dictionary[p][o.id] !== undefined){
								o.preset = dictionary[p][o.id].preset;
							}
						}
					}
				}
			}
		}

		return proj_obj;
	}

	// -
	// プロジェクトオブジェクトからプリセットを除去
	// -
	function PageExpandProjectObjectRemovePreset(proj_obj){
		var p;
		for(p in proj_obj){
			var a = proj_obj[p];
			if((a) && (typeof(a) == "object")){
				if(a.constructor == Array){
					var i;
					var num = a.length;
					for(i=0;i<num;i++){
						var o = a[i];
						if(o.id !== undefined){
							if(o.preset !== undefined){
								ObjectDeleteProperty(o,"preset");
							}
						}
					}
				}
			}
		}
		return proj_obj;
	}

	// -
	// プロジェクトオブジェクト定義から新しいユーザー ID を生成
	// -
	function PageExpandProjectObjectDefineGenerateNewUserId(ary){
		// 辞書作成
		var dic = new Object();
		var i;
		var num = ary.length;
		for(i=0;i<num;i++){
			dic[ary[i].id] = ary[i];
		}

		// ユニーク名を作成
		i = 0;
		while(dic["user" + i]){
			i++;
		}
		return "user" + i;
	}

	// -
	// ダウンロード保存先 simple から detail を取得
	// -
	function ProjectDownloadSaveFile_DetailFromSimple(simple){
		switch(simple){
		case "kebab_url":
			return "<kebab-url>";
		case "filename":
			return "<filename>";
		case "domain":
			return "<domain>-<filename>";
		case "date":
			return "<year><month><day>/<filename>";
		}
		return "<url>";
	}

	// -
	// ダウンロード保存先 ファイル名を取得
	// -
	function ProjectDownloadSaveFile_GetFileNameFromDetail(detail,url){
		function ntos(n,d){
			var s = String(n);
			var l = s.length;
			while(l < d){
				s = "0" + s;
				l ++;
			}
			return s;
		}

		var kebab_url = url.replace(/\//g,"-");
		var pathname = "";
		var origin = "";
		var domain = "";
		var filename = "";
		var name = "";
		var ext = "";
		var query = "";
		var fragment = "";

		var m;
		m = url.match(/([?].*?)(#|$)/);
		if(m) query = m[1];
		m = url.match(/([#].*)$/);
		if(m) fragment = m[1];

		var index = url.length;
		m = url.match(/(#|[?])/);
		if(m) index = m.index;
		pathname = url.substr(0,index);

		m = pathname.match(/([^/]+)(\/*)$/);
		if(m) filename = m[1];
		m = filename.match(/(.*?)([.]|$)/);
		if(m) name = m[1];
		m = filename.match(/.*?[.](.*)$/);
		if(m) ext = m[1];

		m = pathname.match(/.*?:\/\/[^/]*/);
		if(m) origin = m[0];
		m = origin.match(/.*?:\/\/(.*?)(:|$)/);
		if(m) domain = m[1];

		var date = new Date();
		var year = ntos(date.getFullYear(),4);
		var month = ntos(date.getMonth()+1,2);
		var day = ntos(date.getDate(),2);
		var hour = ntos(date.getHours(),2);
		var minute = ntos(date.getMinutes(),2);
		var second = ntos(date.getSeconds(),2);
		var millisecond = ntos(date.getMilliseconds(),3);
		var unixtime = Math.floor(date.getTime() / 1000);

		str = detail;
		str = str.replace(/<url>/gi,url);
		str = str.replace(/<kebab-url>/gi,kebab_url);
		str = str.replace(/<origin>/gi,origin);
		str = str.replace(/<domain>/gi,domain);
		str = str.replace(/<filename>/gi,filename);
		str = str.replace(/<name>/gi,name);
		str = str.replace(/<ext>/gi,ext);
		str = str.replace(/<query>/gi,query);
		str = str.replace(/<fragment>/gi,fragment);

		str = str.replace(/<year>/gi,year);
		str = str.replace(/<month>/gi,month);
		str = str.replace(/<day>/gi,day);
		str = str.replace(/<hour>/gi,hour);
		str = str.replace(/<minute>/gi,minute);
		str = str.replace(/<second>/gi,second);
		str = str.replace(/<millisecond>/gi,millisecond);
		str = str.replace(/<unixtime>/gi,unixtime);

		return str;
	}

	// -
	// ダウンロード保存先 消毒化
	// -
	function ProjectDownloadSaveFile_Sanitize(url){
		var e = new Array();
		var a = url.split(new RegExp("[/\\\\]+","i"));
		var i;
		var num = a.length;
		for(i=0;i<num;i++){
			var f = a[i];
			if(!f) continue;
			if(f.match(/^[. ]+$/)) continue;
			f = f.replace(/^[. ]*(.*?)[. ]*$/,"$1");
			e.push(f);
		}
		return e.join("/").replace(new RegExp("[\":*?<>|~]","ig"),"-");
	}

	// -
	// プロジェクトのアップデート
	// -
	function PageExpandProjectObjectUpdate(proj,param){

		// -
		// プリセットを追加
		// -
		function addPreset(ary,id,insert){
			var i;
			var obj;
			var num = ary.length;
			for(i=0;i<num;i++){
				if(ary[i].id == id){
					obj = ary[i];
					break;
				}
			}

			if(!obj){
				if(insert){
					// 挿入位置を検索
					for(i=num-1;i>=0;i--){
						if(ary[i].id == insert){
							break;
						}
					}
					if(i < 0){
						i = 0;
					}
				}else{
					i = num;
				}

				// オブジェクトを新規作成
				obj = new Object();
				obj.id = id;
				ary.splice(i,0,obj);
			}else{
				// ユーザー設定
				if(obj.user){
					// 複製
					var copy = ObjectCopy(obj);
					delete obj.user;
					delete copy.preset;

					var user = copy.user;
					user.name.standard += " (BackUp)";
					var locales = user.name.locales;
					for(var p in locales){
						locales[p] += " (BackUp)";
					}
					ary.splice(i+1, 0, copy);
					copy.id = PageExpandProjectObjectDefineGenerateNewUserId(ary);
				}
			}

			return obj;
		}

		// -
		// プリセットを取得
		// -
		function getPreset(ary,id){
			var i;
			var param;
			var num = ary.length;
			for(i=0;i<num;i++){
				param = ary[i];
				if(param.id == id){
					if(param.preset){
						return param.preset;
					}else{
						break;
					}
				}
			}

			return null;
		}

		// -
		// プリセットを破棄
		// -
		function removePreset(asset,id){

			// リストを取得
			var def_list = proj[asset];		
			if(!def_list) return null;

			var is_user = false;
			var is_used = false;
			var is_define = !({
				"urlmap":true,
				"expand_bbs":true
			}[asset]);
			
			// リストから除外		
			var def_old = (function(){
				var def_old;
				var i;
				var num = def_list.length;
				for(i=0;i<num;i++){
					def_old = def_list[i];
					if(def_old.id === id){
						def_list.splice(i,1);
						return def_old;
					}
				}
				return null;
			})();
			if(!def_old) return null;

			// バックアップ定義を作成		
			var def_bak = (function(){
				var def_bak = ObjectCopy(def_old);
				if(!def_bak.user){
					def_bak.user = def_bak.preset;
				}else{
					is_user = true;
				}
				delete def_old.user;
				delete def_bak.preset;

				var user = def_bak.user;
				user.name.standard += " (BackUp)";
				var locales = user.name.locales;
				for(var p in locales){
					locales[p] += " (BackUp)";
				}
				def_bak.id = PageExpandProjectObjectDefineGenerateNewUserId(proj[asset]);
				return def_bak;			
			})();
			
			(function(){
				if(!(is_define)) return;

				var urlmaps = proj.urlmap;
				var urlmap_num = urlmaps.length;
				var i;
				var j;
				for(i=0;i<urlmap_num;i++){
					var urlmap = urlmaps[i];
					var preset = urlmap.preset;
					if(!preset) continue;
					var o = preset[asset];
					if(!o) continue;
					if((o.id) && (typeof(o.id) == "object")){
						var a = o.id;
						for(j=a.length-1;j>=0;j--){
							if(a[j] === id){
								a.splice(j,1);
								if(a.length == 0){
									o.enable = false;
								}
							}
						}
					}else if(o.id === id){
						o.id = "";
						o.enable = false;
					}
				}

				for(i=0;i<urlmap_num;i++){
					var urlmap = urlmaps[i];
					var user = urlmap.user;
					if(!user) continue;
					var o = user[asset];
					if(!o) continue;
					if((o.id) && (typeof(o.id) == "object")){
						var a = o.id;
						for(j=a.length-1;j>=0;j--){
							if(a[j] === id){
								a[j] = def_bak.id;
								o.enable = true;
								is_used = true;
							}
						}
					}else if(o.id === id){
						o.id = def_bak.id;
						o.enable = true;
						is_used = true;
					}
				}
			})();
			
			var result = false;
			if(!(is_define) && (is_user)) result = true;
			if(is_used) result = true;

			if(result){
				def_list.push(def_bak);
			}

			return def_old;
		}

		// -
		// プリセット更新
		// -
		function updatePreset(ary,id,func){
			var p;
			var i;
			var num = ary.length;
			if(id == "*"){
				for(i=0;i<num;i++){
					p = ary[i];
					if(p.preset) func(p.preset,p);
				}
			}else{
				for(i=0;i<num;i++){
					p = ary[i];
					if(p.id == id){
						if(p.preset) func(p.preset,p);
						break;
					}
				}
			}
		}

		// -
		// ユーザーデータ更新
		// -
		function updateUser(ary,id,func){
			var p;
			var i;
			var num = ary.length;
			if(id == "*"){
				for(i=0;i<num;i++){
					p = ary[i];
					if(p.user) func(p.user,p);
				}
			}else{
				for(i=0;i<num;i++){
					p = ary[i];
					if(p.id == id){
						if(p.user) func(p.user,p);
						break;
					}
				}
			}
		}

		// -
		// 更新
		// -
		function update(ary,id,func){
			var p;
			var i;
			var num = ary.length;
			if(id == "*"){
				for(i=0;i<num;i++){
					p = ary[i];
					if(p.user) func(p.user,p);
					if(p.preset) func(p.preset,p);
				}
			}else{
				for(i=0;i<num;i++){
					p = ary[i];
					if(p.id == id){
						if(p.user) func(p.user,p);
						if(p.preset) func(p.preset,p);
						break;
					}
				}
			}
		}

		// -
		// アイテムの位置を取得
		// -
		function getItemIndex(ary,id){
			var p;
			var i;
			var num = ary.length;
			for(i=0;i<num;i++){
				p = ary[i];
				if(p.id == id) return i;
			}
			return -1;
		}

		// -
		// アイテムの位置を変更
		// -
		function moveItemAt(ary,id,index){
			var pos = getItemIndex(ary,id);
			var item = ary[pos];
			ary.splice(pos,1);
			ary.splice(index,0,item);
		}

		// -
		// 配列コンテナを作成
		// -
		function createArrayContainer(name){
			if((proj[name]) && (typeof(proj[name]) == "object")){
				if(proj[name].constructor == Array){
					return proj[name];
				}
			}

			proj[name] = new Array();
			return proj[name];
		}

		// -
		// 終了
		// -
		function exit(){
			if(param){
				if(param.version !== undefined){
					if(proj.version >= param.version){
						return true;
					}
				}
			}

			return false;
		}

		// -
		// プロジェクトワーク作成
		// -
		if(!proj){
			proj = new Object();

			// バージョン値
			proj.version = 0;
		}
		if(exit())	return proj;

		// -
		// プロジェクト ver.1
		// -
		if(proj.version < 1){
			// バージョン値
			proj.version = 1;

			// -
			// 基本設定
			// -
			proj.standard = {
				filter_type:"deny",
				filter_deny:[
					"*://example.com/*",
					"*://*.example.com/*"
				],
				filter_allow:[
					"*://example.com/*",
					"*://*.example.com/*"
				],
				enable_debug_mode:false,
				enable_icon_address_bar:true,
				enable_context_menu:true,
				enable_enable_startup:true,
				load_thread_max:10,
				execute_queue:{
					time_occupancy:5,
					time_sleep:0
				}
			};

			// -
			// 掲示板設定
			// -
			createArrayContainer("expand_bbs");

			// 追加
			update(proj.expand_bbs,"*",function(obj){
				if(!(obj.name))						obj.name = new Object();
				if(!(obj.name.standard))			obj.name.standard = "";
				if(!(obj.name.locales))				obj.name.locales = new Object();

				if(!(obj.enable))					obj.enable = false;
				if(!(obj.script_allow))				obj.script_allow = "";
				if(!(obj.script_callback))			obj.script_callback = "";

				if(!(obj.popup))					obj.popup = new Object();
				if(!(obj.popup.origin_type))		obj.popup.origin_type = "adsorb_top_down";
				if(!(obj.popup.position_type))		obj.popup.position_type = "absolute";
				if(!(obj.popup.enable_animation))	obj.popup.enable_animation = false;
				if(!(obj.popup.percent))			obj.popup.percent = new Object();
				if(!(obj.popup.percent.x))			obj.popup.percent.x = 0;
				if(!(obj.popup.percent.y))			obj.popup.percent.y = 0;
				if(!(obj.popup.time_wait_open))		obj.popup.time_wait_open = 0;
				if(!(obj.popup.time_wait_close))	obj.popup.time_wait_close = 0;
				if(!(obj.popup.style_sheet))		obj.popup.style_sheet = 0;
			});

			// 2ちゃんねる掲示板
			var obj = addPreset(proj.expand_bbs,"2ch",null);
			obj.preset = {
				name:{
					standard:"2ch.net",
					locales:{
						ja:"2ちゃんねる掲示板",
						en:"2ch.net"
					}
				},
				enable:true,
				script_allow:"",
				script_callback:"",
				popup:{
					origin_type:"adsorb_top_bottom",
					position_type:"absolute",
					enable_animation:true,
					percent:{x:75,y:90},
					time_wait_open:0,
					time_wait_close:250,
					style_sheet:"padding:20px 10px; border:1px solid #000; background:#FFF; overflow-y:auto; word-wrap:break-word; word-break:break-all;"
				}
			};

			// ログ速
			var obj = addPreset(proj.expand_bbs,"logsoku","2ch");
			obj.preset = {
				name:{
					standard:"logsoku.com",
					locales:{
						ja:"ログ速",
						en:"logsoku.com"
					}
				},
				enable:true,
				script_allow:"",
				script_callback:"",
				popup:{
					origin_type:"adsorb_top_bottom",
					position_type:"absolute",
					enable_animation:true,
					percent:{x:75,y:90},
					time_wait_open:0,
					time_wait_close:250,
					style_sheet:"padding:20px 10px; border:1px solid #000; background:#FFF; overflow-y:auto; word-wrap:break-word; word-break:break-all;"
				}
			};

			// みみずん検索
			var obj = addPreset(proj.expand_bbs,"mimizun","logsoku");
			obj.preset = {
				name:{
					standard:"mimizun.com",
					locales:{
						ja:"みみずん検索",
						en:"mimizun.com"
					}
				},
				enable:true,
				script_allow:"",
				script_callback:"",
				popup:{
					origin_type:"adsorb_top_bottom",
					position_type:"absolute",
					enable_animation:true,
					percent:{x:75,y:90},
					time_wait_open:0,
					time_wait_close:250,
					style_sheet:"padding:20px 10px; border:1px solid #000; background:#FFF; overflow-y:auto; word-wrap:break-word; word-break:break-all;"
				}
			};

			// ふたば☆ちゃんねる
			var obj = addPreset(proj.expand_bbs,"2chan","mimizun");
			obj.preset = {
				name:{
					standard:"2chan.net",
					locales:{
						ja:"ふたば☆ちゃんねる",
						en:"2chan.net"
					}
				},
				enable:true,
				script_allow:"",
				script_callback:"",
				popup:{
					origin_type:"adsorb_top_bottom",
					position_type:"absolute",
					enable_animation:true,
					percent:{x:75,y:90},
					time_wait_open:0,
					time_wait_close:250,
					style_sheet:"padding:20px 10px; border:1px solid #000; background:#FFF; overflow-y:auto; word-wrap:break-word; word-break:break-all;"
				}
			};

			// 4chan.org
			var obj = addPreset(proj.expand_bbs,"4chan","2chan");
			obj.preset = {
				name:{
					standard:"4chan.org",
					locales:{
						ja:"4chan",
						en:"4chan.org"
					}
				},
				enable:true,
				script_allow:"",
				script_callback:"",
				popup:{
					origin_type:"adsorb_top_bottom",
					position_type:"absolute",
					enable_animation:true,
					percent:{x:75,y:90},
					time_wait_open:0,
					time_wait_close:250,
					style_sheet:"padding:20px 10px; border:1px solid #000; background:#FFF; overflow-y:auto; word-wrap:break-word; word-break:break-all;"
				}
			};

			// -
			// URLマッピング設定
			// -
			createArrayContainer("urlmap");

			// 追加
			update(proj.urlmap,"*",function(obj){
				if(!(obj.name))						obj.name = new Object();
				if(!(obj.name.standard))			obj.name.standard = "";
				if(!(obj.name.locales))				obj.name.locales = new Object();

				if(!(obj.enable))							obj.enable = false;
				if(!(obj.filter))							obj.filter = [];
				if(!(obj.access_block))						obj.access_block = new Object();
				if(!(obj.access_block.enable))				obj.access_block.enable = false;
				if(!(obj.replacement_to_element))			obj.replacement_to_element = new Object();
				if(!(obj.replacement_to_element.enable))	obj.replacement_to_element.enable = false;
				if(!(obj.replacement_to_text))				obj.replacement_to_text = new Object();
				if(!(obj.replacement_to_text.enable))		obj.replacement_to_text.enable = false;
				if(!(obj.replacement_to_link))				obj.replacement_to_link = new Object();
				if(!(obj.replacement_to_link.enable))		obj.replacement_to_link.enable = false;
				if(!(obj.replacement_to_referer))			obj.replacement_to_referer = new Object();
				if(!(obj.replacement_to_referer.enable))	obj.replacement_to_referer.enable = false;
				if(!(obj.replacement_to_useragent))			obj.replacement_to_useragent = new Object();
				if(!(obj.replacement_to_useragent.enable))	obj.replacement_to_useragent.enable = false;
				if(!(obj.make_link_to_text))				obj.make_link_to_text = new Object();
				if(!(obj.make_link_to_text.enable))			obj.make_link_to_text.enable = false;
				if(!(obj.expand_short_url))					obj.expand_short_url = new Object();
				if(!(obj.expand_short_url.enable))			obj.expand_short_url.enable = false;
				if(!(obj.expand_text))						obj.expand_text = new Object();
				if(!(obj.expand_text.enable))				obj.expand_text.enable = false;
				if(!(obj.expand_image))						obj.expand_image = new Object();
				if(!(obj.expand_image.enable))				obj.expand_image.enable = false;
				if(!(obj.expand_sound))						obj.expand_sound = new Object();
				if(!(obj.expand_sound.enable))				obj.expand_sound.enable = false;
				if(!(obj.expand_video))						obj.expand_video = new Object();
				if(!(obj.expand_video.enable))				obj.expand_video.enable = false;
				if(!(obj.expand_iframe))					obj.expand_iframe = new Object();
				if(!(obj.expand_iframe.enable))				obj.expand_iframe.enable = false;
				if(!(obj.style_sheet))						obj.style_sheet = new Object();
				if(!(obj.style_sheet.enable))				obj.style_sheet.enable = false;
				if(!(obj.experimental))						obj.experimental = new Object();
				if(!(obj.experimental.enable))				obj.experimental.enable = false;
			});

			// デフォルト
			var obj = addPreset(proj.urlmap,"default",null);
			obj.preset = {
				name:{
					standard:"Default",
					locales:{
						ja:"デフォルト(すべて)",
						en:"Default"
					}
				},
				enable:true,
				filter:[
					"*://*"
				],
				access_block:{enable:false,id:""},
				replacement_to_element:{enable:false,id:""},
				replacement_to_text:{enable:false,id:""},
				replacement_to_link:{enable:false,id:""},
				replacement_to_referer:{enable:false,id:""},
				replacement_to_useragent:{enable:false,id:""},
				make_link_to_text:{enable:true,id:"simple"},
				expand_short_url:{enable:true,id:"simple"},
				expand_text:{enable:false,id:""},
				expand_image:{enable:true,id:"popup"},
				expand_sound:{enable:false,id:""},
				expand_video:{enable:false,id:""},
				expand_iframe:{enable:false,id:""},
				style_sheet:{enable:true,id:"default"},
				experimental:{enable:false,id:""}
			};

			// twitter
			var obj = addPreset(proj.urlmap,"twitter","default");
			obj.preset = {
				name:{
					standard:"twitter.com",
					locales:{
						ja:"ツイッター",
						en:"twitter.com"
					}
				},
				enable:true,
				filter:[
					"*://twitter.com/*"
				],
				access_block:{enable:false,id:""},
				replacement_to_element:{enable:false,id:""},
				replacement_to_text:{enable:false,id:""},
				replacement_to_link:{enable:true,id:"no_referrer"},
				replacement_to_referer:{enable:true,id:"replacement_link"},
				replacement_to_useragent:{enable:false,id:""},
				make_link_to_text:{enable:true,id:"simple"},
				expand_short_url:{enable:true,id:"detail"},
				expand_text:{enable:false,id:""},
				expand_image:{enable:true,id:"thumbnail"},
				expand_sound:{enable:true,id:"inline"},
				expand_video:{enable:true,id:"inline"},
				expand_iframe:{enable:false,id:""},
				style_sheet:{enable:true,id:"default"},
				experimental:{enable:false,id:""}
			};

			// スレッド掲示板
			var obj = addPreset(proj.urlmap,"bbs","twitter");
			obj.preset = {
				name:{
					standard:"2ch.net",
					locales:{
						ja:"スレッド掲示板",
						en:"2ch.net"
					}
				},
				enable:true,
				filter:[
					"*://2ch.net/*",
					"*://*.2ch.net/*",
					"*://*.machi.to/*",
					"*://machibbs.net/*",
					"*://*.machibbs.net/*",
					"*://*.bbspink.com/*",
					"*://jbbs.livedoor.jp/*",
					"*://logsoku.com/*",
					"*://mimizun.com/log/*/*",
					"*://*.kakiko.com/*",
					"*://*.60.kg/*",
					"*://*.atchs.jp/*"
				],
				access_block:{enable:false,id:""},
				replacement_to_element:{enable:false,id:""},
				replacement_to_text:{enable:false,id:""},
				replacement_to_link:{enable:true,id:"direct_link_bbs"},
				replacement_to_referer:{enable:true,id:"replacement_link"},
				replacement_to_useragent:{enable:false,id:""},
				make_link_to_text:{enable:true,id:"detail"},
				expand_short_url:{enable:true,id:"detail"},
				expand_text:{enable:false,id:""},
				expand_image:{enable:true,id:"thumbnail"},
				expand_sound:{enable:true,id:"inline"},
				expand_video:{enable:true,id:"inline"},
				expand_iframe:{enable:false,id:""},
				style_sheet:{enable:true,id:"default"},
				experimental:{enable:false,id:""}
			};

			// 画像掲示板
			var obj = addPreset(proj.urlmap,"image_bbs","bbs");
			obj.preset = {
				name:{
					standard:"www.4chan.org",
					locales:{
						ja:"画像掲示板",
						en:"www.4chan.org"
					}
				},
				enable:true,
				filter:[
					"*://*.4chan.org/*",
					"*://*.2chan.net/*"
				],
				access_block:{enable:false,id:""},
				replacement_to_element:{enable:false,id:""},
				replacement_to_text:{enable:false,id:""},
				replacement_to_link:{enable:true,id:"no_referrer"},
				replacement_to_referer:{enable:true,id:"replacement_link"},
				replacement_to_useragent:{enable:false,id:""},
				make_link_to_text:{enable:true,id:"detail"},
				expand_short_url:{enable:true,id:"detail"},
				expand_text:{enable:false,id:""},
				expand_image:{enable:true,id:"popup"},
				expand_sound:{enable:true,id:"inline"},
				expand_video:{enable:true,id:"inline"},
				expand_iframe:{enable:false,id:""},
				style_sheet:{enable:true,id:"default"},
				experimental:{enable:false,id:""}
			};

			// 検索サイト
			var obj = addPreset(proj.urlmap,"search","image_bbs");
			obj.preset = {
				name:{
					standard:"Search",
					locales:{
						ja:"検索サイト",
						en:"Search"
					}
				},
				enable:true,
				filter:[
					"*://www.google.com/#*q=*",
					"*://www.google.com/search?*",
					"*://www.google.co.jp/#*q=*",
					"*://www.google.co.jp/search?*",
					"*://search.yahoo.com/search*",
					"*://search.yahoo.co.jp/*",
					"*://www.bing.com/search?*q=*",
					"*://topsy.com/s*"
				],
				access_block:{enable:false,id:""},
				replacement_to_element:{enable:false,id:""},
				replacement_to_text:{enable:false,id:""},
				replacement_to_link:{enable:true,id:"direct_link_search"},
				replacement_to_referer:{enable:false,id:""},
				replacement_to_useragent:{enable:false,id:""},
				make_link_to_text:{enable:true,id:"simple"},
				expand_short_url:{enable:true,id:"simple"},
				expand_text:{enable:false,id:""},
				expand_image:{enable:true,id:"popup"},
				expand_sound:{enable:true,id:"inline"},
				expand_video:{enable:true,id:"inline"},
				expand_iframe:{enable:false,id:""},
				style_sheet:{enable:true,id:"default"},
				experimental:{enable:false,id:""}
			};

			// 画像検索サイト
			var obj = addPreset(proj.urlmap,"image_search","search");
			obj.preset = {
				name:{
					standard:"Image Search",
					locales:{
						ja:"画像検索サイト",
						en:"Image Search"
					}
				},
				enable:true,
				filter:[],
				access_block:{enable:false,id:""},
				replacement_to_element:{enable:false,id:""},
				replacement_to_text:{enable:false,id:""},
				replacement_to_link:{enable:true,id:"direct_link_image_search"},
				replacement_to_referer:{enable:true,id:"replacement_link"},
				replacement_to_useragent:{enable:false,id:""},
				make_link_to_text:{enable:true,id:"simple"},
				expand_short_url:{enable:true,id:"simple"},
				expand_text:{enable:false,id:""},
				expand_image:{enable:true,id:"popup"},
				expand_sound:{enable:false,id:""},
				expand_video:{enable:false,id:""},
				expand_iframe:{enable:false,id:""},
				style_sheet:{enable:true,id:"default"},
				experimental:{enable:false,id:""}
			};

			// リアルタイム検索サイト
			var obj = addPreset(proj.urlmap,"realtime_search","image_search");
			obj.preset = {
				name:{
					standard:"Real Time Search",
					locales:{
						ja:"リアルタイム検索サイト",
						en:"Real Time Search"
					}
				},
				enable:true,
				filter:[
					"*://realtime.search.yahoo.co.jp/*",
					"*://topsy.com/s/*/tweet?*",
					"*://topsy.com/s?*type=tweet*",
					"*://www.bing.com/social/search*",
					"*://*search.naver.jp/realtime?*"
				],
				access_block:{enable:false,id:""},
				replacement_to_element:{enable:false,id:""},
				replacement_to_text:{enable:false,id:""},
				replacement_to_link:{enable:true,id:"direct_link_realtime_search"},
				replacement_to_referer:{enable:false,id:""},
				replacement_to_useragent:{enable:false,id:""},
				make_link_to_text:{enable:true,id:"simple"},
				expand_short_url:{enable:true,id:"simple"},
				expand_text:{enable:false,id:""},
				expand_image:{enable:true,id:"thumbnail"},
				expand_sound:{enable:true,id:"inline"},
				expand_video:{enable:true,id:"inline"},
				expand_iframe:{enable:false,id:""},
				style_sheet:{enable:true,id:"default"},
				experimental:{enable:false,id:""}
			};

			// -
			// アクセスブロック定義
			// -
			createArrayContainer("access_block");

			// 追加
			update(proj.access_block,"*",function(obj){
				if(!(obj.name))						obj.name = new Object();
				if(!(obj.name.standard))			obj.name.standard = "";
				if(!(obj.name.locales))				obj.name.locales = new Object();

				if(!(obj.filter))	obj.filter = [];
			});

			// -
			// エレメント置換定義
			// -
			createArrayContainer("replacement_to_element");

			// 追加
			update(proj.replacement_to_element,"*",function(obj){
				if(!(obj.name))						obj.name = new Object();
				if(!(obj.name.standard))			obj.name.standard = "";
				if(!(obj.name.locales))				obj.name.locales = new Object();

				if(!(obj.script))	obj.script = "";
			});

			// フォントの種類をメイリオに変更
			var obj = addPreset(proj.replacement_to_element,"meiryo_font",null);
			obj.preset = {
				name:{
					standard:"Meiryo Font",
					locales:{
						ja:"フォントの種類をメイリオに変更",
						en:"Meiryo Font"
					}
				},
				script:""
			};

			// -
			// テキスト置換定義
			// -
			createArrayContainer("replacement_to_text");

			// 追加
			update(proj.replacement_to_text,"*",function(obj){
				if(!(obj.name))						obj.name = new Object();
				if(!(obj.name.standard))			obj.name.standard = "";
				if(!(obj.name.locales))				obj.name.locales = new Object();

				if(!(obj.script))	obj.script = "";
			});

			// 英数字記号を半角、カタカナを全角に変更
			var obj = addPreset(proj.replacement_to_text,"alphanumeric_half",null);
			obj.preset = {
				name:{
					standard:"String Convert From AlphanumericHalf To AlphanumericFull",
					locales:{
						ja:"英数字記号を半角、カタカナを全角に変更",
						en:"String Convert From AlphanumericHalf To AlphanumericFull"
					}
				},
				script:""
			};

			// -
			// ハイパーリンク置換定義
			// -
			createArrayContainer("replacement_to_link");

			// 追加
			update(proj.replacement_to_link,"*",function(obj){
				if(!(obj.name))						obj.name = new Object();
				if(!(obj.name.standard))			obj.name.standard = "";
				if(!(obj.name.locales))				obj.name.locales = new Object();

				if(!(obj.script))	obj.script = "";
			});

			// ノーリファラ属性を追加
			var obj = addPreset(proj.replacement_to_link,"no_referrer",null);
			obj.preset = {
				name:{
					standard:"No Referer",
					locales:{
						ja:"ノーリファラ属性を追加",
						en:"No Referer"
					}
				},
				script:""
			};

			// ソーシャルサービスのカウント数を表示
			var obj = addPreset(proj.replacement_to_link,"attach_sns_counter","no_referrer");
			obj.preset = {
				name:{
					standard:"Attach SNS Counter",
					locales:{
						ja:"ソーシャルサービスのカウント数を表示",
						en:"Attach SNS Counter"
					}
				},
				script:""
			};

			// 2ch.net 用
			var obj = addPreset(proj.replacement_to_link,"direct_link_bbs","attach_sns_counter");
			obj.preset = {
				name:{
					standard:"Direct Link (bbs)",
					locales:{
						ja:"直リンクに変更(スレッド掲示板用)",
						en:"Direct Link (bbs)"
					}
				},
				script:""
			};

			// 検索用
			var obj = addPreset(proj.replacement_to_link,"direct_link_search","direct_link_bbs");
			obj.preset = {
				name:{
					standard:"Direct Link (search)",
					locales:{
						ja:"直リンクに変更(検索用)",
						en:"Direct Link (search)"
					}
				},
				script:""
			};

			// イメージ検索用
			var obj = addPreset(proj.replacement_to_link,"direct_link_image_search","direct_link_search");
			obj.preset = {
				name:{
					standard:"Direct Link (image search)",
					locales:{
						ja:"直リンクに変更(イメージ検索用)",
						en:"Direct Link (image search)"
					}
				},
				script:""
			};

			// リアルタイム検索用
			var obj = addPreset(proj.replacement_to_link,"direct_link_realtime_search","direct_link_image_search");
			obj.preset = {
				name:{
					standard:"Direct Link (realtime search)",
					locales:{
						ja:"直リンクに変更(リアルタイム検索用)",
						en:"Direct Link (realtime search)"
					}
				},
				script:""
			};

			// -
			// リファラ置換定義
			// -
			createArrayContainer("replacement_to_referer");

			// 追加
			update(proj.replacement_to_referer,"*",function(obj){
				if(!(obj.name))						obj.name = new Object();
				if(!(obj.name.standard))			obj.name.standard = "";
				if(!(obj.name.locales))				obj.name.locales = new Object();

				if(!(obj.script))	obj.script = "";
			});

			// 空文字列に変更
			var obj = addPreset(proj.replacement_to_referer,"replacement_empty",null);
			obj.preset = {
				name:{
					standard:"Replace Empty",
					locales:{
						ja:"空文字列に変更",
						en:"Replace Empty"
					}
				},
				script:""
			};

			// リンク先のURLに変更
			var obj = addPreset(proj.replacement_to_referer,"replacement_link","replacement_empty");
			obj.preset = {
				name:{
					standard:"Replace Link",
					locales:{
						ja:"リンク先のURLに変更",
						en:"Replace Link"
					}
				},
				script:""
			};

			// -
			// ユーザーエージェント置換定義
			// -
			createArrayContainer("replacement_to_useragent");

			// 追加
			update(proj.replacement_to_useragent,"*",function(obj){
				if(!(obj.name))						obj.name = new Object();
				if(!(obj.name.standard))			obj.name.standard = "";
				if(!(obj.name.locales))				obj.name.locales = new Object();

				if(!(obj.script))	obj.script = "";
			});

			// iPhone4
			var obj = addPreset(proj.replacement_to_useragent,"iphone_4",null);
			obj.preset = {
				name:{
					standard:"iPhone4",
					locales:{
						ja:"iPhone4",
						en:"iPhone4"
					}
				},
				script:""
			};

			// Android 2.1
			var obj = addPreset(proj.replacement_to_useragent,"android_2_1","iphone_4");
			obj.preset = {
				name:{
					standard:"Android 2.1",
					locales:{
						ja:"Android 2.1",
						en:"Android 2.1"
					}
				},
				script:""
			};

			// DoCoMo/2.0
			var obj = addPreset(proj.replacement_to_useragent,"docomo_2_0","android_2_1");
			obj.preset = {
				name:{
					standard:"DoCoMo / 2.0",
					locales:{
						ja:"DoCoMo / 2.0",
						en:"DoCoMo / 2.0"
					}
				},
				script:""
			};

			// -
			// ハイパーリンク化定義
			// -
			createArrayContainer("make_link_to_text");

			// 追加
			update(proj.make_link_to_text,"*",function(obj){
				if(!(obj.name))						obj.name = new Object();
				if(!(obj.name.standard))			obj.name.standard = "";
				if(!(obj.name.locales))				obj.name.locales = new Object();

				if(!(obj.script))	obj.script = "";
			});

			// 簡易
			var obj = addPreset(proj.make_link_to_text,"simple",null);
			obj.preset = {
				name:{
					standard:"Simple",
					locales:{
						ja:"簡易",
						en:"Simple"
					}
				},
				script:""
			};

			// 詳細
			var obj = addPreset(proj.make_link_to_text,"detail","simple");
			obj.preset = {
				name:{
					standard:"Detail",
					locales:{
						ja:"詳細",
						en:"Detail"
					}
				},
				script:""
			};

			// -
			// 短縮 URL 展開
			// -
			createArrayContainer("expand_short_url");

			// 追加
			update(proj.expand_short_url,"*",function(obj){
				if(!(obj.name))						obj.name = new Object();
				if(!(obj.name.standard))			obj.name.standard = "";
				if(!(obj.name.locales))				obj.name.locales = new Object();

				if(!(obj.filter))	obj.filter = [];
			});

			// 簡易
			var obj = addPreset(proj.expand_short_url,"simple",null);
			obj.preset = {
				name:{
					standard:"Simple",
					locales:{
						ja:"簡易",
						en:"Simple"
					}
				},
				filter:[
					"http://bit.ly/*",
					"http://j.mp/*",
					"http://goo.gl/*",
					"http://c23.biz/*",
					"http://p.tl/*",
					"http://tinyurl.com/*",
					"http://ow.ly/*",
					"http://t.co/*",
					"http://fb.me/*",
					"http://amzn.to/*",
					"http://youtu.be/*",
					"http://g.co/*",
					"http://r10.to/*",
					"http://s.nikkei.com/*",
					"http://t.asahi.com/*"
				]
			};

			// 詳細
			var obj = addPreset(proj.expand_short_url,"detail","simple");
			obj.preset = {
				name:{
					standard:"Detail",
					locales:{
						ja:"詳細",
						en:"Detail"
					}
				},
				filter:[
					"http://tinyurl.com/*",
					"http://ow.ly/*",
					"http://dlvr.it/*",
					"http://s.nikkei.com/*",
					"http://t.asahi.com/*",
					"http://is.gd/*",
					"http://t.co/*",
					"http://fb.me/*",
					"http://amzn.to/*",
					"http://youtu.be/*",
					"http://tumblr.com/*",
					"http://a.r10.to/*",
					"http://ht.ly/*",
					"http://lnk.ms/*",
					"http://ustre.am/**",
					"http://r10.to/*",
					"http://tou.ch/*",
					"http://po.st/*",
					"http://htn.to/*",
					"http://moi.st/*",
					"http://fc2.in/*",
					"http://a8.net/*",
					"http://p.tl/*",
					"http://itun.es/*",
					"http://flic.kr/*",
					"http://moby.to/*",
					"http://instapaper.com/*",
					"http://icio.us/*",
					"http://dai.ly/*",
					"http://pbckt.com/*",
					"http://nhk.jp/*",
					"http://post.ly/*",
					"http://bit.ly/*",
					"http://goo.gl/*",
					"http://r.sm3.jp/*",
					"http://cot.ag/*",
					"http://mpr.hn/*",
					"http://rss.rssad.jp/*",
					"http://to.ly/*",
					"http://g.co/*",
					"http://fon.gs/*",
					"http://tuna.be/*",
					"http://mysp.ac/*",
					"http://j.mp/*",
					"http://snurl.com/*",
					"http://v.gd/*",
					"http://ux.nu/*",
					"http://qurl.com/*",
					"http://tr.im/*",
					"http://gigaz.in/*",
					"http://3.ly/*",
					"http://artbeat.ly/*",
					"http://sgp.cm/*",
					"http://30m.in/*",
					"http://bt.io/*",
					"http://pic.gd/*",
					"http://twt.mx/*",
					"http://url4.eu/*",
					"http://idek.net/*",
					"http://c23.biz/*"
				]
			};

			// -
			// テキスト展開定義
			// -
			createArrayContainer("expand_text");

			// 追加
			update(proj.expand_text,"*",function(obj){
				if(!(obj.name))						obj.name = new Object();
				if(!(obj.name.standard))			obj.name.standard = "";
				if(!(obj.name.locales))				obj.name.locales = new Object();

				if(!(obj.inline))					obj.inline = new Object();
				if(!(obj.inline.disable_same_text))	obj.inline.disable_same_text = false;
				if(!(obj.inline.script_allow))		obj.inline.script_allow = "";
				if(!(obj.inline.script_insert))		obj.inline.script_insert = "";
			});

			// インライン表示
			var obj = addPreset(proj.expand_text,"inline",null);
			obj.preset = {
				name:{
					standard:"Inline",
					locales:{
						ja:"インライン表示",
						en:"Inline"
					}
				},
				inline:{
					disable_same_text:true,
					script_allow:"",
					script_insert:""
				}
			};

			// -
			// イメージ展開定義
			// -
			createArrayContainer("expand_image");

			// 追加
			update(proj.expand_image,"*",function(obj){
				if(!(obj.name))						obj.name = new Object();
				if(!(obj.name.standard))			obj.name.standard = "";
				if(!(obj.name.locales))				obj.name.locales = new Object();

				if(!(obj.thumbnail))									obj.thumbnail = new Object();
				if(!(obj.thumbnail.enable_popup_mouseover))				obj.thumbnail.enable_popup_mouseover = false;
				if(!(obj.thumbnail.disable_same_image))					obj.thumbnail.disable_same_image = false;
				if(!(obj.thumbnail.script_allow))						obj.thumbnail.script_allow = "";
				if(!(obj.thumbnail.script_insert))						obj.thumbnail.script_insert = "";
				if(!(obj.popup))										obj.popup = new Object();
				if(!(obj.popup.origin_type))							obj.popup.origin_type = "center";
				if(!(obj.popup.position_type))							obj.popup.position_type = "absolute";
				if(!(obj.popup.time_wait_open))							obj.popup.time_wait_open = 0;
				if(!(obj.popup.time_wait_close))						obj.popup.time_wait_close = 0;

				if(!(obj.popup.enable_animation))						obj.popup.enable_animation = false;
				if(!(obj.popup.script_allow))							obj.popup.script_allow = "";
				if(!(obj.reduced_image))								obj.reduced_image = new Object();
				if(!(obj.reduced_image.enable_popup))					obj.reduced_image.enable_popup = false;
				if(!(obj.reduced_image.popup_allow_slcale_less_then))	obj.reduced_image.popup_allow_slcale_less_then = 0;
			});

			// サムネイル表示
			var obj = addPreset(proj.expand_image,"thumbnail",null);
			obj.preset = {
				name:{
					standard:"Thumbnail",
					locales:{
						ja:"サムネイル表示",
						en:"Thumbnail"
					}
				},
				thumbnail:{
					enable_popup_mouseover:true,
					disable_same_image:false,
					script_allow:"",
					script_insert:""
				},
				popup:{
					origin_type:"center",
					position_type:"absolute",
					time_wait_open:0,
					time_wait_close:0,
					enable_animation:true,
					script_allow:""
				},
				reduced_image:{
					enable_popup:true,
					popup_allow_slcale_less_then:70
				}
			};

			// ポップアップ表示
			var obj = addPreset(proj.expand_image,"popup","thumbnail");
			obj.preset = {
				name:{
					standard:"Popup",
					locales:{
						ja:"ポップアップ表示",
						en:"Popup"
					}
				},
				thumbnail:{
					enable_popup_mouseover:true,
					disable_same_image:false,
					script_allow:"",
					script_insert:""
				},
				popup:{
					origin_type:"center",
					position_type:"absolute",
					time_wait_open:0,
					time_wait_close:0,
					enable_animation:true,
					script_allow:""
				},
				reduced_image:{
					enable_popup:true,
					popup_allow_slcale_less_then:70
				}
			};

			// -
			// サウンド展開定義
			// -
			createArrayContainer("expand_sound");

			// 追加
			update(proj.expand_sound,"*",function(obj){
				if(!(obj.name))						obj.name = new Object();
				if(!(obj.name.standard))			obj.name.standard = "";
				if(!(obj.name.locales))				obj.name.locales = new Object();

				if(!(obj.inline))						obj.inline = new Object();
				if(!(obj.inline.disable_same_audio))	obj.inline.disable_same_audio = false;
				if(!(obj.inline.script_allow))			obj.inline.script_allow = "";
				if(!(obj.inline.script_insert))			obj.inline.script_insert = "";
			});

			// インライン表示
			var obj = addPreset(proj.expand_sound,"inline",null);
			obj.preset = {
				name:{
					standard:"Inline",
					locales:{
						ja:"インライン表示",
						en:"Inline"
					}
				},
				inline:{
					disable_same_audio:true,
					script_allow:"",
					script_insert:""
				}
			};

			// -
			// ビデオ展開定義
			// -
			createArrayContainer("expand_video");

			// 追加
			update(proj.expand_video,"*",function(obj){
				if(!(obj.name))						obj.name = new Object();
				if(!(obj.name.standard))			obj.name.standard = "";
				if(!(obj.name.locales))				obj.name.locales = new Object();

				if(!(obj.inline))									obj.inline = new Object();
				if(!(obj.inline.disable_same_video))				obj.inline.disable_same_video = false;
				if(!(obj.inline.script_allow))						obj.inline.script_allow = "";
				if(!(obj.inline.script_insert))						obj.inline.script_insert = "";
				if(!(obj.video_element))							obj.video_element = new Object();
				if(!(obj.video_element.script_allow))				obj.video_element.script_allow = "";
				if(!(obj.youtube))									obj.youtube = new Object();
				if(!(obj.youtube.visible_video))					obj.youtube.visible_video = false;
				if(!(obj.nicovideo))								obj.nicovideo = new Object();
				if(!(obj.nicovideo.visible_video))					obj.nicovideo.visible_video = false;
				if(!(obj.nicovideo.visible_thumbnail_video))		obj.nicovideo.visible_thumbnail_video = false;
				if(!(obj.nicovideo.visible_thumbnail_mylist))		obj.nicovideo.visible_thumbnail_mylist = false;
				if(!(obj.nicovideo.visible_thumbnail_user))			obj.nicovideo.visible_thumbnail_user = false;
				if(!(obj.nicovideo.visible_thumbnail_community))	obj.nicovideo.visible_thumbnail_community = false;
				if(!(obj.nicovideo.visible_thumbnail_live))			obj.nicovideo.visible_thumbnail_live = false;
				if(!(obj.ustream))									obj.ustream = new Object();
				if(!(obj.ustream.visible_video))					obj.ustream.visible_video = false;
				if(!(obj.dailymotion))								obj.dailymotion = new Object();
				if(!(obj.dailymotion.visible_video))				obj.dailymotion.visible_video = false;
				if(!(obj.vimeo))									obj.vimeo = new Object();
				if(!(obj.vimeo.visible_video))						obj.vimeo.visible_video = false;
				if(!(obj.fc2video))									obj.fc2video = new Object();
				if(!(obj.fc2video.visible_video))					obj.fc2video.visible_video = false;
			});

			// インライン表示
			var obj = addPreset(proj.expand_video,"inline",null);
			obj.preset = {
				name:{
					standard:"Inline",
					locales:{
						ja:"インライン表示",
						en:"Inline"
					}
				},
				inline:{
					disable_same_video:true,
					video_max:10,
					script_allow:"",
					script_insert:""
				},
				video_element:{
					script_allow:""
				},
				youtube:{
					visible_video:true
				},
				nicovideo:{
					visible_video:true,
					visible_thumbnail_video:true,
					visible_thumbnail_mylist:true,
					visible_thumbnail_user:true,
					visible_thumbnail_community:true,
					visible_thumbnail_live:true
				},
				ustream:{
					visible_video_live:true,
					visible_video_record:true
				},
				dailymotion:{
					visible_video:true
				},
				vimeo:{
					visible_video:true
				},
				fc2video:{
					visible_video:true
				}
			};

			// -
			// インラインフレーム展開定義
			// -
			createArrayContainer("expand_iframe");

			// 追加
			update(proj.expand_iframe,"*",function(obj){
				if(!(obj.name))						obj.name = new Object();
				if(!(obj.name.standard))			obj.name.standard = "";
				if(!(obj.name.locales))				obj.name.locales = new Object();

				if(!(obj.inline))						obj.inline = new Object();
				if(!(obj.inline.disable_same_iframe))	obj.inline.disable_same_iframe = false;
				if(!(obj.inline.script_allow))			obj.inline.script_allow = "";
				if(!(obj.inline.script_insert))			obj.inline.script_insert = "";
			});

			// Flash のインライン表示
			var obj = addPreset(proj.expand_iframe,"expand_flash_inline",null);
			obj.preset = {
				name:{
					standard:"Expand Flash Inline",
					locales:{
						ja:"Flash のインライン表示",
						en:"Expand Flash Inline"
					}
				},
				inline:{
					disable_same_iframe:true,
					script_allow:"",
					script_insert:""
				}
			};

			// PDF のインライン表示
			var obj = addPreset(proj.expand_iframe,"expand_pdf_inline","expand_flash_inline");
			obj.preset = {
				name:{
					standard:"Expand PDF Inline",
					locales:{
						ja:"PDF のインライン表示",
						en:"Expand PDF Inline"
					}
				},
				inline:{
					disable_same_iframe:true,
					script_allow:"",
					script_insert:""
				}
			};

			// -
			// スタイルシート定義
			// -
			createArrayContainer("style_sheet");

			// 追加
			update(proj.style_sheet,"*",function(obj){
				if(!(obj.name))						obj.name = new Object();
				if(!(obj.name.standard))			obj.name.standard = "";
				if(!(obj.name.locales))				obj.name.locales = new Object();

				if(!(obj.expand_text))						obj.expand_text = new Object();
				if(!(obj.expand_text.inline))				obj.expand_text.inline = "";
				if(!(obj.expand_image))						obj.expand_image = new Object();
				if(!(obj.expand_image.thumbnail))			obj.expand_image.thumbnail = "";
				if(!(obj.expand_image.popup))				obj.expand_image.popup = "";
				if(!(obj.expand_sound))						obj.expand_sound = new Object();
				if(!(obj.expand_sound.inline))				obj.expand_sound.inline = "";
				if(!(obj.expand_video))						obj.expand_video = new Object();
				if(!(obj.expand_video.inline))				obj.expand_video.inline = new Object();

				var inline = obj.expand_video.inline;
				if(!(inline.video_element))					inline.video_element = new Object();
				if(!(inline.video_element.video))			inline.video_element.video = "";
				if(!(inline.youtube))						inline.youtube = new Object();
				if(!(inline.youtube.video))					inline.youtube.video = "";
				if(!(inline.nicovideo))						inline.nicovideo = new Object();
				if(!(inline.nicovideo.video))				inline.nicovideo.video = "";
				if(!(inline.nicovideo.thumbnail_video))		inline.nicovideo.thumbnail_video = "";
				if(!(inline.nicovideo.thumbnail_mylist))	inline.nicovideo.thumbnail_mylist = "";
				if(!(inline.nicovideo.thumbnail_user))		inline.nicovideo.thumbnail_user = "";
				if(!(inline.nicovideo.thumbnail_community))	inline.nicovideo.thumbnail_community = "";
				if(!(inline.nicovideo.thumbnail_live))		inline.nicovideo.thumbnail_live = "";
				if(!(inline.ustream))						inline.ustream = new Object();
				if(!(inline.ustream.video_live))			inline.ustream.video_live = "";
				if(!(inline.ustream.video_record))			inline.ustream.video_record = "";
				if(!(inline.dailymotion))					inline.dailymotion = new Object();
				if(!(inline.dailymotion.video))				inline.dailymotion.video = "";
				if(!(inline.vimeo))							inline.vimeo = new Object();
				if(!(inline.vimeo.video))					inline.vimeo.video = "";
				if(!(inline.fc2video))						inline.fc2video = new Object();
				if(!(inline.fc2video.video))				inline.fc2video.video = "";

				if(!(obj.expand_iframe))					obj.expand_iframe = new Object();
				if(!(obj.expand_iframe.inline))				obj.expand_iframe.inline = "";
			});

			// シンプル
			var obj = addPreset(proj.style_sheet,"simple",null);
			obj.preset = {
				name:{
					standard:"Simple",
					locales:{
						ja:"シンプル",
						en:"Simple"
					}
				},
				expand_text:{
					inline:"margin:2px 0px 2px 0px;"
				},
				expand_image:{
					thumbnail:"margin:2px 0px 2px 0px; background-color:#FFF; border:1px #000 solid;",
					popup:"background-color:#FFF; border:1px #000 solid;"
				},
				expand_sound:{
					inline:"margin:2px 0px 2px 0px;"
				},
				expand_video:{
					inline:{
						video_element:{
							video:"margin:2px 0px 2px 0px; width:720px; height:405px;"
						},
						youtube:{
							video:"margin:2px 0px 2px 0px; width:720px; height:405px; border:0px;"
						},
						nicovideo:{
							video:"margin:2px 0px 2px 0px; width:674px; height:386px; border:0px;",
							thumbnail_video:"margin:2px 0px 2px 0px; width:400px; height:180px; border:0px;",
							thumbnail_mylist:"margin:2px 0px 2px 0px; width:400px; height:180px; border:0px;",
							thumbnail_user:"margin:2px 0px 2px 0px; width:340px; height:160px; border:0px;",
							thumbnail_community:"margin:2px 0px 2px 0px; width:340px; height:180px; border:0px;",
							thumbnail_live:"margin:2px 0px 2px 0px; width:340px; height:180px; border:0px;"
						},
						ustream:{
							video_live:"margin:2px 0px 2px 0px; width:720px; height:405px; border:0px;",
							video_record:"margin:2px 0px 2px 0px; width:720px; height:405px; border:0px;"
						},
						dailymotion:{
							video:"margin:2px 0px 2px 0px; width:720px; height:405px; border:0px;"
						},
						vimeo:{
							video:"margin:2px 0px 2px 0px; width:720px; height:405px; border:0px;"
						},
						fc2video:{
							video:"margin:2px 0px 2px 0px; width:720px; height:405px; border:0px;"
						}
					}
				},
				expand_iframe:{
					inline:"margin:2px 0px 2px 0px; background-color:#FFF; border:1px #000 solid;"
				}
			};

			// デフォルト
			var obj = addPreset(proj.style_sheet,"default","simple");
			obj.preset = {
				name:{
					standard:"Default",
					locales:{
						ja:"デフォルト",
						en:"Default"
					}
				},
				expand_text:{
					inline:"margin:2px 0px 2px 0px; border:1px #000 solid; padding:4px; background-color:#FFF; display:block;"
				},
				expand_image:{
					thumbnail:"margin:2px 0px 2px 0px; border:1px #000 solid; padding:1px; background-color:#FFF;",
					popup:"margin:0px; border:1px #000 solid; padding:1px; background-color:#FFF;"
				},
				expand_sound:{
					inline:"margin:2px 0px 2px 0px; border:1px #000 solid; padding:1px; background-color:#FFF;"
				},
				expand_video:{
					inline:{
						video_element:{
							video:"margin:2px 0px 2px 0px; border:1px #000 solid; background-color:#000; width:720px; height:405px;"
						},
						youtube:{
							video:"margin:2px 0px 2px 0px; border:1px #000 solid; background-color:#000; width:720px; height:405px;"
						},
						nicovideo:{
							video:"margin:2px 0px 2px 0px; border:1px #000 solid; background-color:#000; width:674px; height:386px;",
							thumbnail_video:"margin:2px 0px 2px 0px; border:1px #000 solid; padding:1px; background-color:#FFF; width:400px; height:180px;",
							thumbnail_mylist:"margin:2px 0px 2px 0px; border:1px #000 solid; padding:1px; background-color:#FFF; width:400px; height:180px;",
							thumbnail_user:"margin:2px 0px 2px 0px; border:1px #000 solid; padding:1px; background-color:#FFF; width:340px; height:160px;",
							thumbnail_community:"margin:2px 0px 2px 0px; border:1px #000 solid; padding:1px; background-color:#FFF; width:340px; height:180px;",
							thumbnail_live:"margin:2px 0px 2px 0px; border:1px #000 solid; padding:1px; background-color:#FFF; width:340px; height:180px;"
						},
						ustream:{
							video_live:"margin:2px 0px 2px 0px; border:1px #000 solid; background-color:#000; width:720px; height:405px;",
							video_record:"margin:2px 0px 2px 0px; border:1px #000 solid; background-color:#000; width:720px; height:405px;"
						},
						dailymotion:{
							video:"margin:2px 0px 2px 0px; border:1px #000 solid; background-color:#000; width:720px; height:405px;"
						},
						vimeo:{
							video:"margin:2px 0px 2px 0px; border:1px #000 solid; background-color:#000; width:720px; height:405px;"
						},
						fc2video:{
							video:"margin:2px 0px 2px 0px; border:1px #000 solid; background-color:#000; width:720px; height:405px;"
						}
					}
				},
				expand_iframe:{
					inline:"margin:2px 0px 2px 0px; border:1px #000 solid; padding:1px; background-color:#FFF;"
				}
			};

			// -
			// 試験運用展開定義
			// -
			createArrayContainer("experimental");

			// 追加
			update(proj.experimental,"*",function(obj){
				if(!(obj.name))						obj.name = new Object();
				if(!(obj.name.standard))			obj.name.standard = "";
				if(!(obj.name.locales))				obj.name.locales = new Object();
			});

			// -
			// 言語設定
			// -
			proj.language = {
				type:-1
			};
		}
		if(exit())	return proj;

		// -
		// プロジェクト ver.2
		// -
		if(proj.version < 2){
			// バージョン値
			proj.version = 2;

			// ニコニコ大百科
			var obj = addPreset(proj.expand_bbs,"nicovideo_dictionary","4chan");
			obj.preset = {
				name:{
					standard:"dic.nicovideo.jp",
					locales:{
						ja:"ニコニコ大百科",
						en:"dic.nicovideo.jp"
					}
				},
				enable:true,
				script_allow:"",
				script_callback:"",
				popup:{
					origin_type:"adsorb_top_bottom",
					position_type:"absolute",
					enable_animation:true,
					percent:{x:75,y:90},
					time_wait_open:0,
					time_wait_close:250,
					style_sheet:"padding:20px 10px; border:1px solid #000; background:#FFF; overflow-y:auto; word-wrap:break-word; word-break:break-all;"
				}
			};

		}
		if(exit())	return proj;

		// -
		// プロジェクト ver.3
		// -
		if(proj.version < 3){
			// バージョン値
			proj.version = 3;

			// URLマッピング設定 追加
			update(proj.urlmap,"*",function(obj){
				if(!(obj.enable_unsecure))	obj.enable_unsecure = false;
			});

			// スレッド掲示板 追加
			var obj = addPreset(proj.urlmap,"bbs","bbs");
			obj.preset.filter.push("*://unkar.org/r/*/*");

			// unkar.org
			var obj = addPreset(proj.expand_bbs,"unkar","mimizun");
			obj.preset = {
				name:{
					standard:"unkar.org",
					locales:{
						ja:"うんかー",
						en:"unkar.org"
					}
				},
				enable:true,
				script_allow:"",
				script_callback:"",
				popup:{
					origin_type:"adsorb_top_bottom",
					position_type:"absolute",
					enable_animation:true,
					percent:{x:75,y:90},
					time_wait_open:0,
					time_wait_close:250,
					style_sheet:"padding:20px 10px; border:1px solid #000; background:#FFF; overflow-y:auto; word-wrap:break-word; word-break:break-all;"
				}
			};
		}
		if(exit())	return proj;

		// -
		// プロジェクト ver.4
		// -
		if(proj.version < 4){
			// バージョン値
			proj.version = 4;

			// -
			// 基本設定
			// -
			proj.standard.enable_output_log = false;


			// -
			// 掲示板設定
			// -
			// 追加
			update(proj.expand_bbs,"*",function(obj){
				if(!(obj.filter))				obj.filter = new Array();
				if(!(obj.script_initialize))	obj.script_initialize = "";
			});

			// 削除
			updatePreset(proj.expand_bbs,"*",function(obj){
				if(obj.script_allow !== undefined)		delete obj.script_allow;
			});

			// 2ちゃんねる掲示板
			update(proj.expand_bbs,"2ch",function(obj){
				obj.filter = [
					{
						pattern:"http://.*\\.2ch\\.net/test/read\\.cgi/.*/[0-9]+",
						flags:{i:true,g:false}
					},{
						pattern:"http://.*\\.machi\\.to/bbs/read\\.cgi/.*/[0-9]+",
						flags:{i:true,g:false}
					},{
						pattern:"http://machibbs\\.net/.*/[0-9]+.html",
						flags:{i:true,g:false}
					},{
						pattern:"http://.*\\.machibbs\\.net/.*/[0-9]+.html",
						flags:{i:true,g:false}
					},{
						pattern:"http://.*\\.bbspink\\.com/test/read\\.cgi/.*/[0-9]+",
						flags:{i:true,g:false}
					},{
						pattern:"http://jbbs\\.livedoor\\.jp/bbs/read.cgi/.*/[0-9]+/[0-9]+",
						flags:{i:true,g:false}
					},{
						pattern:"http://.*\\.kakiko\\.com/test/read\\.cgi/.*/[0-9]+",
						flags:{i:true,g:false}
					},{
						pattern:"http://.*\\.60\\.kg/test/read\\.cgi/.*/[0-9]+",
						flags:{i:true,g:false}
					}
				];
				obj.script_initialize = "";
				obj.script_callback = "";
			});

			// ログ速
			update(proj.expand_bbs,"logsoku",function(obj){
				obj.filter = [
					{
						pattern:"http://logsoku\\.com/thread/.*\\.2ch\\.net/.*/[0-9]+",
						flags:{i:true,g:false}
					},{
						pattern:"http://.*\\.atchs\\.jp/test/read\\.cgi/.*/[0-9]+",
						flags:{i:true,g:false}
					}
				];
				obj.script_initialize = "";
				obj.script_callback = "";
			});

			// みみずん検索
			update(proj.expand_bbs,"mimizun",function(obj){
				obj.filter = [
					{
						pattern:"http://mimizun\\.com/log/2ch/.*/[0-9]+",
						flags:{i:true,g:false}
					},{
						pattern:"http://mimizun\\.com/log/machi/.*/[0-9]+",
						flags:{i:true,g:false}
					}
				];
				obj.script_initialize = "";
				obj.script_callback = "";
			});

			// unkar.org
			update(proj.expand_bbs,"unkar",function(obj){
				obj.filter = [
					{
						pattern:"http://unkar\\.org/r/.*/[0-9]+",
						flags:{i:true,g:false}
					}
				];
				obj.script_initialize = "";
				obj.script_callback = "";
			});

			// ふたば☆ちゃんねる
			update(proj.expand_bbs,"2chan",function(obj){
				obj.filter = [
					{
						pattern:"http://.*?\\.2chan\\.net/.*/",
						flags:{i:true,g:false}
					}
				];
			});

			// 4chan.org
			update(proj.expand_bbs,"4chan",function(obj){
				obj.filter = [
					{
						pattern:"http://boards\\.4chan\\.org/.*/",
						flags:{i:true,g:false}
					}
				];
				obj.script_callback = "";
			});

			// ニコニコ大百科
			update(proj.expand_bbs,"nicovideo_dictionary",function(obj){
				obj.filter = [
					{
						pattern:"http://dic\\.nicovideo\\.jp/b/a/.+",
						flags:{i:true,g:false}
					},{
						pattern:"http://dic\\.nicovideo\\.jp/a/.+",
						flags:{i:true,g:false}
					}

				];
				obj.script_initialize = "";
				obj.script_callback = "";
			});

			// -
			// 「ハイパーリンク置換定義」を「アンカー置換定義」に変更
			// -
			update(proj.urlmap,"*",function(obj){
				obj.replacement_to_anchor = obj.replacement_to_link;
				delete obj.replacement_to_link;
			});
			proj.replacement_to_anchor = proj.replacement_to_link;
			delete proj.replacement_to_link;


			// -
			// アクセスブロック定義
			// -
			var obj = addPreset(proj.access_block,"opera_extension",null);
			obj.preset = {
				name:{
					standard:"For Opera Extension",
					locales:{
						ja:"Opera 拡張機能用",
						en:"For Opera Extension"
					}
				},
				filter:[]
			};


			// -
			// エレメント置換定義
			// -
			// 連続するBRタグを削除
			var obj = addPreset(proj.replacement_to_element,"delete_br_tags","meiryo_font");
			obj.preset = {
				name:{
					standard:"Delete BR Tags Continuous",
					locales:{
						ja:"連続するBRタグを削除",
						en:"Delete BR Tags Continuous"
					}
				},
				script:""
			};


			// -
			// アンカー置換定義
			// -
			// イメージ検索用ポップアップ無効化
			var obj = addPreset(proj.replacement_to_anchor,"disable_popup_image_search","direct_link_realtime_search");
			obj.preset = {
				name:{
					standard:"Disable Popup (image search)",
					locales:{
						ja:"ポップアップを無効化(イメージ検索用)",
						en:"Disable Popup (image search)"
					}
				},
				script:""
			};

			// 「イメージ検索用」を破棄
			removePreset("replacement_to_anchor","direct_link_image_search");

			// ツイッター用
			var obj = addPreset(proj.replacement_to_anchor,"direct_link_twitter","direct_link_realtime_search");
			obj.preset = {
				name:{
					standard:"Direct Link (twitter.com)",
					locales:{
						ja:"直リンクに変更(ツイッター用)",
						en:"Direct Link (twitter.com)"
					}
				},
				script:""
			};


			// -
			// ハイパーリンク置換定義
			// -
			createArrayContainer("replacement_to_link");

			// イメージ検索用
			var obj = addPreset(proj.replacement_to_link,"direct_link_image_search",null);
			obj.preset = {
				name:{
					standard:"Direct Link (image search)",
					locales:{
						ja:"直リンク(イメージ検索用)",
						en:"Direct Link (image search)"
					}
				},
				filter:[
					{
						name:{
							standard:"Google",
							locales:{
								ja:"Google 画像検索",
								en:"Google"
							}
						},
						filter:[
							"*://*.google.*/imgres?*",
							"*://*.google.co.*/imgres?*",
							"*://*.google.com.*/imgres?*"
						],
						enable_reflect_to_anchor:false,
						script:""
					},{
						name:{
							standard:"Yahoo Image Search",
							locales:{
								ja:"Yahoo Image Search",
								en:"Yahoo Image Search"
							}
						},
						filter:[
							"*://images.search.yahoo.com/images/view;*"
						],
						enable_reflect_to_anchor:false,
						script:""
					},{
						name:{
							standard:"Yahoo! JAPAN",
							locales:{
								ja:"Yahoo! JAPAN 画像検索",
								en:"Yahoo! JAPAN"
							}
						},
						filter:[
							"*://ord.yahoo.co.jp/o/image/*"
						],
						enable_reflect_to_anchor:false,
						script:""
					},{
						name:{
							standard:"Bing",
							locales:{
								ja:"Bing 画像検索",
								en:"Bing"
							}
						},
						filter:[
							"*://www.bing.com/images/search?*"
						],
						enable_reflect_to_anchor:false,
						script:""
					}
				]
			};

			// 直リンク(汎用)
			var obj = addPreset(proj.replacement_to_link,"direct_link_generic","direct_link_image_search");
			obj.preset = {
				name:{
					standard:"Direct Link (generic)",
					locales:{
						ja:"直リンク(汎用)",
						en:"Direct Link (generic)"
					}
				},
				filter:[
					{
						name:{
							standard:"OGP \"og:image\"",
							locales:{
								ja:"OGP \"og:image\"",
								en:"OGP \"og:image\""
							}
						},
						filter:[
							"*://instagr.am/p/*",
							"*://www.flickr.com/photos/*/*",
							"*://lockerz.com/s/*",
							"*://pics.lockerz.com/s/*"
						],
						enable_reflect_to_anchor:false,
						script:""
					},{
						name:{
							standard:"Twitpic",
							locales:{
								ja:"Twitpic",
								en:"Twitpic"
							}
						},
						filter:[
							"*://twitpic.com/*"
						],
						enable_reflect_to_anchor:false,
						script:""
					},{
						name:{
							standard:"Twitter Photo",
							locales:{
								ja:"Twitter Photo",
								en:"Twitter Photo"
							}
						},
						filter:[
							"*://pic.twitter.com/*",
							"*://twitter.com/*/status/*/photo/*"
						],
						enable_reflect_to_anchor:false,
						script:""
					},{
						name:{
							standard:"Facebook Photo",
							locales:{
								ja:"Facebook Photo",
								en:"Facebook Photo"
							}
						},
						filter:[
							"*://www.facebook.com/photo.php?*"
						],
						enable_reflect_to_anchor:false,
						script:""
					},{
						name:{
							standard:"Tumblr",
							locales:{
								ja:"Tumblr",
								en:"Tumblr"
							}
						},
						filter:[
							"*://*.tumblr.com/post/*"
						],
						enable_reflect_to_anchor:false,
						script:""
					},{
						name:{
							standard:"Photozou Photo",
							locales:{
								ja:"フォト蔵",
								en:"Photozou Photo"
							}
						},
						filter:[
							"*://photozou.jp/photo/show/*/*"
						],
						enable_reflect_to_anchor:false,
						script:""
					},{
						name:{
							standard:"Twipple Photo",
							locales:{
								ja:"ついっぷる",
								en:"Twipple Photo"
							}
						},
						filter:[
							"*://p.twipple.jp/*"
						],
						enable_reflect_to_anchor:false,
						script:""
					},{
						name:{
							standard:"NICONICO SEIGA (must log in)",
							locales:{
								ja:"ニコニコ静画 (ログインが必要)",
								en:"NICONICO SEIGA (must log in)"
							}
						},
						filter:[
							"*://seiga.nicovideo.jp/seiga/im*",
							"*://nico.ms/im*"
						],
						enable_reflect_to_anchor:false,
						script:""
					},{
						name:{
							standard:"pixiv (must referer)",
							locales:{
								ja:"ピクシブ (リファラが必要)",
								en:"pixiv (must referer)"
							}
						},
						filter:[
							"*://www.pixiv.net/member_illust.php?*illust_id*"
						],
						enable_reflect_to_anchor:false,
						script:""
					}
				]
			};

			// -
			// リファラ置換定義
			// -
			// 追加
			update(proj.replacement_to_referer,"*",function(obj){
				if(!(obj.filter))	obj.filter = new Array();
			});

			// 削除
			updatePreset(proj.replacement_to_referer,"*",function(obj){
				if(obj.script !== undefined)		delete obj.script;
			});

			// 空文字列に変更
			update(proj.replacement_to_referer,"replacement_empty",function(obj){
				obj.filter = [
					{
						name:{
							standard:"Empty",
							locales:{
								ja:"空文字列",
								en:"Empty"
							}
						},
						filter:[
							"*://*"
						],
						send_referer:{
							type:"custom",
							custom:"",
							regexp:{
								pattern:"",
								flags:{i:false,g:false}
							},
							replacement:""
						}
					}
				];
			});

			// リンク先のURLに変更
			var obj = addPreset(proj.replacement_to_referer,"replacement_link_url","replacement_link");
			obj.preset = {
				name:{
					standard:"Replace Link URL",
					locales:{
						ja:"リンク先のURLに変更",
						en:"Replace Link URL"
					}
				},
				filter:[
					{
						name:{
							standard:"Link URL",
							locales:{
								ja:"リンク先のURL",
								en:"Link URL"
							}
						},
						filter:[
							"*://*"
						],
						send_referer:{
							type:"link_url",
							custom:"",
							regexp:{
								pattern:"",
								flags:{i:false,g:false}
							},
							replacement:""
						}
					}
				]
			};

			// リンク先のディレクトリに変更
			var obj = addPreset(proj.replacement_to_referer,"replacement_link_directory","replacement_link");
			obj.preset = {
				name:{
					standard:"Replace Link Directory",
					locales:{
						ja:"リンク先のカレントディレクトリに変更",
						en:"Replace Link Directory"
					}
				},
				filter:[
					{
						name:{
							standard:"Link Directory",
							locales:{
								ja:"リンク先のディレクトリ",
								en:"Link Directory"
							}
						},
						filter:[
							"*://*"
						],
						send_referer:{
							type:"link_url",
							custom:"",
							regexp:{
								pattern:"^(http|https|ftp)(:\\/\\/.*\\/).*",
								flags:{i:true,g:false}
							},
							replacement:"\\1\\2"
						}
					}
				]
			};

			// リンク先のドメインに変更
			var obj = addPreset(proj.replacement_to_referer,"replacement_link_domain","replacement_link_directory");
			obj.preset = {
				name:{
					standard:"Replace Link Domain",
					locales:{
						ja:"リンク先のドメインに変更",
						en:"Replace Link Domain"
					}
				},
				filter:[
					{
						name:{
							standard:"Link Domain",
							locales:{
								ja:"リンク先のドメイン",
								en:"Link Domain"
							}
						},
						filter:[
							"*://*"
						],
						send_referer:{
							type:"link_url",
							custom:"",
							regexp:{
								pattern:"^(http|https|ftp)(:\\/\\/.*?\\/).*",
								flags:{i:true,g:false}
							},
							replacement:"\\1\\2"
						}
					}
				]
			};

			// 古い「リンク先のURL」を破棄
			removePreset("replacement_to_referer","replacement_link");


			// -
			// ユーザーエージェント置換定義
			// -
			// 追加
			update(proj.replacement_to_useragent,"*",function(obj){
				if(!(obj.filter))	obj.filter = new Array();
			});

			// 削除
			updatePreset(proj.replacement_to_useragent,"*",function(obj){
				if(obj.script !== undefined)		delete obj.script;
			});

			// iPhone4
			update(proj.replacement_to_useragent,"iphone_4",function(obj){
				obj.filter = [
					{
						name:{
							standard:"iPhone4",
							locales:{
								ja:"iPhone4",
								en:"iPhone4"
							}
						},
						filter:[
							"*://*"
						],
						send_useragent:{
							custom:"Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_0 like Mac OS X; en-us) AppleWebKit/532.9 (KHTML, like Gecko) Version/4.0.5 Mobile/8A293 Safari/6531.22.7"
						}
					}
				];
			});

			// Android 2.1
			update(proj.replacement_to_useragent,"android_2_1",function(obj){
				obj.filter = [
					{
						name:{
							standard:"Android 2.1",
							locales:{
								ja:"Android 2.1",
								en:"Android 2.1"
							}
						},
						filter:[
							"*://*"
						],
						send_useragent:{
							custom:"Mozilla/5.0 (Linux; U; Android 2.1-update1; ja-jp; XXX Build/RA201) AppleWebKit/530.17 (KHTML, like Gecko) Version/4.0 Mobile Safari/530.17"
						}
					}
				];
			});

			// DoCoMo/2.0
			update(proj.replacement_to_useragent,"docomo_2_0",function(obj){
				obj.filter = [
					{
						name:{
							standard:"DoCoMo / 2.0",
							locales:{
								ja:"DoCoMo / 2.0",
								en:"DoCoMo / 2.0"
							}
						},
						filter:[
							"*://*"
						],
						send_useragent:{
							custom:"DoCoMo/2.0 XXX(c100;TB)"
						}
					}
				];
			});


			// -
			// 短縮 URL 展開
			// -
			// 詳細
			var obj = getPreset(proj.expand_short_url,"detail");
			obj.filter.splice(7,0,
				"http://pic.twitter.com/*",
				"http://tmblr.co/*"
			);


			// -
			// テキスト展開定義
			// -
			// インライン表示
			var obj = addPreset(proj.expand_text,"inline",null);
			obj.preset.inline.script_allow = "";


			// -
			// イメージ展開定義
			// -
			// サムネイル表示
			var obj = addPreset(proj.expand_image,"thumbnail",null);
			obj.preset.thumbnail.script_allow = "";

			// ポップアップ表示
			var obj = addPreset(proj.expand_image,"popup",null);
			obj.preset.popup.script_allow = "";


			// -
			// サウンド展開定義
			// -
			// インライン表示
			var obj = addPreset(proj.expand_sound,"inline",null);
			obj.preset.inline.script_allow = "";


			// -
			// ビデオ展開定義
			// -
			// 追加
			update(proj.expand_video,"*",function(obj){
				if(!(obj.nicovideo.visible_thumbnail_seiga))	obj.nicovideo.visible_thumbnail_seiga = true;
				if(!(obj.liveleak))								obj.liveleak = new Object();
				if(!(obj.liveleak.visible_video))				obj.liveleak.visible_video = true;
			});

			// インライン表示
			var obj = addPreset(proj.expand_video,"inline",null);
			obj.preset.video_element.script_allow = "";


			// -
			// インラインフレーム展開定義
			// -
			// Flash のインライン表示
			var obj = addPreset(proj.expand_iframe,"expand_flash_inline",null);
			obj.preset.inline.script_allow = "";

			// PDF のインライン表示
			var obj = addPreset(proj.expand_iframe,"expand_pdf_inline",null);
			obj.preset.inline.script_allow = "";


			// -
			// スタイルシート定義
			// -
			// 追加
			update(proj.style_sheet,"*",function(obj){
				var inline = obj.expand_video.inline;
				if(!(inline.nicovideo.thumbnail_seiga))	inline.nicovideo.thumbnail_seiga = "";
				if(!(inline.liveleak))					inline.liveleak = new Object();
				if(!(inline.liveleak.video))			inline.liveleak.video = "";
			});

			// デフォルト
			update(proj.style_sheet,"default",function(obj){
				obj.expand_video.inline.nicovideo.thumbnail_seiga = "margin:2px 0px 2px 0px; border:1px #000 solid; padding:1px; background-color:#FFF; width:312px; height:176px;";
				obj.expand_video.inline.liveleak.video = "margin:2px 0px 2px 0px; border:1px #000 solid; background-color:#000; width:640px; height:360px;";
			});

			// シンプル
			update(proj.style_sheet,"simple",function(obj){
				obj.expand_video.inline.nicovideo.thumbnail_seiga = "margin:2px 0px 2px 0px; width:312px; height:176px; border:0px;";
				obj.expand_video.inline.liveleak.video = "margin:2px 0px 2px 0px; width:640px; height:360px; border:0px;";
			});


			// -
			// URLマッピング設定
			// -
			// 追加
			update(proj.urlmap,"*",function(obj){
				if(!(obj.replacement_to_link))		obj.replacement_to_link = new Object();

				var replacement_to_link = obj.replacement_to_link;
				if(!(replacement_to_link.enable))	replacement_to_link.enable = false;
				if(!(replacement_to_link.id))		replacement_to_link.id = "";
			});

			// twitter
			var preset = getPreset(proj.urlmap,"twitter");
			preset.replacement_to_anchor = {enable:true,id:"direct_link_twitter"};
			preset.replacement_to_link = {enable:true,id:"direct_link_generic"};
			preset.replacement_to_referer = {enable:true,id:"replacement_link_url"};

			// スレッド掲示板
			var preset = getPreset(proj.urlmap,"bbs");
			preset.replacement_to_link = {enable:true,id:"direct_link_generic"};
			preset.replacement_to_referer = {enable:true,id:"replacement_link_url"};

			// 画像掲示板
			var preset = getPreset(proj.urlmap,"image_bbs");
			preset.replacement_to_link = {enable:true,id:"direct_link_generic"};
			preset.replacement_to_referer = {enable:true,id:"replacement_link_url"};

			// 画像検索サイト
			var obj = addPreset(proj.urlmap,"image_search",null);
			obj.preset.replacement_to_referer = {enable:true,id:"replacement_link_url"};
			obj.preset.replacement_to_anchor = {enable:true,id:"disable_popup_image_search"};
			obj.preset.replacement_to_link = {enable:true,id:"direct_link_image_search"};
			obj.preset.filter = [
				"*://*.google.at/search?*tbm=isch*",
				"*://*.google.be/search?*tbm=isch*",
				"*://*.google.ca/search?*tbm=isch*",
				"*://*.google.ch/search?*tbm=isch*",
				"*://*.google.de/search?*tbm=isch*",
				"*://*.google.es/search?*tbm=isch*",
				"*://*.google.fr/search?*tbm=isch*",
				"*://*.google.it/search?*tbm=isch*",
				"*://*.google.nl/search?*tbm=isch*",
				"*://*.google.no/search?*tbm=isch*",
				"*://*.google.pl/search?*tbm=isch*",
				"*://*.google.ru/search?*tbm=isch*",
				"*://*.google.se/search?*tbm=isch*",
				"*://*.google.co.id/search?*tbm=isch*",
				"*://*.google.co.in/search?*tbm=isch*",
				"*://*.google.co.jp/search?*tbm=isch*",
				"*://*.google.co.th/search?*tbm=isch*",
				"*://*.google.co.uk/search?*tbm=isch*",
				"*://*.google.co.za/search?*tbm=isch*",
				"*://*.google.com/search?*tbm=isch*",
				"*://*.google.com.ar/search?*tbm=isch*",
				"*://*.google.com.au/search?*tbm=isch*",
				"*://*.google.com.br/search?*tbm=isch*",
				"*://*.google.com.mx/search?*tbm=isch*",
				"*://*.google.com.sa/search?*tbm=isch*",
				"*://*.google.com.tr/search?*tbm=isch*",
				"*://*.google.com.tw/search?*tbm=isch*",
				"*://www.google.at/images?*",
				"*://www.google.be/images?*",
				"*://www.google.ca/images?*",
				"*://www.google.ch/images?*",
				"*://www.google.de/images?*",
				"*://www.google.es/images?*",
				"*://www.google.fr/images?*",
				"*://www.google.it/images?*",
				"*://www.google.nl/images?*",
				"*://www.google.no/images?*",
				"*://www.google.pl/images?*",
				"*://www.google.ru/images?*",
				"*://www.google.se/images?*",
				"*://www.google.co.id/images?*",
				"*://www.google.co.in/images?*",
				"*://www.google.co.jp/images?*",
				"*://www.google.co.th/images?*",
				"*://www.google.co.uk/images?*",
				"*://www.google.co.za/images?*",
				"*://www.google.com/images?*",
				"*://www.google.com.ar/images?*",
				"*://www.google.com.au/images?*",
				"*://www.google.com.br/images?*",
				"*://www.google.com.mx/images?*",
				"*://www.google.com.sa/images?*",
				"*://www.google.com.tr/images?*",
				"*://www.google.com.tw/images?*",
				"*://images.search.yahoo.com/search/images*",
				"*://image.search.yahoo.co.jp/search?*",
				"*://www.bing.com/images/search?*"
			];

		}
		if(exit())	return proj;

		// -
		// プロジェクト ver.5
		// -
		if(proj.version < 5){
			// バージョン値
			proj.version = 5;

			// -
			// テキスト置換定義
			// -
			// 空白とタブを可視化
			var obj = addPreset(proj.replacement_to_text,"visualize_space_and_tab",null);
			obj.preset = {
				name:{
					standard:"Visualize spaces and tabs",
					locales:{
						ja:"空白とタブを可視化",
						en:"Visualize spaces and tabs"
					}
				},
				script:""
			};

			// -
			// ハイパーリンク置換定義
			// -
			// 直リンク(汎用)
			updatePreset(proj.replacement_to_link,"direct_link_generic",function(obj){
				obj.filter[0].filter.splice(0,0,"*://instagram.com/p/*");
				obj.filter.splice(1,0,{
					name:{
						standard:"OGP \"twitter:*\"",
						locales:{
							ja:"OGP \"twitter:*\"",
							en:"OGP \"twitter:*\""
						}
					},
					filter:[],
					enable_reflect_to_anchor:false,
					script:""
				});
			});

			// イメージ検索用
			updatePreset(proj.replacement_to_link,"direct_link_image_search",function(obj){

				obj.filter[1].filter.push("*://*.images.search.yahoo.com/images/view;*");
				obj.filter[1].filter.push("*://*.image.search.yahoo.com/images/view;*");

				obj.filter.splice(3,0,{
					name:{
						standard:"yahoo.cn",
						locales:{
							ja:"yahoo.cn",
							en:"yahoo.cn"
						}
					},
					filter:[
						"http://image.yahoo.cn/view?*"
					],
					enable_reflect_to_anchor:false,
					script:""
				});

				obj.filter.push({
					name:{
						standard:"Ask.com",
						locales:{
							ja:"Ask 画像検索",
							en:"Ask.com"
						}
					},
					filter:[
						"*://*.ask.com/fr?*"
					],
					enable_reflect_to_anchor:false,
					script:""
				});

				obj.filter.push({
					name:{
						standard:"AOL Image Search",
						locales:{
							ja:"AOL 画像検索",
							en:"AOL Image Search"
						}
					},
					filter:[
						"*://search.aol.*/aol/imageDetails?*"
					],
					enable_reflect_to_anchor:false,
					script:""
				});

				obj.filter.push({
					name:{
						standard:"goo",
						locales:{
							ja:"goo 画像検索",
							en:"goo"
						}
					},
					filter:[
						"*://*bsearch.goo.ne.jp/image_detail.php?*DOC_ID=*",
						"*://*bsearch.goo.ne.jp/similarity.php?*DOC_ID=*",
						"*://*bsearch.goo.ne.jp/imgdt.php?*DOC_ID=*"
					],
					enable_reflect_to_anchor:false,
					script:""
				});

				obj.filter.push({
					name:{
						standard:"Baidu",
						locales:{
							ja:"百度",
							en:"Baidu"
						}
					},
					filter:[
						"http://image.baidu.com/i*"
					],
					enable_reflect_to_anchor:false,
					script:""
				});

				obj.filter.push({
					name:{
						standard:"Baidu.jp",
						locales:{
							ja:"Baidu.jp",
							en:"Baidu.jp"
						}
					},
					filter:[
						"http://image.baidu.jp/*baiduimagedetail*di=*"
					],
					enable_reflect_to_anchor:false,
					script:""
				});

				obj.filter.push({
					name:{
						standard:"NAVER",
						locales:{
							ja:"NAVER 画像検索",
							en:"NAVER"
						}
					},
					filter:[
						"http://imagesearch.naver.com/search*",
						"http://image.search.naver.com/search*"
					],
					enable_reflect_to_anchor:false,
					script:""
				});

				obj.filter.push({
					name:{
						standard:"naver.jp",
						locales:{
							ja:"naver.jp",
							en:"naver.jp"
						}
					},
					filter:[
						"http://*search.naver.jp/image?*",
						"http://image.search.biglobe.ne.jp/search?*"
					],
					enable_reflect_to_anchor:false,
					script:""
				});
			});

			// ウィキペディア用
			var obj = addPreset(proj.replacement_to_link,"direct_link_wikipedia",null);
			obj.preset = {
				name:{
					standard:"Direct Link (wikipedia.org)",
					locales:{
						ja:"直リンク(ウィキペディア用)",
						en:"Direct Link (wikipedia.org)"
					}
				},
				filter:[
					{
						name:{
							standard:"File:",
							locales:{
								ja:"ファイル:",
								en:"File:"
							}
						},
						filter:[
							"*://*.wikipedia.org/wiki/*:*",
							"*://*.wikipedia.org/w/*:*",
							"*://*.wikimedia.org/wiki/*:*",
							"*://*.wikimedia.org/w/*:*"
						],
						enable_reflect_to_anchor:false,
						script:""
					}
				]
			};

			// -
			// サウンド展開定義
			// -
			// 追加
			update(proj.expand_sound,"*",function(obj){
				if(!obj.audio_element)	obj.audio_element = new Object();
				obj.audio_element.script_allow = "";

				if(!obj.soundcloud)		obj.soundcloud = new Object();
				obj.soundcloud.visible_player_flash = true;
				obj.soundcloud.visible_player_html5 = false;

				if(!obj.mixcloud)		obj.mixcloud = new Object();
				obj.mixcloud.visible_player = true;

				obj.inline.script_allow = "";
				obj.inline.script_insert = "";
				obj.inline.sound_max = 10;
			});


			// -
			// スタイルシート定義
			// -
			// 追加
			update(proj.style_sheet,"*",function(obj){
				var inline = new Object();
				if(!(inline.audio_element))				inline.audio_element = new Object();
				inline.audio_element.audio = obj.expand_sound.inline;

				if(!(inline.soundcloud))				inline.soundcloud = new Object();
				if(!(inline.mixcloud))					inline.mixcloud = new Object();

				obj.expand_sound.inline = inline;
			});

			// デフォルト
			update(proj.style_sheet,"default",function(obj){
				obj.expand_sound.inline.soundcloud.player_flash = "margin:2px 0px 2px 0px; border:1px #000 solid; padding:1px; background-color:#FFF; width:100%;";
				obj.expand_sound.inline.soundcloud.player_html5 = "margin:2px 0px 2px 0px; border:1px #000 solid; padding:1px; background-color:#FFF; width:100%;";
				obj.expand_sound.inline.mixcloud.player = "margin:2px 0px 2px 0px; border:1px #000 solid; padding:1px; background-color:#FFF; width:460px; height:68px;";
			});

			// シンプル
			update(proj.style_sheet,"simple",function(obj){
				obj.expand_sound.inline.soundcloud.player_flash = "margin:2px 0px 2px 0px; width:100%; border:0px;";
				obj.expand_sound.inline.soundcloud.player_html5 = "margin:2px 0px 2px 0px; width:100%; border:0px;";
				obj.expand_sound.inline.mixcloud.player = "margin:2px 0px 2px 0px; width:460px; border:0px; height:68px;";
			});

			// -
			// URLマッピング設定
			// -
			// 追加
			update(proj.urlmap,"*",function(obj){
				// マルチ化
				if(obj.replacement_to_element.enable){
					obj.replacement_to_element.id = [obj.replacement_to_element.id];
				}else{
					obj.replacement_to_element.id = [];
				}
				if(obj.replacement_to_text.enable){
					obj.replacement_to_text.id = [obj.replacement_to_text.id];
				}else{
					obj.replacement_to_text.id = [];
				}
				if(obj.replacement_to_anchor.enable){
					obj.replacement_to_anchor.id = [obj.replacement_to_anchor.id];
				}else{
					obj.replacement_to_anchor.id = [];
				}
			});

			// リアルタイム検索用
			var preset = getPreset(proj.urlmap,"realtime_search");
			preset.replacement_to_anchor.id.push("no_referrer");
			preset.filter.push("*://search.goo.ne.jp/web.jsp?*from=lside_twitter*");
			preset.filter.push("*://search.goo.ne.jp/web.jsp?*mode=1*");
			preset.replacement_to_link = {enable:true,id:"direct_link_generic"};
			preset.expand_short_url = {enable:true,id:"detail"};

			// 検索サイト
			var preset = getPreset(proj.urlmap,"search");
			preset.replacement_to_anchor.id.push("no_referrer");

			// twitter
			var preset = getPreset(proj.urlmap,"twitter");
			preset.replacement_to_anchor.id.push("no_referrer");

			// スレッド掲示板
			var preset = getPreset(proj.urlmap,"bbs");
			preset.replacement_to_anchor.id.push("no_referrer");

			// 画像検索サイト
			var preset = getPreset(proj.urlmap,"image_search");
			preset.replacement_to_anchor.id.push("no_referrer");
			preset.filter.splice(55,0,"*://*.images.search.yahoo.com/search/images*");
			preset.filter.splice(56,0,"*://*.image.search.yahoo.com/search/images*");
			preset.filter.splice(58,0,"*://image.yahoo.cn/s?*");
			preset.filter.push("*://*.ask.com/pictures?*");
			preset.filter.push("*://search.aol.com/aol/image?*");
			preset.filter.push("*://search.aol.jp/aol/image?*");
			preset.filter.push("*://*bsearch.goo.ne.jp/image.php?*MT=*");
			preset.filter.push("*://*bsearch.goo.ne.jp/scrimg.php?*MT=*");
			preset.filter.push("*://*bsearch.goo.ne.jp/similarity.php?*MT=*");
			preset.filter.push("*://image.baidu.com/*");
			preset.filter.push("*://image.baidu.jp/*");
			preset.filter.push("*://image.search.naver.com/*");
			preset.filter.push("*://*search.naver.jp/image?*");
			preset.filter.push("*://image.search.biglobe.ne.jp/search?*");

			// ウィキペディア
			var obj = addPreset(proj.urlmap,"wikipedia","default");
			obj.preset = {
				name:{
					standard:"Wikipedia",
					locales:{
						ja:"ウィキペディア",
						en:"Wikipedia"
					}
				},
				enable:true,
				filter:[
					"*://*.wikipedia.org/*"
				],
				enable_unsecure:false,
				access_block:{enable:false,id:""},
				replacement_to_element:{enable:false,id:[]},
				replacement_to_text:{enable:false,id:[]},
				replacement_to_anchor:{enable:true,id:["no_referrer"]},
				replacement_to_link:{enable:true,id:"direct_link_wikipedia"},
				replacement_to_referer:{enable:false,id:""},
				replacement_to_useragent:{enable:false,id:""},
				make_link_to_text:{enable:true,id:"simple"},
				expand_short_url:{enable:true,id:"simple"},
				expand_text:{enable:false,id:""},
				expand_image:{enable:true,id:"popup"},
				expand_sound:{enable:true,id:"inline"},
				expand_video:{enable:true,id:"inline"},
				expand_iframe:{enable:false,id:""},
				style_sheet:{enable:true,id:"default"},
				experimental:{enable:false,id:""}
			};
		}
		if(exit())	return proj;

		// -
		// プロジェクト ver.6
		// -
		if(proj.version < 6){
			// バージョン値
			proj.version = 6;

			// -
			// ハイパーリンク置換定義
			// -
			// イメージ検索用
			updatePreset(proj.replacement_to_link,"direct_link_image_search",function(obj){

				obj.filter.splice(7,0,{
					name:{
						standard:"Yandex Images",
						locales:{
							ja:"Yandex 画像検索",
							en:"Yandex Images"
						}
					},
					filter:[
						"http://images.yandex.ru/yandsearch?*",
						"http://images.yandex.com/yandsearch?*"
					],
					enable_reflect_to_anchor:false,
					script:""
				});

			});

			// -
			// URLマッピング設定
			// -
			// 画像検索サイト
			var preset = getPreset(proj.urlmap,"image_search");
			preset.filter.splice(63,0,"*://images.yandex.ru/*");
			preset.filter.splice(64,0,"*://images.yandex.com/*");

		}
		if(exit())	return proj;

		// -
		// プロジェクト ver.7
		// -
		if(proj.version < 7){
			// バージョン値
			proj.version = 7;

			// -
			// 掲示板設定
			// -
			// ログ速
			update(proj.expand_bbs,"logsoku",function(obj){
				obj.filter = [
					{
						pattern:"http://logsoku\\.com/thread/.*\\.2ch\\.net/.*?/[0-9]+",
						flags:{i:true,g:false}
					},{
						pattern:"http://.*?\\.logsoku\\.com/r/.*?/[0-9]+",
						flags:{i:true,g:false}
					},{
						pattern:"http://logsoku\\.com/r/.*?/[0-9]+",
						flags:{i:true,g:false}
					}
				];
				obj.script_initialize = "";
				obj.script_callback = "";
			});

			// あっとちゃんねるず
			var obj = addPreset(proj.expand_bbs,"atchs","unkar");
			obj.preset = {
				name:{
					standard:"atchs.jp",
					locales:{
						ja:"あっとちゃんねるず",
						en:"atchs.jp"
					}
				},
				enable:true,
				filter:[],
				script_initialize:"",
				script_callback:"",
				popup:{
					origin_type:"adsorb_top_bottom",
					position_type:"absolute",
					enable_animation:true,
					percent:{x:75,y:90},
					time_wait_open:0,
					time_wait_close:250,
					style_sheet:"padding:20px 10px; border:1px solid #000; background:#FFF; overflow-y:auto; word-wrap:break-word; word-break:break-all;"
				}
			};

			// -
			// アクセスブロック定義
			// -
			var obj = addPreset(proj.access_block,"firefox_extension","opera_extension");
			obj.preset = {
				name:{
					standard:"For Firefox Extension",
					locales:{
						ja:"Firefox 拡張機能用",
						en:"For Firefox Extension"
					}
				},
				filter:[]
			};

			// -
			// リファラ置換定義
			// -
			update(proj.replacement_to_referer,"*",function(obj){
				var filter = obj.filter;
				var i;
				var num = filter.length;
				for(i=0;i<num;i++){
					var send_referer = filter[i].send_referer;
					var str = send_referer.replacement.replace(new RegExp("[$]","g"), "$$$$");
					send_referer.replacement = str.replace(new RegExp("\\\\\\\\|\\\\[0-9]","g"),function(str, p1, p2) {
						if(str == "\\\\")	return "\\";
						return "$" + str[1];
					});
				}
			});
			var obj = addPreset(proj.replacement_to_referer,"firefox_extension",null);
			obj.preset = {
				name:{
					standard:"For Firefox Extension",
					locales:{
						ja:"Firefox 拡張機能用",
						en:"For Firefox Extension"
					}
				},
				filter:[]
			};

			// -
			// ユーザーエージェント置換定義
			// -
			var obj = addPreset(proj.replacement_to_useragent,"firefox_extension",null);
			obj.preset = {
				name:{
					standard:"For Firefox Extension",
					locales:{
						ja:"Firefox 拡張機能用",
						en:"For Firefox Extension"
					}
				},
				filter:[]
			};

			// -
			// ハイパーリンク置換定義
			// -
			// 追加
			updatePreset(proj.replacement_to_link,"*",function(obj){
				var filter = obj.filter;
				var i;
				var num = filter.length;
				for(i=0;i<num;i++){
					filter[i].enable_cache = true;
				}
			});

			// -
			// 短縮 URL 展開
			// -
			// 簡易
			var obj = getPreset(proj.expand_short_url,"simple");
			obj.filter[7] = "*://t.co/*";
			// 詳細
			var obj = getPreset(proj.expand_short_url,"detail");
			obj.filter[6] = "*://t.co/*";

			// -
			// URLマッピング設定
			// -
			// スレッド掲示板 追加
			var obj = addPreset(proj.urlmap,"bbs","bbs");
			obj.preset.filter.splice(8,0,"*://*.logsoku.com/*");

		}
		if(exit())	return proj;

		// -
		// プロジェクト ver.8
		// -
		if(proj.version < 8){
			// バージョン値
			proj.version = 8;

			// -
			// ハイパーリンク置換定義
			// -
			// イメージ検索用
			updatePreset(proj.replacement_to_link,"direct_link_image_search",function(obj){
				var filter = obj.filter;

				// naver.jp
				filter[12].enable_cache = false;
			});

			// -
			// イメージ展開定義
			// -
			// 追加
			update(proj.expand_image,"*",function(obj){
				var enable_animation = false;
				if(obj.popup.enable_animation){
					enable_animation = true;
				}
				obj.popup.enable_animation_scale = enable_animation;
				obj.popup.enable_animation_alpha = enable_animation;
				delete obj.popup.enable_animation;

				if((obj.popup.load_type) === undefined)				obj.popup.load_type = "preload";
				if((obj.thumbnail.load_type) === undefined)			obj.thumbnail.load_type ="preload";

				if((obj.load) === undefined)					obj.load = new Object();
				if((obj.load.enable_notify) === undefined)			obj.load.enable_notify = true;
				if((obj.load.enable_unload) === undefined)			obj.load.enable_unload = false;
				if((obj.load.unload_allow_size_more_then) === undefined)	obj.load.unload_allow_size_more_then = 256;
			});

		}
		if(exit())	return proj;

		// -
		// プロジェクト ver.9
		// -
		if(proj.version < 9){
			// バージョン値
			proj.version = 9;

			// -
			// ハイパーリンク置換定義
			// -
			// 直リンク(汎用)
			updatePreset(proj.replacement_to_link,"direct_link_generic",function(obj){
				var filter = obj.filter;

				// OGP "og:image"
				filter[0].filter.push("*://twitter.yfrog.com/*");
				filter[0].filter.push("*://yfrog.com/*");

				// OGP "twitter:*"
				filter[1].filter.push("*://campl.us/*");

				// Giphy
				filter.splice(6,0,{
					name:{
						standard:"giphy.com",
						locales:{
							ja:"giphy.com",
							en:"giphy.com"
						}
					},
					filter:[
						"*://giphy.com/gifs/*",
						"*://giphy.com/embed/*"
					],
					enable_reflect_to_anchor:false,
					enable_cache:true,
					script:""
				});

				// Gyazo
				filter.splice(7,0,{
					name:{
						standard:"gyazo.com",
						locales:{
							ja:"Gyazo",
							en:"gyazo.com"
						}
					},
					filter:[
						"*://gyazo.com/*"
					],
					enable_reflect_to_anchor:false,
					enable_cache:true,
					script:""
				});
			});

			// -
			// 短縮 URL 展開
			// -
			// 詳細
			var obj = getPreset(proj.expand_short_url,"detail");
			obj.filter.push("http://gph.is/*");

		}
		if(exit())	return proj;

		// -
		// プロジェクト ver.10
		// -
		if(proj.version < 10){
			// バージョン値
			proj.version = 10;

			// -
			// 掲示板設定
			// -
			// 4chan.org
			var obj = addPreset(proj.expand_bbs,"4chan",null);
			var preset = obj.preset;
			preset.name = {
				standard:"4chan.org (Image Boards)",
				locales:{
					ja:"4chan (Image Boards)",
					en:"4chan.org (Image Boards)"
				}
			};
			preset.filter = [
				{
					pattern:"^(http|https)://boards\\.4chan\\.org/.*/",
					flags:{i:true,g:false}
				}
			];
			preset.popup.style_sheet = "padding:20px 10px; border:1px solid #000; overflow-y:auto; word-wrap:break-word; word-break:break-all; display:block;";

			// ニコニコ大百科
			var obj = addPreset(proj.expand_bbs,"nicovideo_dictionary",null);
			var preset = obj.preset;
			preset.filter = [
				{
					pattern:"^http://dic\\.nicovideo\\.jp/b/(a|c|i|l|u|v)/.+",
					flags:{i:true,g:false}
				},{
					pattern:"^http://dic\\.nicovideo\\.jp/(a|c|i|l|u|v)/.+",
					flags:{i:true,g:false}
				}
			];

			// -
			// アンカー置換定義
			// -
			// リンク先をツールチップで表示
			var obj = addPreset(proj.replacement_to_anchor,"display_url_in_tooltip","attach_sns_counter");

			obj.preset = {
				name:{
					standard:"Display URL in the ToolTip",
					locales:{
						ja:"ツールチップにリンク先を表示",
						en:"Display URL in the ToolTip"
					}
				},
				script:""
			};

			// -
			// ハイパーリンク置換定義
			// -
			// 直リンク(汎用)
			updatePreset(proj.replacement_to_link,"direct_link_generic",function(obj){
				var filter = obj.filter;

				// Google+ Photo
				filter.splice(5,0,{
					name:{
						standard:"Google+ Photo",
						locales:{
							ja:"Google+ Photo",
							en:"Google+ Photo"
						}
					},
					filter:[
						"*://plus.google.com/*photos/*/albums/*"
					],
					enable_reflect_to_anchor:false,
					enable_cache:true,
					script:""
				});

				// Picasa Photo
				filter.splice(6,0,{
					name:{
						standard:"Picasa Photo",
						locales:{
							ja:"Picasa Photo",
							en:"Picasa Photo"
						}
					},
					filter:[
						"*://picasaweb.google.com/lh/photo/*",
						"*://picasaweb.google.com/*/*?*#*",
						"*://picasaweb.google.com/*/*#*"
					],
					enable_reflect_to_anchor:false,
					enable_cache:true,
					script:""
				});

				// ついっぷる (直リンク)
				filter.splice(12,0,{
						name:{
							standard:"Twipple Photo (Direct Link)",
							locales:{
								ja:"ついっぷる (直リンク)",
								en:"Twipple Photo (Direct Link)"
							}
						},
						filter:[
							"*://p.twpl.jp/show/*"
						],
						enable_reflect_to_anchor:false,
						enable_cache:true,
						script:""
				});

				// ピクシブ
				filter[14].filter.push("*://touch.pixiv.net/member_illust.php?*illust_id*");
			});

			// -
			// イメージ展開定義
			// -
			// 画像掲示板用
			var obj = addPreset(proj.expand_image,"image_bbs",null);
			obj.preset = {
					name:{
						standard:"For www.4chan.org",
						locales:{
							ja:"画像掲示板用",
							en:"For www.4chan.org"
						}
					},
					thumbnail:{
						enable_popup_mouseover:true,
						disable_same_image:false,
						load_type:"preload",
						script_allow:"",
						script_insert:""
					},
				popup:{
					origin_type:"center",
					position_type:"absolute",
					time_wait_open:0,
					time_wait_close:0,
					enable_animation_scale:true,
					enable_animation_alpha:true,
					load_type:"preload",
					script_allow:""
				},
				reduced_image:{
					enable_popup:true,
					popup_allow_slcale_less_then:70
				},
				load:{
					enable_notify:true,
					enable_unload:false,
					unload_allow_size_more_then:256
				}
			};

			// -
			// URLマッピング設定
			// -
			// 画像検索サイト
			updatePreset(proj.urlmap,"image_bbs",function(obj){
				obj.expand_image.id = "image_bbs";
			});

		}
		if(exit())	return proj;

		// -
		// プロジェクト ver.11
		// -
		if(proj.version < 11){
			// バージョン値
			proj.version = 11;

			// -
			// エレメント置換定義
			// -
			createArrayContainer("replacement_to_element");

			// 追加
			update(proj.replacement_to_element,"*",function(obj){
				if(!(obj.name))						obj.name = new Object();
				if(!(obj.name.standard))			obj.name.standard = "";
				if(!(obj.name.locales))				obj.name.locales = new Object();

				if(!(obj.script))	obj.script = "";
			});

			// -
			// エレメント置換定義
			// -
			// 展開アシスト(画像検索用)
			var obj = addPreset(proj.replacement_to_element,"assist_image_search",null);
			obj.preset = {
				name:{
					standard:"Assist Expand (image search)",
					locales:{
						ja:"展開アシスト(画像検索用)",
						en:"Assist Expand (image search)"
					}
				},
				script:""
			};

			// 展開アシスト(ツイッター用)
			var obj = addPreset(proj.replacement_to_element,"assist_twitter",null);
			obj.preset = {
				name:{
					standard:"Assist Expand (twitter)",
					locales:{
						ja:"展開アシスト(ツイッター用)",
						en:"Assist Expand (twitter)"
					}
				},
				script:""
			};

			// 展開アシスト(ピクシブ用)
			var obj = addPreset(proj.replacement_to_element,"assist_pixiv",null);
			obj.preset = {
				name:{
					standard:"Assist Expand (pixiv)",
					locales:{
						ja:"展開アシスト(ピクシブ用)",
						en:"Assist Expand (pixiv)"
					}
				},
				script:""
			};

			// -
			// アンカー置換定義
			// -
			// 直リンクに変更(フェイスブック用)
			var obj = addPreset(proj.replacement_to_anchor,"direct_link_facebook","direct_link_realtime_search");
			obj.preset = {
				name:{
					standard:"Direct Link (facebook.com)",
					locales:{
						ja:"直リンクに変更(フェイスブック用)",
						en:"Direct Link (facebook.com)"
					}
				},
				script:""
			};

			// イベントを無効化(フェイスブック用)
			var obj = addPreset(proj.replacement_to_anchor,"disable_event_facebook","direct_link_twitter");
			obj.preset = {
				name:{
					standard:"Disable Event (facebook)",
					locales:{
						ja:"イベントを無効化(フェイスブック用)",
						en:"Disable Event (facebook)"
					}
				},
				script:""
			};

			// -
			// ハイパーリンク置換定義
			// -
			// 直リンク(汎用)
			updatePreset(proj.replacement_to_link,"direct_link_generic",function(obj){
				var filter = obj.filter;

				// OGP "og:image"
				filter[0].filter.push("*://seiga.nicovideo.jp/watch/bk*");

				// blog.fc2.com
				filter.splice(13,0,{
					name:{
						standard:"blog.fc2.com",
						locales:{
							ja:"FC2ブログ Photo",
							en:"blog.fc2.com"
						}
					},
					filter:[
						"http://*.blog.fc2.com/img/*/"
					],
					enable_reflect_to_anchor:false,
					enable_cache:true,
					script:""
				});

				// Miiverse
				filter.splice(16,0,{
					name:{
						standard:"Miiverse",
						locales:{
							ja:"Miiverse",
							en:"Miiverse"
						}
					},
					filter:[
						"*://miiverse.nintendo.net/posts/*"
					],
					enable_reflect_to_anchor:false,
					enable_cache:true,
					script:""
				});
			});

			// イメージ検索用
			updatePreset(proj.replacement_to_link,"direct_link_image_search",function(obj){
				var filter = obj.filter;

				// naver.jp
				filter[12].filter = [
					"http://*search.naver.jp/jthumb?*",
					"http://*search.naver.jp/jdanmi?*"
				];
				filter[12].enable_cache = true;
			});

			// ウィキペディア用
			updatePreset(proj.replacement_to_link,"direct_link_wikipedia",function(obj){
				var filter = obj.filter;

				filter = filter[0].filter;
				filter.push("*://*.m.wikipedia.org/wiki/*:*");
				filter.push("*://*.m.wikipedia.org/w/*:*");
				filter.push("*://*.m.wikimedia.org/wiki/*:*");
				filter.push("*://*.m.wikimedia.org/w/*:*");
			});

			// -
			// 短縮 URL 展開
			// -
			// 簡易
			var obj = getPreset(proj.expand_short_url,"simple");
			obj.filter.splice(12,3);
			obj.filter.push("http://dlvr.it/*");
			obj.filter.push("http://is.gd/*");
			obj.filter.push("http://ht.ly/*");
			obj.filter.push("http://lnk.ms/*");
			obj.filter.push("http://po.st/*");
			obj.filter.push("http://htn.to/*");
			obj.filter.push("http://r.sm3.jp/*");
			obj.filter.push("http://cot.ag/*");
			obj.filter.push("http://to.ly/*");
			obj.filter.push("http://ux.nu/*");
			obj.filter.push("http://qurl.com/*");
			obj.filter.push("http://tr.im/*");
			obj.filter.push("http://spr.ly/*");
			obj.filter.push("http://buff.ly/*");

			// 詳細
			var obj = getPreset(proj.expand_short_url,"detail");
			obj.filter.splice(59,1);
			obj.filter.splice(54,4);
			obj.filter.splice(52,1);
			obj.filter.splice(47,1);
			obj.filter.splice(42,1);
			obj.filter.splice(38,1);
			obj.filter.splice(33,1);
			obj.filter.splice(28,2);
			obj.filter.splice(23,1);
			obj.filter.splice(12,1);
			obj.filter.push("http://spr.ly/*");
			obj.filter.push("http://buff.ly/*");
			obj.filter.push("http://amba.to/*");
			obj.filter.push("http://nico.ms/*");
			obj.filter.push("http://yhoo.it/*");
			obj.filter.push("http://shar.es/*");
			obj.filter.push("http://feedly.com/k/*");
			obj.filter.push("http://wp.me/*");
			obj.filter.push("http://migre.me/*");
			obj.filter.push("http://flip.it/*");

			// -
			// イメージ展開定義
			// -
			// 「サムネイル表示」を破棄
			removePreset("expand_image","thumbnail");

			// 「ポップアップ表示」を破棄
			removePreset("expand_image","popup");

			// 追加
			update(proj.expand_image,"*",function(obj){
				if(!(obj.popup.scale_percent))	obj.popup.scale_percent = 100;
			});

			// ポップアップ表示(すべてのリンク)
			var obj = addPreset(proj.expand_image,"popup_all","image_bbs");
			obj.preset = {
				name:{
					standard:"Popup (all)",
					locales:{
						ja:"ポップアップ表示(すべてのリンク)",
						en:"Popup (all)"
					}
				},
				thumbnail:{
					enable_popup_mouseover:true,
					disable_same_image:false,
					load_type:"preload",
					script_allow:"",
					script_insert:""
				},
				popup:{
					origin_type:"center",
					position_type:"absolute",
					time_wait_open:0,
					time_wait_close:0,
					enable_animation_scale:true,
					enable_animation_alpha:true,
					load_type:"preload",
					scale_percent:100,
					script_allow:""
				},
				reduced_image:{
					enable_popup:true,
					popup_allow_slcale_less_then:70
				},
				load:{
					enable_notify:true,
					enable_unload:false,
					unload_allow_size_more_then:256
				}
			};

			// ポップアップ表示(画像を含むリンク)
			var obj = addPreset(proj.expand_image,"popup_include_image","image_bbs");
			obj.preset = {
				name:{
					standard:"Popup (include image)",
					locales:{
						ja:"ポップアップ表示(画像を含むリンク)",
						en:"Popup (include image)"
					}
				},
				thumbnail:{
					enable_popup_mouseover:true,
					disable_same_image:false,
					load_type:"preload",
					script_allow:"",
					script_insert:""
				},
				popup:{
					origin_type:"center",
					position_type:"absolute",
					time_wait_open:0,
					time_wait_close:0,
					enable_animation_scale:true,
					enable_animation_alpha:true,
					load_type:"preload",
					scale_percent:100,
					script_allow:""
				},
				reduced_image:{
					enable_popup:true,
					popup_allow_slcale_less_then:70
				},
				load:{
					enable_notify:true,
					enable_unload:false,
					unload_allow_size_more_then:256
				}
			};

			// サムネイル表示(すべて)
			var obj = addPreset(proj.expand_image,"thumbnail_all","image_bbs");
			obj.preset = {
				name:{
					standard:"Thumbnail (all)",
					locales:{
						ja:"サムネイル表示(すべてのリンク)",
						en:"Thumbnail (all)"
					}
				},
				thumbnail:{
					enable_popup_mouseover:true,
					disable_same_image:false,
					load_type:"preload",
					script_allow:"",
					script_insert:""
				},
				popup:{
					origin_type:"center",
					position_type:"absolute",
					time_wait_open:0,
					time_wait_close:0,
					enable_animation_scale:true,
					enable_animation_alpha:true,
					load_type:"preload",
					scale_percent:100,
					script_allow:""
				},
				reduced_image:{
					enable_popup:true,
					popup_allow_slcale_less_then:70
				},
				load:{
					enable_notify:true,
					enable_unload:false,
					unload_allow_size_more_then:256
				}
			};

			// サムネイル表示(画像を含まないリンク)
			var obj = addPreset(proj.expand_image,"thumbnail_not_include_image","image_bbs");
			obj.preset = {
				name:{
					standard:"Thumbnail (not include image)",
					locales:{
						ja:"サムネイル表示(画像を含まないリンク)",
						en:"Thumbnail (not include image)"
					}
				},
				thumbnail:{
					enable_popup_mouseover:true,
					disable_same_image:false,
					load_type:"preload",
					script_allow:"",
					script_insert:""
				},
				popup:{
					origin_type:"center",
					position_type:"absolute",
					time_wait_open:0,
					time_wait_close:0,
					enable_animation_scale:true,
					enable_animation_alpha:true,
					load_type:"preload",
					scale_percent:100,
					script_allow:""
				},
				reduced_image:{
					enable_popup:true,
					popup_allow_slcale_less_then:70
				},
				load:{
					enable_notify:true,
					enable_unload:false,
					unload_allow_size_more_then:256
				}
			};

			// ツイッター用
			var obj = addPreset(proj.expand_image,"twitter",null);
			obj.preset = {
				name:{
					standard:"For twitter",
					locales:{
						ja:"ツイッター用",
						en:"For twitter"
					}
				},
				thumbnail:{
					enable_popup_mouseover:true,
					disable_same_image:false,
					load_type:"preload",
					script_allow:"",
					script_insert:""
				},
				popup:{
					origin_type:"center",
					position_type:"absolute",
					time_wait_open:0,
					time_wait_close:0,
					enable_animation_scale:true,
					enable_animation_alpha:true,
					load_type:"preload",
					scale_percent:100,
					script_allow:""
				},
				reduced_image:{
					enable_popup:true,
					popup_allow_slcale_less_then:70
				},
				load:{
					enable_notify:true,
					enable_unload:false,
					unload_allow_size_more_then:256
				}
			};

			// -
			// URLマッピング設定
			// -
			// 追加
			update(proj.urlmap,"*",function(obj){
				if(obj.enable_mixed_content === undefined) obj.enable_mixed_content = false;
			});

			// デフォルト
			var preset = getPreset(proj.urlmap,"default");
			preset.make_link_to_text = {enable:false,id:""};
			preset.expand_image = {enable:true,id:"popup_all"};

			// 検索サイト
			var preset = getPreset(proj.urlmap,"search");
			preset.expand_image = {enable:true,id:"popup_include_image"};

			// 画像検索サイト
			var preset = getPreset(proj.urlmap,"image_search");
			preset.replacement_to_element = {enable:true,id:["assist_image_search"]};
			preset.expand_image = {enable:true,id:"popup_include_image"};

			// リアルタイム検索用
			var preset = getPreset(proj.urlmap,"realtime_search");
			preset.expand_image = {enable:true,id:"thumbnail_not_include_image"};

			// スレッド掲示板
			var preset = getPreset(proj.urlmap,"bbs");
			preset.expand_image = {enable:true,id:"thumbnail_not_include_image"};

			// twitter
			var preset = getPreset(proj.urlmap,"twitter");
			preset.replacement_to_element = {enable:true,id:["assist_twitter"]};
			preset.expand_image = {enable:true,id:"twitter"};

			// ウィキペディア
			var preset = getPreset(proj.urlmap,"wikipedia");
			preset.expand_image = {enable:true,id:"popup_include_image"};
			preset.filter.push("*://*.m.wikipedia.org/*");

			// ピクシブ
			var obj = addPreset(proj.urlmap,"pixiv","default");
			obj.preset = {
				name:{
					standard:"pixiv",
					locales:{
						ja:"ピクシブ",
						en:"pixiv"
					}
				},
				enable:true,
				filter:[
					"http://*.pixiv.net/",
					"http://*.pixiv.net/*"
				],
				enable_unsecure:false,
				enable_mixed_content:false,
				access_block:{enable:false,id:""},
				replacement_to_element:{enable:true,id:["assist_pixiv"]},
				replacement_to_text:{enable:false,id:[]},
				replacement_to_anchor:{enable:false,id:[]},
				replacement_to_link:{enable:true,id:"direct_link_generic"},
				replacement_to_referer:{enable:false,id:""},
				replacement_to_useragent:{enable:false,id:""},
				make_link_to_text:{enable:true,id:"simple"},
				expand_short_url:{enable:true,id:"detail"},
				expand_text:{enable:false,id:""},
				expand_image:{enable:true,id:"popup_include_image"},
				expand_sound:{enable:false,id:""},
				expand_video:{enable:false,id:""},
				expand_iframe:{enable:false,id:""},
				style_sheet:{enable:true,id:"default"},
				experimental:{enable:false,id:""}
			};

			// フェイスブック
			var obj = addPreset(proj.urlmap,"facebook","twitter");
			obj.preset = {
				name:{
					standard:"Facebook",
					locales:{
						ja:"フェイスブック",
						en:"Facebook"
					}
				},
				enable:true,
				filter:[
					"*://www.facebook.com/*"
				],
				enable_unsecure:false,
				enable_mixed_content:false,
				access_block:{enable:false,id:""},
				replacement_to_element:{enable:false,id:[]},
				replacement_to_text:{enable:false,id:[]},
				replacement_to_anchor:{enable:true,id:["disable_event_facebook","direct_link_facebook","no_referrer"]},
				replacement_to_link:{enable:true,id:"direct_link_generic"},
				replacement_to_referer:{enable:false,id:""},
				replacement_to_useragent:{enable:false,id:""},
				make_link_to_text:{enable:true,id:"simple"},
				expand_short_url:{enable:true,id:"detail"},
				expand_text:{enable:false,id:""},
				expand_image:{enable:true,id:"popup_include_image"},
				expand_sound:{enable:false,id:""},
				expand_video:{enable:false,id:""},
				expand_iframe:{enable:false,id:""},
				style_sheet:{enable:true,id:"default"},
				experimental:{enable:false,id:""}
			};

		}
		if(exit())	return proj;

		// -
		// プロジェクト ver.12
		// -
		if(proj.version < 12){
			// バージョン値
			proj.version = 12;

			// -
			// URLマッピング設定
			// -
			// 追加
			update(proj.urlmap,"*",function(obj){
				// マルチ化
				if(obj.access_block.enable){
					obj.access_block.id = [obj.access_block.id];
				}else{
					obj.access_block.id = [];
				}
				if(obj.replacement_to_link.enable){
					obj.replacement_to_link.id = [obj.replacement_to_link.id];
				}else{
					obj.replacement_to_link.id = [];
				}
				if(obj.replacement_to_referer.enable){
					obj.replacement_to_referer.id = [obj.replacement_to_referer.id];
				}else{
					obj.replacement_to_referer.id = [];
				}
				if(obj.replacement_to_useragent.enable){
					obj.replacement_to_useragent.id = [obj.replacement_to_useragent.id];
				}else{
					obj.replacement_to_useragent.id = [];
				}
			});
		}
		if(exit())	return proj;

		// -
		// プロジェクト ver.13
		// -
		if(proj.version < 13){
			// バージョン値
			proj.version = 13;

			// -
			// 掲示板設定
			// -
			// ログ速
			var obj = addPreset(proj.expand_bbs,"logsoku",null);
			var preset = obj.preset;
			preset.filter = [
				{
					pattern:"^http://logsoku\\.com/thread/.*\\.2ch\\.net/[^/]+/[0-9]+",
					flags:{i:true,g:false}
				},{
					pattern:"^http://[^.]+\\.logsoku\\.com/r/[^/]+/[0-9]+",
					flags:{i:true,g:false}
				},{
					pattern:"^http://logsoku\\.com/r/[^/]+/[0-9]+",
					flags:{i:true,g:false}
				}
			];

			// みみずん検索
			var obj = addPreset(proj.expand_bbs,"mimizun",null);
			var preset = obj.preset;
			preset.filter = [
				{
					pattern:"^http://mimizun\\.com/log/2ch/[^/]+/[0-9]+",
					flags:{i:true,g:false}
				},{
					pattern:"^http://mimizun\\.com/log/machi/[^/]+/[0-9]+",
					flags:{i:true,g:false}
				}
			];

			// unkar.org
			var obj = addPreset(proj.expand_bbs,"unkar",null);
			var preset = obj.preset;
			preset.filter = [
				{
					pattern:"^http://unkar\\.org/r/[^/]+/[0-9]+",
					flags:{i:true,g:false}
				}
			];

			// あっとちゃんねるず
			var obj = addPreset(proj.expand_bbs,"atchs",null);
			var preset = obj.preset;
			preset.filter = [
				{
					pattern:"^http://[^.]+\\.atchs\\.jp/test/read\\.cgi/[^/]+/[0-9]+",
					flags:{i:true,g:false}
				}
			];

			// -
			// URLマッピング設定
			// -
			// chaika
			var obj = addPreset(proj.urlmap,"chaika","image_bbs");
			obj.preset = {
				name:{
					standard:"chaika",
					locales:{
						ja:"chaika",
						en:"chaika"
					}
				},
				enable:true,
				filter:[
					"http://127.0.0.1:*/thread/http://2ch.net/*",
					"http://127.0.0.1:*/thread/http://*.2ch.net/*",
					"http://127.0.0.1:*/thread/http://*.bbspink.com/*",
					"http://127.0.0.1:*/thread/http://jbbs.livedoor.jp/*"
				],
				enable_unsecure:false,
				enable_mixed_content:false,
				access_block:{enable:false,id:[]},
				replacement_to_element:{enable:false,id:[]},
				replacement_to_text:{enable:false,id:[]},
				replacement_to_anchor:{enable:true,id:["direct_link_bbs","no_referrer"]},
				replacement_to_link:{enable:true,id:["direct_link_generic"]},
				replacement_to_referer:{enable:true,id:["replacement_link_url"]},
				replacement_to_useragent:{enable:false,id:""},
				make_link_to_text:{enable:true,id:"detail"},
				expand_short_url:{enable:true,id:"detail"},
				expand_text:{enable:false,id:""},
				expand_image:{enable:true,id:"thumbnail_not_include_image"},
				expand_sound:{enable:true,id:"inline"},
				expand_video:{enable:true,id:"inline"},
				expand_iframe:{enable:false,id:""},
				style_sheet:{enable:true,id:"default"},
				experimental:{enable:false,id:""}
			};

		}
		if(exit())	return proj;

		// -
		// プロジェクト ver.14
		// -
		if(proj.version < 14){
			// バージョン値
			proj.version = 14;

			var wildcard_name = {
				standard:"Wild Card",
				locales:{
					ja:"ワイルドカード",
					en:"Wild Card"
				}
			};

			// -
			// アクセスブロック定義
			// -
			removePreset("access_block","firefox_extension");
			removePreset("access_block","opera_extension");

			// ワイルドカード
			var obj = addPreset(proj.access_block,"wildcard",null);
			obj.preset = {
				name:wildcard_name,
				filter:[]
			};

			// -
			// リファラ置換定義
			// -
			removePreset("replacement_to_referer","firefox_extension");

			// ワイルドカード
			var obj = addPreset(proj.replacement_to_referer,"wildcard",null);
			obj.preset = {
				name:wildcard_name,
				filter:[]
			};

			// -
			// ユーザーエージェント置換定義
			// -
			removePreset("replacement_to_useragent","firefox_extension");

			// ワイルドカード
			var obj = addPreset(proj.replacement_to_useragent,"wildcard",null);
			obj.preset = {
				name:wildcard_name,
				filter:[]
			};

			// -
			// エレメント置換定義
			// -
			// 展開アシスト(アンカー内画像用)
			var obj = addPreset(proj.replacement_to_element,"assist_image_in_anchor","assist_image_search");
			obj.preset = {
				name:{
					standard:"Assist Expand (image in anchor)",
					locales:{
						ja:"展開アシスト(アンカー内画像用)",
						en:"Assist Expand (image in anchor)"
					}
				},
				script:""
			};

			// -
			// イメージ展開定義
			// -
			// 追加
			update(proj.expand_image,"*",function(obj){
				if((obj.thumbnail.enable_thumbnail) === undefined)		obj.thumbnail.enable_thumbnail = true;
				if((obj.popup.enable_popup_mouseover) === undefined)	obj.popup.enable_popup_mouseover = true;
				if((obj.load.src_type) === undefined)					obj.load.src_type = "mixed_content";
			});

			// ポップアップ表示(すべてのリンク)
			var preset_popup_all = getPreset(proj.expand_image,"popup_all");
			preset_popup_all.thumbnail.enable_thumbnail = false;

			// ポップアップ表示(画像を含むリンク)
			var preset_popup_include_image = getPreset(proj.expand_image,"popup_include_image");
			preset_popup_include_image.thumbnail.enable_thumbnail = false;

			// サムネイル表示(すべて)
			var preset_thumbnail_all = getPreset(proj.expand_image,"thumbnail_all");
			preset_thumbnail_all.popup.enable_popup_mouseover = false;

			// サムネイル表示(画像を含まないリンク)
			var preset_thumbnail_not_include_image = getPreset(proj.expand_image,"thumbnail_not_include_image");
			preset_thumbnail_not_include_image.popup.enable_popup_mouseover = false;

			// ポップアップ表示(アシスト要素のみ)
			var obj = addPreset(proj.expand_image,"popup_image_in_anchor","thumbnail_all");
			obj.preset = {
				name:{
					standard:"Popup (assist only)",
					locales:{
						ja:"ポップアップ表示(アシスト要素のみ)",
						en:"Popup (assist only)"
					}
				},
				thumbnail:{
					enable_thumbnail:false,
					enable_popup_mouseover:true,
					disable_same_image:false,
					load_type:"preload",
					script_allow:"",
					script_insert:""
				},
				popup:{
					enable_popup_mouseover:true,
					origin_type:"center",
					position_type:"absolute",
					time_wait_open:0,
					time_wait_close:0,
					enable_animation_scale:true,
					enable_animation_alpha:true,
					load_type:"preload",
					scale_percent:100,
					script_allow:""
				},
				reduced_image:{
					enable_popup:true,
					popup_allow_slcale_less_then:70
				},
				load:{
					enable_notify:true,
					enable_unload:false,
					src_type:"mixed_content",
					unload_allow_size_more_then:256
				}
			};

			// -
			// 掲示板設定
			// -
			// ふたば☆ちゃんねる
			var obj = addPreset(proj.expand_bbs,"2chan",null);
			var preset = obj.preset;
			preset.filter = [
				{
					pattern:"^http://[^.]+\\.2chan\\.net/[^/]+/res/[0-9]+.htm",
					flags:{i:true,g:false}
				}
			];

			// chaika
			var obj = addPreset(proj.expand_bbs,"chaika","atchs");
			obj.preset = {
				name:{
					standard:"chaika",
					locales:{
						ja:"chaika",
						en:"chaika"
					}
				},
				enable:true,
				filter:[
					{
						pattern:"^http://127\\.0\\.0\\.1:[0-9]+/thread/http://[^.]+\\.2ch\\.net/test/read\\.cgi/[^/]+/[0-9]+",
						flags:{i:true,g:false}
					},{
						pattern:"^http://127\\.0\\.0\\.1:[0-9]+/thread/http://[^.]+\\.bbspink\\.com/test/read\\.cgi/[^/]+/[0-9]+",
						flags:{i:true,g:false}
					},{
						pattern:"^http://127\\.0\\.0\\.1:[0-9]+/thread/http://jbbs\\.shitaraba\\.net/bbs/read.cgi/[^/]+/[0-9]+/[0-9]+",
						flags:{i:true,g:false}
					}
				],
				script_initialize:"",
				script_callback:"",
				popup:{
					origin_type:"adsorb_top_bottom",
					position_type:"absolute",
					enable_animation:true,
					percent:{x:75,y:90},
					time_wait_open:0,
					time_wait_close:250,
					style_sheet:"padding:20px 10px; border:1px solid #000; background:#FFF; overflow-y:auto; word-wrap:break-word; word-break:break-all;"
				}
			};

			// -
			// URLマッピング設定
			// -
			// スレッド掲示板
			updatePreset(proj.urlmap,"bbs",function(obj){
				obj.filter[6] = "*://jbbs.shitaraba.net/*";
			});

			// chaika
			updatePreset(proj.urlmap,"chaika",function(obj){
				obj.filter[3] = "http://127.0.0.1:*/thread/http://jbbs.shitaraba.net/*";
			});

			// ピクシブ
			updatePreset(proj.urlmap,"pixiv",function(obj){
				obj.replacement_to_element.id.unshift("assist_image_in_anchor");
				obj.expand_image.id = "popup_image_in_anchor";
			});

			// -
			// 基本設定
			// -
			proj.standard.enable_startup = proj.standard.enable_enable_startup;
			delete proj.standard.enable_enable_startup;
			proj.standard.enable_input_touch = true;
			proj.standard.enable_double_touch_assist = false;

		}
		if(exit())	return proj;

		// -
		// プロジェクト ver.15
		// -
		if(proj.version < 15){
			// バージョン値
			proj.version = 15;

			// -
			// URLフィルタ形式を更新
			// -
			var updateForAsteriskFilter = function(filter){
				return {
					type:"asterisk",
					asterisk:{
						filter:filter
					},
					regexp:{
						filter:[]
					}
				};
			};
			var updateForRegExpFilter = function(filter){
				return {
					type:"regexp",
					asterisk:{
						filter:[]
					},
					regexp:{
						filter:filter
					}
				};
			};

			// -
			// 掲示板設定
			// -
			update(proj.expand_bbs,"*",function(obj){
				obj.filter = updateForRegExpFilter(obj.filter);
			});

			// 2ちゃんねる掲示板
			var obj = addPreset(proj.expand_bbs,"2ch",null);
			var preset = obj.preset;
			preset.filter = {
				type:"regexp",
				asterisk:{
					filter:[]
				},
				regexp:{
					filter:[
						{
							pattern:"^http://[^.]+\\.2ch\\.net/test/read\\.cgi/[^/]+/[0-9]+.*$",
							flags:{i:true,g:false}
						},{
							pattern:"^http://(|[^.]+\\.)machi\\.to/bbs/read\\.cgi/[^/]+/[0-9]+.*$",
							flags:{i:true,g:false}
						},{
							pattern:"^http://(|[^.]+\\.)machibbs\\.net/[^/]+/[^/]*[0-9]+.*$",
							flags:{i:true,g:false}
						},{
							pattern:"^http://[^.]+\\.bbspink\\.com/test/read\\.cgi/[^/]+/[0-9]+.*$",
							flags:{i:true,g:false}
						},{
							pattern:"^http://jbbs\\.shitaraba\\.net/bbs/read.cgi/[^/]+/[0-9]+/[0-9]+.*$",
							flags:{i:true,g:false}
						},{
							pattern:"^http://[^.]+\\.kakiko\\.com/test/read\\.cgi/[^/]+/[0-9]+.*$",
							flags:{i:true,g:false}
						},{
							pattern:"^http://[^.]+\\.60\\.kg/test/read\\.cgi/[^/]+/[0-9]+.*$",
							flags:{i:true,g:false}
						}
					]
				}
			};

			// ログ速
			var obj = addPreset(proj.expand_bbs,"logsoku",null);
			var preset = obj.preset;
			preset.filter = {
				type:"regexp",
				asterisk:{
					filter:[]
				},
				regexp:{
					filter:[
						{
							pattern:"^http://logsoku\\.com/thread/.*\\.2ch\\.net/[^/]+/[0-9]+.*$",
							flags:{i:true,g:false}
						},{
							pattern:"^http://[^.]+\\.logsoku\\.com/r/[^/]+/[0-9]+.*$",
							flags:{i:true,g:false}
						},{
							pattern:"^http://logsoku\\.com/r/[^/]+/[0-9]+.*$",
							flags:{i:true,g:false}
						}
					]
				}
			};

			// みみずん検索
			var obj = addPreset(proj.expand_bbs,"mimizun",null);
			var preset = obj.preset;
			preset.filter = {
				type:"regexp",
				asterisk:{
					filter:[]
				},
				regexp:{
					filter:[
						{
							pattern:"^http://mimizun\\.com/log/2ch/[^/]+/[0-9]+.*$",
							flags:{i:true,g:false}
						},{
							pattern:"^http://mimizun\\.com/log/machi/[^/]+/[0-9]+.*$",
							flags:{i:true,g:false}
						}
					]
				}
			};

			// unkar.org
			var obj = addPreset(proj.expand_bbs,"unkar",null);
			var preset = obj.preset;
			preset.filter = {
				type:"regexp",
				asterisk:{
					filter:[]
				},
				regexp:{
					filter:[
						{
							pattern:"^http://unkar\\.org/r/[^/]+/[0-9]+.*$",
							flags:{i:true,g:false}
						}
					]
				}
			};

			// あっとちゃんねるず
			var obj = addPreset(proj.expand_bbs,"atchs",null);
			var preset = obj.preset;
			preset.filter = {
				type:"regexp",
				asterisk:{
					filter:[]
				},
				regexp:{
					filter:[
						{
							pattern:"^http://[^.]+\\.atchs\\.jp/test/read\\.cgi/[^/]+/[0-9]+.*$",
							flags:{i:true,g:false}
						}
					]
				}
			};

			// chaika
			var obj = addPreset(proj.expand_bbs,"chaika",null);
			var preset = obj.preset;
			preset.filter = {
				type:"regexp",
				asterisk:{
					filter:[]
				},
				regexp:{
					filter:[
						{
							pattern:"^http://127\\.0\\.0\\.1:[0-9]+/thread/http://[^.]+\\.2ch\\.net/test/read\\.cgi/[^/]+/[0-9]+.*$",
							flags:{i:true,g:false}
						},{
							pattern:"^http://127\\.0\\.0\\.1:[0-9]+/thread/http://[^.]+\\.bbspink\\.com/test/read\\.cgi/[^/]+/[0-9]+.*$",
							flags:{i:true,g:false}
						},{
							pattern:"^http://127\\.0\\.0\\.1:[0-9]+/thread/http://jbbs\\.shitaraba\\.net/bbs/read.cgi/[^/]+/[0-9]+/[0-9]+.*$",
							flags:{i:true,g:false}
						}
					]
				}
			};

			// 4chan.org
			var obj = addPreset(proj.expand_bbs,"4chan",null);
			var preset = obj.preset;
			preset.filter = {
				type:"regexp",
				asterisk:{
					filter:[]
				},
				regexp:{
					filter:[
						{
							pattern:"^(http|https)://boards\\.4chan\\.org/[^/]+/.*$",
							flags:{i:true,g:false}
						}
					]
				}
			};

			// -
			// アクセスブロック定義
			// -
			update(proj.access_block,"*",function(obj){
				obj.filter = updateForAsteriskFilter(obj.filter);
			});

			// -
			// リファラ置換定義
			// -
			update(proj.replacement_to_referer,"*",function(obj){
				var filter = obj.filter;
				var i;
				var num = filter.length;
				for(i=0;i<num;i++){
					filter[i].filter = updateForAsteriskFilter(filter[i].filter);
				}
			});

			// -
			// ユーザーエージェント置換定義
			// -
			update(proj.replacement_to_useragent,"*",function(obj){
				var filter = obj.filter;
				var i;
				var num = filter.length;
				for(i=0;i<num;i++){
					filter[i].filter = updateForAsteriskFilter(filter[i].filter);
				}
			});

			// -
			// ハイパーリンク置換定義
			// -
			update(proj.replacement_to_link,"*",function(obj){
				var filter = obj.filter;
				var i;
				var num = filter.length;
				for(i=0;i<num;i++){
					filter[i].filter = updateForAsteriskFilter(filter[i].filter);
				}
			});

			// ウィキペディア用
			var preset = getPreset(proj.replacement_to_link,"direct_link_wikipedia");
			preset.filter[0].filter = {
				type:"regexp",
				asterisk:{
					filter:[]
				},
				regexp:{
					filter:[{
						pattern:"^[^:]+://[^.]+\\.(|m\\.)(wikipedia|wikimedia|wiktionary|wikinews|wikiquote|wikibooks|wikisource|wikiversity|wikivoyage|mediawiki)\\.org/(wiki|w).*:.*",
						flags:{i:true,g:false}
					},{
						pattern:"^[^:]+://en\\.uncyclopedia\\.co/(wiki|w).*:.*",
						flags:{i:true,g:false}
					},{
						pattern:"^[^:]+://ansaikuropedia\\.org/(wiki|w).*:.*",
						flags:{i:true,g:false}
					}]
				}
			};

			// -
			// 短縮 URL 展開
			// -
			update(proj.expand_short_url,"*",function(obj){
				obj.filter = updateForAsteriskFilter(obj.filter);
			});

			// -
			// URLマッピング設定
			// -
			update(proj.urlmap,"*",function(obj){
				obj.filter = updateForAsteriskFilter(obj.filter);
			});

			// 画像検索サイト
			var preset = getPreset(proj.urlmap,"image_search");
			preset.filter = {
				type:"regexp",
				asterisk:{
					filter:[]
				},
				regexp:{
					filter:[{
						pattern:"^[^:]+://[^.]+\\.google\\.(at|be|ca|ch|de|es|fr|it|nl|no|pl|ru|se|co\\.(id|in|jp|th|uk|za)|com|com\\.(ar|au|br|mx|sa|tr|tw))/(search[?].*tbm=isch|images[?]).*",
						flags:{i:true,g:false}
					},{
						pattern:"^[^:]+://images\\.search\\.yahoo\\.com/search/images.*",
						flags:{i:true,g:false}
					},{
						pattern:"^[^:]+://[^.]+\\.images\\.search\\.yahoo\\.com/search/images.*",
						flags:{i:true,g:false}
					},{
						pattern:"^[^:]+://[^.]+\\.image\\.search\\.yahoo\\.com/search/images.*",
						flags:{i:true,g:false}
					},{
						pattern:"^[^:]+://image\\.search\\.yahoo\\.co\\.jp/search[?].*",
						flags:{i:true,g:false}
					},{
						pattern:"^[^:]+://image\\.yahoo\\.cn/s[?].*",
						flags:{i:true,g:false}
					},{
						pattern:"^[^:]+://www\\.bing\\.com/images/search[?].*",
						flags:{i:true,g:false}
					},{
						pattern:"^[^:]+://[^.]+\\.ask\\.com/pictures[?].*",
						flags:{i:true,g:false}
					},{
						pattern:"^[^:]+://search\\.aol\\.(com|jp)/aol/image[?].*",
						flags:{i:true,g:false}
					},{
						pattern:"^[^:]+://images\\.yandex\\.(ru|com)/.*",
						flags:{i:true,g:false}
					},{
						pattern:"^[^:]+://bsearch\\.goo\\.ne\\.jp/(image|scrimg|similarity)\\.php[?].*MT=.*",
						flags:{i:true,g:false}
					},{
						pattern:"^[^:]+://image\\.baidu\\.com/.*",
						flags:{i:true,g:false}
					},{
						pattern:"^[^:]+://image\\.search\\.naver\\.com/.*",
						flags:{i:true,g:false}
					},{
						pattern:"^[^:]+://[^.]*search\\.naver\\.jp/image[?].*",
						flags:{i:true,g:false}
					},{
						pattern:"^[^:]+://image\\.search\\.biglobe\\.ne\\.jp/search[?].*",
						flags:{i:true,g:false}
					}]
				}
			};

			// ウィキペディア
			var preset = getPreset(proj.urlmap,"wikipedia");
			preset.filter = {
				type:"regexp",
				asterisk:{
					filter:[]
				},
				regexp:{
					filter:[{
						pattern:"^[^:]+://[^.]+\\.(|m\\.)(wikipedia|wikimedia|wiktionary|wikinews|wikiquote|wikibooks|wikisource|wikiversity|wikivoyage|mediawiki)\\.org/.*",
						flags:{i:true,g:false}
					},{
						pattern:"^[^:]+://en\\.uncyclopedia\\.co/.*",
						flags:{i:true,g:false}
					},{
						pattern:"^[^:]+://ansaikuropedia\\.org/.*",
						flags:{i:true,g:false}
					}]
				}
			};

		}
		if(exit())	return proj;

		// -
		// プロジェクト ver.16
		// -
		if(proj.version < 16){
			// バージョン値
			proj.version = 16;
		}
		if(exit())	return proj;

		// -
		// プロジェクト ver.17
		// -
		if(proj.version < 17){
			// バージョン値
			proj.version = 17;

			// -
			// ダウンロード設定
			// -
			proj.download = new Object();
			var load = proj.download.load = new Object();
			var download = proj.download.download = new Object();
			load.thread_max = proj.standard.load_thread_max;
			load.timeout = 0;
			download.thread_max = 2;
			download.conflict_type = "rename";

			// -
			// 基本設定
			// -
			delete proj.standard.load_thread_max;

			// -
			// アンカー置換定義
			// -
			// 自動ダウンロード(すべて)
			var obj = addPreset(proj.replacement_to_anchor,"auto_download_all","disable_popup_image_search");
			obj.preset = {
				name:{
					standard:"Auto Download (all)",
					locales:{
						ja:"自動ダウンロード(すべて)",
						en:"Auto Download (all)"
					}
				},
				script:""
			};

			// 自動ダウンロード(画像のみ)
			var obj = addPreset(proj.replacement_to_anchor,"auto_download_image","disable_popup_image_search");
			obj.preset = {
				name:{
					standard:"Auto Download (image only)",
					locales:{
						ja:"自動ダウンロード(画像のみ)",
						en:"Auto Download (image only)"
					}
				},
				script:""
			};

			// ダウンロードリストに登録(すべて)
			var obj = addPreset(proj.replacement_to_anchor,"add_download_list_all","disable_popup_image_search");
			obj.preset = {
				name:{
					standard:"Add the DownloadList (all)",
					locales:{
						ja:"ダウンロードリストに登録(すべて)",
						en:"Add the DownloadList (all)"
					}
				},
				script:""
			};

			// ダウンロードリストに登録(画像のみ)
			var obj = addPreset(proj.replacement_to_anchor,"add_download_list_image","disable_popup_image_search");
			obj.preset = {
				name:{
					standard:"Add the DownloadList (image only)",
					locales:{
						ja:"ダウンロードリストに登録(画像のみ)",
						en:"Add the DownloadList (image only)"
					}
				},
				script:""
			};

		}
		if(exit())	return proj;

		// -
		// プロジェクト ver.18
		// -
		if(proj.version < 18){
			// バージョン値
			proj.version = 18;

			// -
			// 掲示板設定
			// -
			// 2ちゃんねる掲示板
			var obj = addPreset(proj.expand_bbs,"2ch",null);
			var preset = obj.preset;
			preset.filter.regexp.filter.push({
				pattern:"^http://[^.]+\\.2ch\\.sc/test/read\\.cgi/[^/]+/[0-9]+.*$",
				flags:{i:true,g:false}
			});

			// おーぷん2ちゃんねる
			var obj = addPreset(proj.expand_bbs,"open2ch","atchs");
			obj.preset = {
				name:{
					standard:"open2ch.net",
					locales:{
						ja:"おーぷん2ちゃんねる",
						en:"open2ch.net"
					}
				},
				enable:true,
				filter:{
					type:"regexp",
					asterisk:{
						filter:[]
					},
					regexp:{
						filter:[
							{
								pattern:"^http://[^.]+\\.open2ch\\.net/test/read\\.cgi/[^/]+/[0-9]+.*$",
								flags:{i:true,g:false}
							},{
								pattern:"^http://open2ch\\.net/test/read\\.cgi/[^/]+/[0-9]+.*$",
								flags:{i:true,g:false}
							}
						]
					}
				},
				script_initialize: "",
				script_callback: "",
				popup:{
					origin_type:"adsorb_top_bottom",
					position_type:"absolute",
					enable_animation:true,
					percent:{x:75,y:90},
					time_wait_open:0,
					time_wait_close:250,
					style_sheet:"padding:20px 10px; border:1px solid #000; background:#FFF; overflow-y:auto; word-wrap:break-word; word-break:break-all;"
				}
			};

			// -
			// URLマッピング設定
			// -
			// スレッド掲示板
			updatePreset(proj.urlmap,"bbs",function(obj){
				var filter = obj.filter.asterisk.filter;
				filter.push("*://open2ch.net/*");
				filter.push("*://*.open2ch.net/*");
				filter.push("*://2ch.sc/*");
				filter.push("*://*.2ch.sc/*");
			});

		}
		if(exit())	return proj;

		// -
		// プロジェクト ver.19
		// -
		if(proj.version < 19){
			// バージョン値
			proj.version = 19;

			// -
			// エレメント置換定義
			// -
			// 展開アシスト(deviantART 用)
			var obj = addPreset(proj.replacement_to_element,"assist_deviant_art","assist_pixiv");
			obj.preset = {
				name:{
					standard:"Assist Expand (deviantART)",
					locales:{
						ja:"展開アシスト(deviantART 用)",
						en:"Assist Expand (deviantART)"
					}
				},
				script:""
			};

			// 展開アシスト(ニコニコ静画用)
			var obj = addPreset(proj.replacement_to_element,"assist_nico_seiga","assist_pixiv");
			obj.preset = {
				name:{
					standard:"Assist Expand (NICONICO SEIGA)",
					locales:{
						ja:"展開アシスト(ニコニコ静画用)",
						en:"Assist Expand (NICONICO SEIGA)"
					}
				},
				script:""
			};

			// -
			// ハイパーリンク置換定義
			// -
			// 直リンク(汎用)
			updatePreset(proj.replacement_to_link,"direct_link_generic",function(obj){
				var filter = obj.filter;

				// OGP "og:image"
				filter[0].filter.asterisk.filter.splice(2,5);

				// Facebook Photo
				filter[4].filter.asterisk.filter.push("*://www.facebook.com/*/photos/*");

				// Google+ Photo
				filter[5].filter.asterisk.filter.push("*://plus.google.com/*/posts/*");

				// Flickr
				filter.splice(8,0,{
					name:{
						standard:"Flickr",
						locales:{
							ja:"Flickr",
							en:"Flickr"
						}
					},
					filter:{
						type:"asterisk",
						asterisk:{
							filter:[
								"*://www.flickr.com/photos/*/*",
								"*://flic.kr/p/*"
							]
						},
						regexp:{
							filter:[]
						}
					},
					enable_reflect_to_anchor:false,
					enable_cache:true,
					script:""
				});

				// yfrog.com
				filter.splice(9,0,{
					name:{
						standard:"yfrog.com",
						locales:{
							ja:"yfrog.com",
							en:"yfrog.com"
						}
					},
					filter:{
						type:"asterisk",
						asterisk:{
							filter:[
								"*://twitter.yfrog.com/*",
								"*://yfrog.com/*"
							]
						},
						regexp:{
							filter:[]
						}
					},
					enable_reflect_to_anchor:false,
					enable_cache:true,
					script:""
				});

				// deviantART
				filter.splice(16,0,{
					name:{
						standard:"deviantART",
						locales:{
							ja:"deviantART",
							en:"deviantART"
						}
					},
					filter:{
						type:"asterisk",
						asterisk:{
							filter:[
								"*://*.deviantart.com/art/*"
							]
						},
						regexp:{
							filter:[]
						}
					},
					enable_reflect_to_anchor:false,
					enable_cache:true,
					script:""
				});

				// ニコニコ静画 イラスト
				filter[17].name = {
					standard:"NICONICO SEIGA Illust",
					locales:{
						ja:"ニコニコ静画 イラスト",
						en:"NICONICO SEIGA Illust"
					}
				};

				// ニコニコ静画 イラスト (直リンク)
				filter.splice(18,0,{
					name:{
						standard:"NICONICO SEIGA Illust (Direct Link)",
						locales:{
							ja:"ニコニコ静画 イラスト (直リンク)",
							en:"NICONICO SEIGA Illust (Direct Link)"
						}
					},
					filter:{
						type:"asterisk",
						asterisk:{
							filter:[
								"*://seiga.nicovideo.jp/image/source/*",
								"*://seiga.nicovideo.jp/image/source?id=*"
							]
						},
						regexp:{
							filter:[]
						}
					},
					enable_reflect_to_anchor:false,
					enable_cache:true,
					script:""
				});

				// ニコニコ静画 漫画 
				filter.splice(19,0,{
					name:{
						standard:"NICONICO SEIGA Manga",
						locales:{
							ja:"ニコニコ静画 漫画",
							en:"NICONICO SEIGA Manga"
						}
					},
					filter:{
						type:"asterisk",
						asterisk:{
							filter:[
								"*://seiga.nicovideo.jp/watch/mg*",
								"*://nico.ms/mg*"
							]
						},
						regexp:{
							filter:[]
						}
					},
					enable_reflect_to_anchor:false,
					enable_cache:true,
					script:""
				});
			});

			// イメージ検索用
			updatePreset(proj.replacement_to_link,"direct_link_image_search",function(obj){
				var filter = obj.filter;
				// yahoo.cn
				filter.splice(3,1);
				// Baidu.jp
				filter.splice(9,1);

				// Yandex 画像検索
				filter[6].filter = {
					type:"regexp",
					asterisk:{
						filter:[]
					},
					regexp:{
						filter:[
							{
								pattern:"^http://yandex\\.(ru|com)/images/search[?].*$",
								flags:{i:true,g:false}
							}
						]
					}
				};
			});

			// -
			// 掲示板設定
			// -
			// 2ちゃんねる掲示板
			var obj = addPreset(proj.expand_bbs,"2ch",null);
			var preset = obj.preset;
			preset.filter.regexp.filter.splice(5,0,{
				pattern:"^http://jbbs\\.shitaraba\\.net/[^/]+/[0-9]+/storage/[0-9]+.*$",
				flags:{i:true,g:false}
			});

			// unkar.org
			removePreset("expand_bbs","unkar");

			// -
			// URLマッピング設定
			// -
			// 画像検索サイト
			var preset = getPreset(proj.urlmap,"image_search");
			var filter = preset.filter.regexp.filter;
			filter.splice(5,1);
			filter[8] = {
				pattern:"^[^:]+://yandex\\.(ru|com)/images/.*",
				flags:{i:true,g:false}
			};
			filter[9] = {
				pattern:"^[^:]+://(|[^.]+\\.)bsearch\\.goo\\.ne\\.jp/(image|scrimg|similarity)\\.php[?].*MT=.*",
				flags:{i:true,g:false}
			};
			filter[13] = {
				pattern:"^[^:]+://images\\.search\\.biglobe\\.ne\\.jp/cgi-bin/search[?].*",
				flags:{i:true,g:false}
			};

			// フェイスブック
			var preset = getPreset(proj.urlmap,"facebook");
			preset.replacement_to_anchor = {enable:true,id:["disable_event_facebook","direct_link_facebook"]};

			// deviantART
			var obj = addPreset(proj.urlmap,"deviant_art","pixiv");
			obj.preset = {
				name:{
					standard:"deviantART",
					locales:{
						ja:"deviantART",
						en:"deviantART"
					}
				},
				enable:true,
				filter:{
					type:"asterisk",
					asterisk:{
						filter:[
							"*://*.deviantart.com/*"
						]
					},
					regexp:{
						filter:[]
					}
				},
				enable_unsecure:false,
				enable_mixed_content:false,
				access_block:{enable:false,id:[]},
				replacement_to_element:{enable:true,id:["assist_deviant_art"]},
				replacement_to_text:{enable:false,id:[]},
				replacement_to_anchor:{enable:true,id:["no_referrer"]},
				replacement_to_link:{enable:true,id:["direct_link_generic"]},
				replacement_to_referer:{enable:true,id:["replacement_link_url"]},
				replacement_to_useragent:{enable:false,id:""},
				make_link_to_text:{enable:true,id:"detail"},
				expand_short_url:{enable:true,id:"detail"},
				expand_text:{enable:false,id:""},
				expand_image:{enable:true,id:"popup_image_in_anchor"},
				expand_sound:{enable:true,id:"inline"},
				expand_video:{enable:true,id:"inline"},
				expand_iframe:{enable:false,id:""},
				style_sheet:{enable:true,id:"default"},
				experimental:{enable:false,id:""}
			};

			// ニコニコ静画
			var obj = addPreset(proj.urlmap,"nico_seiga","pixiv");
			obj.preset = {
				name:{
					standard:"niconico seiga",
					locales:{
						ja:"ニコニコ静画",
						en:"niconico seiga"
					}
				},
				enable:true,
				filter:{
					type:"asterisk",
					asterisk:{
						filter:[
							"http://seiga.nicovideo.jp/seiga/im*",
							"http://seiga.nicovideo.jp/illust/*",
							"http://seiga.nicovideo.jp/shunga/*"
						]
					},
					regexp:{
						filter:[]
					}
				},
				enable_unsecure:false,
				enable_mixed_content:false,
				access_block:{enable:false,id:[]},
				replacement_to_element:{enable:true,id:["assist_nico_seiga"]},
				replacement_to_text:{enable:false,id:[]},
				replacement_to_anchor:{enable:true,id:["no_referrer"]},
				replacement_to_link:{enable:true,id:["direct_link_generic"]},
				replacement_to_referer:{enable:true,id:["replacement_link_url"]},
				replacement_to_useragent:{enable:false,id:""},
				make_link_to_text:{enable:true,id:"detail"},
				expand_short_url:{enable:true,id:"detail"},
				expand_text:{enable:false,id:""},
				expand_image:{enable:true,id:"popup_image_in_anchor"},
				expand_sound:{enable:true,id:"inline"},
				expand_video:{enable:true,id:"inline"},
				expand_iframe:{enable:false,id:""},
				style_sheet:{enable:true,id:"default"},
				experimental:{enable:false,id:""}
			};

			// ピクシブ
			updatePreset(proj.urlmap,"pixiv",function(obj){
				obj.replacement_to_element.id.shift();
			});

			// ブログ
			var obj = addPreset(proj.urlmap,"blog_ja","default");
			obj.preset = {
				name:{
					standard:"Blog",
					locales:{
						ja:"ブログ",
						en:"Blog"
					}
				},
				enable:true,
				filter:{
					type:"asterisk",
					asterisk:{
						filter:[
							"*://ameblo.jp/*/*",
							"*://blogs.yahoo.co.jp/*",
							"*://blog.livedoor.jp/*",
							"*://*.blog.jp/*",
							"*://*.doorblog.jp/*",
							"*://*.blog*.fc2.com/*",
							"*://*.exblog.jp/*",
							"*://*.seesaa.net/*",
							"*://*.blogspot.jp/*",
							"*://*.hatenablog.jp/*"
						]
					},
					regexp:{
						filter:[]
					}
				},
				enable_unsecure:false,
				enable_mixed_content:false,
				access_block:{enable:false,id:[]},
				replacement_to_element:{enable:true,id:["assist_image_in_anchor"]},
				replacement_to_text:{enable:false,id:[]},
				replacement_to_anchor:{enable:true,id:["no_referrer"]},
				replacement_to_link:{enable:true,id:["direct_link_generic"]},
				replacement_to_referer:{enable:true,id:["replacement_link_url"]},
				replacement_to_useragent:{enable:false,id:""},
				make_link_to_text:{enable:true,id:"detail"},
				expand_short_url:{enable:true,id:"detail"},
				expand_text:{enable:false,id:""},
				expand_image:{enable:true,id:"popup_image_in_anchor"},
				expand_sound:{enable:false,id:""},
				expand_video:{enable:false,id:""},
				expand_iframe:{enable:false,id:""},
				style_sheet:{enable:true,id:"default"},
				experimental:{enable:false,id:""}
			};

		}
		if(exit())	return proj;

		// -
		// プロジェクト ver.20
		// -
		if(proj.version < 20){
			// バージョン値
			proj.version = 20;
		}
		if(exit())	return proj;

		// -
		// プロジェクト ver.21
		// -
		if(proj.version < 21){
			// バージョン値
			proj.version = 21;

			// -
			// 掲示板設定
			// -
			// 8chan.co
			var obj = addPreset(proj.expand_bbs,"8chan","4chan");
			obj.preset = {
				name:{
					standard:"8chan.co",
					locales:{
						ja:"8chan",
						en:"8chan.co"
					}
				},
				filter:{
					type:"regexp",
					asterisk:{
						filter:[]
					},
					regexp:{
						filter:[
							{
								pattern:"^(http|https)://([^.]+\\.|)8chan\\.co/[^/]+/.*$",
								flags:{i:true,g:false}
							},{
								pattern:"^(http|https)://([^.]+\\.|)8ch\\.net/[^/]+/.*$",
								flags:{i:true,g:false}
							}
						]
					}
				},
				enable:true,
				script_initialize:"",
				script_callback:"",
				popup:{
					origin_type:"adsorb_top_bottom",
					position_type:"absolute",
					enable_animation:true,
					percent:{x:75,y:90},
					time_wait_open:0,
					time_wait_close:250,
					style_sheet:"padding:20px 10px; margin:0px; border:1px solid #000; overflow-y:auto; word-wrap:break-word; word-break:break-all; display:block;"
				}
			};

			// -
			// URLマッピング設定
			// -
			// 画像掲示板
			updatePreset(proj.urlmap,"image_bbs",function(obj){
				var filter = obj.filter.asterisk.filter;
				filter.push("*://8ch.net/*");
				filter.push("*://8chan.co/*");
				filter.push("*://*.8chan.co/*");
			});
		}
		if(exit())	return proj;

		// -
		// プロジェクト ver.22
		// -
		if(proj.version < 22){
			// バージョン値
			proj.version = 22;

			// -
			// ハイパーリンク置換定義
			// -
			// 直リンク(HTML 内の画像を検索)
			var obj = addPreset(proj.replacement_to_link,"direct_link_find_image_in_html",null);
			obj.preset = {
				name:{
					standard:"Direct Link (Find an image in HTML)",
					locales:{
						ja:"直リンク(HTML 内の画像を検索)",
						en:"Direct Link (Find an image in HTML)"
					}
				},
				filter:[
					{
						name:{
							standard:"Image of the largest byte",
							locales:{
								ja:"最大バイトの画像",
								en:"Image of the largest byte"
							}
						},
						filter:{
							type:"regexp",
							asterisk:{
								filter:[]
							},
							regexp:{
								filter:[
									{
										pattern:"^(http|https)://.*\\.(bmp|gif|jpg|jpe|jpeg|png)([^#?/]*)([#?].*|$)",
										flags:{i:true,g:false}
									}
								]
							}
						},
						enable_reflect_to_anchor:false,
						enable_cache:true,
						script:""
					}
				]
			};

		}
		if(exit())	return proj;

		// -
		// プロジェクト ver.23
		// -
		if(proj.version < 23){
			// バージョン値
			proj.version = 23;
		}
		if(exit())	return proj;

		// -
		// プロジェクト ver.24
		// -
		if(proj.version < 24){
			// バージョン値
			proj.version = 24;

			// -
			// リファラ置換定義
			// -
			// スレッド掲示板用
			var obj = addPreset(proj.replacement_to_referer,"bbs","wildcard");
			obj.preset = {
				name:{
					standard:"For 2ch.net",
					locales:{
						ja:"スレッド掲示板用",
						en:"For 2ch.net"
					}
				},
				filter:[
					{
						name:{
							standard:"shitaraba.net",
							locales:{
								ja:"したらば掲示板",
								en:"shitaraba.net"
							}
						},
						filter:{
							type:"asterisk",
							asterisk:{
								filter:[
									"http://jbbs.shitaraba.net/bbs/write.cgi/*"
								]
							},
							regexp:{
								filter:[]
							}
						},
						send_referer:{
							type:"default",
							custom:"",
							regexp:{
								pattern:"",
								flags:{i:false,g:false}
							},
							replacement:""
						}
					}
				]
			};

			// -
			// URLマッピング設定
			// -
			// スレッド掲示板
			var preset = getPreset(proj.urlmap,"bbs");
			preset.replacement_to_referer.id.unshift("bbs");

		}
		if(exit())	return proj;

		// -
		// プロジェクト ver.25
		// -
		if(proj.version < 25){
			// バージョン値
			proj.version = 25;

			// -
			// イメージ展開定義
			// -
			// スレッド掲示板用
			var obj = addPreset(proj.expand_image,"bbs","twitter");
			obj.preset = {
				name:{
					standard:"For 2ch.net",
					locales:{
						ja:"スレッド掲示板用",
						en:"For 2ch.net"
					}
				},
				thumbnail:{
					enable_thumbnail:true,
					enable_popup_mouseover:true,
					disable_same_image:false,
					load_type:"preload",
					script_allow:"",
					script_insert:""
				},
				popup:{
					enable_popup_mouseover:true,
					origin_type:"center",
					position_type:"absolute",
					time_wait_open:0,
					time_wait_close:0,
					enable_animation_scale:true,
					enable_animation_alpha:true,
					load_type:"preload",
					scale_percent:100,
					script_allow:""
				},
				reduced_image:{
					enable_popup:true,
					popup_allow_slcale_less_then:70
				},
				load:{
					enable_notify:true,
					enable_unload:false,
					src_type:"mixed_content",
					unload_allow_size_more_then:256
				}
			};

			// -
			// URLマッピング設定
			// -
			// スレッド掲示板
			var preset = getPreset(proj.urlmap,"bbs");
			preset.replacement_to_element = {enable:true,id:["assist_image_in_anchor"]};
			preset.expand_image = {enable:true,id:"bbs"};

		}
		if(exit())	return proj;

		// -
		// プロジェクト ver.26
		// -
		if(proj.version < 26){
			// バージョン値
			proj.version = 26;

			// -
			// エレメント置換定義
			// -
			// 展開アシスト(reddit 用)
			var obj = addPreset(proj.replacement_to_element,"assist_reddit","assist_deviant_art");
			obj.preset = {
				name:{
					standard:"Assist Expand (reddit)",
					locales:{
						ja:"展開アシスト(reddit 用)",
						en:"Assist Expand (reddit)"
					}
				},
				script:""
			};

			// -
			// ハイパーリンク置換定義
			// -
			// 直リンク(汎用)
			updatePreset(proj.replacement_to_link,"direct_link_generic",function(obj){
				var filter = obj.filter;

				// OGP "twitter:*"
				filter[1].filter.asterisk.filter.push("*://imgur.com/*");
			});

			// -
			// イメージ展開定義
			// -
			// スレッド掲示板用
			var obj = addPreset(proj.expand_image,"reddit",null);
			obj.preset = {
				name:{
					standard:"For reddit",
					locales:{
						ja:"reddit 用",
						en:"For reddit"
					}
				},
				thumbnail:{
					enable_thumbnail:true,
					enable_popup_mouseover:true,
					disable_same_image:false,
					load_type:"preload",
					script_allow:"",
					script_insert:""
				},
				popup:{
					enable_popup_mouseover:true,
					origin_type:"center",
					position_type:"absolute",
					time_wait_open:0,
					time_wait_close:0,
					enable_animation_scale:true,
					enable_animation_alpha:true,
					load_type:"preload",
					scale_percent:100,
					script_allow:""
				},
				reduced_image:{
					enable_popup:true,
					popup_allow_slcale_less_then:70
				},
				load:{
					enable_notify:true,
					enable_unload:false,
					src_type:"mixed_content",
					unload_allow_size_more_then:256
				}
			};

			// -
			// サウンド展開定義
			// -
			// インライン表示(アシスト要素のみ)
			var obj = addPreset(proj.expand_sound,"inline_from_assist",null);
			obj.preset = {
				name:{
					standard:"Inline (assist only)",
					locales:{
						ja:"インライン表示(アシスト要素のみ)",
						en:"Inline (assist only)"
					}
				},
				inline:{
					disable_same_audio:true,
					sound_max:10,
					script_allow:"",
					script_insert:""
				},
				audio_element:{
					script_allow:""
				},
				soundcloud:{
					visible_player_flash:true,
					visible_player_html5:false
				},
				mixcloud:{
					visible_player:true
				}
			};

			// -
			// ビデオ展開定義
			// -
			// インライン表示(アシスト要素のみ)
			var obj = addPreset(proj.expand_video,"inline_from_assist",null);
			obj.preset = {
				name:{
					standard:"Inline (assist only)",
					locales:{
						ja:"インライン表示(アシスト要素のみ)",
						en:"Inline (assist only)"
					}
				},
				inline:{
					disable_same_video:true,
					video_max:10,
					script_allow:"",
					script_insert:""
				},
				video_element:{
					script_allow:""
				},
				youtube:{
					visible_video:true
				},
				nicovideo:{
					visible_video:true,
					visible_thumbnail_video:true,
					visible_thumbnail_mylist:true,
					visible_thumbnail_user:true,
					visible_thumbnail_community:true,
					visible_thumbnail_live:true,
					visible_thumbnail_seiga:true
				},
				ustream:{
					visible_video_live:true,
					visible_video_record:true
				},
				dailymotion:{
					visible_video:true
				},
				vimeo:{
					visible_video:true
				},
				fc2video:{
					visible_video:true
				},
				liveleak:{
					visible_video:true
				}
			};

			// -
			// URLマッピング設定
			// -
			// reddit.com
			var obj = addPreset(proj.urlmap,"reddit","chaika");
			obj.preset = {
				name:{
					standard:"reddit.com",
					locales:{
						ja:"reddit.com",
						en:"reddit.com"
					}
				},
				enable:true,
				filter:{
					type:"asterisk",
					asterisk:{
						filter:[
							"*://*.reddit.com/*"
						]
					},
					regexp:{
						filter:[]
					}
				},
				enable_unsecure:false,
				enable_mixed_content:false,
				access_block:{enable:false,id:[]},
				replacement_to_element:{enable:true,id:["assist_reddit"]},
				replacement_to_text:{enable:false,id:[]},
				replacement_to_anchor:{enable:true,id:["no_referrer"]},
				replacement_to_link:{enable:true,id:["direct_link_generic"]},
				replacement_to_referer:{enable:true,id:["replacement_link_url"]},
				replacement_to_useragent:{enable:false,id:""},
				make_link_to_text:{enable:true,id:"detail"},
				expand_short_url:{enable:true,id:"detail"},
				expand_text:{enable:false,id:""},
				expand_image:{enable:true,id:"reddit"},
				expand_sound:{enable:true,id:"inline_from_assist"},
				expand_video:{enable:true,id:"inline_from_assist"},
				expand_iframe:{enable:false,id:""},
				style_sheet:{enable:true,id:"default"},
				experimental:{enable:false,id:""}
			};

			// -
			// 掲示板設定
			// -
			// reddit.com
			var obj = addPreset(proj.expand_bbs,"reddit","8chan");
			obj.preset = {
				name:{
					standard:"reddit.com",
					locales:{
						ja:"reddit.com",
						en:"reddit.com"
					}
				},
				filter:{
					type:"asterisk",
					asterisk:{
						filter:[
							"*://*.reddit.com/*/*"
						]
					},
					regexp:{
						filter:[]
					}
				},
				enable:true,
				script_initialize:"",
				script_callback:"",
				popup:{
					origin_type:"adsorb_top_bottom",
					position_type:"absolute",
					enable_animation:true,
					percent:{x:75,y:90},
					time_wait_open:0,
					time_wait_close:250,
					style_sheet:"padding:20px 10px; margin:0px; border:1px solid #000; background:#FFF; overflow-y:auto; word-wrap:break-word; word-break:break-all; display:block;"
				}
			};

		}
		if(exit())	return proj;

		// -
		// プロジェクト ver.27
		// -
		if(proj.version < 27){
			// バージョン値
			proj.version = 27;

			// -
			// 掲示板設定
			// -
			// 2ちゃんねる掲示板
			var obj = addPreset(proj.expand_bbs,"2ch",null);
			var preset = obj.preset;
			var filter = preset.filter.regexp.filter;
			filter[4].pattern = "^http://jbbs\\.shitaraba\\.net/bbs/read\\.cgi/[^/]+/[0-9]+/[0-9]+.*$";
			filter[5].pattern = "^http://jbbs\\.shitaraba\\.net/bbs/read_archive\\.cgi/[^/]+/[0-9]+/[0-9]+.*$";

		}
		if(exit())	return proj;

		// -
		// プロジェクト ver.28
		// -
		if(proj.version < 28){
			// バージョン値
			proj.version = 28;

			// -
			// 言語設定
			// -
			var language = proj.language;
			language.auto = (language.type < 0);
			language.code = (["ja","en"][language.type]) || "en";				
			delete (language.type);

			// -
			// リファラ置換定義
			// -
			// スレッド掲示板用
			removePreset("replacement_to_referer","bbs");

			// 直リンク用(汎用)
			var obj = addPreset(proj.replacement_to_referer,"direct_link_generic","wildcard");
			obj.preset = {
				name:{
					standard:"For Direct Link (generic)",
					locales:{
						ja:"直リンク用(汎用)",
						en:"For Direct Link (generic)"
					}
				},
				filter:[
					{
						name:{
							standard:"pixiv.net",
							locales:{
								ja:"pixiv.net",
								en:"pixiv.net"
							}
						},
						filter:{
							type:"asterisk",
							asterisk:{
								filter:[
									"*://*.pixiv.net/*"
								]
							},
							regexp:{
								filter:[]
							}
						},
						send_referer:{
							type:"link_url",
							custom:"",
							regexp:{
								pattern:"",
								flags:{i:false,g:false}
							},
							replacement:""
						}
					}
				]
			};

			// -
			// 短縮 URL 展開
			// -
			var f = function(obj){
				var filter = obj.filter.asterisk.filter;
				var re = new RegExp("^(http|https)://(.*)$","i");
				var i;
				var num = filter.length;
				for(i=0;i<num;i++){
					var m = filter[i].match(re);
					if(m) filter[i] = "*://" + m[2];
				}
			};

			// 詳細
			updatePreset(proj.expand_short_url,"detail",f);
			// 簡易
			updatePreset(proj.expand_short_url,"simple",f);

			// -
			// URLマッピング設定
			// -
			// chaika
			removePreset("urlmap","chaika");

			// ブログ
			var obj = getPreset(proj.urlmap,"blog_ja");
			obj.replacement_to_referer = {enable:true,id:["direct_link_generic"]};

			// ニコニコ静画
			var obj = getPreset(proj.urlmap,"nico_seiga");
			obj.replacement_to_referer = {enable:true,id:["direct_link_generic"]};

			// deviantART
			var obj = getPreset(proj.urlmap,"deviant_art");
			obj.replacement_to_referer = {enable:true,id:["direct_link_generic"]};

			// twitter
			var obj = getPreset(proj.urlmap,"twitter");
			obj.replacement_to_referer = {enable:true,id:["direct_link_generic"]};

			// フェイスブック
			var obj = getPreset(proj.urlmap,"facebook");
			obj.replacement_to_referer = {enable:true,id:["direct_link_generic"]};

			// スレッド掲示板
			var obj = getPreset(proj.urlmap,"bbs");
			var filter = obj.filter.asterisk.filter;
			filter.splice(12,1);
			filter.splice(11,1);
			filter.splice(10,1);
			obj.replacement_to_referer = {enable:true,id:["direct_link_generic"]};

			// 画像掲示板
			var obj = getPreset(proj.urlmap,"image_bbs");
			obj.replacement_to_referer = {enable:true,id:["direct_link_generic"]};

			// reddit.com
			var obj = getPreset(proj.urlmap,"reddit");
			obj.replacement_to_referer = {enable:true,id:["direct_link_generic"]};

			// 画像検索サイト
			var obj = getPreset(proj.urlmap,"image_search");
			obj.replacement_to_referer = {enable:false,id:[]};

			// -
			// 掲示板設定
			// -
			// 2ちゃんねる掲示板
			var obj = addPreset(proj.expand_bbs,"2ch",null);
			var preset = obj.preset;
			var filter = preset.filter.regexp.filter;
			filter.splice(7,1);
			filter.splice(6,1);

			// ログ速
			var obj = addPreset(proj.expand_bbs,"logsoku",null);
			var preset = obj.preset;
			preset.filter.regexp.filter.splice(0,3,{
				pattern:"^http://www\\.logsoku\\.com/r/[^/]+/[^/]+/[0-9]+.*$",
				flags:{i:true,g:false}
			});

			// あっとちゃんねるず
			removePreset("expand_bbs","atchs");

			// chaika
			removePreset("expand_bbs","chaika");

			// 2ちゃんねる掲示板 v.06
			var obj = addPreset(proj.expand_bbs,"2ch_v6","2ch");
			obj.preset = {
				name:{
					standard:"2ch.net (v.06)",
					locales:{
						ja:"2ちゃんねる掲示板(v.06)",
						en:"2ch.net (v.06)"
					}
				},
				filter:{
					type:"regexp",
					asterisk:{
						filter:[]
					},
					regexp:{
						filter:[]
					}
				},
				enable:true,
				script_initialize:"",
				script_callback:"",
				popup:{
					origin_type:"adsorb_top_bottom",
					position_type:"absolute",
					enable_animation:true,
					percent:{x:75,y:90},
					time_wait_open:0,
					time_wait_close:250,
					style_sheet:"padding:20px 10px; margin:0px; border:1px solid #000; background:#FFF; overflow-y:auto; word-wrap:break-word; word-break:break-all; display:block;"
				}
			};

		}
		if(exit())	return proj;

		// -
		// プロジェクト ver.29
		// -
		if(proj.version < 29){
			// バージョン値
			proj.version = 29;

			// -
			// エレメント置換定義
			// -
			var dic = {
				"delete_br_tags":{
					script:"ReplacementToElement_DeleteBrTags"
				},
				"meiryo_font":{
					script:"ReplacementToElement_MeiryoFont"
				},
				"assist_image_in_anchor":{
					script:"ReplacementToElement_AssistImageInAnchor"
				},
				"assist_image_search":{
					script:"ReplacementToElement_AssistImageSearch"
				},
				"assist_twitter":{
					script:"ReplacementToElement_AssistTwitter"
				},
				"assist_reddit":{
					script:"ReplacementToElement_AssistReddit"
				},
				"assist_deviant_art":{
					script:"ReplacementToElement_AssistDeviantArt"
				},
				"assist_nico_seiga":{
					script:"ReplacementToElement_AssistNicoSeiga"
				},
				"assist_pixiv":{
					script:"ReplacementToElement_AssistPixiv"
				}
			};
			updatePreset(proj.replacement_to_element,"*",function(obj,def){
				var p = dic[def.id];
				obj.script = PageExpandProjectScriptObject_Create(p.script);
			});
			updateUser(proj.replacement_to_element,"*",function(obj,def){
				var p = dic[def.id];
				var script_obj = PageExpandProjectScriptObject_Create((p) ? (p.script):"ReplacementToElement_Default");
				PageExpandProjectScriptObject_SetUserScript(script_obj,obj.script);
				obj.script = script_obj;
			});

			// -
			// テキスト置換定義
			// -
			var dic = {
				"alphanumeric_half":{
					script:"ReplacementToText_AlphanumericHalf"
				},
				"visualize_space_and_tab":{
					script:"ReplacementToText_VisualizeSpaceAndTab"
				}
			};
			updatePreset(proj.replacement_to_text,"*",function(obj,def){
				var p = dic[def.id];
				obj.script = PageExpandProjectScriptObject_Create(p.script);
			});
			updateUser(proj.replacement_to_text,"*",function(obj,def){
				var p = dic[def.id];
				var script_obj = PageExpandProjectScriptObject_Create((p) ? (p.script):"ReplacementToText_Default");
				PageExpandProjectScriptObject_SetUserScript(script_obj,obj.script);
				obj.script = script_obj;
			});

			// -
			// アンカー置換定義
			// -
			var dic = {
				"auto_download_all":{
					script:"ReplacementToAnchor_AutoDownloadAll"
				},
				"auto_download_image":{
					script:"ReplacementToAnchor_AutoDownloadImage"
				},
				"add_download_list_all":{
					script:"ReplacementToAnchor_AddDownloadListAll"
				},
				"add_download_list_image":{
					script:"ReplacementToAnchor_AddDownloadListImage"
				},
				"disable_popup_image_search":{
					script:"ReplacementToAnchor_DisablePopupImageSearch"
				},
				"disable_event_facebook":{
					script:"ReplacementToAnchor_DisableEventFacebook"
				},
				"direct_link_twitter":{
					script:"ReplacementToAnchor_DirectLinkTwitter"
				},
				"direct_link_facebook":{
					script:"ReplacementToAnchor_DirectLinkFacebook"
				},
				"direct_link_realtime_search":{
					script:"ReplacementToAnchor_DirectLinkRealtimeSearch"
				},
				"direct_link_search":{
					script:"ReplacementToAnchor_DirectLinkSearch"
				},
				"direct_link_bbs":{
					script:"ReplacementToAnchor_DirectLinkBbs"
				},
				"display_url_in_tooltip":{
					script:"ReplacementToAnchor_DisplayUrlInTooltip"
				},
				"attach_sns_counter":{
					script:"ReplacementToAnchor_AttachSnsCounter"
				},
				"no_referrer":{
					script:"ReplacementToAnchor_NoReferrer"
				}
			};
			updatePreset(proj.replacement_to_anchor,"*",function(obj,def){
				var p = dic[def.id];
				obj.script = PageExpandProjectScriptObject_Create(p.script);
			});
			updateUser(proj.replacement_to_anchor,"*",function(obj,def){
				var p = dic[def.id];
				var script_obj = PageExpandProjectScriptObject_Create((p) ? (p.script):"ReplacementToAnchor_Default");
				PageExpandProjectScriptObject_SetUserScript(script_obj,obj.script);
				obj.script = script_obj;
			});

			// -
			// ハイパーリンク置換定義
			// -
			updateUser(proj.replacement_to_link,"*",function(obj,def){
				var filters = obj.filter;
				var i;
				var num = filters.length;
				for(i=0;i<num;i++){
					var filter = filters[i];
					var script_obj = PageExpandProjectScriptObject_Create("ReplacementToLink_Default");
					PageExpandProjectScriptObject_SetUserScript(script_obj,filter.script);
					filter.script = script_obj;
				}
			});

			// 直リンク(汎用)
			updatePreset(proj.replacement_to_link,"direct_link_generic",function(obj,def){
				var assets = [
					"ReplacementToLink_DirectLinkGeneric_OgpOgImage",
					"ReplacementToLink_DirectLinkGeneric_OgpTwitter",
					"ReplacementToLink_DirectLinkGeneric_Twitpic",
					"ReplacementToLink_DirectLinkGeneric_TwitterPhoto",
					"ReplacementToLink_DirectLinkGeneric_FacebookPhoto",
					"ReplacementToLink_DirectLinkGeneric_GooglePlusPhoto",
					"ReplacementToLink_DirectLinkGeneric_PicasaPhoto",
					"ReplacementToLink_DirectLinkGeneric_Tumblr",
					"ReplacementToLink_DirectLinkGeneric_Flickr",
					"ReplacementToLink_DirectLinkGeneric_Yfrog",
					"ReplacementToLink_DirectLinkGeneric_Giphy",
					"ReplacementToLink_DirectLinkGeneric_Gyazo",
					"ReplacementToLink_DirectLinkGeneric_PhotozouPhoto",
					"ReplacementToLink_DirectLinkGeneric_Twipple",
					"ReplacementToLink_DirectLinkGeneric_TwippleDirectLink",
					"ReplacementToLink_DirectLinkGeneric_BlogFc2Com",
					"ReplacementToLink_DirectLinkGeneric_DeviantArt",
					"ReplacementToLink_DirectLinkGeneric_NicoSeigaIllust",
					"ReplacementToLink_DirectLinkGeneric_NicoSeigaIllustDirectLink",
					"ReplacementToLink_DirectLinkGeneric_NicoSeigaManga",
					"ReplacementToLink_DirectLinkGeneric_PixivNet",
					"ReplacementToLink_DirectLinkGeneric_Miiverse"
				];
				var filters = obj.filter;
				var i;
				var num = filters.length;
				for(i=0;i<num;i++){
					var filter = filters[i];
					filter.script = PageExpandProjectScriptObject_Create(assets[i]);
				}
			});

			// イメージ検索用
			updatePreset(proj.replacement_to_link,"direct_link_image_search",function(obj,def){
				var assets = [
					"ReplacementToLink_DirectLinkImageSearch_Google",
					"ReplacementToLink_DirectLinkImageSearch_YahooImageSearch",
					"ReplacementToLink_DirectLinkImageSearch_YahooJapan",
					"ReplacementToLink_DirectLinkImageSearch_Bing",
					"ReplacementToLink_DirectLinkImageSearch_Ask",
					"ReplacementToLink_DirectLinkImageSearch_Aol",
					"ReplacementToLink_DirectLinkImageSearch_Yandex",
					"ReplacementToLink_DirectLinkImageSearch_Goo",
					"ReplacementToLink_DirectLinkImageSearch_Baidu",
					"ReplacementToLink_DirectLinkImageSearch_Naver",
					"ReplacementToLink_DirectLinkImageSearch_NaverJp"
				];
				var filters = obj.filter;
				var i;
				var num = filters.length;
				for(i=0;i<num;i++){
					var filter = filters[i];
					filter.script = PageExpandProjectScriptObject_Create(assets[i]);
				}
			});

			// ウィキペディア用
			updatePreset(proj.replacement_to_link,"direct_link_wikipedia",function(obj,def){
				var filter = obj.filter[0];
				filter.script = PageExpandProjectScriptObject_Create("ReplacementToLink_DirectLinkWikipedia");
			});

			// 直リンク(HTML 内の画像を検索)
			updatePreset(proj.replacement_to_link,"direct_link_find_image_in_html",function(obj,def){
				var filter = obj.filter[0];
				filter.script = PageExpandProjectScriptObject_Create("ReplacementToLink_DirectLinkFindImageInHTML_ImageOfTheLargestByte");
			});

			// -
			// ハイパーリンク化定義
			// -
			var dic = {
				"detail":{
					script:"MakeLinkToText_Detail"
				},
				"simple":{
					script:"MakeLinkToText_Simple"
				}
			};
			updatePreset(proj.make_link_to_text,"*",function(obj,def){
				var p = dic[def.id];
				obj.script = PageExpandProjectScriptObject_Create(p.script);
			});
			updateUser(proj.make_link_to_text,"*",function(obj,def){
				var p = dic[def.id];
				var script_obj = PageExpandProjectScriptObject_Create((p) ? (p.script):"MakeLinkToText_Default");
				PageExpandProjectScriptObject_SetUserScript(script_obj,obj.script);
				obj.script = script_obj;
			});

			// -
			// テキスト展開定義
			// -
			var dic = {
				"inline":{
					script_allow:"ExpandText_InlineScriptAllow_Inline",
					script_insert:"ExpandText_InlineScriptInsert_Inline"
				}
			};
			updatePreset(proj.expand_text,"*",function(obj,def){
				var p = dic[def.id];
				obj.inline.script_allow  = PageExpandProjectScriptObject_Create(p.script_allow);
				obj.inline.script_insert = PageExpandProjectScriptObject_Create(p.script_insert);
			});
			updateUser(proj.expand_text,"*",function(obj,def){
				var p = dic[def.id];

				var script_obj = PageExpandProjectScriptObject_Create((p) ? (p.script_allow):"ExpandText_InlineScriptAllow_Default");
				PageExpandProjectScriptObject_SetUserScript(script_obj , obj.inline.script_allow);
				obj.inline.script_allow = script_obj;

				var script_obj = PageExpandProjectScriptObject_Create((p) ? (p.script_insert):"ExpandText_InlineScriptInsert_Default");
				PageExpandProjectScriptObject_SetUserScript(script_obj , obj.inline.script_insert);
				obj.inline.script_insert = script_obj;
			});

			// -
			// イメージ展開定義
			// -
			var dic = {
				"popup_all":{
					thumbnail:{
						script_allow:"ExpandImage_ThumbnailScriptAllow_PopupAll",
						script_insert:"ExpandImage_ThumbnailScriptInsert"
					},
					popup:{
						script_allow:"ExpandImage_PopupScriptAllow_PopupAll"
					}
				},
				"popup_include_image":{
					thumbnail:{
						script_allow:"ExpandImage_ThumbnailScriptAllow_PopupIncludeImage",
						script_insert:"ExpandImage_ThumbnailScriptInsert"
					},
					popup:{
						script_allow:"ExpandImage_PopupScriptAllow_PopupIncludeImage"
					}
				},
				"popup_image_in_anchor":{
					thumbnail:{
						script_allow:"ExpandImage_ThumbnailScriptAllow_PopupImageInAnchor",
						script_insert:"ExpandImage_ThumbnailScriptInsert"
					},
					popup:{
						script_allow:"ExpandImage_PopupScriptAllow_PopupImageInAnchor"
					}
				},
				"thumbnail_all":{
					thumbnail:{
						script_allow:"ExpandImage_ThumbnailScriptAllow_ThumbnailAll",
						script_insert:"ExpandImage_ThumbnailScriptInsert"
					},
					popup:{
						script_allow:"ExpandImage_PopupScriptAllow_ThumbnailAll"
					}
				},
				"thumbnail_not_include_image":{
					thumbnail:{
						script_allow:"ExpandImage_ThumbnailScriptAllow_ThumbnailNotIncludeImage",
						script_insert:"ExpandImage_ThumbnailScriptInsert"
					},
					popup:{
						script_allow:"ExpandImage_PopupScriptAllow_ThumbnailNotIncludeImage"
					}
				},
				"image_bbs":{
					thumbnail:{
						script_allow:"ExpandImage_ThumbnailScriptAllow_ImageBbs",
						script_insert:"ExpandImage_ThumbnailScriptInsert"
					},
					popup:{
						script_allow:"ExpandImage_PopupScriptAllow_ImageBbs"
					}
				},
				"bbs":{
					thumbnail:{
						script_allow:"ExpandImage_ThumbnailScriptAllow_ThumbnailNotIncludeImage",
						script_insert:"ExpandImage_ThumbnailScriptInsert"
					},
					popup:{
						script_allow:"ExpandImage_PopupScriptAllow_PopupImageInAnchor"
					}
				},
				"twitter":{
					thumbnail:{
						script_allow:"ExpandImage_ThumbnailScriptAllow_Twitter",
						script_insert:"ExpandImage_ThumbnailScriptInsert"
					},
					popup:{
						script_allow:"ExpandImage_PopupScriptAllow_Twitter"
					}
				},
				"reddit":{
					thumbnail:{
						script_allow:"ExpandImage_ThumbnailScriptAllow_Reddit",
						script_insert:"ExpandImage_ThumbnailScriptInsert"
					},
					popup:{
						script_allow:"ExpandImage_PopupScriptAllow_Reddit"
					}
				}
			};
			updatePreset(proj.expand_image,"*",function(obj,def){
				var p = dic[def.id];
				obj.thumbnail.script_allow  = PageExpandProjectScriptObject_Create(p.thumbnail.script_allow);
				obj.thumbnail.script_insert = PageExpandProjectScriptObject_Create(p.thumbnail.script_insert);
				obj.popup.script_allow = PageExpandProjectScriptObject_Create(p.popup.script_allow);
			});
			updateUser(proj.expand_image,"*",function(obj,def){
				var p = dic[def.id];

				var script_obj = PageExpandProjectScriptObject_Create((p) ? (p.thumbnail.script_allow):"ExpandImage_ThumbnailScriptAllow_Default");
				PageExpandProjectScriptObject_SetUserScript(script_obj , obj.thumbnail.script_allow);
				obj.thumbnail.script_allow = script_obj;

				var script_obj = PageExpandProjectScriptObject_Create((p) ? (p.thumbnail.script_insert):"ExpandImage_ThumbnailScriptInsert_Default");
				PageExpandProjectScriptObject_SetUserScript(script_obj , obj.thumbnail.script_insert);
				obj.thumbnail.script_insert = script_obj;

				var script_obj = PageExpandProjectScriptObject_Create((p) ? (p.popup.script_allow):"ExpandImage_PopupScriptAllow_Default");
				PageExpandProjectScriptObject_SetUserScript(script_obj , obj.popup.script_allow);
				obj.popup.script_allow = script_obj;
			});

			// 追加
			update(proj.expand_image,"*",function(obj){
				var thumbnail = obj.thumbnail;
				if(!(thumbnail.scale_percent)) thumbnail.scale_percent = 20;
				if(!(thumbnail.width_min)) thumbnail.width_min = 50;
				if(!(thumbnail.width_max)) thumbnail.width_max = 300;
			});

			// -
			// サウンド展開定義
			// -
			var dic = {
				"inline":{
					inline:{
						script_allow:"ExpandSound_InlineScriptAllow_Inline",
						script_insert:"ExpandSound_InlineScriptInsert_Inline"
					},
					audio_element:{
						script_allow:"ExpandSound_AudioElementScriptAllow_Inline"
					}
				},
				"inline_from_assist":{
					inline:{
						script_allow:"ExpandSound_InlineScriptAllow_InlineFromAssist",
						script_insert:"ExpandSound_InlineScriptInsert_Inline"
					},
					audio_element:{
						script_allow:"ExpandSound_AudioElementScriptAllow_Inline"
					}
				}
			};
			updatePreset(proj.expand_sound,"*",function(obj,def){
				var p = dic[def.id];
				obj.inline.script_allow  = PageExpandProjectScriptObject_Create(p.inline.script_allow);
				obj.inline.script_insert = PageExpandProjectScriptObject_Create(p.inline.script_insert);
				obj.audio_element.script_allow = PageExpandProjectScriptObject_Create(p.audio_element.script_allow);
			});
			updateUser(proj.expand_sound,"*",function(obj,def){
				var p = dic[def.id];

				var script_obj = PageExpandProjectScriptObject_Create((p) ? (p.inline.script_allow):"ExpandSound_InlineScriptAllow_Default");
				PageExpandProjectScriptObject_SetUserScript(script_obj , obj.inline.script_allow);
				obj.inline.script_allow = script_obj;

				var script_obj = PageExpandProjectScriptObject_Create((p) ? (p.inline.script_insert):"ExpandSound_InlineScriptInsert_Default");
				PageExpandProjectScriptObject_SetUserScript(script_obj , obj.inline.script_insert);
				obj.inline.script_insert = script_obj;

				var script_obj = PageExpandProjectScriptObject_Create((p) ? (p.audio_element.script_allow):"ExpandSound_AudioElementScriptAllow_Default");
				PageExpandProjectScriptObject_SetUserScript(script_obj , obj.audio_element.script_allow);
				obj.audio_element.script_allow = script_obj;
			});

			// -
			// ビデオ展開定義
			// -
			var dic = {
				"inline":{
					inline:{
						script_allow:"ExpandVideo_InlineScriptAllow_Inline",
						script_insert:"ExpandVideo_InlineScriptInsert_Inline"
					},
					video_element:{
						script_allow:"ExpandVideo_VideoElementScriptAllow_Inline"
					}
				},
				"inline_from_assist":{
					inline:{
						script_allow:"ExpandVideo_InlineScriptAllow_InlineFromAssist",
						script_insert:"ExpandVideo_InlineScriptInsert_Inline"
					},
					video_element:{
						script_allow:"ExpandVideo_VideoElementScriptAllow_Inline"
					}
				}
			};
			updatePreset(proj.expand_video,"*",function(obj,def){
				var p = dic[def.id];
				obj.inline.script_allow  = PageExpandProjectScriptObject_Create(p.inline.script_allow);
				obj.inline.script_insert = PageExpandProjectScriptObject_Create(p.inline.script_insert);
				obj.video_element.script_allow = PageExpandProjectScriptObject_Create(p.video_element.script_allow);
			});
			updateUser(proj.expand_video,"*",function(obj,def){
				var p = dic[def.id];

				var script_obj = PageExpandProjectScriptObject_Create((p) ? (p.inline.script_allow):"ExpandVideo_InlineScriptAllow_Default");
				PageExpandProjectScriptObject_SetUserScript(script_obj , obj.inline.script_allow);
				obj.inline.script_allow = script_obj;

				var script_obj = PageExpandProjectScriptObject_Create((p) ? (p.inline.script_insert):"ExpandVideo_InlineScriptInsert_Default");
				PageExpandProjectScriptObject_SetUserScript(script_obj , obj.inline.script_insert);
				obj.inline.script_insert = script_obj;

				var script_obj = PageExpandProjectScriptObject_Create((p) ? (p.video_element.script_allow):"ExpandVideo_VideoElementScriptAllow_Default");
				PageExpandProjectScriptObject_SetUserScript(script_obj , obj.video_element.script_allow);
				obj.video_element.script_allow = script_obj;
			});

			// -
			// インラインフレーム展開定義
			// -
			var dic = {
				"expand_pdf_inline":{
					script_allow:"ExpandIframe_InlineScriptAllow_ExpandPdfInline",
					script_insert:"ExpandIframe_InlineScriptInsert_ExpandPdfInline"
				},
				"expand_flash_inline":{
					script_allow:"ExpandIframe_InlineScriptAllow_ExpandFlashInline",
					script_insert:"ExpandIframe_InlineScriptInsert_ExpandFlashInline"
				}
			};
			updatePreset(proj.expand_iframe,"*",function(obj,def){
				var p = dic[def.id];
				obj.inline.script_allow  = PageExpandProjectScriptObject_Create(p.script_allow);
				obj.inline.script_insert = PageExpandProjectScriptObject_Create(p.script_insert);
			});
			updateUser(proj.expand_iframe,"*",function(obj,def){
				var p = dic[def.id];

				var script_obj = PageExpandProjectScriptObject_Create((p) ? (p.script_allow):"ExpandIframe_InlineScriptAllow_Default");
				PageExpandProjectScriptObject_SetUserScript(script_obj , obj.inline.script_allow);
				obj.inline.script_allow = script_obj;

				var script_obj = PageExpandProjectScriptObject_Create((p) ? (p.script_insert):"ExpandIframe_InlineScriptInsert_Default");
				PageExpandProjectScriptObject_SetUserScript(script_obj , obj.inline.script_insert);
				obj.inline.script_insert = script_obj;
			});

			// -
			// 掲示板設定
			// -
			var dic = {
				"nicovideo_dictionary":{
					script_initialize:"ExpandBbs_ScriptInitialize_NicovideoDictionary",
					script_callback:"ExpandBbs_ScriptCallback_NicovideoDictionary"
				},
				"reddit":{
					script_initialize:"ExpandBbs_ScriptInitialize",
					script_callback:"ExpandBbs_ScriptCallback_reddit"
				},
				"8chan":{
					script_initialize:"ExpandBbs_ScriptInitialize",
					script_callback:"ExpandBbs_ScriptCallback_8chan"
				},
				"4chan":{
					script_initialize:"ExpandBbs_ScriptInitialize",
					script_callback:"ExpandBbs_ScriptCallback_4chan"
				},
				"2chan":{
					script_initialize:"ExpandBbs_ScriptInitialize_2chan",
					script_callback:"ExpandBbs_ScriptCallback_2chan"
				},
				"open2ch":{
					script_initialize:"ExpandBbs_ScriptInitialize_Open2ch",
					script_callback:"ExpandBbs_ScriptCallback_Open2ch"
				},
				"mimizun":{
					script_initialize:"ExpandBbs_ScriptInitialize_Mimizun",
					script_callback:"ExpandBbs_ScriptCallback_Mimizun"
				},
				"logsoku":{
					script_initialize:"ExpandBbs_ScriptInitialize_Logsoku",
					script_callback:"ExpandBbs_ScriptCallback_Logsoku"
				},
				"2ch_v6":{
					script_initialize:"ExpandBbs_ScriptInitialize_2ch_v6",
					script_callback:"ExpandBbs_ScriptCallback_2ch_v6"
				},
				"2ch":{
					script_initialize:"ExpandBbs_ScriptInitialize_2ch",
					script_callback:"ExpandBbs_ScriptCallback_2ch"
				}
			};
			updatePreset(proj.expand_bbs,"*",function(obj,def){
				var p = dic[def.id];
				obj.script_initialize  = PageExpandProjectScriptObject_Create(p.script_initialize);
				obj.script_callback = PageExpandProjectScriptObject_Create(p.script_callback);
			});
			updateUser(proj.expand_bbs,"*",function(obj,def){
				var p = dic[def.id];

				var script_obj = PageExpandProjectScriptObject_Create((p) ? (p.script_initialize):"ExpandBbs_ScriptInitialize_Default");
				PageExpandProjectScriptObject_SetUserScript(script_obj , obj.script_initialize);
				obj.script_initialize = script_obj;

				var script_obj = PageExpandProjectScriptObject_Create((p) ? (p.script_callback):"ExpandBbs_ScriptCallback_Default");
				PageExpandProjectScriptObject_SetUserScript(script_obj , obj.script_callback);
				obj.script_callback = script_obj;
			});
		}
		if(exit())	return proj;

		// -
		// プロジェクト ver.30
		// -
		if(proj.version < 30){
			// バージョン値
			proj.version = 30;
			
			// -
			// ハイパーリンク置換定義
			// -
			// イメージ検索用
			var obj = getPreset(proj.replacement_to_link,"direct_link_image_search");
			var filter = obj.filter[8];
			filter.filter.asterisk.filter[0] = "http://image.baidu.com/search/detail?*";

		}
		if(exit())	return proj;

		// -
		// プロジェクト ver.31
		// -
		if(proj.version < 31){
			// バージョン値
			proj.version = 31;
		}
		if(exit())	return proj;

		// -
		// プロジェクト ver.32
		// -
		if(proj.version < 32){
			// バージョン値
			proj.version = 32;
		}
		if(exit())	return proj;

		// -
		// プロジェクト ver.33
		// -
		if(proj.version < 33){
			// バージョン値
			proj.version = 33;

			// -
			// ハイパーリンク置換定義
			// -
			// 直リンク(汎用)
			updatePreset(proj.replacement_to_link,"direct_link_generic",function(obj){
				var filter = obj.filter;

				// OGP "twitter:*"
				filter[1].filter.asterisk.filter.splice(1,1);
                
				// Imgur
				filter.splice(9,0,{
					name:{
						standard:"Imgur",
						locales:{
							ja:"Imgur",
							en:"Imgur"
						}
					},
					filter:{
						type:"regexp",
						asterisk:{
							filter:[]
						},
						regexp:{
							filter:[
								{
									pattern:"(http|https)://imgur\\.com/[a-zA-Z0-9]+(|[?#].*)$",
									flags:{i:true,g:false}
								},{
									pattern:"^(http|https)://i\\.imgur\\.com/[a-zA-Z0-9]+\\.gifv(|[?#].*)$",
									flags:{i:true,g:false}
								}
							]
						}
					},
					enable_reflect_to_anchor:false,
					enable_cache:true,
					script:PageExpandProjectScriptObject_Create("ReplacementToLink_DirectLinkGeneric_Imgur")
				});
			});
		}
		if(exit())	return proj;

		// -
		// プロジェクト ver.34
		// -
		if(proj.version < 34){
			// バージョン値
			proj.version = 34;

			// -
			// 掲示板設定
			// -
			// ふたば☆ちゃんねる
			var obj = addPreset(proj.expand_bbs,"2chan",null);
			var filter = obj.preset.filter.regexp.filter;
			filter.push({
				pattern:"^http://(futalog|imgbako)\\.com/[0-9]+\\.htm$",
				flags:{i:true,g:false}
			},{
				pattern:"^http://[^.]+\\.ftbucket\\.info/.*/cont/.*$",
				flags:{i:true,g:false}
			});

			// -
			// URLマッピング設定
			// -
			// 画像掲示板
			updatePreset(proj.urlmap,"image_bbs",function(obj){
				var filter = obj.filter.asterisk.filter;
				filter.push("*://futalog.com/*");
				filter.push("*://imgbako.com/*");
				filter.push("*://*.ftbucket.info/*");
			});

		}
		if(exit())	return proj;

		// -
		// プロジェクト ver.35
		// -
		if(proj.version < 35){
			// バージョン値
			proj.version = 35;

			// -
			// リファラ置換定義
			// -
			// 直リンク用(汎用)
			var obj = getPreset(proj.replacement_to_referer,"direct_link_generic");
			var filter = obj.filter[0].filter = {
				type:"regexp",
				asterisk:{
					filter:[]
				},
				regexp:{
					filter:[
						{
							pattern:"^(http|https)://i[0-9]+[.]pixiv[.]net/.*[.](bmp|gif|jpg|jpeg|png)$",
							flags:{i:true,g:false}
						}
					]
				}
			};

			// -
			// URLマッピング設定
			// -
			// 画像掲示板
			var obj = getPreset(proj.urlmap,"pixiv");
			obj.replacement_to_referer = {enable:true,id:["direct_link_generic"]};

			// -
			// ダウンロード設定
			// -
			var download = proj.download.download;
			var save_file = download.save_file = new Object();
			save_file.type = "simple";
			save_file.simple = "url";
			save_file.detail = "";
			var batch_download = proj.download.batch_download = new Object();
			var save_file = batch_download.save_file = new Object();
			save_file.type = "simple";
			save_file.simple = "url";
			save_file.detail = "";
		}
		if(exit())	return proj;

		// -
		// プロジェクト ver.36
		// -
		if(proj.version < 36){
			// バージョン値
			proj.version = 36;
		}
		if(exit())	return proj;

		// -
		// プロジェクト ver.37
		// -
		if(proj.version < 37){
			// バージョン値
			proj.version = 37;

			// -
			// ハイパーリンク置換定義
			// -
			updatePreset(proj.expand_sound,"*",function(obj){
				var soundcloud = obj.soundcloud;
				delete soundcloud.visible_player_flash;
				soundcloud.visible_player_html5 = true;
			});

			// -
			// スタイルシート定義
			// -
			updatePreset(proj.style_sheet,"*",function(obj){
				var soundcloud = obj.expand_sound.inline.soundcloud;
				delete soundcloud.player_flash;
			});

			// -
			// 掲示板設定
			// -
			// ふたば☆ちゃんねる
			var obj = addPreset(proj.expand_bbs,"2chan",null);
			var filter = obj.preset.filter.regexp.filter;
			filter[0].pattern = "^(http|https)://[^.]+\\.2chan\\.net/.*/.*";
		}
		if(exit())	return proj;

		// -
		// プロジェクト ver.38
		// -
		if(proj.version < 38){
			// バージョン値
			proj.version = 38;

			// -
			// URLマッピング設定
			// -
			// 画像検索サイト
			var preset = getPreset(proj.urlmap,"image_search");
			var filter = preset.filter.regexp.filter;
			filter[4] = {
				pattern:"^[^:]+://image\\.search\\.yahoo\\.co\\.jp/search.*",
				flags:{i:true,g:false}
			};
		}
		if(exit())	return proj;

		// -
		// プロジェクト ver.39
		// -
		if(proj.version < 39){
			// バージョン値
			proj.version = 39;

			// -
			// ハイパーリンク置換定義
			// -
			// イメージ検索用
			updatePreset(proj.replacement_to_link,"direct_link_image_search",function(obj,def){
				var filters = obj.filter;
				filters.splice(8,3);
				filters.splice(4,2);
				filters[4].filter.regexp.filter[0] = {
					pattern:"^[^:]+://yandex\\.(ru|com)/images/search[?].*img_url=.*$",
					flags:{i:true,g:false}
				};
				filters[5].filter = {
					type:"regexp",
					asterisk:{
						filter:[]
					},
					regexp:{
						filter:[
							{
								pattern:"^[^:]+://search\\.goo\\.ne\\.jp/imageDetail[?].*mode=7.*$",
								flags:{i:true,g:false}
							}
						]
					}
				};
			});

			// -
			// ビデオ展開定義
			// -
			update(proj.expand_video,"*",function(obj){
				delete obj.ustream;
			});

			// -
			// スタイルシート定義
			// -
			update(proj.style_sheet,"*",function(obj){
				delete obj.expand_video.inline.ustream;
			});

			// -
			// URLマッピング設定
			// -
			// 検索サイト
			var preset = getPreset(proj.urlmap,"search");
			var filter = preset.filter.asterisk.filter;
			filter.splice(7,1);

			// 画像検索サイト
			var preset = getPreset(proj.urlmap,"image_search");
			var filter = preset.filter.regexp.filter;
			filter.splice(12,1);
			filter.splice(6,1);
			filter[4] = {
				pattern:"^[^:]+://search\\.yahoo\\.co\\.jp/image/search.*",
				flags:{i:true,g:false}
			};
			filter.splice(7,0,{
				pattern:"^[^:]+://[^.]+\\.aolsearch\\.com/image[?].*",
				flags:{i:true,g:false}
			});
			filter[9] = {
				pattern:"^[^:]+://search\\.goo\\.ne\\.jp/web\\.jsp[?].*mode=7.*",
				flags:{i:true,g:false}
			};
			filter[11] = {
				pattern:"^[^:]+://search\\.naver\\.com/search\\.naver[?].*where=image.*",
				flags:{i:true,g:false}
			};

			// リアルタイム検索サイト
			var preset = getPreset(proj.urlmap,"realtime_search");
			var filter = preset.filter.asterisk.filter;
			filter.splice(4,1);
			filter.splice(1,5);
			filter[0] = "*://search.yahoo.co.jp/realtime/*";

			// -
			// 掲示板設定
			// -
			// 2ちゃんねる掲示板 v.06
			moveItemAt(proj.expand_bbs,"2ch_v6",getItemIndex(proj.expand_bbs,"2ch"));
			var obj = getPreset(proj.expand_bbs,"2ch_v6");
			var filter = obj.filter.regexp.filter = [{
				pattern:"^(http|https)://[^.]+\\.2ch\\.net/test/read\\.cgi/[^/]+/[0-9]+.*$",
				flags:{i:true,g:false}
			},{
				pattern:"^(http|https)://[^.]+\\.bbspink\\.com/test/read\\.cgi/[^/]+/[0-9]+.*$",
				flags:{i:true,g:false}
			}];

			// 2ちゃんねる掲示板
			var obj = getPreset(proj.expand_bbs,"2ch");
			var filter = obj.filter.regexp.filter;
			var i;
			var num = filter.length;
			for(i=0;i<num;i++){
				var f = filter[i]
				f.pattern = f.pattern.replace("^http:","^(http|https):");
			}
			filter.splice(3,1);

		}
		if(exit())	return proj;

		// -
		// プロジェクト ver.40
		// -
		if(proj.version < 40){
			// バージョン値
			proj.version = 40;

			// -
			// URLマッピング設定
			// -
			// ピクシブ
			var preset = getPreset(proj.urlmap,"pixiv");
			preset.filter.asterisk.filter = [
				"*://*.pixiv.net/",
				"*://*.pixiv.net/*"
			];

			// -
			// 掲示板設定
			// -
			// 2ちゃんねる掲示板
			var obj = getPreset(proj.expand_bbs,"2ch");
			var filter = obj.filter.regexp.filter;
			filter.splice(0,1);

			// 2ちゃんねる掲示板 v.06
			var obj = getPreset(proj.expand_bbs,"2ch_v6");
			var filter = obj.filter.regexp.filter.push({
				pattern:"^(http|https)://[^.]+\\.2ch\\.net/[^/]+/kako/[0-9]+.*$",
				flags:{i:true,g:false}
			});

		}
		if(exit())	return proj;

		// -
		// プロジェクト ver.41
		// -
		if(proj.version < 41){
			// バージョン値
			proj.version = 41;

			// -
			// リファラ置換定義
			// -
			// 直リンク用(汎用)
			var obj = getPreset(proj.replacement_to_referer,"direct_link_generic");
			obj.filter[0].filter.regexp.filter.push({
					pattern:"^(http|https)://i[0-9]*[.]pximg[.]net/.*[.](bmp|gif|jpg|jpeg|png)$",
					flags:{i:true,g:false}
			});

		}
		if(exit())	return proj;

		// -
		// プロジェクト ver.42
		// -
		if(proj.version < 42){
			// バージョン値
			proj.version = 42;

			// -
			// URLマッピング設定
			// -
			// スレッド掲示板
			var obj = getPreset(proj.urlmap,"bbs");
			obj.filter.asterisk.filter.splice(2,0,
				"*://5ch.net/*",
				"*://*.5ch.net/*"
			);

			// -
			// 掲示板設定
			// -
			// 2ちゃんねる掲示板 v.06
			var obj = getPreset(proj.expand_bbs,"2ch_v6");
			var filter = obj.filter.regexp.filter;
			filter[0] = {
				pattern:"^(http|https)://[^.]+\\.(2ch|5ch)\\.net/test/read\\.cgi/[^/]+/[0-9]+.*$",
				flags:{i:true,g:false}
			}
			filter[2] = {
				pattern:"^(http|https)://[^.]+\\.(2ch|5ch)\\.net/[^/]+/kako/[0-9]+.*$",
				flags:{i:true,g:false}
			};

		}
		if(exit())	return proj;

		return proj;
	}


	// -
	// プリセットスクリプト辞書
	// -
	function PresetScriptDictionary(){
		var _this = this;

		// -
		// 開放
		// -
		_this.release = function(){
			_dictionary = null;
		};

		// -
		// アイテムを取得
		// -
		_this.getItem = function(asset){
			return _dictionary[asset];
		};

		// -
		// アイテムを登録(内部用)
		// -
		function attachItem(asset,script_obj){
			_dictionary[asset] = script_obj;
		}

		// -
		// プライベート変数
		// -
		var _dictionary = new Object();

		// -
		// 初期化
		// -
		(function(){

			// -
			// エレメント置換定義「連続するBRタグを削除」
			// -
			attachItem( "ReplacementToElement_DeleteBrTags" , [
	
	function(info,response){
		var element = info.element;

		if(element.tagName.toLowerCase() != "br"){
			return false;
		}

		// 最大連続改行数
		var allow_max = 2;

		var count = 0;
		var e = element.previousSibling;
		while(true){
			if(!e)	break;

			var node_type = e.nodeType;
			if(node_type == 1){
				if(e.tagName.toLowerCase() != "br"){
					break;
				}
				count++;
				if(count >= allow_max){
					var revise_scroll = new DocumentReviseScroll();
					revise_scroll.executeRemoveElementBefore(element);
					DomNodeRemove(element);
					revise_scroll.executeRemoveElementAfter(element);
					break;
				}
			}else if(node_type == 3){
				if(!ElementGetTextContent(e).match(new RegExp("^[ \r\n\t ]*$"))){
					break;
				}
			}



			e = e.previousSibling;
		}

		return false;
	},
	function(info,response){
		response({});
		return true;
	}

			]);

			// -
			// エレメント置換定義「フォントの種類をメイリオに変更」
			// -
			attachItem( "ReplacementToElement_MeiryoFont" , [
	
	function(info,response){
		var element = info.element;
		var style = element.style;
		if(style){
			// フォントのサイズ(font-size)
			//style.fontSize = "12px";

			// フォントの太さ(font-weight)
			//style.fontWeight = "bold";

			// フォントの斜体(font-style)
			//style.fontStyle = "italic";

			// フォントの種類(font-family)
			style.fontFamily = "'メイリオ','Meiryo'";

			// 行の高さ(line-height)
			//style.lineHeight = "1.4";
		}

		return false;
	},
	function(info,response){
		response({});
		return true;
	}

			]);

			// -
			// エレメント置換定義「展開アシスト(アンカー内画像用)」
			// -
			attachItem( "ReplacementToElement_AssistImageInAnchor" , [
	
	function(info,response){
		var element = info.element;
		var result = (function(){

			// イメージ要素
			if(element.tagName == "IMG"){
				return true;
			}

			// バックグラウンドイメージを含む
			var style = ElementGetComputedStyle(element,null);
			if(style){
				if(style.backgroundImage.indexOf("url(") == 0){
					return true;
				}
			}

			return false;
		})();

		if(result){
			while(element){
				if(element.tagName == "A"){
					response({url:element.href});
					return true;
				}
				element = element.parentNode;
			}
		}

		return false;
	},
	function(info,response){
		response({});
		return true;
	}

			]);

			// -
			// エレメント置換定義「展開アシスト(画像検索用)」
			// -
			attachItem( "ReplacementToElement_AssistImageSearch" , [
	
	function(info,response){
		var element = info.element;

		if(element.tagName == "DIV"){

			// Google Image Search
			try{
				var data_ri = element.getAttribute("data-ri");
				if(data_ri){
					var image = element.getElementsByTagName("IMG")[0];
					if(image){
						var mouse_event = document.createEvent("MouseEvent");
						mouse_event.initMouseEvent("mousedown",true,false,document.defaultView,0,0,0,0,0,false,false,false,false,0,null);
						image.dispatchEvent(mouse_event);
						return true;
					}
				}
			}catch(e){}
		}

		if(element.tagName == "LI"){

			// AOL Image Search
			try{
				var org_src = element.dataset["imgdetailContent"];
				if(org_src){
					response({url:org_src});
					return true;			
				}
			}catch(e){}

			// 百度画像検索
			try{
				var a = ElementGetElementsByTagName(element,"a")[0];
				if(a){
					if(a.href.match(new RegExp("^[^:]+://image\\.baidu\\.com/search/detail[?]"))){
						var image_url = element.dataset.objurl;
						if(image_url){
							response({url:image_url});
							return true;
						}
					}
				}
			}catch(e){}
		}

		if(element.tagName == "A"){

			// NAVER 画像検索
			try{
				var m = ElementGetClassName(element).match(new RegExp("thumb","i"));
				if(m){
					var node = ElementGetElementsByClassName(element,"_meta")[0];
					if(node){
						obj = JsonParse(ElementGetTextContent(node));
						var image_url = obj["originalUrl"];
						if(image_url){
							response({url:decodeURIComponent(image_url)});
							return true;
						}
					}
				}
			}catch(e){}

			// BIGLOBE 画像検索
			var org_imgsrc = element.getAttribute("org_imgsrc");
			if(org_imgsrc){
				response({url:org_imgsrc});
				return true;
			}
		}

		return false;
	},
	function(info,response){
		response({});
		return true;
	}

			]);

			// -
			// エレメント置換定義「展開アシスト(ツイッター用)」
			// -
			attachItem( "ReplacementToElement_AssistTwitter" , [

	function(info,response){
		var element = info.element;

		// 画像検索上のサムネイル
		var resolved_url = element.getAttribute("data-resolved-url-large");
		if(resolved_url){
			response({url:resolved_url});
			return true;
		}

		return false;
	},
	function(info,response){
		var element = info.element;

		// 2カラムタイムライン上の画像サムネイル(twimg.com)
		try{
			var m = ElementGetClassName(element).match(new RegExp("(^| |\t|\n|-)(photoContainer)( |\t|\n|$)","i"));
			if(m){
				var image_url = element.getAttribute("data-image-url");
				if(image_url){
					var m = image_url.match("(http|https)://[^:]+");
					if(m) image_url = m[0] + ":orig";
					response({url:image_url});
					return true;
				}
			}
		}catch(e){
		}		

		return false;
	},
	function(info,response){
		var element = info.element;

		// 3カラムタイムライン上の画像サムネイル(twimg.com)
		var result = (function(){
			if(element.tagName != "A") return false;
			if(!element.href.match(/(http|https):[/][/]twitter[.]com[/][^/]+[/]status[/][0-9]+[/]photo[/][0-9]+/)) return false;
			return true;
		})();

		if(result){
			var nodes = ElementGetElementsByTagName(element,"img");
			var i;
			var num = nodes.length;
			for(i=0;i<num;i++){
				var node = nodes[i];
				var m = node.src.match(/(http|https)(:[/][/]pbs[.]twimg[.]com[/]media[/][^?]+)[?].*format=/);
				if(m){
					var q = StringGetQuery(node.src);
					response({url:m[1]+m[2]+"." + q["format"] + ":orig"});
					return true;
				}
			}
		}

		return false;
	},
	function(info,response){
		response({});
		return true;
	}

			]);

			// -
			// エレメント置換定義「展開アシスト(reddit 用)」
			// -
			attachItem( "ReplacementToElement_AssistReddit" , [
	
	function(info,response){
		var element = info.element;
		var result = (function(){

			// アンカー
			if(element.tagName == "A"){
				return true;
			}

			return false;
		})();

		if(result){
			var node = element;
			while(node){
				if(node.nodeType == 1){
					if(node.className.match(new RegExp("(^| )usertext( |$)"))){
						response({url:element.href});
						return true;
					}
				}
				node = node.parentNode;
			}
		}

		return false;
	},
	function(info,response){
		response({});
		return true;
	}

			]);

			// -
			// エレメント置換定義「展開アシスト(deviantART 用)」
			// -
			attachItem( "ReplacementToElement_AssistDeviantArt" , [
	
	function(info,response){
		var element = info.element;
		var result = (function(){

			// イメージ要素
			if(element.tagName == "IMG"){
				return true;
			}

			// 縦長サムネイル
			if(element.className == "tt-bookendh"){
				return true;
			}

			// 小サムネイル
			if(ElementGetClassName(element).search(new RegExp("tinythumb","i")) >= 0){
				return true;
			}

			return false;
		})();

		if(result){
			while(element){
				if(element.tagName == "A"){
					response({url:element.href});
					return true;
				}
				element = element.parentNode;
			}
		}

		return false;
	},
	function(info,response){
		response({});
		return true;
	}

			]);

			// -
			// エレメント置換定義「展開アシスト(ピクシブ用)」
			// -
			attachItem( "ReplacementToElement_AssistPixiv" , [
	
	function(info,response){
		var element = info.element;

		if(element.tagName != "LI") return false;

		var url = document.URL;
		if(url.indexOf("mode=manga") < 0) return false;

		var query = StringGetQuery(url);
		if(!(query.illust_id)) return false;

		var pos = element.getAttribute("data-position");
		if(!pos) return false;

		var tooltip = element.getAttribute("data-tooltip");
		if(!tooltip) return false;

		if(!tooltip.match(/^[0-9]+$/)) return false;

		response({url:"http://www.pixiv.net/member_illust.php?mode=manga_big&illust_id=" + query.illust_id + "&page=" + pos});
		return true;
	},
	function(info,response){
		var element = info.element;
		var result = (function(){

			// DIV 要素
			if(element.tagName != "DIV"){
				return false;
			}

			if(!ElementGetClassName(element).match(new RegExp("(^| )_layout-thumbnail( |$)"))){
				return false;
			}

			return true;
		})();

		if(result){
			while(element){
				if(element.tagName == "A"){
					response({url:element.href});
					return true;
				}
				element = element.parentNode;
			}
		}

		return false;
	},
	function(info,response){
		var element = info.element;
		var result = (function(){

			if(ElementGetClassName(element).indexOf("user-icon") >= 0) return false;

			// イメージ要素
			if(element.tagName == "IMG"){
				return true;
			}

			// バックグラウンドイメージを含む
			var style = ElementGetComputedStyle(element,null);
			if(style){
				if(style.backgroundImage.indexOf("url(") == 0){
					return true;
				}
			}

			return false;
		})();

		if(result){
			while(element){
				if(element.className == "_layout-thumbnail") break;
				if(element.tagName == "A"){
					response({url:element.href});
					return true;
				}
				element = element.parentNode;
			}
		}

		return false;
	},
	function(info,response){
		response({});
		return true;
	}

			]);

			// -
			// エレメント置換定義「展開アシスト(ニコニコ静画用)」
			// -
			attachItem( "ReplacementToElement_AssistNicoSeiga" , [
	
	function(info,response){
		var element = info.element;
		var result = (function(){

			// イメージ要素
			if(element.tagName == "IMG"){
				return true;
			}

			// トップアイテム
			if(element.className == "item_info_container"){
				return true;
			}

			return false;
		})();

		if(result){
			while(element){
				if(element.tagName == "A"){
					response({url:element.href});
					return true;
				}
				element = element.parentNode;
			}
		}

		return false;
	},
	function(info,response){
		response({});
		return true;
	}

			]);

			// -
			// エレメント置換定義「デフォルト」
			// -
			attachItem( "ReplacementToElement_Default" , [
	
	function(info,response){

		// -
		// 第01引数 Object 型
		// element:HTMLElement オブジェクト
		// -
		var element = info.element;

		// -
		// 第02引数 function
		// 引数:Object 型
		// url:String 型(省略可、展開先のアドレスを指定)
		// 処理が完了したタイミングで必ず1度実行する必要がある。非同期実行可能。
		// -
		response({});

		// -
		// 戻り値 Boolean 型
		// true :関数の実行を完了
		// false:次の関数を実行
		// -
		return true;
	}

			]);


			// -
			// テキスト置換定義「英数字記号を半角、カタカナを全角に変更」
			// -
			attachItem( "ReplacementToText_AlphanumericHalf" , [
	
	function(info,response){
		var text_node = info.text_node;

		// 文字列を取得
		var str = DomNodeGetNodeValue(text_node);
		if(!str){
			return false;
		}

		// 小文字化
		//str = str.toLowerCase();

		// 大文字化
		//str = str.toUpperCase();

		// 全角アルファベットから半角アルファベットに変換
		str = StringConvertFromAlphabeticFullToAlphabeticHalf(str);

		// 半角アルファベットから全角アルファベットに変換
		//str = StringConvertFromAlphabeticHalfToAlphabeticFull(str);

		// 全角数字から半角数字に変換
		str = StringConvertFromNumericFullToNumericHalf(str);

		// 半角英数字から全角英数字に変換
		//str = StringConvertFromNumericHalfToNumericFull(str);

		// 全角記号から半角記号に変換
		str = StringConvertFromSignFullToSignHalf(str);

		// 半角記号から全角記号に変換
		//str = StringConvertFromSignHalfToSignFull(str);

		// 全角スペースから半角スペースに変換
		//str = StringConvertFromSpaceFullToSpaceHalf(str);

		// 半角スペースから全角スペースに変換
		//str = StringConvertFromSpaceHalfToSpaceFull(str);

		// 半角カタカナから全角カタカナに変換
		str = StringConvertFromKatakanaFullToKatakanaHalf(str);

		// 全角カタカナから半角カタカナに変換
		//str = StringConvertFromKatakanaHalfToKatakanaFull(str);

		// ひらがなからカタカナに変換
		//str = StringConvertFromHiraganaToKatakana(str);

		// カタカナからひらがなに変換
		//str = StringConvertFromKatakanaToHiragana(str);

		// 文字列をセット
		DomNodeSetNodeValue(text_node,str);

		return false;
	},
	function(info,response){
		response({});
		return true;
	}

			]);

			// -
			// テキスト置換定義「空白とタブを可視化」
			// -
			attachItem( "ReplacementToText_VisualizeSpaceAndTab" , [
	
	function(info,response){
		var text_node = info.text_node;

		// 透明度
		var alpha = 0.1;

		while(text_node){

			// テキストを取得
			var str = DomNodeGetNodeValue(text_node);
			if(!str){
				return false;
			}

			if(str.match(/^( | |\t|\n|\r)+$/)){
				break;
			}

			// 空白を調べる
			var r = new RegExp("( | |\t)","i");
			var match = str.match(r);
			if(match){
				// 左側のテキスト
				DomNodeSetNodeValue(text_node,RegExp.leftContext);

				// pre 作成
				var element = DocumentCreateElement('pre');
				element.style.display = "inline";
				switch(match[1]){
					case " ":	element.style.backgroundColor = "#f00";	break;
					case " ":	element.style.backgroundColor = "#0f0";	break;
					case "\t":	element.style.backgroundColor = "#00f";	break;
				}
				element.style.opacity = alpha;
				DomNodeInsertAfter(element,text_node);

				// テキスト作成
				var text = DocumentCreateText(match[1]);
				DomNodeSetCompletedReplacementToText(text);
				element.appendChild(text);

				// 右側のテキスト
				var text = DocumentCreateText('text');
				DomNodeSetNodeValue(text,RegExp.rightContext);
				DomNodeInsertAfter(text,element);

				text_node = text;
				continue;
			}

			break;
		}

		return false;
	},
	function(info,response){
		response({});
		return true;
	}

			]);

			// -
			// テキスト置換定義「デフォルト」
			// -
			attachItem( "ReplacementToText_Default" , [
	
	function(info,response){

		// -
		// 第01引数 Object 型
		// text_node:Text オブジェクト (DOM)
		// -
		var text_node = info.text_node;

		// -
		// 第02引数 function
		// 引数:なし
		// 処理が完了したタイミングで必ず1度実行する必要がある。非同期実行可能。
		// -
		response();

		// -
		// 戻り値 Boolean 型
		// true :関数の実行を完了
		// false:次の関数を実行
		// -
		return true;
	}

			]);


			// -
			// アンカー置換定義「自動ダウンロード(すべて)」
			// -
			attachItem( "ReplacementToAnchor_AutoDownloadAll" , [
	
	function(info,response){
		var anchor_element = info.anchor_element;

		var url = anchor_element.href;
		if(url.search("^(http|https|data):") >= 0){

			// Downloader オブジェクトを作成
			var downloader = new Downloader();

			// ダウンロード設定
			downloader.setURL(url);
			//downloader.setFileName(url);
			downloader.setSaveAs(false);
			downloader.setSilent(true);
			downloader.setAllowSameRequest(false);

			// ダウンロード開始
			downloader.start();
		}

		return false;
	},
	function(info,response){
		response({});
		return true;
	}

			]);

			// -
			// アンカー置換定義「自動ダウンロード(画像のみ)」
			// -
			attachItem( "ReplacementToAnchor_AutoDownloadImage" , [
	
	function(info,response){
		var anchor_element = info.anchor_element;

		var url = anchor_element.href;
		var ext_list = [
			"bmp",
			"gif",
			"jpg",
			"jpe",
			"jpeg",
			"png"
		];

		var i;
		var num = ext_list.length;
		for(i=0;i<num;i++){
			if(url.search(new RegExp("^.*/.+\\." + ext_list[i] + "($|[#?:].*$)","i")) >= 0){

				// Downloader オブジェクトを作成
				var downloader = new Downloader();

				// ダウンロード設定
				downloader.setURL(url);
				//downloader.setFileName(url);
				downloader.setSaveAs(false);
				downloader.setSilent(true);
				downloader.setAllowSameRequest(false);

				// ダウンロード開始
				downloader.start();

				break;
			}
		}

		return false;
	},
	function(info,response){
		response({});
		return true;
	}

			]);

			// -
			// アンカー置換定義「ダウンロードリストに登録(すべて)」
			// -
			attachItem( "ReplacementToAnchor_AddDownloadListAll" , [
	
	function(info,response){
		var anchor_element = info.anchor_element;

		var url = anchor_element.href;
		if(url.search("^(http|https|data):") >= 0){

			// ユーザーリストからアイテムを作成
			var item = download_list_user.createItem();

			// ダウンロード設定
			item.setURL(url);
			//item.setFileName(url);
		}

		return false;
	},
	function(info,response){
		response({});
		return true;
	}

			]);

			// -
			// アンカー置換定義「ダウンロードリストに登録(画像のみ)」
			// -
			attachItem( "ReplacementToAnchor_AddDownloadListImage" , [
	
	function(info,response){
		var anchor_element = info.anchor_element;

		var url = anchor_element.href;
		var ext_list = [
			"bmp",
			"gif",
			"jpg",
			"jpe",
			"jpeg",
			"png"
		];

		var i;
		var num = ext_list.length;
		for(i=0;i<num;i++){
			if(url.search(new RegExp("^.*/.+\\." + ext_list[i] + "($|[#?:].*$)","i")) >= 0){

				// ユーザーリストからアイテムを作成
				var item = download_list_user.createItem();

				// ダウンロード設定
				item.setURL(url);
				//item.setFileName(url);

				break;
			}
		}

		return false;
	},
	function(info,response){
		response({});
		return true;
	}

			]);

			// -
			// アンカー置換定義「ポップアップを無効化(イメージ検索用)」
			// -
			attachItem( "ReplacementToAnchor_DisablePopupImageSearch" , [

	function(info,response){
		response({});
		return true;
	}

			]);

			// -
			// アンカー置換定義「イベントを無効化(フェイスブック用)」
			// -
			attachItem( "ReplacementToAnchor_DisableEventFacebook" , [
	
	function(info,response){
		var anchor_element = info.anchor_element;
		var parent = anchor_element.parentNode;
		if(parent){
			var m = ElementGetClassName(parent).match(new RegExp("(^| )userContent( |$)","i"));
			if(m){
				anchor_element.removeAttribute("onmouseover");
				anchor_element.removeAttribute("onclick");
				anchor_element.onmouseover = null;
				anchor_element.onclick = null;
			}
		}

		return false;
	},
	function(info,response){
		response({});
		return true;
	}

			]);

			// -
			// アンカー置換定義「直リンクに変更(ツイッター用)」
			// -
			attachItem( "ReplacementToAnchor_DirectLinkTwitter" , [
	
	function(info,response){
		var anchor_element = info.anchor_element;

		var expanded_url = anchor_element.getAttribute("data-expanded-url");
		if(expanded_url){
			if(StringUrlMatchAsteriskWord(anchor_element.href,"*://t.co/*")){
				anchor_element.href = expanded_url;
			}
		}

		return false;
	},
	function(info,response){
		response({});
		return true;
	}

			]);

			// -
			// アンカー置換定義「直リンクに変更(フェイスブック用)」
			// -
			attachItem( "ReplacementToAnchor_DirectLinkFacebook" , [
	
	function(info,response){
		var anchor_element = info.anchor_element;

		var url = anchor_element.href;
		var m = url.match(new RegExp("^(http|https)://[^\\.]+\\.facebook\\.com/l\\.php?","i"));
		if(m){
			var query = StringGetQuery(url);
			if(query["u"]){
				anchor_element.href = unescape(query["u"]);
			}
		}

		return false;
	},
	function(info,response){
		response({});
		return true;
	}

			]);

			// -
			// アンカー置換定義「直リンクに変更(リアルタイム検索用)」
			// -
			attachItem( "ReplacementToAnchor_DirectLinkRealtimeSearch" , [
	
	function(info,response){
		var anchor_element = info.anchor_element;

		// Yahoo! JAPAN リアルタイム検索		
		var url = decodeURIComponent(anchor_element.href);
		var m = url.match(new RegExp("^(http|https)://ord\\.yahoo\\.co\\.jp/o/realtime/.*RU=([0-9a-zA-Z._]+)"));
		if(m){
			var base64 = m[2];
			base64 = base64.replace(/[.]/g,"+");
			base64 = base64.replace(/[_]/g,"/");
			base64 = base64.replace(/[-]/g,"=");
			var ary = Base64_To_ArrayBuffer(base64);
			if(ary){
				anchor_element.href = String_From_ArrayBuffer_As_UTF8(ary);
			}
		}

		return false;
	},
	function(info,response){
		response({});
		return true;
	}

			]);

			// -
			// アンカー置換定義「直リンクに変更(検索用)」
			// -
			attachItem( "ReplacementToAnchor_DirectLinkSearch" , [
	
	function(info,response){
		var anchor_element = info.anchor_element;

		if((function(){
			var code = anchor_element.getAttribute("onmousedown") || (function(){
				if(!anchor_element.onmousedown) return "";
				return anchor_element.onmousedown.toString();
			})() || "";

			// Google 検索
			if(code.match(/return rwt\(this,/)) return true;

			// Yahoo! JAPAN
			if(code.match(/return lswap\(this/)) return true;

			return false;
		})()){
			anchor_element.onmousedown = null;
			var parent = anchor_element.parentNode;
			if(parent.addEventListener){
				parent.addEventListener("mousedown",function(e){
					e.stopPropagation();
				},true);
			}
		}

		return false;
	},
	function(info,response){
		var anchor_element = info.anchor_element;

		// Google 検索
		var url = anchor_element.href;
		var r = new RegExp("^(http|https)://www\\.google\\.(com|co\\.jp)/url[?].*","i");
		if(url.match(r)){
			// クエリを取得
			var query = StringGetQuery(url);
			if(query.url){
				anchor_element.href = decodeURIComponent(query.url);
			}
		}

		return false;
	},
	function(info,response){
		var anchor_element = info.anchor_element;

		// Yahoo! JAPAN 検索
		var url = anchor_element.href;
		var r = new RegExp("^(http|https)://search[.]yahoo[.]co[.]jp/r/.*_ylt=.*[/][*][*](.*)$","i");
		if(url.match(r)){
			anchor_element.href = decodeURIComponent(RegExp.$2);
		}

		return false;
	},
	function(info,response){
		response({});
		return true;
	}

			]);

			// -
			// アンカー置換定義「直リンクに変更(スレッド掲示板用)」
			// -
			attachItem( "ReplacementToAnchor_DirectLinkBbs" , [
	
	function(info,response){
		var anchor_element = info.anchor_element;
		var r;

		// リンク先を取得
		var url = anchor_element.href;

		var list = [
			// 2ちゃんねる
			{search:"^(http|https)://ime\\.nu/",replace:""},
			{search:"^(http|https)://jump\\.(2ch|5ch)\\.net/[?]",replace:""},
			{search:"^(http|https)://2ch\\.io/",replace:""},
			// まちBBS
			{search:"^(http|https)://machi\\.to/bbs/link\\.cgi[?]URL=",replace:""},
			// PINKちゃんねる
			{search:"^(http|https)://(www\\.|)pinktower\\.com/([?]|)",replace:""},
			// したらば掲示板
			{search:"^(http|https)://jbbs\\.shitaraba\\.net/bbs/link\\.cgi[?]url=",replace:"",decode_uri:true},
			// ログ速
			{search:"^(http|https)://l\\.moapi\\.net/",replace:""}
		];

		var i;
		var num = list.length;
		var re_protocol = new RegExp("^(http|https|ftp)://");
		for(i=0;i<num;i++){
			var item = list[i];
			r = new RegExp(item.search,"i");
			if(url.match(r)){
				url = url.replace(r,item.replace);
				if(item.decode_uri) url = decodeURIComponent(url);
				if(!(url.match(re_protocol))) url = "http://" + url;
				anchor_element.href = url;
				break;
			}
		}

		return false;
	},
	function(info,response){
		response({});
		return true;
	}

			]);

			// -
			// アンカー置換定義「ツールチップにリンク先を表示」
			// -
			attachItem( "ReplacementToAnchor_DisplayUrlInTooltip" , [
	
	function(info,response){
		var anchor_element = info.anchor_element;
		var event_dispatcher = info.event_dispatcher;

		// 開放時に実行される関数
		function release(){
			if(event_handler_change){
				event_handler_change.release();
				event_handler_change = null;
			}
			if(event_handler_release){
				event_handler_release.release();
				event_handler_release = null;
			}
		}

		// 変更時に実行される関数
		function change(){
			// ツールチップを設定
			anchor_element.title = anchor_element.href;
		}


		// 開放時に実行されるイベント
		var event_handler_release = event_dispatcher.createEventHandler("release");
		event_handler_release.setFunction(release);

		// 変更時に実行されるイベント
		var event_handler_change = event_dispatcher.createEventHandler("anchor_href_change");
		event_handler_change.setFunction(change);

		change();
		return false;
	},
	function(info,response){
		response({});
		return true;
	}

			]);

			// -
			// アンカー置換定義「ソーシャルサービスのカウント数を表示」
			// -
			attachItem( "ReplacementToAnchor_AttachSnsCounter" , [
	
	function(info,response){
		// Twitterボタンを追加
		var anchor_element = info.anchor_element;
		var url = anchor_element.href;

		// キュー
		var result = new Array();
		var queue = [
			// Twitter
			function(){
				var loader = new Loader();
				loader.onerror = error;
				loader.onload = function(v){
					try{
						var param = JsonParse(v);
						var count = param.count;
						if(count){
							result.push(createItem({
								label:"t",
								value:count,
								tooltip:"twitter Retweet",
								color:"#fff",
								background:"#33CCFF",
								borderColor:"#33CCFF"
							}));
						}
					}catch(e){}
					execute();
				};
				loader.setURL("http://urls.api.twitter.com/1/urls/count.json?url=" + url);
				loader.loadText();
			},
			// Facebook
			function(){
				var loader = new Loader();
				loader.onerror = error;
				loader.onload = function(v){
					try{
						var param = JsonParse(v);
						var count = param[0].total_count;
						if(count){
							result.push(createItem({
								label:"f",
								value:count,
								tooltip:"Facebook Like",
								color:"#fff",
								background:"#3B5999",
								borderColor:"#233774"
							}));
						}
					}catch(e){}
					execute();
				};
				var fql = "SELECT total_count FROM link_stat WHERE url=\"" + url + "\"";
				fql = encodeURIComponent(fql).replace(/!/g, '%21').replace(/'/g, '%27').replace(/\(/g, '%28').replace(/\)/g, '%29').replace(/\*/g, '%2A').replace(/%20/g, '+');
				loader.setURL("https://api.facebook.com/method/fql.query?format=json&query=" + fql);
				loader.loadText();
			},
			// Google +1
			function(){
				var loader = new Loader();
				loader.onerror = error;
				loader.onload = function(v){
					if(v.match(/window\.__SSR = [{]c: ([0-9]+)/i)){
						var count = parseInt(RegExp.$1);
						if(count){
							result.push(createItem({
								label:"g+",
								value:count,
								tooltip:"Google +1",
								color:"#fff",
								background:"#CD4131",
								borderColor:"#A5281A"
							}));
						}
					}
					execute();
				};
				loader.setURL("https://plusone.google.com/u/0/_/+1/fastbutton?count=true&url=" + url);
				loader.loadText();
			},
			// はてなブックマーク
			function(){
				var loader = new Loader();
				loader.onerror = error;
				loader.onload = function(v){
					try{
						if(v){
							result.push(createItem({
								label:"B!",
								value:v,
								tooltip:"Hatena Bookmark",
								color:"#fff",
								background:"#2B65A9",
								borderColor:"#2B65A9"
							}));
						}
					}catch(e){}
					execute();
				};
				loader.setURL("http://api.b.st-hatena.com/entry.count?url=" + escape(url));
				loader.loadText();
			},
			// Pinterest
			function(){
				var loader = new Loader();
				loader.onerror = error;
				loader.onload = function(v){
					try{
						var param = JsonParse(v.match(/\((.*)\)/i)[1]);
						var count = param.count;
						if(count){
							result.push(createItem({
								label:"Pi",
								value:count,
								tooltip:"Pinterest Pin Count",
								color:"#fff",
								background:"#DF2532",
								borderColor:"#8C1B22"
							}));
						}
					}catch(e){}
					execute();
				};
				loader.setURL("http://widgets.pinterest.com/v1/urls/count.json?source=6&url=" + encodeURIComponent(url));
				loader.loadText();
			},
			// reddit score
			function(){
				var loader = new Loader();
				loader.onerror = error;
				loader.onload = function(v){
					try{
						var param = JsonParse(v);
						var score = param.data.children[0].data.score;
						if(score){
							result.push(createItem({
								label:"r",
								value:score,
								tooltip:"reddit Score",
								color:"#30659A",
								background:"#C7DEF7",
								borderColor:"#C7DEF7"
							}));
						}
					}catch(e){}
					execute();
				};
				loader.setURL("http://buttons.reddit.com/button_info.json?url=" + encodeURIComponent(url));
				loader.loadText();
			},
			// StumbleUpon views
			function(){
				var loader = new Loader();
				loader.onerror = error;
				loader.onload = function(v){
					try{
						var param = JsonParse(v);
						var views = param.result.views;
						if(views){
							result.push(createItem({
								label:"SU",
								value:views,
								tooltip:"StumbleUpon Views",
								color:"#fff",
								background:"#E6492E",
								borderColor:"#E6492E"
							}));
						}
					}catch(e){}
					execute();
				};
				loader.setURL("http://www.stumbleupon.com/services/1.01/badge.getinfo?url=" + encodeURIComponent(url));
				loader.loadText();
			},
			// 出力
			function(){
				var num = result.length;
				if(num){
					// span を生成
					var span = DocumentCreateElement("span");
					ElementSetStyle(span,"all:initial; line-height:1.0;");

					var i;
					for(i=0;i<num;i++){
						span.appendChild(result[i]);
					}

					var click_func = function(e){
						DomNodeRemove(span);
					};
					if(span.addEventListener){
						span.addEventListener("click",click_func,true);
					}else if(span.attachEvent){
						span.attachEvent("onclick",click_func);
					}

					// 直後に登録
					DomNodeInsertAfter(span,anchor_element);
				}
			}
		];

		// 実行
		function execute(){
			var f = queue.shift();
			if(f){
				f();
			}
		}

		// エラー
		function error(){
			execute();
		}

		// アイテム作成
		function createItem(param){
			var table = DocumentCreateElement("table");
			var tbody = DocumentCreateElement("tbody");
			table.appendChild(tbody);
			var tr = DocumentCreateElement("tr");
			var td0 = DocumentCreateElement("td");
			var td1 = DocumentCreateElement("td");
			tbody.appendChild(tr);
			tr.appendChild(td0);
			tr.appendChild(td1);
			td0.appendChild(DocumentCreateText(param.label));
			td1.appendChild(DocumentCreateText(param.value));

			table.cellspacing = "0";
			var style = table.style;
			style.cssText = "border:1px solid #888; border-spacing:0; margin;0; margin-right:2px; padding:0; line-height:1.0; border-radius:2px; display:inline-block; font-size:14px; width:auto; heigh:auto;";
			if(param.tooltip){
				table.title = param.tooltip;
			}
			if(param.borderColor){
				style.borderColor = param.borderColor;
			}

			var style = tr.style;
			style.cssText = "margin:0; padding:0; width:auto; height:auto;";

			var style = td0.style;
			style.cssText = "margin:0; padding:1px 2px; background:#fff; text-align:center; width:auto; height:auto; color:#000;";
			if(param.color){
				style.color = param.color;
			}
			if(param.background){
				style.background = param.background;
			}

			var style = td1.style;
			style.cssText = "padding:1px 2px; background:#fff; text-align:center; width:auto; height:auto;";

			return table;
		}

		// 初回実行開始
		if(url.match(new RegExp("^(http|https)://","i"))){
			execute();
		}

		return false;
	},
	function(info,response){
		response({});
		return true;
	}

			]);

			// -
			// アンカー置換定義「ノーリファラ属性を追加」
			// -
			attachItem( "ReplacementToAnchor_NoReferrer" , [
	
	function(info,response){
		var anchor_element = info.anchor_element;

		// "noreferrer" が含まれない場合
		if(!(anchor_element.rel.match(/noreferrer/i))){

			// "noreferrer" を追加
			if(anchor_element.rel){
				anchor_element.rel += " noreferrer";
			}else{
				anchor_element.rel = "noreferrer";
			}
		}

		return false;
	},
	function(info,response){
		response({});
		return true;
	}

			]);

			// -
			// アンカー置換定義「デフォルト」
			// -
			attachItem( "ReplacementToAnchor_Default" , [

	function(info,response){

		// -
		// 第01引数 Object 型
		// anchor_element:HTMLAnchorElement オブジェクト
		// event_dispatcher:EventDispatcher オブジェクト
		// -
		var anchor_element = info.anchor_element;
		var event_dispatcher = info.event_dispatcher;

		// -
		// 第02引数 function
		// 引数:なし
		// 処理が完了したタイミングで必ず1度実行する必要がある。非同期実行可能。
		// -
		response();

		// -
		// 戻り値 Boolean 型
		// true :関数の実行を完了
		// false:次の関数を実行
		// -
		return true;
	}

			]);


			// -
			// ハイパーリンク置換定義「直リンク(汎用)」「OGP "og:image"」
			// -
			attachItem( "ReplacementToLink_DirectLinkGeneric_OgpOgImage" , [
	
	function(info,response){

		var anchor_element = info.anchor_element;

		// ローダーオブジェクトを作成
		var loader = new Loader();

		// 成功
		loader.onload = function(str){
			var m = str.match(new RegExp("<meta[^>]+?(property|name)[ \n\r\t]*=[ \n\r\t]*\"og:image\"[^>]*>","i"));
			if(m){
				m = m[0].match(new RegExp("content[ \n\r\t]*=[ \n\r\t]*\"([^\"]+?)\"","i"));
				if(m){
					response({result:true,url:m[1],content_type:["image"]});
					return;
				}
			}
			response({result:false});
		};

		// 失敗
		loader.onerror = function(){
			response({result:false});
		};

		// テキストの読み込み
		loader.setMethod("GET");
		loader.setURL(anchor_element.href);
		loader.loadText();

		return true;
	}

			]);

			// -
			// ハイパーリンク置換定義「直リンク(汎用)」「OGP "twitter:*"」
			// -
			attachItem( "ReplacementToLink_DirectLinkGeneric_OgpTwitter" , [
	
	function(info,response){
		var anchor_element = info.anchor_element;

		// ローダーオブジェクトを作成
		var loader = new Loader();

		// 成功
		loader.onload = function(str){

			// twitter:card
			if(str.match(new RegExp("<meta[ \n\r\t]+?name[ \n\r\t]*?=[ \n\r\t]*?\"twitter:card\"[ \n\r\t]+?content[ \n\r\t]*?=[ \n\r\t]*?\"([^\"]+?)\"","i"))){

				switch(RegExp.$1){
				case "player":
					if(str.match(new RegExp("<meta[ \n\r\t]+?name[ \n\r\t]*?=[ \n\r\t]*?\"twitter:player\"[ \n\r\t]+?content[ \n\r\t]*?=[ \n\r\t]*?\"([^\"]+?)\"","i"))){
						var video_url = RegExp.$1.replace(/&amp;/g, "&");
						video_url = video_url.replace(/&amp;/g, "&");
						response({result:true,url:video_url});
						return;
					}

				case "photo":
				case "summary":
					if(str.match(new RegExp("<meta[ \n\r\t]+?name[ \n\r\t]*?=[ \n\r\t]*?\"twitter:image\"[ \n\r\t]+?content[ \n\r\t]*?=[ \n\r\t]*?\"([^\"]+?)\"","i"))){
						var image_url = RegExp.$1.replace(/&amp;/g, "&");
						image_url = image_url.replace(/&amp;/g, "&");
						response({result:true,url:image_url,content_type:["image"]});
						return;
					}

				}
			}

			response({result:false});
		};

		// 失敗
		loader.onerror = function(){
			response({result:false});
		};

		// テキストの読み込み
		loader.setMethod("GET");
		loader.setURL(anchor_element.href);
		loader.loadText();

		return true;
	}

			]);

			// -
			// ハイパーリンク置換定義「直リンク(汎用)」「Twitpic」
			// -
			attachItem( "ReplacementToLink_DirectLinkGeneric_Twitpic" , [
	
	function(info,response){

		var anchor_element = info.anchor_element;

		// ローダーオブジェクトを作成
		var loader = new Loader();

		// 成功
		loader.onload = function(str){
			if(str.match(new RegExp("<img[^>]+?src=\"((http|https)://[^/]+/photos/(large|full)/[^\"]+)\"","i"))){
				response({result:true,url:RegExp.$1});
				return;
			}
			response({result:false});
		};

		// 失敗
		loader.onerror = function(){
			response({result:false});
		};

		// テキストの読み込み
		loader.setMethod("GET");
		loader.setURL(anchor_element.href);
		loader.loadText();

		return true;
	}

			]);

			// -
			// ハイパーリンク置換定義「直リンク(汎用)」「Twitter Photo」
			// -
			attachItem( "ReplacementToLink_DirectLinkGeneric_TwitterPhoto" , [
	
	function (info,response){
		var anchor_element = info.anchor_element;

		// # があれば終了
		if(anchor_element.href.indexOf("#") >= 0){
			response({result:false});
		}

		return false;
	},
	function (info,response){
		var anchor_element = info.anchor_element;

		// ローダーオブジェクトを作成
		var loader = new Loader();

		// 成功
		loader.onload = function(str){
			var image_url;

			// 高解像度
			if(!image_url){
				var m = str.match(new RegExp("<meta[^>]+?(property|name)[ \n\r\t]*=[ \n\r\t]*\"og:image\"[^>]*>","i"));
				if(m){
					m = m[0].match(new RegExp("content[ \n\r\t]*=[ \n\r\t]*\"([^\"]+?)\"","i"));
					if(m){
						m = m[1].match(new RegExp("https://pbs\\.twimg\\.com/media/.*","i"));
						if(m){
							image_url = m[0];
						}
					}
				}
			}

			// 低解像度
			if(!image_url){
				var m = str.match(new RegExp('<img[^>]+src[ \n\r\t]*=[ \n\r\t]*"(https://pbs\\.twimg\\.com/media/[^"]+)"',"i"));
				if(m) image_url = m[1];
			}

			if(image_url){
				response({result:true,url:image_url,content_type:["image"]});
				return;
			}
			response({result:false});
		};

		// 失敗
		loader.onerror = function(){
			response({result:false});
		};

		// テキストの読み込み
		loader.setMethod("GET");
		loader.setURL(anchor_element.href);
		loader.loadText();

		return true;
	}

			]);

			// -
			// ハイパーリンク置換定義「直リンク(汎用)」「Facebook Photo」
			// -
			attachItem( "ReplacementToLink_DirectLinkGeneric_FacebookPhoto" , [
	
	function(info,response){

		var anchor_element = info.anchor_element;

		// ローダーオブジェクトを作成
		var loader = new Loader();

		// 成功
		loader.onload = function(str){
			var image_url;

			// 高解像度
			if(!image_url){
				var m = str.match(new RegExp("<a[^>]+?class=\"fbPhotosPhotoActionsItem\"[^>]+?href=\"([^\"]+?[?][^\"]*dl=1)\"[^>]+?rel=\"ignore\"","i"));
				if(m) image_url = m[1].replace(/&amp;/g, "&");
			}

			// 中解像度
			if(!image_url){
				var m = str.match(new RegExp("<img.+?id=\"fbPhotoImage\".+?src=\"([^\"]+?)\"","i"));
				if(m) image_url = m[1].replace(/&amp;/g, "&");
			}

			if(image_url){
				response({result:true,url:image_url});
				return;
			}
			response({result:false});
		};

		// 失敗
		loader.onerror = function(){
			response({result:false});
		};

		// テキストの読み込み
		loader.setMethod("GET");
		loader.setURL(anchor_element.href);
		loader.loadText();

		return true;
	}

			]);

			// -
			// ハイパーリンク置換定義「直リンク(汎用)」「Google+ Photo」
			// -
			attachItem( "ReplacementToLink_DirectLinkGeneric_GooglePlusPhoto" , [
	
	function(info,response){

		var anchor_element = info.anchor_element;

		// ローダーオブジェクトを作成
		var loader = new Loader();

		// 成功
		loader.onload = function(str){
			var image_url;

			if(!image_url){
				var m = str.match(new RegExp("<meta[^>]+?(property|name)[ \n\r\t]*=[ \n\r\t]*\"og:image\"[^>]*>","i"));
				if(m){
					m = m[0].match(new RegExp("content[ \n\r\t]*=[ \n\r\t]*\"([^\"]+?)\"","i"));
					if(m) image_url = m[1];
				}
			}

			if(!image_url){
				var m = str.match(new RegExp("<meta[^>]+?(property|name)[ \n\r\t]*=[ \n\r\t]*\"twitter:image:src\"[^>]*>","i"));
				if(m){
					m = m[0].match(new RegExp("content[ \n\r\t]*=[ \n\r\t]*\"([^\"]+?)\"","i"));
					if(m) image_url = m[1];
				}
			}

			if(image_url){
				var m = image_url.match(new RegExp("(.*)/(s[0-9]+)(|-[^/]+)/(.*?)$","i"))
				if(m){
					image_url = m[1] + "/s9999/" + m[4];
				}

				var m = image_url.match(new RegExp("(.*)/(w[0-9]+[-]h[0-9]+)(|-[^/]+)/(.*?)$","i"))
				if(m){
					image_url = m[1] + "/s9999/" + m[4];
				}

				response({result:true,url:image_url,content_type:["image"]});
				return;
			}
			response({result:false});
		};

		// 失敗
		loader.onerror = function(){
			response({result:false});
		};

		// テキストの読み込み
		loader.setMethod("GET");
		loader.setURL(anchor_element.href);
		loader.loadText();

		return true;
	}

			]);

			// -
			// ハイパーリンク置換定義「直リンク(汎用)」「Picasa Photo」
			// -
			attachItem( "ReplacementToLink_DirectLinkGeneric_PicasaPhoto" , [
	
	function(info,response){
		var anchor_element = info.anchor_element;
		if(anchor_element.href.match("^(http|https)://picasaweb\\.google\\.com/lh/photo/[0-9a-zA-Z]+(|[?].*)$","i")){
			// ローダーオブジェクトを作成
			var loader = new Loader();

			// 成功
			loader.onload = function(str){
				if(str.match(new RegExp("<link.*?rel.*?=.*?\'image_src\'.*?href.*?=.*?\"(.*?)\"","i"))){
					var image_url = RegExp.$1;
					if(image_url.match(new RegExp("(.*)/(s[0-9]{1,3})(|-c)/(.*?)$","i"))){
						image_url = RegExp.$1 + "/s9999/" + RegExp.$4;
					}

					response({result:true,url:image_url,content_type:["image"]});
					return;
				}
				response({result:false});
			};

			// 失敗
			loader.onerror = function(){
				response({result:false});
			};

			// テキストの読み込み
			loader.setMethod("GET");
			loader.setURL(anchor_element.href);
			loader.loadText();

			return true;
		}
		
		return false;
	},
	function (info,response){
		var anchor_element = info.anchor_element;
		if(anchor_element.href.match("^(http|https)://picasaweb\\.google\\.com/[0-9]+/[0-9a-zA-Z]+(|[?].*)#([0-9]+)$","i")){
			var photo_id = RegExp.$3;

			// ローダーオブジェクトを作成
			var loader = new Loader();

			// 成功
			loader.onload = function(str){
				var pos = str.indexOf(photo_id);
				if(pos >= 0){
					if(str.substring(pos).match(new RegExp("\"thumbnail\":[[][{]\"url\":\"(.*?)\"","i"))){
						var image_url = RegExp.$1;
						if(image_url.match(new RegExp("(.*)/(s[0-9]{1,3})(|-c)/(.*?)$","i"))){
							image_url = RegExp.$1 + "/s9999/" + RegExp.$4;
						}

						response({result:true,url:image_url,content_type:["image"]});
						return;
					}
				}
				response({result:false});
			};

			// 失敗
			loader.onerror = function(){
				response({result:false});
			};

			// テキストの読み込み
			loader.setMethod("GET");
			loader.setURL(anchor_element.href);
			loader.loadText();

			return true;
		}
		
		return false;
	}

			]);

			// -
			// ハイパーリンク置換定義「直リンク(汎用)」「Tumblr」
			// -
			attachItem( "ReplacementToLink_DirectLinkGeneric_Tumblr" , [
	
	function(info,response){
		var anchor_element = info.anchor_element;

		// ローダーオブジェクトを作成
		var loader = new Loader();

		// 成功
		loader.onload = function(str){
			// photo
			if(str.match(new RegExp("<meta[ \n\r\t]+?property[ \n\r\t]*?=[ \n\r\t]*?\"og:image\"[ \n\r\t]+?content[ \n\r\t]*?=[ \n\r\t]*?\"([^\"]+?)\"","i"))){
				var m = RegExp.$1.match(new RegExp("^.*\/(tumblr_.*)_[0-9]+\\..*?$","i"));
				if(m){
					var file_name = RegExp.$1;
					var image_url;
					var size = 0;
					str.replace(new RegExp("\"(http:\/\/[^\"]*?\/" + file_name + "_)([0-9]+)(\\..*?)\"","gi"),function(str, p1, p2) {
						var s = parseInt(RegExp.$2);
						if(s > size){
							size = s;
							image_url = RegExp.$1 + RegExp.$2 + RegExp.$3;
						}
					});

					response({result:true,url:image_url,content_type:["image"]});
					return;
				}

			}

			// player
			if(str.match(new RegExp("<meta[ \n\r\t]+?name[ \n\r\t]*?=[ \n\r\t]*?\"twitter:player\"[ \n\r\t]+?content[ \n\r\t]*?=[ \n\r\t]*?\"([^\"]+?)\"","i"))){
				var video_url = RegExp.$1.replace(/&amp;/g, "&");
				video_url = video_url.replace(/&amp;/g, "&");
				response({result:true,url:video_url});
				return;
			}

			response({result:false});
		};

		// 失敗
		loader.onerror = function(){
			response({result:false});
		};

		// テキストの読み込み
		loader.setMethod("GET");
		loader.setURL(anchor_element.href);
		loader.loadText();

		return true;
	}

			]);

			// -
			// ハイパーリンク置換定義「直リンク(汎用)」「Flickr」
			// -
			attachItem( "ReplacementToLink_DirectLinkGeneric_Flickr" , [
	
	function(info,response){

		var anchor_element = info.anchor_element;

		// ローダーオブジェクトを作成
		var loader = new Loader();

		// 成功
		loader.onload = function(str){
			var image_url;

			// 高解像度
			if(!image_url){
				var m = str.match(new RegExp('<img[^>]+class="[^"]*main-photo[^"]*"',"i"));
				if(m){
					m = m[0].match(new RegExp("src[ \n\r\t]*=[ \n\r\t]*\"([^\"]+?)\"","i"));
					if(m) image_url = m[1];
				}
			}

			// 低解像度
			if(!image_url){
				var m = str.match(new RegExp("<meta[^>]+?(property|name)[ \n\r\t]*=[ \n\r\t]*\"og:image\"[^>]*>","i"));
				if(m){
					m = m[0].match(new RegExp("content[ \n\r\t]*=[ \n\r\t]*\"([^\"]+?)\"","i"));
					if(m) image_url = m[1];
				}
			}

			if(image_url){
				response({result:true,url:image_url,content_type:["image"]});
				return;
			}
			response({result:false});
		};

		// 失敗
		loader.onerror = function(){
			response({result:false});
		};

		// テキストの読み込み
		loader.setMethod("GET");
		loader.setURL(anchor_element.href);
		loader.loadText();

		return true;
	}

			]);

			// -
			// ハイパーリンク置換定義「直リンク(汎用)」「Imgur」
			// -
			attachItem( "ReplacementToLink_DirectLinkGeneric_Imgur" , [
	
	function(info,response){
		var anchor_element = info.anchor_element;

		// ローダーオブジェクトを作成
		var loader = new Loader();

		// 成功
		loader.onload = function(str){

			var content_url = "";
			var content_type = new Array();

			if(!content_url){
				var m = str.match(new RegExp("<meta[ \n\r\t]+?name[ \n\r\t]*?=[ \n\r\t]*?\"twitter:player\"[ \n\r\t]+?content[ \n\r\t]*?=[ \n\r\t]*?\"([^\"]+?)\"","i"));
				if(m){
					var m = m[1].match(new RegExp("(.*?\\.gif)v","i"));
					if(m){
						content_url = m[1];
						content_type.push("image");
					}
				}
			}

			if(!content_url){
				var m = str.match(new RegExp("<meta[ \n\r\t]+?name[ \n\r\t]*?=[ \n\r\t]*?\"twitter:stream\"[ \n\r\t]+?content[ \n\r\t]*?=[ \n\r\t]*?\"([^\"]+?)\"","i"));
				if(m){
					content_url = m[1];
				}
			}

			if(!content_url){
				var m = str.match(new RegExp("<link[ \n\r\t]+?rel[ \n\r\t]*?=[ \n\r\t]*?\"image_src\"[ \n\r\t]+?href[ \n\r\t]*?=[ \n\r\t]*?\"([^\"]+?)\"","i"));
				if(m){
					content_url = m[1];
					content_type.push("image");
				}
			}

			if(!content_url){
				var m = str.match(new RegExp("<meta[ \n\r\t]+?name[ \n\r\t]*?=[ \n\r\t]*?\"twitter:image\"[ \n\r\t]+?content[ \n\r\t]*?=[ \n\r\t]*?\"([^\"]+?)\"","i"));
				if(m){
					content_url = m[1];
					content_type.push("image");
				}
			}

			if(content_url){
				response({result:true,url:content_url,content_type:content_type});
			}

			response({result:false});
		};

		// 失敗
		loader.onerror = function(){
			response({result:false});
		};

		// テキストの読み込み
		loader.setMethod("GET");
		loader.setURL(anchor_element.href);
		loader.loadText();

		return true;
	}

			]);

			// -
			// ハイパーリンク置換定義「直リンク(汎用)」「yfrog.com」
			// -
			attachItem( "ReplacementToLink_DirectLinkGeneric_Yfrog" , [
	
	function(info,response){

		var anchor_element = info.anchor_element;

		// ローダーオブジェクトを作成
		var loader = new Loader();

		// 成功
		loader.onload = function(str){
			var image_url;

			// 高解像度
			if(!image_url){
				var m = str.match(new RegExp('<img[^>]+id="main_image"[^>]*>',"i"));
				if(m){
					m = m[0].match(new RegExp("src[ \n\r\t]*=[ \n\r\t]*\"([^\"]+?)\"","i"));
					if(m) image_url = m[1];
				}
			}

			if(image_url){
				response({result:true,url:image_url,content_type:["image"]});
				return;
			}
			response({result:false});
		};

		// 失敗
		loader.onerror = function(){
			response({result:false});
		};

		var url = anchor_element.href;
		var m = url.match(new RegExp("yfrog\\.com/(.*)([?]|#|$)","i"));
		if(m){
			url = "https://twitter.yfrog.com/" + m[1] + "?sa=0";
		}

		// テキストの読み込み
		loader.setMethod("GET");
		loader.setURL(url);
		loader.loadText();

		return true;
	}

			]);

			// -
			// ハイパーリンク置換定義「直リンク(汎用)」「Giphy」
			// -
			attachItem( "ReplacementToLink_DirectLinkGeneric_Giphy" , [
	
	function(info,response){

		var anchor_element = info.anchor_element;

		// ローダーオブジェクトを作成
		var loader = new Loader();

		// 成功
		loader.onload = function(str){
			var image_url;

			var m = str.match(new RegExp("<meta[^>]+?(itemprop)[ \n\r\t]*=[ \n\r\t]*\"image\"[^>]*>","i"));
			if(m){
				m = m[0].match(new RegExp("content[ \n\r\t]*=[ \n\r\t]*\"([^\"]+?)\"","i"));
				if(m) image_url = m[1];
			}

			if(image_url){
				response({result:true,url:image_url,content_type:["image"]});
				return;
			}
			response({result:false});
		};

		// 失敗
		loader.onerror = function(){
			response({result:false});
		};

		// テキストの読み込み
		loader.setMethod("GET");
		loader.setURL(anchor_element.href);
		loader.loadText();

		return true;
	}

			]);

			// -
			// ハイパーリンク置換定義「直リンク(汎用)」「Gyazo」
			// -
			attachItem( "ReplacementToLink_DirectLinkGeneric_Gyazo" , [
	
	function(info,response){

		var anchor_element = info.anchor_element;

		// ローダーオブジェクトを作成
		var loader = new Loader();

		// 成功
		loader.onload = function(str){
			var image_url;

			if(!image_url){
				var m = str.match(new RegExp("<meta[^>]+?name[ \n\r\t]*=[ \n\r\t]*\"twitter:image\"[^>]*>","i"));
				if(m){
					m = m[0].match(new RegExp("content[ \n\r\t]*=[ \n\r\t]*\"([^\"]+?)\"","i"));
					if(m) image_url = m[1];
				}
			}

			if(!image_url){
				var m = str.match(new RegExp('<img[^>]+class[ \n\r\t]*=[ \n\r\t]*"image"[^>]+>',"i"));
				if(m){
					m = m[0].match(new RegExp('src[ \n\r\t]*=[ \n\r\t]*"([^"]+?)"',"i"));
					if(m){
						m = m[1].match(new RegExp('(http|https)://i\\.gyazo\\.com/[0-9a-zA-Z]+\\.(bmp|jpg|jpeg|png)',"i"));
						if(m) image_url = m[0];
					}
				}
			}

			if(image_url){
				response({result:true,url:image_url,content_type:["image"]});
				return;
			}
			response({result:false});
		};

		// 失敗
		loader.onerror = function(){
			response({result:false});
		};

		// テキストの読み込み
		loader.setMethod("GET");
		loader.setURL(anchor_element.href);
		loader.loadText();

		return true;
	}

			]);

			// -
			// ハイパーリンク置換定義「直リンク(汎用)」「Photozou Photo」
			// -
			attachItem( "ReplacementToLink_DirectLinkGeneric_PhotozouPhoto" , [
	
	function(info,response){

		var anchor_element = info.anchor_element;

		// ローダーオブジェクトを作成
		var loader = new Loader();

		// 成功
		loader.onload = function(str){
			if(str.match(new RegExp("<meta.*?property.*?=.*?\"og:image\".*?content.*?=.*?\"(.*?)\"","i"))){
				var image_url = RegExp.$1;
				var m = image_url.match(new RegExp("_[0-9]+\\.v","i"));
				if(m){
					image_url = RegExp.leftContext + "_org.v" + RegExp.rightContext;
				}

				response({result:true,url:image_url});
				return;
			}
			response({result:false});
		};

		// 失敗
		loader.onerror = function(){
			response({result:false});
		};

		// テキストの読み込み
		loader.setMethod("GET");
		loader.setURL(anchor_element.href);
		loader.loadText();

		return true;
	}

			]);

			// -
			// ハイパーリンク置換定義「直リンク(汎用)」「ついっぷる」
			// -
			attachItem( "ReplacementToLink_DirectLinkGeneric_Twipple" , [
	
	function(info,response){

		var anchor_element = info.anchor_element;

		// ローダーオブジェクトを作成
		var loader = new Loader();

		// 成功
		loader.onload = function(str){
			var image_url;

			var m = str.match(new RegExp("<meta[^>]+?(property|name)[ \n\r\t]*=[ \n\r\t]*\"og:image\"[^>]*>","i"));
			if(m){
				m = m[0].match(new RegExp("content[ \n\r\t]*=[ \n\r\t]*\"([^\"]+?)\"","i"));
				if(m) image_url = m[1];
			}

			if(image_url){
				var m = image_url.match(new RegExp("(thumb|large)","i"));
				if(m){
					image_url = RegExp.leftContext + "orig" + RegExp.rightContext;
				}

				response({result:true,url:image_url,content_type:["image"]});
				return;
			}
			response({result:false});
		};

		// 失敗
		loader.onerror = function(){
			response({result:false});
		};

		// テキストの読み込み
		loader.setMethod("GET");
		loader.setURL(anchor_element.href);
		loader.loadText();

		return true;
	}

			]);

			// -
			// ハイパーリンク置換定義「直リンク(汎用)」「ついっぷる (直リンク)」
			// -
			attachItem( "ReplacementToLink_DirectLinkGeneric_TwippleDirectLink" , [
	
	function(info,response){

		var anchor_element = info.anchor_element;
		var m = anchor_element.href.match(new RegExp("^(http|https)(://p.twpl.jp/show/)(orig|large|thumb)(/[0-9a-zA-Z]{4,}$)","i"));
		if(m){
			response({result:true,url:m[1]+m[2]+"orig"+m[4],content_type:["image"]});
		}else{
			response({result:false});
		}

		return true;
	}

			]);

			// -
			// ハイパーリンク置換定義「直リンク(汎用)」「blog.fc2.com」
			// -
			attachItem( "ReplacementToLink_DirectLinkGeneric_BlogFc2Com" , [
	
	function(info,response){
		var anchor_element = info.anchor_element;
		if(anchor_element.href.match("^(http|https)://[a-z0-9]+?\\.blog\\.fc2\\.com/img/.+?./$","i")){
			// ローダーオブジェクトを作成
			var loader = new Loader();

			// 成功
			loader.onload = function(str){
				var image_url;

				var m = str.match(new RegExp('<a[^>]+?class[ \n\r\t]*=[ \n\r\t]*"[^"]*thickbox[^"]*"[^>]*>',"i"));
				if(m){
					m = m[0].match(new RegExp("href[ \n\r\t]*=[ \n\r\t]*\"(http://blog[-]imgs[-][0-9]+?\\.fc2\\.com/./././[a-z0-9_]+?/.+?)\"","i"));
					if(m) image_url = m[1];
				}

				if(image_url){
					response({result:true,url:image_url,content_type:["image"]});
					return;
				}
				response({result:false});
			};

			// 失敗
			loader.onerror = function(){
				response({result:false});
			};

			// テキストの読み込み
			loader.setMethod("GET");
			loader.setURL(anchor_element.href);
			loader.loadText();

			return true;
		}
		
		return false;
	}

			]);

			// -
			// ハイパーリンク置換定義「直リンク(汎用)」「deviantART」
			// -
			attachItem( "ReplacementToLink_DirectLinkGeneric_DeviantArt" , [
	
	function(info,response){

		var anchor_element = info.anchor_element;

		// ローダーオブジェクトを作成
		var loader = new Loader();

		// 成功
		loader.onload = function(str){
			var image_url;

			var m = str.match(new RegExp("<meta[^>]+?(property|name)[ \n\r\t]*=[ \n\r\t]*\"og:image\"[^>]*>","i"));
			if(m){
				m = m[0].match(new RegExp("content[ \n\r\t]*=[ \n\r\t]*\"([^\"]+?)\"","i"));
				if(m) image_url = m[1];
			}

			if(image_url){
				m = image_url.match(new RegExp("^(.*)/PRE/(.*)$","i"));
				if(m){
					image_url = m[1] + "/" + m[2];
				}

				response({result:true,url:image_url,content_type:["image"]});
				return;
			}
			response({result:false});
		};

		// 失敗
		loader.onerror = function(){
			response({result:false});
		};

		// テキストの読み込み
		loader.setMethod("GET");
		loader.setURL(anchor_element.href);
		loader.loadText();

		return true;
	}

			]);

			// -
			// ハイパーリンク置換定義「直リンク(汎用)」「ニコニコ静画 イラスト」
			// -
			attachItem( "ReplacementToLink_DirectLinkGeneric_NicoSeigaIllust" , [
	
	function(info,response){
		var anchor_element = info.anchor_element;

		// ローダーオブジェクトを作成
		var loader = new Loader();

		// 成功
		loader.onload = function(str){

			// 低解像度画像を取得
			function getOgImage(){
				var image_url;
				var m = str.match(new RegExp("<meta[^>]+?(property|name)[ \n\r\t]*=[ \n\r\t]*\"og:image\"[^>]*>","i"));
				if(m){
					m = m[0].match(new RegExp("content[ \n\r\t]*=[ \n\r\t]*\"([^\"]+?)\"","i"));
					if(m) image_url = m[1];
				}

				if(image_url){
					response({result:true,url:image_url,content_type:["image"]});
					return;
				}
				response({result:false});
			}

			// 非ログイン
			if(str.search(new RegExp('class[ \n\r\t]*=[ \n\r\t]*"siteHeaderLogin"',"i")) >= 0){
				getOgImage();
				return;
			}

			// 高解像度リンク
			var image_id = "";
			if(anchor_element.href.match(new RegExp("im([0-9]+)","i"))){
				image_id = RegExp.$1;
			}
			if(anchor_element.href.match(new RegExp("id=([0-9]+)","i"))){
				image_id = RegExp.$1;
			}
			var source_url = "http://seiga.nicovideo.jp/image/source/" + image_id;

			// ローダーオブジェクトを作成
			var loader = new Loader();

			// 成功
			loader.onload = function(str){
				var image_url = str;
				var m = image_url.match(new RegExp("((http|https)://lohas\\.nicoseiga\\.jp/)o(/[a-z0-9]+/[0-9]+/[0-9]+)","i"));
				if(m){
					// 高解像度画像
					var image_url = m[1] + "priv" + m[3];
				}

				if(image_url){
					response({result:true,url:image_url,content_type:["image"]});
					return;
				}
				getOgImage();
			};

			// 失敗
			loader.onerror = function(){
				getOgImage();
			};

			// 最終リダイレクト先を取得
			loader.setMethod("GET");
			loader.setURL(source_url);
			loader.loadFinalURL();
		};

		// 失敗
		loader.onerror = function(){
			response({result:false});
		};

		// テキストの読み込み
		loader.setMethod("GET");
		loader.setURL(anchor_element.href);
		loader.loadText();

		return true;
	}

			]);

			// -
			// ハイパーリンク置換定義「直リンク(汎用)」「ニコニコ静画 イラスト (直リンク)」
			// -
			attachItem( "ReplacementToLink_DirectLinkGeneric_NicoSeigaIllustDirectLink" , [
	
	function(info,response){
		var anchor_element = info.anchor_element;

		// ローダーオブジェクトを作成
		var loader = new Loader();

		// 成功
		loader.onload = function(str){
			var image_url = str;

			var m = image_url.match(new RegExp("((http|https)://lohas\\.nicoseiga\\.jp/)o(/[a-z0-9]+/[0-9]+/[0-9]+)","i"));
			if(m){
				// 高解像度画像
				image_url = m[1] + "priv" + m[3];
			}

			if(image_url){
				response({result:true,url:image_url,content_type:["image"]});
				return;
			}
			response({result:false});
		};

		// 失敗
		loader.onerror = function(){
			response({result:false});
		};

		// 最終リダイレクト先を取得
		loader.setMethod("GET");
		loader.setURL(anchor_element.href);
		loader.loadFinalURL();

		return true;
	}

			]);

			// -
			// ハイパーリンク置換定義「直リンク(汎用)」「ニコニコ静画 漫画」
			// -
			attachItem( "ReplacementToLink_DirectLinkGeneric_NicoSeigaManga" , [
	
	function(info,response){
		var anchor_element = info.anchor_element;

		// ローダーオブジェクトを作成
		var loader = new Loader();

		// 成功
		loader.onload = function(str){
			var image_url;

			// ログイン済み
			if(!image_url){
				var m = str.match(new RegExp('data-original[ \n\r\t]*=[ \n\r\t]*"((http|https)://lohas.nicoseiga.jp/thumb/[^"]*)"',"i"));
				if(m) image_url = m[1];
			}
 
			// 未ログイン
			if(!image_url){
				var m = str.match(new RegExp("<img[^>]+?class[ \n\r\t]*=[ \n\r\t]*\"thumb\"[^>]*>","i"));
				if(m){
					m = m[0].match(new RegExp("src[ \n\r\t]*=[ \n\r\t]*\"([^\"]+?)\"","i"));
					if(m) image_url = m[1];
				}
			}

			if(image_url){
				response({result:true,url:image_url,content_type:["image"]});
				return;
			}
			response({result:false});
		};

		// 失敗
		loader.onerror = function(){
			response({result:false});
		};

		// テキストの読み込み
		loader.setMethod("GET");
		loader.setURL(anchor_element.href);
		loader.loadText();

		return true;
	}

			]);

			// -
			// ハイパーリンク置換定義「直リンク(汎用)」「pixiv.net」
			// -
			attachItem( "ReplacementToLink_DirectLinkGeneric_PixivNet" , [
	
	function (info,response){

		var anchor_element = info.anchor_element;

		var url = anchor_element.href;
		var query = StringGetQuery(url);

		// PC用ドメインに変更
		var m = url.match(new RegExp("(http|https)(://)([^\\.]+)(\\.pixiv\\.net/.*)","i"));
		if(m){
			url = m[1] + m[2] + "www" + m[4];
		}

		// ローダーオブジェクトを作成
		var loader = new Loader();

		// マンガの取得
		if((query["mode"] == "manga_big") && (query["page"])){

			// 成功
			loader.onload = function(str){

				// ログイン時
				var m = str.match(new RegExp("<body><img[^>]+src=\"([^\"]+)\"","i"));
				if(m){
					response({result:true,url:m[1],content_type:["image"]});
					return;
				}

				// 非ログイン時
				var m = str.match(new RegExp("pixiv\\.context\\.images\\[" + query["page"] + "\\] = '([^']+)';","i"));
				if(m){
					m = m[1].match("(.*)(_p[0-9]+\\.[a-z]+)$","i");
					if(m){
						response({result:true,url:m[1] + "_big" + m[2],content_type:["image"]});
						return;
					}
				}

				response({result:false});
			};

		}else{
			// モードを medium に変更
			var m = url.match(new RegExp("mode=([a-z]+)","i"));
			if(m){
				url = RegExp.leftContext + "mode=medium" + RegExp.rightContext;
			}

			// 成功
			loader.onload = function(str){
				var image_url;

				// 2014/11/27 以降
				if(!image_url){
					var m = str.match(new RegExp("<img[^>]+class=\"original-image\"[^>]*>","i"));
					if(m){
						m = m[0].match(new RegExp('src="([^"]+)"',"i"));
						if(m){
							image_url = m[1];
						}
					}
				}

				// 高解像度画像
				if(!image_url){
					var m = str.match(new RegExp("<div class=\"(img-container|front-centered|works_display)\">.*","i"));
					if(m){
						m = m[0].match(new RegExp('<a[^>]+href="([^"]+)".*</a>',"i"));
						if(m){
							var link_url = m[1];

							m = m[0].match(new RegExp('<img src="((http|https)://i[0-9]+\\.pixiv\\.net[^"]*)"',"i"));
							if(m){
								image_url = m[1];

								// マンガ以外
								if(link_url.indexOf("mode=manga") == -1){

									// 2014/10/01 以前
									var m = image_url.match(new RegExp("^(.*)_m(\\.[a-z]+)$","i"));
									if(m){
										image_url = m[1] + m[2];
									}

									// 2014/10/01 以降
									var m = image_url.match(new RegExp("^(http://[^/]+/).*(/img/.*)_master1200(\\.[a-z]+)$","i"));
									if(m){
										var path = m[1] + "img-original" + m[2] + ".";

										(function(){
											var ext_list = [
												"gif",
												"png",
												"jpg"
											];

											var success = function(url){
												response({result:true,url:url,content_type:["image"]});
											};
											var failure = function(){
												response({result:false});
											};

											var load = function(){
												var ext = ext_list.pop();
												if(!ext){
													success(image_url);
													return;
												}
												var url = path + ext;

												// ローダーオブジェクトを作成
												var loader = new Loader();

												// 成功
												loader.onload = function(header){
													var content_type = header["Content-Type"];
													if(!content_type) content_type = "";
													if(content_type.match("image")){
														success(url);
													}else{
														load();
													}
												};

												// 失敗
												loader.onerror = function(){
													load();
												};

												// レスポンスヘッダを読み込み
												loader.setMethod("GET");
												loader.setURL(url);
												loader.loadResponseHeader();
											};

											load();
										})();

										return;
									}
								}
							}
						}
					}
				}

				// うごイラ用 高解像度サムネイル
				/*if(!image_url){
					var m = str.match(new RegExp("<meta[^>]+?(property|name)[ \n\r\t]*=[ \n\r\t]*\"og:image\"[^>]*>","i"));
					if(m){
						m = m[0].match(new RegExp("content[ \n\r\t]*=[ \n\r\t]*\"([^\"]+?)\"","i"));
						if(m) image_url = m[1].replace(new RegExp("^(.*)_s\\.(.*)$"),"$1_master1200.jpg");
					}
				}*/

				if(image_url){
					response({result:true,url:image_url,content_type:["image"]});
					return;
				}
				response({result:false});
			};
		}

		// 失敗
		loader.onerror = function(){
			response({result:false});
		};

		// テキストの読み込み
		loader.setMethod("GET");
		loader.setURL(url);
		loader.loadText();

		return true;
	}

			]);

			// -
			// ハイパーリンク置換定義「直リンク(汎用)」「Miiverse」
			// -
			attachItem( "ReplacementToLink_DirectLinkGeneric_Miiverse" , [
	
	function(info,response){
		var anchor_element = info.anchor_element;

		// ローダーオブジェクトを作成
		var loader = new Loader();

		// 成功
		loader.onload = function(str){
			var image_url;

			if(!image_url){
				var m = str.match(new RegExp('<img[^>]+class[ \n\r\t]*=[ \n\r\t]*"[^"]*post-memo[^"]*"[^>]*>',"i"));
				if(m){
					m = m[0].match(new RegExp('<img[^>]+src[ \n\r\t]*=[ \n\r\t]*"([^"]+?)"',"i"));
					if(m) image_url = m[1];
				}
			}
			if(!image_url){
				var m = str.match(new RegExp('<div[^>]+class[ \n\r\t]*=[ \n\r\t]*"[^"]*screenshot-container[^"]*"><img[^>]+>',"i"));
				if(m){
					m = m[0].match(new RegExp('<img[^>]+src[ \n\r\t]*=[ \n\r\t]*"([^"]+?)"',"i"));
					if(m) image_url = m[1];
				}
			}
			if(!image_url){
				var m = str.match(new RegExp("<meta[^>]+?(property|name)[ \n\r\t]*=[ \n\r\t]*\"og:image\"[^>]*>","i"));
				if(m){
					m = m[0].match(new RegExp("content[ \n\r\t]*=[ \n\r\t]*\"([^\"]+?)\"","i"));
					if(m) image_url = m[1];
				}
			}

			if(image_url){
				response({result:true,url:image_url,content_type:["image"]});
				return;
			}
			response({result:false});
		};

		// 失敗
		loader.onerror = function(){
			response({result:false});
		};

		// テキストの読み込み
		loader.setMethod("GET");
		loader.setURL(anchor_element.href);
		loader.loadText();

		return false;
	}

			]);

			// -
			// ハイパーリンク置換定義「イメージ検索用」「Google 画像検索」
			// -
			attachItem( "ReplacementToLink_DirectLinkImageSearch_Google" , [
	
	function(info,response){
		var anchor_element = info.anchor_element;

		var url = anchor_element.href;
		var r = new RegExp("^(http|https)://.*?\\.google\\.(at|be|ca|ch|de|es|fr|it|nl|no|pl|ru|se|co\\.(id|in|jp|th|uk|za)|com|com\\.(ar|au|br|mx|sa|tr|tw))/imgres[?].*","i");
		if(url.match(r)){
			// クエリを取得
			var query = StringGetQuery(url);
			if(query.imgurl){
				response({result:true,url:decodeURIComponent(decodeURIComponent(query.imgurl)),content_type:["image"]});
				return true;
			}
		}

		return false;
	},
	function(info,response){
		response({result:false});
		return true;
	}

			]);

			// -
			// ハイパーリンク置換定義「イメージ検索用」「Yahoo Image Search」
			// -
			attachItem( "ReplacementToLink_DirectLinkImageSearch_YahooImageSearch" , [
	
	function(info,response){
		var anchor_element = info.anchor_element;

		var url = anchor_element.href;
		var r = new RegExp("(image|images)\\.search\\.yahoo\\.com/images/view;.*","i");
		if(url.match(r)){
			// クエリを取得
			var query = StringGetQuery(url);
			if(query.imgurl){
				response({result:true,url:"http://" + unescape(query.imgurl),content_type:["image"]});
				return true;
			}
		}

		return false;
	},
	function(info,response){
		response({result:false});
		return true;
	}

			]);

			// -
			// ハイパーリンク置換定義「イメージ検索用」「Yahoo! JAPAN 画像検索」
			// -
			attachItem( "ReplacementToLink_DirectLinkImageSearch_YahooJapan" , [

	function (info,response){
		var anchor_element = info.anchor_element;

		var url = decodeURIComponent(anchor_element.href);
		var m = url.match(new RegExp("^.*RU=([0-9a-zA-Z._]+)"));
		if(m){
			var base64 = m[1];
			base64 = base64.replace(/[.]/g,"+");
			base64 = base64.replace(/[_]/g,"/");
			base64 = base64.replace(/[-]/g,"=");
			var ary = Base64_To_ArrayBuffer(base64);
			if(ary){
				response({result:true,url:String_From_ArrayBuffer_As_UTF8(ary),content_type:["image"]});
				return true;
			}
		}
		return false;
	},
	function(info,response){
		response({result:false});
		return true;
	}

			]);

			// -
			// ハイパーリンク置換定義「イメージ検索用」「Bing 画像検索」
			// -
			attachItem( "ReplacementToLink_DirectLinkImageSearch_Bing" , [
	
	function (info,response){
		var anchor_element = info.anchor_element;

		var url = anchor_element.href;
		var r = new RegExp("^(http|https)://www\\.bing\\.com/images/search[?].*","i");
		if(url.match(r)){
			
			var image_url = (function(){
				try{
					// m 属性を取得
					var m = anchor_element.getAttribute("m") || "";
					var obj = JsonParse(m);
					if(obj["murl"]) return obj["murl"];
				}catch(e){}
				
				return null;
			})();

			if(image_url){
				response({result:true,url:image_url,content_type:["image"]});
				return true;
			}
		}

		return false;
	},
	function (info,response){
		var anchor_element = info.anchor_element;

		var div = anchor_element.parentNode;
		if(div.className != "dg_u"){
			return false;
		}

		// ローダーオブジェクトを作成
		var loader = new Loader();

		// 成功
		loader.onload = function(str){
			if(str.match(new RegExp("<a[ ]+?id=\"m_fsi\"[ ]+?href=\"(.*?)\"","i"))){
				response({result:true,url:RegExp.$1,content_type:["image"]});
				return;
			}
			response({result:false});
		};

		// 失敗
		loader.onerror = function(){
			response({result:false});
		};

		// テキストの読み込み
		loader.setMethod("GET");
		loader.setURL(anchor_element.href);
		loader.loadText();

		return true;
	},
	function (info,response){
		response({result:false});
		return true;
	}

			]);

			// -
			// ハイパーリンク置換定義「イメージ検索用」「Yandex 画像検索」
			// -
			attachItem( "ReplacementToLink_DirectLinkImageSearch_Yandex" , [
	
	function(info,response){
		var anchor_element = info.anchor_element;

		// クエリを取得
		var query = StringGetQuery(anchor_element.href);
		if(query.img_url){
			var image_url = decodeURIComponent(query.img_url);
			if(image_url.indexOf("http") != 0){
				image_url = "http://" + image_url;
			}
			response({result:true,url:image_url,content_type:["image"]});
			return true;
		}

		return false;
	},
	function(info,response){
		response({result:false});
		return true;
	}

			]);

			// -
			// ハイパーリンク置換定義「イメージ検索用」「goo 画像検索」
			// -
			attachItem( "ReplacementToLink_DirectLinkImageSearch_Goo" , [
	
	function(info,response){
		var anchor_element = info.anchor_element;

		// ローダーオブジェクトを作成
		var loader = new Loader();

		// 成功
		loader.onload = function(str){
			var image_url;
			var m = str.match('<p[^>]+class[ \n\r\t]*=[ \n\r\t]*"imgDetailTxtLimitLength"[^>]*>(.*)?</p>');
			if(m){
				m = m[1].match('<a[^>]+href[ \n\r\t]*=[ \n\r\t]*"([^"]+)');
				if(m){
					image_url = m[1];
				}
			}

			if(image_url){
				response({result:true,url:image_url});
				return;
			}
			response({result:false});
		};

		// 失敗
		loader.onerror = function(){
			response({result:false});
		};

		// テキストの読み込み
		loader.setMethod("GET");
		loader.setURL(anchor_element.href);
		loader.loadText();

		return true;
	}

			]);

			// -
			// ハイパーリンク置換定義「ウィキペディア用」
			// -
			attachItem( "ReplacementToLink_DirectLinkWikipedia" , [
	
	function(info,response){
		var anchor_element = info.anchor_element;

		var ext_list = [
			"jpg",
			"jpeg",
			"png",
			"gif",
			"svg",
			"ogg"
		];

		var i;
		var num = ext_list.length;
		for(i=0;i<num;i++){
			if(anchor_element.href.match(new RegExp("^.*/.+:.+\\." + ext_list[i] + "($|&|[?])","i"))){
				break;
			}
		}
		if(i != num){
			// ローダーオブジェクトを作成
			var loader = new Loader();

			// 成功
			loader.onload = function(str){
				// audio
				if(str.match(new RegExp("<div[ ]class=\"fullImageLink\".*?<audio[ ].*?<source.*?src=\"(.*?)\"","i"))){
					response({result:true,url:RegExp.$1});
					return;
				}

				// svg
				if(str.match(new RegExp("<div[ ]class=\"fullImageLink\".*?<a href=\".*?\\.svg\".*?<img.*?src=\"(.*?)\"","i"))){
					response({result:true,url:RegExp.$1,content_type:["image"]});
					return;
				}

				// 高解像度画像
				if(str.match(new RegExp("<div[ ]class=\"fullImageLink\".*?<a href=\"(.*?)\"","i"))){
					response({result:true,url:RegExp.$1,content_type:["image"]});
					return;
				}

				response({result:false});
			};

			// 失敗
			loader.onerror = function(){
				response({result:false});
			};

			// テキストの読み込み
			loader.setMethod("GET");
			loader.setURL(anchor_element.href);
			loader.loadText();
		}

		return true;
	}

			]);

			// -
			// ハイパーリンク置換定義「HTML 内の画像を検索」「最大バイトの画像」
			// -
			attachItem( "ReplacementToLink_DirectLinkFindImageInHTML_ImageOfTheLargestByte" , [
	
	function(info,response){
		var anchor_element = info.anchor_element;
		var url = anchor_element.href;

		// ローダーオブジェクトを作成
		var loader = new Loader();

		// 成功
		loader.onload = function(header){

			if((function(){
				if(!header["Content-Type"]) return false;
				if(!header["Content-Type"].match("text")) return false;
				return true;
			})()){
			}else{
				response({result:false});
			}

			// ローダーオブジェクトを作成
			var loader = new Loader();

			// 成功
			loader.onload = function(str){
				var image_link_list = new Array();

				// ベース
				var base;
				var m = str.match(new RegExp("<base[^>]+href[ \n\r\t]*=[ \n\r\t]*\"([^\"]+?)\"","i"));
				if(m) base = m[0];

				// 画像要素
				str.replace(new RegExp("<img[^>]+src[ \n\r\t]*=[ \n\r\t]*\"([^\"]+?)\"","ig"),function (m,p1,index,str){
					image_link_list.push(StringUrl_To_Absolute(p1,url,base));
				});

				// 画像直リンク
				var re_image = new RegExp("\\.(bmp|gif|jpg|jpe|jpeg|png)([#?]|$)","i");
				str.replace(new RegExp("<a[^>]+href[ \n\r\t]*=[ \n\r\t]*\"([^\"]+?)\"","ig"),function (m,p1,index,str){
					if(p1.match(re_image)){
						image_link_list.push(StringUrl_To_Absolute(p1,url,base));
					}
				});

				var image_list = new Array();
				(function callee(){
					var image_url = image_link_list.pop();
					if(!image_url){
						var byte_size_max = 0;
						var image_item;
						var i;
						var num = image_list.length;
						for(i=0;i<num;i++){
							var item = image_list[i];
							if(item.byte_size > byte_size_max){
								byte_size_max = item.byte_size;
								image_item = item;
							}
						}
						if(image_item){
							response({result:true,url:image_item.url,content_type:["image"]});
						}else{
							response({result:false});
						}
						return;
					}

					if(!image_url.match(new RegExp("^(http|https)://","i"))){
						callee();
						return;
					}

					// ローダーオブジェクトを作成
					var loader = new Loader();

					// 成功
					loader.onload = function(header){
						if((function(){
							if(!header["Content-Type"]) return false;
							if(!header["Content-Length"]) return false;
							if(!header["Content-Type"].match("image")) return false;
							return true;
						})()){
							image_list.push({
								url:image_url,
								byte_size:parseInt(header["Content-Length"])
							});
						}

						callee();
					};

					// 失敗
					loader.onerror = function(){
						callee();
					};

					// レスポンスヘッダを読み込み
					loader.setURL(image_url);
					loader.loadResponseHeader();
				})();
			};

			// 失敗
			loader.onerror = function(){
				response({result:false});
			};

			// テキストの読み込み
			loader.setMethod("GET");
			loader.setURL(url);
			loader.loadText();

		};

		// 失敗
		loader.onerror = function(){
			response({result:false});
		};

		// レスポンスヘッダを読み込み
		loader.setURL(url);
		loader.loadResponseHeader();

		return true;
	},
	function(info,response){
		response({result:false});
		return true;
	}

			]);

			// -
			// ハイパーリンク置換定義「デフォルト」
			// -
			attachItem( "ReplacementToLink_Default" , [

	function(info,response){

		// -
		// 第01引数 Object 型
		// anchor_element:HTMLAnchorElement オブジェクト
		// -
		var anchor_element = info.anchor_element;

		// -
		// 第02引数 function
		// 引数:Object 型
		// result:Boolean 型(true で許可、false で拒否)
		// url:String 型(省略可、展開先のアドレスを変更したい場合に指定)
		// content_type:Array 型(省略可、展開先のコンテンツタイプを通知したい場合に指定)
		// 必ず1度実行する必要がある。非同期実行可能。
		// -
		response({result:false});

		// -
		// 戻り値 Boolean 型
		// true :関数の実行を完了
		// false:次の関数を実行
		// -
		return true;
	}

			]);


			// -
			// ハイパーリンク化定義「簡易」
			// -
			attachItem( "MakeLinkToText_Simple" , [
	
	function(info,response){
		var text_node = info.text_node;

		// 対応URIスキーム
		var scheme_list = [
			["https://","https://"],
			["http://","http://"],
			["ftp://","ftp://"]
		];

		// 辞書を作成
		var i;
		var num = scheme_list.length;
		var str = "(";
		var scheme_dictionary = new Object();
		for(i=0;i<num;i++){
			var scheme = scheme_list[i];
			scheme_dictionary[scheme[0]] = scheme[1];
			str += scheme[0];
			if(i < num - 1){
				str += "|";
			}
		}
		str += ")";
		var ignore_dictionary = {"WBR":1};
		var inline_dictionary = {"SPAN":1,"FONT":1,"TT":1,"EM":1,"B":1,"S":1,"I":1,"BIG":1,"SMALL":1};

		// 正規表現を作成
		var char = "[-a-zA-Z0-9#%_.!~*';/?:@&=+$,]";
		var search_regexp = new RegExp(str + "(" + char + "*)","ig");
		var char_regexp = new RegExp("^(" + char + "*)","i");
		var url_regexp = new RegExp("^(http|https|ftp)://(" + char + "{4,})$","");
		var omit_regexp = new RegExp("\\.\\.\\.$","");

		// テキストを取得
		var base = DomNodeGetNodeValue(text_node);

		var p = 0;
		var b = 0;
		var m;
		var l1;
		var l2;
		var size = base.length;
		base.replace(search_regexp, function(str,p1,p2,o,s){
			p = o;
			l1 = p1.length;
			l2 = p2.length;
			var url = scheme_dictionary[p1] + base.substr(p+l1,l2);

			if(size > p + l1 + l2){

				// 有効
				if(url.match(url_regexp) && !url.match(omit_regexp)){

					// 元のテキストノード
					text_node.nodeValue = base.substring(b,p);

					// アンカーを作成
					var anchor_element = DocumentCreateElement('a');
					anchor_element.href = url;
					ElementSetTextContent(anchor_element,p1 + p2);
					DomNode_InsertAfter(text_node,anchor_element);

					p += l1 + l2;
					b = p;

					// 右側のテキストノードを作成
					text_node = DocumentCreateText(base.substring(p));
					DomNode_InsertAfter(anchor_element,text_node);

				}

			}else{
				var nodes = new Array();

				// 元のテキスト
				var prev_text = base.substring(b,p);

				// アンカーテキスト
				nodes.push(DocumentCreateText(p1 + p2));

				var next_node = text_node.nextSibling;
				while(next_node){
					if(next_node.nodeType == 1){
						var result = false;
						var tag_name = next_node.tagName;

						// 無視するタグ
						if(ignore_dictionary[tag_name]){
							nodes.push(next_node);
							result = true;

						// テキストとして取得を試みるタグ
						}else if(inline_dictionary[tag_name]){
							var children = next_node.childNodes;
							num = children.length;
							for(i=0;i<num;i++){
								var node = children[i];
								if(node.nodeType == 3)	continue;
								if(node.nodeType == 1){
									if(ignore_dictionary[node.tagName]){
										continue;
									}
								}
								break;
							}
							if(i >= num){
								base = ElementGetTextContent(next_node);
								m = base.match(char_regexp);
								if(m){
									if(!RegExp.rightContext){
										url += base.substr(0,m[1].length);
										nodes.push(next_node);
										result = true;
									}
								}
							}
						}

						if(!result){
							break;
						}

					}else if(next_node.nodeType == 3){
						base = DomNodeGetNodeValue(next_node);

						m = base.match(char_regexp);
						if(m){
							url += base.substr(0,m[1].length);
							if(RegExp.rightContext){
								// 有効
								if(url.match(url_regexp) && !url.match(omit_regexp)){
									// 元のテキストノード
									next_node.nodeValue = base.substr(0,m[1].length);
									nodes.push(next_node);

									// 右側のテキストノードを作成
									var node = DocumentCreateText(base.substring(m[1].length));
									DomNode_InsertAfter(next_node,node);
								}
								break;
							}else{
								nodes.push(next_node);
							}
						}

					}

					next_node = next_node.nextSibling;
				}

				// 有効
				if(url.match(url_regexp) && !url.match(omit_regexp)){

					// 元のテキストノード
					text_node.nodeValue = prev_text;

					// アンカーを作成
					var anchor_element = DocumentCreateElement('a');
					anchor_element.href = url;
					DomNode_InsertAfter(text_node,anchor_element);

					num = nodes.length;
					for(i=0;i<num;i++){
						if(nodes[i]){
							anchor_element.appendChild(nodes[i]);
						}
					}
				}
			}
		});

		return false;
	},
	function(info,response){
		response({});
		return true;
	}

			]);

			// -
			// ハイパーリンク化定義「詳細」
			// -
			attachItem( "MakeLinkToText_Detail" , [
	
	function(info,response){
		var text_node = info.text_node;

		// 対応URIスキーム
		var scheme_list = [
			["https://","https://"],
			["http://","http://"],
			["ttps://","https://"],
			["ttp://","http://"],
			["ftp://","ftp://"],
			["tps://","https://"]
		];

		// 辞書を作成
		var i;
		var num = scheme_list.length;
		var str = "(";
		var scheme_dictionary = new Object();
		for(i=0;i<num;i++){
			var scheme = scheme_list[i];
			scheme_dictionary[scheme[0]] = scheme[1];
			str += scheme[0];
			if(i < num - 1){
				str += "|";
			}
		}
		str += ")";
		var ignore_dictionary = {"WBR":1};
		var inline_dictionary = {"SPAN":1,"FONT":1,"TT":1,"EM":1,"B":1,"S":1,"I":1,"BIG":1,"SMALL":1};

		// 正規表現を作成
		var char = "[-a-zA-Z0-9#%_.!~*';/?:@&=+$,]";
		var search_regexp = new RegExp(str + "(" + char + "*)","ig");
		var char_regexp = new RegExp("^(" + char + "*)","i");
		var url_regexp = new RegExp("^(http|https|ftp)://(" + char + "{4,})$","");
		var omit_regexp = new RegExp("\\.\\.\\.$","");

		// テキストを取得
		var base = DomNodeGetNodeValue(text_node);
		var half = StringConvertFromAlphabeticFullToAlphabeticHalf(base);
		half = StringConvertFromNumericFullToNumericHalf(half);
		half = StringConvertFromSignFullToSignHalf(half);

		var p = 0;
		var b = 0;
		var m;
		var l1;
		var l2;
		var size = half.length;
		half.replace(search_regexp, function(str,p1,p2,o,s){
			p = o;
			l1 = p1.length;
			l2 = p2.length;
			var url = scheme_dictionary[p1] + half.substr(p+l1,l2);

			if(size > p + l1 + l2){

				// 有効
				if(url.match(url_regexp) && !url.match(omit_regexp)){

					// 元のテキストノード
					text_node.nodeValue = base.substring(b,p);

					// アンカーを作成
					var anchor_element = DocumentCreateElement('a');
					anchor_element.href = url;
					ElementSetTextContent(anchor_element,base.substr(p,l1+l2));
					DomNode_InsertAfter(text_node,anchor_element);

					p += l1 + l2;
					b = p;

					// 右側のテキストノードを作成
					text_node = DocumentCreateText(base.substring(p));
					DomNode_InsertAfter(anchor_element,text_node);

				}

			}else{
				var nodes = new Array();

				// 元のテキスト
				var prev_text = base.substring(b,p);

				// アンカーテキスト
				nodes.push(DocumentCreateText(base.substr(p,l1+l2)));

				var next_node = text_node.nextSibling;
				while(next_node){
					if(next_node.nodeType == 1){
						var result = false;
						var tag_name = next_node.tagName;

						// 無視するタグ
						if(ignore_dictionary[tag_name]){
							nodes.push(next_node);
							result = true;

						// テキストとして取得を試みるタグ
						}else if(inline_dictionary[tag_name]){
							var children = next_node.childNodes;
							num = children.length;
							for(i=0;i<num;i++){
								var node = children[i];
								if(node.nodeType == 3)	continue;
								if(node.nodeType == 1){
									if(ignore_dictionary[node.tagName]){
										continue;
									}
								}
								break;
							}
							if(i >= num){
								base = ElementGetTextContent(next_node);
								half = StringConvertFromAlphabeticFullToAlphabeticHalf(base);
								half = StringConvertFromNumericFullToNumericHalf(half);
								half = StringConvertFromSignFullToSignHalf(half);
								m = half.match(char_regexp);
								if(m){
									if(!RegExp.rightContext){
										url += half.substr(0,m[1].length);
										nodes.push(next_node);
										result = true;
									}
								}
							}
						}

						if(!result){
							break;
						}

					}else if(next_node.nodeType == 3){
						base = DomNodeGetNodeValue(next_node);
						half = StringConvertFromAlphabeticFullToAlphabeticHalf(base);
						half = StringConvertFromNumericFullToNumericHalf(half);
						half = StringConvertFromSignFullToSignHalf(half);

						m = half.match(char_regexp);
						if(m){
							url += half.substr(0,m[1].length);
							if(RegExp.rightContext){
								// 有効
								if(url.match(url_regexp) && !url.match(omit_regexp)){
									// 元のテキストノード
									next_node.nodeValue = base.substr(0,m[1].length);
									nodes.push(next_node);

									// 右側のテキストノードを作成
									var node = DocumentCreateText(base.substring(m[1].length));
									DomNode_InsertAfter(next_node,node);
								}
								break;
							}else{
								nodes.push(next_node);
							}
						}

					}

					next_node = next_node.nextSibling;
				}

				// 有効
				if(url.match(url_regexp) && !url.match(omit_regexp)){

					// 元のテキストノード
					text_node.nodeValue = prev_text;

					// アンカーを作成
					var anchor_element = DocumentCreateElement('a');
					anchor_element.href = url;
					DomNode_InsertAfter(text_node,anchor_element);

					num = nodes.length;
					for(i=0;i<num;i++){
						if(nodes[i]){
							anchor_element.appendChild(nodes[i]);
						}
					}
				}
			}
		});

		return false;
	},
	function(info,response){
		response({});
		return true;
	}

			]);

			// -
			// ハイパーリンク化定義「デフォルト」
			// -
			attachItem( "MakeLinkToText_Default" , [

	function(info,response){

		// -
		// 第01引数 Object 型
		// text_node:Text オブジェクト (DOM)
		// -
		var text_node = info.text_node;

		// -
		// 第02引数 function
		// 引数:なし
		// 処理が完了したタイミングで必ず1度実行する必要がある。非同期実行可能。
		// -
		response();

		// -
		// 戻り値 Boolean 型
		// true :関数の実行を完了
		// false:次の関数を実行
		// -
		return true;
	}

			]);


			// -
			// テキスト展開定義「インライン表示」
			// -
			attachItem( "ExpandText_InlineScriptAllow_Inline" , [
	
	function(info,response){
		var anchor_element = info.anchor_element;
		var parent = anchor_element.parentNode;
		if(parent){
			var width = ElementGetClientWidth(parent);

			// 親の幅が小さすぎる場合インライン表示しない
			if(width < 50){
				response({result:false});
				return true;
			}
		}

		return false;
	},
	function(info,response){
		var anchor_element = info.anchor_element;
		var url = info.url;

		var ext_list = [
			"txt"
		];

		var i;
		var num = ext_list.length;
		for(i=0;i<num;i++){
			// テキストの拡張子である場合、インライン表示を試みる
			if(url.match(new RegExp("^.*/.+\\." + ext_list[i] + "($|[#?:].*$)","i"))){
				response({result:true});
				return true;
			}
		}

		return false;
	},
	function(info,response){
		// インライン表示しない
		response({result:false});
		return true;
	}

			]);

			// -
			// テキスト展開定義「インライン表示」
			// -
			attachItem( "ExpandText_InlineScriptInsert_Inline" , [
	
	function(info,response){

		var anchor_element = info.anchor_element;
		var textarea = info.textarea_element;
		var event_dispatcher = info.event_dispatcher;
		var style = textarea.style;

		// ピクセル値によるサイズ指定
		var width  = 400;

		// スクロール補正
		var revise_scroll = new DocumentReviseScroll();
		revise_scroll.executeAttachElementBefore(textarea);

		// 改行用
		var div_prev = DocumentCreateElement("div");
		var analyze_div_prev = new ElementAnalyzeManager(div_prev,true);
		ElementSetStyle(div_prev,"height:0px;");
		DomNode_InsertAfter(anchor_element,div_prev);

		// テキストエリアを挿入
		DomNode_InsertAfter(div_prev,textarea);

		// 改行用
		var div_next = DocumentCreateElement("div");
		var analyze_div_next = new ElementAnalyzeManager(div_next,true);
		ElementSetStyle(div_next,"height:0px;");
		DomNode_InsertAfter(textarea,div_next);

		// 高さを取得
		var bounding_size = ElementGetBoundingClientRect(textarea);
		var height = bounding_size.bottom  - bounding_size.top;

		// スタイルのサイズを取得
		style.width  = "0px";
		style.height = "0px";
		bounding_size = ElementGetBoundingClientRect(textarea);
		var style_w = bounding_size.right  - bounding_size.left;
		var style_h = bounding_size.bottom  - bounding_size.top;

		// 親の幅を取得
		var width_max = ElementGetClientWidth(textarea.parentNode);

		// エレメントのサイズ
		width  -= style_w;

		// 最大幅補正
		var w = width_max - style_w;
		if(w < width){
			width = w;
		}

		// サイズをセット
		style.width  = width  + "px";
		style.height = (height - style_h) + "px";

		// スクロール補正
		revise_scroll.executeAttachElementAfter(textarea);

		// 開放時に実行されるイベント
		var event_handler = event_dispatcher.createEventHandler("release");
		event_handler.setFunction(function (result){
			if(analyze_div_prev){
				analyze_div_prev.release();
				analyze_div_prev = null;
			}
			if(analyze_div_next){
				analyze_div_next.release();
				analyze_div_next = null;
			}
			if(event_handler){
				event_handler.release();
				event_handler = null;
			}
		});

		response();
		return false;
	}

			]);

			// -
			// テキスト展開定義「デフォルト」
			// -
			attachItem( "ExpandText_InlineScriptAllow_Default" , [
 
	function(info,response){

		// -
		// 第01引数 Object 型
		// current_element:HTMLElement オブジェクト
		// url:String 型(展開先のアドレス)
		// content_type:Array 型(コンテンツタイプ)
		// -
		var current_element = info.current_element;
		var url = info.url;
		var content_type = info.content_type;

		// -
		// 第02引数 function
		// 引数:Object 型
		// result:Boolean 型(true で許可、false で拒否)
		// 必ず1度実行する必要がある。非同期実行可能。
		// -
		response({result:false});

		// -
		// 戻り値 Boolean 型
		// true :関数の実行を完了
		// false:次の関数を実行
		// -
		return true;
	}

			]);

			// -
			// テキスト展開定義「デフォルト」
			// -
			attachItem( "ExpandText_InlineScriptInsert_Default" , [

	function(info,response){

		// -
		// 第01引数 Object 型
		// current_element:HTMLElement オブジェクト
		// textarea_element:HTMLTextAreaElement オブジェクト
		// event_dispatcher:EventDispatcher オブジェクト
		// -
		var current_element = info.current_element;
		var textarea = info.textarea_element;
		var event_dispatcher = info.event_dispatcher;

		// -
		// 第02引数 function
		// 引数:なし
		// 処理が完了したタイミングで必ず1度実行する必要がある。非同期実行可能。
		// -
		response();

		// -
		// 戻り値 Boolean 型
		// true :関数の実行を完了
		// false:次の関数を実行
		// -
		return true;
	}

			]);


			// -
			// イメージ展開定義「サムネイル挿入」
			// -
			attachItem( "ExpandImage_ThumbnailScriptInsert" , [
	
	function(info,response){

		var current_element = info.current_element;
		var image = info.image_element;
		var event_dispatcher = info.event_dispatcher;
		var style = image.style;
		var width;
		var height;

		// 開放時に実行される関数
		function release(){
			DomNodeRemove(image);

			if(analyze_div_prev){
				analyze_div_prev.release();
				analyze_div_prev = null;
			}
			if(analyze_div_next){
				analyze_div_next.release();
				analyze_div_next = null;
			}
			if(event_handler){
				event_handler.release();
				event_handler = null;
			}
		}

		// スクロール補正
		var revise_scroll = new DocumentReviseScroll();
		revise_scroll.executeAttachElementBefore(image);

		// デフォルトの画像サイズを取得
		var natural_size = ImageGetNaturalSize(image);

		// サムネイルの最小サイズ
		var width_min  = project.getWidthMinThumbnailImage();

		// サムネイルの最大サイズ
		var width_max  = project.getWidthMaxThumbnailImage();

		// パーセントによるサイズ指定
		var percent = project.getScalePercentThumbnailImage();
		width  = natural_size.width  / 100 * percent;
		height = natural_size.height / 100 * percent;


		// 改行を作成
		var div_prev = DocumentCreateElement("div");
		var analyze_div_prev = new ElementAnalyzeManager(div_prev,true);
		ElementSetStyle(div_prev,"height:0px;");
		DomNode_InsertAfter(current_element,div_prev);

		// イメージを挿入
		DomNode_InsertAfter(div_prev,image);

		// 改行を作成
		var div_next = DocumentCreateElement("div");
		var analyze_div_next = new ElementAnalyzeManager(div_next,true);
		ElementSetStyle(div_next,"height:0px");
		DomNode_InsertAfter(image,div_next);

		// スタイルのサイズを取得
		style.width  = "0px";
		style.height = "0px";
		var bounding_size = ElementGetBoundingClientRect(image);
		var style_w = bounding_size.right  - bounding_size.left;
		var style_h = bounding_size.bottom - bounding_size.top;

		// 親の幅を取得
		var parent_width = ElementGetClientWidth(image.parentNode);
		if(width_max > parent_width)	width_max = parent_width;

		// エレメントのサイズ
		width  -= style_w;
		height -= style_h;

		// 最小幅補正
		var w = width_min - style_w;
		if(w > width){
			height *= w / width;
			width = w;
		}

		// 最小高補正
		var h = width_min - style_h;
		if(h > height){
			width *= h / height;
			height = h;
		}

		// 最大幅補正
		w = width_max - style_w;
		if(w < width){
			height *= w / width;
			width = w;
		}

		// 最大高補正
		h = width_max - style_h;
		if(h < height){
			width *= h / height;
			height = h;
		}

		// サイズをセット
		style.width  = width  + "px";
		style.height = height + "px";

		// スクロール補正
		revise_scroll.executeAttachElementAfter(image);

		// クリック時に実行されるイベント
		function click_func(e){
			if(e.ctrlKey){
				// Ctrl + クリックで等倍配置
				style.width  = natural_size.width  + "px";
				style.height = natural_size.height + "px";

			}else{
				release();
			}
		}
		if(image.addEventListener){
			image.addEventListener("click",click_func,true);
		}else if(image.attachEvent){
			image.attachEvent("onclick",click_func);
		}

		// 開放時に実行されるイベント
		var event_handler = event_dispatcher.createEventHandler("release");
		event_handler.setFunction(release);

		response();
		return false;
	}

			]);

			// -
			// イメージ展開定義「ポップアップ表示(すべてのリンク)」
			// -
			attachItem( "ExpandImage_ThumbnailScriptAllow_PopupAll" , [
	
	function(info,response){
		// サムネイル表示しない
		response({result:false});
		return true;
	}

			]);

			// -
			// イメージ展開定義「ポップアップ表示(すべてのリンク)」
			// -
			attachItem( "ExpandImage_PopupScriptAllow_PopupAll" , [
	
	function(info,response){
		var current_element = info.current_element;
		var url = info.url;

		var ext_list = [
			"bmp",
			"gif",
			"jpg",
			"jpe",
			"jpeg",
			"png"
		];

		var i;
		var num = ext_list.length;
		for(i=0;i<num;i++){
			// URL が画像の拡張子である場合、ポップアップ表示を試みる
			if(url.match(new RegExp("^.*/.+\\." + ext_list[i] + "($|[#?:].*$)","i"))){
				response({result:true});
				return true;
			}
		}

		return false;
	},
	function(info,response){
		var current_element = info.current_element;
		var content_type = info.content_type;

		// コンテンツタイプに "image" が含まれる
		if(content_type.join(",").match(/image/i)){
			response({result:true});
			return true;
		}

		return false;
	},
	function(info,response){
		// ポップアップ表示しない
		response({result:false});
		return true;
	}

			]);

			// -
			// イメージ展開定義「ポップアップ表示(画像を含むリンク)」
			// -
			attachItem( "ExpandImage_ThumbnailScriptAllow_PopupIncludeImage" , [
	
	function(info,response){
		// サムネイル表示しない
		response({result:false});
		return true;
	}

			]);

			// -
			// イメージ展開定義「ポップアップ表示(画像を含むリンク)」
			// -
			attachItem( "ExpandImage_PopupScriptAllow_PopupIncludeImage" , [
	
	function(info,response){
		var current_element = info.current_element;
		var result = (function(){

			// イメージ要素を含む
			var nodes = ElementGetElementsByTagName(current_element,"img");
			if(nodes.length){
				return true;
			}

			// バックグラウンドイメージを含む
			var nodes = ElementGetElementsByTagName(current_element,"*");
			var i;
			var num = nodes.length;
			for(i=0;i<num;i++){
				var style = ElementGetComputedStyle(nodes[i],null);
				if(style){
					if(style.backgroundImage != "none"){
						return true;
					}
				}
			}

			return false;
		})();

		if(result) return false;

		response({result:false});
		return true;
	},
	function(info,response){
		var current_element = info.current_element;
		var url = info.url;

		var ext_list = [
			"bmp",
			"gif",
			"jpg",
			"jpe",
			"jpeg",
			"png"
		];

		var i;
		var num = ext_list.length;
		for(i=0;i<num;i++){
			// URL が画像の拡張子である場合、ポップアップ表示を試みる
			if(url.match(new RegExp("^.*/.+\\." + ext_list[i] + "($|[#?:].*$)","i"))){
				response({result:true});
				return true;
			}
		}

		return false;
	},
	function(info,response){
		var current_element = info.current_element;
		var content_type = info.content_type;

		// コンテンツタイプに "image" が含まれる
		if(content_type.join(",").match(/image/i)){
			response({result:true});
			return true;
		}

		return false;
	},
	function(info,response){
		// ポップアップ表示しない
		response({result:false});
		return true;
	}

			]);

			// -
			// イメージ展開定義「ポップアップ表示(アシスト要素のみ)」
			// -
			attachItem( "ExpandImage_ThumbnailScriptAllow_PopupImageInAnchor" , [
	
	function(info,response){
		var current_element = info.current_element;
		if(!info.is_overridden_url){
			response({result:false});
			return true;
		}

		return false;
	},
	function(info,response){
		var current_element = info.current_element;
		var parent = current_element.parentNode;
		if(parent){
			var width = ElementGetClientWidth(parent);

			// 親の幅が小さすぎる場合サムネイル化しない
			if(width < 50){
				response({result:false});
				return true;
			}
		}

		return false;
	},
	function(info,response){
		var current_element = info.current_element;
		var url = info.url;

		var ext_list = [
			"bmp",
			"gif",
			"jpg",
			"jpe",
			"jpeg",
			"png"
		];

		var i;
		var num = ext_list.length;
		for(i=0;i<num;i++){
			// URL が画像の拡張子である場合、サムネイル表示を試みる
			if(url.match(new RegExp("^.*/.+\\." + ext_list[i] + "($|[#?:].*$)","i"))){
				response({result:true});
				return true;
			}
		}

		return false;
	},
	function(info,response){
		var current_element = info.current_element;
		var content_type = info.content_type;

		// コンテンツタイプに "image" が含まれる
		if(content_type.join(",").match(/image/i)){
			response({result:true});
			return true;
		}

		return false;
	},
	function(info,response){
		// サムネイル表示しない
		response({result:false});
		return true;
	}

			]);

			// -
			// イメージ展開定義「ポップアップ表示(アシスト要素のみ)」
			// -
			attachItem( "ExpandImage_PopupScriptAllow_PopupImageInAnchor" , [
	
	function(info,response){
		var current_element = info.current_element;
		if(!info.is_overridden_url){
			response({result:false});
			return true;
		}

		return false;
	},
	function(info,response){
		var current_element = info.current_element;
		var url = info.url;

		var ext_list = [
			"bmp",
			"gif",
			"jpg",
			"jpe",
			"jpeg",
			"png"
		];

		var i;
		var num = ext_list.length;
		for(i=0;i<num;i++){
			// URL が画像の拡張子である場合、ポップアップ表示を試みる
			if(url.match(new RegExp("^.*/.+\\." + ext_list[i] + "($|[#?:].*$)","i"))){
				response({result:true});
				return true;
			}
		}

		return false;
	},
	function(info,response){
		var current_element = info.current_element;
		var content_type = info.content_type;

		// コンテンツタイプに "image" が含まれる
		if(content_type.join(",").match(/image/i)){
			response({result:true});
			return true;
		}

		return false;
	},
	function(info,response){
		// ポップアップ表示しない
		response({result:false});
		return true;
	}

			]);

			// -
			// イメージ展開定義「サムネイル表示(すべてのリンク)」
			// -
			attachItem( "ExpandImage_ThumbnailScriptAllow_ThumbnailAll" , [
	
	function(info,response){
		var current_element = info.current_element;
		var parent = current_element.parentNode;
		if(parent){
			var width = ElementGetClientWidth(parent);

			// 親の幅が小さすぎる場合サムネイル化しない
			if(width < 50){
				response({result:false});
				return true;
			}
		}

		return false;
	},
	function(info,response){
		var current_element = info.current_element;
		var url = info.url;

		var ext_list = [
			"bmp",
			"gif",
			"jpg",
			"jpe",
			"jpeg",
			"png"
		];

		var i;
		var num = ext_list.length;
		for(i=0;i<num;i++){
			// URL が画像の拡張子である場合、サムネイル表示を試みる
			if(url.match(new RegExp("^.*/.+\\." + ext_list[i] + "($|[#?:].*$)","i"))){
				response({result:true});
				return true;
			}
		}

		return false;
	},
	function(info,response){
		var current_element = info.current_element;
		var content_type = info.content_type;

		// コンテンツタイプに "image" が含まれる
		if(content_type.join(",").match(/image/i)){
			response({result:true});
			return true;
		}

		return false;
	},
	function(info,response){
		// サムネイル表示しない
		response({result:false});
		return true;
	}

			]);

			// -
			// イメージ展開定義「サムネイル表示(すべてのリンク)」
			// -
			attachItem( "ExpandImage_PopupScriptAllow_ThumbnailAll" , [
	
	function(info,response){
		// ポップアップ表示しない
		response({result:false});
		return true;
	}

			]);

			// -
			// イメージ展開定義「サムネイル表示(画像を含まないリンク)」
			// -
			attachItem( "ExpandImage_ThumbnailScriptAllow_ThumbnailNotIncludeImage" , [
	
	function(info,response){
		var current_element = info.current_element;
		var parent = current_element.parentNode;
		if(parent){
			var width = ElementGetClientWidth(parent);

			// 親の幅が小さすぎる場合サムネイル化しない
			if(width < 50){
				response({result:false});
				return true;
			}
		}

		return false;
	},
	function(info,response){
		var current_element = info.current_element;
		var result = (function(){

			// イメージ要素を含む
			var nodes = ElementGetElementsByTagName(current_element,"img");
			if(nodes.length){
				return false;
			}

			// バックグラウンドイメージを含む
			var nodes = ElementGetElementsByTagName(current_element,"*");
			var i;
			var num = nodes.length;
			for(i=0;i<num;i++){
				var style = ElementGetComputedStyle(nodes[i],null);
				if(style){
					if(style.backgroundImage != "none"){
						return false;
					}
				}
			}

			// 子が無い
			if(!(current_element.childNodes.length)){
				return false;
			}

			return true;
		})();

		if(!result){
			response({result:false});
			return true;
		}

		return false;
	},
	function(info,response){
		var current_element = info.current_element;
		var url = info.url;

		var ext_list = [
			"bmp",
			"gif",
			"jpg",
			"jpe",
			"jpeg",
			"png"
		];

		var i;
		var num = ext_list.length;
		for(i=0;i<num;i++){
			// URL が画像の拡張子である場合、サムネイル表示を試みる
			if(url.match(new RegExp("^.*/.+\\." + ext_list[i] + "($|[#?:].*$)","i"))){
				response({result:true});
				return true;
			}
		}

		return false;
	},
	function(info,response){
		var current_element = info.current_element;
		var content_type = info.content_type;

		// コンテンツタイプに "image" が含まれる
		if(content_type.join(",").match(/image/i)){
			response({result:true});
			return true;
		}

		return false;
	},
	function(info,response){
		// サムネイル表示しない
		response({result:false});
		return true;
	}

			]);

			// -
			// イメージ展開定義「サムネイル表示(画像を含まないリンク)」
			// -
			attachItem( "ExpandImage_PopupScriptAllow_ThumbnailNotIncludeImage" , [
	
	function(info,response){
		// ポップアップ表示しない
		response({result:false});
		return true;
	}

			]);

			// -
			// イメージ展開定義「画像掲示板用」
			// -
			attachItem( "ExpandImage_ThumbnailScriptAllow_ImageBbs" , [
	
	function(info,response){
		var anchor_element = info.anchor_element;

		// 本文中のみ許可
		var node = anchor_element.parentNode;
		if(node){
			if(node.tagName == "BLOCKQUOTE"){
					return false;
			}
			if(node.className == "body"){
					return false;
			}
		}

		response({result:false});
		return true;
	},
	function(info,response){
		var anchor_element = info.anchor_element;
		var parent = anchor_element.parentNode;
		if(parent){
			var width = ElementGetClientWidth(parent);

			// 親の幅が小さすぎる場合サムネイル化しない
			if(width < 50){
				response({result:false});
				return true;
			}
		}

		// 子にイメージが含まれる場合サムネイル化しない
		var nodes = ElementGetElementsByTagName(anchor_element,"img");
		if(nodes.length > 0){
			response({result:false});
			return true;
		}

		// 子が無い
		var nodes = anchor_element.childNodes;
		if(nodes.length == 0){
			response({result:false});
			return true;
		}

		return false;
	},
	function(info,response){
		var anchor_element = info.anchor_element;
		var url = info.url;

		var ext_list = [
			"bmp",
			"gif",
			"jpg",
			"jpe",
			"jpeg",
			"png"
		];

		var i;
		var num = ext_list.length;
		for(i=0;i<num;i++){
			// URL が画像の拡張子である場合、サムネイル表示を試みる
			if(url.match(new RegExp("^.*/.+\\." + ext_list[i] + "($|[#?:].*$)","i"))){
				response({result:true});
				return true;
			}
		}

		return false;
	},
	function(info,response){
		var anchor_element = info.anchor_element;
		var content_type = info.content_type;

		// コンテンツタイプに "image" が含まれる
		if(content_type.join(",").match(/image/i)){
			response({result:true});
			return true;
		}

		return false;
	},
	function(info,response){
		// サムネイル表示しない
		response({result:false});
		return true;
	}

			]);

			// -
			// イメージ展開定義「画像掲示板用」
			// -
			attachItem( "ExpandImage_PopupScriptAllow_ImageBbs" , [
	
	function(info,response){
		var anchor_element = info.anchor_element;

		// イメージが1つだけ含まれる場合許可
		var nodes = ElementGetElementsByTagName(anchor_element,"IMG");
		if(nodes.length == 1){
			var node = nodes[0];

			// 拡張ボタンは除外
			if(node.className == "extButton"){
			}else{
				return false;
			}
		}

		response({result:false});
		return true;
	},
	function(info,response){
		var anchor_element = info.anchor_element;
		var url = info.url;

		var ext_list = [
			"bmp",
			"gif",
			"jpg",
			"jpe",
			"jpeg",
			"png"
		];

		var i;
		var num = ext_list.length;
		for(i=0;i<num;i++){
			// URL が画像の拡張子である場合、ポップアップ表示を試みる
			if(url.match(new RegExp("^.*/.+\\." + ext_list[i] + "($|[#?:].*$)","i"))){
				response({result:true});
				return true;
			}
		}

		return false;
	},
	function(info,response){
		var anchor_element = info.anchor_element;
		var content_type = info.content_type;

		// コンテンツタイプに "image" が含まれる
		if(content_type.join(",").match(/image/i)){
			response({result:true});
			return true;
		}

		return false;
	},
	function(info,response){
		// ポップアップ表示しない
		response({result:false});
		return true;
	}

			]);

			// -
			// イメージ展開定義「ツイッター用」
			// -
			attachItem( "ExpandImage_ThumbnailScriptAllow_Twitter" , [
	
	function(info,response){
		var current_element = info.current_element;
		var url = info.url;

		var result = (function(){
			var node = current_element.parentNode;
			if(!node) return false;
			if(node.tagName != "P") return false;

			var m = ElementGetClassName(node).match(new RegExp("(^| )tweet-text( |$)","i"));
			if(!m) return false;

			if(current_element.getAttribute("data-pre-embedded") === "true"){
				return false;
			}

			var anchor_count = 0;
			var nodes = ElementGetElementsByTagName(node,"a");
			var i;
			var num = nodes.length;
			for(i=0;i<num;i++){
				if(nodes[i].getAttribute("data-expanded-url")){
					anchor_count ++;
					if(anchor_count > 1) return true;
				}
			}

			node = node.nextSibling;
			while(node){
				if(node.nodeType == 1){
					var m = ElementGetClassName(node).match(new RegExp("(^| )(cards-media-container|permalink-footer)( |$)","i"));
					if(m){
						var nodes = ElementGetElementsByTagName(node,"img");
						if(nodes.length){
							return false;
						}
					}
				}
				node = node.nextSibling;
			}

			return true;
		})();

		if(result) return false;

		response({result:false});
		return true;
	},
	function(info,response){
		var current_element = info.current_element;
		var parent = current_element.parentNode;
		if(parent){
			var width = ElementGetClientWidth(parent);

			// 親の幅が小さすぎる場合サムネイル化しない
			if(width < 50){
				response({result:false});
				return true;
			}
		}

		return false;
	},
	function(info,response){
		var current_element = info.current_element;
		var result = (function(){

			// イメージ要素を含む
			var nodes = ElementGetElementsByTagName(current_element,"img");
			if(nodes.length){
				return false;
			}

			// バックグラウンドイメージを含む
			var nodes = ElementGetElementsByTagName(current_element,"*");
			var i;
			var num = nodes.length;
			for(i=0;i<num;i++){
				var style = ElementGetComputedStyle(nodes[i],null);
				if(style){
					if(style.backgroundImage != "none"){
						return false;
					}
				}
			}

			// 子が無い
			if(!(current_element.childNodes.length)){
				return false;
			}

			return true;
		})();

		if(!result){
			response({result:false});
			return true;
		}

		return false;
	},
	function(info,response){
		var current_element = info.current_element;
		var url = info.url;

		var ext_list = [
			"bmp",
			"gif",
			"jpg",
			"jpe",
			"jpeg",
			"png"
		];

		var i;
		var num = ext_list.length;
		for(i=0;i<num;i++){
			// URL が画像の拡張子である場合、サムネイル表示を試みる
			if(url.match(new RegExp("^.*/.+\\." + ext_list[i] + "($|[#?:].*$)","i"))){
				response({result:true});
				return true;
			}
		}

		return false;
	},
	function(info,response){
		var current_element = info.current_element;
		var content_type = info.content_type;

		// コンテンツタイプに "image" が含まれる
		if(content_type.join(",").match(/image/i)){
			response({result:true});
			return true;
		}

		return false;
	},
	function(info,response){
		// サムネイル表示しない
		response({result:false});
		return true;
	}

			]);

			// -
			// イメージ展開定義「ツイッター用」
			// -
			attachItem( "ExpandImage_PopupScriptAllow_Twitter" , [
	
	function(info,response){
		var current_element = info.current_element;
		var result = (function(){
			var node = current_element.parentNode;
			while(node){
				if(node.nodeType != 1) break;
				var m = ElementGetClassName(node).match(new RegExp("(^| )stream-media-grid-items( |$)","i"));
				if(m){
					return true;
				}

				// イメージ要素を含む
				var nodes = ElementGetElementsByTagName(current_element,"img");
				if(nodes.length){
					return true;
				}

				// バックグラウンドイメージを含む
				var nodes = ElementGetElementsByTagName(current_element,"*");
				var i;
				var num = nodes.length;
				for(i=0;i<num;i++){
					var style = ElementGetComputedStyle(nodes[i],null);
					if(style){
						if(style.backgroundImage != "none"){
							return true;
						}
					}
				}

				node = node.parentNode;
			}

			return false;
		})();

		if(result){
			return false;
		}

		response({result:false});
		return true;
	},
	function(info,response){
		var current_element = info.current_element;
		var url = info.url;

		var ext_list = [
			"bmp",
			"gif",
			"jpg",
			"jpe",
			"jpeg",
			"png"
		];

		var i;
		var num = ext_list.length;
		for(i=0;i<num;i++){
			// URL が画像の拡張子である場合、ポップアップ表示を試みる
			if(url.match(new RegExp("^.*/.+\\." + ext_list[i] + "($|[#?:].*$)","i"))){
				response({result:true});
				return true;
			}
		}

		return false;
	},
	function(info,response){
		var current_element = info.current_element;
		var content_type = info.content_type;

		// コンテンツタイプに "image" が含まれる
		if(content_type.join(",").match(/image/i)){
			response({result:true});
			return true;
		}

		return false;
	},
	function(info,response){
		// ポップアップ表示しない
		response({result:false});
		return true;
	}

			]);

			// -
			// イメージ展開定義「reddit 用」
			// -
			attachItem( "ExpandImage_ThumbnailScriptAllow_Reddit" , [
	
	function(info,response){
		var current_element = info.current_element;
		if(!info.is_overridden_url){
			response({result:false});
			return true;
		}

		return false;
	},
	function(info,response){
		var current_element = info.current_element;
		var parent = current_element.parentNode;
		if(parent){
			var width = ElementGetClientWidth(parent);

			// 親の幅が小さすぎる場合サムネイル化しない
			if(width < 50){
				response({result:false});
				return true;
			}
		}

		return false;
	},
	function(info,response){
		var current_element = info.current_element;
		var result = (function(){

			// イメージ要素を含む
			var nodes = ElementGetElementsByTagName(current_element,"img");
			if(nodes.length){
				return false;
			}

			// バックグラウンドイメージを含む
			var nodes = ElementGetElementsByTagName(current_element,"*");
			var i;
			var num = nodes.length;
			for(i=0;i<num;i++){
				var style = ElementGetComputedStyle(nodes[i],null);
				if(style){
					if(style.backgroundImage != "none"){
						return false;
					}
				}
			}

			// 子が無い
			if(!(current_element.childNodes.length)){
				return false;
			}

			return true;
		})();

		if(!result){
			response({result:false});
			return true;
		}

		return false;
	},
	function(info,response){
		var current_element = info.current_element;
		var url = info.url;

		var ext_list = [
			"bmp",
			"gif",
			"jpg",
			"jpe",
			"jpeg",
			"png"
		];

		var i;
		var num = ext_list.length;
		for(i=0;i<num;i++){
			// URL が画像の拡張子である場合、サムネイル表示を試みる
			if(url.match(new RegExp("^.*/.+\\." + ext_list[i] + "($|[#?:].*$)","i"))){
				response({result:true});
				return true;
			}
		}

		return false;
	},
	function(info,response){
		var current_element = info.current_element;
		var content_type = info.content_type;

		// コンテンツタイプに "image" が含まれる
		if(content_type.join(",").match(/image/i)){
			response({result:true});
			return true;
		}

		return false;
	},
	function(info,response){
		// サムネイル表示しない
		response({result:false});
		return true;
	}

			]);

			// -
			// イメージ展開定義「reddit 用」
			// -
			attachItem( "ExpandImage_PopupScriptAllow_Reddit" , [
	
	function(info,response){
		var current_element = info.current_element;
		var result = (function(){

			// イメージ要素を含む
			var nodes = ElementGetElementsByTagName(current_element,"img");
			if(nodes.length){
				return true;
			}

			// バックグラウンドイメージを含む
			var nodes = ElementGetElementsByTagName(current_element,"*");
			var i;
			var num = nodes.length;
			for(i=0;i<num;i++){
				var style = ElementGetComputedStyle(nodes[i],null);
				if(style){
					if(style.backgroundImage != "none"){
						return true;
					}
				}
			}

			return false;
		})();

		if(result) return false;

		response({result:false});
		return true;
	},
	function(info,response){
		var current_element = info.current_element;
		var url = info.url;

		var ext_list = [
			"bmp",
			"gif",
			"jpg",
			"jpe",
			"jpeg",
			"png"
		];

		var i;
		var num = ext_list.length;
		for(i=0;i<num;i++){
			// URL が画像の拡張子である場合、ポップアップ表示を試みる
			if(url.match(new RegExp("^.*/.+\\." + ext_list[i] + "($|[#?:].*$)","i"))){
				response({result:true});
				return true;
			}
		}

		return false;
	},
	function(info,response){
		var current_element = info.current_element;
		var content_type = info.content_type;

		// コンテンツタイプに "image" が含まれる
		if(content_type.join(",").match(/image/i)){
			response({result:true});
			return true;
		}

		return false;
	},
	function(info,response){
		// ポップアップ表示しない
		response({result:false});
		return true;
	}

			]);

			// -
			// イメージ展開定義「デフォルト」
			// -
			attachItem( "ExpandImage_ThumbnailScriptInsert_Default" , [

	function(info,response){

		// -
		// 第01引数 Object 型
		// current_element:HTMLElement オブジェクト
		// image_element:HTMLImageElement オブジェクト
		// event_dispatcher:EventDispatcher オブジェクト
		// -
		var current_element = info.current_element;
		var image = info.image_element;
		var event_dispatcher = info.event_dispatcher;

		// -
		// 第02引数 function
		// 引数:なし
		// 処理が完了したタイミングで必ず1度実行する必要がある。非同期実行可能。
		// -
		response();

		// -
		// 戻り値 Boolean 型
		// true :関数の実行を完了
		// false:次の関数を実行
		// -
		return true;
	}

			]);

			// -
			// イメージ展開定義「デフォルト」
			// -
			attachItem( "ExpandImage_ThumbnailScriptAllow_Default" , [

	function(info,response){

		// -
		// 第01引数 Object 型
		// current_element:HTMLElement オブジェクト
		// url:String 型(展開先のアドレス)
		// content_type:Array 型(コンテンツタイプ)
		// is_overridden_url:Boolean 型(URL がオーバーライドされているか)
		// -
		var current_element = info.current_element;
		var url = info.url;
		var content_type = info.content_type;

		// -
		// 第02引数 function
		// 引数:Object 型
		// result:Boolean 型(true で許可、false で拒否)
		// 必ず1度実行する必要がある。非同期実行可能。
		// -
		response({result:false});

		// -
		// 戻り値 Boolean 型
		// true :関数の実行を完了
		// false:次の関数を実行
		// -
		return true;
	}

			]);

			// -
			// イメージ展開定義「デフォルト」
			// -
			attachItem( "ExpandImage_PopupScriptAllow_Default" , [

	function(info,response){

		// -
		// 第01引数 Object 型
		// current_element:HTMLElement オブジェクト
		// url:String 型(展開先のアドレス)
		// content_type:Array 型(コンテンツタイプ)
		// is_overridden_url:Boolean 型(URL がオーバーライドされているか)
		// -
		var current_element = info.current_element;
		var url = info.url;
		var content_type = info.content_type;

		// -
		// 第02引数 function
		// 引数:Object 型
		// result:Boolean 型(true で許可、false で拒否)
		// 必ず1度実行する必要がある。非同期実行可能。
		// -
		response({result:false});

		// -
		// 戻り値 Boolean 型
		// true :関数の実行を完了
		// false:次の関数を実行
		// -
		return true;
	}

			]);


			// -
			// サウンド展開定義「インライン表示」
			// -
			attachItem( "ExpandSound_InlineScriptAllow_Inline" , [
	
	function(info,response){
		var anchor_element = info.anchor_element;
		var parent = anchor_element.parentNode;
		if(parent){
			var width = ElementGetClientWidth(parent);

			// 親の幅が小さすぎる場合インライン表示しない
			if(width < 150){
				response({result:false});
				return true;
			}
		}

		return false;
	},
	function(info,response){
		// インライン表示する
		response({result:true});
		return true;
	}

			]);


			// -
			// サウンド展開定義「インライン表示」
			// -
			attachItem( "ExpandSound_InlineScriptInsert_Inline" , [
	
	function(info,response){

		var anchor_element = info.anchor_element;
		var audio = info.element;
		var event_dispatcher = info.event_dispatcher;
		var style = audio.style;
		var width;
		var height;

		// スクロール補正
		var revise_scroll = new DocumentReviseScroll();
		revise_scroll.executeAttachElementBefore(audio);

		// 改行用
		var div_prev = DocumentCreateElement("div");
		var analyze_div_prev = new ElementAnalyzeManager(div_prev,true);
		ElementSetStyle(div_prev,"height:0px;");
		DomNode_InsertAfter(anchor_element,div_prev);

		// オーディオを挿入
		DomNode_InsertAfter(div_prev,audio);

		// 改行用
		var div_next = DocumentCreateElement("div");
		var analyze_div_next = new ElementAnalyzeManager(div_next,true);
		ElementSetStyle(div_next,"height:0px;");
		DomNode_InsertAfter(audio,div_next);

		// サイズを取得
		var bounding_size = ElementGetBoundingClientRect(audio);
		var width  = bounding_size.right  - bounding_size.left;
		var height = bounding_size.bottom  - bounding_size.top;

		// スタイルのサイズを取得
		style.width  = "0px";
		style.height = "0px";
		bounding_size = ElementGetBoundingClientRect(audio);
		var style_w = bounding_size.right  - bounding_size.left;
		var style_h = bounding_size.bottom - bounding_size.top;

		// 親の幅を取得
		var width_max = ElementGetClientWidth(audio.parentNode);

		// エレメントのサイズ
		width  -= style_w;
		height -= style_h;

		// 最大幅補正
		var w = width_max - style_w;
		if(w < width){
			width = w;
		}

		// サイズをセット
		style.width  = width  + "px";
		style.height = height + "px";

		// スクロール補正
		revise_scroll.executeAttachElementAfter(audio);

		// 開放時に実行されるイベント
		var event_handler = event_dispatcher.createEventHandler("release");
		event_handler.setFunction(function (result){
			if(analyze_div_prev){
				analyze_div_prev.release();
				analyze_div_prev = null;
			}
			if(analyze_div_next){
				analyze_div_next.release();
				analyze_div_next = null;
			}
			if(event_handler){
				event_handler.release();
				event_handler = null;
			}
		});

		response();
		return false;
	}

			]);

			// -
			// サウンド展開定義「インライン表示」
			// -
			attachItem( "ExpandSound_AudioElementScriptAllow_Inline" , [
	
	function(info,response){
		var anchor_element = info.anchor_element;
		var url = info.url;

		var ext_list = [
			"mp3",
			"wav",
			"ogg",
			"m4a",
			"aac",
			"midi",
			"mid"
		];

		var i;
		var num = ext_list.length;
		for(i=0;i<num;i++){
			// URL がサウンドの拡張子である場合、インライン表示を試みる
			if(url.match(new RegExp("^.*/.+\\." + ext_list[i] + "($|[#?:].*$)","i"))){
				response({result:true});
				return true;
			}
		}

		return false;
	},
	function(info,response){
		// インライン表示しない
		response({result:false});
		return true;
	}

			]);

			// -
			// サウンド展開定義「インライン表示(アシスト要素のみ)」
			// -
			attachItem( "ExpandSound_InlineScriptAllow_InlineFromAssist" , [
	
	function(info,response){
		var current_element = info.current_element;
		if(!info.is_overridden_url){
			response({result:false});
			return true;
		}

		return false;
	},
	function(info,response){
		var anchor_element = info.anchor_element;
		var parent = anchor_element.parentNode;
		if(parent){
			var width = ElementGetClientWidth(parent);

			// 親の幅が小さすぎる場合インライン表示しない
			if(width < 150){
				response({result:false});
				return true;
			}
		}

		return false;
	},
	function(info,response){
		// インライン表示する
		response({result:true});
		return true;
	}

			]);

			// -
			// サウンド展開定義「デフォルト」
			// -
			attachItem( "ExpandSound_InlineScriptAllow_Default" , [

	function(info,response){

		// -
		// 第01引数 Object 型
		// current_element:HTMLElement オブジェクト
		// url:String 型(展開先のアドレス)
		// content_type:Array 型(コンテンツタイプ)
		// is_overridden_url:Boolean 型(URL がオーバーライドされているか)
		// -
		var current_element = info.current_element;
		var url = info.url;
		var content_type = info.content_type;

		// -
		// 第02引数 function
		// 引数:Object 型
		// result:Boolean 型(true で許可、false で拒否)
		// 必ず1度実行する必要がある。非同期実行可能。
		// -
		response({result:false});

		// -
		// 戻り値 Boolean 型
		// true :関数の実行を完了
		// false:次の関数を実行
		// -
		return true;
	}

			]);


			// -
			// サウンド展開定義「デフォルト」
			// -
			attachItem( "ExpandSound_InlineScriptInsert_Default" , [

	function(info,response){

		// -
		// 第01引数 Object 型
		// current_element:HTMLElement オブジェクト
		// element:HTMLElement オブジェクト(オーディオ)
		// event_dispatcher:EventDispatcher オブジェクト
		// -
		var current_element = info.current_element;
		var audio = info.element;
		var event_dispatcher = info.event_dispatcher;

		// -
		// 第02引数 function
		// 引数:なし
		// 処理が完了したタイミングで必ず1度実行する必要がある。非同期実行可能。
		// -
		response();

		// -
		// 戻り値 Boolean 型
		// true :関数の実行を完了
		// false:次の関数を実行
		// -
		return true;
	}

			]);

			// -
			// サウンド展開定義「デフォルト」
			// -
			attachItem( "ExpandSound_AudioElementScriptAllow_Default" , [

	function(info,response){

		// -
		// 第01引数 Object 型
		// current_element:HTMLElement オブジェクト
		// url:String 型(展開先のアドレス)
		// content_type:Array 型(コンテンツタイプ)
		// -
		var current_element = info.current_element;
		var url = info.url;
		var content_type = info.content_type;

		// -
		// 第02引数 function
		// 引数:Object 型
		// result:Boolean 型(true で許可、false で拒否)
		// 必ず1度実行する必要がある。非同期実行可能。
		// -
		response({result:false});

		// -
		// 戻り値 Boolean 型
		// true :関数の実行を完了
		// false:次の関数を実行
		// -
		return true;
	}

			]);







			// -
			// ビデオ展開定義「インライン表示」
			// -
			attachItem( "ExpandVideo_InlineScriptAllow_Inline" , [
	
	function(info,response){
		var anchor_element = info.anchor_element;
		var parent = anchor_element.parentNode;
		if(parent){
			var width = ElementGetClientWidth(parent);

			// 親の幅が小さすぎる場合インライン表示しない
			if(width < 150){
				response({result:false});
				return true;
			}
		}

		return false;
	},
	function(info,response){
		// インライン表示する
		response({result:true});
		return true;
	}

			]);

			// -
			// ビデオ展開定義「インライン表示」
			// -
			attachItem( "ExpandVideo_InlineScriptInsert_Inline" , [
	
	function(info,response){

		var anchor_element = info.anchor_element;
		var video = info.element;
		var event_dispatcher = info.event_dispatcher;
		var style = video.style;
		var width;
		var height;

		// スクロール補正
		var revise_scroll = new DocumentReviseScroll();
		revise_scroll.executeAttachElementBefore(video);

		// 改行用
		var div_prev = DocumentCreateElement("div");
		var analyze_div_prev = new ElementAnalyzeManager(div_prev,true);
		ElementSetStyle(div_prev,"height:0px;");
		DomNode_InsertAfter(anchor_element,div_prev);

		// ビデオを挿入
		DomNode_InsertAfter(div_prev,video);

		// 改行用
		var div_next = DocumentCreateElement("div");
		var analyze_div_next = new ElementAnalyzeManager(div_next,true);
		ElementSetStyle(div_next,"height:0px;");
		DomNode_InsertAfter(video,div_next);

		// サイズを取得
		var bounding_size = ElementGetBoundingClientRect(video);
		var width  = bounding_size.right  - bounding_size.left;
		var height = bounding_size.bottom  - bounding_size.top;

		// スタイルのサイズを取得
		style.width  = "0px";
		style.height = "0px";
		bounding_size = ElementGetBoundingClientRect(video);
		var style_w = bounding_size.right  - bounding_size.left;
		var style_h = bounding_size.bottom - bounding_size.top;

		// 親の幅を取得
		var width_max = ElementGetClientWidth(video.parentNode);

		// エレメントのサイズ
		width  -= style_w;
		height -= style_h;

		// 最大幅補正
		var w = width_max - style_w;
		if(w < width){
			height *= w / width;
			width = w;
		}

		// サイズをセット
		style.width  = width  + "px";
		style.height = height + "px";

		// スクロール補正
		revise_scroll.executeAttachElementAfter(video);

		// 開放時に実行されるイベント
		var event_handler = event_dispatcher.createEventHandler("release");
		event_handler.setFunction(function (result){
			if(analyze_div_prev){
				analyze_div_prev.release();
				analyze_div_prev = null;
			}
			if(analyze_div_next){
				analyze_div_next.release();
				analyze_div_next = null;
			}
			if(event_handler){
				event_handler.release();
				event_handler = null;
			}
		});

		response();
		return false;
	}

			]);

			// -
			// ビデオ展開定義「インライン表示」
			// -
			attachItem( "ExpandVideo_VideoElementScriptAllow_Inline" , [
	
	function(info,response){
		var anchor_element = info.anchor_element;
		var url = info.url;

		var ext_list = [
			"mp4",
			"webm",
			"avi",
			"m4v",
			"ogv",
			"mpg",
			"mpeg"
		];

		var i;
		var num = ext_list.length;
		for(i=0;i<num;i++){
			// URL が動画の拡張子である場合、インライン表示を試みる
			if(url.match(new RegExp("^.*/.+\\." + ext_list[i] + "($|[#?:].*$)","i"))){
				response({result:true});
				return true;
			}
		}

		return false;
	},
	function(info,response){
		// インライン表示しない
		response({result:false});
		return true;
	}

			]);

			// -
			// ビデオ展開定義「インライン表示(アシスト要素のみ)」
			// -
			attachItem( "ExpandVideo_InlineScriptAllow_InlineFromAssist" , [
	
	function(info,response){
		var current_element = info.current_element;
		if(!info.is_overridden_url){
			response({result:false});
			return true;
		}

		return false;
	},
	function(info,response){
		var anchor_element = info.anchor_element;
		var parent = anchor_element.parentNode;
		if(parent){
			var width = ElementGetClientWidth(parent);

			// 親の幅が小さすぎる場合インライン表示しない
			if(width < 150){
				response({result:false});
				return true;
			}
		}

		return false;
	},
	function(info,response){
		// インライン表示する
		response({result:true});
		return true;
	}

			]);

			// -
			// ビデオ展開定義「デフォルト」
			// -
			attachItem( "ExpandVideo_InlineScriptAllow_Default" , [

	function(info,response){

		// -
		// 第01引数 Object 型
		// current_element:HTMLElement オブジェクト
		// url:String 型(展開先のアドレス)
		// content_type:Array 型(コンテンツタイプ)
		// is_overridden_url:Boolean 型(URL がオーバーライドされているか)
		// -
		var current_element = info.current_element;
		var url = info.url;
		var content_type = info.content_type;

		// -
		// 第02引数 function
		// 引数:Object 型
		// result:Boolean 型(true で許可、false で拒否)
		// 必ず1度実行する必要がある。非同期実行可能。
		// -
		response({result:false});

		// -
		// 戻り値 Boolean 型
		// true :関数の実行を完了
		// false:次の関数を実行
		// -
		return true;
	}

			]);

			// -
			// ビデオ展開定義「デフォルト」
			// -
			attachItem( "ExpandVideo_InlineScriptInsert_Default" , [

	function(info,response){

		// -
		// 第01引数 Object 型
		// current_element:HTMLElement オブジェクト
		// element:HTMLElement オブジェクト(ビデオ)
		// event_dispatcher:EventDispatcher オブジェクト
		// -
		var current_element = info.current_element;
		var video = info.element;
		var event_dispatcher = info.event_dispatcher;

		// -
		// 第02引数 function
		// 引数:なし
		// 処理が完了したタイミングで必ず1度実行する必要がある。非同期実行可能。
		// -
		response();

		// -
		// 戻り値 Boolean 型
		// true :関数の実行を完了
		// false:次の関数を実行
		// -
		return true;
	}

			]);

			// -
			// ビデオ展開定義「デフォルト」
			// -
			attachItem( "ExpandVideo_VideoElementScriptAllow_Default" , [

	function(info,response){

		// -
		// 第01引数 Object 型
		// current_element:HTMLElement オブジェクト
		// url:String 型(展開先のアドレス)
		// content_type:Array 型(コンテンツタイプ)
		// -
		var current_element = info.current_element;
		var url = info.url;
		var content_type = info.content_type;

		// -
		// 第02引数 function
		// 引数:Object 型
		// result:Boolean 型(true で許可、false で拒否)
		// 必ず1度実行する必要がある。非同期実行可能。
		// -
		response({result:false});

		// -
		// 戻り値 Boolean 型
		// true :関数の実行を完了
		// false:次の関数を実行
		// -
		return true;
	}

			]);


			// -
			// インラインフレーム展開定義「PDF のインライン表示」
			// -
			attachItem( "ExpandIframe_InlineScriptAllow_ExpandPdfInline" , [
	
	function(info,response){
		var anchor_element = info.anchor_element;
		var parent = anchor_element.parentNode;
		if(parent){
			var width = ElementGetClientWidth(parent);

			// 親の幅が小さすぎる場合インライン表示しない
			if(width < 50){
				response({result:false});
				return true;
			}
		}

		return false;
	},
	function(info,response){
		var anchor_element = info.anchor_element;
		var url = info.url;

		var ext_list = [
			"pdf"
		];

		var i;
		var num = ext_list.length;
		for(i=0;i<num;i++){
			// PDF の拡張子である場合、インライン表示を試みる
			if(url.match(new RegExp("^.*/.+\\." + ext_list[i] + "($|[#?:].*$)","i"))){
				response({result:true});
				return true;
			}
		}

		return false;
	},
	function(info,response){
		// インライン表示しない
		response({result:false});
		return true;
	}

			]);

			// -
			// インラインフレーム展開定義「PDF のインライン表示」
			// -
			attachItem( "ExpandIframe_InlineScriptInsert_ExpandPdfInline" , [
	
	function(info,response){

		var anchor_element = info.anchor_element;
		var iframe = info.iframe_element;
		var event_dispatcher = info.event_dispatcher;

		// ピクセル値によるサイズ指定
		var width  = 597;
		var height = 844;

		// スクロール補正
		var revise_scroll = new DocumentReviseScroll();
		revise_scroll.executeAttachElementBefore(iframe);

		// 改行を作成
		var div_prev = DocumentCreateElement("div");
		var analyze_div_prev = new ElementAnalyzeManager(div_prev,true);
		ElementSetStyle(div_prev,"height:0px;");
		DomNode_InsertAfter(anchor_element,div_prev);

		// iframe を挿入
		DomNode_InsertAfter(div_prev,iframe);

		// 改行を作成
		var div_next = DocumentCreateElement("div");
		var analyze_div_next = new ElementAnalyzeManager(div_next,true);
		ElementSetStyle(div_next,"height:0px");
		DomNode_InsertAfter(iframe,div_next);

		// スタイルのサイズを取得
		iframe.style.width  = "0px";
		iframe.style.height = "0px";
		var bounding_size = ElementGetBoundingClientRect(iframe);
		var style_w = bounding_size.right  - bounding_size.left;
		var style_h = bounding_size.bottom - bounding_size.top;

		// 親の幅を取得
		var width_max = ElementGetClientWidth(iframe.parentNode);

		// エレメントのサイズ
		width  -= style_w;
		height -= style_h;

		// 最大幅補正
		var w = width_max - style_w;
		if(w < width){
			width = w;
		}

		// サイズをセット
		iframe.style.width  = width  + "px";
		iframe.style.height = height + "px";

		// スクロール補正
		revise_scroll.executeAttachElementAfter(iframe);

		// 開放時に実行されるイベント
		var event_handler = event_dispatcher.createEventHandler("release");
		event_handler.setFunction(function (result){
			if(analyze_div_prev){
				analyze_div_prev.release();
				analyze_div_prev = null;
			}
			if(analyze_div_next){
				analyze_div_next.release();
				analyze_div_next = null;
			}
			if(event_handler){
				event_handler.release();
				event_handler = null;
			}
		});

		response();
		return false;
	}

			]);

			// -
			// インラインフレーム展開定義「Flash のインライン表示」
			// -
			attachItem( "ExpandIframe_InlineScriptAllow_ExpandFlashInline" , [
	
	function(info,response){
		var anchor_element = info.anchor_element;
		var parent = anchor_element.parentNode;
		if(parent){
			var width = ElementGetClientWidth(parent);

			// 親の幅が小さすぎる場合インライン表示しない
			if(width < 50){
				response({result:false});
				return true;
			}
		}

		return false;
	},
	function(info,response){
		var anchor_element = info.anchor_element;
		var url = info.url;

		var ext_list = [
			"swf"
		];

		var i;
		var num = ext_list.length;
		for(i=0;i<num;i++){
			// Flash の拡張子である場合、インライン表示を試みる
			if(url.match(new RegExp("^.*/.+\\." + ext_list[i] + "($|[#?:].*$)","i"))){
				response({result:true});
				return true;
			}
		}

		return false;
	},
	function(info,response){
		// インライン表示しない
		response({result:false});
		return true;
	}

			]);

			// -
			// インラインフレーム展開定義「Flash のインライン表示」
			// -
			attachItem( "ExpandIframe_InlineScriptInsert_ExpandFlashInline" , [
	
	function(info,response){

		var anchor_element = info.anchor_element;
		var iframe = info.iframe_element;
		var event_dispatcher = info.event_dispatcher;

		// ピクセル値によるサイズ指定
		var width  = 640;
		var height = 480;

		// スクロール補正
		var revise_scroll = new DocumentReviseScroll();
		revise_scroll.executeAttachElementBefore(iframe);

		// div_dummy を作成
		var div_dummy = DocumentCreateElement("div");
		var analyze_div_dummy = new ElementAnalyzeManager(div_dummy,true);
		ElementSetStyle(div_dummy,ElementGetStyle(iframe));
		DomNode_InsertAfter(anchor_element,div_dummy);

		// 改行を作成
		var div_prev = DocumentCreateElement("div");
		var analyze_div_prev = new ElementAnalyzeManager(div_prev,true);
		ElementSetStyle(div_prev,"height:0px;");
		DomNode_InsertAfter(anchor_element,div_prev);

		// div を挿入
		DomNode_InsertAfter(div_prev,div_dummy);

		// 改行を作成
		var div_next = DocumentCreateElement("div");
		var analyze_div_next = new ElementAnalyzeManager(div_next,true);
		ElementSetStyle(div_next,"height:0px");
		DomNode_InsertAfter(div_dummy,div_next);

		// スタイルのサイズを取得
		div_dummy.style.width  = "0px";
		div_dummy.style.height = "0px";
		var bounding_size = ElementGetBoundingClientRect(div_dummy);
		var style_w = bounding_size.right  - bounding_size.left;
		var style_h = bounding_size.bottom - bounding_size.top;

		// 親の幅を取得
		var width_max = ElementGetClientWidth(div_dummy.parentNode);

		// エレメントのサイズ
		width  -= style_w;
		height -= style_h;

		// 最大幅補正
		var w = width_max - style_w;
		if(w < width){
			height *= w / width;
			width = w;
		}

		// サイズをセット
		div_dummy.style.width  = width  + "px";
		div_dummy.style.height = height + "px";
		iframe.style.width  = width  + "px";
		iframe.style.height = height + "px";

		// スクロール補正
		revise_scroll.executeAttachElementAfter(iframe);

		// クリック時に実行されるイベント
		function click_func(e){
			// iframe を挿入
			DomNode_InsertAfter(div_dummy,iframe);
			// div_dummy を解放
			if(analyze_div_dummy){
				analyze_div_dummy.release();
				analyze_div_dummy = null;
			}
		}
		if(div_dummy.addEventListener){
			div_dummy.addEventListener("click",click_func,true);
		}else if(div_dummy.attachEvent){
			div_dummy.attachEvent("onclick",click_func);
		}

		// 開放時に実行されるイベント
		var event_handler = event_dispatcher.createEventHandler("release");
		event_handler.setFunction(function (result){
			if(analyze_div_dummy){
				analyze_div_dummy.release();
				analyze_div_dummy = null;
			}
			if(analyze_div_prev){
				analyze_div_prev.release();
				analyze_div_prev = null;
			}
			if(analyze_div_next){
				analyze_div_next.release();
				analyze_div_next = null;
			}
			if(event_handler){
				event_handler.release();
				event_handler = null;
			}
		});

		response();
		return false;
	}

			]);

			// -
			// インラインフレーム展開定義「デフォルト」
			// -
			attachItem( "ExpandIframe_InlineScriptAllow_Default" , [

	function(info,response){

		// -
		// 第01引数 Object 型
		// current_element:HTMLElement オブジェクト
		// url:String 型(展開先のアドレス)
		// content_type:Array 型(コンテンツタイプ)
		// -
		var current_element = info.current_element;
		var url = info.url;
		var content_type = info.content_type;

		// -
		// 第02引数 function
		// 引数:Object 型
		// result:Boolean 型(true で許可、false で拒否)
		// 必ず1度実行する必要がある。非同期実行可能。
		// -
		response({result:false});

		// -
		// 戻り値 Boolean 型
		// true :関数の実行を完了
		// false:次の関数を実行
		// -
		return true;
	}

			]);

			// -
			// インラインフレーム展開定義「デフォルト」
			// -
			attachItem( "ExpandIframe_InlineScriptInsert_Default" , [

	function(info,response){

		// -
		// 第01引数 Object 型
		// current_element:HTMLElement オブジェクト
		// iframe_element:HTMLIFrameElement オブジェクト
		// event_dispatcher:EventDispatcher オブジェクト
		// -
		var current_element = info.current_element;
		var iframe = info.iframe_element;
		var event_dispatcher = info.event_dispatcher;

		// -
		// 第02引数 function
		// 引数:なし
		// 処理が完了したタイミングで必ず1度実行する必要がある。非同期実行可能。
		// -
		response();

		// -
		// 戻り値 Boolean 型
		// true :関数の実行を完了
		// false:次の関数を実行
		// -
		return true;
	}

			]);


			// -
			// 掲示板設定「初期化」
			// -
			attachItem( "ExpandBbs_ScriptInitialize" , [
	
	function(info,response){
		var work = info.work;

		response({result:true});
		return true;
	}

			]);

			// -
			// 掲示板設定「ニコニコ大百科」
			// -
			attachItem( "ExpandBbs_ScriptInitialize_NicovideoDictionary" , [
	
	function(info,response){
		var work = info.work;

		// -
		// 基本URL抽出
		// -
		var url = document.URL;
		var bbs_list = [
			{url:"(http://dic\\.nicovideo\\.jp/b/(a|c|i|l|u|v)/[^/#?]+)",replace:"$1/",name:"nicopedia"},
			{url:"(http://dic\\.nicovideo\\.jp)/(a|c|i|l|u|v)/([^/#?]+)",replace:"$1/b/$2/$3/",name:"nicopedia"}
		];

		var i;
		var num = bbs_list.length;
		for(i=0;i<num;i++){
			var bbs = bbs_list[i];
			var re = new RegExp(bbs.url,"i");
			var m = url.match(re);
			if(m){
				work.base_url = m[0].replace(re,bbs.replace);
				work.bbs_name = bbs.name;
				break;
			}
		}

		return false;
	},
	function (info,response){
		var work = info.work;
		if(!(work.bbs_name)){
			return false;
		}

		var load_separate = 1000;
		var load_dose = 30;
		var load_offset = 1;
		var first_id = 1;
		var last_id = 1;
		var load_shadow_id = 1;
		var load_more_id = 1;
		var dictionary_id = new Array();
		var element_parent = null;
		var read_more_button = null;
		var element_form = null;
		var base_url = work.base_url;
		var resource_url_shadow = base_url;
		var resource_url_more = base_url;

		// -
		// 文字列からレスポンス番号を取得
		// -
		work.createResponseAnchorNumbers = function (str){
			var numbers = new ResponseAnchorNumbers();

			var re_search = new RegExp("^(>>|<<|>>|<<|>|>|》|≫|&gt;&gt;)([0-90-9]+)","i");
			var re_range = new RegExp("^([0-90-9]+)[-]([0-90-9]+)","i");
			var re_number = new RegExp("^([0-90-9]+)","i");

			var m = str.match(re_search);
			if(m){
				var p = m[1].length;
				while(true){
					// 番号-番号
					m = str.substr(p).match(re_range);
					if(m){
						var min = parseInt(StringConvertFromNumericFullToNumericHalf(m[1]));
						var max = parseInt(StringConvertFromNumericFullToNumericHalf(m[2]));
						if(min < 1) min = 1;
						if(max < 1) max = 1;
						if(min > 0x7fffffff) min = 0x7fffffff;
						if(max > 0x7fffffff) max = 0x7fffffff;
						if(max < min){
							var tmp = min;
							min = max;
							max = tmp;
						}
						if(max - min > 10000) max = min + 10000;
						p += m[0].length;
						numbers.addNumbers(min,max);
					}else{
						// 番号
						m = str.substr(p).match(re_number);
						if(m){
							p += m[0].length;
							var id = parseInt(StringConvertFromNumericFullToNumericHalf(m[1]));
							if(id < 1) id = 1;
							if(id > 0x7fffffff) id = 0x7fffffff;
							numbers.addNumber(id);
						}
					}

					if(m){
						// カンマ
						if(RegExp.rightContext.search(",") == 0){
							p += 1;
							continue;
						}
					}
					break;
				}
			}
			return numbers;
		};

		// -
		// レスアンカー拡張
		// -
		work.extendResponseAnchor = function (target){
			if(BbsControlResponseAnchorExist(target))	return;

			var re_simple = new RegExp("^(>>|<<|>)[-,0-90-9]+$","i");
			var re_detail = new RegExp("(>>|<<|>>|<<|>|>|》|≫|&gt;&gt;)(([0-90-9]+[-][0-90-9]+|[0-90-9]+),)*([0-90-9]+[-][0-90-9]+|[0-90-9]+)","i");
			var re_range = new RegExp("([0-90-9]+)[-]([0-90-9]+)","i");
			var re_number = new RegExp("([0-90-9]+)","i");

			var i;
			var nodes = ElementGetElementsByTagName(target,"a");
			var num = nodes.length;
			for(i=num-1;i>=0;i--){
				var node = nodes[i];
				var m = ElementGetTextContent(node).match(re_simple);
				if(m){
					var text_node = DocumentCreateText(m[0]);
					DomNode_InsertBefore(node,text_node);
					DomNodeRemove(node);
				}
			}

			// テキストノードを統合
			target.normalize();

			var p;
			var n;
			var q;
			var ignore_dictionary = {"A":1,"SCRIPT":1};
			var queue = new Object();
			q = {p:queue,n:queue,node:target};
			queue.p = q;
			queue.n = q;

			while(queue.n != queue){
				q = queue.n;
				p = q.p;
				n = q.n;
				p.n = n;
				n.p = p;
				var node = q.node;
				switch(node.nodeType){
				case 1:
					var i;
					var nodes = node.childNodes;
					var num = nodes.length;
					for(i=0;i<num;i++){
						n = queue;
						p = n.p;
						q = {p:p,n:n,node:nodes[i]};
						p.n = q;
						n.p = q;
					}
					break;
				case 3:
					while(node){
						var m = DomNodeGetNodeValue(node).match(re_detail);
						if(!m)	break;

						// 元のテキストノード
						DomNodeSetNodeValue(node,RegExp.leftContext);

						// BbsControlName を生成
						var element = DocumentCreateElement("a");
						ElementSetTextContent(element,m[0]);
						DomNode_InsertAfter(node,element);

						// 直後テキスト
						node = DocumentCreateText(RegExp.rightContext);
						DomNode_InsertAfter(element,node);

						var query = "";
						m = ElementGetTextContent(element).match(re_range);
						if(m){
							var min = parseInt(StringConvertFromNumericFullToNumericHalf(m[1]));
							var max = parseInt(StringConvertFromNumericFullToNumericHalf(m[2]));
							if(min < 1) min = 1;
							if(max < 1) max = 1;
							if(min > 0x7fffffff) min = 0x7fffffff;
							if(max > 0x7fffffff) max = 0x7fffffff;
							if(max < min){
								var tmp = min;
								min = max;
								max = tmp;
							}
							query = min;
						}else{
							// 番号
							m = ElementGetTextContent(element).match(re_number);
							if(m){
								query = parseInt(StringConvertFromNumericFullToNumericHalf(m[0]));
								if(query < 1) query = 1;
								if(query > 0x7fffffff) query = 0x7fffffff;
							}

						}
						element.href = work.base_url + (Math.floor(query / 30) * 30 + 1) + "-#" + query;
					}
				}
			}
		};

		// -
		// 継ぎ足し読み込み
		// -
		function readMore(callback){
			var add_count = 0;

			var load = function (){

				// ローダーオブジェクトを作成
				var loader = new Loader();

				// 成功
				loader.onload = function(str){
					var re_number = new RegExp("<a name=\"([0-9]+)\"","i");

					var p = 0;
					var n = str.length;
					function f(){
						try{
							if(p >= n) throw 0;
							p = str.indexOf("<dt class=\"reshead\">",p);
							if(p < 0) throw 0;
							var e = str.indexOf("</dd>",p);
							if(e >= 0) e += 5;
							var s = str.substring(p,e);
							var m = s.match(re_number);
							if(m){
								var id = parseInt(m[1]);
								if(last_id < id){
									var response = bbs_dictionary.getResponse(id);
									response.clearAnalyzed();
									response.clearOriginalElements();
									response.clearFollowing();

									var nodes = StringHtmlCreateDomNodesSafe(s);
									var j;
									var node_num = nodes.length;
									for(j=0;j<node_num;j++){
										element_parent.appendChild(nodes[j]);
									}
									last_id = id;
									add_count += 1;
									resource_url_more = base_url + (last_id) + "-";
								}
							}

							if(p < e){
								p = e;
								execute_queue.attachFirst(f,null);
								return;
							}
						}catch(e){
						}

						var reload = false;
						(function(){
							if(((last_id + 1) % load_dose) != load_offset){
								return;
							}
							var p = Math.floor(load_more_id / load_dose);
							var n = Math.floor(last_id / load_dose);
							if(p >= n){
								return;
							}
							var p = Math.floor(load_more_id / load_separate);
							var n = Math.floor(last_id / load_separate);
							if(p < n){
								return;
							}

							reload = true;
						})();

						var next_id = Math.floor(last_id / load_dose) * load_dose + load_offset;
						resource_url_more = base_url + next_id + "-";

						if(reload){
							load();
						}else{
							callback({result:true,add_count:add_count});
						}
					}

					load_more_id = last_id;
					execute_queue.attachFirst(f,null);
				};

				// 失敗
				loader.onerror = function(){
					callback({result:false});
				};

				// テキストの読み込み
				loader.setMethod("GET");
				loader.setURL(resource_url_more);
				loader.loadText();
			};
			load();
		}

		// -
		// レスポンス親要素
		// -
		(function(){
			var element_bbs = document.getElementById("bbs");
			if(element_bbs){
				var i;
				var nodes = ElementGetElementsByTagName(element_bbs,"dl");
				var num = nodes.length;
				for(i=0;i<num;i++){
					element_parent = nodes[i];
					break;
				}
			}
		})();
		if(!element_parent) return false;

		// -
		// 最後尾 ID
		// -
		var nodes = ElementGetElementsByTagName(element_parent,"dt");
		var i;
		var node_num = nodes.length;
		for(i=0;i<node_num;i++){
			var node = nodes[i];
			var m = ElementGetTextContent(node).match(new RegExp("([0-9]+)[ ]","i"));
			if(m){
				first_id = parseInt(m[1]);
				dictionary_id[first_id] = true;
				if(first_id != 1){
					break;
				}
			}
		}
		for(i=node_num-1;i>=0;i--){
			var node = nodes[i];
			var m = ElementGetTextContent(node).match(new RegExp("([0-9]+)[ ]","i"));
			if(m){
				last_id = parseInt(m[1]);
				dictionary_id[last_id] = true;
				break;
			}
		}

		// -
		// アクセス先 URL
		// -
		var next_id = Math.floor(last_id / load_dose) * load_dose + load_offset;
		resource_url_shadow = base_url + "1-";
		resource_url_more = base_url + next_id + "-";

		// -
		// BbsControlReadMoreButton 作成
		// -
		read_more_button = new BbsControlReadMoreButton();
		read_more_button.setWaitTime(2 * 1000);
		read_more_button.onclick = readMore;
		DomNode_InsertAfter(element_parent,read_more_button.getElement());

		// -
		// シャドウロード
		// -
		function loadShadow(){
			var load_shadow_last_id = load_shadow_id;
			
			// ローダーオブジェクトを作成
			var loader = new Loader();

			// 成功
			loader.onload = function(str){
				var re_number = new RegExp("<a name=\"([0-9]+)\"","i");
				var re_id = new RegExp("ID:[ ]([a-zA-Z0-9+/.]{8,10})","i");
				var re_name = new RegExp("(◆[a-zA-Z0-9+/.]{10,12})","i");

				var p = 0;
				var n = str.length;
				function f(){
					try{
						if(p >= n) throw 0;
						p = str.indexOf("<dt class=\"reshead\">",p);
						if(p < 0) throw 0;
						var e = str.indexOf("</dd>",p);
						if(e >= 0) e += 5;
						var s = str.substring(p,e);
						var m = s.match(re_number);
						if(m){
							var id = load_shadow_last_id = parseInt(m[1]);
							if((first_id <= id) && (id <= last_id)){
							}else if(dictionary_id[id]){
							}else{
								// ナンバーからレスポンスオブジェクトを取得
								var response = bbs_dictionary.getResponse(id);
								if(!(response.getAnalyzed())){
									var nodes = StringHtmlCreateDomNodesSafe(s);
									var dt = nodes[0];
									var dd = nodes[2];

									try{
										if(dt.tagName != "DT")	throw 0;
										if(dd.tagName != "DD")	throw 0;
									}catch(e){
										throw 0;
									}

									var dt_text = ElementGetTextContent(dt);

									// レスアンカー拡張
									work.extendResponseAnchor(dd);

									// IDの取得
									if(dt_text.match(re_id)){
										response.setId(RegExp.$1);
									}

									// 名前の取得
									if(dt_text.match(re_name)){
										response.setName(RegExp.$1);
									}

									// フォロー解析
									var dictionary = new Object();
									(function(){
										var nodes = ElementGetElementsByTagName(dd,"a");
										var i;
										var num = nodes.length;
										for(i=0;i<num;i++){
											var numbers = work.createResponseAnchorNumbers(ElementGetTextContent(nodes[i]));
											numbers.getNumbers(function(n){
												if(!dictionary[n]){
													var following = bbs_dictionary.getResponse(n);
													following.addFollower(response);
													dictionary[n] = true;
												}
											});
										}
									})();

									// オリジナルエレメントをセット
									if(dt)	response.addOriginalElements("dt",dt);
									if(dd)	response.addOriginalElements("dd",dd);

									// 消去時に実行されるイベント
									response.onerase = function(){};

									response.setAnalyzed();
								}
							}
						}

						if(p < e){
							p = e;
							execute_queue.attachFirst(f,null);
							return;
						}
					}catch(e){
					}

					var reload = false;
					(function(){
						if(((load_shadow_last_id + 1) % load_dose) != load_offset){
							return;
						}
						var p = Math.floor(load_shadow_id / load_dose);
						var n = Math.floor(load_shadow_last_id / load_dose);
						if(p >= n){
							return;
						}
						if(load_shadow_last_id > first_id){
							return;
						}

						reload = true;
					})();

					var next_id = Math.floor(load_shadow_last_id / load_dose) * load_dose + load_offset;
					resource_url_shadow = base_url + next_id + "-";

					if(reload){
						load_shadow_id = load_shadow_last_id;
						loadShadow();
					}
				}
				execute_queue.attachFirst(f,null);
			};

			// 失敗
			loader.onerror = function(){
			};

			// テキストの読み込み
			loader.setMethod("GET");
			loader.setURL(resource_url_shadow);
			loader.loadText();
		}
		loadShadow();

		response({result:true});
		return true;
	},
	function (info,response){
		response({result:false});
		return true;
	}

			]);

			// -
			// 掲示板設定「ニコニコ大百科」
			// -
			attachItem( "ExpandBbs_ScriptCallback_NicovideoDictionary" , [
	
	function(info,response){
		var element = info.element;
		var work = info.work;

		// -
		// レスポンスダイアログを登録
		// -
		function attachBbsResponseDialog(response,node,parent_dialog,type){

			// -
			// レスアンカー
			// -
			function forResponseAnchor(target){
				if(BbsControlResponseAnchorExist(target))	return;

				// -
				// BbsControlResponseAnchor を生成
				// -
				(function(){
					var i;
					var nodes = ElementGetElementsByTagName(target,"a");
					var num = nodes.length;
					for(i=0;i<num;i++){
						var node = nodes[i];
						var numbers = work.createResponseAnchorNumbers(ElementGetTextContent(node));
						if(numbers.getCount()){
							var control_res_anchor = new BbsControlResponseAnchor(node,false);
							control_res_anchor.setResponseAnchorNumbers(numbers);
						}
					}
				})();

				// -
				// BbsControlResponseAnchor を検索
				// -
				BbsControlResponseAnchorSearch(target,function(control_res_anchor){

					var element_res_anchor = control_res_anchor.getElement();
					var numbers = control_res_anchor.getResponseAnchorNumbers();

					// ダイアログを作成
					var response_dialog = new BbsResponseDialog();
					if(parent_dialog)	parent_dialog.attachChild(response_dialog);
					response_dialog.setElementParent(node.parent);
					response_dialog.setElementHitArea(element_res_anchor);
					response_dialog.oncreate = function(_window,callback){

						var dl = DocumentCreateElement("dl");
						dl.style.margin = "0px";
						_window.appendChild(dl);

						var created = false;
						var i = 0;
						var number_list = numbers.getNumberList();
						var num = number_list.length;
						if(!num) return false;

						function f(){
							var following = bbs_dictionary.getResponse(number_list[i]);
							var clone = following.getCloneElements();

							var j;
							var clone_num = clone.length;
							if(clone_num){
								var param = new Object();
								param.parent = node.parent;
								for(j=0;j<clone_num;j++){
									var obj = clone[j];
									param[obj.name] = obj.element;
									dl.appendChild(obj.element);
								}

								// レスポンスダイアログを登録
								attachBbsResponseDialog(following,param,response_dialog,"response");

								created = true;
							}

							i += 1;
							if(i < num){
								execute_queue.attachFirst(f,null);
							}else{
								callback({result:created});
							}
						}
						execute_queue.attachFirst(f,null);
					};

					return null;
				});
			}

			// -
			// ID
			// -
			function forId(target){
				if(BbsControlIdExist(target))	return;

				// -
				// BbsControlId を生成
				// -
				(function(){
					var p;
					var n;
					var q;
					var ignore_dictionary = {"A":1,"SCRIPT":1};
					var queue = new Object();
					q = {p:queue,n:queue,node:target};
					queue.p = q;
					queue.n = q;

					while(queue.n != queue){
						q = queue.n;
						p = q.p;
						n = q.n;
						p.n = n;
						n.p = p;
						var node = q.node;
						switch(node.nodeType){
						case 1:
							if(!(ignore_dictionary[node.tagName])){
								var i;
								var nodes = node.childNodes;
								var num = nodes.length;
								for(i=0;i<num;i++){
									n = queue;
									p = n.p;
									q = {p:p,n:n,node:nodes[i]};
									p.n = q;
									n.p = q;
								}
							}

							break;
						case 3:
							while(node){

								var m = DomNodeGetNodeValue(node).match(new RegExp("ID:[ ]([a-zA-Z0-9+/.]{8,10})","i"));
								if(!m)	break;

								// 元のテキストノード
								DomNodeSetNodeValue(node,RegExp.leftContext);

								// BbsControlId を生成
								var control_id = new BbsControlId(null,false);
								control_id.setId(m[1]);
								var element_id = control_id.getElement();
								ElementSetTextContent(element_id,m[0]);
								DomNode_InsertAfter(node,element_id);

								// 直後テキスト
								node = DocumentCreateText(RegExp.rightContext);
								DomNode_InsertAfter(element_id,node);
							}
							break;
						}
					}
				})();

				// -
				// BbsControlId を検索
				// -
				BbsControlIdSearch(target,function(control_id){

					control_id.setResponse(response);

					var id = control_id.getId();
					var myself = (response.getId() === id);
					var element_id = control_id.getElement();
					var textnode_id = DocumentCreateText("");

					element_id.appendChild(textnode_id);

					// -
					// 変化があったときに実行されるイベント
					// -
					control_id.onchange = function(count){
						if(count > 1){
							DomNodeSetNodeValue(textnode_id,"(" + count + ")");
						}else{
							DomNodeSetNodeValue(textnode_id,"");
						}

						var style = element_id.style;
						if(count >= 5){
							StyleDeclarationSetProperty(style,"color","#e80000");
							StyleDeclarationRemoveProperty(style,"font-size");
						}else if(count >= 2){
							StyleDeclarationRemoveProperty(style,"color");
							StyleDeclarationRemoveProperty(style,"font-size");
						}else{
							StyleDeclarationSetProperty(style,"color","#888");
							StyleDeclarationSetProperty(style,"font-size","small");
						}
					};
					control_id.update();

					// -
					// ポップアップ化
					// -
					if(type == "id"){
						if(myself) return null;
					}

					// ダイアログを作成
					var response_dialog = new BbsResponseDialog();
					if(parent_dialog)	parent_dialog.attachChild(response_dialog);
					response_dialog.setElementParent(node.parent);
					response_dialog.setElementHitArea(element_id);
					response_dialog.oncreate = function(_window,callback){

						var dl = DocumentCreateElement("dl");
						dl.style.margin = "0px";
						_window.appendChild(dl);

						var responses = bbs_dictionary.getResponsesFromId(id);
						var i = 0;
						var num = responses.length;
						if(myself){
							if(num < 2) return false;
						}else{
							if(num < 1) return false;
						}

						function f(){
							var response_id = responses[i];
							var clone = response_id.getCloneElements();

							var j;
							var clone_num = clone.length;
							if(clone_num){

								var param = new Object();
								param.parent = node.parent;
								for(j=0;j<clone_num;j++){
									var obj = clone[j];
									param[obj.name] = obj.element;
									dl.appendChild(obj.element);
								}

								// レスポンスダイアログを登録
								attachBbsResponseDialog(response_id,param,response_dialog,"id");
							}

							i += 1;
							if(i < num){
								execute_queue.attachFirst(f,null);
							}else{
								callback({result:true});
							}
						}
						execute_queue.attachFirst(f,null);
					};

					return null;
				});
			}

			// -
			// トリップ
			// -
			function forName(target){
				if(BbsControlNameExist(target))	return;

				// -
				// BbsControlName を生成
				// -
				(function(){
					var p;
					var n;
					var q;
					var ignore_dictionary = {"SCRIPT":1};
					var queue = new Object();
					q = {p:queue,n:queue,node:target};
					queue.p = q;
					queue.n = q;

					while(queue.n != queue){
						q = queue.n;
						p = q.p;
						n = q.n;
						p.n = n;
						n.p = p;
						var node = q.node;
						switch(node.nodeType){
						case 1:
							if(!(ignore_dictionary[node.tagName])){
								var i;
								var nodes = node.childNodes;
								var num = nodes.length;
								for(i=0;i<num;i++){
									n = queue;
									p = n.p;
									q = {p:p,n:n,node:nodes[i]};
									p.n = q;
									n.p = q;
								}
							}
							break;
						case 3:
							while(node){

								// 本文
								var m = DomNodeGetNodeValue(node).match(new RegExp("(◆[a-zA-Z0-9+/.]{10,12})","i"));
								if(!m)	break;

								// 元のテキストノード
								DomNodeSetNodeValue(node,RegExp.leftContext);

								// BbsControlName を生成
								var control_name = new BbsControlName(null,false);
								control_name.setName(m[0]);
								var element_name = control_name.getElement();
								ElementSetTextContent(element_name,m[0]);
								DomNode_InsertAfter(node,element_name);

								// 直後テキスト
								node = DocumentCreateText(RegExp.rightContext);
								DomNode_InsertAfter(element_name,node);
							}
							break;
						}
					}
				})();

				// -
				// BbsControlName を検索
				// -
				BbsControlNameSearch(target,function(control_name){

					control_name.setResponse(response);

					var name = control_name.getName();
					var myself = (response.getName() === name);
					var element_name = control_name.getElement();
					var textnode_name = DocumentCreateText("");


					// -
					// 変化があったときに実行されるイベント
					// -
					control_name.onchange = function(count){
						if(count > 1){
							DomNodeSetNodeValue(textnode_name,"(" + count + ")");
						}else{
							DomNodeSetNodeValue(textnode_name,"");
						}

						var style = element_name.style;
						if(count >= 5){
							StyleDeclarationSetProperty(style,"color","#e80000");
							StyleDeclarationRemoveProperty(style,"font-size");
						}else if(count >= 2){
							StyleDeclarationRemoveProperty(style,"color");
							StyleDeclarationRemoveProperty(style,"font-size");
						}else{
							StyleDeclarationSetProperty(style,"color","#888");
							StyleDeclarationSetProperty(style,"font-size","small");
						}
					};
					control_name.update();
					element_name.appendChild(textnode_name);

					// -
					// ポップアップ化
					// -
					if(type == "name"){
						if(myself) return null;
					}

					// ダイアログを作成
					var response_dialog = new BbsResponseDialog();
					if(parent_dialog)	parent_dialog.attachChild(response_dialog);
					response_dialog.setElementParent(node.parent);
					response_dialog.setElementHitArea(element_name);
					response_dialog.oncreate = function(_window,callback){

						var dl = DocumentCreateElement("dl");
						dl.style.margin = "0px";
						_window.appendChild(dl);

						var responses = bbs_dictionary.getResponsesFromName(name);
						var i = 0;
						var num = responses.length;
						if(myself){
							if(num < 2) return false;
						}else{
							if(num < 1) return false;
						}

						function f(){
							var response_name = responses[i];
							var clone = response_name.getCloneElements();

							var j;
							var clone_num = clone.length;
							if(clone_num){

								var param = new Object();
								param.parent = node.parent;
								for(j=0;j<clone_num;j++){
									var obj = clone[j];
									param[obj.name] = obj.element;
									dl.appendChild(obj.element);
								}

								// レスポンスダイアログを登録
								attachBbsResponseDialog(response_name,param,response_dialog,"name");
							}

							i += 1;
							if(i < num){
								execute_queue.attachFirst(f,null);
							}else{
								callback({result:true});
							}
						}
						execute_queue.attachFirst(f,null);
					};

					return null;
				});
			}

			// -
			// フォロワー
			// -
			function forFollower(target){
				if(BbsControlFollowerExist(target))	return;

				// -
				// BbsControlFollower を生成
				// -
				var control_follower = new BbsControlFollower(null,true);
				control_follower.setResponse(response);

				var element_follower = control_follower.getElement();
				var textnode_follower = DocumentCreateText("");

				element_follower.appendChild(textnode_follower);

				// -
				// 変化があったときに実行されるイベント
				// -
				control_follower.onchange = function(count){
					if(count){
						textnode_follower.nodeValue = " follower(" + count + ")";
					}else{
						textnode_follower.nodeValue = "";
					}

					var style = element_follower.style;
					if(count >= 3){
						StyleDeclarationSetProperty(style,"color","#e80000");
						StyleDeclarationRemoveProperty(style,"font-size");

					}else{
						StyleDeclarationSetProperty(style,"color","#888");
						StyleDeclarationSetProperty(style,"font-size","small");
					}
					if(count){
						StyleDeclarationSetProperty(style,"margin","0px 4px 0px 0px");
					}else{
						StyleDeclarationRemoveProperty(style,"margin");
					}
				};
				control_follower.update();
				var nodes = ElementGetElementsByTagName(target,"br");
				if(nodes.length){
					DomNode_InsertBefore(nodes[0],element_follower);
				}else{
					target.appendChild(element_follower);
				}

				// -
				// ポップアップ化
				// -
				// ダイアログを作成
				var response_dialog = new BbsResponseDialog();
				if(parent_dialog)	parent_dialog.attachChild(response_dialog);
				response_dialog.setElementParent(node.parent);
				response_dialog.setElementHitArea(element_follower);
				response_dialog.oncreate = function(_window,callback){

					var dl = DocumentCreateElement("dl");
					dl.style.margin = "0px";
					_window.appendChild(dl);

					var ary = response.getFollower();
					var i = 0;
					var num = ary.length;
					if(num <= 0) return false;

					function f(){
						var follower = bbs_dictionary.getResponse(ary[i].getNumber());
						var clone = follower.getCloneElements();

						var j;
						var clone_num = clone.length;
						if(clone_num){

							var param = new Object();
							param.parent = node.parent;
							for(j=0;j<clone_num;j++){
								var obj = clone[j];
								param[obj.name] = obj.element;
								dl.appendChild(obj.element);
							}

							// レスポンスダイアログを登録
							attachBbsResponseDialog(follower,param,response_dialog,"response");
						}

						i += 1;
						if(i < num){
							execute_queue.attachFirst(f,null);
						}else{
							callback({result:true});
						}
					}
					execute_queue.attachFirst(f,null);
				};
			}

			if(node.dt){
				forResponseAnchor(node.dt);
				forId(node.dt);
				forName(node.dt);
				forFollower(node.dt);
			}
			if(node.dd){
				forResponseAnchor(node.dd);
				forId(node.dd);
				forName(node.dd);
			}
		}

		// -
		// エレメントを解析
		// -
		var useful = (function(){
			var dt = element;
			var dd;

			try{
				if(dt.tagName != "DT")	return false;
			}catch(e){
				return false;
			}

			dd = dt.nextSibling;
			try{
				dd = dd.nextSibling;
				if(dd.tagName != "DD")	return false;
			}catch(e){
				return false;
			}

			try{
				var dl = dt.parentNode;
				if(dl.tagName != "DL")	return false;

				var div = dl.parentNode;
				if(div.tagName != "DIV")	return false;
				if(div.className != "content")	return false;
			}catch(e){
				return false;
			}

			// document に未登録
			if(!DomNodeGetAttachedDocument(dt))	return false;

			// -
			// レスアンカー拡張
			// -
			work.extendResponseAnchor(dd);

			// -
			// クリーンアップ
			// -
			(function(){
				function cleanup(target){
					BbsControlSearchTrash(target,function(element){
						var node = element.firstChild;
						if(!node)	return null;
						if(node.nodeType != 3)	return null;

						// ID
						var m = node.nodeValue.match(new RegExp("^ID:[ ]([a-zA-Z0-9+/.]{8,10})","i"));
						if(m){
							// 直後テキスト
							var node = DocumentCreateText(m[0]);
							DomNode_InsertAfter(element,node);
							DomNodeRemove(element);
							return null;
						}

						// トリップ
						var m = node.nodeValue.match(new RegExp("^(◆[a-zA-Z0-9+/.]{10,12})","i"));
						if(m){
							// 直後テキスト
							var node = DocumentCreateText(m[0]);
							DomNode_InsertAfter(element,node);
							DomNodeRemove(element);
							return null;
						}

						return null;
					});
				}

				if(dt){
					cleanup(dt);
				}
				if(dd){
					cleanup(dd);
				}
			})();

			// ナンバーを取得
			var dt_text = ElementGetTextContent(dt);
			if(!(dt_text.match(new RegExp("([0-9]+)[ ]","i"))))	return false;

			// ナンバーからレスポンスオブジェクトを取得
			var response = bbs_dictionary.getResponse(parseInt(RegExp.$1));

			// レスポンス解析
			if(!response.getAnalyzed()){

				// IDの取得
				if(dt_text.match(new RegExp("ID:[ ]([a-zA-Z0-9+/.]{8,10})","i"))){
					response.setId(RegExp.$1);
				}

				// 名前の取得
				if(dt_text.match(new RegExp("(◆[a-zA-Z0-9+/.]{10,12})","i"))){
					response.setName(RegExp.$1);
				}

				// フォロー解析
				var dictionary = new Object();
				(function(){
					var nodes = ElementGetElementsByTagName(dd,"a");
					var i;
					var num = nodes.length;
					for(i=0;i<num;i++){
						var numbers = work.createResponseAnchorNumbers(ElementGetTextContent(nodes[i]));
						numbers.getNumbers(function(n){
							if(!dictionary[n]){
								var following = bbs_dictionary.getResponse(n);
								following.addFollower(response);
								dictionary[n] = true;
							}
						});
					}
				})();

				// オリジナルエレメントをセット
				if(dt)	response.addOriginalElements("dt",dt);
				if(dd)	response.addOriginalElements("dd",dd);

				// 消去時に実行されるイベント
				response.onerase = function(){
					var original = response.getOriginalElements();

					// オリジナルエレメントを外す
					var i;
					var num = original.length;
					for(i=0;i<num;i++){
						var revise_scroll = new DocumentReviseScroll();
						var node = original[i].element;
						revise_scroll.executeRemoveElementBefore(node);
						DomNodeRemove(node);
						revise_scroll.executeRemoveElementAfter(node);
					}
				};

				response.setAnalyzed();
			}

			// レスポンスダイアログを登録(ルート)
			attachBbsResponseDialog(
				response,
				{
					dt:dt,
					dd:dd,
					parent:dt.parentNode
				},
				null,
				null
			);

			return true;
		})();

		response({useful:useful});
		return true;
	}

			]);

			// -
			// 掲示板設定「reddit.com」
			// -
			attachItem( "ExpandBbs_ScriptCallback_reddit" , [
	
	function(info,response){
		var element = info.element;

		// -
		// レスポンスダイアログを登録
		// -
		function attachBbsResponseDialog(response,node,parent_dialog,type){

			// -
			// 親
			// -
			function forParent(target){
				if(BbsControlResponseAnchorExist(target))	return;

				var control_res_anchor;
				var element_res_anchor;
				var parent_id;

				(function(){
					// ナンバーを取得
					var node = ElementGetElementsByClassName(target,"bylink")[1];
					if(!node) return;
					var m = node.href.match(new RegExp("[#/]([a-zA-Z0-9]+)$","i"));
					if(!m) return;

					parent_id = m[1];
					element_res_anchor = node;
					control_res_anchor = new BbsControlResponseAnchor(element_res_anchor,false);
				})();

				// ダイアログを作成
				var response_dialog = new BbsResponseDialog();
				if(parent_dialog)	parent_dialog.attachChild(response_dialog);
				response_dialog.setElementParent(node.parent);
				response_dialog.setElementHitArea(element_res_anchor);
				response_dialog.oncreate = function(_window,callback){

					var created = false;
					var following = bbs_dictionary.getResponse(parent_id);
					var clone = following.getCloneElements();

					var j;
					var clone_num = clone.length;
					if(clone_num){
						var container = DocumentCreateElement("div");
						container.className = "entry noncollapsed comment";
						container.style.marginBottom = "20px";
						_window.appendChild(container);

						var param = new Object();
						param.parent = node.parent;
						for(j=0;j<clone_num;j++){
							var obj = clone[j];
							param[obj.name] = obj.element;
							container.appendChild(obj.element);
						}

						// レスポンスダイアログを登録
						attachBbsResponseDialog(following,param,response_dialog,"response");

						created = true;
					}

					callback({result:created});
				};

			}

			// -
			// トリップ
			// -
			function forName(target){
				if(BbsControlNameExist(target))	return;

				// -
				// BbsControlName を生成
				// -
				(function(){
					var p;
					var n;
					var q;
					var ignore_dictionary = {"SCRIPT":1};
					var queue = new Object();
					q = {p:queue,n:queue,node:target};
					queue.p = q;
					queue.n = q;

					while(queue.n != queue){
						q = queue.n;
						p = q.p;
						n = q.n;
						p.n = n;
						n.p = p;
						var node = q.node;
						switch(node.nodeType){
						case 1:
							if(node.tagName == "A"){
								var m = node.className.match(new RegExp("id[-]([a-zA-Z0-9_]+)","i"));
								if(m){
									// BbsControlName を生成
									var control_name = new BbsControlName(null,true);
									control_name.setName(m[1]);
									var element_name = control_name.getElement();
									DomNode_InsertAfter(node,element_name);
									break;
								}
							}

							if(!(ignore_dictionary[node.tagName])){
								var i;
								var nodes = node.childNodes;
								var num = nodes.length;
								for(i=0;i<num;i++){
									n = queue;
									p = n.p;
									q = {p:p,n:n,node:nodes[i]};
									p.n = q;
									n.p = q;
								}
							}

							break;
						}
					}
				})();

				// -
				// BbsControlName を検索
				// -
				BbsControlNameSearch(target,function(control_name){

					control_name.setResponse(response);

					var name = control_name.getName();
					var myself = (response.getName() === name);
					var element_name = control_name.getElement();
					var textnode_name = DocumentCreateText("");


					// -
					// 変化があったときに実行されるイベント
					// -
					control_name.onchange = function(count){
						if(count > 1){
							DomNodeSetNodeValue(textnode_name,"(" + count + ")");
						}else{
							DomNodeSetNodeValue(textnode_name,"");
						}

						var style = element_name.style;
						if(count >= 5){
							StyleDeclarationSetProperty(style,"color","#e80000");
						}else if(count >= 2){
							StyleDeclarationRemoveProperty(style,"color");
						}else{
							StyleDeclarationSetProperty(style,"color","#707070");
						}
					};
					control_name.update();
					element_name.appendChild(textnode_name);

					// -
					// ポップアップ化
					// -
					if(type == "name"){
						if(myself) return null;
					}

					// ダイアログを作成
					var response_dialog = new BbsResponseDialog();
					if(parent_dialog)	parent_dialog.attachChild(response_dialog);
					response_dialog.setElementParent(node.parent);
					response_dialog.setElementHitArea(element_name);
					response_dialog.oncreate = function(_window,callback){

						var responses = bbs_dictionary.getResponsesFromName(name);
						var i = 0;
						var num = responses.length;
						if(myself){
							if(num < 2) return false;
						}else{
							if(num < 1) return false;
						}

						function f(){
							var response_name = responses[i];
							var clone = response_name.getCloneElements();

							var j;
							var clone_num = clone.length;
							if(clone_num){
								var container = DocumentCreateElement("div");
								container.className = "entry noncollapsed comment";
								container.style.marginBottom = "20px";
								_window.appendChild(container);

								var param = new Object();
								param.parent = node.parent;
								for(j=0;j<clone_num;j++){
									var obj = clone[j];
									param[obj.name] = obj.element;
									container.appendChild(obj.element);
								}

								// レスポンスダイアログを登録
								attachBbsResponseDialog(response_name,param,response_dialog,"name");
							}

							i += 1;
							if(i < num){
								execute_queue.attachFirst(f,null);
							}else{
								callback({result:true});
							}
						}
						execute_queue.attachFirst(f,null);
					};

					return null;
				});
			}

			// -
			// フォロワー
			// -
			function forFollower(target,insert){
				if(BbsControlFollowerExist(target))	return;

				// -
				// BbsControlFollower を生成
				// -
				var element_follower = DocumentCreateElement("span");
				var textnode_follower = DocumentCreateText("");

				var control_follower = new BbsControlFollower(element_follower,true);
				control_follower.setResponse(response);

				element_follower.appendChild(textnode_follower);

				// -
				// 変化があったときに実行されるイベント
				// -
				control_follower.onchange = function(count){
					if(count){
						textnode_follower.nodeValue = " follower(" + count + ")";
					}else{
						textnode_follower.nodeValue = "";
					}

					var style = element_follower.style;
					if(count >= 3){
						StyleDeclarationSetProperty(style,"color","#e80000");

					}else{
						StyleDeclarationRemoveProperty(style,"color");
					}
				};
				control_follower.update();
				insert.appendChild(element_follower);


				// -
				// ポップアップ化
				// -
				// ダイアログを作成
				var response_dialog = new BbsResponseDialog();
				if(parent_dialog)	parent_dialog.attachChild(response_dialog);
				response_dialog.setElementParent(node.parent);
				response_dialog.setElementHitArea(element_follower);
				response_dialog.oncreate = function(_window,callback){

					var ary = response.getFollower();
					var i = 0;
					var num = ary.length;
					if(num <= 0) return false;

					function f(){
						var follower = bbs_dictionary.getResponse(ary[i].getNumber());
						var clone = follower.getCloneElements();

						var j;
						var clone_num = clone.length;
						if(clone_num){
							var container = DocumentCreateElement("div");
							container.className = "entry noncollapsed comment";
							container.style.marginBottom = "20px";
							_window.appendChild(container);

							var param = new Object();
							param.parent = node.parent;
							for(j=0;j<clone_num;j++){
								var obj = clone[j];
								param[obj.name] = obj.element;
								container.appendChild(obj.element);
							}

							// レスポンスダイアログを登録
							attachBbsResponseDialog(follower,param,response_dialog,"response");
						}

						i += 1;
						if(i < num){
							execute_queue.attachFirst(f,null);
						}else{
							callback({result:true});
						}
					}
					execute_queue.attachFirst(f,null);
				};
			}

			if(node.post_info){
				forName(node.post_info);
			}
			if(node.post_buttons){
				forParent(node.post_buttons);
			}
			if((node.post_info) && (node.post_buttons)){
				forFollower(node.post_buttons,node.post_info);
			}
		}

		// -
		// エレメントを解析
		// -
		var useful = (function(){
			var post_container = element;
			var post_info;
			var post_body;
			var post_buttons;

			try{
				if(!(post_container.className.match(new RegExp("(^| )thing( |$)","i")))) return false;
			}catch(e){
				return false;
			}

			try{
				var post_info = ElementGetElementsByClassName(post_container,"tagline")[0];
				if(!post_info) return false;
				var post_body = ElementGetElementsByClassName(post_container,"usertext")[0];
				if(!post_body) return false;
				var post_buttons = ElementGetElementsByClassName(post_container,"buttons")[0];
				if(!post_buttons) return false;
			}catch(e){
			}

			// document に未登録
			if(!DomNodeGetAttachedDocument(post_container))	return false;

			// ナンバーを取得
			var input = ElementGetElementsByTagName(post_body,"input")[0];
			if(!input) return false;
			var m = input.value.match(new RegExp("[_]([a-zA-Z0-9_]+)","i"));
			if(!m) return false;

			// ナンバーからレスポンスオブジェクトを取得
			var response = bbs_dictionary.getResponse(m[1]);

			// レスポンス解析
			if(!response.getAnalyzed()){

				// 名前の取得
				(function(){
					var node = ElementGetElementsByClassName(post_info,"author")[0];
					if(node){
						var m = node.className.match(new RegExp("id[-]([a-zA-Z0-9_]+)","i"));
						if(m){
							response.setName(m[1]);
						}
					}
				})();

				// フォロー解析
				(function(){
					var node = ElementGetElementsByClassName(post_buttons,"bylink")[1];
					if(node){
						var m = node.href.match(new RegExp("[#/]([a-zA-Z0-9]+)$","i"));
						if(m){
							var following = bbs_dictionary.getResponse(m[1]);
							following.addFollower(response);
						}

					}
				})();

				// オリジナルエレメントをセット
				if(post_info)		response.addOriginalElements("post_info",post_info);
				if(post_body)		response.addOriginalElements("post_body",post_body);
				if(post_buttons)	response.addOriginalElements("post_buttons",post_buttons);

				// 消去時に実行されるイベント
				response.onerase = function(){
					var original = response.getOriginalElements();
					var i = 0;
					var num = original.length;
					for(i=num-1;i>=1;i--){
						var node = original[i].element;
						var revise_scroll = new DocumentReviseScroll();
						revise_scroll.executeRemoveElementBefore(node);
						node.style.display = "none";
						revise_scroll.executeRemoveElementAfter(node);
					}
				};

				response.setAnalyzed();
			}

			// レスポンスダイアログを登録(ルート)
			attachBbsResponseDialog(
				response,
				{
					post_info:post_info,
					post_body:post_body,
					post_buttons:post_buttons,
					parent:ElementGetElementsByClassName(document,"commentarea")[0]
				},
				null,
				null
			);

			return true;
		})();

		response({useful:useful});
		return true;
	}

			]);

			// -
			// 掲示板設定「8chan.co」
			// -
			attachItem( "ExpandBbs_ScriptCallback_8chan" , [
	
	function(info,response){
		var element = info.element;

		// -
		// レスポンスダイアログを登録
		// -
		function attachBbsResponseDialog(response,node,parent_dialog,type){

			// -
			// レスアンカー
			// -
			function forResponseAnchor(target){
				if(BbsControlResponseAnchorExist(target))	return;

				// -
				// BbsControlResponseAnchor を生成
				// -
				(function(){
					var i;
					var nodes = ElementGetElementsByTagName(target,"a");
					var num = nodes.length;
					for(i=0;i<num;i++){
						var node = nodes[i];
						var numbers = StringCreateResponseAnchorNumbers(ElementGetTextContent(node));
						if(numbers.getCount()){
							var control_res_anchor = new BbsControlResponseAnchor(node,false);
							control_res_anchor.setResponseAnchorNumbers(numbers);
						}
					}
				})();

				// -
				// BbsControlResponseAnchor を検索
				// -
				BbsControlResponseAnchorSearch(target,function(control_res_anchor){

					var element_res_anchor = control_res_anchor.getElement();
					var numbers = control_res_anchor.getResponseAnchorNumbers();

					// ダイアログを作成
					var response_dialog = new BbsResponseDialog();
					if(parent_dialog)	parent_dialog.attachChild(response_dialog);
					response_dialog.setElementParent(node.parent);
					response_dialog.setElementHitArea(element_res_anchor);
					response_dialog.oncreate = function(_window,callback){

						_window.className = "post reply";

						var created = false;
						var i = 0;
						var number_list = numbers.getNumberList();
						var num = number_list.length;
						if(!num) return false;

						function f(){
							var following = bbs_dictionary.getResponse(number_list[i]);
							var clone = following.getCloneElements();

							var j;
							var clone_num = clone.length;
							if(clone_num){
								var container = DocumentCreateElement("table");
								container.style.margin = "0px 0px 20px";
								_window.appendChild(container);

								var param = new Object();
								param.parent = node.parent;
								for(j=0;j<clone_num;j++){
									var obj = clone[j];
									param[obj.name] = obj.element;
									container.appendChild(obj.element);
								}

								// レスポンスダイアログを登録
								attachBbsResponseDialog(following,param,response_dialog,"response");

								created = true;
							}

							i += 1;
							if(i < num){
								execute_queue.attachFirst(f,null);
							}else{
								callback({result:created});
							}
						}
						execute_queue.attachFirst(f,null);
					};

					return null;
				});
			}

			// -
			// ID
			// -
			function forId(target){
				if(BbsControlIdExist(target))	return;

				// -
				// BbsControlId を生成
				// -
				(function(){
					var p;
					var n;
					var q;
					var ignore_dictionary = {"A":1,"SCRIPT":1};
					var queue = new Object();
					q = {p:queue,n:queue,node:target};
					queue.p = q;
					queue.n = q;

					while(queue.n != queue){
						q = queue.n;
						p = q.p;
						n = q.n;
						p.n = n;
						n.p = p;
						var node = q.node;
						switch(node.nodeType){
						case 1:
							if(!(ignore_dictionary[node.tagName])){
								var i;
								var nodes = node.childNodes;
								var num = nodes.length;
								for(i=0;i<num;i++){
									n = queue;
									p = n.p;
									q = {p:p,n:n,node:nodes[i]};
									p.n = q;
									n.p = q;
								}
							}

							// 名前欄
							if(node.tagName == "SPAN"){
								if(node.className == "poster_id"){
									var m = ElementGetTextContent(node).match(new RegExp("^([a-zA-Z0-9+/.]{6,8})$","i"));
									if(m){
										// BbsControlId を生成
										var control_id = new BbsControlId(null,true);
										control_id.setId(m[1]);
										var element_id = control_id.getElement();
										DomNode_InsertAfter(node,element_id);
										var textnode_id = DocumentCreateText("");
										element_id.appendChild(textnode_id);
										control_id.setTextNode(textnode_id);
									}
								}
							}

							break;
						case 3:
							while(node){

								// 本文
								var m = DomNodeGetNodeValue(node).match(new RegExp("ID:(|[ ])([a-zA-Z0-9+/.]{6,8})","i"));
								if(!m)	break;

								// 元のテキストノード
								DomNodeSetNodeValue(node,RegExp.leftContext);

								// BbsControlId を生成
								var control_id = new BbsControlId(null,false);
								control_id.setId(m[2]);
								var element_id = control_id.getElement();
								ElementSetTextContent(element_id,m[0]);
								DomNode_InsertAfter(node,element_id);

								// 直後テキスト
								node = DocumentCreateText(RegExp.rightContext);
								DomNode_InsertAfter(element_id,node);
							}
							break;
						}
					}
				})();

				// -
				// BbsControlId を検索
				// -
				BbsControlIdSearch(target,function(control_id){

					control_id.setResponse(response);

					var id = control_id.getId();
					var myself = (response.getId() === id);
					var element_id = control_id.getElement();
					var textnode_id = DocumentCreateText("");

					element_id.appendChild(textnode_id);

					// -
					// 変化があったときに実行されるイベント
					// -
					control_id.onchange = function(count){
						if(count > 1){
							DomNodeSetNodeValue(textnode_id,"(" + count + ")");
						}else{
							DomNodeSetNodeValue(textnode_id,"");
						}

						var style = element_id.style;
						if(count >= 5){
							StyleDeclarationSetProperty(style,"color","#e80000");
							StyleDeclarationRemoveProperty(style,"font-size");
						}else if(count >= 2){
							StyleDeclarationRemoveProperty(style,"color");
							StyleDeclarationRemoveProperty(style,"font-size");
						}else{
							StyleDeclarationSetProperty(style,"color","#707070");
							StyleDeclarationSetProperty(style,"font-size","small");
						}
						if(count > 1){
							StyleDeclarationSetProperty(style,"margin-left","2px");
							StyleDeclarationSetProperty(style,"margin-right","5px");
						}else{
							StyleDeclarationRemoveProperty(style,"margin-left");
							StyleDeclarationRemoveProperty(style,"margin-right");
						}
					};
					control_id.update();

					// -
					// ポップアップ化
					// -
					if(type == "id"){
						if(myself) return null;
					}

					// ダイアログを作成
					var response_dialog = new BbsResponseDialog();
					if(parent_dialog)	parent_dialog.attachChild(response_dialog);
					response_dialog.setElementParent(node.parent);
					response_dialog.setElementHitArea(element_id);
					response_dialog.oncreate = function(_window,callback){

						_window.className = "post reply";

						var responses = bbs_dictionary.getResponsesFromId(id);
						var i = 0;
						var num = responses.length;
						if(myself){
							if(num < 2) return false;
						}else{
							if(num < 1) return false;
						}

						function f(){
							var response_id = responses[i];
							var clone = response_id.getCloneElements();

							var j;
							var clone_num = clone.length;
							if(clone_num){
								var container = DocumentCreateElement("table");
								container.style.margin = "0px 0px 20px";
								_window.appendChild(container);

								var param = new Object();
								param.parent = node.parent;
								for(j=0;j<clone_num;j++){
									var obj = clone[j];
									param[obj.name] = obj.element;
									container.appendChild(obj.element);
								}

								// レスポンスダイアログを登録
								attachBbsResponseDialog(response_id,param,response_dialog,"id");
							}

							i += 1;
							if(i < num){
								execute_queue.attachFirst(f,null);
							}else{
								callback({result:true});
							}
						}
						execute_queue.attachFirst(f,null);
					};

					return null;
				});
			}

			// -
			// トリップ
			// -
			function forName(target){
				if(BbsControlNameExist(target))	return;

				// -
				// BbsControlName を生成
				// -
				(function(){
					var p;
					var n;
					var q;
					var ignore_dictionary = {"SCRIPT":1};
					var queue = new Object();
					q = {p:queue,n:queue,node:target};
					queue.p = q;
					queue.n = q;

					while(queue.n != queue){
						q = queue.n;
						p = q.p;
						n = q.n;
						p.n = n;
						n.p = p;
						var node = q.node;
						switch(node.nodeType){
						case 1:
							if(!(ignore_dictionary[node.tagName])){
								var i;
								var nodes = node.childNodes;
								var num = nodes.length;
								for(i=0;i<num;i++){
									n = queue;
									p = n.p;
									q = {p:p,n:n,node:nodes[i]};
									p.n = q;
									n.p = q;
								}
							}
							break;
						case 3:
							while(node){

								// 本文
								var m = DomNodeGetNodeValue(node).match(new RegExp("(!|!!)([a-zA-Z0-9+/.]{10})","i"));
								if(!m)	break;

								// 元のテキストノード
								DomNodeSetNodeValue(node,RegExp.leftContext);

								// BbsControlName を生成
								var control_name = new BbsControlName(null,false);
								control_name.setName(m[0]);
								var element_name = control_name.getElement();
								ElementSetTextContent(element_name,m[0]);
								DomNode_InsertAfter(node,element_name);

								// 直後テキスト
								node = DocumentCreateText(RegExp.rightContext);
								DomNode_InsertAfter(element_name,node);
							}
							break;
						}
					}
				})();

				// -
				// BbsControlName を検索
				// -
				BbsControlNameSearch(target,function(control_name){

					control_name.setResponse(response);

					var name = control_name.getName();
					var myself = (response.getName() === name);
					var element_name = control_name.getElement();
					var textnode_name = DocumentCreateText("");


					// -
					// 変化があったときに実行されるイベント
					// -
					control_name.onchange = function(count){
						if(count > 1){
							DomNodeSetNodeValue(textnode_name,"(" + count + ")");
						}else{
							DomNodeSetNodeValue(textnode_name,"");
						}

						var style = element_name.style;
						if(count >= 5){
							StyleDeclarationSetProperty(style,"color","#e80000");
							StyleDeclarationRemoveProperty(style,"font-size");
						}else if(count >= 2){
							StyleDeclarationRemoveProperty(style,"color");
							StyleDeclarationRemoveProperty(style,"font-size");
						}else{
							StyleDeclarationSetProperty(style,"color","#707070");
							StyleDeclarationSetProperty(style,"font-size","small");
						}
					};
					control_name.update();
					element_name.appendChild(textnode_name);

					// -
					// ポップアップ化
					// -
					if(type == "name"){
						if(myself) return null;
					}

					// ダイアログを作成
					var response_dialog = new BbsResponseDialog();
					if(parent_dialog)	parent_dialog.attachChild(response_dialog);
					response_dialog.setElementParent(node.parent);
					response_dialog.setElementHitArea(element_name);
					response_dialog.oncreate = function(_window,callback){

						_window.className = "post reply";

						var responses = bbs_dictionary.getResponsesFromName(name);
						var i = 0;
						var num = responses.length;
						if(myself){
							if(num < 2) return false;
						}else{
							if(num < 1) return false;
						}

						function f(){
							var response_name = responses[i];
							var clone = response_name.getCloneElements();

							var j;
							var clone_num = clone.length;
							if(clone_num){
								var container = DocumentCreateElement("table");
								container.style.margin = "0px 0px 20px";
								_window.appendChild(container);

								var param = new Object();
								param.parent = node.parent;
								for(j=0;j<clone_num;j++){
									var obj = clone[j];
									param[obj.name] = obj.element;
									container.appendChild(obj.element);
								}

								// レスポンスダイアログを登録
								attachBbsResponseDialog(response_name,param,response_dialog,"name");
							}

							i += 1;
							if(i < num){
								execute_queue.attachFirst(f,null);
							}else{
								callback({result:true});
							}
						}
						execute_queue.attachFirst(f,null);
					};

					return null;
				});
			}

			// -
			// フォロワー
			// -
			function forFollower(target){
				if(BbsControlFollowerExist(target))	return;

				// -
				// BbsControlFollower を生成
				// -
				var control_follower = new BbsControlFollower(null,true);
				control_follower.setResponse(response);

				var element_follower = control_follower.getElement();
				var textnode_follower = DocumentCreateText("");

				element_follower.appendChild(textnode_follower);

				// -
				// 変化があったときに実行されるイベント
				// -
				control_follower.onchange = function(count){
					if(count){
						textnode_follower.nodeValue = " follower(" + count + ")";
					}else{
						textnode_follower.nodeValue = "";
					}

					var style = element_follower.style;
					if(count >= 3){
						StyleDeclarationSetProperty(style,"color","#e80000");
						StyleDeclarationRemoveProperty(style,"font-size");

					}else{
						StyleDeclarationSetProperty(style,"color","#707070");
						StyleDeclarationSetProperty(style,"font-size","small");
					}
					if(count){
						StyleDeclarationSetProperty(style,"margin","0px 4px 0px 0px");
					}else{
						StyleDeclarationRemoveProperty(style,"margin");
					}
				};
				control_follower.update();
				target.appendChild(element_follower);


				// -
				// ポップアップ化
				// -
				// ダイアログを作成
				var response_dialog = new BbsResponseDialog();
				if(parent_dialog)	parent_dialog.attachChild(response_dialog);
				response_dialog.setElementParent(node.parent);
				response_dialog.setElementHitArea(element_follower);
				response_dialog.oncreate = function(_window,callback){

					_window.className = "post reply";

					var ary = response.getFollower();
					var i = 0;
					var num = ary.length;
					if(num <= 0) return false;

					function f(){
						var follower = bbs_dictionary.getResponse(ary[i].getNumber());
						var clone = follower.getCloneElements();

						var j;
						var clone_num = clone.length;
						if(clone_num){
							var container = DocumentCreateElement("table");
							container.style.margin = "0px 0px 20px";
							_window.appendChild(container);

							var param = new Object();
							param.parent = node.parent;
							for(j=0;j<clone_num;j++){
								var obj = clone[j];
								param[obj.name] = obj.element;
								container.appendChild(obj.element);
							}

							// レスポンスダイアログを登録
							attachBbsResponseDialog(follower,param,response_dialog,"response");
						}

						i += 1;
						if(i < num){
							execute_queue.attachFirst(f,null);
						}else{
							callback({result:true});
						}
					}
					execute_queue.attachFirst(f,null);
				};
			}

			if(node.post_intro){
				forResponseAnchor(node.post_intro);
				forId(node.post_intro);
				forName(node.post_intro);
				forFollower(node.post_intro);
			}
			if(node.post_body){
				forResponseAnchor(node.post_body);
				forId(node.post_body);
				forName(node.post_body);
			}
		}

		// -
		// 文字列からレスポンス番号を取得
		// -
		function StringCreateResponseAnchorNumbers(str){
			var numbers = new ResponseAnchorNumbers();

			var re_search = new RegExp("^(>>|<<|>>|<<|>|>)([0-90-9]+)","i");
			var re_range = new RegExp("^([0-90-9]+)[-]([0-90-9]+)","i");
			var re_number = new RegExp("^([0-90-9]+)","i");

			var m = str.match(re_search);
			if(m){
				var p = m[1].length;
				while(true){
					// 番号-番号
					m = str.substr(p).match(re_range);
					if(m){
						var min = parseInt(StringConvertFromNumericFullToNumericHalf(m[1]));
						var max = parseInt(StringConvertFromNumericFullToNumericHalf(m[2]));
						if(min < 1) min = 1;
						if(max < 1) max = 1;
						if(min > 0x7fffffff) min = 0x7fffffff;
						if(max > 0x7fffffff) max = 0x7fffffff;
						if(max < min){
							var tmp = min;
							min = max;
							max = tmp;
						}
						if(max - min > 10000) max = min + 10000;
						p += m[0].length;
						numbers.addNumbers(min,max);
					}else{
						// 番号
						m = str.substr(p).match(re_number);
						if(m){
							p += m[0].length;
							var id = parseInt(StringConvertFromNumericFullToNumericHalf(m[1]));
							if(id < 1) id = 1;
							if(id > 0x7fffffff) id = 0x7fffffff;
							numbers.addNumber(id);
						}
					}

					if(m){
						// カンマ
						if(RegExp.rightContext.search(",") == 0){
							p += 1;
							continue;
						}
					}
					break;
				}
			}
			return numbers;
		}

		// -
		// エレメントを解析
		// -
		var useful = (function(){
			var post_container = element;
			var post_intro;
			var post_files;
			var post_body;

			try{
				if(post_container.tagName != "DIV")	return false;
				if(!(post_container.className.match(new RegExp("^post","i"))))	return false;
			}catch(e){
				return false;
			}

			try{
				var node = post_container.previousSibling.previousSibling;
				if(node.tagName == "DIV"){
					if(node.className == "files"){
						post_files = node;
					}
				}
			}catch(e){
			}

			try{
				var nodes = post_container.childNodes;
				var i;
				var num = nodes.length;
				for(i=0;i<num;i++){
					var node = nodes[i];
					switch(node.className){
					case "intro":
						post_intro = node;
						break;
					case "files":
						post_files = node;
						break;
					case "body":
						post_body = node;
						break;
					}
				}
			}catch(e){
			}

			try{
				if(!post_intro) return false;
				if(!post_body) return false;
			}catch(e){
			}

			// document に未登録
			if(!DomNodeGetAttachedDocument(post_intro))	return false;

			// ポップアップを除外
			var board = false;
			var node = post_intro;
			while(node){
				if(node.id.match(new RegExp("^thread","i"))){
					board = true;
					break;
				}
				node = node.parentNode;
			}
			if(!board)	return false;

			// -
			// クリーンアップ
			// -
			(function(){
				function cleanupInfo(target){
					var nodes = ElementGetElementsByTagName(post_intro,"span");
					var i;
					var num = nodes.length;
					for(i=0;i<num;i++){
						var node = nodes[i];
						if(node.className == "postertrip"){
							// トリップ
							var m = ElementGetTextContent(element).match(new RegExp("(!|!!)([a-zA-Z0-9+/.]{10})","i"));
							if(m){
								ElementSetTextContent(node,m[0]);
							}
							break;
						}
					}
				}

				function cleanupMessage(target){
					BbsControlSearchTrash(target,function(element){
						var node = element.firstChild;
						if(!node)	return null;
						if(node.nodeType != 3)	return null;

						// ID
						var m = node.nodeValue.match(new RegExp("^ID:(|[ ])([a-zA-Z0-9+/.]{6,8})","i"));
						if(m){
							// 直後テキスト
							var node = DocumentCreateText(m[0]);
							DomNode_InsertAfter(element,node);
							DomNodeRemove(element);
							return null;
						}

						// トリップ
						var m = node.nodeValue.match(new RegExp("^(!|!!)([a-zA-Z0-9+/.]{10})","i"));
						if(m){
							// 直後テキスト
							var node = DocumentCreateText(m[0]);
							DomNode_InsertAfter(element,node);
							DomNodeRemove(element);
							return null;
						}

						return null;
					});
				}

				function cleanupAnchor(target){
					var p;
					var n;
					var q;
					var queue = new Object();
					q = {p:queue,n:queue,node:target};
					queue.p = q;
					queue.n = q;

					while(queue.n != queue){
						q = queue.n;
						p = q.p;
						n = q.n;
						p.n = n;
						n.p = p;
						var node = q.node;
						switch(node.nodeType){
						case 1:
							if(node.tagName == "A"){
								var clone = node.cloneNode(true);
								DomNode_InsertAfter(node,clone);
								DomNodeRemove(node);
							}else{
								var i;
								var nodes = node.childNodes;
								var num = nodes.length;
								for(i=0;i<num;i++){
									n = queue;
									p = n.p;
									q = {p:p,n:n,node:nodes[i]};
									p.n = q;
									n.p = q;
								}
							}
							break;
						}
					}
				}

				function removeResponseAnchor(target){
					var re_search = new RegExp("^(>>|<<|>>|<<|>|>|》|≫|&gt;&gt;)([0-90-9]+)","i");
					var p;
					var n;
					var q;
					var queue = new Object();
					q = {p:queue,n:queue,node:target};
					queue.p = q;
					queue.n = q;

					while(queue.n != queue){
						q = queue.n;
						p = q.p;
						n = q.n;
						p.n = n;
						n.p = p;
						var node = q.node;
						switch(node.nodeType){
						case 1:
							if(node.tagName == "A"){
								var text = ElementGetTextContent(node);
								if(text.match(re_search)){
									DomNodeRemove(node);
								}
							}else{
								var i;
								var nodes = node.childNodes;
								var num = nodes.length;
								for(i=0;i<num;i++){
									n = queue;
									p = n.p;
									q = {p:p,n:n,node:nodes[i]};
									p.n = q;
									n.p = q;
								}
							}
							break;
						}
					}
				}

				if(post_intro){
					cleanupInfo(post_intro);
					removeResponseAnchor(post_intro);
				}
				if(post_body){
					cleanupMessage(post_body);
					cleanupAnchor(post_body);
				}
			})();

			// ナンバーを取得
			var info_text = ElementGetTextContent(post_intro);
			if(!(info_text.match(new RegExp("No\\.([0-9]+)","i"))))	return false;

			// ナンバーからレスポンスオブジェクトを取得
			var response = bbs_dictionary.getResponse(parseInt(RegExp.$1));

			// レスポンス解析
			if(!response.getAnalyzed()){

				// IDの取得
				var node = ElementGetElementsByClassName(post_intro,"poster_id")[0];
				if(node) response.setId(ElementGetTextContent(node));					

				// 名前の取得
				var node = ElementGetElementsByClassName(post_intro,"trip")[0];
				if(node) response.setName(ElementGetTextContent(node));					

				// フォロー解析
				var dictionary = new Object();
				(function(){
					var nodes = ElementGetElementsByTagName(post_body,"a");
					var i;
					var num = nodes.length;
					for(i=0;i<num;i++){
						var numbers = StringCreateResponseAnchorNumbers(ElementGetTextContent(nodes[i]));
						numbers.getNumbers(function(n){
							if(!dictionary[n]){
								var following = bbs_dictionary.getResponse(n);
								following.addFollower(response);
								dictionary[n] = true;
							}
						});
					}
				})();

				// オリジナルエレメントをセット
				if(post_intro)		response.addOriginalElements("post_intro",post_intro);
				if(post_files)		response.addOriginalElements("post_files",post_files);
				if(post_body)		response.addOriginalElements("post_body",post_body);

				// 消去時に実行されるイベント
				response.onerase = function(){
					var original = response.getOriginalElements();
					if(original.length){
						var node = original[0].element;
						while(node){
							if(node.nodeType != 1) break;
							if(ElementGetClassName(node).match(new RegExp("^post","i"))){
								var revise_scroll = new DocumentReviseScroll();
								revise_scroll.executeRemoveElementBefore(node);
								node.style.display = "none";
								revise_scroll.executeRemoveElementAfter(node);
								break;
							}
							node = node.parentNode;
						}
					}
				};

				response.setAnalyzed();
			}

			// レスポンスダイアログを登録(ルート)
			attachBbsResponseDialog(
				response,
				{
					post_intro:post_intro,
					post_body:post_body,
					parent:document.body
				},
				null,
				null
			);

			return true;
		})();

		response({useful:useful});
		return true;
	}

			]);

			// -
			// 掲示板設定「4chan.org」
			// -
			attachItem( "ExpandBbs_ScriptCallback_4chan" , [
	
	function(info,response){
		var element = info.element;

		// -
		// レスポンスダイアログを登録
		// -
		function attachBbsResponseDialog(response,node,parent_dialog,type){

			// -
			// レスアンカー
			// -
			function forResponseAnchor(target){
				if(BbsControlResponseAnchorExist(target))	return;

				// -
				// BbsControlResponseAnchor を生成
				// -
				(function(){
					var i;
					var nodes = ElementGetElementsByTagName(target,"a");
					var num = nodes.length;
					for(i=0;i<num;i++){
						var node = nodes[i];
						var numbers = StringCreateResponseAnchorNumbers(ElementGetTextContent(node));
						if(numbers.getCount()){
							var control_res_anchor = new BbsControlResponseAnchor(node,false);
							control_res_anchor.setResponseAnchorNumbers(numbers);
						}
					}
				})();

				// -
				// BbsControlResponseAnchor を検索
				// -
				BbsControlResponseAnchorSearch(target,function(control_res_anchor){

					var element_res_anchor = control_res_anchor.getElement();
					var numbers = control_res_anchor.getResponseAnchorNumbers();

					// ダイアログを作成
					var response_dialog = new BbsResponseDialog();
					if(parent_dialog)	parent_dialog.attachChild(response_dialog);
					response_dialog.setElementParent(node.parent);
					response_dialog.setElementHitArea(element_res_anchor);
					response_dialog.oncreate = function(_window,callback){

						_window.className = "reply";

						var created = false;
						var i = 0;
						var number_list = numbers.getNumberList();
						var num = number_list.length;
						if(!num) return false;

						function f(){
							var following = bbs_dictionary.getResponse(number_list[i]);
							var clone = following.getCloneElements();

							var j;
							var clone_num = clone.length;
							if(clone_num){
								var container = DocumentCreateElement("table");
								container.style.margin = "0px 0px 10px";
								_window.appendChild(container);

								var param = new Object();
								param.parent = node.parent;
								for(j=0;j<clone_num;j++){
									var obj = clone[j];
									param[obj.name] = obj.element;
									container.appendChild(obj.element);
								}

								// レスポンスダイアログを登録
								attachBbsResponseDialog(following,param,response_dialog,"response");

								created = true;
							}

							i += 1;
							if(i < num){
								execute_queue.attachFirst(f,null);
							}else{
								callback({result:created});
							}
						}
						execute_queue.attachFirst(f,null);
					};

					return null;
				});
			}

			// -
			// ID
			// -
			function forId(target){
				if(BbsControlIdExist(target))	return;

				// -
				// BbsControlId を生成
				// -
				(function(){
					var p;
					var n;
					var q;
					var ignore_dictionary = {"A":1,"SCRIPT":1};
					var queue = new Object();
					q = {p:queue,n:queue,node:target};
					queue.p = q;
					queue.n = q;

					while(queue.n != queue){
						q = queue.n;
						p = q.p;
						n = q.n;
						p.n = n;
						n.p = p;
						var node = q.node;
						switch(node.nodeType){
						case 1:
							if(!(ignore_dictionary[node.tagName])){
								var i;
								var nodes = node.childNodes;
								var num = nodes.length;
								for(i=0;i<num;i++){
									n = queue;
									p = n.p;
									q = {p:p,n:n,node:nodes[i]};
									p.n = q;
									n.p = q;
								}
							}

							// 名前欄
							if(node.tagName == "SPAN"){
								if(node.className == "hand"){
									var m = ElementGetTextContent(node).match(new RegExp("^([a-zA-Z0-9+/.]{8})$","i"));
									if(m){
										// BbsControlId を生成
										var control_id = new BbsControlId(null,true);
										control_id.setId(m[1]);
										var element_id = control_id.getElement();
										DomNode_InsertAfter(node,element_id);
									}
								}
							}

							break;
						case 3:
							while(node){

								// 本文
								var m = DomNodeGetNodeValue(node).match(new RegExp("ID:(|[ ])([a-zA-Z0-9+/.]{8})","i"));
								if(!m)	break;

								// 元のテキストノード
								DomNodeSetNodeValue(node,RegExp.leftContext);

								// BbsControlId を生成
								var control_id = new BbsControlId(null,false);
								control_id.setId(m[2]);
								var element_id = control_id.getElement();
								ElementSetTextContent(element_id,m[0]);
								DomNode_InsertAfter(node,element_id);

								// 直後テキスト
								node = DocumentCreateText(RegExp.rightContext);
								DomNode_InsertAfter(element_id,node);
							}
							break;
						}
					}
				})();

				// -
				// BbsControlId を検索
				// -
				BbsControlIdSearch(target,function(control_id){

					control_id.setResponse(response);

					var id = control_id.getId();
					var myself = (response.getId() === id);
					var element_id = control_id.getElement();
					var textnode_id = DocumentCreateText("");

					element_id.appendChild(textnode_id);

					// -
					// 変化があったときに実行されるイベント
					// -
					control_id.onchange = function(count){
						if(count > 1){
							DomNodeSetNodeValue(textnode_id,"[" + count + "]");
						}else{
							DomNodeSetNodeValue(textnode_id,"");
						}

						var style = element_id.style;
						if(count >= 5){
							StyleDeclarationSetProperty(style,"color","#e80000");
							StyleDeclarationRemoveProperty(style,"font-size");
						}else if(count >= 2){
							StyleDeclarationRemoveProperty(style,"color");
							StyleDeclarationRemoveProperty(style,"font-size");
						}else{
							StyleDeclarationSetProperty(style,"color","#707070");
							StyleDeclarationSetProperty(style,"font-size","small");
						}
						if(count > 1){
							StyleDeclarationSetProperty(style,"margin","0px 4px 0px 4px");
						}else{
							StyleDeclarationRemoveProperty(style,"margin");
						}
					};
					control_id.update();

					// -
					// ポップアップ化
					// -
					if(type == "id"){
						if(myself) return null;
					}

					// ダイアログを作成
					var response_dialog = new BbsResponseDialog();
					if(parent_dialog)	parent_dialog.attachChild(response_dialog);
					response_dialog.setElementParent(node.parent);
					response_dialog.setElementHitArea(element_id);
					response_dialog.oncreate = function(_window,callback){

						_window.className = "reply";

						var responses = bbs_dictionary.getResponsesFromId(id);
						var i = 0;
						var num = responses.length;
						if(myself){
							if(num < 2) return false;
						}else{
							if(num < 1) return false;
						}

						function f(){
							var response_id = responses[i];
							var clone = response_id.getCloneElements();

							var j;
							var clone_num = clone.length;
							if(clone_num){
								var container = DocumentCreateElement("table");
								container.style.margin = "0px 0px 10px";
								_window.appendChild(container);

								var param = new Object();
								param.parent = node.parent;
								for(j=0;j<clone_num;j++){
									var obj = clone[j];
									param[obj.name] = obj.element;
									container.appendChild(obj.element);
								}

								// レスポンスダイアログを登録
								attachBbsResponseDialog(response_id,param,response_dialog,"id");
							}

							i += 1;
							if(i < num){
								execute_queue.attachFirst(f,null);
							}else{
								callback({result:true});
							}
						}
						execute_queue.attachFirst(f,null);
					};

					return null;
				});
			}

			// -
			// トリップ
			// -
			function forName(target){
				if(BbsControlNameExist(target))	return;

				// -
				// BbsControlName を生成
				// -
				(function(){
					var p;
					var n;
					var q;
					var ignore_dictionary = {"SCRIPT":1};
					var queue = new Object();
					q = {p:queue,n:queue,node:target};
					queue.p = q;
					queue.n = q;

					while(queue.n != queue){
						q = queue.n;
						p = q.p;
						n = q.n;
						p.n = n;
						n.p = p;
						var node = q.node;
						switch(node.nodeType){
						case 1:
							if(!(ignore_dictionary[node.tagName])){
								var i;
								var nodes = node.childNodes;
								var num = nodes.length;
								for(i=0;i<num;i++){
									n = queue;
									p = n.p;
									q = {p:p,n:n,node:nodes[i]};
									p.n = q;
									n.p = q;
								}
							}
							break;
						case 3:
							while(node){

								// 本文
								var m = DomNodeGetNodeValue(node).match(new RegExp("(!|!!)([a-zA-Z0-9+/.]{10})","i"));
								if(!m)	break;

								// 元のテキストノード
								DomNodeSetNodeValue(node,RegExp.leftContext);

								// BbsControlName を生成
								var control_name = new BbsControlName(null,false);
								control_name.setName(m[0]);
								var element_name = control_name.getElement();
								ElementSetTextContent(element_name,m[0]);
								DomNode_InsertAfter(node,element_name);

								// 直後テキスト
								node = DocumentCreateText(RegExp.rightContext);
								DomNode_InsertAfter(element_name,node);
							}
							break;
						}
					}
				})();

				// -
				// BbsControlName を検索
				// -
				BbsControlNameSearch(target,function(control_name){

					control_name.setResponse(response);

					var name = control_name.getName();
					var myself = (response.getName() === name);
					var element_name = control_name.getElement();
					var textnode_name = DocumentCreateText("");


					// -
					// 変化があったときに実行されるイベント
					// -
					control_name.onchange = function(count){
						if(count > 1){
							DomNodeSetNodeValue(textnode_name,"(" + count + ")");
						}else{
							DomNodeSetNodeValue(textnode_name,"");
						}

						var style = element_name.style;
						if(count >= 5){
							StyleDeclarationSetProperty(style,"color","#e80000");
							StyleDeclarationRemoveProperty(style,"font-size");
						}else if(count >= 2){
							StyleDeclarationRemoveProperty(style,"color");
							StyleDeclarationRemoveProperty(style,"font-size");
						}else{
							StyleDeclarationSetProperty(style,"color","#707070");
							StyleDeclarationSetProperty(style,"font-size","small");
						}
					};
					control_name.update();
					element_name.appendChild(textnode_name);

					// -
					// ポップアップ化
					// -
					if(type == "name"){
						if(myself) return null;
					}

					// ダイアログを作成
					var response_dialog = new BbsResponseDialog();
					if(parent_dialog)	parent_dialog.attachChild(response_dialog);
					response_dialog.setElementParent(node.parent);
					response_dialog.setElementHitArea(element_name);
					response_dialog.oncreate = function(_window,callback){

						_window.className = "reply";

						var responses = bbs_dictionary.getResponsesFromName(name);
						var i = 0;
						var num = responses.length;
						if(myself){
							if(num < 2) return false;
						}else{
							if(num < 1) return false;
						}

						function f(){
							var response_name = responses[i];
							var clone = response_name.getCloneElements();

							var j;
							var clone_num = clone.length;
							if(clone_num){
								var container = DocumentCreateElement("table");
								container.style.margin = "0px 0px 10px";
								_window.appendChild(container);

								var param = new Object();
								param.parent = node.parent;
								for(j=0;j<clone_num;j++){
									var obj = clone[j];
									param[obj.name] = obj.element;
									container.appendChild(obj.element);
								}

								// レスポンスダイアログを登録
								attachBbsResponseDialog(response_name,param,response_dialog,"name");
							}

							i += 1;
							if(i < num){
								execute_queue.attachFirst(f,null);
							}else{
								callback({result:true});
							}
						}
						execute_queue.attachFirst(f,null);
					};

					return null;
				});
			}

			// -
			// フォロワー
			// -
			function forFollower(target){
				if(BbsControlFollowerExist(target))	return;

				// -
				// BbsControlFollower を生成
				// -
				var control_follower = new BbsControlFollower(null,true);
				control_follower.setResponse(response);

				var element_follower = control_follower.getElement();
				var textnode_follower = DocumentCreateText("");

				element_follower.appendChild(textnode_follower);

				// -
				// 変化があったときに実行されるイベント
				// -
				control_follower.onchange = function(count){
					if(count){
						textnode_follower.nodeValue = " follower(" + count + ")";
					}else{
						textnode_follower.nodeValue = "";
					}

					var style = element_follower.style;
					if(count >= 3){
						StyleDeclarationSetProperty(style,"color","#e80000");
						StyleDeclarationRemoveProperty(style,"font-size");

					}else{
						StyleDeclarationSetProperty(style,"color","#707070");
						StyleDeclarationSetProperty(style,"font-size","small");
					}
					if(count){
						StyleDeclarationSetProperty(style,"margin","0px 4px 0px 0px");
					}else{
						StyleDeclarationRemoveProperty(style,"margin");
					}
				};
				control_follower.update();
				target.appendChild(element_follower);


				// -
				// ポップアップ化
				// -
				// ダイアログを作成
				var response_dialog = new BbsResponseDialog();
				if(parent_dialog)	parent_dialog.attachChild(response_dialog);
				response_dialog.setElementParent(node.parent);
				response_dialog.setElementHitArea(element_follower);
				response_dialog.oncreate = function(_window,callback){

					_window.className = "reply";

					var ary = response.getFollower();
					var i = 0;
					var num = ary.length;
					if(num <= 0) return false;

					function f(){
						var follower = bbs_dictionary.getResponse(ary[i].getNumber());
						var clone = follower.getCloneElements();

						var j;
						var clone_num = clone.length;
						if(clone_num){
							var container = DocumentCreateElement("table");
							container.style.margin = "0px 0px 10px";
							_window.appendChild(container);

							var param = new Object();
							param.parent = node.parent;
							for(j=0;j<clone_num;j++){
								var obj = clone[j];
								param[obj.name] = obj.element;
								container.appendChild(obj.element);
							}

							// レスポンスダイアログを登録
							attachBbsResponseDialog(follower,param,response_dialog,"response");
						}

						i += 1;
						if(i < num){
							execute_queue.attachFirst(f,null);
						}else{
							callback({result:true});
						}
					}
					execute_queue.attachFirst(f,null);
				};
			}

			if(node.post_info){
				forResponseAnchor(node.post_info);
				forId(node.post_info);
				forName(node.post_info);
				forFollower(node.post_info);
			}
			if(node.post_message){
				forResponseAnchor(node.post_message);
				forId(node.post_message);
				forName(node.post_message);
			}
		}

		// -
		// 文字列からレスポンス番号を取得
		// -
		function StringCreateResponseAnchorNumbers(str){
			var numbers = new ResponseAnchorNumbers();

			var re_search = new RegExp("^(>>|<<|>>|<<|>|>)([0-90-9]+)","i");
			var re_range = new RegExp("^([0-90-9]+)[-]([0-90-9]+)","i");
			var re_number = new RegExp("^([0-90-9]+)","i");

			var m = str.match(re_search);
			if(m){
				var p = m[1].length;
				while(true){
					// 番号-番号
					m = str.substr(p).match(re_range);
					if(m){
						var min = parseInt(StringConvertFromNumericFullToNumericHalf(m[1]));
						var max = parseInt(StringConvertFromNumericFullToNumericHalf(m[2]));
						if(min < 1) min = 1;
						if(max < 1) max = 1;
						if(min > 0x7fffffff) min = 0x7fffffff;
						if(max > 0x7fffffff) max = 0x7fffffff;
						if(max < min){
							var tmp = min;
							min = max;
							max = tmp;
						}
						if(max - min > 10000) max = min + 10000;
						p += m[0].length;
						numbers.addNumbers(min,max);
					}else{
						// 番号
						m = str.substr(p).match(re_number);
						if(m){
							p += m[0].length;
							var id = parseInt(StringConvertFromNumericFullToNumericHalf(m[1]));
							if(id < 1) id = 1;
							if(id > 0x7fffffff) id = 0x7fffffff;
							numbers.addNumber(id);
						}
					}

					if(m){
						// カンマ
						if(RegExp.rightContext.search(",") == 0){
							p += 1;
							continue;
						}
					}
					break;
				}
			}
			return numbers;
		}

		// -
		// エレメントを解析
		// -
		var useful = (function(){
			var post_info = element;
			var post_file;
			var post_message;

			try{
				if(post_info.tagName != "DIV")	return false;
				if(!(post_info.className.match(new RegExp("^postInfo","i"))))	return false;
			}catch(e){
				return false;
			}

			try{
				post_message = post_info.nextSibling;
				if(post_message.tagName == "DIV"){
					if(post_message.className == "file"){
						post_file = post_message;
						post_message = post_file.nextSibling;
					}
				}
			}catch(e){
			}

			try{
				if(post_message.tagName != "BLOCKQUOTE")	return false;
				if(post_message.className != "postMessage")	return false;
			}catch(e){
				return false;
			}

			if(!post_file){
				try{
					var node = post_info.previousSibling;
					if(node.tagName == "DIV"){
						if(node.className == "file"){
							post_file = node;
						}
					}
				}catch(e){
				}
			}

			// document に未登録
			if(!DomNodeGetAttachedDocument(post_info))	return false;

			// ポップアップを除外
			var board = false;
			var node = post_info;
			while(node){
				if(node.className == "board"){
					board = true;
					break;
				}
				node = node.parentNode;
			}
			if(!board)	return false;

			// -
			// クリーンアップ
			// -
			(function(){
				function cleanupInfo(target){
					var nodes = ElementGetElementsByTagName(post_info,"span");
					var i;
					var num = nodes.length;
					for(i=0;i<num;i++){
						var node = nodes[i];
						if(node.className == "postertrip"){
							// トリップ
							var m = ElementGetTextContent(element).match(new RegExp("(!|!!)([a-zA-Z0-9+/.]{10})","i"));
							if(m){
								ElementSetTextContent(node,m[0]);
							}
							break;
						}
					}
				}

				function cleanupMessage(target){
					BbsControlSearchTrash(target,function(element){
						var node = element.firstChild;
						if(!node)	return null;
						if(node.nodeType != 3)	return null;

						// ID
						var m = node.nodeValue.match(new RegExp("^ID:(|[ ])([a-zA-Z0-9+/.]{8})","i"));
						if(m){
							// 直後テキスト
							var node = DocumentCreateText(m[0]);
							DomNode_InsertAfter(element,node);
							DomNodeRemove(element);
							return null;
						}

						// トリップ
						var m = node.nodeValue.match(new RegExp("^(!|!!)([a-zA-Z0-9+/.]{10})","i"));
						if(m){
							// 直後テキスト
							var node = DocumentCreateText(m[0]);
							DomNode_InsertAfter(element,node);
							DomNodeRemove(element);
							return null;
						}

						return null;
					});
				}

				if(post_info){
					cleanupInfo(post_info);
				}
				if(post_message){
					cleanupMessage(post_message);
				}
			})();

			// ナンバーを取得
			var info_text = ElementGetTextContent(post_info);
			if(!(info_text.match(new RegExp("No\\.([0-9]+)","i"))))	return false;

			// ナンバーからレスポンスオブジェクトを取得
			var response = bbs_dictionary.getResponse(parseInt(RegExp.$1));

			// レスポンス解析
			if(!response.getAnalyzed()){

				// IDの取得
				if(info_text.match(new RegExp("\\(ID:[ ]([a-zA-Z0-9+/.]+)\\)","i"))){
					response.setId(RegExp.$1);
				}

				// 名前の取得
				(function(){
					var nodes = ElementGetElementsByTagName(post_info,"span");
					var i;
					var num = nodes.length;
					for(i=0;i<num;i++){
						var node = nodes[i];
						if(node.className == "postertrip"){
							response.setName(ElementGetTextContent(node));
							break;
						}
					}
				})();

				// フォロー解析
				var dictionary = new Object();
				(function(){
					var nodes = ElementGetElementsByTagName(post_message,"a");
					var i;
					var num = nodes.length;
					for(i=0;i<num;i++){
						var numbers = StringCreateResponseAnchorNumbers(ElementGetTextContent(nodes[i]));
						numbers.getNumbers(function(n){
							if(!dictionary[n]){
								var following = bbs_dictionary.getResponse(n);
								following.addFollower(response);
								dictionary[n] = true;
							}
						});
					}
				})();

				// オリジナルエレメントをセット
				if(post_info)		response.addOriginalElements("post_info",post_info);
				if(post_file)		response.addOriginalElements("post_file",post_file);
				if(post_message)	response.addOriginalElements("post_message",post_message);

				// 消去時に実行されるイベント
				response.onerase = function(){
					var original = response.getOriginalElements();
					if(original.length){
						var node = original[0].element;
						while(node){
							if(node.nodeType != 1) break;
							if(ElementGetClassName(node).match(new RegExp("^postContainer","i"))){
								var revise_scroll = new DocumentReviseScroll();
								revise_scroll.executeRemoveElementBefore(node);
								DomNodeRemove(node);
								revise_scroll.executeRemoveElementAfter(node);
								break;
							}
							node = node.parentNode;
						}
					}
				};

				response.setAnalyzed();
			}

			// レスポンスダイアログを登録(ルート)
			attachBbsResponseDialog(
				response,
				{
					post_info:post_info,
					post_file:post_file,
					post_message:post_message,
					parent:document.body
				},
				null,
				null
			);

			return true;
		})();

		response({useful:useful});
		return true;
	}

			]);

			// -
			// 掲示板設定「ふたば☆ちゃんねる」
			// -
			attachItem( "ExpandBbs_ScriptInitialize_2chan" , [
	
	function(info,response){
		var work = info.work;

		// -
		// 基本URL抽出
		// -
		var url = document.URL;
		var bbs_list = [
			{url:"^(http|https)://[^.]+\\.2chan\\.net/[^/]+/res/[0-9]+.htm",name:"2chan"},
			{url:"^http://[^.]+\.ftbucket\\.info/.*/cont/.*$",name:"ftbucket"}
		];

		var i;
		var num = bbs_list.length;
		for(i=0;i<num;i++){
			var m = url.match(new RegExp(bbs_list[i].url,"i"));
			if(m){
				work.base_url = m[0];
				work.bbs_name = bbs_list[i].name;
				break;
			}
		}

		return false;
	},
	function (info,response){
		var work = info.work;
		if(!(work.bbs_name)){
			return false;
		}

		var last_id = 1;
		var element_parent = null;
		var read_more_button = null;
		var element_form = null;
		var base_url = work.base_url;
		var resource_url = base_url;

		// -
		// 双葉辞書
		// -
		function FutabaDictionary(){
			var _this = this;

			// -
			// レスポンス生成
			// -
			function createResponse(number){
				var _response = new Object();

				// -
				// 開放
				// -
				_response.release = function(obj){
					var _prev = _response._prev;
					var _next = _response._next;
					_prev._next = _next;
					_next._prev = _prev;
					_response._prev = _response;
					_response._next = _response;
					delete _number_dictionary[_image_id];
					delete _image_id_dictionary[_image_id];
					_response._text_dictionary = new Object();
				};

				// -
				// 番号を取得
				// -
				_response.getNumber = function(){
					return number;
				};

				// -
				// テキストを登録
				// -
				_response.attachText = function(str){
					var m = str.match(new RegExp("([  ]*)([>>]*)([  ]*)(.+?)([  ]*)$"));
					if(!m) return;
					if(!m[4]) return;
					_response._text_dictionary[m[4]] = {
						depth:m[2].length
					};
				};

				// -
				// テキストからレスポンスを取得
				// -
				_response.getResponsesFromText = function(str){
					var ary = new Array();

					var m = str.match(new RegExp("^([  ]*)([>>]*)([  ]*)(.+?)([  ]*)$","i"));
					if(!m) return ary;
					if(!m[4]) return ary;
					var depth = m[2].length;
					str = m[4];

					var str_num = str.length;
					if(str_num < 1) return ary;
					if(depth < 1) return ary;

					// 完全一致
					var list = _response._prev;
					while(_response_list != list){
						var p = list._text_dictionary[str];
						if(p){
							if(p.depth < depth){
								ary.push(list);
							}
						}
						list = list._prev;
					}
					if(ary.length) return ary;

					// 部分一致
					var list = _response._prev;
					while(_response_list != list){
						var k;
						var d = list._text_dictionary;
						for(k in d){
							var p = d[k];
							if(p.depth < depth){
								if(k.indexOf(str) >= 0){
									ary.push(list);
									break;
								}
							}
						}
						list = list._prev;
					}
					return ary;
				};

				// -
				// イメージ ID を登録
				// -
				_response.setImageId = function(id){
					_image_id = id;
					_image_id_dictionary[_image_id] = _response;
				};

				// -
				// プライベート変数
				// -
				var _image_id;

				// -
				// 初期化
				// -
				(function(){
					_response._prev = _response;
					_response._next = _response;
					_response._text_dictionary = new Object();
					var list = _response_list._prev;
					while(_response_list != list){
						if(list.getNumber() >= number){
							break;
						}
						list = list._prev;
					}
					var _next = list;
					var _prev = _next._prev;
					_prev._next = _response;
					_next._prev = _response;
					_response._prev = _prev;
					_response._next = _next;
					_number_dictionary[number] = _response;
				})();

				return _response;
			}

			// -
			// 番号からレスポンスを生成
			// -
			_this.createResponse = function(number){
				var response = _number_dictionary[number];
				if(!response){
					response = createResponse(number);
					_number_dictionary[number] = response;
				}
				return response;
			};

			// -
			// 番号からレスポンスを取得
			// -
			_this.getResponse = function(number){
				return _number_dictionary[number];
			};

			// -
			// 画像 ID からレスポンスを取得
			// -
			_this.getResponseFromImageId = function(id){
				return _image_id_dictionary[id];
			};

			// -
			// プライベート変数
			// -
			var _number_dictionary;
			var _image_id_dictionary;
			var _response_list;

			// -
			// 初期化
			// -
			(function(){
				_number_dictionary = new Object();
				_image_id_dictionary = new Object();
				_response_list = new Object();
				_response_list._prev = _response_list;
				_response_list._next = _response_list;
			})();
		}

		// -
		// ノードリストから解析
		// -
		work.analyzeNodeList = function(node_list){
			var re_number = new RegExp("No\\.([0-9]+)","i");
			var re_image = new RegExp(".*/([0-9]+)(|s)\\.(bmp|gif|jpeg|jpe|jpg|png|webp|webm|mp4)","i");

			var node_num = node_list.length;
			var info_text = "";
			var i;
			for(i=0;i<node_num;i++){
				info_text += ElementGetTextContent(node_list[i]);
			}

			// ナンバーを取得
			var m = info_text.match(re_number);
			if(!m) return;
			var id = parseInt(m[1]);

			if(work.futaba_dictionary.getResponse(id)) return;
			var response = work.futaba_dictionary.createResponse(id);

			try{
				var blockquote = null;
				var i;
				for(i=node_num-1;i>=0;i--){
					var node = node_list[i];
					if(node.tagName == "BLOCKQUOTE"){
						blockquote = node;
						break;
					}
				}

				// 画像 ID
				var node = DomNodeGetPreviousElementSibling(blockquote);
				while(node){
					var img = ElementGetElementsByTagName(node,"IMG")[0];
					if(img){
						if(img.src.match(re_image)){
							response.setImageId(RegExp.$1);
							break;
						}
					}
					node = DomNodeGetPreviousElementSibling(node);
				}

				// 本文
				var nodes;
				switch(work.bbs_name){
				default:
					nodes = blockquote.childNodes;
					break;
				}
				var node_num = nodes.length;
				var i;
				var s = "";
				for(i=0;i<node_num;i++){
					var node = nodes[i];
					switch(node.nodeType){
					case 1:
						if(node.tagName == "BR"){
							if(s){
								response.attachText(s);
							}
							s = "";
						}else{
							s += ElementGetTextContent(node);
						}
						break;
					case 3:
						s += node.nodeValue;
						break;
					}
				}
				if(s){
					response.attachText(s);
				}
			}catch(e){
			}
		};

		// -
		// レスポンス親要素
		// -
		switch(work.bbs_name){
		default:
			// 2019/11/18 以前
			(function(){
				if(element_parent) return;
				var i;
				var nodes = ElementGetElementsByTagName(document.body,"form");
				var num = nodes.length;
				for(i=0;i<num;i++){
					var node = nodes[i];
					if(node.action.indexOf("futaba.php") != -1){
						if(ElementGetElementsByTagName(node,"blockquote").length){
							element_parent = node;
							break;
						}
					}
				}
			})();

			// 2019/11/18 以降
			(function(){
				if(element_parent) return;
				var node = ElementGetElementsByClassName(document.body,"thre")[0];
				if(!node) return;
				if(!node.getAttribute("data-res")) return;
				element_parent = node;
			})();

			if(!element_parent) return false;
			break;
		}

		if(work.bbs_name == "2chan"){

			// -
			// フォーム位置補正
			// -
			function revisePositionForm(){
				try{
					var ftbl = document.getElementById("ftbl");
					var ufm = document.getElementById("ufm");
					if(ftbl.style.position == "absolute"){
						var p = DocumentGetScrollPos();
						var r = ufm.getBoundingClientRect();
						ftbl.style.top = (p.y + r.top) + "px";
					}
				}catch(e){}
			}

			// -
			// 最新の番号を取得
			// -
			function getLastestNumber(){
				try{
					var re_number = new RegExp("No\\.([0-9]+)","i");
					var nodes = ElementGetElementsByTagName(document.body,"table");
					var i = nodes.length-1;
					for(;i>=0;i--){
						var node = ElementGetElementsByClassName(nodes[i],"rtd")[0];
						if(node){
							if(ElementGetTextContent(node).match(re_number)){
								return parseInt(RegExp.$1);
							}
						}
					}
				}catch(e){}
				return -1;
			}

			// -
			// 継ぎ足し読み込み
			// -
			function readMore(callback){
				var element_result = document.getElementById("contdisp");

				// ローダーオブジェクトを作成
				var loader = new Loader();

				// 成功
				loader.onload = function(str){
					var re_number = new RegExp("No\\.([0-9]+)","i");
					var re_result = new RegExp("<span id=\"contdisp\">(.*?)<\\\\/span>","i");
					var element_last = null;

					var p = 0;
					var n = str.length;
					var add_count = 0;
					function f(){
						try{
							if(p >= n) throw 0;
							p = str.indexOf("<table border=0>",p);
							if(p < 0) throw 0;
							var e = str.indexOf("</td>",p);
							if(e >= 0){
								e = str.indexOf("</tr>",e + 5);
								if(e >= 0){
									e = str.indexOf("</table>",e + 5);
									if(e >= 0) e += 8;
								}
							}
							var s = str.substring(p,e);
							var m = s.match(re_number);
							if(m){
								var lastest_id = getLastestNumber();
								if(last_id < lastest_id){
									last_id = lastest_id;
								}
								var id = parseInt(m[1]);
								if(last_id < id){
									var response = bbs_dictionary.getResponse(id);
									response.clearAnalyzed();
									response.clearOriginalElements();
									response.clearFollowing();

									var nodes = StringHtmlCreateDomNodesSafe(s);
									var j;
									var node_num = nodes.length;
									for(j=0;j<node_num;j++){
										DomNode_InsertAfter(element_last,nodes[j]);
										element_last = nodes[j];
									}

									// フォーム位置補正
									revisePositionForm();

									add_count += 1;
									last_id = id;
								}
							}

							if(p < e){
								p = e;
								execute_queue.attachFirst(f,null);
								return;
							}
						}catch(e){
						}

						if(element_result){
							var m = str.match(re_result);
							if(m){
								ElementSetTextContent(element_result,m[1]);
							}else{
								ElementSetTextContent(element_result,"not found!");
							}
						}

						// フォーム位置補正
						revisePositionForm();

						callback({result:true,add_count:add_count});
					}

					var nodes = ElementGetElementsByTagName(element_parent,"table");
					if(nodes.length){
						element_last = nodes[nodes.length-1];
					}
					if(!element_last){
						var nodes = ElementGetElementsByTagName(element_parent,"blockquote");
						if(nodes.length){
							element_last = nodes[nodes.length-1];
						}
					}

					execute_queue.attachFirst(f,null);
				};

				// 失敗
				loader.onerror = function(){
					if(element_result){
						ElementSetTextContent(element_result,"not found!");
					}
					callback({result:false});
				};

				// テキストの読み込み
				loader.setMethod("GET");
				loader.setURL(resource_url);
				loader.overrideMimeType("text/plain; charset=Shift_JIS");
				loader.loadText();
			}

			// -
			// 最後尾 ID
			// -
			var nodes = ElementGetElementsByTagName(element_parent,"table");
			var i;
			var node_num = nodes.length;
			for(i=node_num-1;i>=0;i--){
				var node = nodes[i];
				var m = ElementGetTextContent(node).match(new RegExp("No\\.([0-9]+)","i"));
				if(m){
					last_id = parseInt(m[1]);
					break;
				}
			}

			// -
			// アクセス先 URL
			// -
			resource_url = base_url;

			// -
			// BbsControlDockingForm 作成
			// -
			(function(){
				var node = document.getElementById("ftbl");
				if(node){
					var nodes = node.getElementsByTagName("tbody");
					var num = nodes.length;
					if(num){
						var docking_form = new BbsControlDockingForm(nodes[0],false);
						docking_form.setStyle("background:#e8e8ec; background-image:linear-gradient(to bottom, #f8f8fc, #e8e8ec); padding:20px; border:1px solid #888; border-radius:4px; box-shadow:2px 2px 5px #aaa; margin:0px; display:block; visibility:visible");
						work.docking_form = docking_form;
					}
				}
			})();

			// -
			// BbsControlReadMoreButton 作成
			// -
			read_more_button = new BbsControlReadMoreButton();
			read_more_button.setWaitTime(2 * 1000);
			read_more_button.onclick = readMore;
			var node = document.getElementById("contres");
			if(node){
				DomNode_InsertAfter(node,read_more_button.getElement());
			}

			// -
			// 書き込みをポップアップ化
			// -
			(function(){
				var element_form;
				var input_submit;
				var element_textarea;
				var event_handler_release;

				(function(){
					// フォーム
					var node = document.getElementById("ftbl");
					while(node){
						if(node.tagName == "FORM"){
							element_form = node;
							break;
						}
						node = node.parentNode;
					}

					// サブミットボタン
					if(element_form){
						var nodes = ElementGetElementsByTagName(element_form,"input");
						for(i=0;i<nodes.length;i++){
							if(nodes[i].type.toLowerCase() == "submit"){
								input_submit = nodes[i];
								break;
							}
						}
						var nodes = ElementGetElementsByTagName(element_form,"textarea");
						if(nodes.length){
							element_textarea = nodes[0];
							work.form_textarea = element_textarea;
						}
					}
				})();

				// 開放
				function release(){
					if(event_handler_release){
						event_handler_release.release();
						event_handler_release = null;
					}
				}

				// クリア
				function clear(){
					var ary = new Array();
					var i;
					var num = element_form.length;
					for(i=0;i<num;i++){
						ary.push({e:element_form[i],v:element_form[i].value});
					}
					element_form.reset();
					for(i=0;i<num;i++){
						try{
							var item = ary[i];
							item.e.value = item.v;
						}catch(e){}
					}
					element_textarea.value = "";
				}

				(function(){
					if(!element_form) return;
					if(!input_submit) return;
					if(!element_textarea) return;

					event_handler_release = page_expand_event_dispatcher.createEventHandler("release");
					event_handler_release.setFunction(function(){
						release();
					});

					if(work.docking_form){
						work.docking_form.onreset = clear;
					}
				})();
			})();

			// -
			// 完了後フォーム位置補正
			// -
			execute_queue.attachLast(function(){
				revisePositionForm();
			},null);

		}

		// -
		// 双葉辞書を生成
		// -
		(function(){
			work.futaba_dictionary = new FutabaDictionary();
			var nodes = ElementGetElementsByTagName(element_parent,"table");
			var node_num = nodes.length;
			var p = 0;

			(function(){
				var node = ElementGetElementsByTagName(document.body,"blockquote")[0];
				if(!node) return;

				var ary = new Array();
				while(node){
					if(node.tagName == "HR") break;
					ary.unshift(node);					
					node = node.previousSibling;
				}
				work.analyzeNodeList(ary);
			})();

			function f(){
				try{
					var node = nodes[p];
					if(!node) throw 0;
					var cells = node.rows[0].cells;
					work.analyzeNodeList(cells[cells.length - 1].childNodes);
				}catch(e){
				}

				if(p < node_num){
					p += 1;
					execute_queue.attachFirst(f,null);
					return;
				}

				response({result:true});
			}

			execute_queue.attachFirst(f,null);
		})();

		return true;
	},
	function (info,response){
		response({result:false});
		return true;
	}

			]);

			// -
			// 掲示板設定「ふたば☆ちゃんねる」
			// -
			attachItem( "ExpandBbs_ScriptCallback_2chan" , [
	
	function(info,response){
		var element = info.element;
		var work = info.work;

		// -
		// レスポンスダイアログを登録
		// -
		function attachBbsResponseDialog(response,node,parent_dialog,type){

			// -
			// レスアンカー
			// -
			function forResponseAnchor(target){
				if(BbsControlResponseAnchorExist(target))	return;

				// -
				// BbsControlResponseAnchor を生成
				// -
				(function(){
					var i;
					var nodes = ElementGetElementsByTagName(target,"a");
					var num = nodes.length;
					for(i=0;i<num;i++){
						var node = nodes[i];
						var numbers = StringCreateResponseAnchorNumbers(ElementGetTextContent(node));
						if(numbers.getCount()){
							var control_res_anchor = new BbsControlResponseAnchor(node,false);
							control_res_anchor.setResponseAnchorNumbers(numbers);
						}
					}
				})();

				// -
				// BbsControlResponseAnchor を検索
				// -
				BbsControlResponseAnchorSearch(target,function(control_res_anchor){

					var element_res_anchor = control_res_anchor.getElement();
					var numbers = control_res_anchor.getResponseAnchorNumbers();

					// ダイアログを作成
					var response_dialog = new BbsResponseDialog();
					if(parent_dialog)	parent_dialog.attachChild(response_dialog);
					response_dialog.setElementParent(node.parent);
					response_dialog.setElementHitArea(element_res_anchor);
					response_dialog.oncreate = function(_window,callback){

						var created = false;
						var i = 0;
						var number_list = numbers.getNumberList();
						var num = number_list.length;
						if(!num) return false;

						function f(){
							var following = bbs_dictionary.getResponse(number_list[i]);
							var clone = following.getCloneElements();

							var j;
							var clone_num = clone.length;
							if(clone_num){
								var table = DocumentCreateElement("table");
								_window.appendChild(table);
								var tr = table.insertRow(-1);
								var td = tr.insertCell(-1);
								table.style.margin = "0px 0px 10px";

								var param = new Object();
								param.parent = node.parent;
								for(j=0;j<clone_num;j++){
									var obj = clone[j];
									if(!param[obj.name]) param[obj.name] = new Array();
									param[obj.name].push(obj.element);
									td.appendChild(obj.element);
								}

								// レスポンスダイアログを登録
								attachBbsResponseDialog(following,param,response_dialog,"response");

								created = true;
							}

							i += 1;
							if(i < num){
								execute_queue.attachFirst(f,null);
							}else{
								callback({result:created});
							}
						}
						execute_queue.attachFirst(f,null);
					};

					return null;
				});
			}

			// -
			// 引用
			// -
			function forQuote(target){
				if(BbsControlQuoteExist(target))	return;

				// -
				// BbsControlQuote を生成
				// -
				(function(){
					function NumberListEqual(a,b){
						var i;
						var n = a.length;
						if(n != b.length) return false;
						for(i=0;i<n;i++){
							if(a[i] != b[i]) return false;
						}
						return true;
					}

					var numbers_old = null;
					var numbers_new = null;
					var i;
					var nodes = target.childNodes;

					var num = nodes.length;
					for(i=num-1;i>=0;i--){
						var node = nodes[i];
						if(node.tagName == "FONT"){
							var numbers = QuoteStringCreateResponseAnchorNumbers(response.getNumber(),ElementGetTextContent(node));
							if(numbers.getCount()){
								numbers_new = numbers.getNumberList();
								var abbreviate = false;
								if(numbers_old){
									if(NumberListEqual(numbers_old,numbers_new)){
										abbreviate = true;
									}
								}
								if(!abbreviate){
									var control_quote = new BbsControlQuote(null,true);
									var element_quote = control_quote.getElement();
									var style = element_quote.style;
									style.fontSize = "small";
									style.textDecoration = "underline";
									style.marginLeft = "10px";
									//var textnode_quote = DocumentCreateText(" >>" + numbers_new.join(","));
									var textnode_quote = DocumentCreateText(" >>" + numbers_new.length);
									element_quote.appendChild(textnode_quote);
									DomNode_InsertLastChild(node,element_quote);
									control_quote.setResponseAnchorNumbers(numbers);
									numbers_old = numbers_new;
								}
							}
						}
					}
				})();

				// -
				// BbsControlQuote を検索
				// -
				BbsControlQuoteSearch(target,function(control_quote){

					var element_res_anchor = control_quote.getElement();
					var numbers = control_quote.getResponseAnchorNumbers();

					// ダイアログを作成
					var response_dialog = new BbsResponseDialog();
					if(parent_dialog)	parent_dialog.attachChild(response_dialog);
					response_dialog.setElementParent(node.parent);
					response_dialog.setElementHitArea(element_res_anchor);
					response_dialog.oncreate = function(_window,callback){

						var created = false;
						var i = 0;
						var number_list = numbers.getNumberList();
						var num = number_list.length;
						if(!num) return false;

						function f(){
							var following = bbs_dictionary.getResponse(number_list[i]);
							var clone = following.getCloneElements();

							var j;
							var clone_num = clone.length;
							if(clone_num){
								var table = DocumentCreateElement("table");
								_window.appendChild(table);
								var tr = table.insertRow(-1);
								var td = tr.insertCell(-1);
								table.style.margin = "0px 0px 10px";

								var param = new Object();
								param.parent = node.parent;
								for(j=0;j<clone_num;j++){
									var obj = clone[j];
									if(!param[obj.name]) param[obj.name] = new Array();
									param[obj.name].push(obj.element);
									td.appendChild(obj.element);
								}

								// レスポンスダイアログを登録
								attachBbsResponseDialog(following,param,response_dialog,"response");

								created = true;
							}

							i += 1;
							if(i < num){
								execute_queue.attachFirst(f,null);
							}else{
								callback({result:created});
							}
						}
						execute_queue.attachFirst(f,null);
					};

					return null;
				});
			}

			// -
			// ID
			// -
			function forId(target){
				if(BbsControlIdExist(target))	return;

				var control_list = new Array();

				// -
				// BbsControlId を生成
				// -
				(function(){
					var p;
					var n;
					var q;
					var ignore_dictionary = {"A":1,"SCRIPT":1};
					var queue = new Object();
					q = {p:queue,n:queue,node:target};
					queue.p = q;
					queue.n = q;

					while(queue.n != queue){
						q = queue.n;
						p = q.p;
						n = q.n;
						p.n = n;
						n.p = p;
						var node = q.node;
						switch(node.nodeType){
						case 1:
							if(!(ignore_dictionary[node.tagName])){
								var i;
								var nodes = node.childNodes;
								var num = nodes.length;
								for(i=0;i<num;i++){
									n = queue;
									p = n.p;
									q = {p:p,n:n,node:nodes[i]};
									p.n = q;
									n.p = q;
								}
							}

							break;
						case 3:
							while(node){

								var m = DomNodeGetNodeValue(node).match(new RegExp("ID:([a-zA-Z0-9+/.]{8,10})[●!]{0,2}","i"));
								if(!m)	break;

								// 元のテキストノード
								DomNodeSetNodeValue(node,RegExp.leftContext);

								// BbsControlId を生成
								var control_id = new BbsControlId(null,false);
								control_id.setId(m[1]);
								control_list.push(control_id);
								var element_id = control_id.getElement();
								ElementSetTextContent(element_id,m[0]);
								DomNode_InsertAfter(node,element_id);

								// 直後テキスト
								node = DocumentCreateText(RegExp.rightContext);
								DomNode_InsertAfter(element_id,node);
							}
							break;
						}
					}
				})();

				// -
				// BbsControlId を検索
				// -
				var i;
				var num = control_list.length;
				for(i=0;i<num;i++){
					(function(control_id){

						control_id.setResponse(response);

						var id = control_id.getId();
						var myself = (response.getId() === id);
						var element_id = control_id.getElement();
						var textnode_id = DocumentCreateText("");

						element_id.appendChild(textnode_id);

						// -
						// 変化があったときに実行されるイベント
						// -
						control_id.onchange = function(count){
							if(count > 1){
								DomNodeSetNodeValue(textnode_id,"(" + count + ")");
							}else{
								DomNodeSetNodeValue(textnode_id,"");
							}

							var style = element_id.style;
							if(count >= 5){
								StyleDeclarationSetProperty(style,"color","#e80000");
								StyleDeclarationRemoveProperty(style,"font-size");
							}else if(count >= 2){
								StyleDeclarationRemoveProperty(style,"color");
								StyleDeclarationRemoveProperty(style,"font-size");
							}else{
								StyleDeclarationSetProperty(style,"color","#707070");
								StyleDeclarationSetProperty(style,"font-size","small");
							}
						};
						control_id.update();

						// -
						// ポップアップ化
						// -
						if(type == "id"){
							if(myself) return null;
						}

						// ダイアログを作成
						var response_dialog = new BbsResponseDialog();
						if(parent_dialog)	parent_dialog.attachChild(response_dialog);
						response_dialog.setElementParent(node.parent);
						response_dialog.setElementHitArea(element_id);
						response_dialog.oncreate = function(_window,callback){

							var responses = bbs_dictionary.getResponsesFromId(id);
							var i = 0;
							var num = responses.length;
							if(myself){
								if(num < 2) return false;
							}else{
								if(num < 1) return false;
							}

							function f(){
								var response_id = responses[i];
								var clone = response_id.getCloneElements();

								var j;
								var clone_num = clone.length;
								if(clone_num){
									var table = DocumentCreateElement("table");
									_window.appendChild(table);
									var tr = table.insertRow(-1);
									var td = tr.insertCell(-1);
									table.style.margin = "0px 0px 10px";

									var param = new Object();
									param.parent = node.parent;
									for(j=0;j<clone_num;j++){
										var obj = clone[j];
										if(!param[obj.name]) param[obj.name] = new Array();
										param[obj.name].push(obj.element);
										td.appendChild(obj.element);
									}

									// レスポンスダイアログを登録
									attachBbsResponseDialog(response_id,param,response_dialog,"id");
								}

								i += 1;
								if(i < num){
									execute_queue.attachFirst(f,null);
								}else{
									callback({result:true});
								}
							}
							execute_queue.attachFirst(f,null);
						};

						return null;
					})(control_list[i]);
				}
			}

			// -
			// トリップ
			// -
			function forName(target){
				if(BbsControlNameExist(target))	return;

				var control_list = new Array();

				// -
				// BbsControlName を生成
				// -
				(function(){
					var p;
					var n;
					var q;
					var ignore_dictionary = {"SCRIPT":1};
					var queue = new Object();
					q = {p:queue,n:queue,node:target};
					queue.p = q;
					queue.n = q;

					while(queue.n != queue){
						q = queue.n;
						p = q.p;
						n = q.n;
						p.n = n;
						n.p = p;
						var node = q.node;
						switch(node.nodeType){
						case 1:
							if(!(ignore_dictionary[node.tagName])){
								var i;
								var nodes = node.childNodes;
								var num = nodes.length;
								for(i=0;i<num;i++){
									n = queue;
									p = n.p;
									q = {p:p,n:n,node:nodes[i]};
									p.n = q;
									n.p = q;
								}
							}
							break;
						case 3:
							while(node){

								// 本文
								var m = DomNodeGetNodeValue(node).match(new RegExp("(◆(|[ ])[a-zA-Z0-9+/.]{10,12})","i"));
								if(!m)	break;

								// 元のテキストノード
								DomNodeSetNodeValue(node,RegExp.leftContext);

								// BbsControlName を生成
								var control_name = new BbsControlName(null,false);
								control_name.setName(m[0]);
								control_list.push(control_name);
								var element_name = control_name.getElement();
								ElementSetTextContent(element_name,m[0]);
								DomNode_InsertAfter(node,element_name);

								// 直後テキスト
								node = DocumentCreateText(RegExp.rightContext);
								DomNode_InsertAfter(element_name,node);
							}
							break;
						}
					}
				})();

				// -
				// BbsControlName を検索
				// -
				var i;
				var num = control_list.length;
				for(i=0;i<num;i++){
					(function(control_name){

						control_name.setResponse(response);

						var name = control_name.getName();
						var myself = (response.getName() === name);
						var element_name = control_name.getElement();
						var textnode_name = DocumentCreateText("");


						// -
						// 変化があったときに実行されるイベント
						// -
						control_name.onchange = function(count){
							if(count > 1){
								DomNodeSetNodeValue(textnode_name,"(" + count + ")");
							}else{
								DomNodeSetNodeValue(textnode_name,"");
							}

							var style = element_name.style;
							if(count >= 5){
								StyleDeclarationSetProperty(style,"color","#e80000");
								StyleDeclarationRemoveProperty(style,"font-size");
							}else if(count >= 2){
								StyleDeclarationRemoveProperty(style,"color");
								StyleDeclarationRemoveProperty(style,"font-size");
							}else{
								StyleDeclarationSetProperty(style,"color","#707070");
								StyleDeclarationSetProperty(style,"font-size","small");
							}
						};
						control_name.update();
						element_name.appendChild(textnode_name);

						// -
						// ポップアップ化
						// -
						if(type == "name"){
							if(myself) return null;
						}

						// ダイアログを作成
						var response_dialog = new BbsResponseDialog();
						if(parent_dialog)	parent_dialog.attachChild(response_dialog);
						response_dialog.setElementParent(node.parent);
						response_dialog.setElementHitArea(element_name);
						response_dialog.oncreate = function(_window,callback){

							var responses = bbs_dictionary.getResponsesFromName(name);
							var i = 0;
							var num = responses.length;
							if(myself){
								if(num < 2) return false;
							}else{
								if(num < 1) return false;
							}

							function f(){
								var response_name = responses[i];
								var clone = response_name.getCloneElements();

								var j;
								var clone_num = clone.length;
								if(clone_num){
									var table = DocumentCreateElement("table");
									_window.appendChild(table);
									var tr = table.insertRow(-1);
									var td = tr.insertCell(-1);
									table.style.margin = "0px 0px 10px";

									var param = new Object();
									param.parent = node.parent;
									for(j=0;j<clone_num;j++){
										var obj = clone[j];
										if(!param[obj.name]) param[obj.name] = new Array();
										param[obj.name].push(obj.element);
										td.appendChild(obj.element);
									}

									// レスポンスダイアログを登録
									attachBbsResponseDialog(response_name,param,response_dialog,"name");
								}

								i += 1;
								if(i < num){
									execute_queue.attachFirst(f,null);
								}else{
									callback({result:true});
								}
							}
							execute_queue.attachFirst(f,null);
						};

						return null;
					})(control_list[i]);
				}
			}

			// -
			// ホスト
			// -
			function forHost(target){
				if(BbsControlHostExist(target))	return;

				var control_list = new Array();

				// -
				// BbsControlHost を生成
				// -
				(function(){
					var p;
					var n;
					var q;
					var ignore_dictionary = {"B":1,"SCRIPT":1};
					var queue = new Object();
					q = {p:queue,n:queue,node:target};
					queue.p = q;
					queue.n = q;

					while(queue.n != queue){
						q = queue.n;
						p = q.p;
						n = q.n;
						p.n = n;
						n.p = p;
						var node = q.node;
						switch(node.nodeType){
						case 1:
							if(!(ignore_dictionary[node.tagName])){
								var i;
								var nodes = node.childNodes;
								var num = nodes.length;
								for(i=0;i<num;i++){
									n = queue;
									p = n.p;
									q = {p:p,n:n,node:nodes[i]};
									p.n = q;
									n.p = q;
								}
							}
							break;
						case 3:
							while(node){
								var text_value = DomNodeGetNodeValue(node);

								var m = text_value.match(new RegExp("(IP:)([-.:*a-zA-Z0-9()]+)","i"));
								if(m){
									// 元のテキストノード
									DomNodeSetNodeValue(node,RegExp.leftContext + m[1]);

									// BbsControlHost を生成
									var control_host = new BbsControlHost(null,false);
									control_host.setHost(m[2]);
									control_list.push(control_host);
									var element_host = control_host.getElement();
									ElementSetTextContent(element_host,m[2]);
									DomNode_InsertAfter(node,element_host);

									// 直後テキスト
									node = DocumentCreateText(RegExp.rightContext);
									DomNode_InsertAfter(element_host,node);
									continue;
								}

								break;
							}

							break;
						}
					}
				})();

				// -
				// BbsControlHost を検索
				// -
				var i;
				var num = control_list.length;
				for(i=0;i<num;i++){
					(function(control_host){

						control_host.setResponse(response);

						var host = control_host.getHost();
						var myself = (response.getHost() === host);
						var element_host = control_host.getElement();
						var textnode_host = DocumentCreateText("");


						// -
						// 変化があったときに実行されるイベント
						// -
						control_host.onchange = function(count){
							if(count > 1){
								DomNodeSetNodeValue(textnode_host,"[" + count + "]");
							}else{
								DomNodeSetNodeValue(textnode_host,"");
							}

							var style = element_host.style;
							if(count >= 5){
								StyleDeclarationSetProperty(style,"color","#e80000");
								StyleDeclarationRemoveProperty(style,"font-size");
							}else if(count >= 2){
								StyleDeclarationRemoveProperty(style,"color");
								StyleDeclarationRemoveProperty(style,"font-size");
							}else{
								StyleDeclarationSetProperty(style,"color","#707070");
								StyleDeclarationSetProperty(style,"font-size","80%");
							}
						};
						control_host.update();
						element_host.appendChild(textnode_host);

						// -
						// ポップアップ化
						// -
						if(type == "host"){
							if(myself) return null;
						}

						// ダイアログを作成
						var response_dialog = new BbsResponseDialog();
						if(parent_dialog)	parent_dialog.attachChild(response_dialog);
						response_dialog.setElementParent(node.parent);
						response_dialog.setElementHitArea(element_host);
						response_dialog.oncreate = function(_window,callback){

							var responses = bbs_dictionary.getResponsesFromHost(host);
							var i = 0;
							var num = responses.length;
							if(myself){
								if(num < 2) return false;
							}else{
								if(num < 1) return false;
							}

							function f(){
								var response_host = responses[i];
								var clone = response_host.getCloneElements();

								var j;
								var clone_num = clone.length;
								if(clone_num){
									var table = DocumentCreateElement("table");
									_window.appendChild(table);
									var tr = table.insertRow(-1);
									var td = tr.insertCell(-1);
									table.style.margin = "0px 0px 10px";

									var param = new Object();
									param.parent = node.parent;
									for(j=0;j<clone_num;j++){
										var obj = clone[j];
										if(!param[obj.name]) param[obj.name] = new Array();
										param[obj.name].push(obj.element);
										td.appendChild(obj.element);
									}

									// レスポンスダイアログを登録
									attachBbsResponseDialog(response_host,param,response_dialog,"host");
								}

								i += 1;
								if(i < num){
									execute_queue.attachFirst(f,null);
								}else{
									callback({result:true});
								}
							}
							execute_queue.attachFirst(f,null);
						};

						return null;
					})(control_list[i]);
				}
			}

			// -
			// ホスト(メッセージ)
			// -
			function forHostInMessage(target){
				if(BbsControlHostExist(target))	return;

				var control_list = new Array();

				// -
				// BbsControlHost を生成
				// -
				(function(){	
					try{
						var node = target.firstChild;
						if(node.nodeValue !== "[") return;
						node = node.nextSibling;
						if(node.tagName !== "FONT") return;
						var m = node.innerHTML.match(new RegExp("^([-.:*a-zA-Z0-9()]+)$","i"));
						if(!m) return;
						node = node.nextSibling;
						if(node.nodeValue !== "]") return;
			
						// BbsControlHost を生成
						var control_host = new BbsControlHost(null,false);
						control_host.setHost(m[1]);
						control_list.push(control_host);
						var element_host = control_host.getElement();
						DomNode_InsertBefore(node,element_host);						
						
					}catch(e){
					}
				})();

				// -
				// BbsControlHost を検索
				// -
				var i;
				var num = control_list.length;
				for(i=0;i<num;i++){
					(function(control_host){

						control_host.setResponse(response);

						var host = control_host.getHost();
						var myself = (response.getHost() === host);
						var element_host = control_host.getElement();
						var textnode_host = DocumentCreateText("");

						// -
						// 変化があったときに実行されるイベント
						// -
						control_host.onchange = function(count){
							var style = element_host.style;
							if(count > 1){
								DomNodeSetNodeValue(textnode_host,"(" + count + ")");
								StyleDeclarationSetProperty(style,"margin-left","4px");
								StyleDeclarationSetProperty(style,"margin-right","4px");
							}else{
								DomNodeSetNodeValue(textnode_host,"");
								StyleDeclarationRemoveProperty(style,"margin-left");
								StyleDeclarationRemoveProperty(style,"margin-right");
							}

							if(count >= 5){
								StyleDeclarationSetProperty(style,"color","#e80000");
								StyleDeclarationRemoveProperty(style,"font-size");
							}else if(count >= 2){
								StyleDeclarationRemoveProperty(style,"color");
								StyleDeclarationRemoveProperty(style,"font-size");
							}else{
								StyleDeclarationSetProperty(style,"color","#707070");
								StyleDeclarationSetProperty(style,"font-size","80%");
							}
						};
						control_host.update();
						element_host.appendChild(textnode_host);

						// -
						// ポップアップ化
						// -
						if(type == "host"){
							if(myself) return null;
						}

						// ダイアログを作成
						var response_dialog = new BbsResponseDialog();
						if(parent_dialog)	parent_dialog.attachChild(response_dialog);
						response_dialog.setElementParent(node.parent);
						response_dialog.setElementHitArea(element_host);
						response_dialog.oncreate = function(_window,callback){

							var responses = bbs_dictionary.getResponsesFromHost(host);
							var i = 0;
							var num = responses.length;
							if(myself){
								if(num < 2) return false;
							}else{
								if(num < 1) return false;
							}

							function f(){
								var response_host = responses[i];
								var clone = response_host.getCloneElements();

								var j;
								var clone_num = clone.length;
								if(clone_num){
									var table = DocumentCreateElement("table");
									_window.appendChild(table);
									var tr = table.insertRow(-1);
									var td = tr.insertCell(-1);
									table.style.margin = "0px 0px 10px";

									var param = new Object();
									param.parent = node.parent;
									for(j=0;j<clone_num;j++){
										var obj = clone[j];
										if(!param[obj.name]) param[obj.name] = new Array();
										param[obj.name].push(obj.element);
										td.appendChild(obj.element);
									}

									// レスポンスダイアログを登録
									attachBbsResponseDialog(response_host,param,response_dialog,"host");
								}

								i += 1;
								if(i < num){
									execute_queue.attachFirst(f,null);
								}else{
									callback({result:true});
								}
							}
							execute_queue.attachFirst(f,null);
						};

						return null;
					})(control_list[i]);
				}
			}

			// -
			// フォロワー
			// -
			function forFollower(target){
				if(BbsControlFollowerExist(target))	return;

				// -
				// BbsControlFollower を生成
				// -
				var control_follower = new BbsControlFollower(null,true);
				control_follower.setResponse(response);

				var element_follower = control_follower.getElement();
				var textnode_follower = DocumentCreateText("");

				element_follower.appendChild(textnode_follower);

				// -
				// 変化があったときに実行されるイベント
				// -
				control_follower.onchange = function(count){
					if(count){
						textnode_follower.nodeValue = " follower(" + count + ")";
					}else{
						textnode_follower.nodeValue = "";
					}

					var style = element_follower.style;
					if(count >= 3){
						StyleDeclarationSetProperty(style,"color","#e80000");
						StyleDeclarationRemoveProperty(style,"font-size");

					}else{
						StyleDeclarationSetProperty(style,"color","#707070");
						StyleDeclarationSetProperty(style,"font-size","small");
					}
					if(count){
						StyleDeclarationSetProperty(style,"margin","0px 4px 0px 0px");
					}else{
						StyleDeclarationRemoveProperty(style,"margin");
					}
				};
				control_follower.update();
				DomNode_InsertAfter(target,element_follower);

				// -
				// ポップアップ化
				// -
				// ダイアログを作成
				var response_dialog = new BbsResponseDialog();
				if(parent_dialog)	parent_dialog.attachChild(response_dialog);
				response_dialog.setElementParent(node.parent);
				response_dialog.setElementHitArea(element_follower);
				response_dialog.oncreate = function(_window,callback){

					var ary = response.getFollower();
					var i = 0;
					var num = ary.length;
					if(num <= 0) return false;

					function f(){
						var follower = bbs_dictionary.getResponse(ary[i].getNumber());
						var clone = follower.getCloneElements();

						var j;
						var clone_num = clone.length;
						if(clone_num){
							var table = DocumentCreateElement("table");
							_window.appendChild(table);
							var tr = table.insertRow(-1);
							var td = tr.insertCell(-1);
							table.style.margin = "0px 0px 10px";

							var param = new Object();
							param.parent = node.parent;
							for(j=0;j<clone_num;j++){
								var obj = clone[j];
								if(!param[obj.name]) param[obj.name] = new Array();
								param[obj.name].push(obj.element);
								td.appendChild(obj.element);
							}

							// レスポンスダイアログを登録
							attachBbsResponseDialog(follower,param,response_dialog,"response");
						}

						i += 1;
						if(i < num){
							execute_queue.attachFirst(f,null);
						}else{
							callback({result:true});
						}
					}
					execute_queue.attachFirst(f,null);
				};
			}

			// -
			// 返信
			// -
			function forReply(target){
				if(BbsControlReplyExist(target))	return;

				// -
				// BbsControlReply を生成
				// -
				(function(){
					var n = target;
					if(!n) return;

					// 本文
					var m = ElementGetTextContent(n).match(new RegExp("No[.][0-9]+","i"));
					if(!m)	return;

					var element_reply;
					switch(n.nodeType){
					// 2019/11/18 以降
					case 1:
						// BbsControlReply を生成
						control_reply = new BbsControlReply(n,true);
						break;

					// 2019/11/18 以前
					case 3:
						// 元のテキストノード
						DomNodeSetNodeValue(n,RegExp.leftContext);

						// BbsControlReply を生成
						control_reply = new BbsControlReply(null,false);
						var element_reply = control_reply.getElement();
						ElementSetTextContent(element_reply,m[0]);
						DomNode_InsertAfter(n,element_reply);

						// 直後テキスト
						n = DocumentCreateText(RegExp.rightContext);
						DomNode_InsertAfter(element_reply,n);
						break;
					}

					control_reply.setResponse(response);
					var docking_form = work.docking_form;
					var textarea = work.form_textarea;
					var blockquote = (function(){
						var list = node.post_message;
						var i;
						var num = list.length;
						for(i=0;i<num;i++){
							if(list[i].nodeName == "BLOCKQUOTE") return list[i];
						}
						return null;
					})();
	
					// -
					// クリックされたときに実行されるイベント
					// -
					control_reply.onclick = function(e){
						docking_form.popupForReply(element_reply);
						var text = textarea.value;
						var num = text.length;
						var selection_end = textarea.selectionEnd;
						var insert_str;
						if(num == 0){
							insert_str = (function(){
								var ary = [">"];								
								var f = function (node){
									switch(node.nodeType){
									case 1:
										if(BbsControlQuoteEqual(node)) return;
										if(node.tagName === "BR"){
											ary.push("\n");
											ary.push(">");
										}else{
											var i;
											var nodes = node.childNodes;
											var num = nodes.length;
											for(i=0;i<num;i++){
												f(nodes[i]);
											}
										}
										break;
									case 3:
										ary.push(node.nodeValue);
										break;
									}									
								};
								f(blockquote);
								if(ary[ary.length - 1] == ">") ary.pop();
								ary.push("\n");
								return ary.join("");
							})();
						}else if(selection_end >= num){
							insert_str = ">No." + (response.getNumber()) + "\n";
						}else{
							insert_str = ">No." + (response.getNumber());
						}
						textarea.value = text.slice(0,selection_end) + insert_str + text.slice(selection_end);
						textarea.selectionEnd = selection_end + insert_str.length;
						textarea.focus();
					};
				})();
			}

			(function(){
				var i;
				var num;
				var list;

				list = node.post_info;
				num = list.length;
				for(i=0;i<num;i++){
					forReply(list[i]);
					forId(list[i]);
					forName(list[i]);
					forHost(list[i]);
				}
				if(num){
					forFollower(list[num-1]);
				}

				list = node.post_message;
				num = list.length;
				for(i=0;i<num;i++){
					forResponseAnchor(list[i]);
					forQuote(list[i]);
					forId(list[i]);
					forName(list[i]);
					forHostInMessage(list[i]);
				}
			})();
		}

		// -
		// 文字列からレスポンス番号を取得
		// -
		function StringCreateResponseAnchorNumbers(str){
			var numbers = new ResponseAnchorNumbers();

			var re_search = new RegExp("^(No\\.|>>|<<|>>|<<|>|>|》|≫|&gt;&gt;)([0-90-9]+)","i");
			var re_image = new RegExp("([0-90-9]+)\\.(bmp|gif|jpeg|jpe|jpg|png|webp|webm|mp4)","i");
			var re_number = new RegExp("^([0-90-9]+)","i");

			var m = str.match(re_search);
			if(m){
				var p = m[1].length;
				while(true){
					// 番号
					m = str.substr(p).match(re_number);
					if(m){
						p += m[0].length;

						var response = null;
						var id = StringConvertFromNumericFullToNumericHalf(m[1]);
						if(!response) response = work.futaba_dictionary.getResponseFromImageId(id);

						id = parseInt(id);
						if(id < 1) id = 1;
						if(id > 0x7fffffff) id = 0x7fffffff;
						if(!response) response = work.futaba_dictionary.getResponse(id);

						if(response){
							id = response.getNumber();
						}

						numbers.addNumber(id);
					}

					if(m){
						// カンマ
						if(RegExp.rightContext.search(",") == 0){
							p += 1;
							continue;
						}
					}
					break;
				}
			}
			var m = str.match(re_image);
			if(m){
				var id = StringConvertFromNumericFullToNumericHalf(m[1]);
				var response = work.futaba_dictionary.getResponseFromImageId(id);
				if(response){
					numbers.addNumber(response.getNumber());
				}

			}
			return numbers;
		}

		// -
		// 引用文字列からレスポンス番号を取得
		// -
		function QuoteStringCreateResponseAnchorNumbers(id,str){
			var numbers = new ResponseAnchorNumbers();
			var response = work.futaba_dictionary.getResponse(id);
			if(!response) return numbers;

			var responses = response.getResponsesFromText(str);
			var num = responses.length;
			var i;
			for(i=0;i<num;i++){
				numbers.addNumber(responses[i].getNumber());
			}

			return numbers;
		}

		// -
		// エレメントを解析
		// -
		var useful = (function(){
			var post_file;
			var post_message = element;
			var post_list = new Array();
			var post_info_list = new Array();
			var post_file_list = new Array();
			var post_file_info_list = new Array();
			var post_message_list = new Array();

			try{
				if(post_message.tagName != "BLOCKQUOTE") return false;
			}catch(e){
				return false;
			}

			// 掲示板ポップアップ内の要素
			if(BbsResponseDialogContains(post_message)) return false;
			// document に未登録
			if(!DomNodeGetAttachedDocument(post_message)) return false;

			// コンテナ取得
			var node = post_message;
			while(node){
				if(node.tagName == "HR") break;
				post_list.unshift(node);
				node = node.previousSibling;
			}

			// 画像取得
			try{
				var node = DomNodeGetPreviousElementSibling(post_message);
				while(node){
					var images = ElementGetElementsByTagName(node,"img");
					if(images.length == 1){
						post_file = node;
						break;
					}
					node = DomNodeGetPreviousElementSibling(node);
				}
			}catch(e){
			}

			// ファイル情報リスト
			try{
				var node = DomNodeGetPreviousElementSibling(post_file);
				if(node.tagName == "BR"){
					var dic = {"BR":1,"HR":1};
					node = node.previousSibling;
					while(node){
						if(dic[node.tagName]) break;
						post_file_info_list.unshift(node);
						node = node.previousSibling;
					}
				}
			}catch(e){
			}

			// 名前情報リスト
			try{
				var node = post_list[0];
				if(node.parentNode.tagName != "TD"){
					var dic = {"FONT":1,"INPUT":1,"SPAN":1};
					var i;
					var num = post_list.length;
					for(i=0;i<num;i++){
						if(dic[post_list[i].tagName]){
							node = post_list[i];
							break;
						}
					}				
				}
				var dic = {"DIV":1,"SMALL":1,"BLOCKQUOTE":1,"BR":1};
				while(node){
					if(dic[node.tagName]) break;
					post_info_list.push(node);
					node = node.nextSibling;
				}
			}catch(e){
			}

			// 双葉辞書追加
			work.analyzeNodeList(post_list);

			if(post_message){
				post_message_list.push(post_message);
			}
			if(post_file){
				post_file_list.push(post_file);
			}
			
			// -
			// レスアンカー拡張
			// -
			(function(target){
				if(BbsControlResponseAnchorExist(target)) return;
				if(BbsControlQuoteExist(target)) return;

				var re_simple = new RegExp("^(No\\.|>>|<<|>)[-,0-90-9]+$","i");
				var re_image = new RegExp("([0-90-9]+)\\.(bmp|gif|jpeg|jpe|jpg|png|webp|webm|mp4)","i");
				var re_detail = new RegExp("(No\\.|>>|<<|>>|<<|>|>|》|≫|&gt;&gt;)([0-90-9]+,)*[0-90-9]+","i");
				var re_number = new RegExp("([0-90-9]+)","i");

				var i;
				var nodes = ElementGetElementsByTagName(target,"a");
				var num = nodes.length;
				for(i=num-1;i>=0;i--){
					var node = nodes[i];
					var m = ElementGetTextContent(node).match(re_simple);
					if(m){
						var text_node = DocumentCreateText(m[0]);
						DomNode_InsertBefore(node,text_node);
						DomNodeRemove(node);
					}
				}

				// テキストノードを統合
				target.normalize();

				var p;
				var n;
				var q;
				var ignore_dictionary = {"A":1,"SCRIPT":1};
				var queue = new Object();
				q = {p:queue,n:queue,node:target};
				queue.p = q;
				queue.n = q;

				while(queue.n != queue){
					q = queue.n;
					p = q.p;
					n = q.n;
					p.n = n;
					n.p = p;
					var node = q.node;
					switch(node.nodeType){
					case 1:
						var i;
						var nodes = node.childNodes;
						var num = nodes.length;
						for(i=0;i<num;i++){
							n = queue;
							p = n.p;
							q = {p:p,n:n,node:nodes[i]};
							p.n = q;
							n.p = q;
						}
						break;
					case 3:
						while(node){
							var m = DomNodeGetNodeValue(node).match(re_image);
							if(m){
								var response = work.futaba_dictionary.getResponseFromImageId(m[1]);
								if(response){
									// 元のテキストノード
									DomNodeSetNodeValue(node,RegExp.leftContext);

									// BbsControlName を生成
									var element = DocumentCreateElement("a");
									ElementSetTextContent(element,m[0]);
									DomNode_InsertAfter(node,element);

									// 直後テキスト
									node = DocumentCreateText(RegExp.rightContext);
									element.href = work.base_url + "#" + response.getNumber();
									DomNode_InsertAfter(element,node);
									continue;
								}
							}

							var m = DomNodeGetNodeValue(node).match(re_detail);
							if(!m)	break;

							var text_left  = RegExp.leftContext;
							var text_match = m[0];
							var text_right = RegExp.rightContext;

							var query = 0;
							m = text_match.match(re_number);
							while(m){
								var v = parseInt(StringConvertFromNumericFullToNumericHalf(m[0]));
								if(v < 1) v = 1;
								if(v > 0x7fffffff) v = 0x7fffffff;

								var response = null;
								if(!response) response = work.futaba_dictionary.getResponse(v);
								if(!response) response = work.futaba_dictionary.getResponseFromImageId(v);
								if(response){
									query = v;
									break;
								}

								m = RegExp.rightContext.match(re_number);
							}

							if(!query) break;

							// 元のテキストノード
							DomNodeSetNodeValue(node,text_left);

							// BbsControlName を生成
							var element = DocumentCreateElement("a");
							ElementSetTextContent(element,text_match);
							DomNode_InsertAfter(node,element);

							// 直後テキスト
							node = DocumentCreateText(text_right);
							element.href = work.base_url + "#" + query;
							DomNode_InsertAfter(element,node);
						}
					}
				}
			})(post_message);

			// -
			// クリーンアップ
			// -
			(function(){
				function cleanup(target){
					BbsControlSearchTrash(target,function(element){
						var node = element.firstChild;
						if(!node)	return null;
						if(node.nodeType != 3)	return null;

						// ID
						var m = node.nodeValue.match(new RegExp("^ID:([a-zA-Z0-9+/.]{8,10})[●!]{0,2}","i"));
						if(m){
							// 直後テキスト
							var node = DocumentCreateText(m[0]);
							DomNode_InsertAfter(element,node);
							DomNodeRemove(element);
							return null;
						}

						// トリップ
						var m = node.nodeValue.match(new RegExp("^(◆(|[ ])[a-zA-Z0-9+/.]{10,12})","i"));
						if(m){
							// 直後テキスト
							var node = DocumentCreateText(m[0]);
							DomNode_InsertAfter(element,node);
							DomNodeRemove(element);
							return null;
						}

						// ホスト名
						var m = node.nodeValue.match(new RegExp("^([0-9]{1,3}\\.[0-9]{1,3}\\.[*][(][-.a-zA-Z0-9]+[)])","i"));
						if(m){
							// 直後テキスト
							var node = DocumentCreateText(m[0]);
							DomNode_InsertAfter(element,node);
							DomNodeRemove(element);

							// テキストノードを統合
							node.parentNode.normalize();
							return null;
						}

						return null;
					});
				}

				function cleanupNodes(list){
					var i;
					var num = list.length;
					for(i=0;i<num;i++){
						cleanup(list[i]);
					}
				}

				cleanupNodes(post_info_list);
				cleanupNodes(post_message_list);
			})();

			// ナンバーを取得
			var info_text = "";
			var i;
			var num = post_info_list.length;
			for(i=0;i<num;i++){
				info_text += ElementGetTextContent(post_info_list[i]) + "|";
			}
			if(!(info_text.match(new RegExp("No\\.([0-9]+)","i"))))	return false;

			// アンカー追加
			try{
				var node = post_list[0].parentNode;
				if(node.tagName == "TD"){
					node.id = "" + RegExp.$1;
				}else{
					var anchor = DocumentCreateElement("a");
					anchor.name = "" + RegExp.$1;
					DomNode_InsertBefore(post_list[0],anchor);
				}				
			}catch(e){
			}

			// ナンバーからレスポンスオブジェクトを取得
			var response = bbs_dictionary.getResponse(parseInt(RegExp.$1));

			// レスポンス解析
			if(!response.getAnalyzed()){

				// IDの取得
				if(info_text.match(new RegExp("ID:([a-zA-Z0-9+/.]{8,10})[●!]{0,2}","i"))){
					response.setId(RegExp.$1);
				}

				// 名前の取得
				if(info_text.match(new RegExp("(◆(|[ ])[a-zA-Z0-9+/.]{10,12})","i"))){
					response.setName(RegExp.$1);
				}

				// ホスト名の取得
				if(info_text.match(new RegExp("IP:([-.:*a-zA-Z0-9()]+)","i"))){
					response.setHost(RegExp.$1);
				}else if(post_message.innerHTML.match(new RegExp('^\\[<font color="#ff0000">([-.:*a-zA-Z0-9()]+)</font>\\]',"i"))){
					response.setHost(RegExp.$1);					
				}

				// フォロー解析
				var dictionary = new Object();
				(function(){
					var nodes = ElementGetElementsByTagName(post_message,"a");
					var i;
					var num = nodes.length;
					for(i=0;i<num;i++){
						var numbers = StringCreateResponseAnchorNumbers(ElementGetTextContent(nodes[i]));
						numbers.getNumbers(function(n){
							if(!dictionary[n]){
								var following = bbs_dictionary.getResponse(n);
								following.addFollower(response);
								dictionary[n] = true;
							}
						});
					}
					var nodes = post_message.childNodes;
					var i;
					var num = nodes.length;
					for(i=0;i<num;i++){
						var node = nodes[i];
						if(node.tagName == "FONT"){
							var numbers = QuoteStringCreateResponseAnchorNumbers(response.getNumber(),ElementGetTextContent(node));
							numbers.getNumbers(function(n){
								if(!dictionary[n]){
									var following = bbs_dictionary.getResponse(n);
									following.addFollower(response);
									dictionary[n] = true;
								}
							});
						}
					}
				})();

				// オリジナルエレメントをセット
				(function(){
					var index = 0;
					var add = function(name,list){
						var i;
						var num = list.length;
						if(num && index){
							response.addOriginalElements("break_line",DocumentCreateElement("br"));
						}
						for(i=0;i<num;i++){
							response.addOriginalElements(name,list[i]);
							index ++;
						}
					};
					add("post_info",post_info_list);
					add("post_file_info",post_file_info_list);
					add("post_file",post_file_list);
					add("post_message",post_message_list);
				})();

				// 消去時に実行されるイベント
				response.onerase = function(){
					var original = response.getOriginalElements();
					if(!(original.length)) return;

					var table;
					var node = original[original.length-1].element;
					while(node){
						if(node.tagName == "TABLE"){
							table = node;
							break;
						}
						node = node.parentNode;
					}

					if(table){
						var revise_scroll = new DocumentReviseScroll();
						revise_scroll.executeRemoveElementBefore(table);
						DomNodeRemove(table);
						revise_scroll.executeRemoveElementAfter(table);
					}else{
						// オリジナルエレメントを外す
						var i;
						var num = original.length;
						for(i=num-1;i>=0;i--){
							var node = original[i].element;
							DomNodeRemove(node);
						}
					}
				};

				response.setAnalyzed();
			}

			// レスポンスダイアログを登録(ルート)
			attachBbsResponseDialog(
				response,
				{
					post_info:post_info_list,
					post_file_info:post_file_info_list,
					post_file:post_file_list,
					post_message:post_message_list,
					parent:document.body
				},
				null,
				null
			);

			return true;
		})();

		response({useful:useful});
		return true;
	}

			]);

			// -
			// 掲示板設定「おーぷん2ちゃんねる」
			// -
			attachItem( "ExpandBbs_ScriptInitialize_Open2ch" , [
	
	function(info,response){
		var work = info.work;

		// -
		// 基本URL抽出
		// -
		var url = document.URL;
		var bbs_list = [
			{url:"(http://[^.]+\\.open2ch\\.net/test/read\\.cgi/[^/]+/[0-9]+)",replace:"$1/",name:"open2ch"},
			{url:"(http://open2ch\\.net/test/read\\.cgi/[^/]+/[0-9]+)",replace:"$1/",name:"open2ch"}
		];

		var i;
		var num = bbs_list.length;
		for(i=0;i<num;i++){
			var bbs = bbs_list[i];
			var re = new RegExp(bbs.url,"i");
			var m = url.match(re);
			if(m){
				work.base_url = m[1].replace(re,bbs.replace);
				work.bbs_name = bbs.name;
				break;
			}
		}

		return false;
	},
	function (info,response){
		var work = info.work;
		if(!(work.bbs_name)){
			return false;
		}

		var first_id = 1;
		var last_id = 1;
		var dictionary_id = new Array();
		var load_shadow_list;
		var load_shadow_pos = 0;
		var load_more_list;
		var load_more_pos = 0;
		var element_parent = null;
		var read_more_button = null;
		var element_form = null;
		var base_url = work.base_url;
		var resource_url_more;

		// -
		// 文字列からレスポンス番号を取得
		// -
		work.createResponseAnchorNumbers = function (str){
			var numbers = new ResponseAnchorNumbers();

			var re_search = new RegExp("^(>>|<<|>>|<<|>|>|》|≫|&gt;&gt;)([0-90-9]+)","i");
			var re_range = new RegExp("^([0-90-9]+)[-]([0-90-9]+)","i");
			var re_number = new RegExp("^([0-90-9]+)","i");

			var m = str.match(re_search);
			if(m){
				var p = m[1].length;
				while(true){
					// 番号-番号
					m = str.substr(p).match(re_range);
					if(m){
						var id0 = parseInt(StringConvertFromNumericFullToNumericHalf(m[1]));
						var id1 = parseInt(StringConvertFromNumericFullToNumericHalf(m[2]));
						if(id0 < 1) id0 = 1;
						if(id1 < 1) id1 = 1;
						if(id0 > 10000) id0 = 10000;
						if(id1 > 10000) id1 = 10000;
						p += m[0].length;
						numbers.addNumbers(id0,id1);
					}else{
						// 番号
						m = str.substr(p).match(re_number);
						if(m){
							p += m[0].length;
							var id = parseInt(StringConvertFromNumericFullToNumericHalf(m[1]));
							if(id < 1) id = 1;
							if(id > 0x7fffffff) id = 0x7fffffff;
							numbers.addNumber(id);
						}
					}

					if(m){
						// カンマ
						if(RegExp.rightContext.search(",") == 0){
							p += 1;
							continue;
						}
					}
					break;
				}
			}
			return numbers;
		};

		// -
		// レスアンカー拡張
		// -
		work.extendResponseAnchor = function (target){
			if(BbsControlResponseAnchorExist(target))	return;

			var re_simple = new RegExp("^(>>|<<|>)[-,0-90-9]+$","i");
			var re_detail = new RegExp("(>>|<<|>>|<<|>|>|》|≫|&gt;&gt;)(([0-90-9]+[-][0-90-9]+|[0-90-9]+),)*([0-90-9]+[-][0-90-9]+|[0-90-9]+)","i");
			var re_range = new RegExp("([0-90-9]+)[-]([0-90-9]+)","i");
			var re_number = new RegExp("([0-90-9]+)","i");

			var i;
			var nodes = ElementGetElementsByTagName(target,"a");
			var num = nodes.length;
			for(i=num-1;i>=0;i--){
				var node = nodes[i];
				var m = ElementGetTextContent(node).match(re_simple);
				if(m){
					var text_node = DocumentCreateText(m[0]);
					DomNode_InsertBefore(node,text_node);
					DomNodeRemove(node);
				}
			}

			// テキストノードを統合
			target.normalize();

			var p;
			var n;
			var q;
			var ignore_dictionary = {"A":1,"SCRIPT":1};
			var queue = new Object();
			q = {p:queue,n:queue,node:target};
			queue.p = q;
			queue.n = q;

			while(queue.n != queue){
				q = queue.n;
				p = q.p;
				n = q.n;
				p.n = n;
				n.p = p;
				var node = q.node;
				switch(node.nodeType){
				case 1:
					var i;
					var nodes = node.childNodes;
					var num = nodes.length;
					for(i=0;i<num;i++){
						n = queue;
						p = n.p;
						q = {p:p,n:n,node:nodes[i]};
						p.n = q;
						n.p = q;
					}
					break;
				case 3:
					while(node){
						var m = DomNodeGetNodeValue(node).match(re_detail);
						if(!m)	break;

						// 元のテキストノード
						DomNodeSetNodeValue(node,RegExp.leftContext);

						// BbsControlName を生成
						var element = DocumentCreateElement("a");
						var span = DocumentCreateElement("span");
						element.appendChild(span);
						ElementSetTextContent(span,m[0]);
						DomNode_InsertAfter(node,element);

						// 直後テキスト
						node = DocumentCreateText(RegExp.rightContext);
						DomNode_InsertAfter(element,node);

						var query = "";
						m = ElementGetTextContent(element).match(re_range);
						if(m){
							var min = parseInt(StringConvertFromNumericFullToNumericHalf(m[1]));
							var max = parseInt(StringConvertFromNumericFullToNumericHalf(m[2]));
							if(min < 1) min = 1;
							if(max < 1) max = 1;
							if(min > 10000) min = 10000;
							if(max > 10000) max = 10000;
							if(max < min){
								var tmp = min;
								min = max;
								max = tmp;
							}
							query = min + "-" + max;
						}else{
							// 番号
							m = ElementGetTextContent(element).match(re_number);
							if(m){
								query = parseInt(StringConvertFromNumericFullToNumericHalf(m[0]));
								if(query < 1) query = 1;
								if(query > 0x7fffffff) query = 0x7fffffff;
							}

						}
						element.href = work.base_url + query;
					}
				}
			}
		};

		// -
		// HTML 文書の整合性テスト
		// -
		function checkValidityFromHTML(str){
			return true;
		}

		// -
		// HTML 文書をシャドウ読み込み
		// -
		function loadShadowFromHTML(str){

			var re_number;
			var re_id = new RegExp("ID:([-a-zA-Z0-9+/.]+)[●!]{0,2}","i");
			var re_name = new RegExp("(◆[a-zA-Z0-9+/.]{10,12})","i");
			switch(work.bbs_name){
			case "open2ch":
				re_number = new RegExp("([0-9]+)","i");
				break;
			}

			var p = 0;
			var n = str.length;
			function f(){
				if(p >= n) return;
				p = str.indexOf("<dt",p);
				if(p < 0) return;
				var e = str.indexOf("</dt>",p);
				var s = str.substring(p,e) + "\n" + "<br>";
				var m = s.match(re_number);
				if(m){
					var id = parseInt(m[1]);
					if((first_id <= id) && (id <= last_id)){
					}else if(dictionary_id[id]){
					}else{
						var nodes = StringHtmlCreateDomNodesSafe(s);
						var dt = nodes[0];
						var dd = nodes[1];
						var br = nodes[3];

						try{
							if(dt.tagName != "DT")	return;
							if(dd.tagName != "DD")	return;
							if(br.tagName != "BR")	return;
						}catch(e){
							return;
						}

						// ナンバーからレスポンスオブジェクトを取得
						var response = bbs_dictionary.getResponse(id);
						if(!(response.getAnalyzed())){
							var dt_text = ElementGetTextContent(dt);

							// レスアンカー拡張
							work.extendResponseAnchor(dd);

							// IDの取得
							if(dt_text.match(re_id)){
								response.setId(RegExp.$1);
							}

							// 名前の取得
							if(dt_text.match(re_name)){
								response.setName(RegExp.$1);
							}

							// ホスト名の取得
							(function(){
								var p;
								var n;
								var q;
								var ignore_dictionary = {"B":1,"SCRIPT":1};
								var queue = new Object();
								q = {p:queue,n:queue,node:dt};
								queue.p = q;
								queue.n = q;

								while(queue.n != queue){
									q = queue.n;
									p = q.p;
									n = q.n;
									p.n = n;
									n.p = p;
									var node = q.node;
									switch(node.nodeType){
									case 1:
										if(!(ignore_dictionary[node.tagName])){
											var i;
											var nodes = node.childNodes;
											var num = nodes.length;
											for(i=0;i<num;i++){
												n = queue;
												p = n.p;
												q = {p:p,n:n,node:nodes[i]};
												p.n = q;
												n.p = q;
											}
										}
										break;
									case 3:
										var m = DomNodeGetNodeValue(node).match(new RegExp("(^|HOST:)([-._a-zA-Z0-9]{1,}(\\.[-._a-zA-Z0-9]{1,}){2,})","i"));
										if(m){
											response.setHost(m[2]);
											return;
										}
										var m = DomNodeGetNodeValue(node).match(new RegExp("(\\[ )([-._a-zA-Z0-9]{1,}(\\.[-._a-zA-Z0-9]{1,}){2,})(|\\n) \\]","i"));
										if(m){
											response.setHost(m[2]);
											return;
										}
										var m = DomNodeGetNodeValue(node).match(new RegExp("(発信元:)([0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3})","i"));
										if(m){
											response.setHost(m[2]);
											return;
										}
										break;
									}
								}
							})();

							// フォロー解析
							var dictionary = new Object();
							(function(){
								var nodes = ElementGetElementsByTagName(dd,"a");
								var i;
								var num = nodes.length;
								for(i=0;i<num;i++){
									var numbers = work.createResponseAnchorNumbers(ElementGetTextContent(nodes[i]));
									numbers.getNumbers(function(n){
										if(!dictionary[n]){
											var following = bbs_dictionary.getResponse(n);
											following.addFollower(response);
											dictionary[n] = true;
										}
									});
								}
							})();

							// オリジナルエレメントをセット
							if(dt)	response.addOriginalElements("dt",dt);
							if(dd)	response.addOriginalElements("dd",dd);
							if(br)	response.addOriginalElements("br",br);

							// 消去時に実行されるイベント
							response.onerase = function(){};

							response.setAnalyzed();
						}
					}
				}

				if(p < e){
					p = e + 1;
					execute_queue.attachFirst(f,null);
				}
			}
			execute_queue.attachFirst(f,null);
		}

		// -
		// HTML 文書を継ぎ足し読み込み
		// -
		function loadMoreFromHTML(str,callback){
			var re_number;
			switch(work.bbs_name){
			case "open2ch":
				re_number = new RegExp("([0-9]+)","i");
				break;
			}

			// 最後尾 ID 更新
			var last_number = 0;
			var nodes = ElementGetElementsByTagName(element_parent,"dt");
			var node_num = nodes.length;
			if(node_num){
				var re_id = new RegExp("([0-9]+)","i");
				if(ElementGetTextContent(nodes[node_num-1]).match(re_id)){
					last_number = parseInt(RegExp.$1);
				}
			}
			var i = last_number;
			while(i > last_id){
				dictionary_id[i] = true;
				i --;
			}
			last_id = last_number;

			var p = 0;
			var n = str.length;
			var add_count = 0;
			function f(){
				try{
					if(p >= n) throw 0;
					p = str.indexOf("<dl",p);
					if(p < 0) throw 0;
					var e = str.indexOf("</dl>",p);
					var s = str.substring(p,e);
					var m = s.match(re_number);
					if(m){
						var id = parseInt(m[1]);
						if(last_id < id){
							var response = bbs_dictionary.getResponse(id);
							response.clearAnalyzed();
							response.clearOriginalElements();
							response.clearFollowing();

							var nodes = StringHtmlCreateDomNodesSafe(s);
							var j;
							var node_num = nodes.length;
							for(j=0;j<node_num;j++){
								element_parent.appendChild(nodes[j]);
							}
							last_id = id;
							add_count += 1;
							resource_url_more = base_url + (last_id) + "-";
						}
					}

					if(p < e){
						p = e + 1;
						execute_queue.attachFirst(f,null);
						return;
					}
				}catch(e){
					if(e){
						callback({result:false});
						return;
					}
				}
				callback({result:true,add_count:add_count});
			}
			execute_queue.attachFirst(f,null);
		}

		// -
		// 継ぎ足し読み込み
		// -
		function readMore(callback){
			var num = load_more_list.length;
			var pos = load_more_pos;
			var i = 0;

			var failure = function(){
				i += 1;
				if(num <= i){
					callback({result:false});
					return;
				}
				pos += 1;
				if(num <= pos) pos = 0;
				load_more_pos = pos;
				load();
			};

			var load = function (){
				var param = load_more_list[pos];

				// ローダーオブジェクトを作成
				var loader = new Loader();

				// 成功
				loader.onload = function(str){
					if(!param.validity(str)){
						failure();
						return;
					}
					param.parse(str,function(response){
						if(response.result){
							callback(response);
						}else{
							failure();
						}
					});
				};

				// 失敗
				loader.onerror = function(){
					failure();
				};

				// テキストの読み込み
				loader.setMethod("GET");
				loader.setURL(param.url);
				loader.loadText();
			};
			load();
		}

		// -
		// レスポンス親要素
		// -
		var i;
		var nodes = ElementGetElementsByClassName(document.body,"thread");
		var num = nodes.length;
		if(num){
			element_parent = nodes[num-1];
		}
		if(!element_parent) return false;

		// -
		// 範囲取得
		// -
		var nodes = ElementGetElementsByTagName(element_parent,"dt");
		var node_num = nodes.length;
		if(node_num){
			var re_id = new RegExp("^([0-9]+)","i");

			if(ElementGetTextContent(nodes[0]).match(re_id)){
				first_id = parseInt(RegExp.$1);
				dictionary_id[0] = true;
			}

			if((first_id == 1) && (node_num > 1)){
				if(ElementGetTextContent(nodes[1]).match(re_id)){
					first_id = parseInt(RegExp.$1);
					dictionary_id[first_id] = true;
					if(first_id <= 2) first_id = 1;
				}
			}

			if(ElementGetTextContent(nodes[node_num-1]).match(re_id)){
				last_id = parseInt(RegExp.$1);
				dictionary_id[last_id] = true;
			}
		}

		// -
		// 読み込みリスト
		// -
		load_shadow_pos = 0;
		load_more_pos = 0;
		load_shadow_list = [
			{
				url:base_url,
				parse:loadShadowFromHTML,
				validity:checkValidityFromHTML
			}
		];
		load_more_list = [
			{
				url:base_url + last_id + "-",
				parse:loadMoreFromHTML,
				validity:checkValidityFromHTML
			}
		];

		// -
		// BbsControlDockingForm 作成
		// -
		(function(){
			var node;

			// フォーム
			var nodes = ElementGetElementsByTagName(document.body,"form");
			var i;
			for(i=0;i<nodes.length;i++){
				if(nodes[i].action.indexOf("/test/bbs.cgi") >= 0){
					node = nodes[i];
					break;
				}
			}

			if(node){
				var docking_form = new BbsControlDockingForm(node,false);
				docking_form.setStyle("background:#e8e8e8; background-image:linear-gradient(to bottom, #f8f8f8, #e8e8e8); padding:20px; border:1px solid #888; border-radius:4px; box-shadow:2px 2px 5px #aaa; margin:0px;");
			}
		})();

		// -
		// BbsControlReadMoreButton 作成
		// -
		//read_more_button = new BbsControlReadMoreButton();
		//read_more_button.setWaitTime(2 * 1000);
		//read_more_button.onclick = readMore;
		//DomNode_InsertAfter(element_parent,read_more_button.getElement());

		// -
		// シャドウロード
		// -
		(function(){
			var num = load_shadow_list.length;
			var pos = load_shadow_pos;
			var i = 0;

			var success = function(){
			};
			var failure = function(){
				i += 1;
				if(num <= i) return;
				pos += 1;
				if(num <= pos) pos = 0;
				load_shadow_pos = pos;
				load();
			};

			var load = function (){
				var param = load_shadow_list[pos];

				// ローダーオブジェクトを作成
				var loader = new Loader();

				// 成功
				loader.onload = function(str){
					if(!param.validity(str)){
						failure();
						return;
					}
					param.parse(str);
					success();
				};

				// 失敗
				loader.onerror = function(){
					failure();
				};

				// テキストの読み込み
				loader.setMethod("GET");
				loader.setURL(param.url);
				loader.loadText();
			};
			load();
		})();

		response({result:true});
		return true;
	},
	function (info,response){
		response({result:false});
		return true;
	}

			]);

			// -
			// 掲示板設定「おーぷん2ちゃんねる」
			// -
			attachItem( "ExpandBbs_ScriptCallback_Open2ch" , [
	
	function(info,response){
		var element = info.element;
		var work = info.work;

		// -
		// レスポンスダイアログを登録
		// -
		function attachBbsResponseDialog(response,node,parent_dialog,type){

			// -
			// レスアンカー
			// -
			function forResponseAnchor(target){
				if(BbsControlResponseAnchorExist(target))	return;

				// -
				// BbsControlResponseAnchor を生成
				// -
				(function(){
					var i;
					var nodes = ElementGetElementsByTagName(target,"a");
					var num = nodes.length;
					for(i=0;i<num;i++){
						var node = nodes[i];
						var numbers = work.createResponseAnchorNumbers(ElementGetTextContent(node));
						if(numbers.getCount()){
							var control_res_anchor = new BbsControlResponseAnchor(node,false);
							control_res_anchor.setResponseAnchorNumbers(numbers);
						}
					}
				})();

				// -
				// BbsControlResponseAnchor を検索
				// -
				BbsControlResponseAnchorSearch(target,function(control_res_anchor){

					var element_res_anchor = control_res_anchor.getElement();
					var numbers = control_res_anchor.getResponseAnchorNumbers();

					// ダイアログを作成
					var response_dialog = new BbsResponseDialog();
					if(parent_dialog)	parent_dialog.attachChild(response_dialog);
					response_dialog.setElementParent(node.parent);
					response_dialog.setElementHitArea(element_res_anchor);
					response_dialog.oncreate = function(_window,callback){

						var dl = DocumentCreateElement("dl");
						dl.style.margin = "0px";
						_window.appendChild(dl);

						var created = false;
						var i = 0;
						var number_list = numbers.getNumberList();
						var num = number_list.length;
						if(!num) return false;

						function f(){
							var following = bbs_dictionary.getResponse(number_list[i]);
							var clone = following.getCloneElements();

							var j;
							var clone_num = clone.length;
							if(clone_num){
								var param = new Object();
								param.parent = node.parent;
								for(j=0;j<clone_num;j++){
									var obj = clone[j];
									param[obj.name] = obj.element;
									dl.appendChild(obj.element);
								}

								// レスポンスダイアログを登録
								attachBbsResponseDialog(following,param,response_dialog,"response");

								created = true;
							}

							i += 1;
							if(i < num){
								execute_queue.attachFirst(f,null);
							}else{
								callback({result:created});
							}
						}
						execute_queue.attachFirst(f,null);
					};

					return null;
				});
			}

			// -
			// ID
			// -
			function forId(target){
				if(BbsControlIdExist(target))	return;

				// -
				// BbsControlId を生成
				// -
				(function(){
					var p;
					var n;
					var q;
					var ignore_dictionary = {"A":1,"SCRIPT":1};
					var queue = new Object();
					q = {p:queue,n:queue,node:target};
					queue.p = q;
					queue.n = q;

					while(queue.n != queue){
						q = queue.n;
						p = q.p;
						n = q.n;
						p.n = n;
						n.p = p;
						var node = q.node;
						switch(node.nodeType){
						case 1:
							if(!(ignore_dictionary[node.tagName])){
								var i;
								var nodes = node.childNodes;
								var num = nodes.length;
								for(i=0;i<num;i++){
									n = queue;
									p = n.p;
									q = {p:p,n:n,node:nodes[i]};
									p.n = q;
									n.p = q;
								}
							}

							// 名前欄
							if(node.tagName == "A"){
								var m = node.href.match(new RegExp("[?]ID=([a-zA-Z0-9+/.]{3,10})[●!]{0,2}","i"));
								if(m){
									// BbsControlId を生成
									var control_id = new BbsControlId(null,true);
									control_id.setId(m[1]);
									var element_id = control_id.getElement();
									DomNode_InsertAfter(node,element_id);
									var textnode_id = DocumentCreateText("");
									element_id.appendChild(textnode_id);
									control_id.setTextNode(textnode_id);
								}
							}

							break;
						case 3:
							while(node){

								var m = DomNodeGetNodeValue(node).match(new RegExp("ID:([a-zA-Z0-9+/.]{3,10})[●!]{0,2}","i"));
								if(!m)	break;

								// 元のテキストノード
								DomNodeSetNodeValue(node,RegExp.leftContext);

								// BbsControlId を生成
								var control_id = new BbsControlId(null,false);
								control_id.setId(m[1]);
								var element_id = control_id.getElement();
								ElementSetTextContent(element_id,m[0]);
								DomNode_InsertAfter(node,element_id);
								var textnode_id = DocumentCreateText("");
								element_id.appendChild(textnode_id);
								control_id.setTextNode(textnode_id);

								// 直後テキスト
								node = DocumentCreateText(RegExp.rightContext);
								DomNode_InsertAfter(element_id,node);
							}
							break;
						}
					}
				})();

				// -
				// BbsControlId を検索
				// -
				BbsControlIdSearch(target,function(control_id){

					control_id.setResponse(response);

					var id = control_id.getId();
					var myself = (response.getId() === id);
					var element_id = control_id.getElement();
					var textnode_id = control_id.getTextNode();

					// -
					// 変化があったときに実行されるイベント
					// -
					control_id.onchange = function(count){
						if(count > 1){
							DomNodeSetNodeValue(textnode_id,"(" + count + ")");
						}else{
							DomNodeSetNodeValue(textnode_id,"");
						}

						var style = element_id.style;
						if(count >= 5){
							StyleDeclarationSetProperty(style,"color","#e80000");
							StyleDeclarationRemoveProperty(style,"font-size");
						}else if(count >= 2){
							StyleDeclarationRemoveProperty(style,"color");
							StyleDeclarationRemoveProperty(style,"font-size");
						}else{
							StyleDeclarationSetProperty(style,"color","#888");
							StyleDeclarationSetProperty(style,"font-size","small");
						}
					};
					control_id.update();

					// -
					// ポップアップ化
					// -
					if(type == "id"){
						if(myself) return null;
					}

					// ダイアログを作成
					var response_dialog = new BbsResponseDialog();
					if(parent_dialog)	parent_dialog.attachChild(response_dialog);
					response_dialog.setElementParent(node.parent);
					response_dialog.setElementHitArea(element_id);
					response_dialog.oncreate = function(_window,callback){

						var dl = DocumentCreateElement("dl");
						dl.style.margin = "0px";
						_window.appendChild(dl);

						var responses = bbs_dictionary.getResponsesFromId(id);
						var i = 0;
						var num = responses.length;
						if(myself){
							if(num < 2) return false;
						}else{
							if(num < 1) return false;
						}

						function f(){
							var response_id = responses[i];
							var clone = response_id.getCloneElements();

							var j;
							var clone_num = clone.length;
							if(clone_num){

								var param = new Object();
								param.parent = node.parent;
								for(j=0;j<clone_num;j++){
									var obj = clone[j];
									param[obj.name] = obj.element;
									dl.appendChild(obj.element);
								}

								// レスポンスダイアログを登録
								attachBbsResponseDialog(response_id,param,response_dialog,"id");
							}

							i += 1;
							if(i < num){
								execute_queue.attachFirst(f,null);
							}else{
								callback({result:true});
							}
						}
						execute_queue.attachFirst(f,null);
					};

					return null;
				});
			}

			// -
			// トリップ
			// -
			function forName(target){
				if(BbsControlNameExist(target))	return;

				// -
				// BbsControlName を生成
				// -
				(function(){
					var p;
					var n;
					var q;
					var ignore_dictionary = {"SCRIPT":1};
					var queue = new Object();
					q = {p:queue,n:queue,node:target};
					queue.p = q;
					queue.n = q;

					while(queue.n != queue){
						q = queue.n;
						p = q.p;
						n = q.n;
						p.n = n;
						n.p = p;
						var node = q.node;
						switch(node.nodeType){
						case 1:
							if(!(ignore_dictionary[node.tagName])){
								var i;
								var nodes = node.childNodes;
								var num = nodes.length;
								for(i=0;i<num;i++){
									n = queue;
									p = n.p;
									q = {p:p,n:n,node:nodes[i]};
									p.n = q;
									n.p = q;
								}
							}
							break;
						case 3:
							while(node){

								// 本文
								var m = DomNodeGetNodeValue(node).match(new RegExp("(◆[a-zA-Z0-9+/.]{10,12})","i"));
								if(m){

									// 元のテキストノード
									DomNodeSetNodeValue(node,RegExp.leftContext);

									// BbsControlName を生成
									var control_name = new BbsControlName(null,false);
									control_name.setName(m[0]);
									var element_name = control_name.getElement();
									ElementSetTextContent(element_name,m[0]);
									DomNode_InsertAfter(node,element_name);

									// 直後テキスト
									node = DocumentCreateText(RegExp.rightContext);
									DomNode_InsertAfter(element_name,node);

									continue;
								}

								// 名前欄
								var m = DomNodeGetNodeValue(node).match(new RegExp("◆$","i"));
								if(m){
									try{
										var b = node.parentNode.nextSibling;
										var m = ElementGetTextContent(b).match(new RegExp("^([a-zA-Z0-9+/.]{10,12})$","i"));
										if(m){
											// BbsControlName を生成
											var control_name = new BbsControlName(null,true);
											control_name.setName("◆" + m[0]);
											var element_name = control_name.getElement();
											DomNode_InsertAfter(b,element_name);
										}
									}catch(e){
									}
								}

								break;
							}
							break;
						}
					}
				})();

				// -
				// BbsControlName を検索
				// -
				BbsControlNameSearch(target,function(control_name){

					control_name.setResponse(response);

					var name = control_name.getName();
					var myself = (response.getName() === name);
					var element_name = control_name.getElement();
					var textnode_name = DocumentCreateText("");


					// -
					// 変化があったときに実行されるイベント
					// -
					control_name.onchange = function(count){
						if(count > 1){
							DomNodeSetNodeValue(textnode_name,"(" + count + ")");
						}else{
							DomNodeSetNodeValue(textnode_name,"");
						}

						var style = element_name.style;
						if(count >= 5){
							StyleDeclarationSetProperty(style,"color","#e80000");
							StyleDeclarationRemoveProperty(style,"font-size");
						}else if(count >= 2){
							StyleDeclarationRemoveProperty(style,"color");
							StyleDeclarationRemoveProperty(style,"font-size");
						}else{
							StyleDeclarationSetProperty(style,"color","#888");
							StyleDeclarationSetProperty(style,"font-size","small");
						}
					};
					control_name.update();
					element_name.appendChild(textnode_name);

					// -
					// ポップアップ化
					// -
					if(type == "name"){
						if(myself) return null;
					}

					// ダイアログを作成
					var response_dialog = new BbsResponseDialog();
					if(parent_dialog)	parent_dialog.attachChild(response_dialog);
					response_dialog.setElementParent(node.parent);
					response_dialog.setElementHitArea(element_name);
					response_dialog.oncreate = function(_window,callback){

						var dl = DocumentCreateElement("dl");
						dl.style.margin = "0px";
						_window.appendChild(dl);

						var responses = bbs_dictionary.getResponsesFromName(name);
						var i = 0;
						var num = responses.length;
						if(myself){
							if(num < 2) return false;
						}else{
							if(num < 1) return false;
						}

						function f(){
							var response_name = responses[i];
							var clone = response_name.getCloneElements();

							var j;
							var clone_num = clone.length;
							if(clone_num){

								var param = new Object();
								param.parent = node.parent;
								for(j=0;j<clone_num;j++){
									var obj = clone[j];
									param[obj.name] = obj.element;
									dl.appendChild(obj.element);
								}

								// レスポンスダイアログを登録
								attachBbsResponseDialog(response_name,param,response_dialog,"name");
							}

							i += 1;
							if(i < num){
								execute_queue.attachFirst(f,null);
							}else{
								callback({result:true});
							}
						}
						execute_queue.attachFirst(f,null);
					};

					return null;
				});
			}

			// -
			// ホスト
			// -
			function forHost(target){
				if(BbsControlHostExist(target))	return;

				// -
				// BbsControlHost を生成
				// -
				(function(){
					var p;
					var n;
					var q;
					var ignore_dictionary = {"B":1,"SCRIPT":1};
					var queue = new Object();
					q = {p:queue,n:queue,node:target};
					queue.p = q;
					queue.n = q;

					while(queue.n != queue){
						q = queue.n;
						p = q.p;
						n = q.n;
						p.n = n;
						n.p = p;
						var node = q.node;
						switch(node.nodeType){
						case 1:
							if(!(ignore_dictionary[node.tagName])){
								var i;
								var nodes = node.childNodes;
								var num = nodes.length;
								for(i=0;i<num;i++){
									n = queue;
									p = n.p;
									q = {p:p,n:n,node:nodes[i]};
									p.n = q;
									n.p = q;
								}
							}
							break;
						case 3:
							while(node){
								var text_value = DomNodeGetNodeValue(node);

								var m = text_value.match(new RegExp("(^|HOST:)([-._a-zA-Z0-9]{1,}(\\.[-._a-zA-Z0-9]{1,}){2,})","i"));
								if(m){
									// 元のテキストノード
									DomNodeSetNodeValue(node,RegExp.leftContext + m[1]);

									// BbsControlHost を生成
									var control_host = new BbsControlHost(null,false);
									control_host.setHost(m[2]);
									var element_host = control_host.getElement();
									ElementSetTextContent(element_host,m[2]);
									DomNode_InsertAfter(node,element_host);

									// 直後テキスト
									node = DocumentCreateText(RegExp.rightContext);
									DomNode_InsertAfter(element_host,node);
									continue;
								}

								var m = text_value.match(new RegExp("(\\[ )([-._a-zA-Z0-9]{1,}(\\.[-._a-zA-Z0-9]{1,}){2,})((|\\n) \\])","i"));
								if(m){
									// 元のテキストノード
									DomNodeSetNodeValue(node,RegExp.leftContext + m[1]);

									// BbsControlHost を生成
									var control_host = new BbsControlHost(null,false);
									control_host.setHost(m[2]);
									var element_host = control_host.getElement();
									ElementSetTextContent(element_host,m[2]);
									DomNode_InsertAfter(node,element_host);

									// 直後テキスト
									node = DocumentCreateText("\n ]" + RegExp.rightContext);
									DomNode_InsertAfter(element_host,node);
									continue;
								}

								var m = text_value.match(new RegExp("(発信元:)([0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3})","i"));
								if(m){
									// 元のテキストノード
									DomNodeSetNodeValue(node,RegExp.leftContext + m[1]);

									// BbsControlHost を生成
									var control_host = new BbsControlHost(null,false);
									control_host.setHost(m[2]);
									var element_host = control_host.getElement();
									ElementSetTextContent(element_host,m[2]);
									DomNode_InsertAfter(node,element_host);

									// 直後テキスト
									node = DocumentCreateText(RegExp.rightContext);
									DomNode_InsertAfter(element_host,node);
									continue;
								}

								break;
							}

							break;
						}
					}
				})();

				// -
				// BbsControlHost を検索
				// -
				BbsControlHostSearch(target,function(control_host){

					control_host.setResponse(response);

					var host = control_host.getHost();
					var myself = (response.getHost() === host);
					var element_host = control_host.getElement();
					var textnode_host = DocumentCreateText("");


					// -
					// 変化があったときに実行されるイベント
					// -
					control_host.onchange = function(count){
						if(count > 1){
							DomNodeSetNodeValue(textnode_host,"(" + count + ")");
						}else{
							DomNodeSetNodeValue(textnode_host,"");
						}

						var style = element_host.style;
						if(count >= 5){
							StyleDeclarationSetProperty(style,"color","#e80000");
							StyleDeclarationRemoveProperty(style,"font-size");
						}else if(count >= 2){
							StyleDeclarationRemoveProperty(style,"color");
							StyleDeclarationRemoveProperty(style,"font-size");
						}else{
							StyleDeclarationSetProperty(style,"color","#888");
							StyleDeclarationSetProperty(style,"font-size","80%");
						}
					};
					control_host.update();
					element_host.appendChild(textnode_host);

					// -
					// ポップアップ化
					// -
					if(type == "host"){
						if(myself) return null;
					}

					// ダイアログを作成
					var response_dialog = new BbsResponseDialog();
					if(parent_dialog)	parent_dialog.attachChild(response_dialog);
					response_dialog.setElementParent(node.parent);
					response_dialog.setElementHitArea(element_host);
					response_dialog.oncreate = function(_window,callback){

						var dl = DocumentCreateElement("dl");
						dl.style.margin = "0px";
						_window.appendChild(dl);

						var responses = bbs_dictionary.getResponsesFromHost(host);
						var i = 0;
						var num = responses.length;
						if(myself){
							if(num < 2) return false;
						}else{
							if(num < 1) return false;
						}

						function f(){
							var response_host = responses[i];
							var clone = response_host.getCloneElements();

							var j;
							var clone_num = clone.length;
							if(clone_num){

								var param = new Object();
								param.parent = node.parent;
								for(j=0;j<clone_num;j++){
									var obj = clone[j];
									param[obj.name] = obj.element;
									dl.appendChild(obj.element);
								}

								// レスポンスダイアログを登録
								attachBbsResponseDialog(response_host,param,response_dialog,"host");
							}

							i += 1;
							if(i < num){
								execute_queue.attachFirst(f,null);
							}else{
								callback({result:true});
							}
						}
						execute_queue.attachFirst(f,null);
					};

					return null;
				});
			}

			// -
			// フォロワー
			// -
			function forFollower(target){
				if(BbsControlFollowerExist(target))	return;

				// -
				// BbsControlFollower を生成
				// -
				var control_follower = new BbsControlFollower(null,true);
				control_follower.setResponse(response);

				var element_follower = control_follower.getElement();
				var textnode_follower = DocumentCreateText("");

				element_follower.appendChild(textnode_follower);

				// -
				// 変化があったときに実行されるイベント
				// -
				control_follower.onchange = function(count){
					if(count){
						textnode_follower.nodeValue = " follower(" + count + ")";
					}else{
						textnode_follower.nodeValue = "";
					}

					var style = element_follower.style;
					if(count >= 3){
						StyleDeclarationSetProperty(style,"color","#e80000");
						StyleDeclarationRemoveProperty(style,"font-size");

					}else{
						StyleDeclarationSetProperty(style,"color","#888");
						StyleDeclarationSetProperty(style,"font-size","small");
					}
					if(count){
						StyleDeclarationSetProperty(style,"margin","0px 4px 0px 0px");
					}else{
						StyleDeclarationRemoveProperty(style,"margin");
					}
				};
				control_follower.update();
				var nodes = ElementGetElementsByTagName(target,"br");
				if(nodes.length){
					DomNode_InsertBefore(nodes[0],element_follower);
				}else{
					target.appendChild(element_follower);
				}

				// -
				// ポップアップ化
				// -
				// ダイアログを作成
				var response_dialog = new BbsResponseDialog();
				if(parent_dialog)	parent_dialog.attachChild(response_dialog);
				response_dialog.setElementParent(node.parent);
				response_dialog.setElementHitArea(element_follower);
				response_dialog.oncreate = function(_window,callback){

					var dl = DocumentCreateElement("dl");
					dl.style.margin = "0px";
					_window.appendChild(dl);

					var ary = response.getFollower();
					var i = 0;
					var num = ary.length;
					if(num <= 0) return false;

					function f(){
						var follower = bbs_dictionary.getResponse(ary[i].getNumber());
						var clone = follower.getCloneElements();

						var j;
						var clone_num = clone.length;
						if(clone_num){

							var param = new Object();
							param.parent = node.parent;
							for(j=0;j<clone_num;j++){
								var obj = clone[j];
								param[obj.name] = obj.element;
								dl.appendChild(obj.element);
							}

							// レスポンスダイアログを登録
							attachBbsResponseDialog(follower,param,response_dialog,"response");
						}

						i += 1;
						if(i < num){
							execute_queue.attachFirst(f,null);
						}else{
							callback({result:true});
						}
					}
					execute_queue.attachFirst(f,null);
				};
			}

			if(node.dt){
				forResponseAnchor(node.dt);
				forId(node.dt);
				forName(node.dt);
				forHost(node.dt);
				forFollower(node.dt);
			}
			if(node.dd){
				forResponseAnchor(node.dd);
				forId(node.dd);
				forName(node.dd);
			}
		}

		// -
		// エレメントを解析
		// -
		var useful = (function(){
			var dt = element;
			var dd;
			var br;

			try{
				if(dt.tagName != "DT")	return false;
			}catch(e){
				return false;
			}

			dd = dt.nextSibling;
			try{
				if(dd.tagName != "DD")	return false;
			}catch(e){
				return false;
			}

			try{
				var dl = dt.parentNode;
				if(dl.tagName != "DL")	return false;
			}catch(e){
				return false;
			}

			try{
				br = dd.nextSibling.nextSibling;
				if(br.tagName != "BR"){
					br = null;
				}
			}catch(e){
			}

			// 改行補充
			if(!br){
				br = DocumentCreateElement('br');
				var text_node = DocumentCreateText("\n");
				DomNodeInsertAfter(element,text_node);
				DomNodeInsertAfter(text_node,br);
			}

			// document に未登録
			if(!DomNodeGetAttachedDocument(dt))	return false;

			// -
			// レスアンカー拡張
			// -
			work.extendResponseAnchor(dd);

			// -
			// クリーンアップ
			// -
			(function(){
				function cleanup(target){
					BbsControlSearchTrash(target,function(element){
						var node = element.firstChild;
						if(!node)	return null;
						if(node.nodeType != 3)	return null;

						// ID
						var m = node.nodeValue.match(new RegExp("^ID:([a-zA-Z0-9+/.]{3,10})[●!]{0,2}","i"));
						if(m){
							// 直後テキスト
							var node = DocumentCreateText(m[0]);
							DomNode_InsertAfter(element,node);
							DomNodeRemove(element);
							return null;
						}

						// トリップ
						var m = node.nodeValue.match(new RegExp("^(◆[a-zA-Z0-9+/.]{10,12})","i"));
						if(m){
							// 直後テキスト
							var node = DocumentCreateText(m[0]);
							DomNode_InsertAfter(element,node);
							DomNodeRemove(element);
							return null;
						}

						// ホスト名
						var m = node.nodeValue.match(new RegExp("^([-._a-zA-Z0-9]{1,}(\\.[-._a-zA-Z0-9]{1,}){2,})","i"));
						if(m){
							// 直後テキスト
							var node = DocumentCreateText(m[0]);
							DomNode_InsertAfter(element,node);
							DomNodeRemove(element);

							// テキストノードを統合
							node.parentNode.normalize();
							return null;
						}
						var m = node.nodeValue.match(new RegExp("^([0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3})","i"));
						if(m){
							// 直後テキスト
							var node = DocumentCreateText(m[0]);
							DomNode_InsertAfter(element,node);
							DomNodeRemove(element);

							// テキストノードを統合
							node.parentNode.normalize();
							return null;
						}

						return null;
					});
				}

				if(dt){
					cleanup(dt);
				}
				if(dd){
					cleanup(dd);
				}
			})();

			// ナンバーを取得
			var dt_text = ElementGetTextContent(dt);
			if(!(dt_text.match(new RegExp("([0-9]+)[ ]","i"))))	return false;

			// ナンバーからレスポンスオブジェクトを取得
			var response = bbs_dictionary.getResponse(parseInt(RegExp.$1));

			// レスポンス解析
			if(!response.getAnalyzed()){

				// IDの取得
				if(dt_text.match(new RegExp("ID:([a-zA-Z0-9+/.]{3,10})[●!]{0,2}","i"))){
					response.setId(RegExp.$1);
				}

				// 名前の取得
				if(dt_text.match(new RegExp("(◆[a-zA-Z0-9+/.]{10,12})","i"))){
					response.setName(RegExp.$1);
				}

				// ホスト名の取得
				(function(){
					var p;
					var n;
					var q;
					var ignore_dictionary = {"B":1,"SCRIPT":1};
					var queue = new Object();
					q = {p:queue,n:queue,node:dt};
					queue.p = q;
					queue.n = q;

					while(queue.n != queue){
						q = queue.n;
						p = q.p;
						n = q.n;
						p.n = n;
						n.p = p;
						var node = q.node;
						switch(node.nodeType){
						case 1:
							if(!(ignore_dictionary[node.tagName])){
								var i;
								var nodes = node.childNodes;
								var num = nodes.length;
								for(i=0;i<num;i++){
									n = queue;
									p = n.p;
									q = {p:p,n:n,node:nodes[i]};
									p.n = q;
									n.p = q;
								}
							}
							break;
						case 3:
							var m = DomNodeGetNodeValue(node).match(new RegExp("(^|HOST:)([-._a-zA-Z0-9]{1,}(\\.[-._a-zA-Z0-9]{1,}){2,})","i"));
							if(m){
								response.setHost(m[2]);
								return;
							}
							var m = DomNodeGetNodeValue(node).match(new RegExp("(\\[ )([-._a-zA-Z0-9]{1,}(\\.[-._a-zA-Z0-9]{1,}){2,})(|\\n) \\]","i"));
							if(m){
								response.setHost(m[2]);
								return;
							}
							var m = DomNodeGetNodeValue(node).match(new RegExp("(発信元:)([0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3})","i"));
							if(m){
								response.setHost(m[2]);
								return;
							}
							break;
						}
					}
				})();

				// フォロー解析
				var dictionary = new Object();
				(function(){
					var nodes = ElementGetElementsByTagName(dd,"a");
					var i;
					var num = nodes.length;
					for(i=0;i<num;i++){
						var numbers = work.createResponseAnchorNumbers(ElementGetTextContent(nodes[i]));
						numbers.getNumbers(function(n){
							if(!dictionary[n]){
								var following = bbs_dictionary.getResponse(n);
								following.addFollower(response);
								dictionary[n] = true;
							}
						});
					}
				})();

				// オリジナルエレメントをセット
				if(dt)	response.addOriginalElements("dt",dt);
				if(dd)	response.addOriginalElements("dd",dd);
				if(br)	response.addOriginalElements("br",br);

				// 消去時に実行されるイベント
				response.onerase = function(){
					var original = response.getOriginalElements();

					// オリジナルエレメントを外す
					var i;
					var num = original.length;
					for(i=0;i<num;i++){
						var revise_scroll = new DocumentReviseScroll();
						var node = original[i].element;
						revise_scroll.executeRemoveElementBefore(node);
						DomNodeRemove(node);
						revise_scroll.executeRemoveElementAfter(node);
					}
				};

				response.setAnalyzed();
			}
			
			var dl = document.body;
			var node = dt;
			while(node){
				if(node.tagName == "DL"){
					dl = node;
				}
				node = node.parentNode;
			}

			// レスポンスダイアログを登録(ルート)
			attachBbsResponseDialog(
				response,
				{
					dt:dt,
					dd:dd,
					parent:dl
				},
				null,
				null
			);

			return true;
		})();

		response({useful:useful});
		return true;
	}

			]);

			// -
			// 掲示板設定「みみずん検索」
			// -
			attachItem( "ExpandBbs_ScriptInitialize_Mimizun" , [
	
	function(info,response){
		var work = info.work;

		// -
		// 基本URL抽出
		// -
		var url = document.URL;
		var bbs_list = [
			{url:"(http://mimizun\\.com/log/2ch/[^/]+/[0-9]+)",replace:"$1/",name:"mimizun"},
			{url:"(http://mimizun\\.com/log/machi/[^/]+/[0-9]+)",replace:"$1/",name:"mimizun"}
		];

		var i;
		var num = bbs_list.length;
		for(i=0;i<num;i++){
			var bbs = bbs_list[i];
			var re = new RegExp(bbs.url,"i");
			var m = url.match(re);
			if(m){
				work.base_url = m[1].replace(re,bbs.replace);
				work.bbs_name = bbs.name;
				break;
			}
		}

		return false;
	},
	function (info,response){
		var work = info.work;
		if(!(work.bbs_name)){
			return false;
		}

		var first_id = 1;
		var last_id = 1;
		var dictionary_id = new Array();
		var element_parent = null;
		var read_more_button = null;
		var element_form = null;
		var base_url = work.base_url;
		var resource_url_shadow = base_url;
		var resource_url_more = base_url;

		// -
		// 文字列からレスポンス番号を取得
		// -
		work.createResponseAnchorNumbers = function (str){
			var numbers = new ResponseAnchorNumbers();

			var re_search = new RegExp("^(>>|<<|>>|<<|>|>|》|≫|&gt;&gt;)([0-90-9]+)","i");
			var re_range = new RegExp("^([0-90-9]+)[-]([0-90-9]+)","i");
			var re_number = new RegExp("^([0-90-9]+)","i");

			var m = str.match(re_search);
			if(m){
				var p = m[1].length;
				while(true){
					// 番号-番号
					m = str.substr(p).match(re_range);
					if(m){
						var id0 = parseInt(StringConvertFromNumericFullToNumericHalf(m[1]));
						var id1 = parseInt(StringConvertFromNumericFullToNumericHalf(m[2]));
						if(id0 < 1) id0 = 1;
						if(id1 < 1) id1 = 1;
						if(id0 > 10000) id0 = 10000;
						if(id1 > 10000) id1 = 10000;
						p += m[0].length;
						numbers.addNumbers(id0,id1);
					}else{
						// 番号
						m = str.substr(p).match(re_number);
						if(m){
							p += m[0].length;
							var id = parseInt(StringConvertFromNumericFullToNumericHalf(m[1]));
							if(id < 1) id = 1;
							if(id > 0x7fffffff) id = 0x7fffffff;
							numbers.addNumber(id);
						}
					}

					if(m){
						// カンマ
						if(RegExp.rightContext.search(",") == 0){
							p += 1;
							continue;
						}
					}
					break;
				}
			}
			return numbers;
		};

		// -
		// レスアンカー拡張
		// -
		work.extendResponseAnchor = function (target){
			if(BbsControlResponseAnchorExist(target))	return;

			var re_simple = new RegExp("^(>>|<<|>)[-,0-90-9]+$","i");
			var re_detail = new RegExp("(>>|<<|>>|<<|>|>|》|≫|&gt;&gt;)(([0-90-9]+[-][0-90-9]+|[0-90-9]+),)*([0-90-9]+[-][0-90-9]+|[0-90-9]+)","i");
			var re_range = new RegExp("([0-90-9]+)[-]([0-90-9]+)","i");
			var re_number = new RegExp("([0-90-9]+)","i");

			var i;
			var nodes = ElementGetElementsByTagName(target,"a");
			var num = nodes.length;
			for(i=num-1;i>=0;i--){
				var node = nodes[i];
				var m = ElementGetTextContent(node).match(re_simple);
				if(m){
					var text_node = DocumentCreateText(m[0]);
					DomNode_InsertBefore(node,text_node);
					DomNodeRemove(node);
				}
			}

			// テキストノードを統合
			target.normalize();

			var p;
			var n;
			var q;
			var ignore_dictionary = {"A":1,"SCRIPT":1};
			var queue = new Object();
			q = {p:queue,n:queue,node:target};
			queue.p = q;
			queue.n = q;

			while(queue.n != queue){
				q = queue.n;
				p = q.p;
				n = q.n;
				p.n = n;
				n.p = p;
				var node = q.node;
				switch(node.nodeType){
				case 1:
					var i;
					var nodes = node.childNodes;
					var num = nodes.length;
					for(i=0;i<num;i++){
						n = queue;
						p = n.p;
						q = {p:p,n:n,node:nodes[i]};
						p.n = q;
						n.p = q;
					}
					break;
				case 3:
					while(node){
						var m = DomNodeGetNodeValue(node).match(re_detail);
						if(!m)	break;

						// 元のテキストノード
						DomNodeSetNodeValue(node,RegExp.leftContext);

						// BbsControlName を生成
						var element = DocumentCreateElement("a");
						ElementSetTextContent(element,m[0]);
						DomNode_InsertAfter(node,element);

						// 直後テキスト
						node = DocumentCreateText(RegExp.rightContext);
						DomNode_InsertAfter(element,node);

						var query = "";
						m = ElementGetTextContent(element).match(re_range);
						if(m){
							var min = parseInt(StringConvertFromNumericFullToNumericHalf(m[1]));
							var max = parseInt(StringConvertFromNumericFullToNumericHalf(m[2]));
							if(min < 1) min = 1;
							if(max < 1) max = 1;
							if(min > 10000) min = 10000;
							if(max > 10000) max = 10000;
							if(max < min){
								var tmp = min;
								min = max;
								max = tmp;
							}
							query = min + "-" + max;
						}else{
							// 番号
							m = ElementGetTextContent(element).match(re_number);
							if(m){
								query = parseInt(StringConvertFromNumericFullToNumericHalf(m[0]));
								if(query < 1) query = 1;
								if(query > 0x7fffffff) query = 0x7fffffff;
							}

						}
						element.href = work.base_url + query;
					}
				}
			}
		};

		// -
		// 継ぎ足し読み込み
		// -
		function readMore(callback){

			// ローダーオブジェクトを作成
			var loader = new Loader();

			// 成功
			loader.onload = function(str){
				var re_number = new RegExp("<a name=\"([0-9]+)\">","i");

				var p = 0;
				var n = str.length;
				var add_count = 0;
				function f(){
					try{
						if(p >= n) throw 0;
						p = str.indexOf("<div class=\"contributor\">",p);
						if(p < 0) throw 0;
						var e = str.indexOf("\n",p);
						var s = str.substring(p,e);
						var m = s.match(re_number);
						if(m){
							var id = parseInt(m[1]);
							if(last_id < id){
								var response = bbs_dictionary.getResponse(id);
								response.clearAnalyzed();
								response.clearOriginalElements();
								response.clearFollowing();

								var nodes = StringHtmlCreateDomNodesSafe(s);
								var j;
								var node_num = nodes.length;
								for(j=0;j<node_num;j++){
									element_parent.appendChild(nodes[j]);
								}
								last_id = id;
								add_count += 1;
								resource_url_more = base_url + (last_id) + "-";
							}
						}

						if(p < e){
							p = e + 1;
							execute_queue.attachFirst(f,null);
							return;
						}
					}catch(e){
					}
					callback({result:true,add_count:add_count});
				}
				execute_queue.attachFirst(f,null);
			};

			// 失敗
			loader.onerror = function(){
				callback({result:false});
			};

			// テキストの読み込み
			loader.setMethod("GET");
			loader.setURL(resource_url_more);
			loader.overrideMimeType("text/plain; charset=Shift_JIS");
			loader.loadText();
		}

		// -
		// レスポンス親要素
		// -
		if(!element_parent) element_parent = document.getElementById("thread");
		if(!element_parent) element_parent = document.getElementById("thread2");
		if(!element_parent) return false;

		// -
		// 範囲取得
		// -
		var nodes = ElementGetElementsByTagName(element_parent,"div");
		var i;
		var node_num = nodes.length;
		for(i=0;i<node_num;i++){
			var node = nodes[i];
			if(node.className == "contributor"){
				var m = ElementGetTextContent(node).match(new RegExp("([0-9]+)","i"));
				if(m){
					first_id = parseInt(m[1]);
					dictionary_id[first_id] = true;
					if(first_id != 1){
						break;
					}
				}
			}
		}
		for(i=node_num-1;i>=0;i--){
			var node = nodes[i];
			if(node.className == "contributor"){
				var m = ElementGetTextContent(node).match(new RegExp("([0-9]+)","i"));
				if(m){
					last_id = parseInt(m[1]);
					dictionary_id[last_id] = true;
					break;
				}
			}
		}

		// -
		// アクセス先 URL
		// -
		resource_url_shadow = base_url;
		resource_url_more = base_url + last_id + "-";

		// -
		// BbsControlReadMoreButton 作成
		// -
		read_more_button = new BbsControlReadMoreButton();
		read_more_button.setWaitTime(2 * 1000);
		read_more_button.onclick = readMore;
		DomNode_InsertAfter(element_parent,read_more_button.getElement());

		// -
		// シャドウロード
		// -
		(function(){
			// ローダーオブジェクトを作成
			var loader = new Loader();

			// 成功
			loader.onload = function(str){
				var re_number = new RegExp("<a name=\"([0-9]+)\">","i");
				var re_id = new RegExp("ID:([a-zA-Z0-9+/.]{8,10})[●!]{0,2}","i");
				var re_name = new RegExp("(◆(|[ ])[a-zA-Z0-9+/.]{10,12})","i");

				var p = 0;
				var n = str.length;
				function f(){
					if(p >= n) return;
					p = str.indexOf("<div class=\"contributor\">",p);
					if(p < 0) return;
					var e = str.indexOf("\n",p);
					var s = str.substring(p,e);
					var m = s.match(re_number);
					if(m){
						var id = parseInt(m[1]);
						if((first_id <= id) && (id <= last_id)){
						}else if(dictionary_id[id]){
						}else{
							// ナンバーからレスポンスオブジェクトを取得
							var response = bbs_dictionary.getResponse(id);
							if(!(response.getAnalyzed())){
								var nodes = StringHtmlCreateDomNodesSafe(s);
								var dt = nodes[0];
								var dd = nodes[1];

								try{
									if(dt.tagName != "DIV")	return;
									if(dt.className != "contributor")	return;
									if(dd.tagName != "DIV")	return;
									if(dd.className != "res")	return;
								}catch(e){
									return;
								}

								var dt_text = ElementGetTextContent(dt);

								// レスアンカー拡張
								work.extendResponseAnchor(dd);

								// IDの取得
								if(dt_text.match(re_id)){
									response.setId(RegExp.$1);
								}

								// 名前の取得
								if(dt_text.match(re_name)){
									response.setName(RegExp.$1);
								}

								// ホスト名の取得
								(function(){
									var p;
									var n;
									var q;
									var ignore_dictionary = {"B":1,"SCRIPT":1};
									var queue = new Object();
									q = {p:queue,n:queue,node:dt};
									queue.p = q;
									queue.n = q;

									while(queue.n != queue){
										q = queue.n;
										p = q.p;
										n = q.n;
										p.n = n;
										n.p = p;
										var node = q.node;
										switch(node.nodeType){
										case 1:
											if(!(ignore_dictionary[node.tagName])){
												var i;
												var nodes = node.childNodes;
												var num = nodes.length;
												for(i=0;i<num;i++){
													n = queue;
													p = n.p;
													q = {p:p,n:n,node:nodes[i]};
													p.n = q;
													n.p = q;
												}
											}
											break;
										case 3:
											var m = DomNodeGetNodeValue(node).match(new RegExp("(^|HOST:)([-._a-zA-Z0-9]{1,}(\\.[-._a-zA-Z0-9]{1,}){2,})","i"));
											if(m){
												response.setHost(m[2]);
												return;
											}
											var m = DomNodeGetNodeValue(node).match(new RegExp("(\\[ )([-._a-zA-Z0-9]{1,}(\\.[-._a-zA-Z0-9]{1,}){2,}) \\]","i"));
											if(m){
												response.setHost(m[2]);
												return;
											}
											var m = DomNodeGetNodeValue(node).match(new RegExp("(発信元:)([0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3})","i"));
											if(m){
												response.setHost(m[2]);
												return;
											}
											break;
										}
									}
								})();

								// フォロー解析
								var dictionary = new Object();
								(function(){
									var nodes = ElementGetElementsByTagName(dd,"a");
									var i;
									var num = nodes.length;
									for(i=0;i<num;i++){
										var numbers = work.createResponseAnchorNumbers(ElementGetTextContent(nodes[i]));
										numbers.getNumbers(function(n){
											if(!dictionary[n]){
												var following = bbs_dictionary.getResponse(n);
												following.addFollower(response);
												dictionary[n] = true;
											}
										});
									}
								})();

								// オリジナルエレメントをセット
								if(dt)	response.addOriginalElements("dt",dt);
								if(dd)	response.addOriginalElements("dd",dd);

								// 消去時に実行されるイベント
								response.onerase = function(){};

								response.setAnalyzed();
							}
						}
					}

					if(p < e){
						p = e + 1;
						execute_queue.attachFirst(f,null);
					}
				}
				execute_queue.attachFirst(f,null);
			};

			// 失敗
			loader.onerror = function(){
			};

			// テキストの読み込み
			loader.setMethod("GET");
			loader.setURL(resource_url_shadow);
			loader.loadText();
		})();

		response({result:true});
		return true;
	},
	function (info,response){
		response({result:false});
		return true;
	}

			]);

			// -
			// 掲示板設定「みみずん検索」
			// -
			attachItem( "ExpandBbs_ScriptCallback_Mimizun" , [
	
	function(info,response){
		var element = info.element;
		var work = info.work;

		// -
		// レスポンスダイアログを登録
		// -
		function attachBbsResponseDialog(response,node,parent_dialog,type){

			// -
			// レスアンカー
			// -
			function forResponseAnchor(target){
				if(BbsControlResponseAnchorExist(target))	return;

				// -
				// BbsControlResponseAnchor を生成
				// -
				(function(){
					var i;
					var nodes = ElementGetElementsByTagName(target,"a");
					var num = nodes.length;
					for(i=0;i<num;i++){
						var node = nodes[i];
						var numbers = work.createResponseAnchorNumbers(ElementGetTextContent(node));
						if(numbers.getCount()){
							var control_res_anchor = new BbsControlResponseAnchor(node,false);
							control_res_anchor.setResponseAnchorNumbers(numbers);
						}
					}
				})();

				// -
				// BbsControlResponseAnchor を検索
				// -
				BbsControlResponseAnchorSearch(target,function(control_res_anchor){

					var element_res_anchor = control_res_anchor.getElement();
					var numbers = control_res_anchor.getResponseAnchorNumbers();

					// ダイアログを作成
					var response_dialog = new BbsResponseDialog();
					if(parent_dialog)	parent_dialog.attachChild(response_dialog);
					response_dialog.setElementParent(node.parent);
					response_dialog.setElementHitArea(element_res_anchor);
					response_dialog.oncreate = function(_window,callback){

						var created = false;
						var i = 0;
						var number_list = numbers.getNumberList();
						var num = number_list.length;
						if(!num) return false;

						function f(){
							var following = bbs_dictionary.getResponse(number_list[i]);
							var clone = following.getCloneElements();

							var j;
							var clone_num = clone.length;
							if(clone_num){
								var param = new Object();
								param.parent = node.parent;
								for(j=0;j<clone_num;j++){
									var obj = clone[j];
									param[obj.name] = obj.element;
									_window.appendChild(obj.element);
								}
								try{
									var dd = ElementGetElementsByTagName(param["dt"],"p")[0];
									DomNode_InsertBefore(dd,param["dd"]);
									DomNodeRemove(dd);
								}catch(e){
								}

								// レスポンスダイアログを登録
								attachBbsResponseDialog(following,param,response_dialog,"response");

								created = true;
							}

							i += 1;
							if(i < num){
								execute_queue.attachFirst(f,null);
							}else{
								callback({result:created});
							}
						}
						execute_queue.attachFirst(f,null);
					};

					return null;
				});
			}

			// -
			// ID
			// -
			function forId(target){
				if(BbsControlIdExist(target))	return;

				// -
				// BbsControlId を生成
				// -
				(function(){
					var p;
					var n;
					var q;
					var ignore_dictionary = {"A":1,"SCRIPT":1};
					var queue = new Object();
					q = {p:queue,n:queue,node:target};
					queue.p = q;
					queue.n = q;

					while(queue.n != queue){
						q = queue.n;
						p = q.p;
						n = q.n;
						p.n = n;
						n.p = p;
						var node = q.node;
						switch(node.nodeType){
						case 1:
							if(!(ignore_dictionary[node.tagName])){
								var i;
								var nodes = node.childNodes;
								var num = nodes.length;
								for(i=0;i<num;i++){
									n = queue;
									p = n.p;
									q = {p:p,n:n,node:nodes[i]};
									p.n = q;
									n.p = q;
								}
							}

							break;
						case 3:
							while(node){

								var m = DomNodeGetNodeValue(node).match(new RegExp("ID:([a-zA-Z0-9+/.]{8,10})[●!]{0,2}","i"));
								if(!m)	break;

								// 元のテキストノード
								DomNodeSetNodeValue(node,RegExp.leftContext);

								// BbsControlId を生成
								var control_id = new BbsControlId(null,false);
								control_id.setId(m[1]);
								var element_id = control_id.getElement();
								ElementSetTextContent(element_id,m[0]);
								DomNode_InsertAfter(node,element_id);

								// 直後テキスト
								node = DocumentCreateText(RegExp.rightContext);
								DomNode_InsertAfter(element_id,node);
							}
							break;
						}
					}
				})();

				// -
				// BbsControlId を検索
				// -
				BbsControlIdSearch(target,function(control_id){

					control_id.setResponse(response);

					var id = control_id.getId();
					var myself = (response.getId() === id);
					var element_id = control_id.getElement();
					var textnode_id = DocumentCreateText("");

					element_id.appendChild(textnode_id);

					// -
					// 変化があったときに実行されるイベント
					// -
					control_id.onchange = function(count){
						if(count > 1){
							DomNodeSetNodeValue(textnode_id,"(" + count + ")");
						}else{
							DomNodeSetNodeValue(textnode_id,"");
						}

						var style = element_id.style;
						if(count >= 5){
							StyleDeclarationSetProperty(style,"color","#e80000");
							StyleDeclarationRemoveProperty(style,"font-size");
						}else if(count >= 2){
							StyleDeclarationRemoveProperty(style,"color");
							StyleDeclarationRemoveProperty(style,"font-size");
						}else{
							StyleDeclarationSetProperty(style,"color","#888");
							StyleDeclarationSetProperty(style,"font-size","small");
						}
					};
					control_id.update();

					// -
					// ポップアップ化
					// -
					if(type == "id"){
						if(myself) return null;
					}

					// ダイアログを作成
					var response_dialog = new BbsResponseDialog();
					if(parent_dialog)	parent_dialog.attachChild(response_dialog);
					response_dialog.setElementParent(node.parent);
					response_dialog.setElementHitArea(element_id);
					response_dialog.oncreate = function(_window,callback){

						var responses = bbs_dictionary.getResponsesFromId(id);
						var i = 0;
						var num = responses.length;
						if(myself){
							if(num < 2) return false;
						}else{
							if(num < 1) return false;
						}

						function f(){
							var response_id = responses[i];
							var clone = response_id.getCloneElements();

							var j;
							var clone_num = clone.length;
							if(clone_num){

								var param = new Object();
								param.parent = node.parent;
								for(j=0;j<clone_num;j++){
									var obj = clone[j];
									param[obj.name] = obj.element;
									_window.appendChild(obj.element);
								}
								try{
									var dd = ElementGetElementsByTagName(param["dt"],"p")[0];
									DomNode_InsertBefore(dd,param["dd"]);
									DomNodeRemove(dd);
								}catch(e){
								}

								// レスポンスダイアログを登録
								attachBbsResponseDialog(response_id,param,response_dialog,"id");
							}

							i += 1;
							if(i < num){
								execute_queue.attachFirst(f,null);
							}else{
								callback({result:true});
							}
						}
						execute_queue.attachFirst(f,null);
					};

					return null;
				});
			}

			// -
			// トリップ
			// -
			function forName(target){
				if(BbsControlNameExist(target))	return;

				// -
				// BbsControlName を生成
				// -
				(function(){
					var p;
					var n;
					var q;
					var ignore_dictionary = {"SCRIPT":1};
					var queue = new Object();
					q = {p:queue,n:queue,node:target};
					queue.p = q;
					queue.n = q;

					while(queue.n != queue){
						q = queue.n;
						p = q.p;
						n = q.n;
						p.n = n;
						n.p = p;
						var node = q.node;
						switch(node.nodeType){
						case 1:
							if(!(ignore_dictionary[node.tagName])){
								var i;
								var nodes = node.childNodes;
								var num = nodes.length;
								for(i=0;i<num;i++){
									n = queue;
									p = n.p;
									q = {p:p,n:n,node:nodes[i]};
									p.n = q;
									n.p = q;
								}
							}
							break;
						case 3:
							while(node){

								// 本文
								var m = DomNodeGetNodeValue(node).match(new RegExp("(◆(|[ ])[a-zA-Z0-9+/.]{10,12})","i"));
								if(!m)	break;

								// 元のテキストノード
								DomNodeSetNodeValue(node,RegExp.leftContext);

								// BbsControlName を生成
								var control_name = new BbsControlName(null,false);
								control_name.setName(m[0]);
								var element_name = control_name.getElement();
								ElementSetTextContent(element_name,m[0]);
								DomNode_InsertAfter(node,element_name);

								// 直後テキスト
								node = DocumentCreateText(RegExp.rightContext);
								DomNode_InsertAfter(element_name,node);
							}
							break;
						}
					}
				})();

				// -
				// BbsControlName を検索
				// -
				BbsControlNameSearch(target,function(control_name){

					control_name.setResponse(response);

					var name = control_name.getName();
					var myself = (response.getName() === name);
					var element_name = control_name.getElement();
					var textnode_name = DocumentCreateText("");


					// -
					// 変化があったときに実行されるイベント
					// -
					control_name.onchange = function(count){
						if(count > 1){
							DomNodeSetNodeValue(textnode_name,"(" + count + ")");
						}else{
							DomNodeSetNodeValue(textnode_name,"");
						}

						var style = element_name.style;
						if(count >= 5){
							StyleDeclarationSetProperty(style,"color","#e80000");
							StyleDeclarationRemoveProperty(style,"font-size");
						}else if(count >= 2){
							StyleDeclarationRemoveProperty(style,"color");
							StyleDeclarationRemoveProperty(style,"font-size");
						}else{
							StyleDeclarationSetProperty(style,"color","#888");
							StyleDeclarationSetProperty(style,"font-size","small");
						}
					};
					control_name.update();
					element_name.appendChild(textnode_name);

					// -
					// ポップアップ化
					// -
					if(type == "name"){
						if(myself) return null;
					}

					// ダイアログを作成
					var response_dialog = new BbsResponseDialog();
					if(parent_dialog)	parent_dialog.attachChild(response_dialog);
					response_dialog.setElementParent(node.parent);
					response_dialog.setElementHitArea(element_name);
					response_dialog.oncreate = function(_window,callback){

						var responses = bbs_dictionary.getResponsesFromName(name);
						var i = 0;
						var num = responses.length;
						if(myself){
							if(num < 2) return false;
						}else{
							if(num < 1) return false;
						}

						function f(){
							var response_name = responses[i];
							var clone = response_name.getCloneElements();

							var j;
							var clone_num = clone.length;
							if(clone_num){

								var param = new Object();
								param.parent = node.parent;
								for(j=0;j<clone_num;j++){
									var obj = clone[j];
									param[obj.name] = obj.element;
									_window.appendChild(obj.element);
								}
								try{
									var dd = ElementGetElementsByTagName(param["dt"],"p")[0];
									DomNode_InsertBefore(dd,param["dd"]);
									DomNodeRemove(dd);
								}catch(e){
								}

								// レスポンスダイアログを登録
								attachBbsResponseDialog(response_name,param,response_dialog,"name");
							}

							i += 1;
							if(i < num){
								execute_queue.attachFirst(f,null);
							}else{
								callback({result:true});
							}
						}
						execute_queue.attachFirst(f,null);
					};

					return null;
				});
			}

			// -
			// ホスト
			// -
			function forHost(target){
				if(BbsControlHostExist(target))	return;

				// -
				// BbsControlHost を生成
				// -
				(function(){
					var p;
					var n;
					var q;
					var ignore_dictionary = {"B":1,"SCRIPT":1};
					var queue = new Object();
					q = {p:queue,n:queue,node:target};
					queue.p = q;
					queue.n = q;

					while(queue.n != queue){
						q = queue.n;
						p = q.p;
						n = q.n;
						p.n = n;
						n.p = p;
						var node = q.node;
						switch(node.nodeType){
						case 1:
							if(!(ignore_dictionary[node.tagName])){
								var i;
								var nodes = node.childNodes;
								var num = nodes.length;
								for(i=0;i<num;i++){
									n = queue;
									p = n.p;
									q = {p:p,n:n,node:nodes[i]};
									p.n = q;
									n.p = q;
								}
							}
							break;
						case 3:
							while(node){
								var text_value = DomNodeGetNodeValue(node);

								var m = text_value.match(new RegExp("(^|HOST:)([-._a-zA-Z0-9]{1,}(\\.[-._a-zA-Z0-9]{1,}){2,})","i"));
								if(m){
									// 元のテキストノード
									DomNodeSetNodeValue(node,RegExp.leftContext + m[1]);

									// BbsControlHost を生成
									var control_host = new BbsControlHost(null,false);
									control_host.setHost(m[2]);
									var element_host = control_host.getElement();
									ElementSetTextContent(element_host,m[2]);
									DomNode_InsertAfter(node,element_host);

									// 直後テキスト
									node = DocumentCreateText(RegExp.rightContext);
									DomNode_InsertAfter(element_host,node);
									continue;
								}

								var m = text_value.match(new RegExp("(\\[ )([-._a-zA-Z0-9]{1,}(\\.[-._a-zA-Z0-9]{1,}){2,})( \\])","i"));
								if(m){
									// 元のテキストノード
									DomNodeSetNodeValue(node,RegExp.leftContext + m[1]);

									// BbsControlHost を生成
									var control_host = new BbsControlHost(null,false);
									control_host.setHost(m[2]);
									var element_host = control_host.getElement();
									ElementSetTextContent(element_host,m[2]);
									DomNode_InsertAfter(node,element_host);

									// 直後テキスト
									node = DocumentCreateText(" ]" + RegExp.rightContext);
									DomNode_InsertAfter(element_host,node);
									continue;
								}

								var m = text_value.match(new RegExp("(発信元:)([0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3})","i"));
								if(m){
									// 元のテキストノード
									DomNodeSetNodeValue(node,RegExp.leftContext + m[1]);

									// BbsControlHost を生成
									var control_host = new BbsControlHost(null,false);
									control_host.setHost(m[2]);
									var element_host = control_host.getElement();
									ElementSetTextContent(element_host,m[2]);
									DomNode_InsertAfter(node,element_host);

									// 直後テキスト
									node = DocumentCreateText(RegExp.rightContext);
									DomNode_InsertAfter(element_host,node);
									continue;
								}

								break;
							}

							break;
						}
					}
				})();

				// -
				// BbsControlHost を検索
				// -
				BbsControlHostSearch(target,function(control_host){

					control_host.setResponse(response);

					var host = control_host.getHost();
					var myself = (response.getHost() === host);
					var element_host = control_host.getElement();
					var textnode_host = DocumentCreateText("");


					// -
					// 変化があったときに実行されるイベント
					// -
					control_host.onchange = function(count){
						if(count > 1){
							DomNodeSetNodeValue(textnode_host,"(" + count + ")");
						}else{
							DomNodeSetNodeValue(textnode_host,"");
						}

						var style = element_host.style;
						if(count >= 5){
							StyleDeclarationSetProperty(style,"color","#e80000");
							StyleDeclarationRemoveProperty(style,"font-size");
						}else if(count >= 2){
							StyleDeclarationRemoveProperty(style,"color");
							StyleDeclarationRemoveProperty(style,"font-size");
						}else{
							StyleDeclarationSetProperty(style,"color","#888");
							StyleDeclarationSetProperty(style,"font-size","80%");
						}
					};
					control_host.update();
					element_host.appendChild(textnode_host);

					// -
					// ポップアップ化
					// -
					if(type == "host"){
						if(myself) return null;
					}

					// ダイアログを作成
					var response_dialog = new BbsResponseDialog();
					if(parent_dialog)	parent_dialog.attachChild(response_dialog);
					response_dialog.setElementParent(node.parent);
					response_dialog.setElementHitArea(element_host);
					response_dialog.oncreate = function(_window,callback){

						var responses = bbs_dictionary.getResponsesFromHost(host);
						var i = 0;
						var num = responses.length;
						if(myself){
							if(num < 2) return false;
						}else{
							if(num < 1) return false;
						}

						function f(){
							var response_host = responses[i];
							var clone = response_host.getCloneElements();

							var j;
							var clone_num = clone.length;
							if(clone_num){

								var param = new Object();
								param.parent = node.parent;
								for(j=0;j<clone_num;j++){
									var obj = clone[j];
									param[obj.name] = obj.element;
									_window.appendChild(obj.element);
								}
								try{
									var dd = ElementGetElementsByTagName(param["dt"],"p")[0];
									DomNode_InsertBefore(dd,param["dd"]);
									DomNodeRemove(dd);
								}catch(e){
								}

								// レスポンスダイアログを登録
								attachBbsResponseDialog(response_host,param,response_dialog,"host");
							}

							i += 1;
							if(i < num){
								execute_queue.attachFirst(f,null);
							}else{
								callback({result:true});
							}
						}
						execute_queue.attachFirst(f,null);
					};

					return null;
				});
			}

			// -
			// フォロワー
			// -
			function forFollower(target){
				if(BbsControlFollowerExist(target))	return;

				// -
				// BbsControlFollower を生成
				// -
				var control_follower = new BbsControlFollower(null,true);
				control_follower.setResponse(response);

				var element_follower = control_follower.getElement();
				var textnode_follower = DocumentCreateText("");

				element_follower.appendChild(textnode_follower);

				// -
				// 変化があったときに実行されるイベント
				// -
				control_follower.onchange = function(count){
					if(count){
						textnode_follower.nodeValue = " follower(" + count + ")";
					}else{
						textnode_follower.nodeValue = "";
					}

					var style = element_follower.style;
					if(count >= 3){
						StyleDeclarationSetProperty(style,"color","#e80000");
						StyleDeclarationRemoveProperty(style,"font-size");

					}else{
						StyleDeclarationSetProperty(style,"color","#888");
						StyleDeclarationSetProperty(style,"font-size","small");
					}
					if(count){
						StyleDeclarationSetProperty(style,"margin","0px 4px 0px 0px");
					}else{
						StyleDeclarationRemoveProperty(style,"margin");
					}
				};
				control_follower.update();
				var nodes = ElementGetElementsByTagName(target,"br");
				if(nodes.length){
					DomNode_InsertBefore(nodes[0],element_follower);
				}else{
					target.appendChild(element_follower);
				}

				// -
				// ポップアップ化
				// -
				// ダイアログを作成
				var response_dialog = new BbsResponseDialog();
				if(parent_dialog)	parent_dialog.attachChild(response_dialog);
				response_dialog.setElementParent(node.parent);
				response_dialog.setElementHitArea(element_follower);
				response_dialog.oncreate = function(_window,callback){

					var ary = response.getFollower();
					var i = 0;
					var num = ary.length;
					if(num <= 0) return false;

					function f(){
						var follower = bbs_dictionary.getResponse(ary[i].getNumber());
						var clone = follower.getCloneElements();

						var j;
						var clone_num = clone.length;
						if(clone_num){

							var param = new Object();
							param.parent = node.parent;
							for(j=0;j<clone_num;j++){
								var obj = clone[j];
								param[obj.name] = obj.element;
								_window.appendChild(obj.element);
							}
							try{
								var dd = ElementGetElementsByTagName(param["dt"],"p")[0];
								DomNode_InsertBefore(dd,param["dd"]);
								DomNodeRemove(dd);
							}catch(e){
							}

							// レスポンスダイアログを登録
							attachBbsResponseDialog(follower,param,response_dialog,"response");
						}

						i += 1;
						if(i < num){
							execute_queue.attachFirst(f,null);
						}else{
							callback({result:true});
						}
					}
					execute_queue.attachFirst(f,null);
				};
			}

			if(node.dt){
				forResponseAnchor(node.dt);
				forId(node.dt);
				forName(node.dt);
				forHost(node.dt);
				forFollower(node.dt);
			}
			if(node.dd){
				forResponseAnchor(node.dd);
				forId(node.dd);
				forName(node.dd);
			}
		}

		// -
		// エレメントを解析
		// -
		var useful = (function(){
			var dt = element;
			var dd;

			try{
				if(dt.tagName != "DIV")	return false;
				if(dt.className != "contributor")	return false;
			}catch(e){
				return false;
			}

			dd = dt.nextSibling;
			try{
				if(dd.tagName != "DIV")	return false;
				if(dd.className != "res")	return false;
			}catch(e){
				return false;
			}

			try{
				var div = dt.parentNode;
				if(div.tagName != "DIV")	return false;
				if(div.id.indexOf("thread") != 0)	return false;
			}catch(e){
				return false;
			}

			// document に未登録
			if(!DomNodeGetAttachedDocument(dt))	return false;

			// -
			// レスアンカー拡張
			// -
			work.extendResponseAnchor(dd);

			// -
			// クリーンアップ
			// -
			(function(){
				function cleanup(target){
					BbsControlSearchTrash(target,function(element){
						var node = element.firstChild;
						if(!node)	return null;
						if(node.nodeType != 3)	return null;

						// ID
						var m = node.nodeValue.match(new RegExp("^ID:([a-zA-Z0-9+/.]{8,10})[●!]{0,2}","i"));
						if(m){
							// 直後テキスト
							var node = DocumentCreateText(m[0]);
							DomNode_InsertAfter(element,node);
							DomNodeRemove(element);
							return null;
						}

						// トリップ
						var m = node.nodeValue.match(new RegExp("^(◆(|[ ])[a-zA-Z0-9+/.]{10,12})","i"));
						if(m){
							// 直後テキスト
							var node = DocumentCreateText(m[0]);
							DomNode_InsertAfter(element,node);
							DomNodeRemove(element);
							return null;
						}

						// ホスト名
						var m = node.nodeValue.match(new RegExp("^([-._a-zA-Z0-9]{1,}(\\.[-._a-zA-Z0-9]{1,}){2,})","i"));
						if(m){
							// 直後テキスト
							var node = DocumentCreateText(m[0]);
							DomNode_InsertAfter(element,node);
							DomNodeRemove(element);

							// テキストノードを統合
							node.parentNode.normalize();
							return null;
						}
						var m = node.nodeValue.match(new RegExp("^([0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3})","i"));
						if(m){
							// 直後テキスト
							var node = DocumentCreateText(m[0]);
							DomNode_InsertAfter(element,node);
							DomNodeRemove(element);

							// テキストノードを統合
							node.parentNode.normalize();
							return null;
						}

						return null;
					});
				}

				if(dt){
					cleanup(dt);
				}
				if(dd){
					cleanup(dd);
				}
			})();

			// ナンバーを取得
			var dt_text = ElementGetTextContent(dt);
			if(!(dt_text.match(new RegExp("([0-9]+)","i"))))	return false;

			// ナンバーからレスポンスオブジェクトを取得
			var response = bbs_dictionary.getResponse(parseInt(RegExp.$1));

			// レスポンス解析
			if(!response.getAnalyzed()){

				(function(){
					// 本文を除外
					var dt_clone = dt.cloneNode(true);
					try{
						var dd = ElementGetElementsByTagName(dt_clone,"p")[0];
						DomNodeRemove(dd);
					}catch(e){
					}
					dt_text = ElementGetTextContent(dt_clone);
				})();

				// IDの取得
				if(dt_text.match(new RegExp("ID:([a-zA-Z0-9+/.]{8,10})[●!]{0,2}","i"))){
					response.setId(RegExp.$1);
				}

				// 名前の取得
				if(dt_text.match(new RegExp("(◆(|[ ])[a-zA-Z0-9+/.]{10,12})","i"))){
					response.setName(RegExp.$1);
				}

				// ホスト名の取得
				(function(){
					var p;
					var n;
					var q;
					var ignore_dictionary = {"B":1,"SCRIPT":1};
					var queue = new Object();
					q = {p:queue,n:queue,node:dt};
					queue.p = q;
					queue.n = q;

					while(queue.n != queue){
						q = queue.n;
						p = q.p;
						n = q.n;
						p.n = n;
						n.p = p;
						var node = q.node;
						switch(node.nodeType){
						case 1:
							if(!(ignore_dictionary[node.tagName])){
								var i;
								var nodes = node.childNodes;
								var num = nodes.length;
								for(i=0;i<num;i++){
									n = queue;
									p = n.p;
									q = {p:p,n:n,node:nodes[i]};
									p.n = q;
									n.p = q;
								}
							}
							break;
						case 3:
							var m = DomNodeGetNodeValue(node).match(new RegExp("(^|HOST:)([-._a-zA-Z0-9]{1,}(\\.[-._a-zA-Z0-9]{1,}){2,})","i"));
							if(m){
								response.setHost(m[2]);
								return;
							}
							var m = DomNodeGetNodeValue(node).match(new RegExp("(\\[ )([-._a-zA-Z0-9]{1,}(\\.[-._a-zA-Z0-9]{1,}){2,}) \\]","i"));
							if(m){
								response.setHost(m[2]);
								return;
							}
							var m = DomNodeGetNodeValue(node).match(new RegExp("(発信元:)([0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3})","i"));
							if(m){
								response.setHost(m[2]);
								return;
							}
							break;
						}
					}
				})();

				// フォロー解析
				var dictionary = new Object();
				(function(){
					var nodes = ElementGetElementsByTagName(dd,"a");
					var i;
					var num = nodes.length;
					for(i=0;i<num;i++){
						var numbers = work.createResponseAnchorNumbers(ElementGetTextContent(nodes[i]));
						numbers.getNumbers(function(n){
							if(!dictionary[n]){
								var following = bbs_dictionary.getResponse(n);
								following.addFollower(response);
								dictionary[n] = true;
							}
						});
					}
				})();

				// オリジナルエレメントをセット
				if(dt)	response.addOriginalElements("dt",dt);
				if(dd)	response.addOriginalElements("dd",dd);

				// 消去時に実行されるイベント
				response.onerase = function(){
					var original = response.getOriginalElements();

					// オリジナルエレメントを外す
					var i;
					var num = original.length;
					for(i=0;i<num;i++){
						var revise_scroll = new DocumentReviseScroll();
						var node = original[i].element;
						revise_scroll.executeRemoveElementBefore(node);
						DomNodeRemove(node);
						revise_scroll.executeRemoveElementAfter(node);
					}
				};

				response.setAnalyzed();
			}

			// レスポンスダイアログを登録(ルート)
			attachBbsResponseDialog(
				response,
				{
					dt:dt,
					dd:dd,
					parent:dt.parentNode
				},
				null,
				null
			);

			return true;
		})();

		response({useful:useful});
		return true;
	}

			]);

			// -
			// 掲示板設定「ログ速」
			// -
			attachItem( "ExpandBbs_ScriptInitialize_Logsoku" , [
	
	function(info,response){
		var work = info.work;

		// -
		// 基本URL抽出
		// -
		var url = document.URL;
		var bbs_list = [
			{url:"http://logsoku\\.com/thread/.*?\\.2ch\\.net/.*?/[0-9]+/",name:"logsoku"},
			{url:"http://.*?\\.logsoku\\.com/r/.*?/[0-9]+/",name:"logsoku"},
			{url:"http://logsoku\\.com/r/.*?/[0-9]+/",name:"logsoku"}
		];

		var i;
		var num = bbs_list.length;
		for(i=0;i<num;i++){
			var bbs = bbs_list[i];
			var re = new RegExp(bbs.url,"i");
			var m = url.match(re);
			if(m){
				work.base_url = m[0];
				work.bbs_name = bbs.name;
				break;
			}
		}

		return false;
	},
	function (info,response){
		var work = info.work;
		if(!(work.bbs_name)){
			return false;
		}

		var first_id = 1;
		var last_id = 1;
		var dictionary_id = new Array();
		var element_parent = null;
		var read_more_button = null;
		var element_form = null;
		var base_url = work.base_url;
		var resource_url_shadow = base_url;
		var resource_url_more = base_url;

		// -
		// 文字列からレスポンス番号を取得
		// -
		work.createResponseAnchorNumbers = function (str){
			var numbers = new ResponseAnchorNumbers();

			var re_search = new RegExp("^(>>|<<|>>|<<|>|>|》|≫|&gt;&gt;)([0-90-9]+)","i");
			var re_range = new RegExp("^([0-90-9]+)[-]([0-90-9]+)","i");
			var re_number = new RegExp("^([0-90-9]+)","i");

			var m = str.match(re_search);
			if(m){
				var p = m[1].length;
				while(true){
					// 番号-番号
					m = str.substr(p).match(re_range);
					if(m){
						var id0 = parseInt(StringConvertFromNumericFullToNumericHalf(m[1]));
						var id1 = parseInt(StringConvertFromNumericFullToNumericHalf(m[2]));
						if(id0 < 1) id0 = 1;
						if(id1 < 1) id1 = 1;
						if(id0 > 10000) id0 = 10000;
						if(id1 > 10000) id1 = 10000;
						p += m[0].length;
						numbers.addNumbers(id0,id1);
					}else{
						// 番号
						m = str.substr(p).match(re_number);
						if(m){
							p += m[0].length;
							var id = parseInt(StringConvertFromNumericFullToNumericHalf(m[1]));
							if(id < 1) id = 1;
							if(id > 0x7fffffff) id = 0x7fffffff;
							numbers.addNumber(id);
						}
					}

					if(m){
						// カンマ
						if(RegExp.rightContext.search(",") == 0){
							p += 1;
							continue;
						}
					}
					break;
				}
			}
			return numbers;
		};

		// -
		// レスアンカー拡張
		// -
		work.extendResponseAnchor = function (target){
			if(BbsControlResponseAnchorExist(target))	return;

			var re_simple = new RegExp("^(>>|<<|>)[-,0-90-9]+$","i");
			var re_detail = new RegExp("(>>|<<|>>|<<|>|>|》|≫|&gt;&gt;)(([0-90-9]+[-][0-90-9]+|[0-90-9]+),)*([0-90-9]+[-][0-90-9]+|[0-90-9]+)","i");
			var re_range = new RegExp("([0-90-9]+)[-]([0-90-9]+)","i");
			var re_number = new RegExp("([0-90-9]+)","i");

			var i;
			var nodes = ElementGetElementsByTagName(target,"a");
			var num = nodes.length;
			for(i=num-1;i>=0;i--){
				var node = nodes[i];
				var m = ElementGetTextContent(node).match(re_simple);
				if(m){
					var text_node = DocumentCreateText(m[0]);
					DomNode_InsertBefore(node,text_node);
					DomNodeRemove(node);
				}
			}

			// テキストノードを統合
			target.normalize();

			var p;
			var n;
			var q;
			var ignore_dictionary = {"A":1,"SCRIPT":1};
			var queue = new Object();
			q = {p:queue,n:queue,node:target};
			queue.p = q;
			queue.n = q;

			while(queue.n != queue){
				q = queue.n;
				p = q.p;
				n = q.n;
				p.n = n;
				n.p = p;
				var node = q.node;
				switch(node.nodeType){
				case 1:
					var i;
					var nodes = node.childNodes;
					var num = nodes.length;
					for(i=0;i<num;i++){
						n = queue;
						p = n.p;
						q = {p:p,n:n,node:nodes[i]};
						p.n = q;
						n.p = q;
					}
					break;
				case 3:
					while(node){
						var m = DomNodeGetNodeValue(node).match(re_detail);
						if(!m)	break;

						// 元のテキストノード
						DomNodeSetNodeValue(node,RegExp.leftContext);

						// BbsControlName を生成
						var element = DocumentCreateElement("a");
						ElementSetTextContent(element,m[0]);
						DomNode_InsertAfter(node,element);

						// 直後テキスト
						node = DocumentCreateText(RegExp.rightContext);
						DomNode_InsertAfter(element,node);

						var query = "";
						m = ElementGetTextContent(element).match(re_range);
						if(m){
							var min = parseInt(StringConvertFromNumericFullToNumericHalf(m[1]));
							var max = parseInt(StringConvertFromNumericFullToNumericHalf(m[2]));
							if(min < 1) min = 1;
							if(max < 1) max = 1;
							if(min > 10000) min = 10000;
							if(max > 10000) max = 10000;
							if(max < min){
								var tmp = min;
								min = max;
								max = tmp;
							}
							query = min + "-" + max;
						}else{
							// 番号
							m = ElementGetTextContent(element).match(re_number);
							if(m){
								query = parseInt(StringConvertFromNumericFullToNumericHalf(m[0]));
								if(query < 1) query = 1;
								if(query > 0x7fffffff) query = 0x7fffffff;
							}

						}
						element.href = work.base_url + query;
					}
				}
			}
		};

		// -
		// 継ぎ足し読み込み
		// -
		function readMore(callback){

			// ローダーオブジェクトを作成
			var loader = new Loader();

			// 成功
			loader.onload = function(str){
				var re_number = new RegExp("<div id=\"([0-9]+)\">","i");

				var p = 0;
				var n = str.length;
				var add_count = 0;
				function f(){
					try{
						if(p >= n) throw 0;
						p = str.indexOf("<div id=",p);
						if(p < 0) throw 0;
						var e = str.indexOf("</div>",p);
						if(e >= 0){
							e = str.indexOf("</div>",e + 6);
							if(e >= 0) e += 6;
						}
						var s = str.substring(p,e);
						var m = s.match(re_number);
						if(m){
							var id = parseInt(m[1]);
							if(last_id < id){
								var response = bbs_dictionary.getResponse(id);
								response.clearAnalyzed();
								response.clearOriginalElements();
								response.clearFollowing();

								var nodes = StringHtmlCreateDomNodesSafe(s);
								var j;
								var node_num = nodes.length;
								for(j=0;j<node_num;j++){
									element_parent.appendChild(nodes[j]);
								}
								last_id = id;
								add_count += 1;
								resource_url_more = base_url + (last_id) + "-";
							}
						}

						if(p < e){
							p = e;
							execute_queue.attachFirst(f,null);
							return;
						}
					}catch(e){
					}
					callback({result:true,add_count:add_count});
				}

				p = str.indexOf("<div id=\"comments\">",p);
				if(p >= 0){
					p += 19;
					execute_queue.attachFirst(f,null);
				}
			};

			// 失敗
			loader.onerror = function(){
				callback({result:false});
			};

			// テキストの読み込み
			loader.setMethod("GET");
			loader.setURL(resource_url_more);
			loader.loadText();
		}

		// -
		// レスポンス親要素
		// -
		element_parent = document.getElementById("comments");
		if(!element_parent) return false;

		// -
		// 範囲取得
		// -
		var nodes = ElementGetElementsByTagName(element_parent,"div");
		var i;
		var node_num = nodes.length;
		for(i=0;i<node_num;i++){
			var node = nodes[i];
			var m = node.id.match(new RegExp("^([0-9]+)$","i"));
			if(m){
				first_id = parseInt(m[1]);
				dictionary_id[first_id] = true;
				if(first_id != 1){
					break;
				}
			}
		}
		for(i=node_num-1;i>=0;i--){
			var node = nodes[i];
			var m = node.id.match(new RegExp("^([0-9]+)$","i"));
			if(m){
				last_id = parseInt(m[1]);
				dictionary_id[last_id] = true;
				break;
			}
		}

		// -
		// アクセス先 URL
		// -
		resource_url_shadow = base_url;
		resource_url_more = base_url + last_id + "-";

		// -
		// BbsControlReadMoreButton 作成
		// -
		read_more_button = new BbsControlReadMoreButton();
		read_more_button.setWaitTime(2 * 1000);
		read_more_button.onclick = readMore;
		DomNode_InsertAfter(element_parent,read_more_button.getElement());


		// -
		// シャドウロード
		// -
		(function(){
			// ローダーオブジェクトを作成
			var loader = new Loader();

			// 成功
			loader.onload = function(str){
				var re_number = new RegExp("<div id=\"([0-9]+)\">","i");
				var re_id = new RegExp("ID:([-a-zA-Z0-9+/.]+)[●!]{0,2}","i");
				var re_name = new RegExp("(◆[a-zA-Z0-9+/.]{10,12})","i");

				var p = 0;
				var n = str.length;
				function f(){
					if(p >= n) return;
					p = str.indexOf("<div id=",p);
					if(p < 0) return;
					var e = str.indexOf("</div>",p);
					if(e >= 0){
						e = str.indexOf("</div>",e + 6);
						if(e >= 0) e += 6;
					}
					var s = str.substring(p,e);
					var m = s.match(re_number);
					if(m){
						var id = parseInt(m[1]);
						if((first_id <= id) && (id <= last_id)){
						}else if(dictionary_id[id]){
						}else{
							// ナンバーからレスポンスオブジェクトを取得
							var response = bbs_dictionary.getResponse(id);
							if(!(response.getAnalyzed())){
								var nodes = StringHtmlCreateDomNodesSafe(s);
								var dt = nodes[0];
								var dd = ElementGetElementsByTagName(dt,"DIV")[0];

								try{
									if(dt.tagName != "DIV")	return;
									if(!dt.id.match(/^[0-9]+$/))	return;
									if(dd.className != "comment")	return;
								}catch(e){
									return;
								}

								var dt_text = ElementGetTextContent(dt);

								// レスアンカー拡張
								work.extendResponseAnchor(dd);

								// IDの取得
								if(dt_text.match(re_id)){
									response.setId(RegExp.$1);
								}

								// 名前の取得
								if(dt_text.match(re_name)){
									response.setName(RegExp.$1);
								}

								// ホスト名の取得
								(function(){
									var p;
									var n;
									var q;
									var ignore_dictionary = {"B":1,"SCRIPT":1};
									var queue = new Object();
									q = {p:queue,n:queue,node:dt};
									queue.p = q;
									queue.n = q;

									while(queue.n != queue){
										q = queue.n;
										p = q.p;
										n = q.n;
										p.n = n;
										n.p = p;
										var node = q.node;
										switch(node.nodeType){
										case 1:
											if(!(ignore_dictionary[node.tagName])){
												var i;
												var nodes = node.childNodes;
												var num = nodes.length;
												for(i=0;i<num;i++){
													n = queue;
													p = n.p;
													q = {p:p,n:n,node:nodes[i]};
													p.n = q;
													n.p = q;
												}
											}
											break;
										case 3:
											var m = DomNodeGetNodeValue(node).match(new RegExp("(^|HOST:)([-._a-zA-Z0-9]{1,}(\\.[-._a-zA-Z0-9]{1,}){2,})","i"));
											if(m){
												response.setHost(m[2]);
												return;
											}
											var m = DomNodeGetNodeValue(node).match(new RegExp("(\\[ )([-._a-zA-Z0-9]{1,}(\\.[-._a-zA-Z0-9]{1,}){2,})\\n \\]","i"));
											if(m){
												response.setHost(m[2]);
												return;
											}
											var m = DomNodeGetNodeValue(node).match(new RegExp("(発信元:)([0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3})","i"));
											if(m){
												response.setHost(m[2]);
												return;
											}
											break;
										}
									}
								})();

								// フォロー解析
								var dictionary = new Object();
								(function(){
									var nodes = ElementGetElementsByTagName(dd,"a");
									var i;
									var num = nodes.length;
									for(i=0;i<num;i++){
										var numbers = work.createResponseAnchorNumbers(ElementGetTextContent(nodes[i]));
										numbers.getNumbers(function(n){
											if(!dictionary[n]){
												var following = bbs_dictionary.getResponse(n);
												following.addFollower(response);
												dictionary[n] = true;
											}
										});
									}
								})();

								// オリジナルエレメントをセット
								if(dt)	response.addOriginalElements("dt",dt);
								if(dd)	response.addOriginalElements("dd",dd);

								// 消去時に実行されるイベント
								response.onerase = function(){};

								response.setAnalyzed();
							}
						}
					}
					if(p < e){
						p = e;
						execute_queue.attachFirst(f,null);
					}
				}

				p = str.indexOf("<div id=\"comments\">",p);
				if(p >= 0){
					p += 19;
					execute_queue.attachFirst(f,null);
				}
			};

			// 失敗
			loader.onerror = function(){
			};

			// テキストの読み込み
			loader.setMethod("GET");
			loader.setURL(resource_url_shadow);
			loader.loadText();
		})();

		response({result:true});
		return true;

	},
	function (info,response){
		response({result:false});
		return true;
	}

			]);

			// -
			// 掲示板設定「ログ速」
			// -
			attachItem( "ExpandBbs_ScriptCallback_Logsoku" , [
	
	function(info,response){
		var element = info.element;
		var work = info.work;

		// -
		// レスポンスダイアログを登録
		// -
		function attachBbsResponseDialog(response,node,parent_dialog,type){

			// -
			// レスアンカー
			// -
			function forResponseAnchor(target){
				if(BbsControlResponseAnchorExist(target))	return;

				// -
				// BbsControlResponseAnchor を生成
				// -
				(function(){
					var i;
					var nodes = ElementGetElementsByTagName(target,"a");
					var num = nodes.length;
					for(i=0;i<num;i++){
						var node = nodes[i];
						var numbers = work.createResponseAnchorNumbers(ElementGetTextContent(node));
						if(numbers.getCount()){
							var control_res_anchor = new BbsControlResponseAnchor(node,false);
							control_res_anchor.setResponseAnchorNumbers(numbers);
						}
					}
				})();

				// -
				// BbsControlResponseAnchor を検索
				// -
				BbsControlResponseAnchorSearch(target,function(control_res_anchor){

					var element_res_anchor = control_res_anchor.getElement();
					var numbers = control_res_anchor.getResponseAnchorNumbers();

					// ダイアログを作成
					var response_dialog = new BbsResponseDialog();
					if(parent_dialog)	parent_dialog.attachChild(response_dialog);
					response_dialog.setElementParent(node.parent);
					response_dialog.setElementHitArea(element_res_anchor);
					response_dialog.oncreate = function(_window,callback){

						var created = false;
						var i = 0;
						var number_list = numbers.getNumberList();
						var num = number_list.length;
						if(!num) return false;

						function f(){
							var following = bbs_dictionary.getResponse(number_list[i]);
							var clone = following.getCloneElements();

							var j;
							var clone_num = clone.length;
							if(clone_num){
								var param = new Object();
								param.parent = node.parent;
								for(j=0;j<clone_num;j++){
									var obj = clone[j];
									param[obj.name] = obj.element;
									_window.appendChild(obj.element);
								}
								try{
									var dd = ElementGetElementsByTagName(param["dt"],"div")[0];
									DomNode_InsertBefore(dd,param["dd"]);
									DomNodeRemove(dd);
									param["dd"].style.minHeight = "0px";
								}catch(e){
								}

								// レスポンスダイアログを登録
								attachBbsResponseDialog(following,param,response_dialog,"response");

								created = true;
							}

							i += 1;
							if(i < num){
								execute_queue.attachFirst(f,null);
							}else{
								callback({result:created});
							}
						}
						execute_queue.attachFirst(f,null);
					};

					return null;
				});
			}

			// -
			// ID
			// -
			function forId(target){
				if(BbsControlIdExist(target))	return;

				// -
				// BbsControlId を生成
				// -
				(function(){
					var p;
					var n;
					var q;
					var ignore_dictionary = {"A":1,"SCRIPT":1};
					var queue = new Object();
					q = {p:queue,n:queue,node:target};
					queue.p = q;
					queue.n = q;

					while(queue.n != queue){
						q = queue.n;
						p = q.p;
						n = q.n;
						p.n = n;
						n.p = p;
						var node = q.node;
						switch(node.nodeType){
						case 1:
							if(!(ignore_dictionary[node.tagName])){
								var i;
								var nodes = node.childNodes;
								var num = nodes.length;
								for(i=0;i<num;i++){
									n = queue;
									p = n.p;
									q = {p:p,n:n,node:nodes[i]};
									p.n = q;
									n.p = q;
								}
							}

							// 名前欄
							if(node.tagName == "SPAN"){
								var link;
								try{ link = node.dataset["logsokuLink"]; }catch(e){}
								if(!link) link = "";
								var m = link.match(new RegExp("/ID:([a-zA-Z0-9+/.]{8,10})[●!]{0,2}$","i"));
								if(m){
									// BbsControlId を生成
									var control_id = new BbsControlId(null,true);
									control_id.setId(m[1]);
									var element_id = control_id.getElement();
									DomNode_InsertAfter(node,element_id);
									var textnode_id = DocumentCreateText("");
									element_id.appendChild(textnode_id);
									control_id.setTextNode(textnode_id);
								}
							}

							break;
						case 3:
							while(node){

								var m = DomNodeGetNodeValue(node).match(new RegExp("ID:([a-zA-Z0-9+/.]{8,10})[●!]{0,2}","i"));
								if(!m)	break;

								// 元のテキストノード
								DomNodeSetNodeValue(node,RegExp.leftContext);

								// BbsControlId を生成
								var control_id = new BbsControlId(null,false);
								control_id.setId(m[1]);
								var element_id = control_id.getElement();
								ElementSetTextContent(element_id,m[0]);
								DomNode_InsertAfter(node,element_id);
								var textnode_id = DocumentCreateText("");
								element_id.appendChild(textnode_id);
								control_id.setTextNode(textnode_id);

								// 直後テキスト
								node = DocumentCreateText(RegExp.rightContext);
								DomNode_InsertAfter(element_id,node);
							}
							break;
						}
					}
				})();

				// -
				// BbsControlId を検索
				// -
				BbsControlIdSearch(target,function(control_id){

					control_id.setResponse(response);

					var id = control_id.getId();
					var myself = (response.getId() === id);
					var element_id = control_id.getElement();
					var textnode_id = control_id.getTextNode();

					// -
					// 変化があったときに実行されるイベント
					// -
					control_id.onchange = function(count){
						if(count > 1){
							DomNodeSetNodeValue(textnode_id,"(" + count + ")");
						}else{
							DomNodeSetNodeValue(textnode_id,"");
						}

						var style = element_id.style;
						if(count >= 5){
							StyleDeclarationSetProperty(style,"color","#e80000");
							StyleDeclarationRemoveProperty(style,"font-size");
						}else if(count >= 2){
							StyleDeclarationRemoveProperty(style,"color");
							StyleDeclarationRemoveProperty(style,"font-size");
						}else{
							StyleDeclarationSetProperty(style,"color","#888");
							StyleDeclarationSetProperty(style,"font-size","small");
						}
					};
					control_id.update();

					// -
					// ポップアップ化
					// -
					if(type == "id"){
						if(myself) return null;
					}

					// ダイアログを作成
					var response_dialog = new BbsResponseDialog();
					if(parent_dialog)	parent_dialog.attachChild(response_dialog);
					response_dialog.setElementParent(node.parent);
					response_dialog.setElementHitArea(element_id);
					response_dialog.oncreate = function(_window,callback){

						var responses = bbs_dictionary.getResponsesFromId(id);
						var i = 0;
						var num = responses.length;
						if(myself){
							if(num < 2) return false;
						}else{
							if(num < 1) return false;
						}

						function f(){
							var response_id = responses[i];
							var clone = response_id.getCloneElements();

							var j;
							var clone_num = clone.length;
							if(clone_num){

								var param = new Object();
								param.parent = node.parent;
								for(j=0;j<clone_num;j++){
									var obj = clone[j];
									param[obj.name] = obj.element;
									_window.appendChild(obj.element);
								}
								try{
									var dd = ElementGetElementsByTagName(param["dt"],"div")[0];
									DomNode_InsertBefore(dd,param["dd"]);
									DomNodeRemove(dd);
									param["dd"].style.minHeight = "0px";
								}catch(e){
								}

								// レスポンスダイアログを登録
								attachBbsResponseDialog(response_id,param,response_dialog,"id");
							}

							i += 1;
							if(i < num){
								execute_queue.attachFirst(f,null);
							}else{
								callback({result:true});
							}
						}
						execute_queue.attachFirst(f,null);
					};

					return null;
				});
			}

			// -
			// トリップ
			// -
			function forName(target){
				if(BbsControlNameExist(target))	return;

				// -
				// BbsControlName を生成
				// -
				(function(){
					var p;
					var n;
					var q;
					var ignore_dictionary = {"SCRIPT":1};
					var queue = new Object();
					q = {p:queue,n:queue,node:target};
					queue.p = q;
					queue.n = q;

					while(queue.n != queue){
						q = queue.n;
						p = q.p;
						n = q.n;
						p.n = n;
						n.p = p;
						var node = q.node;
						switch(node.nodeType){
						case 1:
							if(!(ignore_dictionary[node.tagName])){
								var i;
								var nodes = node.childNodes;
								var num = nodes.length;
								for(i=0;i<num;i++){
									n = queue;
									p = n.p;
									q = {p:p,n:n,node:nodes[i]};
									p.n = q;
									n.p = q;
								}
							}
							break;
						case 3:
							while(node){

								// 本文
								var m = DomNodeGetNodeValue(node).match(new RegExp("(◆(|[ ])[a-zA-Z0-9+/.]{10,12})","i"));
								if(!m)	break;

								// 元のテキストノード
								DomNodeSetNodeValue(node,RegExp.leftContext);

								// BbsControlName を生成
								var control_name = new BbsControlName(null,false);
								control_name.setName(m[0]);
								var element_name = control_name.getElement();
								ElementSetTextContent(element_name,m[0]);
								DomNode_InsertAfter(node,element_name);

								// 直後テキスト
								node = DocumentCreateText(RegExp.rightContext);
								DomNode_InsertAfter(element_name,node);
							}
							break;
						}
					}
				})();

				// -
				// BbsControlName を検索
				// -
				BbsControlNameSearch(target,function(control_name){

					control_name.setResponse(response);

					var name = control_name.getName();
					var myself = (response.getName() === name);
					var element_name = control_name.getElement();
					var textnode_name = DocumentCreateText("");


					// -
					// 変化があったときに実行されるイベント
					// -
					control_name.onchange = function(count){
						if(count > 1){
							DomNodeSetNodeValue(textnode_name,"(" + count + ")");
						}else{
							DomNodeSetNodeValue(textnode_name,"");
						}

						var style = element_name.style;
						if(count >= 5){
							StyleDeclarationSetProperty(style,"color","#e80000");
							StyleDeclarationRemoveProperty(style,"font-size");
						}else if(count >= 2){
							StyleDeclarationRemoveProperty(style,"color");
							StyleDeclarationRemoveProperty(style,"font-size");
						}else{
							StyleDeclarationSetProperty(style,"color","#888");
							StyleDeclarationSetProperty(style,"font-size","small");
						}
					};
					control_name.update();
					element_name.appendChild(textnode_name);

					// -
					// ポップアップ化
					// -
					if(type == "name"){
						if(myself) return null;
					}

					// ダイアログを作成
					var response_dialog = new BbsResponseDialog();
					if(parent_dialog)	parent_dialog.attachChild(response_dialog);
					response_dialog.setElementParent(node.parent);
					response_dialog.setElementHitArea(element_name);
					response_dialog.oncreate = function(_window,callback){

						var responses = bbs_dictionary.getResponsesFromName(name);
						var i = 0;
						var num = responses.length;
						if(myself){
							if(num < 2) return false;
						}else{
							if(num < 1) return false;
						}

						function f(){
							var response_name = responses[i];
							var clone = response_name.getCloneElements();

							var j;
							var clone_num = clone.length;
							if(clone_num){

								var param = new Object();
								param.parent = node.parent;
								for(j=0;j<clone_num;j++){
									var obj = clone[j];
									param[obj.name] = obj.element;
									_window.appendChild(obj.element);
								}
								try{
									var dd = ElementGetElementsByTagName(param["dt"],"div")[0];
									DomNode_InsertBefore(dd,param["dd"]);
									DomNodeRemove(dd);
									param["dd"].style.minHeight = "0px";
								}catch(e){
								}

								// レスポンスダイアログを登録
								attachBbsResponseDialog(response_name,param,response_dialog,"name");
							}

							i += 1;
							if(i < num){
								execute_queue.attachFirst(f,null);
							}else{
								callback({result:true});
							}
						}
						execute_queue.attachFirst(f,null);
					};

					return null;
				});
			}

			// -
			// ホスト
			// -
			function forHost(target){
				if(BbsControlHostExist(target))	return;

				// -
				// BbsControlHost を生成
				// -
				(function(){
					var p;
					var n;
					var q;
					var ignore_dictionary = {"B":1,"SCRIPT":1};
					var queue = new Object();
					q = {p:queue,n:queue,node:target};
					queue.p = q;
					queue.n = q;

					while(queue.n != queue){
						q = queue.n;
						p = q.p;
						n = q.n;
						p.n = n;
						n.p = p;
						var node = q.node;
						switch(node.nodeType){
						case 1:
							if(!(ignore_dictionary[node.tagName])){
								var i;
								var nodes = node.childNodes;
								var num = nodes.length;
								for(i=0;i<num;i++){
									n = queue;
									p = n.p;
									q = {p:p,n:n,node:nodes[i]};
									p.n = q;
									n.p = q;
								}
							}
							break;
						case 3:
							while(node){
								var text_value = DomNodeGetNodeValue(node);

								var m = text_value.match(new RegExp("(^|HOST:)([-._a-zA-Z0-9]{1,}(\\.[-._a-zA-Z0-9]{1,}){2,})","i"));
								if(m){
									// 元のテキストノード
									DomNodeSetNodeValue(node,RegExp.leftContext + m[1]);

									// BbsControlHost を生成
									var control_host = new BbsControlHost(null,false);
									control_host.setHost(m[2]);
									var element_host = control_host.getElement();
									ElementSetTextContent(element_host,m[2]);
									DomNode_InsertAfter(node,element_host);

									// 直後テキスト
									node = DocumentCreateText(RegExp.rightContext);
									DomNode_InsertAfter(element_host,node);
									continue;
								}

								var m = text_value.match(new RegExp("(\\[ )([-._a-zA-Z0-9]{1,}(\\.[-._a-zA-Z0-9]{1,}){2,})(\\n \\])","i"));
								if(m){
									// 元のテキストノード
									DomNodeSetNodeValue(node,RegExp.leftContext + m[1]);

									// BbsControlHost を生成
									var control_host = new BbsControlHost(null,false);
									control_host.setHost(m[2]);
									var element_host = control_host.getElement();
									ElementSetTextContent(element_host,m[2]);
									DomNode_InsertAfter(node,element_host);

									// 直後テキスト
									node = DocumentCreateText("\n ]" + RegExp.rightContext);
									DomNode_InsertAfter(element_host,node);
									continue;
								}

								var m = text_value.match(new RegExp("(発信元:)([0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3})","i"));
								if(m){
									// 元のテキストノード
									DomNodeSetNodeValue(node,RegExp.leftContext + m[1]);

									// BbsControlHost を生成
									var control_host = new BbsControlHost(null,false);
									control_host.setHost(m[2]);
									var element_host = control_host.getElement();
									ElementSetTextContent(element_host,m[2]);
									DomNode_InsertAfter(node,element_host);

									// 直後テキスト
									node = DocumentCreateText(RegExp.rightContext);
									DomNode_InsertAfter(element_host,node);
									continue;
								}

								break;
							}

							break;
						}
					}
				})();

				// -
				// BbsControlHost を検索
				// -
				BbsControlHostSearch(target,function(control_host){

					control_host.setResponse(response);

					var host = control_host.getHost();
					var myself = (response.getHost() === host);
					var element_host = control_host.getElement();
					var textnode_host = DocumentCreateText("");


					// -
					// 変化があったときに実行されるイベント
					// -
					control_host.onchange = function(count){
						if(count > 1){
							DomNodeSetNodeValue(textnode_host,"(" + count + ")");
						}else{
							DomNodeSetNodeValue(textnode_host,"");
						}

						var style = element_host.style;
						if(count >= 5){
							StyleDeclarationSetProperty(style,"color","#e80000");
							StyleDeclarationRemoveProperty(style,"font-size");
						}else if(count >= 2){
							StyleDeclarationRemoveProperty(style,"color");
							StyleDeclarationRemoveProperty(style,"font-size");
						}else{
							StyleDeclarationSetProperty(style,"color","#888");
							StyleDeclarationSetProperty(style,"font-size","80%");
						}
					};
					control_host.update();
					element_host.appendChild(textnode_host);

					// -
					// ポップアップ化
					// -
					if(type == "host"){
						if(myself) return null;
					}

					// ダイアログを作成
					var response_dialog = new BbsResponseDialog();
					if(parent_dialog)	parent_dialog.attachChild(response_dialog);
					response_dialog.setElementParent(node.parent);
					response_dialog.setElementHitArea(element_host);
					response_dialog.oncreate = function(_window,callback){

						var responses = bbs_dictionary.getResponsesFromHost(host);
						var i = 0;
						var num = responses.length;
						if(myself){
							if(num < 2) return false;
						}else{
							if(num < 1) return false;
						}

						function f(){
							var response_host = responses[i];
							var clone = response_host.getCloneElements();

							var j;
							var clone_num = clone.length;
							if(clone_num){

								var param = new Object();
								param.parent = node.parent;
								for(j=0;j<clone_num;j++){
									var obj = clone[j];
									param[obj.name] = obj.element;
									_window.appendChild(obj.element);
								}
								try{
									var dd = ElementGetElementsByTagName(param["dt"],"div")[0];
									DomNode_InsertBefore(dd,param["dd"]);
									DomNodeRemove(dd);
									param["dd"].style.minHeight = "0px";
								}catch(e){
								}

								// レスポンスダイアログを登録
								attachBbsResponseDialog(response_host,param,response_dialog,"host");
							}

							i += 1;
							if(i < num){
								execute_queue.attachFirst(f,null);
							}else{
								callback({result:true});
							}
						}
						execute_queue.attachFirst(f,null);
					};

					return null;
				});
			}

			// -
			// フォロワー
			// -
			function forFollower(target){
				if(BbsControlFollowerExist(target))	return;

				// -
				// BbsControlFollower を生成
				// -
				var control_follower = new BbsControlFollower(null,true);
				control_follower.setResponse(response);

				var element_follower = control_follower.getElement();
				var textnode_follower = DocumentCreateText("");

				element_follower.appendChild(textnode_follower);

				// -
				// 変化があったときに実行されるイベント
				// -
				control_follower.onchange = function(count){
					if(count){
						textnode_follower.nodeValue = " follower(" + count + ")";
					}else{
						textnode_follower.nodeValue = "";
					}

					var style = element_follower.style;
					if(count >= 3){
						StyleDeclarationSetProperty(style,"color","#e80000");
						StyleDeclarationRemoveProperty(style,"font-size");

					}else{
						StyleDeclarationSetProperty(style,"color","#888");
						StyleDeclarationSetProperty(style,"font-size","small");
					}
					if(count){
						StyleDeclarationSetProperty(style,"margin","0px 4px 0px 0px");
					}else{
						StyleDeclarationRemoveProperty(style,"margin");
					}
				};
				control_follower.update();
				var nodes = ElementGetElementsByTagName(target,"div");
				if(nodes.length){
					DomNode_InsertBefore(nodes[0],element_follower);
				}else{
					target.appendChild(element_follower);
				}

				// -
				// ポップアップ化
				// -
				// ダイアログを作成
				var response_dialog = new BbsResponseDialog();
				if(parent_dialog)	parent_dialog.attachChild(response_dialog);
				response_dialog.setElementParent(node.parent);
				response_dialog.setElementHitArea(element_follower);
				response_dialog.oncreate = function(_window,callback){

					var ary = response.getFollower();
					var i = 0;
					var num = ary.length;
					if(num <= 0) return false;

					function f(){
						var follower = bbs_dictionary.getResponse(ary[i].getNumber());
						var clone = follower.getCloneElements();

						var j;
						var clone_num = clone.length;
						if(clone_num){

							var param = new Object();
							param.parent = node.parent;
							for(j=0;j<clone_num;j++){
								var obj = clone[j];
								param[obj.name] = obj.element;
								_window.appendChild(obj.element);
							}
							try{
								var dd = ElementGetElementsByTagName(param["dt"],"div")[0];
								DomNode_InsertBefore(dd,param["dd"]);
								DomNodeRemove(dd);
								param["dd"].style.minHeight = "0px";
							}catch(e){
							}

							// レスポンスダイアログを登録
							attachBbsResponseDialog(follower,param,response_dialog,"response");
						}

						i += 1;
						if(i < num){
							execute_queue.attachFirst(f,null);
						}else{
							callback({result:true});
						}
					}
					execute_queue.attachFirst(f,null);
				};
			}

			if(node.dt){
				forResponseAnchor(node.dt);
				forId(node.dt);
				forName(node.dt);
				forHost(node.dt);
				forFollower(node.dt);
			}
			if(node.dd){
				forResponseAnchor(node.dd);
				forId(node.dd);
				forName(node.dd);
			}
		}

		// -
		// エレメントを解析
		// -
		var useful = (function(){
			var dt = element;
			var dd;

			try{
				if(dt.tagName != "DIV")	return false;
				if(!dt.id.match(/^[0-9]+$/))	return false;
			}catch(e){
				return false;
			}

			try{
				dd = ElementGetElementsByTagName(dt,"DIV")[0];
				if(dd.className != "comment")	return false;
			}catch(e){
				return false;
			}

			try{
				var div = dt.parentNode;
				if(div.tagName != "DIV")	return false;
				if(div.id != "comments")	return false;
			}catch(e){
				return false;
			}

			// document に未登録
			if(!DomNodeGetAttachedDocument(dt))	return false;

			// -
			// レスアンカー拡張
			// -
			work.extendResponseAnchor(dd);

			// -
			// クリーンアップ
			// -
			(function(){
				function cleanupIdInfo(target){
					var p;
					var n;
					var q;
					var ignore_tag = {"A":1};
					var ignore_class = {"comment":1};
					var queue = new Object();
					q = {p:queue,n:queue,node:target};
					queue.p = q;
					queue.n = q;

					while(queue.n != queue){
						q = queue.n;
						p = q.p;
						n = q.n;
						p.n = n;
						n.p = p;
						var node = q.node;
						switch(node.nodeType){
						case 1:
							if(ignore_tag[node.tagName]){
							}else if(ignore_class[node.className]){
							}else{
								var i;
								var nodes = node.childNodes;
								var num = nodes.length;
								for(i=0;i<num;i++){
									n = queue;
									p = n.p;
									q = {p:p,n:n,node:nodes[i]};
									p.n = q;
									n.p = q;
								}
							}

							break;
						case 3:
							while(node){
								var m = DomNodeGetNodeValue(node).match(new RegExp("\[[0-9]+/[0-9]+回.*?\]","i"));
								if(!m)	break;

								// 元のテキストノード
								DomNodeSetNodeValue(node,RegExp.leftContext);

								// 直後テキスト
								var next_node = DocumentCreateText(RegExp.rightContext);
								DomNode_InsertAfter(node,next_node);
								node = next_node;
							}
							break;
						}
					}
				}

				function cleanup(target){
					BbsControlSearchTrash(target,function(element){
						var node = element.firstChild;
						if(!node)	return null;
						if(node.nodeType != 3)	return null;

						// ID
						var m = node.nodeValue.match(new RegExp("^ID:([a-zA-Z0-9+/.]{8,10})[●!]{0,2}","i"));
						if(m){
							// 直後テキスト
							var node = DocumentCreateText(m[0]);
							DomNode_InsertAfter(element,node);
							DomNodeRemove(element);
							return null;
						}

						// トリップ
						var m = node.nodeValue.match(new RegExp("^(◆(|[ ])[a-zA-Z0-9+/.]{10,12})","i"));
						if(m){
							// 直後テキスト
							var node = DocumentCreateText(m[0]);
							DomNode_InsertAfter(element,node);
							DomNodeRemove(element);
							return null;
						}

						// ホスト名
						var m = node.nodeValue.match(new RegExp("^([-._a-zA-Z0-9]{1,}(\\.[-._a-zA-Z0-9]{1,}){2,})","i"));
						if(m){
							// 直後テキスト
							var node = DocumentCreateText(m[0]);
							DomNode_InsertAfter(element,node);
							DomNodeRemove(element);

							// テキストノードを統合
							node.parentNode.normalize();
							return null;
						}
						var m = node.nodeValue.match(new RegExp("^([0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3})","i"));
						if(m){
							// 直後テキスト
							var node = DocumentCreateText(m[0]);
							DomNode_InsertAfter(element,node);
							DomNodeRemove(element);

							// テキストノードを統合
							node.parentNode.normalize();
							return null;
						}

						return null;
					});
				}

				if(dt){
					cleanupIdInfo(dt);
					cleanup(dt);
				}
				if(dd){
					cleanup(dd);
				}
			})();

			// ナンバーを取得
			var dt_text = ElementGetTextContent(dt);
			if(!(dt_text.match(new RegExp("([0-9]+)","i"))))	return false;

			// ナンバーからレスポンスオブジェクトを取得
			var response = bbs_dictionary.getResponse(parseInt(RegExp.$1));

			// レスポンス解析
			if(!response.getAnalyzed()){

				(function(){
					// 本文を除外
					var dt_clone = dt.cloneNode(true);
					try{
						var div = ElementGetElementsByTagName(dt_clone,"div")[0];
						DomNodeRemove(div);
					}catch(e){
					}
					dt_text = ElementGetTextContent(dt_clone);
				})();

				// IDの取得
				if(dt_text.match(new RegExp("ID:([a-zA-Z0-9+/.]{8,10})[●!]{0,2}","i"))){
					response.setId(RegExp.$1);
				}

				// 名前の取得
				if(dt_text.match(new RegExp("(◆(|[ ])[a-zA-Z0-9+/.]{10,12})","i"))){
					response.setName(RegExp.$1);
				}

				// ホスト名の取得
				(function(){
					var p;
					var n;
					var q;
					var ignore_dictionary = {"B":1,"SCRIPT":1};
					var queue = new Object();
					q = {p:queue,n:queue,node:dt};
					queue.p = q;
					queue.n = q;

					while(queue.n != queue){
						q = queue.n;
						p = q.p;
						n = q.n;
						p.n = n;
						n.p = p;
						var node = q.node;
						switch(node.nodeType){
						case 1:
							if(!(ignore_dictionary[node.tagName])){
								var i;
								var nodes = node.childNodes;
								var num = nodes.length;
								for(i=0;i<num;i++){
									n = queue;
									p = n.p;
									q = {p:p,n:n,node:nodes[i]};
									p.n = q;
									n.p = q;
								}
							}
							break;
						case 3:
							var m = DomNodeGetNodeValue(node).match(new RegExp("(^|HOST:)([-._a-zA-Z0-9]{1,}(\\.[-._a-zA-Z0-9]{1,}){2,})","i"));
							if(m){
								response.setHost(m[2]);
								return;
							}
							var m = DomNodeGetNodeValue(node).match(new RegExp("(\\[ )([-._a-zA-Z0-9]{1,}(\\.[-._a-zA-Z0-9]{1,}){2,})\\n \\]","i"));
							if(m){
								response.setHost(m[2]);
								return;
							}
							var m = DomNodeGetNodeValue(node).match(new RegExp("(発信元:)([0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3})","i"));
							if(m){
								response.setHost(m[2]);
								return;
							}
							break;
						}
					}
				})();

				// フォロー解析
				var dictionary = new Object();
				(function(){
					var nodes = ElementGetElementsByTagName(dd,"a");
					var i;
					var num = nodes.length;
					for(i=0;i<num;i++){
						var numbers = work.createResponseAnchorNumbers(ElementGetTextContent(nodes[i]));
						numbers.getNumbers(function(n){
							if(!dictionary[n]){
								var following = bbs_dictionary.getResponse(n);
								following.addFollower(response);
								dictionary[n] = true;
							}
						});
					}
				})();

				// オリジナルエレメントをセット
				if(dt)	response.addOriginalElements("dt",dt);
				if(dd)	response.addOriginalElements("dd",dd);

				// 消去時に実行されるイベント
				response.onerase = function(){
					var original = response.getOriginalElements();

					// オリジナルエレメントを外す
					var i;
					var num = original.length;
					for(i=0;i<num;i++){
						var revise_scroll = new DocumentReviseScroll();
						var node = original[i].element;
						revise_scroll.executeRemoveElementBefore(node);
						DomNodeRemove(node);
						revise_scroll.executeRemoveElementAfter(node);
					}
				};

				response.setAnalyzed();
			}

			// レスポンスダイアログを登録(ルート)
			attachBbsResponseDialog(
				response,
				{
					dt:dt,
					dd:dd,
					parent:dt.parentNode
				},
				null,
				null
			);

			return true;
		})();

		response({useful:useful});
		return true;
	}

			]);

			// -
			// 掲示板設定「2ちゃんねる掲示板(v.06)」
			// -
			attachItem( "ExpandBbs_ScriptInitialize_2ch_v6" , [
	
	function(info,response){
		var work = info.work;

		// -
		// 基本URL抽出
		// -
		var url = document.URL;
		var bbs_list = [
			{url:"((http|https)://[^.]+\\.(2ch|5ch)\\.net/test/read\\.cgi/[^/]+/[0-9]+)",replace:"$1/",secure:true,name:"2ch"},
			{url:"((http|https)://[^.]+\\.(2ch|5ch)\\.net/[^/]+/kako/[0-9]+)",replace:"$1/",secure:true,name:"2ch"},
			{url:"((http|https)://[^.]+\\.bbspink\\.com/test/read\\.cgi/[^/]+/[0-9]+)",replace:"$1/",secure:true,name:"pink"}
		];

		var i;
		var num = bbs_list.length;
		for(i=0;i<num;i++){
			var bbs = bbs_list[i];
			var re = new RegExp(bbs.url,"i");
			var m = url.match(re);
			if(m){
				work.base_url = m[1].replace(re,bbs.replace);
				if(bbs.secure){
					m = work.base_url.match(new RegExp("[^:]+(.*)"));
					if(m) work.base_url = "https" + m[1];
				}
				work.bbs_name = bbs.name;
				break;
			}
		}

		return false;
	},
	function (info,response){
		var work = info.work;
		if(!(work.bbs_name)){
			return false;
		}

		var first_id = 1;
		var last_id = 1;
		var dictionary_id = new Array();
		var load_shadow_list;
		var load_shadow_pos = 0;
		var load_more_list;
		var load_more_pos = 0;
		var element_parent = null;
		var element_parents = [];
		var read_more_button = null;
		var element_form = null;
		var base_url = work.base_url;
		var resource_url_more;

		// -
		// read.cgi バージョンチェック
		// -
		if(work.bbs_name == "2ch"){
			work.bbs_name = (function(){
				var version = (function(){
					var re = new RegExp("read[.]cgi[ \t]+ver[ \t]*([0-9]+)[.][0-9]+[.][0-9]+","i");

					// ver 06-07
					var nodes = ElementGetElementsByClassName(document.body,"footer");
					var node = nodes[nodes.length - 1];
					if(node){
						var m = ElementGetTextContent(node).match(re);
						if(m) return parseInt(m[1]);
					}

					// ver 05
					return 5;
				})();
				if(version == 6){
					return "2ch_v6";
				}else if(version >= 7){
					return "2ch_v6";
				}
				return "2ch_v5";
			})();
		}

		// -
		// 文字列からレスポンス番号を取得
		// -
		work.createResponseAnchorNumbers = function (str){
			var numbers = new ResponseAnchorNumbers();

			var re_search = new RegExp("^(>>|<<|>>|<<|>|>|》|≫|&gt;&gt;)([0-90-9]+)","i");
			var re_range = new RegExp("^([0-90-9]+)[-]([0-90-9]+)","i");
			var re_number = new RegExp("^([0-90-9]+)","i");

			var m = str.match(re_search);
			if(m){
				var p = m[1].length;
				while(true){
					// 番号-番号
					m = str.substr(p).match(re_range);
					if(m){
						var id0 = parseInt(StringConvertFromNumericFullToNumericHalf(m[1]));
						var id1 = parseInt(StringConvertFromNumericFullToNumericHalf(m[2]));
						if(id0 < 1) id0 = 1;
						if(id1 < 1) id1 = 1;
						if(id0 > 10000) id0 = 10000;
						if(id1 > 10000) id1 = 10000;
						p += m[0].length;
						numbers.addNumbers(id0,id1);
					}else{
						// 番号
						m = str.substr(p).match(re_number);
						if(m){
							p += m[0].length;
							var id = parseInt(StringConvertFromNumericFullToNumericHalf(m[1]));
							if(id < 1) id = 1;
							if(id > 0x7fffffff) id = 0x7fffffff;
							numbers.addNumber(id);
						}
					}

					if(m){
						// カンマ
						if(RegExp.rightContext.search(",") == 0){
							p += 1;
							continue;
						}
					}
					break;
				}
			}
			return numbers;
		};

		// -
		// レスアンカー拡張
		// -
		work.extendResponseAnchor = function (target){
			if(BbsControlResponseAnchorExist(target))	return;

			var re_simple = new RegExp("^(>>|<<|>)[-,0-90-9]+$","i");
			var re_detail = new RegExp("(>>|<<|>>|<<|>|>|》|≫|&gt;&gt;)(([0-90-9]+[-][0-90-9]+|[0-90-9]+),)*([0-90-9]+[-][0-90-9]+|[0-90-9]+)","i");
			var re_range = new RegExp("([0-90-9]+)[-]([0-90-9]+)","i");
			var re_number = new RegExp("([0-90-9]+)","i");

			var i;
			var nodes = ElementGetElementsByTagName(target,"a");
			var num = nodes.length;
			for(i=num-1;i>=0;i--){
				var node = nodes[i];
				var m = ElementGetTextContent(node).match(re_simple);
				if(m){
					var text_node = DocumentCreateText(m[0]);
					DomNode_InsertBefore(node,text_node);
					DomNodeRemove(node);
				}
			}

			// テキストノードを統合
			target.normalize();

			var p;
			var n;
			var q;
			var ignore_dictionary = {"A":1,"SCRIPT":1};
			var queue = new Object();
			q = {p:queue,n:queue,node:target};
			queue.p = q;
			queue.n = q;

			while(queue.n != queue){
				q = queue.n;
				p = q.p;
				n = q.n;
				p.n = n;
				n.p = p;
				var node = q.node;
				switch(node.nodeType){
				case 1:
					var i;
					var nodes = node.childNodes;
					var num = nodes.length;
					for(i=0;i<num;i++){
						n = queue;
						p = n.p;
						q = {p:p,n:n,node:nodes[i]};
						p.n = q;
						n.p = q;
					}
					break;
				case 3:
					while(node){
						var m = DomNodeGetNodeValue(node).match(re_detail);
						if(!m)	break;

						// 元のテキストノード
						DomNodeSetNodeValue(node,RegExp.leftContext);

						// 偽装アンカーを生成
						var element = DocumentCreateElement("span");
						element.style.cssText = "color:#00F; text-decoration: underline; cursor: pointer;";
						ElementSetTextContent(element,m[0]);
						DomNode_InsertAfter(node,element);

						// 直後テキスト
						node = DocumentCreateText(RegExp.rightContext);
						DomNode_InsertAfter(element,node);

						var query = "";
						m = ElementGetTextContent(element).match(re_range);
						if(m){
							var min = parseInt(StringConvertFromNumericFullToNumericHalf(m[1]));
							var max = parseInt(StringConvertFromNumericFullToNumericHalf(m[2]));
							if(min < 1) min = 1;
							if(max < 1) max = 1;
							if(min > 10000) min = 10000;
							if(max > 10000) max = 10000;
							if(max < min){
								var tmp = min;
								min = max;
								max = tmp;
							}
							query = min + "-" + max;
						}else{
							// 番号
							m = ElementGetTextContent(element).match(re_number);
							if(m){
								query = parseInt(StringConvertFromNumericFullToNumericHalf(m[0]));
								if(query < 1) query = 1;
								if(query > 0x7fffffff) query = 0x7fffffff;
							}

						}
						element.href = work.base_url + query;
					}
				}
			}
		};

		// -
		// HTML 文書の整合性テスト
		// -
		function checkValidityFromHTML(str){
			var re;
			switch(work.bbs_name){
			case "2ch_v5":
				var m = str.match(new RegExp("<dt>.*?<dd>[ ].*?[ ]<br><br>","i"));
				if(m){
					m = m[0].match(new RegExp("[\r\n]"));
					if(!m) return true;
				}
				break;
			case "2ch_v6":
				re = new RegExp('<div[^>]+class="(| )thread( |)"[^>]*>.*?<div[^>]+class="(| )post( |)"[^>]*>.*?<div[^>]+class="(| )message( |)"[^>]*>',"i");
				return Boolean(str.match(re));
			case "pink":
				re = new RegExp('<dl[^>]+class="(| )post( |)"[^>]*>.*?<dd[^>]+class="(| )thread_in( |)"[^>]*>',"i");
				return Boolean(str.match(re));
			}
			return false;
		}

		// -
		// HTML 文書をシャドウ読み込み
		// -
		function loadShadowFromHTML(str){
			var re_number = new RegExp('id="([0-9]+)',"i");
			var re_id = new RegExp("ID:([-a-zA-Z0-9+/.●!=]{8,})","i");
			var re_name = new RegExp("(◆[a-zA-Z0-9+/.]{10,12})","i");
			var search_post_start;
			var search_post_end;
			var class_name_message;
			switch(work.bbs_name){
			case "2ch_v5":
				re_number = new RegExp('([0-9]+)',"i");
				search_post_start = '<dt>';
				search_post_end = "<br><br>";
				break;
			case "2ch_v6":
				search_post_start = '<div class="post"';
				search_post_end = "</div></div>";
				class_name_message = "message";
				break;
			case "pink":
				search_post_start = '<dl class="post"';
				search_post_end = "</dd></dl>";
				class_name_message = "thread_in";
				break;
			}

			var p = 0;
			var n = str.length;
			function f(){
				if(p >= n) return;
				p = str.indexOf(search_post_start,p);
				if(p < 0) return;
				var e = str.indexOf(search_post_end,p);
				if(e >= 0) e += search_post_end.length;
				var s = str.substring(p,e);
				var m = s.match(re_number);
				if(m){
					var id = parseInt(m[1]);
					if((first_id <= id) && (id <= last_id)){
					}else if(dictionary_id[id]){
					}else{
						var clone_nodes = StringHtmlCreateDomNodesSafe(s);
						var info_post;
						var info_number;
						var info_name;
						var info_date;
						var info_uid;
						var info_message;

						try{
							switch(work.bbs_name){
							case "2ch_v5":
								info_number = info_name = info_date = info_uid = clone_nodes[0];
								if(info_number.tagName != "DT") return;
								info_message = clone_nodes[1];
								if(info_message.tagName != "DD") return;
								break;
							case "2ch_v6":
							case "pink":
								info_post = clone_nodes[0];
								if(info_post.className != "post") return;
								info_number = ElementGetElementsByClassName(info_post,"number")[0];
								info_name = ElementGetElementsByClassName(info_post,"name")[0];
								info_date = ElementGetElementsByClassName(info_post,"date")[0];
								info_uid = ElementGetElementsByClassName(info_post,"uid")[0] || info_date;
								info_message = ElementGetElementsByClassName(info_post,class_name_message)[0];	
								break;
							}
						}catch(e){
							return;
						}

						// ナンバーからレスポンスオブジェクトを取得
						var response = bbs_dictionary.getResponse(id);
						if(!(response.getAnalyzed())){
							// レスアンカー拡張
							work.extendResponseAnchor(info_message);

							// IDの取得
							if(ElementGetTextContent(info_uid).match(re_id)){
								response.setId(RegExp.$1);
							}

							// 名前の取得
							if(ElementGetTextContent(info_name).match(re_name)){
								response.setName(RegExp.$1);
							}

							// ホスト名の取得
							(function(){
								var p;
								var n;
								var q;
								var ignore_dictionary = {"B":1,"SCRIPT":1};
								var queue = new Object();
								q = {p:queue,n:queue,node:info_date};
								queue.p = q;
								queue.n = q;

								while(queue.n != queue){
									q = queue.n;
									p = q.p;
									n = q.n;
									p.n = n;
									n.p = p;
									var node = q.node;
									switch(node.nodeType){
									case 1:
										if(!(ignore_dictionary[node.tagName])){
											var i;
											var nodes = node.childNodes;
											var num = nodes.length;
											for(i=0;i<num;i++){
												n = queue;
												p = n.p;
												q = {p:p,n:n,node:nodes[i]};
												p.n = q;
												n.p = q;
											}
										}
										break;
									case 3:
										var m = DomNodeGetNodeValue(node).match(new RegExp("(^|HOST:)([-._a-zA-Z0-9]{1,}(\\.[-._a-zA-Z0-9]{1,}){2,})","i"));
										if(m){
											response.setHost(m[2]);
											return;
										}
										var m = DomNodeGetNodeValue(node).match(new RegExp("(\\[ )([-._a-zA-Z0-9]{1,}(\\.[-._a-zA-Z0-9]{1,}){2,})(|\\n) \\]","i"));
										if(m){
											response.setHost(m[2]);
											return;
										}
										var m = DomNodeGetNodeValue(node).match(new RegExp("(発信元:)([0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3})","i"));
										if(m){
											response.setHost(m[2]);
											return;
										}
										break;
									}
								}
							})();

							// フォロー解析
							var dictionary = new Object();
							(function(){
								var nodes = ElementGetElementsByTagName(info_message,"span");
								var i;
								var num = nodes.length;
								for(i=0;i<num;i++){
									var numbers = work.createResponseAnchorNumbers(ElementGetTextContent(nodes[i]));
									numbers.getNumbers(function(n){
										if(!dictionary[n]){
											var following = bbs_dictionary.getResponse(n);
											following.addFollower(response);
											dictionary[n] = true;
										}
									});
								}
							})();

							// オリジナルエレメントをセット
							var num = clone_nodes.length;
							for(i=0;i<num;i++){
								response.addOriginalElements(String(i),clone_nodes[i]);
							}

							// 消去時に実行されるイベント
							response.onerase = function(){};

							response.setAnalyzed();
						}
					}
				}

				if(p < e){
					p = e;
					execute_queue.attachFirst(f,null);
				}
			}
			execute_queue.attachFirst(f,null);
		}

		// -
		// HTML 文書を継ぎ足し読み込み
		// -
		function loadMoreFromHTML(str,callback){
			// 最後尾取得
			getLastId(function(id){
				last_id = id;
				dictionary_id[last_id] = true;
			});

			var re_number = new RegExp("([0-9]+)","i");
			var search_post_start;
			var search_post_end;
			switch(work.bbs_name){
			case "2ch_v5":
				search_post_start = '<dt>';
				search_post_end = "<br><br>";
				break;
			case "2ch_v6":
				search_post_start = '<div class="post"';
				search_post_end = "</div></div>";
				break;
			case "pink":
				search_post_start = '<dl class="post"';
				search_post_end = "</dd></dl>";
				break;
			}

			var p = 0;
			var n = str.length;
			var add_count = 0;
			function f(){
				try{
					if(p >= n) throw 0;
					p = str.indexOf(search_post_start,p);
					if(p < 0) throw 0;
					var e = str.indexOf(search_post_end,p);
					if(e >= 0) e += search_post_end.length;
					var s = str.substring(p,e);
					var m = s.match(re_number);
					if(m){
						var id = parseInt(m[1]);
						if(last_id < id){
							var response = bbs_dictionary.getResponse(id);
							response.clearAnalyzed();
							response.clearOriginalElements();
							response.clearFollowing();

							// 暫定 (2ch_v7)
							if(str.substr(e,4) == "<br>"){
								s += "<br>";
							}

							var nodes = StringHtmlCreateDomNodesSafe(s);
							var j;
							var node_num = nodes.length;
							for(j=0;j<node_num;j++){
								element_parent.appendChild(nodes[j]);
							}
							last_id = id;
							add_count += 1;
							resource_url_more = base_url + (last_id) + "-";
						}
					}

					if(p < e){
						p = e;
						execute_queue.attachFirst(f,null);
						return;
					}
				}catch(e){
					if(e){
						callback({result:false});
						return;
					}
				}
				callback({result:true,add_count:add_count});
			}
			execute_queue.attachFirst(f,null);
		}

		// -
		// 継ぎ足し読み込み
		// -
		function readMore(callback){
			var num = load_more_list.length;
			var pos = load_more_pos;
			var i = 0;

			var failure = function(){
				i += 1;
				if(num <= i){
					callback({result:false});
					return;
				}
				pos += 1;
				if(num <= pos) pos = 0;
				load_more_pos = pos;
				load();
			};

			var load = function (){
				var param = load_more_list[pos];

				// ローダーオブジェクトを作成
				var loader = new Loader();

				// 成功
				loader.onload = function(str){
					if(!param.validity(str)){
						failure();
						return;
					}
					param.parse(str,function(response){
						if(response.result){
							callback(response);
						}else{
							failure();
						}
					});
				};

				// 失敗
				loader.onerror = function(){
					failure();
				};

				// テキストの読み込み
				loader.setMethod("GET");
				loader.setURL(param.url);
				switch(work.bbs_name){
				case "2ch_v5":
				case "2ch_v6":
				case "pink":
					loader.overrideMimeType("text/plain; charset=Shift_JIS");
					break;
				}
				loader.loadText();
			};
			load();
		}

		// -
		// レスポンス親要素
		// -
		if(!element_parent){
			var i;
			var nodes = ElementGetElementsByClassName(document.body,"thread");
			var num = nodes.length;
			for(i=0;i<num;i++){
				element_parents.push(nodes[i]);
				element_parent = nodes[i];
			}
		}
		if(!element_parent){
			var i;
			var nodes = ElementGetElementsByTagName(document.body,"DL");
			var num = nodes.length;
			for(i=0;i<num;i++){
				element_parents.push(nodes[i]);
				element_parent = nodes[i];
			}
		}
		if(!element_parent) return false;

		// -
		// 範囲取得
		// -
		function getLastId(callback){
			var get_elements;
			switch(work.bbs_name){
			case "2ch_v5":
				get_elements = function(target){
					return ElementGetElementsByTagName(target,"dt");
				};
				break;
			case "2ch_v6":
			case "pink":
				get_elements = function(target){
					return ElementGetElementsByClassName(target,"post");
				};
				break;
			}

			var num = element_parents.length;
			var i;
			for(i=num-1;i>=0;i--){
				var nodes = get_elements(element_parents[i]);
				var node_num = nodes.length;
				if(node_num){
					var re_id = new RegExp("^[ \t\r\n]*([0-9]+)","i");
					if(ElementGetTextContent(nodes[node_num-1]).match(re_id)){
						callback(parseInt(RegExp.$1));
						return;
					}
				}
			}
		}
		(function(){
			var get_elements;
			switch(work.bbs_name){
			case "2ch_v5":
				get_elements = function(target){
					return ElementGetElementsByTagName(target,"dt");
				};
				break;
			case "2ch_v6":
			case "pink":
				get_elements = function(target){
					return ElementGetElementsByClassName(target,"post");
				};
				break;
			}

			var count = 0;
			var re_id = new RegExp("^[ \t\r\n]*([0-9]+)","i");
			var num = element_parents.length;
			var i,j;
			for(i=0;i<num;i++){
				var nodes = get_elements(element_parents[i]);
				var node_num = nodes.length;
				for(j=0;j<node_num;j++){
					var m = ElementGetTextContent(nodes[j]).match(re_id);
					if(!m) break;
					if(count == 0){
						first_id = parseInt(m[1]);
						dictionary_id[0] = true;
						if(first_id > 1) return;
					}else if(count == 1){
						first_id = parseInt(m[1]);
						dictionary_id[first_id] = true;
						if(first_id <= 2) first_id = 1;
						return;
					}
					count += 1;
				}
			}
		})();
		getLastId(function(id){
			last_id = id;
			dictionary_id[last_id] = true;
		});

		// -
		// 読み込みリスト
		// -
		load_shadow_list = [
			{
				url:base_url,
				parse:loadShadowFromHTML,
				validity:checkValidityFromHTML
			}
		];
		load_more_list = [
			{
				url:base_url + last_id + "-",
				parse:loadMoreFromHTML,
				validity:checkValidityFromHTML
			}
		];

		// -
		// 読み込み方式
		// -
		load_shadow_pos = 0;
		load_more_pos = 0;

		// -
		// BbsControlReadMoreButton 作成
		// -
		read_more_button = new BbsControlReadMoreButton();
		read_more_button.setWaitTime(2 * 1000);
		read_more_button.onclick = readMore;
		DomNode_InsertAfter(element_parent,read_more_button.getElement());

		// -
		// 書き込みをポップアップ化
		// -
		(function(){
			var element_form;
			var input_submit;
			var element_textarea;
			var event_handler_release;
			var task;

			(function(){
				// フォーム
				var nodes = ElementGetElementsByTagName(document.body,"form");
				var i;
				switch(work.bbs_name){
				case "2ch_v5":
				case "2ch_v6":
				case "pink":
					for(i=0;i<nodes.length;i++){
						if(nodes[i].action.indexOf("/test/bbs.cgi") >= 0){
							element_form = nodes[i];
							break;
						}
					}
					break;
				}

				// サブミットボタン
				if(element_form){
					var nodes = ElementGetElementsByTagName(element_form,"input");
					for(i=0;i<nodes.length;i++){
						if(nodes[i].type.toLowerCase() == "submit"){
							input_submit = nodes[i];
							break;
						}
					}
					var nodes = ElementGetElementsByTagName(element_form,"textarea");
					if(nodes.length){
						element_textarea = nodes[0];
						work.form_textarea = element_textarea;
					}

					// BbsControlDockingForm 作成
					var docking_form = new BbsControlDockingForm(element_form,false);
					docking_form.setStyle("background:#e8e8e8; background-image:linear-gradient(to bottom, #f8f8f8, #e8e8e8); padding:10px 20px; border:1px solid #888; border-radius:4px; box-shadow:2px 2px 5px #aaa; margin:0px;");
					work.docking_form = docking_form;
				}
			})();

			// 開放
			function release(){
				if(event_handler_release){
					event_handler_release.release();
					event_handler_release = null;
				}

				removeEvent();

				if(task){
					task.release();
				}
			}

			// クリア
			function clear(){
				element_textarea.value = "";
			}

			// 有効セット
			function setEnable(type){
				input_submit.disabled = !(type);
			}

			// イベント追加
			function addEvent(){
				if(window.addEventListener){
					input_submit.addEventListener("click",EventClickButton);
					element_form.addEventListener("submit",EventSubmitForm);
				}else if(window.attachEvent){
					input_submit.attachEvent("onclick",EventClickButton);
					element_form.attachEvent("onsubmit",EventSubmitForm);
				}
			}

			// イベント除外
			function removeEvent(){
				if(window.removeEventListener){
					input_submit.removeEventListener("click",EventClickButton);
					element_form.removeEventListener("submit",EventSubmitForm);
				}else if(window.detachEvent){
					input_submit.detachEvent("onclick",EventClickButton);
					element_form.detachEvent("onsubmit",EventSubmitForm);
				}
			}

			// サブミット直前に実行されるイベント
			function EventSubmitForm(e){
				setEnable(false);
			}

			// クリック時に実行されるイベント
			function EventClickButton(e){
				var w;
				var h;
				switch(work.bbs_name){
				case "2ch_v5":
				case "2ch_v6":
				case "pink":
					w = 800;
					h = 600;
					var cookie = document.cookie;
					if(cookie){
						if(cookie.indexOf("PREN=") != -1){
							w = 600;
							h = 450;
						}
					}
					break;
				}

				var window_name = "_pageexpand_" + Math.floor(Math.random() * 0x7FFFFFFF);
				var popup_iframe = new BbsControlPopupIframe(window_name);
				popup_iframe.setWindowSize(w,h);
				popup_iframe.onclose = function(){
					setEnable(true);
				};

				var element_iframe = popup_iframe.getIFrameElement();
				element_form.target = window_name;

				(function(){
					var closed = false;
					var timer = null;

					// タスク生成
					task = task_container.createTask();
					task.setDestructorFunc(function(){
						task = null;
					});
					task.setExecuteFunc(function(){
						try{
							var href = "";
							var window_obj = element_iframe.contentWindow;
							if(window_obj.document){
								href = window_obj.document.URL;
							}
							if(href.match(/^(http|https):/)){
								switch(work.bbs_name){
								case "2ch_v5":
								case "2ch_v6":
								case "pink":
									if(href.indexOf("/test/bbs.cgi") == -1){
										closed = true;
									}else if(!timer){
										var body = window_obj.document.body;
										if(body){
											if(ElementGetTextContent(body).indexOf("書きこみが終わりました") != -1){
												timer = (new Date()).getTime();
											}
										}
									}
									break;
								}
							}
							if(timer){
								if((new Date()).getTime() - timer > 1000 * 2){
									closed = true;
								}
							}
						}catch(e){
							closed = true;
						}

						if(closed){
							if(task){
								task.release();
							}
							popup_iframe.close();
							setEnable(true);
							if(timer){
								readMore(function(){});
								clear();
							}
						}
					});
				})();
			}

			(function(){
				if(!element_form) return;
				if(!input_submit) return;
				if(!element_textarea) return;
				if(window.localStorage.getItem("autoPost") == "true") return;

				if(work.docking_form){
					work.docking_form.onreset = clear;
				}

				if((function(){
					try{
						var re = new RegExp("^[^:]+");
						var m0 = element_form.action.match(re);
						var m1 = document.URL.match(re);
						if(!m0) return true;
						if(!m1) return true;
						if(m0[0] === m1[0]) return false;
					}catch(e){}
					return true;
				})()) return;

				if(load_more_pos == 0){
					addEvent();
	
					event_handler_release = page_expand_event_dispatcher.createEventHandler("release");
					event_handler_release.setFunction(function(){
						release();
					});
				}
			})();
		})();

		// -
		// シャドウロード
		// -
		(function(){
			var num = load_shadow_list.length;
			var pos = load_shadow_pos;
			var i = 0;

			var failure = function(){
				i += 1;
				if(num <= i) return;
				pos += 1;
				if(num <= pos) pos = 0;
				load_shadow_pos = pos;
				load();
			};

			var load = function (){
				var param = load_shadow_list[pos];

				// ローダーオブジェクトを作成
				var loader = new Loader();

				// 成功
				loader.onload = function(str){
					if(!param.validity(str)){
						failure();
						return;
					}
					param.parse(str);
				};

				// 失敗
				loader.onerror = function(){
					failure();
				};

				// テキストの読み込み
				loader.setMethod("GET");
				loader.setURL(param.url);
				switch(work.bbs_name){
				case "2ch_v5":
				case "2ch_v6":
				case "pink":
					loader.overrideMimeType("text/plain; charset=Shift_JIS");
					break;
				}
				loader.loadText();
			};
			load();
		})();

		response({result:true});
		return true;
	},
	function (info,response){
		response({result:false});
		return true;
	}

			]);

			// -
			// 掲示板設定「2ちゃんねる掲示板(v.06)」
			// -
			attachItem( "ExpandBbs_ScriptCallback_2ch_v6" , [
	
	function(info,response){
		var element = info.element;
		var work = info.work;

		// -
		// レスポンスダイアログを登録
		// -
		function attachBbsResponseDialog(response,node,parent_dialog,type){

			// -
			// レスアンカー
			// -
			function forResponseAnchor(target){
				if(BbsControlResponseAnchorExist(target))	return;

				// -
				// BbsControlResponseAnchor を生成
				// -
				(function(){
					var i;
					var nodes = ElementGetElementsByTagName(target,"span");
					var num = nodes.length;
					for(i=0;i<num;i++){
						var node = nodes[i];
						var numbers = work.createResponseAnchorNumbers(ElementGetTextContent(node));
						if(numbers.getCount()){
							var control_res_anchor = new BbsControlResponseAnchor(node,false);
							control_res_anchor.setResponseAnchorNumbers(numbers);
						}
					}
				})();

				// -
				// BbsControlResponseAnchor を検索
				// -
				BbsControlResponseAnchorSearch(target,function(control_res_anchor){

					var element_res_anchor = control_res_anchor.getElement();
					var numbers = control_res_anchor.getResponseAnchorNumbers();

					// ダイアログを作成
					var response_dialog = new BbsResponseDialog();
					if(parent_dialog)	parent_dialog.attachChild(response_dialog);
					response_dialog.setElementParent(node.parent);
					response_dialog.setElementHitArea(element_res_anchor);
					response_dialog.oncreate = function(_window,callback){

						var created = false;
						var i = 0;
						var number_list = numbers.getNumberList();
						var num = number_list.length;
						if(!num) return false;

						function f(){
							var dl = DocumentCreateElement("div");
							dl.style.margin = "0px";
							_window.appendChild(dl);

							var following = bbs_dictionary.getResponse(number_list[i]);
							var clone = following.getCloneElements();

							var j;
							var clone_num = clone.length;
							if(clone_num){
								var clone_nodes = [];
								for(j=0;j<clone_num;j++){
									var obj = clone[j];
									clone_nodes.push(obj.element);
									dl.appendChild(obj.element);
								}
								var param = new Object();
								param.clone_nodes = clone_nodes;
								param.parent = node.parent;

								// レスポンスダイアログを登録
								attachBbsResponseDialog(following,param,response_dialog,"response");

								created = true;
							}

							i += 1;
							if(i < num){
								execute_queue.attachFirst(f,null);
							}else{
								callback({result:created});
							}
						}
						execute_queue.attachFirst(f,null);
					};

					return null;
				});
			}

			// -
			// ID
			// -
			function forId(target){
				if(BbsControlIdExist(target))	return;

				// -
				// BbsControlId を生成
				// -
				(function(){
					var p;
					var n;
					var q;
					var ignore_dictionary = {"A":1,"SCRIPT":1};
					var queue = new Object();
					q = {p:queue,n:queue,node:target};
					queue.p = q;
					queue.n = q;

					while(queue.n != queue){
						q = queue.n;
						p = q.p;
						n = q.n;
						p.n = n;
						n.p = p;
						var node = q.node;
						switch(node.nodeType){
						case 1:
							if(!(ignore_dictionary[node.tagName])){
								var i;
								var nodes = node.childNodes;
								var num = nodes.length;
								for(i=0;i<num;i++){
									n = queue;
									p = n.p;
									q = {p:p,n:n,node:nodes[i]};
									p.n = q;
									n.p = q;
								}
							}

							break;
						case 3:
							while(node){

								var m = DomNodeGetNodeValue(node).match(new RegExp("ID:([-a-zA-Z0-9+/.●!=]{8,})","i"));
								if(!m)	break;

								// 元のテキストノード
								DomNodeSetNodeValue(node,RegExp.leftContext);

								// BbsControlId を生成
								var control_id = new BbsControlId(null,false);
								control_id.setId(m[1]);
								var element_id = control_id.getElement();
								ElementSetTextContent(element_id,m[0]);
								DomNode_InsertAfter(node,element_id);

								// 直後テキスト
								node = DocumentCreateText(RegExp.rightContext);
								DomNode_InsertAfter(element_id,node);
							}
							break;
						}
					}
				})();

				// -
				// BbsControlId を検索
				// -
				BbsControlIdSearch(target,function(control_id){

					control_id.setResponse(response);

					var id = control_id.getId();
					var myself = (response.getId() === id);
					var element_id = control_id.getElement();
					var textnode_id = DocumentCreateText("");

					element_id.appendChild(textnode_id);

					// -
					// 変化があったときに実行されるイベント
					// -
					control_id.onchange = function(count){
						if(count > 1){
							DomNodeSetNodeValue(textnode_id,"(" + count + ")");
						}else{
							DomNodeSetNodeValue(textnode_id,"");
						}

						var style = element_id.style;
						if(count >= 5){
							StyleDeclarationSetProperty(style,"color","#e80000");
							StyleDeclarationRemoveProperty(style,"font-size");
						}else if(count >= 2){
							StyleDeclarationRemoveProperty(style,"color");
							StyleDeclarationRemoveProperty(style,"font-size");
						}else{
							StyleDeclarationSetProperty(style,"color","#888");
							StyleDeclarationSetProperty(style,"font-size","small");
						}
					};
					control_id.update();

					// -
					// ポップアップ化
					// -
					if(type == "id"){
						if(myself) return null;
					}

					// ダイアログを作成
					var response_dialog = new BbsResponseDialog();
					if(parent_dialog)	parent_dialog.attachChild(response_dialog);
					response_dialog.setElementParent(node.parent);
					response_dialog.setElementHitArea(element_id);
					response_dialog.oncreate = function(_window,callback){

						var responses = bbs_dictionary.getResponsesFromId(id);
						var i = 0;
						var num = responses.length;
						if(myself){
							if(num < 2) return false;
						}else{
							if(num < 1) return false;
						}

						function f(){
							var dl = DocumentCreateElement("div");
							dl.style.margin = "0px";
							_window.appendChild(dl);

							var response_id = responses[i];
							var clone = response_id.getCloneElements();

							var j;
							var clone_num = clone.length;
							if(clone_num){
								var clone_nodes = [];
								for(j=0;j<clone_num;j++){
									var obj = clone[j];
									clone_nodes.push(obj.element);
									dl.appendChild(obj.element);
								}
								var param = new Object();
								param.clone_nodes = clone_nodes;
								param.parent = node.parent;

								// レスポンスダイアログを登録
								attachBbsResponseDialog(response_id,param,response_dialog,"id");
							}

							i += 1;
							if(i < num){
								execute_queue.attachFirst(f,null);
							}else{
								callback({result:true});
							}
						}
						execute_queue.attachFirst(f,null);
					};

					return null;
				});
			}

			// -
			// トリップ
			// -
			function forName(target){
				if(BbsControlNameExist(target))	return;

				// -
				// BbsControlName を生成
				// -
				(function(){
					var p;
					var n;
					var q;
					var ignore_dictionary = {"SCRIPT":1};
					var queue = new Object();
					q = {p:queue,n:queue,node:target};
					queue.p = q;
					queue.n = q;

					while(queue.n != queue){
						q = queue.n;
						p = q.p;
						n = q.n;
						p.n = n;
						n.p = p;
						var node = q.node;
						switch(node.nodeType){
						case 1:
							if(!(ignore_dictionary[node.tagName])){
								var i;
								var nodes = node.childNodes;
								var num = nodes.length;
								for(i=0;i<num;i++){
									n = queue;
									p = n.p;
									q = {p:p,n:n,node:nodes[i]};
									p.n = q;
									n.p = q;
								}
							}
							break;
						case 3:
							while(node){

								// 本文
								var m = DomNodeGetNodeValue(node).match(new RegExp("(◆[a-zA-Z0-9+/.]{10,12})","i"));
								if(!m)	break;

								// 元のテキストノード
								DomNodeSetNodeValue(node,RegExp.leftContext);

								// BbsControlName を生成
								var control_name = new BbsControlName(null,false);
								control_name.setName(m[0]);
								var element_name = control_name.getElement();
								ElementSetTextContent(element_name,m[0]);
								DomNode_InsertAfter(node,element_name);

								// 直後テキスト
								node = DocumentCreateText(RegExp.rightContext);
								DomNode_InsertAfter(element_name,node);
							}
							break;
						}
					}
				})();

				// -
				// BbsControlName を検索
				// -
				BbsControlNameSearch(target,function(control_name){

					control_name.setResponse(response);

					var name = control_name.getName();
					var myself = (response.getName() === name);
					var element_name = control_name.getElement();
					var textnode_name = DocumentCreateText("");


					// -
					// 変化があったときに実行されるイベント
					// -
					control_name.onchange = function(count){
						if(count > 1){
							DomNodeSetNodeValue(textnode_name,"(" + count + ")");
						}else{
							DomNodeSetNodeValue(textnode_name,"");
						}

						var style = element_name.style;
						if(count >= 5){
							StyleDeclarationSetProperty(style,"color","#e80000");
							StyleDeclarationRemoveProperty(style,"font-size");
						}else if(count >= 2){
							StyleDeclarationRemoveProperty(style,"color");
							StyleDeclarationRemoveProperty(style,"font-size");
						}else{
							StyleDeclarationSetProperty(style,"color","#888");
							StyleDeclarationSetProperty(style,"font-size","small");
						}
					};
					control_name.update();
					element_name.appendChild(textnode_name);

					// -
					// ポップアップ化
					// -
					if(type == "name"){
						if(myself) return null;
					}

					// ダイアログを作成
					var response_dialog = new BbsResponseDialog();
					if(parent_dialog)	parent_dialog.attachChild(response_dialog);
					response_dialog.setElementParent(node.parent);
					response_dialog.setElementHitArea(element_name);
					response_dialog.oncreate = function(_window,callback){

						var responses = bbs_dictionary.getResponsesFromName(name);
						var i = 0;
						var num = responses.length;
						if(myself){
							if(num < 2) return false;
						}else{
							if(num < 1) return false;
						}

						function f(){
							var dl = DocumentCreateElement("div");
							dl.style.margin = "0px";
							_window.appendChild(dl);

							var response_name = responses[i];
							var clone = response_name.getCloneElements();

							var j;
							var clone_num = clone.length;
							if(clone_num){
								var clone_nodes = [];
								for(j=0;j<clone_num;j++){
									var obj = clone[j];
									clone_nodes.push(obj.element);
									dl.appendChild(obj.element);
								}
								var param = new Object();
								param.clone_nodes = clone_nodes;
								param.parent = node.parent;

								// レスポンスダイアログを登録
								attachBbsResponseDialog(response_name,param,response_dialog,"name");
							}

							i += 1;
							if(i < num){
								execute_queue.attachFirst(f,null);
							}else{
								callback({result:true});
							}
						}
						execute_queue.attachFirst(f,null);
					};

					return null;
				});
			}

			// -
			// ホスト
			// -
			function forHost(target){
				if(BbsControlHostExist(target))	return;

				// -
				// BbsControlHost を生成
				// -
				(function(){
					var p;
					var n;
					var q;
					var ignore_dictionary = {"B":1,"SCRIPT":1};
					var queue = new Object();
					q = {p:queue,n:queue,node:target};
					queue.p = q;
					queue.n = q;

					while(queue.n != queue){
						q = queue.n;
						p = q.p;
						n = q.n;
						p.n = n;
						n.p = p;
						var node = q.node;
						switch(node.nodeType){
						case 1:
							if(!(ignore_dictionary[node.tagName])){
								var i;
								var nodes = node.childNodes;
								var num = nodes.length;
								for(i=0;i<num;i++){
									n = queue;
									p = n.p;
									q = {p:p,n:n,node:nodes[i]};
									p.n = q;
									n.p = q;
								}
							}
							break;
						case 3:
							while(node){
								var text_value = DomNodeGetNodeValue(node);

								var m = text_value.match(new RegExp("(^|HOST:)([-._a-zA-Z0-9]{1,}(\\.[-._a-zA-Z0-9]{1,}){2,})","i"));
								if(m){
									// 元のテキストノード
									DomNodeSetNodeValue(node,RegExp.leftContext + m[1]);

									// BbsControlHost を生成
									var control_host = new BbsControlHost(null,false);
									control_host.setHost(m[2]);
									var element_host = control_host.getElement();
									ElementSetTextContent(element_host,m[2]);
									DomNode_InsertAfter(node,element_host);

									// 直後テキスト
									node = DocumentCreateText(RegExp.rightContext);
									DomNode_InsertAfter(element_host,node);
									continue;
								}

								var m = text_value.match(new RegExp("(\\[ )([-._a-zA-Z0-9]{1,}(\\.[-._a-zA-Z0-9]{1,}){2,})((|\\n) \\])","i"));
								if(m){
									// 元のテキストノード
									DomNodeSetNodeValue(node,RegExp.leftContext + m[1]);

									// BbsControlHost を生成
									var control_host = new BbsControlHost(null,false);
									control_host.setHost(m[2]);
									var element_host = control_host.getElement();
									ElementSetTextContent(element_host,m[2]);
									DomNode_InsertAfter(node,element_host);

									// 直後テキスト
									node = DocumentCreateText("\n ]" + RegExp.rightContext);
									DomNode_InsertAfter(element_host,node);
									continue;
								}

								var m = text_value.match(new RegExp("(発信元:)([0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3})","i"));
								if(m){
									// 元のテキストノード
									DomNodeSetNodeValue(node,RegExp.leftContext + m[1]);

									// BbsControlHost を生成
									var control_host = new BbsControlHost(null,false);
									control_host.setHost(m[2]);
									var element_host = control_host.getElement();
									ElementSetTextContent(element_host,m[2]);
									DomNode_InsertAfter(node,element_host);

									// 直後テキスト
									node = DocumentCreateText(RegExp.rightContext);
									DomNode_InsertAfter(element_host,node);
									continue;
								}

								break;
							}

							break;
						}
					}
				})();

				// -
				// BbsControlHost を検索
				// -
				BbsControlHostSearch(target,function(control_host){

					control_host.setResponse(response);

					var host = control_host.getHost();
					var myself = (response.getHost() === host);
					var element_host = control_host.getElement();
					var textnode_host = DocumentCreateText("");


					// -
					// 変化があったときに実行されるイベント
					// -
					control_host.onchange = function(count){
						if(count > 1){
							DomNodeSetNodeValue(textnode_host,"(" + count + ")");
						}else{
							DomNodeSetNodeValue(textnode_host,"");
						}

						var style = element_host.style;
						if(count >= 5){
							StyleDeclarationSetProperty(style,"color","#e80000");
							StyleDeclarationRemoveProperty(style,"font-size");
						}else if(count >= 2){
							StyleDeclarationRemoveProperty(style,"color");
							StyleDeclarationRemoveProperty(style,"font-size");
						}else{
							StyleDeclarationSetProperty(style,"color","#888");
							StyleDeclarationSetProperty(style,"font-size","80%");
						}
					};
					control_host.update();
					element_host.appendChild(textnode_host);

					// -
					// ポップアップ化
					// -
					if(type == "host"){
						if(myself) return null;
					}

					// ダイアログを作成
					var response_dialog = new BbsResponseDialog();
					if(parent_dialog)	parent_dialog.attachChild(response_dialog);
					response_dialog.setElementParent(node.parent);
					response_dialog.setElementHitArea(element_host);
					response_dialog.oncreate = function(_window,callback){

						var responses = bbs_dictionary.getResponsesFromHost(host);
						var i = 0;
						var num = responses.length;
						if(myself){
							if(num < 2) return false;
						}else{
							if(num < 1) return false;
						}

						function f(){
							var dl = DocumentCreateElement("div");
							dl.style.margin = "0px";
							_window.appendChild(dl);

							var response_host = responses[i];
							var clone = response_host.getCloneElements();

							var j;
							var clone_num = clone.length;
							if(clone_num){
								var clone_nodes = [];
								for(j=0;j<clone_num;j++){
									var obj = clone[j];
									clone_nodes.push(obj.element);
									dl.appendChild(obj.element);
								}
								var param = new Object();
								param.clone_nodes = clone_nodes;
								param.parent = node.parent;

								// レスポンスダイアログを登録
								attachBbsResponseDialog(response_host,param,response_dialog,"host");
							}

							i += 1;
							if(i < num){
								execute_queue.attachFirst(f,null);
							}else{
								callback({result:true});
							}
						}
						execute_queue.attachFirst(f,null);
					};

					return null;
				});
			}

			// -
			// フォロワー
			// -
			function forFollower(target){
				if(BbsControlFollowerExist(target))	return;

				// -
				// BbsControlFollower を生成
				// -
				var control_follower = new BbsControlFollower(null,true);
				control_follower.setResponse(response);

				var element_follower = control_follower.getElement();
				var textnode_follower = DocumentCreateText("");

				element_follower.appendChild(textnode_follower);

				// -
				// 変化があったときに実行されるイベント
				// -
				control_follower.onchange = function(count){
					if(count){
						textnode_follower.nodeValue = " follower(" + count + ")";
					}else{
						textnode_follower.nodeValue = "";
					}

					var style = element_follower.style;
					if(count >= 3){
						StyleDeclarationSetProperty(style,"color","#e80000");
						StyleDeclarationRemoveProperty(style,"font-size");

					}else{
						StyleDeclarationSetProperty(style,"color","#888");
						StyleDeclarationSetProperty(style,"font-size","small");
					}
					if(count){
						StyleDeclarationSetProperty(style,"margin","0px 4px 0px 0px");
					}else{
						StyleDeclarationRemoveProperty(style,"margin");
					}
				};
				control_follower.update();
				var prev = target.lastChild;
				while(prev){
					if(prev.tagName != "BR") break;
					prev = prev.previousSibling;
				}
				if(prev){
					DomNode_InsertAfter(prev,element_follower);
				}else{
					target.appendChild(element_follower);
				}

				// -
				// ポップアップ化
				// -
				// ダイアログを作成
				var response_dialog = new BbsResponseDialog();
				if(parent_dialog)	parent_dialog.attachChild(response_dialog);
				response_dialog.setElementParent(node.parent);
				response_dialog.setElementHitArea(element_follower);
				response_dialog.oncreate = function(_window,callback){

					var ary = response.getFollower();
					var i = 0;
					var num = ary.length;
					if(num <= 0) return false;

					function f(){
						var dl = DocumentCreateElement("div");
						dl.style.margin = "0px";
						_window.appendChild(dl);

						var follower = bbs_dictionary.getResponse(ary[i].getNumber());
						var clone = follower.getCloneElements();

						var j;
						var clone_num = clone.length;
						if(clone_num){
								var clone_nodes = [];
								for(j=0;j<clone_num;j++){
									var obj = clone[j];
									clone_nodes.push(obj.element);
									dl.appendChild(obj.element);
								}
								var param = new Object();
								param.clone_nodes = clone_nodes;
								param.parent = node.parent;

							// レスポンスダイアログを登録
							attachBbsResponseDialog(follower,param,response_dialog,"response");
						}

						i += 1;
						if(i < num){
							execute_queue.attachFirst(f,null);
						}else{
							callback({result:true});
						}
					}
					execute_queue.attachFirst(f,null);
				};
			}

			// -
			// 返信
			// -
			function forReply(target){
				if(BbsControlReplyExist(target))	return;

				// -
				// BbsControlReply を生成
				// -
				(function(){
					var node = target.firstChild;
					if(!node) return;

					switch(node.nodeType){
					case 1:
						// 本文
						var m = ElementGetTextContent(node).match(new RegExp("^[0-9]+$","i"));
						if(!m)	return;

						// BbsControlReply を生成
						var control_reply = new BbsControlReply(node,true);
						break;
					case 3:
						// 本文
						var m = DomNodeGetNodeValue(node).match(new RegExp("^[0-9]+","i"));
						if(!m)	return;
	
						// 元のテキストノード
						DomNodeSetNodeValue(node,RegExp.leftContext);
	
						// BbsControlReply を生成
						var control_reply = new BbsControlReply(null,false);
						var element_reply = control_reply.getElement();
						ElementSetTextContent(element_reply,m[0]);
						DomNode_InsertAfter(node,element_reply);
	
						// 直後テキスト
						node = DocumentCreateText(RegExp.rightContext);
						DomNode_InsertAfter(element_reply,node);					
						break;
					}
				})();

				// -
				// BbsControlReply を検索
				// -
				BbsControlReplySearch(target,function(control_reply){

					control_reply.setResponse(response);
					var element_reply = control_reply.getElement();
					var docking_form = work.docking_form;
					var textarea = work.form_textarea;

					// -
					// クリックされたときに実行されるイベント
					// -
					control_reply.onclick = function(e){
						docking_form.popupForReply(element_reply);
						var text = textarea.value;
						var num = text.length;
						var selection_end = textarea.selectionEnd;
						var insert_str;
						if(selection_end >= num){
							insert_str = ">>" + (response.getNumber()) + "\n";
						}else{
							insert_str = ">>" + (response.getNumber());
						}
						textarea.value = text.slice(0,selection_end) + insert_str + text.slice(selection_end);
						textarea.selectionEnd = selection_end + insert_str.length;
						textarea.focus();

						if(e.stopImmediatePropagation){
							e.stopImmediatePropagation();
						}
					};

					return null;
				});
			}

			var info_number;
			var info_name;
			var info_date;
			var info_uid;
			var info_message;
			
			switch(work.bbs_name){
			case "2ch_v5":
				info_number = info_name = info_date = info_uid = node.clone_nodes[0];
				info_message = node.clone_nodes[1];
				break;
			case "2ch_v6":
			case "pink":
				var info_post = node.clone_nodes[0];
				info_number = ElementGetElementsByClassName(info_post,"number")[0];
				info_name = ElementGetElementsByClassName(info_post,"name")[0];
				info_date = ElementGetElementsByClassName(info_post,"date")[0];
				info_uid = ElementGetElementsByClassName(info_post,"uid")[0] || info_date;
				info_message = 
					ElementGetElementsByClassName(info_post,"message")[0] ||
					ElementGetElementsByClassName(info_post,"thread_in")[0];
				break;
			}

			if(info_number){
				forReply(info_number);
			}
			if(info_name){
				forName(info_name);
			}
			if(info_date){
				forHost(info_date);
			}
			if(info_uid){
				forId(info_uid);
				forFollower(info_uid);
			}
			if(info_message){
				forResponseAnchor(info_message);
				forId(info_message);
				forName(info_message);
			}
		}

		// -
		// エレメントを解析
		// -
		var useful = (function(){
			var info_post;
			var info_number;
			var info_name;
			var info_date;
			var info_uid;
			var info_message;
			var clone_nodes = [];

			switch(work.bbs_name){
			case "2ch_v5":
				try{
					var dt = element;
					if(dt.tagName != "DT")	return false;
					var dd = DomNodeGetNextElementSibling(dt);
					var dl = dt.parentNode;
					if(dd.tagName != "DD")	return false;
					if(dl.tagName != "DL")	return false;
					info_post = dl;
					info_number = info_name = info_date = info_uid = dt;
					info_message = dd;
					clone_nodes.push(dt);
					clone_nodes.push(dd);
				}catch(e){
					return false;
				}
				break;
			case "2ch_v6":
			case "pink":
				try{
					info_post = element;
					if(info_post.className != "post") return false;
					info_number = ElementGetElementsByClassName(info_post,"number")[0];
					info_name = ElementGetElementsByClassName(info_post,"name")[0];
					info_date = ElementGetElementsByClassName(info_post,"date")[0];
					info_uid = ElementGetElementsByClassName(info_post,"uid")[0] || info_date;
					info_message = 
						ElementGetElementsByClassName(info_post,"message")[0] ||
						ElementGetElementsByClassName(info_post,"thread_in")[0];
					clone_nodes.push(info_post);
				}catch(e){
					return false;
				}
				break;
			}

			// document に未登録
			if(!DomNodeGetAttachedDocument(info_post))	return false;

			// -
			// レスアンカー拡張
			// -
			work.extendResponseAnchor(info_message);

			// -
			// クリーンアップ
			// -
			(function(){
				function cleanup(target){
					BbsControlSearchTrash(target,function(element){
						var node = element.firstChild;
						if(!node)	return null;
						if(node.nodeType != 3)	return null;

						// ID
						var m = node.nodeValue.match(new RegExp("^ID:([-a-zA-Z0-9+/.●!=]{8,})","i"));
						if(m){
							// 直後テキスト
							var node = DocumentCreateText(m[0]);
							DomNode_InsertAfter(element,node);
							DomNodeRemove(element);
							return null;
						}

						// トリップ
						var m = node.nodeValue.match(new RegExp("^(◆[a-zA-Z0-9+/.]{10,12})","i"));
						if(m){
							// 直後テキスト
							var node = DocumentCreateText(m[0]);
							DomNode_InsertAfter(element,node);
							DomNodeRemove(element);
							return null;
						}

						// ホスト名
						var m = node.nodeValue.match(new RegExp("^([-._a-zA-Z0-9]{1,}(\\.[-._a-zA-Z0-9]{1,}){2,})","i"));
						if(m){
							// 直後テキスト
							var node = DocumentCreateText(m[0]);
							DomNode_InsertAfter(element,node);
							DomNodeRemove(element);

							// テキストノードを統合
							node.parentNode.normalize();
							return null;
						}
						var m = node.nodeValue.match(new RegExp("^([0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3})","i"));
						if(m){
							// 直後テキスト
							var node = DocumentCreateText(m[0]);
							DomNode_InsertAfter(element,node);
							DomNodeRemove(element);

							// テキストノードを統合
							node.parentNode.normalize();
							return null;
						}

						return null;
					});
				}

				if(info_number){
					cleanup(info_number);
				}
				if(info_name){
					cleanup(info_name);
				}
				if(info_date){
					cleanup(info_date);
				}
				if(info_uid){
					cleanup(info_uid);
				}
				if(info_message){
					cleanup(info_message);
				}
			})();

			(function(){
				switch(work.bbs_name){
				case "2ch_v5":
				case "2ch_v6":
				case "pink":
					var node_list = ElementGetElementsByClassName(info_post,"back-links");
					var i;
					var num = node_list.length;
					for(i=num-1;i>=0;i--){
						DomNodeRemove(node_list[i]);
					}
					break;
				}
			})();

			// ナンバーを取得
			if(!(ElementGetTextContent(info_number).match(new RegExp("^([0-9]+)","i"))))	return false;

			// ナンバーからレスポンスオブジェクトを取得
			var response = bbs_dictionary.getResponse(parseInt(RegExp.$1));

			// レスポンス解析
			if(!response.getAnalyzed()){

				// IDの取得
				if(ElementGetTextContent(info_uid).match(new RegExp("ID:([-a-zA-Z0-9+/.●!=]{8,})","i"))){
					response.setId(RegExp.$1);
				}

				// 名前の取得
				if(ElementGetTextContent(info_name).match(new RegExp("(◆[a-zA-Z0-9+/.]{10,12})","i"))){
					response.setName(RegExp.$1);
				}

				// ホスト名の取得
				(function(){
					var p;
					var n;
					var q;
					var ignore_dictionary = {"B":1,"SCRIPT":1};
					var queue = new Object();
					q = {p:queue,n:queue,node:info_date};
					queue.p = q;
					queue.n = q;

					while(queue.n != queue){
						q = queue.n;
						p = q.p;
						n = q.n;
						p.n = n;
						n.p = p;
						var node = q.node;
						switch(node.nodeType){
						case 1:
							if(!(ignore_dictionary[node.tagName])){
								var i;
								var nodes = node.childNodes;
								var num = nodes.length;
								for(i=0;i<num;i++){
									n = queue;
									p = n.p;
									q = {p:p,n:n,node:nodes[i]};
									p.n = q;
									n.p = q;
								}
							}
							break;
						case 3:
							var m = DomNodeGetNodeValue(node).match(new RegExp("(^|HOST:)([-._a-zA-Z0-9]{1,}(\\.[-._a-zA-Z0-9]{1,}){2,})","i"));
							if(m){
								response.setHost(m[2]);
								return;
							}
							var m = DomNodeGetNodeValue(node).match(new RegExp("(\\[ )([-._a-zA-Z0-9]{1,}(\\.[-._a-zA-Z0-9]{1,}){2,})(|\\n) \\]","i"));
							if(m){
								response.setHost(m[2]);
								return;
							}
							var m = DomNodeGetNodeValue(node).match(new RegExp("(発信元:)([0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3})","i"));
							if(m){
								response.setHost(m[2]);
								return;
							}
							break;
						}
					}
				})();

				// フォロー解析
				var dictionary = new Object();
				(function(){
					var nodes = ElementGetElementsByTagName(info_message,"span");
					var i;
					var num = nodes.length;
					for(i=0;i<num;i++){
						var numbers = work.createResponseAnchorNumbers(ElementGetTextContent(nodes[i]));
						numbers.getNumbers(function(n){
							if(!dictionary[n]){
								var following = bbs_dictionary.getResponse(n);
								following.addFollower(response);
								dictionary[n] = true;
							}
						});
					}
				})();

				// オリジナルエレメントをセット
				var i;
				var num = clone_nodes.length;
				for(i=0;i<num;i++){
					response.addOriginalElements(String(i),clone_nodes[i]);
				}

				// 消去時に実行されるイベント
				response.onerase = function(){
					var original = response.getOriginalElements();

					// オリジナルエレメントを外す
					var i;
					var num = original.length;
					for(i=0;i<num;i++){
						var revise_scroll = new DocumentReviseScroll();
						var node = original[i].element;
						revise_scroll.executeRemoveElementBefore(node);
						DomNodeRemove(node);
						revise_scroll.executeRemoveElementAfter(node);
					}
				};

				response.setAnalyzed();
			}

			var node_obj = new Object();
			node_obj.parent = document.body;
			node_obj.clone_nodes = clone_nodes;

			// レスポンスダイアログを登録(ルート)
			attachBbsResponseDialog(
				response,
				node_obj,
				null,
				null
			);

			return true;
		})();

		response({useful:useful});
		return true;
	}

			]);

			// -
			// 掲示板設定「2ちゃんねる掲示板」
			// -
			attachItem( "ExpandBbs_ScriptInitialize_2ch" , [
	
	function(info,response){
		var work = info.work;

		// -
		// 基本URL抽出
		// -
		var url = document.URL;
		var bbs_list = [
			{url:"((http|https)://[^.]+\\.(2ch|5ch)\\.net/test/read\\.cgi/[^/]+/[0-9]+)",replace:"$1/",secure:true,name:"2ch"},
			{url:"((http|https)://[^.]+\\.2ch\\.sc/test/read\\.cgi/[^/]+/[0-9]+)",replace:"$1/",secure:true,name:"2ch.sc"},
			{url:"((http|https)://(|[^.]+\\.)machi\\.to/bbs/read\\.cgi/[^/]+/[0-9]+)",replace:"$1/",secure:true,name:"machi"},
			{url:"((http|https)://(|[^.]+\\.)machibbs\\.net/[^/]+/[^/]*[0-9]+)",replace:"$1",secure:true,name:"machibbs"},
			{url:"((http|https)://[^.]+\\.bbspink\\.com/test/read\\.cgi/[^/]+/[0-9]+)",replace:"$1/",secure:true,name:"pink"},
			{url:"((http|https)://jbbs\\.shitaraba\\.net/bbs/read\\.cgi/[^/]+/[0-9]+/[0-9]+)",replace:"$1/",secure:false,name:"shitaraba"},
			{url:"((http|https)://jbbs\\.shitaraba\\.net/bbs/read_archive\\.cgi/[^/]+/[0-9]+/[0-9]+)",replace:"$1/",secure:false,name:"shitaraba_storage"}
		];

		var i;
		var num = bbs_list.length;
		for(i=0;i<num;i++){
			var bbs = bbs_list[i];
			var re = new RegExp(bbs.url,"i");
			var m = url.match(re);
			if(m){
				work.base_url = m[1].replace(re,bbs.replace);
				if(bbs.secure){
					m = work.base_url.match(new RegExp("[^:]+(.*)"));
					if(m) work.base_url = "https" + m[1];
				}
				work.bbs_name = bbs.name;
				break;
			}
		}

		return false;
	},
	function (info,response){
		var work = info.work;
		if(!(work.bbs_name)){
			return false;
		}

		var first_id = 1;
		var last_id = 1;
		var dictionary_id = new Array();
		var load_shadow_list;
		var load_shadow_pos = 0;
		var load_more_list;
		var load_more_pos = 0;
		var element_parent = null;
		var read_more_button = null;
		var element_form = null;
		var base_url = work.base_url;
		var resource_url_more;

		// -
		// 文字列からレスポンス番号を取得
		// -
		work.createResponseAnchorNumbers = function (str){
			var numbers = new ResponseAnchorNumbers();

			var re_search = new RegExp("^(>>|<<|>>|<<|>|>|》|≫|&gt;&gt;)([0-90-9]+)","i");
			var re_range = new RegExp("^([0-90-9]+)[-]([0-90-9]+)","i");
			var re_number = new RegExp("^([0-90-9]+)","i");

			var m = str.match(re_search);
			if(m){
				var p = m[1].length;
				while(true){
					// 番号-番号
					m = str.substr(p).match(re_range);
					if(m){
						var id0 = parseInt(StringConvertFromNumericFullToNumericHalf(m[1]));
						var id1 = parseInt(StringConvertFromNumericFullToNumericHalf(m[2]));
						if(id0 < 1) id0 = 1;
						if(id1 < 1) id1 = 1;
						if(id0 > 10000) id0 = 10000;
						if(id1 > 10000) id1 = 10000;
						p += m[0].length;
						numbers.addNumbers(id0,id1);
					}else{
						// 番号
						m = str.substr(p).match(re_number);
						if(m){
							p += m[0].length;
							var id = parseInt(StringConvertFromNumericFullToNumericHalf(m[1]));
							if(id < 1) id = 1;
							if(id > 0x7fffffff) id = 0x7fffffff;
							numbers.addNumber(id);
						}
					}

					if(m){
						// カンマ
						if(RegExp.rightContext.search(",") == 0){
							p += 1;
							continue;
						}
					}
					break;
				}
			}
			return numbers;
		};

		// -
		// レスアンカー拡張
		// -
		work.extendResponseAnchor = function (target){
			if(BbsControlResponseAnchorExist(target))	return;

			var re_simple = new RegExp("^(>>|<<|>)[-,0-90-9]+$","i");
			var re_detail = new RegExp("(>>|<<|>>|<<|>|>|》|≫|&gt;&gt;)(([0-90-9]+[-][0-90-9]+|[0-90-9]+),)*([0-90-9]+[-][0-90-9]+|[0-90-9]+)","i");
			var re_range = new RegExp("([0-90-9]+)[-]([0-90-9]+)","i");
			var re_number = new RegExp("([0-90-9]+)","i");

			var i;
			var nodes = ElementGetElementsByTagName(target,"a");
			var num = nodes.length;
			for(i=num-1;i>=0;i--){
				var node = nodes[i];
				var m = ElementGetTextContent(node).match(re_simple);
				if(m){
					var text_node = DocumentCreateText(m[0]);
					DomNode_InsertBefore(node,text_node);
					DomNodeRemove(node);
				}
			}

			// テキストノードを統合
			target.normalize();

			var p;
			var n;
			var q;
			var ignore_dictionary = {"A":1,"SCRIPT":1};
			var queue = new Object();
			q = {p:queue,n:queue,node:target};
			queue.p = q;
			queue.n = q;

			while(queue.n != queue){
				q = queue.n;
				p = q.p;
				n = q.n;
				p.n = n;
				n.p = p;
				var node = q.node;
				switch(node.nodeType){
				case 1:
					var i;
					var nodes = node.childNodes;
					var num = nodes.length;
					for(i=0;i<num;i++){
						n = queue;
						p = n.p;
						q = {p:p,n:n,node:nodes[i]};
						p.n = q;
						n.p = q;
					}
					break;
				case 3:
					while(node){
						var m = DomNodeGetNodeValue(node).match(re_detail);
						if(!m)	break;

						// 元のテキストノード
						DomNodeSetNodeValue(node,RegExp.leftContext);

						var element;
						switch(work.bbs_name){
						case "2ch.sc":
							element = DocumentCreateElement("span");
							element.style.cssText = "color:#00F; text-decoration: underline; cursor: pointer;";
							break;
						default:
							element = DocumentCreateElement("a");
							break;
						}
						ElementSetTextContent(element,m[0]);
						DomNode_InsertAfter(node,element);

						// 直後テキスト
						node = DocumentCreateText(RegExp.rightContext);
						DomNode_InsertAfter(element,node);

						var query = "";
						m = ElementGetTextContent(element).match(re_range);
						if(m){
							var min = parseInt(StringConvertFromNumericFullToNumericHalf(m[1]));
							var max = parseInt(StringConvertFromNumericFullToNumericHalf(m[2]));
							if(min < 1) min = 1;
							if(max < 1) max = 1;
							if(min > 10000) min = 10000;
							if(max > 10000) max = 10000;
							if(max < min){
								var tmp = min;
								min = max;
								max = tmp;
							}
							query = min + "-" + max;
						}else{
							// 番号
							m = ElementGetTextContent(element).match(re_number);
							if(m){
								query = parseInt(StringConvertFromNumericFullToNumericHalf(m[0]));
								if(query < 1) query = 1;
								if(query > 0x7fffffff) query = 0x7fffffff;
							}

						}
						element.href = work.base_url + query;
					}
				}
			}
		};

		// -
		// HTML 文書の整合性テスト
		// -
		function checkValidityFromHTML(str){
			switch(work.bbs_name){
			case "shitaraba":
				var m = str.match(new RegExp("<dt>","i"));
				if(!m) return false;
				var m = str.match(new RegExp("<dd>","i"));
				if(!m) return false;
				return true;
			default:
				var m = str.match(new RegExp("<dt>.*?<dd>[ ].*?[ ]<br><br>","i"));
				if(m){
					m = m[0].match(new RegExp("[\r\n]"));
					if(!m) return true;
				}
				return false;
			}
		}

		// -
		// HTML 文書をシャドウ読み込み
		// -
		function loadShadowFromHTML(str){

			var re_number;
			var re_id = new RegExp("ID:([-a-zA-Z0-9+/.●!=]{8,})","i");
			var re_name = new RegExp("(◆[a-zA-Z0-9+/.]{10,12})","i");
			var dd_end;
			switch(work.bbs_name){
			case "2ch":
			case "2ch.sc":
			case "pink":
			case "machi":
			case "machibbs":
					re_number = new RegExp("([0-9]+)","i");
					dd_end = "\n";
				break;
			case "shitaraba":
					re_number = new RegExp("<a[^>]*>([0-9]+)</a>","i");
					dd_end = "</dd>";
				break;
			}

			var p = 0;
			var n = str.length;
			function f(){
				if(p >= n) return;
				p = str.indexOf("<dt>",p);
				if(p < 0) return;
				var e = str.indexOf(dd_end,p);
				if(e < 0) return;
				var s = str.substring(p,e);
				var m = s.match(re_number);
				if(m){
					var id = parseInt(m[1]);
					if((first_id <= id) && (id <= last_id)){
					}else if(dictionary_id[id]){
					}else{
						var nodes = StringHtmlCreateDomNodesSafe(s);
						var dt = nodes[0];
						var dd = (function(){
							var i=1;
							while(true){
								var node = nodes[i];
								if(!node) break;
								if(node.tagName == "DD") return node;
								i++;
							}
							return null;
						})();

						try{
							if(dt.tagName != "DT")	return;
							if(dd.tagName != "DD")	return;
						}catch(e){
							return;
						}

						// ナンバーからレスポンスオブジェクトを取得
						var response = bbs_dictionary.getResponse(id);
						if(!(response.getAnalyzed())){
							var dt_text = ElementGetTextContent(dt);

							// レスアンカー拡張
							work.extendResponseAnchor(dd);

							// IDの取得
							if(dt_text.match(re_id)){
								response.setId(RegExp.$1);
							}

							// 名前の取得
							if(dt_text.match(re_name)){
								response.setName(RegExp.$1);
							}

							// ホスト名の取得
							(function(){
								var p;
								var n;
								var q;
								var ignore_dictionary = {"B":1,"SCRIPT":1};
								var queue = new Object();
								q = {p:queue,n:queue,node:dt};
								queue.p = q;
								queue.n = q;

								while(queue.n != queue){
									q = queue.n;
									p = q.p;
									n = q.n;
									p.n = n;
									n.p = p;
									var node = q.node;
									switch(node.nodeType){
									case 1:
										if(!(ignore_dictionary[node.tagName])){
											var i;
											var nodes = node.childNodes;
											var num = nodes.length;
											for(i=0;i<num;i++){
												n = queue;
												p = n.p;
												q = {p:p,n:n,node:nodes[i]};
												p.n = q;
												n.p = q;
											}
										}
										break;
									case 3:
										var m = DomNodeGetNodeValue(node).match(new RegExp("(^|HOST:)([-._a-zA-Z0-9]{1,}(\\.[-._a-zA-Z0-9]{1,}){2,})","i"));
										if(m){
											response.setHost(m[2]);
											return;
										}
										var m = DomNodeGetNodeValue(node).match(new RegExp("(\\[ )([-._a-zA-Z0-9]{1,}(\\.[-._a-zA-Z0-9]{1,}){2,})(|\\n) \\]","i"));
										if(m){
											response.setHost(m[2]);
											return;
										}
										var m = DomNodeGetNodeValue(node).match(new RegExp("(発信元:)([0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3})","i"));
										if(m){
											response.setHost(m[2]);
											return;
										}
										break;
									}
								}
							})();

							// フォロー解析
							var dictionary = new Object();
							(function(){
								var nodes;
								switch(work.bbs_name){
								case "2ch.sc":
									nodes = ElementGetElementsByTagName(dd,"span");
									break;
								default:
									nodes = ElementGetElementsByTagName(dd,"a");
									break;
								}
								var i;
								var num = nodes.length;
								for(i=0;i<num;i++){
									var numbers = work.createResponseAnchorNumbers(ElementGetTextContent(nodes[i]));
									numbers.getNumbers(function(n){
										if(!dictionary[n]){
											var following = bbs_dictionary.getResponse(n);
											following.addFollower(response);
											dictionary[n] = true;
										}
									});
								}
							})();

							// オリジナルエレメントをセット
							if(dt)	response.addOriginalElements("dt",dt);
							if(dd)	response.addOriginalElements("dd",dd);

							// 消去時に実行されるイベント
							response.onerase = function(){};

							response.setAnalyzed();
						}
					}
				}

				if(p < e){
					p = e + 1;
					execute_queue.attachFirst(f,null);
				}
			}
			execute_queue.attachFirst(f,null);
		}

		// -
		// HTML 文書を継ぎ足し読み込み
		// -
		function loadMoreFromHTML(str,callback){
			var re_number;
			var dd_end;
			switch(work.bbs_name){
			case "2ch":
			case "2ch.sc":
			case "pink":
			case "machi":
			case "machibbs":
					re_number = new RegExp("([0-9]+)","i");
					dd_end = "\n";
				break;
			case "shitaraba":
					re_number = new RegExp("<a[^>]*>([0-9]+)</a>","i");
					dd_end = "</dd>";
				break;
			}

			var p = 0;
			var n = str.length;
			var add_count = 0;
			function f(){
				try{
					if(p >= n) throw 0;
					p = str.indexOf("<dt>",p);
					if(p < 0) throw 0;
					var e = str.indexOf(dd_end,p);
					if(e < 0) throw 0;
					var s = str.substring(p,e);
					var m = s.match(re_number);
					if(m){
						var id = parseInt(m[1]);
						if(last_id < id){
							var response = bbs_dictionary.getResponse(id);
							response.clearAnalyzed();
							response.clearOriginalElements();
							response.clearFollowing();

							var nodes = StringHtmlCreateDomNodesSafe(s);
							var j;
							var node_num = nodes.length;
							for(j=0;j<node_num;j++){
								element_parent.appendChild(nodes[j]);
							}
							last_id = id;
							add_count += 1;
							resource_url_more = base_url + (last_id) + "-";
						}
					}

					if(p < e){
						p = e + 1;
						execute_queue.attachFirst(f,null);
						return;
					}
				}catch(e){
					if(e){
						callback({result:false});
						return;
					}
				}
				callback({result:true,add_count:add_count});
			}
			execute_queue.attachFirst(f,null);
		}

		// -
		// DAT 文書の整合性テスト
		// -
		function checkValidityFromDAT(str){
			var m = str.match(new RegExp("</b>.*<b>.*?<>.*?<>.*?<>.*?<>","i"));
			if(m){
				m = m[0].match(new RegExp("[\r\n]"));
				if(!m) return true;
			}
			return false;
		}

		// -
		// DAT 文書をシャドウ読み込み
		// -
		function loadShadowFromDAT(str){
			var re_search = new RegExp("(.*?)<>(.*?)<>(.*?)<>(.*?)<>","i");
			var re_number = new RegExp("([0-9]+)","i");
			var re_id = new RegExp("ID:([-a-zA-Z0-9+/.●!=]{8,})","i");
			var re_name = new RegExp("(◆[a-zA-Z0-9+/.]{10,12})","i");
			var re_icon = new RegExp("^ sssp://img.2ch.net/ico/(.*?)( <br> .*)$","i");

			var p = 0;
			var n = str.length;
			var id = 1;
			function f(){
				if(p >= n) return;
				var e = str.indexOf("\n",p);
				if((first_id <= id) && (id <= last_id)){
				}else if(dictionary_id[id]){
				}else{
					// ナンバーからレスポンスオブジェクトを取得
					var response = bbs_dictionary.getResponse(id);
					if(!(response.getAnalyzed())){
						var m = str.substring(p,e).match(re_search);
						if(m){
							var html = "<dt>" + id + " :";
							if(m[2]){
								html += "<a href=\"mailto:" + m[2] + "\"><b>" + m[1] + "</b></a>";
							}else{
								html += "<font color=green><b>" + m[1] + "</b></font>";
							}
							html += ":" + m[3] + "<dd>";
							var msg = m[4];
							if(msg.match(re_icon)){
								msg = "<img src=\"http://img.2ch.net/ico/" + RegExp.$1 + "\">" + RegExp.$2;
							}
							html += msg + "<br><br>";

							var nodes = StringHtmlCreateDomNodesSafe(html);
							var dt = nodes[0];
							var dd = nodes[1];

							try{
								if(dt.tagName != "DT")	return;
								if(dd.tagName != "DD")	return;
							}catch(e){
								return;
							}

							var dt_text = ElementGetTextContent(dt);

							// レスアンカー拡張
							work.extendResponseAnchor(dd);

							// IDの取得
							if(dt_text.match(re_id)){
								response.setId(RegExp.$1);
							}

							// 名前の取得
							if(dt_text.match(re_name)){
								response.setName(RegExp.$1);
							}

							// ホスト名の取得
							(function(){
								var p;
								var n;
								var q;
								var ignore_dictionary = {"B":1,"SCRIPT":1};
								var queue = new Object();
								q = {p:queue,n:queue,node:dt};
								queue.p = q;
								queue.n = q;

								while(queue.n != queue){
									q = queue.n;
									p = q.p;
									n = q.n;
									p.n = n;
									n.p = p;
									var node = q.node;
									switch(node.nodeType){
									case 1:
										if(!(ignore_dictionary[node.tagName])){
											var i;
											var nodes = node.childNodes;
											var num = nodes.length;
											for(i=0;i<num;i++){
												n = queue;
												p = n.p;
												q = {p:p,n:n,node:nodes[i]};
												p.n = q;
												n.p = q;
											}
										}
										break;
									case 3:
										var m = DomNodeGetNodeValue(node).match(new RegExp("(^|HOST:)([-._a-zA-Z0-9]{1,}(\\.[-._a-zA-Z0-9]{1,}){2,})","i"));
										if(m){
											response.setHost(m[2]);
											return;
										}
										var m = DomNodeGetNodeValue(node).match(new RegExp("(\\[ )([-._a-zA-Z0-9]{1,}(\\.[-._a-zA-Z0-9]{1,}){2,})(|\\n) \\]","i"));
										if(m){
											response.setHost(m[2]);
											return;
										}
										var m = DomNodeGetNodeValue(node).match(new RegExp("(発信元:)([0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3})","i"));
										if(m){
											response.setHost(m[2]);
											return;
										}
										break;
									}
								}
							})();

							// フォロー解析
							var dictionary = new Object();
							(function(){
								var nodes;
								switch(work.bbs_name){
								case "2ch.sc":
									nodes = ElementGetElementsByTagName(dd,"span");
									break;
								default:
									nodes = ElementGetElementsByTagName(dd,"a");
									break;
								}
								var i;
								var num = nodes.length;
								for(i=0;i<num;i++){
									var numbers = work.createResponseAnchorNumbers(ElementGetTextContent(nodes[i]));
									numbers.getNumbers(function(n){
										if(!dictionary[n]){
											var following = bbs_dictionary.getResponse(n);
											following.addFollower(response);
											dictionary[n] = true;
										}
									});
								}
							})();

							// オリジナルエレメントをセット
							if(dt)	response.addOriginalElements("dt",dt);
							if(dd)	response.addOriginalElements("dd",dd);

							// 消去時に実行されるイベント
							response.onerase = function(){};

							response.setAnalyzed();
						}
					}
				}

				id += 1;
				if(p < e){
					p = e + 1;
					execute_queue.attachFirst(f,null);
				}
			}
			execute_queue.attachFirst(f,null);
		}

		// -
		// DAT 文書を継ぎ足し読み込み
		// -
		function loadMoreFromDAT(str,callback){

			// 最後尾 ID
			var nodes = ElementGetElementsByTagName(element_parent,"dt");
			var node_num = nodes.length;
			if(node_num){
				if(ElementGetTextContent(nodes[node_num-1]).match(new RegExp("^([0-9]+)[ ]:","i"))){
					last_id = parseInt(RegExp.$1);
				}
			}

			var re_search = new RegExp("(.*?)<>(.*?)<>(.*?)<>(.*?)<>","i");
			var re_icon = new RegExp("^ sssp://img.2ch.net/ico/(.*?)( <br> .*)$","i");

			// レスポンス抽出
			var p = 0;
			var n = str.length;
			var id = 1;
			var add_count = 0;
			function f(){
				try{
					if(p >= n) throw 0;
					var e = str.indexOf("\n",p);
					if(last_id < id){
						var m = str.substring(p,e).match(re_search);
						if(m){
							var response = bbs_dictionary.getResponse(id);
							response.clearAnalyzed();
							response.clearOriginalElements();
							response.clearFollowing();

							var html = "<dt>" + id + " :";
							if(m[2]){
								html += "<a href=\"mailto:" + m[2] + "\"><b>" + m[1] + "</b></a>";
							}else{
								html += "<font color=green><b>" + m[1] + "</b></font>";
							}
							html += ":" + m[3] + "<dd>";
							var msg = m[4];
							if(msg.match(re_icon)){
								msg = "<img src=\"http://img.2ch.net/ico/" + RegExp.$1 + "\">" + RegExp.$2;
							}
							html += msg + "<br><br>";

							var nodes = StringHtmlCreateDomNodesSafe(html);
							var j;
							var node_num = nodes.length;
							for(j=0;j<node_num;j++){
								element_parent.appendChild(nodes[j]);
							}
							last_id = id;
							add_count += 1;
						}
					}

					id += 1;
					if(p < e){
						p = e + 1;
						execute_queue.attachFirst(f,null);
						return;
					}
				}catch(e){
					if(e){
						callback({result:false});
						return;
					}
				}
				callback({result:true,add_count:add_count});
			}
			execute_queue.attachFirst(f,null);
		}

		// -
		// 継ぎ足し読み込み
		// -
		function readMore(callback){
			var num = load_more_list.length;
			var pos = load_more_pos;
			var i = 0;

			var failure = function(){
				i += 1;
				if(num <= i){
					callback({result:false});
					return;
				}
				pos += 1;
				if(num <= pos) pos = 0;
				load_more_pos = pos;
				load();
			};

			var load = function (){
				var param = load_more_list[pos];

				// ローダーオブジェクトを作成
				var loader = new Loader();

				// 成功
				loader.onload = function(str){
					if(!param.validity(str)){
						failure();
						return;
					}
					param.parse(str,function(response){
						if(response.result){
							callback(response);
						}else{
							failure();
						}
					});
				};

				// 失敗
				loader.onerror = function(){
					failure();
				};

				// テキストの読み込み
				loader.setMethod("GET");
				loader.setURL(param.url);
				switch(work.bbs_name){
				case "2ch":
				case "2ch.sc":
				case "machi":
				case "machibbs":
				case "pink":
					loader.overrideMimeType("text/plain; charset=Shift_JIS");
					break;
				case "shitaraba":
					loader.overrideMimeType("text/plain; charset=EUC-JP");
					break;
				}
				loader.loadText();
			};
			load();
		}

		// -
		// レスポンス親要素
		// -
		var i;
		var nodes = ElementGetElementsByTagName(document.body,"dl");
		var num = nodes.length;
		for(i=0;i<num;i++){
			element_parent = nodes[i];
			break;
		}

		if(!element_parent) return false;

		// -
		// フォーム位置修正
		// -
		switch(work.bbs_name){
		case "machi":
			var nodes = ElementGetElementsByTagName(element_parent,"dt");
			if(nodes.length){
				var dt = nodes[nodes.length - 1];
				var node = dt.firstChild;
				while(node){
					var next = node.nextSibling;
					DomNode_InsertAfter(element_parent,node);
					node = next;
				}
				DomNodeRemove(dt);
			}

			var nodes = ElementGetElementsByTagName(element_parent,"dd");
			if(nodes.length){
				nodes = ElementGetElementsByTagName(nodes[nodes.length - 1],"br");
				if(nodes.length){
					var node = nodes[nodes.length - 1];
					node = node.nextSibling;
					while(node){
						var next = node.nextSibling;
						DomNode_InsertAfter(element_parent,node);
						node = next;
					}
				}
			}

			break;
		}

		// -
		// 範囲取得
		// -
		var nodes = ElementGetElementsByTagName(element_parent,"dt");
		var node_num = nodes.length;
		if(node_num){
			var re_id = new RegExp("^[ \t\r\n]*([0-9]+)","i");
			var m;
			m = ElementGetTextContent(nodes[0]).match(re_id);
			if(m){
				first_id = parseInt(m[1]);
				dictionary_id[0] = true;
			}

			if((first_id == 1) && (node_num > 1)){
				m = ElementGetTextContent(nodes[1]).match(re_id);
				if(m){
					first_id = parseInt(m[1]);
					dictionary_id[first_id] = true;
					if(first_id <= 2) first_id = 1;
				}
			}

			m = ElementGetTextContent(nodes[node_num-1]).match(re_id);
			if(m){
				last_id = parseInt(m[1]);
				dictionary_id[last_id] = true;
			}
		}

		// -
		// 読み込みリスト
		// -
		load_shadow_list = [
			{
				url:base_url,
				parse:loadShadowFromHTML,
				validity:checkValidityFromHTML
			},{
				url:(function(){
					var m = base_url.match(new RegExp("http://([^/]+)/test/read\\.cgi/([^/]+)/([0-9]+)/","i"));
					if(!m) return "";
					return "http://" + m[1] + "/" + m[2] + "/dat/" + m[3] + ".dat";
				})(),
				parse:loadShadowFromDAT,
				validity:checkValidityFromDAT
			}
		];
		load_more_list = [
			{
				url:base_url + last_id + "-",
				parse:loadMoreFromHTML,
				validity:checkValidityFromHTML
			},{
				url:(function(){
					var m = base_url.match(new RegExp("http://([^/]+)/test/read\\.cgi/([^/]+)/([0-9]+)/","i"));
					if(!m) return "";
					return "http://" + m[1] + "/" + m[2] + "/dat/" + m[3] + ".dat";
				})(),
				parse:loadMoreFromDAT,
				validity:checkValidityFromDAT
			}
		];

		// -
		// 読み込み方式
		// -
		load_shadow_pos = 0;
		load_more_pos = 0;

		// JavaScript モード検出
		switch(work.bbs_name){
		case "2ch":
		case "2ch.sc":
			load_shadow_pos = 1;

			var nodes = ElementGetElementsByTagName(DocumentGetHeadElement(document),"meta");
			var i;
			var num = nodes.length;
			for(i=0;i<num;i++){
				var node = nodes[i];
				var http_equiv = node.getAttribute("http-equiv");
				if(!http_equiv)	http_equiv = node.httpEquiv;
				if(!http_equiv)	continue;
				if(http_equiv.toLowerCase() != "content-type")	continue;
				var content = node.getAttribute("content");
				if(!content)	content = node.content;
				if(!content)	continue;
				if(content.indexOf("application") == -1)	continue;

				load_more_pos = 1;
				break;
			}
			break;
		}

		// -
		// BbsControlReadMoreButton 作成
		// -
		read_more_button = new BbsControlReadMoreButton();
		read_more_button.setWaitTime(2 * 1000);
		read_more_button.onclick = readMore;
		DomNode_InsertAfter(element_parent,read_more_button.getElement());

		// -
		// 書き込みをポップアップ化
		// -
		(function(){
			var element_form;
			var input_submit;
			var element_textarea;
			var event_handler_release;
			var task;

			(function(){
				// フォーム
				var nodes = ElementGetElementsByTagName(document.body,"form");
				var i;
				switch(work.bbs_name){
				case "2ch":
				case "pink":
				case "2ch.sc":
					for(i=0;i<nodes.length;i++){
						if(nodes[i].action.indexOf("/test/bbs.cgi") >= 0){
							element_form = nodes[i];
							break;
						}
					}
					break;
				case "shitaraba":
					for(i=0;i<nodes.length;i++){
						if(nodes[i].action.indexOf("/bbs/write.cgi/") >= 0){
							element_form = nodes[i];
							break;
						}
					}
					break;
				case "machi":
				case "machibbs":
					for(i=0;i<nodes.length;i++){
						if(nodes[i].action.indexOf("/bbs/write.cgi") >= 0){
							element_form = nodes[i];
							break;
						}
					}
					break;
				}

				// JavaScript モード
				if(!element_form){
					switch(work.bbs_name){
					case "2ch.sc":
						element_form = document.getElementById("postForm");
						break;
					}
				}

				if(element_form){

					// サブミットボタン
					var nodes = ElementGetElementsByTagName(element_form,"input");
					for(i=0;i<nodes.length;i++){
						if(nodes[i].type.toLowerCase() == "submit"){
							input_submit = nodes[i];
							break;
						}
					}

					// テキストエリア
					var nodes = ElementGetElementsByTagName(element_form,"textarea");
					if(nodes.length){
						element_textarea = nodes[0];
						work.form_textarea = element_textarea;
					}

					// BbsControlDockingForm 作成
					var docking_form = new BbsControlDockingForm(element_form,false);
					docking_form.setStyle("background:#e8e8e8; background-image:linear-gradient(to bottom, #f8f8f8, #e8e8e8); padding:20px; border:1px solid #888; border-radius:4px; box-shadow:2px 2px 5px #aaa; margin:0px;");
					work.docking_form = docking_form;
				}
			})();

			// 開放
			function release(){
				if(event_handler_release){
					event_handler_release.release();
					event_handler_release = null;
				}

				removeEvent();

				if(task){
					task.release();
				}
			}

			// クリア
			function clear(){
				element_textarea.value = "";
			}

			// 有効セット
			function setEnable(type){
				input_submit.disabled = !(type);
			}

			// イベント追加
			function addEvent(){
				if(window.addEventListener){
					input_submit.addEventListener("click",EventClickButton);
					element_form.addEventListener("submit",EventSubmitForm);
				}else if(window.attachEvent){
					input_submit.attachEvent("onclick",EventClickButton);
					element_form.attachEvent("onsubmit",EventSubmitForm);
				}
			}

			// イベント除外
			function removeEvent(){
				if(window.removeEventListener){
					input_submit.removeEventListener("click",EventClickButton);
					element_form.removeEventListener("submit",EventSubmitForm);
				}else if(window.detachEvent){
					input_submit.detachEvent("onclick",EventClickButton);
					element_form.detachEvent("onsubmit",EventSubmitForm);
				}
			}

			// サブミット直前に実行されるイベント
			function EventSubmitForm(e){
				setEnable(false);
			}

			// クリック時に実行されるイベント
			function EventClickButton(e){
				var w;
				var h;
				switch(work.bbs_name){
				case "2ch":
				case "2ch.sc":
				case "pink":
					w = 800;
					h = 600;
					var cookie = document.cookie;
					if(cookie){
						if(cookie.indexOf("PREN=") != -1){
							w = 600;
							h = 450;
						}
					}
					break;
				case "shitaraba":
					w = 600;
					h = 450;
					break;
				case "machi":
				case "machibbs":
					w = 700;
					h = 400;
					break;
				}

				var window_name = "_pageexpand_" + Math.floor(Math.random() * 0x7FFFFFFF);
				var popup_iframe = new BbsControlPopupIframe(window_name);
				popup_iframe.setWindowSize(w,h);
				popup_iframe.onclose = function(){
					setEnable(true);
				};

				var element_iframe = popup_iframe.getIFrameElement();
				element_form.target = window_name;

				(function(){
					var closed = false;
					var timer = null;

					// タスク生成
					task = task_container.createTask();
					task.setDestructorFunc(function(){
						task = null;
					});
					task.setExecuteFunc(function(){
						try{
							var href = "";
							var window_obj = element_iframe.contentWindow;
							if(window_obj.document){
								href = window_obj.document.URL;
							}
							if(href.match(/^(http|https):/)){
								switch(work.bbs_name){
								case "2ch":
								case "pink":
									if(href.indexOf("test/bbs.cgi?guid=") == -1){
										closed = true;
									}else if(!timer){
										var body = window_obj.document.body;
										if(body){
											if(ElementGetTextContent(body).indexOf("書きこみが終わりました") != -1){
												timer = (new Date()).getTime();
											}
										}
									}
									break;

								case "2ch.sc":
									if(href.indexOf("test/bbs.cgi?guid=") == -1){
										closed = true;
									}else if(!timer){
										var body = window_obj.document.body;
										if(body){
											if(ElementGetTextContent(body).indexOf("書きこみが終わりました") != -1){
												timer = (new Date()).getTime();
											}
										}
									}
									break;

								case "shitaraba":
									if(href.indexOf("/bbs/write.cgi/") == -1){
										closed = true;
									}else if(!timer){
										var body = window_obj.document.body;
										if(body){
											if(ElementGetTextContent(body).indexOf("書きこみが終りました") != -1){
												timer = (new Date()).getTime();
											}
										}
									}
									break;

								case "machi":
								case "machibbs":
									if(href.indexOf("bbs/write.cgi?guid=ON") == -1){
										closed = true;
										timer = 1;
									}
									break;
								}
							}
							if(timer){
								if((new Date()).getTime() - timer > 1000 * 2){
									closed = true;
								}
							}
						}catch(e){
							closed = true;
						}

						if(closed){
							if(task){
								task.release();
							}
							popup_iframe.close();
							setEnable(true);
							if(timer){
								readMore(function(){});
								clear();
							}
						}
					});
				})();
			}

			(function(){
				if(!element_form) return;
				if(!input_submit) return;
				if(!element_textarea) return;

				if(work.docking_form){
					work.docking_form.onreset = clear;
				}

				if((function(){
					try{
						var re = new RegExp("^[^:]+");
						var m0 = element_form.action.match(re);
						var m1 = document.URL.match(re);
						if(!m0) return true;
						if(!m1) return true;
						if(m0[0] === m1[0]) return false;
					}catch(e){}
					return true;
				})()) return;

				if(load_more_pos == 0){
					addEvent();
	
					event_handler_release = page_expand_event_dispatcher.createEventHandler("release");
					event_handler_release.setFunction(function(){
						release();
					});
				}
			})();
		})();

		// -
		// シャドウロード
		// -
		(function(){
			var num = load_shadow_list.length;
			var pos = load_shadow_pos;
			var i = 0;

			var failure = function(){
				i += 1;
				if(num <= i) return;
				pos += 1;
				if(num <= pos) pos = 0;
				load_shadow_pos = pos;
				load();
			};

			var load = function (){
				var param = load_shadow_list[pos];

				// ローダーオブジェクトを作成
				var loader = new Loader();

				// 成功
				loader.onload = function(str){
					if(!param.validity(str)){
						failure();
						return;
					}
					param.parse(str);
				};

				// 失敗
				loader.onerror = function(){
					failure();
				};

				// テキストの読み込み
				loader.setMethod("GET");
				loader.setURL(param.url);
				switch(work.bbs_name){
				case "2ch":
				case "2ch.sc":
				case "pink":
					loader.overrideMimeType("text/plain; charset=Shift_JIS");
					break;
				case "shitaraba":
					loader.overrideMimeType("text/plain; charset=EUC-JP");
					break;
				}
				loader.loadText();
			};
			load();
		})();

		response({result:true});
		return true;
	},
	function (info,response){
		response({result:false});
		return true;
	}

			]);

			// -
			// 掲示板設定「2ちゃんねる掲示板」
			// -
			attachItem( "ExpandBbs_ScriptCallback_2ch" , [
	
	function(info,response){
		var element = info.element;
		var work = info.work;

		// -
		// レスポンスダイアログを登録
		// -
		function attachBbsResponseDialog(response,node,parent_dialog,type){

			// -
			// レスアンカー
			// -
			function forResponseAnchor(target){
				if(BbsControlResponseAnchorExist(target))	return;

				// -
				// BbsControlResponseAnchor を生成
				// -
				(function(){
					var i;
					var nodes;
					switch(work.bbs_name){
					case "2ch.sc":
						nodes = ElementGetElementsByTagName(target,"span");
						break;
					default:
						nodes = ElementGetElementsByTagName(target,"a");
						break;
					}
					var num = nodes.length;
					for(i=0;i<num;i++){
						var node = nodes[i];
						var numbers = work.createResponseAnchorNumbers(ElementGetTextContent(node));
						if(numbers.getCount()){
							var control_res_anchor = new BbsControlResponseAnchor(node,false);
							control_res_anchor.setResponseAnchorNumbers(numbers);
						}
					}
				})();

				// -
				// BbsControlResponseAnchor を検索
				// -
				BbsControlResponseAnchorSearch(target,function(control_res_anchor){

					var element_res_anchor = control_res_anchor.getElement();
					var numbers = control_res_anchor.getResponseAnchorNumbers();

					// ダイアログを作成
					var response_dialog = new BbsResponseDialog();
					if(parent_dialog)	parent_dialog.attachChild(response_dialog);
					response_dialog.setElementParent(node.parent);
					response_dialog.setElementHitArea(element_res_anchor);
					response_dialog.oncreate = function(_window,callback){

						var dl = DocumentCreateElement("dl");
						dl.style.margin = "0px";
						_window.appendChild(dl);

						var created = false;
						var i = 0;
						var number_list = numbers.getNumberList();
						var num = number_list.length;
						if(!num) return false;

						function f(){
							var following = bbs_dictionary.getResponse(number_list[i]);
							var clone = following.getCloneElements();

							var j;
							var clone_num = clone.length;
							if(clone_num){
								var param = new Object();
								param.parent = node.parent;
								for(j=0;j<clone_num;j++){
									var obj = clone[j];
									param[obj.name] = obj.element;
									dl.appendChild(obj.element);
								}

								// レスポンスダイアログを登録
								attachBbsResponseDialog(following,param,response_dialog,"response");

								created = true;
							}

							i += 1;
							if(i < num){
								execute_queue.attachFirst(f,null);
							}else{
								callback({result:created});
							}
						}
						execute_queue.attachFirst(f,null);
					};

					return null;
				});
			}

			// -
			// ID
			// -
			function forId(target){
				if(BbsControlIdExist(target))	return;

				// -
				// BbsControlId を生成
				// -
				(function(){
					var p;
					var n;
					var q;
					var ignore_dictionary = {"A":1,"SCRIPT":1};
					var queue = new Object();
					q = {p:queue,n:queue,node:target};
					queue.p = q;
					queue.n = q;

					while(queue.n != queue){
						q = queue.n;
						p = q.p;
						n = q.n;
						p.n = n;
						n.p = p;
						var node = q.node;
						switch(node.nodeType){
						case 1:
							if(!(ignore_dictionary[node.tagName])){
								var i;
								var nodes = node.childNodes;
								var num = nodes.length;
								for(i=0;i<num;i++){
									n = queue;
									p = n.p;
									q = {p:p,n:n,node:nodes[i]};
									p.n = q;
									n.p = q;
								}
							}

							break;
						case 3:
							while(node){

								var m = DomNodeGetNodeValue(node).match(new RegExp("ID:([-a-zA-Z0-9+/.●!=]{8,})","i"));
								if(!m)	break;

								// 元のテキストノード
								DomNodeSetNodeValue(node,RegExp.leftContext);

								// BbsControlId を生成
								var control_id = new BbsControlId(null,false);
								control_id.setId(m[1]);
								var element_id = control_id.getElement();
								ElementSetTextContent(element_id,m[0]);
								DomNode_InsertAfter(node,element_id);

								// 直後テキスト
								node = DocumentCreateText(RegExp.rightContext);
								DomNode_InsertAfter(element_id,node);
							}
							break;
						}
					}
				})();

				// -
				// BbsControlId を検索
				// -
				BbsControlIdSearch(target,function(control_id){

					control_id.setResponse(response);

					var id = control_id.getId();
					var myself = (response.getId() === id);
					var element_id = control_id.getElement();
					var textnode_id = DocumentCreateText("");

					element_id.appendChild(textnode_id);

					// -
					// 変化があったときに実行されるイベント
					// -
					control_id.onchange = function(count){
						if(count > 1){
							DomNodeSetNodeValue(textnode_id,"(" + count + ")");
						}else{
							DomNodeSetNodeValue(textnode_id,"");
						}

						var style = element_id.style;
						if(count >= 5){
							StyleDeclarationSetProperty(style,"color","#e80000");
							StyleDeclarationRemoveProperty(style,"font-size");
						}else if(count >= 2){
							StyleDeclarationRemoveProperty(style,"color");
							StyleDeclarationRemoveProperty(style,"font-size");
						}else{
							StyleDeclarationSetProperty(style,"color","#888");
							StyleDeclarationSetProperty(style,"font-size","small");
						}
					};
					control_id.update();

					// -
					// ポップアップ化
					// -
					if(type == "id"){
						if(myself) return null;
					}

					// ダイアログを作成
					var response_dialog = new BbsResponseDialog();
					if(parent_dialog)	parent_dialog.attachChild(response_dialog);
					response_dialog.setElementParent(node.parent);
					response_dialog.setElementHitArea(element_id);
					response_dialog.oncreate = function(_window,callback){

						var dl = DocumentCreateElement("dl");
						dl.style.margin = "0px";
						_window.appendChild(dl);

						var responses = bbs_dictionary.getResponsesFromId(id);
						var i = 0;
						var num = responses.length;
						if(myself){
							if(num < 2) return false;
						}else{
							if(num < 1) return false;
						}

						function f(){
							var response_id = responses[i];
							var clone = response_id.getCloneElements();

							var j;
							var clone_num = clone.length;
							if(clone_num){

								var param = new Object();
								param.parent = node.parent;
								for(j=0;j<clone_num;j++){
									var obj = clone[j];
									param[obj.name] = obj.element;
									dl.appendChild(obj.element);
								}

								// レスポンスダイアログを登録
								attachBbsResponseDialog(response_id,param,response_dialog,"id");
							}

							i += 1;
							if(i < num){
								execute_queue.attachFirst(f,null);
							}else{
								callback({result:true});
							}
						}
						execute_queue.attachFirst(f,null);
					};

					return null;
				});
			}

			// -
			// トリップ
			// -
			function forName(target){
				if(BbsControlNameExist(target))	return;

				// -
				// BbsControlName を生成
				// -
				(function(){
					var p;
					var n;
					var q;
					var ignore_dictionary = {"SCRIPT":1};
					var queue = new Object();
					q = {p:queue,n:queue,node:target};
					queue.p = q;
					queue.n = q;

					while(queue.n != queue){
						q = queue.n;
						p = q.p;
						n = q.n;
						p.n = n;
						n.p = p;
						var node = q.node;
						switch(node.nodeType){
						case 1:
							if(!(ignore_dictionary[node.tagName])){
								var i;
								var nodes = node.childNodes;
								var num = nodes.length;
								for(i=0;i<num;i++){
									n = queue;
									p = n.p;
									q = {p:p,n:n,node:nodes[i]};
									p.n = q;
									n.p = q;
								}
							}
							break;
						case 3:
							while(node){

								// 本文
								var m = DomNodeGetNodeValue(node).match(new RegExp("(◆[a-zA-Z0-9+/.]{10,12})","i"));
								if(!m)	break;

								// 元のテキストノード
								DomNodeSetNodeValue(node,RegExp.leftContext);

								// BbsControlName を生成
								var control_name = new BbsControlName(null,false);
								control_name.setName(m[0]);
								var element_name = control_name.getElement();
								ElementSetTextContent(element_name,m[0]);
								DomNode_InsertAfter(node,element_name);

								// 直後テキスト
								node = DocumentCreateText(RegExp.rightContext);
								DomNode_InsertAfter(element_name,node);
							}
							break;
						}
					}
				})();

				// -
				// BbsControlName を検索
				// -
				BbsControlNameSearch(target,function(control_name){

					control_name.setResponse(response);

					var name = control_name.getName();
					var myself = (response.getName() === name);
					var element_name = control_name.getElement();
					var textnode_name = DocumentCreateText("");


					// -
					// 変化があったときに実行されるイベント
					// -
					control_name.onchange = function(count){
						if(count > 1){
							DomNodeSetNodeValue(textnode_name,"(" + count + ")");
						}else{
							DomNodeSetNodeValue(textnode_name,"");
						}

						var style = element_name.style;
						if(count >= 5){
							StyleDeclarationSetProperty(style,"color","#e80000");
							StyleDeclarationRemoveProperty(style,"font-size");
						}else if(count >= 2){
							StyleDeclarationRemoveProperty(style,"color");
							StyleDeclarationRemoveProperty(style,"font-size");
						}else{
							StyleDeclarationSetProperty(style,"color","#888");
							StyleDeclarationSetProperty(style,"font-size","small");
						}
					};
					control_name.update();
					element_name.appendChild(textnode_name);

					// -
					// ポップアップ化
					// -
					if(type == "name"){
						if(myself) return null;
					}

					// ダイアログを作成
					var response_dialog = new BbsResponseDialog();
					if(parent_dialog)	parent_dialog.attachChild(response_dialog);
					response_dialog.setElementParent(node.parent);
					response_dialog.setElementHitArea(element_name);
					response_dialog.oncreate = function(_window,callback){

						var dl = DocumentCreateElement("dl");
						dl.style.margin = "0px";
						_window.appendChild(dl);

						var responses = bbs_dictionary.getResponsesFromName(name);
						var i = 0;
						var num = responses.length;
						if(myself){
							if(num < 2) return false;
						}else{
							if(num < 1) return false;
						}

						function f(){
							var response_name = responses[i];
							var clone = response_name.getCloneElements();

							var j;
							var clone_num = clone.length;
							if(clone_num){

								var param = new Object();
								param.parent = node.parent;
								for(j=0;j<clone_num;j++){
									var obj = clone[j];
									param[obj.name] = obj.element;
									dl.appendChild(obj.element);
								}

								// レスポンスダイアログを登録
								attachBbsResponseDialog(response_name,param,response_dialog,"name");
							}

							i += 1;
							if(i < num){
								execute_queue.attachFirst(f,null);
							}else{
								callback({result:true});
							}
						}
						execute_queue.attachFirst(f,null);
					};

					return null;
				});
			}

			// -
			// ホスト
			// -
			function forHost(target){
				if(BbsControlHostExist(target))	return;

				// -
				// BbsControlHost を生成
				// -
				(function(){
					var p;
					var n;
					var q;
					var ignore_dictionary = {"B":1,"SCRIPT":1};
					var queue = new Object();
					q = {p:queue,n:queue,node:target};
					queue.p = q;
					queue.n = q;

					while(queue.n != queue){
						q = queue.n;
						p = q.p;
						n = q.n;
						p.n = n;
						n.p = p;
						var node = q.node;
						switch(node.nodeType){
						case 1:
							if(!(ignore_dictionary[node.tagName])){
								var i;
								var nodes = node.childNodes;
								var num = nodes.length;
								for(i=0;i<num;i++){
									n = queue;
									p = n.p;
									q = {p:p,n:n,node:nodes[i]};
									p.n = q;
									n.p = q;
								}
							}
							break;
						case 3:
							while(node){
								var text_value = DomNodeGetNodeValue(node);

								var m = text_value.match(new RegExp("(^|HOST:)([-._a-zA-Z0-9]{1,}(\\.[-._a-zA-Z0-9]{1,}){2,})","i"));
								if(m){
									// 元のテキストノード
									DomNodeSetNodeValue(node,RegExp.leftContext + m[1]);

									// BbsControlHost を生成
									var control_host = new BbsControlHost(null,false);
									control_host.setHost(m[2]);
									var element_host = control_host.getElement();
									ElementSetTextContent(element_host,m[2]);
									DomNode_InsertAfter(node,element_host);

									// 直後テキスト
									node = DocumentCreateText(RegExp.rightContext);
									DomNode_InsertAfter(element_host,node);
									continue;
								}

								var m = text_value.match(new RegExp("(\\[ )([-._a-zA-Z0-9]{1,}(\\.[-._a-zA-Z0-9]{1,}){2,})((|\\n) \\])","i"));
								if(m){
									// 元のテキストノード
									DomNodeSetNodeValue(node,RegExp.leftContext + m[1]);

									// BbsControlHost を生成
									var control_host = new BbsControlHost(null,false);
									control_host.setHost(m[2]);
									var element_host = control_host.getElement();
									ElementSetTextContent(element_host,m[2]);
									DomNode_InsertAfter(node,element_host);

									// 直後テキスト
									node = DocumentCreateText("\n ]" + RegExp.rightContext);
									DomNode_InsertAfter(element_host,node);
									continue;
								}

								var m = text_value.match(new RegExp("(発信元:)([0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3})","i"));
								if(m){
									// 元のテキストノード
									DomNodeSetNodeValue(node,RegExp.leftContext + m[1]);

									// BbsControlHost を生成
									var control_host = new BbsControlHost(null,false);
									control_host.setHost(m[2]);
									var element_host = control_host.getElement();
									ElementSetTextContent(element_host,m[2]);
									DomNode_InsertAfter(node,element_host);

									// 直後テキスト
									node = DocumentCreateText(RegExp.rightContext);
									DomNode_InsertAfter(element_host,node);
									continue;
								}

								break;
							}

							break;
						}
					}
				})();

				// -
				// BbsControlHost を検索
				// -
				BbsControlHostSearch(target,function(control_host){

					control_host.setResponse(response);

					var host = control_host.getHost();
					var myself = (response.getHost() === host);
					var element_host = control_host.getElement();
					var textnode_host = DocumentCreateText("");


					// -
					// 変化があったときに実行されるイベント
					// -
					control_host.onchange = function(count){
						if(count > 1){
							DomNodeSetNodeValue(textnode_host,"(" + count + ")");
						}else{
							DomNodeSetNodeValue(textnode_host,"");
						}

						var style = element_host.style;
						if(count >= 5){
							StyleDeclarationSetProperty(style,"color","#e80000");
							StyleDeclarationRemoveProperty(style,"font-size");
						}else if(count >= 2){
							StyleDeclarationRemoveProperty(style,"color");
							StyleDeclarationRemoveProperty(style,"font-size");
						}else{
							StyleDeclarationSetProperty(style,"color","#888");
							StyleDeclarationSetProperty(style,"font-size","80%");
						}
					};
					control_host.update();
					element_host.appendChild(textnode_host);

					// -
					// ポップアップ化
					// -
					if(type == "host"){
						if(myself) return null;
					}

					// ダイアログを作成
					var response_dialog = new BbsResponseDialog();
					if(parent_dialog)	parent_dialog.attachChild(response_dialog);
					response_dialog.setElementParent(node.parent);
					response_dialog.setElementHitArea(element_host);
					response_dialog.oncreate = function(_window,callback){

						var dl = DocumentCreateElement("dl");
						dl.style.margin = "0px";
						_window.appendChild(dl);

						var responses = bbs_dictionary.getResponsesFromHost(host);
						var i = 0;
						var num = responses.length;
						if(myself){
							if(num < 2) return false;
						}else{
							if(num < 1) return false;
						}

						function f(){
							var response_host = responses[i];
							var clone = response_host.getCloneElements();

							var j;
							var clone_num = clone.length;
							if(clone_num){

								var param = new Object();
								param.parent = node.parent;
								for(j=0;j<clone_num;j++){
									var obj = clone[j];
									param[obj.name] = obj.element;
									dl.appendChild(obj.element);
								}

								// レスポンスダイアログを登録
								attachBbsResponseDialog(response_host,param,response_dialog,"host");
							}

							i += 1;
							if(i < num){
								execute_queue.attachFirst(f,null);
							}else{
								callback({result:true});
							}
						}
						execute_queue.attachFirst(f,null);
					};

					return null;
				});
			}

			// -
			// フォロワー
			// -
			function forFollower(target){
				if(BbsControlFollowerExist(target))	return;

				// -
				// BbsControlFollower を生成
				// -
				var control_follower = new BbsControlFollower(null,true);
				control_follower.setResponse(response);

				var element_follower = control_follower.getElement();
				var textnode_follower = DocumentCreateText("");

				element_follower.appendChild(textnode_follower);

				// -
				// 変化があったときに実行されるイベント
				// -
				control_follower.onchange = function(count){
					if(count){
						textnode_follower.nodeValue = " follower(" + count + ")";
					}else{
						textnode_follower.nodeValue = "";
					}

					var style = element_follower.style;
					if(count >= 3){
						StyleDeclarationSetProperty(style,"color","#e80000");
						StyleDeclarationRemoveProperty(style,"font-size");

					}else{
						StyleDeclarationSetProperty(style,"color","#888");
						StyleDeclarationSetProperty(style,"font-size","small");
					}
					if(count){
						StyleDeclarationSetProperty(style,"margin","0px 4px 0px 0px");
					}else{
						StyleDeclarationRemoveProperty(style,"margin");
					}
				};
				control_follower.update();
				var nodes = ElementGetElementsByTagName(target,"br");
				if(nodes.length){
					DomNode_InsertBefore(nodes[0],element_follower);
				}else{
					target.appendChild(element_follower);
				}

				// -
				// ポップアップ化
				// -
				// ダイアログを作成
				var response_dialog = new BbsResponseDialog();
				if(parent_dialog)	parent_dialog.attachChild(response_dialog);
				response_dialog.setElementParent(node.parent);
				response_dialog.setElementHitArea(element_follower);
				response_dialog.oncreate = function(_window,callback){

					var dl = DocumentCreateElement("dl");
					dl.style.margin = "0px";
					_window.appendChild(dl);

					var ary = response.getFollower();
					var i = 0;
					var num = ary.length;
					if(num <= 0) return false;

					function f(){
						var follower = bbs_dictionary.getResponse(ary[i].getNumber());
						var clone = follower.getCloneElements();

						var j;
						var clone_num = clone.length;
						if(clone_num){

							var param = new Object();
							param.parent = node.parent;
							for(j=0;j<clone_num;j++){
								var obj = clone[j];
								param[obj.name] = obj.element;
								dl.appendChild(obj.element);
							}

							// レスポンスダイアログを登録
							attachBbsResponseDialog(follower,param,response_dialog,"response");
						}

						i += 1;
						if(i < num){
							execute_queue.attachFirst(f,null);
						}else{
							callback({result:true});
						}
					}
					execute_queue.attachFirst(f,null);
				};
			}

			// -
			// 返信
			// -
			function forReply(target){
				if(BbsControlReplyExist(target))	return;

				// -
				// BbsControlReply を生成
				// -
				(function(){
					var node;
					switch(work.bbs_name){
					case "shitaraba":
						node = DomNodeGetFirstElementChild(target);
						break;
					default:
						node = target.firstChild;
						break;
					}
					if(!node) return;

					switch(node.nodeType){
					case 1:
						// 本文
						var m = ElementGetTextContent(node).match(new RegExp("^[0-9]+$","i"));
						if(!m)	return;

						// BbsControlReply を生成
						var control_reply = new BbsControlReply(node,true);
						break;
					case 3:
						// 本文
						var m = DomNodeGetNodeValue(node).match(new RegExp("^[0-9]+","i"));
						if(!m)	return;
	
						// 元のテキストノード
						DomNodeSetNodeValue(node,RegExp.leftContext);
	
						// BbsControlReply を生成
						var control_reply = new BbsControlReply(null,false);
						var element_reply = control_reply.getElement();
						ElementSetTextContent(element_reply,m[0]);
						DomNode_InsertAfter(node,element_reply);
	
						// 直後テキスト
						node = DocumentCreateText(RegExp.rightContext);
						DomNode_InsertAfter(element_reply,node);					
						break;
					}
				})();

				// -
				// BbsControlReply を検索
				// -
				BbsControlReplySearch(target,function(control_reply){

					control_reply.setResponse(response);
					var element_reply = control_reply.getElement();
					var docking_form = work.docking_form;
					var textarea = work.form_textarea;

					// -
					// クリックされたときに実行されるイベント
					// -
					control_reply.onclick = function(e){
						docking_form.popupForReply(element_reply);
						var text = textarea.value;
						var num = text.length;
						var selection_end = textarea.selectionEnd;
						var insert_str;
						if(selection_end >= num){
							insert_str = ">>" + (response.getNumber()) + "\n";
						}else{
							insert_str = ">>" + (response.getNumber());
						}
						textarea.value = text.slice(0,selection_end) + insert_str + text.slice(selection_end);
						textarea.selectionEnd = selection_end + insert_str.length;
						textarea.focus();
					};

					return null;
				});
			}

			if(node.dt){
				forResponseAnchor(node.dt);
				forId(node.dt);
				forName(node.dt);
				forHost(node.dt);
				forFollower(node.dt);
				forReply(node.dt);
			}
			if(node.dd){
				forResponseAnchor(node.dd);
				forId(node.dd);
				forName(node.dd);
			}
		}

		// -
		// エレメントを解析
		// -
		var useful = (function(){
			var dt = element;
			var dd;

			try{
				if(dt.tagName != "DT")	return false;
			}catch(e){
				return false;
			}

			dd = DomNodeGetNextElementSibling(dt);
			try{
				if(dd.tagName != "DD")	return false;
			}catch(e){
				return false;
			}

			try{
				var dl = dt.parentNode;
				if(dl.tagName != "DL")	return false;

				switch(work.bbs_name){
				case "2ch":
				case "pink":
					break;
				case "shitaraba":
				case "machi":
					if(dl.parentNode.parentNode != document.body)	return false;
					break;
				default:
					if(dl.parentNode != document.body)	return false;
					break;
				}
			}catch(e){
				return false;
			}

			// document に未登録
			if(!DomNodeGetAttachedDocument(dt))	return false;

			// -
			// レスアンカー拡張
			// -
			work.extendResponseAnchor(dd);

			// -
			// クリーンアップ
			// -
			(function(){
				function cleanup(target){
					BbsControlSearchTrash(target,function(element){
						var node = element.firstChild;
						if(!node)	return null;
						if(node.nodeType != 3)	return null;

						// ID
						var m = node.nodeValue.match(new RegExp("^ID:([-a-zA-Z0-9+/.●!=]{8,})","i"));
						if(m){
							// 直後テキスト
							var node = DocumentCreateText(m[0]);
							DomNode_InsertAfter(element,node);
							DomNodeRemove(element);
							return null;
						}

						// トリップ
						var m = node.nodeValue.match(new RegExp("^(◆[a-zA-Z0-9+/.]{10,12})","i"));
						if(m){
							// 直後テキスト
							var node = DocumentCreateText(m[0]);
							DomNode_InsertAfter(element,node);
							DomNodeRemove(element);
							return null;
						}

						// ホスト名
						var m = node.nodeValue.match(new RegExp("^([-._a-zA-Z0-9]{1,}(\\.[-._a-zA-Z0-9]{1,}){2,})","i"));
						if(m){
							// 直後テキスト
							var node = DocumentCreateText(m[0]);
							DomNode_InsertAfter(element,node);
							DomNodeRemove(element);

							// テキストノードを統合
							node.parentNode.normalize();
							return null;
						}
						var m = node.nodeValue.match(new RegExp("^([0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3})","i"));
						if(m){
							// 直後テキスト
							var node = DocumentCreateText(m[0]);
							DomNode_InsertAfter(element,node);
							DomNodeRemove(element);

							// テキストノードを統合
							node.parentNode.normalize();
							return null;
						}

						return null;
					});
				}

				if(dt){
					cleanup(dt);
				}
				if(dd){
					cleanup(dd);
				}
			})();

			(function(){
				switch(work.bbs_name){
				case "2ch.sc":
					var node_list = ElementGetElementsByClassName(dt,"id");
					var i;
					var num = node_list.length;
					for(i=num-1;i>=0;i--){
						var node = node_list[i];
						var text = DocumentCreateText(ElementGetTextContent(node));
						DomNode_InsertAfter(node,text);
						DomNodeRemove(node);
					}
					var node_list = ElementGetElementsByClassName(dt,"idNum");
					var i;
					var num = node_list.length;
					for(i=num-1;i>=0;i--){
						DomNodeRemove(node_list[i]);
					}
					
					var node = dt.firstChild;
					if(node.tagName == "SPAN"){
						var str = ElementGetTextContent(node);
						if(str.match(new RegExp("^([0-9]+)","i"))){
							var text = DocumentCreateText(str);
							DomNode_InsertAfter(node,text);
							DomNodeRemove(node);				
						}
					}
					break;
				}
			})();

			// ナンバーを取得
			var dt_text = ElementGetTextContent(dt);
			if(!(dt_text.match(new RegExp("^[ \t\r\n]*([0-9]+)","i"))))	return false;

			// ナンバーからレスポンスオブジェクトを取得
			var response = bbs_dictionary.getResponse(parseInt(RegExp.$1));

			// レスポンス解析
			if(!response.getAnalyzed()){

				// IDの取得
				if(dt_text.match(new RegExp("ID:([-a-zA-Z0-9+/.●!=]{8,})","i"))){
					response.setId(RegExp.$1);
				}

				// 名前の取得
				if(dt_text.match(new RegExp("(◆[a-zA-Z0-9+/.]{10,12})","i"))){
					response.setName(RegExp.$1);
				}

				// ホスト名の取得
				(function(){
					var p;
					var n;
					var q;
					var ignore_dictionary = {"B":1,"SCRIPT":1};
					var queue = new Object();
					q = {p:queue,n:queue,node:dt};
					queue.p = q;
					queue.n = q;

					while(queue.n != queue){
						q = queue.n;
						p = q.p;
						n = q.n;
						p.n = n;
						n.p = p;
						var node = q.node;
						switch(node.nodeType){
						case 1:
							if(!(ignore_dictionary[node.tagName])){
								var i;
								var nodes = node.childNodes;
								var num = nodes.length;
								for(i=0;i<num;i++){
									n = queue;
									p = n.p;
									q = {p:p,n:n,node:nodes[i]};
									p.n = q;
									n.p = q;
								}
							}
							break;
						case 3:
							var m = DomNodeGetNodeValue(node).match(new RegExp("(^|HOST:)([-._a-zA-Z0-9]{1,}(\\.[-._a-zA-Z0-9]{1,}){2,})","i"));
							if(m){
								response.setHost(m[2]);
								return;
							}
							var m = DomNodeGetNodeValue(node).match(new RegExp("(\\[ )([-._a-zA-Z0-9]{1,}(\\.[-._a-zA-Z0-9]{1,}){2,})(|\\n) \\]","i"));
							if(m){
								response.setHost(m[2]);
								return;
							}
							var m = DomNodeGetNodeValue(node).match(new RegExp("(発信元:)([0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3})","i"));
							if(m){
								response.setHost(m[2]);
								return;
							}
							break;
						}
					}
				})();

				// フォロー解析
				var dictionary = new Object();
				(function(){
					var nodes;
					switch(work.bbs_name){
					case "2ch.sc":
						nodes = ElementGetElementsByTagName(dd,"span");
						break;
					default:
						nodes = ElementGetElementsByTagName(dd,"a");
						break;
					}
					var i;
					var num = nodes.length;
					for(i=0;i<num;i++){
						var numbers = work.createResponseAnchorNumbers(ElementGetTextContent(nodes[i]));
						numbers.getNumbers(function(n){
							if(!dictionary[n]){
								var following = bbs_dictionary.getResponse(n);
								following.addFollower(response);
								dictionary[n] = true;
							}
						});
					}
				})();

				// オリジナルエレメントをセット
				if(dt)	response.addOriginalElements("dt",dt);
				if(dd)	response.addOriginalElements("dd",dd);

				// 消去時に実行されるイベント
				response.onerase = function(){
					var original = response.getOriginalElements();

					// オリジナルエレメントを外す
					var i;
					var num = original.length;
					for(i=0;i<num;i++){
						var revise_scroll = new DocumentReviseScroll();
						var node = original[i].element;
						revise_scroll.executeRemoveElementBefore(node);
						DomNodeRemove(node);
						revise_scroll.executeRemoveElementAfter(node);
					}
				};

				response.setAnalyzed();
			}
			
			var dl = document.body;
			var node = dt;
			while(node){
				if(node.tagName == "DL"){
					dl = node;
				}
				node = node.parentNode;
			}

			// レスポンスダイアログを登録(ルート)
			attachBbsResponseDialog(
				response,
				{
					dt:dt,
					dd:dd,
					parent:dl
				},
				null,
				null
			);

			return true;
		})();

		response({useful:useful});
		return true;
	}

			]);

			// -
			// 掲示板設定「デフォルト」
			// -
			attachItem( "ExpandBbs_ScriptInitialize_Default" , [

	function(info,response){

		// -
		// 第01引数 Object 型
		// work:Object 型(自由に書き込み可能)
		// -
		var work = info.work;

		// -
		// 第02引数 function
		// 引数:Object 型
		// result:Boolean 型(true で許可、false で拒否)
		// 必ず1度実行する必要がある。非同期実行可能。
		// -
		response({result:false});

		// -
		// 戻り値 Boolean 型
		// true :関数の実行を完了
		// false:次の関数を実行
		// -
		return true;
	}

			]);

			// -
			// 掲示板設定「デフォルト」
			// -
			attachItem( "ExpandBbs_ScriptCallback_Default" , [

	function(info,response){

		// -
		// 第01引数 Object 型
		// element:Element オブジェクト
		// work:Object 型(自由に書き込み可能)
		// -
		var element = info.element;
		var work = info.work;

		// -
		// 第02引数 function
		// 引数:Object 型
		// useful:Boolean 型(エレメントが有用であった場合に true を指定)
		// 処理が完了したタイミングで必ず1度実行する必要がある。非同期実行可能。
		// -
		response({useful:false});

		// -
		// 戻り値 Boolean 型
		// true :関数の実行を完了
		// false:次の関数を実行
		// -
		return true;
	}

			]);

		})();
	}



	// -
	// PageExpand デバッグ
	// -
	function PageExpandDebug(){
		var _this = this;

		// -
		// 解放
		// -
		_this.release = function (){
			if(_analyze_work){
				// 解析辞書除外
				analyze_work_dictionary.removeAnalyzeWork(_analyze_work);
				_analyze_work = null;
			}

			// リムーブ監視を破棄
			if(_observer_remove){
				_observer_remove.release();
				_observer_remove = null;
			}

			// タスク解放
			if(_task){
				_task.release();
				_task = null;
			}

			// ウィンドウ破棄
			if(_window){
				DomNodeRemove(_window);
				_window = null;
			}
		};

		// -
		// 要素生成
		// -
		function createElement(){
			// 解放
			_this.release();

			// ウィンドウ
			var style;
			var container = DocumentCreateElement("div");
			ElementSetStyle(container,"width:220px;border:3px #888 outset; padding:0px; margin:0px; right:5px; bottom:5px; position:fixed; text-align:left; color:#000; font-size:12px; line-height:1.0; z-index:2147483647;");
			_window = container;

			// 解析ワーク作成
			_analyze_work = AnalyzeWorkCreate(_window);

			// 解析無効化
			AnalyzeWorkSetInvalid(_analyze_work);

			// 解析辞書登録オプション
			var attach_options = new AnalyzeWorkDictionaryAttachOptions();
			attach_options.SetOutsider();

			// 解析辞書登録
			analyze_work_dictionary.attachAnalyzeWork(_analyze_work,attach_options);

			// リムーブ監視
			_observer_remove = new DomNodeObserverRemoveFromDocument(_window);
			_observer_remove.setFunction(_this.release);

			var background = DocumentCreateElement("div");
			ElementSetStyle(background,"background-color:#FFF; line-height:1.0; border:1px #ccc solid; padding:0px; margin:0px; opacity:0.8;");
			container.appendChild(background);

			// PageExpandDebug
			var debug_msg = DocumentCreateElement("div");
			ElementSetStyle(debug_msg,"font-weight:bold; text-align:left; color:#000; line-height:1.0; background-color:#ccc; padding:2px 5px; margin:0px 0px 2px; position:relative;");
			ElementSetTextContent(debug_msg,"PageExpand Debug");
			background.appendChild(debug_msg);

			// 閉じるボタン
			var close_msg = DocumentCreateElement("div");
			ElementSetStyle(close_msg,"width:12px; position:absolute; right:1px; top:1px; bottom:1px; border:1px #888 solid; background:#ddd; line-height:1.0;");
			ElementSetTextContent(close_msg,"");
			debug_msg.appendChild(close_msg);
			close_msg.onclick = function(){
				_this.release();
			};

			var element;
			var css_text_msg = "text-align:left; color:#000; font-size:12px; line-height:1.0;";

			// 実行キュー数
			element = DocumentCreateElement("div");
			ElementSetStyle(element,"margin:0px 5px 0px; " + css_text_msg);
			background.appendChild(element);
			var execute_queue_msg = new UI_Text(element);

			// 実行フェーズ
			element = DocumentCreateElement("div");
			ElementSetStyle(element,"margin:0px 5px 0px; " + css_text_msg);
			background.appendChild(element);
			var execute_queue_phase_msg = new UI_Text(element);

			// 実行キューエラー数
			element = DocumentCreateElement("div");
			ElementSetStyle(element,"margin:0px 5px 0px; " + css_text_msg);
			background.appendChild(element);
			var execute_queue_error_msg = new UI_Text(element);

			// ローダーキュー数
			element = DocumentCreateElement("div");
			ElementSetStyle(element,"margin:0px 5px 0px; " + css_text_msg);
			background.appendChild(element);
			var loader_queue_msg = new UI_Text(element);

			// ローダーキューエラー数
			element = DocumentCreateElement("div");
			ElementSetStyle(element,"margin:0px 5px 2px; " + css_text_msg);
			background.appendChild(element);
			var loader_queue_error_msg = new UI_Text(element);

			// ローダースレッド数
			element = DocumentCreateElement("div");
			ElementSetStyle(element,"margin:0px 5px 1px; " + css_text_msg);
			background.appendChild(element);
			var loader_thread_msg = new UI_Text(element);

			// ローダースレッドメーター
			var loader_thread_meter = new UI_ProgressBar(background);

			// タスク数
			element = DocumentCreateElement("div");
			ElementSetStyle(element,"margin:0px 5px 2px; " + css_text_msg);
			background.appendChild(element);
			var task_count_msg = new UI_Text(element);

			// イメージ数
			element = DocumentCreateElement("div");
			ElementSetStyle(element,"margin:0px 5px 2px; " + css_text_msg);
			background.appendChild(element);
			var image_count_msg = new UI_Text(element);

			// イメージスレッド数
			element = DocumentCreateElement("div");
			ElementSetStyle(element,"margin:0px 5px 1px; " + css_text_msg);
			background.appendChild(element);
			var image_thread_msg = new UI_Text(element);

			// イメージスレッドメーター
			var image_thread_meter = new UI_ProgressBar(background);

			// サウンド数
			element = DocumentCreateElement("div");
			ElementSetStyle(element,"margin:0px 5px 2px; " + css_text_msg);
			background.appendChild(element);
			var sound_count_msg = new UI_Text(element);

			// サウンドスレッド数
			element = DocumentCreateElement("div");
			ElementSetStyle(element,"margin:0px 5px 1px; " + css_text_msg);
			background.appendChild(element);
			var sound_thread_msg = new UI_Text(element);

			// サウンドスレッドメーター
			var sound_thread_meter = new UI_ProgressBar(background);

			// ビデオ数
			element = DocumentCreateElement("div");
			ElementSetStyle(element,"margin:0px 5px 2px; " + css_text_msg);
			background.appendChild(element);
			var video_count_msg = new UI_Text(element);

			// ビデオスレッド数
			element = DocumentCreateElement("div");
			ElementSetStyle(element,"margin:0px 5px 1px; " + css_text_msg);
			background.appendChild(element);
			var video_thread_msg = new UI_Text(element);

			// ビデオスレッドメーター
			var video_thread_meter = new UI_ProgressBar(background);

			// ダウンローダーキュー数
			element = DocumentCreateElement("div");
			ElementSetStyle(element,"margin:0px 5px 0px; " + css_text_msg);
			background.appendChild(element);
			var downloader_queue_msg = new UI_Text(element);

			// ダウンローダーキューエラー数
			element = DocumentCreateElement("div");
			ElementSetStyle(element,"margin:0px 5px 2px; " + css_text_msg);
			background.appendChild(element);
			var downloader_queue_error_msg = new UI_Text(element);

			// ダウンローダースレッド数
			element = DocumentCreateElement("div");
			ElementSetStyle(element,"margin:0px 5px 1px; " + css_text_msg);
			background.appendChild(element);
			var downloader_thread_msg = new UI_Text(element);

			// ダウンローダースレッドメーター
			var downloader_thread_meter = new UI_ProgressBar(background);

			// リムーブ監視数
			element = DocumentCreateElement("div");
			ElementSetStyle(element,"margin:0px 5px 2px; " + css_text_msg);
			background.appendChild(element);
			var observer_remove_msg = new UI_Text(element);

			// 変更監視数
			element = DocumentCreateElement("div");
			ElementSetStyle(element,"margin:0px 5px 2px; " + css_text_msg);
			background.appendChild(element);
			var observer_modify_msg = new UI_Text(element);

			// スクロール監視数
			element = DocumentCreateElement("div");
			ElementSetStyle(element,"margin:0px 5px 2px; " + css_text_msg);
			background.appendChild(element);
			var observer_scroll_msg = new UI_Text(element);

			// アドレス数
			element = DocumentCreateElement("div");
			ElementSetStyle(element,"margin:0px 5px 2px; " + css_text_msg);
			background.appendChild(element);
			var address_count_msg = new UI_Text(element);

			var execute_queue_phase_msg_list = [
				"interrupt",
				"remove",
				"insert",
				"bbs",
				"analyze",
				"element",
				"text",
				"complete",
				""
			]

			// タスク実行
			_task = task_container.createTask();
			_task.setExecuteFunc(function(task){

				// 表示更新
				execute_queue_msg.setText("execute queue: " + execute_queue.getCountQueue());
				execute_queue_phase_msg.setText("execute phase: " + execute_queue_phase_msg_list[execute_queue.getPhase()]);
				execute_queue_error_msg.setText("execute error: " + execute_queue.getCountError());

				loader_queue_msg.setText("loader queue: " + loader_queue.getCountQueue());
				loader_queue_error_msg.setText("loader error: " + loader_queue.getCountError());
				loader_thread_msg.setText("loader thread: " + loader_queue.getCountThread() + " / " + loader_queue.getMaxThread());
				loader_thread_meter.setValue(loader_queue.getCountThread());
				loader_thread_meter.setMaximum(loader_queue.getMaxThread());

				task_count_msg.setText("task count: " + task_container.getCountTask());

				var use_size = Math.floor(element_limitter_image.getByteSizeNow() / 1024 / 1024 * 100) / 100;
				image_count_msg.setText("image size: " + use_size);
				image_thread_msg.setText("image thread: " + element_limitter_image.getCountUse() + " / " + element_limitter_image.getCount());
				image_thread_meter.setValue(element_limitter_image.getCountUse());
				image_thread_meter.setMaximum(element_limitter_image.getCount());

				sound_count_msg.setText("sound count: " + element_limitter_sound.getCount());
				sound_thread_msg.setText("sound thread: " + element_limitter_sound.getCountUse() + " / " + element_limitter_sound.getMaxUse());
				sound_thread_meter.setValue(element_limitter_sound.getCountUse());
				sound_thread_meter.setMaximum(element_limitter_sound.getMaxUse());

				video_count_msg.setText("video count: " + element_limitter_video.getCount());
				video_thread_msg.setText("video thread: " + element_limitter_video.getCountUse() + " / " + element_limitter_video.getMaxUse());
				video_thread_meter.setValue(element_limitter_video.getCountUse());
				video_thread_meter.setMaximum(element_limitter_video.getMaxUse());

				downloader_queue_msg.setText("download queue: " + downloader_queue.getCountQueue());
				downloader_queue_error_msg.setText("download error: " + downloader_queue.getCountError());
				downloader_thread_msg.setText("download thread: " + downloader_queue.getCountThread() + " / " + downloader_queue.getMaxThread());
				downloader_thread_meter.setValue(downloader_queue.getCountThread());
				downloader_thread_meter.setMaximum(downloader_queue.getMaxThread());

				observer_remove_msg.setText("observer remove: " + document_observer_remove_node.getCount());
				observer_modify_msg.setText("observer modify: " + document_observer_modify_node.getCount());
				observer_scroll_msg.setText("observer scroll: " + document_observer_scroll.getCount());
				address_count_msg.setText("src count: " + address_collection.getCountAddress());
			});

			_task.execute(0xffffffff);

			document.body.appendChild(_window);
		}

		// -
		// 表示をセット
		// -
		_this.setVisible = function (type){
			_visible = type;
			if(_visible){
				// フレーム内では動作させない
				if (WindowIsChild(window)){
				}else{
					createElement();
				}
			}else{
				_this.release();
			}
		};

		// -
		// テキスト(内部用)
		// -
		function UI_Text(parent){
			var _this = this;

			// -
			// テキストをセット
			// -
			_this.setText = function(value){
				if(_text != value){
					_text = value;
					DomNodeSetNodeValue(_node,_text);
				}
			};

			// -
			// プライベート変数
			// -
			var _node;
			var _text;

			// -
			// 初期化
			// -
			(function(){
				_node = DocumentCreateText("");
				parent.appendChild(_node);
			})();
		}

		// -
		// ブログレスバー(内部用)
		// -
		function UI_ProgressBar(parent){
			var _this = this;

			// -
			// 値をセット
			// -
			_this.setValue = function(value){
				if(_now != value){
					_now = value;
					update();
				}
			};

			// -
			// 最大値をセット
			// -
			_this.setMaximum = function(value){
				if(_max != value){
					_max = value;
					update();
				}
			};

			// -
			// 更新(内部用)
			// -
			function update(){
				var percent = 0;
				if(_max){
					percent = Math.floor(_now / _max * 100);
				}
				_bar.style.width = percent + "%";
			}

			// -
			// プライベート変数
			// -
			var _mater;
			var _bar;
			var _now;
			var _max;

			// -
			// 初期化
			// -
			(function(){
				_now = 0;
				_max = 0;

				_mater = DocumentCreateElement("div");
				ElementSetStyle(_mater,"height:2px; min-height:0; border:1px #888 solid; margin:0px 5px 2px; line-height:1.0;");
				parent.appendChild(_mater);

				_bar = DocumentCreateElement("div");
				ElementSetStyle(_bar,"height:2px; min-height:0; background-color :#888; margin:0px 0px 2px; width:0%; line-height:1.0;");
				_mater.appendChild(_bar);
			})();
		}

		// -
		// プライベート変数
		// -
		var _window;
		var _task;
		var _analyze_work;
		var _observer_remove;
		var _visible;

		// -
		// 初期化
		// -
		(function(){
			_visible = false;
		})();
	}







	// -
	// PageExpand コンフィグ
	// -
	function PageExpandConfig(){

		var _config = new Object();

		// -
		// メニューアイテム
		// -
		function MenuItemCreate(label,id){
			var _this = this;

			// -
			// 通常状態
			// -
			_this.normal = function(){
				_item.onmouseout = _this.normal;
				_item.onmouseover = _this.over;
				_item.onmousedown = click;
				_style.fontSize = "12px";
				_style.width = "230px";
				_style.boxShadow = "";
				_style.padding = "5px 10px 5px 0px";
				_style.marginTop = "0px";
				_style.marginBottom = "1px";

				_brightness = 0.75;
				updateBackgroundColor();
			};

			// -
			// マウスオーバー状態
			// -
			_this.over = function(){
				_this.normal();
				_style.width = "240px";

				_brightness = 0.9375;
				updateBackgroundColor();
			};

			// -
			// 選択状態
			// -
			_this.active = function(){
				_item.onmouseover = null;
				_item.onmouseout = null;
				_item.onmousedown = null;
				_style.fontSize = "16px";
				_style.width = "250px";
				_style.padding = "14px 5px 14px 0px";
				_style.marginTop = "2px";
				_style.marginBottom = "3px";

				var brightness = 0.25;
				var r = (_color >> 16) & 0xFF;
				var g = (_color >>  8) & 0xFF;
				var b = (_color >>  0) & 0xFF;
				r = Math.floor(r * brightness);
				g = Math.floor(g * brightness);
				b = Math.floor(b * brightness);
				_style.boxShadow = "0px 1px 2px #" + r.toString(16) + g.toString(16) + b.toString(16);

				var brightness = 1.0;
				var r = (_color >> 16) & 0xFF;
				var g = (_color >>  8) & 0xFF;
				var b = (_color >>  0) & 0xFF;
				r = Math.floor(r * brightness);
				g = Math.floor(g * brightness);
				b = Math.floor(b * brightness);
				var liner_gradient = "linear-gradient(left, #" + r.toString(16) + g.toString(16) + b.toString(16) + " 25px, #ffffff 25px)";
				_style.background = "#FFF";
				_style.backgroundImage = liner_gradient;
				var none = {"none":1,"initial":1};
				if(none[_style.backgroundImage]) _style.backgroundImage = "-webkit-" + liner_gradient;
				if(none[_style.backgroundImage]) _style.backgroundImage = "-moz-" + liner_gradient;
				if(none[_style.backgroundImage]) _style.backgroundImage = "-ms-" + liner_gradient;
				if(none[_style.backgroundImage]) _style.backgroundImage = "-o-" + liner_gradient;

				_brightness = 1.0;
			};

			// -
			// サポート状態をセット
			// -
			_this.setSupport = function(type){
				if(type)	_item.style.color = "#000";
				else		_item.style.color = "#888";
			};

			// -
			// 背景カラーをセット
			// -
			_this.setBackgroundColor = function(argb){
				_color = argb;
				updateBackgroundColor();
			};

			// -
			// 背景カラー更新
			// -
			function updateBackgroundColor(){
				var r = (_color >> 16) & 0xFF;
				var g = (_color >>  8) & 0xFF;
				var b = (_color >>  0) & 0xFF;
				r = Math.floor(r * _brightness);
				g = Math.floor(g * _brightness);
				b = Math.floor(b * _brightness);
				_style.background = "#" + r.toString(16) + g.toString(16) + b.toString(16);
			}

			// -
			// クリック時のイベント
			// -
			function click(){
				_config.pushHistory(id);
				_config.MenuItemSelect(id);
			}

			// -
			// プライベート変数
			// -
			var _item;
			var _style;
			var _color;
			var _brightness;

			// -
			// 初期化
			// -
			_item = DocumentCreateElement("a");
			_item.href = "";
			_item.onclick = function(){ return false; };
			ElementSetStyle(_item,"display:block; width:250px; text-decoration:none; text-align:right; margin:0px 0px 2px auto; line-height:1.0; border-radius:5px 0px 0px 5px;");
			_style = _item.style;
			ElementSetTextContent(_item,label);
			_menu_window.appendChild(_item);

			_color = 0xFFFFFFFF;
			_brightness = 1.0;
			updateBackgroundColor();
		}

		// -
		// 履歴を作成
		// -
		_config.pushHistory = function(id){

			// 履歴更新
			var index = _history_state.index;
			_history_state.scroll_pos = WindowGetScrollPosition(window);
			history.replaceState({ index:index , menu:_history_state.selected_menu }, "", "");

			// 履歴作成
			index += 1;
			_history_state_list[index] = _history_state = { index:index , selected_menu:id };
			history.pushState({ index:index , menu:id }, "", "");
		};

		// -
		// メニューアイテム選択
		// -
		_config.MenuItemSelect = function(id){
			var param = _menu_item_param[id];

			var i;
			var num = _menu_items.length;
			var item;
			for(i=0;i<num;i++){
				// すべて未選択
				item = _menu_items[i];
				item.normal();
			}

			item = _menu_items[id];
			item.active();

			ContentClear();
			_history_state.selected_menu = id;

			if(param.callback){
				return (new param.callback());
			}

			return null;
		};

		// -
		// コンテンツクリア
		// -
		function ContentClear(){
			// エレメントを全てクリア
			var child_nodes = _content_window.childNodes;
			var i;
			var num = child_nodes.length;
			for(i=num-1;i >= 0;i--){
			var node = child_nodes[i];
				DomNodeRemove(node);
			}
			WindowSetScrollPositionY (window,0);
		}

		// -
		// 基本設定
		// -
		function ContentSettingStandard(){
			var _this = this;

			// -
			// プライベート変数
			// -
			var _combo_box_filter_url;
			var _text_area_filter_url;
			var _check_box_enable_icon_address_bar;
			var _check_box_enable_context_menu;
			var _check_box_enable_startup;
			var _check_box_enable_debug_mode;
			var _check_box_enable_output_log;
			var _check_box_enable_input_touch;
			var _check_box_enable_double_touch_assist;
			var _stepper_execute_queue_time_occupancy;
			var _stepper_execute_queue_sleep_time;
			var _button_storage_sync_load;
			var _button_storage_sync_save;
			var _button_storage_sync_delete;
			var _button_export;
			var _button_import;
			var _button_reset;

			// -
			// 初期化
			// -
			(function(){
				var standard = page_expand_project.getObject().standard;

				// タイトル
				var title = new UI_Title(_content_window,_i18n.getMessage("menu_setting_standard"));

				// 動作を制限する
				var container = new UI_LineContainer(_content_window,_i18n.getMessage("menu_setting_standard_filter_url"));
				var parent = container.getElement();
				_combo_box_filter_url = new UI_ComboBox(parent);
				_combo_box_filter_url.attachItem(_i18n.getMessage("menu_setting_standard_filter_url_combo_box_item_deny"),"deny");
				_combo_box_filter_url.attachItem(_i18n.getMessage("menu_setting_standard_filter_url_combo_box_item_allow"),"allow");
				_combo_box_filter_url.onchange = function(v){
					standard.filter_type = v;
					filterTypeUpdate();
					projectModify();
				};
				_text_area_filter_url = new UI_TextArea(parent);
				_text_area_filter_url.oninput = function(v){
					var filter = _text_area_filter_url.spiritByLine();
					switch(standard.filter_type){
					case "deny":
						standard.filter_deny = filter;
						break;
					default:
						standard.filter_allow = filter;
						break;
					}
					projectModify();
				};
				new UI_TextHint(parent,_i18n.getMessage("menu_setting_standard_filter_url_hint"));

				// 基本設定
				var container = new UI_InlineContainer(_content_window,_i18n.getMessage("menu_setting_standard_check_box_container"));
				container.setWidth(400);
				var parent = container.getElement();

				// アドレスバーアイコンが有効であるか
				_check_box_enable_icon_address_bar = new UI_CheckBox(parent,_i18n.getMessage("menu_setting_standard_enable_icon_address_bar"));
				_check_box_enable_icon_address_bar.onchange = function(v){
					standard.enable_icon_address_bar = v;
					projectModify();
				};

				// コンテキストメニューが有効か
				_check_box_enable_context_menu = new UI_CheckBox(parent,_i18n.getMessage("menu_setting_standard_enable_context_menu"));
				_check_box_enable_context_menu.onchange = function(v){
					standard.enable_context_menu = v;
					projectModify();
				};

				// ロード完了時から動作を開始するか
				_check_box_enable_startup = new UI_CheckBox(parent,_i18n.getMessage("menu_setting_standard_enable_startup"));
				_check_box_enable_startup.onchange = function(v){
					standard.enable_startup = v;
					projectModify();
				};

				// デバッグモードが有効であるか
				_check_box_enable_debug_mode = new UI_CheckBox(parent,_i18n.getMessage("menu_setting_standard_enable_debug_mode"));
				_check_box_enable_debug_mode.onchange = function(v){
					standard.enable_debug_mode = v;
					projectModify();
				};

				// ログ出力が有効であるか
				_check_box_enable_output_log = new UI_CheckBox(parent,_i18n.getMessage("menu_setting_standard_enable_output_log"));
				_check_box_enable_output_log.onchange = function(v){
					standard.enable_output_log = v;
					projectModify();
				};

				// タッチ操作設定
				var container = new UI_InlineContainer(_content_window,_i18n.getMessage("menu_setting_standard_touch"));
				container.setWidth(400);
				var parent = container.getElement();

				// タッチ操作を有効
				_check_box_enable_input_touch = new UI_CheckBox(parent,_i18n.getMessage("menu_setting_standard_enable_input_touch"));
				_check_box_enable_input_touch.onchange = function(v){
					standard.enable_input_touch = v;
					projectModify();
				};

				// ダブルタッチ補助線を表示
				_check_box_enable_double_touch_assist = new UI_CheckBox(parent,_i18n.getMessage("menu_setting_standard_enable_double_touch_assist"));
				_check_box_enable_double_touch_assist.onchange = function(v){
					standard.enable_double_touch_assist = v;
					projectModify();
				};

				// 実行キュー設定
				var container = new UI_LineContainer(_content_window,_i18n.getMessage("menu_setting_standard_execute_queue"));
				var parent = container.getElement();

				// 最大CPU占有時間
				var parent = container.getElement();
				new UI_TitleItem(parent,_i18n.getMessage("menu_setting_standard_execute_queue_time_occupancy"));
				_stepper_execute_queue_time_occupancy = new UI_NumericStepper(parent);
				_stepper_execute_queue_time_occupancy.setMinimum(0);
				_stepper_execute_queue_time_occupancy.setMaximum(5000);
				_stepper_execute_queue_time_occupancy.oninput = function(v){
					standard.execute_queue.time_occupancy = v;
					projectModify();
				};
				new UI_BreakItem(parent);

				// スリープ時間
				new UI_TitleItem(parent,_i18n.getMessage("menu_setting_standard_execute_queue_time_sleep"));
				_stepper_execute_queue_sleep_time = new UI_NumericStepper(parent);
				_stepper_execute_queue_sleep_time.setMinimum(0);
				_stepper_execute_queue_sleep_time.setMaximum(1000);
				_stepper_execute_queue_sleep_time.oninput = function(v){
					standard.execute_queue.time_sleep = v;
					projectModify();
				};
				new UI_TextHint(parent,_i18n.getMessage("menu_setting_standard_execute_queue_hint"));


				// 設定のエクスポート / インポート
				var container = new UI_LineContainer(_content_window,_i18n.getMessage("menu_setting_standard_export_import"));
				var parent = container.getElement();

				// エクスポート
				_button_export = new UI_InlineButton(parent,_i18n.getMessage("menu_setting_standard_export_button"));
				_button_export.onclick = function(){

					// モーダルダイアログ作成
					var dialog = new UI_ModalDialog(_content_window);
					var dialog_parent = dialog.getElement();

					// タイトル
					var title = new UI_Title(dialog_parent,_i18n.getMessage("menu_setting_standard_export_dialog"));

					var container = new UI_LineContainer(dialog_parent,_i18n.getMessage("menu_setting_standard_export_dialog_export"));
					var parent = container.getElement();

					var text_area = new UI_TextArea(parent);

					new UI_TextHint(parent,_i18n.getMessage("menu_setting_standard_export_dialog_export_hint"));

					// Ok ボタン
					var yes_no_button = new UI_OkButton(dialog_parent);
					yes_no_button.setEnable(false);
					yes_no_button.onclick = function(v){
						// ダイアログ終了
						dialog.close();
					};

					projectSave(function(e){
						var export_obj = page_expand_project.exportObject();
						// プリセットを除去
						export_obj = PageExpandProjectObjectRemovePreset(export_obj);
						export_obj.setting_export = {
							type:"setting"
						};
						text_area.setValue(JsonStringify(export_obj));
						yes_no_button.setEnable(true);
					});

					// ダイアログ開始
					dialog.open();
				};

				// インポート
				_button_import = new UI_InlineButton(parent,_i18n.getMessage("menu_setting_standard_import_button"));
				_button_import.onclick = function(){

					// モーダルダイアログ作成
					var dialog = new UI_ModalDialog(_content_window);
					var dialog_parent = dialog.getElement();

					// タイトル
					var title = new UI_Title(dialog_parent,_i18n.getMessage("menu_setting_standard_import_dialog"));

					// 名前
					var container = new UI_LineContainer(dialog_parent,_i18n.getMessage("menu_setting_standard_import_dialog_explanation"));
					var parent = container.getElement();
					var unordered_list = new UI_UnorderedList(parent);
					unordered_list.addListItem(_i18n.getMessage("menu_setting_standard_import_dialog_explanation_0"));
					unordered_list.addListItem(_i18n.getMessage("menu_setting_standard_import_dialog_explanation_1"));
					unordered_list.addListItem(_i18n.getMessage("menu_setting_standard_import_dialog_explanation_2"));

					var container = new UI_LineContainer(dialog_parent,_i18n.getMessage("menu_setting_standard_import_dialog_import"));
					var parent = container.getElement();

					var text_area_import = new UI_TextArea(parent);

					new UI_TextHint(parent,_i18n.getMessage("menu_setting_standard_import_dialog_import_hint"));

					// 実行しますか?
					var container = new UI_LineContainer(dialog_parent,null);
					var parent = container.getElement();
					new UI_Text(parent,_i18n.getMessage("menu_setting_standard_import_dialog_confirm"));

					// Yes No ボタン
					var yes_no_button = new UI_YesNoButton(dialog_parent);
					yes_no_button.onclick = function(v){

						if(!v){
							// ダイアログ終了
							dialog.close();
							return;
						}

						function ImportFailure(message){
							// 結果を表示
							var alert_dialog = new UI_AlertDialog(dialog_parent,_i18n.getMessage("menu_setting_standard_import_alert"));
							new UI_Text(alert_dialog.getElement(),_i18n.getMessage("menu_setting_standard_import_alert_failure"));
							new UI_Text(alert_dialog.getElement(),message);
							alert_dialog.oncomplete = function(){
								// ダイアログ終了
								dialog.close();
							};
							alert_dialog.open();
						}

						try{
							var proj_obj = page_expand_project.getObject();
							var proj_new = new PageExpandProject();
							var import_obj = JsonParse(text_area_import.getValue());

							// バージョンが一致しない
							if(import_obj.version > proj_obj.version){
								throw "Error: It is a version not supported.";
							}

							// 出力タイプチェック
							var error = true;
							try{
								// v1.0.3 以前
								if(!(import_obj.setting_export)){
									error = false;
								}else{
									switch(import_obj.setting_export.type){
									case "setting":
										error = false;
										break;
									}
								}
							}catch(e){}

							if(error){
								throw "Error: It is a type not supported.";
							}

							delete import_obj.setting_export;

							// プリセットを付加
							import_obj = PageExpandProjectObjectAppendPreset(import_obj);

							proj_new.importObject(import_obj);
							page_expand_project = proj_new;
							projectSave(function(e){
								if(!e.result){
									ImportFailure(e.message);
									return;
								}

								text_area_import.setValue("");

								// 結果を表示
								var alert_dialog = new UI_AlertDialog(dialog_parent,_i18n.getMessage("menu_setting_standard_import_alert"));
								new UI_Text(alert_dialog.getElement(),_i18n.getMessage("menu_setting_standard_import_alert_success"));
								alert_dialog.oncomplete = function(){

									// フェードアウト完了後
									dialog.oncomplete = function(){

										// PageExpandConfig を再構築
										initialize();

										// 基本設定を選択
										_config.MenuItemSelect(PageExpandConfig.MENU_TYPE_SETTING_STANDARD);

									};

									// ダイアログ終了
									dialog.close();
								};
								alert_dialog.open();
							});

						}catch(e){
							ImportFailure(e);
						}
					};

					// ダイアログ開始
					dialog.open();
				};


				// 設定の初期化
				var container = new UI_LineContainer(_content_window,_i18n.getMessage("menu_setting_standard_reset"));
				var parent = container.getElement();
				_button_reset = new UI_LineButton(parent,_i18n.getMessage("menu_setting_standard_reset_button"));
				_button_reset.onclick = function(){
					// モーダルダイアログ作成
					var dialog = new UI_ModalDialog(_content_window);
					var dialog_parent = dialog.getElement();

					// タイトル
					var title = new UI_Title(dialog_parent,_i18n.getMessage("menu_setting_standard_reset_dialog"));

					// 名前
					var container = new UI_LineContainer(dialog_parent,_i18n.getMessage("menu_setting_standard_reset_dialog_explanation"));
					var parent = container.getElement();
					var unordered_list = new UI_UnorderedList(parent);
					unordered_list.addListItem(_i18n.getMessage("menu_setting_standard_reset_dialog_explanation_0"));
					unordered_list.addListItem(_i18n.getMessage("menu_setting_standard_reset_dialog_explanation_1"));
					new UI_Text(parent,_i18n.getMessage("menu_setting_standard_reset_dialog_confirm"));

					// Yes No ボタン
					var yes_no_button = new UI_YesNoButton(dialog_parent);
					yes_no_button.onclick = function(v){

						if(!v){
							// ダイアログ終了
							dialog.close();
							return;
						}

						function LocalStorageDeleteFailure(message){
							// 結果を表示
							var alert_dialog = new UI_AlertDialog(dialog_parent,_i18n.getMessage("menu_setting_standard_reset_alert"));
							new UI_Text(alert_dialog.getElement(),_i18n.getMessage("menu_setting_standard_reset_alert_failure"));
							new UI_Text(alert_dialog.getElement(),message);
							alert_dialog.oncomplete = function(){
								// ダイアログ終了
								dialog.close();
							};
							alert_dialog.open();
						}

						try{
							// プロジェクトを破棄
							projectDelete(function(result){

								page_expand_project = new PageExpandProject();
								page_expand_project.initialize();
								projectSave(function(e){
									if(!e.result){
										LocalStorageDeleteFailure(e.message);
										return;
									}

									// 結果を表示
									var alert_dialog = new UI_AlertDialog(dialog_parent,_i18n.getMessage("menu_setting_standard_reset_alert"));
									new UI_Text(alert_dialog.getElement(),_i18n.getMessage("menu_setting_standard_reset_alert_success"));
									alert_dialog.oncomplete = function(){

										// フェードアウト完了後
										dialog.oncomplete = function(){

											// PageExpandConfig を再構築
											initialize();

											// 基本設定を選択
											_config.MenuItemSelect(PageExpandConfig.MENU_TYPE_SETTING_STANDARD);

										};

										// ダイアログ終了
										dialog.close();
									};
									alert_dialog.open();
								});
							});

						}catch(e){
							LocalStorageDeleteFailure(e);
						}
					};

					// ダイアログ開始
					dialog.open();
				};

				// フィルタタイプ
				_combo_box_filter_url.setValue( standard.filter_type);
				function filterTypeUpdate(){
					switch(standard.filter_type){
					case "deny":
						_text_area_filter_url.joinArray(standard.filter_deny,"\n");
						break;
					default:
						_text_area_filter_url.joinArray(standard.filter_allow,"\n");
						break;
					}
				}
				filterTypeUpdate();

				// アドレスバーアイコンが有効であるか
				_check_box_enable_icon_address_bar.setValue(standard.enable_icon_address_bar);

				// コンテキストメニューが有効か
				_check_box_enable_context_menu.setValue(standard.enable_context_menu);

				// ロード完了時から動作を開始するか
				_check_box_enable_startup.setValue(standard.enable_startup);

				// デバッグモードが有効であるか
				_check_box_enable_debug_mode.setValue(standard.enable_debug_mode);

				// ログ出力が有効であるか
				_check_box_enable_output_log.setValue(standard.enable_output_log);

				// タッチ操作が有効であるか
				_check_box_enable_input_touch.setValue(standard.enable_input_touch);

				// ダブルタッチ操作補助線を表示するか
				_check_box_enable_double_touch_assist.setValue(standard.enable_double_touch_assist);

				// 最大CPU占有時間
				_stepper_execute_queue_time_occupancy.setValue(standard.execute_queue.time_occupancy);

				// スリープ時間
				_stepper_execute_queue_sleep_time.setValue(standard.execute_queue.time_sleep);

			})();
		}

		// -
		// ダウンロード設定
		// -
		function ContentSettingDownload(){
			var _this = this;

			// -
			// プライベート変数
			// -
			var _stepper_load_thread_max;
			var _stepper_load_timeout;
			var _stepper_download_thread_max;
			var _combo_box_conflict_type;			
			var _form_container_download_save_file_simple;
			var _form_container_download_save_file_detail;
			var _combo_box_download_save_file_type;
			var _combo_box_download_save_file_simple;
			var _text_input_download_save_file_detail;
			var _form_container_batch_download_save_file_simple;
			var _form_container_batch_download_save_file_detail;
			var _combo_box_batch_download_save_file_type;
			var _combo_box_batch_download_save_file_simple;
			var _text_input_batch_download_save_file_detail;

			// -
			// 初期化
			// -
			(function(){
				var download = page_expand_project.getObject().download;

				// タイトル
				var title = new UI_Title(_content_window,_i18n.getMessage("menu_setting_download"));

				// ロード設定
				var title = new UI_TitleSub(_content_window,_i18n.getMessage("menu_setting_download_load"));

				// グループ
				var group = new UI_GroupContainer(_content_window);
				var group_parent = group.getElement();

				// 最大同時ロード数
				var container = new UI_LineContainer(group_parent,_i18n.getMessage("menu_setting_download_load_thread_max"));
				var parent = container.getElement();
				_stepper_load_thread_max = new UI_NumericStepper(parent);
				_stepper_load_thread_max.setMinimum(1);
				_stepper_load_thread_max.setMaximum(99999);
				_stepper_load_thread_max.oninput = function(v){
					download.load.thread_max = v;
					projectModify();
				};

				// タイムアウト
				var container = new UI_LineContainer(group_parent,_i18n.getMessage("menu_setting_download_load_timeout"));
				var parent = container.getElement();
				_stepper_load_timeout = new UI_NumericStepper(parent);
				_stepper_load_timeout.setMinimum(0);
				_stepper_load_timeout.setMaximum(1000 * 60 * 10);
				_stepper_load_timeout.oninput = function(v){
					download.load.timeout = v;
					projectModify();
				};
				new UI_TextHint(parent,_i18n.getMessage("menu_setting_download_load_timeout_hint"));
				new UI_Break(_content_window);

				// ダウンロード設定
				var title = new UI_TitleSub(_content_window,_i18n.getMessage("menu_setting_download_download"));

				// グループ
				var group = new UI_GroupContainer(_content_window);
				var group_parent = group.getElement();

				// 最大同時ダウンロード数
				var container = new UI_LineContainer(group_parent,_i18n.getMessage("menu_setting_download_download_thread_max"));
				var parent = container.getElement();
				_stepper_download_thread_max = new UI_NumericStepper(parent);
				_stepper_download_thread_max.setMinimum(1);
				_stepper_download_thread_max.setMaximum(99999);
				_stepper_download_thread_max.oninput = function(v){
					download.download.thread_max = v;
					projectModify();
				};

				// 保存先の設定
				var container = new UI_LineContainer(group_parent,_i18n.getMessage("menu_setting_download_download_save_file"));
				var parent = container.getElement();

				_combo_box_download_save_file_type = new UI_ComboBox(parent);
				_combo_box_download_save_file_type.attachItem(_i18n.getMessage("menu_setting_download_download_save_file_combo_box_item_simple"),"simple");
				_combo_box_download_save_file_type.attachItem(_i18n.getMessage("menu_setting_download_download_save_file_combo_box_item_detail"),"detail");
				_combo_box_download_save_file_type.onchange = function(v){
					download.download.save_file.type = v;
					autoDownloadUpdateSaveFile(true);
					projectModify();
				};
				new UI_BreakItem(parent);

				// フィルタ更新
				function autoDownloadUpdateSaveFile(update){
					var detail = Boolean(download.download.save_file.type === "detail");
					if(detail && update){
						var save_file_detail = "PageExpand/" + ProjectDownloadSaveFile_DetailFromSimple(download.download.save_file.simple);
						_text_input_download_save_file_detail.setValue(save_file_detail);
						download.download.save_file.detail = save_file_detail;
					}
					_form_container_download_save_file_simple.setVisible(!detail);
					_form_container_download_save_file_detail.setVisible(detail);
				}

				_form_container_download_save_file_simple = new UI_FormContainer(parent);
				_form_container_download_save_file_simple.setVisible(true);
				var form_parent_download_simple = _form_container_download_save_file_simple.getElement();

				// 保存先を選択
				new UI_TitleItem(form_parent_download_simple,_i18n.getMessage("menu_setting_download_download_save_file_simple"));
				_combo_box_download_save_file_simple = new UI_ComboBox(form_parent_download_simple);
				_combo_box_download_save_file_simple.attachItem("PageExpand / <url>","url");
				_combo_box_download_save_file_simple.attachItem("PageExpand / <kebab-url>","kebab_url");
				_combo_box_download_save_file_simple.attachItem("PageExpand / <filename>","filename");
				_combo_box_download_save_file_simple.attachItem("PageExpand / <domain> - <filename>","domain");
				_combo_box_download_save_file_simple.attachItem("PageExpand / <year> <month> <day> / <filename>","date");
				_combo_box_download_save_file_simple.onchange = function(v){
					download.download.save_file.simple = v;
					projectModify();
				};
				new UI_BreakItem(form_parent_download_simple);

				_form_container_download_save_file_detail = new UI_FormContainer(parent);
				_form_container_download_save_file_detail.setVisible(false);
				var form_parent_download_detail = _form_container_download_save_file_detail.getElement();

				// 保存先を編集
				new UI_TitleItem(form_parent_download_detail,_i18n.getMessage("menu_setting_download_download_save_file_detail"));
				_text_input_download_save_file_detail = new UI_TextInput(form_parent_download_detail);
				_text_input_download_save_file_detail.oninput = function(v){
					download.download.save_file.detail = v;
					projectModify();
				};
				new UI_BreakItem(form_parent_download_detail);

				function downloadInsertSaveFileVariable(parent){
					new UI_TitleItem(parent,_i18n.getMessage("menu_setting_download_download_save_file_variable"));
					new UI_TextItem(parent,"<url> <kebab-url> <origin> <domain> <filename> <name> <ext> <query> <fragment>");
					new UI_TextItem(parent,"<year> <month> <day> <hour> <minute> <second> <millisecond> <unixtime>");				
				}
				downloadInsertSaveFileVariable(form_parent_download_detail);

				// ファイル名衝突時の処理
				var container = new UI_LineContainer(group_parent,_i18n.getMessage("menu_setting_download_download_conflict_type"));
				var parent = container.getElement();
				_combo_box_conflict_type = new UI_ComboBox(parent);
				_combo_box_conflict_type.attachItem(_i18n.getMessage("menu_setting_download_download_conflict_type_combo_box_item_rename"),"rename");
				_combo_box_conflict_type.attachItem(_i18n.getMessage("menu_setting_download_download_conflict_type_combo_box_item_overwrite"),"overwrite");
				_combo_box_conflict_type.onchange = function(v){
					download.download.conflict_type = v;
					projectModify();
				};

				new UI_Break(_content_window);


				// 一括ダウンロード設定
				var title = new UI_TitleSub(_content_window,_i18n.getMessage("menu_setting_download_batch_download"));

				// グループ
				var group = new UI_GroupContainer(_content_window);
				var group_parent = group.getElement();

				// 保存先の設定
				var container = new UI_LineContainer(group_parent,_i18n.getMessage("menu_setting_download_download_save_file"));
				var parent = container.getElement();

				_combo_box_batch_download_save_file_type = new UI_ComboBox(parent);
				_combo_box_batch_download_save_file_type.attachItem(_i18n.getMessage("menu_setting_download_download_save_file_combo_box_item_simple"),"simple");
				_combo_box_batch_download_save_file_type.attachItem(_i18n.getMessage("menu_setting_download_download_save_file_combo_box_item_detail"),"detail");
				_combo_box_batch_download_save_file_type.onchange = function(v){
					download.batch_download.save_file.type = v;
					batchDownloadUpdateSaveFile(true);
					projectModify();
				};
				new UI_BreakItem(parent);

				// フィルタ更新
				function batchDownloadUpdateSaveFile(update){
					var detail = Boolean(download.batch_download.save_file.type === "detail");
					if(detail && update){
						var save_file_detail = ProjectDownloadSaveFile_DetailFromSimple(download.batch_download.save_file.simple);
						_text_input_batch_download_save_file_detail.setValue(save_file_detail);
						download.batch_download.save_file.detail = save_file_detail;
					}
					_form_container_batch_download_save_file_simple.setVisible(!detail);
					_form_container_batch_download_save_file_detail.setVisible(detail);
				}

				_form_container_batch_download_save_file_simple = new UI_FormContainer(parent);
				_form_container_batch_download_save_file_simple.setVisible(true);
				var form_parent_batch_download_simple = _form_container_batch_download_save_file_simple.getElement();

				// 保存先を選択
				new UI_TitleItem(form_parent_batch_download_simple,_i18n.getMessage("menu_setting_download_download_save_file_simple"));
				_combo_box_batch_download_save_file_simple = new UI_ComboBox(form_parent_batch_download_simple);
				_combo_box_batch_download_save_file_simple.attachItem("<url>","url");
				_combo_box_batch_download_save_file_simple.attachItem("<kebab-url>","kebab_url");
				_combo_box_batch_download_save_file_simple.attachItem("<filename>","filename");
				_combo_box_batch_download_save_file_simple.attachItem("<domain> - <filename>","domain");
				_combo_box_batch_download_save_file_simple.attachItem("<year> <month> <day> / <filename>","date");
				_combo_box_batch_download_save_file_simple.onchange = function(v){
					download.batch_download.save_file.simple = v;
					projectModify();
				};
				new UI_BreakItem(form_parent_batch_download_simple);

				_form_container_batch_download_save_file_detail = new UI_FormContainer(parent);
				_form_container_batch_download_save_file_detail.setVisible(false);
				var form_parent_batch_download_detail = _form_container_batch_download_save_file_detail.getElement();

				// 保存先を編集
				new UI_TitleItem(form_parent_batch_download_detail,_i18n.getMessage("menu_setting_download_download_save_file_detail"));
				_text_input_batch_download_save_file_detail = new UI_TextInput(form_parent_batch_download_detail);
				_text_input_batch_download_save_file_detail.oninput = function(v){
					download.batch_download.save_file.detail = v;
					projectModify();
				};
				new UI_BreakItem(form_parent_batch_download_detail);

				downloadInsertSaveFileVariable(form_parent_batch_download_detail);

				new UI_Break(_content_window);


				// 最大同時ロード数
				_stepper_load_thread_max.setValue(download.load.thread_max);
				// タイムアウト
				_stepper_load_timeout.setValue(download.load.timeout);
				// 最大同時ダウンロード数
				_stepper_download_thread_max.setValue(download.download.thread_max);
				// ファイル名衝突時の処理
				_combo_box_conflict_type.setValue(download.download.conflict_type);
				// 設定タイプ
				_combo_box_download_save_file_type.setValue(download.download.save_file.type);
				// 保存先を選択
				_combo_box_download_save_file_simple.setValue(download.download.save_file.simple);
				// 保存先を編集
				_text_input_download_save_file_detail.setValue(download.download.save_file.detail);	
				// 設定タイプ
				_combo_box_batch_download_save_file_type.setValue(download.batch_download.save_file.type);
				// 保存先を選択
				_combo_box_batch_download_save_file_simple.setValue(download.batch_download.save_file.simple);
				// 保存先を編集
				_text_input_batch_download_save_file_detail.setValue(download.batch_download.save_file.detail);
				
				autoDownloadUpdateSaveFile(false);
				batchDownloadUpdateSaveFile(false);
			})();
		}

		// -
		// スレッド掲示板拡張設定
		// -
		function ContentSettingExpandBbs(){
			var _this = this;

			// -
			// URLからリストを選択
			// -
			_this.selectFromURL = function(url){
				var expand_bbs = page_expand_project.getObject().expand_bbs;
				var i;
				var j;
				var num = expand_bbs.length;
				for(i=0;i<num;i++){
					var c = ProjectObjectGetActiveData(expand_bbs[i]);
					if(!c)	continue;

					// アドレスチェック
					switch(c.filter.type){
					case "asterisk":
						var filter = c.filter.asterisk.filter;
						var filter_num = filter.length;
						for(j=0;j<filter_num;j++){
							if(StringUrlMatchAsteriskWord(url,filter[j])){
								_expand_bbs_list.select(i);
								_expand_bbs_list.replaceHistory();
								return;
							}
						}
						break;
					case "regexp":
						var filter = c.filter.regexp.filter;
						var filter_num = filter.length;
						for(j=0;j<filter_num;j++){
							var regexp = RegExpObjectGetRegExp(filter[j]);
							if(regexp){
								if(StringUrlMatchRegExpList(url,[regexp])){
									_expand_bbs_list.select(i);
									_expand_bbs_list.replaceHistory();
									return;
								}
							}
						}
						break;
					}
				}
			};

			// -
			// リストから選択
			// -
			_this.selectFromIdList = function(list){
				_expand_bbs_list.selectFromIdList(list);
			};

			// -
			// 履歴を上書き
			// -
			_this.replaceHistory = function(){
				_expand_bbs_list.replaceHistory();
			};

			// -
			// 選択(内部用)
			// -
			function select(id){
				var proj = page_expand_project.getObject();
				var expand_bbs = proj.expand_bbs;
				var c = ProjectObjectGetActiveData(expand_bbs[id]);
				if(!c)	return;

				_text_input_name.setValue(LocaleObjectGetString(c.name));
				_check_box_enable_expand_bbs.setValue(c.enable);
				_form_container_enable.setVisible(c.enable);
				_url_edit_container.attachObject(c.filter);
				_script_obj_editer_initialize.setScriptObject(c.script_initialize);
				_check_box_popup_enable_animation.setValue(c.popup.enable_animation);
				_combo_box_popup_origin_type.setValue(c.popup.origin_type);
				_combo_box_popup_position_type.setValue(c.popup.position_type);
				_stepper_popup_percent_h.setValue(c.popup.percent.x);
				_stepper_popup_percent_v.setValue(c.popup.percent.y);
				_stepper_popup_time_wait_open.setValue(c.popup.time_wait_open);
				_stepper_popup_time_wait_close.setValue(c.popup.time_wait_close);
				_text_input_popup_style_sheet.setValue(c.popup.style_sheet);
				_script_obj_editer_callback.setScriptObject(c.script_callback);
			}

			// -
			// 選択しているURLマッピングオブジェクトを取得(内部用)
			// -
			function getSelectedExpandBbs(func){
				var expand_bbs = page_expand_project.getObject().expand_bbs;
				var c;
				var p;
				var a = _expand_bbs_list.getSelectedIndices();
				var i;
				var num = a.length;
				for(i=0;i<num;i++){
					p = null;
					c = expand_bbs[a[i]];
					if(c.user){
						p = c.user;
					}else{
						if(c.preset){
							// プリセットを昇格
							p = c.user = ObjectCopy(c.preset);
						}
					}
					if(p)	func(p);
				}
			}

			// -
			// プライベート変数
			// -
			var _expand_bbs_list;
			var _form_container;
			var _form_container_enable;
			var _text_input_name;
			var _check_box_enable_expand_bbs;
			var _url_edit_container;
			var _script_obj_editer_initialize;
			var _check_box_popup_enable_animation;
			var _combo_box_popup_origin_type;
			var _combo_box_popup_position_type;
			var _stepper_popup_percent_h;
			var _stepper_popup_percent_v;
			var _stepper_popup_time_wait_open;
			var _stepper_popup_time_wait_close;
			var _text_input_popup_style_sheet;
			var _script_obj_editer_callback;

			// -
			// 初期化
			// -
			(function(){
				var expand_bbs = page_expand_project.getObject().expand_bbs;

				// タイトル
				var title = new UI_Title(_content_window,_i18n.getMessage("menu_setting_expand_bbs"));

				// 掲示板拡張設定一覧
				var container = new UI_LineContainer(_content_window,_i18n.getMessage("menu_setting_expand_bbs_list"));
				var parent = container.getElement();
				_expand_bbs_list = new UI_ExpandBbsList(parent);
				_expand_bbs_list.attachExpandBbsData(expand_bbs);
				_expand_bbs_list.onselect = function(id){
					if(id < 0 || expand_bbs.length <= id){
						_form_container.setVisible(false);
					}else{
						_form_container.setVisible(true);
						select(id);
					}
				};
				_expand_bbs_list.onreload = function(){
					_config.MenuItemSelect(PageExpandConfig.MENU_TYPE_SETTING_EXPAND_BBS);
				};

				// フォームコンテナ
				_form_container = new UI_FormContainer(_content_window);
				var form_parent = _form_container.getElement();
				_form_container.setVisible(false);

				// 名前
				var container = new UI_LineContainer(form_parent,_i18n.getMessage("menu_setting_expand_bbs_name"));
				var parent = container.getElement();
				_text_input_name = new UI_TextInput(parent);
				_text_input_name.oninput = function(v){
					getSelectedExpandBbs(function(c){
						LocaleObjectSetString(c.name,v);
					});
					_expand_bbs_list.update();
					projectModify();
				};

				// 掲示板拡張設定
				var container = new UI_LineContainer(form_parent,_i18n.getMessage("menu_setting_expand_bbs_check_box_container"));
				var parent = container.getElement();

				// 有効であるか
				_check_box_enable_expand_bbs = new UI_CheckBox(parent,_i18n.getMessage("menu_setting_expand_bbs_enable_setting"));
				_check_box_enable_expand_bbs.onchange = function(v){
					getSelectedExpandBbs(function(c){
						c.enable = v;
					});
					_form_container_enable.setVisible(v);
					_expand_bbs_list.update();
					projectModify();
				};

				_form_container_enable = new UI_FormContainer(form_parent);
				_form_container_enable.setVisible(false);
				var form_parent_enable = _form_container_enable.getElement();

				// 動作URLの設定
				var container = new UI_LineContainer(form_parent_enable,_i18n.getMessage("menu_setting_expand_bbs_filter_url"));
				var parent = container.getElement();
				_url_edit_container = new UI_UrlEditContainer(parent);
				_url_edit_container.onchange = function(v){
					getSelectedExpandBbs(function(c){
						c.filter = ObjectCopy(v);
					});
					_expand_bbs_list.update();
					projectModify();
				};

				// ポップアップの設定
				var container = new UI_LineContainer(form_parent_enable,_i18n.getMessage("menu_setting_expand_bbs_popup_check_box_container"));
				var parent = container.getElement();

				// ポップアップ時のアニメーション動作を有効
				_check_box_popup_enable_animation = new UI_CheckBox(parent,_i18n.getMessage("menu_setting_expand_bbs_popup_enable_animation"));
				_check_box_popup_enable_animation.onchange = function(v){
					getSelectedExpandBbs(function(c){
						c.popup.enable_animation = v;
					});
					_expand_bbs_list.update();
					projectModify();
				};

				// ポップアップの配置基点
				var container = new UI_LineContainer(form_parent_enable,_i18n.getMessage("menu_setting_expand_bbs_popup_origin_type"));
				var parent = container.getElement();
				_combo_box_popup_origin_type = new UI_ComboBox(parent);
				_combo_box_popup_origin_type.attachItem(_i18n.getMessage("menu_setting_expand_bbs_popup_origin_type_combo_box_item_adsorb_top_bottom"),"adsorb_top_bottom");
				_combo_box_popup_origin_type.attachItem(_i18n.getMessage("menu_setting_expand_bbs_popup_origin_type_combo_box_item_adsorb_left_right"),"adsorb_left_right");
				_combo_box_popup_origin_type.onchange = function(v){
					getSelectedExpandBbs(function(c){
						c.popup.origin_type = v;
					});
					_expand_bbs_list.update();
					projectModify();
				};

				// ポップアップの配置位置
				var container = new UI_LineContainer(form_parent_enable,_i18n.getMessage("menu_setting_expand_bbs_popup_position_type"));
				var parent = container.getElement();
				_combo_box_popup_position_type = new UI_ComboBox(parent);
				_combo_box_popup_position_type.attachItem(_i18n.getMessage("menu_setting_expand_bbs_popup_position_type_combo_box_item_absolute"),"absolute");
				_combo_box_popup_position_type.attachItem(_i18n.getMessage("menu_setting_expand_bbs_popup_position_type_combo_box_item_fixed"),"fixed");
				_combo_box_popup_position_type.onchange = function(v){
					getSelectedExpandBbs(function(c){
						c.popup.position_type = v;
					});
					_expand_bbs_list.update();
					projectModify();
				};

				// ポップアップサイズ
				var container = new UI_LineContainer(form_parent_enable,_i18n.getMessage("menu_setting_expand_bbs_popup_percent"));
				var parent = container.getElement();
				// 横方向パーセント (0~100)
				new UI_TitleItem(parent,_i18n.getMessage("menu_setting_expand_bbs_popup_percent_h"));
				_stepper_popup_percent_h = new UI_NumericStepper(parent);
				_stepper_popup_percent_h.setMinimum(0);
				_stepper_popup_percent_h.setMaximum(100);
				_stepper_popup_percent_h.oninput = function(v){
					getSelectedExpandBbs(function(c){
						c.popup.percent.x = v;
					});
					_expand_bbs_list.update();
					projectModify();
				};
				new UI_BreakItem(parent);

				// 縦方向パーセント (0~100)
				new UI_TitleItem(parent,_i18n.getMessage("menu_setting_expand_bbs_popup_percent_v"));
				_stepper_popup_percent_v = new UI_NumericStepper(parent);
				_stepper_popup_percent_v.setMinimum(0);
				_stepper_popup_percent_v.setMaximum(100);
				_stepper_popup_percent_v.oninput = function(v){
					getSelectedExpandBbs(function(c){
						c.popup.percent.y = v;
					});
					_expand_bbs_list.update();
					projectModify();
				};

				// ポップアップ時間
				var container = new UI_LineContainer(form_parent_enable,_i18n.getMessage("menu_setting_expand_bbs_popup_time"));
				var parent = container.getElement();
				// 開くまでに待機する時間(ミリ秒)
				new UI_TitleItem(parent,_i18n.getMessage("menu_setting_expand_bbs_popup_time_wait_open"));
				_stepper_popup_time_wait_open = new UI_NumericStepper(parent);
				_stepper_popup_time_wait_open.setMinimum(0);
				_stepper_popup_time_wait_open.setMaximum(9999999);
				_stepper_popup_time_wait_open.oninput = function(v){
					getSelectedExpandBbs(function(c){
						c.popup.time_wait_open = v;
					});
					_expand_bbs_list.update();
					projectModify();
				};
				new UI_BreakItem(parent);

				// 閉じるまでに待機する時間(ミリ秒)
				new UI_TitleItem(parent,_i18n.getMessage("menu_setting_expand_bbs_popup_time_wait_close"));
				_stepper_popup_time_wait_close = new UI_NumericStepper(parent);
				_stepper_popup_time_wait_close.setMinimum(0);
				_stepper_popup_time_wait_close.setMaximum(9999999);
				_stepper_popup_time_wait_close.oninput = function(v){
					getSelectedExpandBbs(function(c){
						c.popup.time_wait_close = v;
					});
					_expand_bbs_list.update();
					projectModify();
				};

				// ポップアップのスタイル
				var container = new UI_LineContainer(form_parent_enable,_i18n.getMessage("menu_setting_expand_bbs_popup_style_sheet"));
				var parent = container.getElement();
				_text_input_popup_style_sheet = new UI_TextInput(parent);
				_text_input_popup_style_sheet.oninput = function(v){
					getSelectedExpandBbs(function(c){
						c.popup.style_sheet = v;
					});
					_expand_bbs_list.update();
					projectModify();
				};

				// 初期化スクリプト
				var container = new UI_LineContainer(form_parent_enable,_i18n.getMessage("menu_setting_expand_bbs_script_initialize"));
				var parent = container.getElement();
				_script_obj_editer_initialize = new UI_ScriptObjectEditer(parent);
				_script_obj_editer_initialize.onchange = function(v){
					getSelectedExpandBbs(function(c){
						PageExpandProjectScriptObject_CopyUserScript(c.script_initialize , v);
					});
					_expand_bbs_list.update();
					projectModify();
				};

				// コールバックスクリプト
				var container = new UI_LineContainer(form_parent_enable,_i18n.getMessage("menu_setting_expand_bbs_script_callback"));
				var parent = container.getElement();
				_script_obj_editer_callback = new UI_ScriptObjectEditer(parent);
				_script_obj_editer_callback.onchange = function(v){
					getSelectedExpandBbs(function(c){
						PageExpandProjectScriptObject_CopyUserScript(c.script_callback , v);
					});
					_expand_bbs_list.update();
					projectModify();
				};

			})();
		}

		// -
		// URLマッピング設定
		// -
		function ContentSettingUrlMap(){
			var _this = this;

			// -
			// URLからリストを選択
			// -
			_this.selectFromURL = function(url){
				var urlmap = page_expand_project.getObject().urlmap;
				var i;
				var j;
				var num = urlmap.length;
				for(i=0;i<num;i++){
					var c = ProjectObjectGetActiveData(urlmap[i]);
					if(!c)	continue;

					// アドレスチェック
					switch(c.filter.type){
					case "asterisk":
						var filter = c.filter.asterisk.filter;
						var filter_num = filter.length;
						for(j=0;j<filter_num;j++){
							if(StringUrlMatchAsteriskWord(url,filter[j])){
								_urlmap_list.select(i);
								_urlmap_list.replaceHistory();
								return;
							}
						}
						break;
					case "regexp":
						var filter = c.filter.regexp.filter;
						var filter_num = filter.length;
						for(j=0;j<filter_num;j++){
							var regexp = RegExpObjectGetRegExp(filter[j]);
							if(regexp){
								if(StringUrlMatchRegExpList(url,[regexp])){
									_urlmap_list.select(i);
									_urlmap_list.replaceHistory();
									return;
								}
							}
						}
						break;
					}
				}
			};

			// -
			// リストから選択
			// -
			_this.selectFromIdList = function(list){
				_urlmap_list.selectFromIdList(list);
			};

			// -
			// 履歴を上書き
			// -
			_this.replaceHistory = function(){
				_urlmap_list.replaceHistory();
			};

			// -
			// 選択(内部用)
			// -
			function select(id){
				var proj = page_expand_project.getObject();
				var urlmap = proj.urlmap;
				var c = ProjectObjectGetActiveData(urlmap[id]);
				if(!c)	return;

				// 名前
				_text_input_name.setValue(LocaleObjectGetString(c.name));

				// 有効
				_check_box_enable_urlmap.setValue(c.enable);
				_form_container_enable.setVisible(c.enable);

				// フィルタ
				_url_edit_container.attachObject(c.filter);

				// セキュリティ
				_check_box_enable_unsecure.setValue(c.enable_unsecure);
				_check_box_enable_mixed_content.setValue(c.enable_mixed_content);

				// 定義
				var i;
				var num = _ui_define.length;
				for(i=0;i<num;i++){
					var param = _ui_define_select_params[i];
					switch(param.select){
					case "single":
						var combo_box = _ui_define[i];
						var define = c[param.asset];
						if(define.enable){
							combo_box.setValue(define.id);
						}else{
							combo_box.setValue("");
						}
						break;
					case "multiple":
						var multi_list = _ui_define[i];
						// フィルタ
						var ary = new Array();
						var indices = _urlmap_list.getSelectedIndices();
						for(var p in indices){
							ary.push(urlmap[indices[p]]);
						}
						multi_list.attachUrlMaps(ary,urlmap[id]);
						break;
					}
				}

			}

			// -
			// 選択しているURLマッピングオブジェクトを取得(内部用)
			// -
			function getSelectedUrlMaps(func){
				var urlmap = page_expand_project.getObject().urlmap;
				var c;
				var p;
				var a = _urlmap_list.getSelectedIndices();
				var i;
				var num = a.length;
				for(i=0;i<num;i++){
					p = null;
					c = urlmap[a[i]];
					if(c.user){
						p = c.user;
					}else{
						if(c.preset){
							// プリセットを昇格
							p = c.user = ObjectCopy(c.preset);
						}
					}
					if(p)	func(p);
				}
			}

			// -
			// プライベート変数
			// -
			var _urlmap_list;
			var _form_container;
			var _form_container_enable;
			var _text_input_name;
			var _check_box_enable_urlmap;
			var _url_edit_container;
			var _check_box_enable_unsecure;
			var _check_box_enable_mixed_content;
			var _ui_define;
			var _ui_define_select_params = [
				{asset:"access_block",type:PageExpandConfig.MENU_TYPE_SETTING_ACCESS_BLOCK,select:"multiple" },
				{asset:"replacement_to_referer",type:PageExpandConfig.MENU_TYPE_SETTING_REPLACEMENT_TO_REFERER,select:"multiple" },
				{asset:"replacement_to_useragent",type:PageExpandConfig.MENU_TYPE_SETTING_REPLACEMENT_TO_USERAGENT,select:"multiple" },
				{asset:"replacement_to_element",type:PageExpandConfig.MENU_TYPE_SETTING_REPLACEMENT_TO_ELEMENT,select:"multiple" },
				{asset:"replacement_to_text",type:PageExpandConfig.MENU_TYPE_SETTING_REPLACEMENT_TO_TEXT,select:"multiple" },
				{asset:"replacement_to_anchor",type:PageExpandConfig.MENU_TYPE_SETTING_REPLACEMENT_TO_ANCHOR,select:"multiple" },
				{asset:"replacement_to_link",type:PageExpandConfig.MENU_TYPE_SETTING_REPLACEMENT_TO_LINK,select:"multiple" },
				{asset:"make_link_to_text",type:PageExpandConfig.MENU_TYPE_SETTING_MAKE_LINK_TO_TEXT,select:"single" },
				{asset:"expand_short_url",type:PageExpandConfig.MENU_TYPE_SETTING_EXPAND_SHORT_URL,select:"single" },
				{asset:"expand_text",type:PageExpandConfig.MENU_TYPE_SETTING_EXPAND_TEXT,select:"single" },
				{asset:"expand_image",type:PageExpandConfig.MENU_TYPE_SETTING_EXPAND_IMAGE,select:"single" },
				{asset:"expand_sound",type:PageExpandConfig.MENU_TYPE_SETTING_EXPAND_SOUND,select:"single" },
				{asset:"expand_video",type:PageExpandConfig.MENU_TYPE_SETTING_EXPAND_VIDEO,select:"single" },
				{asset:"expand_iframe",type:PageExpandConfig.MENU_TYPE_SETTING_EXPAND_IFRAME,select:"single" },
				{asset:"style_sheet",type:PageExpandConfig.MENU_TYPE_SETTING_STYLE_SHEET,select:"single" },
				{asset:"experimental",type:PageExpandConfig.MENU_TYPE_SETTING_EXPERIMENTAL,select:"single" }
			];

			// -
			// 初期化
			// -
			(function(){
				var proj = page_expand_project.getObject();
				var urlmap = proj.urlmap;

				// タイトル
				var title = new UI_Title(_content_window,_i18n.getMessage("menu_setting_urlmap"));

				// URLマッピング設定一覧
				var container = new UI_LineContainer(_content_window,_i18n.getMessage("menu_setting_urlmap_list"));
				var parent = container.getElement();
				_urlmap_list = new UI_UrlMapList(parent);
				_urlmap_list.attachUrlMapData(urlmap);
				_urlmap_list.onselect = function(id){
					if(id < 0 || urlmap.length <= id){
						_form_container.setVisible(false);
					}else{
						_form_container.setVisible(true);
						select(id);
					}
				};

				// フォームコンテナ
				_form_container = new UI_FormContainer(_content_window);
				var form_parent = _form_container.getElement();
				_form_container.setVisible(false);

				// URLマッピング設定名
				var container = new UI_LineContainer(form_parent,_i18n.getMessage("menu_setting_urlmap_name"));
				var parent = container.getElement();
				_text_input_name = new UI_TextInput(parent);
				_text_input_name.oninput = function(v){
					getSelectedUrlMaps(function(c){
						LocaleObjectSetString(c.name,v);
					});
					_urlmap_list.update();
					projectModify();
				};

				// URLマッピング設定
				var container = new UI_LineContainer(form_parent,_i18n.getMessage("menu_setting_urlmap_check_box_container"));
				var parent = container.getElement();

				// 有効であるか
				_check_box_enable_urlmap = new UI_CheckBox(parent,_i18n.getMessage("menu_setting_urlmap_enable_setting"));
				_check_box_enable_urlmap.onchange = function(v){
					getSelectedUrlMaps(function(c){
						c.enable = v;
					});
					_form_container_enable.setVisible(v);
					_urlmap_list.update();
					projectModify();
				};

				_form_container_enable = new UI_FormContainer(form_parent);
				_form_container_enable.setVisible(false);
				var form_parent_enable = _form_container_enable.getElement();

				// 動作 URL
				var container = new UI_LineContainer(form_parent_enable,_i18n.getMessage("menu_setting_urlmap_filter_url"));
				var parent = container.getElement();
				_url_edit_container = new UI_UrlEditContainer(parent);
				_url_edit_container.onchange = function(v){
					getSelectedUrlMaps(function(c){
						c.filter = ObjectCopy(v);
					});
					_urlmap_list.update();
					projectModify();
				};

				// セキュリティ
				var container = new UI_LineContainer(form_parent_enable,_i18n.getMessage("menu_setting_urlmap_unsecure_check_box_container"));
				var parent = container.getElement();

				// アンセキュア
				_check_box_enable_unsecure = new UI_CheckBox(parent,_i18n.getMessage("menu_setting_urlmap_enable_unsecure"));
				_check_box_enable_unsecure.onchange = function(v){
					getSelectedUrlMaps(function(c){
						c.enable_unsecure = v;
					});
					_urlmap_list.update();
					projectModify();
				};
				new UI_TextHint(parent,_i18n.getMessage("menu_setting_urlmap_enable_unsecure_hint"));
				new UI_BreakItem(parent);

				// 混在コンテンツ
				_check_box_enable_mixed_content = new UI_CheckBox(parent,_i18n.getMessage("menu_setting_urlmap_enable_mixed_content"));
				_check_box_enable_mixed_content.onchange = function(v){
					getSelectedUrlMaps(function(c){
						c.enable_mixed_content = v;
					});
					_urlmap_list.update();
					projectModify();
				};
				new UI_TextHint(parent,_i18n.getMessage("menu_setting_urlmap_enable_mixed_content_hint"));

				// 定義
				_ui_define = new Array();
				var i;
				var num = _ui_define_select_params.length;
				for(i=0;i<num;i++){
					(function(){
						var param = _ui_define_select_params[i];
						var type = param.type;
						var asset = param.asset;

						// 各定義
						var container = new UI_InlineContainer(form_parent_enable,_i18n.getMessage("menu_setting_" + param.asset));
						container.setWidth(280);
						var parent = container.getElement();
						
						if(!_menu_support_param[type].urlmap){
							container.setAlpha(0.5);
						}
						container.setBackgroundColor(_menu_item_param[type].bgcolor);

						switch(param.select){
						case "single":
							var combo_box = new UI_ComboBoxButton(parent,_i18n.getMessage("menu_setting_urlmap_define_button_edit"));
							_ui_define.push(combo_box);

							// 定義リストを登録
							(function(){
								var define = proj[param.asset];
								var i=0;
								var num = define.length;
								for(i=0;i<num;i++){
									var d = define[i];
									var c = ProjectObjectGetActiveData(d);
									combo_box.attachItem(LocaleObjectGetString(c.name),d.id);
								}
								combo_box.attachItem(_i18n.getMessage("menu_setting_urlmap_define_combo_box_item_no_use"),"");
							})();

							// コンボボックス変更
							combo_box.onchange = function(v){
								getSelectedUrlMaps(function(c){
									var define = c[asset];
									if(v){
										define.enable = true;
										define.id = v;
									}else{
										define.enable = false;
										define.id = "";
									}
								});
								_urlmap_list.update();
								projectModify();
							};

							// ボタン押下
							combo_box.onclick = function(){
								_config.pushHistory(type);
								var content = _config.MenuItemSelect(type);
								content.select(combo_box.getSelectedIndex());
								content.replaceHistory();
							};
							break;
						case "multiple":
							var multi_list = new UI_DefineMultiSelectList(parent);
							_ui_define.push(multi_list);

							multi_list.setAsset(param.asset);
							multi_list.setMenuId(type);
							multi_list.setDefineData(proj[param.asset]);
							multi_list.onchange = function(){
								_urlmap_list.update();
							};
							break;
						}
					})();
				}
			})();
		}

		// -
		// 定義関連のクラス
		// -
		function ContentSettingDefine(){
			var _this = this;

			// -
			// 選択
			// -
			_this.select = function(id){
				_define_list.select(id);
			};

			// -
			// リストから選択
			// -
			_this.selectFromIdList = function(list){
				_define_list.selectFromIdList(list);
			};

			// -
			// 履歴を上書き
			// -
			_this.replaceHistory = function(){
				_define_list.replaceHistory();
			};

			// -
			// 選択(内部用 )
			// -
			function select(id){
				var c = ProjectObjectGetActiveData(_define[id]);
				if(!c)	return;

				// ワイルドカード
				if(_define[id].id == "wildcard"){
					_wildcard_container.setVisible(true);
				}else{
					_wildcard_container.setVisible(false);
				}

				// 名前
				_text_input_name.setValue(LocaleObjectGetString(c.name));

				_this.onselect(id);
			}

			// -
			// 更新
			// -
			_this.update = function(){
				_define_list.update();
			};

			// -
			// 選択イベント
			// -
			_this.onselect = function(){};

			// -
			// リロードイベント
			// -
			_this.onreload = function(){};

			// -
			// データを関連付け
			// -
			_this.attachDefineData = function(data){
				_define = data;

				// リスト選択時
				_define_list.onselect = function(id){
					if(id < 0 || _define.length <= id){
						_form_container_inner.setVisible(false);
						_form_container_outer.setVisible(false);
					}else{
						_form_container_inner.setVisible(true);
						_form_container_outer.setVisible(true);
						select(id);
					}
				};

				// 定義リスト
				_define_list.attachDefineData(_define);
			};

			// -
			// 定義の識別名をセット
			// -
			_this.setDefineAssetName = function(asset){
				_define_list.setDefineAssetName(asset);
			};

			// -
			// タイトルをセット
			// -
			_this.setTitle = function(v){
				_title.setValue(v);
			};

			// -
			// 新規データ作成用関数をセット
			// -
			_this.setFunctionForNewData = function(f){
				_define_list.setFunctionForNewData(f);
			};

			// -
			// フォームエレメントを取得
			// -
			_this.getElementForm = function(){
				return _form_container_outer.getElement();
			};

			// -
			// 選択している定義オブジェクトを取得
			// -
			_this.getSelectedDefinitions = function(func){
				var c;
				var p;
				var a = _define_list.getSelectedIndices();
				var i;
				var num = a.length;
				for(i=0;i<num;i++){
					p = null;
					c = _define[a[i]];
					if(c.user){
						p = c.user;
					}else{
						if(c.preset){
							// プリセットを昇格
							p = c.user = ObjectCopy(c.preset);
						}
					}
					if(p)	func(p);
				}
			};

			// -
			// 選択しているアイテムを取得
			// -
			_this.getSelectedIndex = function(){
				return _define_list.getSelectedIndex();
			};

			// -
			// 選択されたアイテムをすべて取得
			// -
			_this.getSelectedIndices = function(){
				return ObjectCopy(_define_list.getSelectedIndices());
			};

			// -
			// プライベート変数
			// -
			var _title;
			var _form_container_inner;
			var _form_container_outer;
			var _wildcard_container;
			var _text_input_name;
			var _define_list;
			var _define;

			// -
			// 初期化
			// -
			(function(){
				_title = new UI_Title(_content_window,"");

				// グループ
				var group = new UI_GroupContainer(_content_window);
				var group_parent = group.getElement();

				// 定義一覧
				var container = new UI_LineContainer(group_parent,_i18n.getMessage("menu_setting_define_list"));
				var parent = container.getElement();
				_define_list = new UI_DefineList(parent);
				_define_list.onreload = function(){
					_this.onreload();
				};

				// フォームコンテナ
				_form_container_inner = new UI_FormContainer(group_parent);
				var form_parent = _form_container_inner.getElement();
				_form_container_inner.setVisible(false);

				// ワイルドカードについて
				_wildcard_container = new UI_FormContainer(form_parent);
				var wildcard_parent = _wildcard_container.getElement();
				_wildcard_container.setVisible(false);

				// ワイルドカードについて
				var container = new UI_LineContainer(wildcard_parent,_i18n.getMessage("menu_setting_define_wildcard_detail"));
				var parent = container.getElement();
				var unordered_list = new UI_UnorderedList(parent);
				unordered_list.addListItem(_i18n.getMessage("menu_setting_define_wildcard_detail_0"));
				unordered_list.addListItem(_i18n.getMessage("menu_setting_define_wildcard_detail_1"));
				unordered_list.addListItem(_i18n.getMessage("menu_setting_define_wildcard_detail_2"));

				// 定義名
				var container = new UI_LineContainer(form_parent,_i18n.getMessage("menu_setting_define_name"));
				var parent = container.getElement();
				_text_input_name = new UI_TextInput(parent);
				_text_input_name.oninput = function(v){
					_this.getSelectedDefinitions(function(c){
						LocaleObjectSetString(c.name,v);
					});
					_this.update();
					projectModify();
				};
				new UI_Break(_content_window);

				// フォームコンテナ
				_form_container_outer = new UI_FormContainer(_content_window);
				var form_parent = _form_container_outer.getElement();
				_form_container_outer.setVisible(false);
			})();
		}

		// -
		// アクセス遮断の定義
		// -
		function ContentSettingAccessBlock(){
			var _this = this;

			// -
			// 選択
			// -
			_this.select = function(id){
				_setting_define.select(id);
			};

			// -
			// リストから選択
			// -
			_this.selectFromIdList = function(list){
				_setting_define.selectFromIdList(list);
			};

			// -
			// 履歴を上書き
			// -
			_this.replaceHistory = function(){
				_setting_define.replaceHistory();
			};

			// -
			// プライベート変数
			// -
			var _setting_define;
			var _url_edit_container;

			// -
			// 初期化
			// -
			(function(){
				_setting_define = new ContentSettingDefine();
				var form_parent = _setting_define.getElementForm();
				var define = page_expand_project.getObject().access_block;

				// タイトル
				_setting_define.setTitle(_i18n.getMessage("menu_setting_access_block"));

				// グループ
				var group = new UI_GroupContainer(form_parent);
				var group_parent = group.getElement();

				// アクセス遮断 URL
				var container = new UI_LineContainer(group_parent,_i18n.getMessage("menu_setting_access_block_filter_url"));
				var parent = container.getElement();
				_url_edit_container = new UI_UrlEditContainer(parent);
				_url_edit_container.onchange = function(v){
					_setting_define.getSelectedDefinitions(function(c){
						c.filter = ObjectCopy(v);
					});

					_setting_define.update();
					projectModify();
				};
				new UI_Break(form_parent);

				// データの関連付け
				_setting_define.attachDefineData(define);
				_setting_define.setDefineAssetName("access_block");
				_setting_define.setFunctionForNewData(createAccessBlockData);

				// リスト選択
				_setting_define.onselect = function(id){
					var c = ProjectObjectGetActiveData(define[id]);
					if(!c)	return;

					// アクセス遮断 URL
					_url_edit_container.attachObject(c.filter);
				};

				// リロード
				_setting_define.onreload = function(){
					_config.MenuItemSelect(PageExpandConfig.MENU_TYPE_SETTING_ACCESS_BLOCK);
				};

			})();
		}

		// -
		// エレメントの置換定義
		// -
		function ContentSettingReplacementToElement(){
			var _this = this;

			// -
			// 選択
			// -
			_this.select = function(id){
				_setting_define.select(id);
			};

			// -
			// リストから選択
			// -
			_this.selectFromIdList = function(list){
				_setting_define.selectFromIdList(list);
			};

			// -
			// 履歴を上書き
			// -
			_this.replaceHistory = function(){
				_setting_define.replaceHistory();
			};

			// -
			// プライベート変数
			// -
			var _setting_define;
			var _script_obj_editer;

			// -
			// 初期化
			// -
			(function(){
				_setting_define = new ContentSettingDefine();
				var form_parent = _setting_define.getElementForm();
				var define = page_expand_project.getObject().replacement_to_element;

				// タイトル
				_setting_define.setTitle(_i18n.getMessage("menu_setting_replacement_to_element"));

				// グループ
				var group = new UI_GroupContainer(form_parent);
				var group_parent = group.getElement();

				// コールバックスクリプト
				var container = new UI_LineContainer(group_parent,_i18n.getMessage("menu_setting_replacement_to_element_script"));
				var parent = container.getElement();
				_script_obj_editer = new UI_ScriptObjectEditer(parent);
				_script_obj_editer.onchange = function(v){
					_setting_define.getSelectedDefinitions(function(c){
						PageExpandProjectScriptObject_CopyUserScript(c.script , v);
					});

					_setting_define.update();
					projectModify();
				};
				new UI_Break(form_parent);

				// データの関連付け
				_setting_define.attachDefineData(define);
				_setting_define.setDefineAssetName("replacement_to_element");
				_setting_define.setFunctionForNewData(createReplacementToElementData);

				// リスト選択
				_setting_define.onselect = function(id){
					var c = ProjectObjectGetActiveData(define[id]);
					if(!c)	return;

					// コールバックスクリプト
					_script_obj_editer.setScriptObject(c.script);
				};

				// リロード
				_setting_define.onreload = function(){
					_config.MenuItemSelect(PageExpandConfig.MENU_TYPE_SETTING_REPLACEMENT_TO_ELEMENT);
				};

			})();
		}

		// -
		// テキストの置換定義
		// -
		function ContentSettingReplacementToText(){
			var _this = this;

			// -
			// 選択
			// -
			_this.select = function(id){
				_setting_define.select(id);
			};

			// -
			// リストから選択
			// -
			_this.selectFromIdList = function(list){
				_setting_define.selectFromIdList(list);
			};

			// -
			// 履歴を上書き
			// -
			_this.replaceHistory = function(){
				_setting_define.replaceHistory();
			};

			// -
			// プライベート変数
			// -
			var _setting_define;
			var _script_obj_editer;

			// -
			// 初期化
			// -
			(function(){
				_setting_define = new ContentSettingDefine();
				var form_parent = _setting_define.getElementForm();
				var define = page_expand_project.getObject().replacement_to_text;

				// タイトル
				_setting_define.setTitle(_i18n.getMessage("menu_setting_replacement_to_text"));

				// グループ
				var group = new UI_GroupContainer(form_parent);
				var group_parent = group.getElement();

				// コールバックスクリプト
				var container = new UI_LineContainer(group_parent,_i18n.getMessage("menu_setting_replacement_to_text_script"));
				var parent = container.getElement();
				_script_obj_editer = new UI_ScriptObjectEditer(parent);
				_script_obj_editer.onchange = function(v){
					_setting_define.getSelectedDefinitions(function(c){
						PageExpandProjectScriptObject_CopyUserScript(c.script , v);
					});

					_setting_define.update();
					projectModify();
				};
				new UI_Break(form_parent);

				// データの関連付け
				_setting_define.attachDefineData(define);
				_setting_define.setDefineAssetName("replacement_to_text");
				_setting_define.setFunctionForNewData(createReplacementToTextData);

				// リスト選択
				_setting_define.onselect = function(id){
					var c = ProjectObjectGetActiveData(define[id]);
					if(!c)	return;

					// コールバックスクリプト
					_script_obj_editer.setScriptObject(c.script);
				};

				// リロード
				_setting_define.onreload = function(){
					_config.MenuItemSelect(PageExpandConfig.MENU_TYPE_SETTING_REPLACEMENT_TO_TEXT);
				};

			})();
		}

		// -
		// アンカー置換定義
		// -
		function ContentSettingReplacementToAnchor(){
			var _this = this;

			// -
			// 選択
			// -
			_this.select = function(id){
				_setting_define.select(id);
			};

			// -
			// リストから選択
			// -
			_this.selectFromIdList = function(list){
				_setting_define.selectFromIdList(list);
			};

			// -
			// 履歴を上書き
			// -
			_this.replaceHistory = function(){
				_setting_define.replaceHistory();
			};

			// -
			// プライベート変数
			// -
			var _setting_define;
			var _form_container;
			var _script_obj_editer_allow_url;

			// -
			// 初期化
			// -
			(function(){
				_setting_define = new ContentSettingDefine();
				var form_parent = _setting_define.getElementForm();
				var define = page_expand_project.getObject().replacement_to_anchor;

				// タイトル
				_setting_define.setTitle(_i18n.getMessage("menu_setting_replacement_to_anchor"));

				// グループ
				var group = new UI_GroupContainer(form_parent);
				var group_parent = group.getElement();

				// コールバックスクリプト
				var container = new UI_LineContainer(group_parent,_i18n.getMessage("menu_setting_replacement_to_anchor_script"));
				var parent = container.getElement();
				_script_obj_editer_allow_url = new UI_ScriptObjectEditer(parent);
				_script_obj_editer_allow_url.onchange = function(v){
					_setting_define.getSelectedDefinitions(function(c){
						PageExpandProjectScriptObject_CopyUserScript(c.script , v);
					});

					_setting_define.update();
					projectModify();
				};
				new UI_Break(form_parent);

				// データの関連付け
				_setting_define.attachDefineData(define);
				_setting_define.setDefineAssetName("replacement_to_anchor");
				_setting_define.setFunctionForNewData(createReplacementToAnchorData);

				// リスト選択
				_setting_define.onselect = function(id){
					var c = ProjectObjectGetActiveData(define[id]);
					if(!c)	return;

					// コールバックスクリプト
					_script_obj_editer_allow_url.setScriptObject(c.script);
				};

				// リロード
				_setting_define.onreload = function(){
					_config.MenuItemSelect(PageExpandConfig.MENU_TYPE_SETTING_REPLACEMENT_TO_ANCHOR);
				};

			})();
		}

		// -
		// ハイパーリンク置換定義
		// -
		function ContentSettingReplacementToLink(){
			var _this = this;

			// -
			// 選択
			// -
			_this.select = function(id){
				_setting_define.select(id);
			};

			// -
			// リストから選択
			// -
			_this.selectFromIdList = function(list){
				_setting_define.selectFromIdList(list);
			};

			// -
			// リストからフィルタを選択
			// -
			_this.selectFilterFromList = function(list){
				_filter_list.selectFromList(list);
			};

			// -
			// 履歴を上書き
			// -
			_this.replaceHistory = function(){
				_setting_define.replaceHistory();
				_filter_list.replaceHistory();
			};

			// -
			// プライベート変数
			// -
			var _setting_define;
			var _filter_list;
			var _text_input_name;
			var _url_edit_container;
			var _script_obj_editer;
			var _check_box_enable_reflect_to_anchor;
			var _check_box_enable_cache;
			var _form_container_filter_inner;
			var _form_container_filter_outer;

			// -
			// 初期化
			// -
			(function(){
				_setting_define = new ContentSettingDefine();
				var form_parent = _setting_define.getElementForm();
				var define = page_expand_project.getObject().replacement_to_link;

				// タイトル
				_setting_define.setTitle(_i18n.getMessage("menu_setting_replacement_to_link"));

				// フィルタ一覧
				var title = new UI_TitleSub(form_parent,_i18n.getMessage("menu_setting_replacement_to_link_filter_list"));

				// フィルタ更新
				function filterListUpdate(id){
					var visible = false;
					var c = ProjectObjectGetActiveData(_filter_list.getDefinitionActive());
					if(c){
						var filter = c.filter;
						if(0 <= id && id < filter.length){
							var filter = filter[id];
							_text_input_name.setValue(LocaleObjectGetString(filter.name));
							_url_edit_container.attachObject(filter.filter);
							_script_obj_editer.setScriptObject(filter.script);
							_check_box_enable_reflect_to_anchor.setValue(filter.enable_reflect_to_anchor);
							_check_box_enable_cache.setValue(filter.enable_cache);

							visible = true;
						}
					}

					_form_container_filter_inner.setVisible(visible);
					_form_container_filter_outer.setVisible(visible);
				}

				// グループ
				var group = new UI_GroupContainer(form_parent);
				var group_parent = group.getElement();

				// ファイルタリスト
				var container = new UI_LineContainer(group_parent,_i18n.getMessage("menu_setting_replacement_to_link_filter_list"));
				var parent = container.getElement();
				_filter_list = new UI_FilterList(parent);
				_filter_list.onselect = function(id){
					filterListUpdate(id);
				};
				_filter_list.onchange = function(id){
					_setting_define.update();
				};

				_form_container_filter_inner = new UI_FormContainer(group_parent);
				_form_container_filter_inner.setVisible(false);
				var form_parent_filter = _form_container_filter_inner.getElement();

				// フィルタ名
				var container = new UI_LineContainer(form_parent_filter,_i18n.getMessage("menu_setting_replacement_to_link_filter_name"));
				var parent = container.getElement();
				_text_input_name = new UI_TextInput(parent);
				_text_input_name.oninput = function(v){
					_filter_list.writeFilters(function(c){
						LocaleObjectSetString(c.name,v);
					});
					_filter_list.update();
					_setting_define.update();
					projectModify();
				};
				new UI_Break(form_parent);

				_form_container_filter_outer = new UI_FormContainer(form_parent);
				_form_container_filter_outer.setVisible(false);
				var form_parent_filter = _form_container_filter_outer.getElement();

				// フィルタ設定
				var title = new UI_TitleSub(form_parent_filter,_i18n.getMessage("menu_setting_replacement_to_link_filter"));

				// グループ
				var group = new UI_GroupContainer(form_parent_filter);
				var group_parent = group.getElement();

				// 対象 URL
				var container = new UI_LineContainer(group_parent,_i18n.getMessage("menu_setting_replacement_to_link_filter_filter_url"));
				var parent = container.getElement();
				_url_edit_container = new UI_UrlEditContainer(parent);
				_url_edit_container.onchange = function(v){
					_filter_list.writeFilters(function(c){
						c.filter = ObjectCopy(v);
					});
					_setting_define.update();
					projectModify();
				};

				// ハイパーリンクの設定
				var container = new UI_LineContainer(group_parent,_i18n.getMessage("menu_setting_replacement_to_link_check_box_container"));
				var parent = container.getElement();

				//リンクの変更をアンカーに反映する
				_check_box_enable_reflect_to_anchor = new UI_CheckBox(parent,_i18n.getMessage("menu_setting_replacement_to_link_enable_reflect_to_anchor"));
				_check_box_enable_reflect_to_anchor.onchange = function(v){
					_filter_list.writeFilters(function(c){
						c.enable_reflect_to_anchor = v;
					});

					_setting_define.update();
					projectModify();
				};

				//コールバックスクリプトの実行結果をキャッシュする
				_check_box_enable_cache = new UI_CheckBox(parent,_i18n.getMessage("menu_setting_replacement_to_link_enable_cache"));
				_check_box_enable_cache.onchange = function(v){
					_filter_list.writeFilters(function(c){
						c.enable_cache = v;
					});

					_setting_define.update();
					projectModify();
				};
				

				// コールバックスクリプト
				var container = new UI_LineContainer(group_parent,_i18n.getMessage("menu_setting_replacement_to_link_filter_script"));
				var parent = container.getElement();
				_script_obj_editer = new UI_ScriptObjectEditer(parent);
				_script_obj_editer.onchange = function(v){
					_filter_list.writeFilters(function(c){
						PageExpandProjectScriptObject_CopyUserScript(c.script , v);
					});

					_setting_define.update();
					projectModify();
				};
				new UI_Break(form_parent_filter);

				// データの関連付け
				_setting_define.attachDefineData(define);
				_setting_define.setDefineAssetName("replacement_to_link");
				_setting_define.setFunctionForNewData(createReplacementToLinkData);
				_filter_list.setFunctionForNewDefineData(createReplacementToLinkData);
				_filter_list.setFunctionForNewFilterData(createReplacementToLinkFilterItemData);
				_filter_list.setDefineAssetName("replacement_to_link");

				// リスト選択
				_setting_define.onselect = function(id){
					var c = ProjectObjectGetActiveData(define[id]);
					if(!c)	return;

					// フィルタ
					var ary = new Array();
					var indices = _setting_define.getSelectedIndices();
					for(var p in indices){
						ary.push(define[indices[p]]);
					}
					_filter_list.attachDefinitions(ary,define[id]);

					// フィルタ選択
					filterListUpdate(-1);
				};

				// リロード
				_setting_define.onreload = function(){
					_config.MenuItemSelect(PageExpandConfig.MENU_TYPE_SETTING_REPLACEMENT_TO_LINK);
				};

			})();
		}

		// -
		// リファラ置換定義
		// -
		function ContentSettingReplacementToReferer(){
			var _this = this;

			// -
			// 選択
			// -
			_this.select = function(id){
				_setting_define.select(id);
			};

			// -
			// リストから選択
			// -
			_this.selectFromIdList = function(list){
				_setting_define.selectFromIdList(list);
			};

			// -
			// リストからフィルタを選択
			// -
			_this.selectFilterFromList = function(list){
				_filter_list.selectFromList(list);
			};

			// -
			// 履歴を上書き
			// -
			_this.replaceHistory = function(){
				_setting_define.replaceHistory();
				_filter_list.replaceHistory();
			};

			// -
			// プライベート変数
			// -
			var _setting_define;
			var _filter_list;
			var _text_input_name;
			var _url_edit_container;
			var _combo_box_send_type;
			var _text_input_send_custom;
			var _text_regexp_send_regexp;
			var _text_input_send_replacement;
			var _form_container_filter_inner;
			var _form_container_filter_outer;
			var _form_container_send_custom;

			// -
			// 初期化
			// -
			(function(){
				_setting_define = new ContentSettingDefine();
				var form_parent = _setting_define.getElementForm();
				var define = page_expand_project.getObject().replacement_to_referer;

				// タイトル
				_setting_define.setTitle(_i18n.getMessage("menu_setting_replacement_to_referer"));

				// フィルタ一覧
				var title = new UI_TitleSub(form_parent,_i18n.getMessage("menu_setting_replacement_to_referer_filter_list"));

				// フィルタ更新
				function filterListUpdate(id){
					var visible = false;
					var c = ProjectObjectGetActiveData(_filter_list.getDefinitionActive());
					if(c){
						var filter = c.filter;
						if(0 <= id && id < filter.length){
							var filter = filter[id];
							_text_input_name.setValue(LocaleObjectGetString(filter.name));
							_url_edit_container.attachObject(filter.filter);
							_combo_box_send_type.setValue(filter.send_referer.type);
							_text_input_send_custom.setValue(filter.send_referer.custom);
							_text_regexp_send_regexp.setValue(filter.send_referer.regexp);
							_text_input_send_replacement.setValue(filter.send_referer.replacement);
							sendTypeUpdate();

							visible = true;
						}
					}

					_form_container_filter_inner.setVisible(visible);
					_form_container_filter_outer.setVisible(visible);
				}

				// 送信タイプ更新
				function sendTypeUpdate(){
					_form_container_send_custom.setVisible(_combo_box_send_type.getValue() == "custom");
				}

				// グループ
				var group = new UI_GroupContainer(form_parent);
				var group_parent = group.getElement();

				// ファイルタリスト
				var container = new UI_LineContainer(group_parent,_i18n.getMessage("menu_setting_replacement_to_referer_filter_list"));
				var parent = container.getElement();
				_filter_list = new UI_FilterList(parent);
				_filter_list.onselect = function(id){
					filterListUpdate(id);
				};
				_filter_list.onchange = function(id){
					_setting_define.update();
				};

				_form_container_filter_inner = new UI_FormContainer(group_parent);
				_form_container_filter_inner.setVisible(false);
				var form_parent_filter = _form_container_filter_inner.getElement();

				// フィルタ名
				var container = new UI_LineContainer(form_parent_filter,_i18n.getMessage("menu_setting_replacement_to_referer_filter_name"));
				var parent = container.getElement();
				_text_input_name = new UI_TextInput(parent);
				_text_input_name.oninput = function(v){
					_filter_list.writeFilters(function(c){
						LocaleObjectSetString(c.name,v);
					});
					_filter_list.update();
					_setting_define.update();
					projectModify();
				};
				new UI_Break(form_parent);

				_form_container_filter_outer = new UI_FormContainer(form_parent);
				_form_container_filter_outer.setVisible(false);
				var form_parent_filter = _form_container_filter_outer.getElement();

				// フィルタ設定
				var title = new UI_TitleSub(form_parent_filter,_i18n.getMessage("menu_setting_replacement_to_referer_filter"));

				// グループ
				var group = new UI_GroupContainer(form_parent_filter);
				var group_parent = group.getElement();

				// 対象 URL
				var container = new UI_LineContainer(group_parent,_i18n.getMessage("menu_setting_replacement_to_referer_filter_filter_url"));
				var parent = container.getElement();
				_url_edit_container = new UI_UrlEditContainer(parent);
				_url_edit_container.onchange = function(v){
					_filter_list.writeFilters(function(c){
						c.filter = ObjectCopy(v);
					});
					_setting_define.update();
					projectModify();
				};

				// 基本送信データ
				var container = new UI_LineContainer(group_parent,_i18n.getMessage("menu_setting_replacement_to_referer_filter_send_type"));
				var parent = container.getElement();

				new UI_TitleItem(parent,_i18n.getMessage("menu_setting_replacement_to_referer_filter_send_type_combo_box_item"));
				_combo_box_send_type = new UI_ComboBox(parent);
				_combo_box_send_type.attachItem(_i18n.getMessage("menu_setting_replacement_to_referer_filter_send_type_combo_box_item_default"),"default");
				_combo_box_send_type.attachItem(_i18n.getMessage("menu_setting_replacement_to_referer_filter_send_type_combo_box_item_current_url"),"current_url");
				_combo_box_send_type.attachItem(_i18n.getMessage("menu_setting_replacement_to_referer_filter_send_type_combo_box_item_link_url"),"link_url");
				_combo_box_send_type.attachItem(_i18n.getMessage("menu_setting_replacement_to_referer_filter_send_type_combo_box_item_custom"),"custom");
				_combo_box_send_type.onchange = function(v){
					_filter_list.writeFilters(function(c){
						c.send_referer.type = v;
					});
					_setting_define.update();
					projectModify();
					sendTypeUpdate();
				};

				_form_container_send_custom = new UI_FormContainer(parent);
				_form_container_send_custom.setVisible(false);
				var form_parent_send_custom = _form_container_send_custom.getElement();

				new UI_BreakItem(form_parent_send_custom);
				new UI_TitleItem(form_parent_send_custom,_i18n.getMessage("menu_setting_replacement_to_referer_filter_send_custom"));
				_text_input_send_custom = new UI_TextInput(form_parent_send_custom);
				_text_input_send_custom.oninput = function(v){
					_filter_list.writeFilters(function(c){
						c.send_referer.custom = v;
					});
					_setting_define.update();
					projectModify();
				};

				// 基本送信データを正規表現で置換
				var container = new UI_LineContainer(group_parent,_i18n.getMessage("menu_setting_replacement_to_referer_filter_send_regexp"));
				var parent = container.getElement();

				new UI_TitleItem(parent,_i18n.getMessage("menu_setting_replacement_to_referer_filter_send_regexp_match"));
				_text_regexp_send_regexp = new UI_TextRegExp(parent);
				_text_regexp_send_regexp.oninput = function(v){
					_filter_list.writeFilters(function(c){
						c.send_referer.regexp = ObjectCopy(v);
					});
					_setting_define.update();
					projectModify();
				};
				new UI_BreakItem(parent);

				new UI_TitleItem(parent,_i18n.getMessage("menu_setting_replacement_to_referer_filter_send_regexp_replacement"));
				_text_input_send_replacement = new UI_TextInput(parent);
				_text_input_send_replacement.oninput = function(v){
					_filter_list.writeFilters(function(c){
						c.send_referer.replacement = v;
					});
					_setting_define.update();
					projectModify();
				};
				new UI_TextHint(parent,_i18n.getMessage("menu_setting_replacement_to_referer_filter_send_regexp_replacement_hint"));
				new UI_Break(form_parent_filter);

				// データの関連付け
				_setting_define.attachDefineData(define);
				_setting_define.setDefineAssetName("replacement_to_referer");
				_setting_define.setFunctionForNewData(createReplacementToRefererData);
				_filter_list.setFunctionForNewDefineData(createReplacementToRefererData);
				_filter_list.setFunctionForNewFilterData(createReplacementToRefererFilterItemData);
				_filter_list.setDefineAssetName("replacement_to_referer");

				// リスト選択
				_setting_define.onselect = function(id){
					var c = ProjectObjectGetActiveData(define[id]);
					if(!c)	return;

					// フィルタ
					var ary = new Array();
					var indices = _setting_define.getSelectedIndices();
					for(var p in indices){
						ary.push(define[indices[p]]);
					}
					_filter_list.attachDefinitions(ary,define[id]);

					// フィルタ選択
					filterListUpdate(-1);
				};

				// リロード
				_setting_define.onreload = function(){
					_config.MenuItemSelect(PageExpandConfig.MENU_TYPE_SETTING_REPLACEMENT_TO_REFERER);
				};

			})();
		}

		// -
		// ユーザーエージェント置換定義
		// -
		function ContentSettingReplacementToUserAgent(){
			var _this = this;

			// -
			// 選択
			// -
			_this.select = function(id){
				_setting_define.select(id);
			};

			// -
			// リストから選択
			// -
			_this.selectFromIdList = function(list){
				_setting_define.selectFromIdList(list);
			};

			// -
			// リストからフィルタを選択
			// -
			_this.selectFilterFromList = function(list){
				_filter_list.selectFromList(list);
			};

			// -
			// 履歴を上書き
			// -
			_this.replaceHistory = function(){
				_setting_define.replaceHistory();
				_filter_list.replaceHistory();
			};

			// -
			// プライベート変数
			// -
			var _setting_define;
			var _filter_list;
			var _text_input_name;
			var _url_edit_container;
			var _text_input_send_custom;
			var _form_container_filter_inner;
			var _form_container_filter_outer;

			// -
			// 初期化
			// -
			(function(){
				_setting_define = new ContentSettingDefine();
				var form_parent = _setting_define.getElementForm();
				var define = page_expand_project.getObject().replacement_to_useragent;

				// フィルタ一覧
				var title = new UI_TitleSub(form_parent,_i18n.getMessage("menu_setting_replacement_to_useragent_filter_list"));

				// フィルタ更新
				function filterListUpdate(id){
					var visible = false;
					var c = ProjectObjectGetActiveData(_filter_list.getDefinitionActive());
					if(c){
						var filter = c.filter;
						if(0 <= id && id < filter.length){
							var filter = filter[id];
							_text_input_name.setValue(LocaleObjectGetString(filter.name));
							_url_edit_container.attachObject(filter.filter);
							_text_input_send_custom.setValue(filter.send_useragent.custom);

							visible = true;
						}
					}

					_form_container_filter_inner.setVisible(visible);
					_form_container_filter_outer.setVisible(visible);
				}

				// グループ
				var group = new UI_GroupContainer(form_parent);
				var group_parent = group.getElement();

				// ファイルタリスト
				var container = new UI_LineContainer(group_parent,_i18n.getMessage("menu_setting_replacement_to_useragent_filter_list"));
				var parent = container.getElement();
				_filter_list = new UI_FilterList(parent);
				_filter_list.onselect = function(id){
					filterListUpdate(id);
				};
				_filter_list.onchange = function(id){
					_setting_define.update();
				};

				_form_container_filter_inner = new UI_FormContainer(group_parent);
				_form_container_filter_inner.setVisible(false);
				var form_parent_filter = _form_container_filter_inner.getElement();

				// フィルタ名
				var container = new UI_LineContainer(form_parent_filter,_i18n.getMessage("menu_setting_replacement_to_useragent_filter_name"));
				var parent = container.getElement();
				_text_input_name = new UI_TextInput(parent);
				_text_input_name.oninput = function(v){
					_filter_list.writeFilters(function(c){
						LocaleObjectSetString(c.name,v);
					});
					_filter_list.update();
					_setting_define.update();
					projectModify();
				};
				new UI_Break(form_parent);

				_form_container_filter_outer = new UI_FormContainer(form_parent);
				_form_container_filter_outer.setVisible(false);
				var form_parent_filter = _form_container_filter_outer.getElement();

				// フィルタ設定
				var title = new UI_TitleSub(form_parent_filter,_i18n.getMessage("menu_setting_replacement_to_useragent_filter"));

				// グループ
				var group = new UI_GroupContainer(form_parent_filter);
				var group_parent = group.getElement();

				// 対象 URL
				var container = new UI_LineContainer(group_parent,_i18n.getMessage("menu_setting_replacement_to_useragent_filter_filter_url"));
				var parent = container.getElement();
				_url_edit_container = new UI_UrlEditContainer(parent);
				_url_edit_container.onchange = function(v){
					_filter_list.writeFilters(function(c){
						c.filter = ObjectCopy(v);
					});
					_setting_define.update();
					projectModify();
				};

				// 基本送信データ
				var container = new UI_LineContainer(group_parent,_i18n.getMessage("menu_setting_replacement_to_useragent_filter_send"));
				var parent = container.getElement();

				new UI_TitleItem(parent,_i18n.getMessage("menu_setting_replacement_to_useragent_filter_send_custom"));
				_text_input_send_custom = new UI_TextInput(parent);
				_text_input_send_custom.oninput = function(v){
					_filter_list.writeFilters(function(c){
						c.send_useragent.custom = v;
					});
					_setting_define.update();
					projectModify();
				};
				new UI_Break(form_parent_filter);

				// タイトル
				_setting_define.setTitle(_i18n.getMessage("menu_setting_replacement_to_useragent"));

				// データの関連付け
				_setting_define.attachDefineData(define);
				_setting_define.setDefineAssetName("replacement_to_useragent");
				_setting_define.setFunctionForNewData(createReplacementToUserAgentData);
				_filter_list.setFunctionForNewDefineData(createReplacementToUserAgentData);
				_filter_list.setFunctionForNewFilterData(createReplacementToUserAgentFilterItemData);
				_filter_list.setDefineAssetName("replacement_to_useragent");

				// リスト選択
				_setting_define.onselect = function(id){
					var c = ProjectObjectGetActiveData(define[id]);
					if(!c)	return;

					// フィルタ
					var ary = new Array();
					var indices = _setting_define.getSelectedIndices();
					for(var p in indices){
						ary.push(define[indices[p]]);
					}
					_filter_list.attachDefinitions(ary,define[id]);

					// フィルタ選択
					filterListUpdate(-1);
				};

				// リロード
				_setting_define.onreload = function(){
					_config.MenuItemSelect(PageExpandConfig.MENU_TYPE_SETTING_REPLACEMENT_TO_USERAGENT);
				};

			})();
		}

		// -
		// ハイパーリンク化定義
		// -
		function ContentSettingMakeLinkToText(){
			var _this = this;

			// -
			// 選択
			// -
			_this.select = function(id){
				_setting_define.select(id);
			};

			// -
			// リストから選択
			// -
			_this.selectFromIdList = function(list){
				_setting_define.selectFromIdList(list);
			};

			// -
			// 履歴を上書き
			// -
			_this.replaceHistory = function(){
				_setting_define.replaceHistory();
			};

			// -
			// プライベート変数
			// -
			var _setting_define;
			var _script_obj_editer;

			// -
			// 初期化
			// -
			(function(){
				_setting_define = new ContentSettingDefine();
				var form_parent = _setting_define.getElementForm();
				var define = page_expand_project.getObject().make_link_to_text;

				// タイトル
				_setting_define.setTitle(_i18n.getMessage("menu_setting_make_link_to_text"));

				// グループ
				var group = new UI_GroupContainer(form_parent);
				var group_parent = group.getElement();

				// コールバックスクリプト
				var container = new UI_LineContainer(group_parent,_i18n.getMessage("menu_setting_make_link_to_text_script"));
				var parent = container.getElement();
				_script_obj_editer = new UI_ScriptObjectEditer(parent);
				_script_obj_editer.onchange = function(v){
					_setting_define.getSelectedDefinitions(function(c){
						PageExpandProjectScriptObject_CopyUserScript(c.script , v);
					});

					_setting_define.update();
					projectModify();
				};
				new UI_Break(form_parent);

				// データの関連付け
				_setting_define.attachDefineData(define);
				_setting_define.setDefineAssetName("make_link_to_text");
				_setting_define.setFunctionForNewData(createMakeLinkToTextData);

				// リスト選択
				_setting_define.onselect = function(id){
					var c = ProjectObjectGetActiveData(define[id]);
					if(!c)	return;

					// コールバックスクリプト
					_script_obj_editer.setScriptObject(c.script);
				};

				// リロード
				_setting_define.onreload = function(){
					_config.MenuItemSelect(PageExpandConfig.MENU_TYPE_SETTING_MAKE_LINK_TO_TEXT);
				};

			})();
		}

		// -
		// 短縮 URL の展開の定義
		// -
		function ContentSettingExpandShortUrl(){
			var _this = this;

			// -
			// 選択
			// -
			_this.select = function(id){
				_setting_define.select(id);
			};

			// -
			// リストから選択
			// -
			_this.selectFromIdList = function(list){
				_setting_define.selectFromIdList(list);
			};

			// -
			// 履歴を上書き
			// -
			_this.replaceHistory = function(){
				_setting_define.replaceHistory();
			};

			// -
			// プライベート変数
			// -
			var _setting_define;
			var _form_container;
			var _url_edit_container;

			// -
			// 初期化
			// -
			(function(){
				_setting_define = new ContentSettingDefine();
				var form_parent = _setting_define.getElementForm();
				var define = page_expand_project.getObject().expand_short_url;

				// タイトル
				_setting_define.setTitle(_i18n.getMessage("menu_setting_expand_short_url"));

				// グループ
				var group = new UI_GroupContainer(form_parent);
				var group_parent = group.getElement();

				// 対象 URL
				var container = new UI_LineContainer(group_parent,_i18n.getMessage("menu_setting_expand_short_url_filter_url"));
				var parent = container.getElement();
				_url_edit_container = new UI_UrlEditContainer(parent);
				_url_edit_container.onchange = function(v){
					_setting_define.getSelectedDefinitions(function(c){
						c.filter = ObjectCopy(v);
					});

					_setting_define.update();
					projectModify();
				};
				new UI_Break(form_parent);

				// データの関連付け
				_setting_define.attachDefineData(define);
				_setting_define.setDefineAssetName("expand_short_url");
				_setting_define.setFunctionForNewData(createExpandShortUrlData);

				// リスト選択
				_setting_define.onselect = function(id){
					var c = ProjectObjectGetActiveData(define[id]);
					if(!c)	return;

					// 対象 URL
					_url_edit_container.attachObject(c.filter);
				};

				// リロード
				_setting_define.onreload = function(){
					_config.MenuItemSelect(PageExpandConfig.MENU_TYPE_SETTING_EXPAND_SHORT_URL);
				};

			})();
		}

		// -
		// テキストの展開の定義
		// -
		function ContentSettingExpandText(){
			var _this = this;

			// -
			// 選択
			// -
			_this.select = function(id){
				_setting_define.select(id);
			};

			// -
			// リストから選択
			// -
			_this.selectFromIdList = function(list){
				_setting_define.selectFromIdList(list);
			};

			// -
			// 履歴を上書き
			// -
			_this.replaceHistory = function(){
				_setting_define.replaceHistory();
			};

			// -
			// プライベート変数
			// -
			var _setting_define;
			var _form_container;

			// -
			// 初期化
			// -
			(function(){
				_setting_define = new ContentSettingDefine();
				var form_parent = _setting_define.getElementForm();
				var define = page_expand_project.getObject().expand_text;

				// タイトル
				_setting_define.setTitle(_i18n.getMessage("menu_setting_expand_text"));

				// タイトル
				var title = new UI_TitleSub(form_parent,_i18n.getMessage("menu_setting_expand_text_inline"));

				// グループ
				var group = new UI_GroupContainer(form_parent);
				var group_parent = group.getElement();

				// インライン表示の設定
				var container = new UI_LineContainer(group_parent,_i18n.getMessage("menu_setting_expand_text_inline_check_box_container"));
				var parent = container.getElement();

				// 同じURLは展開しない
				var check_box_disable_same_text = new UI_CheckBox(parent,_i18n.getMessage("menu_setting_expand_text_inline_disable_same_text"));
				check_box_disable_same_text.onchange = function(v){
					_setting_define.getSelectedDefinitions(function(c){
						c.inline.disable_same_text = v;
					});

					_setting_define.update();
					projectModify();
				};

				// リンクからインライン表示する条件
				var container = new UI_LineContainer(group_parent,_i18n.getMessage("menu_setting_expand_text_inline_script_allow"));
				var parent = container.getElement();
				var script_obj_editer_inline_script_allow = new UI_ScriptObjectEditer(parent);
				script_obj_editer_inline_script_allow.onchange = function(v){
					_setting_define.getSelectedDefinitions(function(c){
						PageExpandProjectScriptObject_CopyUserScript(c.inline.script_allow , v);
					});

					_setting_define.update();
					projectModify();
				};

				// テキストの挿入位置
				var container = new UI_LineContainer(group_parent,_i18n.getMessage("menu_setting_expand_text_inline_script_insert"));
				var parent = container.getElement();
				var script_obj_editer_inline_script_insert = new UI_ScriptObjectEditer(parent);
				script_obj_editer_inline_script_insert.onchange = function(v){
					_setting_define.getSelectedDefinitions(function(c){
						PageExpandProjectScriptObject_CopyUserScript(c.inline.script_insert , v);
					});

					_setting_define.update();
					projectModify();
				};
				new UI_Break(form_parent);

				// データの関連付け
				_setting_define.attachDefineData(define);
				_setting_define.setDefineAssetName("expand_text");
				_setting_define.setFunctionForNewData(createExpandText);

				// リスト選択
				_setting_define.onselect = function(id){
					var c = ProjectObjectGetActiveData(define[id]);
					if(!c)	return;

					// 同じURLは展開しない
					check_box_disable_same_text.setValue(c.inline.disable_same_text);
					// リンクからインライン表示する条件
					script_obj_editer_inline_script_allow.setScriptObject(c.inline.script_allow);
					// テキストの挿入位置
					script_obj_editer_inline_script_insert.setScriptObject(c.inline.script_insert);
				};

				// リロード
				_setting_define.onreload = function(){
					_config.MenuItemSelect(PageExpandConfig.MENU_TYPE_SETTING_EXPAND_TEXT);
				};

			})();
		}

		// -
		// 画像の展開の定義
		// -
		function ContentSettingExpandImage(){
			var _this = this;

			// -
			// 選択
			// -
			_this.select = function(id){
				_setting_define.select(id);
			};

			// -
			// リストから選択
			// -
			_this.selectFromIdList = function(list){
				_setting_define.selectFromIdList(list);
			};

			// -
			// 履歴を上書き
			// -
			_this.replaceHistory = function(){
				_setting_define.replaceHistory();
			};

			// -
			// プライベート変数
			// -
			var _setting_define;
			var _form_container;
			var _form_container_thumbnail;
			var _form_container_popup;
			var _form_container_reduced_image;
			var _form_container_unload;
			var _selected_id;

			// -
			// 初期化
			// -
			(function(){
				_setting_define = new ContentSettingDefine();
				var form_parent = _setting_define.getElementForm();
				var define = page_expand_project.getObject().expand_image;

				// タイトル
				_setting_define.setTitle(_i18n.getMessage("menu_setting_expand_image"));

				// フォーム更新
				function formUpdate(){
					var c = ProjectObjectGetActiveData(define[_selected_id]);
					if(c){
						_form_container_thumbnail.setVisible(c.thumbnail.enable_thumbnail);
						_form_container_popup.setVisible((c.thumbnail.enable_thumbnail || c.popup.enable_popup_mouseover || c.reduced_image.enable_popup));
						_form_container_reduced_image.setVisible(c.reduced_image.enable_popup);
					}
				}

				// 縮小イメージ設定
				var title = new UI_TitleSub(form_parent,_i18n.getMessage("menu_setting_expand_image_reduced_image"));

				// グループ
				var group = new UI_GroupContainer(form_parent);
				var group_parent = group.getElement();

				// 有効/無効
				var container = new UI_LineContainer(group_parent,_i18n.getMessage("menu_setting_expand_image_reduced_image_check_box_container"));
				var parent = container.getElement();

				// 縮小されたイメージをマウスオーバーするとポップアップ表示
				var check_box_reduced_image_enable_popup = new UI_CheckBox(parent,_i18n.getMessage("menu_setting_expand_image_popup_enable_popup"));
				check_box_reduced_image_enable_popup.onchange = function(v){
					_setting_define.getSelectedDefinitions(function(c){
						c.reduced_image.enable_popup = v;
					});

					formUpdate();
					_setting_define.update();
					projectModify();
				};

				_form_container_reduced_image = new UI_FormContainer(group_parent);
				_form_container_reduced_image.setVisible(false);
				var form_parent_reduced_image = _form_container_reduced_image.getElement();


				// 縮小イメージのポップアップ化条件
				var container = new UI_LineContainer(form_parent_reduced_image,_i18n.getMessage("menu_setting_expand_image_reduced_image_allow_slcale_less_then"));
				var parent = container.getElement();

				// 縮小率
				var stepper_popup_allow_slcale_less_then = new UI_NumericStepper(parent);
				stepper_popup_allow_slcale_less_then.setMinimum(0);
				stepper_popup_allow_slcale_less_then.setMaximum(100);
				stepper_popup_allow_slcale_less_then.oninput = function(v){
					_setting_define.getSelectedDefinitions(function(c){
						c.reduced_image.popup_allow_slcale_less_then = v;
					});

					_setting_define.update();
					projectModify();
				};
				new UI_TextItem(parent,_i18n.getMessage("menu_setting_expand_image_reduced_image_allow_slcale_less_then_text"));
				new UI_Break(form_parent);

				// サムネイル表示設定
				var title = new UI_TitleSub(form_parent,_i18n.getMessage("menu_setting_expand_image_thumbnail"));

				// グループ
				var group = new UI_GroupContainer(form_parent);
				var group_parent = group.getElement();

				// 有効/無効
				var container = new UI_LineContainer(group_parent,_i18n.getMessage("menu_setting_expand_image_thumbnail_enable_check_box_container"));
				var parent = container.getElement();

				// サムネイルを表示する
				var check_box_enable_thumbnail = new UI_CheckBox(parent,_i18n.getMessage("menu_setting_expand_image_thumbnail_enable_thumbnail"));
				check_box_enable_thumbnail.onchange = function(v){
					_setting_define.getSelectedDefinitions(function(c){
						c.thumbnail.enable_thumbnail = v;
					});

					formUpdate();
					_setting_define.update();
					projectModify();
				};

				_form_container_thumbnail = new UI_FormContainer(group_parent);
				_form_container_thumbnail.setVisible(false);
				var form_parent_thumbnail = _form_container_thumbnail.getElement();

				// サムネイル表示設定
				var container = new UI_LineContainer(form_parent_thumbnail,_i18n.getMessage("menu_setting_expand_image_thumbnail_check_box_container"));
				var parent = container.getElement();

				// サムネイルにマウスオーバーするとポップアップ表示
				var check_box_enable_popup_mouseover = new UI_CheckBox(parent,_i18n.getMessage("menu_setting_expand_image_thumbnail_enable_popup_mouseover"));
				check_box_enable_popup_mouseover.onchange = function(v){
					_setting_define.getSelectedDefinitions(function(c){
						c.thumbnail.enable_popup_mouseover = v;
					});

					_setting_define.update();
					projectModify();
				};

				// 同じイメージがすでに配置されている場合サムネイルを表示しない
				var check_box_disable_same_thumbnail_image = new UI_CheckBox(parent,_i18n.getMessage("menu_setting_expand_image_thumbnail_disable_same_thumbnail_image"));
				check_box_disable_same_thumbnail_image.onchange = function(v){
					_setting_define.getSelectedDefinitions(function(c){
						c.thumbnail.disable_same_image = v;
					});

					_setting_define.update();
					projectModify();
				};

				// サムネイルの表示サイズ
				var container = new UI_LineContainer(form_parent_thumbnail,_i18n.getMessage("menu_setting_expand_image_thumbnail_size"));
				var parent = container.getElement();
				// 最小許容限界(ピクセル値)
				new UI_TitleItem(parent,_i18n.getMessage("menu_setting_expand_image_thumbnail_size_min"));
				var stepper_thumbnail_width_min = new UI_NumericStepper(parent);
				stepper_thumbnail_width_min.setMinimum(0);
				stepper_thumbnail_width_min.setMaximum(9999999);
				stepper_thumbnail_width_min.oninput = function(v){
					_setting_define.getSelectedDefinitions(function(c){
						c.thumbnail.width_min = v;
					});

					_setting_define.update();
					projectModify();
				};
				new UI_BreakItem(parent);

				// 基本拡大率(パーセント)
				new UI_TitleItem(parent,_i18n.getMessage("menu_setting_expand_image_thumbnail_size_scale"));
				var stepper_thumbnail_scale_percent = new UI_NumericStepper(parent);
				stepper_thumbnail_scale_percent.setMinimum(0);
				stepper_thumbnail_scale_percent.setMaximum(9999999);
				stepper_thumbnail_scale_percent.oninput = function(v){
					_setting_define.getSelectedDefinitions(function(c){
						c.thumbnail.scale_percent = v;
					});

					_setting_define.update();
					projectModify();
				};
				new UI_BreakItem(parent);

				// 最大許容限界(ピクセル値)
				new UI_TitleItem(parent,_i18n.getMessage("menu_setting_expand_image_thumbnail_size_max"));
				var stepper_thumbnail_width_max = new UI_NumericStepper(parent);
				stepper_thumbnail_width_max.setMinimum(0);
				stepper_thumbnail_width_max.setMaximum(9999999);
				stepper_thumbnail_width_max.oninput = function(v){
					_setting_define.getSelectedDefinitions(function(c){
						c.thumbnail.width_max = v;
					});

					_setting_define.update();
					projectModify();
				};

				// イメージのロード設定
				var container = new UI_LineContainer(form_parent_thumbnail,_i18n.getMessage("menu_setting_expand_image_load_start_type"));
				var parent = container.getElement();
				var combo_box_thumbnail_load_type = new UI_ComboBox(parent);
				combo_box_thumbnail_load_type.attachItem(_i18n.getMessage("menu_setting_expand_image_load_start_type_preload"),"preload");
				combo_box_thumbnail_load_type.attachItem(_i18n.getMessage("menu_setting_expand_image_load_start_type_scroll"),"scroll");
				combo_box_thumbnail_load_type.onchange = function(v){
					_setting_define.getSelectedDefinitions(function(c){
						c.thumbnail.load_type = v;
					});

					_setting_define.update();
					projectModify();
				};

				// リンクからサムネイル化する条件
				var container = new UI_LineContainer(form_parent_thumbnail,_i18n.getMessage("menu_setting_expand_image_thumbnail_script_allow"));
				var parent = container.getElement();
				var script_obj_editer_thumbnail_script_allow = new UI_ScriptObjectEditer(parent);
				script_obj_editer_thumbnail_script_allow.onchange = function(v){
					_setting_define.getSelectedDefinitions(function(c){
						PageExpandProjectScriptObject_CopyUserScript(c.thumbnail.script_allow , v);
					});

					_setting_define.update();
					projectModify();
				};

				// サムネイルの挿入位置
				var container = new UI_LineContainer(form_parent_thumbnail,_i18n.getMessage("menu_setting_expand_image_thumbnail_script_insert"));
				var parent = container.getElement();
				var script_obj_editer_thumbnail_script_insert = new UI_ScriptObjectEditer(parent);
				script_obj_editer_thumbnail_script_insert.onchange = function(v){
					_setting_define.getSelectedDefinitions(function(c){
						PageExpandProjectScriptObject_CopyUserScript(c.thumbnail.script_insert , v);
					});

					_setting_define.update();
					projectModify();
				};
				new UI_Break(form_parent);

				// ポップアップ表示設定
				var title = new UI_TitleSub(form_parent,_i18n.getMessage("menu_setting_expand_image_popup"));

				// グループ
				var group = new UI_GroupContainer(form_parent);
				var group_parent = group.getElement();

				// 有効/無効
				var container = new UI_LineContainer(group_parent,_i18n.getMessage("menu_setting_expand_image_popup_enable_check_box_container"));
				var parent = container.getElement();

				// ポップアップ表示の有無
				var check_box_popup_enable_popup_mouseover = new UI_CheckBox(parent,_i18n.getMessage("menu_setting_expand_image_popup_enable_popup_mouseover"));
				check_box_popup_enable_popup_mouseover.onchange = function(v){
					_setting_define.getSelectedDefinitions(function(c){
						c.popup.enable_popup_mouseover = v;
					});

					formUpdate();
					_setting_define.update();
					projectModify();
				};

				_form_container_popup = new UI_FormContainer(group_parent);
				_form_container_popup.setVisible(false);
				var form_parent_popup = _form_container_popup.getElement();

				// ポップアップ表示設定
				var container = new UI_LineContainer(form_parent_popup,_i18n.getMessage("menu_setting_expand_image_popup_check_box_container"));
				var parent = container.getElement();

				// ポップアップ時のスケールアニメーション動作を有効
				var check_box_enable_animation_scale = new UI_CheckBox(parent,_i18n.getMessage("menu_setting_expand_image_popup_enable_animation_scale"));
				check_box_enable_animation_scale.onchange = function(v){
					_setting_define.getSelectedDefinitions(function(c){
						c.popup.enable_animation_scale = v;
					});

					_setting_define.update();
					projectModify();
				};
				// ポップアップ時のアルファアニメーション動作を有効
				var check_box_enable_animation_alpha = new UI_CheckBox(parent,_i18n.getMessage("menu_setting_expand_image_popup_enable_animation_alpha"));
				check_box_enable_animation_alpha.onchange = function(v){
					_setting_define.getSelectedDefinitions(function(c){
						c.popup.enable_animation_alpha = v;
					});

					_setting_define.update();
					projectModify();
				};

				// イメージのロード設定
				var container = new UI_LineContainer(form_parent_popup,_i18n.getMessage("menu_setting_expand_image_load_start_type"));
				var parent = container.getElement();
				var combo_box_popup_load_type = new UI_ComboBox(parent);
				combo_box_popup_load_type.attachItem(_i18n.getMessage("menu_setting_expand_image_load_start_type_preload"),"preload");
				combo_box_popup_load_type.attachItem(_i18n.getMessage("menu_setting_expand_image_load_start_type_scroll"),"scroll");
				combo_box_popup_load_type.onchange = function(v){
					_setting_define.getSelectedDefinitions(function(c){
						c.popup.load_type = v;
					});

					_setting_define.update();
					projectModify();
				};

				// ポップアップイメージの配置基点
				var container = new UI_LineContainer(form_parent_popup,_i18n.getMessage("menu_setting_expand_image_popup_origin_type"));
				var parent = container.getElement();
				var combo_box_popup_origin_type = new UI_ComboBox(parent);
				combo_box_popup_origin_type.attachItem(_i18n.getMessage("menu_setting_expand_image_popup_origin_type_combo_box_item_center"),"center");
				combo_box_popup_origin_type.attachItem(_i18n.getMessage("menu_setting_expand_image_popup_origin_type_combo_box_item_upper_left"),"upper_left");
				combo_box_popup_origin_type.attachItem(_i18n.getMessage("menu_setting_expand_image_popup_origin_type_combo_box_item_upper_right"),"upper_right");
				combo_box_popup_origin_type.attachItem(_i18n.getMessage("menu_setting_expand_image_popup_origin_type_combo_box_item_client_center"),"client_center");
				combo_box_popup_origin_type.attachItem(_i18n.getMessage("menu_setting_expand_image_popup_origin_type_combo_box_item_adsorb_element"),"adsorb_element");
				combo_box_popup_origin_type.attachItem(_i18n.getMessage("menu_setting_expand_image_popup_origin_type_combo_box_item_adsorb_mouse"),"adsorb_mouse");
				combo_box_popup_origin_type.onchange = function(v){
					_setting_define.getSelectedDefinitions(function(c){
						c.popup.origin_type = v;
					});

					_setting_define.update();
					projectModify();
				};

				// ポップアップイメージの配置位置
				var container = new UI_LineContainer(form_parent_popup,_i18n.getMessage("menu_setting_expand_image_popup_position_type"));
				var parent = container.getElement();
				var combo_box_popup_position_type = new UI_ComboBox(parent);
				combo_box_popup_position_type.attachItem(_i18n.getMessage("menu_setting_expand_image_popup_position_type_combo_box_item_absolute"),"absolute");
				combo_box_popup_position_type.attachItem(_i18n.getMessage("menu_setting_expand_image_popup_position_type_combo_box_item_fixed"),"fixed");
				combo_box_popup_position_type.onchange = function(v){
					_setting_define.getSelectedDefinitions(function(c){
						c.popup.position_type = v;
					});

					_setting_define.update();
					projectModify();
				};

				// ポップアップイメージの表示サイズ
				var container = new UI_LineContainer(form_parent_popup,_i18n.getMessage("menu_setting_expand_image_popup_size"));
				var parent = container.getElement();
				// 拡大率(パーセント)
				new UI_TitleItem(parent,_i18n.getMessage("menu_setting_expand_image_popup_size_scale"));
				var stepper_popup_scale_percent = new UI_NumericStepper(parent);
				stepper_popup_scale_percent.setMinimum(0);
				stepper_popup_scale_percent.setMaximum(9999999);
				stepper_popup_scale_percent.oninput = function(v){
					_setting_define.getSelectedDefinitions(function(c){
						c.popup.scale_percent = v;
					});

					_setting_define.update();
					projectModify();
				};

				// ポップアップ時間
				var container = new UI_LineContainer(form_parent_popup,_i18n.getMessage("menu_setting_expand_image_popup_time"));
				var parent = container.getElement();
				// 開くまでに待機する時間(ミリ秒)
				new UI_TitleItem(parent,_i18n.getMessage("menu_setting_expand_image_popup_time_wait_open"));
				var stepper_popup_time_wait_open = new UI_NumericStepper(parent);
				stepper_popup_time_wait_open.setMinimum(0);
				stepper_popup_time_wait_open.setMaximum(9999999);
				stepper_popup_time_wait_open.oninput = function(v){
					_setting_define.getSelectedDefinitions(function(c){
						c.popup.time_wait_open = v;
					});

					_setting_define.update();
					projectModify();
				};
				new UI_BreakItem(parent);

				// 閉じるまでに待機する時間(ミリ秒)
				new UI_TitleItem(parent,_i18n.getMessage("menu_setting_expand_image_popup_time_wait_close"));
				var stepper_popup_time_wait_close = new UI_NumericStepper(parent);
				stepper_popup_time_wait_close.setMinimum(0);
				stepper_popup_time_wait_close.setMaximum(9999999);
				stepper_popup_time_wait_close.oninput = function(v){
					_setting_define.getSelectedDefinitions(function(c){
						c.popup.time_wait_close = v;
					});

					_setting_define.update();
					projectModify();
				};

				// リンクからポップアップ表示する条件
				var container = new UI_LineContainer(form_parent_popup,_i18n.getMessage("menu_setting_expand_image_popup_script_allow"));
				var parent = container.getElement();
				var script_obj_editer_popup_script_allow = new UI_ScriptObjectEditer(parent);
				script_obj_editer_popup_script_allow.onchange = function(v){
					_setting_define.getSelectedDefinitions(function(c){
						PageExpandProjectScriptObject_CopyUserScript(c.popup.script_allow , v);
					});

					_setting_define.update();
					projectModify();
				};
				new UI_Break(form_parent);

				// イメージのロード設定
				var title = new UI_TitleSub(form_parent,_i18n.getMessage("menu_setting_expand_image_load"));

				// グループ
				var group = new UI_GroupContainer(form_parent);
				var group_parent = group.getElement();

				// イメージ読み込み設定
				var container = new UI_LineContainer(group_parent,_i18n.getMessage("menu_setting_expand_image_load_check_box_container"));
				var parent = container.getElement();

				// 読み込み進捗表示を有効
				var check_box_image_load_enable_notify = new UI_CheckBox(parent,_i18n.getMessage("menu_setting_expand_image_load_enable_notify"));
				check_box_image_load_enable_notify.onchange = function(v){
					_setting_define.getSelectedDefinitions(function(c){
						c.load.enable_notify = v;
					});

					_setting_define.update();
					projectModify();
				};

				// イメージのソースタイプ
				var container = new UI_LineContainer(group_parent,_i18n.getMessage("menu_setting_expand_image_load_src_type"));
				var parent = container.getElement();
				var combo_box_load_src_type = new UI_ComboBox(parent);
				combo_box_load_src_type.attachItem(_i18n.getMessage("menu_setting_expand_image_load_src_type_combo_box_item_url"),"url");
				combo_box_load_src_type.attachItem(_i18n.getMessage("menu_setting_expand_image_load_src_type_combo_box_item_mixed_content"),"mixed_content");
				combo_box_load_src_type.attachItem(_i18n.getMessage("menu_setting_expand_image_load_src_type_combo_box_item_data_uri_scheme"),"data_uri_scheme");
				combo_box_load_src_type.onchange = function(v){
					_setting_define.getSelectedDefinitions(function(c){
						c.load.src_type = v;
					});

					_setting_define.update();
					projectModify();
				};

				// イメージのアンロード設定
				var container = new UI_LineContainer(group_parent,_i18n.getMessage("menu_setting_expand_image_load_unload_check_box_container"));
				var parent = container.getElement();

				// イメージのアンロードを有効
				var check_box_enable_unload = new UI_CheckBox(parent,_i18n.getMessage("menu_setting_expand_image_load_enable_unload"));
				check_box_enable_unload.onchange = function(v){
					_setting_define.getSelectedDefinitions(function(c){
						c.load.enable_unload = v;
					});

					_form_container_unload.setVisible(v);
					_setting_define.update();
					projectModify();
				};

				_form_container_unload = new UI_FormContainer(group_parent);
				_form_container_unload.setVisible(false);
				var form_parent_unload = _form_container_unload.getElement();

				// イメージのアンロード条件
				var container = new UI_LineContainer(form_parent_unload,_i18n.getMessage("menu_setting_expand_image_load_unload"));
				var parent = container.getElement();

				var stepper_unload_allow_size_more_then = new UI_NumericStepper(parent);
				stepper_unload_allow_size_more_then.setM