Greasy Fork is available in English.

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-2023  https://hakuhin.jp
// -


// -
// ユーザースクリプトメタデータ
// -
// ==UserScript==
// @name           PageExpand
// @name:ja        PageExpand
// @name:zh        PageExpand
// @version        1.5.31
// @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,等等...
// @match          http://*/*
// @match          https://*/*
// @match          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_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 url_info_dictionary;
	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 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(!url_info_dictionary){
			url_info_dictionary = new UrlInfoDictionary();
		}
		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(!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("^(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(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(url_info_dictionary){
			url_info_dictionary.release();
			url_info_dictionary = 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()){
				// フレーム内では動作させない
				if (!WindowIsChild(window)){
					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.mixed_passive_content = urlmap.urlmap.mixed_passive_content;
							proj_obj.mixed_active_content = urlmap.urlmap.mixed_active_content;
						}
						if(expand_bbs){
							proj_obj.expand_bbs = expand_bbs.expand_bbs;
						}

						// セキュアページ
						proj_obj.current_secure = Boolean(url.indexOf("https://") == 0);
					}

					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.mixed_passive_content = urlmap.mixed_passive_content;
						proj_obj.mixed_active_content = urlmap.mixed_active_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.mixed_passive_content = _proj_src.mixed_passive_content;
			_proj_ins.mixed_active_content = _proj_src.mixed_active_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.getLoadCacheModeForMedia = function(){
			return _proj_ins.download.load.cache_for_media;
		};

		// -
		// ダウンロードスレッドの最大数
		// -
		_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.checkMixedContent = function(url){
			if(_proj_ins.current_secure){
				if(url.indexOf("http://") == 0){
					return true;
				}
			}
			return false;
		};

		// -
		// パッシブコンテンツのアドレスを修正
		// -
		_this.fixURL_PassiveContent = function(url){
			if(_proj_ins.mixed_passive_content == "unsafe") return url;
			if(_this.checkMixedContent(url)){
				return "https://" + url.slice(7);
			}
			return url;
		};

		// -
		// アクティブコンテンツのアドレスを修正
		// -
		_this.fixURL_ActiveContent = function(url){
			if(_proj_ins.mixed_active_content == "unsafe") return url;
			if(_this.checkMixedContent(url)){
				return "https://" + url.slice(7);
			}
			return url;
		};

		// -
		// IFRAME 要素の展開が可能か
		// -
		_this.checkAllowExpandIframeElement = 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 "blob_url";
		};

		// -
		// イメージのデコードタイプを取得
		// -
		_this.getDecodeLoadExpandImage = function(){
			if(_proj_ins.expand_image){
				return _proj_ins.expand_image.load.decode;
			}
			return "pre-decode";
		};

		// -
		// イメージのアンロードが有効であるか取得
		// -
		_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});
			}
		};

		// -
		// オーディオのソースタイプを取得
		// -
		_this.getSourceAudioElement = function(){
			if(_proj_ins.expand_sound){
				return _proj_ins.expand_sound.audio_element.src_type;
			}
			return "url";
		};

		// -
		// 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.getWidthMaxInlineVideo = function(){
			var v;
			if(_proj_ins.expand_video){
				v = _proj_ins.expand_video.inline.width_max;
			}
			v = Number(v) || 0;
			if(v < 100) v = 100;
			return v;
		};
		_this.getHeightMaxInlineVideo = function(){
			var v;
			if(_proj_ins.expand_video){
				v = _proj_ins.expand_video.inline.height_max;
			}
			v = Number(v) || 0;
			if(v < 100) v = 100;
			return v;
		};

		// -
		// ビデオのインライン展開を許可するかコールバック関数
		// -
		_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});
			}
		};

		// -
		// ビデオのソースタイプを取得
		// -
		_this.getSourceVideoElement = function(){
			if(_proj_ins.expand_video){
				return _proj_ins.expand_video.video_element.src_type;
			}
			return "url";
		};

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

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

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

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

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

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

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

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

		// -
		// 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(url){
			var o = _proj_ins.style_sheet.expand_video.inline.video_element;
			if(_this.checkMixedContent(url)){
				return o.video_unsafe;
			}else{
				return o.video;
			}
		};

		// -
		// 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 "";
		};

		// -
		// 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 "";
		};

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

		// -
		// インラインフレームの展開が可能であるか取得
		// -
		_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 parser = URL_Parser(url);
		var kebab_url = url.replace(/\//g,"-");

		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,parser.origin);
		str = str.replace(/<domain>/gi,parser.domain);
		str = str.replace(/<filename>/gi,parser.filename);
		str = str.replace(/<name>/gi,parser.name);
		str = str.replace(/<ext>/gi,parser.ext);
		str = str.replace(/<query>/gi,parser.search);
		str = str.replace(/<fragment>/gi,parser.hash);

		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);

		// 最後尾が拡張子ではない場合付与
		if(parser.ext){
			var ext0 = "." + parser.ext;
			var ext1 = str.slice(-ext0.length);
			if(ext0 != ext1){
				str += ext0;
			}
		}

		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");
			f = f.replace(/[":*?<>|~]/g,"-");
			e.push(f);
		}

		return e.join("/");
	}

	// -
	// プロジェクトのアップデート
	// -
	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;

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

			// -
			// URLマッピング設定
			// -
			// 画像検索サイト
			var preset = getPreset(proj.urlmap,"image_search");
			var filter = preset.filter.regexp.filter;
			filter.splice(9,4);
			filter.splice(6,2);
			filter.splice(4,1);

			// -
			// ハイパーリンク置換定義
			// -
			// イメージ検索用
			var obj = getPreset(proj.replacement_to_link,"direct_link_image_search");
			var filter = obj.filter;
			filter.splice(5,1);
			filter.splice(2,1);

			// 直リンク(汎用)
			var obj = getPreset(proj.replacement_to_link,"direct_link_generic");
			var filter = obj.filter;

			filter.splice(2,2);
			filter.splice(2,0,{
				name:{
					standard:"pbs.twimg.com (query)",
					locales:{
						ja:"pbs.twimg.com (query)",
						en:"pbs.twimg.com (query)"
					}
				},
				filter:{
					type:"regexp",
					asterisk:{
						filter:[]
					},
					regexp:{
						filter:[
							{
								pattern:"^(http|https)://pbs[.]twimg[.]com[/][^?]+[?].*format=.*$",
								flags:{i:true,g:false}
							}
						]
					}
				},
				enable_reflect_to_anchor:false,
				enable_cache:true,
				script:PageExpandProjectScriptObject_Create("ReplacementToLink_DirectLinkGeneric_Twimg_Query")
			});
			filter.splice(3,0,{
				name:{
					standard:"pbs.twimg.com (colon)",
					locales:{
						ja:"pbs.twimg.com (colon)",
						en:"pbs.twimg.com (colon)"
					}
				},
				filter:{
					type:"regexp",
					asterisk:{
						filter:[]
					},
					regexp:{
						filter:[
							{
								pattern:"^(http|https)://pbs[.]twimg[.]com[/][^.]+[.](jpg|png):.*$",
								flags:{i:true,g:false}
							}
						]
					}
				},
				enable_reflect_to_anchor:false,
				enable_cache:true,
				script:PageExpandProjectScriptObject_Create("ReplacementToLink_DirectLinkGeneric_Twimg_Coron")
			});
			filter.splice(4,4);
			filter.splice(6,7);
			filter.splice(11,1);

		}
		if(exit())	return proj;

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

			// -
			// ビデオ展開定義
			// -
			update(proj.expand_video,"*",function(obj){
				delete obj.fc2video;
				delete obj.liveleak;
				var nicovideo = obj.nicovideo;
				delete nicovideo.visible_thumbnail_video;
				delete nicovideo.visible_thumbnail_mylist;
				delete nicovideo.visible_thumbnail_user;
				delete nicovideo.visible_thumbnail_community;
				delete nicovideo.visible_thumbnail_live;
				delete nicovideo.visible_thumbnail_seiga;
			});

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

			// -
			// スタイルシート定義
			// -
			update(proj.style_sheet,"*",function(obj){
				var inline = obj.expand_video.inline;
				delete inline.fc2video;
				delete inline.liveleak;
				var nicovideo = inline.nicovideo;
				delete nicovideo.thumbnail_video;
				delete nicovideo.thumbnail_mylist;
				delete nicovideo.thumbnail_user;
				delete nicovideo.thumbnail_community;
				delete nicovideo.thumbnail_live;
				delete nicovideo.thumbnail_seiga;
			});

		}
		if(exit())	return proj;

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

			var obj = getPreset(proj.expand_bbs,"nicovideo_dictionary");
			obj.filter.regexp.filter = [
				{
					pattern:"^https://dic\\.nicovideo\\.jp/b/(a|c|i|l|u|v)/.+",
					flags:{i:true,g:false}
				},{
					pattern:"^https://dic\\.nicovideo\\.jp/(a|c|i|l|u|v)/.+",
					flags:{i:true,g:false}
				}
			];

		}
		if(exit())	return proj;

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

			update(proj.expand_image,"*",function(obj){
				delete obj.load.src_type;
			});
			update(proj.expand_video,"*",function(obj){
				var o = obj.inline;
				o.width_max = 720;
				o.height_max = 480;
			});
			proj.download.load.cache_for_media = "default";

		}
		if(exit())	return proj;

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

			update(proj.expand_image,"*",function(obj){
				obj.load.src_type = "blob_url";
				obj.load.decode = "pre-decode";
			});
			update(proj.expand_sound,"*",function(obj){
				obj.audio_element.src_type = "url";
			});
			update(proj.expand_video,"*",function(obj){
				obj.video_element.src_type = "url";
			});
			update(proj.style_sheet,"simple",function(obj){
				obj.expand_text.inline_unsafe = "margin:2px 0px 2px 0px; border:2px #F00 solid;";
				obj.expand_image.thumbnail_unsafe = "margin:2px 0px 2px 0px; background-color:#FFF; border:2px #F00 solid;";
				obj.expand_image.popup_unsafe = "background-color:#FFF; border:2px #F00 solid;";
				obj.expand_sound.inline.audio_element.audio_unsafe = "margin:2px 0px 2px 0px; border:2px #F00 solid;";
				obj.expand_video.inline.video_element.video_unsafe = "margin:2px 0px 2px 0px; border:2px #F00 solid; width:720px; height:405px;"
				obj.expand_iframe.inline_unsafe = "margin:2px 0px 2px 0px; background-color:#FFF; border:2px #F00 solid;";
			});
			update(proj.style_sheet,"default",function(obj){
				obj.expand_text.inline_unsafe = "margin:2px 0px 2px 0px; border:2px #F00 solid; padding:4px; background-color:#FFF; display:block;";
				obj.expand_image.thumbnail_unsafe = "margin:2px 0px 2px 0px; border:2px #F00 solid; padding:1px; background-color:#FFF;";
				obj.expand_image.popup_unsafe = "margin:0px; border:2px #F00 solid; padding:1px; background-color:#FFF;";
				obj.expand_sound.inline.audio_element.audio_unsafe = "margin:2px 0px 2px 0px; border:2px #F00 solid; padding:1px; background-color:#FFF;";
				obj.expand_video.inline.video_element.video_unsafe = "margin:2px 0px 2px 0px; border:2px #F00 solid; background-color:#F00; width:720px; height:405px;";
				obj.expand_iframe.inline_unsafe = "margin:2px 0px 2px 0px; border:2px #F00 solid; padding:1px; background-color:#FFF;";
			});
			update(proj.urlmap,"*",function(obj){
				delete obj.enable_unsecure;
				delete obj.enable_mixed_content;
				obj.mixed_passive_content = "unsafe";
				obj.mixed_active_content = "safe";
			});

		}
		if(exit())	return proj;

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

			// 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/c/[^/]+/[0-9]+.*$",
				flags:{i:true,g:false}
			}

			// 5ちゃんねる掲示板 v.08
			var obj = addPreset(proj.expand_bbs,"5ch_v8",null);
			obj.preset = {
				name:{
					standard:"5ch.net (v.08)",
					locales:{
						ja:"5ちゃんねる掲示板(v.08)",
						en:"5ch.net (v.08)"
					}
				},
				filter:{
					type:"regexp",
					asterisk:{
						filter:[]
					},
					regexp:{
						filter:[{
							pattern:"^(http|https)://[^.]+\\.(2ch|5ch)\\.net/test/read\\.cgi/[^/]+/[0-9]+.*$",
							flags:{i:true,g:false}
						}]
					}
				},
				enable:true,
				script_initialize:PageExpandProjectScriptObject_Create("ExpandBbs_ScriptInitialize_5ch_v8"),
				script_callback:PageExpandProjectScriptObject_Create("ExpandBbs_ScriptCallback_5ch_v8"),
				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;

		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){}
		}

		return false;
	},
	function(info,response){
		response({});
		return true;
	}

			]);

			// -
			// エレメント置換定義「展開アシスト(ツイッター用)」
			// -
			attachItem( "ReplacementToElement_AssistTwitter" , [

	function(info,response){
		var element = info.element;

		// 画像検索上のサムネイル
		if(element.tagName == "IMG"){
			var m = element.src.match(/(http|https)(:[/][/]pbs[.]twimg[.]com[/](media|card_img)[/][^?]+)[?].*format=/);
			if(m){
				if((function (){
					var allow_list = {"card.layoutLarge.media":1,"tweetPhoto":1};
					var node = element;
					while(node){
						if(node.nodeType == 1){
							if(allow_list[node.getAttribute("data-testid")]){
								return true;
							}
						}
						node = node.parentNode;
					}
					return false;
				})()){
					response({url:element.src});
					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;

		var result = (function(){

			// 通常のURL
			var url_parser = URL_Parser(url);
			if(url_parser.protocol.match(/^(http|https|ftp):/i)){
				return true;
			}

			// DataURL
			var data_parser = DataURL_Parser(url);
			if(data_parser){
				return true;
			}

			return false;
		})();


		if(result){

			// 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 result = (function(){

			// 画像の拡張子
			var url_parser = URL_Parser(url);
			if(url_parser.ext.match(/^(bmp|gif|jpg|jpe|jpeg|png|webp|avif)$/i)){
				return true;
			}

			// 画像の DataURL
			var data_parser = DataURL_Parser(url);
			if(data_parser){
				if(data_parser.mimetype.match(/^image[/]/i)){
					return true;
				}
			}

			return false;
		})();

		if(result){

			// 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_AddDownloadListAll" , [
	
	function(info,response){
		var anchor_element = info.anchor_element;
		var url = anchor_element.href;

		var result = (function(){

			// 通常のURL
			var url_parser = URL_Parser(url);
			if(url_parser.protocol.match(/^(http|https|ftp):/i)){
				return true;
			}

			// DataURL
			var data_parser = DataURL_Parser(url);
			if(data_parser){
				return true;
			}

			return false;
		})();

		if(result){

			// ユーザーリストからアイテムを作成
			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 result = (function(){

			// 画像の拡張子
			var url_parser = URL_Parser(url);
			if(url_parser.ext.match(/^(bmp|gif|jpg|jpe|jpeg|png|webp|avif)$/i)){
				return true;
			}

			// 画像の DataURL
			var data_parser = DataURL_Parser(url);
			if(data_parser){
				if(data_parser.mimetype.match(/^image[/]/i)){
					return true;
				}
			}

			return false;
		})();

		if(result){

			// ユーザーリストからアイテムを作成
			var item = download_list_user.createItem();

			// ダウンロード設定
			item.setURL(url);
			//item.setFileName(url);
		}

		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;
	}

			]);

			// -
			// ハイパーリンク置換定義「直リンク(汎用)」「pbs.twimg.com (query)」
			// -
			attachItem( "ReplacementToLink_DirectLinkGeneric_Twimg_Query" , [
	
	function (info,response){
		var anchor_element = info.anchor_element;

		var small_url = anchor_element.href;
		var m = small_url.match(/(http|https)(:[/][/]pbs[.]twimg[.]com[/])([^/]+)([/][^?]+)[?].*format=/);
		if(m){
			var q = StringGetQuery(small_url);
			var large_url = m[1] + m[2] + m[3] + m[4];
			if(m[3] == "media"){
				large_url += "." + q["format"] + ":orig";
			}else{
				large_url += "?format=" + q["format"] + "&name=orig";
			}
			response({result:true,url:large_url,content_type:["image"]});
		}

		return true;
	}

			]);

			// -
			// ハイパーリンク置換定義「直リンク(汎用)」「pbs.twimg.com (colon)」
			// -
			attachItem( "ReplacementToLink_DirectLinkGeneric_Twimg_Coron" , [
	
	function (info,response){
		var anchor_element = info.anchor_element;

		var small_url = anchor_element.href;
		var m = small_url.match(/(http|https)(:[/][/]pbs[.]twimg[.]com[/][^.]+)[.](jpg|png)[:]/);
		if(m){
			var large_url = m[1] + m[2] + "." + m[3] + ":orig";
			response({result:true,url:large_url,content_type:["image"]});
		}

		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;
	}

			]);

			// -
			// ハイパーリンク置換定義「直リンク(汎用)」「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;
	}

			]);

			// -
			// ハイパーリンク置換定義「イメージ検索用」「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){
				try{
					var image_url = decodeURIComponent(decodeURIComponent(query.imgurl));
					response({result:true,url:image_url,content_type:["image"]});
					return true;
				}catch(e){}
			}
		}

		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;
	}

			]);

			// -
			// ハイパーリンク置換定義「イメージ検索用」「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;
	}

			]);

			// -
			// ハイパーリンク置換定義「ウィキペディア用」
			// -
			attachItem( "ReplacementToLink_DirectLinkWikipedia" , [
	
	function(info,response){
		var anchor_element = info.anchor_element;

		if((function(){
			var url_parser = URL_Parser(anchor_element.href);
			if(url_parser.name.match(/:/) && url_parser.ext.match(/^(bmp|gif|jpg|jpeg|png|svg|webp|avif)$/i)) return true;
			return false;
		})()){
			var loader = new Loader();
			loader.onload = function(str){
				var m = str.match(/<meta[^>]+?property="og:image"[^>]+?content="([^">]+)"[^>]*>[^">]/i);
				if(m){
					var url = m[1];
					m = url.match(/([/][/]upload[.]wikimedia[.]org[/]wikipedia[/][^/]+[/])thumb[/]([^/]+[/][^/]+[/].*?)[/]/i);
					if(m) url = "https:" + m[1] + m[2];
					response({result:true,url:url,content_type:["image"]});
				}

				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 result = (function(){

			// テキストの拡張子
			var url_parser = URL_Parser(url);
			if(url_parser.ext.match(/^(txt)$/i)){
				return true;
			}

			// テキストの DataURL
			var data_parser = DataURL_Parser(url);
			if(data_parser){
				if(data_parser.mimetype.match(/^text[/]/i)){
					return true;
				}
			}

			return false;
		})();

		if(result){
			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 result = (function(){

			// 画像の拡張子
			var url_parser = URL_Parser(url);
			if(url_parser.ext.match(/^(bmp|gif|jpg|jpe|jpeg|png|webp|avif)$/i)){
				return true;
			}

			// 画像の DataURL
			var data_parser = DataURL_Parser(url);
			if(data_parser){
				if(data_parser.mimetype.match(/^image[/]/i)){
					return true;
				}
			}

			return false;
		})();

		if(result){
			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 result = (function(){

			// 画像の拡張子
			var url_parser = URL_Parser(url);
			if(url_parser.ext.match(/^(bmp|gif|jpg|jpe|jpeg|png|webp|avif)$/i)){
				return true;
			}

			// 画像の DataURL
			var data_parser = DataURL_Parser(url);
			if(data_parser){
				if(data_parser.mimetype.match(/^image[/]/i)){
					return true;
				}
			}

			return false;
		})();

		if(result){
			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 result = (function(){

			// 画像の拡張子
			var url_parser = URL_Parser(url);
			if(url_parser.ext.match(/^(bmp|gif|jpg|jpe|jpeg|png|webp|avif)$/i)){
				return true;
			}

			// 画像の DataURL
			var data_parser = DataURL_Parser(url);
			if(data_parser){
				if(data_parser.mimetype.match(/^image[/]/i)){
					return true;
				}
			}

			return false;
		})();

		if(result){
			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 result = (function(){

			// 画像の拡張子
			var url_parser = URL_Parser(url);
			if(url_parser.ext.match(/^(bmp|gif|jpg|jpe|jpeg|png|webp|avif)$/i)){
				return true;
			}

			// 画像の DataURL
			var data_parser = DataURL_Parser(url);
			if(data_parser){
				if(data_parser.mimetype.match(/^image[/]/i)){
					return true;
				}
			}

			return false;
		})();

		if(result){
			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 result = (function(){

			// 画像の拡張子
			var url_parser = URL_Parser(url);
			if(url_parser.ext.match(/^(bmp|gif|jpg|jpe|jpeg|png|webp|avif)$/i)){
				return true;
			}

			// 画像の DataURL
			var data_parser = DataURL_Parser(url);
			if(data_parser){
				if(data_parser.mimetype.match(/^image[/]/i)){
					return true;
				}
			}

			return false;
		})();

		if(result){
			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 result = (function(){

			// 画像の拡張子
			var url_parser = URL_Parser(url);
			if(url_parser.ext.match(/^(bmp|gif|jpg|jpe|jpeg|png|webp|avif)$/i)){
				return true;
			}

			// 画像の DataURL
			var data_parser = DataURL_Parser(url);
			if(data_parser){
				if(data_parser.mimetype.match(/^image[/]/i)){
					return true;
				}
			}

			return false;
		})();

		if(result){
			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 result = (function(){

			// 画像の拡張子
			var url_parser = URL_Parser(url);
			if(url_parser.ext.match(/^(bmp|gif|jpg|jpe|jpeg|png|webp|avif)$/i)){
				return true;
			}

			// 画像の DataURL
			var data_parser = DataURL_Parser(url);
			if(data_parser){
				if(data_parser.mimetype.match(/^image[/]/i)){
					return true;
				}
			}

			return false;
		})();

		if(result){
			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 result = (function(){

			// 画像の拡張子
			var url_parser = URL_Parser(url);
			if(url_parser.ext.match(/^(bmp|gif|jpg|jpe|jpeg|png|webp|avif)$/i)){
				return true;
			}

			// 画像の DataURL
			var data_parser = DataURL_Parser(url);
			if(data_parser){
				if(data_parser.mimetype.match(/^image[/]/i)){
					return true;
				}
			}

			return false;
		})();

		if(result){
			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 result = (function(){

			// 画像の拡張子
			var url_parser = URL_Parser(url);
			if(url_parser.ext.match(/^(bmp|gif|jpg|jpe|jpeg|png|webp|avif)$/i)){
				return true;
			}

			// 画像の DataURL
			var data_parser = DataURL_Parser(url);
			if(data_parser){
				if(data_parser.mimetype.match(/^image[/]/i)){
					return true;
				}
			}

			return false;
		})();

		if(result){
			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;
		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 result = (function(){

			// 画像の拡張子
			var url_parser = URL_Parser(url);
			if(url_parser.ext.match(/^(bmp|gif|jpg|jpe|jpeg|png|webp|avif)$/i)){
				return true;
			}

			// 画像の DataURL
			var data_parser = DataURL_Parser(url);
			if(data_parser){
				if(data_parser.mimetype.match(/^image[/]/i)){
					return true;
				}
			}

			return false;
		})();

		if(result){
			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 result = (function(){

			// 画像の拡張子
			var url_parser = URL_Parser(url);
			if(url_parser.ext.match(/^(bmp|gif|jpg|jpe|jpeg|png|webp|avif)$/i)){
				return true;
			}

			// 画像の DataURL
			var data_parser = DataURL_Parser(url);
			if(data_parser){
				if(data_parser.mimetype.match(/^image[/]/i)){
					return true;
				}
			}

			return false;
		})();

		if(result){
			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 result = (function(){

			// 画像の拡張子
			var url_parser = URL_Parser(url);
			if(url_parser.ext.match(/^(bmp|gif|jpg|jpe|jpeg|png|webp|avif)$/i)){
				return true;
			}

			// 画像の DataURL
			var data_parser = DataURL_Parser(url);
			if(data_parser){
				if(data_parser.mimetype.match(/^image[/]/i)){
					return true;
				}
			}

			return false;
		})();

		if(result){
			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 result = (function(){

			// オーディオの拡張子
			var url_parser = URL_Parser(url);
			if(url_parser.ext.match(/^(mp3|wav|ogg|m4a|aac|midi|mid)$/i)){
				return true;
			}

			// オーディオの DataURL
			var data_parser = DataURL_Parser(url);
			if(data_parser){
				if(data_parser.mimetype.match(/^audio[/]/i)){
					return true;
				}
			}

			return false;
		})();

		if(result){
			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;

		// ビデオの最大サイズ
		var width_max  = project.getWidthMaxInlineVideo();
		var height_max  = project.getHeightMaxInlineVideo();

		// スタイルのサイズを取得
		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 parent_width = ElementGetClientWidth(video.parentNode);
		if(width_max > parent_width)	width_max = parent_width;

		// エレメントのサイズ
		width  -= style_w;
		height -= style_h;

		// サイズ情報があれば使用
		if(video.videoWidth)  width  = video.videoWidth;
		if(video.videoHeight) height = video.videoHeight;

		// 最大幅補正
		var w = width_max - style_w;
		if(w < width){
			height *= w / width;
			width = w;
		}

		// 最大高補正
		var h = height_max - style_h;
		if(h < height){
			width *= h / height;
			height = h;
		}

		// サイズをセット
		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 result = (function(){

			// ビデオの拡張子
			var url_parser = URL_Parser(url);
			if(url_parser.ext.match(/^(mp4|webm|avi|m4v|ogv|mpg|mpeg)$/i)){
				return true;
			}

			// ビデオの DataURL
			var data_parser = DataURL_Parser(url);
			if(data_parser){
				if(data_parser.mimetype.match(/^video[/]/i)){
					return true;
				}
			}

			return false;
		})();

		if(result){
			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 result = (function(){

			// PDFの拡張子
			var url_parser = URL_Parser(url);
			if(url_parser.ext.match(/^(pdf)$/i)){
				return true;
			}

			// PDFの DataURL
			var data_parser = DataURL_Parser(url);
			if(data_parser){
				if(data_parser.mimetype.match(/^application[/]pdf/i)){
					return true;
				}
			}

			return false;
		})();

		if(result){
			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;
	}

			]);

			// -
			// インラインフレーム展開定義「デフォルト」
			// -
			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:"(https://dic\\.nicovideo\\.jp/b/(a|c|i|l|u|v)/[^/#?]+)",replace:"$1/",name:"nicopedia"},
			{url:"(https://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("<span class=\"st[-]bbs_resNo\">([0-9]+)","i");

					var p = 0;
					var n = str.length;
					function f(){
						try{
							if(p >= n) throw 0;
							p = str.indexOf("<dt class=\"st-bbs_reshead\">",p);
							if(p < 0) throw 0;
							var e = str.indexOf("</dd>",p);
							if(e >= 0) e += 5;

							var p2 = str.indexOf("<dd class=\"res_reaction\">",e);
							if(p2 >= 0){
								var e2 = str.indexOf("</dd>",p2);
								if(e2 >= 0) e = e2 + 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 = ElementGetElementsByClassName(document.body,"st-bbs-contents")[0];
			if(element_bbs){
				var i;
				var nodes = ElementGetElementsByTagName(element_bbs,"dl");
				if(nodes.length){
					element_parent = nodes[nodes.length - 1];
				}
			}
		})();
		if(!element_parent) return false;

		// -
		// 最後尾 ID
		// -
		var nodes = ElementGetElementsByTagName(element_parent,"dt");
		var i;
		var node_num = nodes.length;
		var re = new RegExp("([0-9]+)","i");
		for(i=0;i<node_num;i++){
			var node = nodes[i];
			var m = ElementGetTextContent(node).match(re);
			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(re);
			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("<span class=\"st[-]bbs_resNo\">([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=\"st-bbs_reshead\">",p);
						if(p < 0) throw 0;
						var e = str.indexOf("</dd>",p);
						if(e >= 0) e += 5;
						var p2 = str.indexOf("<dd class=\"res_reaction\">",e);
						if(p2 >= 0){
							var e2 = str.indexOf("</dd>",p2);
							if(e2 >= 0) e = e2 + 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];
									var dd_reaction = nodes[5];

									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);
									if(dd_reaction) response.addOriginalElements("reaction",dd_reaction);

									// 消去時に実行されるイベント
									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 0px 0px 8px");
					}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;
			var dd_reaction;

			try{
				if(dt.tagName != "DT") return false;
				if(dt.className != "st-bbs_reshead") return false;
			}catch(e){
				return false;
			}

			dd = DomNodeGetNextElementSibling(dt);
			try{
				if(dd.tagName != "DD") return false;
			}catch(e){
				return false;
			}

			dd_reaction = (function(){
				var dd2 = DomNodeGetNextElementSibling(dd);
				if(dd2){
					if(dd2.className == "res_reaction") return dd2;
				}
				return null;
			})();

			// 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);
				if(dd_reaction) response.addOriginalElements("reaction",dd_reaction);

				// 消去時に実行されるイベント
				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/c/[^/]+/[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]+","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;
	}

			]);




			// -
			// 掲示板設定「5ちゃんねる掲示板(v.08)」
			// -
			attachItem( "ExpandBbs_ScriptInitialize_5ch_v8" , [
	
	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:"5ch"}
		];

		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 == "5ch"){
			work.bbs_name = (function(){
				var version = (function(){
					var re = new RegExp("read[.]cgi[ \t]+ver[ \t]*([0-9]+)[.][0-9]+","i");

					// ver 08-
					var nodes = ElementGetElementsByTagName(document.body,"footer");
					var node = nodes[nodes.length - 1];
					if(node){
						var m = ElementGetTextContent(node).match(re);
						if(m) return parseInt(m[1]);
					}

					return 0;
				})();
				if(version >= 8){
					return "5ch_v8";
				}
				return "";
			})();
			if(!(work.bbs_name)){
				return false;
			}
		}

		// -
		// 文字列からレスポンス番号を取得
		// -
		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 "5ch_v8":
				re = new RegExp('<article[^>]+class="(|[^"]* )post(|[^"]* )"[^>]*>.*?<section[^>]+class="(|[^"]* )post-content(|[^"]* )"[^>]*>',"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 "5ch_v8":
				search_post_start = '<article id="';
				search_post_end = "</article>";
				class_name_message = "post-content";
				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 "5ch_v8":
								info_post = clone_nodes[0];
								if(!(info_post.classList.contains("post"))) return;
								info_number = ElementGetElementsByClassName(info_post,"postid")[0];
								info_name = ElementGetElementsByClassName(info_post,"postusername")[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 "5ch_v8":
				search_post_start = '<article id="';
				search_post_end = "</article>";
				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();

							var nodes = StringHtmlCreateDomNodesSafe(s);
							var j;
							var node_num = nodes.length;
							for(j=0;j<node_num;j++){
								(function(){
									var list = element_parent.getElementsByTagName("article");
									var node = list[list.length-1];
									if(node){
										DomNode_InsertAfter(node,nodes[j]);
									}else{
										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 "5ch_v8":
					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 "5ch_v8":
				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 "5ch_v8":
				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;
		(function(){
			var node = ElementGetElementsByClassName(document.body,"newposts")[0];
			if(!node) return;
			DomNode_InsertBefore(node,read_more_button.getElement());
		})();

		// -
		// 書き込みをポップアップ化
		// -
		(function(){
			var element_form;
			var element_textarea;
			var input_submit;
			var event_handler_release;
			var event_handler_submit;
			var task;

			function release(){
				if(event_handler_submit){
					element_form.removeEventListener("submit",event_handler_submit);
					event_handler_submit = null;
				}
				if(event_handler_release){
					event_handler_release.release();
					event_handler_release = null;
				}
				release_task();
			}
			function release_task(){
				if(task){
					task.release();
					task = null;
				}
			}
			function form_reset(){
				element_textarea.value = "";
			}
			function form_set_enable(v){
				input_submit.disabled = !(v);
			}

			event_handler_release = page_expand_event_dispatcher.createEventHandler("release");
			event_handler_release.setFunction(release);

			(function(){
				element_form = (function(){
					var nodes = ElementGetElementsByTagName(document.body,"form");
					var i;
					switch(work.bbs_name){
					case "5ch_v8":
						for(i=0;i<nodes.length;i++){
							if(nodes[i].action.indexOf("/test/bbs.cgi") >= 0){
								return nodes[i];
							}
						}
						break;
					}
					return null;
				})();
				if(!element_form) return;

				input_submit = (function(){
					var nodes = ElementGetElementsByTagName(element_form,"input");
					for(i=0;i<nodes.length;i++){
						if(nodes[i].type.toLowerCase() == "submit"){
							return nodes[i];
						}
					}
					return null;
				})();

				work.form_textarea = element_textarea = (function(){
					var nodes = ElementGetElementsByTagName(element_form,"textarea");
					return nodes[0] || null;
				})();

				var docking_form = work.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;");
			})();

			if((function(){
				if(!element_form) return false;
				if(!input_submit) return false;
				if(!element_textarea) return false;
				if(window.localStorage.getItem("autoPost") == "true") return false;

				var owner_parser = URL_Parser(WindowGetOwnerURL(window));
				var action_parser = URL_Parser(element_form.action);
				if(owner_parser.origin != action_parser.origin) return false;

				if(load_more_pos != 0) return false;

				return true;
			})()){
				// サブミット直前に実行されるイベント
				event_handler_submit = function(e){

					form_set_enable(false);

					var w;
					var h;
					switch(work.bbs_name){
					case "5ch_v8":
						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(){
						form_set_enable(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 window_obj = element_iframe.contentWindow;
								var href = window_obj.document.URL;
								if(href.match(/^(http|https):/)){
									switch(work.bbs_name){
									case "5ch_v8":
										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){
								form_set_enable(true);
								release_task();
								popup_iframe.close();
								if(timer){
									readMore(function(){});
									form_reset();
								}
							}
						});
					})();

				};
				element_form.addEventListener("submit",event_handler_submit);
			}
		})();

		// -
		// シャドウロード
		// -
		(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 "5ch_v8":
					loader.overrideMimeType("text/plain; charset=Shift_JIS");
					break;
				}
				loader.loadText();
			};
			load();
		})();

		response({result:true});
		return true;
	},
	function (info,response){
		response({result:false});
		return true;
	}

			]);

			// -
			// 掲示板設定「5ちゃんねる掲示板(v.08)」
			// -
			attachItem( "ExpandBbs_ScriptCallback_5ch_v8" , [
	
	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 "5ch_v8":
				var info_post = node.clone_nodes[0];
				info_number = ElementGetElementsByClassName(info_post,"postid")[0];
				info_name = ElementGetElementsByClassName(info_post,"postusername")[0];
				info_date = ElementGetElementsByClassName(info_post,"date")[0];
				info_uid = ElementGetElementsByClassName(info_post,"uid")[0] || info_date;
				info_message = 
					ElementGetElementsByClassName(info_post,"post-content")[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 "5ch_v8":
				try{
					info_post = element;
					if(!(info_post.classList.contains("post"))) return false;
					info_number = ElementGetElementsByClassName(info_post,"postid")[0];
					info_name = ElementGetElementsByClassName(info_post,"postusername")[0];
					info_date = ElementGetElementsByClassName(info_post,"date")[0];
					info_uid = ElementGetElementsByClassName(info_post,"uid")[0] || info_date;
					info_message = 
						ElementGetElementsByClassName(info_post,"post-content")[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 "5ch_v8":
					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){
				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(){
			// エレメントを全てクリア
			DomNodeRemoveChildren(_content_window);

			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 _combo_box_load_cache_for_media;
			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 container = new UI_LineContainer(group_parent,_i18n.getMessage("menu_setting_download_load_cache_for_media"));
				var parent = container.getElement();
				_combo_box_load_cache_for_media = new UI_ComboBox(parent);
				_combo_box_load_cache_for_media.attachItem(_i18n.getMessage("menu_setting_expand_image_load_cache_for_media_combo_box_item_default"),"default");
				_combo_box_load_cache_for_media.attachItem(_i18n.getMessage("menu_setting_expand_image_load_cache_for_media_combo_box_item_no_store"),"no-store");
				_combo_box_load_cache_for_media.attachItem(_i18n.getMessage("menu_setting_expand_image_load_cache_for_media_combo_box_item_force_cache"),"force-cache");
				_combo_box_load_cache_for_media.onchange = function(v){
					download.load.cache_for_media = v;
					projectModify();
				};
				new UI_TextHint(parent,_i18n.getMessage("menu_setting_download_load_cache_for_media_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);
				// キャッシュモード(メディア用)
				_combo_box_load_cache_for_media.setValue(download.load.cache_for_media);
				// 最大同時ダウンロード数
				_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);

				// セキュリティ
				_combo_box_mixed_passive_content.setValue(c.mixed_passive_content);
				_combo_box_mixed_active_content.setValue(c.mixed_active_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 _combo_box_mixed_passive_content;
			var _combo_box_mixed_active_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();
				};

				// 定義
				_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;
						}
					})();
				}


				// 混在パッシブコンテンツのセキュリティ
				var container = new UI_LineContainer(form_parent_enable,_i18n.getMessage("menu_setting_urlmap_mixed_passive_content_container"));
				var parent = container.getElement();

				_combo_box_mixed_passive_content = new UI_ComboBox(parent);
				_combo_box_mixed_passive_content.attachItem(_i18n.getMessage("menu_setting_urlmap_mixed_passive_content_unsafe"),"unsafe");
				_combo_box_mixed_passive_content.attachItem(_i18n.getMessage("menu_setting_urlmap_mixed_passive_content_safe"),"safe");
				_combo_box_mixed_passive_content.onchange = function(v){
					getSelectedUrlMaps(function(c){
						c.mixed_passive_content = v;
					});
					_urlmap_list.update();
					projectModify();
				};
				new UI_TextHint(parent,_i18n.getMessage("menu_setting_urlmap_mixed_passive_content_hint"));

				// 混在アクティブコンテンツのセキュリティ
				var container = new UI_LineContainer(form_parent_enable,_i18n.getMessage("menu_setting_urlmap_mixed_active_content_container"));
				var parent = container.getElement();

				_combo_box_mixed_active_content = new UI_ComboBox(parent);
				_combo_box_mixed_active_content.attachItem(_i18n.getMessage("menu_setting_urlmap_mixed_active_content_unsafe"),"unsafe");
				_combo_box_mixed_active_content.attachItem(_i18n.getMessage("menu_setting_urlmap_mixed_active_content_safe"),"safe");
				_combo_box_mixed_active_content.onchange = function(v){
					getSelectedUrlMaps(function(c){
						c.mixed_active_content = v;
					});
					_urlmap_list.update();
					projectModify();
				};
				new UI_TextHint(parent,_i18n.getMessage("menu_setting_urlmap_mixed_active_content_hint"));

			})();
		}

		// -
		// 定義関連のクラス
		// -
		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_blob_url"),"blob_url");
				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_decode"));
				var parent = container.getElement();
				var combo_box_load_decode = new UI_ComboBox(parent);
				combo_box_load_decode.attachItem(_i18n.getMessage("menu_setting_expand_image_load_decode_combo_box_item_auto"),"auto");
				combo_box_load_decode.attachItem(_i18n.getMessage("menu_setting_expand_image_load_decode_combo_box_item_pre_decode"),"pre-decode");
				combo_box_load_decode.onchange = function(v){
					_setting_define.getSelectedDefinitions(function(c){
						c.load.decode = 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.setMinimum(0);
				stepper_unload_allow_size_more_then.setMaximum(99999);
				stepper_unload_allow_size_more_then.oninput = function(v){
					_setting_define.getSelectedDefinitions(function(c){
						c.load.unload_allow_size_more_then = v;
					});

					_setting_define.update();
					projectModify();
				};
				new UI_TextItem(parent,_i18n.getMessage("menu_setting_expand_image_load_allow_unload_more_then_text"));
				new UI_Break(form_parent);

				// データの関連付け
				_setting_define.attachDefineData(define);
				_setting_define.setDefineAssetName("expand_image");
				_setting_define.setFunctionForNewData(createExpandImage);

				// リスト選択
				_setting_define.onselect = function(id){
					var c = ProjectObjectGetActiveData(define[id]);
					if(!c)	return;

					// サムネイルを表示
					check_box_enable_thumbnail.setValue(c.thumbnail.enable_thumbnail);
					// サムネイルにマウスオーバーするとポップアップ表示
					check_box_enable_popup_mouseover.setValue(c.thumbnail.enable_popup_mouseover);
					// 同じイメージがすでに配置されている場合サムネイルを表示しない
					check_box_disable_same_thumbnail_image.setValue(c.thumbnail.disable_same_image);
					// 最小許容限界(ピクセル値)
					stepper_thumbnail_width_min.setValue(c.thumbnail.width_min);
					// 基本拡大率(パーセント)
					stepper_thumbnail_scale_percent.setValue(c.thumbnail.scale_percent);
					// 最大許容限界(ピクセル値)
					stepper_thumbnail_width_max.setValue(c.thumbnail.width_max);
					// サムネイルイメージの読み込み設定
					combo_box_thumbnail_load_type.setValue(c.thumbnail.load_type);
					// リンクからサムネイル化する条件
					script_obj_editer_thumbnail_script_allow.setScriptObject(c.thumbnail.script_allow);
					// サムネイルの挿入位置
					script_obj_editer_thumbnail_script_insert.setScriptObject(c.thumbnail.script_insert);
					// ポップアップ表示の有無
					check_box_popup_enable_popup_mouseover.setValue(c.popup.enable_popup_mouseover);
					// ポップアップ時のアニメーション動作を有効
					check_box_enable_animation_scale.setValue(c.popup.enable_animation_scale);
					check_box_enable_animation_alpha.setValue(c.popup.enable_animation_alpha);
					// ポップアップイメージの読み込み設定
					combo_box_popup_load_type.setValue(c.popup.load_type);
					// ポップアップイメージの配置基点
					combo_box_popup_origin_type.setValue(c.popup.origin_type);
					// ポップアップイメージの配置位置
					combo_box_popup_position_type.setValue(c.popup.position_type);
					// 拡大率(パーセント)
					stepper_popup_scale_percent.setValue(c.popup.scale_percent);
					// 開くまでに待機する時間(ミリ秒)
					stepper_popup_time_wait_open.setValue(c.popup.time_wait_open);
					// 閉じるまでに待機する時間(ミリ秒)
					stepper_popup_time_wait_close.setValue(c.popup.time_wait_close);
					// リンクからポップアップ表示する条件
					script_obj_editer_popup_script_allow.setScriptObject(c.popup.script_allow);
					// 縮小されたイメージをマウスオーバーするとポップアップ表示
					check_box_reduced_image_enable_popup.setValue(c.reduced_image.enable_popup);
					// 縮小率
					stepper_popup_allow_slcale_less_then.setValue(c.reduced_image.popup_allow_slcale_less_then);
					// 読み込み進捗表示
					check_box_image_load_enable_notify.setValue(c.load.enable_notify);
					// ソースタイプ
					combo_box_load_src_type.setValue(c.load.src_type);
					// デコードタイプ
					combo_box_load_decode.setValue(c.load.decode);
					// イメージのアンロードを有効
					check_box_enable_unload.setValue(c.load.enable_unload);
					_form_container_unload.setVisible(c.load.enable_unload);
					// イメージのアンロード条件
					stepper_unload_allow_size_more_then.setValue(c.load.unload_allow_size_more_then);

					_selected_id = id;
					formUpdate();
				};

				// リロード
				_setting_define.onreload = function(){
					_config.MenuItemSelect(PageExpandConfig.MENU_TYPE_SETTING_EXPAND_IMAGE);
				};

			})();
		}

		// -
		// サウンドの展開の定義
		// -
		function ContentSettingExpandSound(){
			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_sound;

				// タイトル
				_setting_define.setTitle(_i18n.getMessage("menu_setting_expand_sound"));

				// インライン表示の設定
				var title = new UI_TitleSub(form_parent,_i18n.getMessage("menu_setting_expand_sound_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_sound_inline_check_box_container"));
				var parent = container.getElement();

				// 同じオーディオがすでに配置されている場合サムネイルを表示しない
				var check_box_disable_same_sound = new UI_CheckBox(parent,_i18n.getMessage("menu_setting_expand_sound_inline_disable_same_text"));
				check_box_disable_same_sound.onchange = function(v){
					_setting_define.getSelectedDefinitions(function(c){
						c.inline.disable_same_audio = v;
					});

					_setting_define.update();
					projectModify();
				};

				// 最大同時表示数
				var container = new UI_LineContainer(group_parent,_i18n.getMessage("menu_setting_expand_sound_inline_sound_max"));
				var parent = container.getElement();

				var stepper_inline_sound_max = new UI_NumericStepper(parent);
				stepper_inline_sound_max.setMinimum(1);
				stepper_inline_sound_max.setMaximum(99999);
				stepper_inline_sound_max.oninput = function(v){
					_setting_define.getSelectedDefinitions(function(c){
						c.inline.sound_max = v;
					});

					_setting_define.update();
					projectModify();
				};

				// リンクからインライン表示する条件
				var container = new UI_LineContainer(group_parent,_i18n.getMessage("menu_setting_expand_sound_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_sound_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);

				// HTMLAudioElement の設定
				var title = new UI_TitleSub(form_parent,_i18n.getMessage("menu_setting_expand_sound_inline_element"));

				// グループ
				var group = new UI_GroupContainer(form_parent);
				var group_parent = group.getElement();

				// リンクからインライン表示する条件
				var container = new UI_LineContainer(group_parent,_i18n.getMessage("menu_setting_expand_sound_inline_element_script_allow"));
				var parent = container.getElement();
				var script_obj_editer_audio_element_script_allow = new UI_ScriptObjectEditer(parent);
				script_obj_editer_audio_element_script_allow.onchange = function(v){
					_setting_define.getSelectedDefinitions(function(c){
						PageExpandProjectScriptObject_CopyUserScript(c.audio_element.script_allow , v);
					});

					_setting_define.update();
					projectModify();
				};

				// ソースタイプ
				var container = new UI_LineContainer(group_parent,_i18n.getMessage("menu_setting_expand_sound_inline_element_src_type"));
				var parent = container.getElement();
				var combo_box_audio_element_src_type = new UI_ComboBox(parent);
				combo_box_audio_element_src_type.attachItem(_i18n.getMessage("menu_setting_expand_sound_inline_element_src_type_combo_box_item_url"),"url");
				combo_box_audio_element_src_type.attachItem(_i18n.getMessage("menu_setting_expand_sound_inline_element_src_type_combo_box_item_blob_url"),"blob_url");
				combo_box_audio_element_src_type.onchange = function(v){
					_setting_define.getSelectedDefinitions(function(c){
						c.audio_element.src_type = v;
					});

					_setting_define.update();
					projectModify();
				};
				new UI_Break(form_parent);

				// タイトル
				var title = new UI_TitleSub(form_parent,_i18n.getMessage("menu_setting_expand_sound_inline_soundcloud"));

				// グループ
				var group = new UI_GroupContainer(form_parent);
				var group_parent = group.getElement();

				// soundcloud.com の設定
				var container = new UI_LineContainer(group_parent,_i18n.getMessage("menu_setting_expand_sound_inline_soundcloud_check_box_container"));
				var parent = container.getElement();

				// HTML5 版プレイヤーを表示
				var check_box_soundcloud_visible_player_html5 = new UI_CheckBox(parent,_i18n.getMessage("menu_setting_expand_sound_inline_soundcloud_visible_player_html5"));
				check_box_soundcloud_visible_player_html5.onchange = function(v){
					_setting_define.getSelectedDefinitions(function(c){
						c.soundcloud.visible_player_html5 = v;
					});

					_setting_define.update();
					projectModify();
				};
				new UI_Break(form_parent);

				// タイトル
				var title = new UI_TitleSub(form_parent,_i18n.getMessage("menu_setting_expand_sound_inline_mixcloud"));

				// グループ
				var group = new UI_GroupContainer(form_parent);
				var group_parent = group.getElement();

				// www.mixcloud.com の設定
				var container = new UI_LineContainer(group_parent,_i18n.getMessage("menu_setting_expand_sound_inline_mixcloud_check_box_container"));
				var parent = container.getElement();

				// プレイヤーを表示
				var check_box_mixcloud_visible_player = new UI_CheckBox(parent,_i18n.getMessage("menu_setting_expand_sound_inline_mixcloud_visible_player"));
				check_box_mixcloud_visible_player.onchange = function(v){
					_setting_define.getSelectedDefinitions(function(c){
						c.mixcloud.visible_player = v;
					});

					_setting_define.update();
					projectModify();
				};
				new UI_Break(form_parent);

				// データの関連付け
				_setting_define.attachDefineData(define);
				_setting_define.setDefineAssetName("expand_sound");
				_setting_define.setFunctionForNewData(createExpandSound);

				// リスト選択
				_setting_define.onselect = function(id){
					var c = ProjectObjectGetActiveData(define[id]);
					if(!c)	return;

					// 同じオーディオがすでに配置されている場合サムネイルを表示しない
					check_box_disable_same_sound.setValue(c.inline.disable_same_audio);
					// 最大同時表示数
					stepper_inline_sound_max.setValue(c.inline.sound_max);
					// リンクからインライン表示する条件
					script_obj_editer_inline_script_allow.setScriptObject(c.inline.script_allow);
					// サウンドの挿入位置
					script_obj_editer_inline_script_insert.setScriptObject(c.inline.script_insert);
					// HTMLAudioElement を表示する条件
					script_obj_editer_audio_element_script_allow.setScriptObject(c.audio_element.script_allow);
					// ソースタイプ
					combo_box_audio_element_src_type.setValue(c.audio_element.src_type);
					// soundcloud プレイヤー表示
					check_box_soundcloud_visible_player_html5.setValue(c.soundcloud.visible_player_html5);
					// mixcloud プレイヤー表示
					check_box_mixcloud_visible_player.setValue(c.mixcloud.visible_player);
				};

				// リロード
				_setting_define.onreload = function(){
					_config.MenuItemSelect(PageExpandConfig.MENU_TYPE_SETTING_EXPAND_SOUND);
				};

			})();
		}

		// -
		// ビデオの展開の定義
		// -
		function ContentSettingExpandVideo(){
			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_video;

				// インライン表示の設定
				_setting_define.setTitle(_i18n.getMessage("menu_setting_expand_video"));

				// タイトル
				var title = new UI_TitleSub(form_parent,_i18n.getMessage("menu_setting_expand_video_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_video_inline_check_box_container"));
				var parent = container.getElement();

				// 同じURLは展開しない
				var check_box_inline_disable_same_video = new UI_CheckBox(parent,_i18n.getMessage("menu_setting_expand_video_inline_disable_same_video"));
				check_box_inline_disable_same_video.onchange = function(v){
					_setting_define.getSelectedDefinitions(function(c){
						c.inline.disable_same_video = v;
					});

					_setting_define.update();
					projectModify();
				};

				// 最大同時表示数
				var container = new UI_LineContainer(group_parent,_i18n.getMessage("menu_setting_expand_video_inline_video_max"));
				var parent = container.getElement();

				var stepper_inline_video_max = new UI_NumericStepper(parent);
				stepper_inline_video_max.setMinimum(1);
				stepper_inline_video_max.setMaximum(99999);
				stepper_inline_video_max.oninput = function(v){
					_setting_define.getSelectedDefinitions(function(c){
						c.inline.video_max = v;
					});

					_setting_define.update();
					projectModify();
				};

				// ビデオの表示サイズ
				var container = new UI_LineContainer(group_parent,_i18n.getMessage("menu_setting_expand_video_inline_size"));
				var parent = container.getElement();
				// 幅の最大許容限界(ピクセル値)
				new UI_TitleItem(parent,_i18n.getMessage("menu_setting_expand_video_inline_width_max"));
				var stepper_inline_width_max = new UI_NumericStepper(parent);
				stepper_inline_width_max.setMinimum(100);
				stepper_inline_width_max.setMaximum(9999999);
				stepper_inline_width_max.oninput = function(v){
					_setting_define.getSelectedDefinitions(function(c){
						c.inline.width_max = v;
					});

					_setting_define.update();
					projectModify();
				};
				new UI_BreakItem(parent);

				// 高さの最大許容限界(ピクセル値)
				new UI_TitleItem(parent,_i18n.getMessage("menu_setting_expand_video_inline_height_max"));
				var stepper_inline_height_max = new UI_NumericStepper(parent);
				stepper_inline_height_max.setMinimum(100);
				stepper_inline_height_max.setMaximum(9999999);
				stepper_inline_height_max.oninput = function(v){
					_setting_define.getSelectedDefinitions(function(c){
						c.inline.height_max = v;
					});

					_setting_define.update();
					projectModify();
				};

				// リンクからインライン表示する条件
				var container = new UI_LineContainer(group_parent,_i18n.getMessage("menu_setting_expand_video_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_video_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);

				// HTMLVideoElement の設定
				var title = new UI_TitleSub(form_parent,_i18n.getMessage("menu_setting_expand_video_inline_element"));

				// グループ
				var group = new UI_GroupContainer(form_parent);
				var group_parent = group.getElement();

				// リンクからインライン表示する条件
				var container = new UI_LineContainer(group_parent,_i18n.getMessage("menu_setting_expand_video_inline_element_script_allow"));
				var parent = container.getElement();
				var script_obj_editer_video_element_script_allow = new UI_ScriptObjectEditer(parent);
				script_obj_editer_video_element_script_allow.onchange = function(v){
					_setting_define.getSelectedDefinitions(function(c){
						PageExpandProjectScriptObject_CopyUserScript(c.video_element.script_allow , v);
					});

					_setting_define.update();
					projectModify();
				};

				// ソースタイプ
				var container = new UI_LineContainer(group_parent,_i18n.getMessage("menu_setting_expand_video_inline_element_src_type"));
				var parent = container.getElement();
				var combo_box_video_element_src_type = new UI_ComboBox(parent);
				combo_box_video_element_src_type.attachItem(_i18n.getMessage("menu_setting_expand_video_inline_element_src_type_combo_box_item_url"),"url");
				combo_box_video_element_src_type.attachItem(_i18n.getMessage("menu_setting_expand_video_inline_element_src_type_combo_box_item_blob_url"),"blob_url");
				combo_box_video_element_src_type.onchange = function(v){
					_setting_define.getSelectedDefinitions(function(c){
						c.video_element.src_type = v;
					});

					_setting_define.update();
					projectModify();
				};
				new UI_Break(form_parent);

				// タイトル
				var title = new UI_TitleSub(form_parent,_i18n.getMessage("menu_setting_expand_video_inline_youtube"));

				// グループ
				var group = new UI_GroupContainer(form_parent);
				var group_parent = group.getElement();

				// www.youtube.com の設定
				var container = new UI_LineContainer(group_parent,_i18n.getMessage("menu_setting_expand_video_inline_youtube_check_box_container"));
				var parent = container.getElement();

				// ビデオを表示
				var check_box_youtube_visible_video = new UI_CheckBox(parent,_i18n.getMessage("menu_setting_expand_video_inline_youtube_visible_video"));
				check_box_youtube_visible_video.onchange = function(v){
					_setting_define.getSelectedDefinitions(function(c){
						c.youtube.visible_video = v;
					});

					_setting_define.update();
					projectModify();
				};
				new UI_Break(form_parent);

				// タイトル
				var title = new UI_TitleSub(form_parent,_i18n.getMessage("menu_setting_expand_video_inline_nicovideo"));

				// グループ
				var group = new UI_GroupContainer(form_parent);
				var group_parent = group.getElement();

				// www.nicovideo.jp の設定"
				var container = new UI_LineContainer(group_parent,_i18n.getMessage("menu_setting_expand_video_inline_nicovideo_check_box_container"));
				var parent = container.getElement();

				// ビデオを表示
				var check_box_nicovideo_visible_video = new UI_CheckBox(parent,_i18n.getMessage("menu_setting_expand_video_inline_nicovideo_visible_video"));
				check_box_nicovideo_visible_video.onchange = function(v){
					_setting_define.getSelectedDefinitions(function(c){
						c.nicovideo.visible_video = v;
					});

					_setting_define.update();
					projectModify();
				};
				new UI_Break(form_parent);

				// タイトル
				var title = new UI_TitleSub(form_parent,_i18n.getMessage("menu_setting_expand_video_inline_dailymotion"));

				// グループ
				var group = new UI_GroupContainer(form_parent);
				var group_parent = group.getElement();

				// www.dailymotion.com の設定
				var container = new UI_LineContainer(group_parent,_i18n.getMessage("menu_setting_expand_video_inline_dailymotion_check_box_container"));
				var parent = container.getElement();

				// ビデオを表示
				var check_box_dailymotion_visible_video = new UI_CheckBox(parent,_i18n.getMessage("menu_setting_expand_video_inline_dailymotion_visible_video"));
				check_box_dailymotion_visible_video.onchange = function(v){
					_setting_define.getSelectedDefinitions(function(c){
						c.dailymotion.visible_video = v;
					});

					_setting_define.update();
					projectModify();
				};
				new UI_Break(form_parent);

				// タイトル
				var title = new UI_TitleSub(form_parent,_i18n.getMessage("menu_setting_expand_video_inline_video"));

				// グループ
				var group = new UI_GroupContainer(form_parent);
				var group_parent = group.getElement();

				// vimeo.com の設定
				var container = new UI_LineContainer(group_parent,_i18n.getMessage("menu_setting_expand_video_inline_video_check_box_container"));
				var parent = container.getElement();

				// ビデオを表示
				var check_box_vimeo_visible_video = new UI_CheckBox(parent,_i18n.getMessage("menu_setting_expand_video_inline_video_visible_video"));
				check_box_vimeo_visible_video.onchange = function(v){
					_setting_define.getSelectedDefinitions(function(c){
						c.vimeo.visible_video = v;
					});

					_setting_define.update();
					projectModify();
				};
				new UI_Break(form_parent);

				// データの関連付け
				_setting_define.attachDefineData(define);
				_setting_define.setDefineAssetName("expand_video");
				_setting_define.setFunctionForNewData(createExpandVideo);

				// リスト選択
				_setting_define.onselect = function(id){
					var c = ProjectObjectGetActiveData(define[id]);
					if(!c)	return;

					// 同じURLは展開しない
					check_box_inline_disable_same_video.setValue(c.inline.disable_same_video);
					// 最大同時表示数
					stepper_inline_video_max.setValue(c.inline.video_max);
					// 幅の最大許容限界(ピクセル値)
					stepper_inline_width_max.setValue(c.inline.width_max);
					// 高さの最大許容限界(ピクセル値)
					stepper_inline_height_max.setValue(c.inline.height_max);
					// リンクからインライン表示する条件
					script_obj_editer_inline_script_allow.setScriptObject(c.inline.script_allow);
					// エレメントの挿入位置
					script_obj_editer_inline_script_insert.setScriptObject(c.inline.script_insert);
					// HTMLVideoElement を表示する条件
					script_obj_editer_video_element_script_allow.setScriptObject(c.video_element.script_allow);
					// ソースタイプ
					combo_box_video_element_src_type.setValue(c.video_element.src_type);
					// youtube ビデオ表示
					check_box_youtube_visible_video.setValue(c.youtube.visible_video);
					// nicovideo ビデオ表示
					check_box_nicovideo_visible_video.setValue(c.nicovideo.visible_video);
					// dailymotion ビデオ表示
					check_box_dailymotion_visible_video.setValue(c.dailymotion.visible_video);
					// vimeo ビデオ表示
					check_box_vimeo_visible_video.setValue(c.vimeo.visible_video);
				};

				// リロード
				_setting_define.onreload = function(){
					_config.MenuItemSelect(PageExpandConfig.MENU_TYPE_SETTING_EXPAND_VIDEO);
				};

			})();
		}

		// -
		// インラインフレームの展開の定義
		// -
		function ContentSettingExpandIframe(){
			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_iframe;

				// タイトル
				_setting_define.setTitle(_i18n.getMessage("menu_setting_expand_iframe"));

				// インライン表示の設定
				var title = new UI_TitleSub(form_parent,_i18n.getMessage("menu_setting_expand_iframe_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_iframe_inline_check_box_container"));
				var parent = container.getElement();

				// 同じURLは展開しない
				var check_box_disable_same_iframe = new UI_CheckBox(parent,_i18n.getMessage("menu_setting_expand_iframe_inline_disable_same_iframe"));
				check_box_disable_same_iframe.onchange = function(v){
					_setting_define.getSelectedDefinitions(function(c){
						c.inline.disable_same_iframe = v;
					});

					_setting_define.update();
					projectModify();
				};

				// リンクからインライン表示する条件
				var container = new UI_LineContainer(group_parent,_i18n.getMessage("menu_setting_expand_iframe_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();
				};

				// HTMLIFrameElement の挿入位置
				var container = new UI_LineContainer(group_parent,_i18n.getMessage("menu_setting_expand_iframe_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_iframe");
				_setting_define.setFunctionForNewData(createExpandIframe);

				// リスト選択
				_setting_define.onselect = function(id){
					var c = ProjectObjectGetActiveData(define[id]);
					if(!c)	return;

					// 同じURLは展開しない
					check_box_disable_same_iframe.setValue(c.inline.disable_same_iframe);
					// リンクからインライン表示する条件
					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_IFRAME);
				};

			})();
		}

		// -
		// スタイルシートの定義
		// -
		function ContentSettingStyleSheet(){
			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().style_sheet;

				// タイトル
				_setting_define.setTitle(_i18n.getMessage("menu_setting_style_sheet"));

				// タイトル
				var title = new UI_TitleSub(form_parent,_i18n.getMessage("menu_setting_style_sheet_expand_text"));

				// グループ
				var group = new UI_GroupContainer(form_parent);
				var group_parent = group.getElement();

				// HTMLTextAreaElement の設定
				var container = new UI_LineContainer(group_parent,_i18n.getMessage("menu_setting_style_sheet_expand_text_element"));
				var parent = container.getElement();

				new UI_TitleItem(parent,_i18n.getMessage("menu_setting_style_sheet_expand_text_element_inline"));
				var text_input_expand_text_inline = new UI_TextInput(parent);
				text_input_expand_text_inline.oninput = function(v){
					_setting_define.getSelectedDefinitions(function(c){
						c.expand_text.inline = v;
					});
					_setting_define.update();
					projectModify();
				};
				new UI_BreakItem(parent);

				new UI_TitleItem(parent,_i18n.getMessage("menu_setting_style_sheet_expand_text_element_inline_unsafe"));
				var text_input_expand_text_inline_unsafe = new UI_TextInput(parent);
				text_input_expand_text_inline_unsafe.oninput = function(v){
					_setting_define.getSelectedDefinitions(function(c){
						c.expand_text.inline_unsafe = v;
					});
					_setting_define.update();
					projectModify();
				};
				new UI_Break(form_parent);

				// タイトル
				var title = new UI_TitleSub(form_parent,_i18n.getMessage("menu_setting_style_sheet_expand_image"));

				// グループ
				var group = new UI_GroupContainer(form_parent);
				var group_parent = group.getElement();

				// HTMImageElement の設定
				var container = new UI_LineContainer(group_parent,_i18n.getMessage("menu_setting_style_sheet_expand_image_element"));
				var parent = container.getElement();

				new UI_TitleItem(parent,_i18n.getMessage("menu_setting_style_sheet_expand_image_element_inline"));
				var text_input_expand_image_thumbnail = new UI_TextInput(parent);
				text_input_expand_image_thumbnail.oninput = function(v){
					_setting_define.getSelectedDefinitions(function(c){
						c.expand_image.thumbnail = v;
					});
					_setting_define.update();
					projectModify();
				};
				new UI_BreakItem(parent);

				new UI_TitleItem(parent,_i18n.getMessage("menu_setting_style_sheet_expand_image_element_inline_unsafe"));
				var text_input_expand_image_thumbnail_unsafe = new UI_TextInput(parent);
				text_input_expand_image_thumbnail_unsafe.oninput = function(v){
					_setting_define.getSelectedDefinitions(function(c){
						c.expand_image.thumbnail_unsafe = v;
					});
					_setting_define.update();
					projectModify();
				};
				new UI_BreakItem(parent);

				new UI_TitleItem(parent,_i18n.getMessage("menu_setting_style_sheet_expand_image_element_popup"));
				var text_input_expand_image_popup = new UI_TextInput(parent);
				text_input_expand_image_popup.oninput = function(v){
					_setting_define.getSelectedDefinitions(function(c){
						c.expand_image.popup = v;
					});
					_setting_define.update();
					projectModify();
				};
				new UI_BreakItem(parent);

				new UI_TitleItem(parent,_i18n.getMessage("menu_setting_style_sheet_expand_image_element_popup_unsafe"));
				var text_input_expand_image_popup_unsafe = new UI_TextInput(parent);
				text_input_expand_image_popup_unsafe.oninput = function(v){
					_setting_define.getSelectedDefinitions(function(c){
						c.expand_image.popup_unsafe = v;
					});
					_setting_define.update();
					projectModify();
				};
				new UI_Break(form_parent);

				// タイトル
				var title = new UI_TitleSub(form_parent,_i18n.getMessage("menu_setting_style_sheet_expand_sound"));

				// グループ
				var group = new UI_GroupContainer(form_parent);
				var group_parent = group.getElement();

				// HTMLAudioElement の設定
				var container = new UI_LineContainer(group_parent,_i18n.getMessage("menu_setting_style_sheet_expand_sound_element"));
				var parent = container.getElement();

				new UI_TitleItem(parent,_i18n.getMessage("menu_setting_style_sheet_expand_sound_element_inline_audio"));
				var text_input_expand_sound_inline_audio_element = new UI_TextInput(parent);
				text_input_expand_sound_inline_audio_element.oninput = function(v){
					_setting_define.getSelectedDefinitions(function(c){
						c.expand_sound.inline.audio_element.audio = v;
					});
					_setting_define.update();
					projectModify();
				};
				new UI_BreakItem(parent);

				new UI_TitleItem(parent,_i18n.getMessage("menu_setting_style_sheet_expand_sound_element_inline_audio_unsafe"));
				var text_input_expand_sound_inline_audio_element_unsafe = new UI_TextInput(parent);
				text_input_expand_sound_inline_audio_element_unsafe.oninput = function(v){
					_setting_define.getSelectedDefinitions(function(c){
						c.expand_sound.inline.audio_element.audio_unsafe = v;
					});
					_setting_define.update();
					projectModify();
				};

				// SoundCloud の設定
				var container = new UI_LineContainer(group_parent,_i18n.getMessage("menu_setting_style_sheet_expand_sound_soundcloud"));
				var parent = container.getElement();

				new UI_TitleItem(parent,_i18n.getMessage("menu_setting_style_sheet_expand_sound_soundcloud_inline_player_html5"));
				var text_input_expand_sound_soundcloud_inline_player_html5 = new UI_TextInput(parent);
				text_input_expand_sound_soundcloud_inline_player_html5.oninput = function(v){
					_setting_define.getSelectedDefinitions(function(c){
						c.expand_sound.inline.soundcloud.player_html5 = v;
					});
					_setting_define.update();
					projectModify();
				};

				// MixCloud の設定
				var container = new UI_LineContainer(group_parent,_i18n.getMessage("menu_setting_style_sheet_expand_sound_mixcloud"));
				var parent = container.getElement();

				new UI_TitleItem(parent,_i18n.getMessage("menu_setting_style_sheet_expand_sound_mixcloud_inline_player"));
				var text_input_expand_sound_mixcloud_inline_player = new UI_TextInput(parent);
				text_input_expand_sound_mixcloud_inline_player.oninput = function(v){
					_setting_define.getSelectedDefinitions(function(c){
						c.expand_sound.inline.mixcloud.player = v;
					});
					_setting_define.update();
					projectModify();
				};
				new UI_Break(form_parent);

				// タイトル
				var title = new UI_TitleSub(form_parent,_i18n.getMessage("menu_setting_style_sheet_expand_video"));

				// グループ
				var group = new UI_GroupContainer(form_parent);
				var group_parent = group.getElement();

				// HTMLVideoElement の設定
				var container = new UI_LineContainer(group_parent,_i18n.getMessage("menu_setting_style_sheet_expand_video_element"));
				var parent = container.getElement();

				new UI_TitleItem(parent,_i18n.getMessage("menu_setting_style_sheet_expand_video_element_inline_video"));
				var text_input_expand_video_inline_video_element = new UI_TextInput(parent);
				text_input_expand_video_inline_video_element.oninput = function(v){
					_setting_define.getSelectedDefinitions(function(c){
						c.expand_video.inline.video_element.video = v;
					});
					_setting_define.update();
					projectModify();
				};
				new UI_BreakItem(parent);

				new UI_TitleItem(parent,_i18n.getMessage("menu_setting_style_sheet_expand_video_element_inline_video_unsafe"));
				var text_input_expand_video_inline_video_element_unsafe = new UI_TextInput(parent);
				text_input_expand_video_inline_video_element_unsafe.oninput = function(v){
					_setting_define.getSelectedDefinitions(function(c){
						c.expand_video.inline.video_element.video_unsafe = v;
					});
					_setting_define.update();
					projectModify();
				};

				// www.youtube.com の設定
				var container = new UI_LineContainer(group_parent,_i18n.getMessage("menu_setting_style_sheet_expand_video_youtube"));
				var parent = container.getElement();

				new UI_TitleItem(parent,_i18n.getMessage("menu_setting_style_sheet_expand_video_youtube_inline_video"));
				var text_input_expand_video_youtube_inline_video = new UI_TextInput(parent);
				text_input_expand_video_youtube_inline_video.oninput = function(v){
					_setting_define.getSelectedDefinitions(function(c){
						c.expand_video.inline.youtube.video = v;
					});
					_setting_define.update();
					projectModify();
				};

				// www.nicovideo.jp の設定
				var container = new UI_LineContainer(group_parent,_i18n.getMessage("menu_setting_style_sheet_expand_video_nicovideo"));
				var parent = container.getElement();

				new UI_TitleItem(parent,_i18n.getMessage("menu_setting_style_sheet_expand_video_nicovideo_inline_video"));
				var text_input_expand_video_nicovideo_inline_video = new UI_TextInput(parent);
				text_input_expand_video_nicovideo_inline_video.oninput = function(v){
					_setting_define.getSelectedDefinitions(function(c){
						c.expand_video.inline.nicovideo.video = v;
					});
					_setting_define.update();
					projectModify();
				};

				// www.dailymotion.com の設定
				var container = new UI_LineContainer(group_parent,_i18n.getMessage("menu_setting_style_sheet_expand_video_dailymotion"));
				var parent = container.getElement();

				new UI_TitleItem(parent,_i18n.getMessage("menu_setting_style_sheet_expand_video_dailymotion_inline_video"));
				var text_input_expand_video_dailymotion_inline_video = new UI_TextInput(parent);
				text_input_expand_video_dailymotion_inline_video.oninput = function(v){
					_setting_define.getSelectedDefinitions(function(c){
						c.expand_video.inline.dailymotion.video = v;
					});
					_setting_define.update();
					projectModify();
				};

				// vimeo.com の設定
				var container = new UI_LineContainer(group_parent,_i18n.getMessage("menu_setting_style_sheet_expand_video_vimeo"));
				var parent = container.getElement();

				new UI_TitleItem(parent,_i18n.getMessage("menu_setting_style_sheet_expand_video_vimeo_inline_video"));
				var text_input_expand_video_vimeo_inline_video = new UI_TextInput(parent);
				text_input_expand_video_vimeo_inline_video.oninput = function(v){
					_setting_define.getSelectedDefinitions(function(c){
						c.expand_video.inline.vimeo.video = v;
					});
					_setting_define.update();
					projectModify();
				};

				new UI_Break(form_parent);

				// タイトル
				var title = new UI_TitleSub(form_parent,_i18n.getMessage("menu_setting_style_sheet_expand_iframe"));

				// グループ
				var group = new UI_GroupContainer(form_parent);
				var group_parent = group.getElement();

				// HTMLIFrameElement の設定
				var container = new UI_LineContainer(group_parent,_i18n.getMessage("menu_setting_style_sheet_expand_iframe_element"));
				var parent = container.getElement();

				new UI_TitleItem(parent,_i18n.getMessage("menu_setting_style_sheet_expand_iframe_element_inline"));
				var text_input_expand_iframe_inline = new UI_TextInput(parent);
				text_input_expand_iframe_inline.oninput = function(v){
					_setting_define.getSelectedDefinitions(function(c){
						c.expand_iframe.inline = v;
					});
					_setting_define.update();
					projectModify();
				};
				new UI_BreakItem(parent);

				new UI_TitleItem(parent,_i18n.getMessage("menu_setting_style_sheet_expand_iframe_element_inline_unsafe"));
				var text_input_expand_iframe_inline_unsafe = new UI_TextInput(parent);
				text_input_expand_iframe_inline_unsafe.oninput = function(v){
					_setting_define.getSelectedDefinitions(function(c){
						c.expand_iframe.inline_unsafe = v;
					});
					_setting_define.update();
					projectModify();
				};
				new UI_Break(form_parent);

				// データの関連付け
				_setting_define.attachDefineData(define);
				_setting_define.setDefineAssetName("style_sheet");
				_setting_define.setFunctionForNewData(createStyleSheet);

				// リスト選択
				_setting_define.onselect = function(id){
					var c = ProjectObjectGetActiveData(define[id]);
					if(!c)	return;

					text_input_expand_text_inline.setValue(c.expand_text.inline);
					text_input_expand_text_inline_unsafe.setValue(c.expand_text.inline_unsafe);
					text_input_expand_image_thumbnail.setValue(c.expand_image.thumbnail);
					text_input_expand_image_thumbnail_unsafe.setValue(c.expand_image.thumbnail_unsafe);
					text_input_expand_image_popup.setValue(c.expand_image.popup);
					text_input_expand_image_popup_unsafe.setValue(c.expand_image.popup_unsafe);
					text_input_expand_sound_inline_audio_element.setValue(c.expand_sound.inline.audio_element.audio);
					text_input_expand_sound_inline_audio_element_unsafe.setValue(c.expand_sound.inline.audio_element.audio_unsafe);
					text_input_expand_sound_soundcloud_inline_player_html5.setValue(c.expand_sound.inline.soundcloud.player_html5);
					text_input_expand_sound_mixcloud_inline_player.setValue(c.expand_sound.inline.mixcloud.player);
					text_input_expand_video_inline_video_element.setValue(c.expand_video.inline.video_element.video);
					text_input_expand_video_inline_video_element_unsafe.setValue(c.expand_video.inline.video_element.video_unsafe);
					text_input_expand_video_youtube_inline_video.setValue(c.expand_video.inline.youtube.video);
					text_input_expand_video_nicovideo_inline_video.setValue(c.expand_video.inline.nicovideo.video);
					text_input_expand_video_dailymotion_inline_video.setValue(c.expand_video.inline.dailymotion.video);
					text_input_expand_video_vimeo_inline_video.setValue(c.expand_video.inline.vimeo.video);
					text_input_expand_iframe_inline.setValue(c.expand_iframe.inline);
					text_input_expand_iframe_inline_unsafe.setValue(c.expand_iframe.inline_unsafe);
				};

				// リロード
				_setting_define.onreload = function(){
					_config.MenuItemSelect(PageExpandConfig.MENU_TYPE_SETTING_STYLE_SHEET);
				};

			})();
		}

		// -
		// 試験運用の定義
		// -
		function ContentSettingExperimental(){
			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().experimental;

				// タイトル
				_setting_define.setTitle(_i18n.getMessage("menu_setting_experimental"));

				// データの関連付け
				_setting_define.attachDefineData(define);
				_setting_define.setDefineAssetName("experimental");
				_setting_define.setFunctionForNewData(createExperimental);

				// リスト選択
				_setting_define.onselect = function(id){
					var c = ProjectObjectGetActiveData(define[id]);
					if(!c)	return;
				};

				// リロード
				_setting_define.onreload = function(){
					_config.MenuItemSelect(PageExpandConfig.MENU_TYPE_SETTING_EXPERIMENTAL);
				};

			})();
		}

		// -
		// 言語設定
		// -
		function ContentSettingLanguage(){
			var _this = this;

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

			// -
			// 初期化
			// -
			(function(){
				var language = page_expand_project.getObject().language;

				// タイトル
				var title = new UI_Title(_content_window,_i18n.getMessage("menu_setting_language"));

				// 言語設定
				var container = new UI_LineContainer(_content_window,"Language");
				var parent = container.getElement();
				_combo_box_language = new UI_ComboBox(parent);
				_combo_box_language.attachItem("BROWSER LANGUAGE","auto");
				_combo_box_language.attachItem("English","en");
				_combo_box_language.attachItem("中文(简体中文)","zh");
				_combo_box_language.attachItem("日本語","ja");
				_combo_box_language.onchange = function(v){
					language.auto = (v === "auto");
					if(!(language.auto)) language.code = v;
					projectModify();

					// PageExpandConfig を再構築
					initialize();
					_config.MenuItemSelect(PageExpandConfig.MENU_TYPE_SETTING_LANGUAGE);
				};

				// 言語タイプ
				if(language.auto){
					_combo_box_language.setValue("auto");
				}else{
					_combo_box_language.setValue(language.code);
				}
			})();
		}

		// -
		// クレジット
		// -
		function ContentCredit(){
			var _this = this;

			// -
			// 初期化
			// -
			(function(){
				var title = new UI_Title(_content_window,_i18n.getMessage("menu_credit"));

				// バージョン情報
				var container = new UI_LineContainer(_content_window,_i18n.getMessage("menu_credit_info_version"));
				var parent = container.getElement();
				new UI_Text(parent,"PageExpand ver.1.5.31");

				// 製作
				var container = new UI_LineContainer(_content_window,_i18n.getMessage("menu_credit_info_copyright"));
				var parent = container.getElement();
				var table = document.createElement("table");
				parent.appendChild(table);
				var tr = table.insertRow(-1);
				new UI_Text(tr.insertCell(-1),'by');
				new UI_AnchorText(tr.insertCell(-1),"Hakuhin","https://hakuhin.jp/");
				new UI_Text(tr.insertCell(-1),'2010-2023');
				new UI_AnchorText(parent,"https://github.com/hakuhin/PageExpand","https://github.com/hakuhin/PageExpand");

				// 翻訳者
				var container = new UI_LineContainer(_content_window,_i18n.getMessage("menu_credit_info_translator"));
				var parent = container.getElement();
				var table = document.createElement("table");
				parent.appendChild(table);

				var tr = table.insertRow(-1);
				new UI_Text(tr.insertCell(-1),'中文(简体中文)');
				new UI_Text(tr.insertCell(-1),'by');
				new UI_AnchorText(tr.insertCell(-1),"weiq530","https://github.com/weiq530");
				new UI_Text(tr.insertCell(-1),'(ver.1.4.9)');
			})();
		}

		// -
		// ラインコンテナ
		// -
		function UI_LineContainer(parent,label){
			var _this = this;

			// -
			// 透明度をセット
			// -
			_this.setAlpha = function(v){
				_window.style.opacity = v;
			};

			// -
			// エレメント取得
			// -
			_this.getElement = function(){
				return _body;
			};

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

			// -
			// 初期化
			// -
			(function(){
				_window = DocumentCreateElement("div");
				ElementSetStyle(_window,"margin:0px 0px 20px; padding:10px; background:#fcfcfc; border-radius:10px; box-shadow:0px 0px 2px #ccc;");
				parent.appendChild(_window);

				if(label){
					var div = DocumentCreateElement("div");
					ElementSetStyle(div,"padding:5px 0px 5px 20px; margin:0px 0px 10px; background:#666; font-size:16px; color:#fff; border-radius:10px; box-shadow:0px 1px 1px #000;");
					ElementSetTextContent(div,label);
					_window.appendChild(div);
				}

				_body = DocumentCreateElement("div");
				ElementSetStyle(_body,"margin:0px 10px 0px 10px;");
				_window.appendChild(_body);
			})();
		}

		// -
		// インラインコンテナ
		// -
		function UI_InlineContainer(parent,label){
			var _this = this;

			// -
			// 幅をセット
			// -
			_this.setWidth = function(v){
				_window.style.width = v + "px";
			};

			// -
			// 透明度をセット
			// -
			_this.setAlpha = function(v){
				_window.style.opacity = v;
			};

			// -
			// 背景カラーをセット
			// -
			_this.setBackgroundColor = function(argb){
				var color = argb;
				var brightness = 0.9;
				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 style = _label.style;
				var liner_gradient = "linear-gradient(right, #" + r.toString(16) + g.toString(16) + b.toString(16) + " 25px, #666 25px)";
				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;
			};

			// -
			// エレメント取得
			// -
			_this.getElement = function(){
				return _body;
			};

			// -
			// プライベート変数
			// -
			var _window;
			var _label;
			var _body;

			// -
			// 初期化
			// -
			(function(){
				_window = DocumentCreateElement("div");
				ElementSetStyle(_window,"width:350px; margin:0px 5px 20px 0px; padding:10px; background:#fcfcfc; display:inline-table; vertical-align:top; border-radius:10px; box-shadow:0px 0px 2px #ccc;");
				parent.appendChild(_window);

				if(label){
					_label = DocumentCreateElement("div");
					ElementSetStyle(_label,"padding:5px 0px 5px 20px; margin:0px 0px 10px; background:#666; font-size:16px; color:#fff; border-radius:10px; box-shadow:0px 1px 1px #000;");
					ElementSetTextContent(_label,label);
					_window.appendChild(_label);
				}

				_body = DocumentCreateElement("div");
				ElementSetStyle(_body,"margin:0px 10px 0px 10px;");
				_window.appendChild(_body);
			})();
		}

		// -
		// フォームコンテナ
		// -
		function UI_FormContainer(parent,label){
			var _this = this;

			// -
			// 可視状態セット
			// -
			_this.setVisible = function(type){
				if(type){
					_form.style.display = "";
				}else{
					_form.style.display = "none";
				}
			};

			// -
			// エレメント取得
			// -
			_this.getElement = function(){
				return _form;
			};

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

			// -
			// 初期化
			// -
			(function(){
				_form = DocumentCreateElement("form");
				parent.appendChild(_form);
				_this.setVisible(true);
			})();
		}

		// -
		// グループコンテナ
		// -
		function UI_GroupContainer(parent){
			var _this = this;

			// -
			// エレメント取得
			// -
			_this.getElement = function(){
				return _div;
			};

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

			// -
			// 初期化
			// -
			(function(){
				_div = DocumentCreateElement("div");
				_div.style.cssText = "padding-left:10px; padding-right:10px; border-left:20px #f4f4f4 solid; border-right:20px #f4f4f4 solid;";
				parent.appendChild(_div);
			})();
		}

		// -
		// モーダルダイアログ
		// -
		function UI_ModalDialog(parent){
			var _this = this;

			// -
			// 幅を変更
			// -
			_this.setWidth = function(v){
				_window.style.width = v + "px";
			};

			// -
			// 開く
			// -
			_this.open = function(){
				var task = task_container.createTask(null);

				var d = 0.0;
				parent.appendChild(_window);

				// イベントを登録
				addEvent();

				// リサイズ
				resize();

				task.setExecuteFunc(function(){
					var complete = false;
					d += 0.2;
					if(d > 1.0){
						d = 1.0;
						complete = true;
					}
					_background.style.opacity = d * 0.5;

					if(complete){
						task.release();
					}
				});
				task.execute(0xffffffff);
			};

			// -
			// 閉じる
			// -
			_this.close = function(){
				var task = task_container.createTask(null);

				var d = 1.0;
				DomNodeRemove(_window);
				task.setExecuteFunc(function(){
					var complete = false;
					d -= 0.2;
					if(d < 0.0){
						d = 0.0;
						complete = true;
					}
					_background.style.opacity = d * 0.5;

					if(complete){
						DomNodeRemove(_background);
						_this.oncomplete();
						task.release();
						return;
					}
				});
				task.execute(0xffffffff);

				// イベントを破棄
				removeEvent();
			};

			// -
			// エレメント取得
			// -
			_this.getElement = function(){
				return _window;
			};

			// -
			// 完了イベント
			// -
			_this.oncomplete = function(){};

			// -
			// リサイズ(内部用 )
			// -
			function resize(){
				var scroll_pos = WindowGetScrollPosition(window);
				var client_size = DocumentGetClientSize(document);
				var dialog_rect = ElementGetBoundingClientRect(_window);

				var w = dialog_rect.right - dialog_rect.left;
				var h = dialog_rect.bottom - dialog_rect.top;

				_window.style.left = (client_size.width  / 2 - w / 2 + scroll_pos.x) + "px";
				if(client_size.height > h){
					_window.style.top  = (client_size.height / 2 - h / 2 + scroll_pos.y) + "px";
					_fitted_top = false;
				}else{
					if(!_fitted_top){
						_window.style.top  = (scroll_pos.y) + "px";
						_fitted_top = true;
					}
				}
			}

			// -
			// イベント登録(内部用 )
			// -
			function addEvent(){
				// イベントリスナーに対応している
				if(window.addEventListener){

					window.addEventListener("scroll" ,resize);
					window.addEventListener("resize" ,resize);

				// アタッチイベントに対応している
				}else if(window.attachEvent){

					window.attachEvent("onscroll" ,resize);
					window.attachEvent("onresize" ,resize);

				}

			}

			// -
			// イベント破棄(内部用 )
			// -
			function removeEvent(){
				// イベントリスナーに対応している
				if(window.removeEventListener){

					window.removeEventListener("scroll" ,resize);
					window.removeEventListener("resize" ,resize);

				// アタッチイベントに対応している
				}else if(window.detachEvent){

					window.detachEvent("onscroll" ,resize);
					window.detachEvent("onresize" ,resize);

				}
			}

			// -
			// プライベート変数
			// -
			var _background;
			var _window;
			var _fitted_top;

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

				_background = DocumentCreateElement("div");
				ElementSetStyle(_background,"position:fixed; top:0px; bottom:0px; left:0px; right:0px; opacity:0.0; background:#000;");
				parent.appendChild(_background);

				_window = DocumentCreateElement("div");
				ElementSetStyle(_window,"position:absolute; width:800px; padding:10px 20px 5px; background:#00F; background-color:#FFF; border-radius:5px; box-shadow:5px 5px 10px #444;");

			})();
		}

		// -
		// アラートダイアログ
		// -
		function UI_AlertDialog(parent,title){
			var _this = this;

			// -
			// エレメント取得
			// -
			_this.getElement = function(){
				return _element;
			};

			// -
			// 開く
			// -
			_this.open = function(){
				// ダイアログ開始
				_dialog.open();
			};

			// -
			// 完了イベント
			// -
			_this.oncomplete = function(){};

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

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

				// モーダルダイアログ作成
				_dialog = new UI_ModalDialog(_content_window);
				_dialog.setWidth(600);
				var dialog_parent = _dialog.getElement();

				// タイトル
				new UI_Title(dialog_parent,title);

				var container = new UI_LineContainer(dialog_parent,null);
				_element = container.getElement();

				// ボタン
				var ok_button = new UI_OkButton(dialog_parent);
				ok_button.onclick = function(){
					// ダイアログ終了
					_dialog.close();
					_this.oncomplete();
				};

			})();
		}

		// -
		// タイトル
		// -
		function UI_Title(parent,label){
			var _this = this;

			// -
			// 値をセット
			// -
			_this.setValue = function(v){
				ElementSetTextContent(_body,v);
			};

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

			// -
			// 初期化
			// -
			(function(){
				_body = DocumentCreateElement("div");
				ElementSetStyle(_body,"margin:0px 0px 10px; font-size:32px; text-align:right;");
				ElementSetTextContent(_body,label);
				parent.appendChild(_body);
			})();
		}

		// -
		// サブタイトル
		// -
		function UI_TitleSub(parent,label){
			var _this = this;

			// -
			// 値をセット
			// -
			_this.setValue = function(v){
				ElementSetTextContent(_body,v);
			};

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

			// -
			// 初期化
			// -
			(function(){
				_body = DocumentCreateElement("div");
				ElementSetStyle(_body,"margin:0px 0px 10px; font-size:24px; text-align:left;");
				ElementSetTextContent(_body,label);
				parent.appendChild(_body);
			})();
		}

		// -
		// アイテム用タイトル
		// -
		function UI_TitleItem(parent,label){
			var _this = this;

			// -
			// 値をセット
			// -
			_this.setValue = function(v){
				ElementSetTextContent(_body,v);
			};

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

			// -
			// 初期化
			// -
			(function(){
				_body = DocumentCreateElement("div");
				ElementSetStyle(_body,"margin:0px 0px 3px; font-size:14px; line-height:1.0; text-align:left;");
				ElementSetTextContent(_body,label);
				parent.appendChild(_body);
			})();
		}

		// -
		// 改行
		// -
		function UI_Break(parent){
			var _this = this;

			// -
			// 値をセット
			// -
			_this.setHeight = function(v){
				_body.style.height = (v) + "px";
			};

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

			// -
			// 初期化
			// -
			(function(){
				_body = DocumentCreateElement("div");
				ElementSetStyle(_body,"margin:0px; height:20px;");
				parent.appendChild(_body);
			})();
		}

		// -
		// アイテム用改行
		// -
		function UI_BreakItem(parent){
			var _this = this;

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

			// -
			// 初期化
			// -
			(function(){
				_body = DocumentCreateElement("div");
				ElementSetStyle(_body,"margin:0px; height:8px;");
				parent.appendChild(_body);
			})();
		}

		// -
		// テキスト
		// -
		function UI_Text(parent,label){
			var div = DocumentCreateElement("div");
			ElementSetStyle(div,"margin:0px 0px 3px; line-height:1.0; font-size:14px;");
			ElementSetTextContent(div,label);
			parent.appendChild(div);
			return div;
		}

		// -
		// アイテム用テキスト
		// -
		function UI_TextItem(parent,label){
			var div = DocumentCreateElement("div");
			ElementSetStyle(div,"margin:0px 0px 3px; line-height:1.0; font-size:12px; color:#444;");
			ElementSetTextContent(div,label);
			parent.appendChild(div);
			return div;
		}

		// -
		// テキストヒント
		// -
		function UI_TextHint(parent,label){
			var div = DocumentCreateElement("div");
			ElementSetStyle(div,"margin:0px 0px 3px 0px; line-height:1.0; font-size:11px; color:#aaa;");
			ElementSetTextContent(div,label);
			parent.appendChild(div);
			return div;
		}

		// -
		// アンカーテキスト
		// -
		function UI_AnchorText(parent,label,url){
			var div = DocumentCreateElement("div");
			ElementSetStyle(div,"margin:0px 0px 5px;");

			var anchor = DocumentCreateElement("a");
			anchor.href = url;
			ElementSetTextContent(anchor,label);
			div.appendChild(anchor);

			parent.appendChild(div);
			return div;
		}

		// -
		// 順序無しリスト
		// -
		function UI_UnorderedList(parent,label){
			var _this = this;

			// -
			// アイテムを追加
			// -
			_this.addListItem = function(label){
				var li = DocumentCreateElement("li");
				ElementSetTextContent(li,label);
				_ul.appendChild(li);
			};

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

			// -
			// 初期化
			// -
			(function(){
				var container = DocumentCreateElement("div");
				ElementSetStyle(container,"margin:0px 0px 5px 0px;");
				parent.appendChild(container);

				_ul = DocumentCreateElement("ul");
				container.appendChild(_ul);
			})();
		}

		// -
		// チェックボックス
		// -
		function UI_CheckBox(parent,label){
			var _this = this;

			// -
			// 値を取得
			// -
			_this.getValue = function(){
				return _input.checked;
			};

			// -
			// 値をセット
			// -
			_this.setValue = function(v){
				_input.checked = v;
			};

			// -
			// 更新イベント
			// -
			_this.onchange = function(){};

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

			// -
			// 初期化
			// -
			(function(){
				var container = DocumentCreateElement("div");
				ElementSetStyle(container,"margin:0px 0px 5px 0px;");
				parent.appendChild(container);

				var _label = DocumentCreateElement("label");
				ElementSetStyle(_label,"cursor:pointer; user-select:none; -webkit-user-select:none; -moz-user-select:none; -khtml-user-select:none;");
				container.appendChild(_label);

				_input = DocumentCreateElement("input");
				ElementSetStyle(_input,"margin:0px 2px 0px 0px;");
				_input.type = "checkbox";
				_label.appendChild(_input);
				_input.onchange = function(){
					_this.onchange(_input.checked);
				};

				var span = DocumentCreateElement("span");
				ElementSetStyle(span,"font-size:14px;");
				ElementSetTextContent(span,":" + label);
				_label.appendChild(span);
			})();
		}

		// -
		// チェックボックス
		// -
		function UI_LineCheckBox(parent,label){
			var _this = this;

			// -
			// 値を取得
			// -
			_this.getValue = function(){
				return _input.checked;
			};

			// -
			// 値をセット
			// -
			_this.setValue = function(v){
				_input.checked = v;
			};

			// -
			// 更新イベント
			// -
			_this.onchange = function(){};

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

			// -
			// 初期化
			// -
			(function(){
				var container = DocumentCreateElement("span");
				ElementSetStyle(container,"margin:0px 10px 5px 0px;");
				parent.appendChild(container);

				var _label = DocumentCreateElement("label");
				ElementSetStyle(_label,"user-select:none; -webkit-user-select:none; -moz-user-select:none; -khtml-user-select:none;");
				container.appendChild(_label);

				_input = DocumentCreateElement("input");
				ElementSetStyle(_input,"margin:0px 2px 0px 0px;");
				_input.type = "checkbox";
				_label.appendChild(_input);
				_input.onchange = function(){
					_this.onchange(_input.checked);
				};

				var span = DocumentCreateElement("span");
				ElementSetStyle(span,"font-size:14px;");
				ElementSetTextContent(span,":" + label);
				_label.appendChild(span);
			})();
		}

		// -
		// テキストダイナミック
		// -
		function UI_TextDynamic(parent){
			var _this = this;

			// -
			// 値を取得
			// -
			_this.getValue = function(){
				return _input.value;
			};

			// -
			// 値をセット
			// -
			_this.setValue = function(v){
				_input.value = v;
			};

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

			// -
			// 初期化
			// -
			(function(){
				var container = DocumentCreateElement("div");
				ElementSetStyle(container,"margin:0px 8px 5px 0px;");
				parent.appendChild(container);

				_input = DocumentCreateElement("input");
				_input.readOnly = "readonly";
				ElementSetStyle(_input,"width:100%; padding:2px; background:#f8f8f8; color:#888;");
				container.appendChild(_input);
			})();
		}

		// -
		// テキストインプット
		// -
		function UI_TextInput(parent){
			var _this = this;

			// -
			// 値を取得
			// -
			_this.getValue = function(){
				return _input.value;
			};

			// -
			// 値をセット
			// -
			_this.setValue = function(v){
				_input.value = v;
			};

			// -
			// 更新イベント
			// -
			_this.oninput = function(){};

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

			// -
			// 初期化
			// -
			(function(){
				var container = DocumentCreateElement("div");
				ElementSetStyle(container,"margin:0px 8px 5px 0px;");
				parent.appendChild(container);

				_input = DocumentCreateElement("input");
				ElementSetStyle(_input,"width:100%; padding:2px; background-color:#fff;");
				container.appendChild(_input);

				_input.oninput = function(){
					_this.oninput(_input.value);
				};
			})();
		}

		// -
		// 正規表現入力
		// -
		function UI_TextRegExp(parent){
			var _this = this;

			// -
			// 値を取得
			// -
			_this.getValue = function(){
				return getValue();
			};

			// -
			// 値を取得
			// -
			function getValue(){
				return {
					pattern:_input_pattern.value,
					flags:{
						i:_check_box_enable_i.getValue(),
						g:_check_box_enable_g.getValue()
					}
				};
			}

			// -
			// エレメント取得
			// -
			_this.getElement = function(){
				return _body;
			};

			// -
			// 値をセット
			// -
			_this.setValue = function(v){
				_input_pattern.value = v.pattern;
				_check_box_enable_i.setValue(v.flags.i);
				_check_box_enable_g.setValue(v.flags.g);

				errorCheck();
			};

			// -
			// 更新イベント
			// -
			_this.oninput = function(){};

			// -
			// 更新イベント
			// -
			function oninput(){
				errorCheck();

				if(!_visible){
					_this.oninput(getValue());
				}
			}

			// -
			// エラーチェック
			// -
			function errorCheck(){
				try{
					var reg_exp = new RegExp(_input_pattern.value);
					setVisibleResult(false);
				}catch(e){
					_input_result.value = e;
					setVisibleResult(true);
				}
			}

			// -
			// 可視状態セット
			// -
			function setVisibleResult(type){
				if(type){
					_input_result_container.appendChild(_input_result);
				}else{
					if(_visible){
						DomNodeRemove(_input_result);
					}
				}
				_visible = type;
			}

			// -
			// プライベート変数
			// -
			var _body;
			var _input_pattern;
			var _input_result;
			var _visible;
			var _input_result_container;
			var _check_box_enable_i;
			var _check_box_enable_g;

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

				_visible = false;

				_body = DocumentCreateElement("div");
				parent.appendChild(_body);

				var table = DocumentCreateElement("div");
				ElementSetStyle(table,"margin:0px 0px 0px 0px; display:table; width:100%;");
				_body.appendChild(table);

				var input_pattern_container = DocumentCreateElement("div");
				ElementSetStyle(input_pattern_container,"display:table-cell; widht:auto; padding-right:8px;");
				table.appendChild(input_pattern_container);

				_input_pattern = DocumentCreateElement("input");
				ElementSetStyle(_input_pattern,"width:100%; padding:2px; background-color:#fff;");
				input_pattern_container.appendChild(_input_pattern);

				_input_pattern.oninput = function(){
					oninput();
				};

				var input_flags_container = DocumentCreateElement("div");
				ElementSetStyle(input_flags_container,"display:table-cell; width:100px; padding-left:10px;");
				table.appendChild(input_flags_container);

				// g チェック
				_check_box_enable_g = new UI_LineCheckBox(input_flags_container,"g");
				_check_box_enable_g.onchange = function(v){
					oninput();
				};
				// i チェック
				_check_box_enable_i = new UI_LineCheckBox(input_flags_container,"i");
				_check_box_enable_i.onchange = function(v){
					oninput();
				};

				_input_result_container = DocumentCreateElement("div");
				ElementSetStyle(_input_result_container,"margin:0px 8px 5px 0px;");
				_body.appendChild(_input_result_container);

				_input_result = DocumentCreateElement("input");
				_input_result.readOnly = "readonly";
				ElementSetStyle(_input_result,"width:100%; font-size:12px; padding:2px; background:#f88;");

				new UI_TextHint(_body,_i18n.getMessage("menu_text_regexp_hint"));

			})();
		}

		// -
		// テキストエリア
		// -
		function UI_TextArea(parent){
			var _this = this;

			// -
			// 値を取得
			// -
			_this.getValue = function(){
				return _textarea.value;
			};

			// -
			// 値をセット
			// -
			_this.setValue = function(v){
				_textarea.value = v;
			};

			// -
			// 改行コードで分割した配列を取得
			// -
			_this.spiritByLine = function(v){
				// 改行コードを統一
				var s = _textarea.value.replace(/\r\n?/g,"\n");
				var a = s.split("\n");
				var n = a.length;
				var i;
				for(i=n-1;i>=0;i--){
					if(!a[i])	a.splice(i,1);
				}
				return a;
			};

			// -
			// 配列の各番地のデータに文字を挟んだ文字列をセット
			// -
			_this.joinArray = function(ary,v){
				_textarea.value = ary.join(v);
			};

			// -
			// 更新イベント
			// -
			_this.oninput = function(){};

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

			// -
			// 初期化
			// -
			(function(){
				var container = DocumentCreateElement("div");
				ElementSetStyle(container,"margin:0px 0px 5px 0px;");
				parent.appendChild(container);

				_textarea = DocumentCreateElement("textarea");
				ElementSetStyle(_textarea,"width:100%; height:100px; box-sizing:border-box; display:block;");
				container.appendChild(_textarea);

				_textarea.oninput = function(){
					_this.oninput(_textarea.value);
				};
			})();
		}

		// -
		// スクリプトオブジェクトエディタ
		// -
		function UI_ScriptObjectEditer(parent){
			var _this = this;

			// -
			// スクリプトオブジェクトをセット
			// -
			_this.setScriptObject = function(v){
				_script_obj = ObjectCopy(v);
				update();
			};

			// -
			// 更新イベント
			// -
			_this.onchange = function(){};

			// -
			// 更新イベント発行
			// -
			function dispatchChange(){
				if(_this.onchange){
					_this.onchange(ObjectCopy(_script_obj));
				}
			}

			// -
			// 更新
			// -
			function update(){
				var enable = PageExpandProjectScriptObject_HasUserScript(_script_obj);
				if(enable){
					_button.setLabel(_i18n.getMessage("menu_script_obj_editer_delete_script"));
					var script = PageExpandProjectScriptObject_ToString(_script_obj);
					_script_area.setValue(script);
				}else{
					_button.setLabel(_i18n.getMessage("menu_script_obj_editer_edit_script"));
				}
				_script_area.setVisible(enable);
			}

			// -
			// プライベート変数
			// -
			var _body;
			var _script_obj;
			var _button;
			var _script_area;

			// -
			// 初期化
			// -
			(function(){
				_visible = false;

				_body = DocumentCreateElement("div");
				ElementSetStyle(_body,"margin:0px 0px 0px 0px;");
				parent.appendChild(_body);

				_button = new UI_InlineButton(_body,"");
				_button.onclick = function(){
					if(PageExpandProjectScriptObject_HasUserScript(_script_obj)){
						PageExpandProjectScriptObject_ReturnPreset(_script_obj);
					}else{
						var script = PageExpandProjectScriptObject_ToString(_script_obj);
						PageExpandProjectScriptObject_SetUserScript(_script_obj,script);
					}
					update();
					dispatchChange();
				};

				_script_area = new UI_ScriptArea(_body);
				_script_area.oninput = function(v){
					PageExpandProjectScriptObject_SetUserScript(_script_obj,v);
					dispatchChange();
				};

			})();
		}

		// -
		// スクリプトエリア
		// -
		function UI_ScriptArea(parent){
			var _this = this;

			// -
			// 値を取得
			// -
			_this.getValue = function(){
				return _textarea.value;
			};

			// -
			// 値をセット
			// -
			_this.setValue = function(v){
				_textarea.value = v;
			};

			// -
			// 更新イベント
			// -
			_this.oninput = function(){};

			// -
			// 可視状態セット
			// -
			_this.setVisible = function(type){
				if(type){
					_body.style.display = "";
				}else{
					_body.style.display = "none";
				}
			};

			// -
			// 可視状態セット
			// -
			function setVisibleResult(type){
				if(type){
					_body.appendChild(_input_container);
				}else{
					if(_visible){
						DomNodeRemove(_input_container);
					}
				}
				_visible = type;
			}

			// -
			// プライベート変数
			// -
			var _body;
			var _textarea;
			var _input_container;
			var _input;
			var _visible;

			// -
			// 初期化
			// -
			(function(){
				_visible = false;

				_body = DocumentCreateElement("div");
				ElementSetStyle(_body,"margin:0px 0px 5px 0px;");
				parent.appendChild(_body);



				_textarea = DocumentCreateElement("textarea");
				ElementSetStyle(_textarea,"width:100%; height:300px; box-sizing:border-box; display:block; background-color:#fff; margin-bottom:5px;");
				_body.appendChild(_textarea);
				_textarea.oninput = function(){

					try{
						(function(){
							eval("[function(){" + _textarea.value + "}]");
						})();
						setVisibleResult(false);
						_this.oninput(_textarea.value);
					}catch(e){
						_input.value = e;
						setVisibleResult(true);
					}
				};

				_input_container = DocumentCreateElement("div");
				ElementSetStyle(_input_container,"margin:0px 0px 5px 0px;");

				_input = DocumentCreateElement("input");
				_input.readOnly = "readonly";
				ElementSetStyle(_input,"width:100%; box-sizing:border-box; display:block; font-size:12px; padding:2px; background:#f88;");
				_input_container.appendChild(_input);

				new UI_TextHint(_body,_i18n.getMessage("menu_scriptarea_hint"));
			})();
		}

		// -
		// ステッパー
		// -
		function UI_NumericStepper(parent){
			var _this = this;

			// -
			// 値取得
			// -
			_this.getValue = function(){
				var v = parseInt(_input.value);
				if(isNaN(v)) v = 0;
				if(v < _min) v = _min;
				if(v > _max) v = _max;
				return v;
			};

			// -
			// 値をセット
			// -
			_this.setValue = function(v){
				if(isNaN(v)) v = 0;
				if(v < _min) v = _min;
				if(v > _max) v = _max;
				_input.value = v;
			};

			// -
			// 最小値をセット
			// -
			_this.setMinimum = function(v){
				_min = v;
				_input.min = v;
			};

			// -
			// 最大値をセット
			// -
			_this.setMaximum = function(v){
				_max = v;
				_input.max = v;
			};

			// -
			// 更新イベント
			// -
			_this.oninput = function(){};

			// -
			// 更新イベント発行
			// -
			function dispatchInput(v){
				if(_this.oninput){
					_this.oninput(v);
				}
			}

			// -
			// プライベート変数
			// -
			var _input;
			var _min;
			var _max;

			// -
			// 初期化
			// -
			(function(){
				var container = DocumentCreateElement("div");
				ElementSetStyle(container,"margin:0px 8px 5px 0px;");
				parent.appendChild(container);

				_input = DocumentCreateElement("input");
				_input.type = "number";
				ElementSetStyle(_input,"width:auto; min-width:200px; padding:2px; background-color:#fff;");
				container.appendChild(_input);

				_input.oninput = function(){
					var v = _this.getValue();
					dispatchInput(v);
				};
				_input.onchange = function(){
					var v = _this.getValue();
					_this.setValue(v);
					dispatchInput(v);
				};

				_this.setMinimum(-0x80000000);
				_this.setMaximum( 0x7fffffff);
			})();
		}

		// -
		// ラインボタン
		// -
		function UI_LineButton(parent,label){
			var _this = this;

			// -
			// ラベルを編集
			// -
			_this.setLabel = function(label){
				_input.value = label;
			};

			// -
			// クリックイベント
			// -
			_this.onclick = function(){};

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

			// -
			// 初期化
			// -
			(function(){
				var container = DocumentCreateElement("div");
				ElementSetStyle(container,"margin:0px -1px 5px 0px;");
				parent.appendChild(container);

				function ButtonOnClick(){
					_this.onclick();
				}

				_input = DocumentCreateElement("input");
				ElementSetStyle(_input,"width:100%; padding:20px 0px;");
				_input.type = "button";
				_input.value = label;
				container.appendChild(_input);
				_input.onclick = function(){
					ButtonOnClick();
				};
			})();
		}

		// -
		// インラインボタン
		// -
		function UI_InlineButton(parent,label){
			var _this = this;

			// -
			// ラベルを編集
			// -
			_this.setLabel = function(label){
				_input.value = label;
			};

			// -
			// クリックイベント
			// -
			_this.onclick = function(){};

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

			// -
			// 初期化
			// -
			(function(){
				_input = DocumentCreateElement("input");
				ElementSetStyle(_input,"padding:4px 10px; margin:0px 2px 5px 0px; box-sizing:border-box;");
				_input.type = "button";
				_input.value = label;
				parent.appendChild(_input);

				function ButtonOnClick(){
					_this.onclick();
				}

				_input.onclick = function(){
					ButtonOnClick();
				};
			})();
		}

		// -
		// YES NO ボタン
		// -
		function UI_YesNoButton(parent){
			var _this = this;

			// -
			// クリックイベント
			// -
			_this.onclick = function(){};

			// -
			// 初期化
			// -
			(function(){
				var container = DocumentCreateElement("div");
				ElementSetStyle(container,"margin:0px 0px 5px 0px; text-align:center;");
				parent.appendChild(container);

				function ButtonOnClick(result){
					input_yes.disabled = true;
					input_no.disabled = true;
					_this.onclick(result);
				}

				var input_yes = DocumentCreateElement("input");
				ElementSetStyle(input_yes,"padding:10px; width:200px; box-sizing:border-box;");
				input_yes.type = "button";
				input_yes.value = _i18n.getMessage("menu_button_yes");
				container.appendChild(input_yes);
				input_yes.onclick = function(){
					ButtonOnClick(true);
				};

				var input_no = DocumentCreateElement("input");
				ElementSetStyle(input_no,"padding:10px; width:200px; box-sizing:border-box;");
				input_no.type = "button";
				input_no.value = _i18n.getMessage("menu_button_no");
				container.appendChild(input_no);
				input_no.onclick = function(){
					ButtonOnClick(false);
				};
			})();
		}

		// -
		// OK ボタン
		// -
		function UI_OkButton(parent){
			var _this = this;

			// -
			// クリックイベント
			// -
			_this.onclick = function(){};

			// -
			// 有無の設定
			// -
			_this.setEnable = function(type){
				input_ok.disabled = ((!type) ? true : false);
			};

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

			// -
			// 初期化
			// -
			(function(){
				var container = DocumentCreateElement("div");
				ElementSetStyle(container,"margin:0px 0px 5px 0px; text-align:center;");
				parent.appendChild(container);

				function ButtonOnClick(){
					_this.setEnable(false);
					_this.onclick();
				}

				input_ok = DocumentCreateElement("input");
				ElementSetStyle(input_ok,"padding:10px; width:200px; box-sizing:border-box;");
				input_ok.type = "button";
				input_ok.value = _i18n.getMessage("menu_button_ok");
				container.appendChild(input_ok);
				input_ok.onclick = function(){
					ButtonOnClick();
				};
			})();
		}

		// -
		// コンボボックス
		// -
		function UI_ComboBox(parent){
			var _this = this;

			// -
			// アイテム追加
			// -
			_this.attachItem = function(label,value){
				var item = DocumentCreateElement("option");
				ElementSetStyle(item,"margin:2px 0px;");
				ElementSetTextContent(item,label);
				item.value = value;
				_combo_box.appendChild(item);
			};

			// -
			// 値を取得
			// -
			_this.getValue = function(){
				return _combo_box.value;
			};

			// -
			// 値をセット
			// -
			_this.setValue = function(v){
				_combo_box.value = v;
			};

			// -
			// 更新イベント
			// -
			_this.onchange = function(){};

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

			// -
			// 初期化
			// -
			(function(){
				var container = DocumentCreateElement("div");
				ElementSetStyle(container,"margin:0px 0px 5px 0px;");
				parent.appendChild(container);

				_combo_box = DocumentCreateElement("select");
				ElementSetStyle(_combo_box,"width:auto; min-width:200px; height:22px; font-size:14px; box-sizing:border-box; display:block;");
				container.appendChild(_combo_box);

				_combo_box.onchange = function(){
					_this.onchange(_combo_box.value);
				};
			})();
		}

		// -
		// リストボックス
		// -
		function UI_ListBox(parent){
			var _this = this;

			// -
			// アイテム追加
			// -
			_this.attachItem = function(label,value){
				var item = DocumentCreateElement("option");
				ElementSetStyle(item,"margin:2px 0px;");
				ElementSetTextContent(item,label);
				item.value = value;
				_list.appendChild(item);
			};

			// -
			// 値を取得
			// -
			_this.getValue = function(v){
				return _list.value;
			};

			// -
			// 値をセット
			// -
			_this.setValue = function(v){
				_list.value = v;
			};

			// -
			// 有無の設定
			// -
			_this.setEnable = function(type){
				_list.disabled = ((!type) ? true : false);
			};

			// -
			// 複数選択設定
			// -
			_this.setMultiple = function(type){
				_list.multiple = type;
			};

			// -
			// リストサイズをセット
			// -
			_this.setListSize = function(v){
				_list.size = v;
			};

			// -
			// 選択されたアイテムをすべて取得
			// -
			_this.getSelectedValues = function(){
				var ary = new Array();
				var a = _list.options;
				var i;
				var num = a.length;
				for(i=0;i<num;i++){
					var option = a[i];
					if(option.selected){
						ary.push(option.value);
					}
				}
				return ary;
			};

			// -
			// 更新イベント
			// -
			_this.onchange = function(){};

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

			// -
			// 初期化
			// -
			(function(){
				var container = DocumentCreateElement("div");
				ElementSetStyle(container,"margin:0px 0px 5px 0px;");
				parent.appendChild(container);

				_list = DocumentCreateElement("select");
				_list.size = 10;
				ElementSetStyle(_list,"width:100%; box-sizing:border-box; display:block; font-size:14px; background:#fff;");
				container.appendChild(_list);

				_list.onchange = function(){
					_this.onchange(_list.value);
				};
			})();
		}

		// -
		// 正規表現リスト
		// -
		function UI_RegExpList(parent){
			var _this = this;

			// -
			// カスタムオブジェクトを関連付け
			// -
			_this.attachArray = function(ary){
				// クリア
				_this.clear();

				_regexp_list = ObjectCopy(ary);

				// リストに登録
				var i;
				var num = _regexp_list.length;
				for(i=0;i<num;i++){
					attachItem(i);
				}
				
				_this.select(-1);
			};

			// -
			// クリア
			// -
			_this.clear = function(){
				var a = _list.options;
				var i;
				var num = a.length;
				for(i=num-1;i>=0;i--){
					removeItem(a[i]);
				}
			};

			// -
			// 表示更新
			// -
			_this.update = function(){
				var a = _list.options;
				var i;
				var num = a.length;
				for(i=0;i<num;i++){
					updateItem(a[i]);
				}
			};

			// -
			// 追加
			// -
			function addClick(){
				_regexp_list.push(RegExpObjectCreate());

				var id = _regexp_list.length - 1;
				attachItem(id);
				_this.update();
				_this.select(id);
				_this.onchange(_regexp_list);
			}

			// -
			// 削除
			// -
			function deleteClick(){
				var changed = false;
				var a = _list.options;
				var i;
				var num = a.length;

				for(i=num-1;i>=0;i--){
					var item = a[i];
					if(item.selected){
						// 抹消
						_regexp_list.splice(i,1);
						removeItem(item);
						changed = true;
					}
				}

				if(changed){
					var a = _list.options;
					var i;
					var num = a.length;
					for(i=0;i<num;i++){
						a[i].value = i;
					}

					_this.update();
					onselect(_list.selectedIndex);
					_this.onchange(_regexp_list);
				}
			}

			// -
			// 優先度アップ(内部用 )
			// -
			function moveUpClick(){
				var changed = false;
				var t;
				var a = _list.options;
				var i;
				var num = a.length;

				// アイテムなし
				if(!num)	return;

				// 先頭が選択されている
				if(a[0].selected)	return;

				for(i=1;i<num;i++){
					if(a[i].selected){
						var c = a[i];
						var t = c.previousSibling;
						t.selected = true;
						c.selected = false;

						var j = i;
						var k = (i-1);
						t = _regexp_list[k];
						_regexp_list[k] = _regexp_list[j];
						_regexp_list[j] = t;
						changed = true;
					}
				}

				if(changed){
					_this.update();
					_this.onchange(_regexp_list);
				}
			}

			// -
			// 優先度ダウン(内部用 )
			// -
			function moveDownClick(){
				var changed = false;
				var t;
				var a = _list.options;
				var i;
				var num = a.length;

				// アイテムなし
				if(!num)	return;

				// 先頭が選択されている
				if(a[num - 1].selected)	return;

				for(i=num - 2;i>=0;i--){
					if(a[i].selected){
						var c = a[i];
						var t = c.nextSibling;
						t.selected = true;
						c.selected = false;

						var j = i;
						var k = (i+1);
						t = _regexp_list[k];
						_regexp_list[k] = _regexp_list[j];
						_regexp_list[j] = t;
						changed = true;
					}
				}

				if(changed){
					_this.update();
					_this.onchange(_regexp_list);
				}
			}

			// -
			// 選択されたアイテムをすべて取得
			// -
			_this.getSelectedIndices = function(){
				var ary = new Array();
				var a = _list.options;
				var i;
				var num = a.length;
				for(i=0;i<num;i++){
					if(a[i].selected){
						ary.push(i);
					}
				}
				return ary;
			};

			// -
			// 更新イベント
			// -
			_this.onchange = function(){};

			// -
			// 選択イベント
			// -
			_this.onselect = function(){};

			// -
			// 選択イベント(内部用)
			// -
			function onselect(id){
				var text_regexp = _text_regexp.getElement();
				if(id >= 0){
					_text_regexp.setValue(_regexp_list[id]);
					parent.appendChild(text_regexp);
				}else{
					DomNodeRemove(text_regexp);
				}
				_this.onselect(id);
			}

			// -
			// リストを選択
			// -
			_this.select = function(id){
				_list.selectedIndex = id;
				onselect(id);
			};

			// -
			// アイテム追加(内部用 )
			// -
			function attachItem(id){
				var item = DocumentCreateElement("option");
				ElementSetStyle(item,"margin:2px 0px;");

				item.value = id;
				_list.appendChild(item);

				item.onmousedown = item.onmouseup = function(){
					_select_mouse = id;
				};
				updateItem(item);
			}

			// -
			// アイテム更新(内部用 )
			// -
			function updateItem(item){
				var id = parseInt(item.value);
				ElementSetTextContent(item,"" + RegExpObjectGetRegExp(_regexp_list[id]));
			}

			// -
			// アイテム削除(内部用 )
			// -
			function removeItem(item){
				DomNodeRemove(item);
			}

			// -
			// プライベート変数
			// -
			var _regexp_list;
			var _list;
			var _select_id;
			var _select_mouse;
			var _text_regexp;

			// -
			// 初期化
			// -
			(function(){
				var container = DocumentCreateElement("div");
				ElementSetStyle(container,"margin:0px 0px 5px 0px; display:table; width:100%;");
				parent.appendChild(container);

				var list_container = DocumentCreateElement("div");
				ElementSetStyle(list_container,"display:table-cell; vertical-align:top; width:auto;");
				container.appendChild(list_container);

				// リスト
				_list = DocumentCreateElement("select");
				_list.size = 8;
				_list.multiple = true;
				ElementSetStyle(_list,"width:100%; box-sizing:border-box; display:block; font-size:14px; background:#fff;");
				list_container.appendChild(_list);
				_list.onchange = function(e){
					_select_id = _list.selectedIndex;
					var o = _list.options[_select_mouse];
					if(o !== undefined){
						if(o.selected){
							_select_id = _select_mouse;
						}
					}
					onselect(_select_id);
				};

				var button_container = DocumentCreateElement("div");
				ElementSetStyle(button_container,"display:table-cell; vertical-align:top; width:150px;");
				container.appendChild(button_container);

				var button_add = DocumentCreateElement("input");
				button_add.type = "button";
				button_add.value = _i18n.getMessage("menu_regexp_list_button_add");
				ElementSetStyle(button_add,"width:100%; padding:4px 0px; margin:0px;");
				button_container.appendChild(button_add);
				button_add.onclick = function(){
					addClick();
				};

				var button_delete = DocumentCreateElement("input");
				button_delete.type = "button";
				button_delete.value = _i18n.getMessage("menu_regexp_list_button_delete");
				ElementSetStyle(button_delete,"width:100%; padding:4px 0px; margin:0px;");
				button_container.appendChild(button_delete);
				button_delete.onclick = function(){
					deleteClick();
				};

				var button_move_up = DocumentCreateElement("input");
				button_move_up.type = "button";
				button_move_up.value = _i18n.getMessage("menu_regexp_list_button_move_up");
				ElementSetStyle(button_move_up,"width:100%; padding:4px 0px; margin:0px;");
				button_container.appendChild(button_move_up);
				button_move_up.onclick = function(){
					moveUpClick();
				};

				var button_move_down = DocumentCreateElement("input");
				button_move_down.type = "button";
				button_move_down.value = _i18n.getMessage("menu_regexp_list_button_move_down");
				ElementSetStyle(button_move_down,"width:100%; padding:4px 0px; margin:0px;");
				button_container.appendChild(button_move_down);
				button_move_down.onclick = function(){
					moveDownClick();
				};

				_text_regexp = new UI_TextRegExp(parent);
				_text_regexp.oninput = function(v){
					var a = _list.options;
					var i;
					var num = a.length;
					for(i=0;i<num;i++){
						if(a[i].selected){
							_regexp_list[i] = ObjectCopy(v);
							updateItem(a[i]);
						}
					}
					_this.onchange(_regexp_list);
				};

			})();
		}

		// -
		// コンボボックス+ボタン
		// -
		function UI_ComboBoxButton(parent,label){
			var _this = this;

			// -
			// アイテム追加
			// -
			_this.attachItem = function(label,value){
				var item = DocumentCreateElement("option");
				ElementSetStyle(item,"margin:2px 0px;");
				ElementSetTextContent(item,label);
				item.value = value;
				_combo_box.appendChild(item);
			};

			// -
			// アイテムクリア
			// -
			_this.clearItem = function(){
				var options = _combo_box.options;
				var i;
				var num = options.length;
				for(i=num-1;i>=0;i--){
					DomNodeRemove(options[i]);
				}
			};

			// -
			// 選択番号を取得
			// -
			_this.getSelectedIndex = function(){
				return _combo_box.selectedIndex;
			};

			// -
			// 値をセット
			// -
			_this.setValue = function(v){
				_combo_box.value = v;
			};

			// -
			// ボタンクリックイベント
			// -
			_this.onclick = function(){};

			// -
			// 変更イベント
			// -
			_this.onchange = function(){};

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

			// -
			// 初期化
			// -
			(function(){
				var container = DocumentCreateElement("div");
				ElementSetStyle(container,"margin:0px 0px 5px 0px; display:table; width:100%;");
				parent.appendChild(container);

				var combo_box_container = DocumentCreateElement("div");
				ElementSetStyle(combo_box_container,"display:table-cell; widht:auto;");
				container.appendChild(combo_box_container);

				_combo_box = DocumentCreateElement("select");
				ElementSetStyle(_combo_box,"width:100%; height:22px; box-sizing:border-box; display:block; font-size:14px;");
				combo_box_container.appendChild(_combo_box);
				_combo_box.onchange = function(){
					_this.onchange(_combo_box.value);
				};

				var button_container = DocumentCreateElement("div");
				ElementSetStyle(button_container,"display:table-cell; width:50px;");
				container.appendChild(button_container);

				var button = DocumentCreateElement("input");
				button.type = "button";
				ElementSetStyle(button,"width:100%; padding:2px 0px;");
				button.value = label;
				button_container.appendChild(button);
				button.onclick = function(){
					_this.onclick();
				};
			})();
		}

		// -
		// 掲示板拡張用リスト
		// -
		function UI_ExpandBbsList(parent){
			var _this = this;

			// -
			// カスタムオブジェクトを関連付け
			// -
			_this.attachExpandBbsData = function(obj){
				_expand_bbs = obj;

				// リストに登録
				var i;
				var num = _expand_bbs.length;
				for(i=0;i<num;i++){
					attachItem(i);
				}
			};

			// -
			// クリア
			// -
			_this.clear = function(){
				var a = _list.options;
				var i;
				var num = a.length;
				for(i=num-1;i>=0;i--){
					removeItem(a[i]);
				}
			};

			// -
			// 表示更新
			// -
			_this.update = function(){
				var a = _list.options;
				var i;
				var num = a.length;
				for(i=0;i<num;i++){
					updateItem(a[i]);
				}
			};

			// -
			// 追加
			// -
			function addClick(){

				// モーダルダイアログ作成
				var dialog = new UI_ModalDialog(_content_window);
				var dialog_parent = dialog.getElement();

				// タイトル
				var title = new UI_Title(dialog_parent,_i18n.getMessage("menu_setting_expand_bbs_add_dialog"));

				// 名前
				var container = new UI_LineContainer(dialog_parent,_i18n.getMessage("menu_setting_expand_bbs_add_dialog_name"));
				var parent = container.getElement();
				var text_input_name = new UI_TextInput(parent);

				// 既存のURLマッピング設定から複製する
				var container = new UI_LineContainer(dialog_parent,_i18n.getMessage("menu_setting_expand_bbs_add_dialog_copy_define"));
				var parent = container.getElement();
				var list_box_expand_bbs = new UI_ListBox(parent);

				var i;
				var num = _expand_bbs.length;
				for(i=0;i<num;i++){
					var urlmap = ProjectObjectGetActiveData(_expand_bbs[i]);
					list_box_expand_bbs.attachItem(LocaleObjectGetString(urlmap.name),_expand_bbs[i].id);
				}
				list_box_expand_bbs.attachItem(_i18n.getMessage("menu_setting_expand_bbs_add_dialog_define_list_box_item_new"),"");
				list_box_expand_bbs.setValue("");

				// Yes No ボタン
				var yes_no_button = new UI_YesNoButton(dialog_parent);
				yes_no_button.onclick = function(v){

					if(v){
						// 辞書作成
						var dic = new Object();
						var i;
						var num = _expand_bbs.length;
						for(i=0;i<num;i++){
							dic[_expand_bbs[i].id] = _expand_bbs[i];
						}

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

						var obj;
						if(dic[list_box_expand_bbs.getValue()]){
							// 設定を複製
							obj = ObjectCopy(dic[list_box_expand_bbs.getValue()]);
							// プリセットを昇格
							if(!(obj.user))	obj.user = obj.preset;
							// プリセットを破棄
							delete obj.preset;
						}else{
							// 新規作成
							obj = createExpandBbsData();
						}

						// 名前をセット
						var c = ProjectObjectGetActiveData(obj);
						c.name = LocaleObjectCreate();
						LocaleObjectSetString(c.name,text_input_name.getValue());

						// IDをセット
						obj.id = id;

						// 先頭に挿入
						_expand_bbs.unshift(obj);

						// 再構築
						_this.clear();
						_this.attachExpandBbsData(_expand_bbs);
						projectModify();

						// 選択
						_this.select(0);
					}

					// ダイアログ終了
					dialog.close();
				};

				// ダイアログ開始
				dialog.open();
			}

			// -
			// 削除
			// -
			function deleteClick(){
				var a = _list.options;
				var i;
				var num = a.length;
				for(i=num-1;i>=0;i--){
					var item = a[i];
					if(item.selected){
						var c = _dictionary[item.value];
						if(c.preset){
							// プリセットに降格
							delete c.user;
						}else{
							// 抹消
							_expand_bbs.splice(i,1);
							removeItem(item);
						}
					}
				}

				_this.update();
				_this.onselect(_list.selectedIndex);
				projectModify();
			}

			// -
			// 優先度アップ(内部用 )
			// -
			function prioUpClick(){
				var t;
				var a = _list.options;
				var i;
				var num = a.length;

				// アイテムなし
				if(!num)	return;

				// 先頭が選択されている
				if(a[0].selected)	return;

				for(i=1;i<num;i++){
					if(a[i].selected){
						var c = a[i];
						var t = c.previousSibling;
						DomNodeRemove(c);
						_list.insertBefore(c,t);

						var j = i;
						var k = (i-1);
						t = _expand_bbs[k];
						_expand_bbs[k] = _expand_bbs[j];
						_expand_bbs[j] = t;
					}
				}

				_this.update();
				projectModify();
			}

			// -
			// 優先度ダウン(内部用 )
			// -
			function prioDownClick(){
				var t;
				var a = _list.options;
				var i;
				var num = a.length;

				// アイテムなし
				if(!num)	return;

				// 先頭が選択されている
				if(a[num - 1].selected)	return;

				for(i=num - 2;i>=0;i--){
					if(a[i].selected){
						var c = a[i];
						var t = c.nextSibling;
						DomNodeRemove(c);
						_list.insertBefore(c,t.nextSibling);

						var j = i;
						var k = (i+1);
						t = _expand_bbs[k];
						_expand_bbs[k] = _expand_bbs[j];
						_expand_bbs[j] = t;
					}
				}

				_this.update();
				projectModify();
			}

			// -
			// エクスポート(内部用 )
			// -
			function exportClick(){

				var proj = page_expand_project.getObject();
				var export_obj = new Object();
				var ary = new Array();

				var a = _list.options;
				var i;
				var num = a.length;

				for(i=0;i<num;i++){
					if(a[i].selected){
						ary.push(ObjectCopy(_expand_bbs[i]));
					}
				}

				export_obj.version = proj.version;
				export_obj.setting_export = {
					type:"expand_bbs"
				};
				export_obj.expand_bbs = ary;

				// プリセットを除去
				export_obj = PageExpandProjectObjectRemovePreset(export_obj);

				// モーダルダイアログ作成
				var dialog = new UI_ModalDialog(_content_window);
				var dialog_parent = dialog.getElement();

				// タイトル
				var title = new UI_Title(dialog_parent,_i18n.getMessage("menu_setting_expand_bbs_export_dialog"));

				var container = new UI_LineContainer(dialog_parent,_i18n.getMessage("menu_setting_expand_bbs_export_dialog_export"));
				var parent = container.getElement();

				var text_area = new UI_TextArea(parent);
				text_area.setValue(JsonStringify(export_obj));

				new UI_TextHint(parent,_i18n.getMessage("menu_setting_expand_bbs_export_dialog_export_hint"));

				// Ok ボタン
				var yes_no_button = new UI_OkButton(dialog_parent);
				yes_no_button.onclick = function(v){
					// ダイアログ終了
					dialog.close();
				};

				// ダイアログ開始
				dialog.open();
			}

			// -
			// インポート(内部用 )
			// -
			function importClick(){

				// モーダルダイアログ作成
				var dialog = new UI_ModalDialog(_content_window);
				var dialog_parent = dialog.getElement();

				// タイトル
				var title = new UI_Title(dialog_parent,_i18n.getMessage("menu_setting_expand_bbs_import_dialog"));

				// 名前
				var container = new UI_LineContainer(dialog_parent,_i18n.getMessage("menu_setting_expand_bbs_import_dialog_explanation"));
				var parent = container.getElement();
				var unordered_list = new UI_UnorderedList(parent);
				unordered_list.addListItem(_i18n.getMessage("menu_setting_expand_bbs_import_dialog_explanation_0"));
				unordered_list.addListItem(_i18n.getMessage("menu_setting_expand_bbs_import_dialog_explanation_1"));
				unordered_list.addListItem(_i18n.getMessage("menu_setting_expand_bbs_import_dialog_explanation_2"));

				var container = new UI_LineContainer(dialog_parent,_i18n.getMessage("menu_setting_expand_bbs_import_dialog_import"));
				var parent = container.getElement();

				var text_area_import = new UI_TextArea(parent);

				new UI_TextHint(parent,_i18n.getMessage("menu_setting_expand_bbs_import_dialog_import_hint"));

				// 実行しますか?
				var container = new UI_LineContainer(dialog_parent,null);
				var parent = container.getElement();
				new UI_Text(parent,_i18n.getMessage("menu_setting_expand_bbs_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 ExpandBbsImportFailure(message){
						// 結果を表示
						var alert_dialog = new UI_AlertDialog(dialog_parent,_i18n.getMessage("menu_setting_expand_bbs_import_alert"));
						new UI_Text(alert_dialog.getElement(),_i18n.getMessage("menu_setting_expand_bbs_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 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{
							switch(import_obj.setting_export.type){
							case "expand_bbs":
								error = false;
								break;
							}
						}catch(e){}

						if(error){
							throw "Error: It is a type not supported.";
						}

						// 定義をインポート
						PageExpandProjectObjectImportExpandBbs(proj_obj,import_obj);

						projectSave(function(e){
							if(!e.result){
								ExpandBbsImportFailure(e.message);
								return;
							}

							text_area_import.setValue("");

							// 結果を表示
							var alert_dialog = new UI_AlertDialog(dialog_parent,_i18n.getMessage("menu_setting_expand_bbs_import_alert"));
							new UI_Text(alert_dialog.getElement(),_i18n.getMessage("menu_setting_expand_bbs_import_alert_success"));
							alert_dialog.oncomplete = function(){

								// フェードアウト完了後
								dialog.oncomplete = function(){

									// リロード
									_this.onreload();
								};

								// ダイアログ終了
								dialog.close();
							};
							alert_dialog.open();
						});

					}catch(e){
						ExpandBbsImportFailure(e);
					}
				};

				// ダイアログ開始
				dialog.open();
			}

			// -
			// 選択されたアイテムをすべて取得
			// -
			_this.getSelectedIndices = function(){
				var ary = new Array();
				var a = _list.options;
				var i;
				var num = a.length;
				for(i=0;i<num;i++){
					if(a[i].selected){
						ary.push(i);
					}
				}
				return ary;
			};

			// -
			// 更新イベント
			// -
			_this.onchange = function(){};

			// -
			// 選択イベント
			// -
			_this.onselect = function(){};

			// -
			// リロードイベント
			// -
			_this.onreload = function(){};

			// -
			// リストを選択
			// -
			_this.select = function(id){
				_list.selectedIndex = _select_id = _select_mouse = id;
				_this.onselect(id);
			};

			// -
			// リストから選択
			// -
			_this.selectFromIdList = function(list){
				var dic = new Object();
				var i;
				var num = _expand_bbs.length;
				for(i=0;i<num;i++){
					dic[_expand_bbs[i].id] = i;
				}
				
				num = list.length;
				var index = dic[list[num - 1]];
				if(index !== undefined){
					_list.selectedIndex = _select_id = index;
				}
				var a = _list.options;
				for(i=0;i<num;i++){
					if(dic[list[i]] !== undefined){
						var o = a[dic[list[i]]];
						if(o) o.selected = true;
					}
				}
				if(index !== undefined){
					_this.onselect(index);
				}
			};

			// -
			// 履歴を上書き
			// -
			_this.replaceHistory = function(){
				var selected_defines = new Array();
				var a = _this.getSelectedIndices();
				var i;
				var num = a.length;
				for(i=0;i<num;i++){
					selected_defines.push(_expand_bbs[a[i]].id);
				}
				if(_expand_bbs[_select_id]){
					selected_defines.push(_expand_bbs[_select_id].id);
				}

				// 履歴更新
				_history_state.selected_defines = selected_defines;
				delete _history_state.selected_filters;
			};

			// -
			// アイテム追加(内部用 )
			// -
			function attachItem(id){
				var item = DocumentCreateElement("option");
				ElementSetStyle(item,"margin:2px 0px;");

				item.value = _expand_bbs[id].id;
				_dictionary[item.value] = _expand_bbs[id];
				_list.appendChild(item);

				item.onmousedown = item.onmouseup = function(){
					_select_mouse = id;
				};
				updateItem(item);
			}

			// -
			// アイテム更新(内部用 )
			// -
			function updateItem(item){
				var urlmap;
				var c = _dictionary[item.value];
				if(c.preset){
					item.style.color = "#ccc";
				}
				if(c.user){
					item.style.color = "#000";
				}
				urlmap = ProjectObjectGetActiveData(c);
				ElementSetTextContent(item,LocaleObjectGetString(urlmap.name));
			}

			// -
			// アイテム削除(内部用 )
			// -
			function removeItem(item){
				var c = _dictionary[item.value];
				DomNodeRemove(item);
				delete _dictionary[item.value];
			}

			// -
			// プライベート変数
			// -
			var _expand_bbs;
			var _dictionary;
			var _list;
			var _select_id;
			var _select_mouse;

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

				var container = DocumentCreateElement("div");
				ElementSetStyle(container,"margin:0px 0px 5px 0px; display:table; width:100%;");
				parent.appendChild(container);

				var list_container = DocumentCreateElement("div");
				ElementSetStyle(list_container,"display:table-cell; vertical-align:top; width:auto;");
				container.appendChild(list_container);

				// リスト
				_list = DocumentCreateElement("select");
				_list.size = 10;
				_list.multiple = true;
				ElementSetStyle(_list,"width:100%; box-sizing:border-box; display:block; font-size:14px; background:#fff;");
				list_container.appendChild(_list);
				_list.onchange = function(e){
					_select_id = _list.selectedIndex;
					var o = _list.options[_select_mouse];
					if(o !== undefined){
						if(o.selected){
							_select_id = _select_mouse;
						}
					}
					_this.onselect(_select_id);
					_this.replaceHistory();
				};

				var button_container = DocumentCreateElement("div");
				ElementSetStyle(button_container,"display:table-cell; vertical-align:top; width:150px;");
				container.appendChild(button_container);

				var button_add = DocumentCreateElement("input");
				button_add.type = "button";
				button_add.value = _i18n.getMessage("menu_setting_expand_bbs_button_add");
				ElementSetStyle(button_add,"width:100%; padding:4px 0px; margin:0px;");
				button_container.appendChild(button_add);
				button_add.onclick = function(){
					addClick();
				};

				var button_delete = DocumentCreateElement("input");
				button_delete.type = "button";
				button_delete.value = _i18n.getMessage("menu_setting_expand_bbs_button_delete");
				ElementSetStyle(button_delete,"width:100%; padding:4px 0px; margin:0px;");
				button_container.appendChild(button_delete);
				button_delete.onclick = function(){
					deleteClick();
				};

				var button_prio_up = DocumentCreateElement("input");
				button_prio_up.type = "button";
				button_prio_up.value = _i18n.getMessage("menu_setting_expand_bbs_button_prio_up");
				ElementSetStyle(button_prio_up,"width:100%; padding:4px 0px; margin:0px;");
				button_container.appendChild(button_prio_up);
				button_prio_up.onclick = function(){
					prioUpClick();
				};

				var button_prio_down = DocumentCreateElement("input");
				button_prio_down.type = "button";
				button_prio_down.value = _i18n.getMessage("menu_setting_expand_bbs_button_prio_down");
				ElementSetStyle(button_prio_down,"width:100%; padding:4px 0px; margin:0px;");
				button_container.appendChild(button_prio_down);
				button_prio_down.onclick = function(){
					prioDownClick();
				};

				var button_export = DocumentCreateElement("input");
				button_export.type = "button";
				button_export.value = _i18n.getMessage("menu_setting_expand_bbs_button_export");
				ElementSetStyle(button_export,"width:100%; padding:4px 0px; margin:0px;");
				button_container.appendChild(button_export);
				button_export.onclick = function(){
					exportClick();
				};

				var button_import = DocumentCreateElement("input");
				button_import.type = "button";
				button_import.value = _i18n.getMessage("menu_setting_expand_bbs_button_import");
				ElementSetStyle(button_import,"width:100%; padding:4px 0px; margin:0px;");
				button_container.appendChild(button_import);
				button_import.onclick = function(){
					importClick();
				};

				new UI_TextHint(parent,_i18n.getMessage("menu_setting_expand_bbs_list_hint"));
			})();
		}

		// -
		// URLマッピング用リスト
		// -
		function UI_UrlMapList(parent){
			var _this = this;

			// -
			// カスタムオブジェクトを関連付け
			// -
			_this.attachUrlMapData = function(obj){
				_urlmap = obj;

				// リストに登録
				var i;
				var num = _urlmap.length;
				for(i=0;i<num;i++){
					attachItem(i);
				}
			};

			// -
			// クリア
			// -
			_this.clear = function(){
				var a = _list.options;
				var i;
				var num = a.length;
				for(i=num-1;i>=0;i--){
					removeItem(a[i]);
				}
			};

			// -
			// 表示更新
			// -
			_this.update = function(){
				var a = _list.options;
				var i;
				var num = a.length;
				for(i=0;i<num;i++){
					updateItem(a[i]);
				}
			};

			// -
			// 追加
			// -
			function addClick(){

				// モーダルダイアログ作成
				var dialog = new UI_ModalDialog(_content_window);
				var dialog_parent = dialog.getElement();

				// タイトル
				var title = new UI_Title(dialog_parent,_i18n.getMessage("menu_setting_urlmap_add_dialog"));

				// 名前
				var container = new UI_LineContainer(dialog_parent,_i18n.getMessage("menu_setting_urlmap_add_dialog_name"));
				var parent = container.getElement();
				var text_input_name = new UI_TextInput(parent);

				// 既存のURLマッピング設定から複製する
				var container = new UI_LineContainer(dialog_parent,_i18n.getMessage("menu_setting_urlmap_add_dialog_copy_define"));
				var parent = container.getElement();
				var list_box_urlmap = new UI_ListBox(parent);

				var i;
				var num = _urlmap.length;
				for(i=0;i<num;i++){
					var urlmap = ProjectObjectGetActiveData(_urlmap[i]);
					list_box_urlmap.attachItem(LocaleObjectGetString(urlmap.name),_urlmap[i].id);
				}
				list_box_urlmap.attachItem(_i18n.getMessage("menu_setting_urlmap_add_dialog_define_list_box_item_new"),"");
				list_box_urlmap.setValue("");

				// Yes No ボタン
				var yes_no_button = new UI_YesNoButton(dialog_parent);
				yes_no_button.onclick = function(v){

					if(v){
						// 辞書作成
						var dic = new Object();
						var i;
						var num = _urlmap.length;
						for(i=0;i<num;i++){
							dic[_urlmap[i].id] = _urlmap[i];
						}

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

						var obj;
						if(dic[list_box_urlmap.getValue()]){
							// 設定を複製
							obj = ObjectCopy(dic[list_box_urlmap.getValue()]);
							// プリセットを昇格
							if(!(obj.user))	obj.user = obj.preset;
							// プリセットを破棄
							delete obj.preset;
						}else{
							// 新規作成
							obj = createUrlMapData();
						}

						// 名前をセット
						var c = ProjectObjectGetActiveData(obj);
						c.name = LocaleObjectCreate();
						LocaleObjectSetString(c.name,text_input_name.getValue());

						// IDをセット
						obj.id = id;

						// 先頭に挿入
						_urlmap.unshift(obj);

						// 再構築
						_this.clear();
						_this.attachUrlMapData(_urlmap);
						projectModify();

						// 選択
						_this.select(0);
					}

					// ダイアログ終了
					dialog.close();
				};

				// ダイアログ開始
				dialog.open();
			}

			// -
			// 削除
			// -
			function deleteClick(){
				var a = _list.options;
				var i;
				var num = a.length;
				for(i=num-1;i>=0;i--){
					var item = a[i];
					if(item.selected){
						var c = _dictionary[item.value];
						if(c.preset){
							// プリセットに降格
							delete c.user;
						}else{
							// 抹消
							_urlmap.splice(i,1);
							removeItem(item);
						}
					}
				}

				_this.update();
				_this.onselect(_list.selectedIndex);
				projectModify();
			}

			// -
			// 優先度アップ(内部用 )
			// -
			function prioUpClick(){
				var t;
				var a = _list.options;
				var i;
				var num = a.length;

				// アイテムなし
				if(!num)	return;

				// 先頭が選択されている
				if(a[0].selected)	return;

				for(i=1;i<num;i++){
					if(a[i].selected){
						var c = a[i];
						var t = c.previousSibling;
						DomNodeRemove(c);
						_list.insertBefore(c,t);

						var j = i;
						var k = (i-1);
						t = _urlmap[k];
						_urlmap[k] = _urlmap[j];
						_urlmap[j] = t;
					}
				}

				_this.update();
				projectModify();
			}

			// -
			// 優先度ダウン(内部用 )
			// -
			function prioDownClick(){
				var t;
				var a = _list.options;
				var i;
				var num = a.length;

				// アイテムなし
				if(!num)	return;

				// 先頭が選択されている
				if(a[num - 1].selected)	return;

				for(i=num - 2;i>=0;i--){
					if(a[i].selected){
						var c = a[i];
						var t = c.nextSibling;
						DomNodeRemove(c);
						_list.insertBefore(c,t.nextSibling);

						var j = i;
						var k = (i+1);
						t = _urlmap[k];
						_urlmap[k] = _urlmap[j];
						_urlmap[j] = t;
					}
				}

				_this.update();
				projectModify();
			}

			// -
			// 選択されたアイテムをすべて取得
			// -
			_this.getSelectedIndices = function(){
				var ary = new Array();
				var a = _list.options;
				var i;
				var num = a.length;
				for(i=0;i<num;i++){
					if(a[i].selected){
						ary.push(i);
					}
				}
				return ary;
			};

			// -
			// 更新イベント
			// -
			_this.onchange = function(){};

			// -
			// 選択イベント
			// -
			_this.onselect = function(){};

			// -
			// リストを選択
			// -
			_this.select = function(id){
				_list.selectedIndex = id;
				_this.onselect(id);
			};

			// -
			// リストから選択
			// -
			_this.selectFromIdList = function(list){
				var dic = new Object();
				var i;
				var num = _urlmap.length;
				for(i=0;i<num;i++){
					dic[_urlmap[i].id] = i;
				}
				
				num = list.length;
				var index = dic[list[num - 1]];
				if(index !== undefined){
					_list.selectedIndex = _select_id = index;
				}
				var a = _list.options;
				for(i=0;i<num;i++){
					if(dic[list[i]] !== undefined){
						var o = a[dic[list[i]]];
						if(o) o.selected = true;
					}
				}
				if(index !== undefined){
					_this.onselect(index);
				}
			};

			// -
			// 履歴を上書き
			// -
			_this.replaceHistory = function(){
				var selected_defines = new Array();
				var a = _this.getSelectedIndices();
				var i;
				var num = a.length;
				for(i=0;i<num;i++){
					selected_defines.push(_urlmap[a[i]].id);
				}
				if(_urlmap[_select_id]){
					selected_defines.push(_urlmap[_select_id].id);
				}

				// 履歴更新
				_history_state.selected_defines = selected_defines;
				delete _history_state.selected_filters;
			};

			// -
			// アイテム追加(内部用 )
			// -
			function attachItem(id){
				var item = DocumentCreateElement("option");
				ElementSetStyle(item,"margin:2px 0px;");

				item.value = _urlmap[id].id;
				_dictionary[item.value] = _urlmap[id];
				_list.appendChild(item);

				item.onmousedown = item.onmouseup = function(){
					_select_mouse = id;
				};
				updateItem(item);
			}

			// -
			// アイテム更新(内部用 )
			// -
			function updateItem(item){
				var urlmap;
				var c = _dictionary[item.value];
				if(c.preset){
					item.style.color = "#ccc";
				}
				if(c.user){
					item.style.color = "#000";
				}
				urlmap = ProjectObjectGetActiveData(c);
				ElementSetTextContent(item,LocaleObjectGetString(urlmap.name));
			}

			// -
			// アイテム削除(内部用 )
			// -
			function removeItem(item){
				var c = _dictionary[item.value];
				DomNodeRemove(item);
				delete _dictionary[item.value];
			}

			// -
			// プライベート変数
			// -
			var _urlmap;
			var _dictionary;
			var _list;
			var _select_id;
			var _select_mouse;

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

				var container = DocumentCreateElement("div");
				ElementSetStyle(container,"margin:0px 0px 5px 0px; display:table; width:100%;");
				parent.appendChild(container);

				var list_container = DocumentCreateElement("div");
				ElementSetStyle(list_container,"display:table-cell; vertical-align:top; width:auto;");
				container.appendChild(list_container);

				// リスト
				_list = DocumentCreateElement("select");
				_list.size = 10;
				_list.multiple = true;
				ElementSetStyle(_list,"width:100%; box-sizing:border-box; display:block; font-size:14px; background:#fff;");
				list_container.appendChild(_list);
				_list.onchange = function(e){
					_select_id = _list.selectedIndex;
					var o = _list.options[_select_mouse];
					if(o !== undefined){
						if(o.selected){
							_select_id = _select_mouse;
						}
					}
					_this.onselect(_select_id);
					_this.replaceHistory();
				};

				var button_container = DocumentCreateElement("div");
				ElementSetStyle(button_container,"display:table-cell; vertical-align:top; width:150px;");
				container.appendChild(button_container);

				var button_add = DocumentCreateElement("input");
				button_add.type = "button";
				button_add.value = _i18n.getMessage("menu_setting_urlmap_button_add");
				ElementSetStyle(button_add,"width:100%; padding:4px 0px; margin:0px;");
				button_container.appendChild(button_add);
				button_add.onclick = function(){
					addClick();
				};

				var button_delete = DocumentCreateElement("input");
				button_delete.type = "button";
				button_delete.value = _i18n.getMessage("menu_setting_urlmap_button_delete");
				ElementSetStyle(button_delete,"width:100%; padding:4px 0px; margin:0px;");
				button_container.appendChild(button_delete);
				button_delete.onclick = function(){
					deleteClick();
				};

				var button_prio_up = DocumentCreateElement("input");
				button_prio_up.type = "button";
				button_prio_up.value = _i18n.getMessage("menu_setting_urlmap_button_prio_up");
				ElementSetStyle(button_prio_up,"width:100%; padding:4px 0px; margin:0px;");
				button_container.appendChild(button_prio_up);
				button_prio_up.onclick = function(){
					prioUpClick();
				};

				var button_prio_down = DocumentCreateElement("input");
				button_prio_down.type = "button";
				button_prio_down.value = _i18n.getMessage("menu_setting_urlmap_button_prio_down");
				ElementSetStyle(button_prio_down,"width:100%; padding:4px 0px; margin:0px;");
				button_container.appendChild(button_prio_down);
				button_prio_down.onclick = function(){
					prioDownClick();
				};

				new UI_TextHint(parent,_i18n.getMessage("menu_setting_urlmap_list_hint"));
			})();
		}

		// -
		// 定義用リスト
		// -
		function UI_DefineList(parent){
			var _this = this;

			// -
			// カスタムオブジェクトを関連付け
			// -
			_this.attachDefineData = function(obj){
				_define = obj;

				// リストに登録
				var i;
				var num = _define.length;
				for(i=0;i<num;i++){
					attachItem(i);
				}
			};

			// -
			// 定義の識別名をセット
			// -
			_this.setDefineAssetName = function(asset){
				_define_id = asset;
			};

			// -
			// 新規データ作成用関数をセット
			// -
			_this.setFunctionForNewData = function(f){
				_new_data_func = f;
			};

			// -
			// クリア
			// -
			_this.clear = function(){
				var a = _list.options;
				var i;
				var num = a.length;
				for(i=num-1;i>=0;i--){
					removeItem(a[i]);
				}
			};

			// -
			// 表示更新
			// -
			_this.update = function(){
				var a = _list.options;
				var i;
				var num = a.length;
				for(i=0;i<num;i++){
					updateItem(a[i]);
				}
			};

			// -
			// 追加
			// -
			function addClick(){

				// モーダルダイアログ作成
				var dialog = new UI_ModalDialog(_content_window);
				var dialog_parent = dialog.getElement();

				// タイトル
				var title = new UI_Title(dialog_parent,_i18n.getMessage("menu_setting_define_add_dialog"));

				// 名前
				var container = new UI_LineContainer(dialog_parent,_i18n.getMessage("menu_setting_define_add_dialog_name"));
				var parent = container.getElement();
				var text_input_name = new UI_TextInput(parent);

				// 既存のURLマッピング設定から複製する
				var container = new UI_LineContainer(dialog_parent,_i18n.getMessage("menu_setting_define_add_dialog_copy_define"));
				var parent = container.getElement();
				var list_box_define = new UI_ListBox(parent);

				var i;
				var num = _define.length;
				for(i=0;i<num;i++){
					var define = ProjectObjectGetActiveData(_define[i]);
					list_box_define.attachItem(LocaleObjectGetString(define.name),_define[i].id);
				}
				list_box_define.attachItem(_i18n.getMessage("menu_setting_define_add_dialog_define_list_box_item_new"),"");
				list_box_define.setValue("");

				// Yes No ボタン
				var yes_no_button = new UI_YesNoButton(dialog_parent);
				yes_no_button.onclick = function(v){

					if(v){
						// 辞書作成
						var dic = new Object();
						var i;
						var num = _define.length;
						for(i=0;i<num;i++){
							dic[_define[i].id] = _define[i];
						}

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

						var obj;
						if(dic[list_box_define.getValue()]){
							// 設定を複製
							obj = ObjectCopy(dic[list_box_define.getValue()]);
							// プリセットを昇格
							if(!(obj.user))	obj.user = obj.preset;
							// プリセットを破棄
							delete obj.preset;
						}else{
							// 新規作成
							obj = _new_data_func();
						}

						// 名前をセット
						var c = ProjectObjectGetActiveData(obj);
						c.name = LocaleObjectCreate();
						LocaleObjectSetString(c.name,text_input_name.getValue());

						// IDをセット
						obj.id = id;

						// 先頭に挿入
						_define.unshift(obj);

						// 再構築
						_this.clear();
						_this.attachDefineData(_define);
						projectModify();

						// 選択
						_this.select(0);
					}

					// ダイアログ終了
					dialog.close();
				};

				// ダイアログ開始
				dialog.open();
			}

			// -
			// 削除
			// -
			function deleteClick(){

				var proj = page_expand_project.getObject();
				var urlmap = proj.urlmap;

				// 削除対象をスタックに登録
				var stack = new Array();
				(function(){
					var a = _list.options;
					var i;
					var num = a.length;
					for(i=0;i<num;i++){
						var item = a[i];
						if(item.selected){
							stack.push({item:item,id:i});
						}
					}
				})();

				// 代替リスト
				var alive = new Array();
				(function(){
					var dictionary = new Object();
					var i;
					var num;
					num = stack.length;
					for(i=0;i<num;i++){
						var p = _dictionary[stack[i].item.value];
						if(p.preset){
						}else{
							dictionary[p.id] = p;
						}
					}
					num = _define.length;
					for(i=0;i<num;i++){
						var p = _define[i];
						if(!dictionary[p.id]){
							alive.push(p);
						}
					}
				})();

				// 逐次実行
				function execute(){
					while(true){
						var param = stack.pop();
						if(!param){
							_this.update();
							_this.onselect(_list.selectedIndex);
							projectModify();
							return;
						}

						// プリセットを保有するなら降格
						var define = _dictionary[param.item.value];
						if(define.preset){
							// プリセットに降格
							delete define.user;
							continue;
						}

						// URLマッピングで使用中か調べる
						var urlmap_use = new Array();
						(function(){
							var i;
							var num = urlmap.length;
							for(i=0;i<num;i++){
								var c = ProjectObjectGetActiveData(urlmap[i]);
								if(!c)	continue;
								var d = c[_define_id];
								if(d.enable){
									if((d.id) && (typeof(d.id) == "object")){
										var ary = d.id;
										var j;
										var ary_num = ary.length;
										for(j=0;j<ary_num;j++){
											if(ary[j] == define.id){
												urlmap_use.push(urlmap[i]);
												break;
											}
										}
									}else{
										if(d.id == define.id){
											urlmap_use.push(urlmap[i]);
										}
									}
								}
							}
						})();

						// ダイアログを表示して確認
						if(urlmap_use.length){

							// モーダルダイアログ作成
							var dialog = new UI_ModalDialog(_content_window);
							var dialog_parent = dialog.getElement();

							// タイトル
							var title = new UI_Title(dialog_parent,_i18n.getMessage("menu_setting_define_delete_dialog"));

							// 名前
							var container = new UI_LineContainer(dialog_parent,_i18n.getMessage("menu_setting_define_delete_dialog_name"));
							var parent = container.getElement();
							var text_name = new UI_TextDynamic(parent);
							text_name.setValue(LocaleObjectGetString(define.user.name));

							// 既存のURLマッピング設定から複製する
							var container = new UI_LineContainer(dialog_parent,_i18n.getMessage("menu_setting_define_delete_dialog_change_define"));
							var parent = container.getElement();
							var list_box_define = new UI_ListBox(parent);

							// 代替リスト
							(function(){
								var i;
								var num = alive.length;
								for(i=0;i<num;i++){
									var d = ProjectObjectGetActiveData(alive[i]);
									list_box_define.attachItem(LocaleObjectGetString(d.name),alive[i].id);
								}
								list_box_define.attachItem(_i18n.getMessage("menu_setting_define_delete_dialog_define_list_box_item_no_use"),"");
								list_box_define.setValue("");
							})();

							// Yes No ボタン
							var yes_no_button = new UI_YesNoButton(dialog_parent);
							yes_no_button.onclick = function(v){

								if(v){
									var i;
									var num = urlmap_use.length;
									for(i=0;i<num;i++){
										var c = urlmap_use[i].user;
										if(!c)	continue;
										var d = c[_define_id];
										if((d.id) && (typeof(d.id) == "object")){
											var ary = d.id;
											var j;
											var ary_num = ary.length;
											for(j=ary_num-1;j>=0;j--){
												if(ary[j] == define.id){
													if(list_box_define.getValue()){
														ary[j] = list_box_define.getValue();
													}else{
														ary.splice(j,1);
													}
												}
											}
											if(!(ary.length)){
												d.enable = false;
											}
										}else{
											if(list_box_define.getValue()){
												d.id = list_box_define.getValue();
												d.enable = true;
											}else{
												d.id = "";
												d.enable = false;
											}
										}
									}

									// 抹消
									_define.splice(param.id,1);
									removeItem(param.item);

									// 実行再開
									execute();
								}

								// ダイアログ終了
								dialog.close();
							};

							// ダイアログ開始
							dialog.open();

							// 表示更新
							_this.update();
							_this.onselect(_list.selectedIndex);
							projectModify();
							return;
						}else{
							// 抹消
							_define.splice(param.id,1);
							removeItem(param.item);
						}
					}
				}

				// 実行開始
				execute();

			}

			// -
			// 上に移動(内部用 )
			// -
			function moveUpClick(){
				var t;
				var a = _list.options;
				var i;
				var num = a.length;

				// アイテムなし
				if(!num)	return;

				// 先頭が選択されている
				if(a[0].selected)	return;

				for(i=1;i<num;i++){
					if(a[i].selected){
						var c = a[i];
						var t = c.previousSibling;
						DomNodeRemove(c);
						_list.insertBefore(c,t);

						var j = i;
						var k = (i-1);
						t = _define[k];
						_define[k] = _define[j];
						_define[j] = t;
					}
				}

				_this.update();
				projectModify();
			}

			// -
			// 下に移動(内部用 )
			// -
			function moveDownClick(){
				var t;
				var a = _list.options;
				var i;
				var num = a.length;

				// アイテムなし
				if(!num)	return;

				// 先頭が選択されている
				if(a[num - 1].selected)	return;

				for(i=num - 2;i>=0;i--){
					if(a[i].selected){
						var c = a[i];
						var t = c.nextSibling;
						DomNodeRemove(c);
						_list.insertBefore(c,t.nextSibling);

						var j = i;
						var k = (i+1);
						t = _define[k];
						_define[k] = _define[j];
						_define[j] = t;
					}
				}

				_this.update();
				projectModify();
			}

			// -
			// エクスポート(内部用 )
			// -
			function exportClick(){

				var proj = page_expand_project.getObject();
				var export_obj = new Object();
				var ary = new Array();

				var a = _list.options;
				var i;
				var num = a.length;

				for(i=0;i<num;i++){
					if(a[i].selected){
						ary.push(ObjectCopy(_define[i]));
					}
				}

				export_obj.version = proj.version;
				export_obj.setting_export = {
					type:"define",
					asset:_define_id
				};
				export_obj[_define_id] = ary;

				// プリセットを除去
				export_obj = PageExpandProjectObjectRemovePreset(export_obj);

				// モーダルダイアログ作成
				var dialog = new UI_ModalDialog(_content_window);
				var dialog_parent = dialog.getElement();

				// タイトル
				var title = new UI_Title(dialog_parent,_i18n.getMessage("menu_setting_define_export_dialog"));

				var container = new UI_LineContainer(dialog_parent,_i18n.getMessage("menu_setting_define_export_dialog_export"));
				var parent = container.getElement();

				var text_area = new UI_TextArea(parent);
				text_area.setValue(JsonStringify(export_obj));

				new UI_TextHint(parent,_i18n.getMessage("menu_setting_define_export_dialog_export_hint"));

				// Ok ボタン
				var yes_no_button = new UI_OkButton(dialog_parent);
				yes_no_button.onclick = function(v){
					// ダイアログ終了
					dialog.close();
				};

				// ダイアログ開始
				dialog.open();
			}

			// -
			// インポート(内部用 )
			// -
			function importClick(){

				// モーダルダイアログ作成
				var dialog = new UI_ModalDialog(_content_window);
				var dialog_parent = dialog.getElement();

				// タイトル
				var title = new UI_Title(dialog_parent,_i18n.getMessage("menu_setting_define_import_dialog"));

				// 名前
				var container = new UI_LineContainer(dialog_parent,_i18n.getMessage("menu_setting_define_import_dialog_explanation"));
				var parent = container.getElement();
				var unordered_list = new UI_UnorderedList(parent);
				unordered_list.addListItem(_i18n.getMessage("menu_setting_define_import_dialog_explanation_0"));
				unordered_list.addListItem(_i18n.getMessage("menu_setting_define_import_dialog_explanation_1"));
				unordered_list.addListItem(_i18n.getMessage("menu_setting_define_import_dialog_explanation_2"));

				var container = new UI_LineContainer(dialog_parent,_i18n.getMessage("menu_setting_define_import_dialog_import"));
				var parent = container.getElement();

				var text_area_import = new UI_TextArea(parent);

				new UI_TextHint(parent,_i18n.getMessage("menu_setting_define_import_dialog_import_hint"));

				// 実行しますか?
				var container = new UI_LineContainer(dialog_parent,null);
				var parent = container.getElement();
				new UI_Text(parent,_i18n.getMessage("menu_setting_define_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 DefineImportFailure(message){
						// 結果を表示
						var alert_dialog = new UI_AlertDialog(dialog_parent,_i18n.getMessage("menu_setting_define_import_alert"));
						new UI_Text(alert_dialog.getElement(),_i18n.getMessage("menu_setting_define_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 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{
							switch(import_obj.setting_export.type){
							case "setting":
							case "define":
								error = false;
								break;
							}
						}catch(e){}

						if(error){
							throw "Error: It is a type not supported.";
						}

						// 定義をインポート
						PageExpandProjectObjectImportDefine(proj_obj,import_obj,_define_id);

						projectSave(function(e){
							if(!e.result){
								DefineImportFailure(e.message);
								return;
							}

							text_area_import.setValue("");

							// 結果を表示
							var alert_dialog = new UI_AlertDialog(dialog_parent,_i18n.getMessage("menu_setting_define_import_alert"));
							new UI_Text(alert_dialog.getElement(),_i18n.getMessage("menu_setting_define_import_alert_success"));
							alert_dialog.oncomplete = function(){

								// フェードアウト完了後
								dialog.oncomplete = function(){

									// リロード
									_this.onreload();
								};

								// ダイアログ終了
								dialog.close();
							};
							alert_dialog.open();
						});

					}catch(e){
						DefineImportFailure(e);
					}
				};

				// ダイアログ開始
				dialog.open();
			}

			// -
			// 選択されたアイテムを取得
			// -
			_this.getSelectedIndex = function(){
				return _select_id = _list.selectedIndex;
			};

			// -
			// 選択されたアイテムをすべて取得
			// -
			_this.getSelectedIndices = function(){
				var ary = new Array();
				var a = _list.options;
				var i;
				var num = a.length;
				for(i=0;i<num;i++){
					if(a[i].selected){
						ary.push(i);
					}
				}
				return ary;
			};

			// -
			// 更新イベント
			// -
			_this.onchange = function(){};

			// -
			// 選択イベント
			// -
			_this.onselect = function(){};

			// -
			// リロードイベント
			// -
			_this.onreload = function(){};

			// -
			// リストを選択
			// -
			_this.select = function(id){
				_list.selectedIndex = _select_id = _select_mouse = id;
				_this.onselect(id);
			};

			// -
			// リストから選択
			// -
			_this.selectFromIdList = function(list){
				var dic = new Object();
				var i;
				var num = _define.length;
				for(i=0;i<num;i++){
					dic[_define[i].id] = i;
				}
				
				num = list.length;
				var index = dic[list[num - 1]];
				if(index !== undefined){
					_list.selectedIndex = _select_id = index;
				}
				var a = _list.options;
				for(i=0;i<num;i++){
					if(dic[list[i]] !== undefined){
						var o = a[dic[list[i]]];
						if(o) o.selected = true;
					}
				}
				if(index !== undefined){
					_this.onselect(index);
				}
			};

			// -
			// 履歴を上書き
			// -
			_this.replaceHistory = function(){
				var selected_defines = new Array();
				var a = _this.getSelectedIndices();
				var i;
				var num = a.length;
				for(i=0;i<num;i++){
					selected_defines.push(_define[a[i]].id);
				}
				if(_define[_select_id]){
					selected_defines.push(_define[_select_id].id);
				}

				// 履歴更新
				_history_state.selected_defines = selected_defines;
				delete _history_state.selected_filters;
			};

			// -
			// アイテム追加(内部用 )
			// -
			function attachItem(id){
				var item = DocumentCreateElement("option");
				ElementSetStyle(item,"margin:2px 0px;");

				item.value = _define[id].id;
				_dictionary[item.value] = _define[id];
				_list.appendChild(item);

				item.onmousedown = item.onmouseup = function(){
					_select_mouse = id;
				};
				updateItem(item);
			}

			// -
			// アイテム更新(内部用 )
			// -
			function updateItem(item){
				var define;
				var c = _dictionary[item.value];
				if(c.preset){
					item.style.color = "#ccc";
				}
				if(c.user){
					item.style.color = "#000";
				}
				if(c.id == "wildcard"){
					if(c.preset){
						item.style.color = "#f88";
					}
					if(c.user){
						item.style.color = "#c00";
					}
				}
				define = ProjectObjectGetActiveData(c);
				ElementSetTextContent(item,LocaleObjectGetString(define.name));
			}

			// -
			// アイテム削除(内部用 )
			// -
			function removeItem(item){
				var c = _dictionary[item.value];
				DomNodeRemove(item);
				delete _dictionary[item.value];
			}

			// -
			// プライベート変数
			// -
			var _define;
			var _define_id;
			var _new_data_func;
			var _dictionary;
			var _list;
			var _select_id;
			var _select_mouse;

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

				var container = DocumentCreateElement("div");
				ElementSetStyle(container,"margin:0px 0px 5px 0px; display:table; width:100%;");
				parent.appendChild(container);

				var list_container = DocumentCreateElement("div");
				ElementSetStyle(list_container,"display:table-cell; vertical-align:top; width:auto;");
				container.appendChild(list_container);

				// リスト
				_list = DocumentCreateElement("select");
				_list.size = 10;
				_list.multiple = true;
				ElementSetStyle(_list,"width:100%; box-sizing:border-box; display:block; font-size:14px; background:#fff;");
				list_container.appendChild(_list);
				_list.onchange = function(e){
					_select_id = _list.selectedIndex;
					var o = _list.options[_select_mouse];
					if(o !== undefined){
						if(o.selected){
							_select_id = _select_mouse;
						}
					}
					_this.onselect(_select_id);
					_this.replaceHistory();
				};

				var button_container = DocumentCreateElement("div");
				ElementSetStyle(button_container,"display:table-cell; vertical-align:top; width:150px;");
				container.appendChild(button_container);

				var button_add = DocumentCreateElement("input");
				button_add.type = "button";
				button_add.value = _i18n.getMessage("menu_setting_define_button_add");
				ElementSetStyle(button_add,"width:100%; padding:4px 0px; margin:0px;");
				button_container.appendChild(button_add);
				button_add.onclick = function(){
					addClick();
				};

				var button_delete = DocumentCreateElement("input");
				button_delete.type = "button";
				button_delete.value = _i18n.getMessage("menu_setting_define_button_delete");
				ElementSetStyle(button_delete,"width:100%; padding:4px 0px; margin:0px;");
				button_container.appendChild(button_delete);
				button_delete.onclick = function(){
					deleteClick();
				};

				var button_move_up = DocumentCreateElement("input");
				button_move_up.type = "button";
				button_move_up.value = _i18n.getMessage("menu_setting_define_button_move_up");
				ElementSetStyle(button_move_up,"width:100%; padding:4px 0px; margin:0px;");
				button_container.appendChild(button_move_up);
				button_move_up.onclick = function(){
					moveUpClick();
				};

				var button_move_down = DocumentCreateElement("input");
				button_move_down.type = "button";
				button_move_down.value = _i18n.getMessage("menu_setting_define_button_move_down");
				ElementSetStyle(button_move_down,"width:100%; padding:4px 0px; margin:0px;");
				button_container.appendChild(button_move_down);
				button_move_down.onclick = function(){
					moveDownClick();
				};

				var button_export = DocumentCreateElement("input");
				button_export.type = "button";
				button_export.value = _i18n.getMessage("menu_setting_define_button_export");
				ElementSetStyle(button_export,"width:100%; padding:4px 0px; margin:0px;");
				button_container.appendChild(button_export);
				button_export.onclick = function(){
					exportClick();
				};

				var button_import = DocumentCreateElement("input");
				button_import.type = "button";
				button_import.value = _i18n.getMessage("menu_setting_define_button_import");
				ElementSetStyle(button_import,"width:100%; padding:4px 0px; margin:0px;");
				button_container.appendChild(button_import);
				button_import.onclick = function(){
					importClick();
				};

				new UI_TextHint(parent,_i18n.getMessage("menu_setting_define_list_hint"));
			})();
		}

		// -
		// フィルタ用リスト
		// -
		function UI_FilterList(parent){
			var _this = this;

			// -
			// フィルタを関連付け
			// -
			_this.attachDefinitions = function(ary,active){

				// 全てクリア
				_this.clear();

				_definitions = ary;
				_definition_active = active;

				_definition_multiple = false;
				if(_definitions.length > 1){
					_definition_multiple = true;
				}

				_definitions_min = 0x7fffffff;
				_definitions_max = 0;

				var i;
				var num = _definitions.length;
				for(i=0;i<num;i++){
					var filter = ProjectObjectGetActiveData(_definitions[i]).filter;
					if(filter.length > _definitions_max)	_definitions_max = filter.length;
					if(filter.length < _definitions_min)	_definitions_min = filter.length;
				}

				for(i=0;i<_definitions_max;i++){
					attachItem(i);
				}
			};

			// -
			// アクティブなフィルタを取得
			// -
			_this.getDefinitionActive = function(){
				return _definition_active;
			};

			// -
			// 定義の識別名をセット
			// -
			_this.setDefineAssetName = function(asset){
				_define_id = asset;
			};

			// -
			// 新規定義データ作成用関数をセット
			// -
			_this.setFunctionForNewDefineData = function(f){
				_new_define_data_func = f;
			};

			// -
			// 新規フィルタデータ作成用関数をセット
			// -
			_this.setFunctionForNewFilterData = function(f){
				_new_filter_data_func = f;
			};

			// -
			// クリア
			// -
			_this.clear = function(){
				var a = _list.options;
				var i;
				var num = a.length;
				for(i=num-1;i>=0;i--){
					removeItem(a[i]);
				}
			};

			// -
			// 表示更新
			// -
			_this.update = function(){
				var a = _list.options;
				var i;
				var num = a.length;
				for(i=0;i<num;i++){
					updateItem(a[i]);
				}
			};

			// -
			// 表示更新(内部用)
			// -
			function update(){
				_this.attachDefinitions(_definitions,_definition_active);
			}

			// -
			// フィルタを書き込み更新
			// -
			_this.writeDefinitions = function(func){
				var c;
				var p;
				var i;
				var num = _definitions.length;
				for(i=0;i<num;i++){
					c = _definitions[i];
					if(c.user){
						p = c.user;
					}else{
						if(c.preset){
							// プリセットを昇格
							p = c.user = ObjectCopy(c.preset);
						}
					}
					if(p)	func(p);
				}
			};

			// -
			// フィルタを書き込み更新
			// -
			_this.writeFilters = function(func){
				var ary = _this.getSelectedIndices();
				var i;
				var num = ary.length;
				_this.writeDefinitions(function(c){
					var filter = c.filter;
					for(i=0;i<num;i++){
						if(ary[i] < filter.length){
							func(filter[ary[i]]);
						}
					}
				});
			};

			// -
			// 追加
			// -
			function addClick(){

				// モーダルダイアログ作成
				var dialog = new UI_ModalDialog(_content_window);
				var dialog_parent = dialog.getElement();

				// タイトル
				var title = new UI_Title(dialog_parent,_i18n.getMessage("menu_setting_filter_add_dialog"));

				// 名前
				var container = new UI_LineContainer(dialog_parent,_i18n.getMessage("menu_setting_filter_add_dialog_name"));
				var parent = container.getElement();
				var text_input_name = new UI_TextInput(parent);

				// 既存のURLマッピング設定から複製する
				var container = new UI_LineContainer(dialog_parent,_i18n.getMessage("menu_setting_filter_add_dialog_copy_define"));
				var parent = container.getElement();
				var list_box_filter = new UI_ListBox(parent);

				var dictionary = new Object();
				var unique = 0;
				var i;
				var j;
				var num = _definitions.length;
				for(i=0;i<num;i++){
					var filters = ProjectObjectGetActiveData(_definitions[i]).filter;
					var filters_num = filters.length;
					for(j=0;j<filters_num;j++){
						var filter = filters[j];
						list_box_filter.attachItem(LocaleObjectGetString(filter.name),unique);
						dictionary[unique] = filter;
						unique ++;
					}
				}

				list_box_filter.attachItem(_i18n.getMessage("menu_setting_filter_add_dialog_define_list_box_item_new"),"");
				list_box_filter.setValue("");

				// Yes No ボタン
				var yes_no_button = new UI_YesNoButton(dialog_parent);
				yes_no_button.onclick = function(v){

					if(v){
						var filter = dictionary[list_box_filter.getValue()];
						if(filter){
							_this.writeDefinitions(function(c){
								var filter_copy = ObjectCopy(filter);
								c.filter.unshift(filter_copy);
								filter_copy.name = LocaleObjectCreate();
								LocaleObjectSetString(filter_copy.name,text_input_name.getValue());
							});
						}else{
							_this.writeDefinitions(function(c){
								if(_new_filter_data_func){
									var filter_new = _new_filter_data_func();
									c.filter.unshift(filter_new);
									filter_new.name = LocaleObjectCreate();
									LocaleObjectSetString(filter_new.name,text_input_name.getValue());
								}
							});
						}

						update();
						projectModify();
						_this.select(0);
						_this.onchange();
					}

					// ダイアログ終了
					dialog.close();
				};

				// ダイアログ開始
				dialog.open();
			}

			// -
			// 削除
			// -
			function deleteClick(){
				var a = _list.options;
				var i;
				var j;
				var num = a.length;
				for(i=num-1;i>=0;i--){
					var item = a[i];
					if(item.selected){
						var id = parseInt(item.value);
						_this.writeDefinitions(function(c){
							var filter = c.filter;
							if(filter.length > id){
								filter.splice(id,1);
							}
						});

						removeItem(item);
					}
				}

				update();
				projectModify();
				_this.onselect(_list.selectedIndex);
				_this.onchange();
			}

			// -
			// 優先度アップ(内部用 )
			// -
			function prioUpClick(){
				var t;
				var a = _list.options;
				var i;
				var num = a.length;

				// アイテムなし
				if(!num)	return;

				// 複数選択オーバー
				for(i=_definitions_min;i<num;i++){
					if(a[i].selected){
						return;
					}
				}

				// 先頭が選択されている
				if(a[0].selected)	return;

				for(i=1;i<num;i++){
					if(a[i].selected){
						var c = a[i];
						var t = c.previousSibling;
						t.selected = true;
						c.selected = false;

						var j = i;
						var k = (i-1);
						_this.writeDefinitions(function(c){
							var filter = c.filter;
							t = filter[k];
							filter[k] = filter[j];
							filter[j] = t;
						});
					}
				}

				_this.update();
				projectModify();
				_this.onchange();
			}

			// -
			// 優先度ダウン(内部用 )
			// -
			function prioDownClick(){
				var t;
				var a = _list.options;
				var i;
				var num = a.length;

				// アイテムなし
				if(!num)	return;

				// 複数選択オーバー
				for(i=_definitions_min;i<num;i++){
					if(a[i].selected){
						return;
					}
				}

				// 先頭が選択されている
				if(a[_definitions_min - 1].selected)	return;

				for(i=num - 2;i>=0;i--){
					if(a[i].selected){
						var c = a[i];
						var t = c.nextSibling;
						t.selected = true;
						c.selected = false;

						var j = i;
						var k = (i+1);
						_this.writeDefinitions(function(c){
							var filter = c.filter;
							t = filter[k];
							filter[k] = filter[j];
							filter[j] = t;
						});
					}
				}

				_this.update();
				projectModify();
				_this.onchange();
			}

			// -
			// エクスポート(内部用 )
			// -
			function exportClick(){

				var proj = page_expand_project.getObject();
				var export_obj = new Object();
				var ary = new Array();

				var a = _list.options;
				var i;
				var num = a.length;

				var filter = ProjectObjectGetActiveData(_definition_active).filter;
				for(i=0;i<num;i++){
					if(a[i].selected){
						if(filter[i]){
							ary.push(ObjectCopy(filter[i]));
						}
					}
				}

				export_obj.version = proj.version;
				export_obj.setting_export = {
					type:"filter",
					asset:_define_id
				};

				var define = _new_define_data_func();
				define.id = PageExpandProjectObjectDefineGenerateNewUserId(_definitions);
				define.user.filter = ary;
				export_obj[_define_id] = [define];

				// プリセットを除去
				export_obj = PageExpandProjectObjectRemovePreset(export_obj);

				// モーダルダイアログ作成
				var dialog = new UI_ModalDialog(_content_window);
				var dialog_parent = dialog.getElement();

				// タイトル
				var title = new UI_Title(dialog_parent,_i18n.getMessage("menu_setting_filter_export_dialog"));

				var container = new UI_LineContainer(dialog_parent,_i18n.getMessage("menu_setting_filter_export_dialog_export"));
				var parent = container.getElement();

				var text_area = new UI_TextArea(parent);
				text_area.setValue(JsonStringify(export_obj));

				new UI_TextHint(parent,_i18n.getMessage("menu_setting_filter_export_dialog_export_hint"));

				// Ok ボタン
				var yes_no_button = new UI_OkButton(dialog_parent);
				yes_no_button.onclick = function(v){
					// ダイアログ終了
					dialog.close();
				};

				// ダイアログ開始
				dialog.open();
			}

			// -
			// インポート(内部用 )
			// -
			function importClick(){

				// モーダルダイアログ作成
				var dialog = new UI_ModalDialog(_content_window);
				var dialog_parent = dialog.getElement();

				// タイトル
				var title = new UI_Title(dialog_parent,_i18n.getMessage("menu_setting_filter_import_dialog"));

				// 名前
				var container = new UI_LineContainer(dialog_parent,_i18n.getMessage("menu_setting_filter_import_dialog_explanation"));
				var parent = container.getElement();
				var unordered_list = new UI_UnorderedList(parent);
				unordered_list.addListItem(_i18n.getMessage("menu_setting_filter_import_dialog_explanation_0"));
				unordered_list.addListItem(_i18n.getMessage("menu_setting_filter_import_dialog_explanation_1"));
				unordered_list.addListItem(_i18n.getMessage("menu_setting_filter_import_dialog_explanation_2"));

				var container = new UI_LineContainer(dialog_parent,_i18n.getMessage("menu_setting_filter_import_dialog_import"));
				var parent = container.getElement();

				var text_area_import = new UI_TextArea(parent);

				new UI_TextHint(parent,_i18n.getMessage("menu_setting_filter_import_dialog_import_hint"));

				// 実行しますか?
				var container = new UI_LineContainer(dialog_parent,null);
				var parent = container.getElement();
				new UI_Text(parent,_i18n.getMessage("menu_setting_filter_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 ExpandBbsImportFailure(message){
						// 結果を表示
						var alert_dialog = new UI_AlertDialog(dialog_parent,_i18n.getMessage("menu_setting_filter_import_alert"));
						new UI_Text(alert_dialog.getElement(),_i18n.getMessage("menu_setting_filter_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 import_obj = JsonParse(text_area_import.getValue());

						// バージョンが一致しない
						if(import_obj.version > proj_obj.version){
							throw "Error: It is a version not supported.";
						}

						// 出力タイプチェック
						var error = false;
						try{
							var setting_export = import_obj.setting_export;
							if(setting_export.type != "filter"){
								error = true;
							}
							if(setting_export.asset != _define_id){
								error = true;
							}
						}catch(e){
							error = true;
						}

						if(error){
							throw "Error: It is a type not supported.";
						}

						// 最新のフィルタを追加
						var filter_latest = PageExpandProjectObjectGetDefineFilterLatest(import_obj,_define_id);
						_this.writeDefinitions(function(c){
							var filter = c.filter;
							c.filter = c.filter.concat(filter_latest);
						});

						projectSave(function(e){
							if(!e.result){
								ExpandBbsImportFailure(e.message);
								return;
							}

							text_area_import.setValue("");

							// 結果を表示
							var alert_dialog = new UI_AlertDialog(dialog_parent,_i18n.getMessage("menu_setting_filter_import_alert"));
							new UI_Text(alert_dialog.getElement(),_i18n.getMessage("menu_setting_filter_import_alert_success"));
							alert_dialog.oncomplete = function(){

								// フェードアウト完了後
								dialog.oncomplete = function(){
									update();
									projectModify();
									_this.onchange();
								};

								// ダイアログ終了
								dialog.close();
							};
							alert_dialog.open();
						});

					}catch(e){
						ExpandBbsImportFailure(e);
					}
				};

				// ダイアログ開始
				dialog.open();
			}

			// -
			// 選択されたアイテムをすべて取得
			// -
			_this.getSelectedIndices = function(){
				var ary = new Array();
				var a = _list.options;
				var i;
				var num = a.length;
				for(i=0;i<num;i++){
					if(a[i].selected){
						ary.push(i);
					}
				}
				return ary;
			};

			// -
			// 更新イベント
			// -
			_this.onchange = function(){};

			// -
			// 選択イベント
			// -
			_this.onselect = function(){};

			// -
			// リストを選択
			// -
			_this.select = function(id){
				_list.selectedIndex = _select_id = _select_mouse = id;
				_this.onselect(id);
			};

			// -
			// リストを選択
			// -
			_this.selectFromList = function(list){
				var dic = new Object();
				var i;
				var num = list.length;
				var index = list[num - 1];
				if(_definitions[index] !== undefined){
					_list.selectedIndex = _select_id = index;
				}
				var a = _list.options;
				for(i=0;i<num;i++){
					var o = a[list[i]];
					if(o) o.selected = true;
				}
				if(index !== undefined){
					_this.onselect(index);
				}
			};

			// -
			// 履歴を上書き
			// -
			_this.replaceHistory = function(){
				var selected_filters = new Array();
				var a = _this.getSelectedIndices();
				var i;
				var num = a.length;
				for(i=0;i<num;i++){
					selected_filters.push(a[i]);
				}
				if(_definitions[_select_id]){
					selected_filters.push(_select_id);
				}

				// 履歴更新
				_history_state.selected_filters = selected_filters;
			};

			// -
			// アイテム追加(内部用 )
			// -
			function attachItem(id){
				var item = DocumentCreateElement("option");
				ElementSetStyle(item,"margin:2px 0px;");

				item.value = id;
				_list.appendChild(item);

				item.onmousedown = item.onmouseup = function(){
					_select_mouse = id;
				};
				updateItem(item);
			}

			// -
			// アイテム更新(内部用 )
			// -
			function updateItem(item){

				item.style.color = "#000";
				var id = parseInt(item.value);

				if(_definition_multiple){
					if(_definitions_min <= id){
						item.style.color = "#ccc";
					}
					var filter = ProjectObjectGetActiveData(_definition_active).filter;
					if(filter.length <= id){
						ElementSetTextContent(item," *");
					}else{
						ElementSetTextContent(item,LocaleObjectGetString(filter[id].name) + " *");
					}
				}else{
					var filter = ProjectObjectGetActiveData(_definition_active).filter;
					ElementSetTextContent(item,LocaleObjectGetString(filter[id].name));
				}
			}

			// -
			// アイテム削除(内部用 )
			// -
			function removeItem(item){
				DomNodeRemove(item);
			}

			// -
			// プライベート変数
			// -
			var _definitions;
			var _definitions_min;
			var _definitions_max;
			var _definition_active;
			var _definition_multiple;
			var _list;
			var _define_id;
			var _select_id;
			var _select_mouse;
			var _new_define_data_func;
			var _new_filter_data_func;

			// -
			// 初期化
			// -
			(function(){
				var container = DocumentCreateElement("div");
				ElementSetStyle(container,"margin:0px 0px 5px 0px; display:table; width:100%;");
				parent.appendChild(container);

				var list_container = DocumentCreateElement("div");
				ElementSetStyle(list_container,"display:table-cell; vertical-align:top; width:auto;");
				container.appendChild(list_container);

				// リスト
				_list = DocumentCreateElement("select");
				_list.size = 10;
				_list.multiple = true;
				ElementSetStyle(_list,"width:100%; box-sizing:border-box; display:block; font-size:14px; background:#fff;");
				list_container.appendChild(_list);
				_list.onchange = function(e){
					_select_id = _list.selectedIndex;
					var o = _list.options[_select_mouse];
					if(o !== undefined){
						if(o.selected){
							_select_id = _select_mouse;
						}
					}
					_this.onselect(_select_id);
					_this.replaceHistory();
				};

				var button_container = DocumentCreateElement("div");
				ElementSetStyle(button_container,"display:table-cell; vertical-align:top; width:150px;");
				container.appendChild(button_container);

				var button_add = DocumentCreateElement("input");
				button_add.type = "button";
				button_add.value = _i18n.getMessage("menu_setting_filter_button_add");
				ElementSetStyle(button_add,"width:100%; padding:4px 0px; margin:0px;");
				button_container.appendChild(button_add);
				button_add.onclick = function(){
					addClick();
				};

				var button_delete = DocumentCreateElement("input");
				button_delete.type = "button";
				button_delete.value = _i18n.getMessage("menu_setting_filter_button_delete");
				ElementSetStyle(button_delete,"width:100%; padding:4px 0px; margin:0px;");
				button_container.appendChild(button_delete);
				button_delete.onclick = function(){
					deleteClick();
				};

				var button_prio_up = DocumentCreateElement("input");
				button_prio_up.type = "button";
				button_prio_up.value = _i18n.getMessage("menu_setting_filter_button_prio_up");
				ElementSetStyle(button_prio_up,"width:100%; padding:4px 0px; margin:0px;");
				button_container.appendChild(button_prio_up);
				button_prio_up.onclick = function(){
					prioUpClick();
				};

				var button_prio_down = DocumentCreateElement("input");
				button_prio_down.type = "button";
				button_prio_down.value = _i18n.getMessage("menu_setting_filter_button_prio_down");
				ElementSetStyle(button_prio_down,"width:100%; padding:4px 0px; margin:0px;");
				button_container.appendChild(button_prio_down);
				button_prio_down.onclick = function(){
					prioDownClick();
				};

				var button_export = DocumentCreateElement("input");
				button_export.type = "button";
				button_export.value = _i18n.getMessage("menu_setting_filter_button_export");
				ElementSetStyle(button_export,"width:100%; padding:4px 0px; margin:0px;");
				button_container.appendChild(button_export);
				button_export.onclick = function(){
					exportClick();
				};

				var button_import = DocumentCreateElement("input");
				button_import.type = "button";
				button_import.value = _i18n.getMessage("menu_setting_filter_button_import");
				ElementSetStyle(button_import,"width:100%; padding:4px 0px; margin:0px;");
				button_container.appendChild(button_import);
				button_import.onclick = function(){
					importClick();
				};

				new UI_TextHint(parent,_i18n.getMessage("menu_setting_filter_list_hint"));
			})();
		}

		// -
		// 定義複数選択用リスト
		// -
		function UI_DefineMultiSelectList(parent){
			var _this = this;

			// -
			// 識別名をセット
			// -
			_this.setAsset = function(asset){
				_asset = asset;
			};

			// -
			// メニュー番号をセット
			// -
			_this.setMenuId = function(id){
				_menu_id = id;
			};

			// -
			// 定義データをセット
			// -
			_this.setDefineData = function(define_data){
				_define_data = define_data;
				_define_dictionary = new Object();
				var i;
				var num = define_data.length;
				for(i=0;i<num;i++){
					var d = define_data[i];
					var p = ProjectObjectGetActiveData(d);
					_define_dictionary[d.id] = p;
				}
			};

			// -
			// URLマップを関連付け
			// -
			_this.attachUrlMaps = function(ary,active){

				// 全てクリア
				_this.clear();

				_urlmaps = ary;
				_urlmap_active = active;

				_urlmap_multiple = false;
				if(_urlmaps.length > 1){
					_urlmap_multiple = true;
				}

				_urlmaps_min = 0x7fffffff;
				_urlmaps_max = 0;

				var i;
				var num = _urlmaps.length;
				for(i=0;i<num;i++){
					var p = ProjectObjectGetActiveData(_urlmaps[i])[_asset];
					if(p.enable){
						var l = p.id.length;
						if(l > _urlmaps_max)	_urlmaps_max = l;
						if(l < _urlmaps_min)	_urlmaps_min = l;
					}else{
						_urlmaps_min = 0;
					}
				}

				for(i=0;i<_urlmaps_max;i++){
					attachItem(i);
				}
				updateUI();
			};

			// -
			// アクティブなフィルタを取得
			// -
			_this.getUrlmapActive = function(){
				return _urlmap_active;
			};

			// -
			// クリア
			// -
			_this.clear = function(){
				var a = _list.options;
				var i;
				var num = a.length;
				for(i=num-1;i>=0;i--){
					removeItem(a[i]);
				}
				updateUI();
			};

			// -
			// 表示更新
			// -
			_this.update = function(){
				var a = _list.options;
				var i;
				var num = a.length;
				for(i=0;i<num;i++){
					updateItem(a[i]);
				}
				updateUI();
			};

			// -
			// 表示更新(内部用)
			// -
			function update(){
				_this.attachUrlMaps(_urlmaps,_urlmap_active);
			}

			// -
			// UI 表示更新(内部用)
			// -
			function updateUI(){
				var _selected_index = _this.getSelectedIndex();
				var disabled = (_selected_index < 0);

				_button_prio_up.disabled = disabled;
				_button_prio_down.disabled = disabled;
				var a = _list.options;
				var num = a.length;
				if(num){
					if(a[0].selected){
						_button_prio_up.disabled = true;
					}
					if(a[num-1].selected){
						_button_prio_down.disabled = true;
					}
				}

				var display = "";
				if(disabled) display = "none";
				_button_prio_up.style.display = display;
				_button_prio_down.style.display = display;
				_button_delete.style.display = display;

				num += 1;
				if(num < 3) num = 3;
				if(num > 10) num = 10;
				if(!disabled){
					if(num < 6) num = 6;
				}
				_list.size = num;
			}

			// -
			// 書き込み更新
			// -
			_this.writeUrlmaps = function(func){
				var c;
				var p;
				var i;
				var num = _urlmaps.length;
				for(i=0;i<num;i++){
					c = _urlmaps[i];
					if(c.user){
						p = c.user;
					}else{
						if(c.preset){
							// プリセットを昇格
							p = c.user = ObjectCopy(c.preset);
						}
					}
					if(p)	func(p);
				}
			};

			// -
			// 追加
			// -
			function addClick(){

				// モーダルダイアログ作成
				var dialog = new UI_ModalDialog(_content_window);
				var dialog_parent = dialog.getElement();
				dialog.setWidth(600);

				// タイトル
				var title = new UI_Title(dialog_parent,_i18n.getMessage("menu_setting_define_multi_select_add_dialog"));

				// 定義の一覧
				var container = new UI_LineContainer(dialog_parent,_i18n.getMessage("menu_setting_define_multi_select_add_dialog_list"));
				var parent = container.getElement();
				var list_box_filter = new UI_ListBox(parent);
				list_box_filter.setMultiple(true);

				var i;
				var num = _define_data.length;
				for(i=0;i<num;i++){
					if(_define_data[i].id == "wildcard") continue;
					var c = ProjectObjectGetActiveData(_define_data[i]);
					list_box_filter.attachItem(LocaleObjectGetString(c.name),i);
				}

				// Yes No ボタン
				var yes_no_button = new UI_YesNoButton(dialog_parent);
				yes_no_button.onclick = function(v){

					if(v){
						var indeices = list_box_filter.getSelectedValues();
						_this.writeUrlmaps(function(c){
							var i;
							var num = indeices.length;
							for(i=0;i<num;i++){
								var p = _define_data[indeices[i]];
								if(c[_asset].enable){
									c[_asset].id.push(p.id);
								}else{
									c[_asset].id = [p.id];
									c[_asset].enable = true;
								}
							}
						});

						update();
						onchange();
						projectModify();
					}

					// ダイアログ終了
					dialog.close();
				};

				// ダイアログ開始
				dialog.open();
			}

			// -
			// 削除
			// -
			function deleteClick(){
				var a = _list.options;
				var i;
				var j;
				var num = a.length;
				for(i=num-1;i>=0;i--){
					var item = a[i];
					if(item.selected){
						var id = parseInt(item.value);
						_this.writeUrlmaps(function(c){
							var ary = c[_asset].id;
							if(ary.length > id){
								ary.splice(id,1);
							}
							if(!(ary.length)){
								c[_asset].enable = false;
							}
						});

						removeItem(item);
					}
				}

				update();
				onchange();
				projectModify();
			}

			// -
			// 編集(内部用 )
			// -
			function editClick(){
				var _selected_index = _this.getSelectedIndex();
				var selected_defines = new Array();

				if(_selected_index >= 0){
					var ary = ProjectObjectGetActiveData(_urlmap_active)[_asset].id;

					var a = _this.getSelectedIndices();
					var i;
					var num = a.length;
					for(i=0;i<num;i++){
						selected_defines.push(ary[a[i]]);
					}
					if(ary[_selected_index]){
						selected_defines.push(ary[_selected_index]);
					}
				}

				_config.pushHistory(_menu_id);
				var content = _config.MenuItemSelect(_menu_id);
				content.selectFromIdList(selected_defines);
				content.replaceHistory();
			}

			// -
			// 優先度アップ(内部用 )
			// -
			function prioUpClick(){
				var t;
				var a = _list.options;
				var i;
				var num = a.length;

				// アイテムなし
				if(!num)	return;

				// 複数選択オーバー
				for(i=_urlmaps_min;i<num;i++){
					if(a[i].selected){
						return;
					}
				}

				// 先頭が選択されている
				if(a[0].selected)	return;

				for(i=1;i<num;i++){
					if(a[i].selected){
						var c = a[i];
						var t = c.previousSibling;
						t.selected = true;
						c.selected = false;

						var j = i;
						var k = (i-1);
						_this.writeUrlmaps(function(c){
							var ary = c[_asset].id;
							t = ary[k];
							ary[k] = ary[j];
							ary[j] = t;
						});
					}
				}

				_this.update();
				onchange();
				projectModify();
			}

			// -
			// 優先度ダウン(内部用 )
			// -
			function prioDownClick(){
				var t;
				var a = _list.options;
				var i;
				var num = a.length;

				// アイテムなし
				if(!num)	return;

				// 複数選択オーバー
				for(i=_urlmaps_min;i<num;i++){
					if(a[i].selected){
						return;
					}
				}

				// 先頭が選択されている
				if(a[_urlmaps_min - 1].selected)	return;

				for(i=num - 2;i>=0;i--){
					if(a[i].selected){
						var c = a[i];
						var t = c.nextSibling;
						t.selected = true;
						c.selected = false;

						var j = i;
						var k = (i+1);
						_this.writeUrlmaps(function(c){
							var ary = c[_asset].id;
							t = ary[k];
							ary[k] = ary[j];
							ary[j] = t;
						});
					}
				}

				_this.update();
				onchange();
				projectModify();
			}

			// -
			// 選択されたアイテムを取得
			// -
			_this.getSelectedIndex = function(){
				return _select_id = _list.selectedIndex;
			};

			// -
			// 選択されたアイテムをすべて取得
			// -
			_this.getSelectedIndices = function(){
				var ary = new Array();
				var a = _list.options;
				var i;
				var num = a.length;
				for(i=0;i<num;i++){
					if(a[i].selected){
						ary.push(i);
					}
				}
				return ary;
			};

			// -
			// 更新イベント
			// -
			_this.onchange = function(){};

			// -
			// 更新イベント(内部用)
			// -
			function onchange(){
				if(_this.onchange){
					_this.onchange();
				}
			}

			// -
			// 選択イベント
			// -
			_this.onselect = function(){};

			// -
			// リストを選択
			// -
			_this.select = function(id){
				_list.selectedIndex = _select_id = _select_mouse = id;
				_this.onselect(id);
			};

			// -
			// アイテム追加(内部用 )
			// -
			function attachItem(id){
				var item = DocumentCreateElement("option");
				ElementSetStyle(item,"margin:2px 0px;");

				item.value = id;
				_list.appendChild(item);

				item.onmousedown = item.onmouseup = function(){
					_select_mouse = id;
				};
				updateItem(item);
			}

			// -
			// アイテム更新(内部用 )
			// -
			function updateItem(item){

				item.style.color = "#000";
				var id = parseInt(item.value);

				if(_urlmap_multiple){
					if(_urlmaps_min <= id){
						item.style.color = "#ccc";
					}

					var p = ProjectObjectGetActiveData(_urlmap_active)[_asset];
					var ary = p.id;
					var l = ary.length;
					if(!(p.enable))	l = 0;
					if(l <= id){
						ElementSetTextContent(item," *");
					}else{
						ElementSetTextContent(item,LocaleObjectGetString(_define_dictionary[ary[id]].name) + " *");
					}
				}else{
					var ary = ProjectObjectGetActiveData(_urlmap_active)[_asset].id;
					ElementSetTextContent(item,LocaleObjectGetString(_define_dictionary[ary[id]].name));
				}
			}

			// -
			// アイテム削除(内部用 )
			// -
			function removeItem(item){
				DomNodeRemove(item);
			}

			// -
			// プライベート変数
			// -
			var _urlmaps;
			var _urlmaps_min;
			var _urlmaps_max;
			var _urlmap_active;
			var _urlmap_multiple;
			var _list;
			var _select_id;
			var _select_mouse;
			var _asset;
			var _menu_id;
			var _define_dictionary;
			var _define_data;
			var _button_add;
			var _button_delete;
			var _button_edit;
			var _button_prio_up;
			var _button_prio_down;


			// -
			// 初期化
			// -
			(function(){
				var container = DocumentCreateElement("div");
				ElementSetStyle(container,"margin:0px 0px 5px 0px; display:table; width:100%;");
				parent.appendChild(container);

				var list_container = DocumentCreateElement("div");
				ElementSetStyle(list_container,"display:table-cell; vertical-align:top; width:auto;");
				container.appendChild(list_container);

				// リスト
				_list = DocumentCreateElement("select");
				_list.multiple = true;
				ElementSetStyle(_list,"width:100%; box-sizing:border-box; display:block; font-size:14px; background:#fff;");
				list_container.appendChild(_list);
				_list.onchange = function(e){
					_select_id = _list.selectedIndex;
					var o = _list.options[_select_mouse];
					if(o !== undefined){
						if(o.selected){
							_select_id = _select_mouse;
						}
					}
					updateUI();
					_this.onselect(_select_id);
				};

				var button_container = DocumentCreateElement("div");
				ElementSetStyle(button_container,"display:table-cell; vertical-align:top; width:50px; line-height:0;");
				container.appendChild(button_container);

				_button_add = DocumentCreateElement("input");
				_button_add.type = "button";
				_button_add.value = _i18n.getMessage("menu_setting_urlmap_define_button_add");
				ElementSetStyle(_button_add,"width:100%; padding:1px 0px; margin:0px;");
				button_container.appendChild(_button_add);
				_button_add.onclick = function(){
					addClick();
				};

				_button_delete = DocumentCreateElement("input");
				_button_delete.type = "button";
				_button_delete.value = _i18n.getMessage("menu_setting_urlmap_define_button_remove");
				ElementSetStyle(_button_delete,"width:100%; padding:1px 0px; margin:0px;");
				button_container.appendChild(_button_delete);
				_button_delete.onclick = function(){
					deleteClick();
				};

				_button_edit = DocumentCreateElement("input");
				_button_edit.type = "button";
				_button_edit.value = _i18n.getMessage("menu_setting_urlmap_define_button_edit");
				ElementSetStyle(_button_edit,"width:100%; padding:1px 0px; margin:0px;");
				button_container.appendChild(_button_edit);
				_button_edit.onclick = function(){
					editClick();
				};

				_button_prio_up = DocumentCreateElement("input");
				_button_prio_up.type = "button";
				_button_prio_up.value = _i18n.getMessage("menu_setting_urlmap_define_button_prio_up");
				ElementSetStyle(_button_prio_up,"width:100%; padding:1px 0px; margin:0px;");
				button_container.appendChild(_button_prio_up);
				_button_prio_up.onclick = function(){
					prioUpClick();
				};

				_button_prio_down = DocumentCreateElement("input");
				_button_prio_down.type = "button";
				_button_prio_down.value = _i18n.getMessage("menu_setting_urlmap_define_button_prio_down");
				ElementSetStyle(_button_prio_down,"width:100%; padding:1px 0px; margin:0px;");
				button_container.appendChild(_button_prio_down);
				_button_prio_down.onclick = function(){
					prioDownClick();
				};

				updateUI();
			})();
		}

		// -
		// URL エディットコンテナ
		// -
		function UI_UrlEditContainer(parent){
			var _this = this;

			// -
			// カスタムオブジェクトを関連付け
			// -
			_this.attachObject = function(obj){
				// クリア
				_this.clear();

				_filter_container = ObjectCopy(obj);
				update();
			};

			// -
			// クリア
			// -
			_this.clear = function(){
				_text_area_filter_url.setValue("");
				_regexp_list_filter.clear();
			};

			// -
			// 表示更新
			// -
			function update(){
				_form_container_asterisk.setVisible(false);
				_form_container_regexp.setVisible(false);

				_combo_box_type.setValue(_filter_container.type);

				switch(_filter_container.type){
				case "asterisk":
					_text_area_filter_url.joinArray(_filter_container.asterisk.filter,"\n");
					_form_container_asterisk.setVisible(true);
					break;
				case "regexp":
					_regexp_list_filter.attachArray(_filter_container.regexp.filter);
					_form_container_regexp.setVisible(true);
					break;
				}
			}

			// -
			// 更新イベント
			// -
			_this.onchange = function(){};

			// -
			// プライベート変数
			// -
			var _filter_container;
			var _combo_box_type;
			var _regexp_list_filter;
			var _text_area_filter_url;
			var _form_container_asterisk;
			var _form_container_regexp;

			// -
			// 初期化
			// -
			(function(){
				_combo_box_type = new UI_ComboBox(parent);
				_combo_box_type.attachItem(_i18n.getMessage("menu_setting_url_edit_container_combo_box_item_asterisk"),"asterisk");
				_combo_box_type.attachItem(_i18n.getMessage("menu_setting_url_edit_container_combo_box_item_regexp"),"regexp");
				_combo_box_type.onchange = function(v){
					_filter_container.type = v;
					update();
					_this.onchange(_filter_container);
				};

				_form_container_asterisk = new UI_FormContainer(parent);
				_form_container_asterisk.setVisible(false);
				var form_parent_asterisk = _form_container_asterisk.getElement();

				// アスタリスクリスト
				_text_area_filter_url = new UI_TextArea(form_parent_asterisk);
				_text_area_filter_url.oninput = function(v){
					_filter_container.asterisk.filter = _text_area_filter_url.spiritByLine();
					_this.onchange(_filter_container);
				};
				new UI_TextHint(form_parent_asterisk,_i18n.getMessage("menu_setting_url_edit_container_type_asterisk_hint"));

				_form_container_regexp = new UI_FormContainer(parent);
				_form_container_regexp.setVisible(false);
				var form_parent_regexp = _form_container_regexp.getElement();

				// 正規表現リスト
				_regexp_list_filter = new UI_RegExpList(form_parent_regexp);
				_regexp_list_filter.onchange = function(v){
					_filter_container.regexp.filter = ObjectCopy(v);
					_this.onchange(_filter_container);
				};
			})();
		}

		// -
		// プロジェクト用データからアクティブなオブジェクトを取得
		// -
		function ProjectObjectGetActiveData(obj){
			if(obj.user)	return obj.user;
			if(obj.preset)	return obj.preset;
			return null;
		}

		// -
		// ロケールオブジェクトを作成
		// -
		function LocaleObjectCreate(){
			return {
				standard:"",
				locales:{}
			};
		}

		// -
		// ロケールオブジェクトから文字を取得
		// -
		function LocaleObjectGetString(obj){
			var language = page_expand_project.getLanguage();
			if(obj.locales.hasOwnProperty(language)){
				return obj.locales[language];
			}else{
				return obj.standard;
			}
		}

		// -
		// ロケールオブジェクトに文字をセット
		// -
		function LocaleObjectSetString(obj,str){
			obj.locales[page_expand_project.getLanguage()] = str;
			obj.standard = str;
		}

		// -
		// 掲示板拡張設定を生成(内部)
		// -
		function createExpandBbsData(){
			return {
				id:null,
				user:{
					name:{
						standard:"",
						locales:{}
					},
					enable:true,
					filter:{
						type:"asterisk",
						asterisk:{
							filter:[]
						},
						regexp:{
							filter:[]
						}
					},
					script_initialize:PageExpandProjectScriptObject_Create("ExpandBbs_ScriptInitialize_Default"),
					script_callback:PageExpandProjectScriptObject_Create("ExpandBbs_ScriptCallback_Default"),
					popup:{
						origin_type:"adsorb_top_bottom",
						position_type:"absolute",
						enable_animation:true,
						percent:{x:50,y:50},
						time_wait_open:0,
						time_wait_close:0,
						style_sheet:""
					}
				}
			};
		}

		// -
		// URLマッピング設定を生成(内部)
		// -
		function createUrlMapData(){
			return {
				id:null,
				user:{
					name:{
						standard:"",
						locales:{}
					},
					enable:false,
					filter:{
						type:"asterisk",
						asterisk:{
							filter:[]
						},
						regexp:{
							filter:[]
						}
					},
					mixed_passive_content:"unsafe",
					mixed_active_content:"safe",
					access_block:{enable:false,id:[]},
					replacement_to_element:{enable:false,id:[]},
					replacement_to_text:{enable:false,id:[]},
					replacement_to_anchor:{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:false,id:""},
					expand_short_url:{enable:false,id:""},
					expand_text:{enable:false,id:""},
					expand_image:{enable:false,id:""},
					expand_sound:{enable:false,id:""},
					expand_video:{enable:false,id:""},
					expand_iframe:{enable:false,id:""},
					style_sheet:{enable:false,id:""},
					experimental:{enable:false,id:""}
				}
			};
		}

		// -
		// アクセス遮断設定を生成(内部)
		// -
		function createAccessBlockData(){
			return {
				id:null,
				user:{
					name:{
						standard:"",
						locales:{}
					},
					filter:{
						type:"asterisk",
						asterisk:{
							filter:[]
						},
						regexp:{
							filter:[]
						}
					}
				}
			};
		}

		// -
		// エレメント置換設定を生成(内部)
		// -
		function createReplacementToElementData(){
			return {
				id:null,
				user:{
					name:{
						standard:"",
						locales:{}
					},
					script:PageExpandProjectScriptObject_Create("ReplacementToElement_Default")
				}
			};
		}

		// -
		// テキスト置換設定を生成(内部)
		// -
		function createReplacementToTextData(){
			return {
				id:null,
				user:{
					name:{
						standard:"",
						locales:{}
					},
					script:PageExpandProjectScriptObject_Create("ReplacementToText_Default")
				}
			};
		}

		// -
		// アンカー置換設定を生成(内部)
		// -
		function createReplacementToAnchorData(){
			return {
				id:null,
				user:{
					name:{
						standard:"",
						locales:{}
					},
					script:PageExpandProjectScriptObject_Create("ReplacementToAnchor_Default")
				}
			};
		}

		// -
		// ハイパーリンク置換設定を生成(内部)
		// -
		function createReplacementToLinkData(){
			return {
				id:null,
				user:{
					name:{
						standard:"",
						locales:{}
					},
					filter:[]
				}
			};
		}

		// -
		// ハイパーリンク置換設定のフィルタアイテムを生成(内部)
		// -
		function createReplacementToLinkFilterItemData(){
			return {
				name:{
					standard:"",
					locales:{
						ja:"",
						en:""
					}
				},
				filter:{
					type:"asterisk",
					asterisk:{
						filter:[]
					},
					regexp:{
						filter:[]
					}
				},
				enable_reflect_to_anchor:false,
				enable_cache:false,
				script:PageExpandProjectScriptObject_Create("ReplacementToLink_Default")
			};
		}

		// -
		// リファラ置換設定を生成(内部)
		// -
		function createReplacementToRefererData(){
			return {
				id:null,
				user:{
					name:{
						standard:"",
						locales:{}
					},
					filter:[]
				}
			};
		}

		// -
		// リファラ置換設定のフィルタアイテムを生成(内部)
		// -
		function createReplacementToRefererFilterItemData(){
			return {
				name:{
					standard:"",
					locales:{
						ja:"",
						en:""
					}
				},
				filter:{
					type:"asterisk",
					asterisk:{
						filter:[]
					},
					regexp:{
						filter:[]
					}
				},
				send_referer:{
					type:"default",
					custom:"",
					regexp:{
						pattern:"",
						flags:{i:false,g:false}
					},
					replacement:""
				}
			};
		}

		// -
		// ユーザーエージェント置換設定を生成(内部)
		// -
		function createReplacementToUserAgentData(){
			return {
				id:null,
				user:{
					name:{
						standard:"",
						locales:{}
					},
					filter:[]
				}
			};
		}

		// -
		// ユーザーエージェント置換設定のフィルタアイテムを生成(内部)
		// -
		function createReplacementToUserAgentFilterItemData(){
			return {
				name:{
					standard:"",
					locales:{
						ja:"",
						en:""
					}
				},
				filter:{
					type:"asterisk",
					asterisk:{
						filter:[]
					},
					regexp:{
						filter:[]
					}
				},
				send_useragent:{
					custom:""
				}
			};
		}

		// -
		// ハイパーリンク化設定を生成(内部)
		// -
		function createMakeLinkToTextData(){
			return {
				id:null,
				user:{
					name:{
						standard:"",
						locales:{}
					},
					script:PageExpandProjectScriptObject_Create("MakeLinkToText_Default")
				}
			};
		}

		// -
		// 短縮 URL の展開設定を生成(内部)
		// -
		function createExpandShortUrlData(){
			return {
				id:null,
				user:{
					name:{
						standard:"",
						locales:{}
					},
					filter:{
						type:"asterisk",
						asterisk:{
							filter:[]
						},
						regexp:{
							filter:[]
						}
					}
				}
			};
		}

		// -
		// テキストの展開設定を生成(内部)
		// -
		function createExpandText(){
			return {
				id:null,
				user:{
					name:{
						standard:"",
						locales:{}
					},
					inline:{
						disable_same_text:false,
						script_allow:PageExpandProjectScriptObject_Create("ExpandText_InlineScriptAllow_Default"),
						script_insert:PageExpandProjectScriptObject_Create("ExpandText_InlineScriptInsert_Default")
					}
				}
			};
		}

		// -
		// イメージの展開設定を生成(内部)
		// -
		function createExpandImage(){
			return {
				id:null,
				user:{
					name:{
						standard:"",
						locales:{}
					},
					thumbnail:{
						enable_thumbnail:false,
						enable_popup_mouseover:false,
						scale_percent:50,
						width_min:0,
						width_max:300,
						disable_same_image:false,
						load_type:"preload",
						script_allow:PageExpandProjectScriptObject_Create("ExpandImage_ThumbnailScriptAllow_Default"),
						script_insert:PageExpandProjectScriptObject_Create("ExpandImage_ThumbnailScriptInsert_Default")
					},
					popup:{
						enable_popup_mouseover:false,
						enable_animation_scale:false,
						enable_animation_alpha:false,
						load_type:"preload",
						origin_type:"center",
						position_type:"absolute",
						scale_percent:100,
						time_wait_open:0,
						time_wait_close:0,
						script_allow:PageExpandProjectScriptObject_Create("ExpandImage_PopupScriptAllow_Default")
					},
					reduced_image:{
						enable_popup:false,
						popup_allow_slcale_less_then:0
					},
					load:{
						enable_notify:false,
						enable_unload:false,
						unload_allow_size_more_then:0
					}
				}
			};
		}

		// -
		// サウンドの展開設定を生成(内部)
		// -
		function createExpandSound(){
			return {
				id:null,
				user:{
					name:{
						standard:"",
						locales:{}
					},
					inline:{
						disable_same_audio:false,
						sound_max:10,
						script_allow:PageExpandProjectScriptObject_Create("ExpandSound_InlineScriptAllow_Default"),
						script_insert:PageExpandProjectScriptObject_Create("ExpandSound_InlineScriptInsert_Default")
					},
					audio_element:{
						script_allow:PageExpandProjectScriptObject_Create("ExpandSound_AudioElementScriptAllow_Default"),
						src_type:"url"
					},
					soundcloud:{
						visible_player_html5:false
					},
					mixcloud:{
						visible_player:false
					}
				}
			};
		}

		// -
		// ビデオの展開設定を生成(内部)
		// -
		function createExpandVideo(){
			return {
				id:null,
				user:{
					name:{
						standard:"",
						locales:{}
					},
					inline:{
						disable_same_video:false,
						video_max:10,
						width_max:720,
						height_max:480,
						script_allow:PageExpandProjectScriptObject_Create("ExpandVideo_InlineScriptAllow_Default"),
						script_insert:PageExpandProjectScriptObject_Create("ExpandVideo_InlineScriptInsert_Default")
					},
					video_element:{
						script_allow:PageExpandProjectScriptObject_Create("ExpandVideo_VideoElementScriptAllow_Default"),
						src_type:"url"
					},
					youtube:{
						visible_video:false
					},
					nicovideo:{
						visible_video:false
					},
					dailymotion:{
						visible_video:false
					},
					vimeo:{
						visible_video:false
					}
				}
			};
		}

		// -
		// インラインフレームの展開設定を生成(内部)
		// -
		function createExpandIframe(){
			return {
				id:null,
				user:{
					name:{
						standard:"",
						locales:{}
					},
					inline:{
						disable_same_iframe:false,
						script_allow:PageExpandProjectScriptObject_Create("ExpandIframe_InlineScriptAllow_Default"),
						script_insert:PageExpandProjectScriptObject_Create("ExpandIframe_InlineScriptInsert_Default")
					}
				}
			};
		}

		// -
		// スタイルシート設定を生成(内部)
		// -
		function createStyleSheet(){
			return {
				id:null,
				user:{
					name:{
						standard:"",
						locales:{}
					},
					expand_text:{
						inline:"",
						inline_unsafe:""
					},
					expand_image:{
						thumbnail:"",
						thumbnail_unsafe:"",
						popup:"",
						popup_unsafe:""
					},
					expand_sound:{
						inline:{
							audio_element:{
								audio:"",
								audio_unsafe:""
							},
							soundcloud:{
								player_html5:""
							},
							mixcloud:{
								player:""
							}
						}
					},
					expand_video:{
						inline:{
							video_element:{
								video:"",
								video_unsafe:""
							},
							youtube:{
								video:""
							},
							nicovideo:{
								video:""
							},
							dailymotion:{
								video:""
							},
							vimeo:{
								video:""
							}
						}
					},
					expand_iframe:{
						inline:"",
						inline_unsafe:"",
					}
				}
			};
		}

		// -
		// 試験運用設定を生成(内部)
		// -
		function createExperimental(){
			return {
				id:null,
				user:{
					name:{
						standard:"",
						locales:{}
					}
				}
			};
		}

		// -
		// プロジェクトを修正(内部用)
		// -
		function projectModify(){
			projectSave(function(e){});
		}

		// -
		// ロード(内部用)
		// -
		function projectLoad(func){
			if(!page_expand_project){
				// プロジェクト
				page_expand_project = new PageExpandProject();

				// ローカルストレージからロード
				page_expand_project.loadLocalStorage(function(e){
					func(e);
				});
			}else{
				func({result:false});
			}
		}

		// -
		// セーブ(内部用)
		// -
		function projectSave(func){
			// ローカルストレージに保存
			page_expand_project.saveLocalStorage(function(e){
				func(e);
			});
		}

		// -
		// 破棄(内部用)
		// -
		function projectDelete(func){
			page_expand_project.removeLocalStorage(function(e){
				func(e);
			});
		}

		// -
		// 同期ストレージロード(内部用)
		// -
		function projectLoadFromSyncStorage(func){
		}

		// -
		// 同期ストレージセーブ(内部用)
		// -
		function projectSaveFromSyncStorage(func){
		}

		// -
		// 同期ストレージ破棄(内部用)
		// -
		function projectDeleteFromSyncStorage(func){
		}

		// -
		// プライベート変数
		// -
		var _menu_window;
		var _content_window;
		var _i18n;
		var _menu_items;
		var _history_state;
		var _history_state_list;
		var _menu_item_param = [
			{asset:"menu_setting_standard",callback:ContentSettingStandard,bgcolor:0xFFFFFFFF},
			{asset:"menu_setting_access_block",callback:ContentSettingAccessBlock,bgcolor:0xFFFFE0F0},
			{asset:"menu_setting_replacement_to_referer",callback:ContentSettingReplacementToReferer,bgcolor:0xFFFFE0F0},
			{asset:"menu_setting_replacement_to_useragent",callback:ContentSettingReplacementToUserAgent,bgcolor:0xFFFFE0F0},
			{asset:"menu_setting_replacement_to_element",callback:ContentSettingReplacementToElement,bgcolor:0xFFE0E0FF},
			{asset:"menu_setting_replacement_to_text",callback:ContentSettingReplacementToText,bgcolor:0xFFE0E0FF},
			{asset:"menu_setting_replacement_to_anchor",callback:ContentSettingReplacementToAnchor,bgcolor:0xFFE0E0FF},
			{asset:"menu_setting_replacement_to_link",callback:ContentSettingReplacementToLink,bgcolor:0xFFE0E0FF},
			{asset:"menu_setting_make_link_to_text",callback:ContentSettingMakeLinkToText,bgcolor:0xFFE0E0FF},
			{asset:"menu_setting_expand_short_url",callback:ContentSettingExpandShortUrl,bgcolor:0xFFE0E0FF},
			{asset:"menu_setting_expand_text",callback:ContentSettingExpandText,bgcolor:0xFFE0E0FF},
			{asset:"menu_setting_expand_image",callback:ContentSettingExpandImage,bgcolor:0xFFE0E0FF},
			{asset:"menu_setting_expand_sound",callback:ContentSettingExpandSound,bgcolor:0xFFE0E0FF},
			{asset:"menu_setting_expand_video",callback:ContentSettingExpandVideo,bgcolor:0xFFE0E0FF},
			{asset:"menu_setting_expand_iframe",callback:ContentSettingExpandIframe,bgcolor:0xFFE0E0FF},
			{asset:"menu_setting_style_sheet",callback:ContentSettingStyleSheet,bgcolor:0xFFE0E0FF},
			{asset:"menu_setting_experimental",callback:ContentSettingExperimental,bgcolor:0xFFE0E0FF},
			{asset:"menu_setting_urlmap",callback:ContentSettingUrlMap,bgcolor:0xFFFFF0D8},
			{asset:"menu_setting_expand_bbs",callback:ContentSettingExpandBbs,bgcolor:0xFFE0FDE0},
			{asset:"menu_setting_download",callback:ContentSettingDownload,bgcolor:0xFFFFFFFF},
			{asset:"menu_setting_language",callback:ContentSettingLanguage,bgcolor:0xFFFFFFFF},
			{asset:"menu_credit",callback:ContentCredit,bgcolor:0xFFFFFFFF}
		];
		var _menu_support_param = [
			{menu:true,urlmap:true},
			{menu:false,urlmap:false},
			{menu:false,urlmap:false},
			{menu:false,urlmap:false},
			{menu:true,urlmap:true},
			{menu:true,urlmap:true},
			{menu:true,urlmap:true},
			{menu:true,urlmap:true},
			{menu:true,urlmap:true},
			{menu:true,urlmap:true},
			{menu:true,urlmap:true},
			{menu:true,urlmap:true},
			{menu:true,urlmap:true},
			{menu:true,urlmap:true},
			{menu:true,urlmap:true},
			{menu:true,urlmap:true},
			{menu:true,urlmap:true},
			{menu:true,urlmap:true},
			{menu:true,urlmap:true},
			{menu:true,urlmap:true},
			{menu:true,urlmap:true},
			{menu:true,urlmap:true}
		];


		// -
		// 初期化関数(内部用)
		// -
		function initialize(){

			_menu_items = new Array();

			// 履歴オブジェクト
			_history_state_list = new Array();
			_history_state_list[0] = _history_state = {index:0};

			// エレメントを全てクリア
			DomNodeRemoveChildren(document.head);
			DomNodeRemoveChildren(document.body);

			// ボディ
			var body = document.body;
			ElementSetStyle(body,'background-color:#CCC; font-family:"Meiryo","sans-serif"; margin:0px; padding:0px; overflow-y:scroll;');

			// ロケール
			_i18n = new InternationalMessage(page_expand_project.getLanguage());

			// タイトル
			document.title = _i18n.getMessage("page_expand_config");

			// シャドウツリー
			var shadow_host = DocumentCreateElement("div");
			body.appendChild(shadow_host);
			var shadow_root;
			if(shadow_host.attachShadow){
				shadow_root = shadow_host.attachShadow({mode:"closed"});
			}else{
				shadow_root = shadow_host;
			}

			// ヘッダ
			var head_window = DocumentCreateElement("div");
			ElementSetStyle(head_window,"background-color:#000; color:#fff; font-size:12px; font-weight:bold; padding:2px 5px; margin:0px 0px 20px;");
			ElementSetTextContent(head_window,_i18n.getMessage("page_expand_config"));
			shadow_root.appendChild(head_window);

			// 外周
			var out_window = DocumentCreateElement("div");
			ElementSetStyle(out_window,"margin:0px 15px 15px 5px;");
			shadow_root.appendChild(out_window);

			// 外周
			var out_table = DocumentCreateElement("div");
			ElementSetStyle(out_table,"width:100%; display:table;");
			out_window.appendChild(out_table);

			// メニュー部
			_menu_window = DocumentCreateElement("div");
			ElementSetStyle(_menu_window,"width:250px; display:table-cell; vertical-align:top; user-select:none; -webkit-user-select:none; -moz-user-select:none; -khtml-user-select:none; margin:20px;");
			out_table.appendChild(_menu_window);

				// メニュー上部
				var menu_item_top = DocumentCreateElement("div");
				ElementSetStyle(menu_item_top,"height:10px;");
				_menu_window.appendChild(menu_item_top);

				{
					// メニュー
					var i;
					var num = _menu_item_param.length;
					for(i=0;i<num;i++){
						var param = _menu_item_param[i];
						var item = new MenuItemCreate(_i18n.getMessage(param.asset),i);
						item.setBackgroundColor(param.bgcolor);
						item.setSupport(_menu_support_param[i].menu);
						_menu_items.push(item);
					}
				}

				// メニュー下部
				var menu_item_bottom = DocumentCreateElement("div");
				ElementSetStyle(menu_item_bottom,"height:50px;");
				_menu_window.appendChild(menu_item_bottom);

			// コンテンツ部
			_content_window = DocumentCreateElement("div");
			ElementSetStyle(_content_window,"width:auto; min-width:500px; display:table-cell; vertical-align:top; padding:10px 20px 50px; background-color:#FFF; border-radius:5px; box-shadow:3px 3px 3px #888;");
			out_table.appendChild(_content_window);

			// 基本設定
			_config.MenuItemSelect(PageExpandConfig.MENU_TYPE_SETTING_STANDARD);

			// -
			// 履歴復元
			// -
			window.onpopstate = function(e){
				var state = e.state;
				if(!state) return;

				// 履歴オブジェクト変更
				_history_state = _history_state_list[state.index];
				if(!_history_state){
					_history_state_list[state.index] = _history_state = { index:state.index , selected_menu:state.menu };
				}

				var content;
				if(_history_state.selected_menu !== undefined){
					content = _config.MenuItemSelect(_history_state.selected_menu);
				}
				if(_history_state.selected_defines !== undefined){
					content.selectFromIdList(_history_state.selected_defines);
				}
				if(_history_state.selected_filters !== undefined){
					if(content.selectFilterFromList){
						content.selectFilterFromList(_history_state.selected_filters);
					}
				}
				if(_history_state.scroll_pos !== undefined){
					WindowSetScrollPosition(window,_history_state.scroll_pos);
				}
			};

			// -
			// スクロール
			// -
			window.onscroll = function(e){
				_history_state.scroll_pos = WindowGetScrollPosition(window);
			};

		}

		// -
		// 初期化関数
		// -
		_config.initialize = function(func){
			// フレームは動作させない
			if (WindowIsChild(window)){
				func(false);
				return;
			}

			// BODY が存在しない
			var body = document.body;
			if(!body){
				func(false);
				return;
			}

			// プロジェクトをロード
			projectLoad(function(e){
				initialize();
				func(true);
			});

		};

		return _config;
	}

	// -
	// 定数
	// -
	PageExpandConfig.MENU_TYPE_SETTING_STANDARD = 0;
	PageExpandConfig.MENU_TYPE_SETTING_ACCESS_BLOCK = 1;
	PageExpandConfig.MENU_TYPE_SETTING_REPLACEMENT_TO_REFERER = 2;
	PageExpandConfig.MENU_TYPE_SETTING_REPLACEMENT_TO_USERAGENT = 3;
	PageExpandConfig.MENU_TYPE_SETTING_REPLACEMENT_TO_ELEMENT = 4;
	PageExpandConfig.MENU_TYPE_SETTING_REPLACEMENT_TO_TEXT = 5;
	PageExpandConfig.MENU_TYPE_SETTING_REPLACEMENT_TO_ANCHOR = 6;
	PageExpandConfig.MENU_TYPE_SETTING_REPLACEMENT_TO_LINK = 7;
	PageExpandConfig.MENU_TYPE_SETTING_MAKE_LINK_TO_TEXT = 8;
	PageExpandConfig.MENU_TYPE_SETTING_EXPAND_SHORT_URL = 9;
	PageExpandConfig.MENU_TYPE_SETTING_EXPAND_TEXT = 10;
	PageExpandConfig.MENU_TYPE_SETTING_EXPAND_IMAGE = 11;
	PageExpandConfig.MENU_TYPE_SETTING_EXPAND_SOUND = 12;
	PageExpandConfig.MENU_TYPE_SETTING_EXPAND_VIDEO = 13;
	PageExpandConfig.MENU_TYPE_SETTING_EXPAND_IFRAME = 14;
	PageExpandConfig.MENU_TYPE_SETTING_STYLE_SHEET = 15;
	PageExpandConfig.MENU_TYPE_SETTING_EXPERIMENTAL = 16;
	PageExpandConfig.MENU_TYPE_SETTING_URL_MAPPING = 17;
	PageExpandConfig.MENU_TYPE_SETTING_EXPAND_BBS = 18;
	PageExpandConfig.MENU_TYPE_SETTING_DOWNLOAD = 19;
	PageExpandConfig.MENU_TYPE_SETTING_LANGUAGE = 20;
	PageExpandConfig.MENU_TYPE_CREDIT = 21;


	// -
	// ポップアップメニュー
	// -
	function PageExpandPopupMenu(){
		var _this = this;

		// -
		// リロード
		// -
		_this.reload = function (){
			// プロジェクト読み込み
			projectLoad(function(e){

				// エレメントを全てクリア
				DomNodeRemoveChildren(document.body);

				// ロケール
				_i18n = new InternationalMessage(page_expand_project.getLanguage());
				initialize();
			});
		};

		// -
		// ロード(内部用)
		// -
		function projectLoad(func){
			var proj = new PageExpandProject();

			// プロジェクトをロード
			proj.loadLocalStorage(function(e){

				// プロジェクトを更新
				page_expand_project = proj;
				project = new Project();
				getActiveURL(function(url){
					project.importObjectForBackground(page_expand_project.getProject(url));
					func(e);
				});
			});
		}

		// -
		// クリック(内部用)
		// -
		function click(command){
		}

		// -
		// アクティブページのURLを取得(内部用)
		// -
		function getActiveURL(func){
		}

		// -
		// ラインボタン(内部用)
		// -
		function UI_LineButton(parent,label){
			var _this = this;

			// -
			// 通常状態(内部用)
			// -
			function normal(){
				_style.color = "#222";
				_style.background = "none";
			}

			// -
			// マウスオーバー状態(内部用)
			// -
			function mouse_over(){
				_style.color = "#fff";
				_style.background = "#4281F4";
			}

			// -
			// マウスオーバー状態(内部用)
			// -
			function mouse_down(){
				_style.color = "#fff";
				_style.background = "#4281F4";
			}

			// -
			// クリックイベント
			// -
			_this.onclick = function(){};

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

			// -
			// 初期化
			// -
			(function(){
				_item = DocumentCreateElement("a");
				_item.href = "";
				_style = _item.style;
				ElementSetStyle(_item,"display:block; text-decoration: none; font-size:13px; color:#000; margin:0px 0px 2px; padding:5px 20px; border-radius:5px; line-height:1.0;");
				ElementSetTextContent(_item,label);
				parent.appendChild(_item);

				if(_item.addEventListener){
					_item.addEventListener("click",function(e){
						_this.onclick();
						e.preventDefault();
					},false);
					_item.addEventListener("mouseover",function(e){
						mouse_over();
					},false);
					_item.addEventListener("mousedown",function(e){
						mouse_down();
					},false);
					_item.addEventListener("mouseup",function(e){
						mouse_over();
					},false);
					_item.addEventListener("mouseout",function(e){
						normal();
					},false);
				}

			})();
		}

		// -
		// セパレータ(内部用)
		// -
		function UI_Separator(parent){
			var _this = this;

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

			// -
			// 初期化
			// -
			(function(){
				_item = DocumentCreateElement("div");
				ElementSetStyle(_item,"height: 0px; border-top:1px solid #ddd; margin:2px 0px;");
				parent.appendChild(_item);
			})();
		}

		// -
		// 初期化(内部用)
		// -
		function initialize(){

			// タイトル
			document.title = _i18n.getMessage("page_expand_popup_menu");

			// ボディ
			var body = document.body;
			ElementSetStyle(body,'background-color:#ccc; font-family:"Meiryo","sans-serif"; margin:0px; padding:0px; width:300px; border:0px solid #000; overflow-x:hidden; box-sizing:border-box;');

			// ヘッダ
			var head_window = DocumentCreateElement("div");
			ElementSetStyle(head_window,"background-color:#000; color:#fff; font-size:12px; font-weight:bold; padding:2px 5px; margin:0px;");
			ElementSetTextContent(head_window,_i18n.getMessage("page_expand_popup_menu"));
			body.appendChild(head_window);

			// ボディ
			var body_window = DocumentCreateElement("div");
			ElementSetStyle(body_window,"border:2px inset #f0f0f0; background-color:#fcfcfc;");
			body.appendChild(body_window);

			// 外周
			var out_window = DocumentCreateElement("div");
			ElementSetStyle(out_window,"margin:5px 5px 5px 5px;");
			body_window.appendChild(out_window);

			// 外周
			var out_table = DocumentCreateElement("div");
			ElementSetStyle(out_table,"width:100%; display:table;");
			out_window.appendChild(out_table);

			// メニュー部
			var _menu_window = DocumentCreateElement("div");
			ElementSetStyle(_menu_window,"display:table-cell; vertical-align:top; user-select:none; -webkit-user-select:none; -moz-user-select:none; -khtml-user-select:none; margin:0px;");
			out_table.appendChild(_menu_window);

			// 一括ダウンロード(画像)
			var button_config = new UI_LineButton(_menu_window,_i18n.getMessage("context_menu_batch_download_image"));
			button_config.onclick = function(){
				click("batchDownloadImage");
			};

			// 一括ダウンロード(ユーザー)
			var button_config = new UI_LineButton(_menu_window,_i18n.getMessage("context_menu_batch_download_user"));
			button_config.onclick = function(){
				click("batchDownloadUser");
			};

			new UI_Separator(_menu_window);

			// 掲示板ボードを開く
			var button_open_bbs_board = new UI_LineButton(_menu_window,_i18n.getMessage("context_menu_pageexpand_open_bbs_board"));
			button_open_bbs_board.onclick = function(){
				click("openBbsBoard");
			};

			new UI_Separator(_menu_window);

			// 現在のページの設定を編集
			var button_config = new UI_LineButton(_menu_window,_i18n.getMessage("context_menu_pageexpand_config_current_page"));
			button_config.onclick = function(){
				click("configCurrentPage");
			};

			// 掲示板拡張の設定
			if(project.getEnableExpandBbs()){
				var button_config = new UI_LineButton(_menu_window,_i18n.getMessage("context_menu_pageexpand_config_current_bbs"));
				button_config.onclick = function(){
					click("configCurrentBbs");
				};
			}

			new UI_Separator(_menu_window);

			// PageExpand の開始
			if(!(project.getEnableStartup())){
				var button_start_pageexpand = new UI_LineButton(_menu_window,_i18n.getMessage("context_menu_pageexpand_start"));
				button_start_pageexpand.onclick = function(){
					click("startPageExpand");
				};
			}

			// PageExpand の中止
			var button_abort_pageexpand = new UI_LineButton(_menu_window,_i18n.getMessage("context_menu_pageexpand_abort"));
			button_abort_pageexpand.onclick = function(){
				click("abortPageExpand");
			};

			// PageExpand の最速実行
			var button_execute_pageexpand_fastest = new UI_LineButton(_menu_window,_i18n.getMessage("context_menu_pageexpand_execute_fastest"));
			button_execute_pageexpand_fastest.onclick = function(){
				click("executeFastest");
			};

			// PageExpand デバッグ
			var button_execute_debug = new UI_LineButton(_menu_window,_i18n.getMessage("context_menu_pageexpand_debug"));
			button_execute_debug.onclick = function(){
				click("executeDebug");
			};
		}

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

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

			// プロジェクト読み込み
			projectLoad(function(e){

				// ロケール
				_i18n = new InternationalMessage(page_expand_project.getLanguage());

				initialize();

			});

		})();
	}


	// -
	// 掲示板ボード
	// -
	function PageExpandBbsBoard(){
		var _this = this;

		// -
		// リサイズ
		// -
		function resize(){
			var client_size = DocumentGetClientSize(document);
			client_size.height -= 28;

			_this.enableCompactMode(client_size.width <= 450);

			var splitter_left_width = _splitter_left_width;
			var splitter_right_width = _splitter_right_width;
			var splitter_bottom_width = _splitter_bottom_width;

			var style;
			var l,r,t,b,w,h;

			if(!(_splitter_left_open)){
				splitter_left_width = 0;
			}
			if(!(_splitter_right_open)){
				splitter_right_width = 0;
			}
			if(!(_splitter_bottom_open)){
				splitter_bottom_width = 0;
			}

			if(splitter_left_width < 0){
				splitter_left_width = 0;
			}
			if(splitter_right_width < 0){
				splitter_right_width = 0;
			}
			if(splitter_bottom_width < 0){
				splitter_bottom_width = 0;
			}

			if(splitter_bottom_width > client_size.height - 6){
				splitter_bottom_width = client_size.height - 6;
			}
			var w = client_size.width - 6 - 6;
			if((splitter_left_width + splitter_right_width) > w){
				var d = splitter_left_width / (splitter_left_width + splitter_right_width);
				splitter_left_width = d * w;
				splitter_right_width = (1.0 - d) * w;
			}

			var w = client_size.width - (24 * 3 + 4 + 4);
			if(w > 150) w = 150;
			if(w < 24) w = 24;
			_select_site.style.width = (w) + "px";

			if(getCompactMode()){
				w = client_size.width;
				h = client_size.height;

				style = _category_container.style;
				style.width  = (w) + "px";

				style = _catalog_container.style;
				style.left   = "0px";
				style.width  = (w) + "px";
				style.height = (h) + "px";

				style = _thread_container.style;
				style.left   = "0px";
				style.right  = "0px";
				style.top	= "0px";
				style.bottom = "0px";
			}else{
				style = _category_container.style;
				w = splitter_left_width;
				style.width  = (w) + "px";
				style.bottom = "0px";

				style = _catalog_container.style;
				l = splitter_left_width + 6;
				w = client_size.width - splitter_left_width - 6 - splitter_right_width;
				if(getVisibleSplitterRight()) w -= 6;
				h = client_size.height - splitter_bottom_width;
				if(getVisibleSplitterBottom()) h -= 6;
				style.left   = (l) + "px";
				style.width  = (w) + "px";
				style.height = (h) + "px";

				if(_splitter_right_open){
					style = _thread_container.style;
					l = client_size.width - splitter_right_width;
					style.left   = (l) + "px";
					style.right  = "0px";
					style.top	= "0px";
					style.bottom = "0px";
				}

				if(_splitter_bottom_open){
					style = _thread_container.style;
					l = splitter_left_width + 6;
					r = 6;
					t = client_size.height - splitter_bottom_width;
					style.left   = (l) + "px";
					style.right  = (r) + "px";
					style.top	= (t) + "px";
					style.bottom = "0px";
				}

				style = _splitter_left.style;
				l = splitter_left_width;
				style.left = (l) + "px";

				style = _splitter_right.style;
				r = splitter_right_width;
				style.right  = (r) + "px";

				style = _splitter_bottom.style;
				l = splitter_left_width + 6;
				r = splitter_right_width + 6;
				b = splitter_bottom_width;
				style.left   = (l) + "px";
				style.right  = (r) + "px";
				style.bottom = (b) + "px";
			}

			_ui_catalog.resize();
		}

		// -
		// サイト変更
		// -
		function changeSelectSite(e){
			_current_site = _select_site.value;
			updateSite();
		}

		// -
		// サイト更新
		// -
		function updateSite(callback){

			disableCategoryContainer(true);
			disableCatalogContainer(true);
			disableThreadContainer(true);

			_ui_catalog.clearColumn();
			_this.clearThread();
			_active_panel = "category";

			switch(_current_site){
			case "2ch":
			case "5ch":
			case "5ch_pc":
			case "open2ch":
			case "shitaraba":
				if(_current_site == "shitaraba"){
					_category_title.nodeValue = _current_site;
					disableCategoryContainer(true);
					openSplitterLeft(false);
				}else{
					_category_title.nodeValue = _current_site;
					disableCategoryContainer(false);
					openSplitterLeft(true);
				}

				var convert_list = new Object();
				convert_list["ppd"] = function(value){
					value = Math.floor(value * 100) / 100;
					return value.toFixed(2);
				};
				convert_list["date_new"] = UNIXTIME_ToString_JP;

				_ui_catalog.onUpdateItem = function (info){
					var parent = info.parent;
					var data = info.data;

					var get_title = function(){
						var title = data.title;
						while(true){
							var m = title.match(new RegExp("(.*)©(2ch[.]net|5ch[.]net|bbspink[.]com)[ 	]*$","i"));
							if(m){
								title = m[1];
								continue;
							}
							var m = title.match(new RegExp("(.*)\\[(転載禁止|無断転載禁止)\\]$","i"));
							if(m){
								title = m[1];
								continue;
							}
							break;
						}
						return title;
					};
					var get_date = function(){
						return convert_list["date_new"](data.date_new);
					};
					var get_ppd = function(){
						return convert_list["ppd"](data.ppd);
					};

					switch(info.layout_mode){
					case "list":
						var container = DocumentCreateElement("div");
						ElementSetStyle(container,"margin:2px; margin-left:4px; margin-right:4px;");
						parent.appendChild(container);

						var text_container = DocumentCreateElement("div");
						ElementSetStyle(text_container,"left:0px; right:0px; top:0px; bottom:0px; overflow:hidden;");
						container.appendChild(text_container);

						var text_block0 = DocumentCreateElement("div");
						ElementSetStyle(text_block0,"");
						text_container.appendChild(text_block0);
						var inline_text0 = DocumentCreateElement("span");
						ElementSetStyle(inline_text0,"word-break:break-all;");
						text_block0.appendChild(inline_text0);
						var text_node0 = document.createTextNode("");
						inline_text0.appendChild(text_node0);

						var text_block1 = DocumentCreateElement("div");
						ElementSetStyle(text_block1,"margin-top:2px;");
						text_container.appendChild(text_block1);
						var inline_text1 = DocumentCreateElement("span");
						ElementSetStyle(inline_text1,"color:#888;");
						text_block1.appendChild(inline_text1);
						var text_node1 = document.createTextNode("");
						inline_text1.appendChild(text_node1);

						info.onupdate = function(){
							text_node0.nodeValue = data.number + ":" + get_title() + " (" + data.res + ")";
							text_node1.nodeValue = "[" + get_ppd() + "/d] [" + get_date() + "]";
						};
						break;

					case "small_icon":
						var inline_text = DocumentCreateElement("span");
						ElementSetStyle(inline_text,"text-decoration:underline; word-break:break-all;");
						parent.appendChild(inline_text);
						var text_node = document.createTextNode("");
						inline_text.appendChild(text_node);

						info.onupdate = function(){
							text_node.nodeValue = data.number + ":" + get_title() + " (" + data.res + ")";
						};
						break;

					case "large_icon":
						var container = DocumentCreateElement("div");
						ElementSetStyle(container,"margin:4px;");
						parent.appendChild(container);

						var text_container = DocumentCreateElement("div");
						ElementSetStyle(text_container,"margin:4px; margin-top:0px;");
						container.appendChild(text_container);

						var text_block0 = DocumentCreateElement("div");
						ElementSetStyle(text_block0,"");
						text_container.appendChild(text_block0);
						var inline_text0 = DocumentCreateElement("span");
						ElementSetStyle(inline_text0,"word-break:break-all;");
						text_block0.appendChild(inline_text0);
						var text_node0 = document.createTextNode("");
						inline_text0.appendChild(text_node0);

						var text_block1 = DocumentCreateElement("div");
						ElementSetStyle(text_block1,"margin-top:2px;");
						text_container.appendChild(text_block1);
						var inline_text1 = DocumentCreateElement("span");
						ElementSetStyle(inline_text1,"color:#888;");
						text_block1.appendChild(inline_text1);
						var text_node1 = document.createTextNode("");
						inline_text1.appendChild(text_node1);

						info.onupdate = function(){
							text_node0.nodeValue = data.number + ":" + get_title() + " (" + data.res + ")";
							text_node1.nodeValue = "[" + get_ppd() + "/d] [" + get_date() + "]";
						};
						break;
					}

					return;
					var element;
					switch(info.layout_mode){
					case "small_icon":
						element = DocumentCreateElement("span");
						break;
					default:
						element = DocumentCreateElement("div");
						ElementSetStyle(element,"margin:2px; margin-left:4px; margin-right:4px;");
						break;
					}
					info.parent.appendChild(element);

					var data = info.data;
					ElementSetTextContent(element,data.number + ":" + data.title + "(" + data.res + ")");
				};

				_ui_catalog.onUpdateCell = function (info){
					var callback = convert_list[info.key];
					var parent = info.parent;
					var data = info.data;
					var text_node = document.createTextNode("");
					parent.appendChild(text_node);

					info.onupdate = function(){
						if(callback){
							text_node.nodeValue = callback(data[info.key]);
						}else{
							text_node.nodeValue = data[info.key];
						}
					}
				};

				var column;
				column = _ui_catalog.createColumn("number");
				column.setLabel("No");
				column.setWidthMin(50);
				column.setWidthMax(50);
				column.setTextAlign("center");

				column = _ui_catalog.createColumn("title");
				column.setLabel("Title");
				column.setWidthMin(300);

				column = _ui_catalog.createColumn("res");
				column.setLabel("Res");
				column.setWidthMin(50);
				column.setWidthMax(50);
				column.setTextAlign("right");

				column = _ui_catalog.createColumn("ppd");
				column.setLabel("P/d");
				column.setWidthMin(70);
				column.setWidthMax(70);
				column.setTextAlign("right");

				column = _ui_catalog.createColumn("date_new");
				column.setLabel("Since");
				column.setWidthMin(150);
				column.setWidthMax(150);
				column.setTextAlign("center");

				_ui_catalog.setBlockSize(180,180 * (1/2));
				_ui_catalog.sort("number",false);
				break;

			case "2chan":
				_category_title.nodeValue = _current_site;
				disableCategoryContainer(false);
				openSplitterLeft(true);

				var convert_list = new Object();
				convert_list["ppd"] = function(value){
					value = Math.floor(value * 100) / 100;
					return value.toFixed(2);
				};
				convert_list["date_new"] = Timestamp_ToString_JP;

				_ui_catalog.onUpdateItem = function (info){
					var parent = info.parent;
					var data = info.data;

					var get_title = function(size){
						if(data.title.length > size){
							return data.title.substr(0,size) + "...";
						}
						return data.title;
					};
					var get_date = function(){
						return convert_list["date_new"](data.date_new);
					};
					var get_ppd = function(){
						return convert_list["ppd"](data.ppd);
					};

					switch(info.layout_mode){
					case "list":
						var container = DocumentCreateElement("div");
						ElementSetStyle(container,"position:relative; margin:2px; margin-left:4px; margin-right:4px; min-height:60px;");
						parent.appendChild(container);

						var img_block = DocumentCreateElement("div");
						ElementSetStyle(img_block,"position:absolute; width:60px; height:60px; text-align:right;");
						container.appendChild(img_block);

						var image = data.image;
						if(image){
							ElementSetStyle(image,"max-width:100%; max-height:60px;");
							img_block.appendChild(image);
						}

						var text_container = DocumentCreateElement("div");
						ElementSetStyle(text_container,"margin-left:65px;");
						container.appendChild(text_container);

						var text_block0 = DocumentCreateElement("div");
						ElementSetStyle(text_block0,"");
						text_container.appendChild(text_block0);
						var inline_text0 = DocumentCreateElement("span");
						ElementSetStyle(inline_text0,"word-break: break-all;");
						text_block0.appendChild(inline_text0);
						var text_node0 = document.createTextNode("");
						inline_text0.appendChild(text_node0);

						var text_block1 = DocumentCreateElement("div");
						ElementSetStyle(text_block1,"margin-top:2px;");
						text_container.appendChild(text_block1);
						var inline_text1 = DocumentCreateElement("span");
						ElementSetStyle(inline_text1,"color:#888;");
						text_block1.appendChild(inline_text1);
						var text_node1 = document.createTextNode("");
						inline_text1.appendChild(text_node1);

						info.onupdate = function(){
							text_node0.nodeValue = data.number + ":" + data.title + " (" + data.res + ")";
							text_node1.nodeValue = "[" + get_ppd() + "/d] [" + get_date() + "]";
						};
						break;

					case "small_icon":
						var inline_text = DocumentCreateElement("span");
						ElementSetStyle(inline_text,"text-decoration:underline; word-break:break-all;");
						parent.appendChild(inline_text);
						var text_node = document.createTextNode("");
						inline_text.appendChild(text_node);

						info.onupdate = function(){
							text_node.nodeValue = data.number + ":" + get_title(100) + " (" + data.res + ")";
						};
						break;

					case "large_icon":
						var img_block = DocumentCreateElement("div");
						ElementSetStyle(img_block,"margin:4px; margin-bottom:0px; text-align:center;");
						parent.appendChild(img_block);

						var image = data.image;
						if(image){
							ElementSetStyle(image,"max-width:100%; max-height:140px;");
							img_block.appendChild(image);
						}

						var text_block = DocumentCreateElement("div");
						ElementSetStyle(text_block,"margin:4px; margin-top:2px;");
						parent.appendChild(text_block);
						var inline_text = DocumentCreateElement("span");
						ElementSetStyle(inline_text,"word-break:break-all;");
						text_block.appendChild(inline_text);
						var text_node = document.createTextNode("");
						inline_text.appendChild(text_node);

						info.onupdate = function(){
							text_node.nodeValue = data.number + ":" + get_title(50) + " (" + data.res + ")";
						};
						break;
					}
				};

				_ui_catalog.onUpdateCell = function (info){
					var callback = convert_list[info.key];
					var parent = info.parent;
					var data = info.data;
					var text_node = document.createTextNode("");
					parent.appendChild(text_node);

					info.onupdate = function(){
						if(callback){
							text_node.nodeValue = callback(data[info.key]);
						}else{
							text_node.nodeValue = data[info.key];
						}
					}
				};

				var column;
				column = _ui_catalog.createColumn("number");
				column.setLabel("No");
				column.setWidthMin(50);
				column.setWidthMax(50);
				column.setTextAlign("center");

				column = _ui_catalog.createColumn("title");
				column.setLabel("Title");
				column.setWidthMin(300);

				column = _ui_catalog.createColumn("res");
				column.setLabel("Res");
				column.setWidthMin(50);
				column.setWidthMax(50);
				column.setTextAlign("right");

				column = _ui_catalog.createColumn("ppd");
				column.setLabel("P/d");
				column.setWidthMin(70);
				column.setWidthMax(70);
				column.setTextAlign("right");

				column = _ui_catalog.createColumn("id");
				column.setLabel("id");
				column.setWidthMin(100);
				column.setWidthMax(100);
				column.setTextAlign("center");

				column = _ui_catalog.createColumn("date_new");
				column.setLabel("Since");
				column.setWidthMin(150);
				column.setWidthMax(150);
				column.setTextAlign("center");

				_ui_catalog.setBlockSize(140,140 * (4/3));
				_ui_catalog.sort("number",false);
				break;

			case "4chan":
				_category_title.nodeValue = _current_site;
				disableCategoryContainer(false);
				openSplitterLeft(true);

				var convert_list = new Object();
				convert_list["ppd"] = function(value){
					value = Math.floor(value * 100) / 100;
					return value.toFixed(2);
				};
				convert_list["date_new"] = UNIXTIME_ToString_JP;

				_ui_catalog.onUpdateItem = function (info){
					var parent = info.parent;
					var data = info.data;

					var get_title = function(size){
						if(data.title.length > size){
							return data.title.substr(0,size) + "...";
						}
						return data.title;
					};
					var get_date = function(){
						return convert_list["date_new"](data.date_new);
					};
					var get_ppd = function(){
						return convert_list["ppd"](data.ppd);
					};

					switch(info.layout_mode){
					case "list":
						var container = DocumentCreateElement("div");
						ElementSetStyle(container,"position:relative; margin:2px; margin-left:4px; margin-right:4px; min-height:60px;");
						parent.appendChild(container);

						var img_block = DocumentCreateElement("div");
						ElementSetStyle(img_block,"position:absolute; width:60px; height:60px; text-align:right;");
						container.appendChild(img_block);

						var image = data.image;
						if(image){
							ElementSetStyle(image,"max-width:100%; max-height:60px;");
							img_block.appendChild(image);
						}

						var text_container = DocumentCreateElement("div");
						ElementSetStyle(text_container,"margin-left:65px;");
						container.appendChild(text_container);

						var text_block0 = DocumentCreateElement("div");
						ElementSetStyle(text_block0,"");
						text_container.appendChild(text_block0);
						var inline_text0 = DocumentCreateElement("span");
						ElementSetStyle(inline_text0,"word-break: break-all;");
						text_block0.appendChild(inline_text0);
						var text_node0 = document.createTextNode("");
						inline_text0.appendChild(text_node0);

						var text_block1 = DocumentCreateElement("div");
						ElementSetStyle(text_block1,"margin-top:2px;");
						text_container.appendChild(text_block1);
						var inline_text1 = DocumentCreateElement("span");
						ElementSetStyle(inline_text1,"color:#888;");
						text_block1.appendChild(inline_text1);
						var text_node1 = document.createTextNode("");
						inline_text1.appendChild(text_node1);

						info.onupdate = function(){
							text_node0.nodeValue = data.number + ":" + data.title;
							text_node1.nodeValue = "R:" + data.replies + " I:" + data.images + " [" + get_ppd() + "/d] [" + get_date() + "]";
						};
						break;

					case "small_icon":
						var inline_text = DocumentCreateElement("span");
						ElementSetStyle(inline_text,"text-decoration:underline; word-break:break-all;");
						parent.appendChild(inline_text);
						var text_node = document.createTextNode("");
						inline_text.appendChild(text_node);

						info.onupdate = function(){
							text_node.nodeValue = data.number + ":" + get_title(100) + " (" + data.replies + ")";
						};
						break;

					case "large_icon":
						var img_block = DocumentCreateElement("div");
						ElementSetStyle(img_block,"margin:4px; margin-bottom:0px; text-align:center;");
						parent.appendChild(img_block);

						var image = data.image;
						if(image){
							ElementSetStyle(image,"max-width:100%; max-height:140px;");
							img_block.appendChild(image);
						}

						var text_block = DocumentCreateElement("div");
						ElementSetStyle(text_block,"margin:4px; margin-top:2px;");
						parent.appendChild(text_block);
						var inline_text = DocumentCreateElement("span");
						ElementSetStyle(inline_text,"word-break:break-all;");
						text_block.appendChild(inline_text);
						var text_node = document.createTextNode("");
						inline_text.appendChild(text_node);

						info.onupdate = function(){
							text_node.nodeValue = data.number + ":" + get_title(50) + " (" + data.replies + ")";
						};
						break;
					}
				};

				_ui_catalog.onUpdateCell = function (info){
					var callback = convert_list[info.key];
					var parent = info.parent;
					var data = info.data;
					var text_node = document.createTextNode("");
					parent.appendChild(text_node);

					info.onupdate = function(){
						if(callback){
							text_node.nodeValue = callback(data[info.key]);
						}else{
							text_node.nodeValue = data[info.key];
						}
					}
				};

				var column;
				column = _ui_catalog.createColumn("number");
				column.setLabel("No");
				column.setWidthMin(50);
				column.setWidthMax(50);
				column.setTextAlign("center");

				column = _ui_catalog.createColumn("title");
				column.setLabel("Title");
				column.setWidthMin(300);

				column = _ui_catalog.createColumn("replies");
				column.setLabel("Replies");
				column.setWidthMin(50);
				column.setWidthMax(70);
				column.setTextAlign("right");

				column = _ui_catalog.createColumn("images");
				column.setLabel("Images");
				column.setWidthMin(50);
				column.setWidthMax(70);
				column.setTextAlign("right");

				column = _ui_catalog.createColumn("ppd");
				column.setLabel("P/d");
				column.setWidthMin(70);
				column.setWidthMax(70);
				column.setTextAlign("right");

				column = _ui_catalog.createColumn("id");
				column.setLabel("id");
				column.setWidthMin(100);
				column.setWidthMax(100);
				column.setTextAlign("center");

				column = _ui_catalog.createColumn("date_new");
				column.setLabel("Since");
				column.setWidthMin(150);
				column.setWidthMax(150);
				column.setTextAlign("center");

				_ui_catalog.setBlockSize(140,140 * (4/3));
				_ui_catalog.sort("number",false);
				break;

			case "8chan":
				_category_title.nodeValue = _current_site;
				disableCategoryContainer(false);
				openSplitterLeft(true);

				var convert_list = new Object();
				convert_list["ppd"] = function(value){
					value = Math.floor(value * 100) / 100;
					return value.toFixed(2);
				};
				convert_list["date_new"] = UNIXTIME_ToString_JP;

				_ui_catalog.onUpdateItem = function (info){
					var parent = info.parent;
					var data = info.data;

					var get_title = function(size){
						if(data.title.length > size){
							return data.title.substr(0,size) + "...";
						}
						return data.title;
					};
					var get_date = function(){
						return convert_list["date_new"](data.date_new);
					};
					var get_ppd = function(){
						return convert_list["ppd"](data.ppd);
					};

					switch(info.layout_mode){
					case "list":
						var container = DocumentCreateElement("div");
						ElementSetStyle(container,"position:relative; margin:2px; margin-left:4px; margin-right:4px; min-height:60px;");
						parent.appendChild(container);

						var img_block = DocumentCreateElement("div");
						ElementSetStyle(img_block,"position:absolute; width:60px; height:60px; text-align:right;");
						container.appendChild(img_block);

						var image = data.image;
						if(image){
							ElementSetStyle(image,"max-width:100%; max-height:60px;");
							img_block.appendChild(image);
						}

						var text_container = DocumentCreateElement("div");
						ElementSetStyle(text_container,"margin-left:65px;");
						container.appendChild(text_container);

						var text_block0 = DocumentCreateElement("div");
						ElementSetStyle(text_block0,"");
						text_container.appendChild(text_block0);
						var inline_text0 = DocumentCreateElement("span");
						ElementSetStyle(inline_text0,"word-break: break-all;");
						text_block0.appendChild(inline_text0);
						var text_node0 = document.createTextNode("");
						inline_text0.appendChild(text_node0);

						var text_block1 = DocumentCreateElement("div");
						ElementSetStyle(text_block1,"margin-top:2px;");
						text_container.appendChild(text_block1);
						var inline_text1 = DocumentCreateElement("span");
						ElementSetStyle(inline_text1,"color:#888;");
						text_block1.appendChild(inline_text1);
						var text_node1 = document.createTextNode("");
						inline_text1.appendChild(text_node1);

						info.onupdate = function(){
							text_node0.nodeValue = data.number + ":" + data.title;
							text_node1.nodeValue = "R:" + data.replies + " I:" + data.images + " [" + get_ppd() + "/d] [" + get_date() + "]";
						};
						break;

					case "small_icon":
						var inline_text = DocumentCreateElement("span");
						ElementSetStyle(inline_text,"text-decoration:underline; word-break:break-all;");
						parent.appendChild(inline_text);
						var text_node = document.createTextNode("");
						inline_text.appendChild(text_node);

						info.onupdate = function(){
							text_node.nodeValue = data.number + ":" + get_title(100) + " (" + data.replies + ")";
						};
						break;

					case "large_icon":
						var img_block = DocumentCreateElement("div");
						ElementSetStyle(img_block,"margin:4px; margin-bottom:0px; text-align:center;");
						parent.appendChild(img_block);

						var image = data.image;
						if(image){
							ElementSetStyle(image,"max-width:100%; max-height:140px;");
							img_block.appendChild(image);
						}

						var text_block = DocumentCreateElement("div");
						ElementSetStyle(text_block,"margin:4px; margin-top:2px;");
						parent.appendChild(text_block);
						var inline_text = DocumentCreateElement("span");
						ElementSetStyle(inline_text,"word-break:break-all;");
						text_block.appendChild(inline_text);
						var text_node = document.createTextNode("");
						inline_text.appendChild(text_node);

						info.onupdate = function(){
							text_node.nodeValue = data.number + ":" + get_title(50) + " (" + data.replies + ")";
						};
						break;
					}
				};

				_ui_catalog.onUpdateCell = function (info){
					var callback = convert_list[info.key];
					var parent = info.parent;
					var data = info.data;
					var text_node = document.createTextNode("");
					parent.appendChild(text_node);

					info.onupdate = function(){
						if(callback){
							text_node.nodeValue = callback(data[info.key]);
						}else{
							text_node.nodeValue = data[info.key];
						}
					}
				};

				var column;
				column = _ui_catalog.createColumn("number");
				column.setLabel("No");
				column.setWidthMin(50);
				column.setWidthMax(50);
				column.setTextAlign("center");

				column = _ui_catalog.createColumn("title");
				column.setLabel("Title");
				column.setWidthMin(300);

				column = _ui_catalog.createColumn("replies");
				column.setLabel("Replies");
				column.setWidthMin(50);
				column.setWidthMax(70);
				column.setTextAlign("right");

				column = _ui_catalog.createColumn("images");
				column.setLabel("Images");
				column.setWidthMin(50);
				column.setWidthMax(70);
				column.setTextAlign("right");

				column = _ui_catalog.createColumn("ppd");
				column.setLabel("P/d");
				column.setWidthMin(70);
				column.setWidthMax(70);
				column.setTextAlign("right");

				column = _ui_catalog.createColumn("id");
				column.setLabel("id");
				column.setWidthMin(100);
				column.setWidthMax(100);
				column.setTextAlign("center");

				column = _ui_catalog.createColumn("date_new");
				column.setLabel("Since");
				column.setWidthMin(150);
				column.setWidthMax(150);
				column.setTextAlign("center");

				_ui_catalog.setBlockSize(140,140 * (4/3));
				_ui_catalog.sort("number",false);
				break;

			case "2ch.hk":
				_category_title.nodeValue = _current_site;
				disableCategoryContainer(false);
				openSplitterLeft(true);

				var convert_list = new Object();
				convert_list["ppd"] = function(value){
					value = Math.floor(value * 100) / 100;
					return value.toFixed(2);
				};
				convert_list["date_new"] = UNIXTIME_ToString_JP;

				_ui_catalog.onUpdateItem = function (info){
					var parent = info.parent;
					var data = info.data;

					var get_title = function(size){
						if(data.title.length > size){
							return data.title.substr(0,size) + "...";
						}
						return data.title;
					};
					var get_date = function(){
						return convert_list["date_new"](data.date_new);
					};
					var get_ppd = function(){
						return convert_list["ppd"](data.ppd);
					};

					switch(info.layout_mode){
					case "list":
						var container = DocumentCreateElement("div");
						ElementSetStyle(container,"position:relative; margin:2px; margin-left:4px; margin-right:4px; min-height:60px;");
						parent.appendChild(container);

						var img_block = DocumentCreateElement("div");
						ElementSetStyle(img_block,"position:absolute; width:60px; height:60px; text-align:right;");
						container.appendChild(img_block);

						var image = data.image;
						if(image){
							ElementSetStyle(image,"max-width:100%; max-height:60px;");
							img_block.appendChild(image);
						}

						var text_container = DocumentCreateElement("div");
						ElementSetStyle(text_container,"margin-left:65px;");
						container.appendChild(text_container);

						var text_block0 = DocumentCreateElement("div");
						ElementSetStyle(text_block0,"");
						text_container.appendChild(text_block0);
						var inline_text0 = DocumentCreateElement("span");
						ElementSetStyle(inline_text0,"word-break: break-all;");
						text_block0.appendChild(inline_text0);
						var text_node0 = document.createTextNode("");
						inline_text0.appendChild(text_node0);

						var text_block1 = DocumentCreateElement("div");
						ElementSetStyle(text_block1,"margin-top:2px;");
						text_container.appendChild(text_block1);
						var inline_text1 = DocumentCreateElement("span");
						ElementSetStyle(inline_text1,"color:#888;");
						text_block1.appendChild(inline_text1);
						var text_node1 = document.createTextNode("");
						inline_text1.appendChild(text_node1);

						info.onupdate = function(){
							text_node0.nodeValue = data.number + ":" + data.title;
							text_node1.nodeValue = "R:" + data.replies + " I:" + data.images + " [" + get_ppd() + "/d] [" + get_date() + "]";
						};
						break;

					case "small_icon":
						var inline_text = DocumentCreateElement("span");
						ElementSetStyle(inline_text,"text-decoration:underline; word-break:break-all;");
						parent.appendChild(inline_text);
						var text_node = document.createTextNode("");
						inline_text.appendChild(text_node);

						info.onupdate = function(){
							text_node.nodeValue = data.number + ":" + get_title(100) + " (" + data.replies + ")";
						};
						break;

					case "large_icon":
						var img_block = DocumentCreateElement("div");
						ElementSetStyle(img_block,"margin:4px; margin-bottom:0px; text-align:center;");
						parent.appendChild(img_block);

						var image = data.image;
						if(image){
							ElementSetStyle(image,"max-width:100%; max-height:140px;");
							img_block.appendChild(image);
						}

						var text_block = DocumentCreateElement("div");
						ElementSetStyle(text_block,"margin:4px; margin-top:2px;");
						parent.appendChild(text_block);
						var inline_text = DocumentCreateElement("span");
						ElementSetStyle(inline_text,"word-break:break-all;");
						text_block.appendChild(inline_text);
						var text_node = document.createTextNode("");
						inline_text.appendChild(text_node);

						info.onupdate = function(){
							text_node.nodeValue = data.number + ":" + get_title(50) + " (" + data.replies + ")";
						};
						break;
					}
				};

				_ui_catalog.onUpdateCell = function (info){
					var callback = convert_list[info.key];
					var parent = info.parent;
					var data = info.data;
					var text_node = document.createTextNode("");
					parent.appendChild(text_node);

					info.onupdate = function(){
						if(callback){
							text_node.nodeValue = callback(data[info.key]);
						}else{
							text_node.nodeValue = data[info.key];
						}
					}
				};

				var column;
				column = _ui_catalog.createColumn("number");
				column.setLabel("No");
				column.setWidthMin(50);
				column.setWidthMax(50);
				column.setTextAlign("center");

				column = _ui_catalog.createColumn("title");
				column.setLabel("Title");
				column.setWidthMin(300);

				column = _ui_catalog.createColumn("replies");
				column.setLabel("Replies");
				column.setWidthMin(50);
				column.setWidthMax(70);
				column.setTextAlign("right");

				column = _ui_catalog.createColumn("images");
				column.setLabel("Images");
				column.setWidthMin(50);
				column.setWidthMax(70);
				column.setTextAlign("right");

				column = _ui_catalog.createColumn("ppd");
				column.setLabel("P/d");
				column.setWidthMin(70);
				column.setWidthMax(70);
				column.setTextAlign("right");

				column = _ui_catalog.createColumn("id");
				column.setLabel("id");
				column.setWidthMin(100);
				column.setWidthMax(100);
				column.setTextAlign("center");

				column = _ui_catalog.createColumn("date_new");
				column.setLabel("Since");
				column.setWidthMin(150);
				column.setWidthMax(150);
				column.setTextAlign("center");

				_ui_catalog.setBlockSize(140,140 * (4/3));
				_ui_catalog.sort("number",false);
				break;

			case "reddit":
				_category_title.nodeValue = "reddit";
				disableCategoryContainer(true);
				openSplitterLeft(false);

				var convert_list = new Object();
				convert_list["ppd"] = function(value){
					value = Math.floor(value * 100) / 100;
					return value.toFixed(2);
				};
				convert_list["date_new"] = UNIXTIME_ToString_JP;

				_ui_catalog.onUpdateItem = function (info){
					var parent = info.parent;
					var data = info.data;

					var get_title = function(size){
						if(data.title.length > size){
							return data.title.substr(0,size) + "...";
						}
						return data.title;
					};
					var get_date = function(){
						return convert_list["date_new"](data.date_new);
					};
					var get_ppd = function(){
						return convert_list["ppd"](data.ppd);
					};

					switch(info.layout_mode){
					case "list":
						var container = DocumentCreateElement("div");
						ElementSetStyle(container,"position:relative; margin:2px; margin-left:4px; margin-right:4px; min-height:60px;");
						parent.appendChild(container);

						var img_block = DocumentCreateElement("div");
						ElementSetStyle(img_block,"position:absolute; width:60px; height:60px; text-align:right;");
						container.appendChild(img_block);

						var image = data.image;
						if(image){
							ElementSetStyle(image,"max-width:100%; max-height:60px;");
							img_block.appendChild(image);
						}

						var text_container = DocumentCreateElement("div");
						ElementSetStyle(text_container,"margin-left:65px;");
						container.appendChild(text_container);

						var text_block0 = DocumentCreateElement("div");
						ElementSetStyle(text_block0,"");
						text_container.appendChild(text_block0);
						var inline_text0 = DocumentCreateElement("span");
						ElementSetStyle(inline_text0,"word-break: break-all;");
						text_block0.appendChild(inline_text0);
						var text_node0 = document.createTextNode("");
						inline_text0.appendChild(text_node0);

						var text_block1 = DocumentCreateElement("div");
						ElementSetStyle(text_block1,"margin-top:2px;");
						text_container.appendChild(text_block1);
						var inline_text1 = DocumentCreateElement("span");
						ElementSetStyle(inline_text1,"color:#888;");
						text_block1.appendChild(inline_text1);
						var text_node1 = document.createTextNode("");
						inline_text1.appendChild(text_node1);

						info.onupdate = function(){
							text_node0.nodeValue = data.number + ":" + data.title;
							text_node1.nodeValue = "S:" + data.score + " C:" + data.comments + " [" + get_ppd() + "/d] [" + get_date() + "]";
						};
						break;

					case "small_icon":
						var inline_text = DocumentCreateElement("span");
						ElementSetStyle(inline_text,"text-decoration:underline; word-break:break-all;");
						parent.appendChild(inline_text);
						var text_node = document.createTextNode("");
						inline_text.appendChild(text_node);

						info.onupdate = function(){
							text_node.nodeValue = data.number + ":" + get_title(100) + " (" + data.comments + ")";
						};
						break;

					case "large_icon":
						var img_block = DocumentCreateElement("div");
						ElementSetStyle(img_block,"margin:4px; margin-bottom:0px; text-align:center;");
						parent.appendChild(img_block);

						var image = data.image;
						if(image){
							ElementSetStyle(image,"max-width:100%; max-height:140px;");
							img_block.appendChild(image);
						}

						var text_block = DocumentCreateElement("div");
						ElementSetStyle(text_block,"margin:4px; margin-top:2px;");
						parent.appendChild(text_block);
						var inline_text = DocumentCreateElement("span");
						ElementSetStyle(inline_text,"word-break:break-all;");
						text_block.appendChild(inline_text);
						var text_node = document.createTextNode("");
						inline_text.appendChild(text_node);

						info.onupdate = function(){
							text_node.nodeValue = data.number + ":" + get_title(50) + " (" + data.comments + ")";
						};
						break;
					}
				};

				_ui_catalog.onUpdateCell = function (info){
					var callback = convert_list[info.key];
					var parent = info.parent;
					var data = info.data;
					var text_node = document.createTextNode("");
					parent.appendChild(text_node);

					info.onupdate = function(){
						if(callback){
							text_node.nodeValue = callback(data[info.key]);
						}else{
							text_node.nodeValue = data[info.key];
						}
					}
				};

				var column;
				column = _ui_catalog.createColumn("number");
				column.setLabel("No");
				column.setWidthMin(50);
				column.setWidthMax(50);
				column.setTextAlign("center");

				column = _ui_catalog.createColumn("title");
				column.setLabel("Title");
				column.setWidthMin(300);

				column = _ui_catalog.createColumn("comments");
				column.setLabel("Comments");
				column.setWidthMin(50);
				column.setWidthMax(100);
				column.setTextAlign("right");

				column = _ui_catalog.createColumn("score");
				column.setLabel("Score");
				column.setWidthMin(50);
				column.setWidthMax(100);
				column.setTextAlign("right");

				column = _ui_catalog.createColumn("ppd");
				column.setLabel("P/d");
				column.setWidthMin(70);
				column.setWidthMax(70);
				column.setTextAlign("right");

				column = _ui_catalog.createColumn("date_new");
				column.setLabel("Since");
				column.setWidthMin(150);
				column.setWidthMax(150);
				column.setTextAlign("center");

				_ui_catalog.setBlockSize(140,140 * (4/3));
				_ui_catalog.sort("number",false);
				break;

			default:
				_category_title.nodeValue = _current_site;
				disableCategoryContainer(true);
				openSplitterLeft(false);
				_active_panel = "";
				break;
			}

			updateCompactMode();
			_ui_catalog.resize();
			updateCategoryReload(callback);
		}

		// -
		// サイト設定
		// -
		_this.setSite = function (type,callback){
			if(_current_site == type) return;
			_select_site.value = _current_site = type;
			updateSite(callback);
		};

		// -
		// カタログ設定
		// -
		_this.setCatalog = function (url,callback){
				disableCatalogContainer(false);
				_active_panel = "catalog";
				updateCompactMode();
				_catalog_url = url;
				_ui_catalog.clearItem();
				updateCatalogReload(callback);
		};

		// -
		// スレッド設定
		// -
		_this.setThread = function (url){
			disableThreadContainer(false);
			_thread_url = url;
			_thread_title.nodeValue = url;
			_thread_iframe.src = url;
		};

		// -
		// スレッドクリア
		// -
		_this.clearThread = function (){
			disableThreadContainer(true);
			_thread_url = "about:blank";
			_thread_iframe.src = _thread_url;
			_thread_title.nodeValue = "";
		};

		// -
		// カテゴリの無効設定
		// -
		function disableCategoryContainer(disable){
			_category_container_disable = disable;
			updateCategoryContainer();
		}

		// -
		// カタログの無効設定
		// -
		function disableCatalogContainer(disable){
			_catalog_container_disable = disable;
			updateCatalogContainer();
		}

		// -
		// スレッドの無効設定
		// -
		function disableThreadContainer(disable){
			_thread_container_disable = disable;
			updateThreadContainer();
		}

		// -
		// カテゴリの表示設定
		// -
		function visibleCategoryContainer(type){
			var style = _category_container.style;
			if(type){
				style.display = "block";
			}else{
				style.display = "none";
			}
		}

		// -
		// カタログの表示設定
		// -
		function visibleCatalogContainer(type){
			var style = _catalog_container.style;
			if(type){
				style.display = "block";
				_ui_catalog.resize();
			}else{
				style.display = "none";
			}
		}

		// -
		// スレッドの表示設定
		// -
		function visibleThreadContainer(type){
			var style = _thread_container.style;
			if(type){
				style.display = "block";
				_ui_catalog.setTargetMode("thread");
			}else{
				style.display = "none";
				_ui_catalog.setTargetMode("_blank");
			}
		}

		// -
		// カテゴリの表示取得
		// -
		function getVisibleCategoryContainer(){
			if(_category_container_disable){
				return false;
			}
			if(!(_splitter_left_open)){
				return false;
			}
			return true;
		}

		// -
		// カタログの表示取得
		// -
		function getVisibleCatalogContainer(){
			if(_catalog_container_disable){
				return false;
			}
			return true;
		}

		// -
		// スレッドの表示取得
		// -
		function getVisibleThreadContainer(){
			if(_compact_mode){
				return false;
			}
			if(_thread_container_disable){
				return false;
			}
			if(_splitter_right_open || _splitter_bottom_open){
			}else{
				return false;
			}
			return true;
		}

		// -
		// カテゴリの表示更新
		// -
		function updateCategoryContainer(){
			visibleCategoryContainer(getVisibleCategoryContainer());
		}

		// -
		// カタログの表示更新
		// -
		function updateCatalogContainer(){
			visibleCatalogContainer(getVisibleCatalogContainer());
		}

		// -
		// スレッドの表示更新
		// -
		function updateThreadContainer(){
			visibleThreadContainer(getVisibleThreadContainer());
		}

		// -
		// メニューカテゴリをクリック
		// -
		function clickMenuCategory(e){
			if(_compact_mode){
				_active_panel = "category";
				updateCompactMode();
			}else{
				openSplitterLeft(!(_splitter_left_open));
			}
		}

		// -
		// メニューカタログをクリック
		// -
		function clickMenuCatalog(e){
			if(_compact_mode){
				_active_panel = "catalog";
				updateCompactMode();
			}
		}

		// -
		// サイドバーリロードをクリック
		// -
		function clickMenuSidebarReload(e){
			if(_this.onreload){
				_this.onreload();
			}
		}

		// -
		// リロードイベント
		// -
		_this.onreload = function (){};

		// -
		// メニュースレッドをクリック
		// -
		function clickMenuThread(e){
			if(_splitter_bottom_open){
				openSplitterBottom(false);
				openSplitterRight(true);
			}else if(_splitter_right_open){
				openSplitterBottom(false);
				openSplitterRight(false);
			}else{
				openSplitterBottom(true);
				openSplitterRight(false);
			}
		}

		// -
		// メニュースレッドを更新
		// -
		function updateMenuThread(){
			_button_menu_thread.setVisible(getVisibleMenuThread());
		}
		function getVisibleMenuThread(){
			if(_sidebar_mode) return false;
			if(_compact_mode) return false;
			return true;
		}

		// -
		// カテゴリレイアウトをクリック
		// -
		function clickCategoryLayout(e){
			_category_layout_mode ++;
			if(_category_layout_mode >= 4){
				_category_layout_mode = 0;
			}

			updateCategoryLayout(e);
		}

		// -
		// カテゴリレイアウトを更新
		// -
		function updateCategoryLayout(e){
			switch(_category_layout_mode){
			case 0:
				_ui_category.setOpenMode(true);
				_ui_category.setLayoutMode("inline");
				break;
			case 1:
				_ui_category.setOpenMode(true);
				_ui_category.setLayoutMode("block");
				break;
			case 2:
				_ui_category.setOpenMode(false);
				_ui_category.setLayoutMode("inline");
				break;
			case 3:
				_ui_category.setOpenMode(false);
				_ui_category.setLayoutMode("block");
				break;
			}
		}

		// -
		// カテゴリリロードをクリック
		// -
		function clickCategoryReload(e){
			updateCategoryReload();
		}

		// -
		// カテゴリリロードを更新
		// -
		function updateCategoryReload(callback){
			_category_modify_count += 1;
			var modify = _category_modify_count;

			var complete = function(response){
				_button_category_reload.setDisabled(false);

				if(callback){
					callback(response);
				}
			};
			
			var exit = function(){
				if(modify == _category_modify_count) return false;
				complete({result:false});
				return true;
			};

			_ui_category.clear();
			_button_category_reload.setDisabled(true);

			// ローダーオブジェクトを作成
			var loader = new Loader();

			switch(_current_site){
			case "2ch":
			case "5ch":
			case "5ch_pc":
			case "open2ch":
				var domain = (_current_site == "5ch_pc") ? "5ch" : _current_site;
				var loader_url = "https://menu." + domain + ".net/bbsmenu.html";

				// 成功
				loader.onload = function(str){
					if(exit()) return;
					
					var re_folder = new RegExp("^<br><B>(.*)</B><br>","i");
					var re_item = new RegExp("<A HREF=(.*)>(.*)</A>","gi");
					var re_start = new RegExp("<br><b>","gi");
					var re_end = new RegExp("<br><B>","gi");

					var p = 0;
					var n = str.length;
					function f(){
						if(exit()) return;

						try{
							if(p >= n) throw 0;

							re_start.lastIndex = p;
							var m = re_start.exec(str);
							if(!m) throw 0;
							p = m.index;

							re_end.lastIndex = re_start.lastIndex;
							var m = re_end.exec(str);
							if(m){
								e = m.index;
							}else{
								e = n;
							}
							var s = str.substring(p,e);
							var m = s.match(re_folder);
							if(m){
								var folder = _ui_category.createFolder(m[1]);
								folder.setLabel(m[1]);

								s.replace(re_item,function(m,p1,p2,index,str){
									var url = p1;
									url = StringLiteral_To_String(url) || url;
									url = StringUrl_To_Absolute(url,loader_url);
									var item = folder.createItem(p1);
									item.setLabel(p2);
									item.setTooltip(url);
									item.setURL(url);
								});
							}

							if(p < e){
								p = e;
								execute_queue.attachFirst(f,null);
								return;
							}
						}catch(e){
						}

						complete({result:true});
					}

					execute_queue.attachLast(f,null);
				};

				// 失敗
				loader.onerror = function(){
					if(exit()) return;
					complete({result:false});
				};

				// テキストの読み込み
				loader.setMethod("GET");
				loader.setURL(loader_url);
				loader.overrideMimeType("text/plain; charset=Shift_JIS");
				loader.loadText();
				break;

			case "2chan":
				var loader_url = "https://www.2chan.net/bbsmenu.html";

				// 成功
				loader.onload = function(str){
					if(exit()) return;

					var re_folder = new RegExp("^<b>(.*)</b><br>","i");
					var re_item = new RegExp('<a href="([^"]*)"[^>]*>([^<]*)',"gi");
					var re_sub = new RegExp('://([^.]+)',"i");

					var board_list = new Array();
					var board_dictionary = new Object();

					var p = 0;
					var n = str.length;
					try{
						while(p < n){
							p = str.indexOf("<b>",p);
							if(p < 0) break;
							var e = str.indexOf("<b>",p+3);
							if(e < 0) e = n;
							var s = str.substring(p,e);
							var m = s.match(re_folder);
							if(m){
								var category = {
									label:m[1]
								};
								s.replace(re_item,function(m,p1,p2,index,str){
									var board = {
										category:category,
										url:StringUrl_To_Absolute(p1,loader_url),
										label:p2
									};
									board.prev = board;
									board.next = board;
									var m = board.url.match(re_sub);
									board.sub = (m) ? m[1] : "";
									var list = board_dictionary[board.label];
									if(list){
										var prev = list;
										var next = list.next;
										prev.next = board;
										next.prev = board;
										board.prev = prev;
										board.next = next;
									}else{
										list = board_dictionary[board.label] = board;
									}
									board_list.push(board);
								});
							}
							p = e;
						}
					}catch(e){
					}

					var p = 0;
					function f(){
						if(exit()) return;

						try{
							var board = board_list[p];
							if(!board) throw 0;
							p++;

							var category = board.category;
							var folder = _ui_category.getFolder(category.label);
							if(!folder){
								folder = _ui_category.createFolder(category.label);
								folder.setLabel(category.label);
							}
							var label = board.label;
							if(board.prev != board){
								label += "(" + board.sub + ")";
							}
							var item = folder.createItem(board.url);
							item.setLabel(label);
							item.setTooltip(board.url);
							item.setURL(board.url);	
							execute_queue.attachFirst(f,null);
							return;
						}catch(e){
						}

						complete({result:true});
					}

					execute_queue.attachLast(f,null);
				};

				// 失敗
				loader.onerror = function(){
					if(exit()) return;
					complete({result:false});
				};

				// テキストの読み込み
				loader.setMethod("GET");
				loader.setURL(loader_url);
				loader.overrideMimeType("text/plain; charset=Shift_JIS");
				loader.loadText();
				break;

			case "4chan":

				// 成功
				loader.onload = function(str){
					if(exit()) return;

					var boards = JsonParse(str).boards;

					var folder0 = _ui_category.createFolder("boards");
					folder0.setLabel("Boards");

					var folder1 = _ui_category.createFolder("folders");
					folder1.setLabel("Folders");

					var p = 0;
					var n = boards.length;
					function f(){
						if(exit()) return;

						try{
							if(p >= n) throw 0;
							var board = boards[p];
							p += 1;

							var url = "https://boards.4chan.org/" + (board.board) + "/";

							var item = folder0.createItem(board.board);
							item.setLabel(board.title);
							item.setTooltip(board.board);
							item.setURL(url);

							var item = folder1.createItem("#" + board.board);
							item.setLabel(board.board);
							item.setTooltip(board.title);
							item.setURL(url);

							execute_queue.attachFirst(f,null);
						}catch(e){
						}

						complete({result:true});
					}

					execute_queue.attachLast(f,null);
				};

				// 失敗
				loader.onerror = function(){
					if(exit()) return;
					complete({result:false});
				};

				// テキストの読み込み
				loader.setMethod("GET");
				loader.setURL("https://a.4cdn.org/boards.json");
				loader.loadText();
				break;

			case "8chan":

				// 成功
				loader.onload = function(str){
					if(exit()) return;

					var boards = JsonParse(str);

					var folder = _ui_category.createFolder("8chan");
					folder.setLabel("8chan");

					var p = 0;
					var n = boards.length;
					if(n > 2000) n = 2000;
					function f(){
						if(exit()) return;

						try{
							if(p >= n) throw 0;
							var board = boards[p];
							p += 1;

							var item = folder.createItem(board.title);
							item.setLabel(board.uri);
							item.setTooltip(board.title);
							item.setURL("https://8ch.net/" + (board.uri) + "/");

							execute_queue.attachFirst(f,null);
						}catch(e){
						}

						complete({result:true});
					}

					execute_queue.attachLast(f,null);
				};

				// 失敗
				loader.onerror = function(){
					if(exit()) return;
					complete({result:false});
				};

				// テキストの読み込み
				loader.setMethod("GET");
				loader.setURL("https://8ch.net/boards.json");
				loader.loadText();
				break;

			case "2ch.hk":

				// 成功
				loader.onload = function(str){
					if(exit()) return;

					var boards = JsonParse(str).boards;

					var board_list = new Array();
					var folder_dictionary = new Array();
					var p = 0;
					var n = boards.length;
					for(p=0;p<n;p++){
						var board = boards[p];
						var folder = folder_dictionary[board.category];
						if(!folder){
							folder = folder_dictionary[board.category] = _ui_category.createFolder(board.category);
							folder.setLabel(board.category);
						}
						var item = {
							folder:folder,
							label:board.name,
							id:board.id,
							url:"https://2ch.hk/" + (board.id) + "/"
						};
						board_list.push(item);
					}
					var folder_id = _ui_category.createFolder("folders");
					folder_id.setLabel("Folders");


					var p = 0;
					function f(){
						if(exit()) return;

						try{
							var board = board_list[p];
							if(!board) throw 0;
							p += 1;

							var item = board.folder.createItem(board.id);
							item.setLabel(board.label);
							item.setTooltip(board.id);
							item.setURL(board.url);

							var item = folder_id.createItem("#" + board.id);
							item.setLabel(board.id);
							item.setTooltip(board.label);
							item.setURL(board.url);

							execute_queue.attachFirst(f,null);
						}catch(e){
						}

						complete({result:true});
					}

					execute_queue.attachLast(f,null);
				};

				// 失敗
				loader.onerror = function(){
					if(exit()) return;
					complete({result:false});
				};

				// テキストの読み込み
				loader.setMethod("GET");
				loader.setURL("https://2ch.hk/boards.json");
				loader.loadText();
				break;

			default:
				complete({result:false});
				break;
			}
		}

		// -
		// カタログレイアウトをクリック
		// -
		function clickCatalogLayout(e){
			_catalog_layout_mode ++;
			if(_catalog_layout_mode >= 4){
				_catalog_layout_mode = 0;
			}

			updateCatalogLayout(e);
		}

		// -
		// カタログレイアウトを更新
		// -
		function updateCatalogLayout(e){
			switch(_catalog_layout_mode){
			case 0:
					_ui_catalog.setLayoutMode("detail");
					break;
			case 1:
					_ui_catalog.setLayoutMode("list");
					break;
			case 2:
					_ui_catalog.setLayoutMode("large_icon");
					break;
			case 3:
					_ui_catalog.setLayoutMode("small_icon");
					break;
			}
		}

		// -
		// カタログリロードをクリック
		// -
		function clickCatalogReload(e){
			updateCatalogReload();
		}

		// -
		// カタログリロードを更新
		// -
		function updateCatalogReload(callback){
			_catalog_modify_count += 1;
			var modify = _catalog_modify_count;

			var complete = function(response){
				_button_catalog_reload.setDisabled(false);

				if(callback){
					callback(response);
				}
			};

			var exit = function(){
				if(modify == _catalog_modify_count) return false;
				complete({result:false});
				return true;
			};

			_button_catalog_reload.setDisabled(true);

			switch(_current_site){
			case "2ch":
			case "5ch":
			case "5ch_pc":
			case "open2ch":
			case "shitaraba":
				var protocol;
				var domain;
				var directory;
				if(_current_site == "shitaraba"){
					if(!domain){
						var m = _catalog_url.match(new RegExp("(http|https)://([^/]+[.](shitaraba)[.]net)/(test|bbs)/[^/]+[.]cgi/([^/]+/[0-9]+)","i"));
						if(m){
							protocol = m[1];
							domain = m[2];
							directory = m[5];
						}
					}
					if(!domain){
						var m = _catalog_url.match(new RegExp("(http|https)://([^/]+[.](shitaraba)[.]net)/([^/]+/[0-9]+)","i"));
						if(m){
							protocol = m[1];
							domain = m[2];
							directory = m[4];
						}
					}
					if(domain){
						_catalog_title.nodeValue = protocol + "://" + domain + "/" + directory + "/";
					}else{
						complete({result:false});
						return;
					}
				}else{
					if(!domain){
						var m = _catalog_url.match(new RegExp("(http|https)://([^/]+[.](bbspink[.]com|open2ch[.]net|2ch[.]net|5ch[.]net))/test/read[.]cgi/([^/]+)","i"));
						if(m){
							protocol = m[1];
							domain = m[2];
							directory = m[4];
						}
					}
					if(!domain){
						var m = _catalog_url.match(new RegExp("(http|https)://([^/]+[.](bbspink[.]com|open2ch[.]net|2ch[.]net|5ch[.]net))/([^/]+)","i"));
						if(m){
							protocol = m[1];
							domain = m[2];
							directory = m[4];
						}
					}
					if(domain){
						_catalog_title.nodeValue = protocol + "://" + domain + "/" + directory + "/";
					}else{
						complete({result:false});
						return;
					}
				}

				// ローダーオブジェクトを作成
				var loader = new Loader();

				// 成功
				loader.onload = function(str){
					if(exit()) return;
					
					var re = new RegExp("([0-9]+)[.](dat<>[ ]*|cgi,)(.*)[(]([0-9]+)[)]","i");

					var item_list = _ui_catalog.getItemList();
					var i;
					var num = item_list.length;
					for(i=0;i<num;i++){
						var data = item_list[i].getData();
						data.number = "x";
						data.ppd = (function(){
							var now = new Date();
							var old = new Date(data.date_new * 1000);
							var sub = now.getTime() - old.getTime();
							var ppd = 0;
							if(sub > 0){
								ppd = data.res / (sub / 1000 / 60 / 60 / 24);
							}
							return ppd;
						})();
					}

					var p = 0;
					var n = str.length;
					var index = 1;
					function f(){
						if(exit()) return;
						try{
							if(p >= n) throw 0;
							var e = str.indexOf("\n",p+1);
							if(e < 0) e = n;
							var s = str.substring(p,e);
							var m = s.match(re);
							if(m){
								var item = _ui_catalog.createItem(m[1]);
								if(_current_site == "shitaraba"){
									item.setURL(protocol + "://" + domain + "/bbs/read.cgi/" + directory + "/" + (m[1]));
								}else{
									var c = "";
									if(_current_site == "5ch_pc") c = "c/";
									if(domain.match(/bbspink[.]com$/)) c = "";
									item.setURL(protocol + "://" + domain + "/test/read.cgi/" + c + directory + "/" + (m[1]));
								}
								var data = item.getData();
								data.number = index;
								data.id = parseInt(m[1]);
								data.title = StringConvert_From_CharacterReferences_To_Text(m[3]);
								data.res = parseInt(m[4]);
								data.date_new = parseInt(data.id);
								data.ppd = (function(){
									var now = new Date();
									var old = new Date(data.date_new * 1000);
									var sub = now.getTime() - old.getTime();
									var ppd = 0;
									if(sub > 0){
										ppd = data.res / (sub / 1000 / 60 / 60 / 24);
									}
									return ppd;
								})();
								index += 1;
							}
							if(p < e){
								p = e;
								f();
								return;
							}
						}catch(e){
						}

						_ui_catalog.commit();
						complete({result:true});
					}
					f();
				};

				// 失敗
				loader.onerror = function(){
					if(exit()) return;
					complete({result:false});
				};

				// テキストの読み込み
				loader.setMethod("GET");
				loader.setURL(protocol + "://" + domain + "/" + directory + "/subject.txt");
				if(_current_site == "shitaraba"){
					loader.overrideMimeType("text/plain; charset=euc-jp");
				}else{
					loader.overrideMimeType("text/plain; charset=Shift_JIS");
				}
				loader.loadText();
				break;

			case "2chan":
				var domain;
				var directory;
				if(!domain){
					var m = _catalog_url.match(new RegExp("(http|https)://([^/]+[.]2chan[.]net)/([^/]+)","i"));
					if(m){
						domain = m[2];
						directory = m[3];
					}
				}
				if(domain){
					_catalog_title.nodeValue = "https://" + domain + "/" + directory + "/futaba.htm";
				}else{
					complete({result:false});
					return;
				}

				// ローダーオブジェクトを作成
				var loader = new Loader();
				var loader_url = "https://" + domain + "/" + directory + "/futaba.php?mode=cat&cxyl=1x2000x2000x0x6";

				// 成功
				loader.onload = function(str){
					if(exit()) return;
					var re_href = new RegExp("<a href='res/([0-9]+)[.]htm","i");
					var re_image = new RegExp("<img src='(.*)/(cat|thumb)/([^']*)","i");
					var re_title = new RegExp("<small>([^<]*)</small>","i");
					var re_res = new RegExp("<font[^>]*>([0-9]+)</font>","i");
					var re_date = new RegExp("/([0-9]+)s[.]jpg","i");

					var item_list = _ui_catalog.getItemList();
					var i;
					var num = item_list.length;
					for(i=0;i<num;i++){
						var data = item_list[i].getData();
						data.number = "x";
						data.ppd = (function(){
							var now = new Date();
							var old = new Date(data.date_new);
							var sub = now.getTime() - old.getTime();
							var ppd = 0;
							if(sub > 0){
								ppd = data.res / (sub / 1000 / 60 / 60 / 24);
							}
							return ppd;
						})();
					}

					var p = 0;
					var n = str.length;
					var index = 1;
					function f(){
						if(exit()) return;
						try{
							if(p >= n) throw 0;
							p = str.indexOf("<tr><td>",p);
							if(p < 0) throw 0;
							var e = str.indexOf("</td>",p+8);
							if(e < 0) e = n;
							var s = str.substring(p,e);
							var m = s.match(re_href);
							if(m){
								var item = _ui_catalog.createItem(m[1]);
								var data = item.getData();
								data.number = index;
								data.id = parseInt(m[1]);
								item.setURL("https://" + domain + "/" + directory + "/res/" + (data.id) + ".htm");

								m = s.match(re_title);
								if(m) data.title = StringConvert_From_CharacterReferences_To_Text(m[1]);
								m = s.match(re_res);
								if(m) data.res = parseInt(m[1]);
								m = s.match(re_date);
								if(m){
									data.date_new = parseInt(m[1]);
								}else{
									data.date_new = 0;
								}
								m = s.match(re_image);
								if(m){
									data.image_url = StringUrl_To_Absolute(m[1] + "/thumb/" + m[3],loader_url);
									var image = new Image();
									image.src = data.image_url;
									data.image = image;
								}
								data.ppd = (function(){
									var now = new Date();
									var old = new Date(data.date_new);
									var sub = now.getTime() - old.getTime();
									var ppd = 0;
									if(sub > 0){
										ppd = data.res / (sub / 1000 / 60 / 60 / 24);
									}
									return ppd;
								})();
								index += 1;
							}
							if(p < e){
								p = e;
								f();
								return;
							}
						}catch(e){
						}

						_ui_catalog.commit();
						complete({result:true});
					}

					f();
				};

				// 失敗
				loader.onerror = function(){
					if(exit()) return;
					complete({result:false});
				};

				// テキストの読み込み
				loader.setMethod("GET");
				loader.setURL(loader_url);
				loader.overrideMimeType("text/plain; charset=Shift_JIS");
				loader.loadText();
				break;

			case "4chan":
				var domain;
				var directory;
				if(!domain){
					var m = _catalog_url.match(new RegExp("(http|https)://([^/]+[.]4chan[.]org)/([^/]+)","i"));
					if(m){
						domain = m[2];
						directory = m[3];
					}
				}
				if(domain){
					_catalog_title.nodeValue = "https://" + domain + "/" + directory + "/";
				}else{
					complete({result:false});
					return;
				}

				// ローダーオブジェクトを作成
				var loader = new Loader();

				// 成功
				loader.onload = function(str){
					if(exit()) return;
					var item_list = _ui_catalog.getItemList();
					var i;
					var num = item_list.length;
					for(i=0;i<num;i++){
						var data = item_list[i].getData();
						data.number = "x";
						data.ppd = (function(){
							var now = new Date();
							var old = new Date(data.date_new * 1000);
							var sub = now.getTime() - old.getTime();
							var ppd = 0;
							if(sub > 0){
								ppd = data.replies / (sub / 1000 / 60 / 60 / 24);
							}
							return ppd;
						})();
					}

					var index = 1;
					try{
						var pages = JsonParse(str);

						var i,j;
						for(i=0;i<pages.length;i++){
							var threads = pages[i].threads;
							for(j=0;j<threads.length;j++){
								var thread = threads[j];

								var item = _ui_catalog.createItem(thread.no);
								item.setURL("https://" + domain + "/" + directory + "/thread/" + thread.no);
								var data = item.getData();
								data.number = index;
								data.id = thread.no;
								data.title = (function(){
									if(thread.sub) return thread.sub;
									try{
										var dom_parser = new DOMParser();
										var document_obj = dom_parser.parseFromString(thread.com , "text/html");
										return ElementGetTextContent(document_obj.body);
									}catch(e){
									}
									return (thread.com || "");
								})();
								data.replies = thread.replies;
								data.images = thread.images;
								data.date_new = thread.time;
								data.image_url = "https://i.4cdn.org/" + directory + "/" + thread.tim + "s.jpg";
								if(data.image_url){
									var image = new Image();
									image.src = data.image_url;
									data.image = image;
								}
								data.ppd = (function(){
									var now = new Date();
									var old = new Date(data.date_new * 1000);
									var sub = now.getTime() - old.getTime();
									var ppd = 0;
									if(sub > 0){
										ppd = data.replies / (sub / 1000 / 60 / 60 / 24);
									}
									return ppd;
								})();

								index += 1;
							}
						}

					}catch(e){
					}

					_ui_catalog.commit();
					complete({result:true});
				};

				// 失敗
				loader.onerror = function(){
					if(exit()) return;
					complete({result:false});
				};

				// テキストの読み込み
				loader.setMethod("GET");
				loader.setURL("https://a.4cdn.org/" + directory + "/catalog.json");
				loader.loadText();
				break;

			case "8chan":
				var domain;
				var directory;
				if(!domain){
					var m = _catalog_url.match(new RegExp("(http|https)://(8ch[.]net)/([^/]+)","i"));
					if(m){
						domain = m[2];
						directory = m[3];
					}
				}
				if(domain){
					_catalog_title.nodeValue = "https://" + domain + "/" + directory + "/";
				}else{
					complete({result:false});
					return;
				}

				// ローダーオブジェクトを作成
				var loader = new Loader();

				// 成功
				loader.onload = function(str){
					if(exit()) return;
					var item_list = _ui_catalog.getItemList();
					var i;
					var num = item_list.length;
					for(i=0;i<num;i++){
						var data = item_list[i].getData();
						data.number = "x";
						data.ppd = (function(){
							var now = new Date();
							var old = new Date(data.date_new * 1000);
							var sub = now.getTime() - old.getTime();
							var ppd = 0;
							if(sub > 0){
								ppd = data.replies / (sub / 1000 / 60 / 60 / 24);
							}
							return ppd;
						})();
					}

					var index = 1;
					try{
						var pages = JsonParse(str);

						var i,j;
						for(i=0;i<pages.length;i++){
							var threads = pages[i].threads;
							for(j=0;j<threads.length;j++){
								var thread = threads[j];

								var item = _ui_catalog.createItem(thread.no);
								item.setURL("https://" + domain + "/" + directory + "/res/" + thread.no + ".html");
								var data = item.getData();
								data.number = index;
								data.id = thread.no;
								data.title = (function(){
									if(thread.sub) return thread.sub;
									try{
										var dom_parser = new DOMParser();
										var document_obj = dom_parser.parseFromString(thread.com , "text/html");
										return ElementGetTextContent(document_obj.body);
									}catch(e){
									}
									return (thread.com || "");
								})();
								data.replies = thread.replies;
								data.images = thread.images;
								data.date_new = thread.time;
								data.image_url = (function(){
									var thumb = (function(){
										if(!(thread.tim)) return null;										
										var ext = thread.ext || "";
										if(!ext.match(/[.](bmp|gif|jpg|jpeg|png)/i)) ext = ".jpg";
										return thread.tim + ext;
									})();
									if(thumb){
										return "https://media.8ch.net/file_store/thumb/" + thumb;
									}
									if(thread.embed){
										var m = thread.embed.match(new RegExp("//img[.]youtube[.]com/vi/[^/]+/[0-9]+[.]jpg","i"));
										if(m) return "https:" + m[0];
									}
									return null;
								})();
								if(data.image_url){
									var image = new Image();
									image.src = data.image_url;
									data.image = image;
								}
								data.ppd = (function(){
									var now = new Date();
									var old = new Date(data.date_new * 1000);
									var sub = now.getTime() - old.getTime();
									var ppd = 0;
									if(sub > 0){
										ppd = data.replies / (sub / 1000 / 60 / 60 / 24);
									}
									return ppd;
								})();

								index += 1;
							}
						}

					}catch(e){
					}

					_ui_catalog.commit();
					complete({result:true});
				};

				// 失敗
				loader.onerror = function(){
					if(exit()) return;
					complete({result:false});
				};

				// テキストの読み込み
				loader.setMethod("GET");
				loader.setURL("https://8ch.net/" + directory + "/catalog.json");
				loader.loadText();
				break;

			case "2ch.hk":
				var domain;
				var directory;
				if(!domain){
					var m = _catalog_url.match(new RegExp("(http|https)://(2ch[.]hk)/([^/]+)","i"));
					if(m){
						domain = m[2];
						directory = m[3];
					}
				}
				if(domain){
					_catalog_title.nodeValue = "https://" + domain + "/" + directory + "/";
				}else{
					complete({result:false});
					return;
				}

				// ローダーオブジェクトを作成
				var loader = new Loader();
				var loader_url = "https://2ch.hk/" + directory + "/catalog.json";

				// 成功
				loader.onload = function(str){
					if(exit()) return;
					var item_list = _ui_catalog.getItemList();
					var i;
					var num = item_list.length;
					for(i=0;i<num;i++){
						var data = item_list[i].getData();
						data.number = "x";
						data.ppd = (function(){
							var now = new Date();
							var old = new Date(data.date_new * 1000);
							var sub = now.getTime() - old.getTime();
							var ppd = 0;
							if(sub > 0){
								ppd = data.replies / (sub / 1000 / 60 / 60 / 24);
							}
							return ppd;
						})();
					}

					var index = 1;
					try{
						var response = JsonParse(str);
						var threads = response.threads;

						var i;
						for(i=0;i<threads.length;i++){
							var thread = threads[i];

							var item = _ui_catalog.createItem(thread.num);
							item.setURL("https://" + domain + "/" + directory + "/res/" + thread.num + ".html");
							var data = item.getData();
							data.number = index;
							data.id = thread.num;
							data.title = (function(){
								if(thread.subject) return thread.subject;
								try{
									var dom_parser = new DOMParser();
									var document_obj = dom_parser.parseFromString(thread.comment , "text/html");
									return ElementGetTextContent(document_obj.body);
								}catch(e){
								}
								return (thread.com || "");
							})();
							data.replies = thread.posts_count;
							data.images = thread.files_count;
							data.date_new = thread.timestamp;
							data.image_url = (function(){
								try{
									return StringUrl_To_Absolute(thread.files[0].thumbnail , loader_url);
								}catch(e){
								}
								return null;
							})();
							if(data.image_url){
								var image = new Image();
								image.src = data.image_url;
								data.image = image;
							}
							data.ppd = (function(){
								var now = new Date();
								var old = new Date(data.date_new * 1000);
								var sub = now.getTime() - old.getTime();
								var ppd = 0;
								if(sub > 0){
									ppd = data.replies / (sub / 1000 / 60 / 60 / 24);
								}
								return ppd;
							})();

							index += 1;
						}

					}catch(e){
					}

					_ui_catalog.commit();
					complete({result:true});
				};

				// 失敗
				loader.onerror = function(){
					if(exit()) return;
					complete({result:false});
				};

				// テキストの読み込み
				loader.setMethod("GET");
				loader.setURL(loader_url);
				loader.loadText();
				break;

			case "reddit":
				var domain;
				var directory;
				var order;
				if(!domain){
					var m = _catalog_url.match(new RegExp("https://(www[.]reddit[.]com)/r/([^/]+)","i"));
					if(m){
						domain = m[1];
						directory = m[2];
					}
				}
				if(domain){
					var m = _catalog_url.match(new RegExp("reddit[.]com/r/[^/]+/(hot|new|rising|controversial|top)"));
					if(m){
						order = m[1];
					}

					var title = "https://" + domain + "/r/" + directory + "/";
					if(order) title += order + "/";
					_catalog_title.nodeValue = title;
				}else{
					complete({result:false});
					return;
				}

				var index = 0;
				var load_count = 0;
				var load_max = 10;
				var load_func = function (after){

					// ローダーオブジェクトを作成
					var loader = new Loader();

					// 成功
					loader.onload = function(str){
						if(exit()) return;
						try{
							var response = JsonParse(str);
							after = response.data.after;
							var children = 	response.data.children;
							var i;
							var num = children.length;
							for(i=0;i<num;i++){
								var thread = children[i].data;

								var item = _ui_catalog.createItem(thread.id);
								item.setURL("https://" + domain + thread.permalink);
								var data = item.getData();
								data.number = (index + 1);
								data.id = thread.id;
								data.title = thread.title;
								data.score = thread.score;
								data.comments = thread.num_comments;
								data.date_new = thread.created_utc;
								if(thread.thumbnail.indexOf("thumbs.redditmedia.com") >= 0){
									data.image_url = thread.thumbnail;
								}
								if(data.image_url){
									var image = new Image();
									image.src = data.image_url;
									data.image = image;
								}
								data.ppd = (function(){
									var now = new Date();
									var old = new Date(data.date_new * 1000);
									var sub = now.getTime() - old.getTime();
									var ppd = 0;
									if(sub > 0){
										ppd = data.comments / (sub / 1000 / 60 / 60 / 24);
									}
									return ppd;
								})();

								index += 1;
							}

						}catch(e){
						}

						_ui_catalog.commit();

						load_count ++;
						if((load_count < load_max) && after){
							load_func(after);
						}else{
							complete({result:true});
						}
					};

					// 失敗
					loader.onerror = function(){
						if(exit()) return;
						complete({result:false});
					};

					var loader_url = "https://" + domain + "/r/" + directory;
					if(order){
						loader_url += "/" + order;
					}
					loader_url += ".json?count=" + (index) + "&limit=100";
					if(after){
						loader_url += "&after=" + after;
					}

					// テキストの読み込み
					loader.setMethod("GET");
					loader.setURL(loader_url);
					loader.loadText();
				};
				load_func();


				break;
			default:
				complete({result:false});
				break;
			}
		}

		// -
		// スレッドリロードをクリック
		// -
		function clickThreadReload(e){
			_thread_iframe.src = _thread_url;
		}

		// -
		// 左スプリッタをクリック
		// -
		function clickSplitterLeft(e){
			openSplitterLeft(!(_splitter_left_open));
		}

		// -
		// 右スプリッタをクリック
		// -
		function clickSplitterRight(e){
			openSplitterBottom(false);
			openSplitterRight(!(_splitter_right_open));
		}

		// -
		// 下スプリッタをクリック
		// -
		function clickSplitterBottom(e){
			openSplitterRight(false);
			openSplitterBottom(!(_splitter_bottom_open));
		}

		// -
		// 左スプリッタ開閉
		// -
		function openSplitterLeft(open){
			_splitter_left_open = open;
			updateCategoryContainer();
			resize();
		}

		// -
		// 右スプリッタ開閉
		// -
		function openSplitterRight(open){
			_splitter_right_open = open;
			if(open && (_splitter_right_width <= 0)){
				var client_size = DocumentGetClientSize(document);
				var w = client_size.width - _splitter_left_width - 6 - 6;
				_splitter_right_width = w * (2/3);
				if(_splitter_right_width < 10) _splitter_right_width = 10;
			}
			updateThreadContainer();
			resize();
		}

		// -
		// 下スプリッタ開閉
		// -
		function openSplitterBottom(open){
			_splitter_bottom_open = open;
			if(open && (_splitter_bottom_width <= 0)){
				var client_size = DocumentGetClientSize(document);
				var h = client_size.height - 28 - 6;
				_splitter_bottom_width = h * (2/3);
				if(_splitter_bottom_width < 10) _splitter_bottom_width = 10;
			}
			updateThreadContainer();
			resize();
		}

		// -
		// コンパクトモードを取得
		// -
		function getCompactMode(){
			return _compact_mode;
		}

		// -
		// コンパクトモードの有無を設定
		// -
		_this.enableCompactMode = function (type){
			var update = (_compact_mode != type);
			_compact_mode = type;
			if(update){
				updateCompactMode();
				resize();
			}
		};

		// -
		// コンパクトモードの更新
		// -
		function updateCompactMode(){
			updateSplitterLeft();
			updateSplitterBottom();
			updateSplitterRight();
			updateMenuThread();

			if(_compact_mode){
				var category_enable = !Boolean(_category_container_disable);
				var catalog_enable = !Boolean(_catalog_container_disable);

				switch(_active_panel){
				case "category":
					category_enable = false;
					break;
				case "catalog":
					catalog_enable = false;
					break;
				}

				_button_menu_category.setDisabled(!category_enable);
				_button_menu_catalog.setDisabled(!catalog_enable);
				_button_menu_catalog.setVisible(true);
			}else{
				_button_menu_category.setDisabled(false);
				_button_menu_catalog.setDisabled(false);
				_button_menu_catalog.setVisible(false);
			}

			if(_compact_mode){
				visibleCategoryContainer(false);
				visibleCatalogContainer(false);
				visibleThreadContainer(false);
				switch(_active_panel){
				case "category":
					visibleCategoryContainer(true);
					break;
				case "catalog":
					visibleCatalogContainer(true);
					break;
				}
			}else{
				updateCategoryContainer();
				updateCatalogContainer();
				updateThreadContainer();
			}
		}

		// -
		// サイドバーモードの有無を設定
		// -
		_this.enableSidebarMode = function (type){
			var update = (_sidebar_mode != type);
			_sidebar_mode = type;
			if(update){
				updateSidebarMode();
			}
		};

		// -
		// サイドバーモードの更新
		// -
		function updateSidebarMode(){
			updateSplitterBottom();
			updateSplitterRight();
			updateMenuThread();
			_button_menu_sidebar_reload.setVisible(_sidebar_mode);
		}

		// -
		// 左スプリッタの更新
		// -
		function updateSplitterLeft(){
			visibleSplitterLeft(getVisibleSplitterLeft());
		}
		function getVisibleSplitterLeft(){
			if(_compact_mode) return false;
			return true;
		}
		function visibleSplitterLeft(type){
			_splitter_left.style.display = ((type) ? "block":"none");
		}

		// -
		// 下スプリッタの更新
		// -
		function updateSplitterBottom(){
			visibleSplitterBottom(getVisibleSplitterBottom());
		}
		function getVisibleSplitterBottom(){
			if(_compact_mode) return false;
			if(_sidebar_mode) return false;
			return true;
		}
		function visibleSplitterBottom(type){
			_splitter_bottom.style.display = ((type) ? "block":"none");
		}

		// -
		// 右スプリッタの更新
		// -
		function updateSplitterRight(){
			visibleSplitterRight(getVisibleSplitterRight());
		}
		function getVisibleSplitterRight(){
			if(_compact_mode) return false;
			if(_sidebar_mode) return false;
			return true;
		}
		function visibleSplitterRight(type){
			_splitter_right.style.display = ((type) ? "block":"none");
		}

		// -
		// ツールボタン
		// -
		function UI_ToolButton(parent){
			var _this = this;

			// -
			// 表示設定
			// -
			_this.setVisible = function(visible){
				var style = _button.style;
				if(visible){
					style.display = "inline-block";
				}else{
					style.display = "none";
				}
			};

			// -
			// 無効設定
			// -
			_this.setDisabled = function(disabled){
				_button.disabled = disabled;
				var style = _button.style;
				if(disabled){
					style.opacity = 0.5;
				}else{
					style.opacity = 1.0;
				}
			};

			// -
			// ラベルを編集
			// -
			_this.setLabel = function(value){
				_button.value = value;
			};

			// -
			// ラベルを編集
			// -
			_this.setImageURL = function(url){
				_image.src = url;
			};

			// -
			// ツールチップを編集
			// -
			_this.setTooltip = function(value){
				_button.title = value;
			};

			// -
			// クリックイベント
			// -
			_this.onclick = function(){};

			// -
			// プライベート変数
			// -
			var _button;
			var _label;
			var _image;

			// -
			// 初期化
			// -
			(function(){
				_button = DocumentCreateElement("button");
				ElementSetStyle(_button,"position:relative; width:24px; height:24px; vertical-align:top; padding:0px;");
				_button.onclick = clickMenuCategory;
				parent.appendChild(_button);

				_image = DocumentCreateElement("img");
				ElementSetStyle(_image,CSSTextGetInitialImageElement());
				ElementAddStyle(_image,"vertical-align:top; margin:0px auto; display:block; pointer-events:inherit;");
				_button.appendChild(_image);

				_label = DocumentCreateElement("div");
				ElementSetStyle(_label,"position:absolute; left:0px; top:0px; right:0px; bottom:0px; text-align:center;");
				_button.appendChild(_label);

				_button.onclick = function(e){
					if(_this.onclick){
						_this.onclick(e)
					}
				};
			})();
		}

		// -
		// ロード(内部用)
		// -
		function projectLoad(func){
			var proj = new PageExpandProject();

			// プロジェクトをロード
			proj.loadLocalStorage(function(e){

				// プロジェクトを更新
				page_expand_project = proj;
				project = new Project();
				project.importObjectForBackground(page_expand_project.getProject());
				func(e);
			});
		}

		// -
		// イベントを追加(内部用)
		// -
		function addEvent(){
			removeEvent();

			if(window.addEventListener){
				window.addEventListener("resize",resize,false);
			}else if(window.attachEvent){
				window.attachEvent("onresize",resize);
			}
		}

		// -
		// イベントを破棄(内部用)
		// -
		function removeEvent(){
			if(window.removeEventListener){
				window.removeEventListener("resize",resize,false);
			}else if(window.detachEvent){
				window.detachEvent("onresize",resize);
			}
		}

		// -
		// セットアップ
		// -
		_this.setURL = function(url){
			if(!url) return;

			var m = url.match(new RegExp("(http|https)://([^/]+)","i"));
			if(!m) return;

			var domain = m[2];
			var site;
			if(domain.match(new RegExp("open2ch[.]net$","i"))){
				site = "open2ch";
			}else if(domain.match(new RegExp("shitaraba[.]net$","i"))){
				site = "shitaraba";
			}else if(domain.match(new RegExp("(5ch[.]net)$","i"))){
				site = "5ch";
			}else if(domain.match(new RegExp("(bbspink[.]com|2ch[.]net)$","i"))){
				site = "2ch";
			}else if(domain.match(new RegExp("2chan[.]net$","i"))){
				site = "2chan";
			}else if(domain.match(new RegExp("4chan[.]org","i"))){
				site = "4chan";
			}else if(domain.match(new RegExp("8ch[.]net|8chan.co","i"))){
				site = "8chan";
			}else if(domain.match(new RegExp("2ch[.]hk","i"))){
				site = "2ch.hk";
			}else if(domain.match(new RegExp("reddit[.]com$","i"))){
				site = "reddit";
			}
			
			if(site){
				_this.setSite(site);
				_this.setCatalog(url);
			}else{
				_this.setSite("");
				_select_site.focus();
			}
		};

		// -
		// 初期化(内部用)
		// -
		function initialize(){

			var data_uri_category = "data:image/gif;base64,R0lGODlhEAAQAIAAAP///wAAACH5BAUUAAAALAAAAAAQABAAAAInRH6gy4bR4oORzWofbnRdy3nc1HWKaYhghoSb62mrmrJyvZWv0wIFADs=";
			var data_uri_catalog = "data:image/gif;base64,R0lGODlhEAAQAIAAAP///wAAACH5BAUUAAAALAAAAAAQABAAAAIhhI9pwe2+mEIh1rns27iDDV6NJ0pdGULelD4W+Z5auyoFADs=";
			var data_uri_thread = "data:image/gif;base64,R0lGODlhEAAQAIAAAP///wAAACH5BAUUAAAALAAAAAAQABAAAAIojI9pwO2+VACITvmsTft6/kRKp2XmYmai17Fp+G2a+zZiy6I1I/VGAQA7";
			var data_uri_layout = "data:image/gif;base64,R0lGODlhEAAQAIAAAAAAAP///yH5BAUUAAEALAAAAAAQABAAAAIrjI9pwBDt4Jru2Vsjna919lXKeEimh6UZp1lrCEvkfILyirOby3q1OEsUAAA7";
			var data_uri_reload = "data:image/gif;base64,R0lGODlhEAAQAIAAAP///wAAACH5BAUUAAAALAAAAAAQABAAAAIlhI+pyxD/UJDRQDdtptcymFUJGC5k2YzpuJlS02JmjG3dfK9MAQA7";

			// エレメントを全てクリア
			DomNodeRemoveChildren(document.head);
			DomNodeRemoveChildren(document.body);

			// ボディ
			var body = document.body;
			ElementSetStyle(body,'font-family:"Meiryo","sans-serif"; margin:0px; padding:0px; background-color:#ccc; overflow:hidden; user-select:none; -moz-user-select:none; -webkit-user-select:none;');

			// タイトル
			document.title = "BBS Board";

			// シャドウツリー
			var shadow_host = DocumentCreateElement("div");
			body.appendChild(shadow_host);
			var shadow_root;
			if(shadow_host.attachShadow){
				shadow_root = shadow_host.attachShadow({mode:"closed"});
			}else{
				shadow_root = shadow_host;
			}

			// メニュー
			var bbs_board_menu = DocumentCreateElement("div");
 			ElementSetStyle(bbs_board_menu,"position:absolute; top:0px; left:0px; right:0px; height:28px; color:#fff; background:#000;");
			shadow_root.appendChild(bbs_board_menu);

			// メニュー右
			var container_right = DocumentCreateElement("div");
 			ElementSetStyle(container_right,"position:absolute; right:4px; top:2px;");
			bbs_board_menu.appendChild(container_right);

				// リロードボタン
				_button_menu_sidebar_reload = new UI_ToolButton(container_right);
				_button_menu_sidebar_reload.setImageURL(data_uri_reload);
				_button_menu_sidebar_reload.setTooltip("reload");
				_button_menu_sidebar_reload.onclick = clickMenuSidebarReload;

			// メニュー左
			var container_left = DocumentCreateElement("div");
 			ElementSetStyle(container_left,"position:absolute; left:4px; top:2px;");
			bbs_board_menu.appendChild(container_left);

				// ドメイン選択
				_select_site = DocumentCreateElement("select");
				_select_site.size = 1;
				_select_site.onchange = changeSelectSite;
				ElementSetStyle(_select_site,"height:24px; box-sizing:border-box; vertical-align:top;");
				container_left.appendChild(_select_site);

					var option = DocumentCreateElement("option");
					ElementSetStyle(option,"color:#aaa;");
					ElementSetTextContent(option,"Select the site ...");
					option.value = "";
					_select_site.appendChild(option);

					var option = DocumentCreateElement("option");
					ElementSetTextContent(option,"2ch.net");
					option.value = "2ch";
					_select_site.appendChild(option);

					var option = DocumentCreateElement("option");
					ElementSetTextContent(option,"5ch.net");
					option.value = "5ch";
					_select_site.appendChild(option);

					var option = DocumentCreateElement("option");
					ElementSetTextContent(option,"5ch.net (PC)");
					option.value = "5ch_pc";
					_select_site.appendChild(option);

					var option = DocumentCreateElement("option");
					ElementSetTextContent(option,"open2ch.net");
					option.value = "open2ch";
					_select_site.appendChild(option);

					var option = DocumentCreateElement("option");
					ElementSetTextContent(option,"2chan.net");
					option.value = "2chan";
					_select_site.appendChild(option);

					var option = DocumentCreateElement("option");
					ElementSetTextContent(option,"4chan.org");
					option.value = "4chan";
					_select_site.appendChild(option);

					var option = DocumentCreateElement("option");
					ElementSetTextContent(option,"8ch.net");
					option.value = "8chan";
					_select_site.appendChild(option);

					var option = DocumentCreateElement("option");
					ElementSetTextContent(option,"2ch.hk");
					option.value = "2ch.hk";
					_select_site.appendChild(option);

				// カテゴリボタン
				_button_menu_category = new UI_ToolButton(container_left);
				_button_menu_category.setImageURL(data_uri_category);
				_button_menu_category.setTooltip("category");
				_button_menu_category.onclick = clickMenuCategory;

				// カタログボタン
				_button_menu_catalog = new UI_ToolButton(container_left);
				_button_menu_catalog.setImageURL(data_uri_catalog);
				_button_menu_catalog.setTooltip("catalog");
				_button_menu_catalog.onclick = clickMenuCatalog;

				// スレッドボタン
				_button_menu_thread = new UI_ToolButton(container_left);
				_button_menu_thread.setImageURL(data_uri_thread);
				_button_menu_thread.setTooltip("thread");
				_button_menu_thread.onclick = clickMenuThread;

			// コンテナ
			_bbs_board_container = DocumentCreateElement("div");
 			ElementSetStyle(_bbs_board_container,"position:absolute; top:28px; left:0px; right:0px; bottom:0px;");
			shadow_root.appendChild(_bbs_board_container);

 			// スプリッタ左
			_splitter_left = DocumentCreateElement("div");
 			ElementSetStyle(_splitter_left,"position:absolute; width:2px; top:0px; bottom:0px; border-left:2px #fff solid; border-right:2px #666 solid; cursor:col-resize;");
			_bbs_board_container.appendChild(_splitter_left);

 			// スプリッタ右
			_splitter_right = DocumentCreateElement("div");
 			ElementSetStyle(_splitter_right,"position:absolute; width:2px; top:0px; bottom:0px; border-left:2px #fff solid; border-right:2px #666 solid; cursor:col-resize;");
			_bbs_board_container.appendChild(_splitter_right);

 			// スプリッタ下
			_splitter_bottom = DocumentCreateElement("div");
 			ElementSetStyle(_splitter_bottom,"position:absolute; height:2px; bottom:0px; border-top:2px #fff solid; border-bottom:2px #666 solid; cursor:row-resize;");
			_bbs_board_container.appendChild(_splitter_bottom);

				(function(){
					
					function f(info){
						var task;
						var old_pos;
						var dragging = false;
						var element = info.splitter;

						element.onmousedown = function(e){
							if(task) task.release();

							input_mouse.setMouseEvent(e);
							old_pos = input_mouse.getPositionClient();

							task = task_container.createTask();
							task.setDestructorFunc(function(){
								dragging = false;
								task = null;	
							});
							task.setExecuteFunc(function(){
								if(!dragging){
									var mouse_pos = input_mouse.getPositionClient();
									var vec_x = mouse_pos.x - old_pos.x;
									var vec_y = mouse_pos.y - old_pos.y;
									if(Math.sqrt(vec_x * vec_x + vec_y * vec_y) >= 3.0){
										dragging = true;
										_thread_cover.style.display = "block";
										info.ondragstart();
									}
								}

								if(dragging){
									info.ondrag();
									resize();
								}

								if(!(input_mouse.getButtonLeft())){
									if(dragging){
										_thread_cover.style.display = "none";
										info.ondragend();
									}
									task.release();
									return;
								}
							});
						};

						element.onclick = function(e){
							if(dragging) return;
							info.onclick(e);
						};
					}
					
					f({
						splitter:_splitter_left,
						onclick:clickSplitterLeft,
						ondragstart:function(){
							openSplitterLeft(true);
						},
						ondrag:function(){
							var mouse_pos = input_mouse.getPositionClient();
							_splitter_left_width = mouse_pos.x - 3;
						},
						ondragend:function(){
							if(_splitter_left_width < 10){
								_splitter_left_width = 10;
								openSplitterLeft(false);
							}
						}
					});

					f({
						splitter:_splitter_right,
						onclick:clickSplitterRight,
						ondragstart:function(){
							openSplitterBottom(false);
							openSplitterRight(true);
						},
						ondrag:function(){
							var client_size = DocumentGetClientSize(document);
							var mouse_pos = input_mouse.getPositionClient();
							_splitter_right_width = client_size.width - mouse_pos.x - 3;
						},
						ondragend:function(){
							if(_splitter_right_width < 10){
								_splitter_right_width = 10;
								openSplitterRight(false);
							}
						}
					});

					f({
						splitter:_splitter_bottom,
						onclick:clickSplitterBottom,
						ondragstart:function(){
							openSplitterRight(false);
							openSplitterBottom(true);
						},
						ondrag:function(){
							var client_size = DocumentGetClientSize(document);
							var mouse_pos = input_mouse.getPositionClient();
							_splitter_bottom_width = client_size.height - mouse_pos.y - 3;
						},
						ondragend:function(){
							if(_splitter_bottom_width < 10){
								_splitter_bottom_width = 10;
								openSplitterBottom(false);
							}
						}
					});
				})();

			// カテゴリコンテナ
			_category_container = DocumentCreateElement("div");
 			ElementSetStyle(_category_container,"position:absolute; left:0px; top:0px; bottom:0px; overflow:hidden;");
			_bbs_board_container.appendChild(_category_container);

			// カタログコンテナ
			_catalog_container = DocumentCreateElement("div");
 			ElementSetStyle(_catalog_container,"position:absolute; top:0px; overflow:hidden;");
			_bbs_board_container.appendChild(_catalog_container);

			// スレッドコンテナ
			_thread_container = DocumentCreateElement("div");
 			ElementSetStyle(_thread_container,"position:absolute; top:0px; overflow:hidden;");
			_bbs_board_container.appendChild(_thread_container);

 			// カテゴリメニュー
			var category_menu = DocumentCreateElement("div");
 			ElementSetStyle(category_menu,"position:absolute; left:0px; top:0px; right:0px; height:28px; background:#444;");
			_category_container.appendChild(category_menu);

				// メニュー左
				var container_left = DocumentCreateElement("div");
				ElementSetStyle(container_left,"position:absolute; left:8px; top:2px; right:56px;");
				category_menu.appendChild(container_left);

				// メニュー右
				var container_right = DocumentCreateElement("div");
				ElementSetStyle(container_right,"position:absolute; right:4px; top:2px;");
				category_menu.appendChild(container_right);

				// カテゴリタイトル
				var category_title = DocumentCreateElement("div");
				ElementSetStyle(category_title,"color:#fff; font-size:14px; padding-top:1px; width:100%; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;");
				container_left.appendChild(category_title);
				_category_title = document.createTextNode("");
				_category_title.nodeValue = "Category Panel";
				category_title.appendChild(_category_title);

				// レイアウトボタン
				_button_category_layout = new UI_ToolButton(container_right);
				_button_category_layout.setImageURL(data_uri_layout);
				_button_category_layout.setTooltip("layout");
				_button_category_layout.onclick = clickCategoryLayout;

				// リロードボタン
				_button_category_reload = new UI_ToolButton(container_right);
				_button_category_reload.setImageURL(data_uri_reload);
				_button_category_reload.setTooltip("reload");
				_button_category_reload.onclick = clickCategoryReload;

 			// カテゴリボディ
			var category_body = DocumentCreateElement("div");
 			ElementSetStyle(category_body,"position:absolute; left:0px; top:28px; right:0px; bottom:0px;");
			_category_container.appendChild(category_body);

				// カテゴリ
				_ui_category = new BbsBoardCategory(category_body);
				_ui_category.onselect = function(e){
					if(e.button == 1) return;
					var selected_item = _ui_category.getSelectedItem();

					disableCatalogContainer(false);
					_active_panel = "catalog";
					updateCompactMode();
					_catalog_url = selected_item.getURL();
					_ui_catalog.clearItem();
					updateCatalogReload();

					return false;
				};
				updateCategoryLayout();

  			// カタログメニュー
			var catalog_menu = DocumentCreateElement("div");
 			ElementSetStyle(catalog_menu,"position:absolute; left:0px; top:0px; right:0px; height:28px; background:#444;");
			_catalog_container.appendChild(catalog_menu);

				// メニュー左
				var container_left = DocumentCreateElement("div");
				ElementSetStyle(container_left,"position:absolute; left:8px; top:2px; right:56px;");
				catalog_menu.appendChild(container_left);

				// メニュー右
				var container_right = DocumentCreateElement("div");
				ElementSetStyle(container_right,"position:absolute; right:4px; top:2px;");
				catalog_menu.appendChild(container_right);

				// タイトル
				var catalog_title = DocumentCreateElement("div");
				ElementSetStyle(catalog_title,"color:#fff; font-size:14px; padding-top:1px; width:100%; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;");
				container_left.appendChild(catalog_title);
				_catalog_title = document.createTextNode("");
				_catalog_title.nodeValue = "Catalog Panel";
				catalog_title.appendChild(_catalog_title);

				// レイアウトボタン
				_button_catalog_layout = new UI_ToolButton(container_right);
				_button_catalog_layout.setImageURL(data_uri_layout);
				_button_catalog_layout.setTooltip("layout");
				_button_catalog_layout.onclick = clickCatalogLayout;

				// 更新ボタン
				_button_catalog_reload = new UI_ToolButton(container_right);
				_button_catalog_reload.setImageURL(data_uri_reload);
				_button_catalog_reload.setTooltip("reload");
				_button_catalog_reload.onclick = clickCatalogReload;

 			// カタログボディ
			var catalog_body = DocumentCreateElement("div");
 			ElementSetStyle(catalog_body,"position:absolute; left:0px; top:28px; right:0px; bottom:0px;");
			_catalog_container.appendChild(catalog_body);

				// カタログ
				_ui_catalog = new BbsBoardCatalog(catalog_body);
				_ui_catalog.onselect = function(e){
					if(e.button == 1) return;
					disableThreadContainer(false);
					if(getVisibleThreadContainer()){
						var selected_item = _ui_catalog.getSelectedItem();
						_this.setThread(selected_item.getURL());
						return false;
					}
				};

  			// スレッドメニュー
			var thread_menu = DocumentCreateElement("div");
 			ElementSetStyle(thread_menu,"position:absolute; left:0px; top:0px; right:0px; height:28px; background:#444;");
			_thread_container.appendChild(thread_menu);

				// メニュー左
				var container_left = DocumentCreateElement("div");
				ElementSetStyle(container_left,"position:absolute; left:8px; top:2px; right:40px;");
				thread_menu.appendChild(container_left);

				// メニュー右
				var container_right = DocumentCreateElement("div");
				ElementSetStyle(container_right,"position:absolute; right:4px; top:2px;");
				thread_menu.appendChild(container_right);

				// スレッドタイトル
				var thread_title = DocumentCreateElement("div");
				ElementSetStyle(thread_title,"color:#fff; font-size:14px; padding-top:1px; width:100%; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;");
				container_left.appendChild(thread_title);
				_thread_title = document.createTextNode("");
				_thread_title.nodeValue = "Thread Panel";
				thread_title.appendChild(_thread_title);

				// 更新ボタン
				_button_thread_reload = new UI_ToolButton(container_right);
				_button_thread_reload.setImageURL(data_uri_reload);
				_button_thread_reload.setTooltip("reload");
				_button_thread_reload.onclick = clickThreadReload;

 			// スレッドボディ
			var thread_body = DocumentCreateElement("div");
 			ElementSetStyle(thread_body,"position:absolute; left:0px; top:28px; right:0px; bottom:0px;");
			_thread_container.appendChild(thread_body);

				// スレッドフレーム
				_thread_iframe = DocumentCreateElement("iframe");
				_thread_iframe.name = "thread";
				_thread_iframe.frameBorder = "0";
				_thread_iframe.allowFullscreen = true;
				ElementSetStyle(_thread_iframe,"position:absolute; display:block; background:#fff; left:0px; top:0px; width:100%; height:100%;");
				thread_body.appendChild(_thread_iframe);

				// カバー
				_thread_cover = DocumentCreateElement("div");
				ElementSetStyle(_thread_cover,"position:absolute; display:none; background:#000; opacity:0.2; left:0px; top:0px; right:0px; bottom:0px;");
				thread_body.appendChild(_thread_cover);

			updateCompactMode();
			updateSidebarMode();
			disableCategoryContainer(true);
			disableCatalogContainer(true);
			disableThreadContainer(true);
			addEvent();

			_splitter_left_width = 200;
			_splitter_right_width = 0;
			_splitter_bottom_width = 0;

			resize();
		}

		// -
		// 初期化関数
		// -
		_this.initialize = function(func){
			var info = {
				result:false
			};

			// フレームは動作させない
			if (WindowIsChild(window)){
				func(info);
				return;
			}

			// BODY が存在しない
			var body = document.body;
			if(!body){
				func(info);
				return;
			}

			// プロジェクト読み込み
			projectLoad(function(e){
				// ロケール
				_i18n = new InternationalMessage(page_expand_project.getLanguage());

				// 設定
				execute_queue.setOccupancyTime(project.getExecuteQueueOccupancyTime());
				execute_queue.setSleepTime(project.getExecuteQueueSleepTime());

				initialize();

				info.result = true;
				func(info);
			});

		};

		// -
		// プライベート変数
		// -
		var _i18n;
		var _bbs_board_container;
		var _category_container;
		var _catalog_container;
		var _thread_container;
		var _splitter_left;
		var _splitter_right;
		var _splitter_bottom;
		var _category_title;
		var _catalog_title;
		var _thread_title;
		var _thread_iframe;
		var _thread_cover;
		var _catalog_url;
		var _thread_url;
		var _select_site;
		var _button_menu_category;
		var _button_menu_catalog;
		var _button_menu_thread;
		var _button_menu_sidebar_reload;
		var _button_category_layout;
		var _button_category_reload;
		var _button_catalog_layout;
		var _button_catalog_reload;
		var _button_thread_reload;
		var _ui_category;
		var _ui_catalog;

		var _splitter_left_width = 0;
		var _splitter_right_width = 0;
		var _splitter_bottom_width = 0;
		var _splitter_left_open = false;
		var _splitter_right_open = false;
		var _splitter_bottom_open = false;
		var _category_container_disable = false;
		var _catalog_container_disable = false;
		var _thread_container_disable = false;
		var _compact_mode = false;
		var _sidebar_mode = false;
		var _active_panel = "";

		var _category_layout_mode = 0;
		var _catalog_layout_mode = 0;
		var _current_site = "";

		var _category_modify_count = 0;
		var _catalog_modify_count = 0;

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


		})();
	}

	// -
	// カテゴリ
	// -
	function BbsBoardCategory(parent){
		var _this = this;

 		// -
		// フォルダを作成
		// -
		_this.createFolder = function (key){
		   var _folder = new Object();

			// -
			// フォルダを作成
			// -
			_folder.createItem = function (key){
				var _item = new Object();

				// -
				// ラベルを設定
				// -
				_item.setLabel = function (label){
					_anchor_text.nodeValue = label;
				};

				// -
				// ツールチップを設定
				// -
				_item.setTooltip = function (label){
					_anchor.title = label;
				};

				// -
				// アドレスを取得
				// -
				_item.getURL = function (){
					return _anchor.href;
				};

				// -
				// アドレスを設定
				// -
				_item.setURL = function (url){
					_anchor.href = url;
				};

				// -
				// クリック
				// -
				function click(e){					
					_selected_item = _item
					if(_this.onselect){
						return _this.onselect(e);
					}
				}

				// -
				// プライベート変数
				// -
				var _anchor;
				var _anchor_text;
				var _separator;

				// -
				// 初期化
				// -
				(function(){
					_item_dictionary[key] = _item;

					_anchor = DocumentCreateElement("a");
					ElementSetStyle(_anchor,"");
					_anchor.className = "category_item";
					_anchor.title = key;
					_anchor.target = "_blank";
					_anchor.onclick = click;
					_folder_child.appendChild(_anchor);
					_anchor_text = document.createTextNode("");
					_anchor.appendChild(_anchor_text);

					_separator = DocumentCreateElement("div");
					_separator.className = "category_item_separator";
					_folder_child.appendChild(_separator);
					ElementSetTextContent(_separator,"/");
				})();

				return _item;
			};

			// -
			// ラベルを設定
			// -
			_folder.setLabel = function (label){
				_label_text.nodeValue = label;
			};

			// -
			// 開閉を設定
			// -
			_folder.setOpen = function (type){
				_open_child = Boolean(type);
				if(_open_child){
					_icon_text.nodeValue = "-";
					var style = _folder_child.style;
					style.height = "auto";
					style.paddingBottom = "10px";
				}else{
					_icon_text.nodeValue = "+";
					var style = _folder_child.style;
					style.height = "0px";
					style.paddingBottom = "0px";
				}
			};

			// -
			// ボディ部をクリック
			// -
			function clickBody(){
				_folder.setOpen(!(_open_child));
			}

			// -
			// プライベート変数
			// -
			var _folder_container;
			var _icon;
			var _icon_text;
			var _label;
			var _label_text;
			var _folder_body;
			var _folder_child;
			var _open_child;
			var _item_dictionary;

			// -
			// 初期化
			// -
			(function(){
				_folder_dictionary[key] = _folder;
				_item_dictionary = new Object();

				_folder_container = DocumentCreateElement("div");
				ElementSetStyle(_folder_container,"position:relative; margin:2px; margin-bottom:2px; padding:1px;");
				_category_container.appendChild(_folder_container);

			   _folder_body = DocumentCreateElement("div");
				_folder_body.className = "category_folder";
				_folder_body.onclick = clickBody;
				_folder_container.appendChild(_folder_body);

				_icon = DocumentCreateElement("div");
				ElementSetStyle(_icon,"display:inline-block; width:20px; text-align:center;");
				_folder_body.appendChild(_icon);
				_icon_text = document.createTextNode("");
				_icon.appendChild(_icon_text);

				_label = DocumentCreateElement("span");
				ElementSetStyle(_label,"");
				_folder_body.appendChild(_label);
				_label_text = document.createTextNode("");
				_label.appendChild(_label_text);

				_folder_child = DocumentCreateElement("div");
				ElementSetStyle(_folder_child,"margin-left:10px; overflow:hidden; line-height:16px; font-size:14px;");
				_folder_container.appendChild(_folder_child);

				_folder.setOpen(_open_mode);
			})();

			return _folder;
		};

		// -
		// フォルダを取得
		// -
		_this.getFolder = function (key){
		   return _folder_dictionary[key] || null;
		};

		// -
		// レイアウトモードを設定
		// -
		_this.setLayoutMode = function (type){
			var style;
			switch(type){
			case "inline":
				style = _style_item.style;
				style.display = "inline-block";
				style.width = "auto";
				style.whiteSpace = "normal";
				style.overflow = "visible";
				style.wordBreak = "break-all";
				style.wordWrap = "break-word";
				style = _style_item_separator.style;
				style.display = "inline";
				break;
			case "block":
				style = _style_item.style;
				style.display = "block";
				style.width = "100%";
				style.whiteSpace = "nowrap";
				style.overflow = "hidden";
				style.wordBreak = "normal";
				style.wordWrap = "normal";
				style = _style_item_separator.style;
				style.display = "none";
				break;
			}
		};

		// -
		// 開閉モードを設定
		// -
		_this.setOpenMode = function (type){
			_open_mode = type;

			var key;
			var folder;
			for(key in _folder_dictionary){
				folder = _folder_dictionary[key];
				folder.setOpen(type);
			}
		};

		// -
		// クリア
		// -
		_this.clear = function (){
			_folder_dictionary = new Object();
			DomNodeRemoveChildren(_category_container);
		};

		// -
		// 選択したアイテムを取得
		// -
		_this.getSelectedItem = function (){
			return _selected_item;
		};

		// -
		// 選択イベント
		// -
		_this.onselect = function (item){};

		// -
		// プライベート変数
		// -
		var _category_container;
		var _style_item;
		var _style_item_separator;
		var _open_mode;
		var _folder_dictionary;

		// -
		// 初期化
		// -
		(function(){
			_folder_dictionary = new Object();

			_category_container = DocumentCreateElement("div");
			ElementSetStyle(_category_container,"position:absolute; left:0px; top:0px; right:0px; bottom:0px; overflow-y:scroll; background:#fff;");
			parent.appendChild(_category_container);

			var category_style = DocumentCreateElement("style");
			parent.appendChild(category_style);

			var style_sheet = ElementGetStyleSheet(category_style);
			CSSStyleSheetInsertRule(style_sheet,".category_folder","margin-left:0px; font-size:14px; color:#000; background:#e8e8e8; border-radius:4px; cursor:pointer; padding:2px; user-select:none; -moz-user-select:none; -webkit-user-select:none;",0);
			CSSStyleSheetInsertRule(style_sheet,".category_folder:hover","color:#fff; background:#4281F4;",1);
			CSSStyleSheetInsertRule(style_sheet,".category_item","text-overflow:ellipsis;",2);
			CSSStyleSheetInsertRule(style_sheet,".category_item:hover","background-color:rgba(192,255,160,0.3);",3);
			CSSStyleSheetInsertRule(style_sheet,".category_item_separator","font-size:14px; color:ccc; margin-left:2px; margin-right:2px;",4);

			var rule_list = CSSStyleSheetGetCSSRuleList(style_sheet);
			_style_item = rule_list[2];
			_style_item_separator = rule_list[4];

			_this.setLayoutMode("block");
		})();
	}

	// -
	// カタログ
	// -
	function BbsBoardCatalog(parent){
		var _this = this;

		// -
		// カラムを作成
		// -
		_this.createColumn = function (key){
			var _column = _column_dictionary[key];
			if(_column) return _column;
			return createColumn(key);
		};

		function createColumn(key){
			var _column = new Object();

			// -
			// ラベルを設定
			// -
			_column.setLabel = function (label){
				_text.nodeValue = label;
			};

			// -
			// ラベルを設定
			// -
			_column.setTextAlign = function (str){
				_column.text_align = str;
			};

			// -
			// 最小幅を設定
			// -
			_column.setWidthMin = function (value){
				_column.width_min = value;
			};

			// -
			// 最大幅を設定
			// -
			_column.setWidthMax = function (value){
				_column.width_max = value;
			};

			// -
			// 最大幅を設定
			// -
			_column.setWidth = function (value){
				_column.width = value;
				_column.width_auto = false;
			};

			// -
			// ソートアイコンを変更
			// -
			_column.setSortIcon = function (type){
				var style = _block.style;
				switch(type){
				case "up":
					style.backgroundImage = "url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAOAgMAAABvOLUFAAAAA3NCSVQICAjb4U/gAAAACVBMVEX////o6Ojo6OgQrkfNAAAAA3RSTlMARP9DYaFSAAAACXBIWXMAAAsSAAALEgHS3X78AAAAFnRFWHRDcmVhdGlvbiBUaW1lADEyLzMwLzE1azlJyQAAACF0RVh0U29mdHdhcmUATWFjcm9tZWRpYSBGaXJld29ya3MgNC4w6iYndQAAAB5JREFUeJxj4GBgACItMFrVAEIQEOoAQqIMIMQCQgBf3AQV/YKvewAAAABJRU5ErkJggg==)";
					break;
				case "down":
					style.backgroundImage = "url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAOAgMAAABvOLUFAAAAA3NCSVQICAjb4U/gAAAACVBMVEX////o6Ojo6OgQrkfNAAAAA3RSTlMARP9DYaFSAAAACXBIWXMAAAsSAAALEgHS3X78AAAAFnRFWHRDcmVhdGlvbiBUaW1lADEyLzMwLzE1azlJyQAAACF0RVh0U29mdHdhcmUATWFjcm9tZWRpYSBGaXJld29ya3MgNC4w6iYndQAAAB5JREFUeJxjYGFgACJRMAp1ACEIWNUAQloMIMQBQgBM1AQV4OptKwAAAABJRU5ErkJggg==)";
					break;
				default:
					style.backgroundImage = "none";
					break;
				}
				switch(type){
				case "up":
				case "down":
					break;
				default:
					break;
				}
			};

			// -
			// プライベート変数
			// -
			var _container;
			var _block;
			var _text;

			// -
			// 初期化
			// -
			(function(){
				_column.key = key;
				_column_dictionary[key] = _column;

				var index = _column_list.length;
				_column_list.push(_column);

				_column.text_align = "left";
				_column.width = 0;
				_column.width_min = 0;
				_column.width_max = 65535;
				_column.width_auto = true;
				_column.index = index;

				_container = DocumentCreateElement("div");
				ElementSetStyle(_container,"position:relative; display:inline-block; vertical-align:top; height:24px;");
				_container.className = "catalog_column_" + (index);
				_container.draggable = true;
				_container.ondragstart = function (e){					
					var cancel = (function(){
						if(_column_dragging_border) return true;
						if(_column_hover_place != "center") return true;
						return false;
					})();
					if(cancel) return false;

					var data_transfer = e.dataTransfer;
					data_transfer.setData("text",key);
				};
				_table_column.appendChild(_container);

				_block = DocumentCreateElement("div");
				_block.className = "catalog_column";
				_container.appendChild(_block);

				_text = document.createTextNode("");
				_block.appendChild(_text);

				var rule_list = CSSStyleSheetGetCSSRuleList(_style_column_list);
				if(!(rule_list[index])){
					CSSStyleSheetInsertRule(_style_column_list , ".catalog_column_" + index , "width:200px;" , index);
				}

				_column.element = _container;
				_column.setSortIcon("");
			})();

			return _column;
		}

		// -
		// アイテムを作成
		// -
		_this.createItem = function (key){
			var _item = _item_dictionary[key];
			if(_item) return _item;
			return createItem(key);
		};

		function createItem(key){
			var _item = new Object();

			// -
			// データオブジェクトを取得
			// -
			_item.getData = function (){
				return _item.data;
			};

			// -
			// アドレスを取得
			// -
			_item.getURL = function (){
				return _anchor.href;
			};

			// -
			// アドレスをセット
			// -
			_item.setURL = function (url){
				_anchor.href = url;
			};

			// -
			// コミット
			// -
			_item.commit = function (){
				sort();
				updateItem(_item);
			};

			// -
			// ソート
			// -
			function sort(index){
				var descending;
				var index = _item.index;
				var value = _item_list[index].data[_sort_key];
				var num = _item_list.length;

				if(index+1 >= num){
					descending = true;
				}else if(0 > compareValue(value,_item_list[index+1].data[_sort_key])){
					descending = true;
				}else if(index <= 0){
					descending = false;
				}else if(0 > compareValue(_item_list[index-1].data[_sort_key],value)){
					descending = false;
				}else{
					return;
				}

				if(descending){
					var p = index;
					var n = 1;
					while(p >= n){
						if(0 > compareValue(_item_list[p-1].data[_sort_key],value)){
							break;
						}
						p--;
					}
					if(index != p){
						move(p);
					}
				}else{
					var p = index + 1;
					var n = num;
					while(p < n){
						if(0 > compareValue(value,_item_list[p].data[_sort_key])){
							break;
						}
						p++;
					}
					if(index != p){
						move(p);
					}
				}
			}

			// -
			// 移動
			// -
			function move(index){
				var i = index;
				var j = _item.index;
				var num = _item_list.length;

				var ref;
				if(_item_list[i]){
					ref = _item_list[i].element;
				}
				if(i < j){
					_item_list.splice(j,1);
					var a0 = _item_list.slice(0,i);
					var a1 = _item_list.slice(i);
					_item_list = a0.concat([_item],a1);
					for(;i<num;i++){
						_item_list[i].index = i;
					}
				}else{
					var a0 = _item_list.slice(0,i);
					a0.splice(j,1);
					var a1 = _item_list.slice(i);
					_item_list = a0.concat([_item],a1);
					for(;j<num;j++){
						_item_list[j].index = j;
					}
				}
				var element = _item.element;
				_table_body.insertBefore(element , ref);
			}

			// -
			// クリック
			// -
			function click(e){
				_selected_item = _item
				if(_this.onselect){
					return _this.onselect(e);
				}
			}

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

			// -
			// 初期化
			// -
			(function(){
				_item.key = key;
				_item_dictionary[key] = _item;
				_item.renderer = new Object();

				var index = _item_list.length;
				_item_list.push(_item);
				_item.index = index;

				_item.data = new Object();

				_anchor = DocumentCreateElement("a");
				_anchor.className = "catalog_item";
				_anchor.target = "_blank";
				_anchor.onclick = click;
				_table_body.appendChild(_anchor);
				_item.element = _anchor;
			})();

			return _item;
		};

		// -
		// 更新
		// -
		_this.update = function (){
			_modify_count += 1;
			var modify = _modify_count;
			var p = 0;
			var f = function (){
				if(modify != _modify_count) return;
				var item = _item_list[p];
				p++;
				if(!item) return;
				updateItem(item);
				execute_queue.attachFirst(f,null);
			};
			execute_queue.attachLast(f,null);
		}

		// -
		// コミット
		// -
		_this.commit = function (){
			_this.sort();
			_this.update();
		}

		// -
		// アイテムリストを取得
		// -
		_this.getItemList = function (){
			return _item_list.slice(0);
		}

		// -
		// アイテム更新
		// -
		function updateItem(item){
			var data = item.getData();
			var renderer = item.renderer;

			if(renderer.layout_mode != _layout_mode){

				DomNodeRemoveChildren(item.element);

				renderer.update_list = new Array();
				renderer.layout_mode = _layout_mode;

				switch(_layout_mode){
				case "detail":
					var parent = item.element;

					var i;
					var num = _column_list.length;
					for(i=0;i<num;i++){
						var column = _column_list[i];
						var cell0 = DocumentCreateElement("div");
						cell0.className = "catalog_column_" + (i);
						cell0.style.cssText = "display:inline-block; vertical-align:top;";
						parent.appendChild(cell0);

						var cell1 = DocumentCreateElement("div");
						cell1.style.cssText = "left:0px; right:0px; top:0px; bottom:0px; padding:4px; padding-top:1px; padding-bottom:1px; border-bottom:1px #eee solid; border-right:1px #ddd solid; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;";
						cell1.style.textAlign = column.text_align;
						cell0.appendChild(cell1);

						var info = new Object();
						info.item = item;
						info.data = data;
						info.layout_mode = _layout_mode;
						info.parent = cell1;
						info.onupdate = null;
						info.column = column;
						info.key = column.key;
						_this.onUpdateCell(info);
						if(info.onupdate) renderer.update_list.push(info.onupdate);
					}
					break;

				default:
					var info = new Object();
					info.item = item;
					info.data = data;
					info.layout_mode = _layout_mode;
					info.parent = item.element;
					info.onupdate = null;
					_this.onUpdateItem(info);
					if(info.onupdate) renderer.update_list.push(info.onupdate);
					break;
				}
			}

			var list = renderer.update_list;
			var i;
			var num = list.length;
			for(i=0;i<num;i++){
				list[i]();
			}
		}

		// -
		// 比較
		// -
		function compareValue(v0,v1){
			var compare;
			if(isNaN(v0) || isNaN(v1)){
				compare = String(v0).localeCompare(v1);
			}else{
				compare = (Number(v0) - Number(v1));
			}
			if(_sort_descending) return compare * -1;
			return compare;
		}

		// -
		// リサイズ
		// -
		_this.resize = function (){

			switch(_layout_mode){
			case "detail":
				var resize_rect = ElementGetBoundingClientRect(_table_column);
				var rule_list = CSSStyleSheetGetCSSRuleList(_style_column_list);
				var column_width = resize_rect.right - resize_rect.left;

				var list = new Array();
				var i,j;
				var num = _column_list.length;
				if(num){
					var width = column_width;
					var count = 0;
					for(i=0;i<num;i++){
						var column = _column_list[i];
						var item = {
							index:i,
							auto:column.width_auto
						};
						if(item.auto){
							width -= column.width_min;
							item.value = item.min = column.width_min;
							item.max = column.width_max;
							count += 1;
						}else{
							width -= column.width;
							item.value = item.min = item.max = column.width;
						}
						for(j=0;j<i;j++){
							if(list[j].max > item.max) break;
						}
						list.splice(j,0,item);
					}

					if(width > 0){
						if(count) width /= count;

						for(i=0;i<num;i++){
							var item = list[i];
							if(!(item.auto)) continue;
							count -= 1;

							var sub = (item.min + width) - item.max;
							if(sub > 0){
								if(count) width = (width * count + sub) / count;
								item.value = item.max;
							}else{
								item.value += width;
							}
						}
					}

					var container_width = 0;
					for(i=0;i<num;i++){
						var item = list[i];
						var style = rule_list[item.index].style;
						style.width = (item.value) + "px";
						container_width += item.value;
					}

					if(container_width < column_width){
						container_width = column_width;
					}
					var style = _style_item_container.style;
					style.width = (container_width) + "px";
				}

				break;

			case "large_icon":
				var resize_rect = ElementGetBoundingClientRect(_table_body);
				var width = resize_rect.right - resize_rect.left - 1.0;
				width -= _table_body.offsetWidth - (_table_body.clientWidth + _table_body.clientLeft);
				width -= 4;
				var style_w = 2 + 2;
				var num = Math.floor(width / _block_size.width);
				var add = (width - (_block_size.width * num)) / num;

				var style = _style_item_container.style;
				style.width = (_block_size.width + add - style_w) + "px";

			default:
				var style = _style_item_container.style;
				style.width = "audo";
				break;
			}

		};

		// -
		// レイアウトモードを設定
		// -
		_this.setLayoutMode = function (type){
			_layout_mode = type;
			var style;
			switch(_layout_mode){
			case "detail":
				style = _style_item_container.style;
				style.display = "block";
				style.margin  = "0px";
				style.width = "auto";
				style.height = "auto";
				style.minHeight = "0";
				style.whiteSpace = "nowrap";
				style.border = "hidden";

				style = _table_body.style;
				style.padding = "0px";
				style.lineHeight = "1.0";
				break;
			case "list":
				style = _style_item_container.style;
				style.display = "block";
				style.margin  = "0px";
				style.marginBottom  = "2px";
				style.width = "auto";
				style.height = "auto";
				style.minHeight = "0";
				style.whiteSpace = "normal";
				style.border = "1px solid #ddd";

				style = _table_body.style;
				style.padding = "4px";
				style.lineHeight = "13px";
				break;
			case "large_icon":
				style = _style_item_container.style;
				style.display = "inline-block";
				style.margin  = "0px";
				style.marginRight = "2px";
				style.marginBottom = "2px";
				style.width = (_block_size.width) + "px";
				style.height = "auto";
				style.minHeight = (_block_size.height) + "px";
				style.whiteSpace = "normal";
				style.border = "1px solid #ddd";

				style = _table_body.style;
				style.padding = "0px";
				style.paddingLeft = "4px";
				style.paddingTop = "4px";
				style.lineHeight = "13px";

				break;
			case "small_icon":
				style = _style_item_container.style;
				style.display = "inline";
				style.margin  = "0px";
				style.marginRight = "8px";
				style.width = "auto";
				style.height = "auto";
				style.minHeight = "0";
				style.whiteSpace = "normal";
				style.border = "hidden";

				style = _table_body.style;
				style.padding = "4px";
				style.lineHeight = "14px";
				break;
			}

			switch(type){
			case "detail":
				style = _table_column.style;
				style.display = "block";
				style = _table_body.style;
				style.top = "24px";
				break;
			default:
				style = _table_column.style;
				style.display = "none";
				style = _table_body.style;
				style.top = "0px";
				break;
			}

			switch(type){
			case "small_icon":
				StyleDeclarationRemoveProperty(_style_item_even.style,"background-color");
				StyleDeclarationRemoveProperty(_style_item_odd.style,"background-color");
				break;
			default:
				StyleDeclarationSetProperty(_style_item_even.style,"background-color","#fafafa");
				StyleDeclarationSetProperty(_style_item_odd.style,"background-color","#ffffff");
				break;
			}

			_this.resize();
			_this.update();
		};

		// -
		// ターゲットモードを設定
		// -
		_this.setTargetMode = function (type){
			_target_mode = type;
		};

		// -
		// 選択イベント
		// -
		_this.onselect = function (e){};

		// -
		// セル更新イベント
		// -
		_this.onUpdateCell = function (info){};

		// -
		// アイテム更新イベント
		// -
		_this.onUpdateItem = function (info){};

		// -
		// ソート
		// -
		_this.sort = function (key , descending){
			if(key !== undefined){
				_sort_key = key;
			}
			if(descending !== undefined){
				_sort_descending = descending;
			}

			var i,j;
			var num;

			num = _column_list.length;
			for(i=0;i<num;i++){
				_column_list[i].setSortIcon("");
			}
			_column_dictionary[_sort_key].setSortIcon(_sort_descending ? "down":"up");

			num = _item_list.length;
			for(i=num-1;i>0;i--){
				for(j=i-1;j>=0;j--){
					if(0 < compareValue(_item_list[j].data[_sort_key],_item_list[i].data[_sort_key])){
						var t = _item_list[i];
						_item_list[i] = _item_list[j];
						_item_list[j] = t;
					}
				}
			}

			var after;
			if(num){
				var item = _item_list[num-1];
				item.index = num - 1;
				if(_table_body.lastChild != item.element){
					_table_body.appendChild(item.element);
				}
				after = item.element;
			}
			for(i=num-2;i>=0;i--){
				var item = _item_list[i];
				item.index = i;
				if(after.previousSibling != item.element){
					_table_body.insertBefore(item.element , after);
				}
				after = item.element;
			}
		};

		// -
		// カラム移動
		// -
		_this.moveColumn = function (key , index){
			var column = _column_dictionary[key];
			if(!column) return;
			var old_index = column.index;
			if(old_index > index) index += 1;
			
			var p = _column_list[old_index];
			_column_list.splice(old_index,1);
			if(index < 0){
				_column_list.unshift(p);
			}else{
				_column_list.splice(index,0,p);
			}
			
			var columns = new Array();
			var nodes = _table_column.childNodes;
			var i;
			var num = nodes.length;
			for(i=0;i<num;i++){
				columns.push(nodes[i]);	
			}

			var p = columns[old_index];
			columns.splice(old_index,1);
			if(index < 0){
				columns.unshift(p);
			}else{
				columns.splice(index,0,p);
			}

			for(i=0;i<num;i++){
				var column = _column_list[i];
				column.index = i;
				_table_column.appendChild(columns[i]);
				columns[i].className = "catalog_column_" + i;
			}

			var i;
			var num = _item_list.length;
			for(i=0;i<num;i++){
				_item_list[i].renderer.layout_mode = "";
			}			
			_this.resize();
			_this.update();
		};

		// -
		// クリア
		// -
		_this.clear = function (){
			_this.clearColumn();
			_this.clearItem();
		};

		// -
		// カラムクリア
		// -
		_this.clearColumn = function (){
			_column_dictionary = new Object();
			_column_list = new Array();
			DomNodeRemoveChildren(_table_column);
		};

		// -
		// アイテムクリア
		// -
		_this.clearItem = function (){
			_modify_count += 1;
			_item_dictionary = new Object();
			_item_list = new Array();
			DomNodeRemoveChildren(_table_body);
		};

		// -
		// ブロックサイズ設定
		// -
		_this.setBlockSize = function (w,h){
			_block_size.width  = w;
			_block_size.height = h;
		};

		// -
		// 選択したアイテムを取得
		// -
		_this.getSelectedItem = function (){
			return _selected_item;
		};

		// -
		// プライベート変数
		// -
		var _table_column;
		var _table_body;
		var _style_column_list;
		var _style_item_container;
		var _style_item_even;
		var _style_item_odd;
		var _style_item_hover;
		var _style_item_separator;
		var _layout_mode;
		var _target_mode;
		var _column_dictionary;
		var _item_dictionary;
		var _column_list;
		var _item_list;
		var _sort_key;
		var _sort_descending;
		var _block_size;
		var _modify_count;
		var _selected_item;
		var _column_hover_place;
		var _column_hover_index_border;
		var _column_hover_index_center;
		var _column_drop_index_border;
		var _column_dragging_border = false;

		// -
		// 初期化
		// -
		(function(){
			_column_dictionary = new Object();
			_item_dictionary = new Object();
			_column_list = new Array();
			_item_list = new Array();
			_block_size = {width:100,height:100};
			_modify_count = 0;

			_table_column = DocumentCreateElement("div");
			ElementSetStyle(_table_column,"position:absolute; left:0px; top:0px; right:0px; white-space:nowrap; height:24px; overflow:hidden; background:#888;");
			parent.appendChild(_table_column);

				(function(){
					function ColumnGetClientRectList(){
						var list = new Array();
						var nodes = _table_column.childNodes;
						var i;
						var num = nodes.length;
						for(i=0;i<num;i++){
							list.push(ElementGetBoundingClientRect(nodes[i]));
						}
						return list;
					}

					_table_column.onmousemove = function(e){
						var column_list = ColumnGetClientRectList();
						var pos_x = e.clientX;
						var pos_y = e.clientY;

						var i;
						var num = column_list.length;

						_column_hover_index_center = num - 1;
						for(i=0;i<num;i++){
							var rect = 	column_list[i];
							if(pos_x < rect.right){
								_column_hover_index_center = i;								
								break;
							}
						}

						_column_hover_index_border = num - 1;
						for(i=0;i<num;i++){
							var rect = 	column_list[i];
							if(pos_x < rect.right - 6){
								_column_hover_index_border = i - 1;
								break;
							}
						}

						_column_drop_index_border = num - 1;
						for(i=0;i<num;i++){
							var rect = 	column_list[i];
							if(pos_x < rect.left + (rect.right - rect.left) * 0.5){
								_column_drop_index_border = i - 1;
								break;
							}
						}		

						_column_hover_place = "center";
						for(i=0;i<num;i++){
							var rect = 	column_list[i];
							if(i <= 0){
							}else if(pos_x < rect.left + 6){
								_column_hover_place = "border";
								break;
							}
							if(pos_x < rect.right - 6){
								break;
							}
						}
						if(i >= num){
							_column_hover_place = "border";								
						}
						
						var hover_border = (function(){
							if(_column_hover_place == "border") return true;
							if(_column_dragging_border) return true;
							return false;
						})();
						_table_column.style.cursor = (hover_border) ? "col-resize" : "pointer";
					};

					// クリックソート
					_table_column.onclick = function(e){
						if(_column_hover_place != "center") return;
						var column = _column_list[_column_hover_index_center];
						if(!column) return;
						_this.sort(column.key,!(_sort_descending));
					};

					// 境界線ダブルクリック
					_table_column.ondblclick = function(e){
						if(_column_hover_place != "border") return;
						
						var column = _column_list[_column_hover_index_border];
						if(!column) return;

						var width = 10;
						var i;
						var num = _item_list.length;
						for(i=0;i<num;i++){
							try{
								var item = _item_list[i];
								if(item.renderer.layout_mode == "detail"){
									var element = item.element;
									var node = element.childNodes[_column_hover_index_border].cloneNode(true);
									node.className = "";
									node.style.cssText = "position:absolute; left:0px; top:0px;"
									_table_column.appendChild(node);
									var rect = ElementGetBoundingClientRect(node);
									_table_column.removeChild(node);
									var w = rect.right - rect.left;
									if(width < w) width = w;
								}
							}catch(e){
							}
						}

						column.setWidth(width);
						_this.resize();
					};
					
					// ドロップ許可
					_table_column.ondragover = function(e){
						_table_column.onmousemove(e);
						return false;
					};

					// ドロップ受け取り
					_table_column.ondrop = function(e){
						try{
							var data_transfer = e.dataTransfer;
							var key = data_transfer.getData("text");
							_this.moveColumn(key,_column_drop_index_border);
						}catch(e){
						}
						return false;
					};

					(function(){
						var task;
						var old_pos;
						var index;
						var column = null;

						_table_column.onmousedown = function(e){
							input_mouse.setMouseEvent(e);

							if(task) task.release();
							_table_column.onmousemove(e);
							if(_column_hover_place != "border") return;

							old_pos = input_mouse.getPositionClient();
							index = _column_hover_index_border;
							column = _column_list[index];
							if(!column) return;

							task = task_container.createTask();
							task.setDestructorFunc(function(){
								_column_dragging_border = false;
								column = null;
								task = null;	
							});
							task.setExecuteFunc(function(){
								if(!(input_mouse.getButtonLeft())){
									task.release();
									return;
								}
								if(!_column_dragging_border){
									var mouse_pos = input_mouse.getPositionClient();
									var vec_x = mouse_pos.x - old_pos.x;
									var vec_y = mouse_pos.y - old_pos.y;
									if(Math.sqrt(vec_x * vec_x + vec_y * vec_y) >= 3.0){										
										_column_dragging_border = true;
									}
								}

								if(_column_dragging_border){
									var column_rect = ElementGetBoundingClientRect(column.element);
									var mouse_pos = input_mouse.getPositionClient();
									
									var width = mouse_pos.x - column_rect.left;
									if(width < 10) width = 10;
									column.setWidth(width);
									_this.resize();
								}
							});
						};

					})();

				})();

			_table_body = DocumentCreateElement("div");
			ElementSetStyle(_table_body,"position:absolute; left:0px; top:32px; right:0px; bottom:0px; font-size:12px; line-height:1.0; overflow-x:auto; overflow-y:scroll; background:#fff;");
			parent.appendChild(_table_body);

			var right = (function(){
				var div = DocumentCreateElement("div");
				ElementSetStyle(div,"position:absolute; left:0px; top:0px; width:100px; overflow-y:scroll;");
				document.body.appendChild(div);
				var right = div.offsetWidth - (div.clientWidth + div.clientLeft);
				DomNodeRemove(div);
				return right;
			})();
			_table_column.style.right = (right) + "px";

			_table_body.onscroll = function(e){
				_table_column.scrollLeft = _table_body.scrollLeft;
			}

			var catalog_style = DocumentCreateElement("style");
			parent.appendChild(catalog_style);

			var catalog_style_width = DocumentCreateElement("style");
			parent.appendChild(catalog_style_width);

			var style_sheet = ElementGetStyleSheet(catalog_style);
			CSSStyleSheetInsertRule(style_sheet,".catalog_item","margin:2px; vertical-align:top; text-decoration:none; border-radius:4px; user-select:none; -moz-user-select:none; -webkit-user-select:none;",0);
			CSSStyleSheetInsertRule(style_sheet,".catalog_item:nth-child(2n)","",1);
			CSSStyleSheetInsertRule(style_sheet,".catalog_item:nth-child(2n+1)","",2);
			CSSStyleSheetInsertRule(style_sheet,".catalog_item:hover","background-color:rgba(192,255,160,0.3);",3);
			CSSStyleSheetInsertRule(style_sheet,".catalog_column","font-size:14px; background-color:#646464; color:#fff; border-right:1px #888 solid; border-bottom:1px #888 solid; position:absolute; top:0px; bottom:0px; left:0px; right:0px; overflow:hidden; padding-left:4px; padding-top:2px; padding-right:10px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; text-align:center; background-repeat:no-repeat; background-position:center right; user-select:none; -moz-user-select:none; -webkit-user-select:none;",4);
			CSSStyleSheetInsertRule(style_sheet,".catalog_column:hover","background-color:#4281F4;",5);

			var rule_list = CSSStyleSheetGetCSSRuleList(style_sheet);
			_style_item_container = rule_list[0];
			_style_item_even = rule_list[1];
			_style_item_odd = rule_list[2];
			_style_item_hover = rule_list[3];

			_style_column_list = ElementGetStyleSheet(catalog_style_width);

			_this.setLayoutMode("detail");
		})();
	}


	// -
	// DOM オブジェクトの解析(ルート)
	// -
	function DomNodeAnalyzeRoot(node){

		var w;
		var o;
		var p;
		var n;
		var i = 0;
		var c = 0;
		var m = 100;
		var q = new Object();
		var nodes = node.childNodes;
		q.p = q;
		q.n = q;

		// 解析無効化
		w = analyze_work_dictionary.getAnalyzeWork(node);
		if(w){
			if(w.a_inv)	return;
		}

		// 中断
		function interrupt(){
			c = 0;
			execute_queue.attachFirstForInsertDomNode(analyze,null);
		}

		// 子孫抽出
		function analyze(){
			while(node){
				if(nodes){
					while(nodes[i]){
						o = {node:nodes[i]};
						n = q;
						p = n.p;
						o.p = p;
						o.n = n;
						p.n = o;
						n.p = o;
						i++;
						c++;
						if(c > m){
							interrupt();
							return;
						}
					}
				}

				switch(node.nodeType){
				case 1:
					execute_queue.attachForAnalyzeElement(DomNodeAnalyzePhaseAnalyzeElement,node);
					break;
				case 3:
					DomNodeAnalyzePhaseAnalyzeTextNode(node);
					break;
				}

				if(!(window.addEventListener)){
					DomNodeSetInserted(node);
				}

				o = q.n;
				p = o.p;
				n = o.n;
				p.n = n;
				n.p = p;
				node = o.node;
				if(node){
					i = 0;
					nodes = node.childNodes;

					// 解析無効化
					w = analyze_work_dictionary.getAnalyzeWork(node);
					if(w){
						if(w.a_inv){
							nodes = null;
						}
					}
				}

				c++;
				if(c > m){
					interrupt();
					return;
				}
			}
		}

		analyze();
	}

	// -
	// エレメントの解析フェーズ
	// -
	function DomNodeAnalyzePhaseAnalyzeElement(node){

		// ゲスト検出
		if(analyze_work_dictionary.verifyGuest(node)){
			return;
		}

		// Content Editable
		if(node.isContentEditable){
			return;
		}

		// クローン検出
		if(analyze_work_dictionary.verifyClone(node)){
			// スクロール補正
			var revise_scroll = new DocumentReviseScroll();
			revise_scroll.executeRemoveElementBefore(node);
			DomNodeRemove(node);
			revise_scroll.executeRemoveElementAfter(node);
			return;
		}

		// 解析ワーク取得
		var work = analyze_work_dictionary.getAnalyzeWork(node);
		if(!work){
			// 解析ワーク作成
			work = AnalyzeWorkCreate(node);

		}

		if(!AnalyzeWorkGetInitializedObserverElement(work)){

			// -
			// アンカー
			// -
			if(node.tagName == "A"){

				// 要素を監視
				AnalyzeWorkObserveElement(work);

				// アドレス変更監視
				var observer_modify_element = document_observer_modify_node.createElement();
				AnalyzeWorkSetObserverModifyAnchor(work,observer_modify_element);
				observer_modify_element.setElement(node,"href");
				observer_modify_element.setFunction(function (){

					// 修正カウンタ加算
					AnalyzeWorkAddModifyCount(work);

					var event_dispatcher = AnalyzeWorkGetEventDispatcher(work);
					if(event_dispatcher){
						// イベント発火
						event_dispatcher.dispatchEvent("anchor_href_change",null);
						event_dispatcher.dispatchEvent("release",null);
					}

					// 解析状況をクリア
					AnalyzeWorkClearAnalyzedReplacementToAnchor(work);
					AnalyzeWorkClearAnalyzedReplacementToLink(work);
					AnalyzeWorkClearAnalyzedExpandShortUrl(work);
					AnalyzeWorkClearAnalyzedExpandInlineText(work);
					AnalyzeWorkClearAnalyzedExpandThumbnailImage(work);
					AnalyzeWorkClearAnalyzedExpandPopupImage(work);
					AnalyzeWorkClearAnalyzedExpandInlineSound(work);
					AnalyzeWorkClearAnalyzedExpandInlineVideo(work);
					AnalyzeWorkClearAnalyzedExpandInlineIframe(work);
					AnalyzeWorkClearExpandUrl(work);
					AnalyzeWorkClearExpandContentType(work);

					// 再解析
					DomNodeAnalyzePhaseAnalyzeElement(node);
				});

				// 破棄イベント
				var event_dispatcher = AnalyzeWorkGetEventDispatcher(work);
				var event_handler = event_dispatcher.createEventHandler("destructor");
				event_handler.setFunction(function(){
					// アドレス変更監視を破棄
					if(observer_modify_element){
						observer_modify_element.release();
						observer_modify_element = null;
						AnalyzeWorkClearObserverModifyAnchor(work);
					}
				});

				// アンカー要素を登録
				AnalyzeWorkSetAnchorElement(work,node);

			// -
			// インラインフレーム
			// -
			}else if(node.tagName == "IFRAME"){

				// 要素を監視
				AnalyzeWorkObserveElement(work);
			}
		}

		var param = {
			modify:AnalyzeWorkGetModifyCount(work),
			work:work
		};

		// -
		// アドレスコレクション
		// -
		ElementAnalyzeAddressCollection(param);

		// -
		// インラインフレーム内コンテンツ
		// -
		// 解析済みチェック
		if(!AnalyzeWorkGetAnalyzedExpandIframeContent(work)){
			AnalyzeWorkSetAnalyzedExpandIframeContent(work);
			execute_queue.attachForExpandElement(ElementAnalyzePhaseExpandIframeContent,param);
		}

		// -
		// 掲示板解析
		// -
		if(project.getEnableExpandBbs()){
			if(expand_bbs.initialized){
				if(expand_bbs.enable){
					execute_queue.attachForExpandBbs(ElementAnalyzeBbs,param);
				}
			}else{
				expand_bbs.node_queue.push(param);
			}
		}

		// -
		// アンカーを置換
		// -
		if(project.getEnableReplacementToAnchor()){
			execute_queue.attachForExpandElement(ElementAnalyzeReplacementToAnchor,param);
		}else{
			// 短縮URL展開関連のフェーズへ
			ElementAnalyzePhaseExpandShortUrl(param);
		}

		// -
		// エレメントの置換
		// -
		if(project.getEnableReplacementToElement()){
			execute_queue.attachForExpandElement(ElementAnalyzeReplacementToElement,param);
		}else{
			// 縮小画像のポップアップのフェーズへ
			ElementAnalyzePhasePopupReducedImage(param);
		}

	}

	// -
	// テキストノードの解析フェーズ
	// -
	function DomNodeAnalyzePhaseAnalyzeTextNode(node){

		// 解析ワーク取得
		var work = analyze_work_dictionary.getAnalyzeWork(node);
		if(!work){
			// 解析ワーク作成
			work = AnalyzeWorkCreate(node);

		}

		var param = {
			modify:AnalyzeWorkGetModifyCount(work),
			work:work
		};

		// -
		// テキストの置換
		// -
		if(project.getEnableReplacementToText()){
			execute_queue.attachForAnalyzeTextNode(ElementAnalyzeReplacementToText,param);
		}else{
			// ハイパーリンク化のフェーズへ
			ElementAnalyzePhaseMakeLinkToText(param);
		}

	}

	// -
	// エレメントの解析フェーズ(短縮URLの展開)
	// -
	function ElementAnalyzePhaseExpandShortUrl(param){
		var work = param.work;
		var modify = param.modify;
		if(!AnalyzeWorkEqualModifyCount(work,modify))	return;

		// -
		// 短縮 URL の展開
		// -
		if(project.getEnableExpandShortUrl()){
			execute_queue.attachForExpandElement(ElementAnalyzeExpandShortUrl,param);
		}else{
			// ハイパーリンク展開関連のフェーズへ
			ElementAnalyzePhaseReplacementToLink(param);
		}
	}

	// -
	// エレメントの解析フェーズ(アンカーの置換)
	// -
	function ElementAnalyzePhaseReplacementToAnchor(param){
		var work = param.work;
		var modify = param.modify;
		if(!AnalyzeWorkEqualModifyCount(work,modify))	return;

		// -
		// アンカーを置換
		// -
		if(project.getEnableReplacementToAnchor()){
			execute_queue.attachForExpandElement(ElementAnalyzeReplacementToAnchor,param);
		}else{
			// ハイパーリンク展開関連のフェーズへ
			ElementAnalyzePhaseReplacementToLink(param);
		}
	}

	// -
	// エレメントの解析フェーズ(ハイパーリンクの置換)
	// -
	function ElementAnalyzePhaseReplacementToLink(param){
		var work = param.work;
		var modify = param.modify;
		if(!AnalyzeWorkEqualModifyCount(work,modify))	return;

		// -
		// アンカーを置換
		// -
		if(project.getEnableReplacementToLink()){
			execute_queue.attachForExpandElement(ElementAnalyzeReplacementToLink,param);
		}else{
			// 展開関連のフェーズへ
			execute_queue.attachForExpandElement(ElementAnalyzePhaseExpand,param);
		}
	}

	// -
	// エレメントの解析フェーズ(ハイパーリンク化)
	// -
	function ElementAnalyzePhaseMakeLinkToText(param){
		var work = param.work;
		var modify = param.modify;
		if(!AnalyzeWorkEqualModifyCount(work,modify))	return;

		// -
		// テキストのハイパーリンク化
		// -
		if(project.getEnableMakeLinkToText()){
			execute_queue.attachForAnalyzeTextNode(ElementAnalyzeMakeLinkToText,param);
		}

	}

	// -
	// エレメントの解析フェーズ(展開関連)
	// -
	function ElementAnalyzePhaseExpand(param){
		var work = param.work;
		var modify = param.modify;
		if(!AnalyzeWorkEqualModifyCount(work,modify))	return;

		var element = AnalyzeWorkGetDomNode(work);
		var anchor = AnalyzeWorkGetAnchorElement(work);

		if(!anchor) return;

		// アンカー
		if(anchor.tagName != "A")	return;

		// document に未登録
		if(!DomNodeGetAttachedDocument(element))	return;

		// 実行対象外のタグ
		var selector_result = ElementMatchesSelector(element,"head *,script *,style *");
		if(selector_result === undefined){
			var node = element;
			var illegal = {HEAD:1,SCRIPT:1,STYLE:1};
			while(node){
				if(illegal[node.tagName]) return;
				node = node.parentNode;
			}
		}else if(selector_result){
			return;
		}

		// -
		// アドレス
		// -
		if(!AnalyzeWorkGetExpandUrl(work)){
			AnalyzeWorkSetExpandUrl(work,anchor.href);
		}

		// -
		// テキストの展開
		// -
		if(project.getEnableExpandText()){
			// 解析済みチェック
			if(!AnalyzeWorkGetAnalyzedExpandInlineText(work)){
				AnalyzeWorkSetAnalyzedExpandInlineText(work);

				// 実行キューに登録
				execute_queue.attachForExpandElement(ElementExpandInlineText,param);
			}
		}

		// -
		// 画像の展開
		// -
		if(project.getEnableExpandImage()){
			// 解析済みチェック
			if(!AnalyzeWorkGetAnalyzedExpandThumbnailImage(work)){
				AnalyzeWorkSetAnalyzedExpandThumbnailImage(work);
				if(project.getEnableThumbnailImage()){
					// 実行キューに登録
					execute_queue.attachForExpandElement(ElementExpandThumbnailImage,param);
				}
			}

			// 解析済みチェック
			if(!AnalyzeWorkGetAnalyzedExpandPopupImage(work)){
				AnalyzeWorkSetAnalyzedExpandPopupImage(work);
				if(project.getEnablePopupImage()){
					// 実行キューに登録
					execute_queue.attachForExpandElement(ElementExpandPopupImage,param);
				}
			}
		}

		// -
		// サウンドの展開
		// -
		if(project.getEnableExpandSound()){
			// 解析済みチェック
			if(!AnalyzeWorkGetAnalyzedExpandInlineSound(work)){
				AnalyzeWorkSetAnalyzedExpandInlineSound(work);

				// 実行キューに登録
				execute_queue.attachForExpandElement(ElementExpandInlineSound,param);
			}
		}

		// -
		// ビデオの展開
		// -
		if(project.getEnableExpandVideo()){
			// 解析済みチェック
			if(!AnalyzeWorkGetAnalyzedExpandInlineVideo(work)){
				AnalyzeWorkSetAnalyzedExpandInlineVideo(work);

				// 実行キューに登録
				execute_queue.attachForExpandElement(ElementExpandInlineVideo,param);
			}
		}

		// -
		// インラインの展開
		// -
		if(project.getEnableExpandIframe()){
			// 解析済みチェック
			if(!AnalyzeWorkGetAnalyzedExpandInlineIframe(work)){
				AnalyzeWorkSetAnalyzedExpandInlineIframe(work);

				// 実行キューに登録
				execute_queue.attachForExpandElement(ElementExpandInlineIframe,param);
			}
		}
	}

	// -
	// エレメントの解析フェーズ(縮小画像のポップアップ)
	// -
	function ElementAnalyzePhasePopupReducedImage(param){
		var work = param.work;
		var modify = param.modify;
		if(!AnalyzeWorkEqualModifyCount(work,modify))	return;

		// -
		// 縮小画像を解析
		// -
		if(project.getEnablePopupReducedImage()){
			execute_queue.attachForExpandElement(ElementAnalyzePopupReducedImage,param);
		}

		// -
		// アンカーを置換
		// -
		var element = AnalyzeWorkGetDomNode(work);

		if(AnalyzeWorkGetOverrodeAnchorElement(work) && AnalyzeWorkGetAnchorElement(work)){

			if(project.getEnableReplacementToAnchor()){
				execute_queue.attachForExpandElement(ElementAnalyzeReplacementToAnchor,param);
			}else{
				// 短縮URL展開関連のフェーズへ
				ElementAnalyzePhaseExpandShortUrl(param);
			}

		}
	}

	// -
	// エレメントの解析フェーズ(インラインフレーム内コンテンツの展開)
	// -
	function ElementAnalyzePhaseExpandIframeContent(param){
		var work = param.work;
		var modify = param.modify;
		if(!AnalyzeWorkEqualModifyCount(work,modify))	return;

		var element = AnalyzeWorkGetDomNode(work);

		// インラインフレーム
		if(element.tagName != "IFRAME")	return;

		// document に未登録
		if(!DomNodeGetAttachedDocument(element))	return;

		ElementExpandIframeContent(param);
	}

	// -
	// エレメントの解析(アドレスコレクション)
	// -
	function ElementAnalyzeAddressCollection(param){
		var work = param.work;
		var modify = param.modify;
		if(!AnalyzeWorkEqualModifyCount(work,modify))	return;

		var element = AnalyzeWorkGetDomNode(work);
		var tag_name = element.tagName;

		if(tag_name == "IMG"){
			if(element.src.search(new RegExp("^(http|https)://")) == 0){

				// -
				// イメージのアドレスを調べる
				// -
				if(project.getDisableSameThumbnailImage()){
					if(element.src){
						address_collection.addAddress("image",element.src);
					}
				}

				// -
				// ダウンロードリストに登録
				// -
				var item = download_list_image.createItem();
				item.setURL(element.src);
			}
		}

		// -
		// サウンドのアドレスを調べる
		// -
		if(project.getDisableSameInlineSound()){
			if(tag_name == "AUDIO"){
				if(element.src){
					address_collection.addAddress("sound",element.src);
				}
			}
		}

		// -
		// ビデオのアドレスを調べる
		// -
		if(project.getDisableSameInlineVideo()){
			if(tag_name == "EMBED"){
				if(element.src){
					address_collection.addAddress("video",element.src);
				}
			}
			if(tag_name == "OBJECT"){
				if(element.src){
					address_collection.addAddress("video",element.src);
				}
			}
			if(tag_name == "IFRAME"){
				if(element.src){
					address_collection.addAddress("video",element.src);
				}
			}
		}

		// -
		// インラインフレームのアドレスを調べる
		// -
		if(project.getDisableSameInlineIframe()){
			if(tag_name == "IFRAME"){
				if(element.src){
					address_collection.addAddress("iframe",element.src);
				}
			}
		}

		// -
		// background-image のアドレスを調べる
		// -
		(function(){
			var style = ElementGetComputedStyle(element,null) || {};
			var bg_image = style.backgroundImage || "";
			bg_image.replace(new RegExp("url[(]([^)]*?)[)]","ig"),function (m,url){
				url = StringLiteral_To_String(url) || url;
				url = StringUrl_To_Absolute(url,WindowGetOwnerURL(window));
				var item = download_list_image.createItem();
				item.setURL(url);
			});
		})();

	}

	// -
	// エレメントの解析(エレメント置換用)
	// -
	function ElementAnalyzeReplacementToElement(param){
		var work = param.work;
		var modify = param.modify;
		if(!AnalyzeWorkEqualModifyCount(work,modify))	return;

		var element = AnalyzeWorkGetDomNode(work);

		// document に未登録
		if(!DomNodeGetAttachedDocument(element))	return;

		ElementReplacementToElement(param);
	}

	// -
	// エレメントの解析(テキスト置換用)
	// -
	function ElementAnalyzeReplacementToText(param){
		var work = param.work;
		var modify = param.modify;
		if(!AnalyzeWorkEqualModifyCount(work,modify))	return;

		var text_node = AnalyzeWorkGetDomNode(work);
		var element = text_node.parentNode;
		if(!element) return;

		// document に未登録
		if(!DomNodeGetAttachedDocument(element))	return;

		// 実行対象外のタグ
		var selector_result = ElementMatchesSelector(element,"script *,style *,script,style");
		if(selector_result === undefined){
			var node = text_node;
			var illegal = {SCRIPT:1,STYLE:1};
			while(node){
				if(illegal[node.tagName]) return;
				node = node.parentNode;
			}
		}else if(selector_result){
			return;
		}

		ElementReplacementToText(param);
	}

	// -
	// エレメントの解析(アンカー置換用)
	// -
	function ElementAnalyzeReplacementToAnchor(param){
		var work = param.work;
		var modify = param.modify;
		if(!AnalyzeWorkEqualModifyCount(work,modify))	return;

		var element = AnalyzeWorkGetDomNode(work);
		var anchor = AnalyzeWorkGetAnchorElement(work);

		if(!anchor) return;

		// アンカー
		if(anchor.tagName != "A")	return;

		// document に未登録
		if(!DomNodeGetAttachedDocument(element))	return;

		// 実行対象外のタグ
		var selector_result = ElementMatchesSelector(element,"head *,script *,style *");
		if(selector_result === undefined){
			var node = element;
			var illegal = {HEAD:1,SCRIPT:1,STYLE:1};
			while(node){
				if(illegal[node.tagName]) return;
				node = node.parentNode;
			}
		}else if(selector_result){
			return;
		}

		if((anchor.name) && !(anchor.href))	return;

		ElementReplacementToAnchor(param);
	}

	// -
	// エレメントの解析(リンク置換用)
	// -
	function ElementAnalyzeReplacementToLink(param){
		var work = param.work;
		var modify = param.modify;
		if(!AnalyzeWorkEqualModifyCount(work,modify))	return;

		var element = AnalyzeWorkGetDomNode(work);
		var anchor = AnalyzeWorkGetAnchorElement(work);

		if(!anchor) return;

		// アンカー
		if(anchor.tagName != "A")	return;

		// document に未登録
		if(!DomNodeGetAttachedDocument(element))	return;

		// 実行対象外のタグ
		var selector_result = ElementMatchesSelector(element,"head *,script *,style *");
		if(selector_result === undefined){
			var node = element;
			var illegal = {HEAD:1,SCRIPT:1,STYLE:1};
			while(node){
				if(illegal[node.tagName]) return;
				node = node.parentNode;
			}
		}else if(selector_result){
			return;
		}

		if(!(anchor.href))	return;

		ElementReplacementToLink(param);
	}

	// -
	// エレメントの解析(テキストからハイパーリンクを生成用)
	// -
	function ElementAnalyzeMakeLinkToText(param){
		var work = param.work;
		var modify = param.modify;
		if(!AnalyzeWorkEqualModifyCount(work,modify))	return;

		var text_node = AnalyzeWorkGetDomNode(work);
		var element = text_node.parentNode;
		if(!element) return;

		// document に未登録
		if(!DomNodeGetAttachedDocument(element))	return;

		// 実行対象外のタグ
		var selector_result = ElementMatchesSelector(element,"script *,style *,a *,textarea *,script,style,a,textarea");
		if(selector_result === undefined){
			var node = text_node;
			var illegal = {SCRIPT:1,STYLE:1,A:1,TEXTAREA:1};
			while(node){
				if(illegal[node.tagName]) return;
				node = node.parentNode;
			}
		}else if(selector_result){
			return;
		}

		ElementMakeLinkToText(param);
	}

	// -
	// エレメントの解析(短縮 URL の展開用)
	// -
	function ElementAnalyzeExpandShortUrl(param){
		var work = param.work;
		var modify = param.modify;
		if(!AnalyzeWorkEqualModifyCount(work,modify))	return;

		var element = AnalyzeWorkGetDomNode(work);
		var anchor = AnalyzeWorkGetAnchorElement(work);

		if(!anchor) return;

		// アンカー
		if(anchor.tagName != "A")	return;

		// document に未登録
		if(!DomNodeGetAttachedDocument(element))	return;

		// 実行対象外のタグ
		var selector_result = ElementMatchesSelector(element,"head *,script *,style *");
		if(selector_result === undefined){
			var node = element;
			var illegal = {HEAD:1,SCRIPT:1,STYLE:1};
			while(node){
				if(illegal[node.tagName]) return;
				node = node.parentNode;
			}
		}else if(selector_result){
			return;
		}

		if(!(anchor.href))	return;

		ElementExpandShortUrl(param);
	}

	// -
	// エレメントの解析(縮小画像のポップアップ用)
	// -
	function ElementAnalyzePopupReducedImage(param){
		var work = param.work;
		var modify = param.modify;
		if(!AnalyzeWorkEqualModifyCount(work,modify))	return;

		var element = AnalyzeWorkGetDomNode(work);

		// イメージ
		if(element.tagName != "IMG")	return;

		// document に未登録
		if(!DomNodeGetAttachedDocument(element))	return;

		ElementPopupReducedImage(param);
	}

	// -
	// エレメントの解析(掲示板用)
	// -
	function ElementAnalyzeBbs(param){
		var work = param.work;
		var modify = param.modify;
		if(!AnalyzeWorkEqualModifyCount(work,modify))	return;

		var dom_node = AnalyzeWorkGetDomNode(work);

		// document に未登録
		if(!DomNodeGetAttachedDocument(dom_node))	return;

		// 実行対象外のタグ
		var selector_result = ElementMatchesSelector(dom_node,"head *,script *,style *");
		if(selector_result === undefined){
			var node = dom_node;
			var illegal = {HEAD:1,SCRIPT:1,STYLE:1};
			while(node){
				if(illegal[node.tagName]) return;
				node = node.parentNode;
			}
		}else if(selector_result){
			return;
		}

		ElementExpandBbs(param);
	}

	// -
	// エレメントを置換
	// -
	function ElementReplacementToElement(param){
		var work = param.work;
		var modify = param.modify;
		if(!AnalyzeWorkEqualModifyCount(work,modify))	return;

		var element = AnalyzeWorkGetDomNode(work);

		var completed = false;
		function response(result){
			if(!AnalyzeWorkEqualModifyCount(work,modify))	return;

			if(completed)	return;
			completed = true;

			if(result.url){

				// -
				// アンカーのオーバーライド
				// -
				if(!AnalyzeWorkGetOverrodeAnchorElement(work)){
					// アンカーを作成
					var anchor = DocumentCreateElement("a");
					anchor.href = result.url;

					// アンカー要素を登録
					AnalyzeWorkSetAnchorElement(work,anchor);

					// オーバーライド済み
					AnalyzeWorkSetOverrodeAnchorElement(work);
					AnalyzeWorkSetOverrodeUrl(work);
				}

				// -
				// 要素を監視
				// -
				AnalyzeWorkObserveElement(work);

			}

			// 縮小画像のポップアップのフェーズへ
			ElementAnalyzePhasePopupReducedImage(param);
		}

		// 解析済みチェック
		if(AnalyzeWorkGetAnalyzedReplacementToElement(work)){
			return;
		}
		AnalyzeWorkSetAnalyzedReplacementToElement(work);

		// コールバック関数を実行
		var request = {
			element:element
		};
		project.executeScriptReplacementToElement(request,response);
	}

	// -
	// テキストを置換
	// -
	function ElementReplacementToText(param){
		var work = param.work;
		var modify = param.modify;
		if(!AnalyzeWorkEqualModifyCount(work,modify))	return;

		var text_node = AnalyzeWorkGetDomNode(work);

		var completed = false;
		function response(){
			if(!AnalyzeWorkEqualModifyCount(work,modify))	return;

			if(completed)	return;
			completed = true;

			// ハイパーリンク化のフェーズへ
			ElementAnalyzePhaseMakeLinkToText(param);
		}

		// 解析済みチェック
		if(AnalyzeWorkGetAnalyzedReplacementToText(work)){
			return;
		}
		AnalyzeWorkSetAnalyzedReplacementToText(work);

		// コールバック関数を実行
		project.executeScriptReplacementToText(text_node,response);
	}

	// -
	// アンカーを置換
	// -
	function ElementReplacementToAnchor(param){
		var work = param.work;
		var modify = param.modify;
		if(!AnalyzeWorkEqualModifyCount(work,modify))	return;

		var element = AnalyzeWorkGetDomNode(work);
		var anchor = AnalyzeWorkGetAnchorElement(work);

		var completed = false;
		function response(){
			if(!AnalyzeWorkEqualModifyCount(work,modify))	return;

			if(completed)	return;
			completed = true;

			// 短縮URL展開済み
			if(AnalyzeWorkGetAnalyzedExpandShortUrl(work)){
				// ハイパーリンク展開関連のフェーズへ
				ElementAnalyzePhaseReplacementToLink(param);
			}else{
				// 短縮URL展開関連のフェーズへ
				ElementAnalyzePhaseExpandShortUrl(param);
			}
		}

		// 解析済みチェック
		if(AnalyzeWorkGetAnalyzedReplacementToAnchor(work)){
			return;
		}
		AnalyzeWorkSetAnalyzedReplacementToAnchor(work);

		// コールバック関数を実行
		project.executeScriptReplacementToAnchor(anchor,work.event_dispatcher,response);
	}

	// -
	// リンクを置換
	// -
	function ElementReplacementToLink(param){
		var work = param.work;
		var modify = param.modify;
		if(!AnalyzeWorkEqualModifyCount(work,modify))	return;

		var element = AnalyzeWorkGetDomNode(work);
		var anchor = AnalyzeWorkGetAnchorElement(work);
		var replacement_to_link = project.getReplacementToLink(anchor);

		var completed = false;
		function response(r){
			if(!AnalyzeWorkEqualModifyCount(work,modify))	return;

			if(completed)	return;
			completed = true;

			var obj = r.getResult();

			//リンクの変更をアンカーに反映する
			if(r.getEnableReflectToAnchor()){
				if(obj.result){
					var monitor_element = AnalyzeWorkGetObserverModifyAnchor(work);
					if(monitor_element){
						monitor_element.setBaseValue(obj.url);
					}
					anchor.href = obj.url;
				}
			}

			if(obj.result){
				if(obj.url){
					AnalyzeWorkSetExpandUrl(work,obj.url);
				}
				if(obj.content_type){
					try{
						var a = obj.content_type;
						var i;
						var num = a.length;
						for(i=0;i<num;i++){
							if(typeof(a[i]) == "string"){
								AnalyzeWorkAddContentType(work,a[i]);
							}
						}
					}catch(e){
					}
				}
			}

			// 展開関連のフェーズへ
			execute_queue.attachForExpandElement(ElementAnalyzePhaseExpand,param);
		}

		// 解析済みチェック
		if(AnalyzeWorkGetAnalyzedReplacementToLink(work)){
			return;
		}
		AnalyzeWorkSetAnalyzedReplacementToLink(work);

		// 結果を取得
		replacement_to_link.getResult(response);
	}

	// -
	// テキストからハイパーリンクを生成
	// -
	function ElementMakeLinkToText(param){
		var work = param.work;
		var modify = param.modify;
		if(!AnalyzeWorkEqualModifyCount(work,modify))	return;

		var text_node = AnalyzeWorkGetDomNode(work);

		var completed = false;
		function response(){
			if(!AnalyzeWorkEqualModifyCount(work,modify))	return;

			if(completed)	return;
			completed = true;
		}

		// 解析済みチェック
		if(AnalyzeWorkGetAnalyzedMakeLinkToText(work)){
			return;
		}
		AnalyzeWorkSetAnalyzedMakeLinkToText(work);

		// コールバック関数を実行
		project.executeScriptMakeLinkToText(text_node,response);
	}

	// -
	// 短縮 URL の展開
	// -
	function ElementExpandShortUrl(param){
		var work = param.work;
		var modify = param.modify;
		if(!AnalyzeWorkEqualModifyCount(work,modify))	return;

		var element = AnalyzeWorkGetDomNode(work);
		var anchor = AnalyzeWorkGetAnchorElement(work);

		var completed = false;
		function response(result){
			if(!AnalyzeWorkEqualModifyCount(work,modify))	return;

			if(completed)	return;
			completed = true;

			if(result){
				// 解析フラグをクリア
				AnalyzeWorkClearAnalyzedReplacementToAnchor(work);

				// アンカーの置換フェーズへ
				execute_queue.attachForExpandElement(ElementAnalyzePhaseReplacementToAnchor,param);
			}else{
				// ハイパーリンク展開関連のフェーズへ
				ElementAnalyzePhaseReplacementToLink(param);
			}
		}

		// 解析済みチェック
		if(AnalyzeWorkGetAnalyzedExpandShortUrl(work)){
			return;
		}
		AnalyzeWorkSetAnalyzedExpandShortUrl(work);

		// アドレスチェック
		var url = anchor.href;
		if(!url){
			response(false);
			return;
		}

		// フィルタ
		if(project.checkExpandShortUrl(url)){

			var loader = new Loader();

			// ロード完了時に実行されるイベント
			loader.onload = function(v){
				if(!AnalyzeWorkEqualModifyCount(work,modify))	return;

				var monitor_element = AnalyzeWorkGetObserverModifyAnchor(work);
				if(monitor_element){
					monitor_element.setBaseValue(v);
				}

				// 取得結果をセット
				anchor.href = v;
				// 終了通知
				if(url != v){
					response(true);
				}else{
					response(false);
				}
			};

			// ロード失敗時に実行されるイベント
			loader.onerror = function(){
				if(!AnalyzeWorkEqualModifyCount(work,modify))	return;

				// 終了通知
				response(false);
			};
			loader.setURL(url);
			loader.setSendData(null);
			loader.loadFinalURL();

		}else{
			response(false);
		}
	}

	// -
	// テキストの展開
	// -
	function ElementExpandInlineText(param){
		var work = param.work;
		var modify = param.modify;
		var element = AnalyzeWorkGetDomNode(work);
		var url = AnalyzeWorkGetExpandUrl(work);
		url = project.fixURL_PassiveContent(url);
		var content_type = AnalyzeWorkGetContentType(work);

		if(!AnalyzeWorkEqualModifyCount(work,modify))	return;

		function complete(){
		}

		function response_allow(param){
			if(!AnalyzeWorkEqualModifyCount(work,modify))	return;

			if(!(param.result)){
				complete();
				return;
			}

			var event_dispatcher = AnalyzeWorkGetEventDispatcher(work);
			var loader = null;
			var text_area = null;
			var text_area_analyze_work = null;
			var text_url = url;
			var event_handler = null;
			var observer_remove = null;

			// 開放イベントを発行
			function dispatchEventRelease(e){
				event_dispatcher.dispatchEvent("release",null);
			}

			// テキストエリアを破棄
			function releaseTextarea(e){
				// ローダーを中断
				if(loader){
					loader.onload = null;
					loader.onerror = null;
					loader = null;
				}

				// アドレスの登録を外す
				if(text_url){
					address_collection.removeAddress("text",text_url);
					text_url = null;
				}

				// イベントハンドラを破棄
				if(event_handler){
					event_handler.release();
					event_handler = null;
				}

				// 監視を破棄
				if(observer_remove){
					observer_remove.release();
					observer_remove = null;
				}

				// 解析辞書除外
				if(text_area_analyze_work){
					analyze_work_dictionary.removeAnalyzeWork(text_area_analyze_work);
					text_area_analyze_work = null;
				}

				// テキストエリアを外す
				if(text_area){
					DomNodeRemove(text_area);
					text_area = null;
				}
			}

			// 重複チェック
			if(project.getDisableSameInlineText()){
				if(address_collection.hasAddress("text",text_url)){
					text_url = null;
					releaseTextarea();
					complete();
					return;
				}
				// アドレスを登録
				address_collection.addAddress("text",text_url);
			}

			// イベントハンドラを作成
			event_handler = event_dispatcher.createEventHandler("release");
			event_handler.setFunction(releaseTextarea);

			// テキストの読み込み
			loader = new Loader();
			loader.onload = function(str){
				complete();

				// テキストエリアを生成
				text_area = DocumentCreateElement("textarea");
				text_area.value = str;

				// スタイルをセット
				ElementSetStyle(text_area,project.getStyleSheetExpandTextInline(text_url));

				// 解析ワーク作成
				text_area_analyze_work = AnalyzeWorkCreate(text_area);

				// 解析辞書登録オプション
				var attach_options = new AnalyzeWorkDictionaryAttachOptions();
				attach_options.SetOutsider();

				// 解析辞書登録
				analyze_work_dictionary.attachAnalyzeWork(text_area_analyze_work,attach_options);

				// テキストエリアのリムーブ監視
				observer_remove = new DomNodeObserverRemoveFromDocument(text_area);
				observer_remove.setFunction(dispatchEventRelease);

				function responseInsert(){
				}

				// コールバック関数を実行
				project.executeScriptInsertInlineText(element,text_area,work.event_dispatcher,responseInsert);
			};

			loader.onerror = function(){
				complete();
			};
			loader.setMethod("GET");
			loader.setURL(text_url);
			loader.loadText();
		}

		// コールバック関数を実行
		project.executeScriptAllowInlineText(element,url,content_type,response_allow);
	}

	// -
	// サムネイルイメージ
	// -
	function ElementExpandThumbnailImage(param){
		var work = param.work;
		var modify = param.modify;
		var element = AnalyzeWorkGetDomNode(work);
		var url = AnalyzeWorkGetExpandUrl(work);
		url = project.fixURL_PassiveContent(url);
		var content_type = AnalyzeWorkGetContentType(work);

		if(!AnalyzeWorkEqualModifyCount(work,modify))	return;

		function complete(){
		}

		function response_allow(param){
			if(!AnalyzeWorkEqualModifyCount(work,modify))	return;

			if(!(param.result)){
				complete();
				return;
			}

			var event_dispatcher = AnalyzeWorkGetEventDispatcher(work);
			var loader = null;
			var popup_image = null;
			var thumbnail_image = null;
			var thumbnail_analyze_work = null;
			var thumbnail_url = url;
			var event_handler = null;
			var observer_remove = null;
			var limitter_element = null;
			var notify_element = null;

			// ダウンロードリストに登録
			var item = download_list_image.createItem();
			item.setURL(thumbnail_url);

			// サムネイルイメージを破棄(ElementLimiter 用)
			function releaseThumbnailImageForElementLimiter(e){
				// ローダーを中断
				if(loader){
					loader.onload = null;
					loader.onerror = null;
					loader = null;
				}

				// ポップアップイメージを破棄
				releasePopupImage();

				// アドレスの登録を外す
				if(thumbnail_url){
					address_collection.removeAddress("image",thumbnail_url);
					thumbnail_url = null;
				}

				// イベントハンドラを破棄
				if(event_handler){
					event_handler.release();
					event_handler = null;
				}

				// 監視を破棄
				if(observer_remove){
					observer_remove.release();
					observer_remove = null;
				}

				// 通知破棄
				if(notify_element){
					notify_element.release();
					notify_element = null;
				}

				// 解析辞書除外
				if(thumbnail_analyze_work){
					analyze_work_dictionary.removeAnalyzeWork(thumbnail_analyze_work);
					thumbnail_analyze_work = null;
				}

				// サムネイルイメージを破棄
				if(thumbnail_image){
					var revise_scroll = new DocumentReviseScroll();
					revise_scroll.executeRemoveElementBefore(thumbnail_image);
					DomNodeRemove(thumbnail_image);
					revise_scroll.executeRemoveElementAfter(thumbnail_image);
					thumbnail_image = null;
				}

				initializeLimitterElement();
			}

			// ポップアップイメージを破棄
			function releasePopupImage(e){
				// ポップアップイメージを破棄
				if(popup_image){
					popup_image.suicide();
					popup_image = null;
				}
			}

			// サムネイルイメージを破棄
			function releaseThumbnailImage(e){
				releaseThumbnailImageForElementLimiter();

				AnalyzeWorkClearPopupImage(work);

				if(limitter_element){
					limitter_element.release();
					limitter_element = null;
				}
			}

			// 開放イベントを発行
			function dispatchEventRelease(e){
				event_dispatcher.dispatchEvent("release",null);
			}

			// 制限初期化
			function initializeLimitterElement(){
				if(limitter_element){
					limitter_element.onattach = function(){
						createThumbnailImage();
					};
					limitter_element.onremove = function(){
						releaseThumbnailImageForElementLimiter();
					};
					limitter_element.setElementHitArea(element);
					limitter_element.setEnablePreload(project.getEnablePreLoadThumbnailImage());
				}
			}

			// サムネイルイメージを登録
			function createThumbnailImage(e){
				if(project.getEnableLoadNotifyExpandImage()){
					notify_element = notify_progress.createElement();
				}
				if(notify_element){
					notify_element.setElementHitArea(element);
					notify_element.setNotify(NotifyProgress.NOTIFY_TYPE_LOADING);
				}

				// 画像の読み込み
				loader = new Loader();
				loader.onload = function(image){
					thumbnail_image = image;

					// 解析ワーク作成
					thumbnail_analyze_work = AnalyzeWorkCreate(thumbnail_image);

					// 解析済み
					AnalyzeWorkSetAnalyzedPopupReducedImage(thumbnail_analyze_work);

					// 解析辞書登録オプション
					var attach_options = new AnalyzeWorkDictionaryAttachOptions();
					attach_options.SetOutsider();

					// 解析辞書登録
					analyze_work_dictionary.attachAnalyzeWork(thumbnail_analyze_work,attach_options);

					complete();

					// 成功通知
					if(notify_element){
						notify_element.setNotify(NotifyProgress.NOTIFY_TYPE_COMPLETE);
						notify_element.release();
						notify_element = null;
					}

					// 画像サイズをセット
					var image_size = ImageGetNaturalSize(thumbnail_image);
					limitter_element.setByteSize(image_size.width * image_size.height * 4);

					// 古い要素を破棄
					element_limitter_image.removeOldElements();
					if(!thumbnail_image)	return;

					// スタイルをセット
					ElementSetStyle(thumbnail_image,project.getStyleSheetExpandImageThumbnail(thumbnail_url));

					function responseInsert(){
						if(!thumbnail_image)	return;

						// ポップアップイメージを生成
						function createPopupImage(){

							// 縮小画像のポップアップ
							if(project.getEnablePopupMouseoverToThumbnailImage()){

								// 既存の PopupImage を全て破棄
								PopupReducedImageReleaseAll(element);

								// イメージを複製
								var loader = new Loader();
								loader.setURL(thumbnail_url);
								loader.onload = function(image_clone){
									if(!thumbnail_image)	return;

									// ポップアップイメージ
									popup_image = new PopupImage(image_clone);
									popup_image.setElementParent(document.body);
									popup_image.setElementAnchor(thumbnail_image);
									popup_image.setElementHitArea(thumbnail_image);
									popup_image.setElementBeginArea(thumbnail_image);
									popup_image.setOriginalURL(thumbnail_url);
									AnalyzeWorkSetPopupImage(work,popup_image);
								};
								loader.loadImage();
							}
						}

						// イメージのリムーブ監視
						observer_remove = new DomNodeObserverRemoveFromDocument(thumbnail_image);
						observer_remove.setFunction(dispatchEventRelease);

						// サムネイルソース
						var image_src = thumbnail_image.src;

						// コールバックを変更
						limitter_element.onattach = function(){
							thumbnail_image.src = image_src;
							createPopupImage();
						};
						limitter_element.onremove = function(){
							thumbnail_image.src = "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEHAAAALAAAAAABAAEAAAICRAEAOw==";
							releasePopupImage();
						};
						limitter_element.setElementHitArea(thumbnail_image);

						// ドラッガー
						var image_dragger = new ImageDragger(thumbnail_image);
						image_dragger.setOriginalURL(thumbnail_url);

						createPopupImage();
					}

					// コールバック関数を実行
					project.executeScriptInsertThumbnailImage(element,thumbnail_image,work.event_dispatcher,responseInsert);
				};

				loader.onerror = function(){
					complete();

					// 失敗通知
					if(notify_element){
						notify_element.setNotify(NotifyProgress.NOTIFY_TYPE_ERROR);
					}
				};
				loader.setMethod("GET");
				loader.setURL(thumbnail_url);
				loader.loadImage();
			}

			// 重複チェック
			if(project.getDisableSameThumbnailImage()){
				if(address_collection.hasAddress("image",thumbnail_url)){
					thumbnail_url = null;
					releaseThumbnailImage();
					complete();
					return;
				}

				// アドレスを登録
				address_collection.addAddress("image",thumbnail_url);
			}

			// イベントハンドラを作成
			event_handler = event_dispatcher.createEventHandler("release");
			event_handler.setFunction(releaseThumbnailImage);

			// イメージ管理
			limitter_element = element_limitter_image.createElement();
			initializeLimitterElement();

			// 更新
			limitter_element.update();
		}

		// コールバック関数を実行
		var request = {
			element:element,
			url:url,
			content_type:content_type,
			is_overridden_url:AnalyzeWorkGetOverrodeUrl(work)
		};
		project.executeScriptAllowThumbnailImage(request,response_allow);
	}

	// -
	// ポップアップイメージ
	// -
	function ElementExpandPopupImage(param){
		var work = param.work;
		var modify = param.modify;
		var element = AnalyzeWorkGetDomNode(work);
		var url = AnalyzeWorkGetExpandUrl(work);
		url = project.fixURL_PassiveContent(url);
		var content_type = AnalyzeWorkGetContentType(work);

		if(!AnalyzeWorkEqualModifyCount(work,modify))	return;

		function complete(){
		}

		function response_allow(param){
			if(!AnalyzeWorkEqualModifyCount(work,modify))	return;

			if(!(param.result)){
				complete();
				return;
			}

			var event_dispatcher = AnalyzeWorkGetEventDispatcher(work);
			var loader = null;
			var popup_image = null;
			var begin_area = null;
			var event_handler = null;
			var observer_remove = null;
			var limitter_element = null;
			var notify_element = null;

			// ダウンロードリストに登録
			var item = download_list_image.createItem();
			item.setURL(url);

			// ポップアップイメージを破棄(ElementLimiter 用)
			function releasePopupImageForElementLimiter(e){
				// ローダーを中断
				if(loader){
					loader.onload = null;
					loader.onerror = null;
					loader = null;
				}

				// ワークを破棄
				if(popup_image){
					popup_image.suicide();
					popup_image = null;
				}

				// イベントハンドラを破棄
				if(event_handler){
					event_handler.release();
					event_handler = null;
				}

				// 監視を破棄
				if(observer_remove){
					observer_remove.release();
					observer_remove = null;
				}

				// 通知破棄
				if(notify_element){
					notify_element.release();
					notify_element = null;
				}
			}

			// ポップアップイメージを破棄
			function releasePopupImage(e){
				releasePopupImageForElementLimiter(e);

				AnalyzeWorkClearPopupImage(work);

				if(limitter_element){
					limitter_element.release();
					limitter_element = null;
				}
			}

			// 開放イベントを発行
			function dispatchEventRelease(e){
				event_dispatcher.dispatchEvent("release",null);
			}

			// ポップアップイメージを登録
			function createPopupImage(e){
				if(project.getEnableLoadNotifyExpandImage()){
					notify_element = notify_progress.createElement();
				}
				if(notify_element){
					notify_element.setElementHitArea(element);
					notify_element.setNotify(NotifyProgress.NOTIFY_TYPE_LOADING);
				}

				// 画像の読み込み
				loader = new Loader();
				loader.onload = function(image){
					complete();

					// 画像サイズをセット
					var image_size = ImageGetNaturalSize(image);
					limitter_element.setByteSize(image_size.width * image_size.height * 4);

					// 古い要素を破棄
					element_limitter_image.removeOldElements();
					if(!loader)	return;

					// 1ドット画像を排除
					if(image_size.width > 1){
					}else if(image_size.height > 1){
					}else{
						releasePopupImage();
						return;
					}

					// 画像を1つだけ保有するなら画像を開始矩形とする
					(function(){
						var begin_element = null;

						if(element.tagName == "IMG"){
							if(ElementGetVisibility(element)){
								begin_element = element;
							}
						}

						var nodes = ElementGetElementsByTagName(element,"img");
						var i;
						var num = nodes.length;
						for(i=0;i<num;i++){
							var node = nodes[i];
							if(ElementGetVisibility(node)){
								if(begin_element) return;
								begin_element = node;
							}
						}

						if(begin_element){
							begin_area = begin_element;
						}
					})();

					// 矩形が画像サイズより小さいか
					if(!begin_area){
						var r = DomTreeGetBoundingClientRect(element);
						if((r.bottom - r.top) > image_size.height){
						}else if((r.right - r.left) > image_size.width){
						}else{
							begin_area = element;
						}
					}

					// 既存の PopupImage を全て破棄
					PopupReducedImageReleaseAll(element);

					// 開始矩形エレメントを監視
					if(begin_area){
						observer_remove = new DomNodeObserverRemoveFromDocument(begin_area);
					}

					// 開始範囲のリムーブ監視
					if(observer_remove){
						observer_remove.setFunction(dispatchEventRelease);
					}

					// ポップアップイメージを作成
					popup_image = new PopupImage(image);
					popup_image.setElementParent(document.body);
					popup_image.setElementAnchor(element);
					popup_image.setElementHitArea(element);
					popup_image.setElementBeginArea(begin_area);
					popup_image.setOriginalURL(url);
					AnalyzeWorkSetPopupImage(work,popup_image);

					// 成功通知
					if(notify_element){
						notify_element.setNotify(NotifyProgress.NOTIFY_TYPE_COMPLETE);
						notify_element.release();
						notify_element = null;
					}

					// ポップアップ
					if(ElementHitTestMousePosition(element,input_mouse.getPositionClient(),true)){
						popup_image.popup();
					}
				};

				loader.onerror = function(){
					complete();

					// 失敗通知
					if(notify_element){
						notify_element.setNotify(NotifyProgress.NOTIFY_TYPE_ERROR);
					}
				};
				loader.setMethod("GET");
				loader.setURL(url);
				loader.loadImage();
			}

			// イベントハンドラを作成
			event_handler = event_dispatcher.createEventHandler("release");
			event_handler.setFunction(releasePopupImage);

			// イメージ管理
			limitter_element = element_limitter_image.createElement();
			limitter_element.onattach = function(){
				createPopupImage();
			};
			limitter_element.onremove = function(){
				releasePopupImageForElementLimiter();
			};
			limitter_element.setElementHitArea(element);
			limitter_element.setEnablePreload(project.getEnablePreLoadPopupImage());

			// 更新
			limitter_element.update();
		}

		// コールバック関数を実行
		var request = {
			element:element,
			url:url,
			content_type:content_type,
			is_overridden_url:AnalyzeWorkGetOverrodeUrl(work)
		};
		project.executeScriptAllowPopupImage(request,response_allow);

	}

	// -
	// インラインサウンド
	// -
	function ElementExpandInlineSound(param){
		var work = param.work;
		var modify = param.modify;
		var element = AnalyzeWorkGetDomNode(work);
		var url = AnalyzeWorkGetExpandUrl(work);
		var content_type = AnalyzeWorkGetContentType(work);

		if(!AnalyzeWorkEqualModifyCount(work,modify))	return;

		function complete(){
		}

		function response_allow(response){
			if(!AnalyzeWorkEqualModifyCount(work,modify))	return;

			if(!(response.result)){
				complete();
				return;
			}

			// AudioElement
			ElementExpandInlineAudioElement(param);
			// SoundCloud
			ElementExpandInlinePlayerSoundcloud(param);
			// MixCloud
			ElementExpandInlinePlayerMixcloud(param);
		}

		// コールバック関数を実行
		var request = {
			element:element,
			url:url,
			content_type:content_type,
			is_overridden_url:AnalyzeWorkGetOverrodeUrl(work)
		};
		project.executeScriptAllowInlineSound(request,response_allow);
	}

	// -
	// インライン AudioElement
	// -
	function ElementExpandInlineAudioElement(param){
		var work = param.work;
		var modify = param.modify;
		var element = AnalyzeWorkGetDomNode(work);
		var url = AnalyzeWorkGetExpandUrl(work);
		url = project.fixURL_PassiveContent(url);
		var content_type = AnalyzeWorkGetContentType(work);

		if(!AnalyzeWorkEqualModifyCount(work,modify))	return;

		function complete(){
		}

		function response_allow(param){
			if(!AnalyzeWorkEqualModifyCount(work,modify))	return;
			if(!(param.result)){
				complete();
				return;
			}

			var event_dispatcher = AnalyzeWorkGetEventDispatcher(work);
			var loader = null;
			var audio = null;
			var audio_analyze_work = null;
			var audio_url = url;
			var event_handler = null;
			var limitter_element = null;
			var observer_remove = null;
			var media_player_ui = null;

			// 開放イベントを発行
			function dispatchEventRelease(e){
				event_dispatcher.dispatchEvent("release",null);
			}

			// オーディオエレメントを破棄
			function releaseAudioElement(e){
				// ローダーを中断
				if(loader){
					loader.onload = null;
					loader.onerror = null;
					loader = null;
				}

				// アドレスの登録を外す
				if(audio_url){
					address_collection.removeAddress("sound",audio_url);
					audio_url = null;
				}

				// イベントハンドラを破棄
				if(event_handler){
					event_handler.release();
					event_handler = null;
				}

				if(limitter_element){
					limitter_element.onremove = null;
					limitter_element.release();
					limitter_element = null;
				}

				// 監視を破棄
				if(observer_remove){
					observer_remove.release();
					observer_remove = null;
				}

				// メディアプレイヤー UI を破棄
				if(media_player_ui){
					media_player_ui.release();
					media_player_ui = null;
				}

				// 解析辞書除外
				if(audio_analyze_work){
					analyze_work_dictionary.removeAnalyzeWork(audio_analyze_work);
					audio_analyze_work = null;
				}

				// オーディオエレメントを外す
				if(audio){
					DomNodeRemove(audio);
					audio = null;
				}
			}

			// 重複チェック
			if(project.getDisableSameInlineSound()){
				if(address_collection.hasAddress("sound",audio_url)){
					audio_url = null;
					releaseAudioElement();
					complete();
					return;
				}
				// アドレスを登録
				address_collection.addAddress("sound",audio_url);
			}

			// イベントハンドラを作成
			event_handler = event_dispatcher.createEventHandler("release");
			event_handler.setFunction(releaseAudioElement);

			// オーディオの読み込み
			loader = new Loader();
			loader.onload = function(audio_element){
				audio = audio_element;

				// 解析ワーク作成
				audio_analyze_work = AnalyzeWorkCreate(audio);

				// 解析辞書登録オプション
				var attach_options = new AnalyzeWorkDictionaryAttachOptions();
				attach_options.SetOutsider();

				// 解析辞書登録
				analyze_work_dictionary.attachAnalyzeWork(audio_analyze_work,attach_options);

				complete();

				// スタイルをセット
				ElementSetStyle(audio,project.getStyleSheetExpandSoundInlineAudioElement(audio_url));

				// オーディオエレメントのリムーブ監視
				observer_remove = new DomNodeObserverRemoveFromDocument(audio);
				observer_remove.setFunction(dispatchEventRelease);

				// メディアプレイヤー UI
				media_player_ui = new MediaPlayerExtendUI(audio);
				var event_handler_close = media_player_ui.createEventHandler("close");
				event_handler_close.setFunction(dispatchEventRelease);

				function responseInsert(){
					if(!audio)	return;

					limitter_element = element_limitter_sound.createElement();
					limitter_element.onattach = function(){
						//audio.preload = "metadata";
						//audio.src = audio_url;
						//audio.load();
					};
					limitter_element.onremove = function(){
						audio.preload = "none";
						//audio.src = "";
						audio.load();
					};
					limitter_element.setElementHitArea(audio);

					// 更新
					limitter_element.update();
				}

				// コールバック関数を実行
				project.executeScriptInsertInlineSound(element,audio,work.event_dispatcher,responseInsert);
			};

			loader.onerror = function(){
				complete();
			};
			loader.setMethod("GET");
			loader.setURL(audio_url);
			loader.loadAudio();
		}

		// コールバック関数を実行
		project.executeScriptAllowAudioElement(element,url,content_type,response_allow);
	}

	// -
	// インラインプレイヤー Soundcloud
	// -
	function ElementExpandInlinePlayerSoundcloud(param){
		var work = param.work;
		var modify = param.modify;
		var element = AnalyzeWorkGetDomNode(work);
		var url = AnalyzeWorkGetExpandUrl(work);

		if(!AnalyzeWorkEqualModifyCount(work,modify))	return;

		function complete(){
		}

		// soundcloud.com 内では動作禁止
		var deny_list = [
			"*://soundcloud.com/*",
			"*://*.soundcloud.com/*"
		];
		var i;
		var num = deny_list.length;
		for(i=0;i<num;i++){
			if(StringUrlMatchAsteriskWord(document.URL,deny_list[i])){
				return;
			}
		}

		// 動画を展開
		function expand_player(){

			// 展開処理の完了
			function expand_player_complete(){
			}

			if(project.getVisiblePlayerHtml5Soundcloud()){
				(function(){
					var iframe_url = "https://w.soundcloud.com/player/?url=" + encodeURIComponent(url);
					var height = 166;

					var event_dispatcher = AnalyzeWorkGetEventDispatcher(work);
					var iframe = null;
					var iframe_analyze_work = null;
					var event_handler = null;
					var limitter_element = null;
					var observer_remove = null;
					var media_player_ui = null;

					// 開放イベントを発行
					function dispatchEventRelease(e){
						event_dispatcher.dispatchEvent("release",null);
					}

					// インラインフレームを破棄
					function releaseIframeHtml5(e){
						// アドレスの登録を外す
						if(iframe_url){
							address_collection.removeAddress("sound",iframe_url);
							iframe_url = null;
						}

						// イベントハンドラを破棄
						if(event_handler){
							event_handler.release();
							event_handler = null;
						}

						if(limitter_element){
							limitter_element.onremove = null;
							limitter_element.release();
							limitter_element = null;
						}

						// 監視を破棄
						if(observer_remove){
							observer_remove.release();
							observer_remove = null;
						}

						// メディアプレイヤー UI を破棄
						if(media_player_ui){
							media_player_ui.release();
							media_player_ui = null;
						}

						// 解析辞書除外
						if(iframe_analyze_work){
							analyze_work_dictionary.removeAnalyzeWork(iframe_analyze_work);
							iframe_analyze_work = null;
						}

						// インラインフレームを外す
						if(iframe){
							DomNodeRemove(iframe);
							iframe = null;
						}
					}

					// 混在コンテンツの展開が可能か
					if(!(project.checkAllowExpandIframeElement(iframe_url))){
						releaseIframeHtml5();
						complete();
						return;
					}

					// 重複チェック
					if(project.getDisableSameInlineSound()){
						if(address_collection.hasAddress("sound",iframe_url)){
							iframe_url = null;
							releaseIframeHtml5();
							complete();
							return;
						}
						// アドレスを登録
						address_collection.addAddress("sound",iframe_url);
					}

					// イベントハンドラを作成
					event_handler = event_dispatcher.createEventHandler("release");
					event_handler.setFunction(releaseIframeHtml5);

					// インラインフレームを作成
					iframe = DocumentCreateElement('iframe');
					iframe.frameBorder = "0";
					iframe.scrolling = "no";
					iframe.allowFullscreen = true;

					// スタイルをセット
					ElementSetStyle(iframe,project.getStyleSheetExpandSoundSoundcloudInlinePlayerHtml5());

					if(height){
						// 高さを設定
						iframe.style.height = parseInt(height) + "px";
					}

					// 解析ワーク作成
					iframe_analyze_work = AnalyzeWorkCreate(iframe);

					// 解析辞書登録オプション
					var attach_options = new AnalyzeWorkDictionaryAttachOptions();
					attach_options.SetOutsider();

					// 解析辞書登録
					analyze_work_dictionary.attachAnalyzeWork(iframe_analyze_work,attach_options);

					// インラインフレームのリムーブ監視
					observer_remove = new DomNodeObserverRemoveFromDocument(iframe);
					observer_remove.setFunction(dispatchEventRelease);

					// メディアプレイヤー UI
					media_player_ui = new MediaPlayerExtendUI(iframe);
					var event_handler_close = media_player_ui.createEventHandler("close");
					event_handler_close.setFunction(dispatchEventRelease);

					function responseInsertHtml5(){
						if(!iframe)	return;

						limitter_element = element_limitter_sound.createElement();
						limitter_element.onattach = function(){
							iframe.src = iframe_url;
						};
						limitter_element.onremove = function(){
							iframe.src = "";
						};
						limitter_element.setElementHitArea(iframe);

						// 更新
						limitter_element.update();
					}

					// コールバック関数を実行
					project.executeScriptInsertInlineSound(element,iframe,work.event_dispatcher,responseInsertHtml5);
				})();
			}

		}

		if(project.getVisiblePlayerHtml5Soundcloud()){

			// soundcloud.com へのリンク
			var allow_list = [
				"(http|https)://soundcloud\\.com/.+?/.+([?]|$)"
			];
			num = allow_list.length;
			for(i=0;i<num;i++){
				if(url.match(new RegExp(allow_list[i],"i"))){
					expand_player();
					return;
				}
			}
		}

		// 完了
		complete();
	}

	// -
	// インラインプレイヤー Mixcloud
	// -
	function ElementExpandInlinePlayerMixcloud(param){
		var work = param.work;
		var modify = param.modify;
		var element = AnalyzeWorkGetDomNode(work);
		var url = AnalyzeWorkGetExpandUrl(work);

		if(!AnalyzeWorkEqualModifyCount(work,modify))	return;

		function complete(){
		}

		// www.mixcloud.com 内では動作禁止
		var deny_list = [
			"*://mixcloud.com/*",
			"*://*.mixcloud.com/*"
		];
		var i;
		var num = deny_list.length;
		for(i=0;i<num;i++){
			if(StringUrlMatchAsteriskWord(document.URL,deny_list[i])){
				return;
			}
		}

		// 動画を展開
		function expand_player(path){

			// 展開処理の完了
			function expand_player_complete(){
			}

			var event_dispatcher = AnalyzeWorkGetEventDispatcher(work);
			var iframe = null;
			var iframe_analyze_work = null;
			var iframe_url = "https://www.mixcloud.com/widget/iframe/?hide_cover=1&light=1&feed=" + encodeURIComponent(path);
			var event_handler = null;
			var limitter_element = null;
			var observer_remove = null;
			var media_player_ui = null;

			// 開放イベントを発行
			function dispatchEventRelease(e){
				event_dispatcher.dispatchEvent("release",null);
			}

			// インラインフレームを破棄
			function releaseIframe(e){
				// アドレスの登録を外す
				if(iframe_url){
					address_collection.removeAddress("sound",iframe_url);
					iframe_url = null;
				}

				// イベントハンドラを破棄
				if(event_handler){
					event_handler.release();
					event_handler = null;
				}

				if(limitter_element){
					limitter_element.onremove = null;
					limitter_element.release();
					limitter_element = null;
				}

				// 監視を破棄
				if(observer_remove){
					observer_remove.release();
					observer_remove = null;
				}

				// メディアプレイヤー UI を破棄
				if(media_player_ui){
					media_player_ui.release();
					media_player_ui = null;
				}

				// 解析辞書除外
				if(iframe_analyze_work){
					analyze_work_dictionary.removeAnalyzeWork(iframe_analyze_work);
					iframe_analyze_work = null;
				}

				// インラインフレームを外す
				if(iframe){
					DomNodeRemove(iframe);
					iframe = null;
				}
			}

			// イベントハンドラを作成
			event_handler = event_dispatcher.createEventHandler("release");
			event_handler.setFunction(releaseIframe);

			// 混在コンテンツの展開が可能か
			if(!(project.checkAllowExpandIframeElement(iframe_url))){
				releaseIframe();
				complete();
				return;
			}

			// 重複チェック
			if(project.getDisableSameInlineSound()){
				if(address_collection.hasAddress("sound",iframe_url)){
					iframe_url = null;
					releaseIframe();
					complete();
					return;
				}
				// アドレスを登録
				address_collection.addAddress("sound",iframe_url);
			}

			// インラインフレームを作成
			iframe = DocumentCreateElement('iframe');
			iframe.frameBorder = "0";
			iframe.scrolling = "no";
			iframe.allowFullscreen = true;

			// スタイルをセット
			ElementSetStyle(iframe,project.getStyleSheetExpandSoundMixcloudInlinePlayer());

			// 高さを設定
			iframe.style.height = 120 + "px";

			// 解析ワーク作成
			iframe_analyze_work = AnalyzeWorkCreate(iframe);

			// 解析辞書登録オプション
			var attach_options = new AnalyzeWorkDictionaryAttachOptions();
			attach_options.SetOutsider();

			// 解析辞書登録
			analyze_work_dictionary.attachAnalyzeWork(iframe_analyze_work,attach_options);

			// インラインフレームのリムーブ監視
			observer_remove = new DomNodeObserverRemoveFromDocument(iframe);
			observer_remove.setFunction(dispatchEventRelease);

			// メディアプレイヤー UI
			media_player_ui = new MediaPlayerExtendUI(iframe);
			var event_handler_close = media_player_ui.createEventHandler("close");
			event_handler_close.setFunction(dispatchEventRelease);

			function responseInsert(){
				if(!iframe)	return;

				limitter_element = element_limitter_sound.createElement();
				limitter_element.onattach = function(){
					iframe.src = iframe_url;
				};
				limitter_element.onremove = function(){
					iframe.src = "";
				};
				limitter_element.setElementHitArea(iframe);

				// 更新
				limitter_element.update();
			}

			// コールバック関数を実行
			project.executeScriptInsertInlineSound(element,iframe,work.event_dispatcher,responseInsert);
		}

		if(project.getVisiblePlayerMixcloud()){

			// mixcloud.com へのリンク
			var allow_list = [
				"^(http|https)://[^.]+\\.mixcloud\\.com/([^/]+)[/]([^/]+)[/]([?]|$)"
			];

			var forbid_user = {live:1,discover:1,upload:1,pro:1};
			var forbid_name = {stream:1,uploads:1,favorites:1,listens:1,playlists:1};

			num = allow_list.length;
			for(i=0;i<num;i++){
				var m = url.match(new RegExp(allow_list[i],"i"));
				if(m){
					if(!(forbid_user[m[2]]) && !(forbid_name[m[3]])){
						expand_player("/"+m[2]+"/"+m[3]+"/");
						return;
					}
				}
			}
		}

		// 完了
		complete();
	}

	// -
	// インラインビデオ
	// -
	function ElementExpandInlineVideo(param){
		var work = param.work;
		var modify = param.modify;
		var element = AnalyzeWorkGetDomNode(work);
		var url = AnalyzeWorkGetExpandUrl(work);
		var content_type = AnalyzeWorkGetContentType(work);

		if(!AnalyzeWorkEqualModifyCount(work,modify))	return;

		function complete(){
		}

		function response_allow(response){
			if(!AnalyzeWorkEqualModifyCount(work,modify))	return;

			if(!(response.result)){
				complete();
				return;
			}

			// VideoElement
			ElementExpandInlineVideoElement(param);
			// youtube
			ElementExpandInlineVideoYoutube(param);
			// nicovideo
			ElementExpandInlineVideoNicovideo(param);
			// dailymotion
			ElementExpandInlineVideoDailymotion(param);
			// vimeo
			ElementExpandInlineVideoVimeo(param);
		}

		// コールバック関数を実行
		var request = {
			element:element,
			url:url,
			content_type:content_type,
			is_overridden_url:AnalyzeWorkGetOverrodeUrl(work)
		};
		project.executeScriptAllowInlineVideo(request,response_allow);
	}

	// -
	// インライン VideoElement
	// -
	function ElementExpandInlineVideoElement(param){
		var work = param.work;
		var modify = param.modify;
		var element = AnalyzeWorkGetDomNode(work);
		var url = AnalyzeWorkGetExpandUrl(work);
		url = project.fixURL_PassiveContent(url);
		var content_type = AnalyzeWorkGetContentType(work);

		if(!AnalyzeWorkEqualModifyCount(work,modify))	return;

		function complete(){
		}

		function response_allow(param){
			if(!AnalyzeWorkEqualModifyCount(work,modify))	return;

			if(!(param.result)){
				complete();
				return;
			}

			var event_dispatcher = AnalyzeWorkGetEventDispatcher(work);
			var loader = null;
			var video = null;
			var video_analyze_work = null;
			var video_url = url;
			var event_handler = null;
			var limitter_element = null;
			var observer_remove = null;
			var media_player_ui = null;

			// 開放イベントを発行
			function dispatchEventRelease(e){
				event_dispatcher.dispatchEvent("release",null);
			}

			// ビデオエレメントを破棄
			function releaseVideoElement(e){
				// ローダーを中断
				if(loader){
					loader.onload = null;
					loader.onerror = null;
					loader = null;
				}

				// アドレスの登録を外す
				if(video_url){
					address_collection.removeAddress("video",video_url);
					video_url = null;
				}

				// イベントハンドラを破棄
				if(event_handler){
					event_handler.release();
					event_handler = null;
				}

				if(limitter_element){
					limitter_element.onremove = null;
					limitter_element.release();
					limitter_element = null;
				}

				// 監視を破棄
				if(observer_remove){
					observer_remove.release();
					observer_remove = null;
				}

				// メディアプレイヤー UI を破棄
				if(media_player_ui){
					media_player_ui.release();
					media_player_ui = null;
				}

				// 解析辞書除外
				if(video_analyze_work){
					analyze_work_dictionary.removeAnalyzeWork(video_analyze_work);
					video_analyze_work = null;
				}

				// ビデオエレメントを外す
				if(video){
					DomNodeRemove(video);
					video = null;
				}
			}

			// 重複チェック
			if(project.getDisableSameInlineVideo()){
				if(address_collection.hasAddress("video",video_url)){
					video_url = null;
					releaseVideoElement();
					complete();
					return;
				}
				// アドレスを登録
				address_collection.addAddress("video",video_url);
			}

			// イベントハンドラを作成
			event_handler = event_dispatcher.createEventHandler("release");
			event_handler.setFunction(releaseVideoElement);

			// ビデオの読み込み
			loader = new Loader();
			loader.onload = function(video_element){
				video = video_element;

				// 解析ワーク作成
				video_analyze_work = AnalyzeWorkCreate(video);

				// 解析辞書登録オプション
				var attach_options = new AnalyzeWorkDictionaryAttachOptions();
				attach_options.SetOutsider();

				// 解析辞書登録
				analyze_work_dictionary.attachAnalyzeWork(video_analyze_work,attach_options);

				complete();

				// スタイルをセット
				ElementSetStyle(video,project.getStyleSheetExpandVideoInlineVideoElement(video_url));

				// ビデオエレメントのリムーブ監視
				observer_remove = new DomNodeObserverRemoveFromDocument(video);
				observer_remove.setFunction(dispatchEventRelease);

				// メディアプレイヤー UI
				media_player_ui = new MediaPlayerExtendUI(video);
				var event_handler_close = media_player_ui.createEventHandler("close");
				event_handler_close.setFunction(dispatchEventRelease);

				function responseInsert(){
					if(!video)	return;

					limitter_element = element_limitter_video.createElement();
					limitter_element.onattach = function(){
						//video.preload = "metadata";
						//video.src = video_url;
						//video.load();
					};
					limitter_element.onremove = function(){
						video.preload = "none";
						//video.src = "";
						video.load();
					};
					limitter_element.setElementHitArea(video);

					// 更新
					limitter_element.update();
				}

				// コールバック関数を実行
				project.executeScriptInsertInlineVideo(element,video,work.event_dispatcher,responseInsert);
			};

			loader.onerror = function(){
				complete();
			};
			loader.setMethod("GET");
			loader.setURL(video_url);
			loader.loadVideo();
		}

		// コールバック関数を実行
		project.executeScriptAllowVideoElement(element,url,content_type,response_allow);
	}

	// -
	// インラインビデオ youtube
	// -
	function ElementExpandInlineVideoYoutube(param){
		var work = param.work;
		var modify = param.modify;
		var element = AnalyzeWorkGetDomNode(work);
		var url = AnalyzeWorkGetExpandUrl(work);

		if(!AnalyzeWorkEqualModifyCount(work,modify))	return;

		function complete(){
		}

		// youtube.com 内では動作禁止
		var deny_list = [
			"*://*.youtube.com/*",
			"*://youtube.com/*"
		];
		var i;
		var num = deny_list.length;
		for(i=0;i<num;i++){
			if(StringUrlMatchAsteriskWord(document.URL,deny_list[i])){
				return;
			}
		}

		// 動画を展開
		function expand_video(url){

			var event_dispatcher = AnalyzeWorkGetEventDispatcher(work);
			var iframe = null;
			var iframe_analyze_work = null;
			var iframe_url = url;
			var event_handler = null;
			var limitter_element = null;
			var observer_remove = null;
			var media_player_ui = null;

			// 開放イベントを発行
			function dispatchEventRelease(e){
				event_dispatcher.dispatchEvent("release",null);
			}

			// インラインフレームを破棄
			function releaseIframe(e){
				// アドレスの登録を外す
				if(iframe_url){
					address_collection.removeAddress("video",iframe_url);
					iframe_url = null;
				}

				// イベントハンドラを破棄
				if(event_handler){
					event_handler.release();
					event_handler = null;
				}

				if(limitter_element){
					limitter_element.onremove = null;
					limitter_element.release();
					limitter_element = null;
				}

				// 監視を破棄
				if(observer_remove){
					observer_remove.release();
					observer_remove = null;
				}

				// メディアプレイヤー UI を破棄
				if(media_player_ui){
					media_player_ui.release();
					media_player_ui = null;
				}

				// 解析辞書除外
				if(iframe_analyze_work){
					analyze_work_dictionary.removeAnalyzeWork(iframe_analyze_work);
					iframe_analyze_work = null;
				}

				// インラインフレームを外す
				if(iframe){
					DomNodeRemove(iframe);
					iframe = null;
				}
			}

			// 混在コンテンツの展開が可能か
			if(!(project.checkAllowExpandIframeElement(iframe_url))){
				releaseIframe();
				complete();
				return;
			}

			// 重複チェック
			if(project.getDisableSameInlineVideo()){
				if(address_collection.hasAddress("video",iframe_url)){
					iframe_url = null;
					releaseIframe();
					complete();
					return;
				}
				// アドレスを登録
				address_collection.addAddress("video",iframe_url);
			}

			// イベントハンドラを作成
			event_handler = event_dispatcher.createEventHandler("release");
			event_handler.setFunction(releaseIframe);

			// インラインフレームを作成
			iframe = DocumentCreateElement('iframe');
			iframe.frameBorder = "0";
			iframe.scrolling = "no";
			iframe.allowFullscreen = true;

			// スタイルをセット
			ElementSetStyle(iframe,project.getStyleSheetExpandVideoYoutubeInlineVideo());

			// 解析ワーク作成
			iframe_analyze_work = AnalyzeWorkCreate(iframe);

			// 解析辞書登録オプション
			var attach_options = new AnalyzeWorkDictionaryAttachOptions();
			attach_options.SetOutsider();

			// 解析辞書登録
			analyze_work_dictionary.attachAnalyzeWork(iframe_analyze_work,attach_options);

			// インラインフレームのリムーブ監視
			observer_remove = new DomNodeObserverRemoveFromDocument(iframe);
			observer_remove.setFunction(dispatchEventRelease);

			// メディアプレイヤー UI
			media_player_ui = new MediaPlayerExtendUI(iframe);
			var event_handler_close = media_player_ui.createEventHandler("close");
			event_handler_close.setFunction(dispatchEventRelease);

			function responseInsert(){
				if(!iframe)	return;

				limitter_element = element_limitter_video.createElement();
				limitter_element.onattach = function(){
					iframe.src = iframe_url;
				};
				limitter_element.onremove = function(){
					iframe.src = "";
				};
				limitter_element.setElementHitArea(iframe);

				// 更新
				limitter_element.update();
			}

			// コールバック関数を実行
			project.executeScriptInsertInlineVideo(element,iframe,work.event_dispatcher,responseInsert);
		}

		function getHashQuery(url){
			var q = new Object();
			var m = url.match(new RegExp("[#](.*?)([?]|$)"));
			if(!m)	return q;
			var a = m[1].split('&');
			var i;
			var num = a.length;
			for(i=0;i<num;i++){
				var b = a[i].split('=');
				if(b.length == 2){
					q[b[0]] = b[1];
				}
			}
			return q;
		}

		function getIframeURL(url,v){
			var q = StringGetQuery(url);
			var h = getHashQuery(url);
			var start = q["t"] || h["t"];
			if(start){
				var t = 0;
				var m;
				m = start.match(/([0-9]+)h/i);
				if(m){
					t += parseInt(m[1]) * 60 * 60;
				}
				m = start.match(/([0-9]+)m/i);
				if(m){
					t += parseInt(m[1]) * 60;
				}
				m = start.match(/([0-9]+)s/i);
				if(m){
					t += parseInt(m[1]);
				}
				if(t){
					start = t + "";
				}
				m = start.match(/([0-9]+)/i);
				if(m){
					start = m[1];
				}else{
					start = "";
				}
			}
			var protocol = project.getSecureCurrent() ? "https" : "http";
			var iframe_url = protocol + "://www.youtube-nocookie.com/embed/" + v;
			if(start) iframe_url += "?start=" + start;
			return iframe_url;
		}

		if(project.getVisibleVideoYoutube()){
			// youtube へのリンク
			var allow_list_query = [
				"*://www.youtube.com/watch?*",
				"*://www.youtube.com/watch_popup?*",
				"*://m.youtube.com/watch?*",
				"*://m.youtube.com/#/watch?*"
			];
			num = allow_list_query.length;
			for(i=0;i<num;i++){
				if(StringUrlMatchAsteriskWord(url,allow_list_query[i])){
					var query = StringGetQuery(url);
					if(query.v){
						expand_video(getIframeURL(url,query.v));
						return;
					}
				}
			}

			// 短縮 URL など
			var allow_list_regexp = [
				"(http|https)://www\\.youtube\\.com/v/",
				"(http|https)://youtu\\.be/"
			];
			num = allow_list_regexp.length;
			for(i=0;i<num;i++){
				if(url.match(new RegExp(allow_list_regexp[i],"i"))){
					if(RegExp.rightContext.match(new RegExp("^([-_a-zA-Z0-9]+)","i"))){
						expand_video(getIframeURL(url,RegExp.$1));
						return;
					}
				}
			}
		}

		// 完了
		complete();
	}

	// -
	// インラインビデオ nicovideo
	// -
	function ElementExpandInlineVideoNicovideo(param){
		var work = param.work;
		var modify = param.modify;
		var element = AnalyzeWorkGetDomNode(work);
		var url = AnalyzeWorkGetExpandUrl(work);

		if(!AnalyzeWorkEqualModifyCount(work,modify))	return;

		function complete(){
		}

		// .nicovideo.jp 内では動作禁止
		var deny_list = [
			"*://nicovideo.jp/*",
			"*://*.nicovideo.jp/*"
		];
		var i;
		var num = deny_list.length;
		for(i=0;i<num;i++){
			if(StringUrlMatchAsteriskWord(document.URL,deny_list[i])){
				return;
			}
		}

		// 動画を展開
		function expand_video(video_id,language){

			(function(){

				// 展開処理の完了
				function expand_video_complete(){
				}

				var event_dispatcher = AnalyzeWorkGetEventDispatcher(work);
				var iframe = null;
				var iframe_analyze_work = null;
				var iframe_url = "https://embed.nicovideo.jp/watch/" + video_id;
				var event_handler = null;
				var limitter_element = null;
				var observer_remove = null;
				var media_player_ui = null;

				// 開放イベントを発行
				function dispatchEventRelease(e){
					event_dispatcher.dispatchEvent("release",null);
				}

				// インラインフレームを破棄
				function releaseIframe(e){
					// アドレスの登録を外す
					if(iframe_url){
						address_collection.removeAddress("video",iframe_url);
						iframe_url = null;
					}

					// イベントハンドラを破棄
					if(event_handler){
						event_handler.release();
						event_handler = null;
					}

					if(limitter_element){
						limitter_element.onremove = null;
						limitter_element.release();
						limitter_element = null;
					}

					// 監視を破棄
					if(observer_remove){
						observer_remove.release();
						observer_remove = null;
					}

					// メディアプレイヤー UI を破棄
					if(media_player_ui){
						media_player_ui.release();
						media_player_ui = null;
					}

					// 解析辞書除外
					if(iframe_analyze_work){
						analyze_work_dictionary.removeAnalyzeWork(iframe_analyze_work);
						iframe_analyze_work = null;
					}

					// インラインフレームを外す
					if(iframe){
						DomNodeRemove(iframe);
						iframe = null;
					}
				}

				// 混在コンテンツの展開が可能か
				if(!(project.checkAllowExpandIframeElement(iframe_url))){
					releaseIframe();
					expand_video_complete();
					return;
				}

				// 重複チェック
				if(project.getDisableSameInlineVideo()){
					if(address_collection.hasAddress("video",iframe_url)){
						iframe_url = null;
						releaseIframe();
						complete();
						return;
					}
					// アドレスを登録
					address_collection.addAddress("video",iframe_url);
				}

				// イベントハンドラを作成
				event_handler = event_dispatcher.createEventHandler("release");
				event_handler.setFunction(releaseIframe);

				iframe = DocumentCreateElement('iframe');
				iframe.frameBorder = "0";
				iframe.scrolling = "no";
				iframe.allowFullscreen = true;

				// スタイルをセット
				ElementSetStyle(iframe,project.getStyleSheetExpandVideoNicovideoInlineVideo());

				// 解析ワーク作成
				iframe_analyze_work = AnalyzeWorkCreate(iframe);

				// 解析辞書登録オプション
				var attach_options = new AnalyzeWorkDictionaryAttachOptions();
				attach_options.SetOutsider();

				// 解析辞書登録
				analyze_work_dictionary.attachAnalyzeWork(iframe_analyze_work,attach_options);

				// インラインフレームのリムーブ監視
				observer_remove = new DomNodeObserverRemoveFromDocument(iframe);
				observer_remove.setFunction(dispatchEventRelease);

				// メディアプレイヤー UI
				media_player_ui = new MediaPlayerExtendUI(iframe);
				var event_handler_close = media_player_ui.createEventHandler("close");
				event_handler_close.setFunction(dispatchEventRelease);

				function responseInsert(){
					if(!iframe)	return;

					limitter_element = element_limitter_video.createElement();
					limitter_element.onattach = function(){
						iframe.src = iframe_url;
					};
					limitter_element.onremove = function(){
						iframe.src = "";
					};
					limitter_element.setElementHitArea(iframe);

					// 更新
					limitter_element.update();

					expand_video_complete();
				}

				// コールバック関数を実行
				project.executeScriptInsertInlineVideo(element,iframe,work.event_dispatcher,responseInsert);
			})();
		}

		// nicovideo.jp へのリンク
		var allow_list_video = [
			"(http|https)://.*\\.nicovideo\\.jp/watch/",
			"(http|https)://nicovideo\\.jp/watch/",
			"(http|https)://nico\\.ms/.*/",
			"(http|https)://nico\\.ms/"
		];
		num = allow_list_video.length;
		for(i=0;i<num;i++){
			if(url.match(new RegExp(allow_list_video[i],"i"))){
				var language = null;
				var video_id = RegExp.rightContext;

				if(video_id.match(new RegExp("^(.*?)[?#]","i"))){
					video_id = RegExp.$1;
				}

				// アルファベット2文字 + 数値
				if(video_id.match(/([a-z]{2})([0-9]+$)/i)){
					video_id = RegExp.$1 + RegExp.$2;

					// 接尾辞
					switch(RegExp.$1){
					case "im":
					case "mg":
					case "lv":
					case "bk":
					case "nw":
					case "co":
						video_id = null;
						break;
					}
				}

				// nicovideo.jp サブドメイン
				if(url.match(new RegExp("^(http|https)://([a-z]+?)\\.nicovideo\\.jp/","i"))){
					// 対応言語
					switch(RegExp.$2){
					case "de":
					case "es":
					case "tw":
						language = RegExp.$2;
						break;
					}

					switch(RegExp.$2){
					case "live":
					case "news":
					case "seiga":
						video_id = null;
						break;
					}
				}

				if(video_id){
					if(project.getVisibleVideoNicovideo()){
						expand_video(video_id,language);
						return;
					}
				}
			}
		}

		// 完了
		complete();
	}

	// -
	// インラインビデオ dailymotion
	// -
	function ElementExpandInlineVideoDailymotion(param){
		var work = param.work;
		var modify = param.modify;
		var element = AnalyzeWorkGetDomNode(work);
		var url = AnalyzeWorkGetExpandUrl(work);

		if(!AnalyzeWorkEqualModifyCount(work,modify))	return;

		function complete(){
		}

		// www.dailymotion.com 内では動作禁止
		var deny_list = [
			"*//www.dailymotion.com/*"
		];
		var i;
		var num = deny_list.length;
		for(i=0;i<num;i++){
			if(StringUrlMatchAsteriskWord(document.URL,deny_list[i])){
				return;
			}
		}

		// 動画を展開
		function expand_video(url){
			var event_dispatcher = AnalyzeWorkGetEventDispatcher(work);
			var iframe = null;
			var iframe_analyze_work = null;
			var iframe_url = url;
			var event_handler = null;
			var limitter_element = null;
			var observer_remove = null;
			var media_player_ui = null;

			// 開放イベントを発行
			function dispatchEventRelease(e){
				event_dispatcher.dispatchEvent("release",null);
			}

			// インラインフレームを破棄
			function releaseIframe(e){
				// アドレスの登録を外す
				if(iframe_url){
					address_collection.removeAddress("video",iframe_url);
					iframe_url = null;
				}

				// イベントハンドラを破棄
				if(event_handler){
					event_handler.release();
					event_handler = null;
				}

				if(limitter_element){
					limitter_element.onremove = null;
					limitter_element.release();
					limitter_element = null;
				}

				// 監視を破棄
				if(observer_remove){
					observer_remove.release();
					observer_remove = null;
				}

				// メディアプレイヤー UI を破棄
				if(media_player_ui){
					media_player_ui.release();
					media_player_ui = null;
				}

				// 解析辞書除外
				if(iframe_analyze_work){
					analyze_work_dictionary.removeAnalyzeWork(iframe_analyze_work);
					iframe_analyze_work = null;
				}

				// インラインフレームを外す
				if(iframe){
					DomNodeRemove(iframe);
					iframe = null;
				}
			}

			// 混在コンテンツの展開が可能か
			if(!(project.checkAllowExpandIframeElement(iframe_url))){
				releaseIframe();
				complete();
				return;
			}

			// 重複チェック
			if(project.getDisableSameInlineVideo()){
				if(address_collection.hasAddress("video",iframe_url)){
					iframe_url = null;
					releaseIframe();
					complete();
					return;
				}
				// アドレスを登録
				address_collection.addAddress("video",iframe_url);
			}

			// イベントハンドラを作成
			event_handler = event_dispatcher.createEventHandler("release");
			event_handler.setFunction(releaseIframe);

			iframe = DocumentCreateElement('iframe');
			iframe.frameBorder = "0";
			iframe.scrolling = "no";
			iframe.allowFullscreen = true;

			// スタイルをセット
			ElementSetStyle(iframe,project.getStyleSheetExpandVideoDailymotionInlineVideo());

			// 解析ワーク作成
			iframe_analyze_work = AnalyzeWorkCreate(iframe);

			// 解析辞書登録オプション
			var attach_options = new AnalyzeWorkDictionaryAttachOptions();
			attach_options.SetOutsider();

			// 解析辞書登録
			analyze_work_dictionary.attachAnalyzeWork(iframe_analyze_work,attach_options);

			// インラインフレームのリムーブ監視
			observer_remove = new DomNodeObserverRemoveFromDocument(iframe);
			observer_remove.setFunction(dispatchEventRelease);

			// メディアプレイヤー UI
			media_player_ui = new MediaPlayerExtendUI(iframe);
			var event_handler_close = media_player_ui.createEventHandler("close");
			event_handler_close.setFunction(dispatchEventRelease);

			function responseInsert(){
				if(!iframe)	return;

				limitter_element = element_limitter_video.createElement();
				limitter_element.onattach = function(){
					iframe.src = iframe_url;
				};
				limitter_element.onremove = function(){
					iframe.src = "";
				};
				limitter_element.setElementHitArea(iframe);

				// 更新
				limitter_element.update();
			}

			// コールバック関数を実行
			project.executeScriptInsertInlineVideo(element,iframe,work.event_dispatcher,responseInsert);
		}

		if(project.getVisibleVideoDailymotion()){
			var allow_list = [
				"*//www.dailymotion.com/video/*",
				"*//touch.dailymotion.com/video/*"
			];
			num = allow_list.length;
			for(i=0;i<num;i++){
				if(StringUrlMatchAsteriskWord(url,allow_list[i])){
					var w = "/video/";
					var s = url.indexOf(w);
					if(s >= 0){
						s += w.length;
						var e = url.indexOf("_",s);
						var video_id;
						if(e >= 0)	video_id = url.substring(s,e);
						else		video_id = url.substring(s);
						if(video_id){
							var protocol = project.getSecureCurrent() ? "https" : "http";
							expand_video(protocol + "://www.dailymotion.com/embed/video/" + video_id);
							return;
						}
					}
				}
			}
		}

		// 完了
		complete();
	}

	// -
	// インラインビデオ vimeo
	// -
	function ElementExpandInlineVideoVimeo(param){
		var work = param.work;
		var modify = param.modify;
		var element = AnalyzeWorkGetDomNode(work);
		var url = AnalyzeWorkGetExpandUrl(work);

		if(!AnalyzeWorkEqualModifyCount(work,modify))	return;

		function complete(){
		}

		// vimeo.com 内では動作禁止
		var deny_list = [
			"*//vimeo.com/*"
		];
		var i;
		var num = deny_list.length;
		for(i=0;i<num;i++){
			if(StringUrlMatchAsteriskWord(document.URL,deny_list[i])){
				return;
			}
		}

		// 動画を展開
		function expand_video(url){

			var event_dispatcher = AnalyzeWorkGetEventDispatcher(work);
			var iframe = null;
			var iframe_analyze_work = null;
			var iframe_url = url;
			var event_handler = null;
			var limitter_element = null;
			var observer_remove = null;
			var media_player_ui = null;

			// 開放イベントを発行
			function dispatchEventRelease(e){
				event_dispatcher.dispatchEvent("release",null);
			}

			// インラインフレームを破棄
			function releaseIframe(e){
				// アドレスの登録を外す
				if(iframe_url){
					address_collection.removeAddress("video",iframe_url);
					iframe_url = null;
				}

				// イベントハンドラを破棄
				if(event_handler){
					event_handler.release();
					event_handler = null;
				}

				if(limitter_element){
					limitter_element.onremove = null;
					limitter_element.release();
					limitter_element = null;
				}

				// 監視を破棄
				if(observer_remove){
					observer_remove.release();
					observer_remove = null;
				}

				// メディアプレイヤー UI を破棄
				if(media_player_ui){
					media_player_ui.release();
					media_player_ui = null;
				}

				// 解析辞書除外
				if(iframe_analyze_work){
					analyze_work_dictionary.removeAnalyzeWork(iframe_analyze_work);
					iframe_analyze_work = null;
				}

				// インラインフレームを外す
				if(iframe){
					DomNodeRemove(iframe);
					iframe = null;
				}
			}

			// 混在コンテンツの展開が可能か
			if(!(project.checkAllowExpandIframeElement(iframe_url))){
				releaseIframe();
				complete();
				return;
			}

			// 重複チェック
			if(project.getDisableSameInlineVideo()){
				if(address_collection.hasAddress("video",iframe_url)){
					iframe_url = null;
					releaseIframe();
					complete();
					return;
				}
				// アドレスを登録
				address_collection.addAddress("video",iframe_url);
			}

			// イベントハンドラを作成
			event_handler = event_dispatcher.createEventHandler("release");
			event_handler.setFunction(releaseIframe);

			iframe = DocumentCreateElement('iframe');
			iframe.frameBorder = "0";
			iframe.scrolling = "no";
			iframe.allowFullscreen = true;

			// スタイルをセット
			ElementSetStyle(iframe,project.getStyleSheetExpandVideoVimeoInlineVideo());

			// 解析ワーク作成
			iframe_analyze_work = AnalyzeWorkCreate(iframe);

			// 解析辞書登録オプション
			var attach_options = new AnalyzeWorkDictionaryAttachOptions();
			attach_options.SetOutsider();

			// 解析辞書登録
			analyze_work_dictionary.attachAnalyzeWork(iframe_analyze_work,attach_options);

			// インラインフレームのリムーブ監視
			observer_remove = new DomNodeObserverRemoveFromDocument(iframe);
			observer_remove.setFunction(dispatchEventRelease);

			// メディアプレイヤー UI
			media_player_ui = new MediaPlayerExtendUI(iframe);
			var event_handler_close = media_player_ui.createEventHandler("close");
			event_handler_close.setFunction(dispatchEventRelease);

			function responseInsert(){
				if(!iframe)	return;

				limitter_element = element_limitter_video.createElement();
				limitter_element.onattach = function(){
					iframe.src = iframe_url;
				};
				limitter_element.onremove = function(){
					iframe.src = "";
				};
				limitter_element.setElementHitArea(iframe);

				// 更新
				limitter_element.update();
			}

			// コールバック関数を実行
			project.executeScriptInsertInlineVideo(element,iframe,work.event_dispatcher,responseInsert);
		}

		if(project.getVisibleVideoVimeo()){
			var allow_list = [
				"*//vimeo.com/*"
			];
			num = allow_list.length;
			for(i=0;i<num;i++){
				if(StringUrlMatchAsteriskWord(url,allow_list[i])){
					var w = "://vimeo.com/";
					var s = url.indexOf(w);
					if(s >= 0){
						s += w.length;
						var e = url.indexOf("?",s);
						var video_id;
						if(e >= 0)	video_id = url.substring(s,e);
						else		video_id = url.substring(s);
						if(video_id){
							// すべて数値
							if(video_id.match(/^[0-9]+$/)){
								expand_video("https://player.vimeo.com/video/" + video_id);
								return;
							}
						}
					}
				}
			}
		}

		// 完了
		complete();
	}

	// -
	// インラインフレームの展開
	// -
	function ElementExpandInlineIframe(param){
		var work = param.work;
		var modify = param.modify;
		var element = AnalyzeWorkGetDomNode(work);
		var url = AnalyzeWorkGetExpandUrl(work);
		url = project.fixURL_ActiveContent(url);
		var content_type = AnalyzeWorkGetContentType(work);

		if(!AnalyzeWorkEqualModifyCount(work,modify))	return;

		function complete(){
		}

		function response_allow(param){
			if(!AnalyzeWorkEqualModifyCount(work,modify))	return;

			if(!(param.result)){
				complete();
				return;
			}

			var event_dispatcher = AnalyzeWorkGetEventDispatcher(work);
			var loader = null;
			var iframe = null;
			var iframe_analyze_work = null;
			var iframe_url = url;
			var event_handler = null;
			var observer_remove = null;

			// 開放イベントを発行
			function dispatchEventRelease(e){
				event_dispatcher.dispatchEvent("release",null);
			}

			// インラインフレームを破棄
			function releaseIframe(e){
				// ローダーを中断
				if(loader){
					loader.onload = null;
					loader.onerror = null;
					loader = null;
				}

				// アドレスの登録を外す
				if(iframe_url){
					address_collection.removeAddress("iframe",iframe_url);
					iframe_url = null;
				}

				// イベントハンドラを破棄
				if(event_handler){
					event_handler.release();
					event_handler = null;
				}

				// 監視を破棄
				if(observer_remove){
					observer_remove.release();
					observer_remove = null;
				}

				// 解析辞書除外
				if(iframe_analyze_work){
					analyze_work_dictionary.removeAnalyzeWork(iframe_analyze_work);
					iframe_analyze_work = null;
				}

				// インラインフレームを外す
				if(iframe){
					DomNodeRemove(iframe);
					iframe = null;
				}
			}

			// 混在コンテンツの展開が可能か
			if(!(project.checkAllowExpandIframeElement(iframe_url))){
				releaseIframe();
				complete();
				return;
			}

			// 重複チェック
			if(project.getDisableSameInlineIframe()){
				if(address_collection.hasAddress("iframe",iframe_url)){
					iframe_url = null;
					releaseIframe();
					complete();
					return;
				}
				// アドレスを登録
				address_collection.addAddress("iframe",iframe_url);
			}

			// イベントハンドラを作成
			event_handler = event_dispatcher.createEventHandler("release");
			event_handler.setFunction(releaseIframe);

			// テキストの読み込み
			loader = new Loader();
			loader.onload = function(headers){
				complete();

				// インラインフレームを生成
				iframe = DocumentCreateElement("iframe");
				iframe.frameBorder = "0";
				iframe.src = iframe_url;

				// スタイルをセット
				ElementSetStyle(iframe,project.getStyleSheetExpandIframeInline(iframe_url));

				// 解析ワーク作成
				iframe_analyze_work = AnalyzeWorkCreate(iframe);

				// 解析辞書登録オプション
				var attach_options = new AnalyzeWorkDictionaryAttachOptions();
				attach_options.SetOutsider();

				// 解析辞書登録
				analyze_work_dictionary.attachAnalyzeWork(iframe_analyze_work,attach_options);

				// インラインフレームのリムーブ監視
				observer_remove = new DomNodeObserverRemoveFromDocument(iframe);
				observer_remove.setFunction(dispatchEventRelease);

				function responseInsert(){
					if(!iframe)	return;
				}

				// コールバック関数を実行
				project.executeScriptInsertInlineIframe(element,iframe,work.event_dispatcher,responseInsert);
			};

			loader.onerror = function(){
				complete();
			};
			loader.setMethod("GET");
			loader.setURL(iframe_url);
			loader.loadResponseHeader();
		}

		// コールバック関数を実行
		project.executeScriptAllowInlineIframe(element,url,content_type,response_allow);
	}

	// -
	// インラインフレーム内コンテンツの展開
	// -
	function ElementExpandIframeContent(param){
		var work = param.work;
		var modify = param.modify;
		var element = AnalyzeWorkGetDomNode(work);

		if(!AnalyzeWorkEqualModifyCount(work,modify))	return;

		var event_dispatcher;
		var event_handler;
		var observer_modify_element;
		var timer;
		var expanded = false;

		// 破棄
		function releaseIframeContent(){

			removeEvent();

			// アドレス変更監視を破棄
			if(observer_modify_element){
				observer_modify_element.release();
				observer_modify_element = null;
			}

		}

		// イベントを除外
		function removeEvent(){
			if(timer){
				timer.release();
				timer = null;
			}
			try{
				var window_obj = element.contentWindow;
				if(window_obj.removeEventListener){
					window_obj.removeEventListener("unload",unload);
				}else if(window_obj.detachEvent){
					window_obj.detachEvent("onunload",unload);
				}
			}catch(e){
			}
		}

		// アンロード
		function unload(){
			expanded = false;
			start();
		}

		// スタート
		function start(){
			if(expanded) return;

			removeEvent();

			timer = new Timer(1,1);
			timer.oncomplete = function(){
				if(expanded) return;

				try{
					var window_obj = element.contentWindow;
					if(WindowIsExecutedByPageExpand(window_obj)){

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

						expanded = true;
						PageExpand({execute_type:page_expand_arguments.execute_type,admin:admin,window:window_obj,page_expand_parent:page_expand_node});
					}
				}catch(e){
				}
			};
			timer.start();
		}

		// 要素を監視
		AnalyzeWorkObserveElement(work);
		event_dispatcher = AnalyzeWorkGetEventDispatcher(work);

		// 開放イベント
		event_handler = event_dispatcher.createEventHandler("release");
		event_handler.setFunction(releaseIframeContent);

		// アドレス変更監視
		observer_modify_element = document_observer_modify_node.createElement();
		observer_modify_element.setElement(element,"src");
		observer_modify_element.setFunction(function (){
			start();
		});

		start();
	}

	// -
	// 縮小画像のポップアップ
	// -
	function ElementPopupReducedImage(param){
		var work = param.work;
		var modify = param.modify;
		if(!AnalyzeWorkEqualModifyCount(work,modify))	return;

		var element = AnalyzeWorkGetDomNode(work);

		// 解析済みチェック
		if(AnalyzeWorkGetAnalyzedPopupReducedImage(work)){
			return;
		}
		AnalyzeWorkSetAnalyzedPopupReducedImage(work);

		var popup_image;
		var event_dispatcher;
		var event_handler;
		var observer_modify_element;
		var released = false;

		// 縮小画像のポップアップを破棄
		function releasePopupReducedImage(){

			// アドレス変更監視を破棄
			if(observer_modify_element){
				observer_modify_element.release();
				observer_modify_element = null;
			}

			// ポップアップイメージを破棄
			if(popup_image){
				popup_image.suicide();
				popup_image = null;
			}

			released = true;
		}

		// 要素を監視
		AnalyzeWorkObserveElement(work);
		event_dispatcher = AnalyzeWorkGetEventDispatcher(work);

		// ポップアップイメージの破棄イベント
		event_handler = event_dispatcher.createEventHandler("release_popup_image");
		event_handler.setFunction(function(){

			// ポップアップイメージを破棄
			if(popup_image){
				popup_image.release();
				popup_image = null;
			}

			releasePopupReducedImage();

			var event_dispatcher = AnalyzeWorkGetEventDispatcher(work);
			if(event_dispatcher){
				if(!AnalyzeWorkGetOverrodeAnchorElement(work)){
					event_dispatcher.dispatchEvent("destructor",null);
				}
			}
		});

		// 開放イベント
		event_handler = event_dispatcher.createEventHandler("release");
		event_handler.setFunction(releasePopupReducedImage);

		// アドレス変更監視
		observer_modify_element = document_observer_modify_node.createElement();
		observer_modify_element.setElement(element,"src");
		observer_modify_element.setFunction(function (){

			var event_dispatcher = AnalyzeWorkGetEventDispatcher(work);
			if(event_dispatcher){
				event_dispatcher.dispatchEvent("destructor",null);
			}

			// 再解析
			DomNodeAnalyzePhaseAnalyzeElement(element);
		});

		// 読み込み完了
		ImageGetLoaded(element,function(){

			if(!AnalyzeWorkEqualModifyCount(work,modify))	return;
			if(released) return;

			var allow = true;
			if(allow){
				try{
					// ソースが無い
					if(!(element.src)){
						allow = false;
					}
				}catch(e){
					allow = false;
				}
			}

			if(allow){
				// 画像の縮小率を調べる
				var natural_size = ImageGetNaturalSize(element);

				var scale = project.getScaleLessThenAllowPopupReducedImage();

				if(element.width  > natural_size.width   / 100 * scale)	allow = false;
				if(element.height > natural_size.height  / 100 * scale)	allow = false;
			}

			if(allow){
				// ブラウザで直接画像を閲覧している場合は除外
				if(element.src == document.URL){
					allow = false;
				}
			}

			if(allow){
				(function(){
					var node = element;
					while(node){
						// 解析ワーク取得
						var work = analyze_work_dictionary.getAnalyzeWork(node);
						if(work){
							// 祖先に PopupImage が存在する
							if(AnalyzeWorkGetPopupImage(work)){
								allow = false;
								break;
							}
						}

						node = node.parentNode;
					}
				})();
			}

			if(allow){
				var thumbnail_url = project.fixURL_PassiveContent(element.src);

				// ポップアップイメージ
				var loader = new Loader();
				loader.setURL(thumbnail_url);
				loader.onload = function(image){
					if(!AnalyzeWorkEqualModifyCount(work,modify))	return;
					if(released) return;

					popup_image = new PopupImage(image);
					popup_image.setElementParent(document.body);
					popup_image.setElementAnchor(element);
					popup_image.setElementHitArea(element);
					popup_image.setElementBeginArea(element);
					popup_image.setOriginalURL(thumbnail_url);
					popup_image.ontrim = function (){
						if(!popup_image) return;

						var trim_check = false;
						var trim_rect = new Object();
						var bounding_rect = ElementGetBoundingClientRect(element);
						var view_rect = ObjectCopy(bounding_rect);

						var overflow_hidden_x = {"hidden":1};
						var overflow_hidden_y = {"hidden":1};
						var display_inline = {"inline":1,"none":1,"table-column":1,"table-column-group":1};
						var node = element;
						while(node){
							var r = ElementGetBoundingClientRect(node);
							if(!r) break;

							if(node.tagName == "BODY") break;

							var style = ElementGetComputedStyle(node,null);
							if(style){
								if(!display_inline[style.display]){
									if(overflow_hidden_x[style.overflowX]){
										if(r.right  < view_rect.right ) view_rect.right  = r.right;
										if(r.left   > view_rect.left  ) view_rect.left   = r.left;
										trim_check = true;
									}
									if(overflow_hidden_y[style.overflowY]){
										if(r.bottom < view_rect.bottom) view_rect.bottom = r.bottom;
										if(r.top    > view_rect.top   ) view_rect.top    = r.top;
										trim_check = true;
									}
								}
							}

							node = node.parentNode;
						}

						if(trim_rect){
							var natural_size = ImageGetNaturalSize(element);
							var computed_style = ElementGetComputedStyle(element,null);
							var boader_rect = ComputedStyleGetBoaderWidth(computed_style);
							var padding_rect = ComputedStyleGetPaddingWidth(computed_style);

							var px = bounding_rect.left + boader_rect.left + padding_rect.left;
							var py = bounding_rect.top  + boader_rect.top  + padding_rect.top;
							var w = (bounding_rect.right  - px) - boader_rect.right  + padding_rect.right;
							var h = (bounding_rect.bottom - py) - boader_rect.bottom + padding_rect.bottom;
							var sx = natural_size.width  / w;
							var sy = natural_size.height / h;

							trim_rect.left   = (view_rect.left   - px) * sx;
							trim_rect.top    = (view_rect.top    - py) * sy;
							trim_rect.right  = (view_rect.right  - px) * sx;
							trim_rect.bottom = (view_rect.bottom - py) * sy;
						}

						if(trim_check){
							popup_image.setTrimRect(trim_rect);
						}
					};
					popup_image.ontrim();
					AnalyzeWorkSetPopupImage(work,popup_image);
				};
				loader.loadImage();
			}else{
				// 解放イベント発行
				var event_dispatcher = AnalyzeWorkGetEventDispatcher(work);
				if(event_dispatcher){
					event_dispatcher.dispatchEvent("release_popup_image",null);
				}
			}
		});

	}

	// -
	// 縮小画像のポップアップを全て破棄
	// -
	function PopupReducedImageReleaseAll(element){

		// 子孫抽出
		function analyze(node){
			// 解析ワーク取得
			var work = analyze_work_dictionary.getAnalyzeWork(node);
			if(work){
				// 解放イベント発行
				var event_dispatcher = AnalyzeWorkGetEventDispatcher(work);
				if(event_dispatcher){
					event_dispatcher.dispatchEvent("release_popup_image",null);
				}
			}
		}

		if(element.nodeType == 1){
			// イメージ
			if(element.tagName == "IMG"){
				analyze(element);
			}

			// 画像をすべて取得
			var nodes = ElementGetElementsByTagName(element,"img");
			var i;
			var num = nodes.length;
			for(i=0;i<num;i++){
				analyze(nodes[i]);
			}
		}
	}

	// -
	// 掲示板拡張
	// -
	function ElementExpandBbs(param){
		var work = param.work;
		var modify = param.modify;
		if(!AnalyzeWorkEqualModifyCount(work,modify))	return;

		var element = AnalyzeWorkGetDomNode(work);

		var completed = false;
		function response(obj){
			if(!AnalyzeWorkEqualModifyCount(work,modify))	return;

			if(completed) return;
			completed = true;

			if(!obj) return;
			if(!(obj.useful)) return;

			var observer_remove;
			var event_handler_release;

			// 解放
			function releaseExpandBbs(){
				// 解析クリア
				AnalyzeWorkClearAnalyzedExpandBbs(work);

				if(event_handler_release){
					event_handler_release.release();
					event_handler_release = null;
				}

				// リムーブ監視を破棄
				if(observer_remove){
					observer_remove.release();
					observer_remove = null;
				}

				// 解析辞書除外
				analyze_work_dictionary.removeAnalyzeWork(work);
			}

			// リムーブ監視
			observer_remove = new DomNodeObserverRemoveFromDocument(element);
			observer_remove.setFunction(releaseExpandBbs);

			// 開放イベント
			event_handler_release = page_expand_event_dispatcher.createEventHandler("release");
			event_handler_release.setFunction(releaseExpandBbs);

			// 解析辞書登録
			analyze_work_dictionary.attachAnalyzeWork(work);
		}

		// 解析済みチェック
		if(AnalyzeWorkGetAnalyzedExpandBbs(work)){
			return;
		}
		AnalyzeWorkSetAnalyzedExpandBbs(work);

		// コールバック関数を実行
		project.executeScriptCallbackExpandBbs(element,response);
	}


	// -
	// PageExpand ノード
	// -
	function PageExpandNode(){
		var _this = this;

		// -
		// 開放
		// -
		_this.release = function(child){
			var _prev = _this._child_list._prev;
			var _next = _prev._next;
			_prev._next = _next;
			_next._prev = _prev;

			_this.remove();
			_this._parent = null;
		};

		// -
		// 子を登録
		// -
		_this.attachChild = function(child){
			child.remove();

			var _next = _this._child_list;
			var _prev = _next._prev;
			_prev._next = child;
			_next._prev = child;
			child._prev = _prev;
			child._next = _next;
			child._parent = _this;
		};

		// -
		// 除外
		// -
		_this.remove = function(){
			var _prev = _this._prev;
			var _next = _this._next;
			_prev._next = _next;
			_next._prev = _prev;
		};

		// -
		// PageExpand ルートを取得
		// -
		_this.getPageExpandRoot = function(){
			var node = _this;
			while(node._parent){
				node = node._parent;
			}
			return node;
		};

		// -
		// 初期化
		// -
		(function(){
			_this._prev = _this;
			_this._next = _this;

			var child_list = new Object();
			child_list._prev = child_list;
			child_list._next = child_list;
			_this._child_list = child_list;
			_this._parent = null;
		})();
	}

	// -
	// PageExpand の解析が有効であるか
	// -
	function PageExpandSetEnableAnalyze(type){
		enable_analyze = type;
	}

	// -
	// コンテンツタイプをセット
	// -
	function DomNodeSetContentType(node,type){
		// 解析ワーク取得
		var work = analyze_work_dictionary.getAnalyzeWork(node);
		if(work){
			AnalyzeWorkAddContentType(work,type);
		}
	}

	// -
	// コンテンツタイプを取得
	// -
	function DomNodeGetContentType(node){
		// 解析ワーク取得
		var work = analyze_work_dictionary.getAnalyzeWork(node);
		if(work){
			var ary = AnalyzeWorkGetContentType(work);
			if(ary){
				return ary.join(",");
			}
		}

		return "";
	}

	// -
	// 「掲示板拡張」の解析状況
	// -
	function DomNodeSetCompletedExpandBbs(node){}

	// -
	// 「テキストの置換」の解析状況
	// -
	function DomNodeSetCompletedReplacementToText(node){}

	// -
	// 「挿入済み」の解析状況
	// -
	function DomNodeClearInserted(node){ ObjectDeleteProperty(node,"_pageexpand_inserted"); }
	function DomNodeSetInserted(node){ try{ node._pageexpand_inserted = true; }catch(e){} }
	function DomNodeGetInserted(node){ try{ if(node._pageexpand_inserted){ return true; } }catch(e){} return false; }

	// -
	// 正規表現オブジェクトを作成
	// -
	function RegExpObjectCreate(){
		return {
			pattern:"",
			flags:{i:false,g:false}
		};
	}

	// -
	// 正規表現オブジェクトから RegExp を生成
	// -
	function RegExpObjectGetRegExp(obj){
		try{
			return new RegExp(obj.pattern,(obj.flags.g ? "g":"") + (obj.flags.i ? "i":""));
		}catch(e){
			return null;
		}
	}

	// -
	// 正規表現オブジェクトからエラーを取得
	// -
	function RegExpObjectGetError(obj){
		try{
			var regexp = new RegExp(obj.pattern,(obj.flags.g ? "g":"") + (obj.flags.i ? "i":""));
			return "";
		}catch(e){
			return e;
		}
	}

	// -
	// スクリプトオブジェクトを生成
	// -
	function PageExpandProjectScriptObject_Create(preset_asset){
		var obj = {
			has_preset:Boolean(preset_asset),
			has_user:false,
			preset:{
				asset:(preset_asset || "")
			},
			user:{
				script:""
			}
		};
		return obj;
	}

	// -
	// スクリプトオブジェクトがユーザースクリプトを所有しているか調べる
	// -
	function PageExpandProjectScriptObject_HasUserScript(obj){
		return obj.has_user;
	}

	// -
	// スクリプトオブジェクトをプリセットに戻す
	// -
	function PageExpandProjectScriptObject_ReturnPreset(obj){
		obj.has_preset = true;
		obj.has_user = false;
		obj.user.script = "";
	}

	// -
	// スクリプトオブジェクトにユーザースクリプトをセット
	// -
	function PageExpandProjectScriptObject_SetUserScript(obj,script){
		obj.has_user = true;
		obj.user.script = script;
	}

	// -
	// スクリプトオブジェクトのユーザースクリプトをコピー
	// -
	function PageExpandProjectScriptObject_CopyUserScript(out,src){
		out.has_user = src.has_user;
		out.user.script = src.user.script;
	}

	// -
	// スクリプトオブジェクトから配列関数を作成
	// -
	function PageExpandProjectScriptObject_EvalArrayFunction(obj){
		if(obj.has_user){
			return StringEvalArrayFunction(obj.user.script);
		}
		if(obj.has_preset){

			// プリセットスクリプト辞書
			if(!preset_script_dictionary){
				preset_script_dictionary = new PresetScriptDictionary();
			}

			var item = preset_script_dictionary.getItem(obj.preset.asset);
			if(item) return item;
		}
		return [];		
	}

	// -
	// スクリプトオブジェクトからスクリプトを出力
	// -
	function PageExpandProjectScriptObject_ToString(obj){
		if(obj.has_user){
			return (obj.user.script);
		}
		if(obj.has_preset){

			// プリセットスクリプト辞書
			if(!preset_script_dictionary){
				preset_script_dictionary = new PresetScriptDictionary();
			}

			var ary = ["[\n"];
			var list = preset_script_dictionary.getItem(obj.preset.asset);
			var i;
			var num = list.length;
			for(i=0;i<num;i++){
				ary.push("\t");
				ary.push(list[i].toString());
				ary.push(",\n");
			}
			ary.pop();
			ary.push("\n]");
			return ary.join("");
		}
	}

	// -
	// ポップアップイメージ
	// -
	function PopupImage(image){
		var _this = this;

		// -
		// 開放
		// -
		_this.release = function(){
			if(!_image)	return;

			if(_event_handler_release){
				_event_handler_release.release();
				_event_handler_release = null;
			}

			if(_input_mouse_current){
				if(window_manager.existWindowRoot()){
					_input_mouse_current.release();
				}
				_input_mouse_current = null;
			}

			// クリックイベントを外す
			removeEventClick();

			// ホイールイベントを外す
			removeEventWheel();

			// マウスイベントを外す
			removeEventMouseOver();

			// タッチイベントを外す
			removeEventTouchStart();

			// リリースイベントを外す
			removeEventRelease();

			// タスクを破棄
			if(_task){
				_task.release();
				_task = null;
			}

			// 解析辞書除外
			analyze_work_dictionary.removeAnalyzeWork(_analyze_work);

			// コンテナから除外
			popup_image_container.remove(_this);

			_image = null;
		};

		// -
		// 自殺
		// -
		_this.suicide = function(){
			if(_task){
				_this.setElementHitArea(null);
				_suicide = true;
			}else{
				_this.release();
			}
		};

		// -
		// 親をセット
		// -
		_this.setElementParent = function(element){
			if(window_manager.existWindowRoot()){
				_element_parent = window_manager.getWindowRoot().document.body;
			}else{
				_element_parent = element;
			}
		};

		// -
		// リンクをセット
		// -
		_this.setElementAnchor = function(element){
			_this._element_anchor = element;

			// コンテナに登録
			popup_image_container.attach(_this);
		};

		// -
		// リンクを取得
		// -
		_this.getElementAnchor = function(){
			return _this._element_anchor;
		};

		// -
		// 当たり判定用エレメントをセット
		// -
		_this.setElementHitArea = function(element){
			// マウスイベントを外す
			removeEventMouseOver();
			// タッチイベントを外す
			removeEventTouchStart();
			// リリースイベントを外す
			removeEventRelease();

			_element_hit_area = element;

			// マウスイベントを開始
			addEventMouseOver();
			// タッチイベントを開始
			addEventTouchStart();
			// リリースイベントを開始
			addEventRelease();
		};

		// -
		// 開始範囲用エレメントをセット
		// -
		_this.setElementBeginArea = function(element){
			_element_begin_area = element;
		};

		// -
		// トリミング範囲をセット
		// -
		_this.setTrimRect = function(rect){
			if(!_trim_rect){
				// イベントを外す
				removeEventClick();
				removeEventWheel();

				var div = DocumentCreateElement("div");
				// スタイルをセット
				ElementSetStyle(div,
					"overflow:hidden;"
				);
				// スタイルを追加
				ElementAddStyle(_element_current,project.getStyleSheetExpandImagePopup(_original_url));
				div.appendChild(_image);
				_element_current = div;

				// イベント
				addEventClick();
				addEventWheel();
			}

			_trim_rect = ObjectCopy(rect);
			_trim_rect.width  = _trim_rect.right - _trim_rect.left;
			_trim_rect.height = _trim_rect.bottom - _trim_rect.top;
		};

		// -
		// 元のアドレスをセット
		// -
		_this.setOriginalURL = function(url){
			_original_url = url;
			if(_image_dragger) _image_dragger.setOriginalURL(url);
		};

		// -
		// 元のアドレスを取得
		// -
		_this.getOriginalURL = function(url){
			return _original_url;
		};

		// -
		// イメージを取得
		// -
		_this.getImage = function(){
			return _image;
		};

		// -
		// ポップアップ
		// -
		_this.popup = function(element){
			createTask();
		};

		// -
		// マウスオーバーイベントを追加(内部用)
		// -
		function addEventMouseOver(){
			if(!_element_hit_area) return;

			removeEventMouseOver();

			if(_element_hit_area.addEventListener){
				_element_hit_area.addEventListener("mouseover",mouseOver,false);
			}else if(_element_hit_area.attachEvent){
				_element_hit_area.attachEvent("onmouseover",mouseOver);
			}
		}

		// -
		// マウスオーバーイベントを外す(内部用)
		// -
		function removeEventMouseOver(){
			if(!_element_hit_area) return;

			if(_element_hit_area.removeEventListener){
				_element_hit_area.removeEventListener("mouseover",mouseOver,false);
			}else if(_element_hit_area.detachEvent){
				_element_hit_area.detachEvent("onmouseover",mouseOver);
			}
		}

		// -
		// タッチスタートイベントを追加(内部用)
		// -
		function addEventTouchStart(){
			if(!_element_hit_area) return;

			removeEventTouchStart();

			if(_element_hit_area.addEventListener){
				//_element_hit_area.addEventListener("touchstart",touchStart,false);
			}
		}

		// -
		// タッチスタートイベントを外す(内部用)
		// -
		function removeEventTouchStart(){
			if(!_element_hit_area) return;

			if(_element_hit_area.removeEventListener){
				//_element_hit_area.removeEventListener("touchstart",touchStart,false);
			}
		}

		// -
		// クリックイベントを追加(内部用)
		// -
		function addEventClick(){
			removeEventClick();

			if(_element_current.addEventListener){
				_element_current.addEventListener("mousedown",mouseDown,false);
				_element_current.addEventListener("click",mouseClick,false);
			}else if(_element_current.attachEvent){
				_element_current.attachEvent("onmousedown",mouseDown);
				_element_current.attachEvent("onclick",mouseClick);
			}
		}

		// -
		// クリックイベントを外す(内部用)
		// -
		function removeEventClick(){
			if(_element_current.removeEventListener){
				_element_current.removeEventListener("mousedown",mouseDown,false);
				_element_current.removeEventListener("click",mouseClick,false);
			}else if(_element_current.detachEvent){
				_element_current.detachEvent("onmousedown",mouseDown);
				_element_current.detachEvent("onclick",mouseClick);
			}
		}

		// -
		// ホイールイベントを追加(内部用)
		// -
		function addEventWheel(){
			removeEventWheel();

			if(_element_current.addEventListener){
				if(window.WheelEvent){
					_element_current.addEventListener("wheel",wheel,false);
				}else if(window.MouseScrollEvent){
					_element_current.addEventListener("DOMMouseScroll",mouseScroll,false);
				}else{
					_element_current.addEventListener("mousewheel",mouseWheel,false);
				}
			}else if(_element_current.attachEvent){
				_element_current.attachEvent("onmousewheel",mouseWheel);
			}
		}

		// -
		// ホイールイベントを外す(内部用)
		// -
		function removeEventWheel(){
			if(_element_current.removeEventListener){
				if(window.WheelEvent){
					_element_current.removeEventListener("wheel",wheel,false);
				}else if(window.MouseScrollEvent){
					_element_current.removeEventListener("DOMMouseScroll",mouseScroll,false);
				}else{
					_element_current.removeEventListener("mousewheel",mouseWheel,false);
				}
			}else if(_element_current.detachEvent){
				_element_current.detachEvent("onmousewheel",mouseWheel);
			}
		}

		// -
		// リリースイベントを追加(内部用)
		// -
		function addEventRelease(){
			if(!_element_hit_area) return;

			removeEventRelease();

			if(!_observer_remove){
				// リムーブ監視
				_observer_remove = new DomNodeObserverRemoveFromDocument(_element_hit_area);
				_observer_remove.setFunction(_this.suicide);
			}
		}

		// -
		// リリースイベントを外す(内部用)
		// -
		function removeEventRelease(){
			if(_observer_remove){
				// 監視を破棄
				_observer_remove.release();
				_observer_remove = null;
			}
		}

		// -
		// マウスオーバーイベント(内部用)
		// -
		function mouseOver(e){
			// マウス入力を更新
			input_mouse.setMouseEvent(e);

			createTask();
		}

		// -
		// タッチスタートイベント(内部用)
		// -
		function touchStart(e){
			// タッチ入力を更新
			input_touch.setTouchEvent(e);

			createTask();
		}

		// -
		// マウスダウンイベント(内部用)
		// -
		function mouseDown(e){
			// マウス入力を更新
			_input_mouse_current.setMouseEvent(e);

			if(
				(_input_mouse_current.getButtonCenter()) ||
				(_input_mouse_current.getButtonLeft() && _input_mouse_current.getButtonRight())
			){
				var image_viewer = new ImageViewer(_this);
				image_viewer.setInputMouse(_input_mouse_current);
			}

			// スクロールを無効化
			if(MouseEventGetChangedButtons(e) & 0x04){
				if(e.preventDefault){
					e.preventDefault();
				}else{
					return false;
				}
			}
		}

		// -
		// マウスクリックイベント(内部用)
		// -
		function mouseClick(e){
			// マウス入力を更新
			_input_mouse_current.setMouseEvent(e);

			_this.release();
		}

		// -
		// ホイールイベント(内部用)
		// -
		function wheel(e){
			// マウス入力を更新
			_input_mouse_current.setMouseEvent(e);

			var vec = {x:0,y:0};
			switch(e.deltaMode){
			case 0:
				vec.x = e.deltaX;
				vec.y = e.deltaY;
				break;
			case 1:
				vec.x = e.deltaX / 3 * 50;
				vec.y = e.deltaY / 3 * 50;
				break;
			case 2:
				vec.x = e.deltaX;
				vec.y = e.deltaY;
				break;
			}

			// 擬似スクロール
			wheelScroll(e,vec);
		}

		// -
		// マウススクロールイベント(内部用)
		// -
		function mouseScroll(e){
			// マウス入力を更新
			_input_mouse_current.setMouseEvent(e);

			// 擬似スクロール
			wheelScroll(e,{
				x:0,
				y:(e.detail / 3 * 50)
			});
		}

		// -
		// マウスホイールイベント(内部用)
		// -
		function mouseWheel(e){
			// マウス入力を更新
			_input_mouse_current.setMouseEvent(e);

			// 擬似スクロール
			wheelScroll(e,{
				x:0,
				y:-(e.wheelDelta / 40 * 50)
			});
		}

		// -
		// 擬似スクロール(内部用)
		// -
		function wheelScroll(e,vector){
			// 擬似スクロール
			var p = WheelScrollFromElement(vector,_element_begin_area,_element_current);
			if(p.result){

				// 絶対座標系
				if(project.getStylePositionPopupImage() == "absolute"){
					// 移動
					move({
						x:-p.vector.x,
						y:-p.vector.y
					});
				}

				if(e.preventDefault){
					e.preventDefault();
				}else{
					return false;
				}
			}
		}

		// -
		// スクロール合計位置を取得(内部用)
		// -
		function getScrollPositionTotal(node){
			var pos = {x:0,y:0};
			node = node.parentNode;
			while(node){
				if(node.scrollLeft) pos.x += node.scrollLeft;
				if(node.scrollTop ) pos.y += node.scrollTop;
				node = node.parentNode;
			}
			return pos;
		}


		// -
		// タスク生成(内部用)
		// -
		function createTask(){
			// 再構築
			if(_task){
				var work = _task.getUserWork();
				switch(work.type){
				case "fade_out":
					_task.setExecuteFunc(PopupImageClose);
					_task.execute(0xffffffff);
					break;
				}
			}

			// Shift キー押下で無視
			if(input_mouse.getKeyShift())	return;

			// ドラッグ中は無視
			if(input_mouse.getButtonLeft())	return;

			// タスクを生成
			if(!_task){
				// タッチイベントを外す
				removeEventTouchStart();

				_task = task_container.createTask();
				_task.setLevel(TASK_EXECUTE_LEVEL_POPUP);
				_task.setDestructorFunc(PopupImageDestructor);
				_task.setExecuteFunc(PopupImageInitialize);
				_task.execute(0xffffffff);
			}
		}

		// -
		// マウスムーブ(内部用)
		// -
		function mouseMove(){
			if(!_task)	return;

			var work = _task.getUserWork();
			var mouse_pos = ObjectCopy(input_mouse.getPositionClient());

			var hit = ElementHitTestPosition(_element_hit_area,mouse_pos,true);
			if(!hit){
				if(_element_rects_tree){
					if(_element_hit_area){
						if(DomNodeGetAttachedDocument(_element_hit_area)){
							var scroll_pos = getScrollPositionTotal(_element_hit_area);
							_scroll_pos_offset.x += scroll_pos.x - _scroll_pos_begin.x;
							_scroll_pos_offset.y += scroll_pos.y - _scroll_pos_begin.y;
							_scroll_pos_begin = scroll_pos;
						}
					}

					mouse_pos.x += _scroll_pos_offset.x;
					mouse_pos.y += _scroll_pos_offset.y;
					hit = _element_rects_tree.hitTestPosition(mouse_pos,true);
					if(!hit) _element_rects_tree = null;
				}
			}
			if(!input_mouse.getEnableMouse()){
				hit = false;
			}

			// アニメーション
			if(project.getEnableAnimationPopupImage()){
				if(hit){
					switch(work.type){
					case "wait_before_close":
						// 表示へ
						_task.setExecuteFunc(PopupImageShowInit);
						_task.execute(0xffffffff);
						break;
					case "fade_out":
						// 開く
						_task.setExecuteFunc(PopupImageBeforeOpenInit);
						_task.execute(0xffffffff);
						break;
					}
				}else{
					switch(work.type){
					case "wait_before_open":
						// 閉じる
						_task.setExecuteFunc(PopupImageClose);
						_task.execute(0xffffffff);
						break;
					case "fade_in":
						// フェードアウトへ
						_task.setExecuteFunc(PopupImageFadeOut);
						_task.execute(0xffffffff);
						break;
					case "show":
						// フェードアウト待機へ
						_task.setExecuteFunc(PopupImageWaitBeforeClose);
						_task.execute(0xffffffff);
						break;
					}
				}
			}else{
				if(hit){
					switch(work.type){
					case "wait_before_close":
						// 表示へ
						_task.setExecuteFunc(PopupImageShowInit);
						_task.execute(0xffffffff);
						break;
					}
				}else{
					switch(work.type){
					case "wait_before_open":
						// 閉じる
						_task.setExecuteFunc(PopupImageClose);
						_task.execute(0xffffffff);
						break;
					case "show":
						// フェードアウト待機へ
						_task.setExecuteFunc(PopupImageWaitBeforeClose);
						_task.execute(0xffffffff);
						break;
					}
				}
			}

			if(!hit){
				// タッチイベントを開始
				addEventTouchStart();
			}
		}

		// -
		// スクロール補正(内部用)
		// -
		function reviseScroll(vec){
			if(_task){
				var work = _task.getUserWork();
				var begin_rect = work.begin_rect;
				var end_rect = work.end_rect;

				begin_rect.left   += vec.x;
				begin_rect.right  += vec.x;
				begin_rect.top    += vec.y;
				begin_rect.bottom += vec.y;
				end_rect.left   += vec.x;
				end_rect.right  += vec.x;
				end_rect.top    += vec.y;
				end_rect.bottom += vec.y;

				_scroll_pos_begin.x += vec.x;
				_scroll_pos_begin.y += vec.y;

				PopupImageSizeUpdate(_task);
			}
		}

		// -
		// 移動(内部用)
		// -
		function move(vec){
			if(_task){
				var work = _task.getUserWork();
				var begin_rect = work.begin_rect;
				var end_rect = work.end_rect;

				begin_rect.left   += vec.x;
				begin_rect.right  += vec.x;
				begin_rect.top    += vec.y;
				begin_rect.bottom += vec.y;
				end_rect.left   += vec.x;
				end_rect.right  += vec.x;
				end_rect.top    += vec.y;
				end_rect.bottom += vec.y;

				PopupImageSizeUpdate(_task);
			}
		}

		// -
		// 初期化(内部用)
		// -
		function PopupImageInitialize(task){
			var work = task.getUserWork();

			work.type = "initialize";
			work.anime_pos = 0.0;
			work.anime_spd = 0.0;

			_element_rects_tree = null;
			if(_element_hit_area){
				_element_rects_tree = new ElementClientRectsTree(_element_hit_area);
				_scroll_pos_begin = getScrollPositionTotal(_element_hit_area);
				_scroll_pos_offset = {x:0,y:0};
			}

			task.setExecuteFunc(PopupImageBeforeOpenInit);
			task.execute(0xffffffff);
		}


		// -
		// オープン前待機(内部用)
		// -
		function PopupImageBeforeOpenInit(task){
			var work = task.getUserWork();

			work.type = "wait_before_open";
			work.frame = project.getTimeWaitOpenPopupImage() / 1000 * 60;

			task.setExecuteFunc(PopupImageBeforeOpenExec);
			task.execute(0xffffffff);
		}
		function PopupImageBeforeOpenExec(task){
			var work = task.getUserWork();

			// マウスムーブ
			mouseMove();

			work.frame -= 1;
			if(work.frame < 0){
				task.setExecuteFunc(PopupImageOpen);
				task.execute(0xffffffff);
				return;
			}
		}

		// -
		// ポップアップイメージを開く(内部用)
		// -
		function PopupImageOpen(task){
			var work = task.getUserWork();

			work.type = "open";

			// デフォルトのスタイル
			ElementSetStyle(_image,CSSTextGetInitialImageElement());

			// スタイルを追加
			ElementAddStyle(_element_current,project.getStyleSheetExpandImagePopup(_original_url));
			_element_current.style.willChange = "left,top,width,height,opacity";

			// 最前面
			_element_current.style.zIndex = 0x7FFFFFFF - 1;
			_element_current.style.position = project.getStylePositionPopupImage();

			_element_current.style.left   = "0px";
			_element_current.style.top    = "0px";
			_element_current.style.width  = "0px";
			_element_current.style.height = "0px";

			if(_this.ontrim){
				_this.ontrim();
			}

			if(_trim_rect){
				_image.style.position = "absolute";
			}


			var window_obj = window_manager.getWindowRoot();
			var document_obj = window_obj.document;
			var client_size = DocumentGetClientSize(document_obj);
			var client_rect = {
				left  :1,
				top   :1,
				right :client_size.width  - 1,
				bottom:client_size.height - 1
			};

			// スタイルのサイズを取得
			_element_parent.appendChild(_element_current);
			var bounding_size = ElementGetBoundingClientRect(_element_current);
			work.style_w = bounding_size.right  - bounding_size.left;
			work.style_h = bounding_size.bottom - bounding_size.top;

			// ネイティブサイズ
			var natural_size = ImageGetNaturalSize(_image);
			if(_trim_rect){
				natural_size.width  = _trim_rect.width;
				natural_size.height = _trim_rect.height;
			}

			// 開始矩形
			var begin_rect;
			if(_element_begin_area){
				if(DomNodeGetAttachedDocument(_element_begin_area)){
					if(_trim_rect){
						begin_rect = ElementGetViewClientRect(_element_begin_area);
					}else{
						begin_rect = DomTreeGetContentClientRect(_element_begin_area);
					}
				}
			}
			if(!begin_rect){
				// マウス座標をセット
				var w = work.style_w * 0.5;
				var h = work.style_h * 0.5;
				var mouse_pos = input_mouse.getPositionClient();
				begin_rect = new Object();
				begin_rect.left   = mouse_pos.x - w;
				begin_rect.right  = mouse_pos.x + w;
				begin_rect.top    = mouse_pos.y - h;
				begin_rect.bottom = mouse_pos.y + h;
			}

			var offset = window_manager.getPositionFromRoot();
			begin_rect.left   += offset.x;
			begin_rect.right  += offset.x;
			begin_rect.top    += offset.y;
			begin_rect.bottom += offset.y;

			// 拡大縮小補正
			var pixel_ratio = WindowGetDevicePixelRatio(window);
			pixel_ratio = 1 / pixel_ratio;
			if(pixel_ratio < 1.0) pixel_ratio = 1.0;

			// 終了サイズ
			var scale = project.getScalePercentPopupImage() / 100 * pixel_ratio;
			var end_w = natural_size.width  * scale;
			var end_h = natural_size.height * scale;
			_element_current.style.width  = (end_w) + "px";
			_element_current.style.height = (end_h) + "px";

			var statusbar_h = 24;

			// クライアントサイズを修正
			switch(project.getOriginPopupImage()){
			case "adsorb_element":
				client_rect.bottom -= statusbar_h;
				var rect = {
					left  :begin_rect.left   - 1,
					right :begin_rect.right  + 1,
					top   :begin_rect.top    - 1,
					bottom:begin_rect.bottom + 1
				};
				var l = rect.left - client_rect.left;
				var r = client_rect.right - rect.right;
				var t = rect.top - client_rect.top;
				var b = client_rect.bottom - rect.bottom;
				var w0;
				var h0;
				if(l < r)	w0 = r;
				else		w0 = l;
				if(t < b)	h0 = b;
				else		h0 = t;
				var w1 = natural_size.width * h0 / natural_size.height;
				var h1 = natural_size.height * w0 / natural_size.width;
				if(w1 > client_size.width)	w1 = client_size.width;
				if(h1 > client_size.height)	h1 = client_size.height;
				if(w0 * h1 > h0 * w1){
					if(l > r)	client_rect.right = rect.left;
					else		client_rect.left = rect.right;
				}else{
					if(t > b)	client_rect.bottom = rect.top;
					else		client_rect.top = rect.bottom;
				}
				break;
			case "adsorb_mouse":
				client_rect.bottom -= statusbar_h;
				var distance = 10;
				var mouse_pos = input_mouse.getPositionClient();
				mouse_pos.x += offset.x;
				mouse_pos.y += offset.y;
				var l = (mouse_pos.x - distance) - client_rect.left;
				var r = client_rect.right - (mouse_pos.x + distance);
				var t = (mouse_pos.y - distance) - client_rect.top;
				var b = client_rect.bottom - (mouse_pos.y + distance);
				var w0;
				var h0;
				if(l < r)	w0 = r;
				else		w0 = l;
				if(t < b)	h0 = b;
				else		h0 = t;
				var w1 = natural_size.width * h0 / natural_size.height;
				var h1 = natural_size.height * w0 / natural_size.width;
				if(w1 > client_size.width)	w1 = client_size.width;
				if(h1 > client_size.height)	h1 = client_size.height;
				if(w0 * h1 > h0 * w1){
					if(l > r)	client_rect.right = (mouse_pos.x - distance);
					else		client_rect.left = (mouse_pos.x + distance);
				}else{
					if(t > b)	client_rect.bottom = (mouse_pos.y - distance);
					else		client_rect.top = (mouse_pos.y + distance);
				}
				break;
			}

			// 幅と高さがクライアント領域を超える場合補正
			client_rect.width  = client_rect.right - client_rect.left;
			client_rect.height = client_rect.bottom - client_rect.top;
			if(client_rect.width < end_w + work.style_w){
				var w = (client_rect.width - work.style_w);
				end_h *= w / end_w;
				end_w = w;
			}
			if(client_rect.height < end_h + work.style_h){
				var h = (client_rect.height - work.style_h);
				end_w *= h / end_h;
				end_h = h;
			}

			// 終了座標
			var end_x;
			var end_y;
			switch(project.getOriginPopupImage()){
			default:
			case "center":
				var x = (begin_rect.right + begin_rect.left) * 0.5;
				var y = (begin_rect.bottom + begin_rect.top) * 0.5;
				end_x = x - ((end_w + work.style_w) * 0.5);
				end_y = y - ((end_h + work.style_h) * 0.5);
				if(begin_rect.right - begin_rect.left < work.style_w){
					begin_rect.left = x - work.style_w / 2;
					begin_rect.right = begin_rect.left + work.style_w;
				}
				if(begin_rect.bottom - begin_rect.top < work.style_h){
					begin_rect.top = y - work.style_h / 2;
					begin_rect.bottom = begin_rect.top  + work.style_h;
				}
				break;
			case "upper_left":
				end_x = begin_rect.left;
				end_y = begin_rect.top;
				break;
			case "upper_right":
				end_x = begin_rect.right - end_w;
				end_y = begin_rect.top;
				break;
			case "client_center":
				end_x = (client_rect.width  * 0.5) - ((end_w + work.style_w) * 0.5);
				end_y = (client_rect.height * 0.5) - ((end_h + work.style_h) * 0.5);
				var x = (begin_rect.right + begin_rect.left) * 0.5;
				var y = (begin_rect.bottom + begin_rect.top) * 0.5;
				if(begin_rect.right - begin_rect.left < work.style_w){
					begin_rect.left = x - work.style_w / 2;
					begin_rect.right = begin_rect.left + work.style_w;
				}
				if(begin_rect.bottom - begin_rect.top < work.style_h){
					begin_rect.top = y - work.style_h / 2;
					begin_rect.bottom = begin_rect.top  + work.style_h;
				}
				break;
			}

			begin_rect.right  -= work.style_w;
			begin_rect.bottom -= work.style_h;
			work.begin_rect = begin_rect;

			if(end_x < client_rect.left)	end_x = client_rect.left;
			if(end_y < client_rect.top )	end_y = client_rect.top ;
			if(end_x + end_w + work.style_w > client_rect.right )	end_x = client_rect.right  - end_w - work.style_w;
			if(end_y + end_h + work.style_h > client_rect.bottom)	end_y = client_rect.bottom - end_h - work.style_h;

			var end_rect = new Object();
			end_rect.left   = end_x;
			end_rect.top    = end_y;
			end_rect.right  = end_rect.left + end_w;
			end_rect.bottom = end_rect.top  + end_h;
			work.end_rect = end_rect;

			// 絶対座標系
			if(project.getStylePositionPopupImage() == "absolute"){
				// 絶対座標系に変更
				begin_rect.left   -= bounding_size.left;
				begin_rect.top    -= bounding_size.top;
				begin_rect.right  -= bounding_size.left;
				begin_rect.bottom -= bounding_size.top;
				end_rect.left   -= bounding_size.left;
				end_rect.top    -= bounding_size.top;
				end_rect.right  -= bounding_size.left;
				end_rect.bottom -= bounding_size.top;

				if(!(window_manager.existWindowRoot())){
					// イベントハンドラを作成
					_event_handler_revise_scroll = page_expand_event_dispatcher.createEventHandler("revise_scroll");
					_event_handler_revise_scroll.setFunction(reviseScroll);
				}
			}

			// スケール未対応
			if(!project.getEnableScaleAnimationPopupImage()){
				work.begin_rect = end_rect;
				PopupImageSizeUpdate(task);
			}

			// アルファ未対応
			if(!project.getEnableAlphaAnimationPopupImage()){
				PopupImageSetAlpha(task,1.0);
			}

			// マウスイベント有効化
			_element_current.style.pointerEvents = "auto";


			if(project.getEnableAnimationPopupImage()){
				task.setExecuteFunc(PopupImageFadeIn);
			}else{
				task.setExecuteFunc(PopupImageShowInit);
			}
			task.execute(0xffffffff);
		}

		// -
		// フェードイン(内部用)
		// -
		function PopupImageFadeIn(task){
			var work = task.getUserWork();

			work.type = "fade_in";

			// マウスムーブ
			mouseMove();

			var sub = 1.0 - work.anime_pos;
			sub *= 0.4;
			if(sub > 0.0){
				work.anime_spd += 0.05;
				if(work.anime_spd > 0.2)	work.anime_spd = 0.2;
				if(work.anime_spd > sub)	work.anime_spd = sub;
			}

			work.anime_pos += work.anime_spd;
			if(work.anime_pos > 0.999){
				work.anime_spd = 0.0;
				work.anime_pos = 1.0;
				task.setExecuteFunc(PopupImageShowInit);
			}

			if(project.getEnableAlphaAnimationPopupImage()){
				PopupImageSetAlpha(task,work.anime_pos);
			}

			if(project.getEnableScaleAnimationPopupImage()){
				PopupImageSizeUpdate(task);
			}
		}

		// -
		// 表示(内部用)
		// -
		function PopupImageShowInit(task){
			var work = task.getUserWork();

			work.type = "show";
			work.anime_pos = 1.0;
			work.anime_spd = 0.0;
			work.frame = project.getTimeWaitClosePopupImage() / 1000 * 60;
			if(project.getEnableAlphaAnimationPopupImage()){
				PopupImageSetAlpha(task,work.anime_pos);
			}
			if(project.getEnableScaleAnimationPopupImage()){
				PopupImageSizeUpdate(task);
			}

			task.setExecuteFunc(PopupImageShowExec);
			task.execute(0xffffffff);
		}
		function PopupImageShowExec(task){
			var work = task.getUserWork();

			// マウスムーブ
			mouseMove();
		}

		// -
		// 待機(内部用)
		// -
		function PopupImageWaitBeforeClose(task){
			var work = task.getUserWork();

			work.type = "wait_before_close";

			// マウスムーブ
			mouseMove();

			work.frame -= 1;
			if(work.frame < 0){
				// アニメーション
				if(project.getEnableAnimationPopupImage()){
					// マウスイベント無効化
					_element_current.style.pointerEvents = "none";
					task.setExecuteFunc(PopupImageFadeOut);
				}else{
					task.setExecuteFunc(PopupImageClose);
				}
			}
		}

		// -
		// フェードアウト(内部用)
		// -
		function PopupImageFadeOut(task){
			var work = task.getUserWork();

			work.type = "fade_out";

			// マウスムーブ
			mouseMove();

			var sub = 0.0 - work.anime_pos;
			sub *= 0.4;
			if(sub < 0.0){
				work.anime_spd -= 0.2;
				if(work.anime_spd < sub)	work.anime_spd = sub;
			}
			work.anime_pos += work.anime_spd;
			if(work.anime_pos < 0.001){
				work.anime_spd = 0.0;
				work.anime_pos = 0.0;
				task.setExecuteFunc(PopupImageClose);
			}
			if(project.getEnableAlphaAnimationPopupImage()){
				PopupImageSetAlpha(task,work.anime_pos);
			}
			if(project.getEnableScaleAnimationPopupImage()){
				PopupImageSizeUpdate(task);
			}
		}

		// -
		// 閉じる(内部用)
		// -
		function PopupImageClose(task){
			var work = task.getUserWork();
			StyleDeclarationRemoveProperty(_element_current.style,"will-change");
			task.release();
		}

		// -
		// デストラクタ(内部用)
		// -
		function PopupImageDestructor(task){
			// 解放
			if(_event_handler_revise_scroll){
				_event_handler_revise_scroll.release();
				_event_handler_revise_scroll = null;
			}

			DomNodeRemove(_element_current);
			_task = null;

			// 自殺
			if(_suicide){
				_this.release();
			}
		}

		// -
		// サイズ更新(内部用)
		// -
		function PopupImageSizeUpdate(task){
			var work = task.getUserWork();
			var begin_rect = work.begin_rect;
			var end_rect = work.end_rect;

			var d = work.anime_pos;
			var l = (end_rect.left   - begin_rect.left  ) * d + begin_rect.left;
			var r = (end_rect.right  - begin_rect.right ) * d + begin_rect.right;
			var t = (end_rect.top    - begin_rect.top   ) * d + begin_rect.top;
			var b = (end_rect.bottom - begin_rect.bottom) * d + begin_rect.bottom;
			var w = r - l;
			var h = b - t;

			var style = _element_current.style;
			style.left = (l) + "px";
			style.top  = (t) + "px";
			style.width  = (w) + "px";
			style.height = (h) + "px";

			if(_trim_rect){
				var style = _image.style;
				var natural_size = ImageGetNaturalSize(_image);
				var computed_style = ElementGetComputedStyle(_element_current,null);
				var padding_rect = ComputedStyleGetPaddingWidth(computed_style);
				var sx = w / _trim_rect.width;
				var sy = h / _trim_rect.height;
				l = _trim_rect.left * sx;
				t = _trim_rect.top  * sy;
				r = l + w;
				b = t + h;
				style.left = (-l + padding_rect.left) + "px";
				style.top  = (-t + padding_rect.top ) + "px";
				style.width  = (natural_size.width  * sx) + "px";
				style.height = (natural_size.height * sy) + "px";
				style.clip = "rect(" + (t) + "px " + (r) + "px " + (b) + "px " + (l) + "px)";
			}
		}

		// -
		// 透明度セット(内部用)
		// -
		function PopupImageSetAlpha(task,v){
			var work = task.getUserWork();
			_element_current.style.opacity = v;
		}

		// -
		// トリミング要求イベント
		// -
		_this.ontrim = function(){};

		// -
		// プライベート変数
		// -
		var _element_parent;
		var _element_hit_area;
		var _element_begin_area;
		var _element_current;
		var _task;
		var _trim_rect;
		var _image;
		var _suicide;
		var _element_rects_tree;
		var _scroll_pos_begin;
		var _scroll_pos_offset;
		var _analyze_work;
		var _observer_remove;
		var _event_handler_revise_scroll;
		var _event_handler_release;
		var _input_mouse_current;
		var _original_url;
		var _image_dragger;

		// -
		// 初期化
		// -
		(function(){
			_element_hit_area = null;
			_element_begin_area = null;
			_task = null;
			_image = image;
			_element_current = _image;
			_suicide = false;
			_element_rects_tree = null;
			if(window_manager.existWindowRoot()){
				_input_mouse_current = new InputMouse(window_manager.getWindowRoot());
				_input_mouse_current.setInputMouse(input_mouse);
			}else{
				_input_mouse_current = input_mouse;
			}
			_original_url = "";
			image = null;

			// リスト
			popup_image_container.initializePopupImage(_this);

			// 解析ワーク作成
			_analyze_work = AnalyzeWorkCreate(_image);

			// 解析済み
			AnalyzeWorkSetAnalyzedPopupReducedImage(_analyze_work);

			// 解析辞書登録オプション
			var attach_options = new AnalyzeWorkDictionaryAttachOptions();
			attach_options.SetOutsider();
			if(window_manager.existWindowRoot()) attach_options.SetGuest();

			// 解析辞書登録
			analyze_work_dictionary.attachAnalyzeWork(_analyze_work,attach_options);

			// イベント
			addEventClick();
			addEventWheel();

			_event_handler_release = page_expand_event_dispatcher.createEventHandler("release");
			_event_handler_release.setFunction(function(){
				_this.release();
			});
			
			// ドラッガー
			_image_dragger = new ImageDragger(_image);
		})();
	}

	// -
	// ポップアップイメージコンテナ
	// -
	function PopupImageContainer(){
		var _this = this;

		// -
		// 開放
		// -
		_this.release = function(){
			while(_this != _this._next){
				_this.remove(_this._next);
			}
		};

		// -
		// 登録
		// -
		_this.attach = function(popup_image){
			_this.remove(popup_image);

			var element = popup_image._element_anchor;
			var list = _this._prev;

			if(element.compareDocumentPosition){
				while(list != _this){
					var doc_pos = element.compareDocumentPosition(list._element_anchor);
					if(doc_pos & document.DOCUMENT_POSITION_PRECEDING){
						break;
					}
					list = list._prev;
				}
			}

			var _prev = list;
			var _next = _prev._next;
			_prev._next = popup_image;
			_next._prev = popup_image;
			popup_image._prev = _prev;
			popup_image._next = _next;
			_count += 1;
		};

		// -
		// 除外
		// -
		_this.remove = function(popup_image){
			if(popup_image != popup_image._next){
				var _prev = popup_image._prev;
				var _next = popup_image._next;
				_prev._next = _next;
				_next._prev = _prev;
				popup_image._prev = popup_image;
				popup_image._next = popup_image;

				_count -= 1;
			}
		};

		// -
		// ポップアップイメージを初期化
		// -
		_this.initializePopupImage = function(popup_image){
			popup_image._prev = popup_image;
			popup_image._next = popup_image;
		};

		// -
		// 1つ前のポップアップイメージを取得
		// -
		_this.getPrev = function(popup_image){
			var list = popup_image._prev;
			if(list == popup_image) return null;
			if(list == _this) return null;
			return list;
		};

		// -
		// 1つ後のポップアップイメージを取得
		// -
		_this.getNext = function(popup_image){
			var list = popup_image._next;
			if(list == popup_image) return null;
			if(list == _this) return null;
			return list;
		};

		// -
		// ポップアップイメージの位置を取得
		// -
		_this.getIndex = function(popup_image){
			var id = 0;
			var list = _this._next;
			while(list != _this){
				if(list == popup_image){
					break;
				}
				id += 1;
				list = list._next;
			}
			return id;
		};

		// -
		// 総数を取得
		// -
		_this.getCount = function(){
			return _count;
		};

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

		// -
		// 初期化
		// -
		(function(){
			_this._prev = _this;
			_this._next = _this;
			_count = 0;
		})();
	}

	// -
	// イメージビューワ
	// -
	function ImageViewer(popup_image){
		var _this = this;

		// -
		// 開放
		// -
		_this.release = function(){
			release_0();
			release_1();
		};

		// -
		// マウス操作をセット
		// -
		_this.setInputMouse = function(input_mouse){
			_input_mouse.setInputMouse(input_mouse);
			_prevent_context_menu = _input_mouse.getButtonRight();
			_prevent_click = _input_mouse.getButtonLeft();
		};

		// -
		// 自殺(内部用)
		// -
		function suicide(){
			release_0();

			(function(){
				if(_fade_task){
					_fade_task.release();
					_fade_task = null;
				}
				_fade_task = task_container.createTask();
				_fade_task.setDestructorFunc(function(){
					_fade_task = null;
				});
				_fade_task.setExecuteFunc(function(){
					_fade_alpha -= 0.2;
					if(_fade_alpha < 0.0){
						_fade_alpha = 0.0;
						_fade_task.release();
						release_1();
					}
					_element_viewer.style.opacity = _fade_alpha;
				});
				_fade_task.execute(0xffffffff);
			})();

			task_execute_level |= TASK_EXECUTE_LEVEL_POPUP;
		}

		// -
		// 開放 0(内部用)
		// -
		function release_0 (){
			removeEvent();

			if(_event_handler_release){
				_event_handler_release.release();
				_event_handler_release = null;
			}

			// マウスイベント無効化
			_element_viewer.style.pointerEvents = "none";

			// スタイルを戻す
			var i;
			var num = _style_overflow_list.length;
			for(i=0;i<num;i++){
				var item = _style_overflow_list.pop();
				var style = item.element.style;
				if(item.value === undefined){
				}else if(item.value){
					StyleDeclarationSetProperty(style,"overflow",item.value);
				}else{
					StyleDeclarationRemoveProperty(style,"overflow");
				}
			}
		};

		// -
		// 開放 1(内部用)
		// -
		function release_1 (){
			removeImage();
			DomNodeRemove(_element_viewer);
			DomNodeRemove(_shadow_host);

			if(_input_mouse){
				if(window_manager.existWindowRoot()){
					_input_mouse.release();
				}
				_input_mouse = null;
			}

			// リムーブ監視を破棄
			if(_observer_remove){
				_observer_remove.release();
				_observer_remove = null;
			}

			// 解析辞書除外
			if(_analyze_work_viewer){
				analyze_work_dictionary.removeAnalyzeWork(_analyze_work_viewer);
				_analyze_work_viewer = null;
			}

			// タスク破棄
			if(_parent_task){
				_parent_task.releaseChild();
				_parent_task.release();
				_parent_task = null;
			}
		};

		// -
		// イベントを追加(内部用)
		// -
		function addEvent(){
			removeEvent();

			if(_element_viewer.addEventListener){
				_element_container.addEventListener("mousedown",mouseDown,false);
				_element_viewer.addEventListener("mousemove",mouseMove,false);
				_element_viewer.addEventListener("mouseup",mouseUp,false);
				_element_viewer.addEventListener("contextmenu",mouseContextMenu,false);
				_element_window.addEventListener("scroll",scroll,false);
				if(window.MouseScrollEvent){
					_element_window.addEventListener("DOMMouseScroll",mouseScroll,false);
				}else{
					_element_window.addEventListener("mousewheel",mouseWheel,false);
				}
				_element_window.addEventListener("dragstart",dragStart,false);
				_window_root.addEventListener("resize",resize,false);
			}else if(_element_viewer.attachEvent){
				_element_container.attachEvent("onmousedown",mouseDown);
				_element_viewer.attachEvent("onmousemove",mouseMove);
				_element_viewer.attachEvent("onmouseup",mouseUp);
				_element_viewer.attachEvent("oncontextmenu",mouseContextMenu);
				_element_window.attachEvent("onscroll",scroll);
				_element_window.attachEvent("onmousewheel",mouseWheel);
				_element_window.attachEvent("ondragstart",dragStart);
				_window_root.attachEvent("onresize",resize);
			}
		}

		// -
		// イベントを破棄(内部用)
		// -
		function removeEvent(){
			if(_element_viewer.removeEventListener){
				_element_container.removeEventListener("mousedown",mouseDown,false);
				_element_viewer.removeEventListener("mousemove",mouseMove,false);
				_element_viewer.removeEventListener("mouseup",mouseUp,false);
				_element_viewer.removeEventListener("contextmenu",mouseContextMenu,false);
				_element_window.removeEventListener("scroll",scroll,false);
				if(window.MouseScrollEvent){
					_element_window.removeEventListener("DOMMouseScroll",mouseScroll,false);
				}else{
					_element_window.removeEventListener("mousewheel",mouseWheel,false);
				}
				_element_window.removeEventListener("dragstart",dragStart,false);
				_window_root.removeEventListener("resize",resize,false);
			}else if(_element_viewer.detachEvent){
				_element_container.detachEvent("onmousedown",mouseDown);
				_element_viewer.detachEvent("onmousemove",mouseMove);
				_element_viewer.detachEvent("onmouseup",mouseUp);
				_element_viewer.detachEvent("oncontextmenu",mouseContextMenu);
				_element_window.detachEvent("onscroll",scroll);
				_element_window.detachEvent("onmousewheel",mouseWheel);
				_element_window.detachEvent("ondragstart",dragStart);
				_window_root.detachEvent("onresize",resize);
			}
		}

		// -
		// マウスダウンイベント(内部用)
		// -
		function mouseDown(e){
			// マウス入力を更新
			_input_mouse.setMouseEvent(e);

			if(_input_mouse.getButtonLeft()){
				if(_mouse_buttons & 0x01){
				}else{
					_mouse_buttons |= 0x01;
					_translate_work.working = false;
					_translate_work.pos_old = _input_mouse.getPositionClient();
				}
			}
			if(_input_mouse.getButtonRight()){
				if(_mouse_buttons & 0x02){
				}else{
					_mouse_buttons |= 0x02;
					_transform_work.working = false;
					_transform_work.mouse_start = _input_mouse.getPositionClient();
					_transform_work.origin = ObjectCopy(_image_origin);
					_transform_work.scale = ObjectCopy(_image_scale);
					_transform_work.zoom = ObjectCopy(_image_zoom);
					_transform_work.rotate = ObjectCopy(_image_rotate);
					_transform_work.pos = ObjectCopy(_image_pos);
					_transform_work.center = ObjectCopy(_image_center);
				}
			}

			if(
				(_input_mouse.getButtonCenter()) ||
				(_input_mouse.getButtonLeft() && _input_mouse.getButtonRight())
			){
				suicide();
			}

			// スクロールを無効化
			if(MouseEventGetChangedButtons(e) & 0x04){
				if(e.preventDefault){
					e.preventDefault();
				}else{
					return false;
				}
			}
		}

		// -
		// マウスダウンイベント(内部用)
		// -
		function mouseMove(e){
			// マウス入力を更新
			_input_mouse.setMouseEvent(e);

			if(_mouse_buttons & 0x01){
				var pos = _input_mouse.getPositionClient();
				var old = _translate_work.pos_old;
				var vec_x = pos.x - old.x;
				var vec_y = pos.y - old.y;

				if(Math.sqrt(vec_x * vec_x + vec_y * vec_y) >= 3.0){
					_translate_work.working = true;
					_prevent_click = true;
				}
				if(_translate_work.working){
					if(vec_x || vec_y){
						_element_window.scrollLeft -= vec_x;
						_element_window.scrollTop  -= vec_y;
						_translate_work.pos_old = pos;
					}
				}
			}

			if(_mouse_buttons & 0x02){
				updateTransform();
			}

			if(_translate_work.working){
				setCursor("move");
			}else if(_transform_work.working){
				setCursor("crosshair");
			}else{
				initCursor();
			}
		}

		// -
		// マウスアップイベント(内部用)
		// -
		function mouseUp(e){
			// マウス入力を更新
			_input_mouse.setMouseEvent(e);

			if(_mouse_buttons & 0x01){
				if(!_input_mouse.getButtonLeft()){
					_mouse_buttons &= ~0x01;
					_translate_work.working = false;
					if(!_prevent_click){
						gotoScaleMode(1);
					}
					_prevent_click = false;
				}
			}
			if(_mouse_buttons & 0x02){
				if(!_input_mouse.getButtonRight()){
					_mouse_buttons &= ~0x02;
					_transform_work.working = false;
					DomNodeRemove(_element_transform);
				}
			}

			if(_prevent_click){
			}else{
				initCursor();
			}
		}

		// -
		// マウスコンテキストメニューイベント(内部用)
		// -
		function mouseContextMenu(e){
			// マウス入力を更新
			_input_mouse.setMouseEvent(e);

			_prevent_context_menu = true;

			// 装飾キー押下で無視
			if(_input_mouse.getKeyShift() || _input_mouse.getKeyCtrl()){
				_prevent_context_menu = false;
			}

			// デフォルトの動作を無効化
			if(_prevent_context_menu){
				_prevent_context_menu = false;

				if(e.preventDefault){
					e.preventDefault();
				}else{
					return false;
				}
			}
		}

		// -
		// マウススクロールイベント(内部用)
		// -
		function mouseScroll(e){
			wheel(e,e.detail);
		}

		// -
		// マウスホイールイベント(内部用)
		// -
		function mouseWheel(e){
			wheel(e,-(e.wheelDelta / 40));
		}

		// -
		// ホイール回転(内部用)
		// -
		function wheel(e,delta){
			// マウス入力を更新
			_input_mouse.setMouseEvent(e);

			var cancel = false;
			if(_input_mouse.getButtonRight()){
				_prevent_context_menu = true;

				gotoImage(delta);

				_transform_work.working = false;
				DomNodeRemove(_element_transform);
				_transform_work.mouse_start = _input_mouse.getPositionClient();

				cancel = true;
			}

			if(_input_mouse.getButtonLeft()){
				if(delta > 0){
					setCursor("zoom-out");
				}else{
					setCursor("zoom-in");
				}
				addScale(-delta);

				_prevent_click = true;
				cancel = true;
			}

			if(cancel){
				_prevent_context_menu = true;

				// デフォルトの動作を無効化
				if(e.preventDefault){
					e.preventDefault();
				}else{
					return false;
				}
			}
		}

		// -
		// スクロールイベント(内部用)
		// -
		function scroll(e){
			if(_prevent_scroll){
				_prevent_scroll = false;
				return;
			}

			if(WindowGetDevicePixelRatio(window) != _pixel_ratio){
				return;
			}

			var pos_x = _element_window.scrollLeft;
			var pos_y = _element_window.scrollTop;
			var max_x = _element_window.scrollWidth  - _element_window.clientWidth;
			var max_y = _element_window.scrollHeight - _element_window.clientHeight;
			var client_w = _element_window.clientWidth;
			var client_h = _element_window.clientHeight;

			var mtx = new Matrix32();
			mtx.translate(-_image_origin.x,-_image_origin.y);
			mtx.scale(_image_scale.x,_image_scale.y);
			mtx.rotate(_image_rotate * Math.PI / 180);
			mtx.translate(_image_pos.x,_image_pos.y);
			mtx.invert();
			_image_center = mtx.transformPosition({x:pos_x + client_w * 0.5,y:pos_y + client_h * 0.5});

			var r = 2;
			if(pos_x <= r){
			}else if(pos_y <= r){
			}else if(pos_x >= max_x - r){
			}else if(pos_y >= max_y - r){
			}else{
				return;
			}

			suicide();
		}

		// -
		// リサイズイベント(内部用)
		// -
		function resize(e){
			var client_size = DocumentGetClientSize(_window_root.document);
			var style = _element_viewer.style;
			style.width  = (client_size.width)  + "px";
			style.height = (client_size.height) + "px";

			_pixel_ratio = WindowGetDevicePixelRatio(window);
			_image_scale.y = _image_scale.x = _image_zoom / _pixel_ratio;

			var mtx = new Matrix32();
			mtx.translate(-_image_origin.x,-_image_origin.y);
			mtx.scale(_image_scale.x,_image_scale.y);
			mtx.rotate(_image_rotate * Math.PI / 180);

			var vtx = new Array();
			vtx.push(mtx.transformPosition({x:-_image_origin.x , y:-_image_origin.y}));
			vtx.push(mtx.transformPosition({x:-_image_origin.x , y: _image_origin.y}));
			vtx.push(mtx.transformPosition({x: _image_origin.x , y:-_image_origin.y}));
			vtx.push(mtx.transformPosition({x: _image_origin.x , y: _image_origin.y}));

			var min_x = vtx[0].x;
			var max_x = vtx[0].x;
			var min_y = vtx[0].y;
			var max_y = vtx[0].y;

			var i;
			var num = vtx.length;
			for(i=1;i<num;i++){
				var p = vtx[i];
				if(min_x > p.x) min_x = p.x;
				if(max_x < p.x) max_x = p.x;
				if(min_y > p.y) min_y = p.y;
				if(max_y < p.y) max_y = p.y;
			}

			var client_w = _element_window.clientWidth;
			var client_h = _element_window.clientHeight;
			var background_w = (client_w * 2) + (max_x - min_x);
			var background_h = (client_h * 2) + (max_y - min_y);

			_prevent_scroll = true;

			var style = _element_background.style;
			style.width  = (background_w) + "px";
			style.height = (background_h) + "px";

			_image_pos = {x:background_w * 0.5,y:background_h * 0.5};
			mtx.translate(_image_pos.x,_image_pos.y);
			StyleDeclarationSetTransform(_element_image.style,mtx.toString());

			var vec = mtx.transformPosition(_image_center);
			_element_window.scrollLeft = vec.x - client_w * 0.5;
			_element_window.scrollTop  = vec.y - client_h * 0.5;
		}

		// -
		// ドラッグ開始イベント(内部用)
		// -
		function dragStart(e){
			// デフォルトの動作を無効化する
			if(e.preventDefault){
				e.preventDefault();
			}else{
				return false;
			}
		}

		// -
		// 画像更新(内部用)
		// -
		function updateImage(popup_image){
			var image = popup_image.getImage();
			var image_size = ImageGetNaturalSize(image);

			removeImage();

			_element_image = DocumentCreateElement("img");
			ElementSetStyle(_element_image,CSSTextGetInitialImageElement());
			ElementAddStyle(_element_image,"position:absolute; left:0px; top:0px; border:5px solid #666; cursor:inherit;");

			var style = _element_image.style;
			style.width  = (image_size.width)  + "px";
			style.height = (image_size.height) + "px";

			_element_image.src = image.src;

			// 解析ワーク作成
			_analyze_work_image = AnalyzeWorkCreate(_element_image);

			// 解析済み
			AnalyzeWorkSetInvalid(_analyze_work_image);

			// 解析辞書登録オプション
			var attach_options = new AnalyzeWorkDictionaryAttachOptions();
			attach_options.SetOutsider();
			if(window_manager.existWindowRoot()) attach_options.SetGuest();
			analyze_work_dictionary.attachAnalyzeWork(_analyze_work_image,attach_options);

			_element_container.appendChild(_element_image);

			updateScaleMode();
		}

		// -
		// 画像除外(内部用)
		// -
		function removeImage(){
			if(_analyze_work_image){
				analyze_work_dictionary.removeAnalyzeWork(_analyze_work_image);
				_analyze_work_image = null;
			}
			if(_element_image){
				DomNodeRemove(_element_image);
				_element_image = null;
			}
		}

		// -
		// スケールモード更新(内部用)
		// -
		function updateScaleMode(){
			var image = _popup_image.getImage();
			var image_size = ImageGetNaturalSize(image);
			var border_width = 5;

			var actual_w = (image_size.width  + border_width * 2) / _pixel_ratio;
			var actual_h = (image_size.height + border_width * 2) / _pixel_ratio;
			var client_w = _element_window.clientWidth;
			var client_h = _element_window.clientHeight;

			var scale_mode = _scale_mode;
			if(scale_mode == ImageViewer.SCALE_MODE_AUTO){
				if((actual_w < client_w) && (actual_h < client_h)){
					scale_mode = ImageViewer.SCALE_MODE_NO_SCALE;
				}else{
					var scale_x = 1.0 / _pixel_ratio;
					if(actual_w > client_w){
						scale_x *= client_w / actual_w;
					}
					if(actual_h * scale_x * 0.75 > client_h){
						scale_mode = ImageViewer.SCALE_MODE_LONG_VERTICAL;
					}else{
						scale_mode = ImageViewer.SCALE_MODE_SHOW_ALL;
					}
				}
			}
			if(scale_mode == ImageViewer.SCALE_MODE_LONG_VERTICAL){
				if((actual_w < client_w) && (actual_h < client_h)){
					scale_mode = ImageViewer.SCALE_MODE_NO_SCALE;
				}else if(actual_w > client_w){
					var scale_y = client_w / actual_w;
					if(actual_h * scale_y < client_h){
						scale_mode = ImageViewer.SCALE_MODE_SHOW_ALL;
					}
				}
			}

			var scale_x = 1.0 / _pixel_ratio;
			var scale_y = 1.0 / _pixel_ratio;
			switch(scale_mode){
			case ImageViewer.SCALE_MODE_LONG_VERTICAL:
				if(actual_w > client_w){
					scale_x *= client_w / actual_w;
					scale_y = scale_x;
				}
				break;
			case ImageViewer.SCALE_MODE_SHOW_ALL:
				if(actual_w > client_w){
					scale_x *= client_w / actual_w;
				}
				if(actual_h > client_h){
					scale_y *= client_h / actual_h;
				}
				if(scale_x > scale_y){
					scale_x = scale_y;
				}else{
					scale_y = scale_x;
				}
				break;
			case ImageViewer.SCALE_MODE_SHOW_FULL:
				scale_x *= client_w / actual_w;
				scale_y *= client_h / actual_h;
				if(scale_x > scale_y){
					scale_x = scale_y;
				}else{
					scale_y = scale_x;
				}
				break;
			}
			_image_zoom = scale_x * _pixel_ratio;

			var background_w = (client_w * 2) + actual_w * _image_zoom;
			var background_h = (client_h * 2) + actual_h * _image_zoom;

			_image_origin = {x:image_size.width  * 0.5 + border_width , y:image_size.height * 0.5 + border_width};
			_image_scale = {x:scale_x,y:scale_y};
			_image_rotate = 0.0;
			_image_pos = {x:background_w * 0.5,y:background_h * 0.5};

			var pos_x = background_w * 0.5 - client_w * 0.5;
			var pos_y;
			switch(scale_mode){
			case ImageViewer.SCALE_MODE_LONG_VERTICAL:
				pos_y = background_h * 0.5 - (image_size.height + border_width * 2) * scale_y * 0.5;
				break;
			default:
				pos_y = background_h * 0.5 - client_h * 0.5;
				break;
			}

			_prevent_scroll = true;

			var style = _element_background.style;
			style.width  = (background_w) + "px";
			style.height = (background_h) + "px";

			var mtx = new Matrix32();
			mtx.translate(-_image_origin.x,-_image_origin.y);
			mtx.scale(_image_scale.x,_image_scale.y);
			mtx.rotate(_image_rotate * Math.PI / 180);
			mtx.translate(_image_pos.x,_image_pos.y);
			StyleDeclarationSetTransformOrigin(_element_image.style,"0% 0%");
			StyleDeclarationSetTransform(_element_image.style,mtx.toString());
			mtx.invert();
			_image_center = mtx.transformPosition({x:pos_x + client_w * 0.5,y:pos_y + client_h * 0.5});

			_element_window.scrollLeft = pos_x;
			_element_window.scrollTop  = pos_y;
		}

		// -
		// 回転拡大更新(内部用)
		// -
		function updateTransform(){
			var cx = _element_window.clientWidth  * 0.5;
			var cy = _element_window.clientHeight * 0.5;
			var p0 = _transform_work.mouse_start;
			var p1 = _input_mouse.getPositionClient();
			var sx = p1.x - p0.x;
			var sy = p1.y - p0.y;
			var v0_x = p0.x - cx;
			var v0_y = p0.y - cy;
			var v1_x = p1.x - cx;
			var v1_y = p1.y - cy;
			var len0 = Math.sqrt(v0_x * v0_x + v0_y * v0_y);
			var len1 = Math.sqrt(v1_x * v1_x + v1_y * v1_y);
			var rad0 = Math.atan2(v0_y,v0_x);
			var rad1 = Math.atan2(v1_y,v1_x);

			if(!(_transform_work.working)){
				if(len1 < 100){
				}else if(Math.sqrt(sx * sx + sy * sy) < 3){
				}else{
					_prevent_context_menu = true;
					_transform_work.working = true;
					_transform_work.mouse_start = _input_mouse.getPositionClient();
					_transform_work.origin = ObjectCopy(_image_origin);
					_transform_work.scale = ObjectCopy(_image_scale);
					_transform_work.zoom = ObjectCopy(_image_zoom);
					_transform_work.rotate = ObjectCopy(_image_rotate);
					_transform_work.pos = ObjectCopy(_image_pos);
					_transform_work.center = ObjectCopy(_image_center);
				}
				return;
			}

			_image_zoom = _transform_work.zoom;
			_image_rotate = _transform_work.rotate;

			var r = Math.atan2(v1_y,v1_x) - Math.atan2(v0_y,v0_x);
			r *= 180 / Math.PI;
			_image_rotate += r;
			if(_image_rotate < -180) _image_rotate += 360;
			if(_image_rotate >  180) _image_rotate -= 360;

			var s = len1 / len0;
			_image_zoom *= s;


			setMessage("Zoom: " + (_image_zoom * 100).toFixed(2) + " % , Rotate: " + _image_rotate.toFixed(2));

			_image_scale.y = _image_scale.x = _image_zoom / _pixel_ratio;
			var mtx = new Matrix32();
			mtx.translate(-_image_origin.x,-_image_origin.y);
			mtx.scale(_image_scale.x,_image_scale.y);
			mtx.rotate(_image_rotate * Math.PI / 180);

			var vtx = new Array();
			vtx.push(mtx.transformPosition({x:-_image_origin.x , y:-_image_origin.y}));
			vtx.push(mtx.transformPosition({x:-_image_origin.x , y: _image_origin.y}));
			vtx.push(mtx.transformPosition({x: _image_origin.x , y:-_image_origin.y}));
			vtx.push(mtx.transformPosition({x: _image_origin.x , y: _image_origin.y}));

			var min_x = vtx[0].x;
			var max_x = vtx[0].x;
			var min_y = vtx[0].y;
			var max_y = vtx[0].y;

			var i;
			var num = vtx.length;
			for(i=1;i<num;i++){
				var p = vtx[i];
				if(min_x > p.x) min_x = p.x;
				if(max_x < p.x) max_x = p.x;
				if(min_y > p.y) min_y = p.y;
				if(max_y < p.y) max_y = p.y;
			}

			var client_w = _element_window.clientWidth;
			var client_h = _element_window.clientHeight;
			var background_w = (client_w * 2) + (max_x - min_x);
			var background_h = (client_h * 2) + (max_y - min_y);

			_prevent_scroll = true;

			var style = _element_background.style;
			style.width  = (background_w) + "px";
			style.height = (background_h) + "px";

			_image_pos = {x:background_w * 0.5,y:background_h * 0.5};
			mtx.translate(_image_pos.x,_image_pos.y);
			StyleDeclarationSetTransform(_element_image.style,mtx.toString());

			var vec = mtx.transformPosition(_image_center);
			_element_window.scrollLeft = vec.x - client_w * 0.5;
			_element_window.scrollTop  = vec.y - client_h * 0.5;

			var mtx = new Matrix32();
			mtx.translate(-len0 - 5.0 , -len0 - 5.0);
			mtx.translate(vec.x,vec.y);
			StyleDeclarationSetTransform(_element_transform_circle_before.style,mtx.toString());
			_element_transform_circle_before.style.width  = (len0 * 2.0) + "px";
			_element_transform_circle_before.style.height = (len0 * 2.0) + "px";


			var mtx = new Matrix32();
			mtx.translate(-2.5 , -2.5);
			mtx.rotate(rad0);
			mtx.translate(vec.x,vec.y);
			StyleDeclarationSetTransform(_element_transform_vector_before.style,mtx.toString());
			_element_transform_vector_before.style.width  = (len0 + 5.0) + "px";

			var mtx = new Matrix32();
			mtx.translate(-2.5 , -2.5);
			mtx.rotate(rad1);
			mtx.translate(vec.x,vec.y);
			StyleDeclarationSetTransform(_element_transform_vector_after.style,mtx.toString());
			_element_transform_vector_after.style.width  = (len1 + 5.0) + "px";

			_element_container.appendChild(_element_transform);
		}

		// -
		// リサイズイベント(内部用)
		// -
		function addScale(delta){
			var ZOOM_MUL = 0.01;
			var zoom_old = _image_zoom;
			if(delta > 0){
				_image_zoom = (1.0 + delta * ZOOM_MUL) * _image_zoom;
			}else{
				_image_zoom = (1.0 / (1.0 - delta * ZOOM_MUL)) * _image_zoom;
			}

			if(delta > 0){
				var next = 1.0;
				while(zoom_old >= 1.0){
					zoom_old /= 2.0;
					next *= 2.0;
				}
				if(next < _image_zoom){
					_image_zoom = next;
				}
			}else{
				var next = 0.0;
				if(zoom_old > 1.0) next = 1.0;
				while(zoom_old > 2.0){
					zoom_old /= 2.0;
					next *= 2.0;
				}
				if(next > _image_zoom){
					_image_zoom = next;
				}
			}
			setMessage("Zoom: " + (_image_zoom * 100).toFixed(2) + " %");

			_image_scale.y = _image_scale.x = _image_zoom / _pixel_ratio;
			var mtx = new Matrix32();
			mtx.translate(-_image_origin.x,-_image_origin.y);
			mtx.scale(_image_scale.x,_image_scale.y);
			mtx.rotate(_image_rotate * Math.PI / 180);

			var vtx = new Array();
			vtx.push(mtx.transformPosition({x:-_image_origin.x , y:-_image_origin.y}));
			vtx.push(mtx.transformPosition({x:-_image_origin.x , y: _image_origin.y}));
			vtx.push(mtx.transformPosition({x: _image_origin.x , y:-_image_origin.y}));
			vtx.push(mtx.transformPosition({x: _image_origin.x , y: _image_origin.y}));

			var min_x = vtx[0].x;
			var max_x = vtx[0].x;
			var min_y = vtx[0].y;
			var max_y = vtx[0].y;

			var i;
			var num = vtx.length;
			for(i=1;i<num;i++){
				var p = vtx[i];
				if(min_x > p.x) min_x = p.x;
				if(max_x < p.x) max_x = p.x;
				if(min_y > p.y) min_y = p.y;
				if(max_y < p.y) max_y = p.y;
			}

			var client_w = _element_window.clientWidth;
			var client_h = _element_window.clientHeight;
			var background_w = (client_w * 2) + (max_x - min_x);
			var background_h = (client_h * 2) + (max_y - min_y);

			_prevent_scroll = true;

			var style = _element_background.style;
			style.width  = (background_w) + "px";
			style.height = (background_h) + "px";

			_image_pos = {x:background_w * 0.5,y:background_h * 0.5};
			mtx.translate(_image_pos.x,_image_pos.y);
			StyleDeclarationSetTransform(_element_image.style,mtx.toString());

			var vec = mtx.transformPosition(_image_center);
			_element_window.scrollLeft = vec.x - client_w * 0.5;
			_element_window.scrollTop  = vec.y - client_h * 0.5;
		}

		// -
		// メッセージをセット(内部用)
		// -
		function setMessage(str){
			if(!_parent_task) return;

			if(_message_task){
				_message_task.release();
			}

			_textnode_message.nodeValue = str;
			_element_viewer.appendChild(_element_message);

			// フェードタスク
			var frame = 60 * 3;
			_message_task = task_container.createTask(_parent_task);
			_message_task.setDestructorFunc(function(){
				_message_task = null;
			});
			_message_task.setExecuteFunc(function(){
				var alpha = _message_alpha;
				frame -= 1;
				if(frame < 0){
					_message_alpha -= 0.1;
					if(_message_alpha < 0.0){
						_message_alpha = 0.0;
						_message_task.release();
						DomNodeRemove(_element_message);
					}
				}else{
					_message_alpha += 0.2;
					if(_message_alpha > 1.0){
						_message_alpha = 1.0;
					}
				}
				if(alpha != _message_alpha){
					_element_message.style.opacity = _message_alpha;
				}
			});
			_message_task.execute(0xffffffff);
		}

		// -
		// カーソルを初期化(内部用)
		// -
		function initCursor(){
			_element_container.style.cursor = "default";
			if(_cursor_task){
				_cursor_task.release();
			}

			if(_parent_task){
				var frame = 60 * 1;
				_cursor_task = task_container.createTask(_parent_task);
				_cursor_task.setDestructorFunc(function(){
					_cursor_task = null;
				});
				_cursor_task.setExecuteFunc(function(){
					frame -= 1;
					if(frame < 0){
						_element_container.style.cursor = "none";
						_cursor_task.release();
					}
				});
				_cursor_task.execute(0xffffffff);
			}
		}

		// -
		// カーソルを変更(内部用)
		// -
		function setCursor(value){
			_element_container.style.cursor = value;
			if(_cursor_task){
				_cursor_task.release();
			}
		}

		// -
		// 画像移動(内部用)
		// -
		function gotoImage(delta){
			var popup_image = null;
			if(delta > 0) popup_image = popup_image_container.getNext(_popup_image);
			if(delta < 0) popup_image = popup_image_container.getPrev(_popup_image);
			if(popup_image){
				_popup_image = popup_image;
				updateImage(_popup_image);
			}

			setMessage((popup_image_container.getIndex(_popup_image) + 1) + " / " + popup_image_container.getCount());
		}

		// -
		// スケールモード移動(内部用)
		// -
		function gotoScaleMode(delta){
			_scale_mode += delta;
			if(_scale_mode < 0){
				_scale_mode += ImageViewer.SCALE_MODE_MAX;
			}
			if(_scale_mode >= ImageViewer.SCALE_MODE_MAX){
				_scale_mode -= ImageViewer.SCALE_MODE_MAX;
			}

			setMessage("ScaleMode: " + [
				"\"AUTO\"",
				"\"NO SCALE\"",
				"\"LONG VERTICAL\"",
				"\"SHOW ALL\"",
				"\"SHOW FULL\""
			][_scale_mode]);

			updateScaleMode();
		}

		// -
		// プライベート変数
		// -
		var _window_root;
		var _element_root;
		var _shadow_host;
		var _element_viewer;
		var _element_menu;
		var _element_window;
		var _element_message;
		var _element_container;
		var _element_background;
		var _element_image;
		var _element_transform;
		var _element_transform_circle_before;
		var _element_transform_vector_before;
		var _element_transform_vector_after;
		var _textnode_url;
		var _textnode_message;
		var _popup_image;
		var _style_overflow_list;
		var _prevent_context_menu;
		var _prevent_click;
		var _prevent_scroll;
		var _parent_task;
		var _fade_task;
		var _fade_alpha;
		var _message_task;
		var _message_alpha;
		var _cursor_task;
		var _observer_remove;
		var _analyze_work_viewer;
		var _analyze_work_image;
		var _input_mouse;
		var _scale_mode;
		var _image_origin;
		var _image_scale;
		var _image_zoom;
		var _image_rotate;
		var _image_pos;
		var _image_center;
		var _mouse_buttons;
		var _translate_work;
		var _transform_work;
		var _pixel_ratio;
		var _event_handler_release;

		// -
		// 初期化
		// -
		(function(){
			_window_root = window_manager.getWindowRoot();
			var document_root = _window_root.document;
			var element_html = document_root.documentElement;
			_element_root = document_root.body;
			if(window_manager.existWindowRoot()){
				_input_mouse = new InputMouse(_window_root);
			}else{
				_input_mouse = input_mouse;
			}
			_prevent_context_menu = _input_mouse.getButtonRight();
			_prevent_click = _input_mouse.getButtonLeft();
			_prevent_scroll = false;
			_scale_mode = ImageViewer.SCALE_MODE_AUTO;
			_image_origin = {x:0.0,y:0.0};
			_image_scale = {x:1.0,y:1.0};
			_image_zoom = 1.0;
			_image_rotate = 0.0;
			_image_pos = {x:0.0,y:0.0};
			_image_center = {x:0.0,y:0.0};
			_mouse_buttons = 0x00;
			_translate_work = new Object();
			_transform_work = new Object();
			_pixel_ratio = WindowGetDevicePixelRatio(window);

			_popup_image = popup_image;
			popup_image = null;

			// スクロールバー無効化
			_style_overflow_list = new Array();
			var list = [
				{
					element:element_html,
					value_list:["hidden","initial"]
				},{
					element:_element_root,
					value_list:["hidden"]
				}
			];
			var i;
			var num = list.length;
			for(i=0;i<num;i++){
				var item = list[i];
				var value_list = item.value_list;
				var element = item.element;
				var style = element.style;

				_style_overflow_list.push({
					element:element,
					value:StyleDeclarationGetPropertyValue(style,"overflow")
				});

				var j;
				var value_num = value_list.length;
				for(j=0;j<value_num;j++){
					style.overflow = value_list[j];
				}
			}

			_element_viewer = DocumentCreateElement("div");
			ElementSetStyle(_element_viewer,CSSTextGetInitialDivElement());
			ElementAddStyle(_element_viewer,"position:fixed; left:0px; top:0px; z-index:2147483646; line-height:0;");
			var client_size = DocumentGetClientSize(document_root);
			var style = _element_viewer.style;
			style.width  = (client_size.width)  + "px";
			style.height = (client_size.height) + "px";

				_element_menu = DocumentCreateElement("div");
				ElementSetStyle(_element_menu,CSSTextGetInitialDivElement());
				ElementAddStyle(_element_menu,"background:#fcfcfc; color:#000; font-size:14px; top:10px; right:30px; line-height:1; position:absolute; border-radius:10px; box-shadow:0px 0px 5px #c0c0c0; pointer-events:inherit;");

					var style_button = "margin:0px; padding:0px; font-size:12px; font-weight:bold; text-align:center; width:24px; height:24px; display:inline-block; pointer-events:inherit;";
					var style_button_image = "vertical-align:top; margin:0px -6px; pointer-events:inherit;";

					var button_prev = DocumentCreateElement("button");
					button_prev.title = "prev image";
					ElementSetStyle(button_prev,CSSTextGetInitialButtonElement());
					ElementAddStyle(button_prev,style_button);
					button_prev.onclick = function(){
						gotoImage(-1);
					};
					var image_prev = DocumentCreateElement("img");
					ElementSetStyle(image_prev,CSSTextGetInitialImageElement());
					ElementAddStyle(image_prev,style_button_image);
					image_prev.src = "data:image/gif;base64,R0lGODlhEAAQAIAAACAgIP///yH5BAUUAAEALAAAAAAQABAAAAIjjI+py50AVzwQvIqwqXpHzmXgKI4h9ZklenpW+bpS7NT2HRQAOw==";
					button_prev.appendChild(image_prev);

					var button_next = DocumentCreateElement("button");
					button_next.title = "next image";
					ElementSetStyle(button_next,CSSTextGetInitialButtonElement());
					ElementAddStyle(button_next,style_button);
					button_next.onclick = function(){
						gotoImage(1);
					};
					var image_next = DocumentCreateElement("img");
					ElementSetStyle(image_next,CSSTextGetInitialImageElement());
					ElementAddStyle(image_next,style_button_image);
					image_next.src = "data:image/gif;base64,R0lGODlhEAAQAIAAACAgIP///yH5BAUUAAEALAAAAAAQABAAAAIljI+py50AFoxn0gqRzWbqnXkYaH2k2JEBum6jeaUx99DOjedBAQA7";
					button_next.appendChild(image_next);

					var button_zoom_out = DocumentCreateElement("button");
					button_zoom_out.title = "zoom out";
					ElementSetStyle(button_zoom_out,CSSTextGetInitialButtonElement());
					ElementAddStyle(button_zoom_out,style_button);
					button_zoom_out.onclick = function(){
						addScale(-10.0);
					};
					var image_zoom_out = DocumentCreateElement("img");
					ElementSetStyle(image_zoom_out,CSSTextGetInitialImageElement());
					ElementAddStyle(image_zoom_out,style_button_image);
					image_zoom_out.src = "data:image/gif;base64,R0lGODlhEAAQAIAAACAgIP///yH5BAUUAAEALAAAAAAQABAAAAIXjI+py+0P4wK0WoquBnnb7mHSSJZmWQAAOw==";
					button_zoom_out.appendChild(image_zoom_out);

					var button_zoom_in = DocumentCreateElement("button");
					button_zoom_in.title = "zoom in";
					ElementSetStyle(button_zoom_in,CSSTextGetInitialButtonElement());
					ElementAddStyle(button_zoom_in,style_button);
					button_zoom_in.onclick = function(){
						addScale( 10.0);
					};
					var image_zoom_in = DocumentCreateElement("img");
					ElementSetStyle(image_zoom_in,CSSTextGetInitialImageElement());
					ElementAddStyle(image_zoom_in,style_button_image);
					image_zoom_in.src = "data:image/gif;base64,R0lGODlhEAAQAIAAACAgIP///yH5BAUUAAEALAAAAAAQABAAAAIfjI+pywYP2oFRBmovZLTv6XVIKILkw30SZrGrmsVSAQA7";
					button_zoom_in.appendChild(image_zoom_in);

					var button_scale_mode = DocumentCreateElement("button");
					button_scale_mode.title = "change scale mode";
					ElementSetStyle(button_scale_mode,CSSTextGetInitialButtonElement());
					ElementAddStyle(button_scale_mode,style_button);
					button_scale_mode.onclick = function(){
						gotoScaleMode(1);
					};
					var image_scale_mode = DocumentCreateElement("img");
					ElementSetStyle(image_scale_mode,CSSTextGetInitialImageElement());
					ElementAddStyle(image_scale_mode,style_button_image);
					image_scale_mode.src = "data:image/gif;base64,R0lGODlhEAAQAIAAACAgIP///yH5BAUUAAEALAAAAAAQABAAAAIshI9pwe2+EDwhrkftZTLWm33Q2GzPaZ4Tya3A98KVKJXZS2EWHHO3qlIIEQUAOw==";
					button_scale_mode.appendChild(image_scale_mode);

					var button_download = DocumentCreateElement("button");
					button_download.title = "download";
					ElementSetStyle(button_download,CSSTextGetInitialButtonElement());
					ElementAddStyle(button_download,style_button);
					button_download.onclick = function(){
						setMessage("Wait...");
						var image = _popup_image.getImage();
						var downloader = new Downloader();
						downloader.setURL(_popup_image.getOriginalURL());
						downloader.setSaveAs(false);
						downloader.setSilent(false);
						downloader.setAllowSameRequest(true);
						downloader.onprogress = function(response){
							var percent = 0.0;
							var loaded = response.bytesLoaded;
							var total = response.bytesTotal;
							if(total) percent = Math.floor(loaded / total * 100);
							setMessage("Loading... " + percent + "% " + loaded + "Byte");
						}
						downloader.oncomplete = function(response){
							if(response.result){
								setMessage("Download success");
							}else{
								setMessage("Download failure ( " + response.error + " )");
							}
						}
						downloader.start();
					};
					var image_download = DocumentCreateElement("img");
					ElementSetStyle(image_download,CSSTextGetInitialImageElement());
					ElementAddStyle(image_download,style_button_image);
					image_download.src = "data:image/gif;base64,R0lGODlhEAAQAIAAACAgIP///yH5BAUUAAEALAAAAAAQABAAAAIgjA8Jx63b4otSUWcvyjpM+oScIX6YqKGduULdW8ZyXAAAOw==";
					button_download.appendChild(image_download);

					var button_scroll = DocumentCreateElement("button");
					button_scroll.title = "close and scroll";
					ElementSetStyle(button_scroll,CSSTextGetInitialButtonElement());
					ElementAddStyle(button_scroll,style_button);
					button_scroll.onclick = function(){
						suicide();
						var anchor = _popup_image.getElementAnchor();
						anchor.scrollIntoView();
					};
					var image_scroll = DocumentCreateElement("img");
					ElementSetStyle(image_scroll,CSSTextGetInitialImageElement());
					ElementAddStyle(image_scroll,style_button_image);
					image_scroll.src = "data:image/gif;base64,R0lGODlhEAAQAIAAACAgIP///yH5BAUUAAEALAAAAAAQABAAAAIwRBypatDr4HnJxTpPtbc9zmkRMl0iVZKetpmrajEZ7M5MjI1p+LZ475PpbpLholgAADs=";
					button_scroll.appendChild(image_scroll);

					var button_close = DocumentCreateElement("button");
					button_close.title = "close";
					ElementSetStyle(button_close,CSSTextGetInitialButtonElement());
					ElementAddStyle(button_close,style_button);
					button_close.onclick = function(){
						suicide();
					};
					var image_close = DocumentCreateElement("img");
					ElementSetStyle(image_close,CSSTextGetInitialImageElement());
					ElementAddStyle(image_close,style_button_image);
					image_close.src = "data:image/gif;base64,R0lGODlhEAAQAIAAACAgIP///yH5BAUUAAEALAAAAAAQABAAAAIgjI+py50AFQQvnrlw0Hna5jlG6HifZHGIqm7n+Iry3BQAOw==";
					button_close.appendChild(image_close);

				_element_window = DocumentCreateElement("div");
				ElementSetStyle(_element_window,CSSTextGetInitialDivElement());
				ElementAddStyle(_element_window,"position:absolute; left:0px; top:0px; right:0px; bottom:0px; overflow:scroll; line-height:0; user-select:none; pointer-events:inherit; -webkit-user-select:none; -moz-user-select:none; -khtml-user-select:none;");

					_element_container = DocumentCreateElement("div");
					ElementSetStyle(_element_container,CSSTextGetInitialDivElement());
					initCursor();

						_element_background = DocumentCreateElement("div");
						ElementSetStyle(_element_background,CSSTextGetInitialDivElement());
						ElementAddStyle(_element_background,"background:#000; opacity:0.9; width:0px; height:0px; position:absolute; cursor:inherit; pointer-events:inherit;");

				_element_message = DocumentCreateElement("div");
				ElementSetStyle(_element_message,CSSTextGetInitialDivElement());
				ElementAddStyle(_element_message,"background:#fcfcfc; color:#000; font-size:14px; top:10px; left:10px; line-height:1; position:absolute; padding:5px 10px; border-radius:10px; box-shadow:0px 0px 5px #c0c0c0; pointer-events:inherit;");
				_textnode_message = document.createTextNode("");
				_element_message.appendChild(_textnode_message);
				_message_alpha = 0.0;

			// リムーブ監視
			_observer_remove = new DomNodeObserverRemoveFromDocument(_element_viewer);
			_observer_remove.setFunction(_this.release);

			// 解析ワーク作成
			_analyze_work_viewer = AnalyzeWorkCreate(_element_viewer);

			// 解析済み
			AnalyzeWorkSetInvalid(_analyze_work_viewer);

			// 解析辞書登録オプション
			var attach_options = new AnalyzeWorkDictionaryAttachOptions();
			attach_options.SetOutsider();
			if(window_manager.existWindowRoot()) attach_options.SetGuest();
			analyze_work_dictionary.attachAnalyzeWork(_analyze_work_viewer,attach_options);

			// ノードリスト登録
			_element_viewer.appendChild(_element_window);
			_element_window.appendChild(_element_container);
			_element_container.appendChild(_element_background);
			_shadow_host = DocumentCreateElement("div");
			_element_root.appendChild(_shadow_host);
			var shadow_root;
			if(_shadow_host.attachShadow){
				shadow_root = _shadow_host.attachShadow({mode:"closed"});
			}else{
				shadow_root = _shadow_host;
			}
			shadow_root.appendChild(_element_viewer);

			addEvent();

			_element_transform = DocumentCreateElement("div");
			ElementSetStyle(_element_transform,CSSTextGetInitialDivElement());
			ElementAddStyle(_element_transform,"cursor:inherit;");

			_element_transform_circle_before = DocumentCreateElement("div");
			ElementSetStyle(_element_transform_circle_before,CSSTextGetInitialDivElement());
			ElementAddStyle(_element_transform_circle_before,"position:absolute; left:0px; top:0px; cursor:inherit; opacity:0.25; background:#FFF; border-radius:50%; border:5px dotted #444;");
			StyleDeclarationSetTransformOrigin(_element_transform_circle_before.style,"0% 0%");

			_element_transform_vector_before = DocumentCreateElement("div");
			ElementSetStyle(_element_transform_vector_before,CSSTextGetInitialDivElement());
			ElementAddStyle(_element_transform_vector_before,"position:absolute; left:0px; top:0px; cursor:inherit; opacity:0.25; height:3px; background:#F88; border:1px solid #800; border-radius:2.5px;");
			StyleDeclarationSetTransformOrigin(_element_transform_vector_before.style,"0% 0%");

			_element_transform_vector_after = DocumentCreateElement("div");
			ElementSetStyle(_element_transform_vector_after,CSSTextGetInitialDivElement());
			ElementAddStyle(_element_transform_vector_after,"position:absolute; left:0px; top:0px; cursor:inherit; opacity:0.25; height:3px; background:#88F; border:1px solid #008; border-radius:2.5px;");
			StyleDeclarationSetTransformOrigin(_element_transform_vector_after.style,"0% 0%");

			_element_transform.appendChild(_element_transform_circle_before);
			_element_transform.appendChild(_element_transform_vector_before);
			_element_transform.appendChild(_element_transform_vector_after);

			// 画像更新
			updateImage(_popup_image);

			(function(){

				// メニュー更新
				function updateMenu(type){
					menu_type = type;
					var style = _element_menu.style;
					var list;
					switch(menu_type){
					case ImageViewer.MENU_TYPE_HORIZONTAL:
						list = menu_horizontal_list;
						style.width = "auto";
						style.padding = "4px 10px";
						break;
					case ImageViewer.MENU_TYPE_VERTICAL:
						list = menu_vertical_list;
						style.width = "24px";
						style.padding = "10px 4px";
						break;
					}

					var i;
					var num = list.length;
					for(i=0;i<num;i++){
						_element_menu.appendChild(list[i]);
					}
				}

				function MenuTaskHideInit(task){
					DomNodeRemove(_element_menu);
					task.setExecuteFunc(MenuTaskHideExec);
					task.execute(0xffffffff);
				}
				function MenuTaskHideExec(task){
					var client_w = _element_window.clientWidth;
					var pos = _input_mouse.getPositionClient();
					if(pos.y <= MENU_WIDTH){
						updateMenu(ImageViewer.MENU_TYPE_HORIZONTAL);
						task.setExecuteFunc(MenuTaskFadeInInit);
					}else if(pos.x >= client_w - MENU_WIDTH){
						updateMenu(ImageViewer.MENU_TYPE_VERTICAL);
						task.setExecuteFunc(MenuTaskFadeInInit);
					}
				}

				function MenuTaskFadeInInit(task){
					_element_viewer.appendChild(_element_menu);
					task.setExecuteFunc(MenuTaskFadeInExec);
					task.execute(0xffffffff);
				}
				function MenuTaskFadeInExec(task){
					menu_alpha += 0.2;
					if(menu_alpha > 1.0){
						menu_alpha = 1.0;
						task.setExecuteFunc(MenuTaskShowInit);
					}
					_element_menu.style.opacity = menu_alpha;
				}

				function MenuTaskShowInit(task){
					task.setExecuteFunc(MenuTaskShowExec);
					task.execute(0xffffffff);
				}
				function MenuTaskShowExec(task){
					var client_w = _element_window.clientWidth;
					var pos = _input_mouse.getPositionClient();
					if(menu_type == ImageViewer.MENU_TYPE_HORIZONTAL){
						if(pos.y > MENU_WIDTH){
							task.setExecuteFunc(MenuTaskWaitInit);
						}
					}
					if(menu_type == ImageViewer.MENU_TYPE_VERTICAL){
						if(pos.x < client_w - MENU_WIDTH){
							task.setExecuteFunc(MenuTaskWaitInit);
						}
					}
				};

				function MenuTaskWaitInit(task){
					var work = task.getUserWork();
					work.frame = 60 * 0;
					task.setExecuteFunc(MenuTaskWaitExec);
					task.execute(0xffffffff);
				}
				function MenuTaskWaitExec(task){
					var work = task.getUserWork();
					work.frame -= 1;
					if(work.frame < 0){
						task.setExecuteFunc(MenuTaskFadeOutInit);
					}
				}

				function MenuTaskFadeOutInit(task){
					task.setExecuteFunc(MenuTaskFadeOutExec);
					task.execute(0xffffffff);
				}
				function MenuTaskFadeOutExec(task){
					menu_alpha -= 0.1;
					if(menu_alpha < 0.0){
						menu_alpha = 0.0;
						task.setExecuteFunc(MenuTaskHideInit);
					}
					_element_menu.style.opacity = menu_alpha;
				}

				var MENU_WIDTH = 50;
				var menu_type;
				var menu_alpha = 1.0;

				var menu_horizontal_list = [
					button_prev,
					button_next,
					button_zoom_out,
					button_zoom_in,
					button_scale_mode,
					button_download,
					button_scroll,
					button_close
				];
				var menu_vertical_list = [
					button_close,
					button_scroll,
					button_download,
					button_scale_mode,
					button_zoom_in,
					button_zoom_out,
					button_prev,
					button_next
				];

				updateMenu(ImageViewer.MENU_TYPE_HORIZONTAL);
				_element_viewer.appendChild(_element_menu);

				function mouseOver(){
					if(_element_menu.removeEventListener){
						_element_menu.removeEventListener("mouseover",mouseOver,false);
					}else if(_element_menu.detachEvent){
						_element_menu.detachEvent("onmouseover",mouseOver);
					}

					if(_parent_task){
						var menu_task = task_container.createTask(_parent_task);
						menu_task.setDestructorFunc(function(){
							menu_task = null;
						});
						menu_task.setExecuteFunc(MenuTaskFadeInInit);
						menu_task.execute(0xffffffff);
					}
				}

				if(_element_menu.addEventListener){
					_element_menu.addEventListener("mouseover",mouseOver,false);
				}else if(_element_menu.attachEvent){
					_element_menu.attachEvent("onmouseover",mouseOver);
				}
			})();

			(function(){
				// 親タスク
				_parent_task = task_container.createTask();
				_parent_task.setDestructorFunc(function(){
					_parent_task = null;
				});

				// フェードインタスク
				_fade_alpha = 0.0;
				_fade_task = task_container.createTask(_parent_task);
				_fade_task.setDestructorFunc(function(){
					_fade_task = null;
				});
				_fade_task.setExecuteFunc(function(){
					_fade_alpha += 0.2;
					if(_fade_alpha > 1.0){
						_fade_alpha = 1.0;
						_fade_task.release();
					}
					_element_viewer.style.opacity = _fade_alpha;
				});
				_fade_task.execute(0xffffffff);

				task_execute_level &= ~TASK_EXECUTE_LEVEL_POPUP;
			})();

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

	// -
	// イメージビューワ定数
	// -
	ImageViewer.SCALE_MODE_AUTO			 = 0;
	ImageViewer.SCALE_MODE_NO_SCALE		 = 1;
	ImageViewer.SCALE_MODE_LONG_VERTICAL = 2;
	ImageViewer.SCALE_MODE_SHOW_ALL		 = 3;
	ImageViewer.SCALE_MODE_SHOW_FULL	 = 4;
	ImageViewer.SCALE_MODE_MAX			 = 5;
	ImageViewer.MENU_TYPE_HORIZONTAL	 = 0;
	ImageViewer.MENU_TYPE_VERTICAL		 = 1;

	// -
	// イメージドラッガー
	// -
	function ImageDragger(image){
		var _this = this;

		// -
		// 開放
		// -
		_this.release = function(){
			removeEvent();
			releaseImageDropper();
		};

		// -
		// 元のアドレスをセット
		// -
		_this.setOriginalURL = function(url){
			_original_url = url;
		};

		// -
		// ドラッグ開始
		// -
		function releaseImageDropper(e){
			if(dropper){
				dropper.release();
				dropper = null;
			}
			if(time_handle !== null){
				clearTimeout(time_handle);
				time_handle = null;
			}
		}

		// -
		// ドラッグ開始
		// -
		function dragStart(e){
			input_mouse.setMouseEvent(e);
			releaseImageDropper();
			
			if(_original_url){
				try{
					var data_transfer = e.dataTransfer;
					data_transfer.setData("url" , _original_url);
					data_transfer.setData("text" , _original_url);
				}catch(e){
				}
			}
			
			time_handle = setTimeout(function(){
				time_handle = null;
				dropper = new ImageDropper();
			},1);
		}

		// -
		// ドラッグ終了
		// -
		function dragEnd(e){
			if(e.dataTransfer.dropEffect == "none"){
				releaseImageDropper();
			}
		}

		// -
		// イベントを追加(内部用)
		// -
		function addEvent(){
			removeEvent();

			if(image.addEventListener){
				image.addEventListener("dragstart",dragStart,false);
				image.addEventListener("dragend",dragEnd,false);
			}else if(image.attachEvent){
				image.attachEvent("ondragstart",mouseMove);
				image.attachEvent("ondragend",dragEnd);
			}
		}

		// -
		// イベントを破棄(内部用)
		// -
		function removeEvent(){
			if(image.removeEventListener){
				image.removeEventListener("dragstart",dragStart,false);
				image.removeEventListener("dragend",dragEnd,false);
			}else if(image.detachEvent){
				image.detachEvent("ondragstart",dragStart);
				image.detachEvent("ondragend",dragEnd);
			}
		}

		// -
		// プライベート変数
		// -
		var dropper = null;
		var time_handle = null;
		var _original_url = null;

		// -
		// 初期化
		// -
		(function(){
			addEvent();		
		})();
		
	}

	// -
	// イメージドロッパー
	// -
	function ImageDropper(){
		var _this = this;

		// -
		// 開放
		// -
		_this.release = function(){
			release_0();
			release_1();
		};

		// -
		// 自殺(内部用)
		// -
		function suicide(){
			release_0();

			(function(){
				var task = task_container.createTask();
				task.setDestructorFunc(function(){
					task = null;
				});
				task.setExecuteFunc(function(){
					_fade_alpha -= 0.2;
					if(_fade_alpha < 0.0){
						_fade_alpha = 0.0;
						task.release();
						release_1();
						return;
					}
					_window.style.opacity = _fade_alpha;
				});
				task.execute(0xffffffff);
			})();
		}

		// -
		// 開放 0(内部用)
		// -
		function release_0 (){
			removeEvent();

			if(_event_handler_release){
				_event_handler_release.release();
				_event_handler_release = null;
			}

			// マウスイベント無効化
			_window.style.pointerEvents = "none";

			if(_parent_task){
				_parent_task.releaseChild();
			}
		};

		// -
		// 開放 1(内部用)
		// -
		function release_1 (){
			DomNodeRemove(_shadow_host);

			// リムーブ監視を破棄
			if(_observer_remove){
				_observer_remove.release();
				_observer_remove = null;
			}

			// 解析辞書除外
			if(_analyze_work_shadow_host){
				analyze_work_dictionary.removeAnalyzeWork(_analyze_work_shadow_host);
				_analyze_work_shadow_host = null;
			}

			// タスク破棄
			if(_parent_task){
				_parent_task.releaseChild();
				_parent_task.release();
				_parent_task = null;
			}
		};

		// -
		// イベントを追加(内部用)
		// -
		function addEvent(){
			removeEvent();

			if(_droperea_download.addEventListener){
				_droperea_download.addEventListener("dragenter",dragEnter,false);
				_droperea_download.addEventListener("dragleave",dragLeave,false);
				_droperea_download.addEventListener("dragover",dragOver,false);
				_droperea_download.addEventListener("drop",dropDownload,false);
			}else if(_droperea_download.attachEvent){
				_droperea_download.attachEvent("ondragenter",dragEnter);
				_droperea_download.attachEvent("ondragleave",dragLeave);
				_droperea_download.attachEvent("ondragover",dragOver);
				_droperea_download.attachEvent("ondrop",dropDownload);
			}
		}

		// -
		// イベントを破棄(内部用)
		// -
		function removeEvent(){
			if(_droperea_download.removeEventListener){
				_droperea_download.removeEventListener("dragenter",dragEnter,false);
				_droperea_download.removeEventListener("dragleave",dragLeave,false);
				_droperea_download.removeEventListener("dragover",dragOver,false);
				_droperea_download.removeEventListener("drop",dropDownload,false);
			}else if(_droperea_download.detachEvent){
				_droperea_download.detachEvent("ondragenter",dragEnter);
				_droperea_download.detachEvent("ondragleave",dragLeave);
				_droperea_download.detachEvent("ondragover",dragOver);
				_droperea_download.detachEvent("ondrop",dropDownload);
			}
		}

		// -
		// ドラッグイベント(内部用)
		// -
		function dragOver(e){
			dragEnter(e);
			if(e.preventDefault){
				e.preventDefault();
			}else{
				return false;
			}
		}
		function dragEnter(e){
			enterDropArea(e.currentTarget);
		}
		function dragLeave(e){
			leaveDropArea(e.currentTarget);
		}
		function enterDropArea(element){
			var style = element.style;
			style.backgroundImage = "linear-gradient(to top, #f0f4ff, #c8cff0)";
			style.boxShadow = "0px 0px 6px #6070d0";
		}
		function leaveDropArea(element){
			var style = element.style;
			style.backgroundImage = "linear-gradient(to bottom, #f8f8f8, #e8e8e8)";
			style.boxShadow = "0px 0px 2px #808080";
		}

		// -
		// ドロップイベント(内部用)
		// -
		function dropDownload(e){
			dragLeave(e);
			
			var url = e.dataTransfer.getData("url");
	
			var ui_progress = new UI_Progress(_svg_download);
			var downloader = new Downloader();
			downloader.setURL(url);
			downloader.setSaveAs(false);
			downloader.setSilent(false);
			downloader.setAllowSameRequest(true);
			downloader.onprogress = function(response){
				var percent = 0.0;
				var loaded = response.bytesLoaded;
				var total = response.bytesTotal;
				if(total) percent = loaded / total;
				ui_progress.setValue(percent);
				_droperea_download.title = "Loading... " + Math.floor(percent * 100) + "% " + loaded + "Byte";
			}
			downloader.oncomplete = function(response){
				var path = document.createElementNS("http://www.w3.org/2000/svg", "path");
				DomNode_InsertLastChild(_svg_download , path);
				
				if(response.error){
					path.setAttribute( "fill" , "rgba(255,128,128,0.75)" );
					path.setAttribute( "d" , 
						"M78,16.099c-0.174,0.404-0.346,0.75-0.519,1.037c-0.174,0.289-0.376,0.599-0.607,0.908" +
						"c-3.543,4.736-7.181,9.417-10.564,13.982c-3.384,4.565-9.663,11.308-9.786,13.975c-0.041,0.892,1.771,3.257,2.723,4.927" +
						"c0.95,1.669,1.967,3.428,3.047,5.271c1.081,1.844,2.24,3.786,3.479,5.832c1.237,2.046,2.641,4.252,4.017,6.57" +
						"c0.35,0.589,0.655,1.195,0.929,1.771c0.274,0.576,0.469,1.138,0.584,1.685c-0.397-0.225-0.595-0.337-0.992-0.562" +
						"c0.173,0.57,0.257,0.855,0.43,1.426c-0.346,0.035-0.519,0.053-0.864,0.088c0.207,0.847,0.312,1.271,0.519,2.118" +
						"c-0.951-0.778-1.425-1.167-2.375-1.945c0.276,1.176,0.415,1.763,0.691,2.938c-0.536-0.294-0.805-0.442-1.341-0.736" +
						"c-0.241,0.813-0.361,1.219-0.603,2.031c-0.984-0.985-1.479-1.477-2.463-2.462c0.207,1.072,0.311,1.608,0.518,2.681" +
						"c-0.535-0.501-0.804-0.755-1.34-1.256c-0.104,0.207-0.157,0.313-0.261,0.52c-0.276-0.312-0.415-0.466-0.691-0.777" +
						"c-0.035,0.415-0.049,0.622-0.084,1.037c-0.489-0.49-0.886-0.914-1.188-1.275c-0.302-0.36-0.584-0.763-0.845-1.189" +
						"c-1.913-3.129-3.823-6.202-5.595-9.184c-1.771-2.982-5.085-8.793-5.121-8.794c-0.361-0.007-2.664,4.35-3.931,6.481" +
						"c-1.268,2.133-2.544,4.338-3.825,6.613c-1.282,2.276-2.592,4.676-3.932,7.196c-1.338,2.521-2.758,5.265-4.256,8.23" +
						"c-0.116,0.23-0.222,0.444-0.323,0.646c-0.102,0.201-0.239,0.427-0.413,0.672c-0.172,0.244-0.382,0.502-0.626,0.775" +
						"c-0.244,0.272-0.555,0.6-0.929,0.974c-0.138-0.622-0.207-0.933-0.345-1.555c-0.881,0.881-1.322,1.321-2.204,2.202" +
						"c0.276-1.382,0.496-2.075,0.772-3.457C28.579,86.444,28,86.921,27,87.871c0-0.674,0-1.01,0-1.684" +
						"c-1,0.432-1.455,0.646-2.371,1.078c0.536-1.244,0.763-1.865,1.299-3.109c-0.985,0.743-1.498,1.113-2.482,1.856" +
						"c0.242-0.812,0.352-1.217,0.594-2.029c-0.536,0.104-0.81,0.155-1.345,0.259c0.501-1.02,0.75-1.528,1.251-2.548" +
						"c-0.777,0.483-1.167,0.727-1.944,1.21c0.085-0.345,0.194-0.706,0.323-1.08c0.129-0.375,0.335-0.756,0.54-1.123" +
						"c3.2-5.729,6.356-12.1,9.828-17.891s10.755-14.004,10.911-17.156c0.104-2.084-4.027-7.568-5.942-11.296" +
						"c-1.915-3.728-3.904-7.594-5.768-11.519c-0.175-0.368-0.339-0.755-0.497-1.144c-0.159-0.389-0.28-0.742-0.367-1.06" +
						"c0.45,0.104,0.674,0.155,1.124,0.259c-0.311-0.882-0.468-1.323-0.779-2.204c0.536,0.035,0.804,0.052,1.34,0.087" +
						"c-0.069-0.898-0.104-1.348-0.174-2.246c1.02,0.933,1.532,1.399,2.552,2.333c-0.432-1.487-0.626-2.229-1.058-3.716" +
						"C34.812,15.702,35,15.978,36,16.531c0-0.778,0-1.167,0-1.944c1,0.968,1.429,1.452,2.396,2.42" +
						"c-0.259-0.933-0.398-1.401-0.658-2.334c0.709,0.64,1.057,0.959,1.765,1.599c0.259-0.519,0.387-0.777,0.646-1.296" +
						"c0.432,0.577,0.784,1.109,1.057,1.599c0.273,0.49,0.627,1.075,0.971,1.728c1.632,3.105,3.076,6.26,4.473,9.012" +
						"c1.397,2.752,4.033,8.012,4.083,8.016c1.278,0.091,10.41-14.775,15.943-21.78c0.385-0.487,0.822-0.943,1.255-1.36" +
						"c0.432-0.417,0.964-0.756,1.598-1.016c-0.121,0.449-0.182,0.674-0.303,1.123c0.674-0.501,1.013-0.751,1.688-1.252" +
						"c-0.208,1.002-0.313,1.504-0.521,2.506c1.21-0.916,1.814-1.375,3.024-2.29c0.035,0.777,0.054,1.167,0.089,1.944" +
						"c0.951-0.328,1.426-0.493,2.377-0.821c-0.605,1.175-0.907,1.764-1.513,2.938c1.072-0.743,1.606-1.115,2.679-1.858" +
						"c-0.259,0.743-0.39,1.115-0.648,1.858c0.501-0.293,0.753-0.441,1.254-0.735c-0.501,0.899-0.753,1.348-1.254,2.247" +
						"C77.04,16.54,77.36,16.393,78,16.099z"
					);
					_droperea_download.title = "Download failure ( " + response.error + " )";
				}else{
					path.setAttribute( "fill" , "rgba(96,255,96,0.75)" );
					path.setAttribute( "d" , 
						"M18.882,60.969c-0.601-0.636-1.068-1.181-1.386-1.635c-0.318-0.454-0.478-0.892-0.478-1.315" +
						"c0-0.545,0.266-1.093,0.795-1.638c0.53-0.545,1.211-1.029,2.045-1.453c0.832-0.424,1.74-0.767,2.725-1.024" +
						"c0.983-0.257,1.931-0.384,2.84-0.384c0.969,0,1.764,0.127,2.384,0.384c0.62,0.257,1.22,0.691,1.795,1.297" +
						"c2.332,2.453,4.444,4.959,6.336,7.518c1.893,2.56,5.564,7.927,5.564,7.927c0.546-0.063,3.572-9.229,5.45-13.604" +
						"c1.877-4.376,3.869-8.66,5.974-12.854c2.104-4.194,4.361-8.331,6.77-12.403c2.407-4.072,5.063-8.175,7.836-12.285" +
						"c1.031-1.529,2.551-2.681,4.564-3.407S76.691,15,79.841,15c0.938,0,1.694,0.136,2.27,0.408s0.865,0.637,0.865,1.091" +
						"c0,0.394-0.091,0.787-0.272,1.181s-0.461,0.85-0.818,1.363c-6.759,9.716-13.279,19.88-18.76,30.161" +
						"c-5.623,10.548-10.722,22.024-14.673,33.254c-0.288,0.817-0.939,1.481-2,1.906C45.393,84.788,43.834,85,41.774,85" +
						"c-0.969,0-1.786-0.03-2.451-0.091c-0.667-0.062-1.228-0.175-1.682-0.341c-0.454-0.166-0.834-0.371-1.136-0.613" +
						"c-0.304-0.242-0.558-0.552-0.771-0.908c-1.26-2.109-2.566-4.097-3.793-5.93c-1.227-1.831-2.5-3.612-3.816-5.338" +
						"c-1.317-1.726-2.725-3.467-4.224-5.223S20.729,62.922,18.882,60.969z"
					);
					_droperea_download.title = "Download success";
				}
				(function(){
					var time = 60 * 3;
					var task = task_container.createTask();
					task.setDestructorFunc(function(){
						task = null;
					});
					task.setExecuteFunc(function(){
						time -= 1;
						if(time < 0){
							suicide();
							task.release();
							return;
						}
					});
					task.execute(0xffffffff);
				})();
			}
			downloader.start();			
			
			
			if(e.preventDefault){
				e.preventDefault();
			}else{
				return false;
			}
		}

		// -
		// ブログレス(内部用)
		// -
		function UI_Progress(svg){
			var _this = this;

			// -
			// 開放
			// -
			_this.release = function(){
				DomNodeRemove(_path);
			};

			// -
			// 値をセット
			// -
			_this.setValue = function(value){
				update(value);
			};

			// -
			// 更新(内部用)
			// -
			function update(v){
				var px = 50;
				var py = 50;
				var r = 48;
				var deg1 = (-90);
				var deg3 = deg1 + (360 * v);
				var deg2 = (deg3 - deg1) * 0.5 + deg1;
				var rad1 = deg1 * Math.PI / 180;
				var rad2 = deg2 * Math.PI / 180;
				var rad3 = deg3 * Math.PI / 180;
				var x1 = Math.cos(rad1) * r + px;
				var y1 = Math.sin(rad1) * r + py;
				var x2 = Math.cos(rad2) * r + px;
				var y2 = Math.sin(rad2) * r + py;
				var x3 = Math.cos(rad3) * r + px;
				var y3 = Math.sin(rad3) * r + py;
				var cmd = new Array();
				cmd.push("M");
				cmd.push(px);
				cmd.push(py);
				cmd.push("L");
				cmd.push(x1);
				cmd.push(y1);
				cmd.push("A");
				cmd.push(r);
				cmd.push(r);
				cmd.push(deg1);
				cmd.push(0);
				cmd.push(1);
				cmd.push(x2);
				cmd.push(y2);
				cmd.push("A");
				cmd.push(r);
				cmd.push(r);
				cmd.push(deg2);
				cmd.push(0);
				cmd.push(1);
				cmd.push(x3);
				cmd.push(y3);
				cmd.push("Z");
				_path.setAttribute( "d" , cmd.join(" ") );
			}

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

			// -
			// 初期化
			// -
			(function(){
				_path = document.createElementNS("http://www.w3.org/2000/svg", "path");
				DomNode_InsertFirstChild(svg , _path);
				_path.setAttribute( "fill" , "rgba(0,128,255,0.1)" );
			})();
		}

		// -
		// プライベート変数
		// -
		var _shadow_host;
		var _window;
		var _droperea_download;
		var _svg_download;
		var _parent_task;
		var _fade_alpha;
		var _observer_remove;
		var _analyze_work_shadow_host;
		var _event_handler_release;

		// -
		// 初期化
		// -
		(function(){
			_shadow_host = DocumentCreateElement("div");

			// リムーブ監視
			_observer_remove = new DomNodeObserverRemoveFromDocument(_shadow_host);
			_observer_remove.setFunction(_this.release);

			// 解析ワーク作成
			_analyze_work_shadow_host = AnalyzeWorkCreate(_shadow_host);

			// 解析済み
			AnalyzeWorkSetInvalid(_analyze_work_shadow_host);

			// 解析辞書登録オプション
			var attach_options = new AnalyzeWorkDictionaryAttachOptions();
			attach_options.SetOutsider();
			analyze_work_dictionary.attachAnalyzeWork(_analyze_work_shadow_host,attach_options);

			document.body.appendChild(_shadow_host);
			var shadow_root;
			if(_shadow_host.attachShadow){
				shadow_root = _shadow_host.attachShadow({mode:"closed"});
			}else{
				shadow_root = _shadow_host;
			}

			_window = DocumentCreateElement("div");
			ElementSetStyle(_window,CSSTextGetInitialDivElement());
			ElementAddStyle(_window,"background:#fcfcfc; color:#000; font-size:14px; line-height:1; position:fixed; padding:15px; z-index:2147483646; border-radius:10px; box-shadow:0px 0px 5px #c0c0c0; pointer-events:inherit;");
			shadow_root.appendChild(_window);
			
			var style_droperea = "margin:0px; padding:0px; background:#ffc; font-size:12px; font-weight:bold; text-align:center; width:100px; height:100px; display:inline-block; pointer-events:inherit; border-radius:10px; overflow:hidden;";

			_droperea_download = document.createElement("div");
			ElementAddStyle(_droperea_download,style_droperea);
			enterDropArea(_droperea_download);
			_window.appendChild(_droperea_download);

			_svg_download = document.createElementNS("http://www.w3.org/2000/svg","svg");
			_svg_download.innerHTML = '<rect x="10" y="80" fill="#252525" width="80" height="10"/><polygon fill="#252525" points="50,75 20,45 40,45 40,10 60,10 60,45 80,45 "/>';
			_droperea_download.appendChild(_svg_download);

			addEvent();

			var client_rect = ElementGetBoundingClientRect(_window);
			var mouse_pos = input_mouse.getPositionClient();
			var w = client_rect.right - client_rect.left;
			var h = client_rect.bottom - client_rect.top;
			var x = mouse_pos.x - w * 0.5;
			var y = mouse_pos.y - h * 0.5;
			var offset = window_manager.getPositionFromRoot();
			x -= offset.x;
			y -= offset.y;
			var style = _window.style;
			style.left = (x) + "px";
			style.top  = (y) + "px";

			// 親タスク
			_parent_task = task_container.createTask();
			_parent_task.setDestructorFunc(function(){
				_parent_task = null;
			});

			(function(){
				// フェードインタスク
				_fade_alpha = 0.0;
				var task = task_container.createTask(_parent_task);
				task.setDestructorFunc(function(){
					task = null;
				});
				task.setExecuteFunc(function(){
					_fade_alpha += 0.2;
					if(_fade_alpha > 1.0){
						_fade_alpha = 1.0;
						task.release();
					}
					_window.style.opacity = _fade_alpha;
				});
				task.execute(0xffffffff);
			})();

			(function(){
				var task = task_container.createTask(_parent_task);
				task.setDestructorFunc(function(){
					task = null;
				});
				task.setExecuteFunc(function(){
					var mouse_pos = input_mouse.getPositionClient();
					var offset = window_manager.getPositionFromRoot();
					mouse_pos.x -= offset.x;
					mouse_pos.y -= offset.y;
					if(!ElementHitTestPosition(_window,mouse_pos,true)){
						task.release();	
						suicide();
					}
				});
				task.execute(0xffffffff);
			})();

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

		})();
	}

	// -
	// メディアプレイヤー拡張 UI
	// -
	function MediaPlayerExtendUI(element){
		var _this = this;

		// -
		// 開放
		// -
		_this.release = function(){
			removeEvent();

			// タスク破棄
			if(_parent_task){
				_parent_task.releaseChild();
				_parent_task.release();
				_parent_task = null;
			}

			if(_event_dispatcher){
				_event_dispatcher.release();
				_event_dispatcher = null;
			}

			if(_event_handler_release){
				_event_handler_release.release();
				_event_handler_release = null;
			}

			if(_observer_remove){
				_observer_remove.release();
				_observer_remove = null;
			}

			// 解析辞書除外
			if(_analyze_work_container){
				analyze_work_dictionary.removeAnalyzeWork(_analyze_work_container);
				_analyze_work_container = null;
			}

			DomNodeRemove(_element_container);
		};

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

		// -
		// 閉じる(内部用)
		// -
		function close(){
			// イベントを発火
			_event_dispatcher.dispatchEvent("close",_this);

			DomNodeRemove(_element_target);

			_this.release();
		}

		// -
		// イベントを追加(内部用)
		// -
		function addEvent(){
			removeEvent();

			if(window.addEventListener){
				_element_target.addEventListener("mouseover",mouseOver,false);
				_element_resize.addEventListener("mousedown",mouseDownResize,false);
				_element_container.addEventListener("dragstart",dragStart,false);
			}else if(window.attachEvent){
				_element_target.attachEvent("onmouseover",mouseOver);
				_element_resize.attachEvent("onmousedown",mouseDownResize);
				_element_container.attachEvent("ondragstart",dragStart);
			}
		}

		// -
		// イベントを破棄(内部用)
		// -
		function removeEvent(){
			if(window.removeEventListener){
				_element_target.removeEventListener("mouseover",mouseOver,false);
				_element_resize.removeEventListener("mousedown",mouseDownResize,false);
				_element_container.removeEventListener("dragstart",dragStart,false);
			}else if(window.detachEvent){
				_element_target.detachEvent("onmouseover",mouseOver);
				_element_resize.detachEvent("onmousedown",mouseDownResize);
				_element_container.detachEvent("ondragstart",dragStart);
			}
		}

		// -
		// マウス移動(内部用)
		// -
		function mouseOver(e){
			// マウス入力を更新
			input_mouse.setMouseEvent(e);

			if(_player_task){
			}else{
				_player_task = task_container.createTask(_parent_task);
				_player_task.setLevel(TASK_EXECUTE_LEVEL_POPUP);
				_player_task.setDestructorFunc(function(){
					_player_task = null;
				});
				_player_task.setExecuteFunc(PlayerTaskInitialize);
				_player_task.execute(0xffffffff);
			}
		}

		// -
		// プレイヤータスク初期化(内部用)
		// -
		function PlayerTaskInitialize(task){
			var work = task.getUserWork();
			work.spd = 0.0;
			document.body.appendChild(_element_container);
			update();

			task.setExecuteFunc(PlayerTaskFadeIn);
			task.execute(0xffffffff);
		}

		// -
		// プレイヤータスクフェードイン(内部用)
		// -
		function PlayerTaskFadeIn(task){
			var work = task.getUserWork();

			work.spd += 0.1;
			if(work.spd > 0.5) work.spd = 0.5;
			var fri = (1.0 - _fade_alpha) * 0.3;
			if(work.spd > fri) work.spd = fri;
			_fade_alpha += work.spd;
			if(_fade_alpha < 0.0){
				_fade_alpha = 0.0;
			}
			if(_fade_alpha > 0.99){
				_fade_alpha = 1.0;
				task.setExecuteFunc(PlayerTaskWaitInit);
			}

			if(!hitTest(input_mouse.getPositionClient())){
				task.setExecuteFunc(PlayerTaskFadeOut);
			}

			update();
		}

		// -
		// プレイヤータスク待機(内部用)
		// -
		function PlayerTaskWaitInit(task){
			var work = task.getUserWork();
			task.setExecuteFunc(PlayerTaskWaitExec);
			task.execute(0xffffffff);
		}
		function PlayerTaskWaitExec(task){
			var work = task.getUserWork();

			if(!hitTest(input_mouse.getPositionClient())){
				task.setExecuteFunc(PlayerTaskFadeOut);
			}
		}

		// -
		// プレイヤータスクフェードアウト(内部用)
		// -
		function PlayerTaskFadeOut(task){
			var work = task.getUserWork();

			work.spd -= 0.01;
			if(work.spd < -0.5) work.spd = -0.5;
			var fri = (0.0 - _fade_alpha) * 0.4;
			if(work.spd < fri) work.spd = fri;
			_fade_alpha += work.spd;
			if(_fade_alpha > 1.0){
				_fade_alpha = 1.0;
			}
			if(_fade_alpha < 0.01){
				_fade_alpha = 0.0;
				task.setExecuteFunc(PlayerTaskClose);
			}

			if(hitTest(input_mouse.getPositionClient())){
				task.setExecuteFunc(PlayerTaskFadeIn);
			}

			update();
		}

		// -
		// 閉じる(内部用)
		// -
		function PlayerTaskClose(task){
			var work = task.getUserWork();
			DomNodeRemove(_element_container);
			task.release();
		}

		// -
		// マウスダウンリサイズ(内部用)
		// -
		function mouseDownResize(e){
			// マウス入力を更新
			input_mouse.setMouseEvent(e);

			var resize_rect = ElementGetBoundingClientRect(_element_resize);
			var mouse_pos = input_mouse.getPositionClient();
			var resize_offset = {
				x:(mouse_pos.x - resize_rect.left) - 4,
				y:(mouse_pos.y - resize_rect.top ) - 4
			};

			if(_resize_task){
			}else if(input_mouse.getButtonLeft()){

				DomNode_InsertBefore(_element_resize,_element_hitarea);

				_resize_task = task_container.createTask(_parent_task);
				_resize_task.setLevel(TASK_EXECUTE_LEVEL_POPUP);
				_resize_task.setDestructorFunc(function(){
					_resize_task = null;
				});
				_resize_task.setExecuteFunc(function(){

					if(!input_mouse.getButtonLeft()){
						DomNodeRemove(_element_hitarea);
						_resize_task.release();
						return;
					}

					var rect = ElementGetBoundingClientRect(_element_target);
					var size = ComputedStyleGetSize(_element_target.style);
					var pos = input_mouse.getPositionClient();
					var w = (pos.x - resize_offset.x) - rect.left - (size.offsetWidth  - size.width);
					var h = (pos.y - resize_offset.y) - rect.top  - (size.offsetHeight - size.height);
					if(w < 0) w = 0;
					if(h < 0) h = 0;

					var style = _element_target.style;
					style.minWidth  = "0";
					style.minHeight = "0";
					style.maxWidth  = "none";
					style.maxHeight = "none";
					style.width  = (w) + "px";
					style.height = (h) + "px";

					update();
				});
				_resize_task.execute(0xffffffff);
			}

		}

		// -
		// 当たり判定(内部用)
		// -
		function hitTest(mouse_pos){
			if(_resize_task) return true;
			if(ElementHitTestPosition(_element_menu,mouse_pos,true)) return true;
			if(ElementHitTestPosition(_element_resize,mouse_pos,true)) return true;
			if(ElementHitTestPosition(_element_target,mouse_pos,true)) return true;

			var rect = ElementGetBoundingClientRect(_element_target);
			var max_x = rect.right + 16;
			var max_y = rect.bottom + 16;
			var min_x = max_x - 32;
			var min_y = max_y - 32;
			if(max_x < mouse_pos.x){
			}else if(max_y < mouse_pos.y){
			}else if(min_x > mouse_pos.x){
			}else if(min_y > mouse_pos.y){
			}else{
				return true;
			}

			return false;
		}

		// -
		// ドラッグ開始イベント(内部用)
		// -
		function dragStart(e){
			// デフォルトの動作を無効化する
			if(e.preventDefault){
				e.preventDefault();
			}else{
				return false;
			}
		}

		// -
		// 更新(内部用)
		// -
		function update(){
			// スクロール位置
			var scroll_pos = WindowGetScrollPosition(window);
			var target_rect = ElementGetBoundingClientRect(_element_target);
			target_rect.left += scroll_pos.x;
			target_rect.right += scroll_pos.x;
			target_rect.top += scroll_pos.y;
			target_rect.bottom += scroll_pos.y;

			var target_w = target_rect.right - target_rect.left;
			var target_h = target_rect.bottom - target_rect.top;

			var style = _element_header.style;
			style.width = (target_w) + "px";

			var header_rect = ElementGetBoundingClientRect(_element_header);
			var header_h = header_rect.bottom - header_rect.top;

			var hreader_y = target_rect.top - header_h;
			style.left = (target_rect.left) + "px";
			style.top  = (hreader_y) + "px";

			var style = _element_menu.style;
			style.top = ((1.0 - _fade_alpha) * header_h) + "px";

			var style = _element_hitarea.style;
			style.left = (target_rect.left) + "px";
			style.top  = (target_rect.top)  + "px";
			style.width  = (target_w)  + "px";
			style.height = (target_h) + "px";

			var style = _element_resize.style;
			style.left = (target_rect.right  - 4) + "px";
			style.top  = (target_rect.bottom - 4) + "px";
			style.opacity = _fade_alpha;
		}

		// -
		// プライベート変数
		// -
		var _element_container;
		var _element_header;
		var _element_menu;
		var _element_resize;
		var _element_hitarea;
		var _element_target;
		var _event_dispatcher;
		var _event_handler_release;
		var _observer_remove;
		var _analyze_work_container;
		var _parent_task;
		var _player_task;
		var _resize_task;
		var _fade_alpha;

		// -
		// 初期化
		// -
		(function(){
			_element_target = element;
			element = null;

			_event_dispatcher = new EventDispatcher();
			_fade_alpha = 0.0;

			// リムーブ監視
			_observer_remove = new DomNodeObserverRemoveFromDocument(_element_target);
			_observer_remove.setFunction(_this.release);

			_element_container = DocumentCreateElement("div");
			_element_container.draggable = true;
			ElementSetStyle(_element_container,CSSTextGetInitialDivElement());

			_element_header = DocumentCreateElement("div");
			ElementSetStyle(_element_header,CSSTextGetInitialDivElement());
			ElementAddStyle(_element_header,"position:absolute; z-index:2147483646; overflow:hidden; text-align:right;");

			_element_menu = DocumentCreateElement("div");
			ElementSetStyle(_element_menu,CSSTextGetInitialDivElement());
			ElementAddStyle(_element_menu,"position:relative; background-color:rgba(128,128,128,0.9); display:inline-block; border-radius:10px 10px 0px 0px; border:2px solid #666; border-bottom-width:0px; top:0px;");

				var _element_menu_inner = DocumentCreateElement("div");
				ElementSetStyle(_element_menu_inner,CSSTextGetInitialDivElement());
				ElementAddStyle(_element_menu_inner,"padding:5px 10px; text-align:right;");
				_element_menu.appendChild(_element_menu_inner);

					var style_button = "margin:0px; padding:0px; font-size:12px; font-weight:bold; text-align:center; width:24px; height:24px; display:inline-block;";
					var style_button_image = "vertical-align:top; margin:0px -6px;";

					var button_close = DocumentCreateElement("button");
					button_close.title = "close";
					ElementSetStyle(button_close,CSSTextGetInitialButtonElement());
					ElementAddStyle(button_close,style_button);
					button_close.onclick = function(){
						close();
					};
					var image_close = DocumentCreateElement("img");
					ElementSetStyle(image_close,CSSTextGetInitialImageElement());
					ElementAddStyle(image_close,style_button_image);
					image_close.src = "data:image/gif;base64,R0lGODlhEAAQAIAAACAgIP///yH5BAUUAAEALAAAAAAQABAAAAIgjI+py50AFQQvnrlw0Hna5jlG6HifZHGIqm7n+Iry3BQAOw==";
					button_close.appendChild(image_close);

					var button_fullscreen = DocumentCreateElement("button");
					button_fullscreen.title = "full screen";
					ElementSetStyle(button_fullscreen,CSSTextGetInitialButtonElement());
					ElementAddStyle(button_fullscreen,style_button);
					button_fullscreen.onclick = function(){
						ElementRequestFullscreen(_element_target);
					};
					var image_fullscreen = DocumentCreateElement("img");
					ElementSetStyle(image_fullscreen,CSSTextGetInitialImageElement());
					ElementAddStyle(image_fullscreen,style_button_image);
					image_fullscreen.src = "data:image/gif;base64,R0lGODlhEAAQAIAAACAgIP///yH5BAUUAAEALAAAAAAQABAAAAIshI9pwe2+EDwhrkftZTLWm33Q2GzPaZ4Tya3A98KVKJXZS2EWHHO3qlIIEQUAOw==";
					button_fullscreen.appendChild(image_fullscreen);

					var button_popup = DocumentCreateElement("button");
					button_popup.title = "popup window";
					ElementSetStyle(button_popup,CSSTextGetInitialButtonElement());
					ElementAddStyle(button_popup,style_button);
					button_popup.onclick = function(e){
						if(!e) e = window.event;

						var ofs_x = e.screenX - e.clientX;
						var ofs_y = e.screenY - e.clientY;

						var target_rect = ElementGetBoundingClientRect(_element_target);
						var target_w = target_rect.right - target_rect.left;
						var target_h = target_rect.bottom - target_rect.top;
						var options = "left=" + (target_rect.left + ofs_x) + ",top=" + (target_rect.top + ofs_y) + ",width=" + target_w + ",height=" + target_h;
						var window_obj = window;
						var document_obj;

						try{
							if((window_obj.wrappedJSObject) && typeof(window_obj.wrappedJSObject) === "object"){
								if(window_obj.wrappedJSObject.open){
									window_obj = window_obj.wrappedJSObject;
								}
							}

							window_obj = window_obj.open("","_blank",options);
							document_obj = window_obj.document;
							document_obj.body.style.cssText = "margin:0px; padding:0px; line-height:0; overflow:hidden; width:100%; height:100%;";
							document_obj.title = "PageExpand Media Player";
						}catch(e){
						}

						close();

						ElementSetStyle(_element_target,CSSTextGetInitialDivElement());
						ElementAddStyle(_element_target,"width:100%; height:100%;");

						// 解析ワーク作成
						var analyze_work_target = AnalyzeWorkCreate(_element_target);
						AnalyzeWorkSetInvalid(analyze_work_target);
						var attach_options = new AnalyzeWorkDictionaryAttachOptions();
						attach_options.SetOutsider();
						attach_options.SetGuest();
						analyze_work_dictionary.attachAnalyzeWork(analyze_work_target,attach_options);

						if(document_obj.adoptNode){
							document_obj.adoptNode(_element_target);
						}
						document_obj.body.appendChild(_element_target);
					};
					var image_popup = DocumentCreateElement("img");
					ElementSetStyle(image_popup,CSSTextGetInitialImageElement());
					ElementAddStyle(image_popup,style_button_image);
					image_popup.src = "data:image/gif;base64,R0lGODlhEAAQAIAAACAgIP///yH5BAUUAAEALAAAAAAQABAAAAInjI9pwO2+lALrWRYlooHr7H1cqI1fh6aSqSbUm7kpu6FwW1bXc0oFADs=";
					button_popup.appendChild(image_popup);

					_element_menu_inner.appendChild(button_popup);
					_element_menu_inner.appendChild(button_fullscreen);
					_element_menu_inner.appendChild(button_close);

			_element_hitarea = DocumentCreateElement("div");
			ElementSetStyle(_element_hitarea,CSSTextGetInitialDivElement());
			ElementAddStyle(_element_hitarea,"position:absolute; z-index:2147483646; background:rgba(255,0,0,0.25);");

			_element_resize = DocumentCreateElement("div");
			ElementSetStyle(_element_resize,CSSTextGetInitialDivElement());
			ElementAddStyle(_element_resize,"position:absolute; z-index:2147483646; cursor:se-resize; width:16px; height:16px; background:url(data:image/gif;base64,R0lGODlhEAAQAJEAACAgIP///////wAAACH5BAUUAAIALAAAAAAQABAAAAIwjI9pwO2+lAJxUYFxoNuykFXUc3XcSG6jSH4nqKav1nZdKEd0fsePzZEcTq2UUFgAADs=);");

			_element_container.appendChild(_element_header);
			_element_header.appendChild(_element_menu);
			_element_container.appendChild(_element_resize);

			// 解析ワーク作成
			_analyze_work_container = AnalyzeWorkCreate(_element_container);

			// 解析済み
			AnalyzeWorkSetInvalid(_analyze_work_container);

			// 解析辞書登録オプション
			var attach_options = new AnalyzeWorkDictionaryAttachOptions();
			attach_options.SetOutsider();
			analyze_work_dictionary.attachAnalyzeWork(_analyze_work_container,attach_options);

			// 親タスク
			_parent_task = task_container.createTask();
			_parent_task.setDestructorFunc(function(){
				_parent_task = null;
			});

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

			addEvent();
		})();
	}

	// -
	// ダウンロード進捗
	// -
	function DownloadProgress(parent){
		var _this = this;

		// -
		// テキスト(内部用)
		// -
		function UI_Text(parent){
			var _this = this;

			// -
			// 値をセット
			// -
			_this.setMessage = function(value){
				if(!value) value = " ";
				_text_node.nodeValue = value;
			};

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

			// -
			// 初期化
			// -
			(function(){
				_div = DocumentCreateElement("div");
				ElementSetStyle(_div,"width:100%; font-size:12px; text-align:left; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; margin-bottom:5px;");

				_text_node = DocumentCreateText(" ");
				_div.appendChild(_text_node);

				parent.appendChild(_div);
			})();
		}

		// -
		// ブログレスバー(内部用)
		// -
		function UI_ProgressBar(parent){
			var _this = this;

			// -
			// 開放
			// -
			_this.release = function(){
				if(_progress){
					DomNodeRemove(_progress);
				}else{
					DomNodeRemove(_mater);
				}
			};

			// -
			// 値をセット
			// -
			_this.setValue = function(value){
				update(value);
			};

			// -
			// 更新(内部用)
			// -
			function update(v){
				if(_progress){
					_progress.value = v;
				}else{
					_bar.style.width = (v * 100) + "%";
				}
			}

			// -
			// プライベート変数
			// -
			var _progress;
			var _mater;
			var _bar;

			// -
			// 初期化
			// -
			(function(){
				if(window.HTMLProgressElement){
					_progress = DocumentCreateElement("progress");
					ElementSetStyle(_progress,"display:block; width:100%;");
					parent.appendChild(_progress);
				}else{
					_mater = DocumentCreateElement("div");
					ElementSetStyle(_mater,"height:16px; min-height:0; border:1px #888 solid; margin-bottom:5px; line-height:1.0;");
					parent.appendChild(_mater);

					_bar = DocumentCreateElement("div");
					ElementSetStyle(_bar,"height:16px; min-height:0; background-color :#888; margin:0px; width:0%; line-height:1.0;");
					_mater.appendChild(_bar);
				}
			})();
		}

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

			// イベントを破棄
			removeEvent();

			DomNodeRemove(_window);
			DomNodeRemove(_background);
			DomNodeRemove(_shadow_host);
		};

		// -
		// 幅を変更
		// -
		_this.setWidth = function(v){
			_window.style.width = v + "px";
		};

		// -
		// メッセージを設定
		// -
		_this.setMessage = function(str,id){
			var ui_text;
			switch(id){
			case 0:
				ui_text = _text_upper;
				break;
			default:
				ui_text = _text_lower;
				break;
			}
			ui_text.setMessage(str);
		};

		// -
		// プログレス値を設定
		// -
		_this.setValueProgress = function(v,id){
			var ui_progress;
			switch(id){
			case 0:
				ui_progress = _progress_upper;
				break;
			default:
				ui_progress = _progress_lower;
				break;
			}
			ui_progress.setValue(v);
		};

		// -
		// アンカーを設定
		// -
		_this.setAnchor = function(options){
			_progress_lower.release();
			_button_cancel.value = "OK";

			var anchor = DocumentCreateElement("a");
			ElementSetTextContent(anchor,options.download);
			anchor.href = options.href;
			anchor.download = options.download;
			ElementSetStyle(anchor,"width:100%; font-size:14px; text-align:left; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; margin-bottom:5px;");
			_container_lower.appendChild(anchor);
		};

		// -
		// 開く
		// -
		_this.open = function(callback){

			parent.appendChild(_window);

			// イベントを登録
			addEvent();

			// リサイズ
			resize();

			if(_task){
				_task.release();
			}

			var alpha = 0.0;
			_task = task_container.createTask(null);
			_task.setDestructorFunc(function(){
				_task = null;
			});
			_task.setExecuteFunc(function(){
				var complete = false;
				alpha += 0.2;
				if(alpha > 1.0){
					alpha = 1.0;
					complete = true;
				}
				_background.style.opacity = alpha * 0.5;

				if(complete){
					_task.release();
					_this.setEnable(true);
					callback();
				}
			});
			_task.execute(0xffffffff);
		};

		// -
		// 有効状態をセット
		// -
		_this.setEnable = function(type){
			_button_cancel.disabled = !(type);
		};

		// -
		// 閉じる
		// -
		_this.close = function(){
			DomNodeRemove(_window);

			// イベントを破棄
			removeEvent();

			_this.setEnable(false);

			if(_task){
				_task.release();
			}

			var alpha = 1.0;
			_task = task_container.createTask(null);
			_task.setDestructorFunc(function(){
				_task = null;
			});
			_task.setExecuteFunc(function(){
				var complete = false;
				alpha -= 0.2;
				if(alpha < 0.0){
					alpha = 0.0;
					complete = true;
				}
				_background.style.opacity = alpha * 0.5;

				if(complete){
					_this.oncomplete();
					_task.release();
					_this.release();
					return;
				}
			});
			_task.execute(0xffffffff);
		};

		// -
		// エレメント取得
		// -
		_this.getElement = function(){
			return _window;
		};

		// -
		// 完了イベント
		// -
		_this.oncomplete = function(){};

		// -
		// 中断イベント
		// -
		_this.onclose = function(){};

		// -
		// リサイズ(内部用 )
		// -
		function resize(){
			var scroll_pos = WindowGetScrollPosition(window);
			var client_size = DocumentGetClientSize(document);
			var dialog_rect = ElementGetBoundingClientRect(_window);

			var w = dialog_rect.right - dialog_rect.left;
			var h = dialog_rect.bottom - dialog_rect.top;

			_window.style.left = (client_size.width  / 2 - w / 2 + scroll_pos.x) + "px";
			if(client_size.height > h){
				_window.style.top  = (client_size.height / 2 - h / 2 + scroll_pos.y) + "px";
				_fitted_top = false;
			}else{
				if(!_fitted_top){
					_window.style.top  = (scroll_pos.y) + "px";
					_fitted_top = true;
				}
			}
		}

		// -
		// イベント登録(内部用 )
		// -
		function addEvent(){
			// イベントリスナーに対応している
			if(window.addEventListener){

				window.addEventListener("scroll" ,resize);
				window.addEventListener("resize" ,resize);

			// アタッチイベントに対応している
			}else if(window.attachEvent){

				window.attachEvent("onscroll" ,resize);
				window.attachEvent("onresize" ,resize);

			}

		}

		// -
		// イベント破棄(内部用 )
		// -
		function removeEvent(){
			if(_event_handler_release){
				_event_handler_release.release();
				_event_handler_release = null;
			}

			// イベントリスナーに対応している
			if(window.removeEventListener){

				window.removeEventListener("scroll" ,resize);
				window.removeEventListener("resize" ,resize);

			// アタッチイベントに対応している
			}else if(window.detachEvent){

				window.detachEvent("onscroll" ,resize);
				window.detachEvent("onresize" ,resize);

			}
		}

		// -
		// プライベート変数
		// -
		var _shadow_host;
		var _background;
		var _window;
		var _container_upper;
		var _container_lower;
		var _text_upper;
		var _text_lower;
		var _progress_upper;
		var _progress_lower;
		var _button_cancel;
		var _event_handler_release;
		var _task;
		var _fitted_top;

		// -
		// 初期化
		// -
		(function(){
			_shadow_host = DocumentCreateElement("div");
			parent.appendChild(_shadow_host);
			if(_shadow_host.attachShadow){
				parent = _shadow_host.attachShadow({mode:"closed"});
			}else{
				parent = _shadow_host;
			}

			var css_text_progress = "display:block; width:100%;";

			_background = DocumentCreateElement("div");
			ElementSetStyle(_background,"position:fixed; top:0px; bottom:0px; left:0px; right:0px; opacity:0.0; background:#000; line-height:1.0; z-index:2147483646;");
			parent.appendChild(_background);

			_window = DocumentCreateElement("div");
			ElementSetStyle(_window,"position:absolute; width:800px; padding:25px; background:#00F; background-color:#FFF; border-radius:5px; box-shadow:5px 5px 10px #444; z-index:2147483646;");

			_container_upper = DocumentCreateElement("div");
			ElementSetStyle(_container_upper,"min-height:50px;");
			_window.appendChild(_container_upper);

			_text_upper = new UI_Text(_container_upper);
			_progress_upper = new UI_ProgressBar(_container_upper);

			_container_lower = DocumentCreateElement("div");
			ElementSetStyle(_container_lower,"min-height:60px;");
			_window.appendChild(_container_lower);

			_text_lower = new UI_Text(_container_lower);
			_progress_lower = new UI_ProgressBar(_container_lower);

			_button_cancel = DocumentCreateElement("input");
			_button_cancel.type = "button";
			_button_cancel.value = "CANCEL";
			ElementSetStyle(_button_cancel,"width:100%; height:50px;");
			_window.appendChild(_button_cancel);
			_button_cancel.onclick = function(){
				if(_this.onclose){
					_this.onclose();
				}
				_this.close();
			};

			_this.setMessage("",0);
			_this.setMessage("",1);
			_this.setValueProgress(0.0,0);
			_this.setValueProgress(0.0,1);
			_this.setEnable(false);

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

	// -
	// インターナショナルメッセージ
	// -
	function InternationalMessage(language){
		var _this = this;

		// -
		// アドレスを登録
		// -
		_this.getMessage = function(asset){
			if(_dictionary[asset]){
				return _dictionary[asset].message;
			}
			return "XXXXX NO LOCALE MESSAGE XXXXX";
		};

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

		// -
		// 初期化
		// -
		if(!(language)) language = "";
		language = language.toLowerCase();
		if(!(_dictionary)){
			_dictionary = InternationalMessage.locales[language];
		}
		if(!(_dictionary)){
			var m = language.match(new RegExp("[^-]+"),"");
			if(m) _dictionary = InternationalMessage.locales[m[0]];
		}
		if(!(_dictionary)){
			_dictionary = InternationalMessage.locales["en"];
		}
	}


	// -
	// ロケールデータ
	// -
	InternationalMessage.locales = {
		ja: {
			extension_name: {
				message: "PageExpand"
			},
			extension_description: {
				message: "画像の一括ダウンロード、画像のポップアップ、サムネイルやビデオの展開、短縮URLの展開、URL文字列のリンク化、リファラ置換、主要掲示板の拡張表示など..."
			},
			page_expand_config: {
				message: "PageExpand 設定"
			},
			menu_setting_standard: {
				message: "基本設定"
			},
			menu_setting_standard_filter_url: {
				message: "動作を制限するURL"
			},
			menu_setting_standard_filter_url_combo_box_item_deny: {
				message: "指定したアドレスのみ動作させない(それ以外はすべて動作する)"
			},
			menu_setting_standard_filter_url_combo_box_item_allow: {
				message: "指定したアドレスのみ動作させる(それ以外はすべて動作しない)"
			},
			menu_setting_standard_filter_url_hint: {
				message: "URL を記述します。アスタリスク使用可。複数行指定可。"
			},
			menu_setting_standard_check_box_container: {
				message: "基本設定"
			},
			menu_setting_standard_enable_icon_address_bar: {
				message: "アドレスバーにアイコンを表示"
			},
			menu_setting_standard_enable_context_menu: {
				message: "コンテキストメニューを表示"
			},
			menu_setting_standard_enable_startup: {
				message: "ロード完了時から動作を開始"
			},
			menu_setting_standard_enable_debug_mode: {
				message: "デバッグモードで動作"
			},
			menu_setting_standard_enable_output_log: {
				message: "コンソールにログを出力(デバッグ用)"
			},
			menu_setting_standard_execute_queue: {
				message: "実行キュー設定(通常は変更の必要はありません)"
			},
			menu_setting_standard_execute_queue_time_sleep: {
				message: "スリープ時間(ミリ秒)"
			},
			menu_setting_standard_execute_queue_time_occupancy: {
				message: "最大CPU占有時間(ミリ秒)"
			},
			menu_setting_standard_execute_queue_hint: {
				message: "最大CPU占有時間が大きいほど、操作レスポンスが悪くなり、スクリプトが高速に動作します。スリープ時間が小さいほど、CPU使用率が高くなり、スクリプトが高速に動作します。"
			},
			menu_setting_standard_touch: {
				message: "タッチ操作設定"
			},
			menu_setting_standard_enable_input_touch: {
				message: "タッチ操作を有効"
			},
			menu_setting_standard_enable_double_touch_assist: {
				message: "ダブルタッチ補助線を表示"
			},
			menu_setting_standard_command: {
				message: "メニューの実行(モバイル用)"
			},
			menu_setting_standard_command_execute_button: {
				message: "実行する"
			},
			menu_setting_standard_command_execute_dialog: {
				message: "メニューの実行"
			},
			menu_setting_standard_command_execute_dialog_tab_list: {
				message: "実行対象となるタブを選択"
			},
			menu_setting_standard_command_execute_dialog_command_list: {
				message: "実行するコマンドを選択"
			},
			menu_setting_standard_command_execute_dialog_confirm: {
				message: "選択したメニューを実行しますか?"
			},
			menu_setting_standard_export_import: {
				message: "設定のエクスポート / インポート"
			},
			menu_setting_standard_export_button: {
				message: "エクスポート"
			},
			menu_setting_standard_import_button: {
				message: "インポート"
			},
			menu_setting_standard_export_dialog: {
				message: "設定のエクスポート"
			},
			menu_setting_standard_export_dialog_export: {
				message: "エクスポート"
			},
			menu_setting_standard_export_dialog_export_hint: {
				message: "テキストエリアの値をコピーして下さい。"
			},
			menu_setting_standard_import_dialog: {
				message: "設定のインポート"
			},
			menu_setting_standard_import_dialog_explanation: {
				message: "インポートについて"
			},
			menu_setting_standard_import_dialog_explanation_0: {
				message: "インポートを行うと、現在の設定は全て失われます。"
			},
			menu_setting_standard_import_dialog_explanation_1: {
				message: "インポートを行う前に、エクスポート機能でバックアップを取ることをお勧めします。"
			},
			menu_setting_standard_import_dialog_explanation_2: {
				message: "信頼の無い人物が作成した設定データを、絶対にインポートしないで下さい。悪意のあるスクリプトが含まれる恐れがあります。"
			},
			menu_setting_standard_import_dialog_import: {
				message: "インポート"
			},
			menu_setting_standard_import_dialog_import_hint: {
				message: "エクスポートから出力したテキストをペーストして下さい。"
			},
			menu_setting_standard_import_dialog_confirm: {
				message: "インポートを実行しますか?"
			},
			menu_setting_standard_import_alert: {
				message: "インポートの結果"
			},
			menu_setting_standard_import_alert_success: {
				message: "インポートが完了しました。"
			},
			menu_setting_standard_import_alert_failure: {
				message: "インポートに失敗しました。"
			},
			menu_setting_standard_storage_sync: {
				message: "同期ストレージ"
			},
			menu_setting_standard_storage_sync_load_button: {
				message: "読込"
			},
			menu_setting_standard_storage_sync_save_button: {
				message: "保存"
			},
			menu_setting_standard_storage_sync_delete_button: {
				message: "削除"
			},
			menu_setting_standard_storage_sync_load_dialog: {
				message: "同期ストレージの読み込み"
			},
			menu_setting_standard_storage_sync_load_dialog_explanation: {
				message: "同期ストレージの読み込みについて"
			},
			menu_setting_standard_storage_sync_load_dialog_explanation_0: {
				message: "同期ストレージからデータを読み込んで設定に反映します。"
			},
			menu_setting_standard_storage_sync_load_dialog_explanation_1: {
				message: "読み込みを行うと、現在の設定は全て失われます。"
			},
			menu_setting_standard_storage_sync_load_dialog_explanation_2: {
				message: "読み込みを行う前に、エクスポート機能でバックアップを取ることをお勧めします。"
			},
			menu_setting_standard_storage_sync_load_dialog_confirm: {
				message: "同期ストレージから設定データを読み込みますか?"
			},
			menu_setting_standard_storage_sync_load_alert: {
				message: "読み込みの結果"
			},
			menu_setting_standard_storage_sync_load_alert_success: {
				message: "読み込みが完了しました。"
			},
			menu_setting_standard_storage_sync_load_alert_failure: {
				message: "読み込みに失敗しました。"
			},
			menu_setting_standard_storage_sync_save_dialog: {
				message: "同期ストレージの保存"
			},
			menu_setting_standard_storage_sync_save_dialog_explanation: {
				message: "同期ストレージの保存について"
			},
			menu_setting_standard_storage_sync_save_dialog_explanation_0: {
				message: "現在の設定を、同期ストレージに保存します。"
			},
			menu_setting_standard_storage_sync_save_dialog_explanation_1: {
				message: "ブラウザの同期機能が有効である必要があります。"
			},
			menu_setting_standard_storage_sync_save_dialog_explanation_2: {
				message: "容量に制限があります。サイズが大きすぎる場合失敗します。"
			},
			menu_setting_standard_storage_sync_save_dialog_confirm: {
				message: "同期ストレージに設定データを保存しますか?"
			},
			menu_setting_standard_storage_sync_save_alert: {
				message: "保存の結果"
			},
			menu_setting_standard_storage_sync_save_alert_success: {
				message: "保存が完了しました。"
			},
			menu_setting_standard_storage_sync_save_alert_failure: {
				message: "保存に失敗しました。"
			},
			menu_setting_standard_storage_sync_delete_dialog: {
				message: "同期ストレージの削除"
			},
			menu_setting_standard_storage_sync_delete_dialog_explanation: {
				message: "同期ストレージの削除について"
			},
			menu_setting_standard_storage_sync_delete_dialog_explanation_0: {
				message: "同期ストレージに保存した設定データをすべて削除します。"
			},
			menu_setting_standard_storage_sync_delete_dialog_confirm: {
				message: "同期ストレージの設定データを削除しますか?"
			},
			menu_setting_standard_storage_sync_delete_alert: {
				message: "削除の結果"
			},
			menu_setting_standard_storage_sync_delete_alert_success: {
				message: "削除が完了しました。"
			},
			menu_setting_standard_storage_sync_delete_alert_failure: {
				message: "削除に失敗しました。"
			},
			menu_setting_standard_reset: {
				message: "設定の初期化"
			},
			menu_setting_standard_reset_button: {
				message: "すべての設定を削除して初期状態に戻す"
			},
			menu_setting_standard_reset_dialog: {
				message: "設定の初期化"
			},
			menu_setting_standard_reset_dialog_explanation: {
				message: "設定の初期化について"
			},
			menu_setting_standard_reset_dialog_explanation_0: {
				message: "すべての設定をデフォルトの状態に戻します。"
			},
			menu_setting_standard_reset_dialog_explanation_1: {
				message: "設定の初期化を行うと現在の設定は全て失われます。"
			},
			menu_setting_standard_reset_dialog_confirm: {
				message: "設定の初期化を実行しますか?"
			},
			menu_setting_standard_reset_alert: {
				message: "設定の初期化の結果"
			},
			menu_setting_standard_reset_alert_success: {
				message: "設定の初期化が完了しました。"
			},
			menu_setting_standard_reset_alert_failure: {
				message: "設定の初期化に失敗しました。"
			},

			menu_setting_download: {
				message: "ダウンロード設定"
			},
			menu_setting_download_load: {
				message: "ロード設定(XHR通信)"
			},
			menu_setting_download_load_thread_max: {
				message: "最大同時ロード数"
			},
			menu_setting_download_load_timeout: {
				message: "タイムアウト(ミリ秒)"
			},
			menu_setting_download_load_timeout_hint: {
				message: "タイムアウトエラーと判定する時間をミリ秒で指定。0 で無制限。"
			},
			menu_setting_download_load_cache_for_media: {
				message: "キャッシュモード(メディア用)"
			},
			menu_setting_download_load_cache_for_media_hint: {
				message: "通常は変更の必要はありません。fetch API を経由し、かつメディア系の読み込み時に作用します。"
			},
			menu_setting_expand_image_load_cache_for_media_combo_box_item_default: {
				message: "デフォルトの最適な動作"
			},
			menu_setting_expand_image_load_cache_for_media_combo_box_item_no_store: {
				message: "キャッシュを使用せず、必ずリクエストする"
			},
			menu_setting_expand_image_load_cache_for_media_combo_box_item_force_cache: {
				message: "キャッシュが残ってる限り、二度とリクエストしない(一生古いデータのまま)"
			},
			menu_setting_download_download: {
				message: "ダウンロード設定"
			},
			menu_setting_download_download_thread_max: {
				message: "最大同時ダウンロード数"
			},
			menu_setting_download_download_save_file: {
				message: "保存先の設定"
			},
			menu_setting_download_download_save_file_combo_box_item_simple: {
				message: "簡易設定"
			},
			menu_setting_download_download_save_file_combo_box_item_detail: {
				message: "詳細設定"
			},
			menu_setting_download_download_save_file_simple: {
				message: "保存先を選択"
			},
			menu_setting_download_download_save_file_detail: {
				message: "保存先を編集"
			},
			menu_setting_download_download_save_file_variable: {
				message: "変数一覧"
			},
			menu_setting_download_download_conflict_type: {
				message: "ファイル名衝突時の処理"
			},
			menu_setting_download_download_conflict_type_combo_box_item_rename: {
				message: "別名にリネーム"
			},
			menu_setting_download_download_conflict_type_combo_box_item_overwrite: {
				message: "同名で上書き"
			},
			menu_setting_download_batch_download: {
				message: "一括ダウンロード設定"
			},

			menu_setting_expand_bbs: {
				message: "掲示板拡張設定"
			},
			menu_setting_expand_bbs_list: {
				message: "掲示板拡張設定一覧"
			},
			menu_setting_expand_bbs_list_hint: {
				message: "リストを選択すると下部のコントロールの入力が可能です。上から順番に動作条件スクリプトを実行し、許可があればその設定が使用されます。複数選択可。複数選択時は同時編集。灰色はプリセット設定。プリセット設定は削除不可(無効化は可能)。"
			},
			menu_setting_expand_bbs_button_add: {
				message: "追加"
			},
			menu_setting_expand_bbs_button_delete: {
				message: "削除"
			},
			menu_setting_expand_bbs_button_prio_up: {
				message: "優先度を上げる"
			},
			menu_setting_expand_bbs_button_prio_down: {
				message: "優先度を下げる"
			},
			menu_setting_expand_bbs_button_export: {
				message: "エクスポート"
			},
			menu_setting_expand_bbs_button_import: {
				message: "インポート"
			},
			menu_setting_expand_bbs_add_dialog: {
				message: "掲示板拡張設定の新規作成"
			},
			menu_setting_expand_bbs_add_dialog_name: {
				message: "名前"
			},
			menu_setting_expand_bbs_add_dialog_copy_define: {
				message: "既存の設定から複製"
			},
			menu_setting_expand_bbs_add_dialog_define_list_box_item_new: {
				message: "複製せずに新規作成する"
			},
			menu_setting_expand_bbs_export_dialog: {
				message: "掲示板拡張設定のエクスポート"
			},
			menu_setting_expand_bbs_export_dialog_export: {
				message: "エクスポート"
			},
			menu_setting_expand_bbs_export_dialog_export_hint: {
				message: "テキストエリアの値をコピーして下さい。"
			},
			menu_setting_expand_bbs_import_dialog: {
				message: "掲示板拡張設定のインポート"
			},
			menu_setting_expand_bbs_import_dialog_explanation: {
				message: "インポートについて"
			},
			menu_setting_expand_bbs_import_dialog_explanation_0: {
				message: "プリセット設定は上書き、ユーザー設定は新規追加されます。"
			},
			menu_setting_expand_bbs_import_dialog_explanation_1: {
				message: "インポートを行う前に、基本設定のエクスポート機能でバックアップを取ることをお勧めします。"
			},
			menu_setting_expand_bbs_import_dialog_explanation_2: {
				message: "信頼の無い人物が作成した設定データを、絶対にインポートしないで下さい。悪意のあるスクリプトが含まれる恐れがあります。"
			},
			menu_setting_expand_bbs_import_dialog_import: {
				message: "インポート"
			},
			menu_setting_expand_bbs_import_dialog_import_hint: {
				message: "エクスポートから出力したテキストをペーストして下さい。"
			},
			menu_setting_expand_bbs_import_dialog_confirm: {
				message: "インポートを実行しますか?"
			},
			menu_setting_expand_bbs_import_alert: {
				message: "インポートの結果"
			},
			menu_setting_expand_bbs_import_alert_success: {
				message: "インポートが完了しました。"
			},
			menu_setting_expand_bbs_import_alert_failure: {
				message: "インポートに失敗しました。"
			},
			menu_setting_expand_bbs_name: {
				message: "名前"
			},
			menu_setting_expand_bbs_check_box_container: {
				message: "有効 / 無効"
			},
			menu_setting_expand_bbs_enable_setting: {
				message: "この設定を使用する"
			},
			menu_setting_expand_bbs_filter_url: {
				message: "動作URLの設定"
			},
			menu_setting_expand_bbs_popup_check_box_container: {
				message: "ポップアップの設定"
			},
			menu_setting_expand_bbs_popup_enable_animation: {
				message: "ポップアップ時のアニメーション動作を有効"
			},
			menu_setting_expand_bbs_popup_origin_type: {
				message: "ポップアップの配置基点"
			},
			menu_setting_expand_bbs_popup_origin_type_combo_box_item_adsorb_top_bottom: {
				message: "上下に吸着"
			},
			menu_setting_expand_bbs_popup_origin_type_combo_box_item_adsorb_left_right: {
				message: "左右に吸着"
			},
			menu_setting_expand_bbs_popup_position_type: {
				message: "ポップアップの配置位置"
			},
			menu_setting_expand_bbs_popup_position_type_combo_box_item_absolute: {
				message: "絶対座標系に配置"
			},
			menu_setting_expand_bbs_popup_position_type_combo_box_item_fixed: {
				message: "クライアント座標系に配置"
			},
			menu_setting_expand_bbs_popup_percent: {
				message: "ポップアップサイズ"
			},
			menu_setting_expand_bbs_popup_percent_h: {
				message: "横方向パーセント (0~100)"
			},
			menu_setting_expand_bbs_popup_percent_v: {
				message: "縦方向パーセント (0~100)"
			},
			menu_setting_expand_bbs_popup_time: {
				message: "ポップアップ時間"
			},
			menu_setting_expand_bbs_popup_time_wait_open: {
				message: "開くまでに待機する時間(ミリ秒)"
			},
			menu_setting_expand_bbs_popup_time_wait_close: {
				message: "閉じるまでに待機する時間(ミリ秒)"
			},
			menu_setting_expand_bbs_popup_style_sheet: {
				message: "ポップアップのスタイル"
			},
			menu_setting_expand_bbs_script_initialize: {
				message: "初期化スクリプト"
			},
			menu_setting_expand_bbs_script_callback: {
				message: "コールバックスクリプト"
			},
			menu_setting_urlmap: {
				message: "URLマッピング設定"
			},
			menu_setting_urlmap_list: {
				message: "URLマッピング設定一覧"
			},
			menu_setting_urlmap_list_hint: {
				message: "リストを選択すると下部のコントロールの入力が可能です。上から順番にURLの比較を行いマッチすればその設定が使用されます。複数選択可。複数選択時は同時編集。灰色はプリセット設定。プリセット設定は削除不可(無効化は可能)。"
			},
			menu_setting_urlmap_button_add: {
				message: "追加"
			},
			menu_setting_urlmap_button_delete: {
				message: "削除"
			},
			menu_setting_urlmap_button_prio_up: {
				message: "優先度を上げる"
			},
			menu_setting_urlmap_button_prio_down: {
				message: "優先度を下げる"
			},
			menu_setting_urlmap_add_dialog: {
				message: "URLマッピング設定の新規作成"
			},
			menu_setting_urlmap_add_dialog_name: {
				message: "名前"
			},
			menu_setting_urlmap_add_dialog_copy_define: {
				message: "既存の設定から複製"
			},
			menu_setting_urlmap_add_dialog_define_list_box_item_new: {
				message: "複製せずに新規作成する"
			},
			menu_setting_urlmap_name: {
				message: "名前"
			},
			menu_setting_urlmap_check_box_container: {
				message: "有効 / 無効"
			},
			menu_setting_urlmap_enable_setting: {
				message: "この設定を使用する"
			},
			menu_setting_urlmap_filter_url: {
				message: "動作URLの設定"
			},
			menu_setting_urlmap_mixed_passive_content_container: {
				message: "Mixed Passive Content のセキュリティ"
			},
			menu_setting_urlmap_mixed_passive_content_unsafe: {
				message: "http:// のままリクエスト"
			},
			menu_setting_urlmap_mixed_passive_content_safe: {
				message: "https:// に変換してリクエスト(失敗なら表示しない)"
			},
			menu_setting_urlmap_mixed_passive_content_hint: {
				message: "画像や動画などのコンテンツが赤枠付きで表示されている場合、暗号化されておらず、信頼性が低く、中間者攻撃で改ざん可能であることを意味します。"
			},
			menu_setting_urlmap_mixed_active_content_container: {
				message: "Mixed Active Content のセキュリティ"
			},
			menu_setting_urlmap_mixed_active_content_unsafe: {
				message: "http:// のままリクエスト"
			},
			menu_setting_urlmap_mixed_active_content_safe: {
				message: "https:// に変換してリクエスト(失敗なら表示しない)"
			},
			menu_setting_urlmap_mixed_active_content_hint: {
				message: "ブラウザはデフォルトで混在アクティブコンテンツをブロックします。実際に表示するには、サイトの権限の設定から「安全ではないコンテンツ」のブロックを解除する必要があります(危険)"
			},
			menu_setting_urlmap_define_button_edit: {
				message: "編集"
			},
			menu_setting_urlmap_define_button_add: {
				message: "追加"
			},
			menu_setting_urlmap_define_button_remove: {
				message: "除外"
			},
			menu_setting_urlmap_define_button_prio_up: {
				message: "上へ"
			},
			menu_setting_urlmap_define_button_prio_down: {
				message: "下へ"
			},
			menu_setting_urlmap_define_combo_box_item_no_use: {
				message: "定義を使用しない"
			},
			menu_setting_define_multi_select_add_dialog: {
				message: "定義の追加"
			},
			menu_setting_define_multi_select_add_dialog_list: {
				message: "追加する定義を選択"
			},
			menu_setting_access_block: {
				message: "アクセス遮断定義"
			},
			menu_setting_access_block_filter_url: {
				message: "アクセス遮断URLを設定"
			},
			menu_setting_replacement_to_element: {
				message: "エレメント置換定義"
			},
			menu_setting_replacement_to_element_script: {
				message: "コールバックスクリプト"
			},
			menu_setting_replacement_to_text: {
				message: "テキスト置換定義"
			},
			menu_setting_replacement_to_text_script: {
				message: "コールバックスクリプト"
			},
			menu_setting_replacement_to_anchor: {
				message: "アンカー置換定義"
			},
			menu_setting_replacement_to_anchor_script: {
				message: "コールバックスクリプト"
			},
			menu_setting_replacement_to_link: {
				message: "ハイパーリンク置換定義"
			},
			menu_setting_replacement_to_link_filter_list: {
				message: "フィルタ一覧"
			},
			menu_setting_replacement_to_link_filter_name: {
				message: "フィルタ名"
			},
			menu_setting_replacement_to_link_filter: {
				message: "フィルタ設定"
			},
			menu_setting_replacement_to_link_filter_filter_url: {
				message: "動作リンク先URLの設定"
			},
			menu_setting_replacement_to_link_check_box_container: {
				message: "ハイパーリンク置換の設定"
			},
			menu_setting_replacement_to_link_enable_reflect_to_anchor: {
				message: "リンクの変更をアンカーに反映する"
			},
			menu_setting_replacement_to_link_enable_cache: {
				message: "コールバックスクリプトの実行結果をキャッシュする"
			},
			menu_setting_replacement_to_link_filter_script: {
				message: "コールバックスクリプト"
			},
			menu_setting_replacement_to_referer: {
				message: "リファラ置換定義"
			},
			menu_setting_replacement_to_referer_filter_list: {
				message: "フィルタ一覧"
			},
			menu_setting_replacement_to_referer_filter_name: {
				message: "フィルタ名"
			},
			menu_setting_replacement_to_referer_filter: {
				message: "フィルタ設定"
			},
			menu_setting_replacement_to_referer_filter_filter_url: {
				message: "動作リンク先URLの設定"
			},
			menu_setting_replacement_to_referer_filter_send_type: {
				message: "基本リファラ"
			},
			menu_setting_replacement_to_referer_filter_send_type_combo_box_item: {
				message: "基本リファラ値"
			},
			menu_setting_replacement_to_referer_filter_send_type_combo_box_item_default: {
				message: "改変しない"
			},
			menu_setting_replacement_to_referer_filter_send_type_combo_box_item_current_url: {
				message: "現在のURL"
			},
			menu_setting_replacement_to_referer_filter_send_type_combo_box_item_link_url: {
				message: "リンク先のURL"
			},
			menu_setting_replacement_to_referer_filter_send_type_combo_box_item_custom: {
				message: "カスタム文字列"
			},
			menu_setting_replacement_to_referer_filter_send_custom: {
				message: "カスタム文字列"
			},
			menu_setting_replacement_to_referer_filter_send_regexp: {
				message: "基本リファラを正規表現で置換"
			},
			menu_setting_replacement_to_referer_filter_send_regexp_match: {
				message: "マッチ条件"
			},
			menu_setting_replacement_to_referer_filter_send_regexp_replacement: {
				message: "置換後の文字列"
			},
			menu_setting_replacement_to_referer_filter_send_regexp_replacement_hint: {
				message: "$0…マッチした全体文字列。$1~$9…マッチした部分文字列。$$…ドルのエスケープシーケンス"
			},
			menu_setting_replacement_to_useragent: {
				message: "ユーザーエージェント置換定義"
			},
			menu_setting_replacement_to_useragent_filter_list: {
				message: "フィルタ一覧"
			},
			menu_setting_replacement_to_useragent_filter_name: {
				message: "フィルタ名"
			},
			menu_setting_replacement_to_useragent_filter: {
				message: "フィルタ設定"
			},
			menu_setting_replacement_to_useragent_filter_filter_url: {
				message: "動作リンク先URLの設定"
			},
			menu_setting_replacement_to_useragent_filter_send: {
				message: "基本ユーザーエージェント"
			},
			menu_setting_replacement_to_useragent_filter_send_custom: {
				message: "カスタム文字列"
			},
			menu_setting_make_link_to_text: {
				message: "ハイパーリンク化定義"
			},
			menu_setting_make_link_to_text_script: {
				message: "コールバックスクリプト"
			},
			menu_setting_expand_short_url: {
				message: "短縮URL展開定義"
			},
			menu_setting_expand_short_url_filter_url: {
				message: "対象URLを設定"
			},
			menu_setting_expand_text: {
				message: "テキスト展開定義"
			},
			menu_setting_expand_text_inline: {
				message: "インライン表示の設定"
			},
			menu_setting_expand_text_inline_check_box_container: {
				message: "インライン表示の設定"
			},
			menu_setting_expand_text_inline_disable_same_text: {
				message: "同じURLは展開しない"
			},
			menu_setting_expand_text_inline_script_allow: {
				message: "リンクからインライン表示する条件"
			},
			menu_setting_expand_text_inline_script_insert: {
				message: "テキストの挿入位置"
			},
			menu_setting_expand_image: {
				message: "イメージ展開定義"
			},
			menu_setting_expand_image_thumbnail: {
				message: "サムネイル表示設定"
			},
			menu_setting_expand_image_thumbnail_enable_check_box_container: {
				message: "有効 / 無効"
			},
			menu_setting_expand_image_thumbnail_enable_thumbnail: {
				message: "サムネイルを表示する"
			},
			menu_setting_expand_image_thumbnail_check_box_container: {
				message: "サムネイル表示設定"
			},
			menu_setting_expand_image_thumbnail_enable_popup_mouseover: {
				message: "サムネイルにマウスオーバーするとポップアップ表示"
			},
			menu_setting_expand_image_thumbnail_disable_same_thumbnail_image: {
				message: "同じイメージがすでに配置されている場合サムネイルを表示しない"
			},
			menu_setting_expand_image_thumbnail_size: {
				message: "サムネイルの表示サイズ"
			},
			menu_setting_expand_image_thumbnail_size_min: {
				message: "最小許容限界(ピクセル値)"
			},
			menu_setting_expand_image_thumbnail_size_scale: {
				message: "基本拡大率(パーセント)"
			},
			menu_setting_expand_image_thumbnail_size_max: {
				message: "最大許容限界(ピクセル値)"
			},
			menu_setting_expand_image_thumbnail_script_allow: {
				message: "リンクからサムネイル化する条件"
			},
			menu_setting_expand_image_thumbnail_script_insert: {
				message: "サムネイルの挿入位置"
			},
			menu_setting_expand_image_popup: {
				message: "ポップアップ表示設定"
			},
			menu_setting_expand_image_popup_enable_check_box_container: {
				message: "有効 / 無効"
			},
			menu_setting_expand_image_popup_enable_popup_mouseover: {
				message: "アンカーをマウスオーバーするとポップアップ表示"
			},
			menu_setting_expand_image_popup_check_box_container: {
				message: "アニメーション設定"
			},
			menu_setting_expand_image_popup_enable_animation_scale: {
				message: "拡大縮小フェードを有効"
			},
			menu_setting_expand_image_popup_enable_animation_alpha: {
				message: "半透明フェードを有効"
			},
			menu_setting_expand_image_popup_origin_type: {
				message: "ポップアップイメージの配置基点"
			},
			menu_setting_expand_image_popup_origin_type_combo_box_item_center: {
				message: "中心を基点"
			},
			menu_setting_expand_image_popup_origin_type_combo_box_item_upper_left: {
				message: "左上を基点"
			},
			menu_setting_expand_image_popup_origin_type_combo_box_item_upper_right: {
				message: "右上を基点"
			},
			menu_setting_expand_image_popup_origin_type_combo_box_item_client_center: {
				message: "クライアント中央"
			},
			menu_setting_expand_image_popup_origin_type_combo_box_item_adsorb_element: {
				message: "エレメントに吸着"
			},
			menu_setting_expand_image_popup_origin_type_combo_box_item_adsorb_mouse: {
				message: "マウスカーソルに吸着"
			},
			menu_setting_expand_image_popup_time: {
				message: "ポップアップ時間"
			},
			menu_setting_expand_image_popup_time_wait_open: {
				message: "開くまでに待機する時間(ミリ秒)"
			},
			menu_setting_expand_image_popup_time_wait_close: {
				message: "閉じるまでに待機する時間(ミリ秒)"
			},
			menu_setting_expand_image_popup_position_type: {
				message: "ポップアップイメージの配置位置"
			},
			menu_setting_expand_image_popup_position_type_combo_box_item_absolute: {
				message: "絶対座標系に配置"
			},
			menu_setting_expand_image_popup_position_type_combo_box_item_fixed: {
				message: "クライアント座標系に配置"
			},
			menu_setting_expand_image_popup_size: {
				message: "ポップアップイメージの表示サイズ"
			},
			menu_setting_expand_image_popup_size_scale: {
				message: "拡大率(パーセント)"
			},
			menu_setting_expand_image_popup_script_allow: {
				message: "リンクからポップアップ表示する条件"
			},
			menu_setting_expand_image_reduced_image: {
				message: "縮小イメージ設定"
			},
			menu_setting_expand_image_reduced_image_check_box_container: {
				message: "有効 / 無効"
			},
			menu_setting_expand_image_popup_enable_popup: {
				message: "縮小されたイメージをマウスオーバーするとポップアップ表示"
			},
			menu_setting_expand_image_reduced_image_allow_slcale_less_then: {
				message: "縮小イメージのポップアップ条件"
			},
			menu_setting_expand_image_reduced_image_allow_slcale_less_then_text: {
				message: "以下の拡大率の場合"
			},
			menu_setting_expand_image_load: {
				message: "イメージのロード設定"
			},
			menu_setting_expand_image_load_check_box_container: {
				message: "イメージのロード設定"
			},
			menu_setting_expand_image_load_enable_notify: {
				message: "ロード進捗を表示"
			},
			menu_setting_expand_image_load_start_type: {
				message: "イメージのロード設定"
			},
			menu_setting_expand_image_load_start_type_preload: {
				message: "すべて事前に読み込む"
			},
			menu_setting_expand_image_load_start_type_scroll: {
				message: "スクロールと連動して読み込む"
			},
			menu_setting_expand_image_load_src_type: {
				message: "イメージのソースタイプ"
			},
			menu_setting_expand_image_load_src_type_combo_box_item_url: {
				message: "URL 形式 (混在コンテンツを除く)"
			},
			menu_setting_expand_image_load_src_type_combo_box_item_blob_url: {
				message: "Blob URL に変換(すべて)"
			},
			menu_setting_expand_image_load_decode: {
				message: "イメージのデコード設定"
			},
			menu_setting_expand_image_load_decode_combo_box_item_auto: {
				message: "表示される瞬間から開始"
			},
			menu_setting_expand_image_load_decode_combo_box_item_pre_decode: {
				message: "すべて事前にデコードする"
			},
			menu_setting_expand_image_load_unload_check_box_container: {
				message: "イメージのアンロード設定"
			},
			menu_setting_expand_image_load_enable_unload: {
				message: "イメージのアンロードを有効"
			},
			menu_setting_expand_image_load_unload: {
				message: "イメージのアンロード条件"
			},
			menu_setting_expand_image_load_allow_unload_more_then_text: {
				message: "MByte以上ロードした場合、古いイメージを解放する"
			},
			menu_setting_expand_sound: {
				message: "サウンド展開定義"
			},
			menu_setting_expand_sound_inline: {
				message: "インライン表示の設定"
			},
			menu_setting_expand_sound_inline_check_box_container: {
				message: "インライン表示の設定"
			},
			menu_setting_expand_sound_inline_disable_same_text: {
				message: "同じURLは展開しない"
			},
			menu_setting_expand_sound_inline_sound_max: {
				message: "最大同時表示数"
			},
			menu_setting_expand_sound_inline_script_allow: {
				message: "リンクからインライン表示する条件"
			},
			menu_setting_expand_sound_inline_script_insert: {
				message: "オーディオの挿入位置"
			},
			menu_setting_expand_sound_inline_element: {
				message: "HTMLAudioElement の設定"
			},
			menu_setting_expand_sound_inline_element_script_allow: {
				message: "HTMLAudioElement を表示する条件"
			},
			menu_setting_expand_sound_inline_element_src_type: {
				message: "ソースタイプ"
			},
			menu_setting_expand_sound_inline_element_src_type_combo_box_item_url: {
				message: "URL 形式 (ストリーミング再生)"
			},
			menu_setting_expand_sound_inline_element_src_type_combo_box_item_blob_url: {
				message: "Blob URL に変換(すべて読み込む)"
			},
			menu_setting_expand_sound_inline_soundcloud: {
				message: "soundcloud.com の設定"
			},
			menu_setting_expand_sound_inline_soundcloud_check_box_container: {
				message: "soundcloud.com の設定"
			},
			menu_setting_expand_sound_inline_soundcloud_visible_player_html5: {
				message: "HTML5 版のプレイヤーを表示"
			},
			menu_setting_expand_sound_inline_mixcloud: {
				message: "www.mixcloud.com の設定"
			},
			menu_setting_expand_sound_inline_mixcloud_check_box_container: {
				message: "www.mixcloud.com の設定"
			},
			menu_setting_expand_sound_inline_mixcloud_visible_player: {
				message: "プレイヤーを表示"
			},
			menu_setting_expand_video: {
				message: "ビデオ展開定義"
			},
			menu_setting_expand_video_inline: {
				message: "インライン表示の設定"
			},
			menu_setting_expand_video_inline_check_box_container: {
				message: "インライン表示の設定"
			},
			menu_setting_expand_video_inline_disable_same_video: {
				message: "同じURLは展開しない"
			},
			menu_setting_expand_video_inline_video_max: {
				message: "最大同時表示数"
			},
			menu_setting_expand_video_inline_size: {
				message: "ビデオの表示サイズ"
			},
			menu_setting_expand_video_inline_width_max: {
				message: "幅の最大許容限界(ピクセル値)"
			},
			menu_setting_expand_video_inline_height_max: {
				message: "高さの最大許容限界(ピクセル値)"
			},
			menu_setting_expand_video_inline_script_allow: {
				message: "リンクからインライン表示する条件"
			},
			menu_setting_expand_video_inline_script_insert: {
				message: "エレメントの挿入位置"
			},
			menu_setting_expand_video_inline_element: {
				message: "HTMLVideoElement の設定"
			},
			menu_setting_expand_video_inline_element_script_allow: {
				message: "HTMLVideoElement を表示する条件"
			},
			menu_setting_expand_video_inline_element_src_type: {
				message: "ソースタイプ"
			},
			menu_setting_expand_video_inline_element_src_type_combo_box_item_url: {
				message: "URL 形式 (ストリーミング再生)"
			},
			menu_setting_expand_video_inline_element_src_type_combo_box_item_blob_url: {
				message: "Blob URL に変換(すべて読み込む)"
			},
			menu_setting_expand_video_inline_youtube: {
				message: "www.youtube.com の設定"
			},
			menu_setting_expand_video_inline_youtube_check_box_container: {
				message: "www.youtube.com の設定"
			},
			menu_setting_expand_video_inline_youtube_visible_video: {
				message: "ビデオを表示"
			},
			menu_setting_expand_video_inline_nicovideo: {
				message: "www.nicovideo.jp の設定"
			},
			menu_setting_expand_video_inline_nicovideo_check_box_container: {
				message: "www.nicovideo.jp の設定"
			},
			menu_setting_expand_video_inline_nicovideo_visible_video: {
				message: "ビデオを表示"
			},
			menu_setting_expand_video_inline_dailymotion: {
				message: "www.dailymotion.com の設定"
			},
			menu_setting_expand_video_inline_dailymotion_check_box_container: {
				message: "www.dailymotion.com の設定"
			},
			menu_setting_expand_video_inline_dailymotion_visible_video: {
				message: "ビデオを表示"
			},
			menu_setting_expand_video_inline_video: {
				message: "vimeo.com の設定"
			},
			menu_setting_expand_video_inline_video_check_box_container: {
				message: "vimeo.com の設定"
			},
			menu_setting_expand_video_inline_video_visible_video: {
				message: "ビデオを表示"
			},
			menu_setting_expand_iframe: {
				message: "インラインフレーム展開定義"
			},
			menu_setting_expand_iframe_inline: {
				message: "インライン表示の設定"
			},
			menu_setting_expand_iframe_inline_check_box_container: {
				message: "インライン表示の設定"
			},
			menu_setting_expand_iframe_inline_disable_same_iframe: {
				message: "同じURLは展開しない"
			},
			menu_setting_expand_iframe_inline_script_allow: {
				message: "リンクからインライン表示する条件"
			},
			menu_setting_expand_iframe_inline_script_insert: {
				message: "HTMLIFrameElement の挿入位置"
			},
			menu_setting_style_sheet: {
				message: "スタイルシート定義"
			},
			menu_setting_style_sheet_expand_text: {
				message: "テキスト展開のスタイル"
			},
			menu_setting_style_sheet_expand_text_element: {
				message: "HTMLTextAreaElement の設定"
			},
			menu_setting_style_sheet_expand_text_element_inline: {
				message: "テキストのインライン表示"
			},
			menu_setting_style_sheet_expand_text_element_inline_unsafe: {
				message: "テキストのインライン表示(混在コンテンツ)"
			},
			menu_setting_style_sheet_expand_image: {
				message: "イメージ展開のスタイル"
			},
			menu_setting_style_sheet_expand_image_element: {
				message: "HTMImageElement の設定"
			},
			menu_setting_style_sheet_expand_image_element_inline: {
				message: "イメージのサムネイル表示"
			},
			menu_setting_style_sheet_expand_image_element_inline_unsafe: {
				message: "イメージのサムネイル表示(混在コンテンツ)"
			},
			menu_setting_style_sheet_expand_image_element_popup: {
				message: "イメージのポップアップ表示"
			},
			menu_setting_style_sheet_expand_image_element_popup_unsafe: {
				message: "イメージのポップアップ表示(混在コンテンツ)"
			},
			menu_setting_style_sheet_expand_sound: {
				message: "サウンド展開のスタイル"
			},
			menu_setting_style_sheet_expand_sound_element: {
				message: "HTMLAudioElement の設定"
			},
			menu_setting_style_sheet_expand_sound_element_inline_audio: {
				message: "オーディオのインライン表示"
			},
			menu_setting_style_sheet_expand_sound_element_inline_audio_unsafe: {
				message: "オーディオのインライン表示(混在コンテンツ)"
			},
			menu_setting_style_sheet_expand_sound_soundcloud: {
				message: "soundcloud.com の設定"
			},
			menu_setting_style_sheet_expand_sound_soundcloud_inline_player_html5: {
				message: "HTML5 版プレイヤーのインライン表示"
			},
			menu_setting_style_sheet_expand_sound_mixcloud: {
				message: "www.mixcloud.com の設定"
			},
			menu_setting_style_sheet_expand_sound_mixcloud_inline_player: {
				message: "プレイヤーのインライン表示"
			},
			menu_setting_style_sheet_expand_video: {
				message: "ビデオ展開のスタイル"
			},
			menu_setting_style_sheet_expand_video_element: {
				message: "HTMLVideoElement の設定"
			},
			menu_setting_style_sheet_expand_video_element_inline_video: {
				message: "ビデオのインライン表示"
			},
			menu_setting_style_sheet_expand_video_element_inline_video_unsafe: {
				message: "ビデオのインライン表示(混在コンテンツ)"
			},
			menu_setting_style_sheet_expand_video_youtube: {
				message: "www.youtube.com の設定"
			},
			menu_setting_style_sheet_expand_video_youtube_inline_video: {
				message: "ビデオのインライン表示"
			},
			menu_setting_style_sheet_expand_video_nicovideo: {
				message: "www.nicovideo.jp の設定"
			},
			menu_setting_style_sheet_expand_video_nicovideo_inline_video: {
				message: "ビデオのインライン表示"
			},
			menu_setting_style_sheet_expand_video_dailymotion: {
				message: "www.dailymotion.com の設定"
			},
			menu_setting_style_sheet_expand_video_dailymotion_inline_video: {
				message: "ビデオのインライン表示"
			},
			menu_setting_style_sheet_expand_video_vimeo: {
				message: "vimeo.com の設定"
			},
			menu_setting_style_sheet_expand_video_vimeo_inline_video: {
				message: "ビデオのインライン表示"
			},
			menu_setting_style_sheet_expand_iframe: {
				message: "インラインフレーム展開のスタイル"
			},
			menu_setting_style_sheet_expand_iframe_element: {
				message: "HTMLIFrameElement の設定"
			},
			menu_setting_style_sheet_expand_iframe_element_inline: {
				message: "インラインフレームのインライン表示"
			},
			menu_setting_style_sheet_expand_iframe_element_inline_unsafe: {
				message: "インラインフレームのインライン表示(混在コンテンツ)"
			},
			menu_setting_experimental: {
				message: "試験運用機能の定義"
			},
			menu_setting_experimental_revise_scroll: {
				message: "スクロール補正機能"
			},
			menu_setting_experimental_revise_scroll_check_box_container: {
				message: "スクロール補正の設定"
			},
			menu_setting_experimental_revise_scroll_enable: {
				message: "有効"
			},
			menu_setting_experimental_revise_scroll_threshold_vertical: {
				message: "補正対象とする縦方向のしきい値( 0 [画面上端] ~ 100 [画面下端] )"
			},
			menu_setting_language: {
				message: "LANGUAGE (言語設定)"
			},
			menu_credit: {
				message: "クレジット"
			},
			menu_credit_info_version: {
				message: "バージョン情報"
			},
			menu_credit_info_copyright: {
				message: "製作"
			},
			menu_credit_info_translator: {
				message: "翻訳者"
			},
			menu_setting_define_list: {
				message: "定義一覧"
			},
			menu_setting_define_list_hint: {
				message: "リストを選択すると下部のコントロールの入力が可能です。複数選択可。複数選択時は同時編集。灰色はプリセット設定。プリセット設定は削除不可。"
			},
			menu_setting_define_button_add: {
				message: "追加"
			},
			menu_setting_define_button_delete: {
				message: "削除"
			},
			menu_setting_define_button_move_up: {
				message: "上に移動"
			},
			menu_setting_define_button_move_down: {
				message: "下に移動"
			},
			menu_setting_define_button_export: {
				message: "エクスポート"
			},
			menu_setting_define_button_import: {
				message: "インポート"
			},
			menu_setting_define_add_dialog: {
				message: "定義の新規作成"
			},
			menu_setting_define_add_dialog_name: {
				message: "名前"
			},
			menu_setting_define_add_dialog_copy_define: {
				message: "既存の定義から複製"
			},
			menu_setting_define_add_dialog_define_list_box_item_new: {
				message: "複製せずに新規作成する"
			},
			menu_setting_define_delete_dialog: {
				message: "定義の削除"
			},
			menu_setting_define_delete_dialog_name: {
				message: "削除する定義名"
			},
			menu_setting_define_delete_dialog_change_define: {
				message: "定義の代替選択"
			},
			menu_setting_define_delete_dialog_define_list_box_item_no_use: {
				message: "定義を使用しない"
			},
			menu_setting_define_name: {
				message: "定義名"
			},
			menu_setting_define_export_dialog: {
				message: "定義のエクスポート"
			},
			menu_setting_define_export_dialog_export: {
				message: "エクスポート"
			},
			menu_setting_define_export_dialog_export_hint: {
				message: "テキストエリアの値をコピーして下さい。"
			},
			menu_setting_define_import_dialog: {
				message: "定義のインポート"
			},
			menu_setting_define_import_dialog_explanation: {
				message: "インポートについて"
			},
			menu_setting_define_import_dialog_explanation_0: {
				message: "プリセット設定は上書き、ユーザー設定は新規追加されます。"
			},
			menu_setting_define_import_dialog_explanation_1: {
				message: "インポートを行う前に、基本設定のエクスポート機能でバックアップを取ることをお勧めします。"
			},
			menu_setting_define_import_dialog_explanation_2: {
				message: "信頼の無い人物が作成した設定データを、絶対にインポートしないで下さい。悪意のあるスクリプトが含まれる恐れがあります。"
			},
			menu_setting_define_import_dialog_import: {
				message: "インポート"
			},
			menu_setting_define_import_dialog_import_hint: {
				message: "エクスポートから出力したテキストをペーストして下さい。"
			},
			menu_setting_define_import_dialog_confirm: {
				message: "インポートを実行しますか?"
			},
			menu_setting_define_import_alert: {
				message: "インポートの結果"
			},
			menu_setting_define_import_alert_success: {
				message: "インポートが完了しました。"
			},
			menu_setting_define_import_alert_failure: {
				message: "インポートに失敗しました。"
			},
			menu_setting_define_wildcard_detail: {
				message: "ワイルドカードについて"
			},
			menu_setting_define_wildcard_detail_0: {
				message: "ワイルドカードは、最後に必ず実行されます。"
			},
			menu_setting_define_wildcard_detail_1: {
				message: "ワイルドカードは、ブラウザのすべての通信に影響します。"
			},
			menu_setting_define_wildcard_detail_2: {
				message: "ワイルドカードは、定義ではありません。「URL マッピング設定」にて使用する事はできません。"
			},
			menu_setting_filter_list: {
				message: "フィルタ一覧"
			},
			menu_setting_filter_list_hint: {
				message: "リストを選択すると下部のコントロールの入力が可能です。上から順番にURLの比較を行いマッチすればその設定が使用されます。"
			},
			menu_setting_filter_button_add: {
				message: "追加"
			},
			menu_setting_filter_button_delete: {
				message: "削除"
			},
			menu_setting_filter_button_prio_up: {
				message: "優先度を上げる"
			},
			menu_setting_filter_button_prio_down: {
				message: "優先度を下げる"
			},
			menu_setting_filter_button_export: {
				message: "エクスポート"
			},
			menu_setting_filter_button_import: {
				message: "インポート"
			},
			menu_setting_filter_add_dialog: {
				message: "フィルタの新規作成"
			},
			menu_setting_filter_add_dialog_name: {
				message: "名前"
			},
			menu_setting_filter_add_dialog_copy_define: {
				message: "既存の設定から複製"
			},
			menu_setting_filter_add_dialog_define_list_box_item_new: {
				message: "複製せずに新規作成する"
			},
			menu_setting_filter_export_dialog: {
				message: "フィルタのエクスポート"
			},
			menu_setting_filter_export_dialog_export: {
				message: "エクスポート"
			},
			menu_setting_filter_export_dialog_export_hint: {
				message: "テキストエリアの値をコピーして下さい。"
			},
			menu_setting_filter_import_dialog: {
				message: "フィルタのインポート"
			},
			menu_setting_filter_import_dialog_explanation: {
				message: "インポートについて"
			},
			menu_setting_filter_import_dialog_explanation_0: {
				message: "インポートした内容は、リストの最後に追加されます。"
			},
			menu_setting_filter_import_dialog_explanation_1: {
				message: "インポートを行う前に、基本設定のエクスポート機能でバックアップを取ることをお勧めします。"
			},
			menu_setting_filter_import_dialog_explanation_2: {
				message: "信頼の無い人物が作成した設定データを、絶対にインポートしないで下さい。悪意のあるスクリプトが含まれる恐れがあります。"
			},
			menu_setting_filter_import_dialog_import: {
				message: "インポート"
			},
			menu_setting_filter_import_dialog_import_hint: {
				message: "エクスポートから出力したテキストをペーストして下さい。"
			},
			menu_setting_filter_import_dialog_confirm: {
				message: "インポートを実行しますか?"
			},
			menu_setting_filter_import_alert: {
				message: "インポートの結果"
			},
			menu_setting_filter_import_alert_success: {
				message: "インポートが完了しました。"
			},
			menu_setting_filter_import_alert_failure: {
				message: "インポートに失敗しました。"
			},
			menu_button_ok: {
				message: "OK"
			},
			menu_button_yes: {
				message: "決定"
			},
			menu_button_no: {
				message: "キャンセル"
			},
			menu_script_obj_editer_edit_script: {
				message: "スクリプトを編集する"
			},
			menu_script_obj_editer_delete_script: {
				message: "スクリプトを削除する(デフォルトに戻す)"
			},
			menu_scriptarea_hint: {
				message: "配列に格納して匿名関数を記述します。信頼の無い人物が作成したスクリプトを、絶対に書き込まないで下さい。悪意のあるスクリプトが含まれる恐れがあります。"
			},
			menu_scriptarea_unsupport: {
				message: "ユーザースクリプトは現在動作しません😥(デフォルトのスクリプトが実行されます)"
			},
			menu_text_regexp_hint: {
				message: "正規表現文字列を記述。[オプション] g…繰り返し処理、i…小文字と大文字を区別しない"
			},
			menu_regexp_list_button_add: {
				message: "追加"
			},
			menu_regexp_list_button_delete: {
				message: "削除"
			},
			menu_regexp_list_button_move_up: {
				message: "上に移動"
			},
			menu_regexp_list_button_move_down: {
				message: "下に移動"
			},
			menu_setting_url_edit_container_combo_box_item_asterisk: {
				message: "アスタリスク形式で入力する"
			},
			menu_setting_url_edit_container_combo_box_item_regexp: {
				message: "正規表現形式で入力する"
			},
			menu_setting_url_edit_container_type_asterisk_hint: {
				message: "URL を記述します。アスタリスク使用可。複数行指定可。"
			},
			page_expand_popup_menu: {
				message: "PageExpand メニュー"
			},
			context_menu_pageexpand_config: {
				message: "PageExpand の設定"
			},
			context_menu_batch_download_image: {
				message: "一括ダウンロード(画像)"
			},
			context_menu_batch_download_user: {
				message: "一括ダウンロード(ユーザー)"
			},
			context_menu_pageexpand_open_bbs_board: {
				message: "掲示板ボードを開く"
			},
			context_menu_pageexpand_open_bbs_board_run_confirm: {
				message: "このページ内で掲示板ボードを実行しますか?"
			},
			context_menu_pageexpand_config_current_page: {
				message: "現在のページの設定を編集"
			},
			context_menu_pageexpand_config_current_bbs: {
				message: "現在の掲示板の設定を編集"
			},
			context_menu_pageexpand_config_current_page_confirm: {
				message: "PageExpand 設定は、規定のページ内でしか動作しません。\n(Web ページ側から悪意のあるスクリプトが注入されるのを防ぐためです)\n\n以下のページを開きますか?\n"
			},
			context_menu_pageexpand_config_auto_run_confirm: {
				message: "このページ内で PageExpand 設定を実行しますか?\n(もしこのページが汚染されている場合、悪意のあるスクリプトが注入されます)\n\n"
			},
			context_menu_pageexpand_start: {
				message: "PageExpand の開始"
			},
			context_menu_pageexpand_execute_fastest: {
				message: "PageExpand の最速実行"
			},
			context_menu_pageexpand_abort: {
				message: "PageExpand の中止"
			},
			context_menu_pageexpand_debug: {
				message: "PageExpand デバッグ"
			}
		},
		en: {
			extension_name: {
				message: "PageExpand"
			},
			extension_description: {
				message: "All Image Download. Image Zoom. Expand Thumbnail and Audio and Video. Expand the short URL. Generate a link from text. Override Referer. Extend BBS. etc..."
			},
			page_expand_config: {
				message: "PageExpand Setting"
			},
			menu_setting_standard: {
				message: "Standard Setting"
			},
			menu_setting_standard_filter_url: {
				message: "To limit the operation by URL"
			},
			menu_setting_standard_filter_url_combo_box_item_deny: {
				message: "Do not operate only at the specified address. (Otherwise it will all work.)"
			},
			menu_setting_standard_filter_url_combo_box_item_allow: {
				message: "Work only at the specified address. (Otherwise, all does not work.)"
			},
			menu_setting_standard_filter_url_hint: {
				message: "Describes the URL. Can be used an asterisk. Can be specified multi line."
			},
			menu_setting_standard_check_box_container: {
				message: "Standard Setting"
			},
			menu_setting_standard_enable_icon_address_bar: {
				message: "Displays an icon in the address bar."
			},
			menu_setting_standard_enable_context_menu: {
				message: "Display the context menu."
			},
			menu_setting_standard_enable_startup: {
				message: "Operation starts from when the load is finished."
			},
			menu_setting_standard_enable_debug_mode: {
				message: "Running in debug mode."
			},
			menu_setting_standard_enable_output_log: {
				message: "Output the log to the console.(debug)"
			},
			menu_setting_standard_execute_queue: {
				message: "ExecuteQueue Setting (Normally, you do not need to change.)"
			},
			menu_setting_standard_execute_queue_time_sleep: {
				message: "Sleep time (Millisecond)"
			},
			menu_setting_standard_execute_queue_time_occupancy: {
				message: "Maximum CPU occupancy time (Millisecond)"
			},
			menu_setting_standard_execute_queue_hint: {
				message: "When maximum CPU occupancy time is large, Response operation is worse,The script will run faster. If the sleep time is small,CPU utilization is higher,The script will run faster."
			},
			menu_setting_standard_touch: {
				message: "Touch Operation Setting"
			},
			menu_setting_standard_enable_input_touch: {
				message: "Enable touch operation."
			},
			menu_setting_standard_enable_double_touch_assist: {
				message: "Display the double touch assist."
			},
			menu_setting_standard_command: {
				message: "Execute Menu (for mobile)"
			},
			menu_setting_standard_command_execute_button: {
				message: "Execute"
			},
			menu_setting_standard_command_execute_dialog: {
				message: "Execute Menu"
			},
			menu_setting_standard_command_execute_dialog_tab_list: {
				message: "select the tab"
			},
			menu_setting_standard_command_execute_dialog_command_list: {
				message: "select the command"
			},
			menu_setting_standard_command_execute_dialog_confirm: {
				message: "Do you want to execute?"
			},
			menu_setting_standard_export_import: {
				message: "Setting Export / Import"
			},
			menu_setting_standard_export_button: {
				message: "Export"
			},
			menu_setting_standard_import_button: {
				message: "Import"
			},
			menu_setting_standard_export_dialog: {
				message: "Setting Export"
			},
			menu_setting_standard_export_dialog_export: {
				message: "Export"
			},
			menu_setting_standard_export_dialog_export_hint: {
				message: "Please copy the text of TextArea."
			},
			menu_setting_standard_import_dialog: {
				message: "Setting Import"
			},
			menu_setting_standard_import_dialog_explanation: {
				message: "information about Import"
			},
			menu_setting_standard_import_dialog_explanation_0: {
				message: "All current settings will be lost."
			},
			menu_setting_standard_import_dialog_explanation_1: {
				message: "It is recommended that you take a backup on the export function."
			},
			menu_setting_standard_import_dialog_explanation_2: {
				message: "Please note so that it does not contain malicious code."
			},
			menu_setting_standard_import_dialog_import: {
				message: "Import"
			},
			menu_setting_standard_import_dialog_import_hint: {
				message: "Please paste the output text from Export."
			},
			menu_setting_standard_import_dialog_confirm: {
				message: "Do you want to Import?"
			},
			menu_setting_standard_import_alert: {
				message: "A result of the import"
			},
			menu_setting_standard_import_alert_success: {
				message: "Import has been completed."
			},
			menu_setting_standard_import_alert_failure: {
				message: "Failed to import."
			},
			menu_setting_standard_storage_sync: {
				message: "Sync Storage"
			},
			menu_setting_standard_storage_sync_load_button: {
				message: "Load"
			},
			menu_setting_standard_storage_sync_save_button: {
				message: "Save"
			},
			menu_setting_standard_storage_sync_delete_button: {
				message: "Delete"
			},
			menu_setting_standard_storage_sync_load_dialog: {
				message: "Load from the Sync Storage"
			},
			menu_setting_standard_storage_sync_load_dialog_explanation: {
				message: "information about Load from the Sync Storage"
			},
			menu_setting_standard_storage_sync_load_dialog_explanation_0: {
				message: "Load the data from the Sync Storage, apply to PageExpand Setting."
			},
			menu_setting_standard_storage_sync_load_dialog_explanation_1: {
				message: "All current settings will be lost."
			},
			menu_setting_standard_storage_sync_load_dialog_explanation_2: {
				message: "It is recommended that you take a backup on the export function."
			},
			menu_setting_standard_storage_sync_load_dialog_confirm: {
				message: "Do you want to Load from the Sync Storage?"
			},
			menu_setting_standard_storage_sync_load_alert: {
				message: "A result of the Load from the Sync Storage"
			},
			menu_setting_standard_storage_sync_load_alert_success: {
				message: "Load from the Sync Storage has been completed."
			},
			menu_setting_standard_storage_sync_load_alert_failure: {
				message: "Failed to the Load from the Sync Storage."
			},
			menu_setting_standard_storage_sync_save_dialog: {
				message: "Save to the Sync Storage"
			},
			menu_setting_standard_storage_sync_save_dialog_explanation: {
				message: "information about Save to the Sync Storage"
			},
			menu_setting_standard_storage_sync_save_dialog_explanation_0: {
				message: "Save the current settings to the Sync Storage."
			},
			menu_setting_standard_storage_sync_save_dialog_explanation_1: {
				message: "Need to enable the functionality of the sync of browser."
			},
			menu_setting_standard_storage_sync_save_dialog_explanation_2: {
				message: "There is a limit to the size. Fail if the size is too large."
			},
			menu_setting_standard_storage_sync_save_dialog_confirm: {
				message: "Do you want to Save to the Sync Storage?"
			},
			menu_setting_standard_storage_sync_save_alert: {
				message: "A result of the Save to the Sync Storage"
			},
			menu_setting_standard_storage_sync_save_alert_success: {
				message: "Save to the Sync Storage has been completed."
			},
			menu_setting_standard_storage_sync_save_alert_failure: {
				message: "Failed to the Save to the Sync Storage."
			},
			menu_setting_standard_storage_sync_delete_dialog: {
				message: "Delete from the Sync Storage"
			},
			menu_setting_standard_storage_sync_delete_dialog_explanation: {
				message: "information about Delete from the Sync Storage"
			},
			menu_setting_standard_storage_sync_delete_dialog_explanation_0: {
				message: "Delete the setting data stored in the Sync Storage."
			},
			menu_setting_standard_storage_sync_delete_dialog_confirm: {
				message: "Do you want to Delete from the Sync Storage?"
			},
			menu_setting_standard_storage_sync_delete_alert: {
				message: "A result of the Delete from the Sync Storage"
			},
			menu_setting_standard_storage_sync_delete_alert_success: {
				message: "Delete from the Sync Storage has been completed."
			},
			menu_setting_standard_storage_sync_delete_alert_failure: {
				message: "Failed to the Delete from the Sync Storage."
			},
			menu_setting_standard_reset: {
				message: "Initialization of setting"
			},
			menu_setting_standard_reset_button: {
				message: "Remove all the settings, Return to the initial state."
			},
			menu_setting_standard_reset_dialog: {
				message: "Initialization of setting"
			},
			menu_setting_standard_reset_dialog_explanation: {
				message: "information about Initialization"
			},
			menu_setting_standard_reset_dialog_explanation_0: {
				message: "Returns all settings to their default state."
			},
			menu_setting_standard_reset_dialog_explanation_1: {
				message: "All current settings will be lost."
			},
			menu_setting_standard_reset_dialog_confirm: {
				message: "Do you want to Initialization?"
			},
			menu_setting_standard_reset_alert: {
				message: "Initialization results"
			},
			menu_setting_standard_reset_alert_success: {
				message: "Configuration initialization has been completed."
			},
			menu_setting_standard_reset_alert_failure: {
				message: "Failed to initialize the configuration."
			},

			menu_setting_download: {
				message: "Download Setting"
			},
			menu_setting_download_load: {
				message: "Load Setting (XHR)"
			},
			menu_setting_download_load_thread_max: {
				message: "Maximum number of simultaneous loads"
			},
			menu_setting_download_load_timeout: {
				message: "Timeout (Millisecond)"
			},
			menu_setting_download_load_timeout_hint: {
				message: "If specify 0, timeout is no limit."
			},
			menu_setting_download_load_cache_for_media: {
				message: "Cache MODE (for Media)"
			},
			menu_setting_download_load_cache_for_media_hint: {
				message: "Normally, you do not need to change. Use \"fetch API\" and works when \"loading media\"."
			},
			menu_setting_expand_image_load_cache_for_media_combo_box_item_default: {
				message: "default (best)"
			},
			menu_setting_expand_image_load_cache_for_media_combo_box_item_no_store: {
				message: "don't use cache."
			},
			menu_setting_expand_image_load_cache_for_media_combo_box_item_force_cache: {
				message: "If cache exists, don't request. (forever old data)"
			},
			menu_setting_download_download: {
				message: "Download Setting"
			},
			menu_setting_download_download_thread_max: {
				message: "Maximum number of simultaneous downloads"
			},
			menu_setting_download_download_save_file: {
				message: "Save File Name"
			},
			menu_setting_download_download_save_file_combo_box_item_simple: {
				message: "simple"
			},
			menu_setting_download_download_save_file_combo_box_item_detail: {
				message: "detail"
			},
			menu_setting_download_download_save_file_simple: {
				message: "Select File Name"
			},
			menu_setting_download_download_save_file_detail: {
				message: "Edit File Name"
			},
			menu_setting_download_download_save_file_variable: {
				message: "Variable List"
			},
			menu_setting_download_download_conflict_type: {
				message: "File Name Conflict"
			},
			menu_setting_download_download_conflict_type_combo_box_item_rename: {
				message: "rename"
			},
			menu_setting_download_download_conflict_type_combo_box_item_overwrite: {
				message: "overwrite"
			},
			menu_setting_download_batch_download: {
				message: "Batch Download Setting"
			},

			menu_setting_expand_bbs: {
				message: "BBS Settng"
			},
			menu_setting_expand_bbs_list: {
				message: "List of BBS Setting"
			},
			menu_setting_expand_bbs_list_hint: {
				message: "When you select an item in the list, the lower control can be edited. Condition script will be executed in order from top to bottom. possible to select multiple. Can be edited by multiple selection. Gray is preset setting. Preset setting can not be deleted."
			},
			menu_setting_expand_bbs_button_add: {
				message: "add"
			},
			menu_setting_expand_bbs_button_delete: {
				message: "delete"
			},
			menu_setting_expand_bbs_button_prio_up: {
				message: "prio up"
			},
			menu_setting_expand_bbs_button_prio_down: {
				message: "prio down"
			},
			menu_setting_expand_bbs_button_export: {
				message: "export"
			},
			menu_setting_expand_bbs_button_import: {
				message: "import"
			},
			menu_setting_expand_bbs_add_dialog: {
				message: "Creating a new BBS Setting"
			},
			menu_setting_expand_bbs_add_dialog_name: {
				message: "Name"
			},
			menu_setting_expand_bbs_add_dialog_copy_define: {
				message: "Replicated from the existing setting."
			},
			menu_setting_expand_bbs_add_dialog_define_list_box_item_new: {
				message: "create a new"
			},
			menu_setting_expand_bbs_export_dialog: {
				message: "BBS Setting Export"
			},
			menu_setting_expand_bbs_export_dialog_export: {
				message: "Export"
			},
			menu_setting_expand_bbs_export_dialog_export_hint: {
				message: "Please copy the text of TextArea."
			},
			menu_setting_expand_bbs_import_dialog: {
				message: "BBS Setting Import"
			},
			menu_setting_expand_bbs_import_dialog_explanation: {
				message: "information about Import"
			},
			menu_setting_expand_bbs_import_dialog_explanation_0: {
				message: "Preset setting will be overwritten. User setting will be add new."
			},
			menu_setting_expand_bbs_import_dialog_explanation_1: {
				message: "It is recommended that you take a backup on the export function."
			},
			menu_setting_expand_bbs_import_dialog_explanation_2: {
				message: "Please note so that it does not contain malicious code."
			},
			menu_setting_expand_bbs_import_dialog_import: {
				message: "Import"
			},
			menu_setting_expand_bbs_import_dialog_import_hint: {
				message: "Please paste the output text from Export."
			},
			menu_setting_expand_bbs_import_dialog_confirm: {
				message: "Do you want to Import?"
			},
			menu_setting_expand_bbs_import_alert: {
				message: "A result of the import"
			},
			menu_setting_expand_bbs_import_alert_success: {
				message: "Import has been completed."
			},
			menu_setting_expand_bbs_import_alert_failure: {
				message: "Failed to import."
			},
			menu_setting_expand_bbs_name: {
				message: "Name"
			},
			menu_setting_expand_bbs_check_box_container: {
				message: "Enable / Disable"
			},
			menu_setting_expand_bbs_enable_setting: {
				message: "Use this setting."
			},
			menu_setting_expand_bbs_filter_url: {
				message: "URL to allow the operation"
			},
			menu_setting_expand_bbs_popup_check_box_container: {
				message: "Popup Setting"
			},
			menu_setting_expand_bbs_popup_enable_animation: {
				message: "Enable pop-up animation"
			},
			menu_setting_expand_bbs_popup_origin_type: {
				message: "Placement origin of the pop-up"
			},
			menu_setting_expand_bbs_popup_origin_type_combo_box_item_adsorb_top_bottom: {
				message: "adsorb top bottom"
			},
			menu_setting_expand_bbs_popup_origin_type_combo_box_item_adsorb_left_right: {
				message: "adsorb left right"
			},
			menu_setting_expand_bbs_popup_position_type: {
				message: "Arrangement position of the pop-up"
			},
			menu_setting_expand_bbs_popup_position_type_combo_box_item_absolute: {
				message: "absolute"
			},
			menu_setting_expand_bbs_popup_position_type_combo_box_item_fixed: {
				message: "fixed"
			},
			menu_setting_expand_bbs_popup_percent: {
				message: "Popup Size"
			},
			menu_setting_expand_bbs_popup_percent_h: {
				message: "Percent Horizontal (0-100)"
			},
			menu_setting_expand_bbs_popup_percent_v: {
				message: "Percent Vertical (0-100)"
			},
			menu_setting_expand_bbs_popup_time: {
				message: "Popup Time"
			},
			menu_setting_expand_bbs_popup_time_wait_open: {
				message: "The time to wait before open (Millisecond)"
			},
			menu_setting_expand_bbs_popup_time_wait_close: {
				message: "The time to wait before close (Millisecond)"
			},
			menu_setting_expand_bbs_popup_style_sheet: {
				message: "Stylesheet of Popup"
			},
			menu_setting_expand_bbs_script_initialize: {
				message: "Initialize Script"
			},
			menu_setting_expand_bbs_script_callback: {
				message: "Callback Script"
			},
			menu_setting_urlmap: {
				message: "URL Mapping Setting"
			},
			menu_setting_urlmap_list: {
				message: "List of URL Mapping Setting"
			},
			menu_setting_urlmap_list_hint: {
				message: "When you select an item in the list, the lower control can be edited. Will be compared with the order from above. possible to select multiple. Can be edited by multiple selection. Gray is preset setting. Preset setting can not be deleted."
			},
			menu_setting_urlmap_button_add: {
				message: "add"
			},
			menu_setting_urlmap_button_delete: {
				message: "delete"
			},
			menu_setting_urlmap_button_prio_up: {
				message: "prio up"
			},
			menu_setting_urlmap_button_prio_down: {
				message: "prio down"
			},
			menu_setting_urlmap_add_dialog: {
				message: "Creating a new URL Mapping"
			},
			menu_setting_urlmap_add_dialog_name: {
				message: "Name"
			},
			menu_setting_urlmap_add_dialog_copy_define: {
				message: "Replicated from the existing setting."
			},
			menu_setting_urlmap_add_dialog_define_list_box_item_new: {
				message: "create a new"
			},
			menu_setting_urlmap_name: {
				message: "Name"
			},
			menu_setting_urlmap_check_box_container: {
				message: "Enable / Disable"
			},
			menu_setting_urlmap_enable_setting: {
				message: "Use this setting."
			},
			menu_setting_urlmap_filter_url: {
				message: "URL to allow the operation"
			},
			menu_setting_urlmap_mixed_passive_content_container: {
				message: "Mixed Passive Content Security"
			},
			menu_setting_urlmap_mixed_passive_content_unsafe: {
				message: "\"http://\" as is"
			},
			menu_setting_urlmap_mixed_passive_content_safe: {
				message: "Convert to \"https://\" (Do not display if failed)"
			},
			menu_setting_urlmap_mixed_passive_content_hint: {
				message: "If content such as images and videos is displayed with a red border, It means that it is unencrypted, untrustworthy, and can be tampered with by man-in-the-middle attacks."
			},
			menu_setting_urlmap_mixed_active_content_container: {
				message: "Mixed Active Content Security"
			},
			menu_setting_urlmap_mixed_active_content_unsafe: {
				message: "\"http://\" as is"
			},
			menu_setting_urlmap_mixed_active_content_safe: {
				message: "Convert to \"https://\" (Do not display if failed)"
			},
			menu_setting_urlmap_mixed_active_content_hint: {
				message: "Browser is block \"mixed active content\" by default. To actually display, you need to unblock \"Insecure content\" from the permission settings. (dangerous)"
			},
			menu_setting_urlmap_define_button_edit: {
				message: "edit"
			},
			menu_setting_urlmap_define_button_add: {
				message: "add"
			},
			menu_setting_urlmap_define_button_remove: {
				message: "remove"
			},
			menu_setting_urlmap_define_button_prio_up: {
				message: "up"
			},
			menu_setting_urlmap_define_button_prio_down: {
				message: "down"
			},
			menu_setting_urlmap_define_combo_box_item_no_use: {
				message: "not use the definine"
			},
			menu_setting_define_multi_select_add_dialog: {
				message: "add the define"
			},
			menu_setting_define_multi_select_add_dialog_list: {
				message: "Select the define you want to add."
			},
			menu_setting_access_block: {
				message: "Blocking Access Define"
			},
			menu_setting_access_block_filter_url: {
				message: "URL to block access"
			},
			menu_setting_replacement_to_element: {
				message: "Replace Element Define"
			},
			menu_setting_replacement_to_element_script: {
				message: "Callback Script"
			},
			menu_setting_replacement_to_text: {
				message: "Replace Text Define"
			},
			menu_setting_replacement_to_text_script: {
				message: "Callback Script"
			},
			menu_setting_replacement_to_anchor: {
				message: "Replace Anchor Define"
			},
			menu_setting_replacement_to_anchor_script: {
				message: "Callback Script"
			},
			menu_setting_replacement_to_link: {
				message: "Replace Link Define"
			},
			menu_setting_replacement_to_link_filter_list: {
				message: "Filter List"
			},
			menu_setting_replacement_to_link_filter_name: {
				message: "Filter Name"
			},
			menu_setting_replacement_to_link_filter: {
				message: "Filter Setting"
			},
			menu_setting_replacement_to_link_filter_filter_url: {
				message: "Link URL to allow the operation"
			},
			menu_setting_replacement_to_link_check_box_container: {
				message: "Setting to link"
			},
			menu_setting_replacement_to_link_enable_reflect_to_anchor: {
				message: "Reflected to the HTMLAnchorElement href"
			},
			menu_setting_replacement_to_link_enable_cache: {
				message: "Cache the results of callback script"
			},
			menu_setting_replacement_to_link_filter_script: {
				message: "Callback Script"
			},
			menu_setting_replacement_to_referer: {
				message: "Replace Referer Define"
			},
			menu_setting_replacement_to_referer_filter_list: {
				message: "Filter List"
			},
			menu_setting_replacement_to_referer_filter_name: {
				message: "Filter Name"
			},
			menu_setting_replacement_to_referer_filter: {
				message: "Filter Setting"
			},
			menu_setting_replacement_to_referer_filter_filter_url: {
				message: "Link URL to allow the operation"
			},
			menu_setting_replacement_to_referer_filter_send_type: {
				message: "Basic Referer"
			},
			menu_setting_replacement_to_referer_filter_send_type_combo_box_item: {
				message: "Basic Referer Value"
			},
			menu_setting_replacement_to_referer_filter_send_type_combo_box_item_default: {
				message: "default"
			},
			menu_setting_replacement_to_referer_filter_send_type_combo_box_item_current_url: {
				message: "current url"
			},
			menu_setting_replacement_to_referer_filter_send_type_combo_box_item_link_url: {
				message: "link url"
			},
			menu_setting_replacement_to_referer_filter_send_type_combo_box_item_custom: {
				message: "custom"
			},
			menu_setting_replacement_to_referer_filter_send_custom: {
				message: "Custom String"
			},
			menu_setting_replacement_to_referer_filter_send_regexp: {
				message: "Replaced by a regular expression"
			},
			menu_setting_replacement_to_referer_filter_send_regexp_match: {
				message: "Match conditions"
			},
			menu_setting_replacement_to_referer_filter_send_regexp_replacement: {
				message: "Replace String"
			},
			menu_setting_replacement_to_referer_filter_send_regexp_replacement_hint: {
				message: "$0...Whole match. $1-$9...Partial match. $$…Dollar sign escape sequence."
			},
			menu_setting_replacement_to_useragent: {
				message: "Replace Useragent Define"
			},
			menu_setting_replacement_to_useragent_filter_list: {
				message: "Filter List"
			},
			menu_setting_replacement_to_useragent_filter_name: {
				message: "Filter Name"
			},
			menu_setting_replacement_to_useragent_filter: {
				message: "Filter Setting"
			},
			menu_setting_replacement_to_useragent_filter_filter_url: {
				message: "Link URL to allow the operation"
			},
			menu_setting_replacement_to_useragent_filter_send: {
				message: "Basic Useragent"
			},
			menu_setting_replacement_to_useragent_filter_send_custom: {
				message: "Custom String"
			},
			menu_setting_make_link_to_text: {
				message: "Make Link To Text Define"
			},
			menu_setting_make_link_to_text_script: {
				message: "Callback Script"
			},
			menu_setting_expand_short_url: {
				message: "Expand Short Url Define"
			},
			menu_setting_expand_short_url_filter_url: {
				message: "URL to allow the operation"
			},
			menu_setting_expand_text: {
				message: "Expand Text Define"
			},
			menu_setting_expand_text_inline: {
				message: "Setting to display inline"
			},
			menu_setting_expand_text_inline_check_box_container: {
				message: "Setting to display inline"
			},
			menu_setting_expand_text_inline_disable_same_text: {
				message: "If the same URL, not to Expand."
			},
			menu_setting_expand_text_inline_script_allow: {
				message: "Condition to display inline from a link"
			},
			menu_setting_expand_text_inline_script_insert: {
				message: "Text Insert"
			},
			menu_setting_expand_image: {
				message: "Expand Image Define"
			},
			menu_setting_expand_image_thumbnail: {
				message: "Setting to display thumbnail"
			},
			menu_setting_expand_image_thumbnail_enable_check_box_container: {
				message: "Enable / Disable"
			},
			menu_setting_expand_image_thumbnail_enable_thumbnail: {
				message: "Display the thumbnail."
			},
			menu_setting_expand_image_thumbnail_check_box_container: {
				message: "Setting to display thumbnail"
			},
			menu_setting_expand_image_thumbnail_enable_popup_mouseover: {
				message: "If you mouse over the thumbnail, a pop-up display"
			},
			menu_setting_expand_image_thumbnail_disable_same_thumbnail_image: {
				message: "If the same URL, not to Expand."
			},
			menu_setting_expand_image_thumbnail_size: {
				message: "Thumbnail Size"
			},
			menu_setting_expand_image_thumbnail_size_min: {
				message: "Minimum allowed size (pixel)"
			},
			menu_setting_expand_image_thumbnail_size_scale: {
				message: "Scale (Percent)"
			},
			menu_setting_expand_image_thumbnail_size_max: {
				message: "Maximum allowed size (pixel)"
			},
			menu_setting_expand_image_thumbnail_script_allow: {
				message: "Condition to display thumbnail from a link"
			},
			menu_setting_expand_image_thumbnail_script_insert: {
				message: "Thumbnail Insert"
			},
			menu_setting_expand_image_popup: {
				message: "Setting to display popup"
			},
			menu_setting_expand_image_popup_enable_check_box_container: {
				message: "Enable / Disable"
			},
			menu_setting_expand_image_popup_enable_popup_mouseover: {
				message: "If you mouse over the anchor, a pop-up display"
			},
			menu_setting_expand_image_popup_check_box_container: {
				message: "Animation"
			},
			menu_setting_expand_image_popup_enable_animation_scale: {
				message: "Enable scale fade animation"
			},
			menu_setting_expand_image_popup_enable_animation_alpha: {
				message: "Enable alpha fade animation"
			},
			menu_setting_expand_image_popup_origin_type: {
				message: "Placement origin of the pop-up image"
			},
			menu_setting_expand_image_popup_origin_type_combo_box_item_center: {
				message: "center"
			},
			menu_setting_expand_image_popup_origin_type_combo_box_item_upper_left: {
				message: "upper left"
			},
			menu_setting_expand_image_popup_origin_type_combo_box_item_upper_right: {
				message: "upper right"
			},
			menu_setting_expand_image_popup_origin_type_combo_box_item_client_center: {
				message: "client center"
			},
			menu_setting_expand_image_popup_origin_type_combo_box_item_adsorb_element: {
				message: "adsorb element"
			},
			menu_setting_expand_image_popup_origin_type_combo_box_item_adsorb_mouse: {
				message: "adsorb mouse"
			},
			menu_setting_expand_image_popup_time: {
				message: "Popup Time"
			},
			menu_setting_expand_image_popup_time_wait_open: {
				message: "The time to wait before open (Millisecond)"
			},
			menu_setting_expand_image_popup_time_wait_close: {
				message: "The time to wait before close (Millisecond)"
			},
			menu_setting_expand_image_popup_position_type: {
				message: "Arrangement position of the pop-up image"
			},
			menu_setting_expand_image_popup_position_type_combo_box_item_absolute: {
				message: "absolute"
			},
			menu_setting_expand_image_popup_position_type_combo_box_item_fixed: {
				message: "fixed"
			},
			menu_setting_expand_image_popup_size: {
				message: "Popup Size"
			},
			menu_setting_expand_image_popup_size_scale: {
				message: "Scale (Percent)"
			},
			menu_setting_expand_image_popup_script_allow: {
				message: "Conditions to display popup from the link"
			},
			menu_setting_expand_image_reduced_image: {
				message: "Reduced Image Setting"
			},
			menu_setting_expand_image_reduced_image_check_box_container: {
				message: "Enable / Disable"
			},
			menu_setting_expand_image_popup_enable_popup: {
				message: "If you mouse over the Reduced Image, a pop-up display"
			},
			menu_setting_expand_image_reduced_image_allow_slcale_less_then: {
				message: "Conditions to display popup"
			},
			menu_setting_expand_image_reduced_image_allow_slcale_less_then_text: {
				message: "If the magnification is less than."
			},
			menu_setting_expand_image_load: {
				message: "Load Image Setting"
			},
			menu_setting_expand_image_load_check_box_container: {
				message: "Load Image Setting"
			},
			menu_setting_expand_image_load_enable_notify: {
				message: "Display the progress."
			},
			menu_setting_expand_image_load_start_type: {
				message: "How to load image"
			},
			menu_setting_expand_image_load_start_type_preload: {
				message: "Preload"
			},
			menu_setting_expand_image_load_start_type_scroll: {
				message: "Conjunction with the scroll"
			},
			menu_setting_expand_image_load_src_type: {
				message: "Image Source Format"
			},
			menu_setting_expand_image_load_src_type_combo_box_item_url: {
				message: "URL (except mixed content)"
			},
			menu_setting_expand_image_load_src_type_combo_box_item_blob_url: {
				message: "Blob URL (all)"
			},
			menu_setting_expand_image_load_decode: {
				message: "Decode Image Setting"
			},
			menu_setting_expand_image_load_decode_combo_box_item_auto: {
				message: "Browser default"
			},
			menu_setting_expand_image_load_decode_combo_box_item_pre_decode: {
				message: "Pre-decode the all"
			},
			menu_setting_expand_image_load_unload_check_box_container: {
				message: "Unload Image Setting"
			},
			menu_setting_expand_image_load_enable_unload: {
				message: "Enable Unload Image"
			},
			menu_setting_expand_image_load_unload: {
				message: "Conditions to unload image"
			},
			menu_setting_expand_image_load_allow_unload_more_then_text: {
				message: "If load more than the specified of MBytes, Release the old image."
			},
			menu_setting_expand_sound: {
				message: "Expand Sound Define"
			},
			menu_setting_expand_sound_inline: {
				message: "Setting to display inline"
			},
			menu_setting_expand_sound_inline_check_box_container: {
				message: "Setting to display inline"
			},
			menu_setting_expand_sound_inline_disable_same_text: {
				message: "If the same URL, not to Expand."
			},
			menu_setting_expand_sound_inline_sound_max: {
				message: "Maximum number of simultaneous display"
			},
			menu_setting_expand_sound_inline_script_allow: {
				message: "Condition to display inline from a link"
			},
			menu_setting_expand_sound_inline_script_insert: {
				message: "Audio Insert"
			},
			menu_setting_expand_sound_inline_element: {
				message: "HTMLAudioElement Setting"
			},
			menu_setting_expand_sound_inline_element_script_allow: {
				message: "Condition to display HTMLAudioElement"
			},
			menu_setting_expand_sound_inline_element_src_type: {
				message: "Audio Source Format"
			},
			menu_setting_expand_sound_inline_element_src_type_combo_box_item_url: {
				message: "URL (streaming)"
			},
			menu_setting_expand_sound_inline_element_src_type_combo_box_item_blob_url: {
				message: "Blob URL (full)"
			},
			menu_setting_expand_sound_inline_soundcloud: {
				message: "soundcloud.com Setting"
			},
			menu_setting_expand_sound_inline_soundcloud_check_box_container: {
				message: "soundcloud.com Setting"
			},
			menu_setting_expand_sound_inline_soundcloud_visible_player_html5: {
				message: "enable player (HTML5)"
			},
			menu_setting_expand_sound_inline_mixcloud: {
				message: "www.mixcloud.com Setting"
			},
			menu_setting_expand_sound_inline_mixcloud_check_box_container: {
				message: "www.mixcloud.com Setting"
			},
			menu_setting_expand_sound_inline_mixcloud_visible_player: {
				message: "enable player"
			},
			menu_setting_expand_video: {
				message: "Expand Video Define"
			},
			menu_setting_expand_video_inline: {
				message: "Setting to display inline"
			},
			menu_setting_expand_video_inline_check_box_container: {
				message: "Setting to display inline"
			},
			menu_setting_expand_video_inline_disable_same_video: {
				message: "If the same URL, not to Expand."
			},
			menu_setting_expand_video_inline_video_max: {
				message: "Maximum number of simultaneous display"
			},
			menu_setting_expand_video_inline_size: {
				message: "Inline Video Size"
			},
			menu_setting_expand_video_inline_width_max: {
				message: "Maximum allowed width (pixel)"
			},
			menu_setting_expand_video_inline_height_max: {
				message: "Maximum allowed height (pixel)"
			},
			menu_setting_expand_video_inline_script_allow: {
				message: "Condition to display inline from a link"
			},
			menu_setting_expand_video_inline_script_insert: {
				message: "Element Insert"
			},
			menu_setting_expand_video_inline_element: {
				message: "HTMLVideoElement Setting"
			},
			menu_setting_expand_video_inline_element_script_allow: {
				message: " Condition to display HTMLVideoElement"
			},
			menu_setting_expand_video_inline_element_src_type: {
				message: "Video Source Format"
			},
			menu_setting_expand_video_inline_element_src_type_combo_box_item_url: {
				message: "URL (streaming)"
			},
			menu_setting_expand_video_inline_element_src_type_combo_box_item_blob_url: {
				message: "Blob URL (full)"
			},
			menu_setting_expand_video_inline_youtube: {
				message: "www.youtube.com Setting"
			},
			menu_setting_expand_video_inline_youtube_check_box_container: {
				message: "www.youtube.com Setting"
			},
			menu_setting_expand_video_inline_youtube_visible_video: {
				message: "enable video"
			},
			menu_setting_expand_video_inline_nicovideo: {
				message: "www.nicovideo.jp Setting"
			},
			menu_setting_expand_video_inline_nicovideo_check_box_container: {
				message: "www.nicovideo.jp Setting"
			},
			menu_setting_expand_video_inline_nicovideo_visible_video: {
				message: "enable video"
			},
			menu_setting_expand_video_inline_dailymotion: {
				message: "www.dailymotion.com Setting"
			},
			menu_setting_expand_video_inline_dailymotion_check_box_container: {
				message: "www.dailymotion.com Setting"
			},
			menu_setting_expand_video_inline_dailymotion_visible_video: {
				message: "enable video"
			},
			menu_setting_expand_video_inline_video: {
				message: "vimeo.com Setting"
			},
			menu_setting_expand_video_inline_video_check_box_container: {
				message: "vimeo.com Setting"
			},
			menu_setting_expand_video_inline_video_visible_video: {
				message: "enable video"
			},
			menu_setting_expand_iframe: {
				message: "Expand Iframe Define"
			},
			menu_setting_expand_iframe_inline: {
				message: "Setting to display inline"
			},
			menu_setting_expand_iframe_inline_check_box_container: {
				message: "Setting to display inline"
			},
			menu_setting_expand_iframe_inline_disable_same_iframe: {
				message: "If the same URL, not to Expand."
			},
			menu_setting_expand_iframe_inline_script_allow: {
				message: "Condition to display inline from a link"
			},
			menu_setting_expand_iframe_inline_script_insert: {
				message: "HTMLIFrameElement Insert"
			},
			menu_setting_style_sheet: {
				message: "Stylesheet Define"
			},
			menu_setting_style_sheet_expand_text: {
				message: "Stylesheet of Expanded Text"
			},
			menu_setting_style_sheet_expand_text_element: {
				message: "HTMLTextAreaElement Setting"
			},
			menu_setting_style_sheet_expand_text_element_inline: {
				message: "Text Inline Display"
			},
			menu_setting_style_sheet_expand_text_element_inline_unsafe: {
				message: "Text Inline Display (unsafe)"
			},
			menu_setting_style_sheet_expand_image: {
				message: "Stylesheet of Expanded Image"
			},
			menu_setting_style_sheet_expand_image_element: {
				message: "HTMImageElement Setting"
			},
			menu_setting_style_sheet_expand_image_element_inline: {
				message: "Image Thumbnail Display"
			},
			menu_setting_style_sheet_expand_image_element_inline_unsafe: {
				message: "Image Thumbnail Display (unsafe)"
			},
			menu_setting_style_sheet_expand_image_element_popup: {
				message: "Image Popup Display"
			},
			menu_setting_style_sheet_expand_image_element_popup_unsafe: {
				message: "Image Popup Display (unsafe)"
			},
			menu_setting_style_sheet_expand_sound: {
				message: "Stylesheet of Expanded Sound"
			},
			menu_setting_style_sheet_expand_sound_element: {
				message: "HTMLAudioElement Setting"
			},
			menu_setting_style_sheet_expand_sound_element_inline_audio: {
				message: "Audo Inline Display"
			},
			menu_setting_style_sheet_expand_sound_element_inline_audio_unsafe: {
				message: "Audo Inline Display (unsafe)"
			},
			menu_setting_style_sheet_expand_sound_soundcloud: {
				message: "soundcloud.com Setting"
			},
			menu_setting_style_sheet_expand_sound_soundcloud_inline_player_html5: {
				message: "Player (HTML5) Inline Display"
			},
			menu_setting_style_sheet_expand_sound_mixcloud: {
				message: "www.mixcloud.com Setting"
			},
			menu_setting_style_sheet_expand_sound_mixcloud_inline_player: {
				message: "Player Inline Display"
			},
			menu_setting_style_sheet_expand_video: {
				message: "Stylesheet of Expanded Video"
			},
			menu_setting_style_sheet_expand_video_element: {
				message: "HTMLVideoElement Setting"
			},
			menu_setting_style_sheet_expand_video_element_inline_video: {
				message: "Video Inline Display"
			},
			menu_setting_style_sheet_expand_video_element_inline_video_unsafe: {
				message: "Video Inline Display (unsafe)"
			},
			menu_setting_style_sheet_expand_video_youtube: {
				message: "www.youtube.com Setting"
			},
			menu_setting_style_sheet_expand_video_youtube_inline_video: {
				message: "Video Inline Display"
			},
			menu_setting_style_sheet_expand_video_nicovideo: {
				message: "www.nicovideo.jp Setting"
			},
			menu_setting_style_sheet_expand_video_nicovideo_inline_video: {
				message: "Video Inline Display"
			},
			menu_setting_style_sheet_expand_video_dailymotion: {
				message: "www.dailymotion.com Setting"
			},
			menu_setting_style_sheet_expand_video_dailymotion_inline_video: {
				message: "Video Inline Display"
			},
			menu_setting_style_sheet_expand_video_vimeo: {
				message: "vimeo.com Setting"
			},
			menu_setting_style_sheet_expand_video_vimeo_inline_video: {
				message: "Video Inline Display"
			},
			menu_setting_style_sheet_expand_iframe: {
				message: "Stylesheet of Expanded Iframe"
			},
			menu_setting_style_sheet_expand_iframe_element: {
				message: "HTMLIFrameElement Setting"
			},
			menu_setting_style_sheet_expand_iframe_element_inline: {
				message: "Iframe Inline Display"
			},
			menu_setting_style_sheet_expand_iframe_element_inline_unsafe: {
				message: "Iframe Inline Display (unsafe)"
			},
			menu_setting_experimental: {
				message: "Experimental Define"
			},
			menu_setting_experimental_revise_scroll: {
				message: "Revise Scroll Setting"
			},
			menu_setting_experimental_revise_scroll_check_box_container: {
				message: "Revise Scroll Setting"
			},
			menu_setting_experimental_revise_scroll_enable: {
				message: "enable"
			},
			menu_setting_experimental_revise_scroll_threshold_vertical: {
				message: "Threshold Vertical ( 0 [top] ~ 100 [bottom] )"
			},
			menu_setting_language: {
				message: "Language Setting"
			},
			menu_credit: {
				message: "Credit"
			},
			menu_credit_info_version: {
				message: "Version"
			},
			menu_credit_info_copyright: {
				message: "Copyright"
			},
			menu_credit_info_translator: {
				message: "Translator"
			},
			menu_setting_define_list: {
				message: "List of Define"
			},
			menu_setting_define_list_hint: {
				message: "When you select an item in the list, the lower control can be edited. Will be compared with the order from above. possible to select multiple. Can be edited by multiple selection. Gray is preset setting. Preset setting can not be deleted."
			},
			menu_setting_define_button_add: {
				message: "add"
			},
			menu_setting_define_button_delete: {
				message: "delete"
			},
			menu_setting_define_button_move_up: {
				message: "move up"
			},
			menu_setting_define_button_move_down: {
				message: "move down"
			},
			menu_setting_define_button_export: {
				message: "export"
			},
			menu_setting_define_button_import: {
				message: "import"
			},
			menu_setting_define_add_dialog: {
				message: "Create a new define"
			},
			menu_setting_define_add_dialog_name: {
				message: "Name"
			},
			menu_setting_define_add_dialog_copy_define: {
				message: "Replicated from the existing define"
			},
			menu_setting_define_add_dialog_define_list_box_item_new: {
				message: "create a new"
			},
			menu_setting_define_delete_dialog: {
				message: "Delete the Define"
			},
			menu_setting_define_delete_dialog_name: {
				message: "Define Name (Be removed)"
			},
			menu_setting_define_delete_dialog_change_define: {
				message: "Alternative Selection"
			},
			menu_setting_define_delete_dialog_define_list_box_item_no_use: {
				message: "not use the define"
			},
			menu_setting_define_name: {
				message: "Define Name"
			},
			menu_setting_define_export_dialog: {
				message: "Define Export"
			},
			menu_setting_define_export_dialog_export: {
				message: "Export"
			},
			menu_setting_define_export_dialog_export_hint: {
				message: "Please copy the text of TextArea."
			},
			menu_setting_define_import_dialog: {
				message: "Define Import"
			},
			menu_setting_define_import_dialog_explanation: {
				message: "information about Import"
			},
			menu_setting_define_import_dialog_explanation_0: {
				message: "Preset setting will be overwritten. User setting will be add new."
			},
			menu_setting_define_import_dialog_explanation_1: {
				message: "It is recommended that you take a backup on the export function."
			},
			menu_setting_define_import_dialog_explanation_2: {
				message: "Please note so that it does not contain malicious code."
			},
			menu_setting_define_import_dialog_import: {
				message: "Import"
			},
			menu_setting_define_import_dialog_import_hint: {
				message: "Please paste the output text from Export."
			},
			menu_setting_define_import_dialog_confirm: {
				message: "Do you want to Import?"
			},
			menu_setting_define_import_alert: {
				message: "A result of the import"
			},
			menu_setting_define_import_alert_success: {
				message: "Import has been completed."
			},
			menu_setting_define_import_alert_failure: {
				message: "Failed to import."
			},
			menu_setting_define_wildcard_detail: {
				message: "information about Wild Card"
			},
			menu_setting_define_wildcard_detail_0: {
				message: "\"Wild Card\" is always execute at the last."
			},
			menu_setting_define_wildcard_detail_1: {
				message: "\"Wild Card\" be applied to all communications."
			},
			menu_setting_define_wildcard_detail_2: {
				message: "\"Wild Card\" is not the define. Can not be used in the \"URL Mapping Setting\"."
			},
			menu_setting_filter_list: {
				message: "Filter List"
			},
			menu_setting_filter_list_hint: {
				message: "When you select an item in the list, the lower control can be edited. Will be compared with the order from above. possible to select multiple. Can be edited by multiple selection."
			},
			menu_setting_filter_button_add: {
				message: "add"
			},
			menu_setting_filter_button_delete: {
				message: "delete"
			},
			menu_setting_filter_button_prio_up: {
				message: "prio up"
			},
			menu_setting_filter_button_prio_down: {
				message: "prio down"
			},
			menu_setting_filter_button_export: {
				message: "export"
			},
			menu_setting_filter_button_import: {
				message: "import"
			},
			menu_setting_filter_add_dialog: {
				message: "Creating a new Filter Setting"
			},
			menu_setting_filter_add_dialog_name: {
				message: "Name"
			},
			menu_setting_filter_add_dialog_copy_define: {
				message: "Replicated from the existing setting."
			},
			menu_setting_filter_add_dialog_define_list_box_item_new: {
				message: "create a new"
			},
			menu_setting_filter_export_dialog: {
				message: "Filter Export"
			},
			menu_setting_filter_export_dialog_export: {
				message: "Export"
			},
			menu_setting_filter_export_dialog_export_hint: {
				message: "Please copy the text of TextArea."
			},
			menu_setting_filter_import_dialog: {
				message: "Filter Import"
			},
			menu_setting_filter_import_dialog_explanation: {
				message: "information about Import"
			},
			menu_setting_filter_import_dialog_explanation_0: {
				message: "Import data is added to the last of the list."
			},
			menu_setting_filter_import_dialog_explanation_1: {
				message: "It is recommended that you take a backup on the export function."
			},
			menu_setting_filter_import_dialog_explanation_2: {
				message: "Please note so that it does not contain malicious code."
			},
			menu_setting_filter_import_dialog_import: {
				message: "Import"
			},
			menu_setting_filter_import_dialog_import_hint: {
				message: "Please paste the output text from Export."
			},
			menu_setting_filter_import_dialog_confirm: {
				message: "Do you want to Import?"
			},
			menu_setting_filter_import_alert: {
				message: "A result of the import"
			},
			menu_setting_filter_import_alert_success: {
				message: "Import has been completed."
			},
			menu_setting_filter_import_alert_failure: {
				message: "Failed to import."
			},
			menu_button_ok: {
				message: "OK"
			},
			menu_button_yes: {
				message: "YES"
			},
			menu_button_no: {
				message: "CANCEL"
			},
			menu_script_obj_editer_edit_script: {
				message: "Edit Script"
			},
			menu_script_obj_editer_delete_script: {
				message: "Delete Script (return to default)"
			},
			menu_scriptarea_hint: {
				message: "To describe the anonymous function to array. Please note so that it does not contain malicious code."
			},
			menu_scriptarea_unsupport: {
				message: "UserScript doesn't work now. 😥"
			},
			menu_text_regexp_hint: {
				message: "regular expression string. [flags] g...repeat. i...without case-sensitive."
			},
			menu_regexp_list_button_add: {
				message: "add"
			},
			menu_regexp_list_button_delete: {
				message: "delete"
			},
			menu_regexp_list_button_move_up: {
				message: "move up"
			},
			menu_regexp_list_button_move_down: {
				message: "move down"
			},
			menu_setting_url_edit_container_combo_box_item_asterisk: {
				message: "asterisk format"
			},
			menu_setting_url_edit_container_combo_box_item_regexp: {
				message: "regular expression format"
			},
			menu_setting_url_edit_container_type_asterisk_hint: {
				message: "Describes the URL. Can be used an asterisk. Can be specified multi line."
			},
			page_expand_popup_menu: {
				message: "PageExpand Menu"
			},
			context_menu_pageexpand_config: {
				message: "PageExpand Setting"
			},
			context_menu_batch_download_image: {
				message: "Batch Download (image)"
			},
			context_menu_batch_download_user: {
				message: "Batch Download (user)"
			},
			context_menu_pageexpand_open_bbs_board: {
				message: "Open BBS Board"
			},
			context_menu_pageexpand_open_bbs_board_run_confirm: {
				message: "Do you want to run the BBS Board in this page?"
			},
			context_menu_pageexpand_config_current_page: {
				message: "PageExpand Setting Current Page"
			},
			context_menu_pageexpand_config_current_bbs: {
				message: "PageExpand Setting Current BBS"
			},
			context_menu_pageexpand_config_current_page_confirm: {
				message: "PageExpand Setting will run only in the following page. \n(The purpose is to prevent from being injected the malicious script)\n\nDo you want to open the following page?\n"
			},
			context_menu_pageexpand_config_auto_run_confirm: {
				message: "Do you want to run the PageExpand Setting in this page?\n(If this page is contaminated, then the malicious script will be injected)"
			},
			context_menu_pageexpand_start: {
				message: "Start PageExpand"
			},
			context_menu_pageexpand_execute_fastest: {
				message: "Execute PageExpand (fastest)"
			},
			context_menu_pageexpand_abort: {
				message: "Abort PageExpand"
			},
			context_menu_pageexpand_debug: {
				message: "PageExpand Debug"
			}
		},
		zh: {
			extension_name: {
				message: "PageExpand"
			},
			extension_description: {
				message: "下载所有图片、图片缩放、扩展缩略图以及音频和视频、展开短网址、从文本生成链接、覆盖引用站点、扩展BBS,等等..."
			},
			page_expand_config: {
				message: "PageExpand 设置"
			},
			menu_setting_standard: {
				message: "标准设置"
			},
			menu_setting_standard_filter_url: {
				message: "通过 URL 限制操作"
			},
			menu_setting_standard_filter_url_combo_box_item_deny: {
				message: "只在指定的地址不要操作。(否则它会在所有地址工作)"
			},
			menu_setting_standard_filter_url_combo_box_item_allow: {
				message: "只在指定的地址操作。(否则,所有地址都不工作。)"
			},
			menu_setting_standard_filter_url_hint: {
				message: "URL 描述。可以使用星号。可以指定多行。"
			},
			menu_setting_standard_check_box_container: {
				message: "标准设置"
			},
			menu_setting_standard_enable_icon_address_bar: {
				message: "在地址栏中显示图标。"
			},
			menu_setting_standard_enable_context_menu: {
				message: "显示上下文菜单。"
			},
			menu_setting_standard_enable_startup: {
				message: "加载完成时开始操作。"
			},
			menu_setting_standard_enable_debug_mode: {
				message: "在调试模式下运行。"
			},
			menu_setting_standard_enable_output_log: {
				message: "输出到控制台日志。(调试)"
			},
			menu_setting_standard_execute_queue: {
				message: "执行队列设置 (通常情况下,无需更改)"
			},
			menu_setting_standard_execute_queue_time_sleep: {
				message: "睡眠时间 (毫秒)"
			},
			menu_setting_standard_execute_queue_time_occupancy: {
				message: "最大的 CPU 占用时间 (毫秒)"
			},
			menu_setting_standard_execute_queue_hint: {
				message: "当最大的 CPU 占用时间较大,响应操作较差,该脚本将运行得更快。如果睡眠时间很短,CPU 利用率较高,该脚本将运行得更快。"
			},
			menu_setting_standard_touch: {
				message: "触摸操作设置"
			},
			menu_setting_standard_enable_input_touch: {
				message: "启用触摸操作。"
			},
			menu_setting_standard_enable_double_touch_assist: {
				message: "显示双触摸协助。"
			},
			menu_setting_standard_command: {
				message: "执行菜单 (移动)"
			},
			menu_setting_standard_command_execute_button: {
				message: "执行"
			},
			menu_setting_standard_command_execute_dialog: {
				message: "执行菜单"
			},
			menu_setting_standard_command_execute_dialog_tab_list: {
				message: "选择标签"
			},
			menu_setting_standard_command_execute_dialog_command_list: {
				message: "选择命令"
			},
			menu_setting_standard_command_execute_dialog_confirm: {
				message: "确定要执行吗?"
			},
			menu_setting_standard_export_import: {
				message: "设置导出/导入"
			},
			menu_setting_standard_export_button: {
				message: "导出"
			},
			menu_setting_standard_import_button: {
				message: "导入"
			},
			menu_setting_standard_export_dialog: {
				message: "导出设置"
			},
			menu_setting_standard_export_dialog_export: {
				message: "导出"
			},
			menu_setting_standard_export_dialog_export_hint: {
				message: "请复制文本区域的文本。"
			},
			menu_setting_standard_import_dialog: {
				message: "导入设置"
			},
			menu_setting_standard_import_dialog_explanation: {
				message: "关于导入的信息"
			},
			menu_setting_standard_import_dialog_explanation_0: {
				message: "当前的所有设置都将丢失。"
			},
			menu_setting_standard_import_dialog_explanation_1: {
				message: "建议你使用导出功能进行备份。"
			},
			menu_setting_standard_import_dialog_explanation_2: {
				message: "请注意,它不包含恶意代码。"
			},
			menu_setting_standard_import_dialog_import: {
				message: "导入"
			},
			menu_setting_standard_import_dialog_import_hint: {
				message: "请粘贴从导出处输出的文本。"
			},
			menu_setting_standard_import_dialog_confirm: {
				message: "确定要导入?"
			},
			menu_setting_standard_import_alert: {
				message: "导入的结果"
			},
			menu_setting_standard_import_alert_success: {
				message: "导入已经完成。"
			},
			menu_setting_standard_import_alert_failure: {
				message: "导入失败!"
			},
			menu_setting_standard_storage_sync: {
				message: "同步存储"
			},
			menu_setting_standard_storage_sync_load_button: {
				message: "加载"
			},
			menu_setting_standard_storage_sync_save_button: {
				message: "保存"
			},
			menu_setting_standard_storage_sync_delete_button: {
				message: "删除"
			},
			menu_setting_standard_storage_sync_load_dialog: {
				message: "从同步存储加载"
			},
			menu_setting_standard_storage_sync_load_dialog_explanation: {
				message: "关于从同步存储加载的信息"
			},
			menu_setting_standard_storage_sync_load_dialog_explanation_0: {
				message: "从同步存储加载数据,应用到 PageExpand 设置。"
			},
			menu_setting_standard_storage_sync_load_dialog_explanation_1: {
				message: "当前的所有设置都将丢失。"
			},
			menu_setting_standard_storage_sync_load_dialog_explanation_2: {
				message: "建议你使用导出功能进行备份"
			},
			menu_setting_standard_storage_sync_load_dialog_confirm: {
				message: "确定从同步存储加载?"
			},
			menu_setting_standard_storage_sync_load_alert: {
				message: "从同步存储加载的结果"
			},
			menu_setting_standard_storage_sync_load_alert_success: {
				message: "从同步存储加载成功。"
			},
			menu_setting_standard_storage_sync_load_alert_failure: {
				message: "从同步存储加载失败!"
			},
			menu_setting_standard_storage_sync_save_dialog: {
				message: "保存到同步存储"
			},
			menu_setting_standard_storage_sync_save_dialog_explanation: {
				message: "关于保存到同步存储的信息"
			},
			menu_setting_standard_storage_sync_save_dialog_explanation_0: {
				message: "将当前设置保存到同步存储。"
			},
			menu_setting_standard_storage_sync_save_dialog_explanation_1: {
				message: "需要启用浏览器的同步功能。"
			},
			menu_setting_standard_storage_sync_save_dialog_explanation_2: {
				message: "有大小限制。如果数据太大,会失败。"
			},
			menu_setting_standard_storage_sync_save_dialog_confirm: {
				message: "确定要保存到同步存储?"
			},
			menu_setting_standard_storage_sync_save_alert: {
				message: "保存到同步存储的结果"
			},
			menu_setting_standard_storage_sync_save_alert_success: {
				message: "保存到同步存储成功。"
			},
			menu_setting_standard_storage_sync_save_alert_failure: {
				message: "保存到同步存储失败!"
			},
			menu_setting_standard_storage_sync_delete_dialog: {
				message: "从同步存储删除"
			},
			menu_setting_standard_storage_sync_delete_dialog_explanation: {
				message: "关于从同步存储区删除的信息"
			},
			menu_setting_standard_storage_sync_delete_dialog_explanation_0: {
				message: "删除同步存储中存储的设置数据。"
			},
			menu_setting_standard_storage_sync_delete_dialog_confirm: {
				message: "确定要从同步存储删除吗?"
			},
			menu_setting_standard_storage_sync_delete_alert: {
				message: "关于从同步存储删除的结果"
			},
			menu_setting_standard_storage_sync_delete_alert_success: {
				message: "从同步存储删除成功。"
			},
			menu_setting_standard_storage_sync_delete_alert_failure: {
				message: "从同步存储删除失败!"
			},
			menu_setting_standard_reset: {
				message: "设置初始化"
			},
			menu_setting_standard_reset_button: {
				message: "删除所有的设置,返回到初始状态。"
			},
			menu_setting_standard_reset_dialog: {
				message: "设置初始化"
			},
			menu_setting_standard_reset_dialog_explanation: {
				message: "关于初始化的信息"
			},
			menu_setting_standard_reset_dialog_explanation_0: {
				message: "将所有设置都返回到它们的默认状态。"
			},
			menu_setting_standard_reset_dialog_explanation_1: {
				message: "当前的所有设置都将丢失。"
			},
			menu_setting_standard_reset_dialog_confirm: {
				message: "确定要初始化吗?"
			},
			menu_setting_standard_reset_alert: {
				message: "初始化的结果"
			},
			menu_setting_standard_reset_alert_success: {
				message: "配置初始化已完成。"
			},
			menu_setting_standard_reset_alert_failure: {
				message: "配置初始化失败!"
			},
			menu_setting_download: {
				message: "下载设置"
			},
			menu_setting_download_load: {
				message: "加载设置 (XHR)"
			},
			menu_setting_download_load_thread_max: {
				message: "同时加载的最大数目"
			},
			menu_setting_download_load_timeout: {
				message: "超时(毫秒)"
			},
			menu_setting_download_load_timeout_hint: {
				message: "如果指定为 0,超时时间没有限制。"
			},
			menu_setting_download_load_cache_for_media: {
				message: "Cache MODE (for Media)"
			},
			menu_setting_download_load_cache_for_media_hint: {
				message: "Normally, you do not need to change. Use \"fetch API\" and works when \"loading media\"."
			},
			menu_setting_expand_image_load_cache_for_media_combo_box_item_default: {
				message: "default (best)"
			},
			menu_setting_expand_image_load_cache_for_media_combo_box_item_no_store: {
				message: "don't use cache."
			},
			menu_setting_expand_image_load_cache_for_media_combo_box_item_force_cache: {
				message: "If cache exists, don't request. (forever old data)"
			},
			menu_setting_download_download: {
				message: "下载设置"
			},
			menu_setting_download_download_thread_max: {
				message: "同时下载的最大数目"
			},
			menu_setting_download_download_save_file: {
				message: "Save File Name"
			},
			menu_setting_download_download_save_file_combo_box_item_simple: {
				message: "simple"
			},
			menu_setting_download_download_save_file_combo_box_item_detail: {
				message: "detail"
			},
			menu_setting_download_download_save_file_simple: {
				message: "Select File Name"
			},
			menu_setting_download_download_save_file_detail: {
				message: "Edit File Name"
			},
			menu_setting_download_download_save_file_variable: {
				message: "Variable List"
			},
			menu_setting_download_download_conflict_type: {
				message: "文件名冲突"
			},
			menu_setting_download_download_conflict_type_combo_box_item_rename: {
				message: "重命名"
			},
			menu_setting_download_download_conflict_type_combo_box_item_overwrite: {
				message: "覆盖"
			},
			menu_setting_download_batch_download: {
				message: "Batch Download Setting"
			},

			menu_setting_expand_bbs: {
				message: "BBS 设置"
			},
			menu_setting_expand_bbs_list: {
				message: "BBS 设置列表"
			},
			menu_setting_expand_bbs_list_hint: {
				message: "当你选择列表中的项目时,可以编辑较低的控制。条件脚本按照从上到下的顺序执行。可以选择多个进行编辑。灰色是预设设置。不能删除预设的设置。"
			},
			menu_setting_expand_bbs_button_add: {
				message: "添加"
			},
			menu_setting_expand_bbs_button_delete: {
				message: "删除"
			},
			menu_setting_expand_bbs_button_prio_up: {
				message: "优先级+"
			},
			menu_setting_expand_bbs_button_prio_down: {
				message: "优先级-"
			},
			menu_setting_expand_bbs_button_export: {
				message: "导出"
			},
			menu_setting_expand_bbs_button_import: {
				message: "导入"
			},
			menu_setting_expand_bbs_add_dialog: {
				message: "创建新的 BBS 设置"
			},
			menu_setting_expand_bbs_add_dialog_name: {
				message: "名称"
			},
			menu_setting_expand_bbs_add_dialog_copy_define: {
				message: "从现有的设置复制。"
			},
			menu_setting_expand_bbs_add_dialog_define_list_box_item_new: {
				message: "创建新的"
			},
			menu_setting_expand_bbs_export_dialog: {
				message: "导出 BBS 设置"
			},
			menu_setting_expand_bbs_export_dialog_export: {
				message: "导出"
			},
			menu_setting_expand_bbs_export_dialog_export_hint: {
				message: "请复制文本区域的文本。"
			},
			menu_setting_expand_bbs_import_dialog: {
				message: "导入 BBS 设置"
			},
			menu_setting_expand_bbs_import_dialog_explanation: {
				message: "关于导入的信息"
			},
			menu_setting_expand_bbs_import_dialog_explanation_0: {
				message: "预设的设置将被覆盖。将添加新的用户设置。"
			},
			menu_setting_expand_bbs_import_dialog_explanation_1: {
				message: "建议你使用导出功能进行备份。"
			},
			menu_setting_expand_bbs_import_dialog_explanation_2: {
				message: "请注意,它不包含恶意代码。"
			},
			menu_setting_expand_bbs_import_dialog_import: {
				message: "导入"
			},
			menu_setting_expand_bbs_import_dialog_import_hint: {
				message: "请粘贴从导出处输出的文本。"
			},
			menu_setting_expand_bbs_import_dialog_confirm: {
				message: "确定要导入?"
			},
			menu_setting_expand_bbs_import_alert: {
				message: "导入的结果"
			},
			menu_setting_expand_bbs_import_alert_success: {
				message: "导入已经完成。"
			},
			menu_setting_expand_bbs_import_alert_failure: {
				message: "导入失败!"
			},
			menu_setting_expand_bbs_name: {
				message: "名称"
			},
			menu_setting_expand_bbs_check_box_container: {
				message: "启用 / 禁用"
			},
			menu_setting_expand_bbs_enable_setting: {
				message: "使用此设置。"
			},
			menu_setting_expand_bbs_filter_url: {
				message: "URL 允许进行操作"
			},
			menu_setting_expand_bbs_popup_check_box_container: {
				message: "弹窗设置"
			},
			menu_setting_expand_bbs_popup_enable_animation: {
				message: "启用弹窗动画"
			},
			menu_setting_expand_bbs_popup_origin_type: {
				message: "弹窗的起始位置"
			},
			menu_setting_expand_bbs_popup_origin_type_combo_box_item_adsorb_top_bottom: {
				message: "吸附顶底"
			},
			menu_setting_expand_bbs_popup_origin_type_combo_box_item_adsorb_left_right: {
				message: "吸附左右"
			},
			menu_setting_expand_bbs_popup_position_type: {
				message: "弹窗的布置位置"
			},
			menu_setting_expand_bbs_popup_position_type_combo_box_item_absolute: {
				message: "绝对"
			},
			menu_setting_expand_bbs_popup_position_type_combo_box_item_fixed: {
				message: "固定"
			},
			menu_setting_expand_bbs_popup_percent: {
				message: "弹窗的大小"
			},
			menu_setting_expand_bbs_popup_percent_h: {
				message: "水平 % (0-100)"
			},
			menu_setting_expand_bbs_popup_percent_v: {
				message: "垂直 % (0-100)"
			},
			menu_setting_expand_bbs_popup_time: {
				message: "弹窗的时间"
			},
			menu_setting_expand_bbs_popup_time_wait_open: {
				message: "打开前的等待时间 (毫秒)"
			},
			menu_setting_expand_bbs_popup_time_wait_close: {
				message: "关闭后的等待时间 (毫秒)"
			},
			menu_setting_expand_bbs_popup_style_sheet: {
				message: "弹窗的样式表"
			},
			menu_setting_expand_bbs_script_initialize: {
				message: "初始化脚本"
			},
			menu_setting_expand_bbs_script_callback: {
				message: "回调脚本"
			},
			menu_setting_urlmap: {
				message: "URL 映射设置"
			},
			menu_setting_urlmap_list: {
				message: "URL 映射设置列表"
			},
			menu_setting_urlmap_list_hint: {
				message: "当你选择列表中的项目时,可以编辑较低的控制。按照从上到下的顺序进行比较。可以选择多个,可以进行多选编辑。灰色是预设设置。不能删除预设的设置。"
			},
			menu_setting_urlmap_button_add: {
				message: "添加"
			},
			menu_setting_urlmap_button_delete: {
				message: "删除"
			},
			menu_setting_urlmap_button_prio_up: {
				message: "优先级+"
			},
			menu_setting_urlmap_button_prio_down: {
				message: "优先级-"
			},
			menu_setting_urlmap_add_dialog: {
				message: "创建新的 URL 映射"
			},
			menu_setting_urlmap_add_dialog_name: {
				message: "名称"
			},
			menu_setting_urlmap_add_dialog_copy_define: {
				message: "从现有的设置复制。"
			},
			menu_setting_urlmap_add_dialog_define_list_box_item_new: {
				message: "创建新的"
			},
			menu_setting_urlmap_name: {
				message: "名称"
			},
			menu_setting_urlmap_check_box_container: {
				message: "启用 / 禁用"
			},
			menu_setting_urlmap_enable_setting: {
				message: "使用此设置。"
			},
			menu_setting_urlmap_filter_url: {
				message: "URL 允许进行操作"
			},
			menu_setting_urlmap_mixed_passive_content_container: {
				message: "Mixed Passive Content Security"
			},
			menu_setting_urlmap_mixed_passive_content_unsafe: {
				message: "\"http://\" as is"
			},
			menu_setting_urlmap_mixed_passive_content_safe: {
				message: "Convert to \"https://\" (Do not display if failed)"
			},
			menu_setting_urlmap_mixed_passive_content_hint: {
				message: "If content such as images and videos is displayed with a red border, It means that it is unencrypted, untrustworthy, and can be tampered with by man-in-the-middle attacks."
			},
			menu_setting_urlmap_mixed_active_content_container: {
				message: "Mixed Active Content Security"
			},
			menu_setting_urlmap_mixed_active_content_unsafe: {
				message: "\"http://\" as is"
			},
			menu_setting_urlmap_mixed_active_content_safe: {
				message: "Convert to \"https://\" (Do not display if failed)"
			},
			menu_setting_urlmap_mixed_active_content_hint: {
				message: "Browser is block \"mixed active content\" by default. To actually display, you need to unblock \"Insecure content\" from the permission settings. (dangerous)"
			},
			menu_setting_urlmap_define_button_edit: {
				message: "编辑"
			},
			menu_setting_urlmap_define_button_add: {
				message: "添加"
			},
			menu_setting_urlmap_define_button_remove: {
				message: "移除"
			},
			menu_setting_urlmap_define_button_prio_up: {
				message: "向上"
			},
			menu_setting_urlmap_define_button_prio_down: {
				message: "向下"
			},
			menu_setting_urlmap_define_combo_box_item_no_use: {
				message: "不使用定义"
			},
			menu_setting_define_multi_select_add_dialog: {
				message: "添加定义"
			},
			menu_setting_define_multi_select_add_dialog_list: {
				message: "选择要添加的定义。"
			},
			menu_setting_access_block: {
				message: "拦截访问定义"
			},
			menu_setting_access_block_filter_url: {
				message: "URL 拦截访问"
			},
			menu_setting_replacement_to_element: {
				message: "替换元素定义"
			},
			menu_setting_replacement_to_element_script: {
				message: "回调脚本"
			},
			menu_setting_replacement_to_text: {
				message: "替换文本定义"
			},
			menu_setting_replacement_to_text_script: {
				message: "回调脚本"
			},
			menu_setting_replacement_to_anchor: {
				message: "替换锚点定义"
			},
			menu_setting_replacement_to_anchor_script: {
				message: "回调脚本"
			},
			menu_setting_replacement_to_link: {
				message: "替换链接定义"
			},
			menu_setting_replacement_to_link_filter_list: {
				message: "筛选器列表"
			},
			menu_setting_replacement_to_link_filter_name: {
				message: "筛选器名称"
			},
			menu_setting_replacement_to_link_filter: {
				message: "筛选器设置"
			},
			menu_setting_replacement_to_link_filter_filter_url: {
				message: "链接 URL,允许进行操作"
			},
			menu_setting_replacement_to_link_check_box_container: {
				message: "设置链接"
			},
			menu_setting_replacement_to_link_enable_reflect_to_anchor: {
				message: "反映到 HTML 锚点元素 href"
			},
			menu_setting_replacement_to_link_enable_cache: {
				message: "缓存回调脚本的结果"
			},
			menu_setting_replacement_to_link_filter_script: {
				message: "回调脚本"
			},
			menu_setting_replacement_to_referer: {
				message: "替换 Referer 定义"
			},
			menu_setting_replacement_to_referer_filter_list: {
				message: "筛选器列表"
			},
			menu_setting_replacement_to_referer_filter_name: {
				message: "筛选器名称"
			},
			menu_setting_replacement_to_referer_filter: {
				message: "筛选器设置"
			},
			menu_setting_replacement_to_referer_filter_filter_url: {
				message: "链接 URL,允许进行操作"
			},
			menu_setting_replacement_to_referer_filter_send_type: {
				message: "基本 Referer"
			},
			menu_setting_replacement_to_referer_filter_send_type_combo_box_item: {
				message: "基本 Referer 值"
			},
			menu_setting_replacement_to_referer_filter_send_type_combo_box_item_default: {
				message: "默认"
			},
			menu_setting_replacement_to_referer_filter_send_type_combo_box_item_current_url: {
				message: "当前 url"
			},
			menu_setting_replacement_to_referer_filter_send_type_combo_box_item_link_url: {
				message: "链接 url"
			},
			menu_setting_replacement_to_referer_filter_send_type_combo_box_item_custom: {
				message: "自定义"
			},
			menu_setting_replacement_to_referer_filter_send_custom: {
				message: "自定义字符串"
			},
			menu_setting_replacement_to_referer_filter_send_regexp: {
				message: "通过正则表达式替换"
			},
			menu_setting_replacement_to_referer_filter_send_regexp_match: {
				message: "匹配条件"
			},
			menu_setting_replacement_to_referer_filter_send_regexp_replacement: {
				message: "替换字符串"
			},
			menu_setting_replacement_to_referer_filter_send_regexp_replacement_hint: {
				message: "$0...整体匹配。 $1-$9...部分匹配。 $$…美元符号转义序列。"
			},
			menu_setting_replacement_to_useragent: {
				message: "替换用户代理定义"
			},
			menu_setting_replacement_to_useragent_filter_list: {
				message: "筛选器列表"
			},
			menu_setting_replacement_to_useragent_filter_name: {
				message: "筛选器名称"
			},
			menu_setting_replacement_to_useragent_filter: {
				message: "筛选器设置"
			},
			menu_setting_replacement_to_useragent_filter_filter_url: {
				message: "链接 URL,允许进行操作"
			},
			menu_setting_replacement_to_useragent_filter_send: {
				message: "基本用户代理"
			},
			menu_setting_replacement_to_useragent_filter_send_custom: {
				message: "自定义字符串"
			},
			menu_setting_make_link_to_text: {
				message: "文本转链接定义"
			},
			menu_setting_make_link_to_text_script: {
				message: "回调脚本"
			},
			menu_setting_expand_short_url: {
				message: "扩展短 Url 定义"
			},
			menu_setting_expand_short_url_filter_url: {
				message: "URL 允许进行操作"
			},
			menu_setting_expand_text: {
				message: "扩展文本定义"
			},
			menu_setting_expand_text_inline: {
				message: "显示内联设置"
			},
			menu_setting_expand_text_inline_check_box_container: {
				message: "显示内联设置"
			},
			menu_setting_expand_text_inline_disable_same_text: {
				message: "如果 URL 相同,不扩展。"
			},
			menu_setting_expand_text_inline_script_allow: {
				message: "从链接显示内联的条件"
			},
			menu_setting_expand_text_inline_script_insert: {
				message: "文本插入"
			},
			menu_setting_expand_image: {
				message: "扩展图片定义"
			},
			menu_setting_expand_image_thumbnail: {
				message: "显示缩略图设置"
			},
			menu_setting_expand_image_thumbnail_enable_check_box_container: {
				message: "启用 / 禁用"
			},
			menu_setting_expand_image_thumbnail_enable_thumbnail: {
				message: "显示缩略图。"
			},
			menu_setting_expand_image_thumbnail_check_box_container: {
				message: "显示缩略图设置"
			},
			menu_setting_expand_image_thumbnail_enable_popup_mouseover: {
				message: "如果你的鼠标悬停在缩略图上,弹出窗口显示。"
			},
			menu_setting_expand_image_thumbnail_disable_same_thumbnail_image: {
				message: "如果 URL 相同,不扩展。"
			},
			menu_setting_expand_image_thumbnail_size: {
				message: "缩略图的大小"
			},
			menu_setting_expand_image_thumbnail_size_min: {
				message: "Minimum allowed size (pixel)"
			},
			menu_setting_expand_image_thumbnail_size_scale: {
				message: "比例 (%)"
			},
			menu_setting_expand_image_thumbnail_size_max: {
				message: "Maximum allowed size (pixel)"
			},
			menu_setting_expand_image_thumbnail_script_allow: {
				message: "从链接显示缩略图的条件"
			},
			menu_setting_expand_image_thumbnail_script_insert: {
				message: "缩略图插入"
			},
			menu_setting_expand_image_popup: {
				message: "显示弹窗设置"
			},
			menu_setting_expand_image_popup_enable_check_box_container: {
				message: "启用 / 禁用"
			},
			menu_setting_expand_image_popup_enable_popup_mouseover: {
				message: "如果你的鼠标悬停在锚点上,弹出窗口显示。"
			},
			menu_setting_expand_image_popup_check_box_container: {
				message: "动画"
			},
			menu_setting_expand_image_popup_enable_animation_scale: {
				message: "启用规模淡入淡出动画"
			},
			menu_setting_expand_image_popup_enable_animation_alpha: {
				message: "启用透明淡入淡出动画"
			},
			menu_setting_expand_image_popup_origin_type: {
				message: "弹窗的起始位置"
			},
			menu_setting_expand_image_popup_origin_type_combo_box_item_center: {
				message: "中央"
			},
			menu_setting_expand_image_popup_origin_type_combo_box_item_upper_left: {
				message: "左上角"
			},
			menu_setting_expand_image_popup_origin_type_combo_box_item_upper_right: {
				message: "右上角"
			},
			menu_setting_expand_image_popup_origin_type_combo_box_item_client_center: {
				message: "客户端中央"
			},
			menu_setting_expand_image_popup_origin_type_combo_box_item_adsorb_element: {
				message: "吸附元素"
			},
			menu_setting_expand_image_popup_origin_type_combo_box_item_adsorb_mouse: {
				message: "吸附鼠标"
			},
			menu_setting_expand_image_popup_time: {
				message: "弹窗的时间"
			},
			menu_setting_expand_image_popup_time_wait_open: {
				message: "打开前的等待时间 (毫秒)"
			},
			menu_setting_expand_image_popup_time_wait_close: {
				message: "关闭后的等待时间 (毫秒)"
			},
			menu_setting_expand_image_popup_position_type: {
				message: "弹出图片的排列位置"
			},
			menu_setting_expand_image_popup_position_type_combo_box_item_absolute: {
				message: "绝对"
			},
			menu_setting_expand_image_popup_position_type_combo_box_item_fixed: {
				message: "固定"
			},
			menu_setting_expand_image_popup_size: {
				message: "弹窗的大小"
			},
			menu_setting_expand_image_popup_size_scale: {
				message: "比例 (%)"
			},
			menu_setting_expand_image_popup_script_allow: {
				message: "从链接显示弹窗的条件"
			},
			menu_setting_expand_image_reduced_image: {
				message: "小图片设置"
			},
			menu_setting_expand_image_reduced_image_check_box_container: {
				message: "启用 / 禁用"
			},
			menu_setting_expand_image_popup_enable_popup: {
				message: "如果你的鼠标悬停在小图片上,弹出窗口显示。"
			},
			menu_setting_expand_image_reduced_image_allow_slcale_less_then: {
				message: "显示弹出窗口的条件"
			},
			menu_setting_expand_image_reduced_image_allow_slcale_less_then_text: {
				message: "如果放大倍数小于"
			},
			menu_setting_expand_image_load: {
				message: "加载图片设置"
			},
			menu_setting_expand_image_load_check_box_container: {
				message: "加载图片设置"
			},
			menu_setting_expand_image_load_enable_notify: {
				message: "显示进度。"
			},
			menu_setting_expand_image_load_start_type: {
				message: "如何加载图片"
			},
			menu_setting_expand_image_load_start_type_preload: {
				message: "预加载"
			},
			menu_setting_expand_image_load_start_type_scroll: {
				message: "滚动结合"
			},
			menu_setting_expand_image_load_src_type: {
				message: "Image Source Format"
			},
			menu_setting_expand_image_load_src_type_combo_box_item_url: {
				message: "URL (except mixed content)"
			},
			menu_setting_expand_image_load_src_type_combo_box_item_blob_url: {
				message: "Blob URL (all)"
			},
			menu_setting_expand_image_load_decode: {
				message: "Decode Image Setting"
			},
			menu_setting_expand_image_load_decode_combo_box_item_auto: {
				message: "Browser default"
			},
			menu_setting_expand_image_load_decode_combo_box_item_pre_decode: {
				message: "Pre-decode the all"
			},
			menu_setting_expand_image_load_unload_check_box_container: {
				message: "卸载图片设置"
			},
			menu_setting_expand_image_load_enable_unload: {
				message: "启用卸载图片"
			},
			menu_setting_expand_image_load_unload: {
				message: "卸载图片的条件"
			},
			menu_setting_expand_image_load_allow_unload_more_then_text: {
				message: "如果加载超过指定的 MBytes,释放旧的图片。"
			},
			menu_setting_expand_sound: {
				message: "扩展声音定义"
			},
			menu_setting_expand_sound_inline: {
				message: "显示内联设置"
			},
			menu_setting_expand_sound_inline_check_box_container: {
				message: "显示内联设置"
			},
			menu_setting_expand_sound_inline_disable_same_text: {
				message: "如果 URL 相同,不扩展。"
			},
			menu_setting_expand_sound_inline_sound_max: {
				message: "同时显示的最大数目"
			},
			menu_setting_expand_sound_inline_script_allow: {
				message: "从链接显示内联的条件"
			},
			menu_setting_expand_sound_inline_script_insert: {
				message: "音频插入"
			},
			menu_setting_expand_sound_inline_element: {
				message: "HTML 音频元素设置"
			},
			menu_setting_expand_sound_inline_element_script_allow: {
				message: "HTML 音频元素显示的条件"
			},
			menu_setting_expand_sound_inline_element_src_type: {
				message: "Audio Source Format"
			},
			menu_setting_expand_sound_inline_element_src_type_combo_box_item_url: {
				message: "URL (streaming)"
			},
			menu_setting_expand_sound_inline_element_src_type_combo_box_item_blob_url: {
				message: "Blob URL (full)"
			},
			menu_setting_expand_sound_inline_soundcloud: {
				message: "soundcloud.com 设置"
			},
			menu_setting_expand_sound_inline_soundcloud_check_box_container: {
				message: "soundcloud.com 设置"
			},
			menu_setting_expand_sound_inline_soundcloud_visible_player_html5: {
				message: "启用播放器 (HTML5)"
			},
			menu_setting_expand_sound_inline_mixcloud: {
				message: "www.mixcloud.com 设置"
			},
			menu_setting_expand_sound_inline_mixcloud_check_box_container: {
				message: "www.mixcloud.com 设置"
			},
			menu_setting_expand_sound_inline_mixcloud_visible_player: {
				message: "启用播放器"
			},
			menu_setting_expand_video: {
				message: "扩展视频定义"
			},
			menu_setting_expand_video_inline: {
				message: "显示内联设置"
			},
			menu_setting_expand_video_inline_check_box_container: {
				message: "显示内联设置"
			},
			menu_setting_expand_video_inline_disable_same_video: {
				message: "如果 URL 相同,不扩展。"
			},
			menu_setting_expand_video_inline_video_max: {
				message: "同时显示的最大数目"
			},
			menu_setting_expand_video_inline_size: {
				message: "Inline Video Size"
			},
			menu_setting_expand_video_inline_width_max: {
				message: "Maximum allowed width (pixel)"
			},
			menu_setting_expand_video_inline_height_max: {
				message: "Maximum allowed height (pixel)"
			},
			menu_setting_expand_video_inline_script_allow: {
				message: "从链接显示内联的条件"
			},
			menu_setting_expand_video_inline_script_insert: {
				message: "元素插入"
			},
			menu_setting_expand_video_inline_element: {
				message: "HTML 视频元素设置"
			},
			menu_setting_expand_video_inline_element_script_allow: {
				message: " HTML 视频元素显示的条件"
			},
			menu_setting_expand_video_inline_element_src_type: {
				message: "Video Source Format"
			},
			menu_setting_expand_video_inline_element_src_type_combo_box_item_url: {
				message: "URL (streaming)"
			},
			menu_setting_expand_video_inline_element_src_type_combo_box_item_blob_url: {
				message: "Blob URL (full)"
			},
			menu_setting_expand_video_inline_youtube: {
				message: "www.youtube.com 设置"
			},
			menu_setting_expand_video_inline_youtube_check_box_container: {
				message: "www.youtube.com 设置"
			},
			menu_setting_expand_video_inline_youtube_visible_video: {
				message: "启用视频"
			},
			menu_setting_expand_video_inline_nicovideo: {
				message: "www.nicovideo.jp 设置"
			},
			menu_setting_expand_video_inline_nicovideo_check_box_container: {
				message: "www.nicovideo.jp 设置"
			},
			menu_setting_expand_video_inline_nicovideo_visible_video: {
				message: "启用视频"
			},
			menu_setting_expand_video_inline_dailymotion: {
				message: "www.dailymotion.com 设置"
			},
			menu_setting_expand_video_inline_dailymotion_check_box_container: {
				message: "www.dailymotion.com 设置"
			},
			menu_setting_expand_video_inline_dailymotion_visible_video: {
				message: "启用视频"
			},
			menu_setting_expand_video_inline_video: {
				message: "vimeo.com 设置"
			},
			menu_setting_expand_video_inline_video_check_box_container: {
				message: "vimeo.com 设置"
			},
			menu_setting_expand_video_inline_video_visible_video: {
				message: "启用视频"
			},
			menu_setting_expand_iframe: {
				message: "扩展 Iframe 定义"
			},
			menu_setting_expand_iframe_inline: {
				message: "显示内联设置"
			},
			menu_setting_expand_iframe_inline_check_box_container: {
				message: "显示内联设置"
			},
			menu_setting_expand_iframe_inline_disable_same_iframe: {
				message: "如果 URL 相同,不扩展。"
			},
			menu_setting_expand_iframe_inline_script_allow: {
				message: "从链接显示内联的条件"
			},
			menu_setting_expand_iframe_inline_script_insert: {
				message: "HTML 内嵌框架元素插入"
			},
			menu_setting_style_sheet: {
				message: "样式表定义"
			},
			menu_setting_style_sheet_expand_text: {
				message: "扩展文本样式表"
			},
			menu_setting_style_sheet_expand_text_element: {
				message: "HTML 文本区域元素设置"
			},
			menu_setting_style_sheet_expand_text_element_inline: {
				message: "文本内联显示"
			},
			menu_setting_style_sheet_expand_text_element_inline_unsafe: {
				message: "文本内联显示 (unsafe)"
			},
			menu_setting_style_sheet_expand_image: {
				message: "扩展图片样式表"
			},
			menu_setting_style_sheet_expand_image_element: {
				message: "HTML 图片元素设置"
			},
			menu_setting_style_sheet_expand_image_element_inline: {
				message: "图片缩略图显示"
			},
			menu_setting_style_sheet_expand_image_element_inline_unsafe: {
				message: "图片缩略图显示 (unsafe)"
			},
			menu_setting_style_sheet_expand_image_element_popup: {
				message: "图片弹窗显示"
			},
			menu_setting_style_sheet_expand_image_element_popup_unsafe: {
				message: "图片弹窗显示 (unsafe)"
			},
			menu_setting_style_sheet_expand_sound: {
				message: "扩展声音样式表"
			},
			menu_setting_style_sheet_expand_sound_element: {
				message: "HTML 音频元素设置"
			},
			menu_setting_style_sheet_expand_sound_element_inline_audio: {
				message: "音频内联显示"
			},
			menu_setting_style_sheet_expand_sound_element_inline_audio_unsafe: {
				message: "音频内联显示 (unsafe)"
			},
			menu_setting_style_sheet_expand_sound_soundcloud: {
				message: "soundcloud.com 设置"
			},
			menu_setting_style_sheet_expand_sound_soundcloud_inline_player_html5: {
				message: "播放器 (HTML5) 内联显示"
			},
			menu_setting_style_sheet_expand_sound_mixcloud: {
				message: "www.mixcloud.com 设置"
			},
			menu_setting_style_sheet_expand_sound_mixcloud_inline_player: {
				message: "播放器内联显示"
			},
			menu_setting_style_sheet_expand_video: {
				message: "扩展视频样式表"
			},
			menu_setting_style_sheet_expand_video_element: {
				message: "HTML 视频元素设置"
			},
			menu_setting_style_sheet_expand_video_element_inline_video: {
				message: "视频内联显示"
			},
			menu_setting_style_sheet_expand_video_element_inline_video_unsafe: {
				message: "视频内联显示 (unsafe)"
			},
			menu_setting_style_sheet_expand_video_youtube: {
				message: "www.youtube.com 设置"
			},
			menu_setting_style_sheet_expand_video_youtube_inline_video: {
				message: "视频内联显示"
			},
			menu_setting_style_sheet_expand_video_nicovideo: {
				message: "www.nicovideo.jp 设置"
			},
			menu_setting_style_sheet_expand_video_nicovideo_inline_video: {
				message: "视频内联显示"
			},
			menu_setting_style_sheet_expand_video_dailymotion: {
				message: "www.dailymotion.com 设置"
			},
			menu_setting_style_sheet_expand_video_dailymotion_inline_video: {
				message: "视频内联显示"
			},
			menu_setting_style_sheet_expand_video_vimeo: {
				message: "vimeo.com 设置"
			},
			menu_setting_style_sheet_expand_video_vimeo_inline_video: {
				message: "视频内联显示"
			},
			menu_setting_style_sheet_expand_iframe: {
				message: "扩展内嵌框架样式表"
			},
			menu_setting_style_sheet_expand_iframe_element: {
				message: "HTML 内嵌框架样设置"
			},
			menu_setting_style_sheet_expand_iframe_element_inline: {
				message: "内嵌框架样内联显示"
			},
			menu_setting_style_sheet_expand_iframe_element_inline_unsafe: {
				message: "内嵌框架样内联显示 (unsafe)"
			},
			menu_setting_experimental: {
				message: "实验定义"
			},
			menu_setting_experimental_revise_scroll: {
				message: "修改滚动设置"
			},
			menu_setting_experimental_revise_scroll_check_box_container: {
				message: "修改滚动设置"
			},
			menu_setting_experimental_revise_scroll_enable: {
				message: "启用"
			},
			menu_setting_experimental_revise_scroll_threshold_vertical: {
				message: "垂直阈值 ( 0 [顶部] ~ 100 [底部] )"
			},
			menu_setting_language: {
				message: "LANGUAGE (语言设置)"
			},
			menu_credit: {
				message: "致谢"
			},
			menu_credit_info_version: {
				message: "版本"
			},
			menu_credit_info_copyright: {
				message: "版权"
			},
			menu_credit_info_translator: {
				message: "翻译者"
			},
			menu_setting_define_list: {
				message: "定义列表"
			},
			menu_setting_define_list_hint: {
				message: "当你选择列表中的项目时,可以编辑较低的控制。按照从上到下的顺序进行比较。可以选择多个,可以进行多选编辑。灰色是预设设置。不能删除预设的设置。"
			},
			menu_setting_define_button_add: {
				message: "添加"
			},
			menu_setting_define_button_delete: {
				message: "删除"
			},
			menu_setting_define_button_move_up: {
				message: "上移"
			},
			menu_setting_define_button_move_down: {
				message: "下移"
			},
			menu_setting_define_button_export: {
				message: "导出"
			},
			menu_setting_define_button_import: {
				message: "导入"
			},
			menu_setting_define_add_dialog: {
				message: "创建新定义"
			},
			menu_setting_define_add_dialog_name: {
				message: "名称"
			},
			menu_setting_define_add_dialog_copy_define: {
				message: "从现有定义复制"
			},
			menu_setting_define_add_dialog_define_list_box_item_new: {
				message: "创建新的"
			},
			menu_setting_define_delete_dialog: {
				message: "删除定义"
			},
			menu_setting_define_delete_dialog_name: {
				message: "定义名称 (被删除)"
			},
			menu_setting_define_delete_dialog_change_define: {
				message: "替代选择"
			},
			menu_setting_define_delete_dialog_define_list_box_item_no_use: {
				message: "不使用定义"
			},
			menu_setting_define_name: {
				message: "定义名称"
			},
			menu_setting_define_export_dialog: {
				message: "导出定义"
			},
			menu_setting_define_export_dialog_export: {
				message: "导出"
			},
			menu_setting_define_export_dialog_export_hint: {
				message: "请复制文本区域的文本。"
			},
			menu_setting_define_import_dialog: {
				message: "导入定义"
			},
			menu_setting_define_import_dialog_explanation: {
				message: "关于导入的信息"
			},
			menu_setting_define_import_dialog_explanation_0: {
				message: "预设的设置将被覆盖。将添加新的用户设置。"
			},
			menu_setting_define_import_dialog_explanation_1: {
				message: "建议你使用导出功能进行备份。"
			},
			menu_setting_define_import_dialog_explanation_2: {
				message: "请注意,它不包含恶意代码。"
			},
			menu_setting_define_import_dialog_import: {
				message: "导入"
			},
			menu_setting_define_import_dialog_import_hint: {
				message: "请粘贴从导出处输出的文本。"
			},
			menu_setting_define_import_dialog_confirm: {
				message: "确定要导入?"
			},
			menu_setting_define_import_alert: {
				message: "导入的结果"
			},
			menu_setting_define_import_alert_success: {
				message: "导入已经完成。"
			},
			menu_setting_define_import_alert_failure: {
				message: "导入失败!"
			},
			menu_setting_define_wildcard_detail: {
				message: "关于通配符的信息"
			},
			menu_setting_define_wildcard_detail_0: {
				message: "\"通配符\" 是总在最后执行。"
			},
			menu_setting_define_wildcard_detail_1: {
				message: "\"通配符\" 适用于所有通信。"
			},
			menu_setting_define_wildcard_detail_2: {
				message: "\"通配符\" 不是的定义。不能用在 \"URL 映射设置\"。"
			},
			menu_setting_filter_list: {
				message: "筛选器列表"
			},
			menu_setting_filter_list_hint: {
				message: "当你选择列表中的项目时,可以编辑较低的控制。按照从上到下的顺序进行比较。可以选择多个,可以进行多选编辑。"
			},
			menu_setting_filter_button_add: {
				message: "添加"
			},
			menu_setting_filter_button_delete: {
				message: "删除"
			},
			menu_setting_filter_button_prio_up: {
				message: "优先级+"
			},
			menu_setting_filter_button_prio_down: {
				message: "优先级-"
			},
			menu_setting_filter_button_export: {
				message: "导出"
			},
			menu_setting_filter_button_import: {
				message: "导入"
			},
			menu_setting_filter_add_dialog: {
				message: "创建新的筛选器设置"
			},
			menu_setting_filter_add_dialog_name: {
				message: "名称"
			},
			menu_setting_filter_add_dialog_copy_define: {
				message: "从现有的设置复制。"
			},
			menu_setting_filter_add_dialog_define_list_box_item_new: {
				message: "创建新的"
			},
			menu_setting_filter_export_dialog: {
				message: "导出过滤器"
			},
			menu_setting_filter_export_dialog_export: {
				message: "导出"
			},
			menu_setting_filter_export_dialog_export_hint: {
				message: "请复制文本区域的文本。"
			},
			menu_setting_filter_import_dialog: {
				message: "导入过滤器"
			},
			menu_setting_filter_import_dialog_explanation: {
				message: "关于导入的信息"
			},
			menu_setting_filter_import_dialog_explanation_0: {
				message: "导入的数据被添加到列表的最后。"
			},
			menu_setting_filter_import_dialog_explanation_1: {
				message: "建议你使用导出功能进行备份"
			},
			menu_setting_filter_import_dialog_explanation_2: {
				message: "请注意,它不包含恶意代码。"
			},
			menu_setting_filter_import_dialog_import: {
				message: "导入"
			},
			menu_setting_filter_import_dialog_import_hint: {
				message: "请粘贴从导出处输出的文本。"
			},
			menu_setting_filter_import_dialog_confirm: {
				message: "确定要导入?"
			},
			menu_setting_filter_import_alert: {
				message: "导入的结果"
			},
			menu_setting_filter_import_alert_success: {
				message: "导入已经完成。"
			},
			menu_setting_filter_import_alert_failure: {
				message: "导入失败!"
			},
			menu_button_ok: {
				message: "确定"
			},
			menu_button_yes: {
				message: "是"
			},
			menu_button_no: {
				message: "取消"
			},
			menu_script_obj_editer_edit_script: {
				message: "Edit Script"
			},
			menu_script_obj_editer_delete_script: {
				message: "Delete Script (return to default)"
			},
			menu_scriptarea_hint: {
				message: "用来描述到数组的匿名函数。请注意,它不包含恶意代码。"
			},
			menu_scriptarea_unsupport: {
				message: "UserScript doesn't work now. 😥"
			},
			menu_text_regexp_hint: {
				message: "正则表达式字符串。 [标记] g...重复。 i...不包含。 case-敏感。"
			},
			menu_regexp_list_button_add: {
				message: "添加"
			},
			menu_regexp_list_button_delete: {
				message: "删除"
			},
			menu_regexp_list_button_move_up: {
				message: "上移"
			},
			menu_regexp_list_button_move_down: {
				message: "下移"
			},
			menu_setting_url_edit_container_combo_box_item_asterisk: {
				message: "星号格式"
			},
			menu_setting_url_edit_container_combo_box_item_regexp: {
				message: "正则表达式格式"
			},
			menu_setting_url_edit_container_type_asterisk_hint: {
				message: "介绍 URL。可以使用一个星号。可以指定多行。"
			},
			page_expand_popup_menu: {
				message: "PageExpand 菜单"
			},
			context_menu_pageexpand_config: {
				message: "PageExpand 设置"
			},
			context_menu_batch_download_image: {
				message: "批量下载 (图片)"
			},
			context_menu_batch_download_user: {
				message: "批量下载 (用户)"
			},
			context_menu_pageexpand_open_bbs_board: {
				message: "Open BBS Board"
			},
			context_menu_pageexpand_open_bbs_board_run_confirm: {
				message: "Do you want to run the BBS Board in this page?"
			},
			context_menu_pageexpand_config_current_page: {
				message: "PageExpand 设置当前页"
			},
			context_menu_pageexpand_config_current_bbs: {
				message: "PageExpand 设置当前 BBS"
			},
			context_menu_pageexpand_config_current_page_confirm: {
				message: "PageExpand 设置将仅在以下页面中运行。 \n(目的是防止被注入恶意脚本)\n\n你想打开以下页面吗?\n"
			},
			context_menu_pageexpand_config_auto_run_confirm: {
				message: "你想要在此页面中运行 PageExpand 设置吗?\n(如果此页面被污染,那么恶意脚本将被注入!)"
			},
			context_menu_pageexpand_start: {
				message: "开始 PageExpand"
			},
			context_menu_pageexpand_execute_fastest: {
				message: "执行 PageExpand (最快)"
			},
			context_menu_pageexpand_abort: {
				message: "关于 PageExpand"
			},
			context_menu_pageexpand_debug: {
				message: "PageExpand 调试"
			}
		}
	};


	// -
	// タイマー
	// -
	function Timer(delay,repeatCount){
		var _this = this;

		// -
		// 開放
		// -
		_this.release = function(){
			_this.stop();

			if(_event_handler_release){
				_event_handler_release.release();
				_event_handler_release = null;
			}
		};

		// -
		// 時間隔実行
		// -
		_this.ontimer = function(){};

		// -
		// 完了
		// -
		_this.oncomplete = function(){};

		// -
		// 開始
		// -
		_this.start = function(){
			if(_time_handle === null){
				_this.running = true;

				_time_handle = setInterval(function (){
					execute();
				},_this.delay);

				_event_handler_release = page_expand_event_dispatcher.createEventHandler("release");
				_event_handler_release.setFunction(_this.release);
			}
		};

		// -
		// 停止
		// -
		_this.stop = function(){
			if(_time_handle !== null){
				clearInterval(_time_handle);
				_time_handle = null;
				_this.running = false;
			}
		};

		// -
		// リセット
		// -
		_this.reset = function(){
			_this.currentCount = 0;
		};

		// -
		// 実行(内部用)
		// -
		function execute (){
			_this.currentCount ++;

			execute_queue.attachFirst(dispatch,null);

			if(_this.repeatCount === null){
			}else if(_this.currentCount >= _this.repeatCount){
				_this.stop();
			}
		}

		// -
		// 発行(内部用)
		// -
		function dispatch (){
			if(!_event_handler_release) return;

			if(_this.ontimer){
				_this.ontimer();
			}

			if(_this.currentCount >= _this.repeatCount){
				if(_this.oncomplete){
					_this.oncomplete();
				}
				_this.release();
			}
		}

		// -
		// プライベート変数
		// -
		var _time_handle;
		var _event_handler_release;
		var _released;

		// -
		// 初期化
		// -
		_time_handle = null;

		if(isNaN(delay)){
			_this.delay = 0;
		}else{
			_this.delay = Number(delay);
		}
		_this.currentCount = 0;
		if(isNaN(repeatCount)){
			_this.repeatCount = null;
		}else{
			_this.repeatCount = Number(repeatCount);
		}
		_this.running = false;
	}


	// -
	// UrlInfo辞書
	// -
	function UrlInfoDictionary(){
		var _this = this;

		// -
		// UrlInfo
		// -
		function UrlInfo(url){
			this.url = url;
			this.id = _unique_id;
			_unique_id += 1;
			_url_count += 1;
		}
		UrlInfo.prototype = {
			release : function(){
				if(!this.url) return;
				var key = this.url.toLowerCase();
				delete _dictionary[key];
				delete this.url;
				this.releaseBlobURL();
				_url_count -= 1;
			},
			getId : function(){
				return this.id;
			},
			getURL : function(){
				return this.url;
			},
			analyzeRedirect : function(){
				var _this = this;
				if(this.analyze_redirect) return null;
				if(this.redirect !== undefined) return null;

				var _analyze_element = this.analyze_redirect = new Object();

				// -
				// 開放
				// -
				_analyze_element.release = function(){
					if(_analyze_element.released) return;
					_analyze_element.released = true;
					_analyze_element.event_dispatcher.release();
					delete _this.analyze_redirect;
				};

				// -
				// 調査成功
				// -
				_analyze_element.success = function(redirect){
					_this.redirect = redirect;
					_analyze_element.event_dispatcher.dispatchEvent("success",null);
					_analyze_element.release();
				};

				// -
				// 調査失敗
				// -
				_analyze_element.failure = function(e){
					_this.redirect = null;
					_analyze_element.event_dispatcher.dispatchEvent("failure",e);
					_analyze_element.release();
				};

				// -
				// 初期化
				// -
				(function(){
					_analyze_element.released = false;
					_analyze_element.event_dispatcher = new EventDispatcher();
				})();

				return _analyze_element;
			},
			getRedirect : function(callback){
				var _this = this;
				var event_handler_success = null;
				var event_handler_failure = null;

				function complete(){
					if(event_handler_success){
						event_handler_success.release();
						event_handler_success = null;
					}
					if(event_handler_failure){
						event_handler_failure.release();
						event_handler_failure = null;
					}
					callback(_this.redirect);	
				}

				var analyze_element = _this.analyze_redirect;
				if((function (){
					if(!analyze_element) return true;
					if(_this.redirect !== undefined) return true;
					return false;
				})()){
					complete();
					return;
				}

				var event_dispatcher = analyze_element.event_dispatcher;
				event_handler_success = event_dispatcher.createEventHandler("success");
				event_handler_success.setFunction(function(event){
					complete();
				});
				event_handler_failure = event_dispatcher.createEventHandler("failure");
				event_handler_failure.setFunction(function(event){
					complete();
				});
			},
			analyzeBlobURL : function(){
				var _this = this;
				if(this.analyze_blob_url) return null;
				if(this.blob_url !== undefined) return null;

				var _analyze_element = this.analyze_blob_url = new Object();

				// -
				// 開放
				// -
				_analyze_element.release = function(){
					if(_analyze_element.released) return;
					_analyze_element.released = true;
					_analyze_element.event_dispatcher.release();
					delete _this.analyze_blob_url;
				};

				// -
				// 調査成功
				// -
				_analyze_element.success = function(blob_url){
					_this.blob_url = blob_url;
					_analyze_element.event_dispatcher.dispatchEvent("success",null);
					_analyze_element.release();
				};

				// -
				// 調査失敗
				// -
				_analyze_element.failure = function(e){
					_this.blob_url = "";
					_analyze_element.event_dispatcher.dispatchEvent("failure",e);
					_analyze_element.release();
				};

				// -
				// 初期化
				// -
				(function(){
					_analyze_element.released = false;
					_analyze_element.event_dispatcher = new EventDispatcher();
				})();

				return _analyze_element;
			},
			getBlobURL : function(callback){
				var _this = this;
				var event_handler_success = null;
				var event_handler_failure = null;

				function complete(){
					if(event_handler_success){
						event_handler_success.release();
						event_handler_success = null;
					}
					if(event_handler_failure){
						event_handler_failure.release();
						event_handler_failure = null;
					}
					callback(_this.blob_url);	
				}

				var analyze_element = _this.analyze_blob_url;
				if((function (){
					if(!analyze_element) return true;
					if(_this.blob_url !== undefined) return true;
					return false;
				})()){
					complete();
					return;
				}

				var event_dispatcher = analyze_element.event_dispatcher;
				event_handler_success = event_dispatcher.createEventHandler("success");
				event_handler_success.setFunction(function(event){
					complete();
				});
				event_handler_failure = event_dispatcher.createEventHandler("failure");
				event_handler_failure.setFunction(function(event){
					complete();
				});
			},
			releaseBlobURL : function(){
				if(this.blob_url){
					BlobURLRevoke(this.blob_url);
					delete this.blob_url;
				}
			},
			getCached : function(callback){
				var _this = this;
				var event_handler_success = null;
				var event_handler_failure = null;

				function complete(){
					if(event_handler_success){
						event_handler_success.release();
						event_handler_success = null;
					}
					if(event_handler_failure){
						event_handler_failure.release();
						event_handler_failure = null;
					}
					callback(_this.cached,null);
				}

				var analyze_element = _this.analyze_cached;
				if((!analyze_element) && (_this.cached === undefined)){
					_this.analyze_cached = (function(){
						var analyze_element = new Object();

						// -
						// 開放
						// -
						analyze_element.release = function(){
							if(analyze_element.released) return;
							analyze_element.released = true;
							analyze_element.event_dispatcher.release();
							delete _this.analyze_cached;
						};

						// -
						// 調査成功
						// -
						analyze_element.success = function(){
							_this.cached = {ok:true};
							analyze_element.event_dispatcher.dispatchEvent("success",null);
							analyze_element.release();
						};

						// -
						// 調査失敗
						// -
						analyze_element.failure = function(e){
							_this.cached = {ok:false};
							analyze_element.event_dispatcher.dispatchEvent("failure",e);
							analyze_element.release();
						};

						// -
						// 初期化
						// -
						(function(){
							analyze_element.released = false;
							analyze_element.event_dispatcher = new EventDispatcher();
						})();

						return analyze_element;
					})();

					callback(_this.cached,_this.analyze_cached);
					return;
				}

				if((function (){
					if(!analyze_element) return true;
					if(_this.cached !== undefined) return true;
					return false;
				})()){
					complete();
					return;
				}

				var event_dispatcher = analyze_element.event_dispatcher;
				event_handler_success = event_dispatcher.createEventHandler("success");
				event_handler_success.setFunction(function(event){
					complete();
				});
				event_handler_failure = event_dispatcher.createEventHandler("failure");
				event_handler_failure.setFunction(function(event){
					complete();
				});

			},
			getMimeType : function(){
				return this.mimetype;
			},
			setMimeType : function(v){
				this.mimetype = v;
			},
			getExt : function(){
				return this.ext;
			},
			setExt : function(v){
				this.ext = v;
			},
			attachDone : function(v){
				if(!(this.done)) this.done = {};
				this.done[v] = true;
			},
			removeDone : function(v){
				if(!(this.done)) return;
				delete this.done[v];
			},
			getDone : function(v){
				if(!(this.done)) return false;
				return Boolean(this.done[v]);
			},
			url : "",
			id : 0,
			analyze_redirect : null,
			analyze_blob_url : null,
			analyze_cached : null,
			redirect : undefined,
			blob_url : undefined,
			cached : undefined,
			category : "",
			mimetype : "",
			ext : ""
		};

		// -
		// 開放
		// -
		_this.release = function(){
			var key;
			for(key in _dictionary){
				_dictionary[key].release();
			}
			_dictionary = null;
		};

		// -
		// URLを登録
		// -
		_this.addURL = function(url){
			var key = url.toLowerCase();
			var obj = _dictionary[key];
			if(!obj){
				_dictionary[key] = obj = new UrlInfo(url);
			}
			return obj;
		};

		// -
		// UrlInfo を取得
		// -
		_this.getUrlInfo = function(url){
			var key = url.toLowerCase();
			var obj = _dictionary[key];
			return obj;
		};

		// -
		// リダイレクト先を取得
		// -
		_this.getRedirectURL = function(current_url,callback){
			var redirected = false;
			var item = _this.getUrlInfo(current_url);

			var complete = function(){
				callback({
					redirected:redirected,
					url_info:item
				});
			};

			if(!item){
				complete();
				return;
			}

			var i = 0;
			var f = function(){
				item.getRedirect(function(next){
					if(next){
						redirected = true;
						item = next;
						i++;
						if(i < _repeat_max){
							f();
							return;
						}
					}
					complete();
				});
			};

			f();
		};

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

		// -
		// 初期化
		// -
		_dictionary = new Object();
		_unique_id = 0;
		_url_count = 0;
		_repeat_max = 16;
	}


	// -
	// アドレスコレクション
	// -
	function AddressCollection(){
		var _this = this;

		// -
		// 開放
		// -
		_this.release = function(category,url){
			_dictionary = null;
			_count = 0;
		};

		// -
		// アドレスを登録
		// -
		_this.addAddress = function(category,url){
			//url = convertAddress(url);

			// カテゴリが存在しない
			var obj = _dictionary[category];
			if(!obj){
				_dictionary[category] = obj = new Object();
			}

			// 登録済み
			if(obj[url]){
				return false;
			}

			// 新規登録
			obj[url] = true;
			_count += 1;
			return true;
		};

		// -
		// アドレスの登録を外す
		// -
		_this.removeAddress = function(category,url){
			//url = convertAddress(url);

			// カテゴリが存在しない
			var obj = _dictionary[category];
			if(!obj){
				return false;
			}

			// 未登録
			if(!obj[url]){
				return false;
			}

			obj[url] = false;
			_count -= 1;

			return true;
		};

		// -
		// アドレスが登録済みであるか調べる
		// -
		_this.hasAddress = function(category,url){
			//url = convertAddress(url);

			// カテゴリが存在しない
			var obj = _dictionary[category];
			if(!obj){
				return false;
			}

			if(obj[url])	return true;
			return false;
		};

		// -
		// アドレスを変換(内部用)
		// -
		function convertAddress(url){
			// 小文字に変換
			url = url.toLowerCase();
			return url;
		}

		// -
		// 登録数を取得
		// -
		_this.getCountAddress = function(){
			return _count;
		};

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

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


	// -
	// 実行キュー
	// -
	function ExecuteQueue(){
		var _this = this;

		// -
		// 開放
		// -
		_this.release = function(){
			var i;
			for(i=0;i<_queue_max;i++){
				var queue = _queue_list[i];
				var _prev = queue._prev;
				var _next = queue._next;
				_prev._next = _next;
				_next._prev = _prev;
				queue._prev = queue;
				queue._next = queue;
			}

			if(_time_handle !== null){
				clearTimeout(_time_handle);
				_time_handle = null;
			}
		};

		// -
		// 最前列に処理を追加
		// -
		_this.attachFirst = function(func,param){
			var o = {func:func,param:param};
			var _prev = _queue_list[0];
			var _next = _prev._next;
			o._prev = _prev;
			o._next = _next;
			_prev._next = o;
			_next._prev = o;

			attach(0);
		};

		// -
		// 割り込み用の処理を最後尾に追加
		// -
		_this.attachLastForInterrupt = function(func,param){
			var o = {func:func,param:param};
			var _next = _queue_list[0];
			var _prev = _next._prev;
			o._prev = _prev;
			o._next = _next;
			_prev._next = o;
			_next._prev = o;

			attach(0);
		};

		// -
		// DOM オブジェクト除外用の処理を最前列に追加
		// -
		_this.attachFirstForRemoveDomNode = function(func,param){
			var o = {func:func,param:param};
			var _prev = _queue_list[1];
			var _next = _prev._next;
			o._prev = _prev;
			o._next = _next;
			_prev._next = o;
			_next._prev = o;

			attach(1);
		};

		// -
		// DOM オブジェクト除外用の処理を最後尾に追加
		// -
		_this.attachLastForRemoveDomNode = function(func,param){
			var o = {func:func,param:param};
			var _next = _queue_list[1];
			var _prev = _next._prev;
			o._prev = _prev;
			o._next = _next;
			_prev._next = o;
			_next._prev = o;

			attach(1);
		};

		// -
		// DOM オブジェクト挿入用の処理を最前列に追加
		// -
		_this.attachFirstForInsertDomNode = function(func,param){
			var o = {func:func,param:param};
			var _prev = _queue_list[2];
			var _next = _prev._next;
			o._prev = _prev;
			o._next = _next;
			_prev._next = o;
			_next._prev = o;

			attach(2);
		};

		// -
		// DOM オブジェクト挿入用の処理を最後尾に追加
		// -
		_this.attachLastForInsertDomNode = function(func,param){
			var o = {func:func,param:param};
			var _next = _queue_list[2];
			var _prev = _next._prev;
			o._prev = _prev;
			o._next = _next;
			_prev._next = o;
			_next._prev = o;

			attach(2);
		};

		// -
		// 掲示板展開用の処理を追加
		// -
		_this.attachForExpandBbs = function(func,param){
			var o = {func:func,param:param};
			var _next = _queue_list[3];
			var _prev = _next._prev;
			o._prev = _prev;
			o._next = _next;
			_prev._next = o;
			_next._prev = o;

			attach(3);
		};

		// -
		// エレメント展開用の処理を追加
		// -
		_this.attachForExpandElement = function(func,param){
			var o = {func:func,param:param};
			var _next = _queue_list[4];
			var _prev = _next._prev;
			o._prev = _prev;
			o._next = _next;
			_prev._next = o;
			_next._prev = o;

			attach(4);
		};

		// -
		// エレメント解析用の処理を追加
		// -
		_this.attachForAnalyzeElement = function(func,param){
			var o = {func:func,param:param};
			var _next = _queue_list[5];
			var _prev = _next._prev;
			o._prev = _prev;
			o._next = _next;
			_prev._next = o;
			_next._prev = o;

			attach(5);
		};

		// -
		// テキストノード解析用の処理を追加
		// -
		_this.attachForAnalyzeTextNode = function(func,param){
			var o = {func:func,param:param};
			var _next = _queue_list[6];
			var _prev = _next._prev;
			o._prev = _prev;
			o._next = _next;
			_prev._next = o;
			_next._prev = o;

			attach(6);
		};

		// -
		// 最後尾に処理を追加
		// -
		_this.attachLast = function(func,param){
			var o = {func:func,param:param};
			var _next = _queue_list[7];
			var _prev = _next._prev;
			o._prev = _prev;
			o._next = _next;
			_prev._next = o;
			_next._prev = o;

			attach(7);
		};

		// -
		// 登録処理(内部用)
		// -
		function attach(level){
			_count += 1;

			if(level < _queue_pos){
				_queue_pos = level;
				_queue = _queue_list[_queue_pos];
			}

			if(_time_handle !== null) return;

			_time_handle = setTimeout(function (){
				execute();
			} , _time_sleep);
		}

		// -
		// 実行(内部用)
		// -
		function execute (){
			_time_handle = setTimeout(function (){
				execute();
			} , _time_sleep);
			var time = _getTime();
			do{
				var o = _queue._next;
				var _prev = o._prev;
				var _next = o._next;
				_prev._next = _next;
				_next._prev = _prev;
				try{
					o.func(o.param);
					_success_count += 1;
				}catch(e){
					if(project.getEnableDebugMode()){
						ConsoleError(e.stack);
					}
					_error_count += 1;
				}

				while(_queue_pos < _queue_max){
					if(_queue._next != _queue) break;
					_queue_pos ++;
					_queue = _queue_list[_queue_pos];
				}

				_count -= 1;
				if(_count <= 0){
					if(_time_handle !== null){
						clearTimeout(_time_handle);
						_time_handle = null;
					}
					return;
				}
			}while (_getTime() - time <= _time_occupancy);
		}

		// -
		// キューの数を取得
		// -
		_this.getCountQueue = function(){
			return _count;
		};

		// -
		// キューの成功数を取得
		// -
		_this.getCountSuccess = function(){
			return _success_count;
		};

		// -
		// キューのエラー数を取得
		// -
		_this.getCountError = function(){
			return _error_count;
		};

		// -
		// キューのフェーズを取得
		// -
		_this.getPhase = function(){
			return _queue_pos;
		};

		// -
		// 占有時間をセット
		// -
		_this.setOccupancyTime = function(v){
			_time_occupancy = v;
		};

		// -
		// スリープ時間をセット
		// -
		_this.setSleepTime = function(v){
			_time_sleep = v;
		};

		// -
		// プライベート変数
		// -
		var _queue;
		var _queue_list;
		var _queue_pos;
		var _queue_max;
		var _count;
		var _success_count;
		var _error_count;
		var _time_handle;
		var _time_occupancy;
		var _time_sleep;
		var _getTime;

		// -
		// 初期化
		// -
		_count = 0;
		_success_count = 0;
		_error_count = 0;
		_time_handle = null;
		_time_occupancy = 5;
		_time_sleep = 0;

		_queue_pos = 0;
		_queue_max = 8;
		_queue_list = new Array();
		while(_queue_pos < _queue_max){
			_queue = new Object();
			_queue._prev = _queue;
			_queue._next = _queue;
			_queue_list[_queue_pos] = _queue;
			_queue_pos ++;
		}

		// 時間取得関数
		_getTime = Date.now;
		if(!_getTime)	_getTime = function(){ return (new Date()).getTime(); };
	}


	// -
	// ローダーキュー
	// -
	function LoaderQueue(){
		var _this = this;

		// -
		// 開放
		// -
		_this.release = function(){
			if(_released) return;
			_released = true;

			var queue = _this.queue;
			while(queue != queue._next){
				element_release(queue._next);
			}

			var i;
			var num = _rules.length;
			for(i=0;i<num;i++){
				var rule = _rules[i];
				rule.release();
			}
		};

		// -
		// 要素を作成
		// -
		_this.createElement = function (){
			return new Element(0);
		};

		// -
		// 要素
		// -
		function Element(rule_id){
			this._prev = this;
			this._next = this;
			this._released = false;
			this._waiting = false;
			this._loading = false;
			this._rule = _rules[rule_id];

			_elements[_unique] = this;
			this._unique = _unique;
			_unique += 1;
			_queue_count += 1;
		}
		Element.prototype = {
			// -
			// 開始イベント
			// -
			onstart : function(){},

			// -
			// 中止イベント
			// -
			onabort : function(){},

			// -
			// 完了を通知
			// -
			complete : function(){
				element_remove(this);
				element_loadend(this);
				dequeue();
			},

			// -
			// 識別番号を取得
			// -
			getId : function(){
				return this._unique;
			},

			// -
			// 要素を破棄(中止の発火なし、デキューあり)
			// -
			release : function(){
				element_release(this);
				dequeue();
			},

			// -
			// 中止
			// -
			abort : function(){
				element_abort(this);
				dequeue();
			},

			// -
			// 通常最前列に処理を追加
			// -
			attachFirst : function(){
				element_abort(this);

				var _prev = _this.queue;
				var _next = _prev._next;
				_prev._next = this;
				_next._prev = this;
				this._prev = _prev;
				this._next = _next;
				this._waiting = true;

				dequeue();
			},

			// -
			// 通常最後尾に追加
			// -
			attachLast : function(){
				element_abort(this);

				var _next = _this.queue;
				var _prev = _next._prev;
				_prev._next = this;
				_next._prev = this;
				this._prev = _prev;
				this._next = _next;
				this._waiting = true;

				dequeue();
			}
		};

		// -
		// ルールを作成
		// -
		_this.createRule = function (){
			return new Rule();
		};

		// -
		// 要素
		// -
		var Rule = (function(){
			function Rule(){
				this._thread_count = 0
				this._thread_max = 0;
				this._cooltime = 0;
				this._time_handler = null;
			}
			Rule.prototype = {

				// -
				// 開放
				// -
				release : function(){
					Rule_clear_timer(this);
				},

				// -
				// 最大数をセット
				// -
				setMaxThread : function(v){
					this._thread_max = v;
				},

				// -
				// 待機時間をセット
				// -
				setCoolTime : function(v){
					this._cooltime = v;
				}

			};

			return Rule;
		})();
		function Rule_loadstart(rule){
			rule._thread_count += 1;
		}
		function Rule_loadend(rule){
			var full = Boolean(rule._thread_count >= rule._thread_max);
			rule._thread_count -= 1;

			if(!full) return;
			if(!rule._cooltime) return;

			// クールダウン
			Rule_clear_timer(rule);
			rule._time_handler = setTimeout(function(){
				Rule_clear_timer(rule);
				dequeue();
			},rule._cooltime);
		}
		function Rule_clear_timer(rule){
			if(rule._time_handler !== null){
				clearTimeout(rule._time_handler);
				rule._time_handler = null;
			}
		}
		function Rule_can_generated(rule){
			if(rule._thread_count >= rule._thread_max) return false;
			if(Rule_is_freezing(rule)) return false;
			return true;
		}
		function Rule_is_freezing(rule){
			return Boolean(rule._time_handler !== null);
		}

		// -
		// 要素のロード開始(内部用)
		// -
		function element_loadstart(element){
			if(element._loading) return;
			element._loading = true;
			element_remove(element);
			_thread_count += 1;
			Rule_loadstart(element._rule);
			element.onstart();
		}

		// -
		// 要素のロード終了(内部用)
		// -
		function element_loadend(element){
			if(!(element._loading)) return;
			element._loading = false;
			_thread_count -= 1;
			Rule_loadend(element._rule);
		}

		// -
		// 要素を外す(内部用)
		// -
		function element_remove(element){
			var _prev = element._prev;
			var _next = element._next;
			_prev._next = _next;
			_next._prev = _prev;
			element._prev = element;
			element._next = element;
			element._waiting = false;
		}

		// -
		// 要素を中止(内部用)
		// -
		function element_abort(element){
			if((element._loading) || (element._waiting)){
				var f = element.onabort;
				if(f) f();
			}
			element_remove(element);
			element_loadend(element);
		}

		// -
		// 要素を破棄(内部用)
		// -
		function element_release(element){
			if(element._released) return;
			element._released = true;

			element_remove(element);
			element_loadend(element);

			delete _elements[element._unique];
			_queue_count -= 1;
		}

		// -
		// デキュー(内部用)
		// -
		function dequeue(){
			if(_released) return;

			var left = _this.queue;
			var element = left._next;
			while(true){
				if(element == _this.queue) break;
				if(_thread_count >= _thread_max) break;

				if(Rule_can_generated(element._rule)){
					element_loadstart(element);
					element = left._next;
				}else{
					left = element;
					element = element._next;
				}
			}
		}

		// -
		// 要素を取得
		// -
		_this.getElementById = function(id){
			return _elements[id];
		};

		// -
		// キューの数を取得
		// -
		_this.getCountQueue = function(){
			return _queue_count;
		};

		// -
		// スレッドの数を取得
		// -
		_this.getCountThread = function(){
			return _thread_count;
		};

		// -
		// エラー数を取得
		// -
		_this.getCountError = function(){
			return _error_count;
		};

		// -
		// エラー数を加算
		// -
		_this.addCountError = function(){
			_error_count += 1;
		};

		// -
		// スレッドの最大数を取得
		// -
		_this.getMaxThread = function(){
			return _thread_max;
		};

		// -
		// ロードスレッドの最大数をセット
		// -
		_this.setMaxThread = function(v){
			_thread_max = v;
		};

		// -
		// プライベート変数
		// -
		var _queue_count;
		var _thread_count;
		var _thread_max;
		var _error_count;
		var _released;
		var _unique;
		var _elements;
		var _rules;

		// -
		// 初期化
		// -
		(function(){
			_queue_count = 0;
			_thread_count = 0;
			_this.setMaxThread(10);
			_error_count = 0;
			_released = false;
			_unique = 1;
			_elements = new Object();
			_rules = new Array();

			var queue = new Object();
			queue._prev = queue;
			queue._next = queue;
			_this.queue = queue;

			// デフォルトのルール
			var rule = _this.createRule();
			rule.setCoolTime(100);
			rule.setMaxThread(0x7FFFFFFF);
			_rules.push(rule);
		})();
	}

	// -
	// ローダー
	// -
	var Loader = (function(){

		// -
		// 定数
		// -
		var QUEUE_ATTACH_TYPE = {FIRST:0,LAST:1};
		var XHR_TYPE = {BY_ORIGIN:0,ONLY_BACKGROUND:1};

		// -
		// 初期化
		// -
		function init_request(){
			var o = this.request;
			for(var k in o){ delete o[k]; };
			o.headers = new Object(),
			o.method = "GET",
			o.url = "",
			o.data = null,
			o.timeout = project.getLoadTimeout()
			o.overrideMimeType = "";
			o.responseType = "text";
		}
		function init_response(o){
			var o = this.response;
			for(var k in o){ delete o[k]; };
			o.readyState = 0;
			o.status = 0;
			o.headers = new ResponseHeadersParser("");
			o.responseURL = "";
			o.redirected = false;
			o.response = null;
			o.responseText = "";
			o.errorText = "";
			o.ok = false;

		}
		function init_progress(o){
			var o = this.progress;
			for(var k in o){ delete o[k]; };
			o.bytesLoaded = 0;
			o.bytesTotal = 0;
		}
		function init_verify_check(){
			var url_parser = this.url_parser = URL_Parser(this.request.url);
			if(!url_parser.protocol.match(/^(http|https|ftp|data|blob):/)){
				this.response.errorText = "protocol is not supported.";
				return false;
			}
			this.url_info = url_info_dictionary.addURL(this.request.url);

			if(project.checkAccessBlock(this.request.url)){
				this.response.errorText = "Access Block";
				if(project.getEnableOutputLog()){
					ConsoleLog({type:"AccessBlock",current_url:WindowGetOwnerURL(window),url:this.request.url,call:"Loader"});
				}
				return false;
			}
			return true;
		}

		// -
		// 発火
		// -
		function dispatch_onprogress(){
			var f = this.onprogress;
			if(f) f(this.progress);
		}
		function dispatch_onload(v){
			var f = this.onload;
			if(f) f(v);
		}
		function dispatch_onerror(){
			loader_queue.addCountError();
			var f = this.onerror;
			if(f) f(this.response.errorText);
		}

		// -
		// fetch(コンテントで実行)
		// -
		function request_content_fetch(callback){
			try{
				var _this = this;
				var released = false;
				var event_handler_release;
				var event_handler_abort;
				var timeout_handle = null;
				var fetch_abort = null;

				var request = _this.request;
				var response = _this.response;
				var progress = _this.progress;

				var abort = function(){
					try{
						release_timeout();
						fetch_abort.abort();
					}catch(e){
					}
				};
				var release_timeout = function(){
					if(timeout_handle !== null){
						clearTimeout(timeout_handle);
						timeout_handle = null;
					}
				};
				var release = function(){
					if(released) return;
					released = true;

					abort();

					release_timeout();
					if(event_handler_abort){
						event_handler_abort.release();
						event_handler_abort = null;
					}
					if(event_handler_release){
						event_handler_release.release();
						event_handler_release = null;
					}
				};

				event_handler_release = _this._event_dispatcher.createEventHandler("release");
				event_handler_release.setFunction(function(){
					release();
				});
				event_handler_abort = _this._event_dispatcher.createEventHandler("abort");
				event_handler_abort.setFunction(function(){
					release();
				});

				var complete = function(){
					release();
					callback({state:"complete"});
				};

				var success = function(){
					if(released) return;
					response.readyState = 4;
					complete();
				};

				var failure = function(msg){
					if(released) return;
					response.ok = false;
					response.status = 0;
					response.readyState = 4;
					response.errorText = msg;
					complete();
				};
				var rejected = function(e){
					failure(e.message);
				};

				fetch_abort = new AbortController();
				if(request.timeout){
					timeout_handle = setTimeout(function(){
						timeout_handle = null;
						abort();
					},request.timeout);
				}
				var fetch_option = new Object();
				fetch_option.signal = fetch_abort.signal;
				fetch_option.method = request.method;
				fetch_option.headers = (function(){
					var o = new Headers();
					var i = request.headers;
					for(var n in i){
						o.append(n,i[n]);
					}
					return o;
				})();
				fetch_option.body = request.data;
				if(request.cache) fetch_option.cache = request.cache;
				if(request.redirect) fetch_option.redirect = request.redirect;

				var fetch_promise = fetch(request.url,fetch_option);

				fetch_promise.then(
					function(r){
						fetch_response = r;
						response.ok = r.ok;
						response.readyState = 3;
						response.status = r.status;
						var response_headers = r.headers;
						var headers = new Array();
						response_headers.forEach(function(v,k){
							headers.push(k + ": " + v);
						});
						response.headers = new ResponseHeadersParser(headers.join("\r\n"));
						response.responseURL = r.url;
						response.redirected = r.redirected;

						if(!r.body){
							success();
							return;
						}
						var reader = r.body.getReader();
						var reader_reading;
						var reader_success;

						switch(request.responseType){
						case "blob":
							(function (){
								var blob_list = new Array();
								reader_reading = function(value){
									blob_list.push(new Blob([value]));
								};
								reader_success = function(){
									var options = {
										type:response_headers.get("Content-Type")
									};
									response.response = new Blob(blob_list,options);
									success();
								};
							})();
							break;
						case "arraybufferlist":
							(function (){
								var ary_buffer_list = new Array();
								reader_reading = function(value){
									ary_buffer_list.push(value);
								};
								reader_success = function(){
									response.response = ary_buffer_list;
									success();
								};
							})();
							break;
						case "arraybuffer":
						case "dataurischeme":
						case "binarystring":
							(function (){
								var blob_list = new Array();
								reader_reading = function(value){
									blob_list.push(new Blob([value]));
								};
								reader_success = function(){
									var file_reader = new FileReader();
									file_reader.onloadend = function(e){
										if(released) return;

										if(file_reader.error){
											failure(file_reader.error);
										}else{
											if(request.responseType == "arraybuffer"){
												response.response = file_reader.result;
											}else{
												response.responseText = file_reader.result;
											}
											success();
										}
									};

									var options = {
										type:response_headers.get("Content-Type")
									};
									var blob = new Blob(blob_list,options);

									switch(request.responseType){
									case "arraybuffer":
										file_reader.readAsArrayBuffer(blob);
										break;
									case "dataurischeme":
										file_reader.readAsDataURL(blob);
										break;
									case "binarystring":
										file_reader.readAsBinaryString(blob);
										break;
									}
								};
							})();
							break;
						default:
							(function (){
								var charset = "utf-8";
								var mime_type = request.overrideMimeType || "";
								var m = mime_type.match(new RegExp("text/plain; charset=([0-9a-zA-Z-_]+)"));
								if(m) charset = m[1];
								var text_decoder = new TextDecoder(charset);
								var decode_options = {stream:true};
								var str_list = new Array();
								reader_reading = function(value){
									var ary_u8 = new Uint8Array(value);
									str_list.push(text_decoder.decode(ary_u8,decode_options));
								};
								reader_success = function(){
									response.responseText = str_list.join("");
									success();
								};
							})();
							break;
						}

						var loaded = 0;
						var total = parseInt(response_headers.get("Content-Length")) || 0;

						var pull = function (){
							var p = reader.read();
							p.then(function(result){
								if(result.done){
									reader.releaseLock();
									reader_success();
									return;
								}

								loaded += result.value.byteLength;
								progress.bytesLoaded = loaded || 0;
								progress.bytesTotal = total || 0;
								dispatch_onprogress.call(_this);

								reader_reading(result.value);
								pull();
							},rejected);	

						};
						pull();

					},
					rejected
				);
			}catch(e){
				response.errorText = e.message;
				release();
				callback({state:"unsupported"});
			}

		}

		// -
		// xhr(コンテントで実行)
		// -
		function request_content_xhr(callback){
			try{
				var _this = this;
				var released = false;
				var event_handler_release;
				var event_handler_abort;
				var xhr;

				var request = _this.request;
				var response = _this.response;
				var progress = _this.progress;

				var abort = function(){
					try{
						xhr.abort();
					}catch(e){
					}
				};

				var release = function(){
					if(released) return;
					released = true;

					abort();

					try{
						xhr.onloadend = null;
						xhr.onreadystatechange = null;
						xhr.onprogress = null;
					}catch(e){
					}

					if(event_handler_abort){
						event_handler_abort.release();
						event_handler_abort = null;
					}
					if(event_handler_release){
						event_handler_release.release();
						event_handler_release = null;
					}

					xhr = null;
				};

				event_handler_release = _this._event_dispatcher.createEventHandler("release");
				event_handler_release.setFunction(function(){
					release();
				});
				event_handler_abort = _this._event_dispatcher.createEventHandler("abort");
				event_handler_abort.setFunction(function(){
					release();
				});

				var complete = function(){
					release();
					callback({state:"complete"});
				};

				var success = function(){
					if(released) return;
					complete();
				};

				var failure = function(msg){
					if(released) return;
					response.ok = false;
					response.status = 0;
					response.readyState = 4;
					response.errorText = msg;
					complete();
				};

				xhr = new XMLHttpRequest();
				xhr.onloadend = function(r){
					response.ok = Boolean((200 <= xhr.status && xhr.status < 300) || xhr.status == 304)
					response.status = xhr.status;
					response.headers = new ResponseHeadersParser(xhr.getAllResponseHeaders());
					response.responseURL = xhr.responseURL;
					response.redirected = Boolean((xhr.responseURL) && (request.url != xhr.responseURL));

					switch(request.responseType){
					case "blob":
						(function (){
							response.response = xhr.response;
							success();
						})();
						break;
					case "arraybuffer":
						(function (){
							response.response = xhr.response;
							success();
						})();
						break;
					case "arraybufferlist":
						(function (){
							var blob = xhr.response;
							if(!blob){
								success();
								return;
							}

							var ary_buffer_list = new Array();
							var pos = 0;
							var read_size = 1024 * 1024 * 16;
							var total = blob.size;
							var f = function (){
								var file_reader = new FileReader();
								file_reader.onloadend = function(){
									if(released) return;

									if(file_reader.error){
										failure(file_reader.error);
										return;
									}

									ary_buffer_list.push(file_reader.result);

									pos += read_size;
									if(pos < total){
										f();
										return;
									}

									response.response = ary_buffer_list;
									success();
								};
								file_reader.readAsArrayBuffer(blob.slice(pos,pos+read_size));
							};
							f();
						})();
						break;
					case "dataurischeme":
					case "binarystring":
						(function (){
							var blob = xhr.response;
							if(!blob){
								success();
								return;
							}

							var file_reader = new FileReader();
							file_reader.onloadend = function(e){
								if(released) return;

								if(file_reader.error){
									failure(file_reader.error);
								}else{
									response.responseText = file_reader.result;
									success();
								}
							};

							switch(request.responseType){
							case "dataurischeme":
								file_reader.readAsDataURL(blob);
								break;
							case "binarystring":
								file_reader.readAsBinaryString(blob);
								break;
							}
						})();
						break;
					default:
						(function (){
							response.responseText = xhr.responseText;
							success();
						})();
						break;
					}

				};
				xhr.onprogress = function(e){
					progress.bytesLoaded = e.loaded || 0;
					progress.bytesTotal = e.total || 0;
					dispatch_onprogress.call(_this);
				};

				xhr.open(request.method,request.url,true);

				var headers = request.headers;
				for(var name in headers){
					xhr.setRequestHeader(name,headers[name]);
				}
				if(request.overrideMimeType){
					if(xhr.overrideMimeType) xhr.overrideMimeType(request.overrideMimeType);
				}
				if(request.timeout){
					xhr.timeout = request.timeout;
				}
				if(request.responseType){
					switch(request.responseType){
					case "arraybufferlist":
					case "dataurischeme":
					case "binarystring":
						xhr.responseType = "blob";
						break;
					default:
						xhr.responseType = request.responseType;
						break;
					}
				}
				xhr.send(request.data);
			}catch(e){
				response.errorText = e.message;
				release();
				callback({state:"unsupported"});
			}
		}

		// -
		// GM_xmlhttpRequest
		// -
		function request_gm_xhr(callback){
			try{
				var _this = this;
				var released = false;
				var event_handler_release;
				var event_handler_abort;
				var onreadystatechange_func;
				var onloadheader_func;
				var onload_func;
				var gmxhr;

				var request = _this.request;
				var response = _this.response;
				var progress = _this.progress;

				var abort = function(){
					try{
						gmxhr.abort();
					}catch(e){
					}
				};

				var release = function(){
					if(released) return;
					released = true;

					abort();

					onreadystatechange_func = null;
					onloadheader_func = null;
					onload_func = null;

					if(event_handler_abort){
						event_handler_abort.release();
						event_handler_abort = null;
					}
					if(event_handler_release){
						event_handler_release.release();
						event_handler_release = null;
					}

					gmxhr = null;
				};

				event_handler_release = _this._event_dispatcher.createEventHandler("release");
				event_handler_release.setFunction(function(){
					release();
				});
				event_handler_abort = _this._event_dispatcher.createEventHandler("abort");
				event_handler_abort.setFunction(function(){
					release();
				});

				var complete = function(){
					release();
					callback({state:"complete"});
				};

				var success = function(){
					if(released) return;
					complete();
				};

				var failure = function(msg){
					if(released) return;
					response.ok = false;
					response.status = 0;
					response.readyState = 4;
					response.errorText = msg;
					complete();
				};


				var gmxhr_request = new Object();

				gmxhr_request.onprogress = function(e){
					progress.bytesLoaded = e.loaded || 0;
					progress.bytesTotal = e.total || 0;
					dispatch_onprogress.call(_this);
				};

				gmxhr_request.onload = function(r){
					if(onload_func) onload_func(r);
				};
				gmxhr_request.onerror = function(r){
					failure(r);
				};
				gmxhr_request.onreadystatechange = function(r){
					if(onreadystatechange_func) onreadystatechange_func(r);
				};

				onreadystatechange_func = function(r){
					if(r.readyState == 2){
						if(onloadheader_func) onloadheader_func(r);
					}
					if(r.readyState == 4){
						if(onload_func) onload_func(r);
					}
				};
				onloadheader_func = function(r){
					response.ok = Boolean((200 <= r.status && r.status < 300) || r.status == 304)
					response.status = r.status;
					response.readyState = r.readyState;
					response.headers = new ResponseHeadersParser(r.responseHeaders);
					response.responseURL = r.finalUrl;
					response.redirected = Boolean((r.finalUrl) && (request.url != r.finalUrl));
				};
				onload_func = function(r){
					onload_func = null;
					if(onloadheader_func) onloadheader_func(r);

					switch(request.responseType){
					case "blob":
						(function (){
							response.response = r.response;
							success();
						})();
						break;
					case "arraybuffer":
						(function (){
							response.response = r.response;
							success();
						})();
						break;
					case "arraybufferlist":
						(function (){
							var blob = r.response;
							if(!blob){
								success();
								return;
							}

							var ary_buffer_list = new Array();
							var pos = 0;
							var read_size = 1024 * 1024 * 16;
							var total = blob.size;
							var f = function (){
								var file_reader = new FileReader();
								file_reader.onloadend = function(){
									if(released) return;

									if(file_reader.error){
										failure(file_reader.error);
										return;
									}

									ary_buffer_list.push(file_reader.result);

									pos += read_size;
									if(pos < total){
										f();
										return;
									}

									response.response = ary_buffer_list;
									success();
								};
								file_reader.readAsArrayBuffer(blob.slice(pos,pos+read_size));
							};
							f();
						})();
						break;
					case "dataurischeme":
					case "binarystring":
						(function (){
							var blob = r.response;
							if(!blob){
								success();
								return;
							}

							var file_reader = new FileReader();
							file_reader.onloadend = function(e){
								if(released) return;

								if(file_reader.error){
									failure(file_reader.error);
								}else{
									response.responseText = file_reader.result;
									success();
								}
							};

							switch(request.responseType){
							case "dataurischeme":
								file_reader.readAsDataURL(blob);
								break;
							case "binarystring":
								file_reader.readAsBinaryString(blob);
								break;
							}
						})();
						break;
					default:
						(function (){
							response.responseText = r.responseText;
							success();
						})();
						break;
					}
				};

				gmxhr_request.method = request.method;
				gmxhr_request.url = request.url;
				gmxhr_request.headers = request.headers;
				if(request.overrideMimeType){
					gmxhr_request.overrideMimeType = request.overrideMimeType;
				}
				if(request.timeout){
					gmxhr_request.timeout = request.timeout;
				}
				if(request.responseType){
					switch(request.responseType){
					case "arraybufferlist":
					case "dataurischeme":
					case "binarystring":
						gmxhr_request.responseType = "blob";
						break;
					default:
						gmxhr_request.responseType = request.responseType;
						break;
					}
				}
				if(request.data){
					gmxhr_request.data = request.data;
				}

				try{
					gmxhr = GM.xmlHttpRequest(gmxhr_request);
					return;
				}catch(e){
				}
				try{
					gmxhr = GM_xmlhttpRequest(gmxhr_request);
					return;
				}catch(e){
				}
				throw {message:"GM_xmlhttpRequest is not supported"};
			}catch(e){
				response.errorText = e.message;
				release();
				callback({state:"unsupported"});
			}
		}


		// -
		// media
		// -
		function request_element(param,callback){
			var _this = this;

			var released = false;
			var event_handler_release;
			var event_handler_abort;
			var time_handle = null;
			var queue_element = loader_queue.createElement();
			var element;

			function release(){
				if(released) return;
				released = true;

				if(element){
					element.removeEventListener("load",onload_handle);
					element.removeEventListener("loadedmetadata",onload_handle);
					element.removeEventListener("error",failure);
				}
				if(event_handler_abort){
					event_handler_abort.release();
					event_handler_abort = null;
				}
				if(event_handler_release){
					event_handler_release.release();
					event_handler_release = null;
				}
				if(queue_element){
					queue_element.complete();
					queue_element.release();
					queue_element = null;
				}
				if(time_handle !== null){
					clearTimeout(time_handle);
					time_handle = null;
				}
			};
			function success(){
				if(released) return;
				release();
				callback.call(_this,element);
			}
			function failure(){
				if(released) return;
				release();
				if(element) element.src = "";
				element = null;
				callback.call(_this,null);
			}
			function onload_handle(){
				if(released) return;

				if((function(){
					if(element.tagName != "IMG") return false;
					if(!element.decode) return false;
					if(project.getDecodeLoadExpandImage() == "pre-decode") return true;
					return false;
				})()){
					element.decoding = "async";
					var promise = element.decode();
					promise.then(success,failure);
					return;
				}

				success();
			}

			init_progress.call(_this);
			init_response.call(_this);

			if(!param.url){
				failure();
				return;
			}

			event_handler_release = _this._event_dispatcher.createEventHandler("release");
			event_handler_release.setFunction(function(){
				release();
			});
			event_handler_abort = _this._event_dispatcher.createEventHandler("abort");
			event_handler_abort.setFunction(function(){
				failure();
			});

			queue_element.onstart = function(){
				element = DocumentCreateElement(param.tagName);
				if(param.tagName == "IMG"){
				}else{
					element.controls = true;
					element.autoplay = false;
					element.preload = "metadata";
				}
				element.addEventListener("load",onload_handle);
				element.addEventListener("loadedmetadata",onload_handle);
				element.addEventListener("error",failure);
				element.src = param.url;

				if(_this.request.timeout){
					setTimeout(failure,_this.request.timeout);
				}
			};

			queue_element.onabort = function(){
				_this.abort();
			};

			var url_parser = URL_Parser(param.url);
			if(url_parser.protocol.match(/^(blob|data):/)){
				_this._queue_attch_type = QUEUE_ATTACH_TYPE.FIRST;
			}

			switch(_this._queue_attch_type){
			case QUEUE_ATTACH_TYPE.FIRST:
				queue_element.attachFirst();
				break;
			default:
				queue_element.attachLast();
				break;
			}
		}
		function load_element(param){
			var _this = this;

			function complete(element){
				if(element){
					dispatch_onload.call(_this,element);
				}else{
					dispatch_onerror.call(_this);
				}
			}

			_this.request.cache = project.getLoadCacheModeForMedia();

			switch((function(){
				var current_url_parser = URL_Parser(WindowGetOwnerURL(window));
				if(_this.url_parser.protocol.match(/^(blob):/)) return "url";
				if(_this.url_parser.protocol.match(/^(data):/)) return "blob_url";
				if(current_url_parser.protocol.match(/^(https):/) && _this.url_parser.protocol.match(/^(http):/)) return "blob_url";
				return param.src_type;
			})()){
			default:
			case "url":
				(function(){
					_this.url_info.getCached(function(result,analyze_element){
						if(result){
							if(!result.ok){
								complete(null);
								return;
							}
						}
						request_element.call(_this,{tagName:param.tagName,url:_this.request.url},function(element){
							complete(element);
							if(analyze_element){
								if(element){
									analyze_element.success(true);
								}else{
									analyze_element.failure();
								}
							}
						});
					});
				})();
				break;

			case "blob_url":
				(function(){
					var analyze_element = _this.url_info.analyzeBlobURL();
					_this.url_info.getBlobURL(function(blob_url){
						request_element.call(_this,{tagName:param.tagName,url:blob_url},complete);
					});

					if(!analyze_element) return;

					_this.setResponseType("blob");

					load.call(_this,function(){
						var blob = _this.response.response;
						if(blob){
							var blob_url = BlobURLCreate(blob);
							analyze_element.success(blob_url);
						}else{
							analyze_element.failure();
						}
					});
				})();
				break;
			}

		}

		// -
		// 読み込みを開始
		// -
		function load(callback){
			var _this = this;

			var event_handler_release;
			var event_handler_abort;
			var queue_element = loader_queue.createElement();
			var load_methods = new Array();
			var commands;

			var replied = false;
			function reply(){
				if(replied) return;
				replied = true;
				callback.call(_this);
			}
			function release(){
				if(event_handler_abort){
					event_handler_abort.release();
					event_handler_abort = null;
				}
				if(event_handler_release){
					event_handler_release.release();
					event_handler_release = null;
				}
				if(queue_element){
					queue_element.complete();
					queue_element.release();
					queue_element = null;
				}
				command = {};
			};
			function success(){
				var mimetype = _this.response.headers.getResponseHeader("Content-Type")
				if(mimetype) _this.url_info.setMimeType(mimetype);
				release();
				reply();
			}
			function failure(){
				release();
				reply();
			}

			function load_init(){
				init_progress.call(_this);
				init_response.call(_this);
			}

			function load_exec(){
				var f = load_methods[0];
				if(!f){
					failure();
					return;
				}

				load_init();

				f.call(_this,function(v){
					var f = commands[v.state];
					if(f) f();
				});
			}

			load_init();

			event_handler_release = _this._event_dispatcher.createEventHandler("release");
			event_handler_release.setFunction(function(){
				release();
			});
			event_handler_abort = _this._event_dispatcher.createEventHandler("abort");
			event_handler_abort.setFunction(function(){
				failure();
			});

			commands = {
				"complete" : function(){
					success();
				},
				"retry" : function(){
					load_exec();
				},
				"unsupported" : function(){
					load_methods.shift();
					load_exec();
				}
			};

			var current_url_parser = URL_Parser(WindowGetOwnerURL(window));
			if((function(){
				if(_this.url_parser.protocol.match(/blob|data/)) return false;
				if(this._xhr_type == XHR_TYPE.ONLY_BACKGROUND) return true;
				return Boolean(current_url_parser.origin != _this.url_parser.origin);
			})()){
				load_methods.push(request_gm_xhr);
			}else{
				load_methods.push(request_content_fetch);
				load_methods.push(request_content_xhr);
			}

			queue_element.onstart = function(){
				load_exec();
			};
			queue_element.onabort = function(){
				_this.abort();
			};

			switch(_this._queue_attch_type){
			case QUEUE_ATTACH_TYPE.FIRST:
				queue_element.attachFirst();
				break;
			default:
				queue_element.attachLast();
				break;
			}

		}

		// -
		// コンストラクタ
		// -
		var Loader = function(){
			this.request = new Object();
			this.response = new Object();
			this.progress = new Object();
			init_request.call(this);
			init_response.call(this);
			init_progress.call(this);
			this._event_dispatcher = new EventDispatcher();
			this.setTimeout(project.getLoadTimeout());
		};
		Loader.prototype = {

			// -
			// 開放
			// -
			release : function(){
				this._event_dispatcher.dispatchEvent("release",null);
				if(this._event_dispatcher){
					this._event_dispatcher.release();
					this._event_dispatcher = null;
				}
			},

			// -
			// 中止
			// -
			abort : function(){
				this._event_dispatcher.dispatchEvent("abort",null);
			},

			// -
			// イベント
			// -
			onload : function(){},
			onerror : function(){},
			onprogress : function(){},

			// -
			// setter
			// -
			setRequestHeader : function(name,value){
				this.request.headers[name] = value;
			},
			overrideMimeType : function(type){
				this.request.overrideMimeType = type;
			},
			setTimeout : function(time){
				this.request.timeout = time || 0;
			},
			setMethod : function(method){
				this.request.method = (method || "").toLowerCase();
			},
			setURL : function(url){
				this.request.url = url;
			},
			setResponseType : function(type){
				this.request.responseType = (type || "").toLowerCase();
			},
			setSendData : function(data){
				this.request.data = data;
			},

			// -
			// 読み込みを開始(ヘッダのみ)
			// -
			loadResponseHeader : function(){
				var _this = this;
				if(!init_verify_check.call(_this)){
					dispatch_onerror.call(_this);
					return;
				}

				this.setMethod("head");
				this.setResponseType("blob");

				load.call(_this,function(){
					var response = _this.response;
					if(response.ok){
						dispatch_onload.call(_this,response.headers);
					}else{
						dispatch_onerror.call(_this);
					}
				});
			},

			// -
			// 読み込みを開始(任意のタイプ)
			// -
			load : function(){
				var _this = this;
				if(!init_verify_check.call(_this)){
					dispatch_onerror.call(_this);
					return;
				}

				load.call(_this,function(){
					var response = _this.response;
					if(response.ok){
						dispatch_onload.call(_this,response);
					}else{
						dispatch_onerror.call(_this);
					}
				});
			},

			// -
			// 読み込みを開始(テキスト形式)
			// -
			loadText : function(){
				var _this = this;
				if(!init_verify_check.call(_this)){
					dispatch_onerror.call(_this);
					return;
				}

				this.setResponseType("text");
				_this._queue_attch_type = QUEUE_ATTACH_TYPE.FIRST;

				load.call(_this,function(){
					var response = _this.response;
					if(response.ok){
						dispatch_onload.call(_this,response.responseText);
					}else{
						dispatch_onerror.call(_this);
					}
				});
			},

			// -
			// 読み込みを開始(DataUriScheme 形式)
			// -
			loadDataUriScheme : function(){
				var _this = this;
				if(!init_verify_check.call(_this)){
					dispatch_onerror.call(_this);
					return;
				}

				this.setResponseType("dataurischeme");

				load.call(_this,function(){
					var response = _this.response;
					if(response.ok){
						dispatch_onload.call(_this,response.responseText);
					}else{
						dispatch_onerror.call(_this);
					}
				});
			},

			// -
			// 読み込みを開始(IMG要素を生成)
			// -
			loadImage : function(){
				if(!init_verify_check.call(this)){
					dispatch_onerror.call(this);
					return;
				}

				var options = {tagName:"IMG"};
				options.src_type = project.getSourceLoadExpandImage();
				load_element.call(this,options);
			},

			// -
			// 読み込みを開始(AUDIO要素を生成)
			// -
			loadAudio : function(){
				if(!init_verify_check.call(this)){
					dispatch_onerror.call(this);
					return;
				}

				if(!(window.HTMLAudioElement)){
					this.response.errorText = "not support HTMLAudioElement";
					dispatch_onerror.call(_this);
					return;
				}

				var options = {tagName:"AUDIO"};
				options.src_type = project.getSourceAudioElement();
				load_element.call(this,options);
			},
			// -
			// 読み込みを開始(VIDEO要素を生成)
			// -
			loadVideo : function(){
				if(!init_verify_check.call(this)){
					dispatch_onerror.call(this);
					return;
				}

				if(!(window.HTMLVideoElement)){
					this.response.errorText = "not support HTMLVideoElement";
					dispatch_onerror.call(_this);
					return;
				}

				var options = {tagName:"VIDEO"};
				options.src_type = project.getSourceVideoElement();
				load_element.call(this,options);
			},

			// -
			// 読み込みを開始(リダイレクト先を検出)
			// -
			loadFinalURL : function(){
				var _this = this;
				if(!init_verify_check.call(_this)){
					dispatch_onerror.call(_this);
					return;
				}

				var redirect_max = 16;
				var request_url = _this.request.url;
				var url_info = url_info_dictionary.addURL(_this.request.url);
				var analyze_element;

				_this.setTimeout(1000 * 10);
				_this.setResponseType("text");
				_this._xhr_type = XHR_TYPE.ONLY_BACKGROUND;
				_this._queue_attch_type = QUEUE_ATTACH_TYPE.FIRST;

				function success(next_url){
					url_info = url_info_dictionary.addURL(next_url);
					analyze_element.success(url_info);
				}

				function failure(){
					analyze_element.failure();
				}

				var redirect_status = {"300":1,"301":1,"302":1,"303":1,"307":1,"308":1};
				function loadHeader(){
					_this.setURL(url_info.getURL());
					if(!init_verify_check.call(_this)){
						failure();
						return;
					}

					_this.setMethod("HEAD");
					load.call(_this,function(){
						var response = _this.response;
						var headers = response.headers;

						if(redirect_status[response.status]){
							//	Location ヘッダを取得
							var url = headers.getResponseHeader("Location");
							if(url){
								success(url);
								return;
							}
						}

						// リダイレクトが発生した
						if(response.redirected){
							success(response.responseURL);
							return;
						}

						if((function(){
							if(!(response.ok)) return false;

							var total = parseInt(headers.getResponseHeader("Content-Length")) || 0;
							if(!total) return false;
							if(total > 1024 * 10) return false;

							var mimetype = headers.getResponseHeader("Content-Type");
							if(!(mimetype.match(/^text[/]/))) return false;

							return true;
						})()){
							loadBody();
							return;
						}

						failure();
					});
				}

				function loadBody(){
					_this.setMethod("GET");
					load.call(_this,function(){
						var response = _this.response;

						// メタタグのリダイレクトを調べる
						var redirect_url = null;
						var m = response.responseText.match(new RegExp("<meta[^>]http-equiv[ \n\r\t]*=[ \n\r\t]*\"refresh\"[^>]*>","i"));
						if(m){
							m = m[0].match(new RegExp("content[ \n\r\t]*=[ \n\r\t]*\"[0-9]+;URL=([^\"]+)\"","i"));
							if(m){
								redirect_url = m[1];
							}
						}

						if(redirect_url){
							success(redirect_url);
							return;
						}

						failure();
					});
				}

				function analyze(){
					analyze_element = url_info.analyzeRedirect();
					url_info.getRedirect(function(next){
						redirect_max -= 1;

						if((function(){
							if(!next) return true;
							if(redirect_max <= 0) return true;
							return false;
						})()){
							url_info_dictionary.getRedirectURL(request_url,function (result){
								if(result.redirected){
									dispatch_onload.call(_this,result.url_info.getURL());
								}else{
									dispatch_onerror.call();
								}
							});
							return;
						}

						url_info = next;
						analyze();
					});

					if(!analyze_element) return;

					// ヘッダの読み込み
					loadHeader();
				}

				analyze();
			},

			request : {},
			response : {},
			progress : {},
			url_parser : null,
			url_info : null,
			_queue_attch_type : QUEUE_ATTACH_TYPE.LAST,
			_xhr_type : XHR_TYPE.BY_ORIGIN
		};

		return Loader;
	})();

	// -
	// ダウンローダー
	// -
	function Downloader(){
		var _this = this;

		// -
		// デストラクタ
		// -
		function destructor(){
			if(_this._blob_url){
				BlobURLRevoke(_this._blob_url);
				_this._blob_url = null;
			}
		}

		// -
		// URL をセット
		// -
		_this.setURL = function(url){
			_this._url = url;
		};

		// -
		// 保存ファイル名をセット
		// -
		_this.setFileName = function(file_name){
			_this._file_name = file_name;
		};

		// -
		// 保存タイアログを使用する
		// -
		_this.setSaveAs = function(use){
			_this._save_as = use;
		};

		// -
		// サイレントダウンロードを使用する
		// -
		_this.setSilent = function(use){
			_this._silent = use;
		};

		// -
		// 同じリクエストを許可する
		// -
		_this.setAllowSameRequest = function(use){
			_this._allow_same_request = use;
		};

		// -
		// ダウンロード開始
		// -
		_this.start = function(){
			var queue_element = downloader_queue.createElement();
			queue_element.onstart = function(){

				var exec = function(){
					var f = download_methods.shift();
					f(response);
				};

				var response = function(response){
					var param = response.response;
					switch(response.state){
					case "progress":
						if(_this.onprogress) _this.onprogress(param);
						break;
					case "complete":
						if(!(param.result)){
							downloader_queue.addCountError();
						}
						// ロード完了を通知
						queue_element.complete();
						queue_element.release();

						if(_this.oncomplete) _this.oncomplete(param);
						destructor();
						break;					
					case "unsupported":
						exec();
						break;
					}
				};

				var data_parser = DataURL_Parser(_this._url);
				if(data_parser){
					var mimetype = data_parser.mimetype;
					var ary_buffer;
					if(data_parser.format == "base64"){
						ary_buffer = Base64_To_ArrayBuffer(_this._url.slice(data_parser.data_offset));
					}else{
						var text_encoder = new TextEncoder();
						var ary_u8 = text_encoder.encode(_this._url.slice(data_parser.data_offset));
						ary_buffer = ary_u8.buffer;
						if(!mimetype) mimetype = "text/plain";
					}

					var crc32 = new CRC32();
					crc32.initialize();
					var hash = crc32.getFromArrayBuffer(ary_buffer,ary_buffer.byteLength);
					var ext = MIMEType_To_Ext(mimetype);
					if(!ext) ext = FileSignature_To_Ext_From_ArrayBuffer(ary_buffer);
					if(!mimetype) mimetype = MIMEType_From_Ext(ext);

					// 短いアドレスを生成
					_this._short_url = "data:" + mimetype.replace(/[/]/g,"-") + "/" + hash.toString(16).toUpperCase();
					if(ext) _this._short_url += "." + ext;

					var blob = new Blob([ary_buffer],{type:mimetype});
					_this._url = _this._blob_url = BlobURLCreate(blob);
				}

				exec();
			};
			queue_element.attachLast();
		};

		// -
		// 進捗イベント
		// -
		_this.onprogress = function(response){};

		// -
		// 完了イベント
		// -
		_this.oncomplete = function(response){};

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

		// -
		// 初期化
		// -
		(function(){
			_this._url = "";
			_this._short_url = "";
			_this._file_name = "";
			_this._save_as = false;
			_this._silent = true;
			_this._allow_same_request = false;
			_this._blob_url = null;

			download_methods = new Array();

			// 重複チェック
			download_methods.push(function(callback){
				if(!(_this._allow_same_request)){
					if(address_collection.hasAddress("download",_this._url)){
						callback({
							state:"complete",
							response:{
								result:false,
								error:"Request is duplicated."
							}
						});
						return;
					}

					// アドレスを登録
					address_collection.addAddress("download",_this._url);
				}

				callback({
					state:"unsupported",
					response:{}
				});
			});


			// GM_download API
			download_methods.push(function(callback){
				if(!GM_downloadSupported()){
					callback({
						state:"unsupported",
						response:{}
					});
					return;
				}

				var file_name = ProjectDownloadSaveFile_Sanitize(_this._file_name || project.getSaveFileDownload(_this._short_url || _this._url));

				// ファイル名が長すぎるとフリーズするので回避
				if(file_name.length > 65535){
					callback({
						state:"unsupported",
						response:{}
					});
					return;
				}

				var dl_options = {
					url:_this._url,
					saveAs:_this._save_as,
					name:file_name,
					onload:function(e){
						callback({
							state:"complete",
							response:{
								result:true,
								completed:true,
								error:""
							}
						});
					},
					onerror:function(e){
						callback({
							state:"complete",
							response:{
								result:false,
								completed:true,
								error:e.error
							}
						});
					},
					onprogress:function(e){
						callback({
							state:"progress",
							response:{
								bytesLoaded:e.loaded || 0,
								bytesTotal:e.total || 0
							}
						});
					}
				};

				// ダウンロード開始
				GM_download(dl_options);
			});

			// HTML5
			download_methods.push(function(callback){
				var anchor = DocumentCreateElement("a");
				if(anchor.download === undefined){
					callback({
						state:"unsupported",
						response:{}
					});
					return;
				}

				var anchor_download = function (data_url){
					anchor.target = "PageExpandDownload";
					anchor.href = data_url;
					anchor.download = ProjectDownloadSaveFile_Sanitize(_this._file_name || project.getSaveFileDownload(_this._short_url || _this._url));
					document.body.appendChild(anchor);
					anchor.click();
					DomNodeRemove(anchor);
					anchor.href = "";
					anchor.download = "";
					callback({
						state:"complete",
						response:{
							result:true,
							completed:false,
							error:""
						}
					});
				};

				if(_this._url.search(new RegExp("^(data|blob):","i")) >= 0){
					anchor_download(_this._url);
					return;
				}

				// ローダーオブジェクトを作成
				var loader = new Loader();

				// 進捗
				loader.onprogress = function(e){
					if(_this.onprogress) _this.onprogress(e);
				};

				// 成功
				loader.onload = anchor_download;

				// 失敗
				loader.onerror = function(){
					callback({
						state:"complete",
						response:{
							result:false,
							error:"Loader is failed."
						}
					});
				};

				// DataURIScheme の読み込み
				loader.setMethod("GET");
				loader.setURL(_this._url);
				loader.loadDataUriScheme();
			});

			// 未対応
			download_methods.push(function(callback){
				callback({
					state:"complete",
					response:{
						result:false,
						error:"Downloader is not supported."
					}
				});
			});

		})();
	}

	// -
	// ダウンロードリスト
	// -
	function DownloadList(){
		var _this = this;

		// -
		// 開放
		// -
		_this.release = function(){
			while(_queue != _queue._next){
				_queue._next.release();
			}
		};

		// -
		// アイテム生成
		// -
		_this.createItem = function(){
			var _item = new Object();

			// -
			// 開放
			// -
			_item.release = function(){
				var _prev = _item._prev;
				var _next = _item._next;
				_prev._next = _next;
				_next._prev = _prev;
				_item._prev = _item;
				_item._next = _item;
			};

			// -
			// URL をセット
			// -
			_item.setURL = function(url){
				_item._url = url;
				if(!(_item._file_name)){
					_item.setFileName(project.getSaveFileBatchDownload(url));
				}
			};

			// -
			// ファイル名をセット
			// -
			_item.setFileName = function(file_name){
				_item._file_name = ProjectDownloadSaveFile_Sanitize(file_name);
			};

			// -
			// 初期化
			// -
			(function(){
				var _next = _queue;
				var _prev = _next._prev;
				_prev._next = _item;
				_next._prev = _item;
				_item._prev = _prev;
				_item._next = _next;
			})();

			return _item;
		};

		// -
		// アーカイブを作成
		// -
		_this.createArchive = function(){

			// -
			// 初期化
			// -
			var crc32 = new CRC32();
			var progress = new DownloadProgress(document.body);
			var blob_url;
			var closed = false;
			var event_dispatcher = new EventDispatcher();
			var event_handler_release;

			// -
			// 終了
			// -
			function close(){
				if(event_handler_release){
					event_handler_release.release();
					event_handler_release = null;
				}
				if(blob_url){
					BlobURLRevoke(blob_url);
					blob_url = null;
				}
				if(event_dispatcher){
					// イベントを発火
					event_dispatcher.dispatchEvent("close",_this);
					event_dispatcher.release();
					event_dispatcher = null;
				}
			}

			// -
			// 中断イベント
			// -
			progress.onclose = function (){
				closed = true;
				close();
			};

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

			// -
			// 開く
			// -
			progress.open(function (){

				// -
				// バイナリを読み込み
				// -
				function loadBinary(url,callback){
					var loader = new Loader();
					loader.onload = function(str){
						callback(str);
					};
					loader.onerror = function(){
						callback(null);
					};
					loader.setMethod("GET");
					loader.setURL(url);
					loader.overrideMimeType("text/plain; charset=x-user-defined");
					loader.loadText();
				}

				// -
				// 解析待ち
				// -
				function phaseWaitAnalyze(callback){

					progress.setMessage("Wait Analyze ...",0);
					progress.setValueProgress(0.0,0);
					progress.setValueProgress(0.0,1);

					var max = execute_queue.getCountQueue();
					var cnt = max;

					var task = task_container.createTask();
					task.setDestructorFunc(function(){
						task = null;
					});
					task.setExecuteFunc(function(){
						if(closed){
							task.release();
							return;
						}

						cnt = execute_queue.getCountQueue();
						if(max < cnt) max = cnt;
						if(cnt <= 0){
							task.release();
							callback();
							return;
						}

						var d = 1.0;
						if(max > 0) d = cnt / max;
						d = 1.0 - d;

						progress.setValueProgress(d,1);
						progress.setMessage(Math.floor(d * 100) + "% (" + (cnt) + "/" + (max) + ")",1);
					});
				}

				// -
				// ファイル名変換
				// -
				function phaseConvertFileName(items,callback){

					progress.setMessage("Converting ...",0);
					progress.setMessage("",1);
					progress.setValueProgress(0.0,0);
					progress.setValueProgress(0.0,1);

					var dic = new Object();
					var ary = new Array();
					var pos = 0;
					var num = items.length;
					(function callee(){
						if(closed) return;
						if(pos >= num){
							callback(ary);
							return;
						}

						var d = 1.0;
						if(num > 1) d = pos / (num - 1);

						item = items[pos];
						pos ++;

						progress.setValueProgress(d,1);
						progress.setMessage(item._url,1);

						if(dic[item._url] === undefined){
							var name = String_To_ArrayBuffer_As_UTF8(item._file_name);
							if(name){
								ary.push({
									file_name:name,
									item:item
								});
							}
							dic[item._url] = true;
						}else{
							item.release();
						}

						execute_queue.attachFirst(callee,null);
					})();
				}

				// -
				// 読み込み
				// -
				function phaseDownload(items,callback){

					progress.setMessage("Downloading ...",0);
					progress.setMessage("",1);
					progress.setValueProgress(0.0,0);
					progress.setValueProgress(0.0,1);

					var ary = new Array();
					var ref = 0;
					var i;
					var num = items.length;
					var total_byte = 0;
					for(i=0;i<num;i++){
						(function (){
							var item = items[i];
							loadBinary(item.item._url,function (binary){
								if(closed) return;
								if(binary){
									ary.push(item);
									item.binary = binary;
									item.file_size = binary.length;
									total_byte += item.file_size;
								}

								ref ++;
								if(num <= ref){
									callback(ary);
								}

								var d = 1.0;
								if(num > 1) d = ref / (num - 1);

								progress.setMessage(total_byte + " Byte (" + ref + "/" + num + ")",1);
								progress.setValueProgress(d,1);
							});
						})();
					}
					if(!num){
						callback(ary);
					}
				}

				// -
				// CRC32 計算
				// -
				function phaseCalculateCRC(items,callback){
					var increment = 1024 * 10;

					progress.setMessage("Calculate CRC ...",0);
					progress.setMessage("",1);
					progress.setValueProgress(0.0,0);
					progress.setValueProgress(0.0,1);

					var pos = 0;
					var num = items.length;
					(function callee(){
						if(closed) return;
						if(pos >= num){
							callback(items);
							return;
						}

						var upper = 1.0;
						if(num > 1) upper = pos / (num);

						item = items[pos];
						pos ++;

						progress.setValueProgress(upper * 0.5,0);
						progress.setValueProgress(0.0,1);
						progress.setMessage(item.item._url,1);

						var p = 0;
						var s = increment;
						var n = item.file_size;
						crc32.initialize();
						execute_queue.attachLastForInterrupt(function f(){
							if(n - p < s){
								s = n - p;
							}
							if(s <= 0){
								execute_queue.attachLastForInterrupt(callee,null);
								return;
							}
							p += s;

							var loawer = 1.0;
							if(n > 0) loawer = p / n;
							progress.setValueProgress((upper + (loawer / num)) * 0.5,0);
							progress.setValueProgress(loawer,1);

							item.crc32 = crc32.getFromStringOfBinaryData(item.binary,s);
							execute_queue.attachFirst(f,null);
						},null);

					})();
				}

				// -
				// アーカイブの作成
				// -
				function phaseCreateArchive(items,callback){

					// -
					// 初期化
					// -
					var pos = 0;
					var total = 0;
					var central_directory_pos = 0;
					var central_directory_size = 0;
					var ary_buffer;
					var data_view;
					var little_endian = true;

					// -
					// local file header のサイズを取得
					// -
					function getSize_LocalFileHeader(item){
						var file_name_size = item.file_name.byteLength;
						var extra_size = 0;
						return (30 + file_name_size + extra_size);
					}

					// -
					// file data のサイズを取得
					// -
					function getSize_LocalFileData(item){
						return (item.file_size);
					}

					// -
					// file header のサイズを取得
					// -
					function getSize_FileHeader(item){
						var file_name_size = item.file_name.byteLength;
						var extra_size = 0;
						var comment_size = 0;
						return (46 + file_name_size + extra_size + comment_size);
					}

					// -
					// End of central dir record のサイズを取得
					// -
					function getSize_EndOfCentralDirRecord(){
						return 22;
					}

					// -
					// 時刻を出力
					// -
					function writeLastModFileTime(item){
						var date_obj = item.date;
						var v = 
							((date_obj.getHours()        & 0x1f) << 11) |
							((date_obj.getMinutes()      & 0x3f) <<  5) |
							(Math.round(date_obj.getSeconds() / 2) & 0x1f);
						data_view.setUint16(pos , v , little_endian);
						pos += 2;
					}

					// -
					// 日付を出力
					// -
					function writeLastModFileDate(item){
						var date_obj = item.date;
						var v = 
							(((date_obj.getFullYear() - 1980)   & 0x7f) <<  9) |
							(((date_obj.getMonth() + 1) & 0x0f) <<  5) |
							( date_obj.getDate()  & 0x1f);
						data_view.setUint16(pos , v , little_endian);
						pos += 2;
					}

					// -
					// local file header を出力
					// -
					function writeLocalFileHeader(item){
						var name = item.file_name;
						var name_u8 = new Uint8Array(name);
						var name_size = name.byteLength;
						var file_size = item.file_size;
						var extra_size = 0;

						// シグネチャ
						data_view.setUint32(pos , 0x04034b50 , little_endian);
						pos += 4;

						// バージョン
						data_view.setUint16(pos , 10 , little_endian);
						pos += 2;

						// オプション
						data_view.setUint16(pos , 0x80 , little_endian);
						pos += 2;

						// 圧縮アルゴリズム
						data_view.setUint16(pos , 0 , little_endian);
						pos += 2;

						// タイムスタンプ(時刻)
						writeLastModFileTime(item);

						// タイムスタンプ(日付)
						writeLastModFileDate(item);

						// CRC32
						data_view.setUint32(pos , item.crc32 , little_endian);
						pos += 4;

						// ファイルサイズ
						data_view.setUint32(pos , file_size , little_endian);
						pos += 4;

						// 圧縮サイズ
						data_view.setUint32(pos , file_size , little_endian);
						pos += 4;

						// ファイル名のサイズ
						data_view.setUint16(pos , name_size , little_endian);
						pos += 2;

						// 拡張フィールドサイズ
						data_view.setUint16(pos , extra_size , little_endian);
						pos += 2;

						// ファイル名
						for(i=0;i<name_size;i++){
							data_view.setUint8(pos , name_u8[i] , little_endian);
							pos += 1;
						}
					}

					// -
					// file header を出力
					// -
					function writeFileHeader(item){
						var name = item.file_name;
						var name_u8 = new Uint8Array(name);
						var name_size = name.byteLength;
						var file_size = item.file_size;
						var extra_size = 0;
						var comment_size = 0;

						// シグネチャ
						data_view.setUint32(pos , 0x02014b50 , little_endian);
						pos += 4;

						// バージョン
						data_view.setUint16(pos , 10 , little_endian);
						pos += 2;

						// OS
						data_view.setUint16(pos , 0 , little_endian);
						pos += 2;

						// オプション
						data_view.setUint16(pos , 0x80 , little_endian);
						pos += 2;

						// 圧縮アルゴリズム
						data_view.setUint16(pos , 0 , little_endian);
						pos += 2;

						// タイムスタンプ(時刻)
						writeLastModFileTime(item);

						// タイムスタンプ(日付)
						writeLastModFileDate(item);

						// CRC32
						data_view.setUint32(pos , item.crc32 , little_endian);
						pos += 4;

						// ファイルサイズ
						data_view.setUint32(pos , file_size , little_endian);
						pos += 4;

						// 圧縮サイズ
						data_view.setUint32(pos , file_size , little_endian);
						pos += 4;

						// ファイル名のサイズ
						data_view.setUint16(pos , name_size , little_endian);
						pos += 2;

						// 拡張フィールドサイズ
						data_view.setUint16(pos , extra_size , little_endian);
						pos += 2;

						// コメントサイズ
						data_view.setUint16(pos , comment_size , little_endian);
						pos += 2;

						// ファイルヘッダのディスク位置
						data_view.setUint16(pos , 0 , little_endian);
						pos += 2;

						// 内部ファイル属性
						data_view.setUint16(pos , 0 , little_endian);
						pos += 2;

						// 外部ファイル属性
						data_view.setUint32(pos , 0 , little_endian);
						pos += 4;

						// Local file header 開始オフセット(先頭から)
						data_view.setUint32(pos , item.offset , little_endian);
						pos += 4;

						// ファイル名
						for(i=0;i<name_size;i++){
							data_view.setUint8(pos , name_u8[i] , little_endian);
							pos += 1;
						}
					}

					// -
					// End of central dir record を出力
					// -
					function writeEndOfCentralDirRecord(){
						var file_num = items.length;

						// シグネチャ
						data_view.setUint32(pos , 0x06054b50 , little_endian);
						pos += 4;

						// 同ディスク位置
						data_view.setUint16(pos , 0 , little_endian);
						pos += 2;

						// ファイル開始ディスク位置
						data_view.setUint16(pos , 0 , little_endian);
						pos += 2;

						// 同ディスク内ファイル総数
						data_view.setUint16(pos , file_num , little_endian);
						pos += 2;

						// ファイル総数
						data_view.setUint16(pos , file_num , little_endian);
						pos += 2;

						// Central directory 総サイズ
						data_view.setUint32(pos , central_directory_size , little_endian);
						pos += 4;

						// File header 開始オフセット
						data_view.setUint32(pos , central_directory_pos , little_endian);
						pos += 4;

						// コメントサイズ
						data_view.setUint16(pos , 0 , little_endian);
						pos += 2;
					}

					// -
					// ファイルデータ出力
					// -
					function phaseWriteFileData(items,callback){

						var increment = 1024 * 10;

						progress.setMessage("Write File Data ...",0);
						progress.setMessage("",1);
						progress.setValueProgress(0.5,0);
						progress.setValueProgress(0.0,1);

						var i = 0;
						var num = items.length;
						(function callee(){
							if(closed) return;
							if(i >= num){
								callback(items);
								return;
							}

							var upper = 1.0;
							if(num > 1) upper = i / (num);

							item = items[i];
							i ++;

							progress.setValueProgress(upper * 0.5 + 0.5,0);
							progress.setValueProgress(0.0,1);
							progress.setMessage(item.item._url,1);

							writeLocalFileHeader(item);

							var p = 0;
							var s = increment;
							var n = item.file_size;
							var e;
							var binary = item.binary;
							delete item.binary;
							crc32.initialize();
							execute_queue.attachLastForInterrupt(function f(){
								if(n - p < s){
									s = n - p;
								}
								if(s <= 0){
									execute_queue.attachLastForInterrupt(callee,null);
									return;
								}

								e = p + s;
								while(p < e){
									data_view.setUint8(pos , (binary.charCodeAt(p) & 0xff) , little_endian);
									pos += 1;
									p ++;
								}

								var loawer = 1.0;
								if(n > 0) loawer = p / n;
								progress.setValueProgress(loawer,1);
								progress.setValueProgress((upper + (loawer / num)) * 0.5 + 0.5,0);

								execute_queue.attachFirst(f,null);
							},null);

						})();
					}

					// -
					// 中央ディレクトリ出力
					// -
					function phaseWriteCentralDirectory(items,callback){

						var increment = 1024 * 10;

						progress.setMessage("Write Central Directory ...",0);
						progress.setMessage("",1);
						progress.setValueProgress(1.0,0);
						progress.setValueProgress(0.0,1);

						var i = 0;
						var num = items.length;
						(function callee(){
							if(closed) return;
							if(i >= num){
								writeEndOfCentralDirRecord();
								callback(items);
								return;
							}

							item = items[i];
							i ++;

							var lower = 1.0;
							if(num > 1) lower = i / (num);

							progress.setValueProgress(lower,1);
							progress.setMessage(item.item._url,1);

							writeFileHeader(item);
							execute_queue.attachLastForInterrupt(callee,null);
						})();
					}

					(function(){
						var date_obj = new Date();

						// 総サイズ
						var i;
						var num = items.length;
						for(i=0;i<num;i++){
							var item = items[i];
							item.offset = total;
							total += getSize_LocalFileHeader(item);
							total += getSize_LocalFileData(item);
							item.index = i;
							item.date = date_obj;
						}
						central_directory_pos = total;

						for(i=0;i<num;i++){
							var item = items[i];
							central_directory_size += getSize_FileHeader(item);
						}
						total += central_directory_size;
						total += getSize_EndOfCentralDirRecord();

						// バイナリ生成
						ary_buffer = new ArrayBuffer(total);
						data_view = new DataView(ary_buffer);

						// 出力
						phaseWriteFileData(items,function(items){
							phaseWriteCentralDirectory(items,function(items){

								var download_file_name = "PageExpand_" + date_obj.getTime() + ".zip";

								// クローズイベント
								function close_event(){
									var event_handler = event_dispatcher.createEventHandler("close");
									event_handler.setFunction(function(){
										var i = 0;
										var num = items.length;
										for(i=0;i<num;i++){
											var item = items[i];
											item.item.release();
										}
									});
								}

								// 成功
								function success(){
									if(closed) return;
									close_event();
									progress.close();
									close();
								}

								// 失敗
								function failure(src){
									if(closed) return;

									close_event();
									progress.setMessage("Complete",0);
									progress.setMessage("Save Zip File As ...",1);
									progress.setAnchor({href:src,download:download_file_name});
								}

								progress.setMessage("",1);
								progress.setValueProgress(1.0,0);
								progress.setValueProgress(1.0,1);

								progress.setMessage("Create Blob URL ...",0);
								setTimeout(function(){
									try{
										var blob = new Blob([new Uint8Array(ary_buffer)],{type:"application/zip"});
										blob_url = BlobURLCreate(blob);
									}catch(e){
									}

									if(blob_url){
										progress.setMessage("Wait ...",0);
										setTimeout(function(){
											var downloader = new Downloader();
											downloader.setURL(blob_url);
											downloader.setFileName(download_file_name);
											downloader.setSaveAs(true);
											downloader.onprogress = function(response){
												var loaded = response.bytesLoaded;
												var total = response.bytesTotal;
												if(total < loaded) total = loaded;
												progress.setValueProgress(loaded/total,1);
												progress.setMessage(loaded + " / " + total + " Byte",1);
											}
											downloader.oncomplete = function(response){
												progress.setMessage("Complete",0);
												if(response.result && response.completed){
													success();
												}else{
													failure(blob_url);
												}
											}
											downloader.start();
										},1);
									}else{
										progress.setMessage("Create Data URI Scheme ...",0);
										Base64_From_ArrayBuffer_Async(ary_buffer,function(base64){
											progress.setMessage("Wait ...",0);
											progress.setMessage("",1);
											progress.setValueProgress(1.0,1);
											setTimeout(function(){
												failure("data:application/zip;base64," + base64);
											},1);
										},{
											onprogress:function(e){
												progress.setMessage(e.loaded + "/" + e.total + " Byte",1);
												progress.setValueProgress(e.loaded/e.total,1);
											}
										});
									}
								},1);

							});
						});
					})();
				}

				(function(){
					phaseWaitAnalyze(function(){

						// 配列に格納
						var items = new Array();
						var item = _queue._next;
						while(_queue != item){
							items.push(item);
							item = item._next;
						}

						phaseConvertFileName(items,function(items){
							phaseDownload(items,function(items){
								phaseCalculateCRC(items,function(items){
									phaseCreateArchive(items,function(items){
										progress.close();
									});
								});
							});
						});
					});
				})();
			});

		};

		// -
		// クリア
		// -
		_this.clear = function(){
			_queue._prev = _queue;
			_queue._next = _queue;
		};

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

		// -
		// 初期化
		// -
		(function(){
			_queue = new Object();
			_queue._prev = _queue;
			_queue._next = _queue;
		})();

	}

	// -
	// タスクコンテナ
	// -
	function TaskContainer(){
		var _this = this;

		// -
		// タスク生成
		// -
		_this.createTask = function(parent){
			var _task = new Object();

			// -
			// タスクを実行
			// -
			_task.execute = function(level){
				if(!_task._alive)	return;
				if(_task._execute_func){
					if(level & _task._level){
						try{
							_task._execute_func(_task);
						}catch(e){
							if(project.getEnableDebugMode()){
								ConsoleError(e.stack);
							}
						}
					}
				}
			};

			// -
			// タスクを破棄
			// -
			_task.release = function(){
				_task.releaseChild();
				TaskRelease(_task);
			};

			// -
			// 子タスクをすべて破棄
			// -
			_task.releaseChild = function(){
				var a = new Array();
				var child = _task._child;
				var task = child._next;
				while(task != child){
					a.push(task);
					task = task._next;
				}
				var i;
				var num = a.length;
				for(i=0;i<num;i++){
					task = a[i];
					task.releaseChild();
					TaskRelease(task);
				}
			};

			// -
			// 子タスクとして登録
			// -
			_task.attachChild = function(task){
				task.removeParent();
				var prev = _task._child;
				var next = prev._next;
				prev._next = task;
				next._prev = task;
				task._prev = prev;
				task._next = next;
				task._parent = _task;
				_task._child_count += 1;
			};

			// -
			// 自身の親子関係を外す
			// -
			_task.removeParent = function(){
				if(_task._parent){
					_task._parent._child_count -= 1;
					var prev = _task._prev;
					var next = _task._next;
					prev._next = next;
					next._prev = prev;
					_task._prev = _task;
					_task._next = _task;
					_task._parent = null;
				}
			};

			// -
			// 子の親子関係を外す
			// -
			_task.removeChild = function(){
				var a = new Array();
				var child = _task._child;
				var task = child._next;
				while(task != child){
					a.push(task);
					task = task._next;
				}

				var i;
				var num = a.length;
				for(i=0;i<num;i++){
					task = a[i];
					task.removeParent();
				}
			};

			// -
			// 子を取得
			// -
			_task.getChild = function(func){
				var a = new Array();
				var child = _task._child;
				var task = child._next;
				while(task != child){
					a.push(task);
					task = task._next;
				}

				var i;
				var num = a.length;
				for(i=0;i<num;i++){
					task = a[i];
					func(task);
				}
			};

			// -
			// 親を取得
			// -
			_task.getParent = function(){
				return _task._parent;
			};

			// -
			// 実行関数をゲット
			// -
			_task.getExecuteFunc = function(){
				return _task._execute_func;
			};

			// -
			// 実行関数をセット
			// -
			_task.setExecuteFunc = function(func){
				_task._execute_func = func;
			};

			// -
			// デストラクタ関数をゲット
			// -
			_task.getDestructorFunc = function(){
				return _task._destructor_func;
			};

			// -
			// デストラクタ関数をゲット
			// -
			_task.setDestructorFunc = function(func){
				_task._destructor_func = func;
			};

			// -
			// 自身の前の優先度でタスクを登録
			// -
			_task.attachPrioPrev = function(task){
				TaskRemovePrio(task);
				var prev = _task._prio_prev;
				var next = _task;
				prev._prio_next = task;
				next._prio_prev = task;
				task._prio_prev = prev;
				task._prio_next = next;
			};

			// -
			// 自身の後の優先度でタスクを登録
			// -
			_task.attachPrioNext = function(task){
				TaskRemovePrio(task);
				var prev = _task;
				var next = _task._prio_next;
				prev._prio_next = task;
				next._prio_prev = task;
				task._prio_prev = prev;
				task._prio_next = next;
			};

			// -
			// 自身の直前の優先度に位置するタスクを取得
			// -
			_task.getPrioPrev = function(){
				return _task._prio_prev;
			};

			// -
			// 自身の直後の優先度に位置するタスクを取得
			// -
			_task.getPrioNext = function(){
				return _task._prio_next;
			};

			// -
			// 子の総数を取得
			// -
			_task.getCountChild = function(){
				return _task._child_count;
			};

			// -
			// タスクレベルをゲット
			// -
			_task.getLevel = function(){
				return _task._level;
			};

			// -
			// タスクレベルをセット
			// -
			_task.setLevel = function(level){
				_task._level = level;
			};

			// -
			// 生存状態をゲット
			// -
			_task.getAlive = function(){
				return _task._alive;
			};

			// -
			// ユーザーワークを取得
			// -
			_task.getUserWork = function(){
				return _task._user_work;
			};

			// -
			// 初期化
			// -
			_task._prio_prev = _task;
			_task._prio_next = _task;
			_task._prev = _task;
			_task._next = _task;
			_task._parent = null;
			_task._child_count = 0;
			_task._child = new Object();
			_task._child._prev = _task._child;
			_task._child._next = _task._child;
			_task._alive = true;
			_task._level = 0xffffffff;
			_task._user_work = new Object();
			_task._execute_func = null;
			_task._destructor_func = null;

			if(parent){
				parent.attachChild(_task);
			}
			_this.attachPrioLast(_task);

			if(_task_count == 1){
				if(_start_func)	_start_func();
			}
			_task_count += 1;

			return _task;
		};

		// -
		// タスクコンテナ実行
		// -
		_this.execute = function(level){
			var a = new Array();
			var task = _this._prio_next;
			while(task != _this){
				a.push(task);
				task = task._prio_next;
			}

			var i;
			var num = a.length;
			for(i=0;i<num;i++){
				task = a[i];
				if(task.getAlive()){
					task.execute(level);
				}else{
					// 開放
					var prev = task._prio_prev;
					var next = task._prio_next;
					prev._prio_next = next;
					next._prio_prev = prev;
					task._prio_prev = task;
					task._prio_next = task;
				}
			}
		};

		// -
		// タスクコンテナ開放
		// -
		_this.release = function(){
			var a = new Array();
			var task = _this._prio_next;
			while(task != _this){
				a.push(task);
				task = task._prio_next;
			}

			var prev;
			var next;
			var i;
			var num = a.length;
			for(i=0;i<num;i++){
				task = a[i];
				TaskRelease(task);
				prev = task._prio_prev;
				next = task._prio_next;
				prev._prio_next = next;
				next._prio_prev = prev;
				task._prio_prev = task;
				task._prio_next = task;
			}
		};

		// -
		// 子としてタスクを登録
		// -
		_this.attachChild = function(task){
			_root_task.attachChild(task);
		};

		// -
		// 優先度を最前列で登録
		// -
		_this.attachPrioFirst = function(task){
			TaskRemovePrio(task);
			var prev = _this;
			var next = prev._prio_next;
			prev._prio_next = task;
			next._prio_prev = task;
			task._prio_prev = prev;
			task._prio_next = next;
		};

		// -
		// 優先度を最後尾で登録
		// -
		_this.attachPrioLast = function(task){
			TaskRemovePrio(task);
			var next = _this;
			var prev = next._prio_prev;
			prev._prio_next = task;
			next._prio_prev = task;
			task._prio_prev = prev;
			task._prio_next = next;
		};

		// -
		// 優先度を外す(内部用)
		// -
		function TaskRemovePrio(task){
			var next = task._prio_next;
			if(task != next){
				var prev = task._prio_prev;
				prev._prio_next = next;
				next._prio_prev = prev;
				task._prio_prev = task;
				task._prio_next = task;
			}
		}

		// -
		// 開放(内部用)
		// -
		function TaskRelease(task){
			if(task._alive){
				task._alive = false;

				if(task._destructor_func){
					task._destructor_func(task);
				}

				task.removeParent();

				task._user_work = null;
				_task_count -= 1;

				if(_task_count == 1){
					if(_end_func)	_end_func();
				}
			}
		}

		// -
		// タスク総数を取得
		// -
		_this.getCountTask = function(){
			return _task_count - 1;
		};

		// -
		// 開始関数をセット
		// -
		_this.setStartFunc = function(f){
			_start_func = f;
		};

		// -
		// 終了関数をセット
		// -
		_this.setEndFunc = function(f){
			_end_func = f;
		};

		// -
		// プライベート変数
		// -
		var _root_task;
		var _task_count;
		var _start_func = null;
		var _end_func = null;

		// -
		// 初期化
		// -
		_task_count = 0;
		_this._prio_prev = _this;
		_this._prio_next = _this;
		_root_task = _this.createTask(null);
	}

	// -
	// ローダー進捗通知
	// -
	function NotifyProgress(){
		var _this = this;

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

		// -
		// 要素生成
		// -
		_this.createElement = function(){
			var _element = new Object();

			// -
			// 開放
			// -
			_element.release = function(){
				// マウスイベントを外す
				removeEventMouseOver();
				// タッチイベントを外す
				removeEventTouchStart();
				// タスクを破棄
				releaseTask();
			};

			// -
			// 当たり判定用エレメントをセット
			// -
			_element.setElementHitArea = function(element){
				_element_hit_area = element;

				// マウスイベントを開始
				addEventMouseOver();
				// タッチイベントを開始
				addEventTouchStart();

				// マウスとの当たり判定
				if(ElementHitTestMousePosition(element,input_mouse.getPositionClient(),true)){
					createTask();
				}
			};

			// -
			// 通知をセット
			// -
			_element.setNotify = function(type){
				_notify = type;
				ElementSetNotify(_element,_notify);
			};

			// -
			// 通知をセット
			// -
			_element.hitTest = function(){
				return _hittest;
			};

			// -
			// マウスオーバーイベントを追加(内部用)
			// -
			function addEventMouseOver(){
				removeEventMouseOver();

				if(_element_hit_area.addEventListener){
					_element_hit_area.addEventListener("mouseover",mouseOver,false);
				}else if(_element_hit_area.attachEvent){
					_element_hit_area.attachEvent("onmouseover",mouseOver);
				}
			}

			// -
			// マウスオーバーイベントを外す(内部用)
			// -
			function removeEventMouseOver(){
				if(_element_hit_area.removeEventListener){
					_element_hit_area.removeEventListener("mouseover",mouseOver,false);
				}else if(_element_hit_area.detachEvent){
					_element_hit_area.detachEvent("onmouseover",mouseOver);
				}
			}


			// -
			// タッチスタートイベントを追加(内部用)
			// -
			function addEventTouchStart(){
				removeEventTouchStart();

				if(_element_hit_area.addEventListener){
					//_element_hit_area.addEventListener("touchstart",touchStart,false);
				}
			}

			// -
			// タッチスタートイベントを外す(内部用)
			// -
			function removeEventTouchStart(){
				if(_element_hit_area.removeEventListener){
					//_element_hit_area.removeEventListener("touchstart",touchStart,false);
				}
			}

			// -
			// マウスオーバーイベント(内部用)
			// -
			function mouseOver(e){
				// マウス入力を更新
				input_mouse.setMouseEvent(e);

				// タスクを生成
				createTask();
			}

			// -
			// タッチスタートイベント(内部用)
			// -
			function touchStart(e){
				// タッチ入力を更新
				input_touch.setTouchEvent(e);

				// タスクを生成
				createTask();
			}

			// -
			// マウスムーブ(内部用)
			// -
			function mouseMove(){
				if(!_task)	return;

				var work = _task.getUserWork();
				var hit = ElementHitTestPosition(_element_hit_area,input_mouse.getPositionClient(),true);
				if(!input_mouse.getEnableMouse()){
					hit = false;
				}
				if(!hit){
					releaseTask();
				}
			}

			// -
			// タスク生成(内部用)
			// -
			function createTask(){
				if(!_task){
					_hittest = true;

					ElementFocus(_element);
					ElementSetNotify(_element,_notify);

					_task = task_container.createTask();
					_task.setDestructorFunc(function(){
						_hittest = false;
						ElementBlur(_element);
						_task = null;
					});
					_task.setExecuteFunc(function(){
						mouseMove();
					});
					_task.execute(0xffffffff);
				}
			}

			// -
			// タスク破棄(内部用)
			// -
			function releaseTask(){
				if(_task){
					_task.release();
					_task = null;
				}
			}

			// -
			// プライベート変数
			// -
			var _element_hit_area;
			var _notify;
			var _task;
			var _hittest;

			// -
			// 初期化
			// -
			(function(){
				_element_hit_area = null;
				_notify = NotifyProgress.NOTIFY_TYPE_UNKNOWN;
				_task = null;
				_hittest = false;
			})();

			return _element;
		};

		// -
		// アクティブ
		// -
		function ElementFocus(element){
			_active = element;

			if(!_task){
				// タスクを生成
				_task = task_container.createTask();
				_task.setDestructorFunc(NotifyIconDestructor);
				_task.setExecuteFunc(NotifyIconInitialize);
				_task.execute(0xffffffff);
			}else{
				_task.setExecuteFunc(NotifyIconFadeIn);
			}

		}

		// -
		// 非アクティブ
		// -
		function ElementBlur(element){
			if(element != _active)	return;

			if(_task){
				_task.setExecuteFunc(NotifyIconFadeOut);
			}
		}

		// -
		// 通知をセット
		// -
		function ElementSetNotify(element,type){
			if(element != _active)	return;
			if(_notify == type)	return;

			switch(type){
			case NotifyProgress.NOTIFY_TYPE_LOADING:
				_icon.src = "data:image/gif;base64,R0lGODlhGAAYALMAAP//3vf31sXFtYyMjHuEjGNrc0pSY0JKUv///wAAAAAAAAAAAAAAAAAAAAAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh+QQJCAAIACwAAAAAGAAYAAAEexDJSZExNetpQsBbRVQHABwhNQgFVZ6pRAhA0EovGiNFUN+dz07Sq4Euw0lRl6wYmM2o5nk4gFJUq8VnEoY6JiO4e51yjZaqNpYtS7FQlzuzzJRsoaIXuf1p9EAeIIAiNHg4JkxFAiMqLC6JFAUCAxqNEzkiSUFzTXwhEQAh+QQJCAAIACwAAAAAFgAYAAAEfxDJSZExNWsbAt4TUR0AcFQiNQgFRZpUIQyhAASt9J5SEQCCFMJ3yxk6HyKuovxcJMeihshzSTeG6ugD6mayhwPXC/2VPORJ9Dwmg8XpuByqdbVjvzqCtMw0oU4/fRNKRkg9gjkIBDaDO4Q/QRMrinslWjI0FEI6lyhuh3OAIBEAIfkECQgACAAsAAAAABgAGAAABHoQyUmRMTXraULAW0VUBwAcojYIBVWeVCEMogAErfSiUhEAglHsh5N0Pj1iruK7gS5GZajJc92WG0OVBAp5vdrDoRsKjy0/E7KcdnZMTnAbaSZnxeevXqPdb6h+TERPdlNSaGteBDZFOiZbIStYO35CE5SBFEeFgVBeEQAh+QQJCAAIACwAAAAAGAAWAAAEexDJSZExNetpQsBbRVQHAByiNggFVZ5UIQyiAASt9KJSEQCCUeyHk3Q+PWKu4ruBLkZlqMlz3ZYbQ5UECnm92sOhGwqPLT8Tspx2dkxOcBtpJmfF569eo93kpz9bOleAcRVvRRlNiYpSFAQ2jBpNQRUrWBsyNBlCep0IEQAh+QQJCAAIACwAAAAAGAAYAAAEeRDJSZExNetpQsBbRVQHAByiNggFVZ5UIQyiAASt9KJSEQCCUeyHk3Q+PWKu4ruBLkZlqMlz3ZYbQ5UECnm92sOhGwqPLT8Tspx2dkxOcBtpJmfF569+77LzdVd/Fk9Se0cgTUV6OxNNQYsmWzI0kDAUQnqHghVQXhEAIfkECQgACAAsAgAAABYAGAAABH0QyTmNoThTE8LVFIEdAHBgIjUIBUWaVCEMEyEAQSu9p1QEAEEK8cPpOB4fMIcpJhEWCceoKfZcVJDhOvqAvuDw5kD2iqHA0vM8VZvF2/J5vgUd3jEgd5dtLj9RaH1KWUgfTjoINn08E0VCEyuJCI2OMygjJXtDX4ZzGIFfEQAh+QQJCAAIACwAAAAAGAAYAAAEfBDJSZExNetpQsBbKB0AcFSESJEmVQiDOpanVASAkKrdZ+OBgkxyIQKFwwopmNQcQM2k4UCFhqZVC67ku24Bn04JbM2IuRjsU6YuR0XTzVp0aynBSE29W9Ti9UdGXXt5EgQCfzN2CHU6FQMChSw1NjAaOxOTKFIebk19IREAIfkECQgACAAsAAACABgAFgAABHgQSUSmvbLiIQrGhTBchAAE3icVASBoE3umYIt+cmBghk3XgAPmMFNNDMLPYWdsOpGHpRMBlfYAWF3zmjVwT0zVV1sNG8vTNC85NONa7AnxpsoxvZIr/ZJL9bQIfSQme0RBMS0vFxw/hnEhIxgwEo4kan9uanmZFxEAOw==";
				break;
			case NotifyProgress.NOTIFY_TYPE_COMPLETE:
				_icon.src = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAMAAADXqc3KAAAAA3NCSVQICAjb4U/gAAAAwFBMVEX///+A/4CA/4D///+A/4CA/4CA/4CA/4Dn5+eA/4CA/4CA/4CA/4CA/4CSkpIqWyr5+fng4OB9fX0REREAAAAgSiAxajH6+vrz8/Pw8PDq6urX19fHx8fExMSqqqqnp6ejo6Oenp6ZmZmWlpYtLS0lJSUeHh6Mx4yu564IHAg0RTQ5TTk4STgqNioLIAtxd3FwfXBcdVyP+Y9Ci0ImUibT09O7u7uJiYmCgoJ6enpsbGxgYGBHR0c+Pj42NjYnJyeRSLVtAAAAQHRSTlMA7iL/iFUzRP8Rd6rdzP/u///////M7v////////////////////8iM3eZqqq7u8zd3e7u7v//////////////aE0y2QAAAAlwSFlzAAALEgAACxIB0t1+/AAAABx0RVh0U29mdHdhcmUAQWRvYmUgRmlyZXdvcmtzIENTNui8sowAAAAWdEVYdENyZWF0aW9uIFRpbWUAMDEvMDcvMTOlb7SWAAAA4UlEQVQokZ3R1xKCMBAFUNJIKFawF6zYe+///1dmJaA4vOh9PDczm9nVtH9jYBUj7ljnnMlwruO4M5O+YjJ9GHNq2UjGtig7ea3721NI5Vgn5OAGcz/dKxORd4MfYG5aocvnIu1yrApqK6+BO4WwYFR57uVFyr4K8I5fRFGxXEldowZ4L4OiolVrdGWzJ4S0waNisSuVyqIpvXoFt2k4/JHLEoi4bGGUZarCGN8q0Ii8A56iTFcrxtNzBdwNPVownnSz1bSzCZb4uXg8a7b7BbX2+EH8/jzpUJo2GCWf9oc8AZktDpWygbAkAAAAAElFTkSuQmCC";
				break;
			case NotifyProgress.NOTIFY_TYPE_ERROR:
				_icon.src = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAMAAADXqc3KAAAAA3NCSVQICAjb4U/gAAAAwFBMVEX/////VVX3UlJNbGyULi4mDw86GhoMERHoTEzPRET/pqb/ZmZ0MTGZMzN0JCQYIiIMERH/xcWfqqrDWVnUS0u+T0+SPz9sQkJ6OTkRGBj84ODzZmboWVl3YmJhIiJMIiJBIiIGCAgRGBiIv79okpIuQUEGCAjk///N9va66enW3Ny11tb/trbqkpKOm5u7hYWGfHyycXFZfHzgVFSsX1+cTk6xQUF3SEhTTExSOzt5JCRiKysXCAh/srIRGBgpOTlzKqofAAAAQHRSTlMA///////////////////M3f//////////3f////////+ZzN3d3d3/////////////////////////////mZnMlM/YUAAAAAlwSFlzAAALEgAACxIB0t1+/AAAABx0RVh0U29mdHdhcmUAQWRvYmUgRmlyZXdvcmtzIENTNui8sowAAAAWdEVYdENyZWF0aW9uIFRpbWUAMDEvMDcvMTOlb7SWAAABLElEQVQokV2SZ2OCMBCG7yCJQAEBqWKdbUVbtzg6tPX//6teBiK9T8n75HYAjNmTwpYGdXtdzOOl53mrzSC/199n8QNq6x2+Kv3tqZSl7f2a7gw558J3LbTSs4mj3g+f1UW0ibhjlXem4hgAzQzRYl06LWIV2R39anI90oVcfubkkNKrNGtq8tlDK7RhQg6nqQgodEl2iEEExRJRAIxORPwXBbYEGmB7iJxu50cK58uksK4B6EjSliRBZBoIqEh+AytEMwNJ8FhACzGMwN5Q2doFPkiivmk+gsY/oLIzXQ4MWnqOTGbND7Ic08Ja6Y6Yqk77MqnZQir174sJTQT7u+06SVpK5+VCOnur2pMT3nQaCHMNchi/3C+9Ow5ZwBgLBZ/++yd21CCLbt/nD9ghFMIF8V9xAAAAAElFTkSuQmCC";
				break;
			}
			
			_notify = type;
		}

		// -
		// マウスムーブ(内部用)
		// -
		function mouseMove(){
			if(!_task)	return;
			var work = _task.getUserWork();
			var mouse_pos = input_mouse.getPositionClient();
			_icon.style.left = (mouse_pos.x - 24.0/2.0) + "px";
			_icon.style.top  = (mouse_pos.y - 24.0-2.0) + "px";
		}

		// -
		// 初期化(内部用)
		// -
		function NotifyIconInitialize(task){
			var work = task.getUserWork();

			work.anime_pos = 0.0;
			work.anime_spd = 0.0;

			// 最前面に配置
			_icon.style.zIndex = 0x7FFFFFFF;
			_icon.style.position = "fixed";
			_icon.style.pointerEvents = "none";
			document.body.appendChild(_icon);

			task.setExecuteFunc(NotifyIconFadeIn);
			task.execute(0xffffffff);
		}

		// -
		// デストラクタ(内部用)
		// -
		function NotifyIconDestructor(task){
			DomNodeRemove(_icon);
			_task = null;
		}

		// -
		// フェードイン(内部用)
		// -
		function NotifyIconFadeIn(task){
			var work = task.getUserWork();

			// マウスムーブ
			mouseMove();

			var sub = 1.0 - work.anime_pos;
			sub *= 0.4;
			if(sub > 0.0){
				work.anime_spd += 0.05;
				if(work.anime_spd > 0.2)	work.anime_spd = 0.2;
				if(work.anime_spd > sub)	work.anime_spd = sub;
			}

			work.anime_pos += work.anime_spd;
			if(work.anime_pos > 0.999){
				work.anime_spd = 0.0;
				work.anime_pos = 1.0;
				task.setExecuteFunc(NotifyIconShowInit);
			}
			_icon.style.opacity = work.anime_pos;
		}

		// -
		// 表示(内部用)
		// -
		function NotifyIconShowInit(task){
			var work = task.getUserWork();

			work.anime_pos = 1.0;
			work.anime_spd = 0.0;
			_icon.style.opacity = work.anime_pos;

			task.setExecuteFunc( NotifyIconShowExec);
			task.execute(0xffffffff);
		}
		function NotifyIconShowExec(task){
			var work = task.getUserWork();

			// マウスムーブ
			mouseMove();
		}

		// -
		// フェードアウト(内部用)
		// -
		function NotifyIconFadeOut(task){
			var work = task.getUserWork();

			// マウスムーブ
			mouseMove();

			var sub = 0.0 - work.anime_pos;
			sub *= 0.4;
			if(sub < 0.0){
				work.anime_spd -= 0.2;
				if(work.anime_spd < sub)	work.anime_spd = sub;
			}
			work.anime_pos += work.anime_spd;
			if(work.anime_pos < 0.001){
				work.anime_spd = 0.0;
				work.anime_pos = 0.0;
				task.setExecuteFunc(NotifyIconClose);
			}
			_icon.style.opacity = work.anime_pos;
		}

		// -
		// 閉じる(内部用)
		// -
		function NotifyIconClose(task){
			var work = task.getUserWork();
			task.release();
		}

		// -
		// プライベート変数
		// -
		var _icon;
		var _active;
		var _notify;

		var _task;

		// -
		// 初期化
		// -
		(function(){
			_icon = DocumentCreateElement("img");
			_notify = NotifyProgress.NOTIFY_TYPE_UNKNOWN;
		})();
	}
	NotifyProgress.NOTIFY_TYPE_UNKNOWN = 0;
	NotifyProgress.NOTIFY_TYPE_LOADING = 1;
	NotifyProgress.NOTIFY_TYPE_COMPLETE = 2;
	NotifyProgress.NOTIFY_TYPE_ERROR = 3;
	NotifyProgress.NOTIFY_TYPE_RELEASE = 4;


	// -
	// ダブルタッチ補助
	// -
	function DoubleTouchAssist(){
		var _this = this;

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

		// -
		// 表示開始
		// -
		_this.setShow = function (pos,vec){
			if(_task){
				_task.release();
				_task = null;
			}

			_task = task_container.createTask();
			_task.setDestructorFunc(AssistLineDestructor);
			_task.setExecuteFunc(AssistLineInitialize);

			var work = _task.getUserWork();
			work.pos = pos;
			work.vec = vec;

			_task.execute(0xffffffff);
		};

		// -
		// 初期化(内部用)
		// -
		function AssistLineInitialize(task){
			var work = task.getUserWork();

			var style = _line.style;
			style.left   = "0px";
			style.top    = "0px";
			style.width  = "0px";
			document.body.appendChild(_line);

			var pos = work.pos;
			var vec = work.vec;
			var bounding_size = ElementGetBoundingClientRect(_line);
			var x = vec.x * 0.5;
			var y = vec.y * 0.5;
			var r = Math.atan2(vec.y,vec.x);
			var w = Math.sqrt(vec.x * vec.x + vec.y * vec.y);

			style.left  = (pos.x - bounding_size.left - x - (w * 0.5)) + "px";
			style.top   = (pos.y - bounding_size.top  - 0 - y) + "px";
			style.width = (w) + "px";
			style.transform = style.MozTransform = style.webkitTransform = "rotate(" + (r) + "rad)";
			style.opacity = 0.5;

			work.anime_pos = 0.0;
			work.anime_spd = 0.0;

			task.setExecuteFunc(AssistLineShowInit);
			task.execute(0xffffffff);
		}

		// -
		// デストラクタ(内部用)
		// -
		function AssistLineDestructor(task){
			DomNodeRemove(_line);
			_task = null;
		}

		// -
		// 表示(内部用)
		// -
		function AssistLineShowInit(task){
			var work = task.getUserWork();
			work.frame = 30;
			task.setExecuteFunc( AssistLineShowExec);
			task.execute(0xffffffff);
		}
		function AssistLineShowExec(task){
			var work = task.getUserWork();

			work.frame -= 1;
			if(work.frame < 0){
				task.setExecuteFunc(AssistLineFadeOutInit);
			}
		}

		// -
		// フェードアウト(内部用)
		// -
		function AssistLineFadeOutInit(task){
			var work = task.getUserWork();

			work.anime_pos = 1.0;
			work.anime_spd = 0.0;

			task.setExecuteFunc( AssistLineFadeOutExec);
			task.execute(0xffffffff);
		}
		function AssistLineFadeOutExec(task){
			var work = task.getUserWork();

			var sub = 0.0 - work.anime_pos;
			sub *= 0.5;
			if(sub < 0.0){
				work.anime_spd -= 0.25;
				if(work.anime_spd < sub)	work.anime_spd = sub;
			}
			work.anime_pos += work.anime_spd;
			if(work.anime_pos < 0.01){
				work.anime_spd = 0.0;
				work.anime_pos = 0.0;
				task.setExecuteFunc(AssistLineClose);
			}
			_line.style.opacity = work.anime_pos * 0.5;
		}

		// -
		// 閉じる(内部用)
		// -
		function AssistLineClose(task){
			var work = task.getUserWork();
			task.release();
		}

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

		// -
		// 初期化
		// -
		(function(){
			_line = DocumentCreateElement("div");
			_line.style.cssText = "height:2px; border:1px solid #000; background:#FFF; border-radius:2px; box-shadow:0px 0px 2px #888;";
			_line.style.zIndex = 0x7FFFFFFF;
			_line.style.position = "absolute";
			_line.style.pointerEvents = "none";
		})();
	}

	// -
	// 可視制限コンテナ(数指定)
	// -
	function ElementLimiterByCount(){
		var _this = this;

		// -
		// 開放
		// -
		_this.release = function(){
			while(_use_list != _use_list._next){
				_use_list._next.release();
			}
			while(_rest_list != _rest_list._next){
				_rest_list._next.release();
			}
		};

		// -
		// 要素生成
		// -
		_this.createElement = function(){
			var _element = new Object();

			// -
			// 開放
			// -
			_element.release = function(){
				_element.remove();
				removeObserver();
				ElementRemove(_element);
				_count -= 1;
			};

			// -
			// 当たり判定用エレメントをセット
			// -
			_element.setElementHitArea = function(element){
				_element._element_hit_area = element;
			};

			// -
			// アタッチイベント
			// -
			_element.onattach = function(){};

			// -
			// リムーブイベント
			// -
			_element.onremove = function(){};

			// -
			// アタッチ
			// -
			_element.attach = function(){
				if(!(_element._use)){
					_element._use = true;
					_use_count += 1;
					ElementAttachUseList(_element);
					removeObserver();
					_element.onattach();
				}

			};

			// -
			// リムーブ
			// -
			_element.remove = function(){
				if(_element._use){
					_element._use = false;
					_use_count -= 1;
					ElementAttachRestList(_element);
					attachObserver();
					if(_element.onremove){
						_element.onremove();
					}
				}
			};

			// -
			// 監視開始
			// -
			function attachObserver (){
				removeObserver();
				if(!_observer_Scroll){
					_observer_Scroll = document_observer_scroll.createElement();
					_observer_Scroll.setFunction(_element.update);
				}
			}

			// -
			// 監視終了
			// -
			function removeObserver (){
				if(_observer_Scroll){
					_observer_Scroll.release();
					_observer_Scroll = null;
				}
			}

			// -
			// 更新
			// -
			_element.update = function(){
				if(_use_count < _use_max){
					// アタッチ
					_element.attach();
				}else{
					var client_size = DocumentGetClientSize(document);
					var r = DomTreeGetBoundingClientRect(_element._element_hit_area);
					if(r.right < 0){
					}else if(client_size.width < r.left){
					}else if(r.bottom < 0){
					}else if(client_size.height < r.top){
					}else{
						if(!_inner){
							// 遠い要素を外す
							var element_far = getElementFar();
							if(element_far){
								element_far.remove();
							}

							// アタッチ
							_element.attach();
						}
						_inner = true;
						return;
					}
					_inner = false;
				}
			};

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

			// -
			// 初期化
			// -
			(function(){
				_element._use = false;
				_element._prev = _element;
				_element._next = _element;
				_element._element_hit_area = null;
				attachObserver();
				ElementAttachRestList(_element);
				_inner = false;
				_count += 1;
			})();

			return _element;
		};

		// -
		// 使用数を取得
		// -
		_this.getCountUse = function(){
			return _use_count;
		};

		// -
		// 使用最大数を取得
		// -
		_this.getMaxUse = function(){
			return _use_max;
		};

		// -
		// 使用最大数をセット
		// -
		_this.setMaxUse = function(v){
			_use_max = v;
		};

		// -
		// 使用数を取得
		// -
		_this.getCount = function(){
			return _count;
		};

		// -
		// エレメントを外す(内部用)
		// -
		function ElementRemove(element){
			var _prev = element._prev;
			var _next = element._next;
			_prev._next = _next;
			_next._prev = _prev;
			element._prev = element;
			element._next = element;
		}

		// -
		// エレメント未使用リストに登録(内部用)
		// -
		function ElementAttachRestList(element){
			ElementRemove(element);
			var _prev = _rest_list;
			var _next = _prev._next;
			_prev._next = element;
			_next._prev = element;
			element._prev = _prev;
			element._next = _next;
			element._use = false;
		}

		// -
		// エレメント使用リストに登録(内部用)
		// -
		function ElementAttachUseList(element){
			ElementRemove(element);
			var _prev = _use_list;
			var _next = _prev._next;
			_prev._next = element;
			_next._prev = element;
			element._prev = _prev;
			element._next = _next;
			element._use = true;
		}

		// -
		// 一番遠い要素を取得(内部用)
		// -
		function getElementFar(){
			var client_size = DocumentGetClientSize(document);
			var client_x = client_size.width * 0.5;
			var client_y = client_size.height * 0.5;
			var element = null;
			var distance = 0;

			// 使用リスト
			var list = _use_list._next;
			while(list != _use_list){
				var next = list._next;
				var r = DomTreeGetBoundingClientRect(list._element_hit_area);

				var element_x = (r.left + r.right) * 0.5;
				var element_y = (r.top + r.bottom) * 0.5;
				var x = element_x - client_x;
				var y = element_y - client_y;
				var d = x * x + y * y;
				if(d > distance){
					distance = d;
					element = list;
				}

				list = list._next;
			}

			return element;
		}

		// -
		// プライベート変数
		// -
		var _use_list;
		var _rest_list;
		var _count;
		var _use_count;
		var _use_max;

		// -
		// 初期化
		// -
		(function(){
			_use_list = new Object();
			_rest_list = new Object();
			_count = 0;
			_use_count = 0;
			_use_max = 0;

			_use_list._prev = _use_list;
			_use_list._next = _use_list;
			_rest_list._prev = _rest_list;
			_rest_list._next = _rest_list;
		})();
	}

	// -
	// 可視制限コンテナ(バイト数指定)
	// -
	function ElementLimiterByByteSize(){
		var _this = this;

		// -
		// 開放
		// -
		_this.release = function(){
			while(_use_list != _use_list._next){
				_use_list._next.release();
			}
			while(_rest_list != _rest_list._next){
				_rest_list._next.release();
			}
		};

		// -
		// 要素生成
		// -
		_this.createElement = function(){
			var _element = new Object();

			// -
			// 開放
			// -
			_element.release = function(){
				_element.remove();
				removeObserver();
				ElementRemove(_element);
				_count -= 1;
			};

			// -
			// プリロード設定をセット
			// -
			_element.setEnablePreload = function(v){
				_element._preload = v;
			};

			// -
			// 当たり判定用エレメントをセット
			// -
			_element.setElementHitArea = function(element){
				_element._element_hit_area = element;
			};

			// -
			// サイズをセット
			// -
			_element.setByteSize = function(size){
				_element._byte_size = size;
				_byte_size_now += size;
			};

			// -
			// アタッチイベント
			// -
			_element.onattach = function(){};

			// -
			// リムーブイベント
			// -
			_element.onremove = function(){};

			// -
			// アタッチ
			// -
			_element.attach = function(){
				if(!(_element._use)){
					_element._use = true;
					_use_count += 1;
					ElementAttachUseList(_element);
					removeObserver();
					_element.onattach();
				}
			};

			// -
			// リムーブ
			// -
			_element.remove = function(){
				if(_element._use){
					_element._use = false;
					_use_count -= 1;
					ElementAttachRestList(_element);
					attachObserver();
					if(_element.onremove){
						_element.onremove();
					}

					_byte_size_now -= _element._byte_size;
					_element._byte_size = 0;
				}
			};

			// -
			// 監視開始
			// -
			function attachObserver (){
				removeObserver();
				if(!_observer_Scroll){
					_observer_Scroll = document_observer_scroll.createElement();
					_observer_Scroll.setFunction(_element.update);
				}
			}

			// -
			// 監視終了
			// -
			function removeObserver (){
				if(_observer_Scroll){
					_observer_Scroll.release();
					_observer_Scroll = null;
				}
			}

			// -
			// 更新
			// -
			_element.update = function(){
				var preload = false;

				if(_element._preload){
					if(!_limit){
						preload = true;
					}
				}

				if(preload){
					// アタッチ
					_element.attach();
				}else{
					var client_size = DocumentGetClientSize(document);
					var r = DomTreeGetBoundingClientRect(_element._element_hit_area);
					if(r.right < 0){
					}else if(client_size.width < r.left){
					}else if(r.bottom < 0){
					}else if(client_size.height < r.top){
					}else{
						if(!_inner){
							// 古いデータを破棄
							_this.removeOldElements();

							// アタッチ
							_element.attach();
						}
						_inner = true;
						return;
					}
					_inner = false;
				}
			};

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

			// -
			// 初期化
			// -
			(function(){
				_element._use = false;
				_element._byte_size = 0;
				_element._prev = _element;
				_element._next = _element;
				_element._element_hit_area = null;
				_element.setEnablePreload(true);
				attachObserver();
				ElementAttachRestList(_element);
				_inner = false;
				_count += 1;
			})();

			return _element;
		};

		// -
		// 古い要素を破棄
		// -
		_this.removeOldElements = function(){
			if(!_enable_unload)	return;

			if(_byte_size_now > _byte_size_max){
				_limit = true;
				var client_size = DocumentGetClientSize(document);

				var list = _use_list._prev;
				do {
					if(list == _use_list)	return;

					var r = DomTreeGetBoundingClientRect(list._element_hit_area);
					if(r.right < 0){
					}else if(client_size.width < r.left){
					}else if(r.bottom < 0){
					}else if(client_size.height < r.top){
					}else{
						list = list._prev;
						continue;
					}

					list = list._prev;
					list._next.remove();

				} while(_byte_size_now > _byte_size_max);
			}
		};

		// -
		// 使用数を取得
		// -
		_this.getCountUse = function(){
			return _use_count;
		};

		// -
		// 現在の使用バイト数を取得
		// -
		_this.getByteSizeNow = function(){
			return _byte_size_now;
		};

		// -
		// 使用最大バイト数をセット
		// -
		_this.setByteSizeMax = function(v){
			_byte_size_max = v * 1024 * 1024;
		};

		// -
		// アンロード設定のセット
		// -
		_this.setEnableUnload = function(v){
			_enable_unload = v;
		};

		// -
		// 使用数を取得
		// -
		_this.getCount = function(){
			return _count;
		};

		// -
		// エレメントを外す(内部用)
		// -
		function ElementRemove(element){
			var _prev = element._prev;
			var _next = element._next;
			_prev._next = _next;
			_next._prev = _prev;
			element._prev = element;
			element._next = element;
		}

		// -
		// エレメント未使用リストに登録(内部用)
		// -
		function ElementAttachRestList(element){
			ElementRemove(element);
			var _prev = _rest_list;
			var _next = _prev._next;
			_prev._next = element;
			_next._prev = element;
			element._prev = _prev;
			element._next = _next;
			element._use = false;
		}

		// -
		// エレメント使用リストに登録(内部用)
		// -
		function ElementAttachUseList(element){
			ElementRemove(element);
			var _prev = _use_list;
			var _next = _prev._next;
			_prev._next = element;
			_next._prev = element;
			element._prev = _prev;
			element._next = _next;
			element._use = true;
		}

		// -
		// プライベート変数
		// -
		var _use_list;
		var _rest_list;
		var _count;
		var _use_count;
		var _byte_size_now;
		var _byte_size_max;
		var _enable_unload;
		var _limit;

		// -
		// 初期化
		// -
		(function(){
			_use_list = new Object();
			_rest_list = new Object();
			_count = 0;
			_use_count = 0;
			_byte_size_now = 0;
			_byte_size_max = 0;
			_limit = false;

			_use_list._prev = _use_list;
			_use_list._next = _use_list;
			_rest_list._prev = _rest_list;
			_rest_list._next = _rest_list;
		})();
	}

	// -
	// イベントディスパッチャー
	// -
	function EventDispatcher(){
		var _this = this;

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

		// -
		// イベントハンドラ生成
		// -
		_this.createEventHandler = function(name){
			var _event_handler = new Object();

			// -
			// 開放
			// -
			_event_handler.release = function(){
				var _prev = _event_handler._prev;
				var _next = _event_handler._next;
				_prev._next = _next;
				_next._prev = _prev;
				_event_handler._prev = _event_handler;
				_event_handler._next = _event_handler;
				_event_handler._func = null;

				var list = _dictionary[name];
				if(list){
					if(list == list._next){
						ObjectDeleteProperty(_dictionary,name);
					}
				}
			};

			// -
			// 関数を登録
			// -
			_event_handler.setFunction = function(func){
				_event_handler._func = func;
			};

			// -
			// 初期化
			// -
			(function(){
				_event_handler._func = null;
				_event_handler._prev = _event_handler;
				_event_handler._next = _event_handler;

				var list = _dictionary[name];
				if(!list){
					list = new Object();
					list._prev = list;
					list._next = list;
					_dictionary[name] = list;
				}

				var _next = list;
				var _prev = _next._prev;
				_prev._next = _event_handler;
				_next._prev = _event_handler;
				_event_handler._prev = _prev;
				_event_handler._next = _next;
			})();

			return _event_handler;
		};

		// -
		// 発火
		// -
		_this.dispatchEvent = function(name,param){
			var list = _dictionary[name];
			if(!list)	return;

			var a = new Array();
			var handler = list._next;
			while(list != handler){
				a.push(handler);
				handler = handler._next;
			}

			var i;
			var num = a.length;
			for(i=0;i<num;i++){
				var handler = a[i];
				if(handler._func){
					handler._func(param);
				}
			}
		};

		// -
		// すべてのイベントハンドラを外す
		// -
		_this.removeAll = function(){
			for(var p in _dictionary){
				var list = _dictionary[p];
				while(true){
					var handler = list._next;
					if(list == handler)	break;
					handler.release();
				}
			}
		};

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

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

	// -
	// スクロール補正
	// -
	function DocumentReviseScroll(){
		var _this = this;

		// -
		// エレメントの挿入直前に実行
		// -
		_this.executeAttachElementBefore = function(element){
			update();
		};

		// -
		// エレメントの挿入直後に実行
		// -
		_this.executeAttachElementAfter = function(element){
			var bounding_size = DomTreeGetBoundingClientRect(element);
			_enable_revise_x = (bounding_size.right  < 0) ? true : false;
			_enable_revise_y = (bounding_size.bottom < 0) ? true : false;
			revise();
		};

		// -
		// エレメントのリムーブ直前に実行
		// -
		_this.executeRemoveElementBefore = function(element){
			var bounding_size = DomTreeGetBoundingClientRect(element);
			_enable_revise_x = (bounding_size.right  < 0) ? true : false;
			_enable_revise_y = (bounding_size.bottom < 0) ? true : false;
			update();
		};

		// -
		// エレメントのリムーブ直後に実行
		// -
		_this.executeRemoveElementAfter = function(element){
			revise();
		};

		// -
		// 更新
		// -
		function update(){
			_scroll_pos = WindowGetScrollPosition(window);
			_document_size = DocumentGetDocumentSize(document);
		}

		// -
		// 補正
		// -
		function revise(){
			var vec = {x:0,y:0};
			var document_size = DocumentGetDocumentSize(document);
			if(_enable_revise_x){
				var sub_x = document_size.width - _document_size.width;
				vec.x = sub_x;
				WindowSetScrollPositionX(window,_scroll_pos.x + sub_x);
			}
			if(_enable_revise_y){
				var sub_y = document_size.height - _document_size.height;
				vec.y = sub_y;
				WindowSetScrollPositionY(window,_scroll_pos.y + sub_y);
			}

			// イベント発火
			page_expand_event_dispatcher.dispatchEvent("revise_scroll",vec);
		}

		// -
		// プライベート変数
		// -
		var _scroll_pos;
		var _document_size;
		var _enable_revise_x;
		var _enable_revise_y;

		// -
		// 初期化
		// -
		(function(){
			_enable_revise_x = false;
			_enable_revise_y = false;
			update();
		})();
	}

	// -
	// マウス入力
	// -
	function InputMouse(window_obj){
		var _this = this;

		// -
		// 開放
		// -
		_this.release = function(){
			if(!_mouse_input_func) return;

			if(_document_obj.removeEventListener){
				_document_obj.removeEventListener("mousemove",mouse_move_func,true);
				_document_obj.removeEventListener("mouseout",mouse_out_func,true);
				_document_obj.removeEventListener("mousedown",mouse_down_func,true);
				_document_obj.removeEventListener("mouseup",mouse_up_func,true);
				_document_obj.removeEventListener("dragstart",mouse_down_func,true);
				_document_obj.removeEventListener("drag",mouse_move_func,true);
				_document_obj.removeEventListener("dragend",mouse_up_func,true);
				window_obj.removeEventListener("contextmenu",context_menu_func);
				window_obj.removeEventListener("blur",blur_func);
			}else if(_document_obj.detachEvent){
				_document_obj.detachEvent("onmousemove",mouse_move_func);
				_document_obj.detachEvent("onmouseout",mouse_out_func,true);
				_document_obj.detachEvent("onmousedown",mouse_down_func);
				_document_obj.detachEvent("onmouseup",mouse_up_func);
				_document_obj.detachEvent("ondragstart",mouse_down_func);
				_document_obj.detachEvent("ondrag",mouse_move_func);
				_document_obj.detachEvent("ondragend",mouse_up_func);
				window_obj.detachEvent("oncontextmenu",context_menu_func);
				window_obj.detachEvent("onblur",blur_func);
			}

			_mouse_input_func = null;
		};

		// -
		// マウスイベントをセット
		// -
		_this.setMouseEvent = function(e){
			if(!_mouse_input_func) return;
			mouse_move_func(e);
		};

		// -
		// マウス操作をセット
		// -
		_this.setInputMouse = function(input_mouse){
			_buttons = input_mouse.getButtons();
			_key_shift = input_mouse.getKeyShift();
			_key_ctrl = input_mouse.getKeyCtrl();
			_enable_mouse = input_mouse.getEnableMouse();
		}

		// -
		// タッチ操作をセット
		// -
		_this.setInputTouch = function(input_touch){
			if(!_mouse_input_func) return;
			if(!input_touch.getEnableTouch()){
				_buttons = 0x00;
			}

			_pos_client = input_touch.getPositionAverage();
		}

		// -
		// 座標を取得
		// -
		_this.getPositionClient = function(){
			return ObjectCopy(_pos_client);
		};

		// -
		// ボタンの押下状態を取得
		// -
		_this.getButtons = function(){
			return _buttons;
		};

		// -
		// 左ボタンの押下状態を取得
		// -
		_this.getButtonLeft = function(){
			return (_buttons & 0x01) ? true:false;
		};

		// -
		// 右ボタンの押下状態を取得
		// -
		_this.getButtonRight = function(){
			return (_buttons & 0x02) ? true:false;
		};

		// -
		// 中央ボタンの押下状態を取得
		// -
		_this.getButtonCenter = function(){
			return (_buttons & 0x04) ? true:false;
		};

		// -
		// Shift キーの押下状態を取得
		// -
		_this.getKeyShift = function(){
			return _key_shift;
		};

		// -
		// Ctrl キーの押下状態を取得
		// -
		_this.getKeyCtrl = function(){
			return _key_ctrl;
		};

		// -
		// マウスが有効か調べる
		// -
		_this.getEnableMouse = function(){
			return _enable_mouse;
		};

		// -
		// マウス移動(内部用)
		// -
		function mouse_move_func(e){
			_enable_mouse = true;
			_mouse_input_func(e,false);
		}

		// -
		// マウスアウト(内部用)
		// -
		function mouse_out_func(e){
			// クライアントサイズ
			var client_size = DocumentGetClientSize(document);
			if(e.clientX < 0) _enable_mouse = false;
			if(e.clientY < 0) _enable_mouse = false;
			if(e.clientX >= client_size.width ) _enable_mouse = false;
			if(e.clientY >= client_size.height) _enable_mouse = false;
			_mouse_input_func(e,false);
		}

		// -
		// マウスボタンダウン(内部用)
		// -
		function mouse_down_func(e){
			_mouse_input_func(e,false);
		}

		// -
		// マウスボタンアップ(内部用)
		// -
		function mouse_up_func(e){
			_mouse_input_func(e,true);
		}

		// -
		// コンテキストメニュー(内部用)
		// -
		function context_menu_func(e){
			if(e.defaultPrevented === true) return;
			if(e.returnValue === false) return;
			_buttons &= ~0x02;
		}

		// -
		// 非アクティブ(内部用)
		// -
		function blur_func(e){
			_buttons = 0x00;
			_key_shift = false;
			_key_ctrl = false;
			//_enable_mouse = false;
		}

		// -
		// プライベート変数
		// -
		var _document_obj;
		var _pos_client;
		var _buttons;
		var _key_shift;
		var _key_ctrl;
		var _enable_mouse;
		var _mouse_input_func;

		// -
		// 初期化
		// -
		(function(){
			_document_obj = window_obj.document;
			_pos_client = new Object();
			_pos_client.x = -1;
			_pos_client.y = -1;
			_buttons = 0x00;
			_key_shift = false;
			_key_ctrl = false;
			_enable_mouse = false;

			var event_type_down = { "mousedown":true , "dragstart":true };
			var event_type_move = { "mousemove":true , "drag":true      };
			var event_type_up   = { "mouseup":true   , "dragend":true   };

			if(_document_obj.addEventListener){
				_document_obj.addEventListener("mousemove",mouse_move_func,true);
				_document_obj.addEventListener("mouseout",mouse_out_func,true);
				_document_obj.addEventListener("mousedown",mouse_down_func,true);
				_document_obj.addEventListener("mouseup",mouse_up_func,true);
				_document_obj.addEventListener("dragstart",mouse_down_func,true);
				_document_obj.addEventListener("drag",mouse_move_func,true);
				_document_obj.addEventListener("dragend",mouse_up_func,true);
				window_obj.addEventListener("contextmenu",context_menu_func);
				window_obj.addEventListener("blur",blur_func);
				_mouse_input_func = function(e,r){
					if((function(){
						if(e.buttons === undefined) return false;
						if(!event_type_move[e.type]) return false;
						return true;
					})()){
						_buttons = e.buttons;
					}

					if(event_type_down[e.type]){
						if(e.button == 0) _buttons |=  0x01;
						if(e.button == 1) _buttons |=  0x04;
						if(e.button == 2) _buttons |=  0x02;
					}else if(event_type_up[e.type]){
						if(e.button == 0) _buttons &= ~0x01;
						if(e.button == 1) _buttons &= ~0x04;
						if(e.button == 2) _buttons &= ~0x02;
					}

					if(e.clientX || e.clientY){
						_pos_client.x = e.clientX;
						_pos_client.y = e.clientY;
					}
					_key_shift = e.shiftKey;
					_key_ctrl = e.ctrlKey;
				};
			}else if(_document_obj.attachEvent){
				_document_obj.attachEvent("onmousemove",mouse_move_func);
				_document_obj.attachEvent("onmouseout",mouse_out_func,true);
				_document_obj.attachEvent("onmousedown",mouse_down_func);
				_document_obj.attachEvent("onmouseup",mouse_up_func);
				_document_obj.attachEvent("ondragstart",mouse_down_func);
				_document_obj.attachEvent("ondrag",mouse_move_func);
				_document_obj.attachEvent("ondragend",mouse_up_func);
				window_obj.attachEvent("oncontextmenu",context_menu_func);
				window_obj.attachEvent("onblur",blur_func);
				_mouse_input_func = function(e,r){
					if(event_type_up[e.type]){
						_buttons &= ~(e.button);
					}else{
						_buttons  =  (e.button);
					}
					if(e.clientX || e.clientY){
						_pos_client.x = e.clientX;
						_pos_client.y = e.clientY;
					}
					_key_shift = e.shiftKey;
					_key_ctrl = e.ctrlKey;
				};
			}
		})();
	}

	// -
	// タッチ入力
	// -
	function InputTouch(){
		var _this = this;

		// -
		// 開放
		// -
		_this.release = function(){
			if(document.removeEventListener){
				document.removeEventListener("touchstart",touch_move_func,true);
				document.removeEventListener("touchmove",touch_move_func,true);
				document.removeEventListener("touchend",touch_end_func,true);
				document.removeEventListener("touchcancel",touch_end_func,true);
				window.removeEventListener("blur",blur_func);
			}

			if(_event_dispatcher){
				_event_dispatcher.release();
				_event_dispatcher = null;
			}
		};

		// -
		// タッチイベントをセット
		// -
		_this.setTouchEvent = function(e){
			touch_move_func(e);
		};

		// -
		// 平均座標を取得
		// -
		_this.getPositionAverage = function(){
			return ObjectCopy(_pos_average);
		};

		// -
		// タッチが有効か調べる
		// -
		_this.getEnableTouch = function(){
			return _enable_touch;
		};

		// -
		// タッチリストを取得する
		// -
		_this.getTouchList = function(){
			return _touch_list;
		};

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

		// -
		// タッチ入力移動(内部用)
		// -
		function touch_input_func(e){
			var touch_list = e.changedTouches;
			var i;
			var num = touch_list.length;
			for(i=0;i<num;i++){
				var touch = touch_list[i];
				_touch_list[touch.identifier] = touch;
			}

			var x = 0;
			var y = 0;
			var count = 0;
			num = _touch_list.length;
			for(i=0;i<num;i++){
				var touch = _touch_list[i];
				if(!touch) continue;
				x += touch.clientX;
				y += touch.clientY;
				count ++;
			}
			if(count){
				_pos_average.x = x / count;
				_pos_average.y = y / count;
			}
		}

		// -
		// タッチ移動(内部用)
		// -
		function touch_move_func(e){
			_enable_touch = true;
			touch_input_func(e);

			// イベントを発火
			_event_dispatcher.dispatchEvent("update",_this);
		}

		// -
		// タッチ終了(内部用)
		// -
		function touch_end_func(e){
			touch_input_func(e);

			var touch_list = e.changedTouches;
			var i;
			var num = touch_list.length;
			for(i=0;i<num;i++){
				var touch = touch_list[i];
				_touch_list[touch.identifier] = null;
			}

			i = _touch_list.length - 1;
			while(i >= 0){
				if(_touch_list[i]) break;
				i --;
			}
			_touch_list.length = i + 1;

			if(!(_touch_list.length)){
				_enable_touch = false;
			}

			// イベントを発火
			_event_dispatcher.dispatchEvent("update",_this);
		}

		// -
		// 非アクティブ(内部用)
		// -
		function blur_func(e){
			_enable_touch = false;
			_touch_list.length;

			// イベントを発火
			_event_dispatcher.dispatchEvent("update",_this);
		}

		// -
		// プライベート変数
		// -
		var _pos_average;
		var _touch_list;
		var _enable_touch;
		var _event_dispatcher;

		// -
		// 初期化
		// -
		(function(){
			_touch_list = new Array();
			_pos_average = new Object();
			_pos_average.x = -1;
			_pos_average.y = -1;
			_enable_touch = false;
			_event_dispatcher = new EventDispatcher();

			if(document.addEventListener){
				document.addEventListener("touchstart",touch_move_func,true);
				document.addEventListener("touchmove",touch_move_func,true);
				document.addEventListener("touchend",touch_end_func,true);
				document.addEventListener("touchcancel",touch_end_func,true);
				window.addEventListener("blur",blur_func);
			}
		})();
	}

	// -
	// 仮想マウスポインタ
	// -
	function VirtualMousePointer(document_obj){
		var _this = this;

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

		// -
		// 座標をセット
		// -
		_this.setPosition = function(pos){
			_mouse_pos = pos;
			mouse_move_func();
		};

		// -
		// 移動量を加算
		// -
		_this.addVector = function(vec){
			var pos_end = {
				x:_mouse_pos.x + vec.x,
				y:_mouse_pos.y + vec.y
			};

			var len = Math.sqrt((vec.x * vec.x) + (vec.y * vec.y))
			var size = 1;
			var num = Math.floor(len / size);

			len = (1 / len) * size;
			var vx = vec.x * len;
			var vy = vec.y * len;

			var i;
			for(i=0;i<num;i++){
				_mouse_pos.x += vx;
				_mouse_pos.y += vy;
				mouse_move_func();
			}
			_mouse_pos = pos_end;
			mouse_move_func();
		};

		// -
		// マウス移動(内部用)
		// -
		function mouse_move_func(){
			var node = document_obj.elementFromPoint(_mouse_pos.x,_mouse_pos.y);
			while(node){
				var work = analyze_work_dictionary.getAnalyzeWork(node);
				if(work){
					break;
				}

				node = node.parentNode;
			}
			if(node != _element_active){
				if(_element_active){
					// マウスアウトイベント発行
					//var mouse_event = document_obj.createEvent("MouseEvent");
					//mouse_event.initMouseEvent("mouseout",false,false,document_obj.defaultView,0,0,0,_mouse_pos.x,_mouse_pos.y,false,false,false,false,0,_element_active);
					//_element_active.dispatchEvent (mouse_event);
				}
				if(node){
					// マウスオーバーイベント発行
					var mouse_event = document_obj.createEvent("MouseEvent");
					mouse_event.initMouseEvent("mouseover",false,false,document_obj.defaultView,0,0,0,_mouse_pos.x,_mouse_pos.y,false,false,false,false,0,node);
					node.dispatchEvent (mouse_event);
				}
			}
			_element_active = node;
		}

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

		// -
		// 初期化
		// -
		(function(){
			_element_active = null;
			_mouse_pos = new Object();
			_mouse_pos.x = -1;
			_mouse_pos.y = -1;
		})();
	}

	// -
	// URLキャッシュ辞書
	// -
	function UrlCacheDictionary(){
		var _this = this;

		// -
		// オブジェクトを取得
		// -
		_this.getObject = function(url){
			if(url.length > 260) return {};

			var obj = _dictionary[url];
			if(obj){
				var prev = obj.prev;
				var next = obj.next;
				prev.next = next;
				next.prev = prev;
				prev = _queue;
				prev = prev.next;
				prev.next = obj;
				next.prev = obj;
				obj.prev = prev;
				obj.next = next;
				return obj;
			}

			obj = new Object();
			obj.url = url;
			var prev = _queue;
			var next = prev.next;
			prev.next = obj;
			next.prev = obj;
			obj.prev = prev;
			obj.next = next;

			_queue_count ++;
			_dictionary[url] = obj;

			if(_queue_count >= _queue_max){
				var o = _queue.prev;
				prev = o.prev;
				next = o.next;
				prev.next = next;
				next.prev = prev;

				_queue_count --;
				delete _dictionary[o.url];
			}

			return obj;
		};

		// -
		// キャッシュの最大数をセット
		// -
		_this.setCacheMax = function(v){
			_queue_max = v;
		};

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

		// -
		// 初期化
		// -
		(function(){
			_dictionary = new Object();
			_queue = new Object();
			_queue.prev = _queue;
			_queue.next = _queue;

			_queue_count = 0;
			_queue_max = 16;
		})();
	}














	// -
	// 要素管理
	// -
	function ElementAnalyzeManager(element,outsider){
		var _this = this;

		// -
		// 解放
		// -
		_this.release = function(){
			if(!_element)	return;

			// リムーブ監視を破棄
			if(_observer_remove){
				_observer_remove.release();
				_observer_remove = null;
			}

			// 解析辞書除外
			analyze_work_dictionary.removeAnalyzeWork(_analyze_work);

			DomNodeRemove(_element);
			_element = null;
		};

		// -
		// 解析
		// -
		_this.analyze = function(){
			// 解析有効化
			AnalyzeWorkClearInvalid(_analyze_work);

			// 解析開始
			execute_queue.attachLastForInsertDomNode(DomNodeAnalyzeRoot,_element);
		};

		// -
		// プライベート変数
		// -
		var _element;
		var _analyze_work;
		var _observer_remove;

		// -
		// 初期化
		// -
		(function(){
			_element = element;
			element = null;

			// リムーブ監視
			_observer_remove = new DomNodeObserverRemoveFromDocument(_element);
			_observer_remove.setFunction(_this.release);

			// 解析ワーク
			_analyze_work = analyze_work_dictionary.getAnalyzeWork(_element);
			if(_analyze_work){
			}else{
				// 解析ワーク作成
				_analyze_work = AnalyzeWorkCreate(_element);
			}

			// 解析辞書登録オプション
			var attach_options = new AnalyzeWorkDictionaryAttachOptions();
			if(outsider) attach_options.SetOutsider();

			// 解析辞書登録
			analyze_work_dictionary.attachAnalyzeWork(_analyze_work,attach_options);

			// 解析無効化
			AnalyzeWorkSetInvalid(_analyze_work);
		})();
	}

	// -
	// 解析ワーク作成
	// -
	function AnalyzeWorkCreate(node){
		return {
			node:node,
			modify:1
		};
	}

	// -
	// 解析ワークから DOM オブジェクトを取得
	// -
	function AnalyzeWorkGetDomNode(work){
		return work.node;
	}

	// -
	// 解析ワークにアンカー要素を登録
	// -
	function AnalyzeWorkClearAnchorElement(work){ ObjectDeleteProperty(work,"anchor"); }
	function AnalyzeWorkSetAnchorElement(work,anchor){ work.anchor = anchor; }
	function AnalyzeWorkGetAnchorElement(work){ return work.anchor; }

	// -
	// エレメント監視初期化状況
	// -
	function AnalyzeWorkClearInitializedObserverElement(work){ ObjectDeleteProperty(work,"i_obs"); }
	function AnalyzeWorkSetInitializedObserverElement(work){ work.i_obs = true; }
	function AnalyzeWorkGetInitializedObserverElement(work){ return Boolean(work.i_obs); }

	// -
	// アンカーオーバーライド状況
	// -
	function AnalyzeWorkClearOverrodeAnchorElement(work){ ObjectDeleteProperty(work,"o_anc"); }
	function AnalyzeWorkSetOverrodeAnchorElement(work){ work.o_anc = true; }
	function AnalyzeWorkGetOverrodeAnchorElement(work){ return Boolean(work.o_anc); }

	// -
	// URL オーバーライド状況
	// -
	function AnalyzeWorkClearOverrodeUrl(work){ ObjectDeleteProperty(work,"o_url"); }
	function AnalyzeWorkSetOverrodeUrl(work){ work.o_anc = true; }
	function AnalyzeWorkGetOverrodeUrl(work){ return Boolean(work.o_anc); }

	// -
	// 「エレメントの置換」の解析状況
	// -
	function AnalyzeWorkClearAnalyzedReplacementToElement(work){ ObjectDeleteProperty(work,"a_rte"); }
	function AnalyzeWorkSetAnalyzedReplacementToElement(work){ work.a_rte = true; }
	function AnalyzeWorkGetAnalyzedReplacementToElement(work){ return Boolean(work.a_rte); }

	// -
	// 「テキストの置換」の解析状況
	// -
	function AnalyzeWorkClearAnalyzedReplacementToText(work){ ObjectDeleteProperty(work,"a_rtt"); }
	function AnalyzeWorkSetAnalyzedReplacementToText(work){ work.a_rtt = true; }
	function AnalyzeWorkGetAnalyzedReplacementToText(work){ return Boolean(work.a_rtt); }

	// -
	// 「アンカーの置換」の解析状況
	// -
	function AnalyzeWorkClearAnalyzedReplacementToAnchor(work){ ObjectDeleteProperty(work,"a_rta"); }
	function AnalyzeWorkSetAnalyzedReplacementToAnchor(work){ work.a_rta = true; }
	function AnalyzeWorkGetAnalyzedReplacementToAnchor(work){ return Boolean(work.a_rta); }

	// -
	// 「ハイパーリンクの置換」の解析状況
	// -
	function AnalyzeWorkClearAnalyzedReplacementToLink(work){ ObjectDeleteProperty(work,"a_rtl"); }
	function AnalyzeWorkSetAnalyzedReplacementToLink(work){ work.a_rtl = true; }
	function AnalyzeWorkGetAnalyzedReplacementToLink(work){ return Boolean(work.a_rtl); }

	// -
	// 展開 URL 先を設定
	// -
	function AnalyzeWorkClearExpandUrl(work){ ObjectDeleteProperty(work,"expand_url"); }
	function AnalyzeWorkSetExpandUrl(work,url){ work.expand_url = url; }
	function AnalyzeWorkGetExpandUrl(work){ return work.expand_url; }

	// -
	// 展開コンテンツタイプを設定
	// -
	function AnalyzeWorkClearExpandContentType(work){ ObjectDeleteProperty(work,"expand_content_type"); }
	function AnalyzeWorkAddContentType(work,type){ if(!(work.expand_content_type)){ work.expand_content_type = new Array(); } work.expand_content_type.push(type); }
	function AnalyzeWorkGetContentType(work){ if(work.expand_content_type){ return work.expand_content_type; } return []; }

	// -
	// 「ハイパーリンク化の置換」の解析状況
	// -
	function AnalyzeWorkClearAnalyzedMakeLinkToText(work){ ObjectDeleteProperty(work,"a_mlt"); }
	function AnalyzeWorkSetAnalyzedMakeLinkToText(work){ work.a_mlt = true; }
	function AnalyzeWorkGetAnalyzedMakeLinkToText(work){ return Boolean(work.a_mlt); }

	// -
	// 「短縮 URL の展開」の解析状況
	// -
	function AnalyzeWorkClearAnalyzedExpandShortUrl(work){ ObjectDeleteProperty(work,"a_esu"); }
	function AnalyzeWorkSetAnalyzedExpandShortUrl(work){ work.a_esu = true; }
	function AnalyzeWorkGetAnalyzedExpandShortUrl(work){ return Boolean(work.a_esu); }

	// -
	// 「テキストの展開」の解析状況
	// -
	function AnalyzeWorkClearAnalyzedExpandInlineText(work){ ObjectDeleteProperty(work,"a_eit"); }
	function AnalyzeWorkSetAnalyzedExpandInlineText(work){ work.a_eit = true; }
	function AnalyzeWorkGetAnalyzedExpandInlineText(work){ return Boolean(work.a_eit); }

	// -
	// 「イメージのサムネイル展開」の解析状況
	// -
	function AnalyzeWorkClearAnalyzedExpandThumbnailImage(work){ ObjectDeleteProperty(work,"a_eti"); }
	function AnalyzeWorkSetAnalyzedExpandThumbnailImage(work){ work.a_eti = true; }
	function AnalyzeWorkGetAnalyzedExpandThumbnailImage(work){ return Boolean(work.a_eti); }

	// -
	// 「イメージのポップアップ展開」の解析状況
	// -
	function AnalyzeWorkClearAnalyzedExpandPopupImage(work){ ObjectDeleteProperty(work,"a_epi"); }
	function AnalyzeWorkSetAnalyzedExpandPopupImage(work){ work.a_epi = true; }
	function AnalyzeWorkGetAnalyzedExpandPopupImage(work){ return Boolean(work.a_epi); }

	// -
	// 「ポップアップ」のワーク埋め込み
	// -
	function AnalyzeWorkClearPopupImage(work){ ObjectDeleteProperty(work,"popup_image"); }
	function AnalyzeWorkSetPopupImage(work,obj){ work.popup_image = obj; }
	function AnalyzeWorkGetPopupImage(work){ return work.popup_image; }

	// -
	// 「サウンドのインライン展開」の解析状況
	// -
	function AnalyzeWorkClearAnalyzedExpandInlineSound(work){ ObjectDeleteProperty(work,"a_eis"); }
	function AnalyzeWorkSetAnalyzedExpandInlineSound(work){ work.a_eis = true; }
	function AnalyzeWorkGetAnalyzedExpandInlineSound(work){ return Boolean(work.a_eis); }

	// -
	// 「ビデオのインライン展開」の解析状況
	// -
	function AnalyzeWorkClearAnalyzedExpandInlineVideo(work){ ObjectDeleteProperty(work,"a_eiv"); }
	function AnalyzeWorkSetAnalyzedExpandInlineVideo(work){ work.a_eiv = true; }
	function AnalyzeWorkGetAnalyzedExpandInlineVideo(work){ return Boolean(work.a_eiv); }

	// -
	// 「インラインの展開」の解析状況
	// -
	function AnalyzeWorkClearAnalyzedExpandInlineIframe(work){ ObjectDeleteProperty(work,"a_eif"); }
	function AnalyzeWorkSetAnalyzedExpandInlineIframe(work){ work.a_eif = true; }
	function AnalyzeWorkGetAnalyzedExpandInlineIframe(work){ return Boolean(work.a_eif); }

	// -
	// 「インラインフレーム内コンテンツ展開」の解析状況
	// -
	function AnalyzeWorkClearAnalyzedExpandIframeContent(work){ ObjectDeleteProperty(work,"a_eic"); }
	function AnalyzeWorkSetAnalyzedExpandIframeContent(work){ work.a_eic = true; }
	function AnalyzeWorkGetAnalyzedExpandIframeContent(work){ return Boolean(work.a_eic); }

	// -
	// 「縮小画像のポップアップ」の解析状況
	// -
	function AnalyzeWorkClearAnalyzedPopupReducedImage(work){ ObjectDeleteProperty(work,"a_pri"); }
	function AnalyzeWorkSetAnalyzedPopupReducedImage(work){ work.a_pri = true; }
	function AnalyzeWorkGetAnalyzedPopupReducedImage(work){ return Boolean(work.a_pri); }

	// -
	// 「インラインMediaPlayer」の解析状況
	// -
	function AnalyzeWorkClearAnalyzedInlineMediaPlayer(work){ ObjectDeleteProperty(work,"a_imp"); }
	function AnalyzeWorkSetAnalyzedInlineMediaPlayer(work){ work.a_imp = true; }
	function AnalyzeWorkGetAnalyzedInlineMediaPlayer(work){ return Boolean(work.a_imp); }

	// -
	// 「掲示板拡張」の解析状況
	// -
	function AnalyzeWorkClearAnalyzedExpandBbs(work){ ObjectDeleteProperty(work,"a_ebb"); }
	function AnalyzeWorkSetAnalyzedExpandBbs(work){ work.a_ebb = true; }
	function AnalyzeWorkGetAnalyzedExpandBbs(work){ return Boolean(work.a_ebb); }

	// -
	// 解析無効化
	// -
	function AnalyzeWorkClearInvalid(work){ ObjectDeleteProperty(work,"a_inv"); }
	function AnalyzeWorkSetInvalid(work){ work.a_inv = true; }
	function AnalyzeWorkGetInvalid(work){ return Boolean(work.a_inv); }

	// -
	// 「修正カウンタ」の解析状況
	// -
	function AnalyzeWorkInitializeModifyCount(work){ work.modify = 1; }
	function AnalyzeWorkGetModifyCount(work){ return work.modify; }
	function AnalyzeWorkAddModifyCount(work){ work.modify += 1; }
	function AnalyzeWorkEqualModifyCount(work,modify){ if(work.modify){ return (modify == work.modify); } return (modify == 0); }

	// -
	// イベントディスパッチャーの管理
	// -
	function AnalyzeWorkClearEventDispatcher(work){ ObjectDeleteProperty(work,"event_dispatcher"); }
	function AnalyzeWorkSetEventDispatcher(work,event_dispatcher){ work.event_dispatcher = event_dispatcher; }
	function AnalyzeWorkGetEventDispatcher(work){ return work.event_dispatcher; }

	// -
	// アンカー監視要素の管理
	// -
	function AnalyzeWorkClearObserverModifyAnchor(work){ ObjectDeleteProperty(work,"observer_modify_anchor"); }
	function AnalyzeWorkSetObserverModifyAnchor(work,element){ work.observer_modify_anchor = element; }
	function AnalyzeWorkGetObserverModifyAnchor(work){ return work.observer_modify_anchor; }

	// -
	// 掲示板コントロールの管理
	// -
	function AnalyzeWorkClearBbsControl(work){ ObjectDeleteProperty(work,"bbs_control"); }
	function AnalyzeWorkSetBbsControl(work,obj){ work.bbs_control = obj; }
	function AnalyzeWorkGetBbsControl(work){ return work.bbs_control; }

	// -
	// 要素の基本的な監視化
	// -
	function AnalyzeWorkObserveElement(work){

		if(AnalyzeWorkGetInitializedObserverElement(work)) return;

		var node = AnalyzeWorkGetDomNode(work);

		// 初期化済み
		AnalyzeWorkSetInitializedObserverElement(work);

		// 解析辞書登録
		analyze_work_dictionary.attachAnalyzeWork(work);

		// イベントディスパッチャー生成
		var event_dispatcher = new EventDispatcher();
		AnalyzeWorkSetEventDispatcher(work,event_dispatcher);

		// デストラクタ発行
		function dispatchDestructor(){
			var event_dispatcher = AnalyzeWorkGetEventDispatcher(work);
			if(event_dispatcher){
				// イベント発火
				event_dispatcher.dispatchEvent("remove",null);
				event_dispatcher.dispatchEvent("destructor",null);
			}
		}

		// リムーブ監視
		var observer_remove = new DomNodeObserverRemoveFromDocument(node);
		observer_remove.setFunction(dispatchDestructor);

		// 開放イベント
		var event_handler_release = page_expand_event_dispatcher.createEventHandler("release");
		event_handler_release.setFunction(dispatchDestructor);

		// 破棄イベント
		var event_handler = event_dispatcher.createEventHandler("destructor");
		event_handler.setFunction(function(){
			// 修正カウンタ加算
			AnalyzeWorkAddModifyCount(work);

			var event_dispatcher = AnalyzeWorkGetEventDispatcher(work);
			if(event_dispatcher){
				// イベント発火
				event_dispatcher.dispatchEvent("release",null);
				event_dispatcher.release();
				AnalyzeWorkClearEventDispatcher(work);
			}

			// リムーブ監視を破棄
			if(observer_remove){
				observer_remove.release();
				observer_remove = null;
			}

			// イベントを破棄
			if(event_handler_release){
				event_handler_release.release();
				event_handler_release = null;
			}

			// 解析辞書除外
			analyze_work_dictionary.removeAnalyzeWork(work);

			if(!(window.addEventListener)){
				DomNodeClearInserted(node);
			}
		});

	}

	// -
	// 解析辞書登録フラグ
	// -
	function AnalyzeWorkDictionaryAttachOptions(){
		var _this = this;

		// -
		// PageExpand 生成ノード
		// -
		_this.SetOutsider = function(){
			_this._flag |= ANALYZE_WORK_DICTIONARY_ATTACH_OPTION_OUTSIDER;
		};

		// -
		// PageExpand ゲストノード
		// -
		_this.SetGuest = function(){
			_this._flag |= ANALYZE_WORK_DICTIONARY_ATTACH_OPTION_GUEST;
		};

		// -
		// 初期化
		// -
		(function(){
			_this._flag = 0;
		})();
	}
	var ANALYZE_WORK_DICTIONARY_ATTACH_OPTION_OUTSIDER	= 0x00000001;
	var ANALYZE_WORK_DICTIONARY_ATTACH_OPTION_GUEST		= 0x00000002;
	var ANALYZE_WORK_DICTIONARY_ATTACH_OPTION_MAX		= 2;

	// -
	// 解析辞書
	// -
	function AnalyzeWorkDictionary(){
		var _this = this;

		// -
		// 開放
		// -
		_this.release = function(){
			for(var id in _dictionary){
				_this.removeAnalyzeWork(_dictionary[id]);
			}
			_dictionary = null;
		};

		// -
		// 解析ワークを登録
		// -
		_this.attachAnalyzeWork = function(work,attach_options){
			if(work.id)	return true;

			var node = AnalyzeWorkGetDomNode(work);
			if(node){
				var flag = 0;
				if(attach_options){
					flag = attach_options._flag;
				}
				var id = (_identity << ANALYZE_WORK_DICTIONARY_ATTACH_OPTION_MAX) | flag;
				_dictionary[id] = work;
				_identity += 1;
				work.id = id;
				node._pageexpand_ = id;
				if(node.setAttribute){
					node.setAttribute("_pageexpand_",id);
				}
				return true;
			}

			return false;
		};

		// -
		// 解析ワークを除外
		// -
		_this.removeAnalyzeWork = function(work){
			var id = work.id;
			if(!id)	return false;

			try{
				ObjectDeleteProperty(_dictionary,id);
				ObjectDeleteProperty(work,"id");
			}catch(e){}
		};

		// -
		// エレメントからオブジェクトを取得
		// -
		_this.getAnalyzeWork = function(node){
			var id;
			id = node._pageexpand_;
			if(id){
				var work = _dictionary[parseInt(id)];
				if(work){
					if(AnalyzeWorkGetDomNode(work) == node){
						return work;
					}
				}
			}
			return null;
		};

		// -
		// クローンであるか確認する
		// -
		_this.verifyClone = function(node){
			if(node.getAttribute){
				var id = node.getAttribute("_pageexpand_");
				if(id){
					var id = parseInt(id);
					if(id & ANALYZE_WORK_DICTIONARY_ATTACH_OPTION_OUTSIDER){
						var work = _dictionary[id];
						if(!work)	return true;
						if(AnalyzeWorkGetDomNode(work) != node){
							return true;
						}
					}
				}
			}

			return false;
		};

		// -
		// 解放後の要素であるか確認する
		// -
		_this.verifyRemoved = function(node){
			if(node.getAttribute){
				var id = node.getAttribute("_pageexpand_");
				if(id){
					var id = parseInt(id);
					var work = _dictionary[id];
					if(!work)	return true;
					if(AnalyzeWorkGetDomNode(work) != node){
						return true;
					}
				}
			}

			return false;
		};

		// -
		// ゲスト要素であるか確認する
		// -
		_this.verifyGuest = function(node){
			if(node.getAttribute){
				var id = node.getAttribute("_pageexpand_");
				if(id){
					var id = parseInt(id);
					if(id & ANALYZE_WORK_DICTIONARY_ATTACH_OPTION_GUEST){
						return true;
					}
				}
			}

			return false;
		};

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


		// -
		// 初期化
		// -
		(function(){
			_identity = 1;
			_dictionary = new Array();
		})();
	}

	// -
	// 掲示板辞書
	// -
	function BbsDictionary(){
		var _this = this;

		// -
		// 開放
		// -
		_this.release = function(){
			for(n in _number_dictionary){
				_number_dictionary[n].release();
			}
		};

		// -
		// フォロー生成
		// -
		function createFollow(follower_response,following_response){
			var _follow = new Object();

			// -
			// 開放
			// -
			_follow.release = function(){
				var _follower_prev = _follow._follower_prev;
				var _follower_next = _follow._follower_next;
				_follower_prev._follower_next = _follower_next;
				_follower_next._follower_prev = _follower_prev;
				_follow._follower_prev = _follow;
				_follow._follower_next = _follow;

				var _following_prev = _follow._following_prev;
				var _following_next = _follow._following_next;
				_following_prev._following_next = _following_next;
				_following_next._following_prev = _following_prev;
				_follow._following_prev = _follow;
				_follow._following_next = _follow;

				var following = _follow.getResponseFollowing();
				if(following){
					following.addCountFollower(-1);
				}
			};

			// -
			// フォロワーレスポンスを取得
			// -
			_follow.getResponseFollower = function(){
				return follower_response;
			};

			// -
			// フォローイングレスポンスを取得
			// -
			_follow.getResponseFollowing = function(){
				return following_response;
			};

			// -
			// 初期化
			// -
			(function(){
				_follow._follower_prev = _follow;
				_follow._follower_next = _follow;
				_follow._following_prev = _follow;
				_follow._following_next = _follow;
			})();

			return _follow;
		}

		// -
		// レスポンス生成
		// -
		function createResponse(number){
			var _response = new Object();

			// -
			// 開放
			// -
			_response.release = function(obj){
				if(_released)	return;
				_released = true;

				release();

				_analyzed = false;

				// フォロワーを開放
				var follow = _response._follow;
				while(true){
					var follower = follow._follower_next;
					if(follow == follower)	break;
					follower.release();
				}

				// イベント解放
				if(_event_dispatcher){
					_event_dispatcher.release();
					_event_dispatcher = null;
				}

				// 番号を破棄
				delete _number_dictionary[number];
			};

			// -
			// レスポンスを消去
			// -
			_response.erase = function(){

				// 消去イベント実行
				if(_response.onerase){
					_response.onerase();
				}

				release();
			};

			// -
			// 開放(内部用)
			// -
			function release(){

				// イベントを外す
				removeEventRelease();

				// オリジナルエレメントをクリア
				_response.clearOriginalElements();

				// フォローイングをクリア
				_response.clearFollowing();

				// データを開放
				removeDataAll();

				// イベント発火
				_event_dispatcher.dispatchEvent("release",null);
			}

			// -
			// リリースイベントを追加(内部用)
			// -
			function addEventRelease(){
				removeEventRelease();

				var i;
				var num = _elements_original.length;
				for(i=0;i<num;i++){
					if(!_observer_remove[i]){
						var obj = _elements_original[i];
						_observer_remove[i] = new DomNodeObserverRemoveFromDocument(obj.element);
						_observer_remove[i].setFunction(_response.release);
					}
				}
			}

			// -
			// リリースイベントを外す(内部用)
			// -
			function removeEventRelease(){
				var i;
				var num = _elements_original.length;
				for(i=0;i<num;i++){
					if(_observer_remove[i]){
						var obj = _elements_original[i];
						// 監視を破棄
						_observer_remove[i].release();
						_observer_remove[i] = null;
					}
				}
			}

			// -
			// 番号を取得
			// -
			_response.getNumber = function(){
				return number;
			};

			// -
			// ID を取得
			// -
			_response.getId = function(){
				return _response.getDataList("id")[0];
			};

			// -
			// ID をセット
			// -
			_response.setId = function(id){
				removeData("id");
				_response.attachData("id",id);
			};

			// -
			// 名前を取得
			// -
			_response.getName = function(){
				return _response.getDataList("name")[0];
			};

			// -
			// 名前をセット
			// -
			_response.setName = function(name){
				removeData("name");
				_response.attachData("name",name);
			};

			// -
			// ホストを取得
			// -
			_response.getHost = function(){
				return _response.getDataList("host")[0];
			};

			// -
			// ホストをセット
			// -
			_response.setHost = function(host){
				removeData("host");
				_response.attachData("host",host);
			};

			// -
			// データを登録(内部用)
			// -
			function attachData(name,data){
				var same_container = getSameContainer(name,data);
				var data_list = same_container.list;
				var target_item = data_list.dic_prev;
				while(target_item != data_list){
					if(_response.getNumber() >= target_item.owner.getNumber()){
						break;
					}
					target_item = target_item.dic_prev;
				}

				if(!_datalist[name]){
					var ary_list = new Object();
					ary_list.ary_prev = ary_list;
					ary_list.ary_next = ary_list;
					_datalist[name] = ary_list;
				}

				var data_item = Object();
				data_item.data = data;
				data_item.owner = _response;
				data_item.container = same_container;

				var dic_prev = target_item;
				var dic_next = dic_prev.dic_next;
				dic_prev.dic_next = data_item;
				dic_next.dic_prev = data_item;
				data_item.dic_prev = dic_prev;
				data_item.dic_next = dic_next;

				var ary_prev = _datalist[name].ary_prev;
				var ary_next = ary_prev.ary_next;
				ary_prev.ary_next = data_item;
				ary_next.ary_prev = data_item;
				data_item.ary_prev = ary_prev;
				data_item.ary_next = ary_next;

				// カウンタ
				addCountData(same_container,1);
			}

			// -
			// データの登録を外す(内部用)
			// -
			function removeData(name){
				var data_item = _datalist[name];
				if(!data_item) return;
				while(data_item.ary_next != data_item){
					removeDataItem(data_item.ary_next);
				}
			}

			// -
			// データの登録を外す(内部用)
			// -
			function removeDataItem(data_item){
				addCountData(data_item.container,-1);

				var dic_prev = data_item.dic_prev;
				var dic_next = data_item.dic_next;
				dic_prev.dic_next = dic_next;
				dic_next.dic_prev = dic_prev;

				var ary_prev = data_item.ary_prev;
				var ary_next = data_item.ary_next;
				ary_prev.ary_next = ary_next;
				ary_next.ary_prev = ary_prev;
			}

			// -
			// すべてのデータを解放(内部用)
			// -
			function removeDataAll(){
				for(var name in _datalist){
					removeData(name);
				}
			}

			// -
			// データを取得
			// -
			_response.getDataList = function(name){
				var ary = [];
				var data_list = _datalist[name];
				if(!data_list) return ary;

				var data_item = data_list.ary_next;
				while(data_item != data_list){
					ary.push(data_item.data);
					data_item = data_item.ary_next;
				}
				return ary;
			};

			// -
			// データを持っているか
			// -
			_response.hasData = function(name,data){
				var data_list = _datalist[name];
				if(!data_list) return false;

				var data_item = data_list.ary_next;
				while(data_item != data_list){
					if(data_item.data === data) return true;
					data_item = data_item.ary_next;
				}
				return false;
			};

			// -
			// データを追加
			// -
			_response.attachData = function(name,data){
				attachData(name,data);
			};

			// -
			// 解析済みクリア
			// -
			_response.clearAnalyzed = function(){
				_analyzed = false;
			};

			// -
			// 解析済みか調べる
			// -
			_response.getAnalyzed = function(){
				return _analyzed;
			};

			// -
			// 解析済みをセット
			// -
			_response.setAnalyzed = function(){
				_analyzed = true;
			};

			// -
			// オリジナルエレメントをクリア
			// -
			_response.clearOriginalElements = function(){

				// イベントを外す
				removeEventRelease();

				var i;
				var num = _elements_original_work.length;
				for(i=0;i<num;i++){
					// 解析クリア
					AnalyzeWorkClearAnalyzedExpandBbs(_elements_original_work[i]);
					// 解析辞書除外
					analyze_work_dictionary.removeAnalyzeWork(_elements_original_work[i]);
				}

				_elements_original.length = 0;
				_elements_clone.length = 0;
				_elements_original_work.length = 0;
			};

			// -
			// オリジナルエレメントを取得
			// -
			_response.getOriginalElements = function(){
				return _elements_original;
			};

			// -
			// オリジナルエレメントをセット
			// -
			_response.addOriginalElements = function(name,element){
				_elements_original.push({name:name,element:element});

				// 解析ワーク
				var analyze_work = analyze_work_dictionary.getAnalyzeWork(element);
				if(analyze_work){
				}else{
					// 解析ワーク作成
					analyze_work = AnalyzeWorkCreate(element);
				}
				_elements_original_work.push(analyze_work);

				// 解析辞書登録
				analyze_work_dictionary.attachAnalyzeWork(analyze_work);

				// 解析済み
				AnalyzeWorkSetAnalyzedExpandBbs(analyze_work);

				// 複製して保有
				_elements_clone.push({name:name,element:ElementCloneNode(element,true)});

				// リリースイベント
				addEventRelease();
			};

			// -
			// 複製エレメントを取得
			// -
			_response.getCloneElements = function(){
				var ary = new Array();

				var i;
				var num = _elements_clone.length;
				for(i=0;i<num;i++){
					var obj = _elements_clone[i];
					ary.push({name:obj.name,element:ElementCloneNode(obj.element,true)});
				}
				return ary;
			};

			// -
			// フォローイングをクリア
			// -
			_response.clearFollowing = function(){
				var follow = _response._follow;
				while(true){
					var following = follow._following_next;
					if(follow == following)	break;
					following.release();
				}
			};

			// -
			// フォロワーカウント数取得
			// -
			_response.getCountFollower = function(){
				return _follower_count;
			};

			// -
			// フォロワーカウント数加算
			// -
			_response.addCountFollower = function(v){
				_follower_count += v;
				// イベント発火
				var event_dispatcher = _follower_counter_event_dictionary[number];
				if(event_dispatcher){
					event_dispatcher.dispatchEvent("update",_follower_count);
				}
			};

			// -
			// フォロワー取得
			// -
			_response.getFollower = function(){
				var ary = new Array();

				var follow = _response._follow._follower_next;
				while(follow != _response._follow){
					ary.push(follow.getResponseFollower());
					follow = follow._follower_next;
				}
				return ary;
			};

			// -
			// フォロワーを加算
			// -
			_response.addFollower = function(target){

				var follow = createFollow(target,_response);
				var _prev;
				var _next;

				var list = _response._follow._follower_prev;
				while(list != _response._follow){
					if(target.getNumber() >= list.getResponseFollower().getNumber()){
						break;
					}
					list = list._follower_prev;
				}

				_prev = list;
				_next = _prev._follower_next;
				_prev._follower_next = follow;
				_next._follower_prev = follow;
				follow._follower_prev = _prev;
				follow._follower_next = _next;

				_prev = target._follow._following_prev;
				_next = _prev._following_next;
				_prev._following_next = follow;
				_next._following_prev = follow;
				follow._following_prev = _prev;
				follow._following_next = _next;

				_response.addCountFollower(1);
			};

			// -
			// イベントディスパッチャーを取得
			// -
			_response.getEventDispatcher = function(){
				return _event_dispatcher;
			};

			// -
			// 消去イベント
			// -
			_response.onerase = function(){};

			// -
			// プライベート変数
			// -
			var _datalist;
			var _analyzed;
			var _released;
			var _elements_original;
			var _elements_original_work;
			var _elements_clone;
			var _follower_count;
			var _observer_remove;
			var _event_dispatcher;

			// -
			// 初期化
			// -
			(function(){
				_datalist = new Object();
				_analyzed = false;
				_released = false;
				_elements_original = new Array();
				_elements_original_work = new Array();
				_elements_clone = new Array();
				_follower_count = 0;
				_response._follow = createFollow(null,null);
				_observer_remove = new Array();
				_event_dispatcher = new EventDispatcher();
			})();

			return _response;
		}

		// -
		// 番号からレスポンスが存在するか調べる
		// -
		_this.getExist = function(number){
			if(_number_dictionary[number]){
				return true;
			}
			return false;
		};

		// -
		// 番号からレスポンスを取得
		// -
		_this.getResponse = function(number){
			var response = _number_dictionary[number];
			if(!response){
				response = createResponse(number);
				_number_dictionary[number] = response;
			}
			
			return response;
		};

		// -
		// ID からレスポンスを取得
		// -
		_this.getResponsesFromId = function(id){
			return _this.getResponsesFromData("id",id);
		};

		// -
		// 名前からレスポンスを取得
		// -
		_this.getResponsesFromName = function(name){
			return _this.getResponsesFromData("name",name);
		};

		// -
		// ホストからレスポンスを取得
		// -
		_this.getResponsesFromHost = function(host){
			return _this.getResponsesFromData("host",host);
		};

		// -
		// データからレスポンスを取得
		// -
		_this.getResponsesFromData = function(name,data){
			var ary = new Array();
			var same_container = getSameContainer(name,data);
			var data_list = same_container.list;
			var data_item = data_list.dic_next;
			while(data_item != data_list){
				ary.push(data_item.owner);
				data_item = data_item.dic_next;
			}
			return ary;	
		};

		// -
		// ID カウント用のイベントハンドラを生成
		// -
		_this.createEventHandlerForIdCounter = function(id){
			return _this.createEventHandlerForDataCounter("id",id);
		};

		// -
		// 名前カウント用のイベントハンドラを生成
		// -
		_this.createEventHandlerForNameCounter = function(name){
			return _this.createEventHandlerForDataCounter("name",name);
		};

		// -
		// ホストカウント用のイベントハンドラを生成
		// -
		_this.createEventHandlerForHostCounter = function(host){
			return _this.createEventHandlerForDataCounter("host",host);
		};

		// -
		// データカウント用のイベントハンドラを生成
		// -
		_this.createEventHandlerForDataCounter = function(name,data){
			var same_container = getSameContainer(name,data);
			return same_container.counter_event.createEventHandler("update");		
		};

		// -
		// フォロワーカウント用のイベントハンドラを生成
		// -
		_this.createEventHandlerForFollowerCounter = function(number){
			var event_dispatcher = _follower_counter_event_dictionary[number];
			if(!event_dispatcher){
				event_dispatcher = new EventDispatcher();
				_follower_counter_event_dictionary[number] = event_dispatcher;
			}
			return event_dispatcher.createEventHandler("update");
		};

		// -
		// IDカウント数取得
		// -
		_this.getCountId = function(id){
			return _this.getCountData("id",id);
		};

		// -
		// 名前カウント数取得
		// -
		_this.getCountName = function(name){
			return _this.getCountData("name",name);
		};

		// -
		// ホストカウント数取得
		// -
		_this.getCountHost = function(host){
			return _this.getCountData("host",host);
		};

		// -
		// データカウント数取得
		// -
		_this.getCountData = function(name,data){
			var same_container = getSameContainer(name,data);
			return same_container.count;
		};

		// -
		// データカウント数加算(内部用)
		// -
		function addCountData(same_container,v){
			same_container.count += v;

			// イベント発火
			same_container.counter_event.dispatchEvent("update",same_container.count);
		}

		// -
		// データを取得(内部用)
		// -
		function getSameContainer(name,data){
			var same_dic = _data_dictionary[name];
			if(!same_dic){
				same_dic = _data_dictionary[name] = new Object();
			}
			var same_container = same_dic[data];
			if(!same_container){
				var dic_list = new Object();
				dic_list.dic_prev = dic_list;
				dic_list.dic_next = dic_list;

				var event_dispatcher = new EventDispatcher();
				same_container = same_dic[data] = {
					count:0,
					counter_event:event_dispatcher,
					list:dic_list
				};
			}

			return same_container;
		}

		// -
		// プライベート変数
		// -
		var _number_dictionary;
		var _data_dictionary;
		var _follower_counter_event_dictionary;

		// -
		// 初期化
		// -
		(function(){
			_number_dictionary = new Object();
			_data_dictionary = new Object();
			_follower_counter_event_dictionary = new Object();
		})();
	}

	// -
	// 掲示板ポップアップレスポンス
	// -
	function BbsResponseDialog(){
		var _this = this;

		// -
		// 開放
		// -
		_this.release = function(){
			if(_released) return;
			_released = true;

			if(_event_handler_release){
				_event_handler_release.release();
				_event_handler_release = null;
			}

			// 子を全て破棄
			getChildren(function(dialog){
				dialog.release();
				return false;
			});

			// ダイアログの親子関係を外す
			_this.removeParent();

			// マウスイベントを外す
			removeEventMouseOverHitArea();
			// タッチイベントを外す
			removeEventTouchStartHitArea();
			// リリースイベントを外す
			removeEventRelease();

			// タスクを破棄
			if(_task){
				_task.release();
				_task = null;
			}
		};

		// -
		// 自殺
		// -
		_this.suicide = function(){
			if(_task){
				_this.setElementHitArea(null);
				_suicide = true;
			}else{
				_this.release();
			}
		};

		// -
		// ヒットエリアとなる範囲を指定
		// -
		_this.setElementHitArea = function(element){
			// マウスイベントを外す
			removeEventMouseOverHitArea();
			// タッチイベントを外す
			removeEventTouchStartHitArea();
			// リリースイベントを外す
			removeEventRelease();

			_element_hit_area = element;

			if(_element_hit_area){
				_invalid_timestamp = (new Date()).getTime();
				_invalid_once = true;
			}

			// マウスイベントを開始
			addEventMouseOverHitArea();
			// タッチイベントを開始
			addEventTouchStartHitArea();
			// リリースイベントを開始
			addEventRelease();
		};

		// -
		// 配置用親エレメントを指定
		// -
		_this.setElementParent = function(element){
			_element_parent = element;
		};

		// -
		// ウィンドウとの当たり判定
		// -
		_this.hittestWindow = function(pos){
			if(!_window)	return false;
			return ElementHitTestPosition(_window,pos,false);
		};

		// -
		// 子ダイアログとして登録
		// -
		_this.attachChild = function(child){
			child.removeParent();
			var _child = _this._child;
			var _prev = _child;
			var _next = _prev._next;
			child._prev = _prev;
			child._next = _next;
			_prev._next = child;
			_next._prev = child;
			_this._parent = child;
		};

		// -
		// 親からの登録を外す
		// -
		_this.removeParent = function(){
			var _prev = _this._prev;
			var _next = _this._next;
			_prev._next = _next;
			_next._prev = _prev;
			_this._prev = _this;
			_this._next = _this;
			_this._parent = null;
		};

		// -
		// 子を取得(内部用)
		// -
		function getChildren(func){
			var queue = new Array();

			var _child = _this._child;
			var child = _child._next;
			while(child != _child){
				queue.push(child);
				child = child._next;
			}

			while(true){
				var dialog = queue.shift();
				if(!dialog)	break;

				var _child = dialog._child;
				var child = _child._next;
				while(child != _child){
					queue.push(child);
					child = child._next;
				}

				if(func(dialog)){
					return;
				}
			}
		}

		// -
		// ヒットエリアのマウスオーバーイベントを追加(内部用)
		// -
		function addEventMouseOverHitArea(){
			if(!_element_hit_area) return;

			removeEventMouseOverHitArea();

			if(_element_hit_area.addEventListener){
				_element_hit_area.addEventListener("mouseover",mouseOverHitArea,false);
			}else if(_element_hit_area.attachEvent){
				_element_hit_area.attachEvent("onmouseover",mouseOverHitArea);
			}
		}

		// -
		// ヒットエリアのマウスオーバーイベントを外す(内部用)
		// -
		function removeEventMouseOverHitArea(){
			if(!_element_hit_area) return;

			if(_element_hit_area.removeEventListener){
				_element_hit_area.removeEventListener("mouseover",mouseOverHitArea,false);
			}else if(_element_hit_area.detachEvent){
				_element_hit_area.detachEvent("onmouseover",mouseOverHitArea);
			}
		}

		// -
		// ヒットエリアのタッチスタートイベントを追加(内部用)
		// -
		function addEventTouchStartHitArea(){
			if(!_element_hit_area) return;

			removeEventTouchStartHitArea();

			if(_element_hit_area.addEventListener){
				//_element_hit_area.addEventListener("touchstart",touchStartHitArea,false);
			}
		}

		// -
		// ヒットエリアのタッチスタートイベントを外す(内部用)
		// -
		function removeEventTouchStartHitArea(){
			if(!_element_hit_area) return;

			if(_element_hit_area.removeEventListener){
				//_element_hit_area.removeEventListener("touchstart",touchStartHitArea,false);
			}
		}

		// -
		// リリースイベントを追加(内部用)
		// -
		function addEventRelease(){
			if(!_element_hit_area) return;

			removeEventRelease();

			if(!_observer_remove){
				_observer_remove = new DomNodeObserverRemoveFromDocument(_element_hit_area);
				_observer_remove.setFunction(_this.suicide);
			}
		}

		// -
		// リリースイベントを外す(内部用)
		// -
		function removeEventRelease(){
			if(_observer_remove){
				// 監視を破棄
				_observer_remove.release();
				_observer_remove = null;
			}
		}

		// -
		// ヒットエリアのマウスオーバーイベント(内部用)
		// -
		function mouseOverHitArea(e){
			// マウス入力を更新
			input_mouse.setMouseEvent(e);

			// タスク生成
			createTask();
		}

		// -
		// ヒットエリアのタッチスタートイベント(内部用)
		// -
		function touchStartHitArea(e){
			// タッチ入力を更新
			input_touch.setTouchEvent(e);

			// タスク生成
			createTask();
		}

		// -
		// タスク生成(内部用)
		// -
		function createTask(){
			// 一度無効化
			if(_invalid_once){
				_invalid_once = false;
				if((new Date()).getTime() - _invalid_timestamp < 100){
					return;
				}
			}

			// 再構築
			if(_task){
				var work = _task.getUserWork();
				switch(work.type){
				case "fade_out":
					_task.setExecuteFunc(ResponseDialogClose);
					_task.execute(0xffffffff);
					break;
				}
			}

			// Shift キー押下で無視
			if(input_mouse.getKeyShift())	return;

			// ドラッグ中は無視
			if(input_mouse.getButtonLeft())	return;

			// タスクを生成
			if(!_task){
				_task = task_container.createTask();
				_task.setLevel(TASK_EXECUTE_LEVEL_POPUP);
				_task.setDestructorFunc(ResponseDialogDestructor);
				_task.setExecuteFunc(ResponseDialogInitialize);
				_task.execute(0xffffffff);
			}
		}

		// -
		// マウスムーブ(内部用)
		// -
		function mouseMove(){
			if(!_task)	return;

			var work = _task.getUserWork();
			var mouse_pos = input_mouse.getPositionClient();

			var hit = ElementHitTestPosition(_element_hit_area,mouse_pos,false);
			if(!hit){
				hit = Boolean(document.elementFromPoint( mouse_pos.x , mouse_pos.y ) == _element_hit_area);
			}
			if(!hit){
				hit = _this.hittestWindow(mouse_pos);
			}
			if(!hit){
				getChildren(function(dialog){
					hit = dialog.hittestWindow(mouse_pos);
					return hit;
				});
			}
			if(hit){
				var client_size = DocumentGetClientSize(document);
				if(mouse_pos.x < 1) hit = false;
				if(mouse_pos.y < 1) hit = false;
				if(client_size.width  - 2 < mouse_pos.x) hit = false;
				if(client_size.height - 2 < mouse_pos.y) hit = false;
				if(!input_mouse.getEnableMouse()){
					hit = false;
				}
			}

			// アニメーション
			if(project.getEnableAnimationPopupBbsResponse()){
				if(hit){
					switch(work.type){
					case "wait_before_close":
						// 表示へ
						_task.setExecuteFunc(ResponseDialogShowInit);
						_task.execute(0xffffffff);
						break;
					case "fade_out":
						// フェードインへ
						_task.setExecuteFunc(ResponseDialogFadeIn);
						_task.execute(0xffffffff);
						break;
					}
				}else{
					switch(work.type){
					case "wait_before_open":
						// 閉じる
						_task.setExecuteFunc(ResponseDialogClose);
						_task.execute(0xffffffff);
						break;
					case "fade_in":
						// フェードアウトへ
						_task.setExecuteFunc(ResponseDialogFadeOut);
						_task.execute(0xffffffff);
						break;
					case "show":
						// フェードアウト待機へ
						_task.setExecuteFunc(ResponseDialogWaitBeforeClose);
						_task.execute(0xffffffff);
						break;
					}
				}
			}else{
				if(hit){
					switch(work.type){
					case "wait_before_close":
						// 表示へ
						_task.setExecuteFunc(ResponseDialogShowInit);
						_task.execute(0xffffffff);
						break;
					}
				}else{
					switch(work.type){
					case "wait_before_open":
						// 閉じる
						_task.setExecuteFunc(ResponseDialogClose);
						_task.execute(0xffffffff);
						break;
					case "show":
						// フェードアウト待機へ
						_task.setExecuteFunc(ResponseDialogWaitBeforeClose);
						_task.execute(0xffffffff);
						break;
					}
				}
			}

		}

		// -
		// スクロール補正(内部用)
		// -
		function reviseScroll(vec){
			if(_task){
				var work = _task.getUserWork();
				var pos = work.pos;

				pos.x += vec.x;
				pos.y += vec.y;

				ResponseDialogPositionUpdate(_task);
			}
		}

		// -
		// 初期化(内部用)
		// -
		function ResponseDialogInitialize(task){
			var work = task.getUserWork();

			work.type = "initialize";
			work.anime_pos = 0.0;
			work.anime_spd = 0.0;

			task.setExecuteFunc(ResponseDialogWaitBeforeOpenInit);
			task.execute(0xffffffff);
		}

		// -
		// オープン前待機(内部用)
		// -
		function ResponseDialogWaitBeforeOpenInit(task){
			var work = task.getUserWork();

			work.type = "wait_before_open";
			work.frame = project.getTimeWaitOpenPopupExpandBbsResponse() / 1000 * 60;

			task.setExecuteFunc(ResponseDialogWaitBeforeOpenExec);
			task.execute(0xffffffff);
		}
		function ResponseDialogWaitBeforeOpenExec(task){
			var work = task.getUserWork();

			// マウスムーブ
			mouseMove();

			work.frame -= 1;
			if(work.frame < 0){
				task.setExecuteFunc(ResponseDialogOpen);
				task.execute(0xffffffff);
				return;
			}
		}

		// -
		// ダイアログオープン(内部用)
		// -
		function ResponseDialogOpen(task){
			var work = task.getUserWork();

			work.type = "open";
			work.anime_pos = 0.0;
			work.anime_spd = 0.0;

			// ウィンドウ作成
			_window = DocumentCreateElement("div");

			// 解析ワーク作成
			_analyze_work = AnalyzeWorkCreate(_window);

			// 解析辞書登録オプション
			var attach_options = new AnalyzeWorkDictionaryAttachOptions();
			attach_options.SetOutsider();

			// 解析辞書登録
			analyze_work_dictionary.attachAnalyzeWork(_analyze_work,attach_options);

			// スタイルをセット
			ElementSetStyle(_window,project.getStyleSheetExpandBbsPopupResponse());

			// 最前面
			_window.style.zIndex = 0x7FFFFFFF - 1;
			_window.style.position = project.getStylePositionPopupBbsResponse();

			try{
				// 親からの継承を無効化
				_window.style.minWidth  = "0";
				_window.style.minHeight = "0";
				_window.style.maxWidth  = "none";
				_window.style.maxHeight = "none";
			}catch(e){}

			_window.style.left   = "0px";
			_window.style.top    = "0px";
			_window.style.width  = "0px";
			_window.style.height = "0px";


			// スタイルのサイズを取得
			var clone = ElementCloneNode(_window,false);
			if(_element_parent){
				_element_parent.appendChild(clone);
			}else{
				document.body.appendChild(clone);
			}
			var bounding_size = ElementGetBoundingClientRect(clone);
			work.style_w = bounding_size.right  - bounding_size.left;
			work.style_h = bounding_size.bottom - bounding_size.top;
			DomNodeRemove(clone);

			var completed = false;
			function abort(){
				_task.setExecuteFunc(ResponseDialogClose);
				_task.execute(0xffffffff);
			}

			function response(obj){
				if(!task.getAlive())	return;

				if(completed)	return;
				completed = true;

				if(!(obj.result)){
					abort();
					return;
				}

				// クライアントサイズ
				var client_size = DocumentGetClientSize(document);

				// スクロール位置
				var scroll_pos = WindowGetScrollPosition(window);

				// サイズ
				var percent = project.getPercentPopupBbsResponse();
				var width  = Math.floor(client_size.width  * (percent.x / 100)) - work.style_w - 2;
				var height = Math.floor(client_size.height * (percent.y / 100)) - work.style_h - 2;

				// サイズをセット
				_window.style.width  = (width) + "px";
				_window.style.height = "auto";
				_window.style.maxHeight = (height) + "px";

				if(_element_parent){
					_element_parent.appendChild(_window);
				}else{
					document.body.appendChild(_window);
				}

				// バウンディングサイズ
				var hit_bounding_size;
				if(_element_hit_area){
					if(DomNodeGetAttachedDocument(_element_hit_area)){
						hit_bounding_size = ElementGetBoundingClientRect(_element_hit_area);
					}
				}
				if(!hit_bounding_size){
					var mouse_pos = ObjectCopy(input_mouse.getPositionClient());
					hit_bounding_size = {
						left  :mouse_pos.x,
						right :mouse_pos.x,
						top   :mouse_pos.y,
						bottom:mouse_pos.y
					};
				}
				hit_bounding_size.left   = Math.ceil(hit_bounding_size.left);
				hit_bounding_size.top    = Math.ceil(hit_bounding_size.top);
				hit_bounding_size.right  = Math.floor(hit_bounding_size.right);
				hit_bounding_size.bottom = Math.floor(hit_bounding_size.bottom);

				// バウンディングサイズ
				var window_bounding_size = ElementGetBoundingClientRect(_window);

				var sub_x;
				var sub_y;
				var cx = (hit_bounding_size.left + hit_bounding_size.right) * 0.5;
				var cy = (hit_bounding_size.top + hit_bounding_size.bottom) * 0.5;

				// 表示位置
				switch(project.getOriginPopupExpandBbsResponse()){
				default:
				case "adsorb_left_right":

					// 左右吸着
					if((cx / client_size.width) < 0.5){
						sub_x = hit_bounding_size.right - window_bounding_size.left;
					}else{
						sub_x = hit_bounding_size.left - window_bounding_size.right;
					}
					if((cy / client_size.height) < 0.5){
						sub_y = hit_bounding_size.top - window_bounding_size.top;
					}else{
						sub_y = hit_bounding_size.bottom - window_bounding_size.bottom;
					}
					break;

				case "adsorb_top_bottom":

					// 上下吸着
					if((cx / client_size.width) < 0.5){
						sub_x = hit_bounding_size.left - window_bounding_size.left;
					}else{
						sub_x = hit_bounding_size.right - window_bounding_size.right;
					}
					if((cy / client_size.height) < 0.5){
						sub_y = hit_bounding_size.bottom - window_bounding_size.top;
					}else{
						sub_y = hit_bounding_size.top - window_bounding_size.bottom;
					}
					break;
				}

				window_bounding_size.left   += sub_x;
				window_bounding_size.right  += sub_x;
				window_bounding_size.top    += sub_y;
				window_bounding_size.bottom += sub_y;

				var pos = {
					x:window_bounding_size.left,
					y:window_bounding_size.top
				};
				work.pos = pos;

				// サイズ補正
				if(client_size.width  < window_bounding_size.right  + 1)		pos.x += client_size.width  - 1 - window_bounding_size.right;
				if(client_size.height < window_bounding_size.bottom + 1)		pos.y += client_size.height - 1 - window_bounding_size.bottom;
				if(pos.x < 1)	pos.x = 1;
				if(pos.y < 1)	pos.y = 1;

				var h = client_size.height - pos.y - work.style_h - 1;
				if(h < height){
					height = h;
					_window.style.maxHeight = (height) + "px";
				}

				// 絶対座標系
				if(project.getStylePositionPopupBbsResponse() == "absolute"){
					pos.x -= bounding_size.left;
					pos.y -= bounding_size.top;

					// イベントハンドラを作成
					_event_handler_revise_scroll = page_expand_event_dispatcher.createEventHandler("revise_scroll");
					_event_handler_revise_scroll.setFunction(reviseScroll);
				}

				ResponseDialogPositionUpdate(task);


				// DOMContentLoaded イベントに未対応
				if(!document.addEventListener){
					execute_queue.attachLastForInsertDomNode(DomNodeAnalyzeRoot,_window);
				}

				// マウスイベント有効化
				_window.style.pointerEvents = "auto";


				// アニメーション
				if(project.getEnableAnimationPopupBbsResponse()){
					task.setExecuteFunc(ResponseDialogFadeIn);
				}else{
					task.setExecuteFunc(ResponseDialogShowInit);
				}

				task.execute(0xffffffff);
			}

			// 待機
			_task.setExecuteFunc(null);

			// 生成イベント
			var result = _this.oncreate(_window,response);
			if(result !== undefined){
				response({result:result});
			}
		}

		// -
		// フェードイン(内部用)
		// -
		function ResponseDialogFadeIn(task){
			var work = task.getUserWork();

			work.type = "fade_in";

			// マウスムーブ
			mouseMove();

			var sub = 1.0 - work.anime_pos;
			sub *= 0.4;
			if(sub > 0.0){
				work.anime_spd += 0.05;
				if(work.anime_spd > 0.2)	work.anime_spd = 0.2;
				if(work.anime_spd > sub)	work.anime_spd = sub;
			}

			work.anime_pos += work.anime_spd;
			if(work.anime_pos > 0.999){
				work.anime_spd = 0.0;
				work.anime_pos = 1.0;
				task.setExecuteFunc(ResponseDialogShowInit);
			}
			_window.style.opacity = work.anime_pos;
		}

		// -
		// 表示(内部用)
		// -
		function ResponseDialogShowInit(task){
			var work = task.getUserWork();

			work.type = "show";
			work.anime_pos = 1.0;
			work.anime_spd = 0.0;
			work.frame = project.getTimeWaitClosePopupExpandBbsResponse() / 1000 * 60;
			_window.style.opacity = work.anime_pos;

			task.setExecuteFunc(ResponseDialogShowExec);
			task.execute(0xffffffff);
		}
		function ResponseDialogShowExec(task){
			var work = task.getUserWork();

			// マウスムーブ
			mouseMove();
		}

		// -
		// 待機(内部用)
		// -
		function ResponseDialogWaitBeforeClose(task){
			var work = task.getUserWork();

			work.type = "wait_before_close";

			// マウスムーブ
			mouseMove();

			work.frame -= 1;
			if(work.frame < 0){
				// アニメーション
				if(project.getEnableAnimationPopupBbsResponse()){
					// マウスイベント無効化
					_window.style.pointerEvents = "none";
					task.setExecuteFunc(ResponseDialogFadeOut);
				}else{
					task.setExecuteFunc(ResponseDialogClose);
				}
			}
		}

		// -
		// フェードアウト(内部用)
		// -
		function ResponseDialogFadeOut(task){
			var work = task.getUserWork();

			work.type = "fade_out";

			var sub = 0.0 - work.anime_pos;
			sub *= 0.4;
			if(sub < 0.0){
				work.anime_spd -= 0.2;
				if(work.anime_spd < sub)	work.anime_spd = sub;
			}
			work.anime_pos += work.anime_spd;
			if(work.anime_pos < 0.001){
				work.anime_spd = 0.0;
				work.anime_pos = 0.0;
				task.setExecuteFunc(ResponseDialogClose);
			}
			_window.style.opacity = work.anime_pos;
		}

		// -
		// 閉じる(内部用)
		// -
		function ResponseDialogClose(task){
			var work = task.getUserWork();
			task.release();
		}

		// -
		// デストラクタ(内部用)
		// -
		function ResponseDialogDestructor(task){
			// 解放
			if(_event_handler_revise_scroll){
				_event_handler_revise_scroll.release();
				_event_handler_revise_scroll = null;
			}

			if(_analyze_work){
				// 解析辞書除外
				analyze_work_dictionary.removeAnalyzeWork(_analyze_work);
				_analyze_work = null;
			}

			if(_window){
				DomNodeRemove(_window);
				_window = null;
			}
			_task = null;

			// 自殺
			if(_suicide){
				_this.release();
			}
		}

		// -
		// サイズ更新(内部用)
		// -
		function ResponseDialogPositionUpdate(task){
			var work = task.getUserWork();
			var pos = work.pos;

			_window.style.left = (pos.x) + "px";
			_window.style.top  = (pos.y) + "px";
		}

		// -
		// ダイアログ生成イベント
		// -
		_this.oncreate = function(element){};

		// -
		// プライベート変数
		// -
		var _task;
		var _element_hit_area;
		var _element_parent;
		var _window;
		var _invalid_once;
		var _invalid_timestamp;
		var _suicide;
		var _released;
		var _analyze_work;
		var _observer_remove;
		var _event_handler_revise_scroll;
		var _event_handler_release;

		// -
		// 初期化
		// -
		(function(){
			_task = null;
			_window = null;
			_invalid_once = false;
			_invalid_timestamp = 0;
			_suicide = false;
			_released = false;
			_this._parent = null;
			_this._prev = _this;
			_this._next = _this;

			var _child = new Object();
			_child._prev = _child;
			_child._next = _child;
			_this._child = _child;

			_event_handler_release = page_expand_event_dispatcher.createEventHandler("release");
			_event_handler_release.setFunction(function(){
				_this.release();
			});
		})();
	}

	// -
	// 掲示板ポップアップ内の要素か調べる
	// -
	function BbsResponseDialogContains(node){
		while(node){
			var work = analyze_work_dictionary.getAnalyzeWork(node);
			if(work){
				if(work.id & ANALYZE_WORK_DICTIONARY_ATTACH_OPTION_OUTSIDER){
					return true;
				}
			}
			node = node.parentNode;
		}
		return false;
	}

	// -
	// 掲示板コントロール レスアンカー
	// -
	function BbsControlResponseAnchor(element,outsider){
		var _this = this;

		// -
		// タイプを取得
		// -
		_this.getType = function(id){
			return "res_a";
		};

		// -
		// ResponseAnchorNumbers オブジェクトを取得
		// -
		_this.getResponseAnchorNumbers = function(){
			return _numbers;
		};

		// -
		// ResponseAnchorNumbers オブジェクトをセット
		// -
		_this.setResponseAnchorNumbers = function(numbers){
			_numbers = numbers;
		};

		// -
		// レスポンスオブジェクトをセット
		// -
		_this.setResponse = function(response){
			if(!_response){
				_response = response;

				// 解放イベント
				var event_dispatcher = response.getEventDispatcher();
				_event_handler_release = event_dispatcher.createEventHandler("release");
				_event_handler_release.setFunction(_this.release);
			}
		};

		// -
		// 要素を取得
		// -
		_this.getElement = function(){
			return _element;
		};

		// -
		// テキストノードを取得
		// -
		_this.getTextNode = function(){
			return _text_node;
		};

		// -
		// テキストノードをセット
		// -
		_this.setTextNode = function(node){
			_text_node = node;
		};

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

			_this.onchange(0);

			// イベント解放
			if(_event_handler_release){
				_event_handler_release.release();
				_event_handler_release = null;
			}
			if(_event_handler_abort){
				_event_handler_abort.release();
				_event_handler_abort = null;
			}

			// リムーブ監視を破棄
			if(_observer_remove){
				_observer_remove.release();
				_observer_remove = null;
			}

			if(_analyze_work){
				// 解析辞書除外
				AnalyzeWorkClearBbsControl(_analyze_work);
				analyze_work_dictionary.removeAnalyzeWork(_analyze_work);
				_analyze_work = null;
			}

			if(_element){
				if(outsider){
					DomNodeRemove(_element);
				}
				_element = null;
			}
		};

		// -
		// 更新通知
		// -
		_this.onchange = function(v){};

		// -
		// プライベート変数
		// -
		var _numbers;
		var _element;
		var _text_node;
		var _analyze_work;
		var _observer_remove;
		var _response;
		var _event_handler_release;
		var _event_handler_abort;

		// -
		// 初期化
		// -
		(function(){
			if(element){
				_element = element;
				element = null;
			}else{
				_element = DocumentCreateElement("a");
			}

			// 解析ワーク作成
			_analyze_work = AnalyzeWorkCreate(_element);
			// 掲示板コントロール登録
			AnalyzeWorkSetBbsControl(_analyze_work,_this);
			// 解析済み
			AnalyzeWorkSetInvalid(_analyze_work);
			// 解析辞書登録オプション
			var attach_options = new AnalyzeWorkDictionaryAttachOptions();
			if(outsider) attach_options.SetOutsider();
			// 解析辞書登録
			analyze_work_dictionary.attachAnalyzeWork(_analyze_work,attach_options);

			// リムーブ監視
			_observer_remove = new DomNodeObserverRemoveFromDocument(_element);
			_observer_remove.setFunction(_this.release);

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

	// -
	// 掲示板コントロール レスアンカー の存在確認
	// -
	function BbsControlResponseAnchorExist(element){
		var nodes = ElementGetElementsByTagName(element,"*");
		var i;
		var num = nodes.length;
		for(i=0;i<num;i++){
			// 解析ワーク取得
			var work = analyze_work_dictionary.getAnalyzeWork(nodes[i]);
			if(work){
				var control = AnalyzeWorkGetBbsControl(work);
				if(control){
					if(control.getType() == "res_a"){
						return true;
					}
				}
			}
		}
		return false;
	}

	// -
	// 掲示板コントロール レスアンカー の検索
	// -
	function BbsControlResponseAnchorSearch(element,func){
		var result = null;
		var nodes = ElementGetElementsByTagName(element,"*");
		var i;
		var num = nodes.length;
		for(i=0;i<num;i++){
			// 解析ワーク取得
			var work = analyze_work_dictionary.getAnalyzeWork(nodes[i]);
			if(work){
				var control = AnalyzeWorkGetBbsControl(work);
				if(control){
					if(control.getType() == "res_a"){
						result = func(control);
						if(result){
							return result;
						}
					}
				}
			}
		}
		return result;
	}

	// -
	// 掲示板コントロール 引用
	// -
	function BbsControlQuote(element,outsider){
		var _this = this;

		// -
		// タイプを取得
		// -
		_this.getType = function(id){
			return "res_q";
		};

		// -
		// ResponseAnchorNumbers オブジェクトを取得
		// -
		_this.getResponseAnchorNumbers = function(){
			return _numbers;
		};

		// -
		// ResponseAnchorNumbers オブジェクトをセット
		// -
		_this.setResponseAnchorNumbers = function(numbers){
			_numbers = numbers;
		};

		// -
		// レスポンスオブジェクトをセット
		// -
		_this.setResponse = function(response){
			if(!_response){
				_response = response;

				// 解放イベント
				var event_dispatcher = response.getEventDispatcher();
				_event_handler_release = event_dispatcher.createEventHandler("release");
				_event_handler_release.setFunction(_this.release);
			}
		};

		// -
		// 要素を取得
		// -
		_this.getElement = function(){
			return _element;
		};

		// -
		// テキストノードを取得
		// -
		_this.getTextNode = function(){
			return _text_node;
		};

		// -
		// テキストノードをセット
		// -
		_this.setTextNode = function(node){
			_text_node = node;
		};

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

			_this.onchange(0);

			// イベント解放
			if(_event_handler_release){
				_event_handler_release.release();
				_event_handler_release = null;
			}
			if(_event_handler_abort){
				_event_handler_abort.release();
				_event_handler_abort = null;
			}

			// リムーブ監視を破棄
			if(_observer_remove){
				_observer_remove.release();
				_observer_remove = null;
			}

			if(_analyze_work){
				// 解析辞書除外
				AnalyzeWorkClearBbsControl(_analyze_work);
				analyze_work_dictionary.removeAnalyzeWork(_analyze_work);
				_analyze_work = null;
			}

			if(_element){
				removeEventClick();
				if(outsider){
					DomNodeRemove(_element);
				}
				_element = null;
			}
		};

		// -
		// 更新通知
		// -
		_this.onchange = function(v){};

		// -
		// マウスクリック時に実行される関数(内部用)
		// -
		function mouseClick(e){
			_this.release();
		}

		// -
		// クリックイベントを外す(内部用)
		// -
		function removeEventClick(){
			if(_element.removeEventListener){
				_element.removeEventListener("click",mouseClick);
			}
		}

		// -
		// プライベート変数
		// -
		var _numbers;
		var _element;
		var _text_node;
		var _analyze_work;
		var _observer_remove;
		var _response;
		var _event_handler_release;
		var _event_handler_abort;

		// -
		// 初期化
		// -
		(function(){
			if(element){
				_element = element;
				element = null;
			}else{
				_element = DocumentCreateElement("span");
				_element.style.cursor = "pointer";
				_element.title = "remove";
			}

			if(_element.addEventListener){
				_element.addEventListener("click",mouseClick);
			}

			// 解析ワーク作成
			_analyze_work = AnalyzeWorkCreate(_element);
			// 掲示板コントロール登録
			AnalyzeWorkSetBbsControl(_analyze_work,_this);
			// 解析済み
			AnalyzeWorkSetInvalid(_analyze_work);
			// 解析辞書登録オプション
			var attach_options = new AnalyzeWorkDictionaryAttachOptions();
			if(outsider) attach_options.SetOutsider();
			// 解析辞書登録
			analyze_work_dictionary.attachAnalyzeWork(_analyze_work,attach_options);

			// リムーブ監視
			_observer_remove = new DomNodeObserverRemoveFromDocument(_element);
			_observer_remove.setFunction(_this.release);

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

	// -
	// 掲示板コントロール 引用 の存在確認
	// -
	function BbsControlQuoteExist(element){
		var nodes = ElementGetElementsByTagName(element,"*");
		var i;
		var num = nodes.length;
		for(i=0;i<num;i++){
			if(BbsControlQuoteEqual(nodes[i])){
				return true;
			}
		}
		return false;
	}

	// -
	// 掲示板コントロール 引用 の確認
	// -
	function BbsControlQuoteEqual(element){
		// 解析ワーク取得
		var work = analyze_work_dictionary.getAnalyzeWork(element);
		if(work){
			var control = AnalyzeWorkGetBbsControl(work);
			if(control){
				if(control.getType() == "res_q"){
					return true;
				}
			}
		}
		return false;
	}

	// -
	// 掲示板コントロール 引用 の検索
	// -
	function BbsControlQuoteSearch(element,func){
		var result = null;
		var nodes = ElementGetElementsByTagName(element,"*");
		var i;
		var num = nodes.length;
		for(i=0;i<num;i++){
			// 解析ワーク取得
			var work = analyze_work_dictionary.getAnalyzeWork(nodes[i]);
			if(work){
				var control = AnalyzeWorkGetBbsControl(work);
				if(control){
					if(control.getType() == "res_q"){
						result = func(control);
						if(result){
							return result;
						}
					}
				}
			}
		}
		return result;
	}

	// -
	// 掲示板コントロール ID
	// -
	function BbsControlId(element,outsider){
		var _this = this;

		// -
		// タイプを取得
		// -
		_this.getType = function(id){
			return "id";
		};

		// -
		// ID を取得
		// -
		_this.getId = function(){
			return _id;
		};

		// -
		// ID をセット
		// -
		_this.setId = function(id){
			if(!_id){
				_id = id;

				// ID 数の更新イベント
				_event_handler_update = bbs_dictionary.createEventHandlerForIdCounter(_id);
				_event_handler_update.setFunction(function(v){
					_this.onchange(v);
				});
			}
		};

		// -
		// レスポンスオブジェクトをセット
		// -
		_this.setResponse = function(response){
			if(!_response){
				_response = response;

				// 解放イベント
				var event_dispatcher = response.getEventDispatcher();
				_event_handler_release = event_dispatcher.createEventHandler("release");
				_event_handler_release.setFunction(_this.release);
			}
		};

		// -
		// 要素を取得
		// -
		_this.getElement = function(){
			return _element;
		};

		// -
		// テキストノードを取得
		// -
		_this.getTextNode = function(){
			return _text_node;
		};

		// -
		// テキストノードをセット
		// -
		_this.setTextNode = function(node){
			_text_node = node;
		};

		// -
		// 更新
		// -
		_this.update = function(){
			var v = bbs_dictionary.getCountId(_id);
			_this.onchange(v);
		};

		// -
		// 開放
		// -
		_this.release = function(){

			_this.onchange(0);

			// イベント解放
			if(_event_handler_update){
				_event_handler_update.release();
				_event_handler_update = null;
			}
			if(_event_handler_release){
				_event_handler_release.release();
				_event_handler_release = null;
			}
			if(_event_handler_abort){
				_event_handler_abort.release();
				_event_handler_abort = null;
			}

			// リムーブ監視を破棄
			if(_observer_remove){
				_observer_remove.release();
				_observer_remove = null;
			}

			if(_analyze_work){
				// 解析辞書除外
				AnalyzeWorkClearBbsControl(_analyze_work);
				analyze_work_dictionary.removeAnalyzeWork(_analyze_work);
				_analyze_work = null;
			}

			if(_element){
				removeEventClick();
				if(outsider){
					DomNodeRemove(_element);
				}
				_element = null;
			}
		};

		// -
		// 更新通知
		// -
		_this.onchange = function(v){};

		// -
		// マウスクリック時に実行される関数(内部用)
		// -
		function mouseClick(e){
			removeEventClick();

			var ary = bbs_dictionary.getResponsesFromId(_id);
			var num = ary.length;
			var i = num - 1;
			function f(){
				ary[i].erase();

				i --;
				if(i >= 0){
					execute_queue.attachFirst(f,null);
				}else{
					_this.release();
				}
			}
			execute_queue.attachFirst(f,null);
		}

		// -
		// クリックイベントを外す(内部用)
		// -
		function removeEventClick(){
			if(_element.removeEventListener){
				_element.removeEventListener("click",mouseClick);
			}else if(_element.detachEvent){
				_element.detachEvent("onclick",mouseClick);
			}
		}

		// -
		// プライベート変数
		// -
		var _element;
		var _text_node;
		var _analyze_work;
		var _observer_remove;
		var _response;
		var _id;
		var _event_handler_update;
		var _event_handler_release;
		var _event_handler_abort;

		// -
		// 初期化
		// -
		(function(){
			if(element){
				_element = element;
				element = null;
			}else{
				_element = DocumentCreateElement("span");
				_element.style.cursor = "pointer";
				_element.title = "remove";
			}

			if(_element.addEventListener){
				_element.addEventListener("click",mouseClick);
			}else if(_element.attachEvent){
				_element.attachEvent("onclick",mouseClick);
			}

			// 解析ワーク作成
			_analyze_work = AnalyzeWorkCreate(_element);
			// 掲示板コントロール登録
			AnalyzeWorkSetBbsControl(_analyze_work,_this);
			// 解析済み
			AnalyzeWorkSetInvalid(_analyze_work);
			// 解析辞書登録オプション
			var attach_options = new AnalyzeWorkDictionaryAttachOptions();
			if(outsider) attach_options.SetOutsider();
			// 解析辞書登録
			analyze_work_dictionary.attachAnalyzeWork(_analyze_work,attach_options);

			// リムーブ監視
			_observer_remove = new DomNodeObserverRemoveFromDocument(_element);
			_observer_remove.setFunction(_this.release);

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

	// -
	// 掲示板コントロール ID の存在確認
	// -
	function BbsControlIdExist(element){
		var nodes = ElementGetElementsByTagName(element,"*");
		var i;
		var num = nodes.length;
		for(i=0;i<num;i++){
			// 解析ワーク取得
			var work = analyze_work_dictionary.getAnalyzeWork(nodes[i]);
			if(work){
				var control = AnalyzeWorkGetBbsControl(work);
				if(control){
					if(control.getType() == "id"){
						return true;
					}
				}
			}
		}
		return false;
	}

	// -
	// 掲示板コントロール ID の検索
	// -
	function BbsControlIdSearch(element,func){
		var result = null;
		var nodes = ElementGetElementsByTagName(element,"*");
		var i;
		var num = nodes.length;
		for(i=0;i<num;i++){
			// 解析ワーク取得
			var work = analyze_work_dictionary.getAnalyzeWork(nodes[i]);
			if(work){
				var control = AnalyzeWorkGetBbsControl(work);
				if(control){
					if(control.getType() == "id"){
						result = func(control);
						if(result){
							return result;
						}
					}
				}
			}
		}
		return result;
	}

	// -
	// 掲示板コントロール 名前
	// -
	function BbsControlName(element,outsider){
		var _this = this;

		// -
		// タイプを取得
		// -
		_this.getType = function(name){
			return "name";
		};

		// -
		// 名前を取得
		// -
		_this.getName = function(){
			return _name;
		};

		// -
		// 名前をセット
		// -
		_this.setName = function(name){
			if(!_name){
				_name = name;

				// 名前数の更新イベント
				_event_handler_update = bbs_dictionary.createEventHandlerForNameCounter(_name);
				_event_handler_update.setFunction(function(v){
					_this.onchange(v);
				});
			}
		};

		// -
		// レスポンスオブジェクトをセット
		// -
		_this.setResponse = function(response){
			if(!_response){
				_response = response;

				// 解放イベント
				var event_dispatcher = response.getEventDispatcher();
				_event_handler_release = event_dispatcher.createEventHandler("release");
				_event_handler_release.setFunction(_this.release);
			}
		};

		// -
		// 要素を取得
		// -
		_this.getElement = function(){
			return _element;
		};

		// -
		// テキストノードを取得
		// -
		_this.getTextNode = function(){
			return _text_node;
		};

		// -
		// テキストノードをセット
		// -
		_this.setTextNode = function(node){
			_text_node = node;
		};

		// -
		// 更新
		// -
		_this.update = function(){
			var v = bbs_dictionary.getCountName(_name);
			_this.onchange(v);
		};

		// -
		// 開放
		// -
		_this.release = function(){

			_this.onchange(0);

			// イベント解放
			if(_event_handler_update){
				_event_handler_update.release();
				_event_handler_update = null;
			}
			if(_event_handler_release){
				_event_handler_release.release();
				_event_handler_release = null;
			}
			if(_event_handler_abort){
				_event_handler_abort.release();
				_event_handler_abort = null;
			}

			// リムーブ監視を破棄
			if(_observer_remove){
				_observer_remove.release();
				_observer_remove = null;
			}

			if(_analyze_work){
				// 解析辞書除外
				AnalyzeWorkClearBbsControl(_analyze_work);
				analyze_work_dictionary.removeAnalyzeWork(_analyze_work);
				_analyze_work = null;
			}

			if(_element){
				removeEventClick();
				if(outsider){
					DomNodeRemove(_element);
				}
				_element = null;
			}
		};

		// -
		// 更新通知
		// -
		_this.onchange = function(v){};

		// -
		// マウスクリック時に実行される関数(内部用)
		// -
		function mouseClick(e){
			removeEventClick();

			var ary = bbs_dictionary.getResponsesFromName(_name);
			var num = ary.length;
			var i = num - 1;
			function f(){
				ary[i].erase();

				i --;
				if(i >= 0){
					execute_queue.attachFirst(f,null);
				}else{
					_this.release();
				}
			}
			execute_queue.attachFirst(f,null);
		}

		// -
		// クリックイベントを外す(内部用)
		// -
		function removeEventClick(){
			if(_element.removeEventListener){
				_element.removeEventListener("click",mouseClick);
			}else if(_element.detachEvent){
				_element.detachEvent("onclick",mouseClick);
			}
		}

		// -
		// プライベート変数
		// -
		var _element;
		var _text_node;
		var _analyze_work;
		var _observer_remove;
		var _response;
		var _name;
		var _event_handler_update;
		var _event_handler_release;
		var _event_handler_abort;

		// -
		// 初期化
		// -
		(function(){
			if(element){
				_element = element;
				element = null;
			}else{
				_element = DocumentCreateElement("span");
				_element.style.cursor = "pointer";
				_element.title = "remove";
			}

			if(_element.addEventListener){
				_element.addEventListener("click",mouseClick);
			}else if(_element.attachEvent){
				_element.attachEvent("onclick",mouseClick);
			}

			// 解析ワーク作成
			_analyze_work = AnalyzeWorkCreate(_element);
			// 掲示板コントロール登録
			AnalyzeWorkSetBbsControl(_analyze_work,_this);
			// 解析済み
			AnalyzeWorkSetInvalid(_analyze_work);
			// 解析辞書登録オプション
			var attach_options = new AnalyzeWorkDictionaryAttachOptions();
			if(outsider) attach_options.SetOutsider();
			// 解析辞書登録
			analyze_work_dictionary.attachAnalyzeWork(_analyze_work,attach_options);

			// リムーブ監視
			_observer_remove = new DomNodeObserverRemoveFromDocument(_element);
			_observer_remove.setFunction(_this.release);

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

	// -
	// 掲示板コントロール 名前 の存在確認
	// -
	function BbsControlNameExist(element){
		var nodes = ElementGetElementsByTagName(element,"*");
		var i;
		var num = nodes.length;
		for(i=0;i<num;i++){
			// 解析ワーク取得
			var work = analyze_work_dictionary.getAnalyzeWork(nodes[i]);
			if(work){
				var control = AnalyzeWorkGetBbsControl(work);
				if(control){
					if(control.getType() == "name"){
						return true;
					}
				}
			}
		}
		return false;
	}

	// -
	// 掲示板コントロール 名前 の検索
	// -
	function BbsControlNameSearch(element,func){
		var result = null;
		var nodes = ElementGetElementsByTagName(element,"*");
		var i;
		var num = nodes.length;
		for(i=0;i<num;i++){
			// 解析ワーク取得
			var work = analyze_work_dictionary.getAnalyzeWork(nodes[i]);
			if(work){
				var control = AnalyzeWorkGetBbsControl(work);
				if(control){
					if(control.getType() == "name"){
						result = func(control);
						if(result){
							return result;
						}
					}
				}
			}
		}
		return result;
	}

	// -
	// 掲示板コントロール ホスト
	// -
	function BbsControlHost(element,outsider){
		var _this = this;

		// -
		// タイプを取得
		// -
		_this.getType = function(host){
			return "host";
		};

		// -
		// ホストを取得
		// -
		_this.getHost = function(){
			return _host;
		};

		// -
		// ホストをセット
		// -
		_this.setHost = function(host){
			if(!_host){
				_host = host;

				// ホスト数の更新イベント
				_event_handler_update = bbs_dictionary.createEventHandlerForHostCounter(_host);
				_event_handler_update.setFunction(function(v){
					_this.onchange(v);
				});
			}
		};

		// -
		// レスポンスオブジェクトをセット
		// -
		_this.setResponse = function(response){
			if(!_response){
				_response = response;

				// 解放イベント
				var event_dispatcher = response.getEventDispatcher();
				_event_handler_release = event_dispatcher.createEventHandler("release");
				_event_handler_release.setFunction(_this.release);
			}
		};

		// -
		// 要素を取得
		// -
		_this.getElement = function(){
			return _element;
		};

		// -
		// テキストノードを取得
		// -
		_this.getTextNode = function(){
			return _text_node;
		};

		// -
		// テキストノードをセット
		// -
		_this.setTextNode = function(node){
			_text_node = node;
		};

		// -
		// 更新
		// -
		_this.update = function(){
			var v = bbs_dictionary.getCountHost(_host);
			_this.onchange(v);
		};

		// -
		// 開放
		// -
		_this.release = function(){

			_this.onchange(0);

			// イベント解放
			if(_event_handler_update){
				_event_handler_update.release();
				_event_handler_update = null;
			}
			if(_event_handler_release){
				_event_handler_release.release();
				_event_handler_release = null;
			}
			if(_event_handler_abort){
				_event_handler_abort.release();
				_event_handler_abort = null;
			}

			// リムーブ監視を破棄
			if(_observer_remove){
				_observer_remove.release();
				_observer_remove = null;
			}

			if(_analyze_work){
				// 解析辞書除外
				AnalyzeWorkClearBbsControl(_analyze_work);
				analyze_work_dictionary.removeAnalyzeWork(_analyze_work);
				_analyze_work = null;
			}

			if(_element){
				removeEventClick();
				if(outsider){
					DomNodeRemove(_element);
				}
				_element = null;
			}
		};

		// -
		// 更新通知
		// -
		_this.onchange = function(v){};

		// -
		// マウスクリック時に実行される関数(内部用)
		// -
		function mouseClick(e){
			removeEventClick();

			var ary = bbs_dictionary.getResponsesFromHost(_host);
			var num = ary.length;
			var i = num - 1;
			function f(){
				ary[i].erase();

				i --;
				if(i >= 0){
					execute_queue.attachFirst(f,null);
				}else{
					_this.release();
				}
			}
			execute_queue.attachFirst(f,null);
		}

		// -
		// クリックイベントを外す(内部用)
		// -
		function removeEventClick(){
			if(_element.removeEventListener){
				_element.removeEventListener("click",mouseClick);
			}else if(_element.detachEvent){
				_element.detachEvent("onclick",mouseClick);
			}
		}

		// -
		// プライベート変数
		// -
		var _element;
		var _text_node;
		var _analyze_work;
		var _observer_remove;
		var _response;
		var _host;
		var _event_handler_update;
		var _event_handler_release;
		var _event_handler_abort;

		// -
		// 初期化
		// -
		(function(){
			if(element){
				_element = element;
				element = null;
			}else{
				_element = DocumentCreateElement("span");
				_element.style.cursor = "pointer";
				_element.title = "remove";
			}

			if(_element.addEventListener){
				_element.addEventListener("click",mouseClick);
			}else if(_element.attachEvent){
				_element.attachEvent("onclick",mouseClick);
			}

			// 解析ワーク作成
			_analyze_work = AnalyzeWorkCreate(_element);
			// 掲示板コントロール登録
			AnalyzeWorkSetBbsControl(_analyze_work,_this);
			// 解析済み
			AnalyzeWorkSetInvalid(_analyze_work);
			// 解析辞書登録オプション
			var attach_options = new AnalyzeWorkDictionaryAttachOptions();
			if(outsider) attach_options.SetOutsider();
			// 解析辞書登録
			analyze_work_dictionary.attachAnalyzeWork(_analyze_work,attach_options);

			// リムーブ監視
			_observer_remove = new DomNodeObserverRemoveFromDocument(_element);
			_observer_remove.setFunction(_this.release);

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

	// -
	// 掲示板コントロール ホスト の存在確認
	// -
	function BbsControlHostExist(element){
		var nodes = ElementGetElementsByTagName(element,"*");
		var i;
		var num = nodes.length;
		for(i=0;i<num;i++){
			// 解析ワーク取得
			var work = analyze_work_dictionary.getAnalyzeWork(nodes[i]);
			if(work){
				var control = AnalyzeWorkGetBbsControl(work);
				if(control){
					if(control.getType() == "host"){
						return true;
					}
				}
			}
		}
		return false;
	}

	// -
	// 掲示板コントロール ホスト の検索
	// -
	function BbsControlHostSearch(element,func){
		var result = null;
		var nodes = ElementGetElementsByTagName(element,"*");
		var i;
		var num = nodes.length;
		for(i=0;i<num;i++){
			// 解析ワーク取得
			var work = analyze_work_dictionary.getAnalyzeWork(nodes[i]);
			if(work){
				var control = AnalyzeWorkGetBbsControl(work);
				if(control){
					if(control.getType() == "host"){
						result = func(control);
						if(result){
							return result;
						}
					}
				}
			}
		}
		return result;
	}

	// -
	// 掲示板コントロール Follower
	// -
	function BbsControlFollower(element,outsider){
		var _this = this;

		// -
		// タイプを取得
		// -
		_this.getType = function(id){
			return "follower";
		};

		// -
		// レスポンスオブジェクトをセット
		// -
		_this.setResponse = function(response){
			if(!_response){
				_response = response;

				// フォロワー数の更新イベント
				_event_handler_update = bbs_dictionary.createEventHandlerForFollowerCounter(response.getNumber());
				_event_handler_update.setFunction(function(v){
					_this.onchange(v);
				});

				// 解放イベント
				var event_dispatcher = response.getEventDispatcher();
				_event_handler_release = event_dispatcher.createEventHandler("release");
				_event_handler_release.setFunction(_this.release);
			}
		};

		// -
		// 要素を取得
		// -
		_this.getElement = function(){
			return _element;
		};

		// -
		// テキストノードを取得
		// -
		_this.getTextNode = function(){
			return _text_node;
		};

		// -
		// テキストノードをセット
		// -
		_this.setTextNode = function(node){
			_text_node = node;
		};

		// -
		// 更新
		// -
		_this.update = function(){
			var v = _response.getCountFollower();
			_this.onchange(v);
		};

		// -
		// 開放
		// -
		_this.release = function(){
			// イベント解放
			if(_event_handler_update){
				_event_handler_update.release();
				_event_handler_update = null;
			}
			if(_event_handler_release){
				_event_handler_release.release();
				_event_handler_release = null;
			}
			if(_event_handler_abort){
				_event_handler_abort.release();
				_event_handler_abort = null;
			}

			// リムーブ監視を破棄
			if(_observer_remove){
				_observer_remove.release();
				_observer_remove = null;
			}

			if(_analyze_work){
				// 解析辞書除外
				AnalyzeWorkClearBbsControl(_analyze_work);
				analyze_work_dictionary.removeAnalyzeWork(_analyze_work);
				_analyze_work = null;
			}

			if(_element){
				removeEventClick();
				if(outsider){
					DomNodeRemove(_element);
				}
				_element = null;
			}
		};

		// -
		// 更新通知
		// -
		_this.onchange = function(v){};

		// -
		// マウスクリック時に実行される関数(内部用)
		// -
		function mouseClick(e){
			removeEventClick();

			var ary = _response.getFollower();
			var num = ary.length;
			var i = num - 1;
			function f(){
				var follower = bbs_dictionary.getResponse(ary[i].getNumber());
				follower.erase();

				i --;
				if(i >= 0){
					execute_queue.attachFirst(f,null);
				}else{
					_this.release();
				}
			}
			execute_queue.attachFirst(f,null);
		}

		// -
		// クリックイベントを外す(内部用)
		// -
		function removeEventClick(){
			if(_element.removeEventListener){
				_element.removeEventListener("click",mouseClick);
			}else if(_element.detachEvent){
				_element.detachEvent("onclick",mouseClick);
			}
		}

		// -
		// プライベート変数
		// -
		var _element;
		var _text_node;
		var _analyze_work;
		var _observer_remove;
		var _response;
		var _event_handler_update;
		var _event_handler_release;
		var _event_handler_abort;

		// -
		// 初期化
		// -
		(function(){
			if(element){
				_element = element;
				element = null;
			}else{
				_element = DocumentCreateElement("span");
				_element.style.cursor = "pointer";
				_element.title = "remove";
			}

			if(_element.addEventListener){
				_element.addEventListener("click",mouseClick);
			}else if(_element.attachEvent){
				_element.attachEvent("onclick",mouseClick);
			}

			// 解析ワーク作成
			_analyze_work = AnalyzeWorkCreate(_element);
			// 掲示板コントロール登録
			AnalyzeWorkSetBbsControl(_analyze_work,_this);
			// 解析済み
			AnalyzeWorkSetInvalid(_analyze_work);
			// 解析辞書登録オプション
			var attach_options = new AnalyzeWorkDictionaryAttachOptions();
			if(outsider) attach_options.SetOutsider();
			// 解析辞書登録
			analyze_work_dictionary.attachAnalyzeWork(_analyze_work,attach_options);

			// リムーブ監視
			_observer_remove = new DomNodeObserverRemoveFromDocument(_element);
			_observer_remove.setFunction(_this.release);

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

	// -
	// 掲示板コントロール Follower の存在確認
	// -
	function BbsControlFollowerExist(element){
		var nodes = ElementGetElementsByTagName(element,"*");
		var i;
		var num = nodes.length;
		for(i=0;i<num;i++){
			// 解析ワーク取得
			var work = analyze_work_dictionary.getAnalyzeWork(nodes[i]);
			if(work){
				var control = AnalyzeWorkGetBbsControl(work);
				if(control){
					if(control.getType() == "follower"){
						return true;
					}
				}
			}
		}
		return false;
	}

	// -
	// 掲示板コントロール Follower の検索
	// -
	function BbsControlFollowerSearch(element,func){
		var result = null;
		var nodes = ElementGetElementsByTagName(element,"*");
		var i;
		var num = nodes.length;
		for(i=0;i<num;i++){
			// 解析ワーク取得
			var work = analyze_work_dictionary.getAnalyzeWork(nodes[i]);
			if(work){
				var control = AnalyzeWorkGetBbsControl(work);
				if(control){
					if(control.getType() == "follower"){
						result = func(control);
						if(result){
							return result;
						}
					}
				}
			}
		}
		return result;
	}

	// -
	// 掲示板コントロール 返信
	// -
	function BbsControlReply(element,outsider){
		var _this = this;

		// -
		// タイプを取得
		// -
		_this.getType = function(){
			return "reply";
		};

		// -
		// レスポンスオブジェクトをセット
		// -
		_this.setResponse = function(response){
			if(!_response){
				_response = response;

				// 解放イベント
				var event_dispatcher = response.getEventDispatcher();
				_event_handler_release = event_dispatcher.createEventHandler("release");
				_event_handler_release.setFunction(_this.release);
			}
		};

		// -
		// 要素を取得
		// -
		_this.getElement = function(){
			return _element;
		};

		// -
		// テキストノードを取得
		// -
		_this.getTextNode = function(){
			return _text_node;
		};

		// -
		// テキストノードをセット
		// -
		_this.setTextNode = function(node){
			_text_node = node;
		};

		// -
		// 開放
		// -
		_this.release = function(){

			// イベント解放
			if(_event_handler_release){
				_event_handler_release.release();
				_event_handler_release = null;
			}
			if(_event_handler_abort){
				_event_handler_abort.release();
				_event_handler_abort = null;
			}

			// リムーブ監視を破棄
			if(_observer_remove){
				_observer_remove.release();
				_observer_remove = null;
			}

			if(_analyze_work){
				// 解析辞書除外
				AnalyzeWorkClearBbsControl(_analyze_work);
				analyze_work_dictionary.removeAnalyzeWork(_analyze_work);
				_analyze_work = null;
			}

			if(_element){
				removeEventClick();
				if(outsider){
					DomNodeRemove(_element);
				}
				_element = null;
			}
		};

		// -
		// クリック通知
		// -
		_this.onclick = function(v){};

		// -
		// マウスクリック時に実行される関数(内部用)
		// -
		function mouseClick(e){
			if(_this.onclick) _this.onclick(e);	
			if(e.preventDefault){
				e.preventDefault();
			}else{
				return false;
			}
		}

		// -
		// クリックイベントを外す(内部用)
		// -
		function removeEventClick(){
			if(_element.removeEventListener){
				_element.removeEventListener("click",mouseClick);
			}else if(_element.detachEvent){
				_element.detachEvent("onclick",mouseClick);
			}
		}

		// -
		// プライベート変数
		// -
		var _element;
		var _text_node;
		var _analyze_work;
		var _observer_remove;
		var _response;
		var _event_handler_release;
		var _event_handler_abort;

		// -
		// 初期化
		// -
		(function(){
			if(element){
				_element = element;
				element = null;
			}else{
				_element = DocumentCreateElement("span");
				_element.style.cursor = "pointer";
				_element.title = "reply";
			}

			if(_element.addEventListener){
				_element.addEventListener("click",mouseClick);
			}else if(_element.attachEvent){
				_element.attachEvent("onclick",mouseClick);
			}

			// 解析ワーク作成
			_analyze_work = AnalyzeWorkCreate(_element);
			// 掲示板コントロール登録
			AnalyzeWorkSetBbsControl(_analyze_work,_this);
			// 解析済み
			AnalyzeWorkSetInvalid(_analyze_work);
			// 解析辞書登録オプション
			var attach_options = new AnalyzeWorkDictionaryAttachOptions();
			if(outsider) attach_options.SetOutsider();
			// 解析辞書登録
			analyze_work_dictionary.attachAnalyzeWork(_analyze_work,attach_options);

			// リムーブ監視
			_observer_remove = new DomNodeObserverRemoveFromDocument(_element);
			_observer_remove.setFunction(_this.release);

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

	// -
	// 掲示板コントロール 返信 の存在確認
	// -
	function BbsControlReplyExist(element){
		var nodes = ElementGetElementsByTagName(element,"*");
		var i;
		var num = nodes.length;
		for(i=0;i<num;i++){
			if(BbsControlReplyEqual(nodes[i])){
				return true;
			}
		}
		return false;
	}

	// -
	// 掲示板コントロール 返信 の確認
	// -
	function BbsControlReplyEqual(element){
		// 解析ワーク取得
		var work = analyze_work_dictionary.getAnalyzeWork(element);
		if(work){
			var control = AnalyzeWorkGetBbsControl(work);
			if(control){
				if(control.getType() == "reply"){
					return true;
				}
			}
		}
		return false;
	}

	// -
	// 掲示板コントロール 返信 の検索
	// -
	function BbsControlReplySearch(element,func){
		var result = null;
		var nodes = ElementGetElementsByTagName(element,"*");
		var i;
		var num = nodes.length;
		for(i=0;i<num;i++){
			// 解析ワーク取得
			var work = analyze_work_dictionary.getAnalyzeWork(nodes[i]);
			if(work){
				var control = AnalyzeWorkGetBbsControl(work);
				if(control){
					if(control.getType() == "reply"){
						result = func(control);
						if(result){
							return result;
						}
					}
				}
			}
		}
		return result;
	}

	// -
	// 掲示板コントロール ReadMoreButton
	// -
	function BbsControlReadMoreButton(){
		var _this = this;

		// -
		// タイプを取得
		// -
		_this.getType = function(id){
			return "read_more";
		};

		// -
		// 開放
		// -
		_this.release = function(){

			// イベント解放
			if(_event_handler_abort){
				_event_handler_abort.release();
				_event_handler_abort = null;
			}

			// リムーブ監視を破棄
			if(_observer_remove){
				_observer_remove.release();
				_observer_remove = null;
			}
			removeObserverScroll();

			if(_analyze_work){
				// 解析辞書除外
				AnalyzeWorkClearBbsControl(_analyze_work);
				analyze_work_dictionary.removeAnalyzeWork(_analyze_work);
				_analyze_work = null;
			}

			if(_element){
				if(_element.removeEventListener){
					_element.removeEventListener("mousedown",mouseDown);
					_element.removeEventListener("click",mouseClick);
				}else if(_element.detachEvent){
					_element.detachEvent("onmousedown",mouseDown);
					_element.detachEvent("onclick",mouseClick);
				}
				DomNodeRemove(_element);
				_element = null;
			}
		};

		// -
		// 要素取得
		// -
		_this.getElement = function(){
			return _element;
		};

		// -
		// 待機時間を設定 (単位:ミリ秒)
		// -
		_this.setWaitTime = function(v){
			_wait_time = v;
		};

		// -
		// 初期化
		// -
		_this.init = function(){
			_auto_mode = false;
			ButtonSetValue("Read More");
			_element.style.color = "#000";
			_element.disabled = false;
			_timer = _getTime();
			_auto_time_now = _auto_time;
			if(_task){
				_task.release();
				_task = null;
			}
			scroll();
		};

		// -
		// マウスダウン時に実行される関数(内部用)
		// -
		function mouseDown(e){
			// マウス入力を更新
			input_mouse.setMouseEvent(e);

			// スクロールを無効化
			if(MouseEventGetChangedButtons(e) & 0x04){
				click(e);
				if(e.preventDefault){
					e.preventDefault();
				}else{
					return false;
				}
			}
		}

		// -
		// マウスクリック時に実行される関数(内部用)
		// -
		function mouseClick(e){
			// マウス入力を更新
			input_mouse.setMouseEvent(e);

			if(MouseEventGetChangedButtons(e) & 0x04){
			}else{
				click(e);
			}
		}

		// -
		// クリック(内部用)
		// -
		function click(e){
			if(!(_this.onclick)) return;
			if(_task){
				if(_auto_mode){
					_this.init();
				}
				return;
			}

			if(e.ctrlKey || e.shiftKey || (MouseEventGetChangedButtons(e) & 0x04)){
				_auto_mode = true;
				_element.style.color = "#d00";
			}else{
				_element.disabled = true;
			}

			// タスク生成
			_task = task_container.createTask();
			if(_auto_mode){
				if(_getTime() - _timer < _auto_time_now){
					_task.setExecuteFunc(ReadMoreAutoLoadWaitInit);
				}else{
					_task.setExecuteFunc(ReadMoreLoadInit);
				}
			}else{
				if(_getTime() - _timer < _wait_time){
					_task.setExecuteFunc(ReadMoreLoadWaitInit);
				}else{
					_task.setExecuteFunc(ReadMoreLoadInit);
				}
			}
		}

		// -
		// スクロール監視開始(内部用)
		// -
		function attachObserverScroll (){
			removeObserverScroll();

			// イベントリスナーに対応している
			if(window.addEventListener){
				window.addEventListener("scroll" ,scroll);
			// アタッチイベントに対応している
			}else if(window.attachEvent){
				window.attachEvent("onscroll" ,scroll);
			}
		}

		// -
		// スクロール監視終了(内部用)
		// -
		function removeObserverScroll (){
			// イベントリスナーに対応している
			if(window.removeEventListener){
				window.removeEventListener("scroll" ,scroll);
			// アタッチイベントに対応している
			}else if(window.detachEvent){
				window.detachEvent("onscroll" ,scroll);
			}
		}

		// -
		// スクロール時に実行される関数(内部用)
		// -
		function scroll(){
			removeObserverScroll();
			_add_count = 0;
			updateTitle();
		}

		// -
		// 読み込み待機(内部用)
		// -
		function ReadMoreLoadWaitInit(){
			_task.setExecuteFunc(ReadMoreLoadWaitExec);
			_task.execute(0xffffffff);
		}
		function ReadMoreLoadWaitExec(){
			var time_sub = _getTime() - _timer;

			var t = Math.ceil((_wait_time - time_sub) / 1000);
			if(t < 0)	t = 0;
			ButtonSetValue("wait ... " + t);

			if(time_sub > _wait_time){
				_task.setExecuteFunc(ReadMoreLoadInit);
			}
		}

		// -
		// 自動読み込み待機(内部用)
		// -
		function ReadMoreAutoLoadWaitInit(){
			_task.setExecuteFunc(ReadMoreAutoLoadWaitExec);
			_task.execute(0xffffffff);
		}
		function ReadMoreAutoLoadWaitExec(){
			var time_sub = _getTime() - _timer;

			var t = Math.ceil((_auto_time_now - time_sub) / 1000);
			if(t < 0)	t = 0;
			ButtonSetValue("auto ... " + t);

			if(time_sub > _auto_time_now){
				_task.setExecuteFunc(ReadMoreLoadInit);
			}
		}

		// -
		// 読み込み(内部用)
		// -
		function ReadMoreLoadInit(){
			ButtonSetValue("loading...");
			_task.setExecuteFunc(null);

			_this.onclick(function(response){
				if(_auto_mode){
					if(response.result){
						if(response.add_count){
							_auto_time_now = _auto_time_now * 0.5;
							_add_count += response.add_count;
							updateTitle();
							attachObserverScroll();
						}else{
							var add = _auto_time_now * 0.5
							if(add < 5000) add = 5000;
							_auto_time_now += add;
						}
						_auto_time_now = Math.ceil(_auto_time_now / 1000) * 1000;
						if(_auto_time_now > _auto_time_max) _auto_time_now = _auto_time_max;
						if(_auto_time_now < _auto_time_min) _auto_time_now = _auto_time_min;

						_timer = _getTime();
						_task.setExecuteFunc(ReadMoreAutoLoadWaitInit);
					}else{
						_this.init();
					}
				}else{
					_this.init();
				}
			});
		}

		// -
		// テキストを設定(内部用)
		// -
		function ButtonSetValue(v){
			if(v == _button_value_old) return;
			_element.value = _button_value_old = v;
		}

		// -
		// タイトルを更新(内部用)
		// -
		function updateTitle(){
			try{
				var title = document.title;
				var m = title.match(new RegExp("\\([0-9]+\\) (.*)","i"));
				if(m){
					if(_title_old != m[1]){
						_title_old = m[1];
					}
				}else{
					_title_old = title;
				}
				if(_add_count){
					document.title = "(" + _add_count + ") " + _title_old;
				}else{
					document.title = _title_old;
				}
			}catch(e){
			}
		}

		// -
		// プライベート変数
		// -
		var _element;
		var _task;
		var _onclick;
		var _timer;
		var _wait_time;
		var _auto_time;
		var _auto_time_now;
		var _auto_time_min;
		var _auto_time_max;
		var _auto_mode;
		var _button_value_old;
		var _title_old;
		var _add_count;
		var _analyze_work;
		var _observer_remove;
		var _event_handler_abort;
		var _getTime;

		// -
		// 初期化
		// -
		(function(){
			_this.onclick = null;
			_timer = 0;
			_wait_time = 5 * 1000;
			_auto_time = 10 * 1000;
			_auto_time_min =  5 * 1000;
			_auto_time_max = 60 * 1000;
			_button_value_old = "";
			_add_count = 0;
			_title_old = "";

			// ボタン
			_element = DocumentCreateElement("input");
			_element.type = "button";
			ElementSetStyle(_element,CSSTextGetInitialButtonElement());
			ElementAddStyle(_element,"width:100%; height:50px; margin:25px 0px; padding:0px;");
			if(_element.addEventListener){
				_element.addEventListener("mousedown",mouseDown);
				_element.addEventListener("click",mouseClick);
			}else if(_element.attachEvent){
				_element.attachEvent("onmousedown",mouseDown);
				_element.attachEvent("onclick",mouseClick);
			}
			// 解析ワーク作成
			_analyze_work = AnalyzeWorkCreate(_element);
			// 掲示板コントロール登録
			AnalyzeWorkSetBbsControl(_analyze_work,_this);
			// 解析済み
			AnalyzeWorkSetInvalid(_analyze_work);
			// 解析辞書登録オプション
			var attach_options = new AnalyzeWorkDictionaryAttachOptions();
			attach_options.SetOutsider();
			// 解析辞書登録
			analyze_work_dictionary.attachAnalyzeWork(_analyze_work,attach_options);

			// リムーブ監視
			_observer_remove = new DomNodeObserverRemoveFromDocument(_element);
			_observer_remove.setFunction(_this.release);

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

			// 時間取得関数
			_getTime = Date.now;
			if(!_getTime)	_getTime = function(){ return (new Date()).getTime(); };

			_this.init();
		})();
	}

	// -
	// 掲示板コントロール PopupIframe
	// -
	function BbsControlPopupIframe(name){
		var _this = this;

		// -
		// 開放
		// -
		_this.release = function(){
			release_0();
			release_1();
		};

		// -
		// 閉じる
		// -
		_this.close = function(){
			release_0();

			(function(){
				if(_fade_task){
					_fade_task.release();
					_fade_task = null;
				}
				_fade_task = task_container.createTask();
				_fade_task.setDestructorFunc(function(){
					_fade_task = null;
				});
				_fade_task.setExecuteFunc(function(){
					_fade_alpha -= 0.2;
					if(_fade_alpha < 0.0){
						_fade_alpha = 0.0;
						_fade_task.release();
						release_1();
					}
					_element_container.style.opacity = _fade_alpha;
				});
				_fade_task.execute(0xffffffff);
			})();
		}

		// -
		// 開放 0(内部用)
		// -
		function release_0 (){
			_element_iframe.src = "";
			removeEvent();

			// イベント解放
			if(_event_handler_abort){
				_event_handler_abort.release();
				_event_handler_abort = null;
			}

			// マウスイベント無効化
			_element_container.style.pointerEvents = "none";
		};

		// -
		// 開放 1(内部用)
		// -
		function release_1 (){
			DomNodeRemove(_element_container);

			// リムーブ監視を破棄
			if(_observer_remove){
				_observer_remove.release();
				_observer_remove = null;
			}

			// 解析辞書除外
			if(_analyze_work){
				analyze_work_dictionary.removeAnalyzeWork(_analyze_work);
				_analyze_work = null;
			}

			// タスク破棄
			if(_parent_task){
				_parent_task.releaseChild();
				_parent_task.release();
				_parent_task = null;
			}
		};

		// -
		// IFRAME 要素取得
		// -
		_this.getIFrameElement = function(){
			return _element_iframe;
		};

		// -
		// サイズをセット
		// -
		_this.setWindowSize = function(w,h){
			_element_window.style.width  = w + "px";
			_element_iframe.style.height = h + "px";

			resize();
		};

		// -
		// 中断イベント
		// -
		_this.onclose = function(){};

		// -
		// リサイズ(内部用 )
		// -
		function resize(){
			var scroll_pos = WindowGetScrollPosition(window);
			var client_size = DocumentGetClientSize(document);
			var dialog_rect = ElementGetBoundingClientRect(_element_window);

			var w = dialog_rect.right - dialog_rect.left;
			var h = dialog_rect.bottom - dialog_rect.top;

			_element_window.style.left = (client_size.width  / 2 - w / 2 + scroll_pos.x) + "px";
			if(client_size.height > h){
				_element_window.style.top  = (client_size.height / 2 - h / 2 + scroll_pos.y) + "px";
				_fitted_top = false;
			}else{
				if(!_fitted_top){
					_element_window.style.top  = (scroll_pos.y) + "px";
					_fitted_top = true;
				}
			}
		}

		// -
		// イベント登録(内部用 )
		// -
		function addEvent(){
			// イベントリスナーに対応している
			if(window.addEventListener){

				window.addEventListener("scroll" ,resize);
				window.addEventListener("resize" ,resize);

			// アタッチイベントに対応している
			}else if(window.attachEvent){

				window.attachEvent("onscroll" ,resize);
				window.attachEvent("onresize" ,resize);

			}

		}

		// -
		// イベント破棄(内部用 )
		// -
		function removeEvent(){
			// イベントリスナーに対応している
			if(window.removeEventListener){

				window.removeEventListener("scroll" ,resize);
				window.removeEventListener("resize" ,resize);

			// アタッチイベントに対応している
			}else if(window.detachEvent){

				window.detachEvent("onscroll" ,resize);
				window.detachEvent("onresize" ,resize);

			}
		}

		// -
		// プライベート変数
		// -
		var _element_container;
		var _element_background;
		var _element_window;
		var _element_iframe;
		var _button_cancel;
		var _observer_remove;
		var _event_handler_abort;
		var _parent_task;
		var _fade_task;
		var _fade_alpha;
		var _analyze_work;
		var _fitted_top;

		// -
		// 初期化
		// -
		(function(){
			// コンテナ
			_element_container = DocumentCreateElement("div");
			ElementSetStyle(_element_container,CSSTextGetInitialDivElement());

			// 背景
			_element_background = DocumentCreateElement("div");
			ElementSetStyle(_element_background,CSSTextGetInitialDivElement());
			ElementAddStyle(_element_background,"position:fixed; top:0px; bottom:0px; left:0px; right:0px; opacity:0.5; background:#000; line-height:1.0; z-index:2147483646; pointer-events:inherit;");
			_element_container.appendChild(_element_background);

			// ウィンドウ
			_element_window = DocumentCreateElement("div");
			ElementSetStyle(_element_window,CSSTextGetInitialDivElement());
			ElementAddStyle(_element_window,"position:absolute; width:600px; padding:25px; background:#00F; background-color:#FFF; border-radius:5px; box-shadow:5px 5px 10px #444; z-index:2147483646; pointer-events:inherit;");
			_element_container.appendChild(_element_window);

			// インラインフレーム
			_element_iframe = DocumentCreateElement("iframe");
			_element_iframe.name = name;
			ElementSetStyle(_element_iframe,"width:100%; height:400px; margin-bottom:20px; padding:0px; background:#f8f8f8; pointer-events:inherit;");
			_element_window.appendChild(_element_iframe);

			// ボタン
			_button_cancel = DocumentCreateElement("input");
			_button_cancel.type = "button";
			_button_cancel.value = "CANCEL";
			ElementSetStyle(_button_cancel,CSSTextGetInitialButtonElement());
			ElementAddStyle(_button_cancel,"width:100%; height:50px; pointer-events:inherit;");
			_element_window.appendChild(_button_cancel);
			_button_cancel.onclick = function(){
				if(_this.onclose){
					_this.onclose();
				}
				_this.close();
			};

			// 解析ワーク作成
			_analyze_work = AnalyzeWorkCreate(_element_container);

			// 解析済み
			AnalyzeWorkSetInvalid(_analyze_work);

			// 解析辞書登録オプション
			var attach_options = new AnalyzeWorkDictionaryAttachOptions();
			attach_options.SetOutsider();
			analyze_work_dictionary.attachAnalyzeWork(_analyze_work,attach_options);

			document.body.appendChild(_element_container);

			// イベントを登録
			addEvent();

			// リサイズ
			_this.setWindowSize(640,480);

			// リムーブ監視
			_observer_remove = new DomNodeObserverRemoveFromDocument(_element_container);
			_observer_remove.setFunction(_this.release);

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

			(function(){
				// 親タスク
				_parent_task = task_container.createTask();
				_parent_task.setDestructorFunc(function(){
					_parent_task = null;
				});

				// フェードインタスク
				_fade_alpha = 0.0;
				_fade_task = task_container.createTask(_parent_task);
				_fade_task.setDestructorFunc(function(){
					_fade_task = null;
				});
				_fade_task.setExecuteFunc(function(){
					_fade_alpha += 0.2;
					if(_fade_alpha > 1.0){
						_fade_alpha = 1.0;
						_fade_task.release();
					}
					_element_container.style.opacity = _fade_alpha;
				});
				_fade_task.execute(0xffffffff);
			})();

		})();
	}

	// -
	// 掲示板コントロール DockingForm
	// -
	function BbsControlDockingForm(element,outsider){
		var _this = this;

		// -
		// スタイルを設定
		// -
		_this.setStyle = function(css_text){
			_css_text_popup = css_text;
		};

		// -
		// 要素を取得
		// -
		_this.getElement = function(){
			return _element;
		};

		// -
		// リセット通知
		// -
		_this.onreset = function(v){};

		// -
		// 開放
		// -
		_this.release = function(){
			update("original");

			if(_task){
				_task.release();
				_task = null;
			}

			if(_event_handler_abort){
				_event_handler_abort.release();
				_event_handler_abort = null;
			}

			// リムーブ監視を破棄
			if(_observer_remove){
				_observer_remove.release();
				_observer_remove = null;
			}

			if(_analyze_work){
				// 解析辞書除外
				AnalyzeWorkClearBbsControl(_analyze_work);
				analyze_work_dictionary.removeAnalyzeWork(_analyze_work);
				_analyze_work = null;
			}

			if(_element){
				removeEvent();
				if(outsider){
					DomNodeRemove(_element);
				}
				_element = null;
			}
			DomNodeRemove(_element_border);
		};

		// -
		// 返信用ポップアップ
		// -
		_this.popupForReply = function(element){
			switch(_docking_type){
			case "original":

				// ポップアップ
				update("popup");

				// クライアントサイズ
				var client_size = DocumentGetClientSize(document);

				// バウンディングサイズ
				var hit_bounding_size;
				if(element){
					if(DomNodeGetAttachedDocument(element)){
						hit_bounding_size = ElementGetBoundingClientRect(element);
					}
				}
				if(!hit_bounding_size){
					var mouse_pos = ObjectCopy(input_mouse.getPositionClient());
					hit_bounding_size = {
						left  :mouse_pos.x,
						right :mouse_pos.x,
						top   :mouse_pos.y,
						bottom:mouse_pos.y
					};
				}
				hit_bounding_size.left   = Math.ceil(hit_bounding_size.left);
				hit_bounding_size.top    = Math.ceil(hit_bounding_size.top);
				hit_bounding_size.right  = Math.floor(hit_bounding_size.right);
				hit_bounding_size.bottom = Math.floor(hit_bounding_size.bottom);

				// バウンディングサイズ
				var window_bounding_size = ElementGetBoundingClientRect(_element);

				var sub_x;
				var sub_y;
				var cx = (hit_bounding_size.left + hit_bounding_size.right) * 0.5;
				var cy = (hit_bounding_size.top + hit_bounding_size.bottom) * 0.5;
				if((cx / client_size.width) < 0.5){
					sub_x = hit_bounding_size.left - window_bounding_size.left;
				}else{
					sub_x = hit_bounding_size.right - window_bounding_size.right;
				}
				if((cy / client_size.height) < 0.5){
					sub_y = hit_bounding_size.bottom - window_bounding_size.top;
				}else{
					sub_y = hit_bounding_size.top - window_bounding_size.bottom;
				}

				window_bounding_size.left   += sub_x;
				window_bounding_size.right  += sub_x;
				window_bounding_size.top    += sub_y;
				window_bounding_size.bottom += sub_y;

				var pos = {
					x:window_bounding_size.left,
					y:window_bounding_size.top
				};

				// サイズ補正
				if(client_size.width  < window_bounding_size.right  + 1) pos.x += client_size.width  - 1 - window_bounding_size.right;
				if(client_size.height < window_bounding_size.bottom + 1) pos.y += client_size.height - 1 - window_bounding_size.bottom;
				if(pos.x < 1) pos.x = 1;
				if(pos.y < 1) pos.y = 1;

				var style = _element.style;
				style.left = (pos.x) + "px";
				style.top  = (pos.y) + "px";
				break;
			}
		};

		// -
		// リセット通知(内部用)
		// -
		function dispatchReset(e){
			if(_this.onreset) _this.onreset();
		}

		// -
		// マウスダウン時に実行される関数(内部用)
		// -
		function mouseDown(e){
			var target = (e.target || e.srcElement);
			if(_control_dic[target.tagName]) return;

			// マウス入力を更新
			input_mouse.setMouseEvent(e);

			var rect = ElementGetBoundingClientRect(_element);
			_drag_ofs = {
				x:e.clientX - rect.left,
				y:e.clientY - rect.top
			};

			// タスク起動
			if(_task){
				_task.release();
				_task = null;
			}
			_task = task_container.createTask();
			_task.setDestructorFunc(function(){
				_task = null;
			});
			_task.setExecuteFunc(DockingFormTaskInit);
			_task.execute(0xffffffff);

			// 戻す
			if(MouseEventGetChangedButtons(e) & 0x04){
				update("original");
				dispatchReset();
			}

			if(e.preventDefault){
				e.preventDefault();
			}else{
				return false;
			}
		}

		// -
		// 境界マウスダウン時に実行される関数(内部用)
		// -
		function mouseDownBorder(e){

			// マウス入力を更新
			input_mouse.setMouseEvent(e);

			// タスク起動
			if(_task){
				_task.release();
				_task = null;
			}
			_task = task_container.createTask();
			_task.setDestructorFunc(function(){
				_task = null;
			});
			_task.setExecuteFunc(function(){
				var distance = 0;

				var mouse_pos = input_mouse.getPositionClient();
				var client_size = DocumentGetClientSize(document);
				switch(_docking_type){
				case "left":
					distance = mouse_pos.x;
					break;
				case "top":
					distance = mouse_pos.y;
					break;
				case "right":
					distance = client_size.width - mouse_pos.x;
					break;
				case "bottom":
					distance = client_size.height - mouse_pos.y;
					break;
				}

				moveBorder(distance);

				if(!(input_mouse.getButtonLeft())){
					_task.release();
					return;
				}
			});
			_task.execute(0xffffffff);

			if(e.preventDefault){
				e.preventDefault();
			}else{
				return false;
			}
		}

		// -
		// ダブルクリック(内部用)
		// -
		function mouseDoubleClick(e){
			var target = (e.target || e.srcElement);
			if(_control_dic[target.tagName]) return;

			// マウス入力を更新
			input_mouse.setMouseEvent(e);

			switch(_docking_type){
			case "original":
				var rect = ElementGetBoundingClientRect(_element);
				_drag_ofs = {
					x:e.clientX - rect.left,
					y:e.clientY - rect.top
				};
				update("popup");
				var mouse_pos = ObjectCopy(input_mouse.getPositionClient());
				var style = _element.style;
				var pos_x = mouse_pos.x - _drag_ofs.x;
				var pos_y = mouse_pos.y - _drag_ofs.y;
				style.left = (pos_x) + "px";
				style.top  = (pos_y) + "px";
				break;
			case "popup":
				update("original");
				dispatchReset();
				break;
			default:
				if(_expand){
					moveBorder(0);
				}else{
					moveBorder(_expand_distance);
				}
				break;
			}
		}

		// -
		// イベントを外す(内部用)
		// -
		function removeEvent(){
			if(_element.removeEventListener){
				_element.removeEventListener("mousedown",mouseDown);
				_element.removeEventListener("dblclick",mouseDoubleClick);
				_element_border.removeEventListener("mousedown",mouseDownBorder);
			}else if(_element.detachEvent){
				_element.detachEvent("onmousedown",mouseDown);
				_element.detachEvent("ondblclick",mouseDoubleClick);
				_element_border.detachEvent("onmousedown",mouseDownBorder);
			}
		}

		// -
		// タスク実行(内部用)
		// -
		function DockingFormTaskInit(task){
			var work = task.getUserWork();
			work.exec = DockingFormTaskDragWaitInit;
			_task.setExecuteFunc(DockingFormTaskExec);
			_task.execute(0xffffffff);

		}
		function DockingFormTaskExec(task){
			var work = task.getUserWork();

			if(work.exec) work.exec(task);

			if(!(input_mouse.getButtonLeft())){
				task.release();
				return;
			}
		}

		// -
		// ドラッグ待機(内部用)
		// -
		function DockingFormTaskDragWaitInit(task){
			var work = task.getUserWork();
			work.mouse_pos_start = input_mouse.getPositionClient();
			work.exec = DockingFormTaskDragWaitExec;
			work.exec(task);
		}
		function DockingFormTaskDragWaitExec(task){
			var work = task.getUserWork();
			var mouse_pos = input_mouse.getPositionClient();
			var x = mouse_pos.x - work.mouse_pos_start.x;
			var y = mouse_pos.y - work.mouse_pos_start.y;
			var l = Math.sqrt(x * x + y * y);
			if(l > 5){
				work.exec = DockingFormTaskDragMoveInit;
			}
		}

		// -
		// ドラッグ移動(内部用)
		// -
		function DockingFormTaskDragMoveInit(task){
			var work = task.getUserWork();

			work.exec = DockingFormTaskDragMoveExec;
			work.exec(task);
		}
		function DockingFormTaskDragMoveExec(task){
			var work = task.getUserWork();
			var mouse_pos = ObjectCopy(input_mouse.getPositionClient());

			var range = 10;
			var client_size = DocumentGetClientSize(document);

			if(mouse_pos.x < 0 + range){
				update("left");
			}else if(mouse_pos.y < 0 + range){
				update("top");
			}else if(mouse_pos.x > client_size.width  - range){
				update("right");
			}else if(mouse_pos.y > client_size.height - range){
				update("bottom");
			}else{
				update("popup");
			}

			if(_docking_type == "popup"){
				var style = _element.style;

				var pos_x = mouse_pos.x - _drag_ofs.x;
				var pos_y = mouse_pos.y - _drag_ofs.y;

				style.left = (pos_x) + "px";
				style.top  = (pos_y) + "px";
			}
		}

		// -
		// 更新(内部用)
		// -
		function update(type){
			if(_docking_type == type) return;

			var style_form = _element.style;
			var style_html = document.documentElement.style;
			var style_border = _element_border.style;

			// 戻す
			switch(_docking_type){
			case "left":
				style_html.marginLeft = "0px";
				break;
			case "top":
				style_html.marginTop = "0px";
				break;
			case "right":
				style_html.marginRight = "0px";
				break;
			case "bottom":
				style_html.paddingBottom = "0px";
				break;
			}
			_docking_type = type;
			_docking_distance = 0;

			DomNodeRemove(_element_border);

			style_form.cssText = _css_text_popup;
			style_form.position = "fixed";
			style_form.left = "0px";
			style_form.top  = "0px";
			style_form.right  = "auto";
			style_form.bottom = "auto";
			style_form.width  = "auto";
			style_form.height = "auto";

			var rect = ElementGetBoundingClientRect(_element);

			var range = 2;
			if(_drag_ofs.x < range) _drag_ofs.x = range;
			if(_drag_ofs.y < range) _drag_ofs.y = range;
			if(_drag_ofs.x > rect.right  - range) _drag_ofs.x = rect.right  - range;
			if(_drag_ofs.y > rect.bottom - range) _drag_ofs.y = rect.bottom - range;

			var client_size = DocumentGetClientSize(document);
			var href_w = client_size.width  * 0.5;
			var href_h = client_size.height * 0.5;
			var w = rect.right - rect.left;
			var h = rect.bottom - rect.top;
			if(w > href_w) w = href_w;
			if(h > href_h) h = href_h;

			switch(type){
			case "original":
				style_form.cssText = _css_text_original;
				break;
			default:
				style_form.cssText = _css_text_popup;
				style_form.position = "fixed";
				style_form.zIndex = 0x7FFFFFFF - 2;
				style_form.width  = "auto";
				style_form.height = "auto";
				switch(type){
				case "popup":
					break;
				default:
					style_form.overflow = "auto";
					style_border.cssText = "position:fixed;";
					style_border.zIndex = 0x7FFFFFFF - 2;
					document.body.appendChild(_element_border);
					break;
				}
				break;
			}
			style_form.cursor = "move";

			switch(type){
			case "left":
				style_form.left = "0px";
				style_border.left = "0px";
				break;
			case "right":
				style_form.right = "0px";
				style_border.right = "0px";
				break;
			case "top":
				style_form.top = "0px";
				style_border.top = "0px";
				break;
			case "bottom":
				style_form.bottom = "0px";
				style_border.bottom = "0px";
				break;
			}

			switch(_docking_type){
			case "left":
			case "right":
				style_form.top = "0px";
				style_form.bottom = "0px";
				style_border.cursor = "col-resize";
				style_border.top = "0px";
				style_border.bottom = "0px";
				style_border.width = "6px";
				moveBorder(w);
				break;
			case "top":
			case "bottom":
				style_form.left = "0px";
				style_form.right = "0px";
				style_border.cursor = "row-resize";
				style_border.left = "0px";
				style_border.right = "0px";
				style_border.height = "6px";
				moveBorder(h);
				break;
			}
		}

		// -
		// 境界移動(内部用)
		// -
		function moveBorder(distance){
			var style_form = _element.style;
			var style_html = document.documentElement.style;
			var style_border = _element_border.style;
			var size_obj = ComputedStyleGetSize(ElementGetComputedStyle(_element,""));

			switch(_docking_type){
			case "left":
			case "right":
				var w = distance - size_obj.paddingLeft - size_obj.paddingRight - size_obj.borderLeft - size_obj.borderRight;
				if(w < 0) w = 0;
				style_form.width = (w) + "px";
				break;
			case "top":
			case "bottom":
				var h = distance - size_obj.paddingTop - size_obj.paddingBottom - size_obj.borderTop - size_obj.borderBottom;
				if(h < 0) h = 0;
				style_form.height = (h) + "px";
				break;
			};

			_expand = true;
			var rect = ElementGetBoundingClientRect(_element);
			switch(_docking_type){
			case "left":
			case "right":
				var w = rect.right - rect.left;
				if(distance < w){
					_expand = false;
					distance = w;
				}
				break;
			case "top":
			case "bottom":
				var h = rect.bottom - rect.top;
				if(distance < h){
					_expand = false;
					distance = h;
				}
				break;
			};

			var v = distance - 3;
			switch(_docking_type){
			case "left":
				style_border.marginLeft = v + "px";
				break;
			case "top":
				style_border.marginTop = v + "px";
				break;
			case "right":
				style_border.marginRight = v + "px";
				break;
			case "bottom":
				style_border.marginBottom = v + "px";
				break;
			};

			var v = distance + 10;
			var s = distance - _docking_distance;
			var scroll_pos = WindowGetScrollPosition(window);
			switch(_docking_type){
			case "left":
				style_html.marginLeft = v + "px";
				break;
			case "top":
				style_html.marginTop = v + "px";
				break;
			case "right":
				style_html.marginRight = v + "px";
				WindowSetScrollPositionX(window,scroll_pos.x + s);
				break;
			case "bottom":
				style_html.paddingBottom = v + "px";
				WindowSetScrollPositionY(window,scroll_pos.y + s);
				break;
			};

			_docking_distance = distance;

			if(_expand){
				_expand_distance = distance;
			}
		}

		// -
		// プライベート変数
		// -
		var _element;
		var _element_border;
		var _css_text_popup;
		var _css_text_original;
		var _drag_ofs;
		var _docking_type;
		var _docking_distance;
		var _expand;
		var _expand_distance;
		var _control_dic;
		var _task;
		var _analyze_work;
		var _observer_remove;
		var _event_handler_abort;

		// -
		// 初期化
		// -
		(function(){
			if(element){
				_element = element;
				element = null;
			}else{
				_element = DocumentCreateElement("div");
			}
			_element_border = DocumentCreateElement("div");

			_css_text_original = _element.style.cssText;
			_drag_ofs = {x:0.0,y:0.0};
			_docking_type = "";
			_docking_distance = 0;
			_expand = false;
			_expand_distance = 0;
			_control_dic = {
				"INPUT":true,
				"BUTTON":true,
				"TEXTAREA":true,
				"SELECT":true,
				"FIELDSET":true,
				"KEYGEN":true,
				"OBJECT":true,
				"EMBED":true,
				"CANVAS":true
			};

			if(_element.addEventListener){
				_element.addEventListener("mousedown",mouseDown);
				_element.addEventListener("dblclick",mouseDoubleClick);
				_element_border.addEventListener("mousedown",mouseDownBorder);
			}else if(_element.attachEvent){
				_element.attachEvent("onmousedown",mouseDown);
				_element.attachEvent("ondblclick",mouseDoubleClick);
				_element_border.attachEvent("onmousedown",mouseDownBorder);
			}

			// 解析ワーク作成
			_analyze_work = AnalyzeWorkCreate(_element);
			// 解析済み
			AnalyzeWorkSetInvalid(_analyze_work);
			// 解析辞書登録オプション
			var attach_options = new AnalyzeWorkDictionaryAttachOptions();
			if(outsider) attach_options.SetOutsider();
			// 解析辞書登録
			analyze_work_dictionary.attachAnalyzeWork(_analyze_work,attach_options);

			// リムーブ監視
			_observer_remove = new DomNodeObserverRemoveFromDocument(_element);
			_observer_remove.setFunction(_this.release);

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

			update("original");
		})();
	}

	// -
	// 掲示板コントロールの不要物検索
	// -
	function BbsControlSearchTrash(element,func){
		var result = null;
		var nodes = ElementGetElementsByTagName(element,"*");
		var i;
		var num = nodes.length;
		for(i=num-1;i>=0;i--){
			// 解析ワーク取得
			if(analyze_work_dictionary.verifyRemoved(nodes[i])){
				result = func(nodes[i]);
				if(result){
					return result;
				}
			}
		}
		return result;
	}

	// -
	// レスアンカー番号管理
	// -
	function ResponseAnchorNumbers(){
		var _this = this;

		// -
		// 番号追加
		// -
		_this.addNumber = function(number){
			var p;
			var n;
			var list = _list.n;
			while(list != _list){
				if(list.num >= number)	break;
				list = list.n;
			}

			if((list != _list) && (list.num == number)){
			}else{
				var list_min = {num:number,d:0};
				n = list;
				p = n.p;
				list_min.p = p;
				list_min.n = n;
				p.n = list_min;
				n.p = list_min;
			}
		};

		// -
		// 範囲追加
		// -
		_this.addNumbers = function(min,max){
			if(min > max){
				var t = max;
				max = min;
				min = t;
			}
			var p;
			var n;
			var list = _list.n;
			while(list != _list){
				if(list.num >= min)	break;
				list = list.n;
			}

			// 最小値
			if((list != _list) && (list.num == min)){
				list.d += 1;
			}else{
				var list_min = {num:min,d:1};
				n = list;
				p = n.p;
				list_min.p = p;
				list_min.n = n;
				p.n = list_min;
				n.p = list_min;
				list = list_min;
			}

			while(list != _list){
				if(list.num >= max)	break;
				list = list.n;
			}

			// 最大値
			if((list != _list) && (list.num == max)){
				list.d -= 1;
			}else{
				var list_max = {num:max,d:-1};
				n = list;
				p = n.p;
				list_max.p = p;
				list_max.n = n;
				p.n = list_max;
				n.p = list_max;
			}
		};

		// -
		// すべての番号を取得
		// -
		_this.getNumbers = function(func){
			var d = 0;
			var min = 0;
			var max = 0;
			var list = _list.n;
			while(list != _list){

				d += list.d;

				if(d == 0){
					func(list.num);
				}else if(d > 0){
					min = list.num;

					list = list.n;
					while(list != _list){
						d += list.d;
						if(d == 0){
							max = list.num + 1;
							break;
						}
						list = list.n;
					}
					
					var i;
					for(i=min;i<max;i++){
						func(i);
					}
				}

				list = list.n;
			}
		};

		// -
		// すべての番号を配列形式で取得
		// -
		_this.getNumberList = function(){
			var a = new Array();
			var d = 0;
			var min = 0;
			var max = 0;
			var list = _list.n;
			while(list != _list){

				d += list.d;

				if(d == 0){
					a.push(list.num);
				}else if(d > 0){
					min = list.num;

					list = list.n;
					while(list != _list){
						d += list.d;
						if(d == 0){
							max = list.num + 1;
							break;
						}
						list = list.n;
					}
					
					var i;
					for(i=min;i<max;i++){
						a.push(i);
					}
				}

				list = list.n;
			}
			return a;
		};

		// -
		// 総数を取得
		// -
		_this.getCount = function(){
			var count = 0;
			var d = 0;
			var min = 0;
			var max = 0;
			var list = _list.n;
			while(list != _list){

				d += list.d;

				if(d == 0){
					count += 1;
				}else if(d > 0){
					min = list.num;

					list = list.n;
					while(list != _list){
						d += list.d;
						if(d == 0){
							max = list.num + 1;
							break;
						}
						list = list.n;
					}
					count += max - min;
				}

				list = list.n;
			}
			return count;
		};

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

		// -
		// 初期化
		// -
		(function(){
			_list = new Object();
			_list.p = _list;
			_list.n = _list;
		})();
	}

	// -
	// InternetExplorer を使用しているか
	// -
	function UserAgentGetInternetExplorer(){
		if(window.navigator.userAgent.indexOf("Sleipnir") != -1)	return false;
		return (window.navigator.userAgent.indexOf("MSIE") != -1);
	}

	// -
	// Firefox を使用しているか
	// -
	function UserAgentGetFirefox(){
		return (window.navigator.userAgent.indexOf("Firefox") != -1);
	}

	// -
	// GoogleChrome を使用しているか
	// -
	function UserAgentGetGoogleChrome(){
		return (window.navigator.userAgent.indexOf("Chrome") != -1);
	}

	// -
	// Opera を使用しているか
	// -
	function UserAgentGetOpera(){
		return (window.navigator.userAgent.indexOf("Opera") != -1);
	}

	// -
	// Safari を使用しているか
	// -
	function UserAgentGetSafari(){
		if(window.navigator.userAgent.indexOf("Chrome") != -1)	return false;
		return (window.navigator.userAgent.indexOf("Safari") != -1);
	}

	// -
	// Sleipnir を使用しているか
	// -
	function UserAgentGetSleipnir(){
		return (window.navigator.userAgent.indexOf("Sleipnir") != -1);
	}

	// -
	// ブラウザの言語を調べる
	// -
	function NavigatorGetBrowserLanguage() {
		try {
			return (window.navigator.browserLanguage || window.navigator.language || window.navigator.userLanguage).substr(0,2);
		}
		catch(e) {
			return undefined;
		}
	}

	// -
	// コンソールにログ出力
	// -
	function ConsoleLog(obj){
		try{
			console.log(obj);
		}catch(e){}
	}

	// -
	// コンソールにエラー出力
	// -
	function ConsoleError(obj){
		try{
			console.error(obj);
		}catch(e){}
	}

	// -
	// Promise 生成
	// -
	function PromiseCreate(executor){
		try{
			return (new Promise(executor));
		}catch(e){
		}

		var completed = false;
		var result;
		var callback_resolve;
		var callback_reject;
		var argument_value;
		var argument_reason;
		var promise = new Object();
		promise.then = function(resolve , reject){
			callback_resolve = resolve;
			callback_reject = reject;
			receive();
		};
		var receive = function(){
			if(!completed) return;
			if(result){
				if(!callback_resolve) return;
				callback_resolve(argument_value);
			}else{
				if(!callback_reject) return;
				callback_reject(argument_reason);
			}
		};
		executor(
			function onFulfilled(value){
				completed = true;
				result = true;
				argument_value = value;
				receive();
			},
			function onRejected(reason){
				completed = true;
				result = false;
				argument_reason = reason;
				receive();
			}
		);
		return promise;
	}

	// -
	// 文字列から DOMParser を作成
	// -
	function DOMParserCreateFromString(text){
		if (window.DOMParser){
			var parser = new DOMParser();
			return parser.parseFromString(text,"application/xml");
		}
		try{
			var xml_doc = new ActiveXObject("Microsoft.XMLDOM");
			xml_doc.async = false;
			xml_doc.loadXML(text);
			return xml_doc;
		}catch(e){}

		return null;
	}

	// -
	// MutationObserver が利用可能か
	// -
	function MutationObserverSupported(){
		try{
			if(window.MutationObserver || window.WebKitMutationObserver){
				return true;
			}
		}catch(e){
		}
		return false;
	}

	// -
	// MutationObserver を作成
	// -
	function MutationObserverCreate(func){
		try{
			var MutationObserver = window.MutationObserver || window.WebKitMutationObserver;
			var mutation_observer = new MutationObserver(func);
			return mutation_observer;
		}catch(e){
		}
		return null;
	}

	// -
	// JSON が利用可能か
	// -
	function JSONSupported(){
		try{
			if(JSON)	return true;
		}catch(e){
		}
		return false;
	}

	// -
	// Object から JSON 文字列に変換
	// -
	function JsonStringify(obj){
		if(JSONSupported()){
			return JSON.stringify(obj);
		}
		return "";
	}

	// -
	// JSON 文字列 から Object に変換
	// -
	function JsonParse(str){
		if(JSONSupported()){
			return JSON.parse(str);
		}
		return eval("(" + str + ")");
	}

	// -
	// ArrayBuffer から Base64 文字列に変換する関数 (非同期実行)
	// -
	function Base64_From_ArrayBuffer_Async(ary_buffer,callback,options){
		var dic = [
			'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P',
			'Q','R','S','T','U','V','W','X','Y','Z','a','b','c','d','e','f',
			'g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v',
			'w','x','y','z','0','1','2','3','4','5','6','7','8','9','+','/'
		];
		var base64 = [];
		var ary_u8 = new Uint8Array( ary_buffer );
		var num = ary_u8.length;
		var n = 0;
		var b = 0;

		if(typeof(options) != "object") options = {};
		var increment = options.increment || 1024;
		var onprogress = options.onprogress || null;

		var i = 0;
		var j = 0;
		function f(){
			while(i < num){
				b = ary_u8[i];
				base64.push(dic[(b >> 2)]);
				n = (b & 0x03) << 4;
				i ++;
				if(i >= num) break;

				b = ary_u8[i];
				base64.push(dic[n | (b >> 4)]);
				n = (b & 0x0f) << 2;
				i ++;
				if(i >= num) break;

				b = ary_u8[i];
				base64.push(dic[n | (b >> 6)]);
				base64.push(dic[(b & 0x3f)]);
				i ++;

				j += 3;
				if(j > increment){
					j = 0;
					if(onprogress){
						onprogress({loaded:i,total:num});
					}
					execute_queue.attachFirst(f,null);
					return;
				}
			}

			var m = num % 3;
			if(m){
				base64.push(dic[n]);
			}
			if(m == 1){
				base64.push("==");
			}else if(m == 2){
				base64.push("=");
			}
			callback(base64.join(""));
		}

		execute_queue.attachFirst(f,null);
	}

	// -
	// x-user-defined 文字列から Base64 文字列に変換する (非同期実行)
	// -
	function Base64_From_XUserDefined_Async(x_user_defined,callback,options){
		var dic = [
			'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P',
			'Q','R','S','T','U','V','W','X','Y','Z','a','b','c','d','e','f',
			'g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v',
			'w','x','y','z','0','1','2','3','4','5','6','7','8','9','+','/'
		];
		var base64 = [];
		var num = x_user_defined.length;
		var n = 0;
		var b = 0;

		if(typeof(options) != "object") options = {};
		var increment = options.increment || 1024;
		var onprogress = options.onprogress || null;

		var i = 0;
		var j = 0;
		function f(){
			while(i < num){
				b = x_user_defined.charCodeAt(i) & 0xff;
				base64.push(dic[(b >> 2)]);
				n = (b & 0x03) << 4;
				i ++;
				if(i >= num) break;

				b = x_user_defined.charCodeAt(i) & 0xff;
				base64.push(dic[n | (b >> 4)]);
				n = (b & 0x0f) << 2;
				i ++;
				if(i >= num) break;

				b = x_user_defined.charCodeAt(i) & 0xff;
				base64.push(dic[n | (b >> 6)]);
				base64.push(dic[(b & 0x3f)]);
				i ++;

				j += 3;
				if(j > increment){
					j = 0;
					if(onprogress){
						onprogress({loaded:i,total:num});
					}
					execute_queue.attachFirst(f,null);
					return;
				}
			}

			var m = num % 3;
			if(m){
				base64.push(dic[n]);
			}
			if(m == 1){
				base64.push("==");
			}else if(m == 2){
				base64.push("=");
			}
			callback(base64.join(""));
		}

		execute_queue.attachFirst(f,null);
	}

	// -
	// Base64 文字列から ArrayBuffer に変換する関数 (同期実行)
	// -
	function Base64_To_ArrayBuffer(base64){
		var dic = new Object();
		dic[0x41]= 0; dic[0x42]= 1; dic[0x43]= 2; dic[0x44]= 3; dic[0x45]= 4; dic[0x46]= 5; dic[0x47]= 6; dic[0x48]= 7; dic[0x49]= 8; dic[0x4a]= 9; dic[0x4b]=10; dic[0x4c]=11; dic[0x4d]=12; dic[0x4e]=13; dic[0x4f]=14; dic[0x50]=15;
		dic[0x51]=16; dic[0x52]=17; dic[0x53]=18; dic[0x54]=19; dic[0x55]=20; dic[0x56]=21; dic[0x57]=22; dic[0x58]=23; dic[0x59]=24; dic[0x5a]=25; dic[0x61]=26; dic[0x62]=27; dic[0x63]=28; dic[0x64]=29; dic[0x65]=30; dic[0x66]=31;
		dic[0x67]=32; dic[0x68]=33; dic[0x69]=34; dic[0x6a]=35; dic[0x6b]=36; dic[0x6c]=37; dic[0x6d]=38; dic[0x6e]=39; dic[0x6f]=40; dic[0x70]=41; dic[0x71]=42; dic[0x72]=43; dic[0x73]=44; dic[0x74]=45; dic[0x75]=46; dic[0x76]=47;
		dic[0x77]=48; dic[0x78]=49; dic[0x79]=50; dic[0x7a]=51; dic[0x30]=52; dic[0x31]=53; dic[0x32]=54; dic[0x33]=55; dic[0x34]=56; dic[0x35]=57; dic[0x36]=58; dic[0x37]=59; dic[0x38]=60; dic[0x39]=61; dic[0x2b]=62; dic[0x2f]=63;
		var num = base64.length;
		var n = 0;
		var b = 0;
		var e;

		e = Math.ceil(num / 4) * 3;
		switch(num % 4){
		case 0:
			if(base64.charAt(num - 1) == '=') e -= 1;
			if(base64.charAt(num - 2) == '=') e -= 1;
			break;
		case 2:
			e -= 2;
			break;
		case 3:
			e -= 1;
			break;
		case 1:
			return null;
		}

		var ary_buffer = new ArrayBuffer( e );
		var ary_u8 = new Uint8Array( ary_buffer );
		var i = 0;
		var p = 0;
		while(p < e){
			b = dic[base64.charCodeAt(i)];
			if(b === undefined) return null;
			n = (b << 2);
			i ++;

			b = dic[base64.charCodeAt(i)];
			if(b === undefined) return null;
			ary_u8[p] = n | ((b >> 4) & 0x3);
			n = (b & 0x0f) << 4;
			i ++;
			p ++;
			if(p >= e) break;

			b = dic[base64.charCodeAt(i)];
			if(b === undefined) return null;
			ary_u8[p] = n | ((b >> 2) & 0xf);
			n = (b & 0x03) << 6;
			i ++;
			p ++;
			if(p >= e) break;

			b = dic[base64.charCodeAt(i)];
			if(b === undefined) return null;
			ary_u8[p] = n | b;
			i ++;
			p ++;
		}
		return ary_buffer;
	}

	// -
	// Base64 文字列から ArrayBuffer に変換する関数 (非同期実行)
	// -
	function Base64_To_ArrayBuffer_Async(base64,callback,options){
		var dic = new Object();
		dic[0x41]= 0; dic[0x42]= 1; dic[0x43]= 2; dic[0x44]= 3; dic[0x45]= 4; dic[0x46]= 5; dic[0x47]= 6; dic[0x48]= 7; dic[0x49]= 8; dic[0x4a]= 9; dic[0x4b]=10; dic[0x4c]=11; dic[0x4d]=12; dic[0x4e]=13; dic[0x4f]=14; dic[0x50]=15;
		dic[0x51]=16; dic[0x52]=17; dic[0x53]=18; dic[0x54]=19; dic[0x55]=20; dic[0x56]=21; dic[0x57]=22; dic[0x58]=23; dic[0x59]=24; dic[0x5a]=25; dic[0x61]=26; dic[0x62]=27; dic[0x63]=28; dic[0x64]=29; dic[0x65]=30; dic[0x66]=31;
		dic[0x67]=32; dic[0x68]=33; dic[0x69]=34; dic[0x6a]=35; dic[0x6b]=36; dic[0x6c]=37; dic[0x6d]=38; dic[0x6e]=39; dic[0x6f]=40; dic[0x70]=41; dic[0x71]=42; dic[0x72]=43; dic[0x73]=44; dic[0x74]=45; dic[0x75]=46; dic[0x76]=47;
		dic[0x77]=48; dic[0x78]=49; dic[0x79]=50; dic[0x7a]=51; dic[0x30]=52; dic[0x31]=53; dic[0x32]=54; dic[0x33]=55; dic[0x34]=56; dic[0x35]=57; dic[0x36]=58; dic[0x37]=59; dic[0x38]=60; dic[0x39]=61; dic[0x2b]=62; dic[0x2f]=63;
		var num = base64.length;
		var n = 0;
		var b = 0;
		var e;

		if(typeof(options) != "object") options = {};
		var increment = options.increment || 1024;
		var onprogress = options.onprogress || null;

		e = Math.ceil(num / 4) * 3;
		switch(num % 4){
		case 0:
			if(base64.charAt(num - 1) == '=') e -= 1;
			if(base64.charAt(num - 2) == '=') e -= 1;
			break;
		case 2:
			e -= 2;
			break;
		case 3:
			e -= 1;
			break;
		case 1:
			callback(null);
			return;
		}

		var ary_buffer = new ArrayBuffer( e );
		var ary_u8 = new Uint8Array( ary_buffer );
		var i = 0;
		var j = 0;
		var p = 0;
		function f(){
			while(p < e){
				b = dic[base64.charCodeAt(i)];
				if(b === undefined){ callback(null); return; }
				n = (b << 2);
				i ++;

				b = dic[base64.charCodeAt(i)];
				if(b === undefined){ callback(null); return; }
				ary_u8[p] = n | ((b >> 4) & 0x3);
				n = (b & 0x0f) << 4;
				i ++;
				p ++;
				if(p >= e) break;

				b = dic[base64.charCodeAt(i)];
				if(b === undefined){ callback(null); return; }
				ary_u8[p] = n | ((b >> 2) & 0xf);
				n = (b & 0x03) << 6;
				i ++;
				p ++;
				if(p >= e) break;

				b = dic[base64.charCodeAt(i)];
				if(b === undefined){ callback(null); return; }
				ary_u8[p] = n | b;
				i ++;
				p ++;

				j += 4;
				if(j > increment){
					j = 0;
					execute_queue.attachFirst(f,null);
					return;
				}
			}
			callback(ary_buffer);
		}

		execute_queue.attachFirst(f,null);
	}

	// -
	// Blob URL を生成
	// -
	function BlobURLCreate (src){
		var winow_url = window.URL || window.webkitURL;
		if(winow_url){
			return winow_url.createObjectURL(src);
		}
		return null;
	}

	// -
	// Blob URL を破棄
	// -
	function BlobURLRevoke (blob_url){
		var winow_url = window.URL || window.webkitURL;
		if(winow_url){
			return winow_url.revokeObjectURL(blob_url);
		}
	}

	// -
	// CRC32
	// -
	function CRC32 (){

		// -
		// 初期化
		// -
		this.initialize = function (){
			_crc32 = 0xffffffff;
			_pos = 0;
		};

		// -
		// 位置をセット
		// -
		this.setPosition = function (v){
			_pos = v;
		};

		// -
		// ArrayBuffer から CRC32 を取得
		// -
		this.getFromArrayBuffer = function (buffer,size){
			var ary_u8 = new Uint8Array(buffer,_pos,size);
			var i;
			for (i=0;i<size;i++) {
				_crc32 = _table[(_crc32 ^ ary_u8[i]) & 0xff] ^ (_crc32 >>> 8);
			}
			_pos += size;
			return (_crc32 ^ 0xffffffff) >>> 0;
		};

		// -
		// バイナリ文字列から CRC32 を取得
		// -
		this.getFromStringOfBinaryData = function (buffer,size){
			size += _pos;
			while(_pos<size){
				_crc32 = _table[(_crc32 ^ (buffer.charCodeAt(_pos) & 0xff)) & 0xff] ^ (_crc32 >>> 8);
				_pos ++;
			}
			return (_crc32 ^ 0xffffffff) >>> 0;
		};

		// -
		// 文字列から CRC32 を取得
		// -
		this.getFromString = function (buffer,size){
			size += _pos;
			while(_pos<size){
				var code = buffer.charCodeAt(_pos);
				_crc32 = _table[(_crc32 ^ ((code >>> 8) & 0xff)) & 0xff] ^ (_crc32 >>> 8);
				_crc32 = _table[(_crc32 ^ ((code >>> 0) & 0xff)) & 0xff] ^ (_crc32 >>> 8);
				_pos ++;
			}
			return (_crc32 ^ 0xffffffff) >>> 0;
		};

		// -
		// プライベート変数
		// -
		var _crc32;
		var _pos;
		var _table = [
			0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3,
			0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91,
			0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de, 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7,
			0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9, 0xfa0f3d63, 0x8d080df5,
			0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172, 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b,
			0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59,
			0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423, 0xcfba9599, 0xb8bda50f,
			0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d,
			0x76dc4190, 0x01db7106, 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433,
			0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01,
			0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, 0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457,
			0x65b0d9c6, 0x12b7e950, 0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65,
			0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, 0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb,
			0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0, 0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9,
			0x5005713c, 0x270241aa, 0xbe0b1010, 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f,
			0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad,
			0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a, 0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683,
			0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8, 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1,
			0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb, 0x196c3671, 0x6e6b06e7,
			0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc, 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5,
			0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b,
			0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55, 0x316e8eef, 0x4669be79,
			0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f,
			0xc5ba3bbe, 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d,
			0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713,
			0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, 0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21,
			0x86d3d2d4, 0xf1d4e242, 0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777,
			0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, 0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45,
			0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2, 0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db,
			0xaed16a4a, 0xd9d65adc, 0x40df0b66, 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9,
			0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, 0xcdd70693, 0x54de5729, 0x23d967bf,
			0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94, 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d
		];

		// -
		// 初期化
		// -
		this.initialize();

	}

	// -
	// MIMEタイプから拡張子を取得
	// -
	var MIMEType_To_Ext = (function(){
		var dic = {
			"image":{
				"png":"png",
				"bmp":"bmp",
				"gif":"gif",
				"jpg":"jpg",
				"jpeg":"jpeg",
				"svg+xml":"svg",
				"tiff":"tiff",
				"webp":"webp",
				"vnd.microsoft.icon":"ico"
			},
			"audio":{
				"aac":"aac",
				"midi":"mid",
				"x-midi":"mid",
				"mpeg":"mp3",
				"ogg":"oga",
				"wav":"wav",
				"webm":"weba",
			},
			"video":{
				"x-msvideo":"avi",
				"mpeg":"mpeg",
				"ogg":"ogv",
				"mp2t":"ts",
				"webm":"webm",
				"mp4":"mp4"
			},
			"text":{
				"css":"css",
				"csv":"csv",
				"html":"html",
				"javascript":"js",
				"plain":"txt"
			},
			"application":{
				"octet-stream":"bin",
				"x-bzip":"bz",
				"x-bzip2":"bz2",
				"gzip":"gz",
				"json":"json",
				"x-httpd-php":"php",
				"vnd.rar":"rar",
				"rtf":"rtf",
				"x-tar":"tar",
				"xml":"xml",
				"zip":"zip",
				"x-7z-compressed":"7z",
			}
		};

		return function (type){
			var upper = "";
			var lower = "";
			var m = (type||"").match(/(.*)[/](.*)/);
			if(!m) return "";
			upper = m[1].toLowerCase();
			lower = m[2].toLowerCase();

			var o = dic[upper];
			if(!o) return "";

			return o[lower] || "";
		};
	})();

	// -
	// 拡張子からMIMEタイプを取得
	// -
	var MIMEType_From_Ext = (function(){
		var dic = {
			"png":"image/png",
			"bmp":"image/bmp",
			"gif":"image/gif",
			"jpg":"image/jpg",
			"jpeg":"image/jpeg",
			"svg":"image/svg+xml",
			"tiff":"image/tiff",
			"webp":"image/webp",
			"ico":"image/vnd.microsoft.icon",

			"aac":"audio/aac",
			"mid":"audio/midi",
			"mp3":"audio/mpeg",
			"oga":"audio/ogg",
			"wav":"audio/wav",
			"weba":"audio/webm",
			"avi":"video/x-msvideo",
			"mpeg":"video/mpeg",
			"ogv":"video/ogg",
			"ts":"video/mp2t",
			"webm":"video/webm",
			"mp4":"video/mp4",

			"css":"text/css",
			"csv":"text/csv",
			"html":"text/html",
			"js":"text/javascript",
			"txt":"text/plain",

			"bin":"application/octet-stream",
			"bz":"application/x-bzip",
			"bz2":"application/x-bzip2",
			"gz":"application/gzip",
			"json":"application/json",
			"php":"application/x-httpd-php",
			"rar":"application/vnd.rar",
			"rtf":"application/rtf",
			"tar":"application/x-tar",
			"xml":"application/xml",
			"zip":"application/zip",
			"7z":"application/x-7z-compressed"
		};

		return function (ext){
			return dic[(ext||"").toLowerCase()] || "";
		};
	})();

	// -
	// シグネチャーから拡張子を取得
	// -
	function FileSignature_To_Ext_From_ArrayBuffer(ary_buffer){
		var data_view = new DataView(ary_buffer);
		var size = ary_buffer.byteLength;

		if(size < 2) return "";
		switch(data_view.getUint16(0,false)){
		case 0x424D:
			return "bmp";
		case 0xFFD8:
			return "jpg";
		}

		if(size < 4) return "";
		switch(data_view.getUint32(0,false) >>> 8){
		case 0x474946:
			return "gif";
		}
		switch(data_view.getUint32(0,false)){
		case 0x52494646:
			return "webp";
		}

		if(size < 8) return "";
		if((data_view.getUint32(0,false) == 0x89504E47) && (data_view.getUint32(4,false) == 0x0D0A1A0A)){
			return "png";
		}

		return "";
	}

	// -
	// 文字列から ArrayBuffer に変換(UTF-8)
	// -
	function String_To_ArrayBuffer_As_UTF8(str){
		var i;
		var p;
		var num;
		var list = new Array();
		var size = 0;

		p = 0;
		num = str.length;
		while(p < num){
			var c0 = str.charCodeAt(p);
			p += 1;
			if((c0 & 0xFC00) == 0xD800){
				var c1 = str.charCodeAt(p) || 0;
				if((c1 & 0xFC00) == 0xDC00){
					c0 = (((c0 - 0xD800) << 10) | ((c1 - 0xDC00) & 0x3FF)) + 0x10000;
					p += 1;
				}
			}
			if(c0 < 0x80){
				size += 1;
			}else if(c0 < 0x800){
				size += 2;
			}else if(c0 < 0x10000){
				size += 3;
			}else if(c0 < 0x200000){
				size += 4;
			}else if(c0 < 0x4000000){
				size += 5;
			}else{
				size += 6;
			}
			list.push(c0);
		}

		var a = new Uint8Array(size);
		p = 0;
		var i;
		var num = list.length;
		for(i=0;i<num;i++){
			var c = list[i];
			if(c < 0x80){
				a[p] = (c & 0x7f) >>> 0;
				p += 1;
			}else if(c < 0x800){
				a[p] = ((c & 0x000007c0) >>>  6) | 0xc0;
				p += 1;
				a[p] = ((c & 0x0000003f) >>>  0) | 0x80;
				p += 1;
			}else if(c < 0x10000){
				a[p] = ((c & 0x0000f000) >>> 12) | 0xe0;
				p += 1;
				a[p] = ((c & 0x00000fc0) >>>  6) | 0x80;
				p += 1;
				a[p] = ((c & 0x0000003f) >>>  0) | 0x80;
				p += 1;
			}else if(c < 0x200000){
				a[p] = ((c & 0x001c0000) >>> 18) | 0xf0;
				p += 1;
				a[p] = ((c & 0x0003f000) >>> 12) | 0x80;
				p += 1;
				a[p] = ((c & 0x00000fc0) >>>  6) | 0x80;
				p += 1;
				a[p] = ((c & 0x0000003f) >>>  0) | 0x80;
				p += 1;
			}else if(c < 0x4000000){
				a[p] = ((c & 0x03000000) >>> 24) | 0xf8;
				p += 1;
				a[p] = ((c & 0x00fc0000) >>> 18) | 0x80;
				p += 1;
				a[p] = ((c & 0x0003f000) >>> 12) | 0x80;
				p += 1;
				a[p] = ((c & 0x00000fc0) >>>  6) | 0x80;
				p += 1;
				a[p] = ((c & 0x0000003f) >>>  0) | 0x80;
				p += 1;
			}else{
				a[p] = ((c & 0x40000000) >>> 30) | 0xfc;
				p += 1;
				a[p] = ((c & 0x3f000000) >>> 24) | 0x80;
				p += 1;
				a[p] = ((c & 0x00fc0000) >>> 18) | 0x80;
				p += 1;
				a[p] = ((c & 0x0003f000) >>> 12) | 0x80;
				p += 1;
				a[p] = ((c & 0x00000fc0) >>>  6) | 0x80;
				p += 1;
				a[p] = ((c & 0x0000003f) >>>  0) | 0x80;
				p += 1;
			}
		}

		return a.buffer;
	}

	// -
	// ArrayBuffer から文字列に変換(UTF-8)
	// -
	function String_From_ArrayBuffer_As_UTF8(ary){
		var str = new Array();
		var a = new Uint8Array(ary);
		var size = a.byteLength;
		var p = 0;
		var c;
		while(p < size){
			if((a[p+0] & 0xC0) == 0x80){
				p += 1;
			}else if((a[p+0] & 0x80) == 0x00){
				c = (a[p+0] & 0x7f);
				str.push(String.fromCharCode(c));
				p += 1;
			}else if((a[p+0] & 0xe0) == 0xc0){
				c = (                          ((a[p+0] & 0x1c) >> 2)  <<  8) |
                    ((((a[p+0] & 0x03) << 6) | ((a[p+1] & 0x3f) << 0)) <<  0);
				str.push(String.fromCharCode(c));
				p += 2;
			}else if((a[p+0] & 0xF0) == 0xe0){
				c = ((((a[p+0] & 0x0f) << 4) | ((a[p+1] & 0x3c) >> 2)) <<  8) |
				    ((((a[p+1] & 0x03) << 6) | ((a[p+2] & 0x3f) << 0)) <<  0);
				str.push(String.fromCharCode(c));
				p += 3;
			}else if((a[p+0] & 0xf8) == 0xf0){
				c = ((((a[p+0] & 0x07) << 2) | ((a[p+1] & 0x30) >> 4)) << 16) |
				    ((((a[p+1] & 0x0f) << 4) | ((a[p+2] & 0x3c) >> 2)) <<  8) |
					((((a[p+2] & 0x03) << 6) | ((a[p+3] & 0x3f) << 0)) <<  0);
				str.push(String.fromCharCode( ((c - 0x10000) >>> 10) + 0xD800 , ((c - 0x10000) & 0x3FF) + 0xDC00 ));
				p += 4;
			}else if((a[p+0] & 0xfc) == 0xf8){
				c = (                          ((a[p+0] & 0x03) << 0)  << 24) |
				    ((((a[p+1] & 0x3f) << 2) | ((a[p+2] & 0x30) >> 4)) << 16) |
				    ((((a[p+2] & 0x0f) << 4) | ((a[p+3] & 0x3c) >> 2)) <<  8) |
				    ((((a[p+3] & 0x03) << 6) | ((a[p+4] & 0x3f) << 0)) <<  0);
				str.push(String.fromCodePoint(c));
				p += 5;
			}else if((a[p+0] & 0xfe) == 0xfc){
				c = ((((a[p+0] & 0x01) << 6) | ((a[p+1] & 0x3f) << 0)) << 24) |
				    ((((a[p+2] & 0x3f) << 2) | ((a[p+3] & 0x30) >> 4)) << 16) |
				    ((((a[p+3] & 0x0f) << 4) | ((a[p+4] & 0x3c) >> 2)) <<  8) |
				    ((((a[p+4] & 0x03) << 6) | ((a[p+5] & 0x3f) << 0)) <<  0);
				str.push(String.fromCodePoint(c));
				p += 6;
			}else{
				break;
			}
		}
		return str.join("");
	}

	// -
	// ResponseHeaders パーサー
	// -
	function ResponseHeadersParser(str){
		var _this = this;

		// -
		// ローカル変数
		// -
		var dic = new Object();

		// -
		// 初期化
		// -
		(function(){
			var s = str.replace(/\r\n?/g,"\n");
			var a = s.split("\n");
			var index = 0;
			var i;
			var num = a.length;
			for(i=0;i<num;i++){
				var m = a[i].match(new RegExp("^(.*):[ ](.*)$","i"));
				if(!m) continue;
				_this[index] = m[1];
				_this[m[1]] = m[2];
				dic[m[1].toLowerCase()] = m[2];
				index += 1;
			}
			_this.length = index;
		})();

		// -
		// レスポンスヘッダを取得
		// -
		_this.getResponseHeader = function(label){
			return (dic[label.toLowerCase()] || "");
		}
	}

	// -
	// GM_download が利用可能か
	// -
	function GM_downloadSupported(){
		try{
			if(GM_download)	return true;
		}catch(e){
		}
		return false;
	}

	// -
	// GM_openInTab ラッパー
	// -
	function GMW_openInTab( url, open_in_background ){
		try{
			if(GM.openInTab){
				GM.openInTab(url, open_in_background);
				return;
			}
		}catch(e){
		}
		try{
			if(GM_openInTab){
				GM_openInTab(url, open_in_background);
				return;
			}
		}catch(e){
		}
	}
	GMW_openInTab.isSupported = function(){
		try{
			if(GM.openInTab) return true;
		}catch(e){
		}
		try{
			if(GM_openInTab) return true;
		}catch(e){
		}
		return false;
	};

	// -
	// GM_xmlhttpRequest ラッパー
	// -
	function GMW_XMLHttpRequest(){
			var _this = this;

			// -
			// リクエストヘッダを設定
			// -
			_this.setRequestHeader = function(name,value){
				_param.headers[name] = value;
			};

			// -
			// オーバーライドコンテンツタイプを設定
			// -
			_this.overrideMimeType = function(type){
				_param.overrideMimeType = type;
			};

			// -
			// レスポンスヘッダを取得
			// -
			_this.getResponseHeader = function(label){
				if(!(_response_header)) return "";
				return _response_header.getResponseHeader(label);
			};

			// -
			// すべてのレスポンスヘッダを取得
			// -
			_this.getAllResponseHeaders = function(){
				return _this.responseHeaders;
			};

			// -
			// 開く
			// -
			_this.open = function(method,url){
				_param.method = method;
				_param.url = url;
			};

			// -
			// 送信開始
			// -
			_this.send = function(data){
				_param.data = data;
				_param.onprogress = function(r){
					if(_this.onprogress) _this.onprogress(r);
				};
				_param.onreadystatechange = function(r){
					readystatechange(r);
				};
				_param.onerror = function(r){
					// Tampermonkey 用
					readystatechange(r);
				};

				if(_this.timeout){
					_param.timeout = _this.timeout;
				}
				if(_this.responseType){
					_param.responseType = _this.responseType;
				}

				try{
					GM.xmlHttpRequest(_param);
					return;
				}catch(e){
				}
				try{
					GM_xmlhttpRequest(_param);
					return;
				}catch(e){
				}
				readystatechange({readyState:4,status:0});
			};

			// -
			// 状態変更イベント
			// -
			_this.onreadystatechange = function(){};

			// -
			// 状態変更イベント呼び出し
			// -
			function readystatechange(r){
				_this.readyState = r.readyState;
				_this.status = r.status || 0;
				if(r.responseHeaders){
					if(!_response_header){
						_this.responseHeaders = r.responseHeaders;
						_response_header = new ResponseHeadersParser(r.responseHeaders);
					}
				}
				if(r.readyState == 4){
					try{
						_this.responseText = r.responseText;
					}catch(e){}
					try{
						_this.response = r.response;
					}catch(e){}
					_this.responseURL = r.finalUrl;
				}
				if(_this.onreadystatechange){
					_this.onreadystatechange(_this);
				}
				if(_this.readyState == 4){
					_this.onreadystatechange = null;
				}
			}

			// -
			// 進捗イベント
			// -
			_this.onprogress = function(response){};

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

			// -
			// 初期化
			// -
			_param = new Object();
			_param.headers = new Object();
			_this.readyState = 0;
			_this.status = 0;
			_this.responseHeaders = null;
			_this.responseText = "";
			_this.responseType = "";
	}
	GMW_XMLHttpRequest.isSupported = function(){
		try{
			if(GM.xmlHttpRequest) return true;
		}catch(e){
		}
		try{
			if(GM_xmlhttpRequest) return true;
		}catch(e){
		}
		return false;
	};

	// -
	// ローカルストレージのラッパー
	// -
	function GMW_LocalStorage(){
		var _this = this;

		// -
		// 追加
		// -
		_this.setItem = function(key, value){
			var promise;
			try{
				if(GM.setValue){
					promise = GM.setValue(key, value);
					return promise;
				}
			}catch(e){
			}
			try{
				if(GM_setValue){
					promise = PromiseCreate(function(resolve , reject){
						GM_setValue(key, value);
						resolve();
					});
					return promise;
				}
			}catch(e){
			}
			promise = PromiseCreate(function(resolve , reject){
				reject();
			})
			return promise;
		};

		// -
		// 取得
		// -
		_this.getItem = function(key){
			var promise;
			try{
				if(GM.getValue){
					promise = GM.getValue(key);
					return promise;
				}
			}catch(e){
			}
			try{
				if(GM_getValue){
					promise = PromiseCreate(function(resolve , reject){
						var value = GM_getValue(key);
						resolve(value);
					});
					return promise;
				}
			}catch(e){
			}
			promise = PromiseCreate(function(resolve , reject){
				reject();
			})
			return promise;
		};

		// -
		// 削除
		// -
		_this.removeItem = function(key){
			var promise;
			try{
				if(GM.deleteValue){
					promise = GM.deleteValue(key);
					return promise;
				}
			}catch(e){
			}
			try{
				if(GM_deleteValue){
					promise = PromiseCreate(function(resolve , reject){
						var value = GM_deleteValue(key);
						resolve(value);
					});
					return promise;
				}
			}catch(e){
			}
			promise = PromiseCreate(function(resolve , reject){
				reject();
			})
			return promise;
		};
	}
	GMW_LocalStorage.isSupported = function(){
		try{
			if(GM.getValue) return true;
		}catch(e){
		}
		try{
			if(GM_getValue) return true;
		}catch(e){
		}
		return false;
	};

	// -
	// MenuCommand ラッパー
	// -
	function GMW_MenuCommand(){
		var _this = this;

		// -
		// 開放
		// -
		_this.release = function(){
			var i;
			var num = _item_list.length;
			for(i=num-1;i>=0;i--){
				var item = _item_list[i];
				delete _item_list[i];
				try{
					//GM_unregisterMenuCommand(item.id);
				}catch(e){
				}
			}
		};

		// -
		// 追加
		// -
		_this.addItem = function(caption, commandFunc, accessKey){
			var key_code = 0;
			if(accessKey){
				key_code =  accessKey.toLocaleUpperCase().charCodeAt(0) || 0;
			}
			var item = {
				caption:caption,
				callback:commandFunc,
				key_code:key_code
			};
			_item_list.push(item);
			try{
				item.id = GM.registerMenuCommand(caption, commandFunc, accessKey);
				return;
			}catch(e){
			}
			try{
				item.id = GM_registerMenuCommand(caption, commandFunc, accessKey);
				return;
			}catch(e){
			}
			
		};

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

		// -
		// 初期化
		// -
		(function(){
			_item_list = new Array();
		})();
	}
	GMW_MenuCommand.isSupported = function(){
		try{
			if(GM.registerMenuCommand)	return true;
		}catch(e){
		}
		try{
			if(GM_registerMenuCommand)	return true;
		}catch(e){
		}
		return false;
	};

	// -
	// ローカルストレージからロード
	// -
	function LocalStorageGetItem(key,func){

		function LocalStorageLoad(){
			var result = new Object();
			try{
				if(window.localStorage){
					result.value = localStorage.getItem(key);
					result.result = true;
				}else{
					result.result = false;
					result.message = "Do not support storage.";
				}
			}catch(e){
				result.result = false;
				result.message = e;
			}
			func(result);
		}

		if(GMW_LocalStorage.isSupported()){
			var storage = new GMW_LocalStorage();
			var promise = storage.getItem(key);
			promise.then(
				function(value){
					func({result:true,value:value});
				},
				function(reason){
					func({result:false,message:reason});
				}
			);
		}else{
			func({result:false,message:"Do not support storage."});
		}
	}

	// -
	// ローカルストレージからセーブ
	// -
	function LocalStorageSetItem(key,str,func){

		function LocalStorageSave(){
			var result = new Object();
			try{
				if(window.localStorage){
					localStorage.setItem(key,str);
					result.result = true;
				}else{
					result.result = false;
					result.message = "Do not support storage.";
				}
			}catch(e){
				result.result = false;
				result.message = e;
			}
			func(result);
		}

		var result = new Object();
		if(GMW_LocalStorage.isSupported()){
			var storage = new GMW_LocalStorage();
			var promise = storage.setItem(key,str);
			promise.then(
				function(value){
					func({result:true,value:value});
				},
				function(reason){
					func({result:false,message:reason});
				}
			);
		}else{
			result.result = false;
			result.message = "Do not support storage.";
		}
		func(result);
	}

	// -
	// ローカルストレージから削除
	// -
	function LocalStorageRemoveItem(key,func){

		function LocalStorageDelete(){
			var result = new Object();
			try{
				if(window.localStorage){
					localStorage.removeItem(key);
					result.result = true;
				}else{
					result.result = false;
					result.message = "Do not support storage.";
				}
			}catch(e){
				result.result = false;
				result.message = e;
			}
			func(result);
		}

		var result = new Object();
		if(GMW_LocalStorage.isSupported()){
			var storage = new GMW_LocalStorage();
			var promise = storage.removeItem(key);
			promise.then(
				function(value){
					func({result:true,value:value});
				},
				function(reason){
					func({result:false,message:reason});
				}
			);
		}else{
			result.result = false;
			result.message = "Do not support storage.";
		}
		func(result);
	}

	// -
	// 同期ストレージからロード
	// -
	function SyncStorageGetItem(key,func){
	}

	// -
	// 同期ストレージからセーブ
	// -
	function SyncStorageSetItem(key,str,func){
	}

	// -
	// 同期ストレージから削除
	// -
	function SyncStorageRemoveItem(key,func){
	}

	// -
	// 全角アルファベットから半角アルファベットに変換
	// -
	function StringConvertFromAlphabeticFullToAlphabeticHalf(s){

		var r;
		r = new RegExp("[a-zA-Z]","g");
		return s.replace(r, function(c){
			return String.fromCharCode(c.charCodeAt(0) - 65248);
		});
	}

	// -
	// 半角アルファベットから全角アルファベットに変換
	// -
	function StringConvertFromAlphabeticHalfToAlphabeticFull(s){

		var r;
		r = new RegExp("[a-zA-Z-.]","g");
		return s.replace(r, function(c){
			return String.fromCharCode(c.charCodeAt(0) + 65248);
		});
	}

	// -
	// 全角数字から半角数字に変換
	// -
	function StringConvertFromNumericFullToNumericHalf(s){

		var r;
		r = new RegExp("[0-9-.]","g");
		return s.replace(r, function(c){
			return String.fromCharCode(c.charCodeAt(0) - 65248);
		});
	}

	// -
	// 半角英数字から全角英数字に変換
	// -
	function StringConvertFromNumericHalfToNumericFull(s){

		var r;
		r = new RegExp("[0-9]","g");
		return s.replace(r, function(c){
			return String.fromCharCode(c.charCodeAt(0) + 65248);
		});
	}

	// -
	// 全角記号から半角記号に変換
	// -
	function StringConvertFromSignFullToSignHalf(s){
		s = s.replace(/”/g, "\"");
		s = s.replace(/’/g, "\'");
		s = s.replace(/¥/g, "\\");
		var r = new RegExp("[!-/:-@[-`{-~]","g");
		return s.replace(r, function(c){
			return String.fromCharCode(c.charCodeAt(0) - 65248);
		});
	}

	// -
	// 半角記号から全角記号に変換
	// -
	function StringConvertFromSignHalfToSignFull(s){
		s = s.replace(/\"/g, "”");
		s = s.replace(/\'/g, "’");
		s = s.replace(/\\/g, "¥");
		var r = new RegExp("[!-/:-@\[-`\{-~]","g");
		return s.replace(r, function(c){
			return String.fromCharCode(c.charCodeAt(0) + 65248);
		});
	}

	// -
	// 全角スペースから半角スペースに変換
	// -
	function StringConvertFromSpaceFullToSpaceHalf(s){
		return s.replace(/ /g, " ");
	}

	// -
	// 半角スペースから全角スペースに変換
	// -
	function StringConvertFromSpaceHalfToSpaceFull(s){
		return s.replace(/ /g, " ");
	}

	// -
	// 半角カタカナから全角カタカナに変換
	// -
	var StringConvertFromKatakanaFullToKatakanaHalf = (function(){
		var data_g = ["ガ","ギ","グ","ゲ","ゴ","ザ","ジ","ズ","ゼ","ゾ","ダ","ヂ","ヅ","デ","ド","バ","ビ","ブ","ベ","ボ"];
		var re_g = new RegExp("ガ|ギ|グ|ゲ|ゴ|ザ|ジ|ズ|ゼ|ゾ|ダ|ヂ|ヅ|デ|ド|バ|ビ|ブ|ベ|ボ","g");
		var data_p = ["パ","ピ","プ","ペ","ポ"];
		var re_p = new RegExp("パ|ピ|プ|ペ|ポ","g");
		var data_o = ["。","「","」","、","・","ヲ","ァ","ィ","ゥ","ェ","ォ","ャ","ュ","ョ","ッ","ー","ア","イ","ウ","エ","オ","カ","キ","ク","ケ","コ","サ","シ","ス","セ","ソ","タ","チ","ツ","テ","ト","ナ","ニ","ヌ","ネ","ノ","ハ","ヒ","フ","ヘ","ホ","マ","ミ","ム","メ","モ","ヤ","ユ","ヨ","ラ","リ","ル","レ","ロ","ワ","ン","゛","゜"];
		var re_o = new RegExp("[。-゚]","g");

		return function (s){
			// 濁点
			s = s.replace(re_g, function(c){
				var code = c.charCodeAt(0);
				if(code <= 65409)	return data_g[code-65398];
				if(code >= 65418)	return data_g[code-65418 + 15];
				return data_g[code-65410 + 12];
			});

			// 半濁点
			s = s.replace(re_p, function(c){
				var code = c.charCodeAt(0);
				return data_p[code-65418];
			});

			// その他
			s = s.replace(re_o, function(c){
				return data_o[c.charCodeAt(0)-65377];
			});

			return s;
		};
	})();

	// -
	// 全角カタカナから半角カタカナに変換
	// -
	var StringConvertFromKatakanaHalfToKatakanaFull = (function(){
		var data = new Object();
		data["。"] = "。"; data["「"] = "「"; data["」"] = "」"; data["、"] = "、"; data["・"] = "・";
		data["ヲ"] = "ヲ";
		data["ァ"] = "ァ"; data["ィ"] = "ィ"; data["ゥ"] = "ゥ"; data["ェ"] = "ェ"; data["ォ"] = "ォ";
		data["ャ"] = "ャ"; data["ュ"] = "ュ"; data["ョ"] = "ョ"; data["ッ"] = "ッ"; data["ー"] = "ー"; 
		data["ア"] = "ア"; data["イ"] = "イ"; data["ウ"] = "ウ"; data["エ"] = "エ"; data["オ"] = "オ"; 
		data["カ"] = "カ"; data["キ"] = "キ"; data["ク"] = "ク"; data["ケ"] = "ケ"; data["コ"] = "コ";
		data["サ"] = "サ"; data["シ"] = "シ"; data["ス"] = "ス"; data["セ"] = "セ"; data["ソ"] = "ソ";
		data["タ"] = "タ"; data["チ"] = "チ"; data["ツ"] = "ツ"; data["テ"] = "テ"; data["ト"] = "ト";
		data["ナ"] = "ナ"; data["ニ"] = "ニ"; data["ヌ"] = "ヌ"; data["ネ"] = "ネ"; data["ノ"] = "ノ";
		data["ハ"] = "ハ"; data["ヒ"] = "ヒ"; data["フ"] = "フ"; data["ヘ"] = "ヘ"; data["ホ"] = "ホ";
		data["マ"] = "マ"; data["ミ"] = "ミ"; data["ム"] = "ム"; data["メ"] = "メ"; data["モ"] = "モ";
		data["ヤ"] = "ヤ"; data["ユ"] = "ユ"; data["ヨ"] = "ヨ";
		data["ラ"] = "ラ"; data["リ"] = "リ"; data["ル"] = "ル"; data["レ"] = "レ"; data["ロ"] = "ロ";
		data["ワ"] = "ワ"; data["ン"] = "ン"; data["゛"] = "゙"; data["゜"] = "゚";
		data["ガ"] = "ガ"; data["ギ"] = "ギ"; data["グ"] = "グ"; data["ゲ"] = "ゲ"; data["ゴ"] = "ゴ";
		data["ザ"] = "ザ"; data["ジ"] = "ジ"; data["ズ"] = "ズ"; data["ゼ"] = "ゼ"; data["ゾ"] = "ゾ";
		data["ダ"] = "ダ"; data["ヂ"] = "ヂ"; data["ヅ"] = "ヅ"; data["デ"] = "デ"; data["ド"] = "ド";
		data["バ"] = "バ"; data["ビ"] = "ビ"; data["ブ"] = "ブ"; data["ベ"] = "ベ"; data["ボ"] = "ボ";
		data["パ"] = "パ"; data["ピ"] = "ピ"; data["プ"] = "プ"; data["ペ"] = "ペ"; data["ポ"] = "ポ";
		var r = new RegExp("[、。「」゛゜ァ-ロワヲン・ー]","g");

		return function (s){
			return s.replace(r, function(c){
				return data[c];
			});
		};
	})();

	// -
	// ひらがなからカタカナに変換
	// -
	function StringConvertFromHiraganaToKatakana(s){
		var r = new RegExp("[ぁ-ん]","g");
		return s.replace(r, function(c){
			return String.fromCharCode(c.charCodeAt(0) + 96);
		});
	}

	// -
	// カタカナからひらがなに変換
	// -
	function StringConvertFromKatakanaToHiragana(s){
		var r = new RegExp("[ァ-ン]","g");
		return s.replace(r, function(c){
			return String.fromCharCode(c.charCodeAt(0) - 96);
		});
	}

	// -
	// 文字参照からテキストに変換
	// -
	function StringConvert_From_CharacterReferences_To_Text(html){
		var element = document.createElement("span");
		var re = new RegExp("(&#[0-9]{1,};)|(&#x[0-9a-f]{1,};)|(&[0-9a-z]{2,};)","gi");
		return html.replace(re , function(c){
			element.innerHTML = c;
			return ElementGetTextContent(element);
		});
	}

	// -
	// 文字列を評価して配列関数を作成
	// -
	function StringEvalArrayFunction(src){
		try{
			var a = eval(src);

			if(typeof(a) == "function")	return [a];

			var check = false;
			if((a) && (typeof(a) == "object")){
				if(a.constructor == Array){
					var ary = new Array();
					var i;
					var num = a.length;
					for(i=0;i<num;i++){
						if(typeof(a[i]) == "function"){
							ary.push(a[i]);
						}
					}

					return ary;
				}
			}

		}catch(e){}

		return [];
	}

	// -
	// 文字列からクエリーを取得
	// -
	function StringGetQuery(url){
		var q = new Object();
		var m = url.match(new RegExp("[?](.*?)(#|$)"));
		if(!m)	return q;
		var a = m[1].split('&');
		var i;
		var num = a.length;
		for(i=0;i<num;i++){
			var b = a[i].split('=');
			if(b.length == 2){
				q[b[0]] = b[1];
			}
		}
		return q;
	}

	// -
	// 文字列とアスタリスク付きワードとが一致するか調べる
	// -
	function StringMatchAsteriskWord(src,w){
		var i_num = src.length;
		var j_num = w.length;
		var i=0;
		var j=0;
		var n;
		var l;
		n = w.indexOf("*");
		if(n < 0){
			return (src == w);
		}else if(n > 0){
			var l = n - j;
			n = src.indexOf(w.substring(j,n),i);
			if(n != 0){
				return false;
			}
			i = n + l;
			j = j + l;
		}
		while(true){
			while(true){
				j ++;
				n = w.indexOf("*",j);
				if(n != j ){
					break;
				}
			}
			if(n < 0){
				if(j >= j_num){
					return true;
				}else{
					n = j_num;
				}
			}
			l = n - j;
			n = src.indexOf(w.substring(j,n),i);
			if(n < 0){
				return false;
			}
			i = n + l;
			j = j + l ;
		}
		return false;
	}

	// -
	// URL 文字列とアスタリスク付きワードとが一致するか調べる
	// -
	function StringUrlMatchAsteriskWord(src,w){

		var ary = new Array();
		var r = new RegExp(":|\/|[.]|[?]|#|[*]+","i");
		while(true){
			var m = w.match(r);
			if(m){
				if(RegExp.leftContext){
					ary.push(RegExp.leftContext);
				}
				if(m[0].charAt(0) == '*')	ary.push('*');
				else						ary.push(m[0]);
				w = RegExp.rightContext;
				continue;
			}
			if(w){
				ary.push(w);
			}
			break;
		}

		var i;
		var num = src.length;
		var p = 0;
		while(true){
			w = ary.shift();
			if(!w){
				if(p >= num)	return true;
				return false;
			}
			if(w == '*'){
				w = ary.shift();
				if(!w)	return true;

				i = src.indexOf(w,p);
				if(i < 0)	return false;
				p = i + w.length;
			}else{
				if(src.indexOf(w,p) != p)	return false;
				p += w.length;
			}
		}
	}

	// -
	// URLアスタリスク付きワードから正規表現配列を取得
	// -
	function StringRegExpListFromAsteriskWord(w){

		var str = "^";
		var ary = new Array();
		var r = new RegExp(":|\/|[.]|[?]|#|[*]+");

		while(true){
			var m = w.match(r);
			if(m){
				if(m[0].charAt(0) == '*'){
					str += RegExp.leftContext + ".*?";
				}else{
					str += RegExp.leftContext + "[" + m[0] + "]";
					ary.push(new RegExp(str));
					str = "^";
				}
				w = RegExp.rightContext;
			}else{
				m = w.match(new RegExp("(.*)$"));
				if(m[0] || (str.length > 1)){
					str += m[0] + "$";
					ary.push(new RegExp(str));
					break;
				}
				break;
			}
		}
		return ary;
	}

	// -
	// URL 文字列とアスタリスク付きワードとが一致するか調べる
	// -
	function StringUrlMatchRegExpList(src,ary){
		var i;
		var num = ary.length;
		var m;
		for(i=0;i<num;i++){
			m = src.match(ary[i]);
			if(!m)	return false;
			src = RegExp.rightContext;
		}

		if(src == "")	return true;
		return false;
	}

	// -
	// URL アドレスを絶対 URL に変換
	// -
	function StringUrl_To_Absolute(src,url,base){
		if(!src) src = "";
		if(!url) url = "";
		if(!base) base = "";

		var m = url.match(new RegExp("^.*/","i"));
		if(!m) return "";
		var path = m[0];

		var m = url.match(new RegExp("^[^:]+://[^/]+/","i"));
		if(!m) return "";
		var root = m[0];

		var m = url.match(new RegExp("^[^:]+:","i"));
		if(!m) return "";
		var protocol = m[0];

		var m = base.match(new RegExp(".*/","i"));
		if(m) base = m[0];

		if(base.indexOf("//") == 0){
			base = protocol + base;
		}else if(base.indexOf("/") == 0){
			base = root + base.substr(1);
		}else{
			base = path + base;
		}

		if(src.indexOf("//") == 0){
			return protocol + src;
		}else if(src.indexOf("/") == 0){
			return root + src.substr(1);
		}else if(src.match(new RegExp("^[a-z]+:[^/]","i"))){
			return src;
		}else if(src.match(new RegExp("://","i"))){
			return src;
		}

		return base + src;
	}

	// -
	// URL アドレスからオリジンを取得
	// -
	function URL_Get_Origin(url){
		return URL_Parser(url).origin;
	}

	// -
	// URL パーサー
	// -
	function URL_Parser(url){

		var protocol = "";
		var username = "";
		var password = "";
		var port = "";
		var host = "";
		var hostname = "";
		var origin = "";
		var pathname = "";
		var filename = "";
		var name = "";
		var ext = "";
		var search = "";
		var hash = "";
		var special_scheme;

		try{
			var parser = new URL(url);
			pathname = parser.pathname;
			if(pathname.length <= 2048){
				var m = pathname.match(/([^/]+)([/]*)$/);
				if(m) filename = m[1];
				m = filename.match(/[.]([^.]*)$/);
				if(m){
					ext = m[1];
					name = RegExp.leftContext;
				}else{
					name = filename;
				}
				m = ext.match(/^([^":*?<>|~]+)/);
				if(m){
					ext = m[1];
				}
			}

			return {
				protocol:parser.protocol,
				username:parser.username,
				password:parser.password,
				port:parser.port,
				host:parser.host,
				hostname:parser.hostname,
				origin:parser.origin,
				pathname:pathname,
				filename:filename,
				name:name,
				ext:ext,
				search:parser.search,
				hash:parser.hash
			};

		}catch(e){
		}


		var m;
		var n = url;
		if(url.length <= 2048){
			m = n.match(/([#].*)$/);
			if(m){
				hash = m[1];
				n = RegExp.leftContext;
			}

			m = n.match(/([?].*)/);
			if(m){
				search = m[1];
				n = RegExp.leftContext;
			}

			m = n.match(/^([^:]+:)/);
			if(m){
				protocol = m[1];
				n = RegExp.rightContext;
			}

			m = protocol.match(/^(http|https|ftp|file|ws|wss):/);
			special_scheme = Boolean(m);
			if(special_scheme){
				m = n.match(/^([/]*)/);
				if(m){
					n = RegExp.rightContext;
				}
				if(protocol.match(/^(file):/)){
					n = "/" + n;
				}
				m = n.match(/^([^/]*)/);
				if(m){
					pathname = RegExp.rightContext;
					n = m[1];
				}
			}else{
				pathname = n;
				n = "";
			}

			m = pathname.match(/([^/]+)([/]*)$/);
			if(m) filename = m[1];
			m = filename.match(/[.]([^.]*)$/);
			if(m){
				ext = m[1];
				name = RegExp.leftContext;
			}else{
				name = filename;
			}

			m = n.match(/([^@]*)@/);
			if(m){
				host = RegExp.rightContext; 
				n = m[1];
			}else{
				host = n;
				n = "";
			}

			m = host.match(/:([^:]*)$/);
			if(m){
				port = m[1];
				hostname = RegExp.leftContext;
			}else{
				hostname = host;
			}

			m = n.match(/[:]([^:]*)$/);
			if(m){
				password = m[1];
				username = RegExp.leftContext;
			}else{
				username = n;
			}

			if(special_scheme){
				origin = protocol + "//" + hostname;
				if(port) origin += ":" + port;
			}

		}

		return {
			protocol:protocol,
			username:username,
			password:password,
			port:port,
			host:host,
			hostname:hostname,
			origin:origin,
			pathname:pathname,
			filename:filename,
			name:name,
			ext:ext,
			search:search,
			hash:hash
		};
	}

	// -
	// Data URL パーサー
	// -
	function DataURL_Parser(url){
		var mimetype = "";
		var charset = "";
		var format = "";
		var offset = 0;

		var m;
		m = url.match(/^data:/i);
		if(!m) return null;

		offset = url.indexOf(",");
		if(offset < 0) return null;

		var ary = url.slice(5,offset).split(";");
		var s;
		s = ary.shift() || "";
		m = s.match(/.+[/].+/);
		if(m){
			mimetype = m[0];
			s = ary.shift() || "";
		}
		m = s.match(/^charset=(.*)/i);
		if(m){
			charset = m[1];
			s = ary.shift() || "";
		}
		if(s.match(/^base64$/i)){
			format = "base64";
		}else{
			format = "text";
		}
		offset += 1;

		return {
			mimetype:mimetype,
			charset:charset,
			format:format,
			data_offset:offset,
			data_size:(url.length - offset)
		};
	}

	// -
	// 文字列リテラルから文字列に変換
	// -
	function StringLiteral_To_String(str){
		// 引用符
		var q;
		var m;
		if(!q){
			m = str.match(/^"(.*)"$/);
			if(m){
				q = '"';
				str = m[1];
			}
		}
		if(!q){
			m = str.match(/^'(.*)'$/);
			if(m){
				q = '"';
				str = m[1];
			}
		}
		if(!q) return null;

		function getChar(s){
			var n = 0;
			var d = 1;
			var i;
			for(i=s.length-1;i>=0;i--){
				var c = s.charCodeAt(i);
				if(c >= 97) c -= 87;
				if(c >= 65) c -= 55;
				if(c >= 48) c -= 48;
				n += d * c;
				d *= 16;
			}
			return String.fromCharCode(n);
		}

		// Unicodeスカラ値
		str = str.replace(new RegExp("\\\\u([0-9a-f]{4})","ig"),function (m0,m1){
			return getChar(m1);
		});

		// Hexスカラ値
		str = str.replace(new RegExp("\\\\x([0-9a-f]{2})","ig"),function (m0,m1){
			return getChar(m1);
		});

		// エスケープ
		var d = {
			"\\":"\u005C",
			"b":"\u0008",
			"f":"\u000C",
			"n":"\u000A",
			"r":"\u000D",
			"t":"\u0009",
			"v":"\u000B",
			"'":"\u0027",
			'"':"\u0022",
			"/":"\u002F"
		};
		str = str.replace(new RegExp("\\\\(.)","g"),function (m0,m1){
			if(d[m1]) return d[m1];
			return m1;
		});

		return str;
	}

	// -
	// タイムスタンプから日付を取得
	// -
	function Timestamp_ToString_JP(time){
		var date = new Date(time);
		var year = date.getFullYear();
		var mon = date.getMonth() + 1;
		var day = date.getDate();
		var hou = date.getHours();
		var min = date.getMinutes();
		var sec = date.getSeconds();
		var str = "";
		if(year < 1000) str += "0";
		if(year < 100) str += "0";
		if(year < 10) str += "0";
		str += year;
		str += "/";
		if(mon < 10) str += "0";
		str += mon;
		str += "/";
		if(day < 10) str += "0";
		str += day;
		str += " ";
		if(hou < 10) str += "0";
		str += hou;
		str += ":";
		if(min < 10) str += "0";
		str += min;
		str += ":";
		if(sec < 10) str += "0";
		str += sec;
		return str;
	}

	// -
	// UNIXTIME から日付を取得
	// -
	function UNIXTIME_ToString_JP(unix_time){
		return Timestamp_ToString_JP(unix_time * 1000);
	}

	// -
	// 属性辞書 HTML5
	// -
	var DICTIONARY_ATTRIBUTE_HTML5 = {
		globals :{ "accesskey":true, "class":true, "contenteditable":true, "dir":true, "draggable":true, "dropzone":true, "hidden":true, "id":true, "lang":true, "spellcheck":true, "style":true, "tabindex":true, "title":true, "translate":true },
		elements:{
			"A":{
				allow:true,
				attributes:{ "href":true, "target":true, "download":true, "rel":true, "hreflang":true, "type":true }
			},
			"ABBR":{
				allow:true,
				attributes:{ }
			},
			"ADDRESS":{
				allow:true,
				attributes:{ }
			},
			"AREA":{
				allow:true,
				attributes:{ "alt":true, "coords":true, "shape":true, "href":true, "target":true, "download":true, "rel":true, "hreflang":true, "type":true }
			},
			"ARTICLE":{
				allow:true,
				attributes:{ }
			},
			"ASIDE":{
				allow:true,
				attributes:{ }
			},
			"AUDIO":{
				allow:true,
				attributes:{ "src":true, "crossorigin":true, "preload":true, "autoplay":true, "mediagroup":true, "loop":true, "muted":true, "controls":true }
			},
			"B":{
				allow:true,
				attributes:{ }
			},
			"BASE":{
				allow:true,
				attributes:{ "href":true, "target":true }
			},
			"BDI":{
				allow:true,
				attributes:{ }
			},
			"BDO":{
				allow:true,
				attributes:{ }
			},
			"BLOCKQUOTE":{
				allow:true,
				attributes:{ "cite":true }
			},
			"BODY":{
				allow:false,
				attributes:{ }
			},
			"BR":{
				allow:true,
				attributes:{ }
			},
			"BUTTON":{
				allow:true,
				attributes:{ "autofocus":true, "disabled":true, "form":true, "formaction":true, "formenctype":true, "formmethod":true, "formnovalidate":true, "formtarget":true, "name":true, "type":true, "value":true }
			},
			"CANVAS":{
				allow:true,
				attributes:{ "width":true, "height":true }
			},
			"CAPTION":{
				allow:true,
				attributes:{ }
			},
			"CITE":{
				allow:true,
				attributes:{ }
			},
			"CODE":{
				allow:true,
				attributes:{ }
			},
			"COL":{
				allow:true,
				attributes:{ "span":true }
			},
			"COLGROUP":{
				allow:true,
				attributes:{ "span":true }
			},
			"DATA":{
				allow:true,
				attributes:{ "value":true }
			},
			"DATALIST":{
				allow:true,
				attributes:{ }
			},
			"DD":{
				allow:true,
				attributes:{ }
			},
			"DEL":{
				allow:true,
				attributes:{ "cite":true, "datetime":true }
			},
			"DETAILS":{
				allow:true,
				attributes:{ "open":true }
			},
			"DFN":{
				allow:true,
				attributes:{ }
			},
			"DIALOG":{
				allow:true,
				attributes:{ "open":true }
			},
			"DIV":{
				allow:true,
				attributes:{ }
			},
			"DL":{
				allow:true,
				attributes:{ }
			},
			"DT":{
				allow:true,
				attributes:{ }
			},
			"EM":{
				allow:true,
				attributes:{ }
			},
			"EMBED":{
				allow:false,
				attributes:{ "src":true, "type":true, "width":true, "height":true, "any*":true }
			},
			"FIELDSET":{
				allow:true,
				attributes:{ "disabled":true, "form":true, "name":true }
			},
			"FIGCAPTION":{
				allow:true,
				attributes:{ }
			},
			"FIGURE":{
				allow:true,
				attributes:{ }
			},
			"FOOTER":{
				allow:true,
				attributes:{ }
			},
			"FORM":{
				allow:true,
				attributes:{ "accept-charset":true, "action":true, "autocomplete":true, "enctype":true, "method":true, "name":true, "novalidate":true, "target":true }
			},
			"H1":{
				allow:true,
				attributes:{ }
			},
			"H2":{
				allow:true,
				attributes:{ }
			},
			"H3":{
				allow:true,
				attributes:{ }
			},
			"H4":{
				allow:true,
				attributes:{ }
			},
			"H5":{
				allow:true,
				attributes:{ }
			},
			"H6":{
				allow:true,
				attributes:{ }
			},
			"HEAD":{
				allow:false,
				attributes:{ }
			},
			"HEADER":{
				allow:true,
				attributes:{ }
			},
			"HR":{
				allow:true,
				attributes:{ }
			},
			"HTML":{
				allow:false,
				attributes:{ "manifest":true }
			},
			"I":{
				allow:true,
				attributes:{ }
			},
			"IFRAME":{
				allow:false,
				attributes:{ "src":true, "srcdoc":true, "name":true, "sandbox":true, "seamless":true, "width":true, "height":true }
			},
			"IMG":{
				allow:true,
				attributes:{ "alt":true, "src":true, "crossorigin":true, "usemap":true, "ismap":true, "width":true, "height":true }
			},
			"INPUT":{
				allow:true,
				attributes:{ "accept":true, "alt":true, "autocomplete":true, "autofocus":true, "checked":true, "dirname":true, "disabled":true, "form":true, "formaction":true, "formenctype":true, "formmethod":true, "formnovalidate":true, "formtarget":true, "height":true, "list":true, "max":true, "maxlength":true, "min":true, "minlength":true, "multiple":true, "name":true, "pattern":true, "placeholder":true, "readonly":true, "required":true, "size":true, "src":true, "step":true, "type":true, "value":true, "width":true }
			},
			"INS":{
				allow:true,
				attributes:{ "cite":true, "datetime":true }
			},
			"KBD":{
				allow:true,
				attributes:{ }
			},
			"KEYGEN":{
				allow:true,
				attributes:{ "autofocus":true, "challenge":true, "disabled":true, "form":true, "keytype":true, "name":true }
			},
			"LABEL":{
				allow:true,
				attributes:{ "form":true, "for":true }
			},
			"LEGEND":{
				allow:true,
				attributes:{ }
			},
			"LI":{
				allow:true,
				attributes:{ "value*":true }
			},
			"LINK":{
				allow:true,
				attributes:{ "href":true, "crossorigin":true, "rel":true, "media":true, "hreflang":true, "type":true, "sizes":true }
			},
			"MAIN":{
				allow:true,
				attributes:{ "":true }
			},
			"MAP":{
				allow:true,
				attributes:{ "name":true }
			},
			"MARK":{
				allow:true,
				attributes:{ }
			},
			"META":{
				allow:true,
				attributes:{ "name":true, "http-equiv":true, "content":true, "charset":true }
			},
			"METER":{
				allow:true,
				attributes:{ "value":true, "min":true, "max":true, "low":true, "high":true, "optimum":true }
			},
			"NAV":{
				allow:true,
				attributes:{ }
			},
			"NOSCRIPT":{
				allow:true,
				attributes:{ }
			},
			"OBJECT":{
				allow:true,
				attributes:{ "data":true, "type":true, "typemustmatch":true, "name":true, "usemap":true, "form":true, "width":true, "height":true }
			},
			"OL":{
				allow:true,
				attributes:{ "reversed":true, "start":true, "type":true }
			},
			"OPTGROUP":{
				allow:true,
				attributes:{ "disabled":true, "label":true }
			},
			"OPTION":{
				allow:true,
				attributes:{ "disabled":true, "label":true, "selected":true, "value":true }
			},
			"OUTPUT":{
				allow:true,
				attributes:{ "for":true, "form":true, "name":true }
			},
			"P":{
				allow:true,
				attributes:{ }
			},
			"PARAM":{
				allow:true,
				attributes:{ "name":true, "value":true }
			},
			"PRE":{
				allow:true,
				attributes:{ }
			},
			"PROGRESS":{
				allow:true,
				attributes:{ "value":true, "max":true }
			},
			"Q":{
				allow:true,
				attributes:{ "cite":true }
			},
			"RB":{
				allow:true,
				attributes:{ }
			},
			"RP":{
				allow:true,
				attributes:{ }
			},
			"RT":{
				allow:true,
				attributes:{ }
			},
			"RTC":{
				allow:true,
				attributes:{ }
			},
			"RUBY":{
				allow:true,
				attributes:{ }
			},
			"S":{
				allow:true,
				attributes:{ }
			},
			"SAMP":{
				allow:true,
				attributes:{ }
			},
			"SCRIPT":{
				allow:false,
				attributes:{ "src":true, "type":true, "charset":true, "async":true, "defer":true, "crossorigin":true }
			},
			"SECTION":{
				allow:true,
				attributes:{ }
			},
			"SELECT":{
				allow:true,
				attributes:{ "autofocus":true, "disabled":true, "form":true, "multiple":true, "name":true, "required":true, "size":true }
			},
			"SMALL":{
				allow:true,
				attributes:{ }
			},
			"SOURCE":{
				allow:true,
				attributes:{ "src":true, "type":true, "media":true }
			},
			"SPAN":{
				allow:true,
				attributes:{ }
			},
			"STRONG":{
				allow:true,
				attributes:{ }
			},
			"STYLE":{
				allow:false,
				attributes:{ "media":true, "type":true, "scoped":true }
			},
			"SUB":{
				allow:true,
				attributes:{ }
			},
			"SUMMARY":{
				allow:true,
				attributes:{ }
			},
			"SUP":{
				allow:true,
				attributes:{ }
			},
			"TABLE":{
				allow:true,
				attributes:{ "border":true }
			},
			"TBODY":{
				allow:true,
				attributes:{ }
			},
			"TD":{
				allow:true,
				attributes:{ "colspan":true, "rowspan":true, "headers":true }
			},
			"TEMPLATE":{
				allow:true,
				attributes:{ }
			},
			"TEXTAREA":{
				allow:true,
				attributes:{ "autofocus":true, "cols":true, "dirname":true, "disabled":true, "form":true, "maxlength":true, "minlength":true, "name":true, "placeholder":true, "readonly":true, "required":true, "rows":true, "wrap":true }
			},
			"TFOOT":{
				allow:true,
				attributes:{ }
			},
			"TH":{
				allow:true,
				attributes:{ "colspan":true, "rowspan":true, "headers":true, "scope":true, "abbr":true }
			},
			"THEAD":{
				allow:true,
				attributes:{ }
			},
			"TIME":{
				allow:true,
				attributes:{ "datetime":true }
			},
			"TITLE":{
				allow:true,
				attributes:{ }
			},
			"TR":{
				allow:true,
				attributes:{ }
			},
			"TRACK":{
				allow:true,
				attributes:{ "default":true, "kind":true, "label":true, "src":true, "srclang":true }
			},
			"U":{
				allow:true,
				attributes:{ }
			},
			"UL":{
				allow:true,
				attributes:{ }
			},
			"VAR":{
				allow:true,
				attributes:{ }
			},
			"VIDEO":{
				allow:true,
				attributes:{ "src":true, "crossorigin":true, "poster":true, "preload":true, "autoplay":true, "mediagroup":true, "loop":true, "muted":true, "controls":true, "width":true, "height":true }
			},
			"WBR":{
				allow:true,
				attributes:{ }
			}
		}
	};

	// -
	// 属性辞書 HTML4.1
	// -
	var DICTIONARY_ATTRIBUTE_HTML4 = {
		globals :{ "class":true, "dir":true, "id":true, "lang":true, "style":true, "title":true },
		elements:{
			"A":{
				allow:true,
				attributes:{ "accesskey":true, "charset":true, "coords":true, "href":true, "hreflang":true, "name":true, "rel":true, "rev":true, "shape":true, "tabindex":true, "target":true, "type":true }
			},
			"ABBR":{
				allow:true,
				attributes:{ }
			},
			"ACRONYM":{
				allow:true,
				attributes:{ }
			},
			"ADDRESS":{
				allow:true,
				attributes:{ }
			},
			"APPLET":{
				allow:false,
				attributes:{ "align":true, "alt":true, "archive":true, "code":true, "codebase":true, "height":true, "hspace":true, "name":true, "object":true, "vspace":true, "width":true }
			},
			"AREA":{
				allow:true,
				attributes:{ "accesskey":true, "alt":true, "coords":true, "href":true, "nohref":true, "shape":true, "tabindex":true, "target":true }
			},
			"B":{
				allow:true,
				attributes:{ }
			},
			"BASE":{
				allow:true,
				attributes:{ "href":true, "target":true }
			},
			"BASEFONT":{
				allow:true,
				attributes:{ "color":true, "face":true, "size":true }
			},
			"BDO":{
				allow:true,
				attributes:{ "dir":true }
			},
			"BIG":{
				allow:true,
				attributes:{ }
			},
			"BLOCKQUOTE":{
				allow:true,
				attributes:{ "cite":true }
			},
			"BODY":{
				allow:false,
				attributes:{ "alink":true, "background":true, "bgcolor":true, "link":true, "text":true, "vlink":true }
			},
			"BR":{
				allow:true,
				attributes:{ "clear":true }
			},
			"BUTTON":{
				allow:true,
				attributes:{ "accesskey":true, "disabled":true, "name":true, "tabindex":true, "type":true, "value":true }
			},
			"CAPTION":{
				allow:true,
				attributes:{ "align":true }
			},
			"CENTER":{
				allow:true,
				attributes:{ }
			},
			"CITE":{
				allow:true,
				attributes:{ }
			},
			"CODE":{
				allow:true,
				attributes:{ }
			},
			"COL":{
				allow:true,
				attributes:{ "align":true, "char":true, "charoff":true, "span":true, "valign":true, "width":true }
			},
			"COLGROUP":{
				allow:true,
				attributes:{ "align":true, "char":true, "charoff":true, "span":true, "valign":true, "width":true }
			},
			"DD":{
				allow:true,
				attributes:{ }
			},
			"DEL":{
				allow:true,
				attributes:{ "cite":true, "datetime":true }
			},
			"DFN":{
				allow:true,
				attributes:{ }
			},
			"DIR":{
				allow:true,
				attributes:{ "compact":true }
			},
			"DIV":{
				allow:true,
				attributes:{ "align":true }
			},
			"DL":{
				allow:true,
				attributes:{ "compact":true }
			},
			"DT":{
				allow:true,
				attributes:{ }
			},
			"EM":{
				allow:true,
				attributes:{ }
			},
			"FIELDSET":{
				allow:true,
				attributes:{ }
			},
			"FONT":{
				allow:true,
				attributes:{ "color":true, "face":true, "size":true }
			},
			"FORM":{
				allow:true,
				attributes:{ "accept-charset":true, "accept":true, "action":true, "enctype":true, "method":true, "name":true, "target":true }
			},
			"FRAME":{
				allow:false,
				attributes:{ "frameborder":true, "longdesc":true, "marginheight":true, "marginwidth":true, "name":true, "noresize":true, "scrolling":true, "src":true }
			},
			"FRAMESET":{
				allow:false,
				attributes:{ "cols":true, "rows":true }
			},
			"H1":{
				allow:true,
				attributes:{ "align":true }
			},
			"H2":{
				allow:true,
				attributes:{ "align":true }
			},
			"H3":{
				allow:true,
				attributes:{ "align":true }
			},
			"H4":{
				allow:true,
				attributes:{ "align":true }
			},
			"H5":{
				allow:true,
				attributes:{ "align":true }
			},
			"H6":{
				allow:true,
				attributes:{ "align":true }
			},
			"HEAD":{
				allow:false,
				attributes:{ "profile":true }
			},
			"HR":{
				allow:true,
				attributes:{ "align":true, "noshade":true, "size":true, "width":true }
			},
			"HTML":{
				allow:false,
				attributes:{ "version":true }
			},
			"I":{
				allow:true,
				attributes:{ }
			},
			"IFRAME":{
				allow:false,
				attributes:{ "align":true, "frameborder":true, "height":true, "longdesc":true, "marginheight":true, "marginwidth":true, "name":true, "scrolling":true, "src":true, "width":true }
			},
			"IMG":{
				allow:true,
				attributes:{ "align":true, "alt":true, "border":true, "height":true, "hspace":true, "ismap":true, "longdesc":true, "name":true, "src":true, "usemap":true, "vspace":true, "width":true }
			},
			"INPUT":{
				allow:true,
				attributes:{ "accept":true, "accesskey":true, "align":true, "alt":true, "checked":true, "disabled":true, "ismap":true, "maxlength":true, "name":true, "readonly":true, "size":true, "src":true, "tabindex":true, "type":true, "usemap":true, "value":true }
			},
			"INS":{
				allow:true,
				attributes:{ "cite":true, "datetime":true }
			},
			"ISINDEX":{
				allow:true,
				attributes:{ "prompt":true }
			},
			"KBD":{
				allow:true,
				attributes:{ }
			},
			"LABEL":{
				allow:true,
				attributes:{ "accesskey":true, "for":true }
			},
			"LEGEND":{
				allow:true,
				attributes:{ "accesskey":true, "align":true }
			},
			"LI":{
				allow:true,
				attributes:{ "type":true, "value":true }
			},
			"LINK":{
				allow:true,
				attributes:{ "charset":true, "href":true, "hreflang":true, "media":true, "rel":true, "rev":true, "target":true, "type":true }
			},
			"MAP":{
				allow:true,
				attributes:{ "name":true }
			},
			"MENU":{
				allow:true,
				attributes:{ "compact":true }
			},
			"META":{
				allow:true,
				attributes:{ "content":true, "http-equiv":true, "name":true, "scheme":true }
			},
			"NOFRAMES":{
				allow:true,
				attributes:{ }
			},
			"NOSCRIPT":{
				allow:true,
				attributes:{ }
			},
			"OBJECT":{
				allow:false,
				attributes:{ "align":true, "archive":true, "border":true, "classid":true, "codebase":true, "codetype":true, "data":true, "declare":true, "height":true, "hspace":true, "name":true, "standby":true, "tabindex":true, "type":true, "usemap":true, "vspace":true, "width":true }
			},
			"OL":{
				allow:true,
				attributes:{ "compact":true, "start":true, "type":true }
			},
			"OPTGROUP":{
				allow:true,
				attributes:{ "disabled":true, "label":true }
			},
			"OPTION":{
				allow:true,
				attributes:{ "disabled":true, "label":true, "selected":true, "value":true }
			},
			"P":{
				allow:true,
				attributes:{ "align":true }
			},
			"PARAM":{
				allow:true,
				attributes:{ "name":true, "type":true, "value":true, "valuetype":true }
			},
			"PRE":{
				allow:true,
				attributes:{ "width":true }
			},
			"Q":{
				allow:true,
				attributes:{ "cite":true }
			},
			"S":{
				allow:true,
				attributes:{ }
			},
			"SAMP":{
				allow:true,
				attributes:{ }
			},
			"SCRIPT":{
				allow:false,
				attributes:{ "charset":true, "defer":true, "language":true, "src":true, "type":true }
			},
			"SELECT":{
				allow:true,
				attributes:{ "disabled":true, "multiple":true, "name":true, "size":true, "tabindex":true }
			},
			"SMALL":{
				allow:true,
				attributes:{ }
			},
			"SPAN":{
				allow:true,
				attributes:{ }
			},
			"STRIKE":{
				allow:true,
				attributes:{ }
			},
			"STRONG":{
				allow:true,
				attributes:{ }
			},
			"STYLE":{
				allow:false,
				attributes:{ "media":true, "type":true }
			},
			"SUB":{
				allow:true,
				attributes:{ }
			},
			"SUP":{
				allow:true,
				attributes:{ }
			},
			"TABLE":{
				allow:true,
				attributes:{ "align":true, "bgcolor":true, "border":true, "cellpadding":true, "cellspacing":true, "frame":true, "rules":true, "summary":true, "width":true }
			},
			"TBODY":{
				allow:true,
				attributes:{ "align":true, "char":true, "charoff":true, "valign":true }
			},
			"TD":{
				allow:true,
				attributes:{ "abbr":true, "align":true, "axis":true, "bgcolor":true, "char":true, "charoff":true, "colspan":true, "headers":true, "height":true, "nowrap":true, "rowspan":true, "scope":true, "valign":true, "width":true }
			},
			"TEXTAREA":{
				allow:true,
				attributes:{ "accesskey":true, "cols":true, "disabled":true, "name":true, "readonly":true, "rows":true, "tabindex":true }
			},
			"TFOOT":{
				allow:true,
				attributes:{ "align":true, "char":true, "charoff":true, "valign":true }
			},
			"TH":{
				allow:true,
				attributes:{ "abbr":true, "align":true, "axis":true, "bgcolor":true, "char":true, "charoff":true, "colspan":true, "headers":true, "height":true, "nowrap":true, "rowspan":true, "scope":true, "valign":true, "width":true }
			},
			"THEAD":{
				allow:true,
				attributes:{ "align":true, "char":true, "charoff":true, "valign":true }
			},
			"TITLE":{
				allow:true,
				attributes:{ }
			},
			"TR":{
				allow:true,
				attributes:{ "align":true, "bgcolor":true, "char":true, "charoff":true, "valign":true }
			},
			"TT":{
				allow:true,
				attributes:{ }
			},
			"U":{
				allow:true,
				attributes:{ }
			},
			"UL":{
				allow:true,
				attributes:{ "compact":true, "type":true }
			},
			"VAR":{
				allow:true,
				attributes:{ }
			}
		}
	};

	// -
	// HTML 文字列から DOM オブジェクトを生成(スクリプト要素 と イベントハンドラは除外)
	// -
	function StringHtmlCreateDomNodesSafe(html){

		// 属性名終端文字
		var end_attr_name = new Object();
		end_attr_name[' '] = end_attr_name[' '] = end_attr_name['\t'] = end_attr_name['\r'] = end_attr_name['\n'] = end_attr_name['>'] = end_attr_name['='] = true;

		// 属性値端文字
		var end_attr_value = new Object();
		end_attr_value[' '] = end_attr_value[' '] = end_attr_value['\t'] = end_attr_value['\r'] = end_attr_value['\n'] = end_attr_value['>'] = true;

		// 整形用文字
		var dic_space = new Object();
		dic_space[' '] = dic_space[' '] = dic_space['\t'] = dic_space['\r'] = dic_space['\n'] = true;

		// 空要素
		var dic_empty = new Object();
		dic_empty["AREA"] = dic_empty["BASE"] = dic_empty["BASEFONT"] = dic_empty["BR"] = dic_empty["COL"] = dic_empty["FRAME"] = dic_empty["HR"] = dic_empty["IMG"] = 
		dic_empty["INPUT"] = dic_empty["ISINDEX"] = dic_empty["LINK"] = dic_empty["META"] = dic_empty["PARAM"] = dic_empty["WBR"] = true;

		// 空要素(任意)
		var dic_optional = new Object();
		dic_optional["BODY"] = dic_optional["COLGROUP"] = dic_optional["DD"] = dic_optional["DT"] = dic_optional["HEAD"] = dic_optional["HTML"] = dic_optional["LI"] = dic_optional["OPTION"] = 
		dic_optional["P"] = dic_optional["TBODY"] = dic_optional["TD"] = dic_optional["TFOOT"] = dic_optional["TH"] = dic_optional["THEAD"] = dic_optional["TR"] = true;

		var nodes = new Array();
		var stack = new Array();

		var c;
		var b;
		var e;
		var p = 0;
		var l = html.length;

		var edit = {
			element:null,
			name:"",
			depth:0
		};
		stack.push(edit);

		try{
			while(true){
				// SCRIPT、STYLE
				if(edit.name == "SCRIPT" || edit.name == "STYLE"){

					while(true){

						// '<'
						while(l > p){
							c = html.charAt(p);
							p ++;
							if(c == '<'){
								break;
							}
						}
						if(p >= l)	throw("end");

						// 整形無視
						while(l > p){
							c = html.charAt(p);
							p ++;
							if(dic_space[c]){
							}else{
								break;
							}
						}
						if(p >= l)	throw("end");

						// '/'
						if(c != '/')	continue;

						// 整形無視
						while(l > p){
							c = html.charAt(p);
							if(dic_space[c]){
							}else{
								break;
							}
							p ++;
						}
						if(p >= l)	throw("end");

						// 要素名
						var tag_name = edit.name;
						if(html.substr(p,tag_name.length).toUpperCase() != tag_name)	continue;
						p += tag_name.length;

						// 整形無視
						while(l > p){
							c = html.charAt(p);
							p ++;
							if(dic_space[c]){
							}else{
								break;
							}
						}
						if(p >= l)	throw("end");

						// '>'
						if(c != '>')	continue;
						if(html.charAt(p - 2) == '\\')	continue;

						// スタックポップ
						if(edit.depth){
							stack.pop();
							edit = stack[stack.length - 1];
						}
						break;
					}

				}

				// 要素の開始 '<'
				b = p;
				e = -1;
				while(l > p){
					c = html.charAt(p);
					p ++;
					if(c == '<'){
						e = p - 1;
						break;
					}
				}

				// テキストノード
				if(b < e){
					// テキストノード生成
					var s = html.substring(b,e);
					s = StringConvert_From_CharacterReferences_To_Text(s);
					var text_node = document.createTextNode(s);
					if(text_node){
						if(edit.depth){
							if(edit.element){
								edit.element.appendChild(text_node);
							}
						}else{
							nodes.push(text_node);
						}
					}
				}
				if(p >= l)	throw("end");

				// コメント "<!--"
				if(html.substr(p,3) == "!--"){
					p += 3;
					e = html.indexOf("-->",p);
					if(e >= 0)	p = e + 3;
					continue;
				}

				// 名前の開始、要素の終了 '/'
				while(l > p){
					c = html.charCodeAt(p);
					p ++;
					if((0x41 <= c && c <= 0x5a) || (0x61 <= c && c <= 0x7a) || (c == 0x2f)){
						b = p - 1;
						break;
					}
				}
				if(p >= l)	throw("end");

				// 要素の終了 '/'
				if(c == 0x2f){

					// 名前の開始
					while(l > p){
						c = html.charCodeAt(p);
						p ++;
						if((0x41 <= c && c <= 0x5a) || (0x61 <= c && c <= 0x7a)){
							b = p - 1;
							break;
						}
					}
					if(p >= l)	throw("end");

					// 名前の終了
					while(l > p){
						c = html.charCodeAt(p);
						if((0x41 <= c && c <= 0x5a) || (0x61 <= c && c <= 0x7a) || (0x30 <= c && c <= 0x39)){
						}else{
							e = p;
							break;
						}
						p ++;
					}
					if(p >= l)	throw("end");

					// 要素名
					var tag_name = html.substring(b,e).toUpperCase();

					// 要素の終了 '>'
					while(l > p){
						c = html.charAt(p);
						p ++;
						if(c == '>'){
							break;
						}
					}

					// スタックポップ
					var i;
					b = e = stack.length;
					for(i=e-1;i>=0;i--){
						if(stack[i].name == tag_name){
							b = i;
							break;
						}
					}
					for(;b<e;b++){
						if(edit.depth){
							stack.pop();
							edit = stack[stack.length - 1];
						}
					}

				// 名前の開始
				}else{
					// 名前の終了
					while(l > p){
						c = html.charCodeAt(p);
						if((0x41 <= c && c <= 0x5a) || (0x61 <= c && c <= 0x7a) || (0x30 <= c && c <= 0x3a)){
						}else{
							e = p;
							break;
						}
						p ++;
					}
					if(p >= l)	throw("end");

					// 要素名
					var tag_name = html.substring(b,e).toUpperCase();

					// 要素終了
					var i;
					if(dic_optional[tag_name]){
						b = e = stack.length;
						for(i=e-1;i>=0;i--){
							if(dic_optional[stack[i].name]){
								b = i;
								break;
							}
						}
						for(;b<e;b++){
							if(edit.depth){
								stack.pop();
								edit = stack[stack.length - 1];
							}
						}
					}

					// 要素生成
					var parent = edit.element;
					var empty = false;
					var attr_allow = new Array();
					var element = null;

					var dic_attr = DICTIONARY_ATTRIBUTE_HTML4;
					var item = dic_attr.elements[tag_name];
					if(item){
						if(item.allow){
							attr_allow.push(dic_attr.globals);
							attr_allow.push(item.attributes);
						}
					}
					var dic_attr = DICTIONARY_ATTRIBUTE_HTML5;
					var item = dic_attr.elements[tag_name];
					if(item){
						if(item.allow){
							attr_allow.push(dic_attr.globals);
							attr_allow.push(item.attributes);
						}
					}

					if(attr_allow.length){
						element = document.createElement(tag_name);
					}
					if(element){
						if(edit.depth){
							if(parent && element){
								parent.appendChild(element);
							}
						}else{
							nodes.push(element);
						}
					}

					// 空要素
					if(dic_empty[tag_name]){
						empty = true;
					}

					// スタックプッシュ
					edit = {
						element:element,
						name:tag_name,
						depth:edit.depth + 1
					};
					stack.push(edit);

					// 属性
					while(true){
						// 整形無視
						while(l > p){
							c = html.charAt(p);

							// 整形無視
							if(dic_space[c]){
							}else{
								b = p;
								break;
							}
							p ++;
						}
						if(p >= l)	throw("end");

						// 要素の終了 '>'
						if(c == '>'){
							// スタックポップ
							if(empty){
								if(edit.depth){
									stack.pop();
									edit = stack[stack.length - 1];
								}
							}
							p += 1;
							break;

						// 空要素 '/'
						}else if(c == '/'){
							empty = true;
							p += 1;

						// 属性名の開始
						}else{
							// 属性名の終了
							while(l > p){
								c = html.charAt(p);
								if(end_attr_name[c]){
									e = p;
									break;
								}
								p ++;

							}
							if(p >= l)	throw("end");

							var attr_name = html.substring(b,e);
							var attr_value = undefined;

							// 整形無視
							while(l > p){
								c = html.charAt(p);
								if(dic_space[c]){
								}else{
									break;
								}
								p ++;
							}
							if(p >= l)	throw("end");

							// 属性値 '='
							if(c == '='){
								p ++;

								// 整形無視
								while(l > p){
									c = html.charAt(p);
									if(dic_space[c]){
									}else{
										break;
									}
									p ++;
								}
								if(p >= l)	throw("end");

								// 引用符
								var li = "";
								if(c == '"' || c == '\''){
									li = c;
									p ++;
								}

								b = p;

								// 属性値の終了、引用符の終了
								while(l > p){
									c = html.charAt(p);

									if(li){
										// 引用符の終了
										if(c == li){
											if(html.charAt(p - 1) != '\\'){
												e = p;
												p ++;
												break;
											}
										}
									}else{
										// 属性値の終了
										if(end_attr_value[c]){
											e = p;
											break;
										}
									}

									p ++;
								}
								if(p >= l)	throw("end");

								// 属性値
								attr_value = html.substring(b,e);

							}

							if(edit.element){
								attr_name = attr_name.toLowerCase();
								for(var id in attr_allow){
									if(attr_allow[id][attr_name]){
										if(attr_value === undefined)	attr_value = "";

										// 属性生成
										var attribute = document.createAttribute(attr_name);
										attribute.value = attr_value;
										edit.element.setAttributeNode(attribute);

										break;
									}
								}
							}
						}
					}
				}
			}
		}catch(e){}

		return nodes;
	}

	// -
	// オブジェクトをコピーする関数
	// -
	function ObjectCopy(obj){
		if(obj === null) return null;
		if(typeof(obj) != "object") return obj;

		var s;
		var o;
		var k;
		var r = new (obj.constructor)();
		var q = new Array();

		q.push({o:r,s:obj});
		while(true){
			k = q.pop();
			if(!k)	break;

			o = k.o;
			s = k.s;
			for(k in s){
				if(typeof(s[k]) == "object"){
					if(s[k]){
						o[k] = new (s[k].constructor)();
						q.push({o:o[k],s:s[k]});
						continue;
					}
				}
				o[k] = s[k];
			}
		}

		return r;
	}

	// -
	// オブジェクトからプロパティを破棄
	// -
	function ObjectDeleteProperty(obj,key){
		try{
			obj[key] = null;
			delete obj[key];
		}catch(e){
		}
	}

	// -
	// 正規表現でバックスラッシュワードを置換
	// -
	function RegExpReplacementBackslashWord(re,src,w){
		if(!re)	return src;
		var ary = src.match(re);
		if(!ary)	return src;
		var num = ary.length;
		return w.replace(new RegExp("\\\\\\\\|\\\\[0-9]","g"),function(str, p1, p2) {
			if(str == "\\\\")	return "\\";
			var p = parseInt(str[1]);
			if(p > 0 && p <= num){
				return ary[p];
			}
			if(p == 0)	return ary[0];
			return "";
		});
	}

	// -
	// 正規表現でドルワードを置換
	// -
	function RegExpReplacementDollarWord(re,src,w){
		if(!re)	return src;
		var ary = src.match(re);
		if(!ary)	return src;
		var num = ary.length;
		return w.replace(new RegExp("[$][$]|[$][0-9]","g"),function(str, p1, p2) {
			if(str == "$$")	return "$";
			var p = parseInt(str[1]);
			if(p > 0 && p <= num){
				return ary[p];
			}
			if(p == 0)	return ary[0];
			return "";
		});
	}

	// -
	// クリップボードにテキストをコピー
	// -
	function ClipboardSetText(str){
	}

	// -
	// ウィンドウ用クラス
	// -
	function WindowManager(window_obj){
		var _this = this;

		// -
		// 開放
		// -
		_this.release = function(){
			_window_root = null;
			_window_self = null;
			_window_list = null;
		};

		// -
		// ルートウィンドウを取得
		// -
		_this.getWindowRoot = function(){
			return _window_root;
		};

		// -
		// ルートウィンドウが存在するか調べる
		// -
		_this.existWindowRoot = function(){
			return (_window_root != _window_self);
		};

		// -
		// ルートからの座標
		// -
		_this.getPositionFromRoot = function(){
			var x = 0.0;
			var y = 0.0;

			try{
				var element;
				var style;
				var size;
				var rect;
				var i;
				var num = _window_list.length;
				for(i=0;i<num;i++){
					element = _window_list[i].frameElement;
					if(!element) break;
					style = ElementGetComputedStyle(element,"");
					size = ComputedStyleGetSize(style);
					rect = ElementGetBoundingClientRect(element);
					x += rect.left + size.paddingLeft + size.borderLeft;
					y += rect.top  + size.paddingTop  + size.borderTop;
				}
			}catch(e){
			}

			return {x:x,y:y};
		};

		// -
		// プライベート変数
		// -
		var _window_root;
		var _window_self;
		var _window_list;


		// -
		// 初期化
		// -
		(function(){
			_window_self = window_obj;
			_window_list = new Array();

			try{
				var top = window_obj.top;
				while(window_obj != top){
					var parent = window_obj.parent;
					if(parent.location.href){}
					if(parent.document.URL){}
					_window_list.push(window_obj);
					window_obj = parent;
				}
			}catch(e){
			}
			_window_root = window_obj;
		})();
	}

	// -
	// ウィンドウのスクロール位置を取得する関数
	// -
	function WindowGetScrollPosition(window_obj){
		if(window_obj.pageXOffset === undefined){
		}else if(window_obj.pageYOffset === undefined){
		}else{
			return {
				x:window_obj.pageXOffset,
				y:window_obj.pageYOffset
			};
		}

		var d = window_obj.document;
		return {
			x:(d.documentElement.scrollLeft || d.body.scrollLeft),
			y:(d.documentElement.scrollTop  || d.body.scrollTop )
		};
	}

	// -
	// ウィンドウのスクロール位置をセットする関数
	// -
	function WindowSetScrollPosition(window_obj,pos){
		WindowSetScrollPositionX(window_obj,pos.x);
		WindowSetScrollPositionY(window_obj,pos.y);
	}

	// -
	// ウィンドウの水平方向スクロール座標を変更する関数
	// -
	function WindowSetScrollPositionX (window_obj,x){
		var document_obj = window_obj.document;
		if(document_obj.body){
			document_obj.body.scrollLeft = x;
		}
		if(document_obj.documentElement){
			document_obj.documentElement.scrollLeft = x;
		}
	}

	// -
	// ウィンドウの垂直方向スクロール座標を変更する関数
	// -
	function WindowSetScrollPositionY (window_obj,y){
		var document_obj = window_obj.document;
		if(document_obj.body){
			document_obj.body.scrollTop = y;
		}
		if(document_obj.documentElement){
			document_obj.documentElement.scrollTop = y;
		}
	}

	// -
	// ウィンドウから、アクセス可能なルートウィンドウを取得
	// -
	function WindowGetRoot(window_obj){
		try{
			var top = window_obj.top;
			while(window_obj != top){
				var parent = window_obj.parent;
				if(parent.location.href){}
				if(parent.document.URL){}
				window_obj = parent;
			}
		}catch(e){
		}
		return window_obj;
	}

	// -
	// ウィンドウが子であるか取得
	// -
	function WindowIsChild(window_obj){
		return (window_obj.top != window_obj.self);
	}

	// -
	// 所有者となる Window の URL を取得
	// -
	function WindowGetOwnerURL(window_obj){
		var url = "";
		var re = new RegExp("^(blob|data|about):","i");
		try{
			url = window_obj.document.URL;
			var top = window_obj.top;
			while(window_obj != top) {
				if(!url.match(re)) break;
				window_obj = window_obj.parent;
				if(window_obj.location.href){}
				url = window_obj.document.URL;
			}
		}catch(e){
		}

		return url;
	}

	// -
	// HEAD 要素を取得
	// -
	function DocumentGetHeadElement(document_obj){
		if(document_obj.head){
			return document_obj.head;
		}

		var nodes = document_obj.documentElement.childNodes;
		var i;
		var num = nodes.length;
		for(i=0;i<num;i++){
			if(nodes[i].tagName == "HEAD"){
				return nodes[i];
			}
		}

		return null;
	}

	// -
	// クライアント領域のサイズを取得
	// -
	function DocumentGetClientSize(document_obj){
		var b = document_obj.body;
		var r = document_obj.documentElement;
		var w = b.clientWidth;
		var h;
		if(w < r.clientWidth)	w = r.clientWidth;
		if(document_obj.compatMode == "BackCompat"){
			h = b.clientHeight;
		}else{
			if(r.clientHeight){
				h = r.clientHeight;
			}else{
				h = b.clientHeight;
			}
		}
		return {
			width :w,
			height:h
		};
	}

	// -
	// スクロール座標を取得(削除予定)
	// -
	function DocumentGetScrollPos(){
		return{
			x:document.body.scrollLeft || document.documentElement.scrollLeft,
			y:document.body.scrollTop  || document.documentElement.scrollTop
		};
	}

	// -
	// ドキュメント(HTML 全体)のサイズを取得する関数
	// -
	function DocumentGetDocumentSize(document_obj){
		var e;
		var w = 0;
		var h = 0;

		e = document_obj.body;
		if(e){
			if(w < e.clientWidth)	w = e.clientWidth;
			if(w < e.scrollWidth)	w = e.scrollWidth;
			if(h < e.clientHeight)	h = e.clientHeight;
			if(h < e.scrollHeight)	h = e.scrollHeight;
		}
		e = document_obj.documentElement;
		if(e){
			if(w < e.clientWidth)	w = e.clientWidth;
			if(w < e.scrollWidth)	w = e.scrollWidth;
			if(h < e.clientHeight)	h = e.clientHeight;
			if(h < e.scrollHeight)	h = e.scrollHeight;
		}

		return {
			width :w,
			height:h
		};
	}

	// -
	// DOM オブジェクトの構築が完了したか調べる関数
	// -
	function DocumentGetLoadedDomContent(document_obj,callback){

		function DOMContentLoadedFunc(e){
			document_obj.removeEventListener("DOMContentLoaded" , DOMContentLoadedFunc);
			callback();
		}

		function ReadyStateChangeFunc(e){
			switch(document_obj.readyState){
			case "interactive":
			case "complete":
				document_obj.detachEvent("onreadystatechange" , ReadyStateChangeFunc);
				callback();
			}
		}

		switch(document_obj.readyState){
		case "interactive":
		case "complete":
			callback();
			return;
		}

		if(document_obj.addEventListener){
			document_obj.addEventListener("DOMContentLoaded" , DOMContentLoadedFunc);
		}else if(document_obj.attachEvent){
			document_obj.attachEvent("onreadystatechange" , ReadyStateChangeFunc);
		}
	}


	// -
	// ブラウザの拡大縮小率を取得
	// -
	function WindowGetDevicePixelRatio(window_obj){
		if(window_obj.devicePixelRatio === undefined) return 1.0;
		return window_obj.devicePixelRatio;
	}


	// -
	// エレメント作成
	// -
	function DocumentCreateElement(type){
		var element = document.createElement(type);
//		if(element.wrappedJSObject)	return element.wrappedJSObject;
		return element;
	}

	// -
	// テキスト作成
	// -
	function DocumentCreateText(value){
		var element = document.createTextNode(value);
//		if(element.wrappedJSObject)	return element.wrappedJSObject;
		return element;
	}

	// -
	// クエリーを取得
	// -
	function DocumentGetQuery(){
		return StringGetQuery(document.URL);
	}

	// -
	// プロパティの更新監視
	// -
	function DocumentObserverModifyProperty (){
		var _this = this;

		// -
		// 開放
		// -
		_this.release = function(){
			while(_list != _list.next){
				_list.next.release();
			}
		};

		// -
		// 要素生成
		// -
		_this.createElement = function(){
			var _element = new Object();

			// -
			// コールバック関数をセット
			// -
			_element.setFunction = function(f){
				_element.callback = f;
			};

			// -
			// 基本値を設定
			// -
			_element.setBaseValue = function(value){
				_element.base = value;
			};

			// -
			// 要素をセット
			// -
			_element.setElement = function(element,key){
				_element.element = element;
				_element.key = key;
				_element.base = element[_element.key];

				if(MutationObserverSupported()){
					_mutation_observer = MutationObserverCreate(function(mutations) {
						var i;
						var num = mutations.length;
						for(i=0;i<num;i++){
							var target = mutations[i].target;
							if(_element.base != target[_element.key]){
								_element.base = target[_element.key];
								_element.callback();
								return;
							}
						}
					});
					_mutation_observer.observe(element,{attributes:true,attributeFilter:[key]});
				}
			};

			// -
			// 開放
			// -
			_element.release = function(){
				if(_list == _element){
					_list = _element.next;
				}
				var next = _element.next;
				var prev = _element.prev;
				prev.next = next;
				next.prev = prev;
				_element.prev = _element;
				_element.next = _element;
				_count --;

				if(_mutation_observer){
					_mutation_observer.disconnect();
					_mutation_observer = null;
				}
			};

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

			// -
			// 初期化
			// -
			(function(){
				_element.callback = null;
				_element.element = null;
				_element.key = null;
				_element.base = null;

				var next = _list;
				var prev = next.prev;
				prev.next = _element;
				next.prev = _element;
				_element.prev = prev;
				_element.next = next;
				_count++;
			})();

			return _element;
		};

		// -
		// 実行
		// -
		_this.execute = function(){
			var i = 0;
			var num = 5;
			var start = _list;
			do{
				if(_list.element){
					if(_list.base != _list.element[_list.key]){
						_list.base = _list.element[_list.key];
						_list.callback();
					}
				}
				_list = _list.next;
				i ++;
				if(num <= i)	break;
			}while(start != _list);
		};

		// -
		// 要素数を取得
		// -
		_this.getCount = function(){
			return _count;
		};

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

		// -
		// 初期化
		// -
		(function(){
			_list = new Object();
			_list.prev = _list;
			_list.next = _list;

			_count = 0;
		})();
	}

	// -
	// DOMノードが外れたか監視
	// -
	function DocumentObserverRemoveDomNode(){
		var _this = this;

		// -
		// 開放
		// -
		_this.release = function(){
			if(_mutation_observer){
				for(var id in _list){
					var list = _list[id];
					while(list != list._next){
						list._next.release();
					}
				}
				_mutation_observer.disconnect();
				_mutation_observer = null;
				_map_id = null;
			}else{
				while(_list != _list._next){
					_list._next.release();
				}
			}
		};

		// -
		// 要素生成
		// -
		_this.createElement = function(){
			var _element = new Object();

			// -
			// コールバック関数をセット
			// -
			_element.setFunction = function(f){
				_element.callback = f;
			};

			// -
			// 要素をセット
			// -
			_element.setDomNode = function(node){
				_element.node = node;

				if(_mutation_observer){
					if(_map_id){
						_id = _map_id.get(node);
					}else{
						_id = node._pageexpand_remove;
					}
					if(!_id){
						if(_map_id){
							_id = _identity;
							_map_id.set(node,_id);
						}else{
							_id = node._pageexpand_remove = _identity;
						}
						_identity++;
					}

					if(!_list[_id]){
						var o = new Object();
						o._prev = o;
						o._next = o;
						_list[_id] = o;
					}

					var _prev = _list[_id];
					var _next = _prev._next;
					_prev._next = _element;
					_next._prev = _element;
					_element._prev = _prev;
					_element._next = _next;
				}
			};

			// -
			// 開放
			// -
			_element.release = function(){
				if(_mutation_observer){
					var _prev = _element._prev;
					var _next = _element._next;
					_prev._next = _next;
					_next._prev = _prev;
					_element._prev = _element;
					_element._next = _element;

					if(_list[_id] == _list[_id]._next){
						ObjectDeleteProperty(_list,_id);
						if(_map_id){
							_map_id.delete(_element.node);
						}
					}

				}else{
					if(_list_end == _element){
						_list_end = _element._prev;
					}
					if(_list_pos == _element){
						_list_pos = _element._prev;
					}

					var _prev = _element._prev;
					var _next = _element._next;
					_prev._next = _next;
					_next._prev = _prev;
					_element._prev = _element;
					_element._next = _element;
				}

				_count -= 1;
				_element.node = null;
			};

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

			// -
			// 初期化
			// -
			(function(){
				if(_mutation_observer){
					_element._prev = _element;
					_element._next = _element;
				}else{
					var _next = _list_pos;
					var _prev = _next._prev;
					_element._prev = _prev;
					_element._next = _next;
					_next._prev = _element;
					_prev._next = _element;

					_list_end = _element;
				}

				_element.callback = null;
				_element.node = null;

				_count += 1;
			})();

			return _element;
		};

		// -
		// 要素数を取得
		// -
		_this.getCount = function(){
			return _count;
		};

		// -
		// 実行
		// -
		_this.execute = function(){
			_list_end = _list_pos;
			var num = 5;
			var i;
			for(i=0;i<num;i++){
				if(_list_pos.node){
					if(!(DomNodeGetAttachedDocument(_list_pos.node))){
						_list_pos.callback();
					}
				}
				_list_pos = _list_pos._next;
				if(_list_pos == _list_end){
					return;
				}
			}
		};

		// -
		// 検出
		// -
		function detect(node){
			var w;
			var o;
			var p;
			var n;
			var i = 0;
			var c = 0;
			var m = 100;
			var q = new Object();
			var nodes = node.childNodes;
			q.p = q;
			q.n = q;

			// 中断
			function interrupt(){
				c = 0;
				execute_queue.attachFirstForRemoveDomNode(analyze,null);
			}

			// 子孫抽出
			function analyze(){
				while(node){
					if(nodes){
						while(nodes[i]){
							o = {node:nodes[i]};
							n = q;
							p = n.p;
							o.p = p;
							o.n = n;
							p.n = o;
							n.p = o;
							i++;
							c++;
							if(c > m){
								interrupt();
								return;
							}
						}
					}

					var id;
					if(_map_id){
						id = _map_id.get(node);
					}else{
						id = node._pageexpand_remove;
					}
					if(id){
						if(!(DomNodeGetAttachedDocument(node))){
							var ary = new Array();
							var dict = _list[id];
							var list = dict._next;
							while(list != dict){
								ary.push(list);
								list = list._next;
							}

							var j;
							var num = ary.length;
							for(j=0;j<num;j++){
								ary[j].callback();
							}
						}
					}

					o = q.n;
					p = o.p;
					n = o.n;
					p.n = n;
					n.p = p;
					node = o.node;
					if(node){
						i = 0;
						nodes = node.childNodes;
					}

					c++;
					if(c > m){
						interrupt();
						return;
					}
				}
			}

			analyze();
		}

		// -
		// プライベート変数
		// -
		var _mutation_observer;
		var _task;
		var _list;
		var _list_pos;
		var _list_end;
		var _map_id;
		var _count;
		var _identity;

		// -
		// 初期化
		// -
		(function(){
			_count = 0;

			if(MutationObserverSupported()){
				_list = new Array();
				if(window.WeakMap){
					_map_id = new WeakMap();
				}
				_identity = 1;
				_mutation_observer = MutationObserverCreate(function(mutations) {
					var i;
					var num = mutations.length;
					for(i=0;i<num;i++){
						var nodes = mutations[i].removedNodes;
						var j;
						var node_num = nodes.length;
						for(j=0;j<node_num;j++){
							execute_queue.attachLastForRemoveDomNode(detect,nodes[j]);
						}
					}
				});
				_mutation_observer.observe(document.documentElement,{childList:true,subtree:true});
			}

			if(!_mutation_observer){
				_list = new Object();
				_list._prev = _list;
				_list._next = _list;
				_list_pos = _list;
				_list_end = _list;
			}
		})();
	}

	// -
	// スクロール監視
	// -
	function DocumentObserverScroll(){
		var _this = this;

		// -
		// 開放
		// -
		_this.release = function(){
			removeEvent();

			while(_list != _list._next){
				_list._next.release();
			}

			if(_timer){
				_timer.release();
				_timer = null;
			}
			if(_task){
				_task.release();
			}
		};

		// -
		// 要素生成
		// -
		_this.createElement = function(){
			var _element = new Object();

			// -
			// コールバック関数をセット
			// -
			_element.setFunction = function(f){
				_element.callback = f;
			};

			// -
			// 開放
			// -
			_element.release = function(){
				if(_list_end == _element){
					_list_end = _element._prev;
				}
				if(_list_pos == _element){
					_list_pos = _element._prev;
				}

				var _prev = _element._prev;
				var _next = _element._next;
				_prev._next = _next;
				_next._prev = _prev;
				_element._prev = _element;
				_element._next = _element;

				_count -= 1;
				if(!_count){
					removeEvent();
				}
			};

			// -
			// 初期化
			// -
			(function(){
				var _next = _list_pos;
				var _prev = _next._prev;
				_element._prev = _prev;
				_element._next = _next;
				_next._prev = _element;
				_prev._next = _element;

				_list_end = _element;

				_element.callback = null;

				if(!_count){
					addEvent();

					if(_timer){
						_timer.release();
						_timer = null;
					}
					_timer = new Timer(1,1);
					_timer.oncomplete = function(){
						detect();
					};
					_timer.start();
				}
				_count += 1;
			})();

			return _element;
		};

		// -
		// 要素数を取得
		// -
		_this.getCount = function(){
			return _count;
		};

		// -
		// 検出
		// -
		function detect(){
			if(_task){
				_list_end = _list_pos;
			}else{
				_task = task_container.createTask();
				_task.setDestructorFunc(function(){
					_task = null;
				});
				_task.setExecuteFunc(function(){
					var num = 10;
					var i;
					for(i=0;i<num;i++){
						if(_list_pos.callback){
							_list_pos.callback();
						}

						_list_pos = _list_pos._next;

						if(_list_pos == _list_end){
							_task.release();
							return;
						}
					}
				});

				_list_end = _list_pos = _list;

				_task.execute(0xffffffff);
			}
		}

		// -
		// イベントを追加(内部用)
		// -
		function addEvent(){
			if(window.addEventListener){
				window.addEventListener("scroll",detect,true);
			}else if(window.attachEvent){
				window.attachEvent("onscroll",detect);
			}
		}

		// -
		// イベントを外す(内部用)
		// -
		function removeEvent(){
			if(window.removeEventListener){
				window.removeEventListener("scroll",detect,true);
			}else if(window.attachEvent){
				window.detachEvent("onscroll",detect);
			}
		}

		// -
		// プライベート変数
		// -
		var _task;
		var _timer;
		var _list;
		var _list_pos;
		var _list_end;
		var _count;

		// -
		// 初期化
		// -
		(function(){
			_count = 0;
			_list = new Object();
			_list._prev = _list;
			_list._next = _list;
			_list_pos = _list;
			_list_end = _list;
		})();
	}

	// -
	// キュー辞書
	// -
	function QueueDictionary(){
		var _this = this;

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

		// -
		// 要素生成
		// -
		_this.createElement = function(key){
			var _element = new Object();

			// -
			// データをセット
			// -
			_element.setData = function(data){
				_element.data = data;
			};

			// -
			// データを取得
			// -
			_element.getData = function(){
				return _element.data;
			};

			// -
			// 開放
			// -
			_element.release = function(){
				var owner = _element.owner;
				if(!owner) return;

				_element.owner = null;
				var _prev = _element._prev;
				var _next = _element._next;
				_prev._next = _next;
				_next._prev = _prev;
				owner.count -= 1;
				if(!owner.count){
					delete _dic[owner.key];
				}
				_count -= 1;
			};

			// -
			// 初期化
			// -
			(function(){
				var owner = _dic[key];
				if(!owner){
					owner = {
						key:key,
						count:0
					};
					owner._prev = owner;
					owner._next = owner;
					_dic[key] = owner;
				}

				var _next = owner;
				var _prev = _next._prev
				_prev._next = _element;
				_next._prev = _element;
				_element._prev = _prev;
				_element._next = _next;
				_element.owner = owner;
				owner.count += 1;
				
				_count += 1;
			})();

			return _element;
		};

		// -
		// 
		// -
		_this.get = function(key){
			var obj = _dic[key];
			if(!obj) return null;
			return obj._next;
		};

		// -
		// 登録数を取得
		// -
		_this.getCount = function(){
			return _count;
		};

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

		// -
		// 初期化
		// -
		(function(){
			_count = 0;
			_dic = new Object();
		})();
	}

	// -
	// エレメントからタグ名を指定してエレメントを取得
	// -
	function ElementGetElementsByTagName(node,type){
		if(node.getElementsByTagName){
			return node.getElementsByTagName(type);
		}else if(node.querySelectorAll){
			return node.querySelectorAll(type);
		}else{
			type = type.toUpperCase();
			var ary = new Array();
			var p;
			var n;
			var q;
			var queue = new Object();
			q = {p:queue,n:queue,node:node};
			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;
					}
					if(node.tagName == type || type == '*'){
						ary.push(node);
					}
					break;
				}
			}
			return ary;
		}
	}

	// -
	// エレメントから名前を指定してエレメントを取得する
	// -
	function ElementGetElementsByName(node,name){
		var nodes = new Array();
		var p;
		var n;
		var q;
		var queue = new Object();
		q = {p:queue,n:queue,node:node};
		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;
				}
				if(node.getAttribute("name") == name){
					nodes.push(node);
				}
				break;
			}
		}
		return nodes;
	}

	// -
	// エレメントからクラス名を指定してエレメントを取得する
	// -
	function ElementGetElementsByClassName(node,class_name){
		if(node.getElementsByClassName){
			return node.getElementsByClassName(class_name);
		}

		var node_list = new Array();
		if(!class_name) return node_list;

		var re = new RegExp("[ \t\r\n]*([^ \t\r\n]+)[ \t\r\n]*","g");

		var class_list = new Object();
		class_name.replace(re,function (m,k){ class_list[k] = true; });

		var f = function (node){
			if(node.nodeType != 1) return;

			var a = new Object();
			(node.className.baseVal === undefined ? node.className:node.className.baseVal).replace(re,function (m,k){ a[k] = true; });

			var m;
			for (var k in class_list){
				m = a[k];
				if(!m) break;
			}
			if(m) node_list.push(node);

			var nodes = node.childNodes;
			var i;
			var num = nodes.length;
			for(i=0;i < num;i++){
				f(nodes[i]);
			}
		}

		if(node.documentElement){
			node = node.documentElement;
		}

		var nodes = node.childNodes;
		var i;
		var num = nodes.length;
		for(i=0;i < num;i++){
			f(nodes[i]);
		}

		return node_list;
	}

	// -
	// エレメントのクラス名を取得
	// -
	function ElementGetClassName(element){
		if(element.className.baseVal !== undefined){
			return element.className.baseVal;
		}
		return element.className;
	}

	// -
	// エレメントのスタイルシートを取得
	// -
	function ElementGetStyle(element){
		return element.style.cssText;
	}

	// -
	// エレメントにスタイルを追加
	// -
	function ElementAddStyle(element,style){
		element.style.cssText += style;
	}

	// -
	// エレメントにスタイルをセット
	// -
	function ElementSetStyle(element,style){
		element.style.cssText = style;
	}

	// -
	// エレメントの幅を取得
	// -
	function ElementGetClientWidth(element){
		var w;
		while(element){
			w = element.clientWidth;
			if(w)	break;
			element = element.parentNode;
		}
		if(!element)	return 0;
		return w;
	}

	// -
	// エレメントのクライアント領域のバウンディング矩形を取得
	// -
	function ElementGetBoundingClientRect(element){
		if(!(element.getBoundingClientRect))	return null;
		var r = element.getBoundingClientRect();
		var o = {
			left:r.left,
			right:r.right,
			top:r.top,
			bottom:r.bottom
		};

		if(UserAgentGetInternetExplorer() || UserAgentGetSleipnir()){
			var sx = 2;
			var sy = 2;
			o.left   -= sx;
			o.right  -= sx;
			o.top    -= sy;
			o.bottom -= sy;
		}

		return o;
	}

	// -
	// エレメントのクライアント領域のコンテンツ矩形を取得
	// -
	var ElementGetContentClientRect = (function(){
		var re = new RegExp("^([-0-9.]+)px$","i");
		var list = [
			{style:"paddingLeft"   ,key:"left"   ,sign: 1},
			{style:"paddingRight"  ,key:"right"  ,sign:-1},
			{style:"paddingTop"    ,key:"top"    ,sign: 1},
			{style:"paddingBottom" ,key:"bottom" ,sign:-1},
			{style:"borderLeftWidth"   ,key:"left"   ,sign: 1},
			{style:"borderRightWidth"  ,key:"right"  ,sign:-1},
			{style:"borderTopWidth"    ,key:"top"    ,sign: 1},
			{style:"borderBottomWidth" ,key:"bottom" ,sign:-1}
		];

		return function (element){
			var rect = ElementGetBoundingClientRect(element);
			var style = ElementGetComputedStyle(element,null);
			if(style){
				var i;
				var num = list.length;
				for(i=0;i<num;i++){
					var param = list[i];
					if(style[param.style]){
						var m = style[param.style].match(re);
						if(m){
							rect[param.key] += parseFloat(m[0]) * param.sign;
						}
					}
				}
			}
			return rect;
		};
	})();

	// -
	// エレメントのクライアント領域の可視矩形を取得
	// -
	function ElementGetViewClientRect(element){
		var rect = ElementGetBoundingClientRect(element);
		var overflow_hidden_x = {"hidden":1};
		var overflow_hidden_y = {"hidden":1};
		var display_inline = {"inline":1,"none":1,"table-column":1,"table-column-group":1};

		while(element){
			var r = ElementGetBoundingClientRect(element);
			if(!r) break;

			if(element.tagName == "BODY") break;

			var style = ElementGetComputedStyle(element,null);
			if(style){
				if(!display_inline[style.display]){
					if(overflow_hidden_x[style.overflowX]){
						if(r.right  < rect.right ) rect.right  = r.right;
						if(r.left   > rect.left  ) rect.left   = r.left;
					}
					if(overflow_hidden_y[style.overflowY]){
						if(r.bottom < rect.bottom) rect.bottom = r.bottom;
						if(r.top    > rect.top   ) rect.top    = r.top;
					}
				}
			}

			element = element.parentNode;
		}
		return rect;
	}

	// -
	// エレメントとクライアント座標との当たり判定を取得
	// -
	function ElementClientRectsTree(element){
		var _this = this;

		// -
		// 座標との当たり判定
		// -
		_this.hitTestPosition = function(pos,child_type){
			var node = _this.parentNode;
			while(node){
				var r = node.boundingClientRect;
				if(!r) break;

				if(r.bottom + 1 < pos.y) return false;
				if(r.top    - 1 > pos.y) return false;
				if(r.right  + 1 < pos.x) return false;
				if(r.left   - 1 > pos.x) return false;

				node = node.parentNode;
			}

			var queue = new Array();
			queue.push(_this);
			while(true){
				var node = queue.pop();
				if(!node)	break;

				// 子ノード
				var child_nodes = node.childNodes;
				var i;
				var num = child_nodes.length;
				for(i=0;i < num;i++){
					queue.push(child_nodes[i]);
				}

				var ary = node.clientRects;
				var i;
				var num = ary.length;
				for(i=0;i<num;i++){
					var r = ary[i];
					if(r.bottom + 5 < pos.y){
					}else if(r.top - 5 > pos.y){
					}else if(r.right + 2 < pos.x){
					}else if(r.left - 2 > pos.x){
					}else{
						return true;
					}
				}

				if(!child_type)	return false;
			}

			return false;
		};

		// -
		// 初期化
		// -
		(function(){
			var overflow_hidden = {"scroll":1,"hidden":1,"auto":1};
			var display_inline = {"inline":1,"none":1,"table-column":1,"table-column-group":1};
			var position_offset_parent = {"relative":1,"absolute":1,"fixed":1,"sticky":1};
			var absoluted = false;

			var node_obj = _this;
			var node = element;
			while(node){
				var r = ElementGetBoundingClientRect(node);
				if(!r) break;

				if(node.tagName == "BODY") break;

				var style = ElementGetComputedStyle(node,null);
				if(style){
					if(style.position == "fixed") break;

					if(absoluted){
						absoluted = !Boolean(position_offset_parent[style.position]);
					}else{
						absoluted = Boolean(style.position == "absolute");
					}

					if(!absoluted){
						if(!display_inline[style.display]){
							if(overflow_hidden[style.overflow]){
								node_obj.parentNode = {
									boundingClientRect:r
								};
								node_obj = node_obj.parentNode;
							}
						}
					}
				}

				node = node.parentNode;
			}

			_this.childNodes = new Array();
			_this.clientRects = new Array();
			var queue = new Array();
			queue.push({node:element,node_obj:_this});
			while(true){
				var param = queue.pop();
				if(!param)	break;
				var node_obj = param.node_obj;
				var node = param.node;

				var check = true;
				var style = null;
				if(node.nodeType == 1){
					style = ElementGetComputedStyle(node,null);
				}
				if(style){
					if(!display_inline[style.display]){
						if(overflow_hidden[style.overflow]){
							check = false;
						}
					}
				}
				if(check){
					// 子ノード
					var child_nodes = node.childNodes;
					var i;
					var num = child_nodes.length;
					for(i=0;i < num;i++){
						var o = {
							childNodes:new Array(),
							clientRects:new Array()
						};
						queue.push({
							node:child_nodes[i],
							node_obj:o
						});
						node_obj.childNodes.push(o);
					}
				}

				if(node.getClientRects){
					var ary = node.getClientRects();
					var i;
					var num = ary.length;
					for(i=0;i<num;i++){
						node_obj.clientRects.push(ary[i]);
					}
				}
			}
		})();
	}

	// -
	// エレメントとクライアント座標との当たり判定を取得
	// -
	function ElementHitTestPosition(element,pos,child_type){
		if(!element) return false;

		var overflow_hidden = {"scroll":1,"hidden":1,"auto":1};
		var display_inline = {"inline":1,"none":1,"table-column":1,"table-column-group":1};
		var position_offset_parent = {"relative":1,"absolute":1,"fixed":1,"sticky":1};
		var absoluted = false;

		var node = element;
		while(node){
			var r = ElementGetBoundingClientRect(node);
			if(!r) break;

			if(node.tagName == "BODY") break;

			var style = ElementGetComputedStyle(node,null);
			if(style){
				if(style.position == "fixed") break;

				if(absoluted){
					absoluted = !Boolean(position_offset_parent[style.position]);
				}else{
					absoluted = Boolean(style.position == "absolute");
				}

				if(!absoluted){
					if(!display_inline[style.display]){
						if(overflow_hidden[style.overflow]){
							if(r.bottom + 1 < pos.y) return false;
							if(r.top    - 1 > pos.y) return false;
							if(r.right  + 1 < pos.x) return false;
							if(r.left   - 1 > pos.x) return false;
						}
					}
				}
			}

			node = node.parentNode;
		}

		var queue = new Array();
		queue.push(element);
		while(true){
			element = queue.pop();
			if(!element)	break;

			var check = true;
			var style = null;
			if(element.nodeType == 1){
				style = ElementGetComputedStyle(element,null);
			}
			if(style){
				if(!display_inline[style.display]){
					if(overflow_hidden[style.overflow]){
						check = false;
					}
				}
			}
			if(check){
				// 子ノード
				var child_nodes = element.childNodes;
				var i;
				var num = child_nodes.length;
				for(i=0;i < num;i++){
					queue.push(child_nodes[i]);
				}
			}

			if(element.getClientRects){
				var ary = element.getClientRects();
				var i;
				var num = ary.length;
				for(i=0;i<num;i++){
					var r = ary[i];
					if(r.bottom + 5 < pos.y){
					}else if(r.top - 5 > pos.y){
					}else if(r.right + 2 < pos.x){
					}else if(r.left - 2 > pos.x){
					}else{
						return true;
					}
				}
			}

			if(!child_type)	return false;
		}

		return false;
	}

	// -
	// エレメントとマウスクライアント座標との当たり判定を取得
	// -
	function ElementHitTestMousePosition(element,pos,child_type){
		var element_hit = document.elementFromPoint(pos.x,pos.y);
		if(child_type){
			while(element_hit){
				if(element_hit == element){
					return true;
				}
				element_hit = element_hit.parentNode;
			}
			return false;
		}
		return (element_hit == element);
	}

	// -
	// エレメントが見えているか調べる
	// -
	function ElementGetVisibility(element){
		var visibility_visible = {"visible":1};
		var display_none = {"none":1};
		while(element){
			var style = ElementGetComputedStyle(element,null);
			if(style){
				if(!(visibility_visible[style.visibility])){
					return false;
				}
				if(display_none[style.display]){
					return false;
				}
			}
			element = element.parentNode;
		}
		return true;
	}

	// -
	// 最終的に適用されているスタイルを取得
	// -
	function ElementGetComputedStyle(element,pseudo_element){
		try{
			var document_obj = element.ownerDocument;
			if(document_obj){
				var window_obj = document_obj.defaultView;
				if(window_obj){
					if(window_obj.getComputedStyle !== undefined){
						return window_obj.getComputedStyle(element,pseudo_element);
					}
				}
			}
			if(element.currentStyle !== undefined){
				return element.currentStyle;
			}
		}catch(e){
		}
		return null;
	}

	// -
	// スタイルから各サイズ情報を取得する
	// -
	var ComputedStyleGetSize = (function(){
		var re = new RegExp("([-0-9.]+)px","i");
		var list = [
			{ i:"width"  , o:"width"  },
			{ i:"height" , o:"height" },
			{ i:"paddingLeft"   , o:"paddingLeft"   },
			{ i:"paddingTop"    , o:"paddingTop"    },
			{ i:"paddingRight"  , o:"paddingRight"  },
			{ i:"paddingBottom" , o:"paddingBottom" },
			{ i:"borderLeftWidth"   , o:"borderLeft"   },
			{ i:"borderTopWidth"    , o:"borderTop"    },
			{ i:"borderRightWidth"  , o:"borderRight"  },
			{ i:"borderBottomWidth" , o:"borderBottom" },
			{ i:"marginLeft"   , o:"marginLeft"   },
			{ i:"marginTop"    , o:"marginTop"    },
			{ i:"marginRight"  , o:"marginRight"  },
			{ i:"marginBottom" , o:"marginBottom" }
		];

		return function (style){
			var i;
			var num = list.length;
			var obj = new Object();
			for(i=0;i < num;i++){
				var p = list[i];
				var m = style[p.i].match(re);
				if(m){
					obj[p.o] = parseFloat(m[1]);
				}else{
					obj[p.o] = 0;
				}
			}
			obj.clientWidth  = obj.width  + obj.paddingLeft + obj.paddingRight;
			obj.clientHeight = obj.height + obj.paddingTop + obj.paddingBottom;
			obj.offsetWidth  = obj.clientWidth  + obj.borderLeft + obj.borderRight;
			obj.offsetHeight = obj.clientHeight + obj.borderTop + obj.borderBottom;
			return obj;
		};
	})();

	// -
	// スタイルからパディングサイズを取得
	// -
	function ComputedStyleGetPaddingWidth(style){
		var re = new RegExp("([-0-9.]+)px","i");
		var list = [
			{ i:"paddingLeft"   , o:"left"   },
			{ i:"paddingTop"    , o:"top"    },
			{ i:"paddingRight"  , o:"right"  },
			{ i:"paddingBottom" , o:"bottom" }
		];
		var i;
		var num = list.length;
		var obj = new Object();
		for(i=0;i < num;i++){
			var p = list[i];
			var m = style[p.i].match(re);
			if(m){
				obj[p.o] = parseFloat(m[1]);
			}else{
				obj[p.o] = 0;
			}
		}
		return obj;
	}

	// -
	// スタイルからボーダーサイズを取得
	// -
	var ComputedStyleGetBoaderWidth = (function(){
		var re = new RegExp("([-0-9.]+)px","i");
		var list = [
			{ i:"borderLeftWidth"   , o:"left"   },
			{ i:"borderRightWidth"  , o:"top"    },
			{ i:"borderTopWidth"    , o:"right"  },
			{ i:"borderBottomWidth" , o:"bottom" }
		];

		return function (style){
			var i;
			var num = list.length;
			var obj = new Object();
			for(i=0;i < num;i++){
				var p = list[i];
				var m = style[p.i].match(re);
				if(m){
					obj[p.o] = parseFloat(m[1]);
				}else{
					obj[p.o] = 0;
				}
			}
			return obj;
		};
	})();

	// -
	// スタイルの transform を設定
	// -
	function StyleDeclarationSetTransform(style,value){
		var list = [
			"transform",
			"webkitTransform",
			"MozTransform",
			"msTransform",
			"OTransform"
		];
		var i;
		var num = list.length;
		for(i=0;i<num;i++){
			if(style[list[i]] !== undefined){
				style[list[i]] = value;
				return true;
			}
		}
		return false;
	}

	// -
	// スタイルの transform-origin を設定
	// -
	function StyleDeclarationSetTransformOrigin(style,value){
		var list = [
			"transformOrigin",
			"webkitTransformOrigin",
			"MozTransformOrigin",
			"msTransformOrigin",
			"OTransformOrigin"
		];
		var i;
		var num = list.length;
		for(i=0;i<num;i++){
			if(style[list[i]] !== undefined){
				style[list[i]] = value;
				return true;
			}
		}
		return false;
	}

	// -
	// 2D用の行列を計算するクラス
	// -
	function Matrix32 (a,b,c,d,tx,ty) {
		this.a  = ((a  === undefined) ? 1.0 : a );
		this.b  = ((b  === undefined) ? 0.0 : b );
		this.c  = ((c  === undefined) ? 0.0 : c );
		this.d  = ((d  === undefined) ? 1.0 : d );
		this.tx = ((tx === undefined) ? 0.0 : tx);
		this.ty = ((ty === undefined) ? 0.0 : ty);
	}
	Matrix32.prototype = {

		// -
		// 単位行列化
		// -
		identity:function(){
			this.a  = 1.0; this.b  = 0.0;
			this.c  = 0.0; this.d  = 1.0;
			this.tx = 0.0; this.ty = 0.0;
		},

		// -
		// 移動成分を乗算
		// -
		translate:function(tx,ty){
			this.tx += tx;
			this.ty += ty;
		},

		// -
		// 回転成分を乗算(ラジアン)
		// -
		rotate:function(angle){
			var cos = Math.cos(angle);
			var sin = Math.sin(angle);
			var a  = this.a;
			var c  = this.c;
			var tx = this.tx;
			this.a  = a  * cos + this.b  * -sin;
			this.b  = a  * sin + this.b  *  cos;
			this.c  = c  * cos + this.d  * -sin;
			this.d  = c  * sin + this.d  *  cos;
			this.tx = tx * cos + this.ty * -sin;
			this.ty = tx * sin + this.ty *  cos;
		},

		// -
		// 拡大縮小成分を乗算
		// -
		scale:function(sx,sy){
			this.a  = this.a  * sx;
			this.b  = this.b  * sy;
			this.c  = this.c  * sx;
			this.d  = this.d  * sy;
			this.tx = this.tx * sx;
			this.ty = this.ty * sy;
		},

		// -
		// 行列を乗算 (this * m)
		// -
		multiply:function(m){
			var a  = this.a;
			var c  = this.c;
			var tx = this.tx;
			this.a  = a  * m.a + this.b  * m.c;
			this.b  = a  * m.b + this.b  * m.d;
			this.c  = c  * m.a + this.d  * m.c;
			this.d  = c  * m.b + this.d  * m.d;
			this.tx = tx * m.a + this.ty * m.c + m.tx;
			this.ty = tx * m.b + this.ty * m.d + m.ty;
		},

		// -
		// 座標を変換
		// -
		transformPosition:function(pos){
			return {
				x:pos.x * this.a + pos.y * this.c + this.tx,
				y:pos.x * this.b + pos.y * this.d + this.ty
			};
		},

		// -
		// ベクトルを変換
		// -
		transformVector:function(vec){
			return {
				x:vec.x * this.a + vec.y * this.c,
				y:vec.x * this.b + vec.y * this.d
			};
		},

		// -
		// 逆行列化
		// -
		invert: function(){
			var a  = this.a;
			var b  = this.b;
			var c  = this.c;
			var d  = this.d;
			var tx = this.tx;
			var ty = this.ty;
			this.a  = 1.0; this.b  = 0.0;
			this.c  = 0.0; this.d  = 1.0;
			this.tx = 0.0; this.ty = 0.0;

			var b_  = b;
			var d_  = d;
			var ty_ = ty;

			if(a){
				this.a  /= a;
				     b_ /= a;
			}
			     d_  -= c  *      b_;
			this.c   -= c  * this.a;
			     ty_ -= tx *      b_;
			this.tx  -= tx * this.a;

			if(d_){
				this.c /= d_;
			}
			this.tx -= ty_ * this.c;
			this.a  -= b_  * this.c;

			if(a){
				this.b /= a;
				     b /= a;
			}
			     d  -= c  *      b;
			this.d  -= c  * this.b;
			     ty -= tx *      b;
			this.ty -= tx * this.b;

			if(d){
				this.d /= d;
			}
			this.ty -= ty * this.d;
			this.b  -= b  * this.d;
		},

		// -
		// 複製
		// -
		clone:function(){
			return new Matrix32(
				this.a,  this.b,
				this.c,  this.d,
				this.tx, this.ty
			);
		},

		// -
		// 文字列を取得
		// -
		toString:function(){
			return "matrix(" +
				this.a.toFixed(20)  + "," +
				this.b.toFixed(20)  + "," +
				this.c.toFixed(20)  + "," +
				this.d.toFixed(20)  + "," +
				this.tx.toFixed(20) + "," +
				this.ty.toFixed(20) + 
			")";
		}
	};

	// -
	// 自身から直前方向へと順番に調べ、最初に見つかる要素を取得する
	// -
	function DomNodeGetPreviousElementSibling(node){
		node = node.previousSibling;
		while(node){
			if(node.nodeType == 1) break;
			node = node.previousSibling;
		}
		return node;
	}

	// -
	// 自身から直後方向へと順番に調べ、最初に見つかる要素を取得する
	// -
	function DomNodeGetNextElementSibling(node){
		node = node.nextSibling;
		while(node){
			if(node.nodeType == 1) break;
			node = node.nextSibling;
		}
		return node;
	}

	// -
	// ノードリストの最先頭から順番に調べ、最初に見つかる要素を取得する
	// -
	function DomNodeGetFirstElementChild(node){
		var nodes = node.childNodes;
		var i;
		var num = nodes.length;
		for(i=0;i<num;i++){
			if(nodes[i].nodeType == 1) return nodes[i];
		}
		return null;
	}

	// -
	// ノードリストの最後尾から順番に調べ、最初に見つかる要素を取得する
	// -
	function DomNodeGetLastElementChild(node){
		var nodes = node.childNodes;
		var i;
		var num = nodes.length;
		for(i=num-1;i>=0;i--){
			if(nodes[i].nodeType == 1) return nodes[i];
		}
		return null;
	}

	// -
	// DOM ノードの直前に DOM ノードを登録(削除予定)
	// -
	function DomNodeInsertBefore(node_new,node_ref){
		var parent = node_ref.parentNode;
		if(!parent)	return false;

		var node =  parent.insertBefore(node_new,node_ref);
		return (node == node_new);
	}

	// -
	// DOM ノードの直後に DOM ノードを登録(削除予定)
	// -
	function DomNodeInsertAfter(node_new,node_ref){
		var parent = node_ref.parentNode;
		if(!parent)	return false;

		var node =  parent.insertBefore(node_new,node_ref.nextSibling);
		return (node == node_new);
	}

	// -
	// 子の最先頭に登録(削除予定)
	// -
	function DomNodeInsertFirstChild(node_new,node_ref){
		try{
			var child = node_ref.firstChild;
			var node =  node_ref.insertBefore(node_new,child);
			return (node == node_new);
		}catch(e){
			return false;
		}
	}

	// -
	// 子の最後尾に登録(削除予定)
	// -
	function DomNodeInsertLastChild(node_new,node_ref){
		try{
			var node =  node_ref.appendChild(node_new);
			return (node == node_new);
		}catch(e){
			return false;
		}
	}

	// -
	// DOM ノードの直前に DOM ノードを登録
	// -
	function DomNode_InsertBefore(node_ref,node_new){
		var parent = node_ref.parentNode;
		if(!parent)	return false;

		var node =  parent.insertBefore(node_new,node_ref);
		return (node == node_new);
	}

	// -
	// DOM ノードの直後に DOM ノードを登録
	// -
	function DomNode_InsertAfter(node_ref,node_new){
		var parent = node_ref.parentNode;
		if(!parent)	return false;

		var node =  parent.insertBefore(node_new,node_ref.nextSibling);
		return (node == node_new);
	}

	// -
	// 子の最先頭に登録
	// -
	function DomNode_InsertFirstChild(node_ref,node_new){
		try{
			var child = node_ref.firstChild;
			var node =  node_ref.insertBefore(node_new,child);
			return (node == node_new);
		}catch(e){
			return false;
		}
	}

	// -
	// 子の最後尾に登録
	// -
	function DomNode_InsertLastChild(node_ref,node_new){
		try{
			var node =  node_ref.appendChild(node_new);
			return (node == node_new);
		}catch(e){
			return false;
		}
	}

	// -
	// DOM ノードの登録を外す
	// -
	function DomNodeRemove(node_ref){
		var parent = node_ref.parentNode;
		if(!parent)	return false;

		var node =  parent.removeChild(node_ref);
		return (node == node_ref);
	}

	// -
	// DOM ノードのすべての子を外す
	// -
	function DomNodeRemoveChildren(node){
		var nodes = node.childNodes;
		var i;
		var num = nodes.length;
		for(i=num-1;i>=0;i--){
			node.removeChild(nodes[i]);
		}
	}

	// -
	// DOM ノードが document に登録されているか調べる
	// -
	function DomNodeGetAttachedDocument(node){
		if(node.offsetParent) return true;

		var selector_result = ElementMatchesSelector(node,"html *");
		if(selector_result === undefined){
			try{
				while(node){
					if(node == document) return true;
					node = node.parentNode;
				}
			}catch(e){
			}
		}else if(selector_result){
			return true;
		}

		return false;
	}

	// -
	// DOM オブジェクトのすべての子孫を検索する関数
	// -
	function DomNodeFindAllDescendants(node,func){
		function f(n){
			var nodes = n.childNodes;
			var i;
			var num = nodes.length;
			var a = new Array();
			for(i=0;i < num;i++){ a[i] = nodes[i]; }
			for(i=0;i < num;i++){
				node = func(a[i]);
				if(node){ return node; }
				node = f(a[i]);
				if(node){ return node; }
			}
			return null;
		}
		return f(node);
	}

	// -
	// DOM ノードからノード値を取得
	// -
	function DomNodeGetNodeValue(node){
		try{
			return node.nodeValue;
		}catch(e){
		}
		return "";
	}

	// -
	// DOM ノードにノード値をセット
	// -
	function DomNodeSetNodeValue(node,value){
		try{
			node.nodeValue = value;
		}catch(e){
		}
	}

	// -
	// DOM ノードが外れるか調べる
	// -
	function DomNodeObserverRemoveFromDocument(node){
		var _this = this;

		// -
		// 開放
		// -
		_this.release = function(){
			if(_observer_remove_node){
				_observer_remove_node.release();
				_observer_remove_node = null;
			}else if(node.removeEventListener){
				node.removeEventListener('DOMNodeRemovedFromDocument',detectForMutationEvent);
			}
		};

		// -
		// コールバック関数をセット
		// -
		_this.setFunction = function(f){
			_func = f;
		};

		// -
		// 検出(内部用)
		// -
		function detect(e){
			if(_func)	_func(e);
		}

		// -
		// 検出(内部用)
		// -
		function detectForMutationEvent(e){
			execute_queue.attachLastForRemoveDomNode(detect,e);
		}

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

		// -
		// 初期化
		// -
		(function(){
			if(MutationObserverSupported()){
				_observer_remove_node = document_observer_remove_node.createElement();
				_observer_remove_node.setDomNode(node);
				_observer_remove_node.setFunction(detect);
			}else if(node.addEventListener){
				node.addEventListener('DOMNodeRemovedFromDocument',detectForMutationEvent);
			}
		})();
	}

	// -
	// DOM ツリーのクライアント領域のバウンディング矩形を取得
	// -
	function DomTreeGetBoundingClientRect(element){
		var min_x;
		var min_y;
		var max_x;
		var max_y;
		var display_inline = {"inline":1};

		function f(node){
			if(node.getBoundingClientRect){
				var r = node.getBoundingClientRect();
				if(min_x > r.left  ) min_x = r.left;
				if(min_y > r.top   ) min_y = r.top;
				if(max_x < r.right ) max_x = r.right;
				if(max_y < r.bottom) max_y = r.bottom;
			}

			var style = null;
			if(node.nodeType == 1){
				style = ElementGetComputedStyle(node,null);
			}
			if(style){
				if(display_inline[style.display]){
					var nodes = node.childNodes;
					var i;
					var num = nodes.length;
					for(i=0;i<num;i++){
						f(nodes[i]);
					}
				}
			}
		}

		if(!(element.getBoundingClientRect)){
			return null;
		}

		var r = element.getBoundingClientRect();
		min_x = r.left;
		min_y = r.top;
		max_x = r.right;
		max_y = r.bottom;
		f(element);

		return {
			left:min_x,
			top :min_y,
			right :max_x,
			bottom:max_y
		};
	}

	// -
	// DOM ツリーのクライアント領域のコンテンツ矩形を取得
	// -
	var DomTreeGetContentClientRect = (function(){
		var re = new RegExp("^([-0-9.]+)px$","i");
		var list = [
			{style:"paddingLeft"   ,key:"left"   ,sign: 1},
			{style:"paddingRight"  ,key:"right"  ,sign:-1},
			{style:"paddingTop"    ,key:"top"    ,sign: 1},
			{style:"paddingBottom" ,key:"bottom" ,sign:-1},
			{style:"borderLeftWidth"   ,key:"left"   ,sign: 1},
			{style:"borderRightWidth"  ,key:"right"  ,sign:-1},
			{style:"borderTopWidth"    ,key:"top"    ,sign: 1},
			{style:"borderBottomWidth" ,key:"bottom" ,sign:-1}
		];

		return function (element){
			var rect = DomTreeGetBoundingClientRect(element);
			var style = ElementGetComputedStyle(element,null);
			if(style){
				var i;
				var num = list.length;
				for(i=0;i<num;i++){
					var param = list[i];
					if(style[param.style]){
						var m = style[param.style].match(re);
						if(m){
							rect[param.key] += parseFloat(m[0]) * param.sign;
						}
					}
				}
			}
			return rect;
		};
	})();

	// -
	// エレメント複製
	// -
	function ElementCloneNode(element,child_clone){
		return element.cloneNode(child_clone);
	}

	// -
	// エレメントのテキストを取得
	// -
	function ElementGetTextContent(element){
		if(element.textContent !== undefined){
			return element.textContent;
		}
		if(element.innerText !== undefined){
			return element.innerText;
		}

		return "";
	}

	// -
	// エレメントにテキストをセット
	// -
	function ElementSetTextContent(element,str){
		if(element.textContent !== undefined){
			element.textContent = str;
		}
		if(element.innerText !== undefined){
			element.innerText = str;
		}
	}

	// -
	// エレメントがセレクタとマッチするか調べる
	// -
	function ElementMatchesSelector(element,selector){
		if(element.matches){
			return element.matches(selector);
		}
		if(element.webkitMatchesSelector){
			return element.webkitMatchesSelector(selector);
		}
		if(element.mozMatchesSelector){
			return element.mozMatchesSelector(selector);
		}
		if(element.oMatchesSelector){
			return element.oMatchesSelector(selector);
		}
		if(element.msMatchesSelector){
			return element.msMatchesSelector(selector);
		}
		return undefined;
	}

	// -
	// エレメントをフルスクリーン表示する関数
	// -
	function ElementRequestFullscreen(element){
		var list = [
			"requestFullscreen",
			"webkitRequestFullScreen",
			"mozRequestFullScreen",
			"msRequestFullscreen"
		];
		var i;
		var num = list.length;
		for(i=0;i < num;i++){
			if(element[list[i]]){
				element[list[i]]();
				return true;
			}
		}
		return false;
	}

	// -
	// エレメントから StyleSheet オブジェクトを取得する関数
	// -
	function ElementGetStyleSheet(style_sheet){
		if(style_sheet.sheet !== undefined){
			return style_sheet.sheet;
		}else if(style_sheet.styleSheet !== undefined){
			return style_sheet.styleSheet;
		}
		return null;
	}

	// -
	// スタイルシートにルールを追加する関数
	// -
	function CSSStyleSheetInsertRule(style_sheet,selector,style,index){
		if(style_sheet.insertRule !== undefined){
			style_sheet.insertRule(selector + "{" + style + "}",index);
		}else if(style_sheet.addRule !== undefined){
			style_sheet.addRule(selector,style,index);
		}
		return index;
	}

	// -
	// スタイルシートから CSSRuleList オブジェクトを取得する関数
	// -
	function CSSStyleSheetGetCSSRuleList(style_sheet){
		try{
			if(style_sheet.cssRules !== undefined){
				return style_sheet.cssRules;
			}else if(style_sheet.rules !== undefined){
				return style_sheet.rules;
			}
		}catch(e){
		}
		return null;
	}

	// -
	// スタイルにプロパティをセット
	// -
	function StyleDeclarationSetProperty(style,name,value){
		if(style.setProperty){
			style.setProperty(name,value);
		}else{
			try{
				name = name.replace(/[-]([a-z])/g, function(s,p1){ return p1.toUpperCase(); });
				style[name] = value;
			}catch(e){
			}
		}
	}

	// -
	// スタイルの値を取得する関数
	// -
	function StyleDeclarationGetPropertyValue(style,property_name){
		if(style.getPropertyValue !== undefined){
			return style.getPropertyValue(property_name);
		}
		try{
			return style[property_name.replace(/([a-z]+)-([a-z])/g , function (str,p1,p2){ return p1 + p2.toUpperCase(); })];
		}catch(e){
		}
		return null;
	}

	// -
	// スタイルからプロパティを削除
	// -
	function StyleDeclarationRemoveProperty(style,name){
		if(style.removeProperty){
			style.removeProperty(name);
		}else{
			try{
				name = name.replace(/[-]([a-z])/g, function(s,p1){ return p1.toUpperCase(); });
				style[name] = "none";
				delete style[name];
			}catch(e){
			}
		}
	}

	// -
	// DivElement 用初期スタイル文字列を取得
	// -
	function CSSTextGetInitialDivElement(){
		return	"" +
			"background-attachment: scroll;" +
			"background-blend-mode: normal;" +
			"background-clip: border-box;" +
			"background-color: rgba(0, 0, 0, 0);" +
			"background-image: none;" +
			"background-origin: padding-box;" +
			"background-position: 0% 0%;" +
			"background-repeat: repeat;" +
			"background-size: auto;" +
			"border-bottom-color: rgb(0, 0, 0);" +
			"border-bottom-left-radius: 0px;" +
			"border-bottom-right-radius: 0px;" +
			"border-bottom-style: none;" +
			"border-bottom-width: 0px;" +
			"border-collapse: separate;" +
			"border-image-outset: 0px;" +
			"border-image-repeat: stretch;" +
			"border-image-slice: 100%;" +
			"border-image-source: none;" +
			"border-image-width: 1;" +
			"border-left-color: rgb(0, 0, 0);" +
			"border-left-style: none;" +
			"border-left-width: 0px;" +
			"border-right-color: rgb(0, 0, 0);" +
			"border-right-style: none;" +
			"border-right-width: 0px;" +
			"border-top-color: rgb(0, 0, 0);" +
			"border-top-left-radius: 0px;" +
			"border-top-right-radius: 0px;" +
			"border-top-style: none;" +
			"border-top-width: 0px;" +
			"bottom: auto;" +
			"box-shadow: none;" +
			"box-sizing: content-box;" +
			"caption-side: top;" +
			"clear: none;" +
			"clip: auto;" +
			"color: rgb(0, 0, 0);" +
			"cursor: auto;" +
			"direction: ltr;" +
			"display: block;" +
			"empty-cells: show;" +
			"float: none;" +
			"font-family: 'MS PGothic';" +
			"font-kerning: auto;" +
			"font-size: 16px;" +
			"font-style: normal;" +
			"font-variant: normal;" +
			"font-variant-ligatures: normal;" +
			"font-weight: normal;" +
			"height: auto;" +
			"image-rendering: auto;" +
			"left: auto;" +
			"letter-spacing: normal;" +
			"line-height: normal;" +
			"list-style-image: none;" +
			"list-style-position: outside;" +
			"list-style-type: disc;" +
			"margin-bottom: 0px;" +
			"margin-left: 0px;" +
			"margin-right: 0px;" +
			"margin-top: 0px;" +
			"max-height: none;" +
			"max-width: none;" +
			"min-height: 0px;" +
			"min-width: 0px;" +
			"object-fit: fill;" +
			"object-position: 50% 50%;" +
			"opacity: 1;" +
			"orphans: auto;" +
			"outline-color: rgb(0, 0, 0);" +
			"outline-offset: 0px;" +
			"outline-style: none;" +
			"outline-width: 0px;" +
			"overflow-wrap: normal;" +
			"overflow: visible;" +
			"padding-bottom: 0px;" +
			"padding-left: 0px;" +
			"padding-right: 0px;" +
			"padding-top: 0px;" +
			"page-break-after: auto;" +
			"page-break-before: auto;" +
			"page-break-inside: auto;" +
			"pointer-events: auto;" +
			"position: static;" +
			"resize: none;" +
			"right: auto;" +
			"speak: normal;" +
			"table-layout: auto;" +
			"tab-size: 8;" +
			"text-align: start;" +
			"text-decoration: none solid rgb(0, 0, 0);" +
			"text-indent: 0px;" +
			"text-rendering: auto;" +
			"text-shadow: none;" +
			"text-overflow: clip;" +
			"text-transform: none;" +
			"top: auto;" +
			"transition-delay: 0s;" +
			"transition-duration: 0s;" +
			"transition-property: all;" +
			"transition-timing-function: ease;" +
			"unicode-bidi: normal;" +
			"vertical-align: baseline;" +
			"visibility: visible;" +
			"white-space: normal;" +
			"widows: auto;" +
			"width: auto;" +
			"word-break: normal;" +
			"word-spacing: 0px;" +
			"word-wrap: normal;" +
			"z-index: auto;" +
			"zoom: 1;" +
			"align-content: stretch;" +
			"align-items: stretch;" +
			"align-self: stretch;" +
			"flex-basis: auto;" +
			"flex-grow: 0;" +
			"flex-shrink: 1;" +
			"flex-direction: row;" +
			"flex-wrap: nowrap;" +
			"justify-content: flex-start;" +
			"order: 0;" +
			"buffered-rendering: auto;" +
			"clip-path: none;" +
			"clip-rule: nonzero;" +
			"mask: none;" +
			"filter: none;" +
			"flood-color: rgb(0, 0, 0);" +
			"flood-opacity: 1;" +
			"lighting-color: rgb(255, 255, 255);" +
			"stop-color: rgb(0, 0, 0);" +
			"stop-opacity: 1;" +
			"color-interpolation: srgb;" +
			"color-interpolation-filters: linearrgb;" +
			"color-rendering: auto;" +
			"fill: rgb(0, 0, 0);" +
			"fill-opacity: 1;" +
			"fill-rule: nonzero;" +
			"marker-end: none;" +
			"marker-mid: none;" +
			"marker-start: none;" +
			"mask-type: luminance;" +
			"shape-rendering: auto;" +
			"stroke: none;" +
			"stroke-dasharray: none;" +
			"stroke-dashoffset: 0;" +
			"stroke-linecap: butt;" +
			"stroke-linejoin: miter;" +
			"stroke-miterlimit: 4;" +
			"stroke-opacity: 1;" +
			"stroke-width: 1;" +
			"alignment-baseline: auto;" +
			"baseline-shift: baseline;" +
			"dominant-baseline: auto;" +
			"kerning: 0;" +
			"text-anchor: start;" +
			"writing-mode: lr-tb;" +
			"glyph-orientation-horizontal: 0deg;" +
			"glyph-orientation-vertical: auto;" +
			"vector-effect: none;" +
			"paint-order: fill stroke markers;";
	}

	// -
	// ImageElement 用初期スタイル文字列を取得
	// -
	function CSSTextGetInitialImageElement(){
		return "all:revert;";
	}

	// -
	// ButtonElement 用初期スタイル文字列を取得
	// -
	function CSSTextGetInitialButtonElement(){
		return "all:revert;";
	}

	// -
	// マウスイベントで変化したボタンを buttons 形式で取得する
	// -
	function MouseEventGetChangedButtons(event_obj){
		try{
			if(event_obj instanceof MouseEvent){
				var buttons = 0;
				if(event_obj.button == 0) buttons |= 0x01;
				if(event_obj.button == 1) buttons |= 0x04;
				if(event_obj.button == 2) buttons |= 0x02;
				return buttons;
			}
		}catch(e){
		}
		return event_obj.button;
	}

	// -
	// イメージを複製
	// -
	function ImageClone(image){
		var c = document.createElement("img");
		c.src = image.src;
		return c;
	}

	// -
	// イメージの読み込みが完了したか取得する
	// -
	function ImageGetLoaded (image,callback) {

		var event_handler_release;
		var event_handler_load;
		var event_handler_error;
		var timer;
		var released = false;

		function release(){
			if(released) return;
			released = true;

			if(event_handler_release){
				event_handler_release.release();
				event_handler_release = null;
			}
			if(event_handler_load){
				image.removeEventListener("load" ,event_handler_load);
				event_handler_load = null;
			}
			if(event_handler_error){
				image.removeEventListener("error",event_handler_error);
				event_handler_error = null;
			}
			if(timer){
				timer.release();
				timer = null;
			}
		}

		function complete(){
			release();
			callback();
		}

		function success(){
			if(released) return;
			complete();
		}

		function failure(){
			if(released) return;
			complete();
		}

		event_handler_release = page_expand_event_dispatcher.createEventHandler("release");
		event_handler_release.setFunction(function(){
			release();
		});

		function add_event(){
			event_handler_load = success;
			event_handler_error = failure;
			image.addEventListener("load" ,event_handler_load);
			image.addEventListener("error",event_handler_error);
		}

		// ロード中
		if(!image.complete){
			add_event();
			return;
		}

		// ロード完了
		if(image.naturalHeight !== 0){
			complete();
			return;
		}

		// 念のために1秒待機
		timer = new Timer(1000,1);
		timer.oncomplete = function(){
			if(image.complete){
				complete();
			}else{
				add_event();
			}
		};
		timer.start();
	}

	// -
	// イメージのデフォルトのサイズを取得
	// -
	function ImageGetNaturalSize(image) {
		if(image.naturalWidth === undefined){
		}else if(image.naturalHeight === undefined){
		}else{
			return {
				width :image.naturalWidth,
				height:image.naturalHeight
			};
		}

		// Opera 用
		if(UserAgentGetOpera()){
			var w = image.width;
			var h = image.height;

			image.removeAttribute("width");
			image.removeAttribute("height");

			var size = {
				width :image.width,
				height:image.height
			};
			image.width  = w;
			image.height = h;

			return size;
		}

		image = ElementCloneNode(image,false);
		return {
			width :image.width,
			height:image.height
		};
	}

	// -
	// 擬似スクロール
	// -
	function WheelScrollFromElement(vector,target,current){
		var p = {
			result:false,
			vector:{x:0,y:0},
			target:null
		};

		var overflow_hidden_x = {"hidden":1};
		var overflow_hidden_y = {"hidden":1};
		while(target){
			if(target == current){
				break;
			}
			if(current.compareDocumentPosition){
				var dom_pos = current.compareDocumentPosition(target);
				if(dom_pos & document.DOCUMENT_POSITION_CONTAINS){
					break;
				}
			}

			var computed_style = ElementGetComputedStyle(target,null);
			if(!computed_style) computed_style = {};

			var min_x = 0;
			var max_x = target.scrollWidth - target.clientWidth;
			var old_x = target.scrollLeft;
			var new_x = old_x + vector.x;

			if(!(vector.x)){
			}else if(overflow_hidden_x[computed_style.overflowX]){
			}else if((vector.x < 0) && (min_x >= old_x)){
			}else if((vector.x > 0) && (max_x <= old_x)){
			}else{
				if(new_x < min_x) new_x = min_x;
				if(new_x > max_x) new_x = max_x;
				target.scrollLeft = new_x;
				if(target.scrollLeft != old_x){
					p.result = true;
					p.target = target;
					p.vector.x = new_x - old_x;
				}
			}

			var min_y = 0;
			var max_y = target.scrollHeight - target.clientHeight;
			var old_y = target.scrollTop;
			var new_y = old_y + vector.y;

			if(!(vector.y)){
			}else if(overflow_hidden_y[computed_style.overflowY]){
			}else if((vector.y < 0) && (min_y >= old_y)){
			}else if((vector.y > 0) && (max_y <= old_y)){
			}else{
				if(new_y < min_y) new_y = min_y;
				if(new_y > max_y) new_y = max_y;
				target.scrollTop = new_y;
				if(target.scrollTop != old_y){
					p.result = true;
					p.target = target;
					p.vector.y = new_y - old_y;
				}
			}

			if(p.result) break;

			target = target.parentElement;
		}

		return p;
	}


	// -
	// 初期化
	// -
	switch(page_expand_arguments.execute_type){

	// -
	// ユーザースクリプトとして動作
	// -
	case "UserScript":

		// 実行除外
		if(page_expand_arguments.page_expand_parent){
		}else{
			if(WindowIsExecutedByPageExpand(window)) return;
		}

		// PageExpand 初期化
		PageExpandInitialize();

		// プロジェクトをロード
		page_expand_project = new PageExpandProject();
		page_expand_project.loadLocalStorage(function(result){

			project = new Project();
			project.importObject(ObjectCopy(page_expand_project.getProject(WindowGetOwnerURL(window))));

			// ロケール
			var _i18n = new InternationalMessage(page_expand_project.getLanguage());

			// -
			// ロードブロック
			// -
			if(document.addEventListener){
				document.addEventListener("beforeload", function(e){
					if(project.checkAccessBlock(e.url)){
						e.preventDefault();
						if(project.getEnableOutputLog()){
							ConsoleLog({type:"AccessBlock",current_url:document.URL,url:e.url,call:"document.beforeload"});
						}
					}
				}, true);
			}

			// -
			// メニューコマンド(設定)
			// -
			var menu_command = new GMW_MenuCommand();
			(function(){
				var event_handler_release = page_expand_event_dispatcher.createEventHandler("release");
				event_handler_release.setFunction(function(){
					menu_command.release();
					event_handler_release.release();
					menu_command = null;
				});
		 	})();

			// -
			// メニューコマンドの追加(トップのみ)
			// -
			(function(){
				if(!menu_command) return;
				if(WindowIsChild(window)) return;
				if(page_expand_arguments.admin != page_expand_arguments.window) return;

				menu_command.addItem(_i18n.getMessage("context_menu_batch_download_image"), function(){
					download_list_image.createArchive();
				},"i");

				menu_command.addItem(_i18n.getMessage("context_menu_batch_download_user"), function(){
					download_list_user.createArchive();
				},"u");

				if(!(project.getEnableStartup())){
					menu_command.addItem(_i18n.getMessage("context_menu_pageexpand_start"), function(){
						PageExpandStart();
					},"s");
				}

				menu_command.addItem(_i18n.getMessage("context_menu_pageexpand_abort"), function(){
					PageExpandRelease();
				},"a");

				menu_command.addItem(_i18n.getMessage("context_menu_pageexpand_execute_fastest"), function(){
					PageExpandExecuteFastest();
				},"q");

				menu_command.addItem(_i18n.getMessage("context_menu_pageexpand_debug"), function(){
					page_expand_debug.setVisible(true);
				},"d");

				(function(){

					// BbsBoard の自動実行を許すアドレス
					var bbs_board_allow_filter = "https://hakuhin.github.io/PageExpand/GreaseMonkey/bbs_board.html";

					var allowed = StringUrlMatchAsteriskWord( (document.URL) , (bbs_board_allow_filter + "*") );

					var bbs_board_exec = function(){
						if(!confirm(_i18n.getMessage("context_menu_pageexpand_open_bbs_board_run_confirm"))) return;

						// PageExpand コンストラクタ
						PageExpandConstructor();

						// 実行開始
						PageExpandStart();

						var bbs_board = new PageExpandBbsBoard();
						bbs_board.initialize(function(info){
							if(!(info.result)) return;

							bbs_board.enableCompactMode(false);			
							bbs_board.setURL(document.URL);	
						});
					};

					menu_command.addItem(_i18n.getMessage("context_menu_pageexpand_open_bbs_board"), function(){
						bbs_board_exec();
					},"b");

					// 自動実行
					if(allowed) bbs_board_exec();
			 	})();

				(function(){

					// PageExpand 設定の動作を許すアドレス
					var config_allow_filter = "https://hakuhin.github.io/PageExpand/GreaseMonkey/options.html";

					var allowed = StringUrlMatchAsteriskWord( (document.URL) , (config_allow_filter + "*") );

					var config_exec = function(){
						if(!confirm(_i18n.getMessage("context_menu_pageexpand_config_auto_run_confirm"))) return;

						// PageExpand コンストラクタ
						PageExpandConstructor();

						// 実行開始
						PageExpandStart();

						var config = new PageExpandConfig();
						config.initialize(function(result){
							config.MenuItemSelect(PageExpandConfig.MENU_TYPE_SETTING_STANDARD);
						});
					};

					menu_command.addItem(_i18n.getMessage("context_menu_pageexpand_config"), function(){
						if(allowed){
							config_exec();
						}else{
							if(confirm(_i18n.getMessage("context_menu_pageexpand_config_current_page_confirm") + config_allow_filter)){
								if(GMW_openInTab.isSupported()){
									GMW_openInTab(config_allow_filter,{active:true});
								}else{
									window.open(config_allow_filter,"_blank");
								}
							}
						}
					},"c");

					// 自動実行
					if(allowed) config_exec();
			 	})();
			})();

			// 実行可能
			if(project.getEnable()){

				// PageExpand コンストラクタ
				PageExpandConstructor();

				if((page_expand_arguments.page_expand_parent) || project.getEnableStartup()){
					// 実行開始
					PageExpandStart();
				}
			}
		});

		break;

	};

})({execute_type:"UserScript",admin:window,window:window});