Index: temp/trunk/html/admin/products/index_test.php
===================================================================
--- temp/trunk/html/admin/products/index_test.php	(revision 1694)
+++ temp/trunk/html/admin/products/index_test.php	(revision 1694)
@@ -0,0 +1,332 @@
+<?php
+
+require_once("../require.php");
+require_once("./index_csv.php");
+
+class LC_Page {
+	var $arrForm;
+	var $arrHidden;
+	var $arrProducts;
+	var $arrPageMax;
+	function LC_Page() {
+		$this->tpl_mainpage = 'products/index.tpl';
+		$this->tpl_mainno = 'products';
+		$this->tpl_subnavi = 'products/subnavi.tpl';
+		$this->tpl_subno = 'index';
+		$this->tpl_pager = ROOT_DIR . 'data/Smarty/templates/admin/pager.tpl';
+		$this->tpl_subtitle = '¾¦ÉÊ¥Þ¥¹¥¿';
+
+		global $arrPageMax;
+		$this->arrPageMax = $arrPageMax;
+		global $arrDISP;
+		$this->arrDISP = $arrDISP;
+		global $arrSTATUS;
+		$this->arrSTATUS = $arrSTATUS;
+		global $arrPRODUCTSTATUS_COLOR;
+		$this->arrPRODUCTSTATUS_COLOR = $arrPRODUCTSTATUS_COLOR;
+
+	}
+}
+
+//$conn = new SC_DBConn();
+$objPage = new LC_Page();
+$objView = new SC_AdminView();
+
+$objDate = new SC_Date();
+
+// ÅÐÏ¿¡¦¹¹¿·¸¡º÷³«»ÏÇ¯
+$objDate->setStartYear(RELEASE_YEAR);
+$objDate->setEndYear(DATE("Y"));
+$objPage->arrStartYear = $objDate->getYear();
+$objPage->arrStartMonth = $objDate->getMonth();
+$objPage->arrStartDay = $objDate->getDay();
+// ÅÐÏ¿¡¦¹¹¿·¸¡º÷½ªÎ»Ç¯
+$objDate->setStartYear(RELEASE_YEAR);
+$objDate->setEndYear(DATE("Y"));
+$objPage->arrEndYear = $objDate->getYear();
+$objPage->arrEndMonth = $objDate->getMonth();
+$objPage->arrEndDay = $objDate->getDay();
+
+// Ç§¾Ú²ÄÈÝ¤ÎÈ½Äê
+//$objSess = new SC_Session();
+//sfIsSuccess($objSess);
+
+//¥­¥ã¥ó¥Ú¡¼¥ó¤ÎÊÔ½¸»þ
+if(sfIsInt($_POST['campaign_id']) && $_POST['mode'] == "camp_search") {
+	$objQuery = new SC_Query();
+	$search_data = $objQuery->get("dtb_campaign", "search_condition", "campaign_id = ? ", array($_POST['campaign_id']));
+	$arrSearch = unserialize($search_data);
+	foreach ($arrSearch as $key => $val) {
+		$_POST[$key] = $val;
+	}
+}
+
+// POSTÃÍ¤Î°ú¤­·Ñ¤®
+$objPage->arrForm = $_POST;
+
+// ¸¡º÷¥ï¡¼¥É¤Î°ú¤­·Ñ¤®
+foreach ($_POST as $key => $val) {
+	if (ereg("^search_", $key) || ereg("^campaign_", $key)) {
+		switch($key) {
+			case 'search_product_flag':
+			case 'search_status':
+				$objPage->arrHidden[$key] = sfMergeParamCheckBoxes($val);
+				if(!is_array($val)) {
+					$objPage->arrForm[$key] = split("-", $val);
+				}
+				break;
+			default:
+				$objPage->arrHidden[$key] = $val;
+				break;
+		}
+	}
+}
+
+// ¥Ú¡¼¥¸Á÷¤êÍÑ
+$objPage->arrHidden['search_pageno'] = $_POST['search_pageno'];
+
+// ¾¦ÉÊºï½ü
+if ($_POST['mode'] == "delete") {
+	if($_POST['category_id'] != "") {
+		// ¥é¥ó¥¯ÉÕ¤­¥ì¥³¡¼¥É¤Îºï½ü
+		$where = "category_id = " . addslashes($_POST['category_id']);
+		sfDeleteRankRecord("dtb_products", "product_id", $_POST['product_id'], $where);
+	} else {
+		sfDeleteRankRecord("dtb_products", "product_id", $_POST['product_id']);
+	}
+	// »Ò¥Æ¡¼¥Ö¥ë(¾¦ÉÊµ¬³Ê)¤Îºï½ü
+	$objQuery = new SC_Query();
+	$objQuery->delete("dtb_products_class", "product_id = ?", array($_POST['product_id']));
+	
+	// ·ï¿ô¥«¥¦¥ó¥È¥Ð¥Ã¥Á¼Â¹Ô
+	sfCategory_Count($objQuery);	
+}
+
+
+if ($_POST['mode'] == "search" || $_POST['mode'] == "csv"  || $_POST['mode'] == "delete" || $_POST['mode'] == "delete_all" || $_POST['mode'] == "camp_search") {
+	// ÆþÎÏÊ¸»ú¤Î¶¯À©ÊÑ´¹
+	lfConvertParam();
+	// ¥¨¥é¡¼¥Á¥§¥Ã¥¯
+	$objPage->arrErr = lfCheckError();
+
+	$where = "delete = 0";
+
+	// ÆþÎÏ¥¨¥é¡¼¤Ê¤·
+	if (count($objPage->arrErr) == 0) {
+
+		foreach ($objPage->arrForm as $key => $val) {
+				
+			$val = sfManualEscape($val);
+			
+			if($val == "") {
+				continue;
+			}
+			
+			switch ($key) {
+				case 'search_product_id':
+					$where .= " AND product_id = ?";
+					$arrval[] = $val;
+					break;
+				case 'search_product_class_id':
+					$where .= " AND product_id IN (SELECT product_id FROM dtb_products_class WHERE product_class_id = ?)";
+					$arrval[] = $val;
+					break;
+				case 'search_name':
+					$where .= " AND name ILIKE ?";
+					$arrval[] = "%$val%";
+					break;
+				case 'search_category_id':
+					list($tmp_where, $tmp_arrval) = sfGetCatWhere($val);
+					if($tmp_where != "") {
+						$where.= " AND $tmp_where";
+						$arrval = array_merge($arrval, $tmp_arrval);
+					}
+					break;
+				case 'search_product_code':
+					$where .= " AND product_id IN (SELECT product_id FROM dtb_products_class WHERE product_code ILIKE ? GROUP BY product_id)";
+					$arrval[] = "%$val%";
+					break;
+				case 'search_startyear':
+					$date = sfGetTimestamp($_POST['search_startyear'], $_POST['search_startmonth'], $_POST['search_startday']);
+					$where.= " AND update_date >= ?";
+					$arrval[] = $date;
+					break;
+				case 'search_endyear':
+					$date = sfGetTimestamp($_POST['search_endyear'], $_POST['search_endmonth'], $_POST['search_endday']);
+					$where.= " AND update_date <= ?";
+					$arrval[] = $date;
+					break;
+				case 'search_product_flag':
+					global $arrSTATUS;
+					$search_product_flag = sfSearchCheckBoxes($val);
+					if($search_product_flag != "") {
+						$where.= " AND product_flag LIKE ?";
+						$arrval[] = $search_product_flag;					
+					}
+					break;
+				case 'search_status':
+					$tmp_where = "";
+					foreach ($val as $element){
+						if ($element != ""){
+							if ($tmp_where == ""){
+								$tmp_where.="AND (status LIKE ? ";
+							}else{
+								$tmp_where.="OR status LIKE ? ";
+							}
+							$arrval[]=$element;
+						}
+					}
+					if ($tmp_where != ""){
+						$tmp_where.=")";
+						$where.= "$tmp_where";
+					}
+					break;
+				default:
+					break;
+			}
+		}
+
+		$order = "update_date DESC";
+		$objQuery = new SC_Query();
+		
+		switch($_POST['mode']) {
+		case 'csv':
+			// ¥ª¥×¥·¥ç¥ó¤Î»ØÄê
+			$option = "ORDER BY $order";
+			// CSV½ÐÎÏ¥¿¥¤¥È¥ë¹Ô¤ÎºîÀ®
+			$arrOutput = sfSwapArray(sfgetCsvOutput(1, " WHERE csv_id = 1 AND status = 1"));
+			
+			if (count($arrOutput) <= 0) break;
+			
+			$arrOutputCols = $arrOutput['col'];
+			$arrOutputTitle = $arrOutput['disp_name'];
+			
+			$head = sfGetCSVList($arrOutputTitle);
+			
+			$data = lfGetProductsCSV($where, $option, $arrval, $arrOutputCols);
+
+			// CSV¤òÁ÷¿®¤¹¤ë¡£
+			sfCSVDownload($head.$data);
+			exit;
+			break;
+		case 'delete_all':
+			// ¸¡º÷·ë²Ì¤ò¤¹¤Ù¤Æºï½ü
+			$where = "product_id IN (SELECT product_id FROM vw_products_nonclass WHERE $where)";
+			$sqlval['delete'] = 1;
+			$objQuery->update("dtb_products", $sqlval, $where, $arrval);
+			break;
+		default:
+			// ÆÉ¤ß¹þ¤àÎó¤È¥Æ¡¼¥Ö¥ë¤Î»ØÄê
+			$col = "product_id, name, category_id, main_list_image, status, product_code, price01, price02, stock, stock_unlimited";
+			$from = "vw_products_nonclass";
+
+			// ¹Ô¿ô¤Î¼èÆÀ
+			$linemax = $objQuery->count($from, $where, $arrval);
+			$objPage->tpl_linemax = $linemax;				// ²¿·ï¤¬³ºÅö¤·¤Þ¤·¤¿¡£É½¼¨ÍÑ
+
+			// ¥Ú¡¼¥¸Á÷¤ê¤Î½èÍý
+			if(is_numeric($_POST['search_page_max'])) {	
+				$page_max = $_POST['search_page_max'];
+			} else {
+				$page_max = SEARCH_PMAX;
+			}
+
+			// ¥Ú¡¼¥¸Á÷¤ê¤Î¼èÆÀ
+			$objNavi = new SC_PageNavi($_POST['search_pageno'], $linemax, $page_max, "fnNaviSearchPage", NAVI_PMAX);
+			$startno = $objNavi->start_row;
+			$objPage->arrPagenavi = $objNavi->arrPagenavi;
+			
+			//¥­¥ã¥ó¥Ú¡¼¥ó¾¦ÉÊ¸¡º÷»þ¤Ï¡¢Á´·ë²Ì¤Î¾¦ÉÊID¤òÊÑ¿ô¤Ë³ÊÇ¼¤¹¤ë
+			if($_POST['search_mode'] == 'campaign') {
+				$arrRet = $objQuery->select($col, $from, $where, $arrval);
+				if(count($arrRet) > 0) {
+					$arrRet = sfSwapArray($arrRet);
+					$pid = implode("-", $arrRet['product_id']);
+					$objPage->arrHidden['campaign_product_id'] = $pid;
+				}
+			}
+
+			// ¼èÆÀÈÏ°Ï¤Î»ØÄê(³«»Ï¹ÔÈÖ¹æ¡¢¹Ô¿ô¤Î¥»¥Ã¥È)
+			$objQuery->setlimitoffset($page_max, $startno);
+			// É½¼¨½ç½ø
+			$objQuery->setorder($order);
+			// ¸¡º÷·ë²Ì¤Î¼èÆÀ
+			$objPage->arrProducts = $objQuery->select($col, $from, $where, $arrval);
+
+			break;
+		}
+	}
+}
+
+// ¥«¥Æ¥´¥ê¤ÎÆÉ¹þ
+$objPage->arrCatList = sfGetCategoryList();
+$objPage->arrCatIDName = lfGetIDName($objPage->arrCatList);
+
+// ²èÌÌ¤ÎÉ½¼¨
+$objView->assignobj($objPage);
+$objView->display(MAIN_FRAME);
+
+//---------------------------------------------------------------------------------------------------------------------------------------------------------
+
+// ¼èÆÀÊ¸»úÎó¤ÎÊÑ´¹ 
+function lfConvertParam() {
+	global $objPage;
+	/*
+	 *	Ê¸»úÎó¤ÎÊÑ´¹
+	 *	K :  ¡ÖÈ¾³Ñ(ÊÝ¶¸)ÊÒ²¾Ì¾¡×¤ò¡ÖÁ´³ÑÊÒ²¾Ì¾¡×¤ËÊÑ´¹
+	 *	C :  ¡ÖÁ´³Ñ¤Ò¤é²¾Ì¾¡×¤ò¡ÖÁ´³Ñ¤«¤¿²¾Ì¾¡×¤ËÊÑ´¹
+	 *	V :  ÂùÅÀÉÕ¤­¤ÎÊ¸»ú¤ò°ìÊ¸»ú¤ËÊÑ´¹¡£"K","H"¤È¶¦¤Ë»ÈÍÑ¤·¤Þ¤¹	
+	 *	n :  ¡ÖÁ´³Ñ¡×¿ô»ú¤ò¡ÖÈ¾³Ñ(ÊÝ¶¸)¡×¤ËÊÑ´¹
+	 */
+	$arrConvList['search_name'] = "KVa";
+	$arrConvList['search_product_code'] = "KVa";
+	
+	// Ê¸»úÊÑ´¹
+	foreach ($arrConvList as $key => $val) {
+		// POST¤µ¤ì¤Æ¤­¤¿ÃÍ¤Î¤ßÊÑ´¹¤¹¤ë¡£
+		if(isset($objPage->arrForm[$key])) {
+			$objPage->arrForm[$key] = mb_convert_kana($objPage->arrForm[$key] ,$val);
+		}
+	}
+}
+
+// ¥¨¥é¡¼¥Á¥§¥Ã¥¯ 
+// ÆþÎÏ¥¨¥é¡¼¥Á¥§¥Ã¥¯
+function lfCheckError() {
+	$objErr = new SC_CheckError();
+	$objErr->doFunc(array("³«»ÏÆü", "search_startyear", "search_startmonth", "search_startday"), array("CHECK_DATE"));
+	$objErr->doFunc(array("½ªÎ»Æü", "search_endyear", "search_endmonth", "search_endday"), array("CHECK_DATE"));
+	$objErr->doFunc(array("³«»ÏÆü", "½ªÎ»Æü", "search_startyear", "search_startmonth", "search_startday", "search_endyear", "search_endmonth", "search_endday"), array("CHECK_SET_TERM"));
+	return $objErr->arrErr;
+}
+
+// ¥Á¥§¥Ã¥¯¥Ü¥Ã¥¯¥¹ÍÑWHEREÊ¸ºîÀ®
+function lfGetCBWhere($key, $max) {
+	$str = "";
+	$find = false;
+	for ($cnt = 1; $cnt <= $max; $cnt++) {
+		if ($_POST[$key . $cnt] == "1") {
+			$str.= "1";
+			$find = true;
+		} else {
+			$str.= "_";
+		}
+	}
+	if (!$find) {
+		$str = "";
+	}
+	return $str;
+}
+
+// ¥«¥Æ¥´¥êID¤ò¥­¡¼¡¢¥«¥Æ¥´¥êÌ¾¤òÃÍ¤Ë¤¹¤ëÇÛÎó¤òÊÖ¤¹¡£
+function lfGetIDName($arrCatList) {
+	$max = count($arrCatList);
+	for ($cnt = 0; $cnt < $max; $cnt++ ) {
+		$key = $arrCatList[$cnt]['category_id'];
+		$val = $arrCatList[$cnt]['category_name'];
+		$arrRet[$key] = $val;	
+	}
+	return $arrRet;
+}
+
+?>
Index: temp/trunk/html/test/naka/test2.php
===================================================================
--- temp/trunk/html/test/naka/test2.php	(revision 1694)
+++ temp/trunk/html/test/naka/test2.php	(revision 1694)
@@ -0,0 +1,28 @@
+<?
+
+$arrRet = array("1", "2", "3", "4", "5", "0");
+
+if(array_search("2", $arrRet)) {
+	echo '2:find';
+}
+
+if(array_search("1", $arrRet)) {
+	echo '1:find';
+}
+
+if(array_search("3", $arrRet)) {
+	echo '3:find';
+}
+
+if(array_search("4", $arrRet)) {
+	echo '4:find';
+}
+
+if(array_search("0", $arrRet)) {
+	echo '0:find';
+}
+
+print(array_search("1", $arrRet));
+print(array_search("2", $arrRet));
+
+?>
Index: temp/trunk/html/test/naka/zip.php
===================================================================
--- temp/trunk/html/test/naka/zip.php	(revision 1694)
+++ temp/trunk/html/test/naka/zip.php	(revision 1694)
@@ -0,0 +1,84 @@
+<?php
+
+require_once("../../require.php");
+
+define("ZIP_CSV_LINE_MAX", 8192);
+define("IMAGE_MAX", 680);	// ²èÁü¤ÎÉ½¼¨¸Ä¿ô
+
+$path = ROOT_DIR . "html/install/KEN_ALL.CSV";
+
+$objQuery = new SC_Query();
+
+$fp = fopen($path, "r");
+
+// °ìÉô¤ÎIE¤Ï256¥Ð¥¤¥È°Ê¾å¼õ¤±¼è¤Ã¤Æ¤«¤éÉ½¼¨¤ò³«»Ï¤¹¤ë¡£
+for($i = 0; $i < 256; $i++) {
+	print(" ");
+}
+print("\n");
+flush();
+
+if(!$fp) {
+	sfErrorHeader(">> " . $path . "¤Î¼èÆÀ¤Ë¼ºÇÔ¤·¤Þ¤·¤¿¡£");
+} else {
+	print("<img src='/img/install/main_w.jpg'><br>");
+	flush();
+	
+	// CSV¤Î·ï¿ô¤ò¿ô¤¨¤ë
+	$line = 0;
+	while(!feof($fp)) {
+		fgets($fp, ZIP_CSV_LINE_MAX);
+		$line++;
+	}
+	
+	print("<img src='/img/install/space_w.gif'>");
+	flush();
+		
+	// ¥Õ¥¡¥¤¥ë¥Ý¥¤¥ó¥¿¤òÌá¤¹
+	fseek($fp, 0);
+	
+	// ²èÁü¤ò°ì¸ÄÉ½¼¨¤¹¤ë·ï¿ô¤òµá¤á¤ë¡£
+	$disp_line = intval($line / IMAGE_MAX);
+	
+	// ´û¤Ë½ñ¤­¹þ¤Þ¤ì¤¿¥Ç¡¼¥¿¤ò¿ô¤¨¤ë
+	$end_cnt = $objQuery->count("mtb_zip");
+	
+	$cnt = 1;
+	$img_cnt = 0;
+	while (!feof($fp)) {
+		$arrCSV = fgetcsv($fp, ZIP_CSV_LINE_MAX);
+		
+		// ¤¹¤Ç¤Ë½ñ¤­¹þ¤Þ¤ì¤¿¥Ç¡¼¥¿¤òÈô¤Ð¤¹¡£
+		if($cnt > $end_cnt) {
+			$sqlval['code'] = $arrCSV[0];
+			$sqlval['old_zipcode'] = $arrCSV[1];
+			$sqlval['zipcode'] = $arrCSV[2];
+			$sqlval['state_kana'] = $arrCSV[3];
+			$sqlval['city_kana'] = $arrCSV[4];
+			$sqlval['town_kana'] = $arrCSV[5];
+			$sqlval['state'] = $arrCSV[6];
+			$sqlval['city'] = $arrCSV[7];
+			$sqlval['town'] = $arrCSV[8];
+			$sqlval['flg1'] = $arrCSV[9];
+			$sqlval['flg2'] = $arrCSV[10];
+			$sqlval['flg3'] = $arrCSV[11];
+			$sqlval['flg4'] = $arrCSV[12];
+			$sqlval['flg5'] = $arrCSV[13];
+			$sqlval['flg6'] = $arrCSV[14];	
+			$objQuery->insert("mtb_zip", $sqlval);
+		}
+		
+		$cnt++;
+		// $disp_line·ï¤´¤È¤Ë¿ÊÄ½É½¼¨¤¹¤ë
+		if($cnt % $disp_line == 0 && $img_cnt < IMAGE_MAX) {
+			print("<img src='/img/install/graph_1_w.gif'>");
+			flush();
+			$img_cnt++;
+		}
+	}
+	fclose($fp);
+	print("<img src='/img/install/space_w.gif'>");
+}
+
+
+?>
Index: temp/trunk/html/test/naka/test3.php
===================================================================
--- temp/trunk/html/test/naka/test3.php	(revision 1694)
+++ temp/trunk/html/test/naka/test3.php	(revision 1694)
@@ -0,0 +1,5 @@
+<?php
+	$ret = ereg_replace("^[a-zA-Z0-9_~=&\?\/-]+", "", "naka.lockon.co.jp");
+	
+	print($ret);
+?>
Index: temp/trunk/html/test/naka/bar.php
===================================================================
--- temp/trunk/html/test/naka/bar.php	(revision 1694)
+++ temp/trunk/html/test/naka/bar.php	(revision 1694)
@@ -0,0 +1,75 @@
+<?php
+require_once("./class/SC_GraphBar.php");
+
+$objGraphBar = new SC_GraphBar();
+
+$arrData1 = array(
+	3250,
+	423,
+	533,
+	1158,
+	1120,
+	1300,
+	2223,
+	100,
+	250,
+);
+
+$arrData2 = array(
+	533,
+	1158,
+	3250,
+	423,
+	1120,
+	100,
+	250,
+	1300,
+	2223,
+);
+
+$arrData3 = array(
+	1120,
+	1300,
+	2223,
+	100,
+	250,
+	3250,
+	423,
+	533,
+	1158,
+);
+
+$arrXLabel = array(
+	'»î¸³1',
+	'»î¸³2',
+	'»î¸³3',
+	'»î¸³4',
+	'»î¸³5',
+	'»î¸³6',
+	'»î¸³7',
+	'»î¸³8',
+	'»î¸³9',
+	'»î¸³10',
+	'»î¸³11',
+);
+
+$arrLegend = array(
+	'»î¸³1',
+	'»î¸³2',
+	'»î¸³3',
+	'»î¸³4'
+);
+
+// ¥°¥é¥ÕÉÁ²è
+$objGraphBar->setXLabel($arrXLabel);
+$objGraphBar->setXTitle("´ü´Ö(·î)");
+$objGraphBar->setYTitle("Çä¾å¤²(±ß)");
+$objGraphBar->setData($arrData1);
+$objGraphBar->setData($arrData2);
+$objGraphBar->setData($arrData3);
+$objGraphBar->setLegend($arrLegend);
+$objGraphBar->drawGraph();
+
+$objGraphBar->outputGraph();
+
+?>
Index: temp/trunk/html/test/naka/HTMLArea/popupwin.js
===================================================================
--- temp/trunk/html/test/naka/HTMLArea/popupwin.js	(revision 1694)
+++ temp/trunk/html/test/naka/HTMLArea/popupwin.js	(revision 1694)
@@ -0,0 +1,139 @@
+// (c) dynarch.com 2003-2004
+// Distributed under the same terms as HTMLArea itself.
+
+function PopupWin(editor, title, handler, initFunction) {
+	this.editor = editor;
+	this.handler = handler;
+	var dlg = window.open("", "__ha_dialog",
+			      "toolbar=no,menubar=no,personalbar=no,width=600,height=600,left=20,top=40" +
+			      "scrollbars=no,resizable=no");
+	this.window = dlg;
+	var doc = dlg.document;
+	this.doc = doc;
+	var self = this;
+
+	var base = document.baseURI || document.URL;
+	if (base && base.match(/(.*)\/([^\/]+)/)) {
+		base = RegExp.$1 + "/";
+	}
+	if (typeof _editor_url != "undefined" && !/^\//.test(_editor_url)) {
+		// _editor_url doesn't start with '/' which means it's relative
+		// FIXME: there's a problem here, it could be http:// which
+		// doesn't start with slash but it's not relative either.
+		base += _editor_url;
+	} else
+		base = _editor_url;
+	if (!/\/$/.test(base)) {
+		// base does not end in slash, add it now
+		base += '/';
+	}
+	this.baseURL = base;
+
+	doc.open();
+	var html = "<html><head><title>" + title + "</title>\n";
+	// html += "<base href='" + base + "htmlarea.js' />\n";
+	html += "<style type='text/css'>@import url(" + base + "htmlarea.css);</style></head>\n";
+	html += "<body class='dialog popupwin' id='--HA-body'></body></html>";
+	doc.write(html);
+	doc.close();
+
+	// sometimes I Hate Mozilla... ;-(
+	function init2() {
+		var body = doc.body;
+		if (!body) {
+			setTimeout(init2, 25);
+			return false;
+		}
+		dlg.title = title;
+		doc.documentElement.style.padding = "0px";
+		doc.documentElement.style.margin = "0px";
+		var content = doc.createElement("div");
+		content.className = "content";
+		self.content = content;
+		body.appendChild(content);
+		self.element = body;
+		initFunction(self);
+		dlg.focus();
+	};
+	init2();
+};
+
+PopupWin.prototype.callHandler = function() {
+	var tags = ["input", "textarea", "select"];
+	var params = new Object();
+	for (var ti in tags) {
+		var tag = tags[ti];
+		var els = this.content.getElementsByTagName(tag);
+		for (var j = 0; j < els.length; ++j) {
+			var el = els[j];
+			var val = el.value;
+			if (el.tagName.toLowerCase() == "input") {
+				if (el.type == "checkbox") {
+					val = el.checked;
+				}
+			}
+			params[el.name] = val;
+		}
+	}
+	this.handler(this, params);
+	return false;
+};
+
+PopupWin.prototype.close = function() {
+	this.window.close();
+};
+
+PopupWin.prototype.addButtons = function() {
+	var self = this;
+	var div = this.doc.createElement("div");
+	this.content.appendChild(div);
+	div.className = "buttons";
+	for (var i = 0; i < arguments.length; ++i) {
+		var btn = arguments[i];
+		var button = this.doc.createElement("button");
+		div.appendChild(button);
+		button.innerHTML = HTMLArea.I18N.buttons[btn];
+		switch (btn) {
+		    case "ok":
+			button.onclick = function() {
+				self.callHandler();
+				self.close();
+				return false;
+			};
+			break;
+		    case "cancel":
+			button.onclick = function() {
+				self.close();
+				return false;
+			};
+			break;
+		}
+	}
+};
+
+PopupWin.prototype.showAtElement = function() {
+	var self = this;
+	// Mozilla needs some time to realize what's goin' on..
+	setTimeout(function() {
+		var w = self.content.offsetWidth + 4;
+		var h = self.content.offsetHeight + 4;
+		// size to content -- that's fuckin' buggy in all fuckin' browsers!!!
+		// so that we set a larger size for the dialog window and then center
+		// the element inside... phuck!
+
+		// center...
+		var el = self.content;
+		var s = el.style;
+		// s.width = el.offsetWidth + "px";
+		// s.height = el.offsetHeight + "px";
+		s.position = "absolute";
+		s.left = (w - el.offsetWidth) / 2 + "px";
+		s.top = (h - el.offsetHeight) / 2 + "px";
+		if (HTMLArea.is_gecko) {
+			self.window.innerWidth = w;
+			self.window.innerHeight = h;
+		} else {
+			self.window.resizeTo(w + 8, h + 35);
+		}
+	}, 25);
+};
Index: temp/trunk/html/test/naka/HTMLArea/examples/context-menu.html
===================================================================
--- temp/trunk/html/test/naka/HTMLArea/examples/context-menu.html	(revision 1694)
+++ temp/trunk/html/test/naka/HTMLArea/examples/context-menu.html	(revision 1694)
@@ -0,0 +1,95 @@
+<html>
+  <head>
+    <title>Test of ContextMenu plugin</title>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+    <script type="text/javascript">
+      _editor_url = "../";
+      _editor_lang = "en";
+    </script>
+
+    <!-- load the main HTMLArea file -->
+    <script type="text/javascript" src="../htmlarea.js"></script>
+
+    <script type="text/javascript">
+      HTMLArea.loadPlugin("ContextMenu");
+      HTMLArea.loadPlugin("TableOperations");
+
+      function initDocument() {
+        var editor = new HTMLArea("editor");
+        editor.registerPlugin(ContextMenu);
+        editor.registerPlugin(TableOperations);
+        editor.generate();
+      }
+    </script>
+
+  </head>
+
+  <body onload="initDocument()">
+    <h1>Test of ContextMenu plugin</h1>
+
+
+<textarea id="editor" style="height: 30em; width: 100%;">
+&lt;table border="1" style="border: 1px dotted rgb(0, 102, 255); width:
+100%; background-color: rgb(255, 204, 51); background-image: none; float:
+none; text-align: left; vertical-align: top; border-collapse: collapse;"
+summary="" cellspacing="" cellpadding="" frame="box"
+rules="all"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="border: 1px solid
+rgb(255, 0, 0); background-color: rgb(0, 51, 51); background-image: none;
+text-align: left; vertical-align: top;"&gt;&lt;a
+href="http://dynarch.com/mishoo/articles.epl?art_id=430"&gt;&lt;img
+src="http://127.0.0.1/~mishoo/htmlarea/examples/pieng.png" alt="" align=""
+border="0" hspace="0" vspace="0" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;td
+style="border: 1px solid rgb(255, 0, 0); background-color: rgb(255, 255, 0);
+background-image: none; text-align: left; vertical-align: top;"&gt;The
+article linked on the left image presents a script that allows Internet
+Explorer to use PNG images.  We hope to be able to implement IE PNG support
+in HTMLArea soon.&lt;br /&gt; &lt;br /&gt; Go on, right-click everywhere and
+test our new context menus.  And be thankful to &lt;a
+href="http://www.americanbible.org/"&gt;American Bible Society&lt;/a&gt; who
+sponsored the development, &lt;a
+href="http://dynarch.com/mishoo/"&gt;mishoo&lt;/a&gt; who made it happen and
+God, Who keeps mishoo alife. ;-)&lt;br /&gt; &lt;br /&gt;&lt;span
+style="font-style: italic;"&gt;P.S.&lt;/span&gt; No animals were harmed
+while producing this movie.&lt;br /&gt;
+&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border-style: none;
+background-color: rgb(255, 255, 51); background-image: none; text-align:
+left; vertical-align: top;"&gt;Welcome to HTMLArea, the best online
+editor.&lt;br /&gt;&lt;/td&gt;&lt;td&gt;HTMLArea is a project initiated by
+&lt;a href="http://interactivetools.com/"&gt;InteractiveTools.com&lt;/a&gt;.
+Other companies contributed largely by sponsoring the development of
+additional extensions.  Many thanks to:&lt;br /&gt; &lt;br
+style="font-family: courier new,courier,monospace;" /&gt; &lt;div
+style="margin-left: 40px;"&gt;&lt;a href="http://www.zapatec.com/"
+style="font-family: courier
+new,courier,monospace;"&gt;http://www.zapatec.com&lt;/a&gt;&lt;br
+style="font-family: courier new,courier,monospace;" /&gt; &lt;a
+href="http://www.americanbible.org/" style="font-family: courier
+new,courier,monospace;"&gt;http://www.americanbible.org&lt;/a&gt;&lt;br
+style="font-family: courier new,courier,monospace;" /&gt; &lt;a
+href="http://www.neomedia.ro/" style="font-family: courier
+new,courier,monospace;"&gt;http://www.neomedia.ro&lt;/a&gt;&lt;br
+style="font-family: courier new,courier,monospace;" /&gt; &lt;a
+href="http://www.os3.it/" style="font-family: courier
+new,courier,monospace;"&gt;http://www.os3.it&lt;/a&gt;&lt;br
+style="font-family: courier new,courier,monospace;" /&gt; &lt;a
+href="http://www.miro.com.au/" style="font-family: courier
+new,courier,monospace;"&gt;http://www.miro.com.au&lt;/a&gt;&lt;br
+style="font-family: courier new,courier,monospace;" /&gt; &lt;a
+href="http://www.thycotic.com/" style="font-family: courier
+new,courier,monospace;"&gt;http://www.thycotic.com&lt;/a&gt;&lt;br /&gt;
+&lt;/div&gt; &lt;br /&gt; and to all the posters at <a
+href="http://www.interactivetools.com/iforum/Open_Source_C3/htmlArea_v3.0_-_Alpha_Release_F14/
+">InteractiveTools</a> HTMLArea forums, whose feedback is continually
+useful in polishing HTMLArea.&lt;br /&gt; &lt;br /&gt;&lt;div
+style="text-align: right;"&gt;-- developers and maintainers of version 3,
+&lt;a href="http://dynarch.com/"&gt;dynarch.com&lt;/a&gt;.&lt;br
+/&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
+    </textarea>
+
+    <hr />
+    <address><a href="http://dynarch.com/mishoo/">Mihai Bazon</a></address>
+<!-- Created: Wed Oct  1 19:55:37 EEST 2003 -->
+<!-- hhmts start --> Last modified: Wed Jan 28 11:10:29 EET 2004 <!-- hhmts end -->
+<!-- doc-lang: English -->
+  </body>
+</html>
Index: temp/trunk/html/test/naka/HTMLArea/examples/index.html
===================================================================
--- temp/trunk/html/test/naka/HTMLArea/examples/index.html	(revision 1694)
+++ temp/trunk/html/test/naka/HTMLArea/examples/index.html	(revision 1694)
@@ -0,0 +1,40 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html> <head>
+<title>HTMLArea examples index</title>
+</head>
+
+<body>
+<h1>HTMLArea: auto-generated examples index</h1>
+
+<ul>
+  <li>
+    <a href="2-areas.html">2-areas.html</a>
+  </li>
+  <li>
+    <a href="context-menu.html">context-menu.html</a>
+  </li>
+  <li>
+    <a href="core.html">core.html</a>
+  </li>
+  <li>
+    <a href="css.html">css.html</a>
+  </li>
+  <li>
+    <a href="full-page.html">full-page.html</a>
+  </li>
+  <li>
+    <a href="fully-loaded.html">fully-loaded.html</a>
+  </li>
+  <li>
+    <a href="spell-checker.html">spell-checker.html</a>
+  </li>
+  <li>
+    <a href="table-operations.html">table-operations.html</a>
+  </li>
+</ul>
+
+<hr />
+<address>mishoo@infoiasi.ro</address>
+<!-- hhmts start --> Last modified: Sun Feb  1 13:30:39 EET 2004 <!-- hhmts end -->
+</body> </html>
+
Index: temp/trunk/html/test/naka/HTMLArea/examples/core.html
===================================================================
--- temp/trunk/html/test/naka/HTMLArea/examples/core.html	(revision 1694)
+++ temp/trunk/html/test/naka/HTMLArea/examples/core.html	(revision 1694)
@@ -0,0 +1,184 @@
+<html>
+<head>
+<title>Example of HTMLArea 3.0</title>
+
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+
+<!-- Configure the path to the editor.  We make it relative now, so that the
+    example ZIP file will work anywhere, but please NOTE THAT it's better to
+    have it an absolute path, such as '/htmlarea/'. -->
+<script type="text/javascript">
+  _editor_url = "../";
+  _editor_lang = "en";
+</script>
+<script type="text/javascript" src="../htmlarea.js"></script>
+
+<style type="text/css">
+html, body {
+  font-family: Verdana,sans-serif;
+  background-color: #fea;
+  color: #000;
+}
+a:link, a:visited { color: #00f; }
+a:hover { color: #048; }
+a:active { color: #f00; }
+
+textarea { background-color: #fff; border: 1px solid 00f; }
+</style>
+
+<script type="text/javascript">
+var editor = null;
+function initEditor() {
+  editor = new HTMLArea("ta");
+
+  // comment the following two lines to see how customization works
+  editor.generate();
+  return false;
+
+  var cfg = editor.config; // this is the default configuration
+  cfg.registerButton({
+    id        : "my-hilite",
+    tooltip   : "Highlight text",
+    image     : "ed_custom.gif",
+    textMode  : false,
+    action    : function(editor) {
+                  editor.surroundHTML("<span class=\"hilite\">", "</span>");
+                },
+    context   : 'table'
+  });
+
+  cfg.toolbar.push(["linebreak", "my-hilite"]); // add the new button to the toolbar
+
+  // BEGIN: code that adds a custom button
+  // uncomment it to test
+  var cfg = editor.config; // this is the default configuration
+  /*
+  cfg.registerButton({
+    id        : "my-hilite",
+    tooltip   : "Highlight text",
+    image     : "ed_custom.gif",
+    textMode  : false,
+    action    : function(editor) {
+                  editor.surroundHTML("<span class=\"hilite\">", "</span>");
+                }
+  });
+  */
+
+function clickHandler(editor, buttonId) {
+  switch (buttonId) {
+    case "my-toc":
+      editor.insertHTML("<h1>Table Of Contents</h1>");
+      break;
+    case "my-date":
+      editor.insertHTML((new Date()).toString());
+      break;
+    case "my-bold":
+      editor.execCommand("bold");
+      editor.execCommand("italic");
+      break;
+    case "my-hilite":
+      editor.surroundHTML("<span class=\"hilite\">", "</span>");
+      break;
+  }
+};
+cfg.registerButton("my-toc",  "Insert TOC", "ed_custom.gif", false, clickHandler);
+cfg.registerButton("my-date", "Insert date/time", "ed_custom.gif", false, clickHandler);
+cfg.registerButton("my-bold", "Toggle bold/italic", "ed_custom.gif", false, clickHandler);
+cfg.registerButton("my-hilite", "Hilite selection", "ed_custom.gif", false, clickHandler);
+
+cfg.registerButton("my-sample", "Class: sample", "ed_custom.gif", false,
+  function(editor) {
+    if (HTMLArea.is_ie) {
+      editor.insertHTML("<span class=\"sample\">&nbsp;&nbsp;</span>");
+      var r = editor._doc.selection.createRange();
+      r.move("character", -2);
+      r.moveEnd("character", 2);
+      r.select();
+    } else { // Gecko/W3C compliant
+      var n = editor._doc.createElement("span");
+      n.className = "sample";
+      editor.insertNodeAtSelection(n);
+      var sel = editor._iframe.contentWindow.getSelection();
+      sel.removeAllRanges();
+      var r = editor._doc.createRange();
+      r.setStart(n, 0);
+      r.setEnd(n, 0);
+      sel.addRange(r);
+    }
+  }
+);
+
+
+  /*
+  cfg.registerButton("my-hilite", "Highlight text", "ed_custom.gif", false,
+    function(editor) {
+      editor.surroundHTML('<span class="hilite">', '</span>');
+    }
+  );
+  */
+  cfg.pageStyle = "body { background-color: #efd; } .hilite { background-color: yellow; } "+
+                  ".sample { color: green; font-family: monospace; }";
+  cfg.toolbar.push(["linebreak", "my-toc", "my-date", "my-bold", "my-hilite", "my-sample"]); // add the new button to the toolbar
+  // END: code that adds a custom button
+
+  editor.generate();
+}
+function insertHTML() {
+  var html = prompt("Enter some HTML code here");
+  if (html) {
+    editor.insertHTML(html);
+  }
+}
+function highlight() {
+  editor.surroundHTML('<span style="background-color: yellow">', '</span>');
+}
+</script>
+
+</head>
+
+<!-- use <body onload="HTMLArea.replaceAll()" if you don't care about
+     customizing the editor.  It's the easiest way! :) -->
+<body onload="initEditor()">
+
+<h1>HTMLArea 3.0</h1>
+
+<p>A replacement for <code>TEXTAREA</code> elements.  &copy; <a
+href="http://interactivetools.com">InteractiveTools.com</a>, 2003-2004.</p>
+
+<form action="test.cgi" method="post" id="edit" name="edit">
+
+<textarea id="ta" name="ta" style="width:100%" rows="20" cols="80">
+  &lt;p&gt;Here is some sample text: &lt;b&gt;bold&lt;/b&gt;, &lt;i&gt;italic&lt;/i&gt;, &lt;u&gt;underline&lt;/u&gt;. &lt;/p&gt;
+  &lt;p align=center&gt;Different fonts, sizes and colors (all in bold):&lt;/p&gt;
+  &lt;p&gt;&lt;b&gt;
+   &lt;font face="arial"           size="7" color="#000066"&gt;arial&lt;/font&gt;,
+   &lt;font face="courier new"     size="6" color="#006600"&gt;courier new&lt;/font&gt;,
+   &lt;font face="georgia"         size="5" color="#006666"&gt;georgia&lt;/font&gt;,
+   &lt;font face="tahoma"          size="4" color="#660000"&gt;tahoma&lt;/font&gt;,
+   &lt;font face="times new roman" size="3" color="#660066"&gt;times new roman&lt;/font&gt;,
+   &lt;font face="verdana"         size="2" color="#666600"&gt;verdana&lt;/font&gt;,
+   &lt;font face="tahoma"          size="1" color="#666666"&gt;tahoma&lt;/font&gt;
+  &lt;/b&gt;&lt;/p&gt;
+  &lt;p&gt;Click on &lt;a href="http://www.interactivetools.com/"&gt;this link&lt;/a&gt; and then on the link button to the details ... OR ... select some text and click link to create a &lt;b&gt;new&lt;/b&gt; link.&lt;/p&gt;
+</textarea>
+
+<p />
+
+<input type="submit" name="ok" value="  submit  " />
+<input type="button" name="ins" value="  insert html  " onclick="return insertHTML();" />
+<input type="button" name="hil" value="  highlight text  " onclick="return highlight();" />
+
+<a href="javascript:mySubmit()">submit</a>
+
+<script type="text/javascript">
+function mySubmit() {
+// document.edit.save.value = "yes";
+document.edit.onsubmit(); // workaround browser bugs.
+document.edit.submit();
+};
+</script>
+
+</form>
+
+</body>
+</html>
Index: temp/trunk/html/test/naka/HTMLArea/examples/css.html
===================================================================
--- temp/trunk/html/test/naka/HTMLArea/examples/css.html	(revision 1694)
+++ temp/trunk/html/test/naka/HTMLArea/examples/css.html	(revision 1694)
@@ -0,0 +1,88 @@
+<html>
+  <head>
+    <title>Test of CSS plugin</title>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+    <script type="text/javascript">
+      _editor_url = "../";
+      _editor_lang = "en";
+    </script>
+
+    <!-- load the main HTMLArea files -->
+    <script type="text/javascript" src="../htmlarea.js"></script>
+
+    <script type="text/javascript">
+      HTMLArea.loadPlugin("CSS");
+
+      function initDocument() {
+        var editor = new HTMLArea("editor");
+        editor.config.pageStyle = "@import url(custom.css);";
+        editor.registerPlugin(CSS, {
+          combos : [
+            { label: "Syntax",
+                         // menu text       // CSS class
+              options: { "None"           : "",
+                         "Code" : "code",
+                         "String" : "string",
+                         "Comment" : "comment",
+                         "Variable name" : "variable-name",
+                         "Type" : "type",
+                         "Reference" : "reference",
+                         "Preprocessor" : "preprocessor",
+                         "Keyword" : "keyword",
+                         "Function name" : "function-name",
+                         "Html tag" : "html-tag",
+                         "Html italic" : "html-helper-italic",
+                         "Warning" : "warning",
+                         "Html bold" : "html-helper-bold"
+                       },
+              context: "pre"
+            },
+            { label: "Info",
+              options: { "None"           : "",
+                         "Quote"          : "quote",
+                         "Highlight"      : "highlight",
+                         "Deprecated"     : "deprecated"
+                       }
+            }
+          ]
+        });
+        editor.generate();
+      }
+    </script>
+
+  </head>
+
+  <body onload="initDocument()">
+    <h1>Test of FullPage plugin</h1>
+
+    <textarea id="editor" style="height: 30em; width: 100%;"
+>&lt;h1&gt;&lt;tt&gt;registerDropdown&lt;/tt&gt;&lt;/h1&gt;
+
+&lt;p&gt;Here's some sample code that adds a dropdown to the toolbar.  Go on, do
+        syntax highlighting on it ;-)&lt;/p&gt;
+
+&lt;pre&gt;var the_options = {
+	"Keyword"          : "keyword",
+	"Function name"    : "function-name",
+	"String"           : "string",
+	"Numeric"          : "integer",
+	"Variable name"    : "variable"
+};
+var css_class = {
+	id                 : "CSS-class",
+	tooltip            : i18n["tooltip"],
+	options            : the_options,
+	action             : function(editor) { self.onSelect(editor, this); }
+};
+cfg.registerDropdown(css_class);
+toolbar[0].unshift(["CSS-class"]);&lt;/pre&gt;
+
+&lt;p&gt;Easy, eh? ;-)&lt;/p&gt;</textarea>
+
+    <hr />
+    <address><a href="http://dynarch.com/mishoo/">Mihai Bazon</a></address>
+<!-- Created: Wed Oct  1 19:55:37 EEST 2003 -->
+<!-- hhmts start --> Last modified: Wed Jan 28 11:10:16 EET 2004 <!-- hhmts end -->
+<!-- doc-lang: English -->
+  </body>
+</html>
Index: temp/trunk/html/test/naka/HTMLArea/examples/table-operations.html
===================================================================
--- temp/trunk/html/test/naka/HTMLArea/examples/table-operations.html	(revision 1694)
+++ temp/trunk/html/test/naka/HTMLArea/examples/table-operations.html	(revision 1694)
@@ -0,0 +1,116 @@
+<html>
+<head>
+<title>Example of HTMLArea 3.0</title>
+
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+
+<!-- Configure the path to the editor.  We make it relative now, so that the
+    example ZIP file will work anywhere, but please NOTE THAT it's better to
+    have it an absolute path, such as '/htmlarea/'. -->
+<script type="text/javascript">
+  _editor_lang = "en";
+  _editor_url = "../";
+</script>
+<!-- load the main HTMLArea files -->
+<script type="text/javascript" src="../htmlarea.js"></script>
+
+<style type="text/css">
+html, body {
+  font-family: Verdana,sans-serif;
+  background-color: #fea;
+  color: #000;
+}
+a:link, a:visited { color: #00f; }
+a:hover { color: #048; }
+a:active { color: #f00; }
+
+textarea { background-color: #fff; border: 1px solid 00f; }
+</style>
+
+<script type="text/javascript">
+// load the plugin files
+HTMLArea.loadPlugin("TableOperations");
+
+var editor = null;
+function initEditor() {
+  // create an editor for the "ta" textbox
+  editor = new HTMLArea("ta");
+
+  // register the TableOperations plugin with our editor
+  editor.registerPlugin(TableOperations);
+
+  editor.generate();
+  return false;
+}
+
+function insertHTML() {
+  var html = prompt("Enter some HTML code here");
+  if (html) {
+    editor.insertHTML(html);
+  }
+}
+function highlight() {
+  editor.surroundHTML('<span style="background-color: yellow">', '</span>');
+}
+</script>
+
+</head>
+
+<!-- use <body onload="HTMLArea.replaceAll()" if you don't care about
+     customizing the editor.  It's the easiest way! :) -->
+<body onload="initEditor()">
+
+<h1>HTMLArea 3.0</h1>
+
+<p>A replacement for <code>TEXTAREA</code> elements.  &copy; <a
+href="http://interactivetools.com">InteractiveTools.com</a>, 2003-2004.</p>
+
+<p>Page that demonstrates the additional features of the
+<tt>TableOperations</tt> plugin (sponsored by <a
+href="http://www.bloki.com">Zapatec Inc.</a>).</p>
+
+<form action="test.cgi" method="post" id="edit" name="edit">
+
+<textarea id="ta" name="ta" style="width:100%" rows="24" cols="80">
+
+<h1>Plugin: <tt>TableOperations</tt></h1>
+
+<p>This page exemplifies the table operations toolbar, provided by the
+TableOperations plugin.</p>
+
+<p>Following there is a table.</p>
+
+<table border="1" style="border: 2px solid rgb(255, 0, 0); width: 80%; background-image: none; border-collapse: collapse; color: rgb(153, 102, 0); background-color: rgb(255, 255, 51);" align="center" cellspacing="2" cellpadding="1" summary="">
+  <caption>This <span style="font-weight: bold;">is</span> a table</caption>
+  <tbody>
+  <tr style="border-style: none; background-image: none; background-color: rgb(255, 255, 153);" char="." align="left" valign="middle"> <td>1.1</td> <td>1.2</td> <td>1.3</td> <td>1.4</td> </tr>
+  <tr> <td>2.1</td> <td style="border: 1px solid rgb(51, 51, 255); background-image: none; background-color: rgb(102, 255, 255); color: rgb(0, 0, 51);" char="." align="left" valign="middle">2.2</td> <td>2.3</td> <td>2.4</td> </tr>
+  <tr> <td>3.1</td> <td>3.2</td> <td style="border: 2px dashed rgb(51, 204, 102); background-image: none; background-color: rgb(102, 255, 153); color: rgb(0, 51, 0);" char="." align="left" valign="middle">3.3</td> <td>3.4</td> </tr>
+  <tr> <td style="background-color: rgb(255, 204, 51);">4.1</td> <td style="background-color: rgb(255, 204, 51);">4.2</td> <td style="background-color: rgb(255, 204, 51);">4.3</td> <td style="background-color: rgb(255, 204, 51);">4.4</td> </tr>
+  </tbody>
+</table>
+
+<p>Text after the table</p>
+
+</textarea>
+
+<p />
+
+<input type="submit" name="ok" value="  submit  " />
+<input type="button" name="ins" value="  insert html  " onclick="return insertHTML();" />
+<input type="button" name="hil" value="  highlight text  " onclick="return highlight();" />
+
+<a href="javascript:mySubmit()">submit</a>
+
+<script type="text/javascript">
+function mySubmit() {
+// document.edit.save.value = "yes";
+document.edit.onsubmit(); // workaround browser bugs.
+document.edit.submit();
+};
+</script>
+
+</form>
+
+</body>
+</html>
Index: temp/trunk/html/test/naka/HTMLArea/examples/2-areas.html
===================================================================
--- temp/trunk/html/test/naka/HTMLArea/examples/2-areas.html	(revision 1694)
+++ temp/trunk/html/test/naka/HTMLArea/examples/2-areas.html	(revision 1694)
@@ -0,0 +1,158 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html>
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+    <title>Example with 2 HTMLAreas in the same form</title>
+    <script type="text/javascript">
+      // the _editor_url is REQUIRED!  don't forget to set it.
+      _editor_url = "../";
+      // implicit language will be "en", but let's set it for brevity
+      _editor_lang = "en";
+    </script>
+    <script type="text/javascript" src="../htmlarea.js"></script>
+    <script type="text/javascript">
+      // load the plugins that we will use
+      // loading is necessary ONLY ONCE, regardless on how many editors you create
+      // basically calling the following functions will load the plugin files as if
+      // we would have wrote script src="..." but with easier and cleaner code
+      HTMLArea.loadPlugin("TableOperations");
+      HTMLArea.loadPlugin("SpellChecker");
+      HTMLArea.loadPlugin("CSS");
+
+      // this function will get called at body.onload
+      function initDocument() {
+        // cache these values as we need to pass it for both editors
+        var css_plugin_args = {
+          combos : [
+            { label: "Syntax",
+                         // menu text       // CSS class
+              options: { "None"           : "",
+                         "Code" : "code",
+                         "String" : "string",
+                         "Comment" : "comment",
+                         "Variable name" : "variable-name",
+                         "Type" : "type",
+                         "Reference" : "reference",
+                         "Preprocessor" : "preprocessor",
+                         "Keyword" : "keyword",
+                         "Function name" : "function-name",
+                         "Html tag" : "html-tag",
+                         "Html italic" : "html-helper-italic",
+                         "Warning" : "warning",
+                         "Html bold" : "html-helper-bold"
+                       },
+              context: "pre"
+            },
+            { label: "Info",
+              options: { "None"           : "",
+                         "Quote"          : "quote",
+                         "Highlight"      : "highlight",
+                         "Deprecated"     : "deprecated"
+                       }
+            }
+          ]
+        };
+
+        //---------------------------------------------------------------------
+        // GENERAL PATTERN
+        //
+	//  1. Instantitate an editor object.
+	//  2. Register plugins (note, it's required to have them loaded).
+	//  3. Configure any other items in editor.config.
+	//  4. generate() the editor
+	//
+	// The above are steps that you use to create one editor.  Nothing new
+	// so far.  In order to create more than one editor, you just have to
+	// repeat those steps for each of one.  Of course, you can register any
+	// plugins you want (no need to register the same plugins for all
+	// editors, and to demonstrate that we'll skip the TableOperations
+	// plugin for the second editor).  Just be careful to pass different
+	// ID-s in the constructor (you don't want to _even try_ to create more
+	// editors for the same TEXTAREA element ;-)).
+	//
+	// So much for the noise, see the action below.
+	//---------------------------------------------------------------------
+
+
+        //---------------------------------------------------------------------
+        // CREATE FIRST EDITOR
+        //
+        var editor1 = new HTMLArea("text-area-1");
+
+        // plugins must be registered _per editor_.  Therefore, we register
+        // plugins for the first editor here, and we will also do this for the
+        // second editor.
+        editor1.registerPlugin(TableOperations);
+        editor1.registerPlugin(SpellChecker);
+        editor1.registerPlugin(CSS, css_plugin_args);
+
+        // custom config must be done per editor.  Here we're importing the
+        // stylesheet used by the CSS plugin.
+        editor1.config.pageStyle = "@import url(custom.css);";
+
+        // generate first editor
+        editor1.generate();
+        //---------------------------------------------------------------------
+
+
+        //---------------------------------------------------------------------
+        // CREATE SECOND EDITOR
+        //
+        var editor2 = new HTMLArea("text-area-2");
+
+        // we are using the same plugins
+        editor2.registerPlugin(TableOperations);
+        editor2.registerPlugin(SpellChecker);
+        editor2.registerPlugin(CSS, css_plugin_args);
+
+        // import the CSS plugin styles
+        editor2.config.pageStyle = "@import url(custom.css);";
+
+        // generate the second editor
+        // IMPORTANT: if we don't give it a timeout, the first editor will
+        // not function in Mozilla.  Soon I'll think about starting to
+        // implement some kind of event that will fire when the editor
+        // finished creating, then we'll be able to chain the generate()
+        // calls in an elegant way.  But right now there's no other solution
+        // than the following.
+        setTimeout(function() {
+          editor2.generate();
+        }, 500);
+        //---------------------------------------------------------------------
+      };
+    </script>
+  </head>
+
+  <body onload="initDocument()">
+    <h1>Example with 2 HTMLAreas in the same form</h1>
+
+    <form action="2-areas.cgi" method="post" target="_blank">
+
+      <input type="submit" value=" Submit " />
+      <br />
+
+      <textarea id="text-area-1" name="text1" style="width: 100%; height: 12em">
+        &lt;h3&gt;HTMLArea #1&lt;/h3&gt;
+        &lt;p&gt;This will submit a field named &lt;em&gt;text1&lt;/em&gt;.&lt;/p&gt;
+      </textarea>
+
+      <br />
+
+      <textarea id="text-area-2" name="text2" style="width: 100%; height: 12em">
+        &lt;h3&gt;Second HTMLArea&lt;/h3&gt; &lt;p&gt;&lt;em&gt;text2&lt;/em&gt; submission.  Both are
+        located in the same FORM element and the script action is
+        2-areas.cgi (see it in the examples directory)&lt;/p&gt;
+      </textarea>
+
+      <br />
+      <input type="submit" value=" Submit " />
+
+    </form>
+
+    <hr>
+    <address><a href="http://dynarch.com/mishoo/">Mihai Bazon</a></address>
+<!-- Created: Fri Oct 31 09:37:10 EET 2003 -->
+<!-- hhmts start --> Last modified: Wed Jan 28 11:10:40 EET 2004 <!-- hhmts end -->
+<!-- doc-lang: English -->
+  </body>
+</html>
Index: temp/trunk/html/test/naka/HTMLArea/examples/full-page.html
===================================================================
--- temp/trunk/html/test/naka/HTMLArea/examples/full-page.html	(revision 1694)
+++ temp/trunk/html/test/naka/HTMLArea/examples/full-page.html	(revision 1694)
@@ -0,0 +1,75 @@
+<html>
+  <head>
+    <title>Test of FullPage plugin</title>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+    <script type="text/javascript">
+      _editor_url = "../";
+      _editor_lang = "en";
+    </script>
+
+    <!-- load the main HTMLArea files -->
+    <script type="text/javascript" src="../htmlarea.js"></script>
+
+    <script type="text/javascript">
+      HTMLArea.loadPlugin("FullPage");
+
+      function initDocument() {
+        var editor = new HTMLArea("editor");
+        editor.registerPlugin(FullPage);
+        editor.generate();
+      }
+    </script>
+
+  </head>
+
+  <body onload="initDocument()">
+    <h1>Test of FullPage plugin</h1>
+
+    <textarea id="editor" style="height: 30em; width: 100%;">
+      &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"&gt;
+      &lt;html&gt;
+        &lt;head&gt;
+          &lt;title&gt;FullPage plugin for HTMLArea&lt;/title&gt;
+          &lt;link rel="alternate stylesheet" href="http://dynarch.com/mishoo/css/dark.css" /&gt;
+          &lt;link rel="stylesheet" href="http://dynarch.com/mishoo/css/cool-light.css" /&gt;
+        &lt;/head&gt;
+        &lt;body style="background-color: #ddddee; color: #000077;"&gt;
+          &lt;table style="width:60%; height: 90%; margin: 2% auto 1% auto;" align="center" border="0" cellpadding="0" cellspacing="0"&gt;
+            &lt;tr&gt;
+              &lt;td style="background-color: #ddeedd; border: 2px solid #002; height: 1.5em; padding: 2px; font: bold 24px Verdana;"&gt;
+                FullPage plugin
+              &lt;/td&gt;
+            &lt;/tr&gt;
+            &lt;tr&gt;
+              &lt;td style="background-color: #fff; border: 1px solid #aab; padding: 1em 3em; font: 12px Verdana;"&gt;
+                &lt;p&gt;
+                  This plugin enables one to edit a full HTML file in &lt;a
+                    href="http://dynarch.com/htmlarea/"&gt;HTMLArea&lt;/a&gt;.  This is not
+                  normally possible with just the core editor since it only
+                  retrieves the HTML inside the &lt;code&gt;body&lt;/code&gt; tag.
+                &lt;/p&gt;
+                &lt;p&gt;
+                  It provides the ability to change the &lt;code&gt;DOCTYPE&lt;/code&gt; of
+                  the document, &lt;code&gt;body&lt;/code&gt; &lt;code&gt;bgcolor&lt;/code&gt; and
+                  &lt;code&gt;fgcolor&lt;/code&gt; attributes as well as to add additional
+                  &lt;code&gt;link&lt;/code&gt;-ed stylesheets.  Cool, eh?
+                &lt;/p&gt;
+                &lt;p&gt;
+                  The development of this plugin was initiated and sponsored by
+                  &lt;a href="http://thycotic.com"&gt;Thycotic Software Ltd.&lt;/a&gt;.
+                  That's also cool, isn't it? ;-)
+                &lt;/p&gt;
+              &lt;/td&gt;
+            &lt;/tr&gt;
+          &lt;/table&gt;
+        &lt;/body&gt;
+      &lt;/html&gt;
+    </textarea>
+
+    <hr />
+    <address><a href="http://dynarch.com/mishoo/">Mihai Bazon</a></address>
+<!-- Created: Wed Oct  1 19:55:37 EEST 2003 -->
+<!-- hhmts start --> Last modified: Wed Jan 28 11:10:07 EET 2004 <!-- hhmts end -->
+<!-- doc-lang: English -->
+  </body>
+</html>
Index: temp/trunk/html/test/naka/HTMLArea/examples/fully-loaded.html
===================================================================
--- temp/trunk/html/test/naka/HTMLArea/examples/fully-loaded.html	(revision 1694)
+++ temp/trunk/html/test/naka/HTMLArea/examples/fully-loaded.html	(revision 1694)
@@ -0,0 +1,248 @@
+<html>
+<head>
+<title>Example of HTMLArea 3.0</title>
+
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+
+<!-- Configure the path to the editor.  We make it relative now, so that the
+    example ZIP file will work anywhere, but please NOTE THAT it's better to
+    have it an absolute path, such as '/htmlarea/'. -->
+<script type="text/javascript">
+  _editor_url = "../";
+  _editor_lang = "en";
+</script>
+
+<!-- load the main HTMLArea file, this will take care of loading the CSS and
+    other required core scripts. -->
+<script type="text/javascript" src="../htmlarea.js"></script>
+
+<!-- load the plugins -->
+<script type="text/javascript">
+      // WARNING: using this interface to load plugin
+      // will _NOT_ work if plugins do not have the language
+      // loaded by HTMLArea.
+
+      // In other words, this function generates SCRIPT tags
+      // that load the plugin and the language file, based on the
+      // global variable HTMLArea.I18N.lang (defined in the lang file,
+      // in our case "lang/en.js" loaded above).
+
+      // If this lang file is not found the plugin will fail to
+      // load correctly and nothing will work.
+
+      HTMLArea.loadPlugin("TableOperations");
+      HTMLArea.loadPlugin("SpellChecker");
+      HTMLArea.loadPlugin("FullPage");
+      HTMLArea.loadPlugin("CSS");
+      HTMLArea.loadPlugin("ContextMenu");
+</script>
+
+<style type="text/css">
+html, body {
+  font-family: Verdana,sans-serif;
+  background-color: #fea;
+  color: #000;
+}
+a:link, a:visited { color: #00f; }
+a:hover { color: #048; }
+a:active { color: #f00; }
+
+textarea { background-color: #fff; border: 1px solid 00f; }
+</style>
+
+<script type="text/javascript">
+var editor = null;
+function initEditor() {
+
+  // create an editor for the "ta" textbox
+  editor = new HTMLArea("ta");
+
+  // register the FullPage plugin
+  editor.registerPlugin(FullPage);
+
+  // register the SpellChecker plugin
+  editor.registerPlugin(TableOperations);
+
+  // register the SpellChecker plugin
+  editor.registerPlugin(SpellChecker);
+
+  // register the CSS plugin
+  editor.registerPlugin(CSS, {
+    combos : [
+      { label: "Syntax:",
+                   // menu text       // CSS class
+        options: { "None"           : "",
+                   "Code" : "code",
+                   "String" : "string",
+                   "Comment" : "comment",
+                   "Variable name" : "variable-name",
+                   "Type" : "type",
+                   "Reference" : "reference",
+                   "Preprocessor" : "preprocessor",
+                   "Keyword" : "keyword",
+                   "Function name" : "function-name",
+                   "Html tag" : "html-tag",
+                   "Html italic" : "html-helper-italic",
+                   "Warning" : "warning",
+                   "Html bold" : "html-helper-bold"
+                 },
+        context: "pre"
+      },
+      { label: "Info:",
+        options: { "None"           : "",
+                   "Quote"          : "quote",
+                   "Highlight"      : "highlight",
+                   "Deprecated"     : "deprecated"
+                 }
+      }
+    ]
+  });
+
+  // add a contextual menu
+  editor.registerPlugin("ContextMenu");
+
+  // load the stylesheet used by our CSS plugin configuration
+  editor.config.pageStyle = "@import url(custom.css);";
+
+  setTimeout(function() {
+    editor.generate();
+  }, 500);
+  return false;
+}
+
+function insertHTML() {
+  var html = prompt("Enter some HTML code here");
+  if (html) {
+    editor.insertHTML(html);
+  }
+}
+function highlight() {
+  editor.surroundHTML('<span style="background-color: yellow">', '</span>');
+}
+</script>
+
+</head>
+
+<!-- use <body onload="HTMLArea.replaceAll()" if you don't care about
+     customizing the editor.  It's the easiest way! :) -->
+<body onload="initEditor()">
+
+<h1>HTMLArea 3.0</h1>
+
+<p>A replacement for <code>TEXTAREA</code> elements.  &copy; <a
+href="http://interactivetools.com">InteractiveTools.com</a>, 2003-2004.</p>
+
+<form action="test.cgi" method="post" id="edit" name="edit">
+
+<textarea id="ta" name="ta" style="width:100%" rows="24" cols="80">
+&lt;!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 3.2//EN"&gt;
+&lt;html&gt;
+
+&lt;head&gt;
+&lt;title&gt;Passing parameters to JavaScript code&lt;/title&gt;
+&lt;link rel="stylesheet" href="custom.css" /&gt;
+&lt;/head&gt;
+
+&lt;body&gt;
+&lt;h1&gt;Passing parameters to JavaScript code&lt;/h1&gt;
+
+&lt;p&gt;Sometimes we need to pass parameters to some JavaScript function that we
+wrote ourselves.  But sometimes it's simply more convenient to include the
+parameter not in the function call, but in the affected HTML elements.
+Usually, all JavaScript calls affect some element, right? ;-)&lt;/p&gt;
+
+&lt;p&gt;Well, here's an original way to do it.  Or at least, I think it's
+original.&lt;/p&gt;
+
+&lt;h2&gt;But first...&lt;/h2&gt;
+
+&lt;p&gt;... an example.  Why would I need such thing?  I have a JS function that
+is called on &lt;code&gt;BODY&lt;/code&gt; &lt;code&gt;onload&lt;/code&gt; handler.  This function
+tries to retrieve the element with the ID "conttoc" and, if present, it will
+&lt;a href="toc.epl" title="Automatic TOC generation"&gt;generate an index&lt;/a&gt;.
+The problem is, this function exists in some external JavaScript library
+that it's loaded in page.  I only needed to pass the parameter from
+&lt;em&gt;one&lt;/em&gt; page.  Thus, it makes sense to pass the parameter from the HTML
+code on &lt;em&gt;that&lt;/em&gt; page, not to affect the others.&lt;/p&gt;
+
+&lt;p&gt;The first idea that came to me was to use some attribute, like "id" or
+"class".  But "id" was locked already, it &lt;em&gt;had&lt;/em&gt; to be "conttoc".  Use
+"class"?  It's not elegant.. what if I really wanted to give it a class, at
+some point?&lt;/p&gt;
+
+&lt;h2&gt;The idea&lt;/h2&gt;
+
+&lt;p&gt;So I thought: what are the HTML elements that do not affect the page
+rendering in any way?  Well, comments.  I mean, &lt;em&gt;comments&lt;/em&gt;, HTML
+comments.  You know, like &lt;code&gt;&amp;lt;!-- this is a comment --&amp;gt;&lt;/code&gt;.&lt;/p&gt;
+
+&lt;p&gt;Though comments do not normally affect the way browser renders the page,
+they are still parsed and are part of the DOM, as well as any other node.
+But this mean that we can access comments from JavaScript code, just like we
+access any other element, right?  Which means that they &lt;em&gt;can&lt;/em&gt; affect
+the way that page finally appears ;-)&lt;/p&gt;
+
+&lt;h2&gt;The code&lt;/h2&gt;
+
+&lt;p&gt;The main part was the idea.  The code is simple ;-)  Suppose we have the
+following HTML code:&lt;/p&gt;
+
+&lt;pre class="code"&gt;&lt;span class="function-name"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html-tag"&gt;div&lt;/span&gt; &lt;span class="variable-name"&gt;id=&lt;/span&gt;&lt;span class="string"&gt;&amp;quot;conttoc&amp;quot;&lt;/span&gt;&lt;span class="paren-face-match"&gt;&amp;gt;&lt;/span&gt;&lt;span class="function-name"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html-tag"&gt;/div&lt;/span&gt;&lt;span class="function-name"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
+
+&lt;p&gt;and our function checks for the presence an element having the ID
+"conttoc", and generates a table of contents into it.  Our code will also
+check if the "conttoc" element's first child is a comment node, and if so
+will parse additional parameters from there, for instance, a desired prefix
+for the links that are to be generated into it.  Why did I need it?  Because
+if the page uses a &lt;code&gt;&amp;lt;base&amp;gt;&lt;/code&gt; element to specify the default
+link prefix, then links like "#gen1" generated by the &lt;a href="toc.epl"&gt;toc
+generator&lt;/a&gt; will not point to that same page as they should, but to the
+page reffered from &lt;code&gt;&amp;lt;base&amp;gt;&lt;/code&gt;.&lt;/p&gt;
+
+&lt;p&gt;So the HTML would now look like this:&lt;/p&gt;
+
+&lt;pre class="code"&gt;&lt;span class="function-name"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html-tag"&gt;div&lt;/span&gt; &lt;span class="variable-name"&gt;id=&lt;/span&gt;&lt;span class="string"&gt;&amp;quot;conttoc&amp;quot;&lt;/span&gt;&lt;span class="function-name"&gt;&amp;gt;&lt;/span&gt;&lt;span class="comment"&gt;&amp;lt;!-- base:link/prefix.html --&amp;gt;&lt;/span&gt;&lt;span class="paren-face-match"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html-tag"&gt;/div&lt;/span&gt;&lt;span class="paren-face-match"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
+
+&lt;p&gt;And our TOC generation function does something like this:&lt;/p&gt;
+
+&lt;pre class="code"&gt;&lt;span class="keyword"&gt;var&lt;/span&gt; &lt;span class="variable-name"&gt;element&lt;/span&gt; = getElementById(&amp;quot;&lt;span class="string"&gt;conttoc&lt;/span&gt;&amp;quot;);
+&lt;span class="keyword"&gt;if&lt;/span&gt; (element.firstChild &amp;amp;&amp;amp; element.firstChild.nodeType == 8) {
+  &lt;span class="comment"&gt;// 8 means Node.COMMENT_NODE.  We're using numeric values
+&lt;/span&gt;  &lt;span class="comment"&gt;// because IE6 does not support constant names.
+&lt;/span&gt;  &lt;span class="keyword"&gt;var&lt;/span&gt; &lt;span class="variable-name"&gt;parameters&lt;/span&gt; = element.firstChild.data;
+  &lt;span class="comment"&gt;// at this point &amp;quot;parameters&amp;quot; contains base:link/prefix.html
+&lt;/span&gt;  &lt;span class="comment"&gt;// ...
+&lt;/span&gt;}&lt;/pre&gt;
+
+&lt;p&gt;So we retrieved the value passed to the script from the HTML code.  This
+was the goal of this article.&lt;/p&gt;
+
+&lt;hr /&gt;
+&lt;address&gt;&lt;a href="http://students.infoiasi.ro/~mishoo/"&gt;Mihai Bazon&lt;/a&gt;&lt;/address&gt;
+&lt;!-- hhmts start --&gt; Last modified on Thu Apr  3 20:34:17 2003
+&lt;!-- hhmts end --&gt;
+&lt;!-- doc-lang: English --&gt;
+&lt;/body&gt;
+&lt;/html&gt;
+</textarea>
+
+<p />
+
+<input type="submit" name="ok" value="  submit  " />
+<input type="button" name="ins" value="  insert html  " onclick="return insertHTML();" />
+<input type="button" name="hil" value="  highlight text  " onclick="return highlight();" />
+
+<a href="javascript:mySubmit()">submit</a>
+
+<script type="text/javascript">
+function mySubmit() {
+// document.edit.save.value = "yes";
+document.edit.onsubmit(); // workaround browser bugs.
+document.edit.submit();
+};
+</script>
+
+</form>
+
+</body>
+</html>
Index: temp/trunk/html/test/naka/HTMLArea/examples/spell-checker.html
===================================================================
--- temp/trunk/html/test/naka/HTMLArea/examples/spell-checker.html	(revision 1694)
+++ temp/trunk/html/test/naka/HTMLArea/examples/spell-checker.html	(revision 1694)
@@ -0,0 +1,132 @@
+<html>
+<head>
+<title>Example of HTMLArea 3.0</title>
+
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+
+<!-- Configure the path to the editor.  We make it relative now, so that the
+    example ZIP file will work anywhere, but please NOTE THAT it's better to
+    have it an absolute path, such as '/htmlarea/'. -->
+<script type="text/javascript">
+  _editor_lang = "en";
+  _editor_url = "../";
+</script>
+<!-- load the main HTMLArea files -->
+<script type="text/javascript" src="../htmlarea.js"></script>
+
+<style type="text/css">
+html, body {
+  font-family: Verdana,sans-serif;
+  background-color: #fea;
+  color: #000;
+}
+a:link, a:visited { color: #00f; }
+a:hover { color: #048; }
+a:active { color: #f00; }
+
+textarea { background-color: #fff; border: 1px solid 00f; }
+</style>
+
+<script type="text/javascript">
+HTMLArea.loadPlugin("SpellChecker");
+var editor = null;
+function initEditor() {
+  // create an editor for the "ta" textbox
+  editor = new HTMLArea("ta");
+
+  // register the SpellChecker plugin
+  editor.registerPlugin(SpellChecker);
+
+  editor.generate();
+  return false;
+}
+
+function insertHTML() {
+  var html = prompt("Enter some HTML code here");
+  if (html) {
+    editor.insertHTML(html);
+  }
+}
+function highlight() {
+  editor.surroundHTML('<span style="background-color: yellow">', '</span>');
+}
+</script>
+
+</head>
+
+<!-- use <body onload="HTMLArea.replaceAll()" if you don't care about
+     customizing the editor.  It's the easiest way! :) -->
+<body onload="initEditor()">
+
+<h1>HTMLArea 3.0</h1>
+
+<p>A replacement for <code>TEXTAREA</code> elements.  &copy; <a
+href="http://interactivetools.com">InteractiveTools.com</a>, 2003-2004.</p>
+
+<p>Plugins:
+      <tt>SpellChecker</tt> (sponsored by <a
+        href="http://americanbible.org">American Bible Society</a>).
+</p>
+
+<form action="test.cgi" method="post" id="edit" name="edit">
+
+<textarea id="ta" name="ta" style="width:100%" rows="24" cols="80">
+
+<h1>The <tt>SpellChecker</tt> plugin</h1>
+
+      <p>This file deminstrates the <tt>SpellChecker</tt> plugin of
+      HTMLArea.  To inwoke the spell checkert you need to press the
+      <em>spell-check</em> buton in the toolbar.</p>
+
+      <p>The spell-checker uses a serverside script written in Perl.  The
+        Perl script calls <a href="http://aspell.net">aspell</a> for any
+        word in the text and reports wordz that aren't found in the
+        dyctionari.</p>
+
+      <p>The document that yu are reading now <b>intentionaly</b> containes
+        some errorz, so that you have something to corect ;-)</p>
+
+      <p>Credits for the <tt>SpellChecker</tt> plugin go to:</p>
+
+      <ul>
+
+        <li><a href="http://aspell.net">Aspell</a> -- spell
+          checker</li>
+
+        <li>The <a href="http://perl.org">Perl</a> programming language</li>
+
+        <li><tt><a
+              href="http://cpan.org/modules/by-module/Text/Text-Aspell-0.02.readme">Text::Aspell</a></tt>
+          -- Perl interface to Aspell</li>
+
+        <li><a href="http://americanbible.org">American Bible Society</a> --
+          for sponsoring the <tt>SpellChecker</tt> plugin for
+          <tt>HTMLArea</tt></li>
+
+        <li><a href="http://dynarch.com/mishoo/">Your humble servant</a> for
+          implementing it ;-)</li>
+
+      </ul>
+
+</textarea>
+
+<p />
+
+<input type="submit" name="ok" value="  submit  " />
+<input type="button" name="ins" value="  insert html  " onclick="return insertHTML();" />
+<input type="button" name="hil" value="  highlight text  " onclick="return highlight();" />
+
+<a href="javascript:mySubmit()">submit</a>
+
+<script type="text/javascript">
+function mySubmit() {
+// document.edit.save.value = "yes";
+document.edit.onsubmit(); // workaround browser bugs.
+document.edit.submit();
+};
+</script>
+
+</form>
+
+</body>
+</html>
Index: temp/trunk/html/test/naka/HTMLArea/license.txt
===================================================================
--- temp/trunk/html/test/naka/HTMLArea/license.txt	(revision 1694)
+++ temp/trunk/html/test/naka/HTMLArea/license.txt	(revision 1694)
@@ -0,0 +1,30 @@
+htmlArea License (based on BSD license)
+Copyright (c) 2002-2004, interactivetools.com, inc.
+Copyright (c) 2003-2004 dynarch.com
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+1) Redistributions of source code must retain the above copyright notice,
+   this list of conditions and the following disclaimer.
+
+2) Redistributions in binary form must reproduce the above copyright notice,
+   this list of conditions and the following disclaimer in the documentation
+   and/or other materials provided with the distribution.
+
+3) Neither the name of interactivetools.com, inc. nor the names of its
+   contributors may be used to endorse or promote products derived from this
+   software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGE.
Index: temp/trunk/html/test/naka/HTMLArea/lang/de.js
===================================================================
--- temp/trunk/html/test/naka/HTMLArea/lang/de.js	(revision 1694)
+++ temp/trunk/html/test/naka/HTMLArea/lang/de.js	(revision 1694)
@@ -0,0 +1,54 @@
+// german version for htmlArea v3.0 - Alpha Release
+// - translated by AtK<atk@chello.at>
+// term´s and licenses are equal to htmlarea!
+// translation improved by broxx<broxx@broxx.com>
+
+HTMLArea.I18N = {
+
+	// the following should be the filename without .js extension
+	// it will be used for automatically load plugin language.
+	lang: "de",
+
+	tooltips: {
+		bold:           "Fett",
+		italic:         "Kursiv",
+		underline:      "Unterstrichen",
+		strikethrough:  "Durchgestrichen",
+		subscript:      "Hochgestellt",
+		superscript:    "Tiefgestellt",
+		justifyleft:    "Links ausrichten",
+		justifycenter:  "Zentrieren",
+		justifyright:   "Rechts ausrichten",
+		justifyfull:    "Blocksatz",
+		orderedlist:    "Nummerierung",
+		unorderedlist:  "Aufzaehlungszeichen",
+		outdent:        "Einzug verkleinern",
+		indent:         "Einzug vergrössern",
+		forecolor:      "Text Farbe",
+		hilitecolor:    "Hintergrund Farbe",
+		horizontalrule: "Horizontale Linie",
+		createlink:     "Hyperlink einfuegen",
+		insertimage:    "Bild einfuegen",
+		inserttable:    "Tabelle einfuegen",
+		htmlmode:       "HTML Modus",
+		popupeditor:    "Editor im Popup öffnen",
+		about:          "Ueber HtmlArea",
+		showhelp:       "Hilfe",
+		textindicator:  "derzeitiger Stil",
+		undo:           "Rueckgaengig",
+		redo:           "Wiederholen",
+		cut:            "Ausschneiden",
+		copy:           "Kopieren",
+		paste:          "Einfuegen"
+	},
+  
+ buttons: {
+		"ok":           "OK",
+		"cancel":       "Abbrechen"
+	},
+
+	msg: {
+		"Path":         "Pfad",
+		"TEXT_MODE":    "Du befindest dich im HTML Modus.  Benuetze die [<>] Schaltflaeche um in den WYSIWIG-Modus zu wechseln."
+	}
+};
Index: temp/trunk/html/test/naka/HTMLArea/lang/gb.js
===================================================================
--- temp/trunk/html/test/naka/HTMLArea/lang/gb.js	(revision 1694)
+++ temp/trunk/html/test/naka/HTMLArea/lang/gb.js	(revision 1694)
@@ -0,0 +1,36 @@
+// I18N constants -- Chinese GB
+// by Dave Lo -- dlo@interactivetools.com
+HTMLArea.I18N = {
+
+	// the following should be the filename without .js extension
+	// it will be used for automatically load plugin language.
+	lang: "gb",
+
+	tooltips: {
+		bold:           "´ÖÌå",
+		italic:         "Ð±Ìå",
+		underline:      "µ×Ïß",
+		strikethrough:  "É¾³ýÏß",
+		subscript:      "ÏÂ±ê",
+		superscript:    "ÉÏ±ê",
+		justifyleft:    "Î»ÖÃ¿¿×ó",
+		justifycenter:  "Î»ÖÃ¾ÓÖÐ",
+		justifyright:   "Î»ÖÃ¿¿ÓÒ",
+		justifyfull:    "Î»ÖÃ×óÓÒÆ½µÈ",
+		orderedlist:    "Ë³ÐòÇåµ¥",
+		unorderedlist:  "ÎÞÐòÇåµ¥",
+		outdent:        "¼õÐ¡ÐÐÇ°¿Õ°×",
+		indent:         "¼Ó¿íÐÐÇ°¿Õ°×",
+		forecolor:      "ÎÄ×ÖÑÕÉ«",
+		backcolor:      "±³¾°ÑÕÉ«",
+		horizontalrule: "Ë®Æ½Ïß",
+		createlink:     "²åÈëÁ¬½á",
+		insertimage:    "²åÈëÍ¼ÐÎ",
+		inserttable:    "²åÈë±í¸ñ",
+		htmlmode:       "ÇÐ»»HTMLÔ­Ê¼Âë",
+		popupeditor:    "·Å´ó",
+		about:          "¹Øì¶ HTMLArea",
+		help:           "ËµÃ÷",
+		textindicator:  "×ÖÌåÀý×Ó"
+	}
+};
Index: temp/trunk/html/test/naka/HTMLArea/lang/ee.js
===================================================================
--- temp/trunk/html/test/naka/HTMLArea/lang/ee.js	(revision 1694)
+++ temp/trunk/html/test/naka/HTMLArea/lang/ee.js	(revision 1694)
@@ -0,0 +1,63 @@
+// I18N constants
+
+// LANG: "ee", ENCODING: UTF-8 | ISO-8859-1
+// Author: Martin Raie, <albertvill@hot.ee>
+
+// FOR TRANSLATORS:
+//
+//   1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE
+//      (at least a valid email address)
+//
+//   2. PLEASE TRY TO USE UTF-8 FOR ENCODING;
+//      (if this is not possible, please include a comment
+//       that states what encoding is necessary.)
+
+HTMLArea.I18N = {
+
+	// the following should be the filename without .js extension
+	// it will be used for automatically load plugin language.
+	lang: "ee",
+
+	tooltips: {
+		bold:           "Paks",
+		italic:         "Kursiiv",
+		underline:      "Allakriipsutatud",
+		strikethrough:  "Läbikriipsutatud",
+		subscript:      "Allindeks",
+		superscript:    "Ülaindeks",
+		justifyleft:    "Joonda vasakule",
+		justifycenter:  "Joonda keskele",
+		justifyright:   "Joonda paremale",
+		justifyfull:    "Rööpjoonda",
+		insertorderedlist:    "Nummerdus",
+		insertunorderedlist:  "Täpploend",
+		outdent:        "Vähenda taanet",
+		indent:         "Suurenda taanet",
+		forecolor:      "Fondi värv",
+		hilitecolor:    "Tausta värv",
+		inserthorizontalrule: "Horisontaaljoon",
+		createlink:     "Lisa viit",
+		insertimage:    "Lisa pilt",
+		inserttable:    "Lisa tabel",
+		htmlmode:       "HTML/tavaline vaade",
+		popupeditor:    "Suurenda toimeti aken",
+		about:          "Teave toimeti kohta",
+		showhelp:       "Spikker",
+		textindicator:  "Kirjastiil",
+		undo:           "Võta tagasi",
+		redo:           "Tee uuesti",
+		cut:            "Lõika",
+		copy:           "Kopeeri",
+		paste:          "Kleebi"
+	},
+
+	buttons: {
+		"ok":           "OK",
+		"cancel":       "Loobu"
+	},
+
+	msg: {
+		"Path":         "Path",
+		"TEXT_MODE":    "Sa oled tekstireziimis.  Kasuta nuppu [<>] lülitamaks tagasi WYSIWIG reziimi."
+	}
+};
Index: temp/trunk/html/test/naka/HTMLArea/lang/he.js
===================================================================
--- temp/trunk/html/test/naka/HTMLArea/lang/he.js	(revision 1694)
+++ temp/trunk/html/test/naka/HTMLArea/lang/he.js	(revision 1694)
@@ -0,0 +1,63 @@
+// I18N constants
+
+// LANG: "he", ENCODING: UTF-8
+// Author: Liron Newman, <plastish@ultinet.org>
+
+// FOR TRANSLATORS:
+//
+//   1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE
+//      (at least a valid email address)
+//
+//   2. PLEASE TRY TO USE UTF-8 FOR ENCODING;
+//      (if this is not possible, please include a comment
+//       that states what encoding is necessary.)
+
+HTMLArea.I18N = {
+
+	// the following should be the filename without .js extension
+	// it will be used for automatically load plugin language.
+	lang: "he",
+
+	tooltips: {
+		bold:           "מודגש",
+		italic:         "נטוי",
+		underline:      "קו תחתי",
+		strikethrough:  "קו אמצע",
+		subscript:      "כתב עילי",
+		superscript:    "כתב תחתי",
+		justifyleft:    " ישור לשמאל",
+		justifycenter:  "ישור למרכז",
+		justifyright:   "ישור לימין",
+		justifyfull:    "יישור לשורה מלאה",
+		orderedlist:    "רשימה ממוספרת",
+		unorderedlist:  "רשימה לא ממוספרת",
+		outdent:        "הקטן כניסה",
+		indent:         "הגדל כניסה",
+		forecolor:      "צבע גופן",
+		hilitecolor:    "צבע רקע",
+		horizontalrule: "קו אנכי",
+		createlink:     "הכנס היפר-קישור",
+		insertimage:    "הכנס תמונה",
+		inserttable:    "הכנס טבלה",
+		htmlmode:       "שנה מצב קוד HTML",
+		popupeditor:    "הגדל את העורך",
+		about:          "אודות עורך זה",
+		showhelp:       "עזרה לשימוש בעורך",
+		textindicator:  "סגנון נוכחי",
+		undo:           "מבטל את פעולתך האחרונה",
+		redo:           "מבצע מחדש את הפעולה האחרונה שביטלת",
+		cut:            "גזור בחירה",
+		copy:           "העתק בחירה",
+		paste:          "הדבק מהלוח"
+	},
+
+	buttons: {
+		"ok":           "OK",
+		"cancel":       "ביטול"
+	},
+
+	msg: {
+		"Path":         "נתיב עיצוב",
+		"TEXT_MODE":    "אתה במצב טקסט נקי (קוד). השתמש בכפתור [<>] כדי לחזור למצב WYSIWYG (תצוגת עיצוב)."
+	}
+};
Index: temp/trunk/html/test/naka/HTMLArea/lang/fi.js
===================================================================
--- temp/trunk/html/test/naka/HTMLArea/lang/fi.js	(revision 1694)
+++ temp/trunk/html/test/naka/HTMLArea/lang/fi.js	(revision 1694)
@@ -0,0 +1,46 @@
+// I18N constants
+
+HTMLArea.I18N = {
+
+	// the following should be the filename without .js extension
+	// it will be used for automatically load plugin language.
+	lang: "en",
+
+	tooltips: {
+		bold:           	"Lihavoitu",
+		italic:         	"Kursivoitu",
+		underline:      	"Alleviivattu",
+		strikethrough:  	"Yliviivattu",
+		subscript:      	"Alaindeksi",
+		superscript:    	"Yläindeksi",
+		justifyleft:    	"Tasaa vasemmat reunat",
+		justifycenter:  	"Keskitä",
+		justifyright:   	"Tasaa oikeat reunat",
+		justifyfull:    	"Tasaa molemmat reunat",
+		insertorderedlist: 	"Numerointi",
+		insertunorderedlist: 	"Luettelomerkit",
+		outdent:        	"Lisää sisennystä",
+		indent:         	"Pienennä sisennystä",
+		forecolor:      	"Fontin väri",
+		hilitecolor:    	"Taustaväri",
+		inserthorizontalrule: 	"Vaakaviiva",
+		createlink:     	"Lisää Linkki",
+		insertimage:    	"Lisää Kuva",
+		inserttable:    	"Lisää Taulu",
+		htmlmode:       	"HTML Lähdekoodi vs WYSIWYG",
+		popupeditor:    	"Suurenna Editori",
+		about:          	"Tietoja Editorista",
+		showhelp:           	"Näytä Ohje",
+		textindicator:  	"Nykyinen tyyli",
+		undo:           	"Peruuta viimeinen toiminto",
+		redo:           	"Palauta viimeinen toiminto",
+		cut:            	"Leikkaa maalattu",
+		copy:           	"Kopioi maalattu",
+		paste:          	"Liitä leikepyödältä"
+	},
+
+	buttons: {
+		"ok":           	"Hyväksy",
+		"cancel":       	"Peruuta"
+	}
+};
Index: temp/trunk/html/test/naka/HTMLArea/lang/nb.js
===================================================================
--- temp/trunk/html/test/naka/HTMLArea/lang/nb.js	(revision 1694)
+++ temp/trunk/html/test/naka/HTMLArea/lang/nb.js	(revision 1694)
@@ -0,0 +1,36 @@
+// I18N constants
+
+HTMLArea.I18N = {
+
+	// the following should be the filename without .js extension
+	// it will be used for automatically load plugin language.
+	lang: "nb",
+
+	tooltips: {
+		bold:           "Fet",
+		italic:         "Kursiv",
+		underline:      "Understreket",
+		strikethrough:  "Gjennomstreket",
+		subscript:      "Senket",
+		superscript:    "Hevet",
+		justifyleft:    "Venstrejuster",
+		justifycenter:  "Midtjuster",
+		justifyright:   "Høyrejuster",
+		justifyfull:    "Blokkjuster",
+		orderedlist:    "Nummerert liste",
+		unorderedlist:  "Punktmerket liste",
+		outdent:        "Øke innrykk",
+		indent:         "Reduser innrykk",
+		forecolor:      "Skriftfarge",
+		backcolor:      "Bakgrunnsfarge",
+		horizontalrule: "Horisontal linje",
+		createlink:     "Sett inn lenke",
+		insertimage:    "Sett inn bilde",
+		inserttable:    "Sett inn tabell",
+		htmlmode:       "Vis HTML kode",
+		popupeditor:    "Forstørr redigeringsvindu",
+		about:          "Om..",
+		help:           "Hjelp",
+		textindicator:  "Gjeldende stil"
+	}
+};
Index: temp/trunk/html/test/naka/HTMLArea/lang/ja-sjis.js
===================================================================
--- temp/trunk/html/test/naka/HTMLArea/lang/ja-sjis.js	(revision 1694)
+++ temp/trunk/html/test/naka/HTMLArea/lang/ja-sjis.js	(revision 1694)
@@ -0,0 +1,38 @@
+// I18N constants -- Japanese Shift-JIS
+// by Manabu Onoue -- tmocsys@tmocsys.com
+
+HTMLArea.I18N = {
+
+	// the following should be the filename without .js extension
+	// it will be used for automatically load plugin language.
+	lang: "ja-sjis",
+
+	tooltips: {
+		bold:           "¾",
+		italic:         "ÎÌ",
+		underline:      "ºü",
+		strikethrough:  "Å¿Áµü",
+		subscript:      "ºt«Y¦",
+		superscript:    "ãt«Y¦",
+		justifyleft:    "¶ñ¹",
+		justifycenter:  "ñ¹",
+		justifyright:   "Eñ¹",
+		justifyfull:    "Ït",
+		orderedlist:    "Ôt«Óð«",
+		unorderedlist:  "Lt«Óð«",
+		outdent:        "Cfgð",
+		indent:         "CfgÝè",
+		forecolor:      "¶F",
+		backcolor:      "wiF",
+		horizontalrule: "
+½ü",
+		createlink:     "Nì¬",
+		insertimage:    "æ}ü",
+		inserttable:    "e[u}ü",
+		htmlmode:       "HTML\¦ØÖ",
+		popupeditor:    "GfB^gå",
+		about:          "o[Wîñ",
+		help:           "wv",
+		textindicator:  "»ÝÌX^C"
+	}
+};
Index: temp/trunk/html/test/naka/HTMLArea/lang/el.js
===================================================================
--- temp/trunk/html/test/naka/HTMLArea/lang/el.js	(revision 1694)
+++ temp/trunk/html/test/naka/HTMLArea/lang/el.js	(revision 1694)
@@ -0,0 +1,75 @@
+// I18N constants
+
+// LANG: "el", ENCODING: UTF-8 | ISO-8859-7
+// Author: Dimitris Glezos, dimitris@glezos.com
+
+HTMLArea.I18N = {
+
+	// the following should be the filename without .js extension
+	// it will be used for automatically load plugin language.
+	lang: "el",
+
+	tooltips: {
+		bold:           "Έντονα",
+		italic:         "Πλάγια",
+		underline:      "Υπογραμμισμένα",
+		strikethrough:  "Διαγραμμένα",
+		subscript:      "Δείκτης",
+		superscript:    "Δείκτης",
+		justifyleft:    "Στοίχιση Αριστερά",
+		justifycenter:  "Στοίχιση Κέντρο",
+		justifyright:   "Στοίχιση Δεξιά",
+		justifyfull:    "Πλήρης Στοίχιση",
+		orderedlist:    "Αρίθμηση",
+		unorderedlist:  "Κουκκίδες",
+		outdent:        "Μείωση Εσοχής",
+		indent:         "Αύξηση Εσοχής",
+		forecolor:      "Χρώμα Γραμματοσειράς",
+		hilitecolor:    "Χρώμα Φόντου",
+		horizontalrule: "Οριζόντια Γραμμή",
+		createlink:     "Εισαγωγή Συνδέσμου",
+		insertimage:    "Εισαγωγή/Τροποποίηση Εικόνας",
+		inserttable:    "Εισαγωγή Πίνακα",
+		htmlmode:       "Εναλλαγή σε/από HTML",
+		popupeditor:    "Μεγένθυνση επεξεργαστή",
+		about:          "Πληροφορίες",
+		showhelp:       "Βοήθεια",
+		textindicator:  "Παρών στυλ",
+		undo:           "Αναίρεση τελευταίας ενέργειας",
+		redo:           "Επαναφορά από αναίρεση",
+		cut:            "Αποκοπή",
+		copy:           "Αντιγραφή",
+		paste:          "Επικόλληση",
+        lefttoright:    "Κατεύθυνση αριστερά προς δεξιά",
+        righttoleft:    "Κατεύθυνση από δεξιά προς τα αριστερά"
+	},
+
+	buttons: {
+		"ok":           "OK",
+		"cancel":       "Ακύρωση"
+	},
+
+	msg: {
+		"Path":         "Διαδρομή",
+		"TEXT_MODE":    "Είστε σε TEXT MODE.  Χρησιμοποιήστε το κουμπί [<>] για να επανέρθετε στο WYSIWIG.",
+
+       "IE-sucks-full-screen":	"Η κατάσταση πλήρης οθόνης έχει προβλήματα με τον Internet Explorer, " +
+       							"λόγω σφαλμάτων στον ίδιο τον browser.  Αν το σύστημα σας είναι Windows 9x " +
+       							"μπορεί και να χρειαστείτε reboot. Αν είστε σίγουροι, πατήστε ΟΚ."
+       },
+
+       dialogs: {
+               "Cancel"                                            : "Ακύρωση",
+               "Insert/Modify Link"                                : "Εισαγωγή/Τροποποίηση σύνδεσμου",
+               "New window (_blank)"                               : "Νέο παράθυρο (_blank)",
+               "None (use implicit)"                               : "Κανένα (χρήση απόλυτου)",
+               "OK"                                                : "Εντάξει",
+               "Other"                                             : "Αλλο",
+               "Same frame (_self)"                                : "Ίδιο frame (_self)",
+               "Target:"                                           : "Target:",
+               "Title (tooltip):"                                  : "Τίτλος (tooltip):",
+               "Top frame (_top)"                                  : "Πάνω frame (_top)",
+               "URL:"                                              : "URL:",
+               "You must enter the URL where this link points to"  : "Πρέπει να εισάγετε το URL που οδηγεί αυτός ο σύνδεσμος"
+       }
+};
Index: temp/trunk/html/test/naka/HTMLArea/lang/en.js
===================================================================
--- temp/trunk/html/test/naka/HTMLArea/lang/en.js	(revision 1694)
+++ temp/trunk/html/test/naka/HTMLArea/lang/en.js	(revision 1694)
@@ -0,0 +1,88 @@
+// I18N constants
+
+// LANG: "en", ENCODING: UTF-8 | ISO-8859-1
+// Author: Mihai Bazon, http://dynarch.com/mishoo
+
+// FOR TRANSLATORS:
+//
+//   1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE
+//      (at least a valid email address)
+//
+//   2. PLEASE TRY TO USE UTF-8 FOR ENCODING;
+//      (if this is not possible, please include a comment
+//       that states what encoding is necessary.)
+
+HTMLArea.I18N = {
+
+	// the following should be the filename without .js extension
+	// it will be used for automatically load plugin language.
+	lang: "en",
+
+	tooltips: {
+		bold:           "Bold",
+		italic:         "Italic",
+		underline:      "Underline",
+		strikethrough:  "Strikethrough",
+		subscript:      "Subscript",
+		superscript:    "Superscript",
+		justifyleft:    "Justify Left",
+		justifycenter:  "Justify Center",
+		justifyright:   "Justify Right",
+		justifyfull:    "Justify Full",
+		orderedlist:    "Ordered List",
+		unorderedlist:  "Bulleted List",
+		outdent:        "Decrease Indent",
+		indent:         "Increase Indent",
+		forecolor:      "Font Color",
+		hilitecolor:    "Background Color",
+		horizontalrule: "Horizontal Rule",
+		createlink:     "Insert Web Link",
+		insertimage:    "Insert/Modify Image",
+		inserttable:    "Insert Table",
+		htmlmode:       "Toggle HTML Source",
+		popupeditor:    "Enlarge Editor",
+		about:          "About this editor",
+		showhelp:       "Help using editor",
+		textindicator:  "Current style",
+		undo:           "Undoes your last action",
+		redo:           "Redoes your last action",
+		cut:            "Cut selection",
+		copy:           "Copy selection",
+		paste:          "Paste from clipboard",
+		lefttoright:    "Direction left to right",
+		righttoleft:    "Direction right to left"
+	},
+
+	buttons: {
+		"ok":           "OK",
+		"cancel":       "Cancel"
+	},
+
+	msg: {
+		"Path":         "Path",
+		"TEXT_MODE":    "You are in TEXT MODE.  Use the [<>] button to switch back to WYSIWYG.",
+
+		"IE-sucks-full-screen" :
+		// translate here
+		"The full screen mode is known to cause problems with Internet Explorer, " +
+		"due to browser bugs that we weren't able to workaround.  You might experience garbage " +
+		"display, lack of editor functions and/or random browser crashes.  If your system is Windows 9x " +
+		"it's very likely that you'll get a 'General Protection Fault' and need to reboot.\n\n" +
+		"You have been warned.  Please press OK if you still want to try the full screen editor."
+	},
+
+	dialogs: {
+		"Cancel"                                            : "Cancel",
+		"Insert/Modify Link"                                : "Insert/Modify Link",
+		"New window (_blank)"                               : "New window (_blank)",
+		"None (use implicit)"                               : "None (use implicit)",
+		"OK"                                                : "OK",
+		"Other"                                             : "Other",
+		"Same frame (_self)"                                : "Same frame (_self)",
+		"Target:"                                           : "Target:",
+		"Title (tooltip):"                                  : "Title (tooltip):",
+		"Top frame (_top)"                                  : "Top frame (_top)",
+		"URL:"                                              : "URL:",
+		"You must enter the URL where this link points to"  : "You must enter the URL where this link points to"
+	}
+};
Index: temp/trunk/html/test/naka/HTMLArea/lang/ja-euc.js
===================================================================
--- temp/trunk/html/test/naka/HTMLArea/lang/ja-euc.js	(revision 1694)
+++ temp/trunk/html/test/naka/HTMLArea/lang/ja-euc.js	(revision 1694)
@@ -0,0 +1,37 @@
+// I18N constants -- Japanese EUC
+// by Manabu Onoue -- tmocsys@tmocsys.com
+
+HTMLArea.I18N = {
+
+	// the following should be the filename without .js extension
+	// it will be used for automatically load plugin language.
+	lang: "ja-euc",
+
+	tooltips: {
+		bold:           "ÂÀ»ú",
+		italic:         "¼ÐÂÎ",
+		underline:      "²¼Àþ",
+		strikethrough:  "ÂÇ¤Á¾Ã¤·Àþ",
+		subscript:      "²¼ÉÕ¤­Åº¤¨»ú",
+		superscript:    "¾åÉÕ¤­Åº¤¨»ú",
+		justifyleft:    "º¸´ó¤»",
+		justifycenter:  "Ãæ±û´ó¤»",
+		justifyright:   "±¦´ó¤»",
+		justifyfull:    "¶ÑÅù³äÉÕ",
+		orderedlist:    "ÈÖ¹æÉÕ¤­²Õ¾ò½ñ¤­",
+		unorderedlist:  "µ­¹æÉÕ¤­²Õ¾ò½ñ¤­",
+		outdent:        "¥¤¥ó¥Ç¥ó¥È²ò½ü",
+		indent:         "¥¤¥ó¥Ç¥ó¥ÈÀßÄê",
+		forecolor:      "Ê¸»ú¿§",
+		backcolor:      "ÇØ·Ê¿§",
+		horizontalrule: "¿åÊ¿Àþ",
+		createlink:     "¥ê¥ó¥¯ºîÀ®",
+		insertimage:    "²èÁüÁÞÆþ",
+		inserttable:    "¥Æ¡¼¥Ö¥ëÁÞÆþ",
+		htmlmode:       "HTMLÉ½¼¨ÀÚÂØ",
+		popupeditor:    "¥¨¥Ç¥£¥¿³ÈÂç",
+		about:          "¥Ð¡¼¥¸¥ç¥ó¾ðÊó",
+		help:           "¥Ø¥ë¥×",
+		textindicator:  "¸½ºß¤Î¥¹¥¿¥¤¥ë"
+	}
+};
Index: temp/trunk/html/test/naka/HTMLArea/lang/b5.js
===================================================================
--- temp/trunk/html/test/naka/HTMLArea/lang/b5.js	(revision 1694)
+++ temp/trunk/html/test/naka/HTMLArea/lang/b5.js	(revision 1694)
@@ -0,0 +1,36 @@
+// I18N constants -- Chinese Big-5
+// by Dave Lo -- dlo@interactivetools.com
+HTMLArea.I18N = {
+
+	// the following should be the filename without .js extension
+	// it will be used for automatically load plugin language.
+	lang: "b5",
+
+	tooltips: {
+		bold:           "²ÊÅé",
+		italic:         "±×Åé",
+		underline:      "©³½u",
+		strikethrough:  "§R°£½u",
+		subscript:      "¤U¼Ð",
+		superscript:    "¤W¼Ð",
+		justifyleft:    "¦ì¸m¾a¥ª",
+		justifycenter:  "¦ì¸m©~¤¤",
+		justifyright:   "¦ì¸m¾a¥k",
+		justifyfull:    "¦ì¸m¥ª¥k¥­µ¥",
+		orderedlist:    "¶¶§Ç²M³æ",
+		unorderedlist:  "µL§Ç²M³æ",
+		outdent:        "´î¤p¦æ«eªÅ¥Õ",
+		indent:         "¥[¼e¦æ«eªÅ¥Õ",
+		forecolor:      "¤å¦rÃC¦â",
+		backcolor:      "­I´ºÃC¦â",
+		horizontalrule: "¤ô¥­½u",
+		createlink:     "´¡¤J³sµ²",
+		insertimage:    "´¡¤J¹Ï§Î",
+		inserttable:    "´¡¤Jªí®æ",
+		htmlmode:       "¤Á´«HTML­ì©l½X",
+		popupeditor:    "©ñ¤j",
+		about:          "Ãö©ó HTMLArea",
+		help:           "»¡©ú",
+		textindicator:  "¦rÅé¨Ò¤l"
+	}
+};
Index: temp/trunk/html/test/naka/HTMLArea/lang/pt_br.js
===================================================================
--- temp/trunk/html/test/naka/HTMLArea/lang/pt_br.js	(revision 1694)
+++ temp/trunk/html/test/naka/HTMLArea/lang/pt_br.js	(revision 1694)
@@ -0,0 +1,37 @@
+// I18N constants
+// Brazilian Portuguese Translation by Alex Piaz <webmaster@globalmap.com>
+
+HTMLArea.I18N = {
+
+	// the following should be the filename without .js extension
+	// it will be used for automatically load plugin language.
+	lang: "pt_br",
+
+	tooltips: {
+		bold:           "Negrito",
+		italic:         "Itálico",
+		underline:      "Sublinhado",
+		strikethrough:  "Tachado",
+		subscript:      "Subescrito",
+		superscript:    "Sobrescrito",
+		justifyleft:    "Alinhar à Esquerda",
+		justifycenter:  "Centralizar",
+		justifyright:   "Alinhar à Direita",
+		justifyfull:    "Justificar",
+		orderedlist:    "Lista Numerada",
+		unorderedlist:  "Lista Marcadores",
+		outdent:        "Diminuir Indentação",
+		indent:         "Aumentar Indentação",
+		forecolor:      "Cor da Fonte",
+		backcolor:      "Cor do Fundo",
+		horizontalrule: "Linha Horizontal",
+		createlink:     "Inserir Link",
+		insertimage:    "Inserir Imagem",
+		inserttable:    "Inserir Tabela",
+		htmlmode:       "Ver Código-Fonte",
+		popupeditor:    "Expandir Editor",
+		about:          "Sobre",
+		help:           "Ajuda",
+		textindicator:  "Estilo Atual"
+	}
+};
Index: temp/trunk/html/test/naka/HTMLArea/lang/fr.js
===================================================================
--- temp/trunk/html/test/naka/HTMLArea/lang/fr.js	(revision 1694)
+++ temp/trunk/html/test/naka/HTMLArea/lang/fr.js	(revision 1694)
@@ -0,0 +1,61 @@
+// I18N constants
+// Author: Jonathan Ernst, <Jonathan.Ernst@NetOxygen.ch>
+
+// FOR TRANSLATORS:
+//
+//   1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE
+//      (at least a valid email address)
+//
+//   2. PLEASE TRY TO USE UTF-8 FOR ENCODING;
+//      (if this is not possible, please include a comment
+//       that states what encoding is necessary.)
+
+HTMLArea.I18N = {
+
+	// the following should be the filename without .js extension
+	// it will be used for automatically load plugin language.
+	lang: "fr",
+
+	tooltips: {
+		bold:           "Gras",
+		italic:         "Italique",
+		underline:      "Souligné",
+		strikethrough:  "Barré",
+		subscript:      "Subscript",
+		superscript:    "Superscript",
+		justifyleft:    "Aligné à gauche",
+		justifycenter:  "Centré",
+		justifyright:   "Aligné à droite",
+		justifyfull:    "Justifié",
+		orderedlist:    "Numérotation",
+		unorderedlist:  "Puces",
+		outdent:        "Augmenter le retrait",
+		indent:         "Diminuer le retrait",
+		forecolor:      "Couleur du texte",
+		hilitecolor:    "Couleur du fond",
+		horizontalrule: "Ligne horizontale",
+		createlink:     "Insérer un lien",
+		insertimage:    "Insérer une image",
+		inserttable:    "Insérer un tableau",
+		htmlmode:       "Passer au code source HTML",
+		popupeditor:    "Agrandir l'éditeur",
+		about:          "A propos de cet éditeur",
+		showhelp:       "Aide sur l'éditeur",
+		textindicator:  "Style courant",
+		undo:           "Annule la dernière action",
+		redo:           "Refait la dernière action",
+		cut:            "Coupe la sélection",
+		copy:           "Copie la sélection",
+		paste:          "Colle depuis le presse papiers"
+	},
+
+	buttons: {
+		"ok":           "OK",
+		"cancel":       "Annuler"
+	},
+
+	msg: {
+		"Path":         "Chemin",
+		"TEXT_MODE":    "Vous êtes en mode texte.  Utilisez le bouton [<>] pour revenir au mode WYSIWIG."
+	}
+};
Index: temp/trunk/html/test/naka/HTMLArea/lang/es.js
===================================================================
--- temp/trunk/html/test/naka/HTMLArea/lang/es.js	(revision 1694)
+++ temp/trunk/html/test/naka/HTMLArea/lang/es.js	(revision 1694)
@@ -0,0 +1,51 @@
+// I18N constants
+
+HTMLArea.I18N = {
+
+	// the following should be the filename without .js extension
+	// it will be used for automatically load plugin language.
+	lang: "es",
+
+	tooltips: {
+		bold:           "Negrita",
+		italic:         "Cursiva",
+		underline:      "Subrayado",
+		strikethrough:  "Tachado",
+		subscript:      "Subíndice",
+		superscript:    "Superíndice",
+		justifyleft:    "Alinear a la Izquierda",
+		justifycenter:  "Centrar",
+		justifyright:   "Alinear a la Derecha",
+		justifyfull:    "Justificar",
+		insertorderedlist:    "Lista Ordenada",
+		insertunorderedlist:  "Lista No Ordenada",
+		outdent:        "Aumentar Sangría",
+		indent:         "Disminuir Sangría",
+		forecolor:      "Color del Texto",
+		hilitecolor:    "Color del Fondo",
+		inserthorizontalrule: "Línea Horizontal",
+		createlink:     "Insertar Enlace",
+		insertimage:    "Insertar Imagen",
+		inserttable:    "Insertar Tabla",
+		htmlmode:       "Ver Documento en HTML",
+		popupeditor:    "Ampliar Editor",
+		about:          "Acerca del Editor",
+		showhelp:       "Ayuda",
+		textindicator:  "Estilo Actual",
+		undo:           "Deshacer",
+		redo:           "Rehacer",
+		cut:            "Cortar selección",
+		copy:           "Copiar selección",
+		paste:          "Pegar desde el portapapeles"
+	},
+
+	buttons: {
+		"ok":           "Aceptar",
+		"cancel":       "Cancelar"
+	},
+
+	msg: {
+		"Path":         "Ruta",
+		"TEXT_MODE":    "Esta en modo TEXTO. Use el boton [<>] para cambiar a WYSIWIG",
+	}
+};
Index: temp/trunk/html/test/naka/HTMLArea/lang/se.js
===================================================================
--- temp/trunk/html/test/naka/HTMLArea/lang/se.js	(revision 1694)
+++ temp/trunk/html/test/naka/HTMLArea/lang/se.js	(revision 1694)
@@ -0,0 +1,38 @@
+// Swedish version for htmlArea v3.0 - Alpha Release
+// - translated by pat<pat@engvall.nu>
+// term´s and licenses are equal to htmlarea!
+
+HTMLArea.I18N = {
+
+	// the following should be the filename without .js extension
+	// it will be used for automatically load plugin language.
+	lang: "se",
+
+	tooltips: {
+		bold:           "Fet",
+		italic:         "Kursiv",
+		underline:      "Understruken",
+		strikethrough:  "Genomstruken",
+		subscript:      "Nedsänkt",
+		superscript:    "Upphöjd",
+		justifyleft:    "Vänsterjustera",
+		justifycenter:  "Centrera",
+		justifyright:   "Högerjustera",
+		justifyfull:    "Marginaljustera",
+		orderedlist:    "Numrerad lista",
+		unorderedlist:  "Punktlista",
+		outdent:        "Minska indrag",
+		indent:         "Öka indrag",
+		forecolor:      "Textfärg",
+		backcolor:      "Bakgrundsfärg",
+		horizontalrule: "Vågrät linje",
+		createlink:     "Infoga länk",
+		insertimage:    "Infoga bild",
+		inserttable:    "Infoga tabell",
+		htmlmode:       "Visa källkod",
+		popupeditor:    "Visa i eget fönster",
+		about:          "Om denna editor",
+		help:           "Hjälp",
+		textindicator:  "Nuvarande stil"
+	}
+};
Index: temp/trunk/html/test/naka/HTMLArea/lang/nl.js
===================================================================
--- temp/trunk/html/test/naka/HTMLArea/lang/nl.js	(revision 1694)
+++ temp/trunk/html/test/naka/HTMLArea/lang/nl.js	(revision 1694)
@@ -0,0 +1,90 @@
+// I18N constants
+
+// LANG: "nl", ENCODING: UTF-8 | ISO-8859-1
+// Author: Michel Weegeerink (info@mmc-shop.nl), http://mmc-shop.nl
+
+// FOR TRANSLATORS:
+//
+//   1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE
+//      (at least a valid email address)
+//
+//   2. PLEASE TRY TO USE UTF-8 FOR ENCODING;
+//      (if this is not possible, please include a comment
+//       that states what encoding is necessary.)
+
+HTMLArea.I18N = {
+
+	// the following should be the filename without .js extension
+	// it will be used for automatically load plugin language.
+	lang: "nl",
+
+	tooltips: {
+		bold:					"Vet",
+		italic:					"Cursief",
+		underline:				"Onderstrepen",
+		strikethrough:			"Doorhalen",
+		subscript:				"Subscript",
+		superscript:			"Superscript",
+		justifyleft:			"Links uitlijnen",
+		justifycenter:			"Centreren",
+		justifyright:			"Rechts uitlijnen",
+		justifyfull:			"Uitvullen",
+		insertorderedlist:		"Nummering",
+		insertunorderedlist:	"Opsommingstekens",
+		outdent:				"Inspringing verkleinen",
+		indent:					"Inspringing vergroten",
+		forecolor:				"Tekstkleur",
+		hilitecolor:			"Achtergrondkleur",
+		inserthorizontalrule:	"Horizontale lijn",
+		createlink:				"Hyperlink invoegen/aanpassen",
+		insertimage:			"Afbeelding invoegen/aanpassen",
+		inserttable:			"Tabel invoegen",
+		htmlmode:				"HTML broncode",
+		popupeditor:			"Vergroot Editor",
+		about:					"Over deze editor",
+		showhelp:				"HTMLArea help",
+		textindicator:			"Huidige stijl",
+		undo:					"Ongedaan maken",
+		redo:					"Herhalen",
+		cut:					"Knippen",
+		copy:					"Kopiëren",
+		paste:					"Plakken",
+		lefttoright:			"Tekstrichting links naar rechts",
+		righttoleft:			"Tekstrichting rechts naar links"
+	},
+
+	buttons: {
+		"ok":					"OK",
+		"cancel":				"Annuleren"
+	},
+
+	msg: {
+		"Path":					"Pad",
+		"TEXT_MODE":			"Je bent in TEKST-mode. Gebruik de [<>] knop om terug te keren naar WYSIWYG-mode.",
+      
+		"IE-sucks-full-screen" :
+		// translate here
+		"Fullscreen-mode veroorzaakt problemen met Internet Explorer door bugs in de webbrowser " +
+		"die we niet kunnen omzeilen. Hierdoor kunnen de volgende effecten optreden: verknoeide teksten, " +
+		"een verlies aan editor-functionaliteit en/of willekeurig vastlopen van de webbrowser. " +
+		"Als u Windows 95 of 98 gebruikt, is het zeer waarschijnlijk dat u een algemene beschermingsfout " +
+		"('General Protection Fault') krijgt en de computer opnieuw zal moeten opstarten.\n\n" +
+		"U bent gewaarschuwd. Druk OK als u toch nog de Fullscreen-editor wil gebruiken."
+	},
+
+	dialogs: {
+		"Cancel"                                            : "Annuleren",
+		"Insert/Modify Link"                                : "Hyperlink invoegen/aanpassen",
+		"New window (_blank)"                               : "Nieuw venster (_blank)",
+		"None (use implicit)"                               : "Geen",
+		"OK"                                                : "OK",
+		"Other"                                             : "Ander",
+		"Same frame (_self)"                                : "Zelfde frame (_self)",
+		"Target:"                                           : "Doel:",
+		"Title (tooltip):"                                  : "Titel (tooltip):",
+		"Top frame (_top)"                                  : "Bovenste frame (_top)",
+		"URL:"                                              : "URL:",
+		"You must enter the URL where this link points to"  : "Geef de URL in waar de link naar verwijst"
+	}
+};
+
Index: temp/trunk/html/test/naka/HTMLArea/lang/pl.js
===================================================================
--- temp/trunk/html/test/naka/HTMLArea/lang/pl.js	(revision 1694)
+++ temp/trunk/html/test/naka/HTMLArea/lang/pl.js	(revision 1694)
@@ -0,0 +1,36 @@
+// I18N constants
+
+HTMLArea.I18N = {
+
+	// the following should be the filename without .js extension
+	// it will be used for automatically load plugin language.
+	lang: "pl",
+
+	tooltips: {
+		bold:           "Pogrubienie",
+		italic:         "Pochylenie",
+		underline:      "Podkrelenie",
+		strikethrough:  "Przekrelenie",
+		subscript:      "Indeks dolny",
+		superscript:    "Indeks górny",
+		justifyleft:    "Wyrównaj do lewej",
+		justifycenter:  "Wyrodkuj",
+		justifyright:   "Wyrównaj do prawej",
+		justifyfull:    "Wyjustuj",
+		orderedlist:    "Numerowanie",
+		unorderedlist:  "Wypunktowanie",
+		outdent:        "Zmniejsz wciêcie",
+		indent:         "Zwiêksz wciêcie",
+		forecolor:      "Kolor czcionki",
+		backcolor:      "Kolor t³a",
+		horizontalrule: "Linia pozioma",
+		createlink:     "Wstaw adres sieci Web",
+		insertimage:    "Wstaw obraz",
+		inserttable:    "Wstaw tabelê",
+		htmlmode:       "Edycja WYSIWYG/w ródle strony",
+		popupeditor:    "Pe³ny ekran",
+		about:          "Informacje o tym edytorze",
+		help:           "Pomoc",
+		textindicator:  "Obecny styl"
+	}
+};
Index: temp/trunk/html/test/naka/HTMLArea/lang/si.js
===================================================================
--- temp/trunk/html/test/naka/HTMLArea/lang/si.js	(revision 1694)
+++ temp/trunk/html/test/naka/HTMLArea/lang/si.js	(revision 1694)
@@ -0,0 +1,63 @@
+// I18N constants
+
+// LANG: "si", ENCODING: ISO-8859-2
+// Author: Tomaz Kregar, x_tomo_x@email.si
+
+// FOR TRANSLATORS:
+//
+//   1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE
+//      (at least a valid email address)
+//
+//   2. PLEASE TRY TO USE UTF-8 FOR ENCODING;
+//      (if this is not possible, please include a comment
+//       that states what encoding is necessary.)
+
+HTMLArea.I18N = {
+
+	// the following should be the filename without .js extension
+	// it will be used for automatically load plugin language.
+	lang: "si",
+
+	tooltips: {
+		bold:           "Krepko",
+		italic:         "Le¾eèe",
+		underline:      "Podèrtano",
+		strikethrough:  "Preèrtano",
+		subscript:      "Podpisano",
+		superscript:    "Nadpisano",
+		justifyleft:    "Poravnaj levo",
+		justifycenter:  "Na sredino",
+		justifyright:   "Poravnaj desno",
+		justifyfull:    "Porazdeli vsebino",
+		orderedlist:    "O¹tevilèevanje",
+		unorderedlist:  "Oznaèevanje",
+		outdent:        "Zmanj¹aj zamik",
+		indent:         "Poveèaj zamik",
+		forecolor:      "Barva pisave",
+		hilitecolor:    "Barva ozadja",
+		horizontalrule: "Vodoravna èrta",
+		createlink:     "Vstavi hiperpovezavo",
+		insertimage:    "Vstavi sliko",
+		inserttable:    "Vstavi tabelo",
+		htmlmode:       "Preklopi na HTML kodo",
+		popupeditor:    "Poveèaj urejevalnik",
+		about:          "Vizitka za urejevalnik",
+		showhelp:       "Pomoè za urejevalnik",
+		textindicator:  "Trenutni slog",
+		undo:           "Razveljavi zadnjo akcijo",
+		redo:           "Uveljavi zadnjo akcijo",
+		cut:            "Izre¾i",
+		copy:           "Kopiraj",
+		paste:          "Prilepi"
+	},
+
+	buttons: {
+		"ok":           "V redu",
+		"cancel":       "Preklièi"
+	},
+
+	msg: {
+		"Path":         "Pot",
+		"TEXT_MODE":    "Si v tekstovnem naèinu.  Uporabi [<>] gumb za prklop nazaj na WYSIWYG."
+	}
+};
Index: temp/trunk/html/test/naka/HTMLArea/lang/it.js
===================================================================
--- temp/trunk/html/test/naka/HTMLArea/lang/it.js	(revision 1694)
+++ temp/trunk/html/test/naka/HTMLArea/lang/it.js	(revision 1694)
@@ -0,0 +1,54 @@
+// I18N constants
+
+// LANG: "it", ENCODING: UTF-8 | ISO-8859-1
+// Author: Fabio Rotondo <fabio@rotondo.it>
+
+HTMLArea.I18N = {
+
+	// the following should be the filename without .js extension
+	// it will be used for automatically load plugin language.
+	lang: "it",
+
+	tooltips: {
+		bold:           "Grassetto",
+		italic:         "Italico",
+		underline:      "Sottolineato",
+		strikethrough:  "Barrato",
+		subscript:      "Pedice",
+		superscript:    "Apice",
+		justifyleft:    "Giustifica a Sinistra",
+		justifycenter:  "Giustifica in Centro",
+		justifyright:   "Giustifica a Destra",
+		justifyfull:    "Giustifica Completamente",
+		orderedlist:    "Lista Ordinata",
+		unorderedlist:  "Lista Puntata",
+		outdent:        "Decrementa Indentazione",
+		indent:         "Incrementa Indentazione",
+		forecolor:      "Colore del Carattere",
+		hilitecolor:    "Colore di Sfondo",
+		horizontalrule: "Linea Orizzontale",
+		createlink:     "Inserisci un Link",
+		insertimage:    "Inserisci un'Immagine",
+		inserttable:    "Inserisci una Tabella",
+		htmlmode:       "Attiva il codice HTML",
+		popupeditor:    "Allarga l'editor",
+		about:          "Info sull'editor",
+		showhelp:       "Aiuto sull'editor",
+		textindicator:  "Stile Attuale",
+		undo:           "Elimina l'ultima modifica",
+		redo:           "Ripristina l'ultima modifica",
+		cut:            "Taglia l'area selezionata",
+		copy:           "Copia l'area selezionata",
+		paste:          "Incolla dalla memoria"
+	},
+
+	buttons: {
+		"ok":           "OK",
+		"cancel":       "Annulla"
+	},
+
+	msg: {
+		"Path":         "Percorso",
+		"TEXT_MODE":    "Sei in MODALITA' TESTO. Usa il bottone [<>] per tornare alla modalità WYSIWYG."
+	}
+};
Index: temp/trunk/html/test/naka/HTMLArea/lang/hu.js
===================================================================
--- temp/trunk/html/test/naka/HTMLArea/lang/hu.js	(revision 1694)
+++ temp/trunk/html/test/naka/HTMLArea/lang/hu.js	(revision 1694)
@@ -0,0 +1,63 @@
+// I18N constants
+
+// LANG: "hu", ENCODING: UTF-8
+// Author: Miklós Somogyi, <somogyine@vnet.hu>
+
+// FOR TRANSLATORS:
+//
+//   1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE
+//      (at least a valid email address)
+//
+//   2. PLEASE TRY TO USE UTF-8 FOR ENCODING;
+//      (if this is not possible, please include a comment
+//       that states what encoding is necessary.)
+
+HTMLArea.I18N = {
+
+	// the following should be the filename without .js extension
+	// it will be used for automatically load plugin language.
+	lang: "hu",
+
+	tooltips: {
+		bold:           "Félkövér",
+		italic:         "Dőlt",
+		underline:      "Aláhúzott",
+		strikethrough:  "Áthúzott",
+		subscript:      "Alsó index",
+		superscript:    "Felső index",
+		justifyleft:    "Balra zárt",
+		justifycenter:  "Középre zárt",
+		justifyright:   "Jobbra zárt",
+		justifyfull:    "Sorkizárt",
+		orderedlist:    "Számozott lista",
+		unorderedlist:  "Számozatlan lista",
+		outdent:        "Behúzás csökkentése",
+		indent:         "Behúzás növelése",
+		forecolor:      "Karakterszín",
+		hilitecolor:    "Háttérszín",
+		horizontalrule: "Elválasztó vonal",
+		createlink:     "Hiperhivatkozás beszúrása",
+		insertimage:    "Kép beszúrása",
+		inserttable:    "Táblázat beszúrása",
+		htmlmode:       "HTML forrás be/ki",
+		popupeditor:    "Szerkesztő külön ablakban",
+		about:          "Névjegy",
+		showhelp:       "Súgó",
+		textindicator:  "Aktuális stílus",
+		undo:           "Visszavonás",
+		redo:           "Újra végrehajtás",
+		cut:            "Kivágás",
+		copy:           "Másolás",
+		paste:          "Beillesztés"
+	},
+
+	buttons: {
+		"ok":           "Rendben",
+		"cancel":       "Mégsem"
+	},
+
+	msg: {
+		"Path":         "Hierarchia",
+		"TEXT_MODE":    "Forrás mód. Visszaváltás [<>] gomb"
+	}
+};
Index: temp/trunk/html/test/naka/HTMLArea/lang/cz.js
===================================================================
--- temp/trunk/html/test/naka/HTMLArea/lang/cz.js	(revision 1694)
+++ temp/trunk/html/test/naka/HTMLArea/lang/cz.js	(revision 1694)
@@ -0,0 +1,63 @@
+﻿// I18N constants
+
+// LANG: "cz", ENCODING: UTF-8 | ISO-8859-2
+// Author: Jiri Löw, <jirilow@jirilow.com>
+
+// FOR TRANSLATORS:
+//
+//   1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE
+//      (at least a valid email address)
+//
+//   2. PLEASE TRY TO USE UTF-8 FOR ENCODING;
+//      (if this is not possible, please include a comment
+//       that states what encoding is necessary.)
+
+HTMLArea.I18N = {
+
+	// the following should be the filename without .js extension
+	// it will be used for automatically load plugin language.
+	lang: "cz",
+
+	tooltips: {
+		bold:           "Tučně",
+		italic:         "Kurzíva",
+		underline:      "Podtržení",
+		strikethrough:  "Přeškrtnutí",
+		subscript:      "Dolní index",
+		superscript:    "Horní index",
+		justifyleft:    "Zarovnat doleva",
+		justifycenter:  "Na střed",
+		justifyright:   "Zarovnat doprava",
+		justifyfull:    "Zarovnat do stran",
+		orderedlist:    "Seznam",
+		unorderedlist:  "Odrážky",
+		outdent:        "Předsadit",
+		indent:         "Odsadit",
+		forecolor:      "Barva písma",
+		hilitecolor:    "Barva pozadí",
+		horizontalrule: "Vodorovná čára",
+		createlink:     "Vložit odkaz",
+		insertimage:    "Vložit obrázek",
+		inserttable:    "Vložit tabulku",
+		htmlmode:       "Přepnout HTML",
+		popupeditor:    "Nové okno editoru",
+		about:          "O této aplikaci",
+		showhelp:       "Nápověda aplikace",
+		textindicator:  "Zvolený styl",
+		undo:           "Vrátí poslední akci",
+		redo:           "Opakuje poslední akci",
+		cut:            "Vyjmout",
+		copy:           "Kopírovat",
+		paste:          "Vložit"
+	},
+
+	buttons: {
+		"ok":           "OK",
+		"cancel":       "Zrušit"
+	},
+
+	msg: {
+		"Path":         "Cesta",
+		"TEXT_MODE":    "Jste v TEXTOVÉM REŽIMU.  Použijte tlačítko [<>] pro přepnutí do WYSIWIG."
+	}
+};
Index: temp/trunk/html/test/naka/HTMLArea/lang/no.js
===================================================================
--- temp/trunk/html/test/naka/HTMLArea/lang/no.js	(revision 1694)
+++ temp/trunk/html/test/naka/HTMLArea/lang/no.js	(revision 1694)
@@ -0,0 +1,79 @@
+// Norwegian version for htmlArea v3.0 - pre1
+// - translated by ses<ses@online.no>
+// Additional translations by Håvard Wigtil <havardw@extend.no>
+// term´s and licenses are equal to htmlarea!
+
+HTMLArea.I18N = {
+
+	// the following should be the filename without .js extension
+	// it will be used for automatically load plugin language.
+	lang: "no",
+
+	tooltips: {
+		bold:                 "Fet",
+		italic:               "Kursiv",
+		underline:            "Understreket",
+		strikethrough:        "Gjennomstreket",
+		subscript:            "Nedsenket",
+		superscript:          "Opphøyet",
+		justifyleft:          "Venstrejuster",
+		justifycenter:        "Midtjuster",
+		justifyright:         "Høyrejuster",
+		justifyfull:          "Blokkjuster",
+		insertorderedlist:    "Nummerert liste",
+		insertunorderedlist:  "Punktliste",
+		outdent:              "Reduser innrykk",
+		indent:               "Øke innrykk",
+		forecolor:            "Tekstfarge",
+		hilitecolor:          "Bakgrundsfarge",
+		inserthorizontalrule: "Vannrett linje",
+		createlink:           "Lag lenke",
+		insertimage:          "Sett inn bilde",
+		inserttable:          "Sett inn tabell",
+		htmlmode:             "Vis kildekode",
+		popupeditor:          "Vis i eget vindu",
+		about:                "Om denne editor",
+		showhelp:             "Hjelp",
+		textindicator:        "Nåværende stil",
+                undo:                 "Angrer siste redigering",
+		redo:                 "Gjør om siste angring",
+		cut:                  "Klipp ut område",
+		copy:                 "Kopier område",
+		paste:                "Lim inn",
+		lefttoright:          "Fra venstre mot høyre",
+		righttoleft:          "Fra høyre mot venstre"
+	},
+    
+	buttons: {
+		"ok":           "OK",
+		"cancel":       "Avbryt"
+	},
+
+	msg: {
+		"Path":         "Tekstvelger",
+		"TEXT_MODE":    "Du er i tekstmodus  Klikk på [<>] for å gå tilbake til WYSIWIG.",
+                "IE-sucks-full-screen" :
+		// translate here
+                "Visning i eget vindu har kjente problemer med Internet Explorer, " + 
+                "på grunn av problemer med denne nettleseren. Mulige problemer er et uryddig " + 
+                "skjermbilde, manglende editorfunksjoner og/eller at nettleseren crasher. Hvis du bruker Windows 95 eller Windows 98 " +
+                "er det også muligheter for at Windows will crashe.\n\n" +
+                "Trykk 'OK' hvis du vil bruke visning i eget vindu på tross av denne advarselen."
+	},
+
+	dialogs: {
+		"Cancel"                                            : "Avbryt",
+		"Insert/Modify Link"                                : "Rediger lenke",
+		"New window (_blank)"                               : "Eget vindu (_blank)",
+		"None (use implicit)"                               : "Ingen (bruk standardinnstilling)",
+		"OK"                                                : "OK",
+		"Other"                                             : "Annen",
+		"Same frame (_self)"                                : "Samme ramme (_self)",
+		"Target:"                                           : "Mål:",
+		"Title (tooltip):"                                  : "Tittel (tooltip):",
+		"Top frame (_top)"                                  : "Toppramme (_top)",
+		"URL:"                                              : "Adresse:",
+		"You must enter the URL where this link points to"  : "Du må skrive inn en adresse som denne lenken skal peke til"
+	}
+};
+
Index: temp/trunk/html/test/naka/HTMLArea/lang/ja-jis.js
===================================================================
--- temp/trunk/html/test/naka/HTMLArea/lang/ja-jis.js	(revision 1694)
+++ temp/trunk/html/test/naka/HTMLArea/lang/ja-jis.js	(revision 1694)
@@ -0,0 +1,37 @@
+// I18N constants -- Japanese JIS
+// by Manabu Onoue -- tmocsys@tmocsys.com
+
+HTMLArea.I18N = {
+
+	// the following should be the filename without .js extension
+	// it will be used for automatically load plugin language.
+	lang: "ja-jis",
+
+	tooltips: {
+		bold:           "$BB@;z(B",
+		italic:         "$B<PBN(B",
+		underline:      "$B2<@~(B",
+		strikethrough:  "$BBG$A>C$7@~(B",
+		subscript:      "$B2<IU$-E:$(;z(B",
+		superscript:    "$B>eIU$-E:$(;z(B",
+		justifyleft:    "$B:84s$;(B",
+		justifycenter:  "$BCf1{4s$;(B",
+		justifyright:   "$B1&4s$;(B",
+		justifyfull:    "$B6QEy3dIU(B",
+		orderedlist:    "$BHV9fIU$-2U>r=q$-(B",
+		unorderedlist:  "$B5-9fIU$-2U>r=q$-(B",
+		outdent:        "$B%$%s%G%s%H2r=|(B",
+		indent:         "$B%$%s%G%s%H@_Dj(B",
+		forecolor:      "$BJ8;z?'(B",
+		backcolor:      "$BGX7J?'(B",
+		horizontalrule: "$B?eJ?@~(B",
+		createlink:     "$B%j%s%/:n@.(B",
+		insertimage:    "$B2hA|A^F~(B",
+		inserttable:    "$B%F!<%V%kA^F~(B",
+		htmlmode:       "HTML$BI=<(@ZBX(B",
+		popupeditor:    "$B%(%G%#%?3HBg(B",
+		about:          "$B%P!<%8%g%s>pJs(B",
+		help:           "$B%X%k%W(B",
+		textindicator:  "$B8=:_$N%9%?%$%k(B"
+	}
+};
Index: temp/trunk/html/test/naka/HTMLArea/lang/ja-utf8.js
===================================================================
--- temp/trunk/html/test/naka/HTMLArea/lang/ja-utf8.js	(revision 1694)
+++ temp/trunk/html/test/naka/HTMLArea/lang/ja-utf8.js	(revision 1694)
@@ -0,0 +1,37 @@
+﻿// I18N constants -- Japanese UTF-8
+// by Manabu Onoue -- tmocsys@tmocsys.com
+
+HTMLArea.I18N = {
+
+	// the following should be the filename without .js extension
+	// it will be used for automatically load plugin language.
+	lang: "ja-utf8",
+
+	tooltips: {
+		bold:           "太字",
+		italic:         "斜体",
+		underline:      "下線",
+		strikethrough:  "打ち消し線",
+		subscript:      "下付き添え字",
+		superscript:    "上付き添え字",
+		justifyleft:    "左寄せ",
+		justifycenter:  "中央寄せ",
+		justifyright:   "右寄せ",
+		justifyfull:    "均等割付",
+		orderedlist:    "番号付き箇条書き",
+		unorderedlist:  "記号付き箇条書き",
+		outdent:        "インデント解除",
+		indent:         "インデント設定",
+		forecolor:      "文字色",
+		backcolor:      "背景色",
+		horizontalrule: "水平線",
+		createlink:     "リンク作成",
+		insertimage:    "画像挿入",
+		inserttable:    "テーブル挿入",
+		htmlmode:       "HTML表示切替",
+		popupeditor:    "エディタ拡大",
+		about:          "バージョン情報",
+		help:           "ヘルプ",
+		textindicator:  "現在のスタイル"
+	}
+};
Index: temp/trunk/html/test/naka/HTMLArea/lang/lt.js
===================================================================
--- temp/trunk/html/test/naka/HTMLArea/lang/lt.js	(revision 1694)
+++ temp/trunk/html/test/naka/HTMLArea/lang/lt.js	(revision 1694)
@@ -0,0 +1,55 @@
+// I18N constants
+
+// LANG: "lt", ENCODING: UTF-8
+// Author: Jaroslav Šatkevič, <jaro@akl.lt>
+
+
+HTMLArea.I18N = {
+
+	// the following should be the filename without .js extension
+	// it will be used for automatically load plugin language.
+	lang: "lt",
+
+	tooltips: {
+		bold:           "Paryškinti",
+		italic:         "Kursyvas",
+		underline:      "Pabraukti",
+		strikethrough:  "Perbraukti",
+		subscript:      "Apatinis indeksas",
+		superscript:    "Viršutinis indeksas",
+		justifyleft:    "Lygiavimas pagal kairę",
+		justifycenter:  "Lygiavimas pagal centrą",
+		justifyright:   "Lygiavimas pagal dešinę",
+		justifyfull:    "Lygiuoti pastraipą",
+		orderedlist:    "Numeruotas sąrašas",
+		unorderedlist:  "Suženklintas sąrašas",
+		outdent:        "Sumažinti paraštę",
+		indent:         "Padidinti paraštę",
+		forecolor:      "Šrifto spalva",
+		hilitecolor:    "Fono spalva",
+		horizontalrule: "Horizontali linija",
+		createlink:     "Įterpti nuorodą",
+		insertimage:    "Įterpti paveiksliuką",
+		inserttable:    "Įterpti lentelę",
+		htmlmode:       "Perjungti į HTML/WYSIWYG",
+		popupeditor:    "Išplėstas redagavimo ekranas/Enlarge Editor",
+		about:          "Apie redaktorių",
+		showhelp:       "Pagalba naudojant redaktorių",
+		textindicator:  "Dabartinis stilius",
+		undo:           "Atšaukia paskutini jūsų veiksmą",
+		redo:           "Pakartoja paskutinį atšauktą jūsų veiksmą",
+		cut:            "Iškirpti",
+		copy:           "Kopijuoti",
+		paste:          "Įterpti"
+	},
+
+	buttons: {
+		"ok":           "OK",
+		"cancel":       "Atšaukti"
+	},
+
+	msg: {
+		"Path":         "Kelias",
+		"TEXT_MODE":    "Jūs esete teksto režime.  Naudokite [<>] mygtuką grįžimui į WYSIWYG."
+	}
+};
Index: temp/trunk/html/test/naka/HTMLArea/lang/ro.js
===================================================================
--- temp/trunk/html/test/naka/HTMLArea/lang/ro.js	(revision 1694)
+++ temp/trunk/html/test/naka/HTMLArea/lang/ro.js	(revision 1694)
@@ -0,0 +1,80 @@
+// I18N constants
+
+// LANG: "ro", ENCODING: UTF-8
+// Author: Mihai Bazon, http://dynarch.com/mishoo
+
+// FOR TRANSLATORS:
+//
+//   1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE
+//      (at least a valid email address)
+//
+//   2. PLEASE TRY TO USE UTF-8 FOR ENCODING;
+//      (if this is not possible, please include a comment
+//       that states what encoding is necessary.)
+
+HTMLArea.I18N = {
+
+	// the following should be the filename without .js extension
+	// it will be used for automatically load plugin language.
+	lang: "ro",
+
+	tooltips: {
+		bold:           "Îngroşat",
+		italic:         "Italic",
+		underline:      "Subliniat",
+		strikethrough:  "Tăiat",
+		subscript:      "Indice jos",
+		superscript:    "Indice sus",
+		justifyleft:    "Aliniere la stânga",
+		justifycenter:  "Aliniere pe centru",
+		justifyright:   "Aliniere la dreapta",
+		justifyfull:    "Aliniere în ambele părţi",
+		orderedlist:    "Listă ordonată",
+		unorderedlist:  "Listă marcată",
+		outdent:        "Micşorează alineatul",
+		indent:         "Măreşte alineatul",
+		forecolor:      "Culoarea textului",
+		hilitecolor:    "Culoare de fundal",
+		horizontalrule: "Linie orizontală",
+		createlink:     "Inserează/modifică link",
+		insertimage:    "Inserează/modifică imagine",
+		inserttable:    "Inserează un tabel",
+		htmlmode:       "Sursa HTML / WYSIWYG",
+		popupeditor:    "Maximizează editorul",
+		about:          "Despre editor",
+		showhelp:       "Documentaţie (devel)",
+		textindicator:  "Stilul curent",
+		undo:           "Anulează ultima acţiune",
+		redo:           "Reface ultima acţiune anulată",
+		cut:            "Taie în clipboard",
+		copy:           "Copie în clipboard",
+		paste:          "Aduce din clipboard",
+		lefttoright:    "Direcţia de scriere: stânga - dreapta",
+		righttoleft:    "Direcţia de scriere: dreapta - stânga"
+	},
+
+	buttons: {
+		"ok":           "OK",
+		"cancel":       "Anulează"
+	},
+
+	msg: {
+		"Path":         "Calea",
+		"TEXT_MODE":    "Eşti în modul TEXT.  Apasă butonul [<>] pentru a te întoarce în modul WYSIWYG."
+	},
+
+	dialogs: {
+		"Cancel"                                            : "Renunţă",
+		"Insert/Modify Link"                                : "Inserează/modifcă link",
+		"New window (_blank)"                               : "Fereastră nouă (_blank)",
+		"None (use implicit)"                               : "Nimic (foloseşte ce-i implicit)",
+		"OK"                                                : "Acceptă",
+		"Other"                                             : "Alt target",
+		"Same frame (_self)"                                : "Aceeaşi fereastră (_self)",
+		"Target:"                                           : "Ţinta:",
+		"Title (tooltip):"                                  : "Titlul (tooltip):",
+		"Top frame (_top)"                                  : "Fereastra principală (_top)",
+		"URL:"                                              : "URL:",
+		"You must enter the URL where this link points to"  : "Trebuie să introduceţi un URL"
+	}
+};
Index: temp/trunk/html/test/naka/HTMLArea/lang/lv.js
===================================================================
--- temp/trunk/html/test/naka/HTMLArea/lang/lv.js	(revision 1694)
+++ temp/trunk/html/test/naka/HTMLArea/lang/lv.js	(revision 1694)
@@ -0,0 +1,55 @@
+// I18N constants
+
+// LANG: "lv", ENCODING: UTF-8 | ISO-8859-1
+// Author: Mihai Bazon, http://dynarch.com/mishoo
+// Translated by: Janis Klavins, <janis.klavins@devia.lv>
+
+HTMLArea.I18N = {
+
+	// the following should be the filename without .js extension
+	// it will be used for automatically load plugin language.
+	lang: "lv",
+
+	tooltips: {
+		bold:           "Trekniem burtiem",
+		italic:         "Kursîvâ",
+		underline:      "Pasvîtrots",
+		strikethrough:  "Pârsvîtrots",
+		subscript:      "Novietot zem rindas",
+		superscript:    "Novietot virs rindas",
+		justifyleft:    "Izlîdzinât pa kreisi",
+		justifycenter:  "Izlîdzinât centrâ",
+		justifyright:   "Izlîdzinât pa labi",
+		justifyfull:    "Izlîdzinât pa visu lapu",
+		orderedlist:    "Numurçts saraksts",
+		unorderedlist:  "Saraksts",
+		outdent:        "Samazinât atkâpi",
+		indent:         "Palielinât atkâpi",
+		forecolor:      "Burtu krâsa",
+		hilitecolor:    "Fona krâsa",
+		horizontalrule: "Horizontâla atdalîtâjsvîtra",
+		createlink:     "Ievietot hipersaiti",
+		insertimage:    "Ievietot attçlu",
+		inserttable:    "Ievietot tabulu",
+		htmlmode:       "Skatît HTML kodu",
+		popupeditor:    "Palielinât Rediìçtâju",
+		about:          "Par ðo rediìçtâju",
+		showhelp:       "Rediìçtâja palîgs",
+		textindicator:  "Patreizçjais stils",
+		undo:           "Atcelt pçdçjo darbîbu",
+		redo:           "Atkârtot pçdçjo darbîbu",
+		cut:            "Izgriezt iezîmçto",
+		copy:           "Kopçt iezîmçto",
+		paste:          "Ievietot iezîmçto"
+	},
+
+	buttons: {
+		"ok":           "Labi",
+		"cancel":       "Atcelt"
+	},
+
+	msg: {
+		"Path":         "Ceïð",
+		"TEXT_MODE":    "Jûs patlaban darbojaties TEKSTA REÞÎMÂ. Lai pârietu atpakaï uz GRAFISKO REÞÎMU (WYSIWIG), lietojiet [<>] pogu."
+	}
+};
Index: temp/trunk/html/test/naka/HTMLArea/lang/vn.js
===================================================================
--- temp/trunk/html/test/naka/HTMLArea/lang/vn.js	(revision 1694)
+++ temp/trunk/html/test/naka/HTMLArea/lang/vn.js	(revision 1694)
@@ -0,0 +1,51 @@
+// I18N constants : Vietnamese
+// LANG: "en", ENCODING: UTF-8
+// Author: Nguyễn Đình Nam, <hncryptologist@yahoo.com>
+
+HTMLArea.I18N = {
+
+	// the following should be the filename without .js extension
+	// it will be used for automatically load plugin language.
+	lang: "vn",
+
+	tooltips: {
+		bold:           "Đậm",
+		italic:         "Nghiêng",
+		underline:      "Gạch Chân",
+		strikethrough:  "Gạch Xóa",
+		subscript:      "Viết Xuống Dưới",
+		superscript:    "Viết Lên Trên",
+		justifyleft:    "Căn Trái",
+		justifycenter:  "Căn Giữa",
+		justifyright:   "Căn Phải",
+		justifyfull:    "Căn Đều",
+		orderedlist:    "Danh Sách Có Thứ Tự",
+		unorderedlist:  "Danh Sách Phi Thứ Tự",
+		outdent:        "Lùi Ra Ngoài",
+		indent:         "Thụt Vào Trong",
+		forecolor:      "Màu Chữ",
+		backcolor:      "Màu Nền",
+		horizontalrule: "Dòng Kẻ Ngang",
+		createlink:     "Tạo Liên Kết",
+		insertimage:    "Chèn Ảnh",
+		inserttable:    "Chèn Bảng",
+		htmlmode:       "Chế Độ Mã HTML",
+		popupeditor:    "Phóng To Ô Soạn Thảo",
+		about:          "Tự Giới Thiệu",
+		showhelp:       "Giúp Đỡ",
+		textindicator:  "Định Dạng Hiện Thời",
+		undo:           "Undo",
+		redo:           "Redo",
+		cut:            "Cắt",
+		copy:           "Copy",
+		paste:          "Dán"
+	},
+	buttons: {
+		"ok":           "OK",
+		"cancel":       "Hủy"
+	},
+	msg: {
+		"Path":         "Đường Dẫn",
+		"TEXT_MODE":    "Bạn đang ở chế độ text.  Sử dụng nút [<>] để chuyển lại chế độ WYSIWIG."
+	}
+};
Index: temp/trunk/html/test/naka/HTMLArea/lang/da.js
===================================================================
--- temp/trunk/html/test/naka/HTMLArea/lang/da.js	(revision 1694)
+++ temp/trunk/html/test/naka/HTMLArea/lang/da.js	(revision 1694)
@@ -0,0 +1,38 @@
+// danish version for htmlArea v3.0 - Alpha Release
+// - translated by rene<rene@laerke.net>
+// term´s and licenses are equal to htmlarea!
+
+HTMLArea.I18N = {
+
+	// the following should be the filename without .js extension
+	// it will be used for automatically load plugin language.
+	lang: "da",
+
+	tooltips: {
+		bold:           "Fed",
+		italic:         "Kursiv",
+		underline:      "Understregning",
+		strikethrough:  "Overstregning ",
+		subscript:      "Sænket skrift",
+		superscript:    "Hævet skrift",
+		justifyleft:    "Venstrejuster",
+		justifycenter:  "Centrer",
+		justifyright:   "Højrejuster",
+		justifyfull:    "Lige margener",
+		orderedlist:    "Opstilling med tal",
+		unorderedlist:  "Opstilling med punkttegn",
+		outdent:        "Formindsk indrykning",
+		indent:         "Forøg indrykning",
+		forecolor:      "Skriftfarve",
+		backcolor:      "Baggrundsfarve",
+		horizontalrule: "Horisontal linie",
+		createlink:     "Indsæt hyperlink",
+		insertimage:    "Indsæt billede",
+		inserttable:    "Indsæt tabel",
+		htmlmode:       "HTML visning",
+		popupeditor:    "Vis editor i popup",
+		about:          "Om htmlarea",
+		help:           "Hjælp",
+		textindicator:  "Anvendt stil"
+	}
+};
Index: temp/trunk/html/test/naka/HTMLArea/lang/ru.js
===================================================================
--- temp/trunk/html/test/naka/HTMLArea/lang/ru.js	(revision 1694)
+++ temp/trunk/html/test/naka/HTMLArea/lang/ru.js	(revision 1694)
@@ -0,0 +1,63 @@
+﻿// I18N constants
+
+// LANG: "ru", ENCODING: UTF-8 | ISO-8859-1
+// Author: Yulya Shtyryakova, <yulya@vdcom.ru>
+
+// FOR TRANSLATORS:
+//
+//   1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE
+//      (at least a valid email address)
+//
+//   2. PLEASE TRY TO USE UTF-8 FOR ENCODING;
+//      (if this is not possible, please include a comment
+//       that states what encoding is necessary.)
+
+HTMLArea.I18N = {
+
+	// the following should be the filename without .js extension
+	// it will be used for automatically load plugin language.
+	lang: "ru",
+
+	tooltips: {
+		bold:           "Полужирный",
+		italic:         "Наклонный",
+		underline:      "Подчеркнутый",
+		strikethrough:  "Перечеркнутый",
+		subscript:      "Нижний индекс",
+		superscript:    "Верхний индекс",
+		justifyleft:    "По левому краю",
+		justifycenter:  "По центру",
+		justifyright:   "По правому краю",
+		justifyfull:    "По ширине",
+		insertorderedlist:    "Нумерованный лист",
+		insertunorderedlist:  "Маркированный лист",
+		outdent:        "Уменьшить отступ",
+		indent:         "Увеличить отступ",
+		forecolor:      "Цвет шрифта",
+		hilitecolor:    "Цвет фона",
+		horizontalrule: "Горизонтальный разделитель",
+		createlink:     "Вставить гиперссылку",
+		insertimage:    "Вставить изображение",
+		inserttable:    "Вставить таблицу",
+		htmlmode:       "Показать Html-код",
+		popupeditor:    "Увеличить редактор",
+		about:          "О редакторе",
+		showhelp:       "Помощь",
+		textindicator:  "Текущий стиль",
+		undo:           "Отменить",
+		redo:           "Повторить",
+		cut:            "Вырезать",
+		copy:           "Копировать",
+		paste:          "Вставить"
+	},
+
+	buttons: {
+		"ok":           "OK",
+		"cancel":       "Отмена"
+	},
+
+	msg: {
+		"Path":         "Путь",
+		"TEXT_MODE":    "Вы в режиме отображения Html-кода. нажмите кнопку [<>], чтобы переключиться в визуальный режим."
+	}
+};
Index: temp/trunk/html/test/naka/HTMLArea/plugins/CSS/css.js
===================================================================
--- temp/trunk/html/test/naka/HTMLArea/plugins/CSS/css.js	(revision 1694)
+++ temp/trunk/html/test/naka/HTMLArea/plugins/CSS/css.js	(revision 1694)
@@ -0,0 +1,116 @@
+// Simple CSS (className) plugin for the editor
+// Sponsored by http://www.miro.com.au
+// Implementation by Mihai Bazon, http://dynarch.com/mishoo.
+//
+// (c) dynarch.com 2003
+// Distributed under the same terms as HTMLArea itself.
+// This notice MUST stay intact for use (see license.txt).
+//
+// $Id$
+
+function CSS(editor, params) {
+	this.editor = editor;
+	var cfg = editor.config;
+	var toolbar = cfg.toolbar;
+	var self = this;
+	var i18n = CSS.I18N;
+	var plugin_config = params[0];
+	var combos = plugin_config.combos;
+
+	var first = true;
+	for (var i = combos.length; --i >= 0;) {
+		var combo = combos[i];
+		var id = "CSS-class" + i;
+		var css_class = {
+			id         : id,
+			options    : combo.options,
+			action     : function(editor) { self.onSelect(editor, this, combo.context, combo.updatecontextclass); },
+			refresh    : function(editor) { self.updateValue(editor, this); },
+			context    : combo.context
+		};
+		cfg.registerDropdown(css_class);
+
+		// prepend to the toolbar
+		toolbar[1].splice(0, 0, first ? "separator" : "space");
+		toolbar[1].splice(0, 0, id);
+		if (combo.label)
+			toolbar[1].splice(0, 0, "T[" + combo.label + "]");
+		first = false;
+	}
+};
+
+CSS._pluginInfo = {
+	name          : "CSS",
+	version       : "1.0",
+	developer     : "Mihai Bazon",
+	developer_url : "http://dynarch.com/mishoo/",
+	c_owner       : "Mihai Bazon",
+	sponsor       : "Miro International",
+	sponsor_url   : "http://www.miro.com.au",
+	license       : "htmlArea"
+};
+
+CSS.prototype.onSelect = function(editor, obj, context, updatecontextclass) {
+	var tbobj = editor._toolbarObjects[obj.id];
+	var index = tbobj.element.selectedIndex;
+	var className = tbobj.element.value;
+
+	// retrieve parent element of the selection
+	var parent = editor.getParentElement();
+	var surround = true;
+
+	var is_span = (parent && parent.tagName.toLowerCase() == "span");
+	var update_parent = (context && updatecontextclass && parent && parent.tagName.toLowerCase() == context);
+
+	if (update_parent) {
+		parent.className = className;
+		editor.updateToolbar();
+		return;
+	}
+
+	if (is_span && index == 0 && !/\S/.test(parent.style.cssText)) {
+		while (parent.firstChild) {
+			parent.parentNode.insertBefore(parent.firstChild, parent);
+		}
+		parent.parentNode.removeChild(parent);
+		editor.updateToolbar();
+		return;
+	}
+
+	if (is_span) {
+		// maybe we could simply change the class of the parent node?
+		if (parent.childNodes.length == 1) {
+			parent.className = className;
+			surround = false;
+			// in this case we should handle the toolbar updation
+			// ourselves.
+			editor.updateToolbar();
+		}
+	}
+
+	// Other possibilities could be checked but require a lot of code.  We
+	// can't afford to do that now.
+	if (surround) {
+		// shit happens ;-) most of the time.  this method works, but
+		// it's dangerous when selection spans multiple block-level
+		// elements.
+		editor.surroundHTML("<span class='" + className + "'>", "</span>");
+	}
+};
+
+CSS.prototype.updateValue = function(editor, obj) {
+	var select = editor._toolbarObjects[obj.id].element;
+	var parent = editor.getParentElement();
+	if (typeof parent.className != "undefined" && /\S/.test(parent.className)) {
+		var options = select.options;
+		var value = parent.className;
+		for (var i = options.length; --i >= 0;) {
+			var option = options[i];
+			if (value == option.value) {
+				select.selectedIndex = i;
+				return;
+			}
+		}
+	}
+	select.selectedIndex = 0;
+};
Index: temp/trunk/html/test/naka/HTMLArea/plugins/CSS/lang/en.js
===================================================================
--- temp/trunk/html/test/naka/HTMLArea/plugins/CSS/lang/en.js	(revision 1694)
+++ temp/trunk/html/test/naka/HTMLArea/plugins/CSS/lang/en.js	(revision 1694)
@@ -0,0 +1,2 @@
+// none yet; this file is a stub.
+CSS.I18N = {};
Index: temp/trunk/html/test/naka/HTMLArea/plugins/ContextMenu/context-menu.js
===================================================================
--- temp/trunk/html/test/naka/HTMLArea/plugins/ContextMenu/context-menu.js	(revision 1694)
+++ temp/trunk/html/test/naka/HTMLArea/plugins/ContextMenu/context-menu.js	(revision 1694)
@@ -0,0 +1,416 @@
+// Context Menu Plugin for HTMLArea-3.0
+// Sponsored by www.americanbible.org
+// Implementation by Mihai Bazon, http://dynarch.com/mishoo/
+//
+// (c) dynarch.com 2003.
+// Distributed under the same terms as HTMLArea itself.
+// This notice MUST stay intact for use (see license.txt).
+//
+// $Id$
+
+HTMLArea.loadStyle("menu.css", "ContextMenu");
+
+function ContextMenu(editor) {
+	this.editor = editor;
+};
+
+ContextMenu._pluginInfo = {
+	name          : "ContextMenu",
+	version       : "1.0",
+	developer     : "Mihai Bazon",
+	developer_url : "http://dynarch.com/mishoo/",
+	c_owner       : "dynarch.com",
+	sponsor       : "American Bible Society",
+	sponsor_url   : "http://www.americanbible.org",
+	license       : "htmlArea"
+};
+
+ContextMenu.prototype.onGenerate = function() {
+	var self = this;
+	var doc = this.editordoc = this.editor._iframe.contentWindow.document;
+	HTMLArea._addEvents(doc, ["contextmenu"],
+			    function (event) {
+				    return self.popupMenu(HTMLArea.is_ie ? self.editor._iframe.contentWindow.event : event);
+			    });
+	this.currentMenu = null;
+};
+
+ContextMenu.prototype.getContextMenu = function(target) {
+	var self = this;
+	var editor = this.editor;
+	var config = editor.config;
+	var menu = [];
+	var tbo = this.editor.plugins.TableOperations;
+	if (tbo) tbo = tbo.instance;
+	var i18n = ContextMenu.I18N;
+
+	var selection = editor.hasSelectedText();
+	if (selection)
+		menu.push([ i18n["Cut"], function() { editor.execCommand("cut"); }, null, config.btnList["cut"][1] ],
+			  [ i18n["Copy"], function() { editor.execCommand("copy"); }, null, config.btnList["copy"][1] ]);
+	menu.push([ i18n["Paste"], function() { editor.execCommand("paste"); }, null, config.btnList["paste"][1] ]);
+
+	var currentTarget = target;
+	var elmenus = [];
+
+	var link = null;
+	var table = null;
+	var tr = null;
+	var td = null;
+	var img = null;
+
+	function tableOperation(opcode) {
+		tbo.buttonPress(editor, opcode);
+	};
+
+	for (; target; target = target.parentNode) {
+		var tag = target.tagName;
+		if (!tag)
+			continue;
+		tag = tag.toLowerCase();
+		switch (tag) {
+		    case "img":
+			img = target;
+			elmenus.push(null,
+				     [ i18n["Image Properties"],
+				       function() {
+					       editor._insertImage(img);
+				       },
+				       i18n["Show the image properties dialog"],
+				       config.btnList["insertimage"][1] ]
+				);
+			break;
+		    case "a":
+			link = target;
+			elmenus.push(null,
+				     [ i18n["Modify Link"],
+				       function() { editor.execCommand("createlink", true); },
+				       i18n["Current URL is"] + ': ' + link.href,
+				       config.btnList["createlink"][1] ],
+
+				     [ i18n["Check Link"],
+				       function() { window.open(link.href); },
+				       i18n["Opens this link in a new window"] ],
+
+				     [ i18n["Remove Link"],
+				       function() {
+					       if (confirm(i18n["Please confirm that you want to unlink this element."] + "\n" +
+							   i18n["Link points to:"] + " " + link.href)) {
+						       while (link.firstChild)
+							       link.parentNode.insertBefore(link.firstChild, link);
+						       link.parentNode.removeChild(link);
+					       }
+				       },
+				       i18n["Unlink the current element"] ]
+				);
+			break;
+		    case "td":
+			td = target;
+			if (!tbo) break;
+			elmenus.push(null,
+				     [ i18n["Cell Properties"],
+				       function() { tableOperation("TO-cell-prop"); },
+				       i18n["Show the Table Cell Properties dialog"],
+				       config.btnList["TO-cell-prop"][1] ]
+				);
+			break;
+		    case "tr":
+			tr = target;
+			if (!tbo) break;
+			elmenus.push(null,
+				     [ i18n["Row Properties"],
+				       function() { tableOperation("TO-row-prop"); },
+				       i18n["Show the Table Row Properties dialog"],
+				       config.btnList["TO-row-prop"][1] ],
+
+				     [ i18n["Insert Row Before"],
+				       function() { tableOperation("TO-row-insert-above"); },
+				       i18n["Insert a new row before the current one"],
+				       config.btnList["TO-row-insert-above"][1] ],
+
+				     [ i18n["Insert Row After"],
+				       function() { tableOperation("TO-row-insert-under"); },
+				       i18n["Insert a new row after the current one"],
+				       config.btnList["TO-row-insert-under"][1] ],
+
+				     [ i18n["Delete Row"],
+				       function() { tableOperation("TO-row-delete"); },
+				       i18n["Delete the current row"],
+				       config.btnList["TO-row-delete"][1] ]
+				);
+			break;
+		    case "table":
+			table = target;
+			if (!tbo) break;
+			elmenus.push(null,
+				     [ i18n["Table Properties"],
+				       function() { tableOperation("TO-table-prop"); },
+				       i18n["Show the Table Properties dialog"],
+				       config.btnList["TO-table-prop"][1] ],
+
+				     [ i18n["Insert Column Before"],
+				       function() { tableOperation("TO-col-insert-before"); },
+				       i18n["Insert a new column before the current one"],
+				       config.btnList["TO-col-insert-before"][1] ],
+
+				     [ i18n["Insert Column After"],
+				       function() { tableOperation("TO-col-insert-after"); },
+				       i18n["Insert a new column after the current one"],
+				       config.btnList["TO-col-insert-after"][1] ],
+
+				     [ i18n["Delete Column"],
+				       function() { tableOperation("TO-col-delete"); },
+				       i18n["Delete the current column"],
+				       config.btnList["TO-col-delete"][1] ]
+				);
+			break;
+		    case "body":
+			elmenus.push(null,
+				     [ i18n["Justify Left"],
+				       function() { editor.execCommand("justifyleft"); }, null,
+				       config.btnList["justifyleft"][1] ],
+				     [ i18n["Justify Center"],
+				       function() { editor.execCommand("justifycenter"); }, null,
+				       config.btnList["justifycenter"][1] ],
+				     [ i18n["Justify Right"],
+				       function() { editor.execCommand("justifyright"); }, null,
+				       config.btnList["justifyright"][1] ],
+				     [ i18n["Justify Full"],
+				       function() { editor.execCommand("justifyfull"); }, null,
+				       config.btnList["justifyfull"][1] ]
+				);
+			break;
+		}
+	}
+
+	if (selection && !link)
+		menu.push(null, [ i18n["Make link"],
+				  function() { editor.execCommand("createlink", true); },
+				  i18n["Create a link"],
+				  config.btnList["createlink"][1] ]);
+
+	for (var i in elmenus)
+		menu.push(elmenus[i]);
+
+	menu.push(null,
+		  [ i18n["Remove the"] + " &lt;" + currentTarget.tagName + "&gt; " + i18n["Element"],
+		    function() {
+			    if (confirm(i18n["Please confirm that you want to remove this element:"] + " " + currentTarget.tagName)) {
+				    var el = currentTarget;
+				    var p = el.parentNode;
+				    p.removeChild(el);
+				    if (HTMLArea.is_gecko) {
+					    if (p.tagName.toLowerCase() == "td" && !p.hasChildNodes())
+						    p.appendChild(editor._doc.createElement("br"));
+					    editor.forceRedraw();
+					    editor.focusEditor();
+					    editor.updateToolbar();
+					    if (table) {
+						    var save_collapse = table.style.borderCollapse;
+						    table.style.borderCollapse = "collapse";
+						    table.style.borderCollapse = "separate";
+						    table.style.borderCollapse = save_collapse;
+					    }
+				    }
+			    }
+		    },
+		    i18n["Remove this node from the document"] ]);
+	return menu;
+};
+
+ContextMenu.prototype.popupMenu = function(ev) {
+	var self = this;
+	var i18n = ContextMenu.I18N;
+	if (this.currentMenu)
+		this.currentMenu.parentNode.removeChild(this.currentMenu);
+	function getPos(el) {
+		var r = { x: el.offsetLeft, y: el.offsetTop };
+		if (el.offsetParent) {
+			var tmp = getPos(el.offsetParent);
+			r.x += tmp.x;
+			r.y += tmp.y;
+		}
+		return r;
+	};
+	function documentClick(ev) {
+		ev || (ev = window.event);
+		if (!self.currentMenu) {
+			alert(i18n["How did you get here? (Please report!)"]);
+			return false;
+		}
+		var el = HTMLArea.is_ie ? ev.srcElement : ev.target;
+		for (; el != null && el != self.currentMenu; el = el.parentNode);
+		if (el == null)
+			self.closeMenu();
+		//HTMLArea._stopEvent(ev);
+		//return false;
+	};
+	var keys = [];
+	function keyPress(ev) {
+		ev || (ev = window.event);
+		HTMLArea._stopEvent(ev);
+		if (ev.keyCode == 27) {
+			self.closeMenu();
+			return false;
+		}
+		var key = String.fromCharCode(HTMLArea.is_ie ? ev.keyCode : ev.charCode).toLowerCase();
+		for (var i = keys.length; --i >= 0;) {
+			var k = keys[i];
+			if (k[0].toLowerCase() == key)
+				k[1].__msh.activate();
+		}
+	};
+	self.closeMenu = function() {
+		self.currentMenu.parentNode.removeChild(self.currentMenu);
+		self.currentMenu = null;
+		HTMLArea._removeEvent(document, "mousedown", documentClick);
+		HTMLArea._removeEvent(self.editordoc, "mousedown", documentClick);
+		if (keys.length > 0)
+			HTMLArea._removeEvent(self.editordoc, "keypress", keyPress);
+		if (HTMLArea.is_ie)
+			self.iePopup.hide();
+	};
+	var target = HTMLArea.is_ie ? ev.srcElement : ev.target;
+	var ifpos = getPos(self.editor._iframe);
+	var x = ev.clientX + ifpos.x;
+	var y = ev.clientY + ifpos.y;
+
+	var div;
+	var doc;
+	if (!HTMLArea.is_ie) {
+		doc = document;
+	} else {
+		// IE stinks
+		var popup = this.iePopup = window.createPopup();
+		doc = popup.document;
+		doc.open();
+		doc.write("<html><head><style type='text/css'>@import url(" + _editor_url + "plugins/ContextMenu/menu.css); html, body { padding: 0px; margin: 0px; overflow: hidden; border: 0px; }</style></head><body unselectable='yes'></body></html>");
+		doc.close();
+	}
+	div = doc.createElement("div");
+	if (HTMLArea.is_ie)
+		div.unselectable = "on";
+	div.oncontextmenu = function() { return false; };
+	div.className = "htmlarea-context-menu";
+	if (!HTMLArea.is_ie)
+		div.style.left = div.style.top = "0px";
+	doc.body.appendChild(div);
+
+	var table = doc.createElement("table");
+	div.appendChild(table);
+	table.cellSpacing = 0;
+	table.cellPadding = 0;
+	var parent = doc.createElement("tbody");
+	table.appendChild(parent);
+
+	var options = this.getContextMenu(target);
+	for (var i = 0; i < options.length; ++i) {
+		var option = options[i];
+		var item = doc.createElement("tr");
+		parent.appendChild(item);
+		if (HTMLArea.is_ie)
+			item.unselectable = "on";
+		else item.onmousedown = function(ev) {
+			HTMLArea._stopEvent(ev);
+			return false;
+		};
+		if (!option) {
+			item.className = "separator";
+			var td = doc.createElement("td");
+			td.className = "icon";
+			var IE_IS_A_FUCKING_SHIT = '>';
+			if (HTMLArea.is_ie) {
+				td.unselectable = "on";
+				IE_IS_A_FUCKING_SHIT = " unselectable='on' style='height=1px'>&nbsp;";
+			}
+			td.innerHTML = "<div" + IE_IS_A_FUCKING_SHIT + "</div>";
+			var td1 = td.cloneNode(true);
+			td1.className = "label";
+			item.appendChild(td);
+			item.appendChild(td1);
+		} else {
+			var label = option[0];
+			item.className = "item";
+			item.__msh = {
+				item: item,
+				label: label,
+				action: option[1],
+				tooltip: option[2] || null,
+				icon: option[3] || null,
+				activate: function() {
+					self.closeMenu();
+					self.editor.focusEditor();
+					this.action();
+				}
+			};
+			label = label.replace(/_([a-zA-Z0-9])/, "<u>$1</u>");
+			if (label != option[0])
+				keys.push([ RegExp.$1, item ]);
+			label = label.replace(/__/, "_");
+			var td1 = doc.createElement("td");
+			if (HTMLArea.is_ie)
+				td1.unselectable = "on";
+			item.appendChild(td1);
+			td1.className = "icon";
+			if (item.__msh.icon)
+				td1.innerHTML = "<img align='middle' src='" + item.__msh.icon + "' />";
+			var td2 = doc.createElement("td");
+			if (HTMLArea.is_ie)
+				td2.unselectable = "on";
+			item.appendChild(td2);
+			td2.className = "label";
+			td2.innerHTML = label;
+			item.onmouseover = function() {
+				this.className += " hover";
+				self.editor._statusBarTree.innerHTML = this.__msh.tooltip || '&nbsp;';
+			};
+			item.onmouseout = function() { this.className = "item"; };
+			item.oncontextmenu = function(ev) {
+				this.__msh.activate();
+				if (!HTMLArea.is_ie)
+					HTMLArea._stopEvent(ev);
+				return false;
+			};
+			item.onmouseup = function(ev) {
+				var timeStamp = (new Date()).getTime();
+				if (timeStamp - self.timeStamp > 500)
+					this.__msh.activate();
+				if (!HTMLArea.is_ie)
+					HTMLArea._stopEvent(ev);
+				return false;
+			};
+			//if (typeof option[2] == "string")
+			//item.title = option[2];
+		}
+	}
+
+	if (!HTMLArea.is_ie) {
+		var dx = x + div.offsetWidth - window.innerWidth + 4;
+		var dy = y + div.offsetHeight - window.innerHeight + 4;
+		if (dx > 0) x -= dx;
+		if (dy > 0) y -= dy;
+		div.style.left = x + "px";
+		div.style.top = y + "px";
+	} else {
+		// determine the size (did I mention that IE stinks?)
+		var foobar = document.createElement("div");
+		foobar.className = "htmlarea-context-menu";
+		foobar.innerHTML = div.innerHTML;
+		document.body.appendChild(foobar);
+		var w = foobar.offsetWidth;
+		var h = foobar.offsetHeight;
+		document.body.removeChild(foobar);
+		this.iePopup.show(ev.screenX, ev.screenY, w, h);
+	}
+
+	this.currentMenu = div;
+	this.timeStamp = (new Date()).getTime();
+
+	HTMLArea._addEvent(document, "mousedown", documentClick);
+	HTMLArea._addEvent(this.editordoc, "mousedown", documentClick);
+	if (keys.length > 0)
+		HTMLArea._addEvent(this.editordoc, "keypress", keyPress);
+
+	HTMLArea._stopEvent(ev);
+	return false;
+};
Index: temp/trunk/html/test/naka/HTMLArea/plugins/ContextMenu/lang/el.js
===================================================================
--- temp/trunk/html/test/naka/HTMLArea/plugins/ContextMenu/lang/el.js	(revision 1694)
+++ temp/trunk/html/test/naka/HTMLArea/plugins/ContextMenu/lang/el.js	(revision 1694)
@@ -0,0 +1,57 @@
+// I18N constants
+
+// LANG: "el", ENCODING: UTF-8 | ISO-8859-7
+// Author: Dimitris Glezos, dimitris@glezos.com
+
+ContextMenu.I18N = {
+	// Items that appear in menu.  Please note that an underscore (_)
+	// character in the translation (right column) will cause the following
+	// letter to become underlined and be shortcut for that menu option.
+
+	"Cut"                                                   : "Αποκοπή",
+	"Copy"                                                  : "Αντιγραφή",
+	"Paste"                                                 : "Επικόλληση",
+	"Image Properties"                                      : "Ιδιότητες Εικόνας...",
+	"Modify Link"                                           : "Τροποποίηση συνδέσμου...",
+	"Check Link"                                            : "Έλεγχος συνδέσμων...",
+	"Remove Link"                                           : "Διαγραφή συνδέσμου...",
+	"Cell Properties"                                       : "Ιδιότητες κελιού...",
+	"Row Properties"                                        : "Ιδιότητες γραμμής...",
+	"Insert Row Before"                                     : "Εισαγωγή γραμμής πριν",
+	"Insert Row After"                                      : "Εισαγωγή γραμμής μετά",
+	"Delete Row"                                            : "Διαγραφή γραμμής",
+	"Table Properties"                                      : "Ιδιότητες πίνακα...",
+	"Insert Column Before"                                  : "Εισαγωγή στήλης πριν",
+	"Insert Column After"                                   : "Εισαγωγή στήλης μετά",
+	"Delete Column"                                         : "Διαγραφή στήλης",
+	"Justify Left"                                          : "Στοίχηση Αριστερά",
+	"Justify Center"                                        : "Στοίχηση Κέντρο",
+	"Justify Right"                                         : "Στοίχηση Δεξιά",
+	"Justify Full"                                          : "Πλήρης Στοίχηση",
+	"Make link"                                             : "Δημιουργία συνδέσμου...",
+	"Remove the"                                            : "Αφαίρεση",
+	"Element"                                               : "στοιχείου...",
+
+	// Other labels (tooltips and alert/confirm box messages)
+
+	"Please confirm that you want to remove this element:"  : "Είστε βέβαιος πως θέλετε να αφαιρέσετε το στοιχείο ",
+	"Remove this node from the document"                    : "Αφαίρεση αυτού του κόμβου από το έγγραφο",
+	"How did you get here? (Please report!)"                : "Πώς ήρθατε μέχρι εδώ; (Παρακαλούμε αναφέρετε το!)",
+	"Show the image properties dialog"                      : "Εμφάνιση διαλόγου με τις Ιδιότητες εικόνας",
+	"Modify URL"                                            : "Τροποποίηση URL",
+	"Current URL is"                                        : "Το τρέχων URL είναι",
+	"Opens this link in a new window"                       : "Ανοίγει αυτό τον σύνδεσμο σε ένα νέο παράθυρο",
+	"Please confirm that you want to unlink this element."  : "Είστε βέβαιος πως θέλετε να αφαιρέσετε τον σύνδεσμο από αυτό το στοιχείο:",
+	"Link points to:"                                       : "Ο σύνδεμος οδηγεί εδώ:",
+	"Unlink the current element"                            : "Αφαίρεση συνδέσμου από το παρών στοιχείο",
+	"Show the Table Cell Properties dialog"                 : "Εμφάνιση διαλόγου με τις Ιδιότητες κελιού Πίνακα",
+	"Show the Table Row Properties dialog"                  : "Εμφάνιση διαλόγου με τις Ιδιότητες γραμμής Πίνακα",
+	"Insert a new row before the current one"               : "Εισαγωγή μιας νέας γραμμής πριν την επιλεγμένη",
+	"Insert a new row after the current one"                : "Εισαγωγή μιας νέας γραμμής μετά την επιλεγμένη",
+	"Delete the current row"                                : "Διαγραφή επιλεγμένης γραμμής",
+	"Show the Table Properties dialog"                      : "Εμφάνιση διαλόγου με τις Ιδιότητες Πίνακα",
+	"Insert a new column before the current one"            : "Εισαγωγή νέας στήλης πριν την επιλεγμένη",
+	"Insert a new column after the current one"             : "Εισαγωγή νέας στήλης μετά την επιλεγμένη",
+	"Delete the current column"                             : "Διαγραφή επιλεγμένης στήλης",
+	"Create a link"                                         : "Δημιουργία συνδέσμου"
+};
Index: temp/trunk/html/test/naka/HTMLArea/plugins/ContextMenu/lang/en.js
===================================================================
--- temp/trunk/html/test/naka/HTMLArea/plugins/ContextMenu/lang/en.js	(revision 1694)
+++ temp/trunk/html/test/naka/HTMLArea/plugins/ContextMenu/lang/en.js	(revision 1694)
@@ -0,0 +1,66 @@
+// I18N constants
+
+// LANG: "en", ENCODING: UTF-8 | ISO-8859-1
+// Author: Mihai Bazon, http://dynarch.com/mishoo
+
+// FOR TRANSLATORS:
+//
+//   1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE
+//      (at least a valid email address)
+//
+//   2. PLEASE TRY TO USE UTF-8 FOR ENCODING;
+//      (if this is not possible, please include a comment
+//       that states what encoding is necessary.)
+
+ContextMenu.I18N = {
+	// Items that appear in menu.  Please note that an underscore (_)
+	// character in the translation (right column) will cause the following
+	// letter to become underlined and be shortcut for that menu option.
+
+	"Cut"                                                   : "Cut",
+	"Copy"                                                  : "Copy",
+	"Paste"                                                 : "Paste",
+	"Image Properties"                                      : "_Image Properties...",
+	"Modify Link"                                           : "_Modify Link...",
+	"Check Link"                                            : "Chec_k Link...",
+	"Remove Link"                                           : "_Remove Link...",
+	"Cell Properties"                                       : "C_ell Properties...",
+	"Row Properties"                                        : "Ro_w Properties...",
+	"Insert Row Before"                                     : "I_nsert Row Before",
+	"Insert Row After"                                      : "In_sert Row After",
+	"Delete Row"                                            : "_Delete Row",
+	"Table Properties"                                      : "_Table Properties...",
+	"Insert Column Before"                                  : "Insert _Column Before",
+	"Insert Column After"                                   : "Insert C_olumn After",
+	"Delete Column"                                         : "De_lete Column",
+	"Justify Left"                                          : "Justify Left",
+	"Justify Center"                                        : "Justify Center",
+	"Justify Right"                                         : "Justify Right",
+	"Justify Full"                                          : "Justify Full",
+	"Make link"                                             : "Make lin_k...",
+	"Remove the"                                            : "Remove the",
+	"Element"                                               : "Element...",
+
+	// Other labels (tooltips and alert/confirm box messages)
+
+	"Please confirm that you want to remove this element:"  : "Please confirm that you want to remove this element:",
+	"Remove this node from the document"                    : "Remove this node from the document",
+	"How did you get here? (Please report!)"                : "How did you get here? (Please report!)",
+	"Show the image properties dialog"                      : "Show the image properties dialog",
+	"Modify URL"                                            : "Modify URL",
+	"Current URL is"                                        : "Current URL is",
+	"Opens this link in a new window"                       : "Opens this link in a new window",
+	"Please confirm that you want to unlink this element."  : "Please confirm that you want to unlink this element.",
+	"Link points to:"                                       : "Link points to:",
+	"Unlink the current element"                            : "Unlink the current element",
+	"Show the Table Cell Properties dialog"                 : "Show the Table Cell Properties dialog",
+	"Show the Table Row Properties dialog"                  : "Show the Table Row Properties dialog",
+	"Insert a new row before the current one"               : "Insert a new row before the current one",
+	"Insert a new row after the current one"                : "Insert a new row after the current one",
+	"Delete the current row"                                : "Delete the current row",
+	"Show the Table Properties dialog"                      : "Show the Table Properties dialog",
+	"Insert a new column before the current one"            : "Insert a new column before the current one",
+	"Insert a new column after the current one"             : "Insert a new column after the current one",
+	"Delete the current column"                             : "Delete the current column",
+	"Create a link"                                         : "Create a link"
+};
Index: temp/trunk/html/test/naka/HTMLArea/plugins/ContextMenu/lang/de.js
===================================================================
--- temp/trunk/html/test/naka/HTMLArea/plugins/ContextMenu/lang/de.js	(revision 1694)
+++ temp/trunk/html/test/naka/HTMLArea/plugins/ContextMenu/lang/de.js	(revision 1694)
@@ -0,0 +1,59 @@
+﻿// I18N constants
+
+// LANG: "de", ENCODING: UTF-8 | ISO-8859-1
+
+// translated: <]{MJ}[>  i@student.ethz.ch
+
+
+ContextMenu.I18N = {
+	// Items that appear in menu.  Please note that an underscore (_)
+	// character in the translation (right column) will cause the following
+	// letter to become underlined and be shortcut for that menu option.
+
+	"Cut"                                                   : "Ausschneiden",
+	"Copy"                                                  : "Kopieren",
+	"Paste"                                                 : "Einfügen",
+	"Image Properties"                                      : "_Bild Einstellungen...",
+	"Modify Link"                                           : "_Link ändern...",
+	"Check Link"                                            : "Link testen...",
+	"Remove Link"                                           : "Link entfernen...",
+	"Cell Properties"                                       : "Z_ellen Einstellungen...",
+	"Row Properties"                                        : "Ze_ilen Einstellungen...",
+	"Insert Row Before"                                     : "Zeile einfügen v_or Position",
+	"Insert Row After"                                      : "Zeile einfügen n_ach Position",
+	"Delete Row"                                            : "Zeile löschen",
+	"Table Properties"                                      : "_Tabellen Einstellungen...",
+	"Insert Column Before"                                  : "Spalte einfügen vo_r Position",
+	"Insert Column After"                                   : "Spalte einfügen na_ch Position",
+	"Delete Column"                                         : "Spalte löschen",
+	"Justify Left"                                          : "Links ausrichten",
+	"Justify Center"                                        : "Zentriert",
+	"Justify Right"                                         : "Rechts ausrichten",
+	"Justify Full"                                          : "Blocksatz",
+	"Make link"                                             : "Lin_k erstellen...",
+	"Remove the"                                            : "",
+	"Element"                                               : "Element entfernen...",
+
+	// Other labels (tooltips and alert/confirm box messages)
+
+	"Please confirm that you want to remove this element:"  : "Wollen sie dieses Element wirklich entfernen ?",
+	"Remove this node from the document"                    : "Dieses Element aus dem Dokument entfernen",
+	"How did you get here? (Please report!)"                : "How did you get here? (Please report!)",
+	"Show the image properties dialog"                      : "Fenster für die Bild-Einstellungen anzeigen",
+	"Modify URL"                                            : "URL ändern",
+	"Current URL is"                                        : "Aktuelle URL ist",
+	"Opens this link in a new window"                       : "Diesen Link in neuem Fenster öffnen",
+	"Please confirm that you want to unlink this element."  : "Wollen sie diesen Link wirklich entfernen ?",
+	"Link points to:"                                       : "Link zeigt auf:",
+	"Unlink the current element"                            : "Link auf Element entfernen",
+	"Show the Table Cell Properties dialog"                 : "Zellen-Einstellungen anzeigen",
+	"Show the Table Row Properties dialog"                  : "Zeilen-Einstellungen anzeigen",
+	"Insert a new row before the current one"               : "Zeile einfügen vor der aktuellen Position",
+	"Insert a new row after the current one"                : "Zeile einfügen nach der aktuellen Position",
+	"Delete the current row"                                : "Zeile löschen",
+	"Show the Table Properties dialog"                      : "Show the Table Properties dialog",
+	"Insert a new column before the current one"            : "Spalte einfügen vor der aktuellen Position",
+	"Insert a new column after the current one"             : "Spalte einfügen nach der aktuellen Position",
+	"Delete the current column"                             : "Spalte löschen",
+	"Create a link"                                         : "Link erstellen"
+};
Index: temp/trunk/html/test/naka/HTMLArea/plugins/ContextMenu/lang/nl.js
===================================================================
--- temp/trunk/html/test/naka/HTMLArea/plugins/ContextMenu/lang/nl.js	(revision 1694)
+++ temp/trunk/html/test/naka/HTMLArea/plugins/ContextMenu/lang/nl.js	(revision 1694)
@@ -0,0 +1,66 @@
+// I18N constants
+
+// LANG: "nl", ENCODING: UTF-8 | ISO-8859-1
+// Author: Michel Weegeerink (info@mmc-shop.nl), http://mmc-shop.nl
+
+// FOR TRANSLATORS:
+//
+//   1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE
+//      (at least a valid email address)
+//
+//   2. PLEASE TRY TO USE UTF-8 FOR ENCODING;
+//      (if this is not possible, please include a comment
+//       that states what encoding is necessary.)
+
+ContextMenu.I18N = {
+	// Items that appear in menu.  Please note that an underscore (_)
+	// character in the translation (right column) will cause the following
+	// letter to become underlined and be shortcut for that menu option.
+
+	"Cut"                                                   : "Knippen",
+	"Copy"                                                  : "Kopiëren",
+	"Paste"                                                 : "Plakken",
+	"Image Properties"                                      : "Eigenschappen afbeelding...",
+	"Modify Link"                                           : "Hyperlin_k aanpassen...",
+	"Check Link"                                            : "Controleer hyperlin_k...",
+	"Remove Link"                                           : "Ve_rwijder hyperlink...",
+	"Cell Properties"                                       : "C_eleigenschappen...",
+	"Row Properties"                                        : "Rijeigenscha_ppen...",
+	"Insert Row Before"                                     : "Rij invoegen boven",
+	"Insert Row After"                                      : "Rij invoegen onder",
+	"Delete Row"                                            : "Rij _verwijderen",
+	"Table Properties"                                      : "_Tabeleigenschappen...",
+	"Insert Column Before"                                  : "Kolom invoegen voor",
+	"Insert Column After"                                   : "Kolom invoegen na",
+	"Delete Column"                                         : "Kolom verwijderen",
+	"Justify Left"                                          : "Links uitlijnen",
+	"Justify Center"                                        : "Centreren",
+	"Justify Right"                                         : "Rechts uitlijnen",
+	"Justify Full"                                          : "Uitvullen",
+	"Make link"                                             : "Maak hyperlin_k...",
+	"Remove the"                                            : "Verwijder het",
+	"Element"                                               : "element...",
+
+	// Other labels (tooltips and alert/confirm box messages)
+
+	"Please confirm that you want to remove this element:"  : "Is het werkelijk de bedoeling dit element te verwijderen:",
+	"Remove this node from the document"                    : "Verwijder dit punt van het document",
+	"How did you get here? (Please report!)"                : "Hoe kwam je hier? (A.U.B. doorgeven!)",
+	"Show the image properties dialog"                      : "Laat het afbeeldingseigenschappen dialog zien",
+	"Modify URL"                                            : "Aanpassen URL",
+	"Current URL is"                                        : "Huidig URL is",
+	"Opens this link in a new window"                       : "Opend deze hyperlink in een nieuw venster",
+	"Please confirm that you want to unlink this element."  : "Is het werkelijk de bedoeling dit element te unlinken.",
+	"Link points to:"                                       : "Hyperlink verwijst naar:",
+	"Unlink the current element"                            : "Unlink het huidige element",
+	"Show the Table Cell Properties dialog"                 : "Laat de tabel celeigenschappen dialog zien",
+	"Show the Table Row Properties dialog"                  : "Laat de tabel rijeigenschappen dialog zien",
+	"Insert a new row before the current one"               : "Voeg een nieuwe rij in boven de huidige",
+	"Insert a new row after the current one"                : "Voeg een nieuwe rij in onder de huidige",
+	"Delete the current row"                                : "Verwijder de huidige rij",
+	"Show the Table Properties dialog"                      : "Laat de tabel eigenschappen dialog zien",
+	"Insert a new column before the current one"            : "Voeg een nieuwe kolom in voor de huidige",
+	"Insert a new column after the current one"             : "Voeg een nieuwe kolom in na de huidige",
+	"Delete the current column"                             : "Verwijder de huidige kolom",
+	"Create a link"                                         : "Maak een hyperlink"
+};
Index: temp/trunk/html/test/naka/HTMLArea/plugins/TableOperations/lang/de.js
===================================================================
--- temp/trunk/html/test/naka/HTMLArea/plugins/TableOperations/lang/de.js	(revision 1694)
+++ temp/trunk/html/test/naka/HTMLArea/plugins/TableOperations/lang/de.js	(revision 1694)
@@ -0,0 +1,81 @@
+// I18N constants
+
+// LANG: "de", ENCODING: UTF-8 | ISO-8859-1
+// Author: broxx, <broxx@broxx.com>
+
+TableOperations.I18N = {
+	"Align":					  "Ausrichten",
+	"All four sides":				  "Alle 4 Seiten",
+	"Background":					  "Hintergrund",
+	"Baseline":                                       "Basislinie",
+	"Border":					  "Rand",
+	"Borders":					  "Raender",
+	"Bottom":                                         "Unten",
+	"CSS Style":					  "Style [CSS]",
+	"Caption":					  "Ueberschrift",
+	"Cell Properties":                                "Zellen",
+	"Center":					  "Zentrieren",
+	"Char":                                           "Zeichen",
+	"Collapsed borders":                              "Collapsed borders",
+	"Color":					  "Farbe",
+	"Description":					  "Beschreibung",
+	"FG Color":					  "FG Farbe",
+	"Float":                                          "Ausrichtung",
+	"Frames":					  "Rahmen",
+	"Height":                                         "Hoehe",
+	"How many columns would you like to merge?":      "Wieviele Spalten willst du verbinden?",
+	"How many rows would you like to merge?":         "Wieviele Zeilen willst du verbinden?",
+	"Image URL":					  "Bild URL",
+	"Justify":                                        "Justieren",
+	"Layout":					  "Layout",
+	"Left":						  "Links",
+	"Margin":                                         "Rand",
+	"Middle":                                         "Mitte",
+	"No rules":					  "Keine Balken",
+	"No sides":					  "Keine Seiten",
+	"None":                                           "Keine",
+	"Padding":					  "Auffuellung",
+	"Please click into some cell":                    "Waehle eine Zelle",
+	"Right":					  "Rechts",
+	"Row Properties":                                 "Reihen",
+	"Rules will appear between all rows and columns": "Balken zwischen Reihen und Spalten",
+	"Rules will appear between columns only":	  "Balken zwischen Spalten",
+	"Rules will appear between rows only":		  "Balken zwischen Reihen",
+	"Rules":					  "Balken",
+	"Spacing and padding":                            "Abstaende",
+	"Spacing":					  "Abstand",
+	"Summary":					  "Zusammenfassung",
+	"TO-cell-delete":				  "Zelle loeschen",
+	"TO-cell-insert-after":				  "Zelle einfuegen nach",
+	"TO-cell-insert-before":			  "Zelle einfuegen bevor",
+	"TO-cell-merge":				  "Zellen zusammenfuegen",
+	"TO-cell-prop":					  "Zelleinstellungen",
+	"TO-cell-split":				  "Zellen aufteilen",
+	"TO-col-delete":				  "Spalte loeschen",
+	"TO-col-insert-after":				  "Spalte einfuegen nach",
+	"TO-col-insert-before":				  "Spalte einfuegen bevor",
+	"TO-col-split":					  "Spalte aufteilen",
+	"TO-row-delete":				  "Reihe loeschen",
+	"TO-row-insert-above":				  "Reihe einfuegen vor",
+	"TO-row-insert-under":				  "Reihe einfuegen nach",
+	"TO-row-prop":					  "Reiheneinstellungen",
+	"TO-row-split":					  "Reihen aufteilen",
+	"TO-table-prop":				  "Tabelle",
+	"Table Properties":				  "Tabelle",
+	"Text align":                                     "Ausrichtung",
+	"The bottom side only":				  "Nur untere Seite",
+	"The left-hand side only":			  "Nur linke Seite",
+	"The right and left sides only":		  "Nur linke und rechte Seite",
+	"The right-hand side only":			  "Nur rechte Seite",
+	"The top and bottom sides only":		  "Nur obere und untere Seite",
+	"The top side only":				  "Nur obere Seite",
+	"Top":                                            "Oben",	
+	"Unset color":                                    "Farbe",
+	"Vertical align":                                 "Ausrichtung",
+	"Width":					  "Breite",
+	"not-del-last-cell":				  "Letzte Zelle in dieser Reihe!",
+	"not-del-last-col":				  "Letzte Spalte in dieser Tabelle!",
+	"not-del-last-row":				  "Letzte Reihe in dieser Tabelle",
+	"percent":					  "%",
+	"pixels":					  "pixels"
+};
Index: temp/trunk/html/test/naka/HTMLArea/plugins/TableOperations/lang/nl.js
===================================================================
--- temp/trunk/html/test/naka/HTMLArea/plugins/TableOperations/lang/nl.js	(revision 1694)
+++ temp/trunk/html/test/naka/HTMLArea/plugins/TableOperations/lang/nl.js	(revision 1694)
@@ -0,0 +1,90 @@
+// I18N constants
+
+// LANG: "nl", ENCODING: UTF-8 | ISO-8859-1
+// Author: Michel Weegeerink (info@mmc-shop.nl), http://mmc-shop.nl
+
+// FOR TRANSLATORS:
+//
+//   1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE
+//      (at least a valid email address)
+//
+//   2. PLEASE TRY TO USE UTF-8 FOR ENCODING;
+//      (if this is not possible, please include a comment
+//       that states what encoding is necessary.)
+
+TableOperations.I18N = {
+	"Align":											"Uitlijning",
+	"All four sides":									"Alle 4 zijden",
+	"Background":										"Achtergrond",
+	"Baseline":											"Basis",
+	"Border":											"Rand",
+	"Borders":											"Randen",
+	"Bottom":											"Onder",
+	"CSS Style":										"CSS Style",
+	"Caption":											"Opmerking",
+	"Cell Properties":									"Celeigenschappen",
+	"Center":											"Centreren",
+	"Char":												"Karakter",
+	"Collapsed borders":								"Geen randen",
+	"Color":											"Kleur",
+	"Description":										"Omschrijving",
+	"FG Color":											"Voorgrond",
+	"Float":											"Zwevend",
+	"Frames":											"Frames",
+	"Height":											"Hoogte",
+	"How many columns would you like to merge?":		"Hoeveel kolommen wilt u samenvoegen?",
+	"How many rows would you like to merge?":			"Hoeveel rijen wilt u samenvoegen?",
+	"Image URL":										"Afbeelding URL",
+	"Justify":											"Uitvullen",
+	"Layout":											"Opmaak",
+	"Left":												"Links",
+	"Margin":											"Marge",
+	"Middle":											"Midden",
+	"No rules":											"Geen regels",
+	"No sides":											"Geen zijlijnen",
+	"None":												"Geen",
+	"Padding":											"Celmarge",
+	"Please click into some cell":						"Klik in een cel a.u.b.",
+	"Right":											"Rechts",
+	"Row Properties":									"Rijeigenschappen",
+	"Rules will appear between all rows and columns":	"Regels verschijnen tussen alle rijen en kolommen",
+	"Rules will appear between columns only":	  		"Regels verschijnen enkel tussen de kolommen",
+	"Rules will appear between rows only":				"Regels verschijnen enkel tussen de rijen",
+	"Rules":					  						"Regels",
+	"Spacing and padding":                           	"Celmarge en afstand tussen cellen",
+	"Spacing":											"marge",
+	"Summary":											"Overzicht",
+	"TO-cell-delete":				  					"Cel verwijderen",
+	"TO-cell-insert-after":				  				"Voeg cel toe achter",
+	"TO-cell-insert-before":			  				"Voeg cel toe voor",
+	"TO-cell-merge":									"Cellen samenvoegen",
+	"TO-cell-prop":										"Celeigenschappen",
+	"TO-cell-split":									"Cel splitsen",
+	"TO-col-delete":									"Kolom verwijderen",
+	"TO-col-insert-after":								"Kolom invoegen achter",
+	"TO-col-insert-before":								"Kolom invoegen voor",
+	"TO-col-split":										"Kolom splitsen",
+	"TO-row-delete":									"Rij verwijderen",
+	"TO-row-insert-above":								"Rij invoegen boven",
+	"TO-row-insert-under":								"Rij invoegen onder",
+	"TO-row-prop":										"Rij eigenschappen",
+	"TO-row-split":										"Rij splitsen",
+	"TO-table-prop":				  					"Tabel eigenschappen",
+	"Table Properties":				  					"Tabel eigenschappen",
+	"Text align":                                     	"Text uitlijning",
+	"The bottom side only":				  				"Enkel aan de onderkant",
+	"The left-hand side only":			 				"Enkel aan de linkerkant",
+	"The right and left sides only":		 			"Enkel aan de linker en rechterkant",
+	"The right-hand side only":							"Enkel aan de rechterkant",
+	"The top and bottom sides only":					"Enkel aan de bovenen onderkant",
+	"The top side only":								"Enkel aan de bovenkant",
+	"Top":												"Boven",
+	"Unset color":										"Wis kleur",
+	"Vertical align":									"Vertikale uitlijning",
+	"Width":					 						"Breedte",
+	"not-del-last-cell":								"HTMLArea kan de laatste cel in deze tabel niet verwijderen.",
+	"not-del-last-col":									"HTMLArea kan de laatste kolom in deze tabel niet verwijderen.",
+	"not-del-last-row":									"HTMLArea kan de laatste rij in deze tabel niet verwijderen.",
+	"percent":											"procent",
+	"pixels":											"pixels"
+};
Index: temp/trunk/html/test/naka/HTMLArea/plugins/TableOperations/lang/cz.js
===================================================================
--- temp/trunk/html/test/naka/HTMLArea/plugins/TableOperations/lang/cz.js	(revision 1694)
+++ temp/trunk/html/test/naka/HTMLArea/plugins/TableOperations/lang/cz.js	(revision 1694)
@@ -0,0 +1,90 @@
+﻿// I18N constants
+
+// LANG: "cz", ENCODING: UTF-8 | ISO-8859-2
+// Author: Jiri Löw, <jirilow@jirilow.com>
+
+// FOR TRANSLATORS:
+//
+//   1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE
+//      (at least a valid email address)
+//
+//   2. PLEASE TRY TO USE UTF-8 FOR ENCODING;
+//      (if this is not possible, please include a comment
+//       that states what encoding is necessary.)
+
+TableOperations.I18N = {
+	"Align":					  "Zarovnání",
+	"All four sides":				  "Všechny čtyři strany",
+	"Background":					  "Pozadí",
+	"Baseline":                                       "Základní linka",
+	"Border":					  "Obrys",
+	"Borders":					  "Obrysy",
+	"Bottom":                                         "Dolů",
+	"CSS Style":					  "Kaskádové styly (CSS)",
+	"Caption":					  "Titulek",
+	"Cell Properties":                                "Vlastnosti buňky",
+	"Center":					  "Na střed",
+	"Char":                                           "Znak",
+	"Collapsed borders":                              "Stlačené okraje",
+	"Color":					  "Barva",
+	"Description":					  "Popis",
+	"FG Color":					  "Barva popředí",
+	"Float":                                          "Obtékání",
+	"Frames":					  "Rámečky",
+	"Height":                                         "Výška",
+	"How many columns would you like to merge?":      "Kolik sloupců si přejete spojit?",
+	"How many rows would you like to merge?":         "Kolik řádků si přejete spojit?",
+	"Image URL":					  "Adresa obrázku",
+	"Justify":                                        "Do stran",
+	"Layout":					  "Rozložení",
+	"Left":						  "Vlevo",
+	"Margin":                                         "Okraj",
+	"Middle":                                         "Na střed",
+	"No rules":					  "Žádné čáry",
+	"No sides":					  "Žádné strany",
+	"None":                                           "Žádné",
+	"Padding":					  "Odsazování",
+	"Please click into some cell":                    "Prosím klikněte do některé buňky",
+	"Right":					  "Vpravo",
+	"Row Properties":                                 "Vlastnosti řádku",
+	"Rules will appear between all rows and columns": "Čáry mezi všemi řádky i sloupci",
+	"Rules will appear between columns only":	  "Čáry pouze mezi sloupci",
+	"Rules will appear between rows only":		  "Čáry pouze mezi řádky",
+	"Rules":					  "Čáry",
+	"Spacing and padding":                            "Mezery a odsazování",
+	"Spacing":					  "Mezery",
+	"Summary":					  "Shrnutí",
+	"TO-cell-delete":				  "Smazat buňku",
+	"TO-cell-insert-after":				  "Vložit buňku za",
+	"TO-cell-insert-before":			  "Vložit buňku před",
+	"TO-cell-merge":				  "Spojit buňky",
+	"TO-cell-prop":					  "Vlastnosti buňky",
+	"TO-cell-split":				  "Rozdělit buňku",
+	"TO-col-delete":				  "Smazat sloupec",
+	"TO-col-insert-after":				  "Vložit sloupec za",
+	"TO-col-insert-before":				  "Vložit sloupec před",
+	"TO-col-split":					  "Rozdělit sloupec",
+	"TO-row-delete":				  "Smazat řádek",
+	"TO-row-insert-above":				  "Smazat řádek nad",
+	"TO-row-insert-under":				  "Smazat řádek pod",
+	"TO-row-prop":					  "Vlastnosti řádku",
+	"TO-row-split":					  "Rozdělit řádek",
+	"TO-table-prop":				  "Vlastnosti tabulky",
+	"Table Properties":				  "Vlastnosti tabulky",
+	"Text align":                                     "Zarovnání textu",
+	"The bottom side only":				  "Pouze spodní strana",
+	"The left-hand side only":			  "Pouze levá strana",
+	"The right and left sides only":		  "Pouze levá a pravá strana",
+	"The right-hand side only":			  "Pouze pravá strana",
+	"The top and bottom sides only":		  "Pouze horní a dolní strana",
+	"The top side only":				  "Pouze horní strana",
+	"Top":                                            "Nahoru",	
+	"Unset color":                                    "Zrušit barvu",
+	"Vertical align":                                 "Svislé zarovnání",
+	"Width":					  "Šířka",
+	"not-del-last-cell":				  "HTMLArea zbaběle odmítá smazat poslední buňku v řádku.",
+	"not-del-last-col":				  "HTMLArea zbaběle odmítá smazat poslední sloupec v tabulce.",
+	"not-del-last-row":				  "HTMLArea zbaběle odmítá smazat poslední řádek v tabulce.",
+	"percent":					  "procent",
+	"pixels":					  "pixelů"
+};
Index: temp/trunk/html/test/naka/HTMLArea/plugins/TableOperations/lang/hu.js
===================================================================
--- temp/trunk/html/test/naka/HTMLArea/plugins/TableOperations/lang/hu.js	(revision 1694)
+++ temp/trunk/html/test/naka/HTMLArea/plugins/TableOperations/lang/hu.js	(revision 1694)
@@ -0,0 +1,63 @@
+// I18N constants
+
+// LANG: "hu", ENCODING: UTF-8
+// Author: Miklós Somogyi, <somogyine@vnet.hu>
+
+// FOR TRANSLATORS:
+//
+//   1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE
+//      (at least a valid email address)
+//
+//   2. PLEASE TRY TO USE UTF-8 FOR ENCODING;
+//      (if this is not possible, please include a comment
+//       that states what encoding is necessary.)
+
+HTMLArea.I18N = {
+
+	// the following should be the filename without .js extension
+	// it will be used for automatically load plugin language.
+	lang: "hu",
+
+	tooltips: {
+		bold:           "Félkövér",
+		italic:         "Dőlt",
+		underline:      "Aláhúzott",
+		strikethrough:  "Áthúzott",
+		subscript:      "Alsó index",
+		superscript:    "Felső index",
+		justifyleft:    "Balra zárt",
+		justifycenter:  "Középre zárt",
+		justifyright:   "Jobbra zárt",
+		justifyfull:    "Sorkizárt",
+		orderedlist:    "Számozott lista",
+		unorderedlist:  "Számozatlan lista",
+		outdent:        "Behúzás csökkentése",
+		indent:         "Behúzás növelése",
+		forecolor:      "Karakterszín",
+		hilitecolor:    "Háttérszín",
+		horizontalrule: "Elválasztó vonal",
+		createlink:     "Hiperhivatkozás beszúrása",
+		insertimage:    "Kép beszúrása",
+		inserttable:    "Táblázat beszúrása",
+		htmlmode:       "HTML forrás be/ki",
+		popupeditor:    "Szerkesztő külön ablakban",
+		about:          "Névjegy",
+		showhelp:       "Súgó",
+		textindicator:  "Aktuális stílus",
+		undo:           "Visszavonás",
+		redo:           "Újra végrehajtás",
+		cut:            "Kivágás",
+		copy:           "Másolás",
+		paste:          "Beillesztés"
+	},
+
+	buttons: {
+		"ok":           "Rendben",
+		"cancel":       "Mégsem"
+	},
+
+	msg: {
+		"Path":         "Hierarchia",
+		"TEXT_MODE":    "Forrás mód. Visszaváltás [<>] gomb"
+	}
+};
Index: temp/trunk/html/test/naka/HTMLArea/plugins/TableOperations/lang/it.js
===================================================================
--- temp/trunk/html/test/naka/HTMLArea/plugins/TableOperations/lang/it.js	(revision 1694)
+++ temp/trunk/html/test/naka/HTMLArea/plugins/TableOperations/lang/it.js	(revision 1694)
@@ -0,0 +1,81 @@
+// I18N constants
+
+// LANG: "it", ENCODING: UTF-8 | ISO-8859-1
+// Author: Fabio Rotondo <fabio@rotondo.it>
+
+TableOperations.I18N = {
+	"Align":					  "Allinea",
+	"All four sides":				  "Tutti e quattro i lati",
+	"Background":					  "Sfondo",
+	"Baseline":                                       "Allineamento",
+	"Border":					  "Bordo",
+	"Borders":					  "Bordi",
+	"Bottom":                                         "Basso",
+	"CSS Style":					  "Stile [CSS]",
+	"Caption":					  "Titolo",
+	"Cell Properties":                                "Proprietà della Cella",
+	"Center":					  "Centra",
+	"Char":                                           "Carattere",
+	"Collapsed borders":                              "Bordi chiusi",
+	"Color":					  "Colore",
+	"Description":					  "Descrizione",
+	"FG Color":					  "Colore Principale",
+	"Float":                                          "Fluttuante",
+	"Frames":					  "Frames",
+	"Height":                                         "Altezza",
+	"How many columns would you like to merge?":      "Quante colonne vuoi unire?",
+	"How many rows would you like to merge?":         "Quante righe vuoi unire?",
+	"Image URL":					  "URL dell'Immagine",
+	"Justify":                                        "Justifica",
+	"Layout":					  "Layout",
+	"Left":						  "Sinistra",
+	"Margin":                                         "Margine",
+	"Middle":                                         "Centrale",
+	"No rules":					  "Nessun righello",
+	"No sides":					  "Nessun lato",
+	"None":                                           "Nulla",
+	"Padding":					  "Padding",
+	"Please click into some cell":                    "Per favore, clicca in una cella",
+	"Right":					  "Destra",
+	"Row Properties":                                 "Proprietà della Riga",
+	"Rules will appear between all rows and columns": "Le linee appariranno tra tutte le righe e colonne",
+	"Rules will appear between columns only":	  "Le linee appariranno solo tra le colonne",
+	"Rules will appear between rows only":		  "Le linee appariranno solo tra le righe",
+	"Rules":					  "Linee",
+	"Spacing and padding":                            "Spaziatura e Padding",
+	"Spacing":					  "Spaziatura",
+	"Summary":					  "Sommario",
+	"TO-cell-delete":				  "Cancella cella",
+	"TO-cell-insert-after":				  "Inserisci cella dopo",
+	"TO-cell-insert-before":			  "Inserisci cella prima",
+	"TO-cell-merge":				  "Unisci celle",
+	"TO-cell-prop":					  "Proprietà della cella",
+	"TO-cell-split":				  "Dividi cella",
+	"TO-col-delete":				  "Cancella colonna",
+	"TO-col-insert-after":				  "Inserisci colonna dopo",
+	"TO-col-insert-before":				  "Inserisci colonna prima",
+	"TO-col-split":					  "Dividi colonna",
+	"TO-row-delete":				  "Cancella riga",
+	"TO-row-insert-above":				  "Inserisci riga prima",
+	"TO-row-insert-under":				  "Inserisci riga dopo",
+	"TO-row-prop":					  "Proprietà della riga",
+	"TO-row-split":					  "Dividi riga",
+	"TO-table-prop":				  "Proprietà della Tabella",
+	"Table Properties":				  "Proprietà della Tabella",
+	"Text align":                                     "Allineamento del Testo",
+	"The bottom side only":				  "Solo la parte inferiore",
+	"The left-hand side only":			  "Solo la parte sinistra",
+	"The right and left sides only":		  "Solo destra e sinistra",
+	"The right-hand side only":			  "Solo la parte destra",
+	"The top and bottom sides only":		  "Solo sopra e sotto",
+	"The top side only":				  "Solo la parte sopra",
+	"Top":                                            "Alto",	
+	"Unset color":                                    "Rimuovi colore",
+	"Vertical align":                                 "Allineamento verticale",
+	"Width":					  "Larghezza",
+	"not-del-last-cell":				  "HTMLArea si rifiuta codardamente di cancellare l'ultima cella nella riga.",
+	"not-del-last-col":				  "HTMLArea si rifiuta codardamente di cancellare l'ultima colonna nella tabella.",
+	"not-del-last-row":				  "HTMLArea si rifiuta codardamente di cancellare l'ultima riga nella tabella.",
+	"percent":					  "percento",
+	"pixels":					  "pixels"
+};
Index: temp/trunk/html/test/naka/HTMLArea/plugins/TableOperations/lang/no.js
===================================================================
--- temp/trunk/html/test/naka/HTMLArea/plugins/TableOperations/lang/no.js	(revision 1694)
+++ temp/trunk/html/test/naka/HTMLArea/plugins/TableOperations/lang/no.js	(revision 1694)
@@ -0,0 +1,91 @@
+// I18N constants
+
+// LANG: "en", ENCODING: UTF-8 | ISO-8859-1
+// Author: Mihai Bazon, <mishoo@infoiasi.ro>
+// translated into Norwegia: ses@online.no  11.11.03
+
+// FOR TRANSLATORS:
+//
+//   1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE
+//      (at least a valid email address)
+//
+//   2. PLEASE TRY TO USE UTF-8 FOR ENCODING;
+//      (if this is not possible, please include a comment
+//       that states what encoding is necessary.)
+
+TableOperations.I18N = {
+	"Align":					  	"Juster",
+	"All four sides":			  	"Alle fire sider",
+	"Background":					"Bakgrund",
+	"Baseline":                   	"Grunnlinje",
+	"Border":					  	"Kantlinje",
+	"Borders":					  	"Kantlinjer",
+	"Bottom":                     	"Bunn",
+	"CSS Style":					"Stil [CSS]",
+	"Caption":					  	"Overskrift",
+	"Cell Properties":              "Celleegenskaper",
+	"Center":					  	"Sentrer",
+	"Char":                         "Tegn",
+	"Collapsed borders":            "Fjern kantlinjer",
+	"Color":					  	"Farge",
+	"Description":					"Beskrivelse",
+	"FG Color":					  	"FG farge",
+	"Float":                        "Flytende",
+	"Frames":					  	"rammer",
+	"Height":                       "Høyde",
+	"How many columns would you like to merge?":      "Hvor mange kolonner vil du slå sammen?",
+	"How many rows would you like to merge?":         "Hvor mange rader vil du slå sammen?",
+	"Image URL":					"Bildets URL",
+	"Justify":                      "Juster",
+	"Layout":					  	"Layout",
+	"Left":						  	"Venstre",
+	"Margin":                       "Marg",
+	"Middle":                       "Midten",
+	"No rules":					  	"Ingen linjal",
+	"No sides":					  	"Ingen sider",
+	"None":                         "Ingen",
+	"Padding":					  	"Luft",
+	"Please click into some cell":  "Klikk i en eller annen celle",
+	"Right":					  	"Høyre",
+	"Row Properties":               "Egenskaper for rad",
+	"Rules will appear between all rows and columns": "Linjer vil synes mellom alle rader og kolonner",
+	"Rules will appear between columns only":	  "Linjer vil synes kun mellom kolonner",
+	"Rules will appear between rows only":		  "Linjer vil synes kun mellom rader",
+	"Rules":					  	"Linjer",
+	"Spacing and padding":          "Luft",
+	"Spacing":					  	"Luft",
+	"Summary":					  	"Sammendrag",
+	"TO-cell-delete":				"Slett celle",
+	"TO-cell-insert-after":			"Sett inn celle etter",
+	"TO-cell-insert-before":		"Sett inn celle foran",
+	"TO-cell-merge":				"Slå sammen celler",
+	"TO-cell-prop":					"Egenskaper for celle",
+	"TO-cell-split":				"Del celle",
+	"TO-col-delete":				"Slett kolonne",
+	"TO-col-insert-after":			"Skyt inn kolonne etter",
+	"TO-col-insert-before":			"Skyt inn kolonne før",
+	"TO-col-split":					"Del kolonne",
+	"TO-row-delete":				"Slett rad",
+	"TO-row-insert-above":			"Skyt inn rad foran",
+	"TO-row-insert-under":			"Skyt inn rad etter",
+	"TO-row-prop":					"Egenskaper for rad",
+	"TO-row-split":					"Del rad",
+	"TO-table-prop":				"Tabellegenskaper",
+	"Table Properties":				"Tabellegenskaper",
+	"Text align":                   "Juster tekst",
+	"The bottom side only":			"Bunnen kun",
+	"The left-hand side only":		"Venstresiden kun",
+	"The right and left sides only":	"Høyre- og venstresiden kun",
+	"The right-hand side only":			"Høyresiden kun",
+	"The top and bottom sides only":	"The top and bottom sides only",
+	"The top side only":				"Overkanten kun",
+	"Top":                          "Overkant",	
+	"Unset color":                  "Ikke-bestemt farge",
+	"Vertical align":               "Vertikal justering",
+	"Width":					  	"Bredde",
+	"not-del-last-cell":			"HTMLArea nekter å slette siste cellen i tabellen.",
+	"not-del-last-col":				"HTMLArea nekter å slette siste kolonnen i tabellen.",
+	"not-del-last-row":				"HTMLArea nekter å slette siste raden i tabellen.",
+	"percent":					  	"prosent",
+	"pixels":					  	"billedpunkter"
+};
Index: temp/trunk/html/test/naka/HTMLArea/plugins/TableOperations/lang/fi.js
===================================================================
--- temp/trunk/html/test/naka/HTMLArea/plugins/TableOperations/lang/fi.js	(revision 1694)
+++ temp/trunk/html/test/naka/HTMLArea/plugins/TableOperations/lang/fi.js	(revision 1694)
@@ -0,0 +1,66 @@
+TableOperations.I18N = {
+	"Align":					  "Kohdistus",
+	"All four sides":				  "Kaikki neljä sivua",
+	"Background":					  "Tausta",
+	"Baseline":                                       "Takaraja",
+	"Border":					  "Reuna",
+	"Borders":					  "Reunat",
+	"Bottom":                                         "Alle",
+	"CSS Style":					  "Tyyli [CSS]",
+	"Caption":					  "Otsikko",
+	"Cell Properties":                                "Solun asetukset",
+	"Center":					  "Keskelle",
+	"Char":                                           "Merkki",
+	"Collapsed borders":                              "Luhistetut reunat",
+	"Color":					  "Väri",
+	"Description":					  "Kuvaus",
+	"FG Color":					  "FG Väri",
+	"Frames":					  "Kehykset",
+	"Image URL":					  "Kuvan osoite",
+	"Layout":					  "Sommittelu",
+	"Left":						  "Vasen",
+	"Margin":                                         "Marginaali",
+	"Middle":                                         "Keskelle",
+	"No rules":					  "Ei viivoja",
+	"No sides":					  "Ei sivuja",
+	"Padding":					  "Palstantäyte",
+	"Right":					  "Oikea",
+	"Row Properties":                                 "Rivin asetukset",
+	"Rules will appear between all rows and columns": "Viivat jokaisen rivin ja sarakkeen välillä",
+	"Rules will appear between columns only":	  "Viivat ainoastaan sarakkeiden välillä",
+	"Rules will appear between rows only":		  "Viivat ainoastaan rivien välillä",
+	"Rules":					  "Viivat",
+	"Spacing":					  "Palstatila",
+	"Summary":					  "Yhteenveto",
+	"TO-cell-delete":				  "Poista solu",
+	"TO-cell-insert-after":				  "Lisää solu perään",
+	"TO-cell-insert-before":			  "Lisää solu ennen",
+	"TO-cell-merge":				  "Yhdistä solut",
+	"TO-cell-prop":					  "Solun asetukset",
+	"TO-cell-split":				  "Jaa solu",
+	"TO-col-delete":				  "Poista sarake",
+	"TO-col-insert-after":				  "Lisää sarake perään",
+	"TO-col-insert-before":				  "Lisää sarake ennen",
+	"TO-col-split":					  "Jaa sarake",
+	"TO-row-delete":				  "Poista rivi",
+	"TO-row-insert-above":				  "Lisää rivi yläpuolelle",
+	"TO-row-insert-under":				  "Lisää rivi alapuolelle",
+	"TO-row-prop":					  "Rivin asetukset",
+	"TO-row-split":					  "Jaa rivi",
+	"TO-table-prop":				  "Taulukon asetukset",
+	"Top":                                            "Ylös",	
+	"Table Properties":				  "Taulukon asetukset",
+	"The bottom side only":				  "Ainoastaan alapuolelle",
+	"The left-hand side only":			  "Ainoastaan vasenreuna",
+	"The right and left sides only":		  "Oikea- ja vasenreuna",
+	"The right-hand side only":			  "Ainoastaan oikeareuna",
+	"The top and bottom sides only":		  "Ylä- ja alapuoli.",
+	"The top side only":				  "Ainoastaan yläpuoli",
+	"Vertical align":                                 "Vertikaali kohdistus",
+	"Width":					  "Leveys",
+	"not-del-last-cell":				  "Ei voida poistaa viimeistä solua rivistä.",
+	"not-del-last-col":				  "Ei voida poistaa viimeistä saraketta taulusta.",
+	"not-del-last-row":				  "Ei voida poistaa viimeistä riviä taulusta.",
+	"percent":					  "prosenttia",
+	"pixels":					  "pikseliä"
+};
Index: temp/trunk/html/test/naka/HTMLArea/plugins/TableOperations/lang/el.js
===================================================================
--- temp/trunk/html/test/naka/HTMLArea/plugins/TableOperations/lang/el.js	(revision 1694)
+++ temp/trunk/html/test/naka/HTMLArea/plugins/TableOperations/lang/el.js	(revision 1694)
@@ -0,0 +1,81 @@
+// I18N constants
+
+// LANG: "el", ENCODING: UTF-8 | ISO-8859-7
+// Author: Dimitris Glezos, dimitris@glezos.com
+
+TableOperations.I18N = {
+	"Align":					  "Στοίχηση",
+	"All four sides":				  "Και οι 4 πλευρές",
+	"Background":					  "Φόντο",
+	"Baseline":                                       "Baseline",
+	"Border":					  "Περίγραμμα",
+	"Borders":					  "Περιγράμματα",
+	"Bottom":                                         "Κάτω μέρος",
+	"CSS Style":					  "Στυλ [CSS]",
+	"Caption":					  "Λεζάντα",
+	"Cell Properties":                                "Ιδιότητες Κελιού",
+	"Center":					  "Κέντρο",
+	"Char":                                           "Χαρακτήρας",
+	"Collapsed borders":                              "Συμπτυγμένα περιγράμματα",
+	"Color":					  "Χρώμα",
+	"Description":					  "Περιγραφή",
+	"FG Color":					  "Χρώμα αντικειμένων",
+	"Float":                                          "Float",
+	"Frames":					  "Frames",
+	"Height":                                         "Ύψος",
+	"How many columns would you like to merge?":      "Πόσες στήλες θέλετε να ενώσετε;",
+	"How many rows would you like to merge?":         "Πόσες γραμμές θέλετε να ενώσετε;",
+	"Image URL":					  "URL εικόνας",
+	"Justify":                                        "Πλήρης στοίχηση",
+	"Layout":					  "Διάταξη",
+	"Left":						  "Αριστερά",
+	"Margin":                                         "Περιθώριο",
+	"Middle":                                         "Κέντρο",
+	"No rules":					  "Χωρίς Γραμμές",
+	"No sides":					  "No sides",
+	"None":                                           "Τίποτα",
+	"Padding":					  "Εσοχή",
+	"Please click into some cell":                    "Κάντε κλικ μέσα σε κάποιο κελί",
+	"Right":					  "Δεξιά",
+	"Row Properties":                                 "Ιδιότητες Γραμμής",
+	"Rules will appear between all rows and columns": "Γραμμές θα εμφανίζονται μεταξύ όλων των γραμμών και στηλών",
+	"Rules will appear between columns only":	  "Γραμμές θα εμφανίζονται μόνο μεταξύ στηλών",
+	"Rules will appear between rows only":		  "Γραμμές θα εμφανίζονται μόνο μεταξύ γραμμών",
+	"Rules":					  "Γραμμές",
+	"Spacing and padding":                            "Αποστάσεις και εσοχές",
+	"Spacing":					  "Αποστάσεις",
+	"Summary":					  "Σύνοψη",
+	"TO-cell-delete":				  "Διαγραφή κελιού",
+	"TO-cell-insert-after":				  "Εισαγωγή κελιού μετά",
+	"TO-cell-insert-before":			  "Εισαγωγή κελιού πριν",
+	"TO-cell-merge":				  "Συγχώνευση κελιών",
+	"TO-cell-prop":					  "Ιδιότητες κελιού",
+	"TO-cell-split":				  "Διαίρεση κελιού",
+	"TO-col-delete":				  "Διαγραφή στήλης",
+	"TO-col-insert-after":				  "Εισαγωγή στήλης μετά",
+	"TO-col-insert-before":				  "Εισαγωγή στήλης πριν",
+	"TO-col-split":					  "Διαίρεση στήλης",
+	"TO-row-delete":				  "Διαγραφή γραμμής",
+	"TO-row-insert-above":				  "Εισαγωγή γραμμής μετά",
+	"TO-row-insert-under":				  "Εισαγωγή γραμμής πριν",
+	"TO-row-prop":					  "Ιδιότητες γραμμής",
+	"TO-row-split":					  "Διαίρεση γραμμής",
+	"TO-table-prop":				  "Ιδιότητες πίνακα",
+	"Table Properties":				  "Ιδιότητες πίνακα",
+	"Text align":                                     "Στοίχηση κειμένου",
+	"The bottom side only":				  "Η κάτω πλευρά μόνο",
+	"The left-hand side only":			  "Η αριστερή πλευρά μόνο",
+	"The right and left sides only":		  "Οι δεξιές και αριστερές πλευρές μόνο",
+	"The right-hand side only":			  "Η δεξιά πλευρά μόνο",
+	"The top and bottom sides only":		  "Οι πάνω και κάτω πλευρές μόνο",
+	"The top side only":				  "Η πάνω πλευρά μόνο",
+	"Top":                                            "Πάνω",	
+	"Unset color":                                    "Αναίρεση χρώματος",
+	"Vertical align":                                 "Κατακόρυφη στοίχηση",
+	"Width":					  "Πλάτος",
+	"not-del-last-cell":				  "Δεν μπορεί να διαγραφεί το τελευταίο κελί σε μια γραμμή.",
+	"not-del-last-col":				  "Δεν μπορεί να διαγραφεί η τελευταία στήλη σε ένα πίνακα.",
+	"not-del-last-row":				  "Δεν μπορεί να διαγραφεί η τελευταία γραμμή σε ένα πίνακα.",
+	"percent":					  "τοις εκατόν",
+	"pixels":					  "pixels"
+};
Index: temp/trunk/html/test/naka/HTMLArea/plugins/TableOperations/lang/ro.js
===================================================================
--- temp/trunk/html/test/naka/HTMLArea/plugins/TableOperations/lang/ro.js	(revision 1694)
+++ temp/trunk/html/test/naka/HTMLArea/plugins/TableOperations/lang/ro.js	(revision 1694)
@@ -0,0 +1,90 @@
+// I18N constants
+
+// LANG: "ro", ENCODING: UTF-8
+// Author: Mihai Bazon, http://dynarch.com/mishoo
+
+// FOR TRANSLATORS:
+//
+//   1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE
+//      (at least a valid email address)
+//
+//   2. PLEASE TRY TO USE UTF-8 FOR ENCODING;
+//      (if this is not possible, please include a comment
+//       that states what encoding is necessary.)
+
+TableOperations.I18N = {
+	"Align":					  "Aliniere",
+	"All four sides":				  "Toate părţile",
+	"Background":					  "Fundal",
+	"Baseline":                                       "Baseline",
+	"Border":					  "Chenar",
+	"Borders":					  "Chenare",
+	"Bottom":                                         "Jos",
+	"CSS Style":					  "Stil [CSS]",
+	"Caption":					  "Titlu de tabel",
+	"Cell Properties":                                "Proprietăţile celulei",
+	"Center":					  "Centru",
+	"Char":                                           "Caracter",
+	"Collapsed borders":                              "Chenare asimilate",
+	"Color":					  "Culoare",
+	"Description":					  "Descriere",
+	"FG Color":					  "Culoare text",
+	"Float":                                          "Poziţie",
+	"Frames":					  "Chenare",
+	"Height":                                         "Înălţimea",
+	"How many columns would you like to merge?":      "Câte coloane vrei să uneşti?",
+	"How many rows would you like to merge?":         "Câte linii vrei să uneşti?",
+	"Image URL":					  "URL-ul imaginii",
+	"Justify":                                        "Justify",
+	"Layout":					  "Aranjament",
+	"Left":						  "Stânga",
+	"Margin":                                         "Margine",
+	"Middle":                                         "Mijloc",
+	"No rules":					  "Fără linii",
+	"No sides":					  "Fără părţi",
+	"None":                                           "Nimic",
+	"Padding":					  "Spaţiere",
+	"Please click into some cell":                    "Vă rog să daţi click într-o celulă",
+	"Right":					  "Dreapta",
+	"Row Properties":                                 "Proprietăţile liniei",
+	"Rules will appear between all rows and columns": "Vor apărea linii între toate rândurile şi coloanele",
+	"Rules will appear between columns only":	  "Vor apărea doar linii verticale",
+	"Rules will appear between rows only":		  "Vor apărea doar linii orizontale",
+	"Rules":					  "Linii",
+	"Spacing and padding":                            "Spaţierea",
+	"Spacing":					  "Între celule",
+	"Summary":					  "Sumar",
+	"TO-cell-delete":				  "Şterge celula",
+	"TO-cell-insert-after":				  "Inserează o celulă la dreapta",
+	"TO-cell-insert-before":			  "Inserează o celulă la stânga",
+	"TO-cell-merge":				  "Uneşte celulele",
+	"TO-cell-prop":					  "Proprietăţile celulei",
+	"TO-cell-split":				  "Împarte celula",
+	"TO-col-delete":				  "Şterge coloana",
+	"TO-col-insert-after":				  "Inserează o coloană la dreapta",
+	"TO-col-insert-before":				  "Inserează o coloană la stânga",
+	"TO-col-split":					  "Împarte coloana",
+	"TO-row-delete":				  "Şterge rândul",
+	"TO-row-insert-above":				  "Inserează un rând înainte",
+	"TO-row-insert-under":				  "Inserează un rând după",
+	"TO-row-prop":					  "Proprietăţile rândului",
+	"TO-row-split":					  "Împarte rândul",
+	"TO-table-prop":				  "Proprietăţile tabelei",
+	"Table Properties":				  "Proprietăţile tabelei",
+	"Text align":                                     "Aliniere",
+	"The bottom side only":				  "Doar partea de jos",
+	"The left-hand side only":			  "Doar partea din stânga",
+	"The right and left sides only":		  "Partea din stânga şi cea din dreapta",
+	"The right-hand side only":			  "Doar partea din dreapta",
+	"The top and bottom sides only":		  "Partea de sus si cea de jos",
+	"The top side only":				  "Doar partea de sus",
+	"Top":                                            "Sus",	
+	"Unset color":                                    "Dezactivează culoarea",
+	"Vertical align":                                 "Aliniere pe verticală",
+	"Width":					  "Lăţime",
+	"not-del-last-cell":				  "HTMLArea refuză cu laşitate să şteargă ultima celulă din rând.",
+	"not-del-last-col":				  "HTMLArea refuză cu laşitate să şteargă ultima coloamă din tabela.",
+	"not-del-last-row":				  "HTMLArea refuză cu laşitate să şteargă ultimul rând din tabela.",
+	"percent":					  "procente",
+	"pixels":					  "pixeli"
+};
Index: temp/trunk/html/test/naka/HTMLArea/plugins/TableOperations/lang/en.js
===================================================================
--- temp/trunk/html/test/naka/HTMLArea/plugins/TableOperations/lang/en.js	(revision 1694)
+++ temp/trunk/html/test/naka/HTMLArea/plugins/TableOperations/lang/en.js	(revision 1694)
@@ -0,0 +1,90 @@
+// I18N constants
+
+// LANG: "en", ENCODING: UTF-8 | ISO-8859-1
+// Author: Mihai Bazon, http://dynarch.com/mishoo
+
+// FOR TRANSLATORS:
+//
+//   1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE
+//      (at least a valid email address)
+//
+//   2. PLEASE TRY TO USE UTF-8 FOR ENCODING;
+//      (if this is not possible, please include a comment
+//       that states what encoding is necessary.)
+
+TableOperations.I18N = {
+	"Align":					  "Align",
+	"All four sides":				  "All four sides",
+	"Background":					  "Background",
+	"Baseline":                                       "Baseline",
+	"Border":					  "Border",
+	"Borders":					  "Borders",
+	"Bottom":                                         "Bottom",
+	"CSS Style":					  "Style [CSS]",
+	"Caption":					  "Caption",
+	"Cell Properties":                                "Cell Properties",
+	"Center":					  "Center",
+	"Char":                                           "Char",
+	"Collapsed borders":                              "Collapsed borders",
+	"Color":					  "Color",
+	"Description":					  "Description",
+	"FG Color":					  "FG Color",
+	"Float":                                          "Float",
+	"Frames":					  "Frames",
+	"Height":                                         "Height",
+	"How many columns would you like to merge?":      "How many columns would you like to merge?",
+	"How many rows would you like to merge?":         "How many rows would you like to merge?",
+	"Image URL":					  "Image URL",
+	"Justify":                                        "Justify",
+	"Layout":					  "Layout",
+	"Left":						  "Left",
+	"Margin":                                         "Margin",
+	"Middle":                                         "Middle",
+	"No rules":					  "No rules",
+	"No sides":					  "No sides",
+	"None":                                           "None",
+	"Padding":					  "Padding",
+	"Please click into some cell":                    "Please click into some cell",
+	"Right":					  "Right",
+	"Row Properties":                                 "Row Properties",
+	"Rules will appear between all rows and columns": "Rules will appear between all rows and columns",
+	"Rules will appear between columns only":	  "Rules will appear between columns only",
+	"Rules will appear between rows only":		  "Rules will appear between rows only",
+	"Rules":					  "Rules",
+	"Spacing and padding":                            "Spacing and padding",
+	"Spacing":					  "Spacing",
+	"Summary":					  "Summary",
+	"TO-cell-delete":				  "Delete cell",
+	"TO-cell-insert-after":				  "Insert cell after",
+	"TO-cell-insert-before":			  "Insert cell before",
+	"TO-cell-merge":				  "Merge cells",
+	"TO-cell-prop":					  "Cell properties",
+	"TO-cell-split":				  "Split cell",
+	"TO-col-delete":				  "Delete column",
+	"TO-col-insert-after":				  "Insert column after",
+	"TO-col-insert-before":				  "Insert column before",
+	"TO-col-split":					  "Split column",
+	"TO-row-delete":				  "Delete row",
+	"TO-row-insert-above":				  "Insert row before",
+	"TO-row-insert-under":				  "Insert row after",
+	"TO-row-prop":					  "Row properties",
+	"TO-row-split":					  "Split row",
+	"TO-table-prop":				  "Table properties",
+	"Table Properties":				  "Table Properties",
+	"Text align":                                     "Text align",
+	"The bottom side only":				  "The bottom side only",
+	"The left-hand side only":			  "The left-hand side only",
+	"The right and left sides only":		  "The right and left sides only",
+	"The right-hand side only":			  "The right-hand side only",
+	"The top and bottom sides only":		  "The top and bottom sides only",
+	"The top side only":				  "The top side only",
+	"Top":                                            "Top",	
+	"Unset color":                                    "Unset color",
+	"Vertical align":                                 "Vertical align",
+	"Width":					  "Width",
+	"not-del-last-cell":				  "HTMLArea cowardly refuses to delete the last cell in row.",
+	"not-del-last-col":				  "HTMLArea cowardly refuses to delete the last column in table.",
+	"not-del-last-row":				  "HTMLArea cowardly refuses to delete the last row in table.",
+	"percent":					  "percent",
+	"pixels":					  "pixels"
+};
Index: temp/trunk/html/test/naka/HTMLArea/plugins/TableOperations/lang/da.js
===================================================================
--- temp/trunk/html/test/naka/HTMLArea/plugins/TableOperations/lang/da.js	(revision 1694)
+++ temp/trunk/html/test/naka/HTMLArea/plugins/TableOperations/lang/da.js	(revision 1694)
@@ -0,0 +1,90 @@
+﻿// I18N constants
+
+// LANG: "da", ENCODING: UTF-8 | ISO-8859-1
+// Author: Steen Sønderup, <steen@soenderup.com>
+
+// FOR TRANSLATORS:
+//
+//   1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE
+//      (at least a valid email address)
+//
+//   2. PLEASE TRY TO USE UTF-8 FOR ENCODING;
+//      (if this is not possible, please include a comment
+//       that states what encoding is necessary.)
+
+TableOperations.I18N = {
+	"Align":											"Placer",
+	"All four sides":									"Alle fire sider",
+	"Background":										"Baggrund",
+	"Baseline":											"Bundlinie",
+	"Border":											"Kant",
+	"Borders":											"Kanter",
+	"Bottom":											"Bund",
+	"CSS Style":										"Stil [CSS]",
+	"Caption":											"Titel",
+	"Cell Properties":									"Celle egenskaber",
+	"Center":											"Centrer",
+	"Char":												"Plads",
+	"Collapsed borders":								"Sammensmelt rammer",
+	"Color":											"Farve",
+	"Description":										"Beskrivelse",
+	"FG Color":											"Font farve",
+	"Float":											"Justering",
+	"Frames":											"Udvendig",
+	"Height":											"Højde",
+	"How many columns would you like to merge?":		"Hvor mange kollonner vil du samle?",
+	"How many rows would you like to merge?":			"Hvor mange rækker vil du samle?",
+	"Image URL":										"Billede URL",
+	"Justify":											"Lige margener",
+	"Layout":											"Opsætning",
+	"Left":												"Venstre",
+	"Margin":											"Margen",
+	"Middle":											"Centrer",
+	"No rules":											"Ingen rammer",
+	"No sides":											"Ingen sider",
+	"None":												"Ingen",
+	"Padding":											"Margen",
+	"Please click into some cell":						"Klik på en celle",
+	"Right":											"Højre",
+	"Row Properties":									"Række egenskaber",
+	"Rules will appear between all rows and columns":	"Rammer mellem rækker og kolonner",
+	"Rules will appear between columns only":			"Kun rammer mellem kolonner",
+	"Rules will appear between rows only":				"Kun rammer mellem rækker",
+	"Rules":											"Invendig",
+	"Spacing and padding":								"Afstand og margen",
+	"Spacing":											"Afstand",
+	"Summary":											"Beskrivelse",
+	"TO-cell-delete":									"Slet celle",
+	"TO-cell-insert-after":								"Indsæt celle efter",
+	"TO-cell-insert-before":							"Indsæt celle før",
+	"TO-cell-merge":									"Sammensæt celler",
+	"TO-cell-prop":										"Celle egenskaber",
+	"TO-cell-split":									"Opdel celle",
+	"TO-col-delete":									"Slet kollonne",
+	"TO-col-insert-after":								"Indsæt kolonne efter",
+	"TO-col-insert-before":								"Indsæt kolonne før",
+	"TO-col-split":										"Opdel kolonne",
+	"TO-row-delete":									"Slet række",
+	"TO-row-insert-above":								"Indsæt række før",
+	"TO-row-insert-under":								"Indsæt række efter",
+	"TO-row-prop":										"Række egenskaber",
+	"TO-row-split":										"Opdel række",
+	"TO-table-prop":									"Tabel egenskaber",
+	"Table Properties":									"Tabel egenskaber",
+	"Text align":										"Tekst",
+	"The bottom side only":								"Kun i bunden",
+	"The left-hand side only":							"Kun i højre side",
+	"The right and left sides only":					"Kun i siderne",
+	"The right-hand side only":							"Kun i venstre side",
+	"The top and bottom sides only":					"Kun i top og bund",
+	"The top side only":								"Kun i toppen",
+	"Top":												"Top",	
+	"Unset color":										"Farve ikke valgt",
+	"Vertical align":									"Vertikal placering",
+	"Width":											"Bredde",
+	"not-del-last-cell":								"Du kan ikke slette den sidste celle i en række.",
+	"not-del-last-col":									"Du kan ikke slette den sidste kolonne i en tabel.",
+	"not-del-last-row":									"Du kan ikke slette den sidste række i en tabel.",
+	"percent":											"procent",
+	"pixels":											"pixel"
+};
Index: temp/trunk/html/test/naka/HTMLArea/plugins/TableOperations/table-operations.js
===================================================================
--- temp/trunk/html/test/naka/HTMLArea/plugins/TableOperations/table-operations.js	(revision 1694)
+++ temp/trunk/html/test/naka/HTMLArea/plugins/TableOperations/table-operations.js	(revision 1694)
@@ -0,0 +1,1160 @@
+// Table Operations Plugin for HTMLArea-3.0
+// Implementation by Mihai Bazon.  Sponsored by http://www.bloki.com
+//
+// htmlArea v3.0 - Copyright (c) 2002 interactivetools.com, inc.
+// This notice MUST stay intact for use (see license.txt).
+//
+// A free WYSIWYG editor replacement for <textarea> fields.
+// For full source code and docs, visit http://www.interactivetools.com/
+//
+// Version 3.0 developed by Mihai Bazon for InteractiveTools.
+//   http://dynarch.com/mishoo
+//
+// $Id$
+
+// Object that will encapsulate all the table operations provided by
+// HTMLArea-3.0 (except "insert table" which is included in the main file)
+function TableOperations(editor) {
+	this.editor = editor;
+
+	var cfg = editor.config;
+	var tt = TableOperations.I18N;
+	var bl = TableOperations.btnList;
+	var self = this;
+
+	// register the toolbar buttons provided by this plugin
+	var toolbar = ["linebreak"];
+	for (var i in bl) {
+		var btn = bl[i];
+		if (!btn) {
+			toolbar.push("separator");
+		} else {
+			var id = "TO-" + btn[0];
+			cfg.registerButton(id, tt[id], editor.imgURL(btn[0] + ".gif", "TableOperations"), false,
+					   function(editor, id) {
+						   // dispatch button press event
+						   self.buttonPress(editor, id);
+					   }, btn[1]);
+			toolbar.push(id);
+		}
+	}
+
+	// add a new line in the toolbar
+	cfg.toolbar.push(toolbar);
+};
+
+TableOperations._pluginInfo = {
+	name          : "TableOperations",
+	version       : "1.0",
+	developer     : "Mihai Bazon",
+	developer_url : "http://dynarch.com/mishoo/",
+	c_owner       : "Mihai Bazon",
+	sponsor       : "Zapatec Inc.",
+	sponsor_url   : "http://www.bloki.com",
+	license       : "htmlArea"
+};
+
+/************************
+ * UTILITIES
+ ************************/
+
+// retrieves the closest element having the specified tagName in the list of
+// ancestors of the current selection/caret.
+TableOperations.prototype.getClosest = function(tagName) {
+	var editor = this.editor;
+	var ancestors = editor.getAllAncestors();
+	var ret = null;
+	tagName = ("" + tagName).toLowerCase();
+	for (var i in ancestors) {
+		var el = ancestors[i];
+		if (el.tagName.toLowerCase() == tagName) {
+			ret = el;
+			break;
+		}
+	}
+	return ret;
+};
+
+// this function requires the file PopupDiv/PopupWin to be loaded from browser
+TableOperations.prototype.dialogTableProperties = function() {
+	var i18n = TableOperations.I18N;
+	// retrieve existing values
+	var table = this.getClosest("table");
+	// this.editor.selectNodeContents(table);
+	// this.editor.updateToolbar();
+
+	var dialog = new PopupWin(this.editor, i18n["Table Properties"], function(dialog, params) {
+		TableOperations.processStyle(params, table);
+		for (var i in params) {
+			var val = params[i];
+			switch (i) {
+			    case "f_caption":
+				if (/\S/.test(val)) {
+					// contains non white-space characters
+					var caption = table.getElementsByTagName("caption")[0];
+					if (!caption) {
+						caption = dialog.editor._doc.createElement("caption");
+						table.insertBefore(caption, table.firstChild);
+					}
+					caption.innerHTML = val;
+				} else {
+					// search for caption and delete it if found
+					var caption = table.getElementsByTagName("caption")[0];
+					if (caption) {
+						caption.parentNode.removeChild(caption);
+					}
+				}
+				break;
+			    case "f_summary":
+				table.summary = val;
+				break;
+			    case "f_width":
+				table.style.width = ("" + val) + params.f_unit;
+				break;
+			    case "f_align":
+				table.align = val;
+				break;
+			    case "f_spacing":
+				table.cellSpacing = val;
+				break;
+			    case "f_padding":
+				table.cellPadding = val;
+				break;
+			    case "f_borders":
+				table.border = val;
+				break;
+			    case "f_frames":
+				table.frame = val;
+				break;
+			    case "f_rules":
+				table.rules = val;
+				break;
+			}
+		}
+		// various workarounds to refresh the table display (Gecko,
+		// what's going on?! do not disappoint me!)
+		dialog.editor.forceRedraw();
+		dialog.editor.focusEditor();
+		dialog.editor.updateToolbar();
+		var save_collapse = table.style.borderCollapse;
+		table.style.borderCollapse = "collapse";
+		table.style.borderCollapse = "separate";
+		table.style.borderCollapse = save_collapse;
+	},
+
+	// this function gets called when the dialog needs to be initialized
+	function (dialog) {
+
+		var f_caption = "";
+		var capel = table.getElementsByTagName("caption")[0];
+		if (capel) {
+			f_caption = capel.innerHTML;
+		}
+		var f_summary = table.summary;
+		var f_width = parseInt(table.style.width);
+		isNaN(f_width) && (f_width = "");
+		var f_unit = /%/.test(table.style.width) ? 'percent' : 'pixels';
+		var f_align = table.align;
+		var f_spacing = table.cellSpacing;
+		var f_padding = table.cellPadding;
+		var f_borders = table.border;
+		var f_frames = table.frame;
+		var f_rules = table.rules;
+
+		function selected(val) {
+			return val ? " selected" : "";
+		};
+
+		// dialog contents
+		dialog.content.style.width = "400px";
+		dialog.content.innerHTML = " \
+<div class='title'\
+ style='background: url(" + dialog.baseURL + dialog.editor.imgURL("table-prop.gif", "TableOperations") + ") #fff 98% 50% no-repeat'>" + i18n["Table Properties"] + "\
+</div> \
+<table style='width:100%'> \
+  <tr> \
+    <td> \
+      <fieldset><legend>" + i18n["Description"] + "</legend> \
+       <table style='width:100%'> \
+        <tr> \
+          <td class='label'>" + i18n["Caption"] + ":</td> \
+          <td class='value'><input type='text' name='f_caption' value='" + f_caption + "'/></td> \
+        </tr><tr> \
+          <td class='label'>" + i18n["Summary"] + ":</td> \
+          <td class='value'><input type='text' name='f_summary' value='" + f_summary + "'/></td> \
+        </tr> \
+       </table> \
+      </fieldset> \
+    </td> \
+  </tr> \
+  <tr><td id='--HA-layout'></td></tr> \
+  <tr> \
+    <td> \
+      <fieldset><legend>" + i18n["Spacing and padding"] + "</legend> \
+       <table style='width:100%'> \
+"+//        <tr> \
+//           <td class='label'>" + i18n["Width"] + ":</td> \
+//           <td><input type='text' name='f_width' value='" + f_width + "' size='5' /> \
+//             <select name='f_unit'> \
+//               <option value='%'" + selected(f_unit == "percent") + ">" + i18n["percent"] + "</option> \
+//               <option value='px'" + selected(f_unit == "pixels") + ">" + i18n["pixels"] + "</option> \
+//             </select> &nbsp;&nbsp;" + i18n["Align"] + ": \
+//             <select name='f_align'> \
+//               <option value='left'" + selected(f_align == "left") + ">" + i18n["Left"] + "</option> \
+//               <option value='center'" + selected(f_align == "center") + ">" + i18n["Center"] + "</option> \
+//               <option value='right'" + selected(f_align == "right") + ">" + i18n["Right"] + "</option> \
+//             </select> \
+//           </td> \
+//         </tr> \
+"        <tr> \
+          <td class='label'>" + i18n["Spacing"] + ":</td> \
+          <td><input type='text' name='f_spacing' size='5' value='" + f_spacing + "' /> &nbsp;" + i18n["Padding"] + ":\
+            <input type='text' name='f_padding' size='5' value='" + f_padding + "' /> &nbsp;&nbsp;" + i18n["pixels"] + "\
+          </td> \
+        </tr> \
+       </table> \
+      </fieldset> \
+    </td> \
+  </tr> \
+  <tr> \
+    <td> \
+      <fieldset><legend>Frame and borders</legend> \
+        <table width='100%'> \
+          <tr> \
+            <td class='label'>" + i18n["Borders"] + ":</td> \
+            <td><input name='f_borders' type='text' size='5' value='" + f_borders + "' /> &nbsp;&nbsp;" + i18n["pixels"] + "</td> \
+          </tr> \
+          <tr> \
+            <td class='label'>" + i18n["Frames"] + ":</td> \
+            <td> \
+              <select name='f_frames'> \
+                <option value='void'" + selected(f_frames == "void") + ">" + i18n["No sides"] + "</option> \
+                <option value='above'" + selected(f_frames == "above") + ">" + i18n["The top side only"] + "</option> \
+                <option value='below'" + selected(f_frames == "below") + ">" + i18n["The bottom side only"] + "</option> \
+                <option value='hsides'" + selected(f_frames == "hsides") + ">" + i18n["The top and bottom sides only"] + "</option> \
+                <option value='vsides'" + selected(f_frames == "vsides") + ">" + i18n["The right and left sides only"] + "</option> \
+                <option value='lhs'" + selected(f_frames == "lhs") + ">" + i18n["The left-hand side only"] + "</option> \
+                <option value='rhs'" + selected(f_frames == "rhs") + ">" + i18n["The right-hand side only"] + "</option> \
+                <option value='box'" + selected(f_frames == "box") + ">" + i18n["All four sides"] + "</option> \
+              </select> \
+            </td> \
+          </tr> \
+          <tr> \
+            <td class='label'>" + i18n["Rules"] + ":</td> \
+            <td> \
+              <select name='f_rules'> \
+                <option value='none'" + selected(f_rules == "none") + ">" + i18n["No rules"] + "</option> \
+                <option value='rows'" + selected(f_rules == "rows") + ">" + i18n["Rules will appear between rows only"] + "</option> \
+                <option value='cols'" + selected(f_rules == "cols") + ">" + i18n["Rules will appear between columns only"] + "</option> \
+                <option value='all'" + selected(f_rules == "all") + ">" + i18n["Rules will appear between all rows and columns"] + "</option> \
+              </select> \
+            </td> \
+          </tr> \
+        </table> \
+      </fieldset> \
+    </td> \
+  </tr> \
+  <tr> \
+    <td id='--HA-style'></td> \
+  </tr> \
+</table> \
+";
+		var st_prop = TableOperations.createStyleFieldset(dialog.doc, dialog.editor, table);
+		var p = dialog.doc.getElementById("--HA-style");
+		p.appendChild(st_prop);
+		var st_layout = TableOperations.createStyleLayoutFieldset(dialog.doc, dialog.editor, table);
+		p = dialog.doc.getElementById("--HA-layout");
+		p.appendChild(st_layout);
+		dialog.modal = true;
+		dialog.addButtons("ok", "cancel");
+		dialog.showAtElement(dialog.editor._iframe, "c");
+	});
+};
+
+// this function requires the file PopupDiv/PopupWin to be loaded from browser
+TableOperations.prototype.dialogRowCellProperties = function(cell) {
+	var i18n = TableOperations.I18N;
+	// retrieve existing values
+	var element = this.getClosest(cell ? "td" : "tr");
+	var table = this.getClosest("table");
+	// this.editor.selectNodeContents(element);
+	// this.editor.updateToolbar();
+
+	var dialog = new PopupWin(this.editor, i18n[cell ? "Cell Properties" : "Row Properties"], function(dialog, params) {
+		TableOperations.processStyle(params, element);
+		for (var i in params) {
+			var val = params[i];
+			switch (i) {
+			    case "f_align":
+				element.align = val;
+				break;
+			    case "f_char":
+				element.ch = val;
+				break;
+			    case "f_valign":
+				element.vAlign = val;
+				break;
+			}
+		}
+		// various workarounds to refresh the table display (Gecko,
+		// what's going on?! do not disappoint me!)
+		dialog.editor.forceRedraw();
+		dialog.editor.focusEditor();
+		dialog.editor.updateToolbar();
+		var save_collapse = table.style.borderCollapse;
+		table.style.borderCollapse = "collapse";
+		table.style.borderCollapse = "separate";
+		table.style.borderCollapse = save_collapse;
+	},
+
+	// this function gets called when the dialog needs to be initialized
+	function (dialog) {
+
+		var f_align = element.align;
+		var f_valign = element.vAlign;
+		var f_char = element.ch;
+
+		function selected(val) {
+			return val ? " selected" : "";
+		};
+
+		// dialog contents
+		dialog.content.style.width = "400px";
+		dialog.content.innerHTML = " \
+<div class='title'\
+ style='background: url(" + dialog.baseURL + dialog.editor.imgURL(cell ? "cell-prop.gif" : "row-prop.gif", "TableOperations") + ") #fff 98% 50% no-repeat'>" + i18n[cell ? "Cell Properties" : "Row Properties"] + "</div> \
+<table style='width:100%'> \
+  <tr> \
+    <td id='--HA-layout'> \
+"+//      <fieldset><legend>" + i18n["Layout"] + "</legend> \
+//        <table style='width:100%'> \
+//         <tr> \
+//           <td class='label'>" + i18n["Align"] + ":</td> \
+//           <td> \
+//             <select name='f_align'> \
+//               <option value='left'" + selected(f_align == "left") + ">" + i18n["Left"] + "</option> \
+//               <option value='center'" + selected(f_align == "center") + ">" + i18n["Center"] + "</option> \
+//               <option value='right'" + selected(f_align == "right") + ">" + i18n["Right"] + "</option> \
+//               <option value='char'" + selected(f_align == "char") + ">" + i18n["Char"] + "</option> \
+//             </select> \
+//             &nbsp;&nbsp;" + i18n["Char"] + ": \
+//             <input type='text' style='font-family: monospace; text-align: center' name='f_char' size='1' value='" + f_char + "' /> \
+//           </td> \
+//         </tr><tr> \
+//           <td class='label'>" + i18n["Vertical align"] + ":</td> \
+//           <td> \
+//             <select name='f_valign'> \
+//               <option value='top'" + selected(f_valign == "top") + ">" + i18n["Top"] + "</option> \
+//               <option value='middle'" + selected(f_valign == "middle") + ">" + i18n["Middle"] + "</option> \
+//               <option value='bottom'" + selected(f_valign == "bottom") + ">" + i18n["Bottom"] + "</option> \
+//               <option value='baseline'" + selected(f_valign == "baseline") + ">" + i18n["Baseline"] + "</option> \
+//             </select> \
+//           </td> \
+//         </tr> \
+//        </table> \
+//       </fieldset> \
+"    </td> \
+  </tr> \
+  <tr> \
+    <td id='--HA-style'></td> \
+  </tr> \
+</table> \
+";
+		var st_prop = TableOperations.createStyleFieldset(dialog.doc, dialog.editor, element);
+		var p = dialog.doc.getElementById("--HA-style");
+		p.appendChild(st_prop);
+		var st_layout = TableOperations.createStyleLayoutFieldset(dialog.doc, dialog.editor, element);
+		p = dialog.doc.getElementById("--HA-layout");
+		p.appendChild(st_layout);
+		dialog.modal = true;
+		dialog.addButtons("ok", "cancel");
+		dialog.showAtElement(dialog.editor._iframe, "c");
+	});
+};
+
+// this function gets called when some button from the TableOperations toolbar
+// was pressed.
+TableOperations.prototype.buttonPress = function(editor, button_id) {
+	this.editor = editor;
+	var mozbr = HTMLArea.is_gecko ? "<br />" : "";
+	var i18n = TableOperations.I18N;
+
+	// helper function that clears the content in a table row
+	function clearRow(tr) {
+		var tds = tr.getElementsByTagName("td");
+		for (var i = tds.length; --i >= 0;) {
+			var td = tds[i];
+			td.rowSpan = 1;
+			td.innerHTML = mozbr;
+		}
+	};
+
+	function splitRow(td) {
+		var n = parseInt("" + td.rowSpan);
+		var nc = parseInt("" + td.colSpan);
+		td.rowSpan = 1;
+		tr = td.parentNode;
+		var itr = tr.rowIndex;
+		var trs = tr.parentNode.rows;
+		var index = td.cellIndex;
+		while (--n > 0) {
+			tr = trs[++itr];
+			var otd = editor._doc.createElement("td");
+			otd.colSpan = td.colSpan;
+			otd.innerHTML = mozbr;
+			tr.insertBefore(otd, tr.cells[index]);
+		}
+		editor.forceRedraw();
+		editor.updateToolbar();
+	};
+
+	function splitCol(td) {
+		var nc = parseInt("" + td.colSpan);
+		td.colSpan = 1;
+		tr = td.parentNode;
+		var ref = td.nextSibling;
+		while (--nc > 0) {
+			var otd = editor._doc.createElement("td");
+			otd.rowSpan = td.rowSpan;
+			otd.innerHTML = mozbr;
+			tr.insertBefore(otd, ref);
+		}
+		editor.forceRedraw();
+		editor.updateToolbar();
+	};
+
+	function splitCell(td) {
+		var nc = parseInt("" + td.colSpan);
+		splitCol(td);
+		var items = td.parentNode.cells;
+		var index = td.cellIndex;
+		while (nc-- > 0) {
+			splitRow(items[index++]);
+		}
+	};
+
+	function selectNextNode(el) {
+		var node = el.nextSibling;
+		while (node && node.nodeType != 1) {
+			node = node.nextSibling;
+		}
+		if (!node) {
+			node = el.previousSibling;
+			while (node && node.nodeType != 1) {
+				node = node.previousSibling;
+			}
+		}
+		if (!node) {
+			node = el.parentNode;
+		}
+		editor.selectNodeContents(node);
+	};
+
+	switch (button_id) {
+		// ROWS
+
+	    case "TO-row-insert-above":
+	    case "TO-row-insert-under":
+		var tr = this.getClosest("tr");
+		if (!tr) {
+			break;
+		}
+		var otr = tr.cloneNode(true);
+		clearRow(otr);
+		tr.parentNode.insertBefore(otr, /under/.test(button_id) ? tr.nextSibling : tr);
+		editor.forceRedraw();
+		editor.focusEditor();
+		break;
+	    case "TO-row-delete":
+		var tr = this.getClosest("tr");
+		if (!tr) {
+			break;
+		}
+		var par = tr.parentNode;
+		if (par.rows.length == 1) {
+			alert(i18n["not-del-last-row"]);
+			break;
+		}
+		// set the caret first to a position that doesn't
+		// disappear.
+		selectNextNode(tr);
+		par.removeChild(tr);
+		editor.forceRedraw();
+		editor.focusEditor();
+		editor.updateToolbar();
+		break;
+	    case "TO-row-split":
+		var td = this.getClosest("td");
+		if (!td) {
+			break;
+		}
+		splitRow(td);
+		break;
+
+		// COLUMNS
+
+	    case "TO-col-insert-before":
+	    case "TO-col-insert-after":
+		var td = this.getClosest("td");
+		if (!td) {
+			break;
+		}
+		var rows = td.parentNode.parentNode.rows;
+		var index = td.cellIndex;
+		for (var i = rows.length; --i >= 0;) {
+			var tr = rows[i];
+			var ref = tr.cells[index + (/after/.test(button_id) ? 1 : 0)];
+			var otd = editor._doc.createElement("td");
+			otd.innerHTML = mozbr;
+			tr.insertBefore(otd, ref);
+		}
+		editor.focusEditor();
+		break;
+	    case "TO-col-split":
+		var td = this.getClosest("td");
+		if (!td) {
+			break;
+		}
+		splitCol(td);
+		break;
+	    case "TO-col-delete":
+		var td = this.getClosest("td");
+		if (!td) {
+			break;
+		}
+		var index = td.cellIndex;
+		if (td.parentNode.cells.length == 1) {
+			alert(i18n["not-del-last-col"]);
+			break;
+		}
+		// set the caret first to a position that doesn't disappear
+		selectNextNode(td);
+		var rows = td.parentNode.parentNode.rows;
+		for (var i = rows.length; --i >= 0;) {
+			var tr = rows[i];
+			tr.removeChild(tr.cells[index]);
+		}
+		editor.forceRedraw();
+		editor.focusEditor();
+		editor.updateToolbar();
+		break;
+
+		// CELLS
+
+	    case "TO-cell-split":
+		var td = this.getClosest("td");
+		if (!td) {
+			break;
+		}
+		splitCell(td);
+		break;
+	    case "TO-cell-insert-before":
+	    case "TO-cell-insert-after":
+		var td = this.getClosest("td");
+		if (!td) {
+			break;
+		}
+		var tr = td.parentNode;
+		var otd = editor._doc.createElement("td");
+		otd.innerHTML = mozbr;
+		tr.insertBefore(otd, /after/.test(button_id) ? td.nextSibling : td);
+		editor.forceRedraw();
+		editor.focusEditor();
+		break;
+	    case "TO-cell-delete":
+		var td = this.getClosest("td");
+		if (!td) {
+			break;
+		}
+		if (td.parentNode.cells.length == 1) {
+			alert(i18n["not-del-last-cell"]);
+			break;
+		}
+		// set the caret first to a position that doesn't disappear
+		selectNextNode(td);
+		td.parentNode.removeChild(td);
+		editor.forceRedraw();
+		editor.updateToolbar();
+		break;
+	    case "TO-cell-merge":
+		// !! FIXME: Mozilla specific !!
+		var sel = editor._getSelection();
+		var range, i = 0;
+		var rows = [];
+		var row = null;
+		var cells = null;
+		if (!HTMLArea.is_ie) {
+			try {
+				while (range = sel.getRangeAt(i++)) {
+					var td = range.startContainer.childNodes[range.startOffset];
+					if (td.parentNode != row) {
+						row = td.parentNode;
+						(cells) && rows.push(cells);
+						cells = [];
+					}
+					cells.push(td);
+				}
+			} catch(e) {/* finished walking through selection */}
+			rows.push(cells);
+		} else {
+			// Internet Explorer "browser"
+			var td = this.getClosest("td");
+			if (!td) {
+				alert(i18n["Please click into some cell"]);
+				break;
+			}
+			var tr = td.parentElement;
+			var no_cols = prompt(i18n["How many columns would you like to merge?"], 2);
+			if (!no_cols) {
+				// cancelled
+				break;
+			}
+			var no_rows = prompt(i18n["How many rows would you like to merge?"], 2);
+			if (!no_rows) {
+				// cancelled
+				break;
+			}
+			var cell_index = td.cellIndex;
+			while (no_rows-- > 0) {
+				td = tr.cells[cell_index];
+				cells = [td];
+				for (var i = 1; i < no_cols; ++i) {
+					td = td.nextSibling;
+					if (!td) {
+						break;
+					}
+					cells.push(td);
+				}
+				rows.push(cells);
+				tr = tr.nextSibling;
+				if (!tr) {
+					break;
+				}
+			}
+		}
+		var HTML = "";
+		for (i = 0; i < rows.length; ++i) {
+			// i && (HTML += "<br />");
+			var cells = rows[i];
+			for (var j = 0; j < cells.length; ++j) {
+				// j && (HTML += "&nbsp;");
+				var cell = cells[j];
+				HTML += cell.innerHTML;
+				(i || j) && (cell.parentNode.removeChild(cell));
+			}
+		}
+		var td = rows[0][0];
+		td.innerHTML = HTML;
+		td.rowSpan = rows.length;
+		td.colSpan = rows[0].length;
+		editor.selectNodeContents(td);
+		editor.forceRedraw();
+		editor.focusEditor();
+		break;
+
+		// PROPERTIES
+
+	    case "TO-table-prop":
+		this.dialogTableProperties();
+		break;
+
+	    case "TO-row-prop":
+		this.dialogRowCellProperties(false);
+		break;
+
+	    case "TO-cell-prop":
+		this.dialogRowCellProperties(true);
+		break;
+
+	    default:
+		alert("Button [" + button_id + "] not yet implemented");
+	}
+};
+
+// the list of buttons added by this plugin
+TableOperations.btnList = [
+	// table properties button
+	["table-prop",       "table"],
+	null,			// separator
+
+	// ROWS
+	["row-prop",         "tr"],
+	["row-insert-above", "tr"],
+	["row-insert-under", "tr"],
+	["row-delete",       "tr"],
+	["row-split",        "td[rowSpan!=1]"],
+	null,
+
+	// COLS
+	["col-insert-before", "td"],
+	["col-insert-after",  "td"],
+	["col-delete",        "td"],
+	["col-split",         "td[colSpan!=1]"],
+	null,
+
+	// CELLS
+	["cell-prop",          "td"],
+	["cell-insert-before", "td"],
+	["cell-insert-after",  "td"],
+	["cell-delete",        "td"],
+	["cell-merge",         "tr"],
+	["cell-split",         "td[colSpan!=1,rowSpan!=1]"]
+	];
+
+
+
+//// GENERIC CODE [style of any element; this should be moved into a separate
+//// file as it'll be very useful]
+//// BEGIN GENERIC CODE -----------------------------------------------------
+
+TableOperations.getLength = function(value) {
+	var len = parseInt(value);
+	if (isNaN(len)) {
+		len = "";
+	}
+	return len;
+};
+
+// Applies the style found in "params" to the given element.
+TableOperations.processStyle = function(params, element) {
+	var style = element.style;
+	for (var i in params) {
+		var val = params[i];
+		switch (i) {
+		    case "f_st_backgroundColor":
+			style.backgroundColor = val;
+			break;
+		    case "f_st_color":
+			style.color = val;
+			break;
+		    case "f_st_backgroundImage":
+			if (/\S/.test(val)) {
+				style.backgroundImage = "url(" + val + ")";
+			} else {
+				style.backgroundImage = "none";
+			}
+			break;
+		    case "f_st_borderWidth":
+			style.borderWidth = val;
+			break;
+		    case "f_st_borderStyle":
+			style.borderStyle = val;
+			break;
+		    case "f_st_borderColor":
+			style.borderColor = val;
+			break;
+		    case "f_st_borderCollapse":
+			style.borderCollapse = val ? "collapse" : "";
+			break;
+		    case "f_st_width":
+			if (/\S/.test(val)) {
+				style.width = val + params["f_st_widthUnit"];
+			} else {
+				style.width = "";
+			}
+			break;
+		    case "f_st_height":
+			if (/\S/.test(val)) {
+				style.height = val + params["f_st_heightUnit"];
+			} else {
+				style.height = "";
+			}
+			break;
+		    case "f_st_textAlign":
+			if (val == "char") {
+				var ch = params["f_st_textAlignChar"];
+				if (ch == '"') {
+					ch = '\\"';
+				}
+				style.textAlign = '"' + ch + '"';
+			} else {
+				style.textAlign = val;
+			}
+			break;
+		    case "f_st_verticalAlign":
+			style.verticalAlign = val;
+			break;
+		    case "f_st_float":
+			style.cssFloat = val;
+			break;
+// 		    case "f_st_margin":
+// 			style.margin = val + "px";
+// 			break;
+// 		    case "f_st_padding":
+// 			style.padding = val + "px";
+// 			break;
+		}
+	}
+};
+
+// Returns an HTML element for a widget that allows color selection.  That is,
+// a button that contains the given color, if any, and when pressed will popup
+// the sooner-or-later-to-be-rewritten select_color.html dialog allowing user
+// to select some color.  If a color is selected, an input field with the name
+// "f_st_"+name will be updated with the color value in #123456 format.
+TableOperations.createColorButton = function(doc, editor, color, name) {
+	if (!color) {
+		color = "";
+	} else if (!/#/.test(color)) {
+		color = HTMLArea._colorToRgb(color);
+	}
+
+	var df = doc.createElement("span");
+ 	var field = doc.createElement("input");
+	field.type = "hidden";
+	df.appendChild(field);
+ 	field.name = "f_st_" + name;
+	field.value = color;
+	var button = doc.createElement("span");
+	button.className = "buttonColor";
+	df.appendChild(button);
+	var span = doc.createElement("span");
+	span.className = "chooser";
+	// span.innerHTML = "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
+	span.style.backgroundColor = color;
+	button.appendChild(span);
+	button.onmouseover = function() { if (!this.disabled) { this.className += " buttonColor-hilite"; }};
+	button.onmouseout = function() { if (!this.disabled) { this.className = "buttonColor"; }};
+	span.onclick = function() {
+		if (this.parentNode.disabled) {
+			return false;
+		}
+		editor._popupDialog("select_color.html", function(color) {
+			if (color) {
+				span.style.backgroundColor = "#" + color;
+				field.value = "#" + color;
+			}
+		}, color);
+	};
+	var span2 = doc.createElement("span");
+	span2.innerHTML = "&#x00d7;";
+	span2.className = "nocolor";
+	span2.title = TableOperations.I18N["Unset color"];
+	button.appendChild(span2);
+	span2.onmouseover = function() { if (!this.parentNode.disabled) { this.className += " nocolor-hilite"; }};
+	span2.onmouseout = function() { if (!this.parentNode.disabled) { this.className = "nocolor"; }};
+	span2.onclick = function() {
+		span.style.backgroundColor = "";
+		field.value = "";
+	};
+	return df;
+};
+
+TableOperations.createStyleLayoutFieldset = function(doc, editor, el) {
+	var i18n = TableOperations.I18N;
+	var fieldset = doc.createElement("fieldset");
+	var legend = doc.createElement("legend");
+	fieldset.appendChild(legend);
+	legend.innerHTML = i18n["Layout"];
+	var table = doc.createElement("table");
+	fieldset.appendChild(table);
+	table.style.width = "100%";
+	var tbody = doc.createElement("tbody");
+	table.appendChild(tbody);
+
+	var tagname = el.tagName.toLowerCase();
+	var tr, td, input, select, option, options, i;
+
+	if (tagname != "td" && tagname != "tr" && tagname != "th") {
+		tr = doc.createElement("tr");
+		tbody.appendChild(tr);
+		td = doc.createElement("td");
+		td.className = "label";
+		tr.appendChild(td);
+		td.innerHTML = i18n["Float"] + ":";
+		td = doc.createElement("td");
+		tr.appendChild(td);
+		select = doc.createElement("select");
+		td.appendChild(select);
+		select.name = "f_st_float";
+		options = ["None", "Left", "Right"];
+		for (i in options) {
+			var Val = options[i];
+			var val = options[i].toLowerCase();
+			option = doc.createElement("option");
+			option.innerHTML = i18n[Val];
+			option.value = val;
+			option.selected = (("" + el.style.cssFloat).toLowerCase() == val);
+			select.appendChild(option);
+		}
+	}
+
+	tr = doc.createElement("tr");
+	tbody.appendChild(tr);
+	td = doc.createElement("td");
+	td.className = "label";
+	tr.appendChild(td);
+	td.innerHTML = i18n["Width"] + ":";
+	td = doc.createElement("td");
+	tr.appendChild(td);
+	input = doc.createElement("input");
+	input.type = "text";
+	input.value = TableOperations.getLength(el.style.width);
+	input.size = "5";
+	input.name = "f_st_width";
+	input.style.marginRight = "0.5em";
+	td.appendChild(input);
+	select = doc.createElement("select");
+	select.name = "f_st_widthUnit";
+	option = doc.createElement("option");
+	option.innerHTML = i18n["percent"];
+	option.value = "%";
+	option.selected = /%/.test(el.style.width);
+	select.appendChild(option);
+	option = doc.createElement("option");
+	option.innerHTML = i18n["pixels"];
+	option.value = "px";
+	option.selected = /px/.test(el.style.width);
+	select.appendChild(option);
+	td.appendChild(select);
+
+	select.style.marginRight = "0.5em";
+	td.appendChild(doc.createTextNode(i18n["Text align"] + ":"));
+	select = doc.createElement("select");
+	select.style.marginLeft = select.style.marginRight = "0.5em";
+	td.appendChild(select);
+	select.name = "f_st_textAlign";
+	options = ["Left", "Center", "Right", "Justify"];
+	if (tagname == "td") {
+		options.push("Char");
+	}
+	input = doc.createElement("input");
+	input.name = "f_st_textAlignChar";
+	input.size = "1";
+	input.style.fontFamily = "monospace";
+	td.appendChild(input);
+	for (i in options) {
+		var Val = options[i];
+		var val = Val.toLowerCase();
+		option = doc.createElement("option");
+		option.value = val;
+		option.innerHTML = i18n[Val];
+		option.selected = (el.style.textAlign.toLowerCase() == val);
+		select.appendChild(option);
+	}
+	function setCharVisibility(value) {
+		input.style.visibility = value ? "visible" : "hidden";
+		if (value) {
+			input.focus();
+			input.select();
+		}
+	};
+	select.onchange = function() { setCharVisibility(this.value == "char"); };
+	setCharVisibility(select.value == "char");
+
+	tr = doc.createElement("tr");
+	tbody.appendChild(tr);
+	td = doc.createElement("td");
+	td.className = "label";
+	tr.appendChild(td);
+	td.innerHTML = i18n["Height"] + ":";
+	td = doc.createElement("td");
+	tr.appendChild(td);
+	input = doc.createElement("input");
+	input.type = "text";
+	input.value = TableOperations.getLength(el.style.height);
+	input.size = "5";
+	input.name = "f_st_height";
+	input.style.marginRight = "0.5em";
+	td.appendChild(input);
+	select = doc.createElement("select");
+	select.name = "f_st_heightUnit";
+	option = doc.createElement("option");
+	option.innerHTML = i18n["percent"];
+	option.value = "%";
+	option.selected = /%/.test(el.style.height);
+	select.appendChild(option);
+	option = doc.createElement("option");
+	option.innerHTML = i18n["pixels"];
+	option.value = "px";
+	option.selected = /px/.test(el.style.height);
+	select.appendChild(option);
+	td.appendChild(select);
+
+	select.style.marginRight = "0.5em";
+	td.appendChild(doc.createTextNode(i18n["Vertical align"] + ":"));
+	select = doc.createElement("select");
+	select.name = "f_st_verticalAlign";
+	select.style.marginLeft = "0.5em";
+	td.appendChild(select);
+	options = ["Top", "Middle", "Bottom", "Baseline"];
+	for (i in options) {
+		var Val = options[i];
+		var val = Val.toLowerCase();
+		option = doc.createElement("option");
+		option.value = val;
+		option.innerHTML = i18n[Val];
+		option.selected = (el.style.verticalAlign.toLowerCase() == val);
+		select.appendChild(option);
+	}
+
+	return fieldset;
+};
+
+// Returns an HTML element containing the style attributes for the given
+// element.  This can be easily embedded into any dialog; the functionality is
+// also provided.
+TableOperations.createStyleFieldset = function(doc, editor, el) {
+	var i18n = TableOperations.I18N;
+	var fieldset = doc.createElement("fieldset");
+	var legend = doc.createElement("legend");
+	fieldset.appendChild(legend);
+	legend.innerHTML = i18n["CSS Style"];
+	var table = doc.createElement("table");
+	fieldset.appendChild(table);
+	table.style.width = "100%";
+	var tbody = doc.createElement("tbody");
+	table.appendChild(tbody);
+
+	var tr, td, input, select, option, options, i;
+
+	tr = doc.createElement("tr");
+	tbody.appendChild(tr);
+	td = doc.createElement("td");
+	tr.appendChild(td);
+	td.className = "label";
+	td.innerHTML = i18n["Background"] + ":";
+	td = doc.createElement("td");
+	tr.appendChild(td);
+	var df = TableOperations.createColorButton(doc, editor, el.style.backgroundColor, "backgroundColor");
+	df.firstChild.nextSibling.style.marginRight = "0.5em";
+	td.appendChild(df);
+	td.appendChild(doc.createTextNode(i18n["Image URL"] + ": "));
+	input = doc.createElement("input");
+	input.type = "text";
+	input.name = "f_st_backgroundImage";
+	if (el.style.backgroundImage.match(/url\(\s*(.*?)\s*\)/)) {
+		input.value = RegExp.$1;
+	}
+	// input.style.width = "100%";
+	td.appendChild(input);
+
+	tr = doc.createElement("tr");
+	tbody.appendChild(tr);
+	td = doc.createElement("td");
+	tr.appendChild(td);
+	td.className = "label";
+	td.innerHTML = i18n["FG Color"] + ":";
+	td = doc.createElement("td");
+	tr.appendChild(td);
+	td.appendChild(TableOperations.createColorButton(doc, editor, el.style.color, "color"));
+
+	// for better alignment we include an invisible field.
+	input = doc.createElement("input");
+	input.style.visibility = "hidden";
+	input.type = "text";
+	td.appendChild(input);
+
+	tr = doc.createElement("tr");
+	tbody.appendChild(tr);
+	td = doc.createElement("td");
+	tr.appendChild(td);
+	td.className = "label";
+	td.innerHTML = i18n["Border"] + ":";
+	td = doc.createElement("td");
+	tr.appendChild(td);
+
+	var colorButton = TableOperations.createColorButton(doc, editor, el.style.borderColor, "borderColor");
+	var btn = colorButton.firstChild.nextSibling;
+	td.appendChild(colorButton);
+	// borderFields.push(btn);
+	btn.style.marginRight = "0.5em";
+
+	select = doc.createElement("select");
+	var borderFields = [];
+	td.appendChild(select);
+	select.name = "f_st_borderStyle";
+	options = ["none", "dotted", "dashed", "solid", "double", "groove", "ridge", "inset", "outset"];
+	var currentBorderStyle = el.style.borderStyle;
+	// Gecko reports "solid solid solid solid" for "border-style: solid".
+	// That is, "top right bottom left" -- we only consider the first
+	// value.
+	(currentBorderStyle.match(/([^\s]*)\s/)) && (currentBorderStyle = RegExp.$1);
+	for (i in options) {
+		var val = options[i];
+		option = doc.createElement("option");
+		option.value = val;
+		option.innerHTML = val;
+		(val == currentBorderStyle) && (option.selected = true);
+		select.appendChild(option);
+	}
+	select.style.marginRight = "0.5em";
+	function setBorderFieldsStatus(value) {
+		for (i in borderFields) {
+			var el = borderFields[i];
+			el.style.visibility = value ? "hidden" : "visible";
+			if (!value && (el.tagName.toLowerCase() == "input")) {
+				el.focus();
+				el.select();
+			}
+		}
+	};
+	select.onchange = function() { setBorderFieldsStatus(this.value == "none"); };
+
+	input = doc.createElement("input");
+	borderFields.push(input);
+	input.type = "text";
+	input.name = "f_st_borderWidth";
+	input.value = TableOperations.getLength(el.style.borderWidth);
+	input.size = "5";
+	td.appendChild(input);
+	input.style.marginRight = "0.5em";
+	var span = doc.createElement("span");
+	span.innerHTML = i18n["pixels"];
+	td.appendChild(span);
+	borderFields.push(span);
+
+	setBorderFieldsStatus(select.value == "none");
+
+	if (el.tagName.toLowerCase() == "table") {
+		// the border-collapse style is only for tables
+		tr = doc.createElement("tr");
+		tbody.appendChild(tr);
+		td = doc.createElement("td");
+		td.className = "label";
+		tr.appendChild(td);
+		input = doc.createElement("input");
+		input.type = "checkbox";
+		input.name = "f_st_borderCollapse";
+		input.id = "f_st_borderCollapse";
+		var val = (/collapse/i.test(el.style.borderCollapse));
+		input.checked = val ? 1 : 0;
+		td.appendChild(input);
+
+		td = doc.createElement("td");
+		tr.appendChild(td);
+		var label = doc.createElement("label");
+		label.htmlFor = "f_st_borderCollapse";
+		label.innerHTML = i18n["Collapsed borders"];
+		td.appendChild(label);
+	}
+
+// 	tr = doc.createElement("tr");
+// 	tbody.appendChild(tr);
+// 	td = doc.createElement("td");
+// 	td.className = "label";
+// 	tr.appendChild(td);
+// 	td.innerHTML = i18n["Margin"] + ":";
+// 	td = doc.createElement("td");
+// 	tr.appendChild(td);
+// 	input = doc.createElement("input");
+// 	input.type = "text";
+// 	input.size = "5";
+// 	input.name = "f_st_margin";
+// 	td.appendChild(input);
+// 	input.style.marginRight = "0.5em";
+// 	td.appendChild(doc.createTextNode(i18n["Padding"] + ":"));
+
+// 	input = doc.createElement("input");
+// 	input.type = "text";
+// 	input.size = "5";
+// 	input.name = "f_st_padding";
+// 	td.appendChild(input);
+// 	input.style.marginLeft = "0.5em";
+// 	input.style.marginRight = "0.5em";
+// 	td.appendChild(doc.createTextNode(i18n["pixels"]));
+
+	return fieldset;
+};
+
+//// END GENERIC CODE -------------------------------------------------------
Index: temp/trunk/html/test/naka/HTMLArea/plugins/FullPage/popups/docprop.html
===================================================================
--- temp/trunk/html/test/naka/HTMLArea/plugins/FullPage/popups/docprop.html	(revision 1694)
+++ temp/trunk/html/test/naka/HTMLArea/plugins/FullPage/popups/docprop.html	(revision 1694)
@@ -0,0 +1,131 @@
+<html>
+
+<head>
+  <title>Document properties</title>
+
+<script type="text/javascript" src="../../../popups/popup.js"></script>
+
+<script type="text/javascript">
+
+FullPage = window.opener.FullPage; // load the FullPage plugin and lang file ;-)
+window.resizeTo(400, 100);
+
+  var accepted = {
+      f_doctype       : true,
+      f_title         : true,
+      f_body_bgcolor  : true,
+      f_body_fgcolor  : true,
+      f_base_style    : true,
+      f_alt_style     : true
+  };
+
+var editor = null;
+function Init() {
+  __dlg_translate(FullPage.I18N);
+  __dlg_init();
+  var params = window.dialogArguments;
+  for (var i in params) {
+      if (i in accepted) {
+        var el = document.getElementById(i);
+        el.value = params[i];
+      }
+  }
+  editor = params.editor;
+  document.getElementById("f_title").focus();
+  document.getElementById("f_title").select();
+};
+
+function onOK() {
+  var required = {
+  };
+  for (var i in required) {
+    var el = document.getElementById(i);
+    if (!el.value) {
+      alert(required[i]);
+      el.focus();
+      return false;
+    }
+  }
+
+  var param = {};
+  for (var i in accepted) {
+    var el = document.getElementById(i);
+    param[i] = el.value;
+  }
+  __dlg_close(param);
+  return false;
+};
+
+function onCancel() {
+  __dlg_close(null);
+  return false;
+};
+
+</script>
+
+<style type="text/css">
+html, body {
+  background: ButtonFace;
+  color: ButtonText;
+  font: 11px Tahoma,Verdana,sans-serif;
+  margin: 0px;
+  padding: 0px;
+}
+body { padding: 5px; }
+table {
+  font: 11px Tahoma,Verdana,sans-serif;
+}
+select, input, button { font: 11px Tahoma,Verdana,sans-serif; }
+button { width: 70px; }
+table .label { text-align: right; width: 12em; }
+
+.title { background: #ddf; color: #000; font-weight: bold; font-size: 120%; padding: 3px 10px; margin-bottom: 10px;
+border-bottom: 1px solid black; letter-spacing: 2px;
+}
+
+#buttons {
+      margin-top: 1em; border-top: 1px solid #999;
+      padding: 2px; text-align: right;
+}
+</style>
+
+  </head>
+
+  <body onload="Init()">
+
+    <div class="title"><span>Document properties</span></div>
+
+    <table style="width: 100%">
+      <tr>
+        <td class="label"><span>Document title:</span></td>
+        <td><input type="text" id="f_title" style="width: 100%" /></td>
+      </tr>
+      <tr>
+        <td class="label"><span>DOCTYPE:</span></td>
+        <td><input type="text" id="f_doctype" style="width: 100%" /></td>
+      </tr>
+      <tr>
+        <td class="label"><span>Primary style-sheet:</span></td>
+        <td><input type="text" id="f_base_style" style="width: 100%" /></td>
+      </tr>
+      <tr>
+        <td class="label"><span>Alternate style-sheet:</span></td>
+        <td><input type="text" id="f_alt_style" style="width: 100%" /></td>
+      </tr>
+      <tr>
+        <td class="label"><span>Background color:</span></td>
+        <td><input type="text" id="f_body_bgcolor" size="7" /></td>
+      </tr>
+      <tr>
+        <td class="label"><span>Text color:</span></td>
+        <td><input type="text" id="f_body_fgcolor" size="7" /></td>
+      </tr>
+    </table>
+
+    <div id="buttons">
+      <button type="button" name="ok" onclick="return onOK();"><span>OK</span></button>
+      <button type="button" name="cancel" onclick="return onCancel();"><span>Cancel</span></button>
+    </div>
+
+  </body>
+</html>
Index: temp/trunk/html/test/naka/HTMLArea/plugins/FullPage/full-page.js
===================================================================
--- temp/trunk/html/test/naka/HTMLArea/plugins/FullPage/full-page.js	(revision 1694)
+++ temp/trunk/html/test/naka/HTMLArea/plugins/FullPage/full-page.js	(revision 1694)
@@ -0,0 +1,143 @@
+// FullPage Plugin for HTMLArea-3.0
+// Implementation by Mihai Bazon.  Sponsored by http://thycotic.com
+//
+// htmlArea v3.0 - Copyright (c) 2002 interactivetools.com, inc.
+// This notice MUST stay intact for use (see license.txt).
+//
+// A free WYSIWYG editor replacement for <textarea> fields.
+// For full source code and docs, visit http://www.interactivetools.com/
+//
+// Version 3.0 developed by Mihai Bazon for InteractiveTools.
+//   http://dynarch.com/mishoo
+//
+// $Id$
+
+function FullPage(editor) {
+	this.editor = editor;
+
+	var cfg = editor.config;
+	cfg.fullPage = true;
+	var tt = FullPage.I18N;
+	var self = this;
+
+	cfg.registerButton("FP-docprop", tt["Document properties"], editor.imgURL("docprop.gif", "FullPage"), false,
+			   function(editor, id) {
+				   self.buttonPress(editor, id);
+			   });
+
+	// add a new line in the toolbar
+	cfg.toolbar[0].splice(0, 0, "separator");
+	cfg.toolbar[0].splice(0, 0, "FP-docprop");
+};
+
+FullPage._pluginInfo = {
+	name          : "FullPage",
+	version       : "1.0",
+	developer     : "Mihai Bazon",
+	developer_url : "http://dynarch.com/mishoo/",
+	c_owner       : "Mihai Bazon",
+	sponsor       : "Thycotic Software Ltd.",
+	sponsor_url   : "http://thycotic.com",
+	license       : "htmlArea"
+};
+
+FullPage.prototype.buttonPress = function(editor, id) {
+	var self = this;
+	switch (id) {
+	    case "FP-docprop":
+		var doc = editor._doc;
+		var links = doc.getElementsByTagName("link");
+		var style1 = '';
+		var style2 = '';
+		for (var i = links.length; --i >= 0;) {
+			var link = links[i];
+			if (/stylesheet/i.test(link.rel)) {
+				if (/alternate/i.test(link.rel))
+					style2 = link.href;
+				else
+					style1 = link.href;
+			}
+		}
+		var title = doc.getElementsByTagName("title")[0];
+		title = title ? title.innerHTML : '';
+		var init = {
+			f_doctype      : editor.doctype,
+			f_title        : title,
+			f_body_bgcolor : HTMLArea._colorToRgb(doc.body.style.backgroundColor),
+			f_body_fgcolor : HTMLArea._colorToRgb(doc.body.style.color),
+			f_base_style   : style1,
+			f_alt_style    : style2,
+
+			editor         : editor
+		};
+		editor._popupDialog("plugin://FullPage/docprop", function(params) {
+			self.setDocProp(params);
+		}, init);
+		break;
+	}
+};
+
+FullPage.prototype.setDocProp = function(params) {
+	var txt = "";
+	var doc = this.editor._doc;
+	var head = doc.getElementsByTagName("head")[0];
+	var links = doc.getElementsByTagName("link");
+	var style1 = null;
+	var style2 = null;
+	for (var i = links.length; --i >= 0;) {
+		var link = links[i];
+		if (/stylesheet/i.test(link.rel)) {
+			if (/alternate/i.test(link.rel))
+				style2 = link;
+			else
+				style1 = link;
+		}
+	}
+	function createLink(alt) {
+		var link = doc.createElement("link");
+		link.rel = alt ? "alternate stylesheet" : "stylesheet";
+		head.appendChild(link);
+		return link;
+	};
+
+	if (!style1 && params.f_base_style)
+		style1 = createLink(false);
+	if (params.f_base_style)
+		style1.href = params.f_base_style;
+	else if (style1)
+		head.removeChild(style1);
+
+	if (!style2 && params.f_alt_style)
+		style2 = createLink(true);
+	if (params.f_alt_style)
+		style2.href = params.f_alt_style;
+	else if (style2)
+		head.removeChild(style2);
+
+	for (var i in params) {
+		var val = params[i];
+		switch (i) {
+		    case "f_title":
+			var title = doc.getElementsByTagName("title")[0];
+			if (!title) {
+				title = doc.createElement("title");
+				head.appendChild(title);
+			} else while (node = title.lastChild)
+				title.removeChild(node);
+			if (!HTMLArea.is_ie)
+				title.appendChild(doc.createTextNode(val));
+			else
+				doc.title = val;
+			break;
+		    case "f_doctype":
+			this.editor.setDoctype(val);
+			break;
+		    case "f_body_bgcolor":
+			doc.body.style.backgroundColor = val;
+			break;
+		    case "f_body_fgcolor":
+			doc.body.style.color = val;
+			break;
+		}
+	}
+};
Index: temp/trunk/html/test/naka/HTMLArea/plugins/FullPage/lang/ro.js
===================================================================
--- temp/trunk/html/test/naka/HTMLArea/plugins/FullPage/lang/ro.js	(revision 1694)
+++ temp/trunk/html/test/naka/HTMLArea/plugins/FullPage/lang/ro.js	(revision 1694)
@@ -0,0 +1,25 @@
+// I18N for the FullPage plugin
+
+// LANG: "en", ENCODING: UTF-8 | ISO-8859-1
+// Author: Mihai Bazon, http://dynarch.com/mishoo
+
+// FOR TRANSLATORS:
+//
+//   1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE
+//      (at least a valid email address)
+//
+//   2. PLEASE TRY TO USE UTF-8 FOR ENCODING;
+//      (if this is not possible, please include a comment
+//       that states what encoding is necessary.)
+
+FullPage.I18N = {
+	"Alternate style-sheet:":		"Template CSS alternativ:",
+	"Background color:":			"Culoare de fundal:",
+	"Cancel":				"Renunţă",
+	"DOCTYPE:":				"DOCTYPE:",
+	"Document properties":			"Proprietăţile documentului",
+	"Document title:":			"Titlul documentului:",
+	"OK":					"Acceptă",
+	"Primary style-sheet:":			"Template CSS principal:",
+	"Text color:":				"Culoare text:"
+};
Index: temp/trunk/html/test/naka/HTMLArea/plugins/FullPage/lang/en.js
===================================================================
--- temp/trunk/html/test/naka/HTMLArea/plugins/FullPage/lang/en.js	(revision 1694)
+++ temp/trunk/html/test/naka/HTMLArea/plugins/FullPage/lang/en.js	(revision 1694)
@@ -0,0 +1,25 @@
+// I18N for the FullPage plugin
+
+// LANG: "en", ENCODING: UTF-8 | ISO-8859-1
+// Author: Mihai Bazon, http://dynarch.com/mishoo
+
+// FOR TRANSLATORS:
+//
+//   1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE
+//      (at least a valid email address)
+//
+//   2. PLEASE TRY TO USE UTF-8 FOR ENCODING;
+//      (if this is not possible, please include a comment
+//       that states what encoding is necessary.)
+
+FullPage.I18N = {
+	"Alternate style-sheet:":		"Alternate style-sheet:",
+	"Background color:":			"Background color:",
+	"Cancel":				"Cancel",
+	"DOCTYPE:":				"DOCTYPE:",
+	"Document properties":			"Document properties",
+	"Document title:":			"Document title:",
+	"OK":					"OK",
+	"Primary style-sheet:":			"Primary style-sheet:",
+	"Text color:":				"Text color:"
+};
Index: temp/trunk/html/test/naka/HTMLArea/plugins/FullPage/test.html
===================================================================
--- temp/trunk/html/test/naka/HTMLArea/plugins/FullPage/test.html	(revision 1694)
+++ temp/trunk/html/test/naka/HTMLArea/plugins/FullPage/test.html	(revision 1694)
@@ -0,0 +1,89 @@
+<html>
+  <head>
+    <title>Test of FullPage plugin</title>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+    <script type="text/javascript">
+      _editor_url = "../../";
+    </script>
+
+    <!-- load the main HTMLArea files -->
+    <script type="text/javascript" src="../../htmlarea.js"></script>
+    <script type="text/javascript" src="../../lang/en.js"></script>
+    <script type="text/javascript" src="../../dialog.js"></script>
+
+    <!-- <script type="text/javascript" src="popupdiv.js"></script> -->
+    <script type="text/javascript" src="../../popupwin.js"></script>
+
+    <script type="text/javascript">
+      HTMLArea.loadPlugin("TableOperations");
+      HTMLArea.loadPlugin("SpellChecker");
+      HTMLArea.loadPlugin("FullPage");
+
+      function initDocument() {
+        var editor = new HTMLArea("editor");
+        editor.registerPlugin(TableOperations);
+        editor.registerPlugin(SpellChecker);
+        editor.registerPlugin(FullPage);
+        editor.generate();
+      }
+    </script>
+
+    <style type="text/css">
+      @import url(../../htmlarea.css);
+    </style>
+
+  </head>
+
+  <body onload="initDocument()">
+    <h1>Test of FullPage plugin</h1>
+
+    <textarea id="editor" style="height: 30em; width: 100%;">
+      &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"&gt;
+      &lt;html&gt;
+        &lt;head&gt;
+          &lt;title&gt;FullPage plugin for HTMLArea&lt;/title&gt;
+          &lt;link rel="alternate stylesheet" href="http://dynarch.com/mishoo/css/dark.css" /&gt;
+          &lt;link rel="stylesheet" href="http://dynarch.com/mishoo/css/cool-light.css" /&gt;
+        &lt;/head&gt;
+        &lt;body style="background-color: #ddddee; color: #000077;"&gt;
+          &lt;table style="width:60%; height: 90%; margin: 2% auto 1% auto;" align="center" border="0" cellpadding="0" cellspacing="0"&gt;
+            &lt;tr&gt;
+              &lt;td style="background-color: #ddeedd; border: 2px solid #002; height: 1.5em; padding: 2px; font: bold 24px Verdana;"&gt;
+                FullPage plugin
+              &lt;/td&gt;
+            &lt;/tr&gt;
+            &lt;tr&gt;
+              &lt;td style="background-color: #fff; border: 1px solid #aab; padding: 1em 3em; font: 12px Verdana;"&gt;
+                &lt;p&gt;
+                  This plugin enables one to edit a full HTML file in &lt;a
+                    href="http://dynarch.com/htmlarea/"&gt;HTMLArea&lt;/a&gt;.  This is not
+                  normally possible with just the core editor since it only
+                  retrieves the HTML inside the &lt;code&gt;body&lt;/code&gt; tag.
+                &lt;/p&gt;
+                &lt;p&gt;
+                  It provides the ability to change the &lt;code&gt;DOCTYPE&lt;/code&gt; of
+                  the document, &lt;code&gt;body&lt;/code&gt; &lt;code&gt;bgcolor&lt;/code&gt; and
+                  &lt;code&gt;fgcolor&lt;/code&gt; attributes as well as to add additional
+                  &lt;code&gt;link&lt;/code&gt;-ed stylesheets.  Cool, eh?
+                &lt;/p&gt;
+                &lt;p&gt;
+                  The development of this plugin was initiated and sponsored by
+                  &lt;a href="http://thycotic.com"&gt;Thycotic Software Ltd.&lt;/a&gt;.
+                  That's also cool, isn't it? ;-)
+                &lt;/p&gt;
+              &lt;/td&gt;
+            &lt;/tr&gt;
+          &lt;/table&gt;
+        &lt;/body&gt;
+      &lt;/html&gt;
+    </textarea>
+
+    <hr />
+    <address><a href="http://dynarch.com/mishoo/">Mihai Bazon</a></address>
+<!-- Created: Wed Oct  1 19:55:37 EEST 2003 -->
+<!-- hhmts start -->
+Last modified on Sat Oct 25 01:06:59 2003
+<!-- hhmts end -->
+<!-- doc-lang: English -->
+  </body>
+</html>
Index: temp/trunk/html/test/naka/HTMLArea/plugins/SpellChecker/spell-checker.js
===================================================================
--- temp/trunk/html/test/naka/HTMLArea/plugins/SpellChecker/spell-checker.js	(revision 1694)
+++ temp/trunk/html/test/naka/HTMLArea/plugins/SpellChecker/spell-checker.js	(revision 1694)
@@ -0,0 +1,79 @@
+// Spell Checker Plugin for HTMLArea-3.0
+// Sponsored by www.americanbible.org
+// Implementation by Mihai Bazon, http://dynarch.com/mishoo/
+//
+// (c) dynarch.com 2003.
+// Distributed under the same terms as HTMLArea itself.
+// This notice MUST stay intact for use (see license.txt).
+//
+// $Id$
+
+function SpellChecker(editor) {
+	this.editor = editor;
+
+	var cfg = editor.config;
+	var tt = SpellChecker.I18N;
+	var bl = SpellChecker.btnList;
+	var self = this;
+
+	// register the toolbar buttons provided by this plugin
+	var toolbar = [];
+	for (var i in bl) {
+		var btn = bl[i];
+		if (!btn) {
+			toolbar.push("separator");
+		} else {
+			var id = "SC-" + btn[0];
+			cfg.registerButton(id, tt[id], editor.imgURL(btn[0] + ".gif", "SpellChecker"), false,
+					   function(editor, id) {
+						   // dispatch button press event
+						   self.buttonPress(editor, id);
+					   }, btn[1]);
+			toolbar.push(id);
+		}
+	}
+
+	for (var i in toolbar) {
+		cfg.toolbar[0].push(toolbar[i]);
+	}
+};
+
+SpellChecker._pluginInfo = {
+	name          : "SpellChecker",
+	version       : "1.0",
+	developer     : "Mihai Bazon",
+	developer_url : "http://dynarch.com/mishoo/",
+	c_owner       : "Mihai Bazon",
+	sponsor       : "American Bible Society",
+	sponsor_url   : "http://www.americanbible.org",
+	license       : "htmlArea"
+};
+
+SpellChecker.btnList = [
+	null, // separator
+	["spell-check"]
+	];
+
+SpellChecker.prototype.buttonPress = function(editor, id) {
+	switch (id) {
+	    case "SC-spell-check":
+		SpellChecker.editor = editor;
+		SpellChecker.init = true;
+		var uiurl = _editor_url + "plugins/SpellChecker/spell-check-ui.html";
+		var win;
+		if (HTMLArea.is_ie) {
+			win = window.open(uiurl, "SC_spell_checker",
+					  "toolbar=no,location=no,directories=no,status=no,menubar=no," +
+					  "scrollbars=no,resizable=yes,width=600,height=450");
+		} else {
+			win = window.open(uiurl, "SC_spell_checker",
+					  "toolbar=no,menubar=no,personalbar=no,width=600,height=450," +
+					  "scrollbars=no,resizable=yes");
+		}
+		win.focus();
+		break;
+	}
+};
+
+// this needs to be global, it's accessed from spell-check-ui.html
+SpellChecker.editor = null;
Index: temp/trunk/html/test/naka/HTMLArea/plugins/SpellChecker/spell-check-ui.js
===================================================================
--- temp/trunk/html/test/naka/HTMLArea/plugins/SpellChecker/spell-check-ui.js	(revision 1694)
+++ temp/trunk/html/test/naka/HTMLArea/plugins/SpellChecker/spell-check-ui.js	(revision 1694)
@@ -0,0 +1,397 @@
+// Spell Checker Plugin for HTMLArea-3.0
+// Sponsored by www.americanbible.org
+// Implementation by Mihai Bazon, http://dynarch.com/mishoo/
+//
+// (c) dynarch.com 2003.
+// Distributed under the same terms as HTMLArea itself.
+// This notice MUST stay intact for use (see license.txt).
+//
+// $Id$
+
+// internationalization file was already loaded in parent ;-)
+var SpellChecker = window.opener.SpellChecker;
+var i18n = SpellChecker.I18N;
+
+var HTMLArea = window.opener.HTMLArea;
+var is_ie = HTMLArea.is_ie;
+var editor = SpellChecker.editor;
+var frame = null;
+var currentElement = null;
+var wrongWords = null;
+var modified = false;
+var allWords = {};
+var fixedWords = [];
+var suggested_words = {};
+
+function makeCleanDoc(leaveFixed) {
+	// document.getElementById("status").innerHTML = 'Please wait: rendering valid HTML';
+	var words = wrongWords.concat(fixedWords);
+	for (var i = words.length; --i >= 0;) {
+		var el = words[i];
+		if (!(leaveFixed && /HA-spellcheck-fixed/.test(el.className))) {
+			el.parentNode.insertBefore(el.firstChild, el);
+			el.parentNode.removeChild(el);
+		} else
+			el.className = "HA-spellcheck-fixed";
+	}
+	// we should use innerHTML here, but IE6's implementation fucks up the
+	// HTML to such extent that our poor Perl parser doesn't understand it
+	// anymore.
+	return window.opener.HTMLArea.getHTML(frame.contentWindow.document.body, false, editor);
+};
+
+function recheckClicked() {
+	document.getElementById("status").innerHTML = i18n["Please wait: changing dictionary to"] + ': "' + document.getElementById("f_dictionary").value + '".';
+	var field = document.getElementById("f_content");
+	field.value = makeCleanDoc(true);
+	field.form.submit();
+};
+
+function saveClicked() {
+	if (modified) {
+		editor.setHTML(makeCleanDoc(false));
+	}
+	window.close();
+	return false;
+};
+
+function cancelClicked() {
+	var ok = true;
+	if (modified) {
+		ok = confirm(i18n["QUIT_CONFIRMATION"]);
+	}
+	if (ok) {
+		window.close();
+	}
+	return false;
+};
+
+function replaceWord(el) {
+	var replacement = document.getElementById("v_replacement").value;
+	var this_word_modified = (el.innerHTML != replacement);
+	if (this_word_modified)
+		modified = true;
+	if (el) {
+		el.className = el.className.replace(/\s*HA-spellcheck-(hover|fixed)\s*/g, " ");
+	}
+	el.className += " HA-spellcheck-fixed";
+	el.__msh_fixed = true;
+	if (!this_word_modified) {
+		return false;
+	}
+	el.innerHTML = replacement;
+};
+
+function replaceClicked() {
+	replaceWord(currentElement);
+	var start = currentElement.__msh_id;
+	var index = start;
+	do {
+		++index;
+		if (index == wrongWords.length) {
+			index = 0;
+		}
+	} while ((index != start) && wrongWords[index].__msh_fixed);
+	if (index == start) {
+		index = 0;
+		alert(i18n["Finished list of mispelled words"]);
+	}
+	wrongWords[index].__msh_wordClicked(true);
+	return false;
+};
+
+function revertClicked() {
+	document.getElementById("v_replacement").value = currentElement.__msh_origWord;
+	replaceWord(currentElement);
+	currentElement.className = "HA-spellcheck-error HA-spellcheck-current";
+	return false;
+};
+
+function replaceAllClicked() {
+	var replacement = document.getElementById("v_replacement").value;
+	var ok = true;
+	var spans = allWords[currentElement.__msh_origWord];
+	if (spans.length == 0) {
+		alert("An impossible condition just happened.  Call FBI.  ;-)");
+	} else if (spans.length == 1) {
+		replaceClicked();
+		return false;
+	}
+	/*
+	var message = "The word \"" + currentElement.__msh_origWord + "\" occurs " + spans.length + " times.\n";
+	if (replacement == currentElement.__msh_origWord) {
+		ok = confirm(message + "Ignore all occurrences?");
+	} else {
+		ok = confirm(message + "Replace all occurrences with \"" + replacement + "\"?");
+	}
+	*/
+	if (ok) {
+		for (var i in spans) {
+			if (spans[i] != currentElement) {
+				replaceWord(spans[i]);
+			}
+		}
+		// replace current element the last, so that we jump to the next word ;-)
+		replaceClicked();
+	}
+	return false;
+};
+
+function ignoreClicked() {
+	document.getElementById("v_replacement").value = currentElement.__msh_origWord;
+	replaceClicked();
+	return false;
+};
+
+function ignoreAllClicked() {
+	document.getElementById("v_replacement").value = currentElement.__msh_origWord;
+	replaceAllClicked();
+	return false;
+};
+
+function learnClicked() {
+	alert("Not [yet] implemented");
+	return false;
+};
+
+function internationalizeWindow() {
+	var types = ["div", "span", "button"];
+	for (var i in types) {
+		var tag = types[i];
+		var els = document.getElementsByTagName(tag);
+		for (var j = els.length; --j >= 0;) {
+			var el = els[j];
+			if (el.childNodes.length == 1 && /\S/.test(el.innerHTML)) {
+				var txt = el.innerHTML;
+				if (typeof i18n[txt] != "undefined") {
+					el.innerHTML = i18n[txt];
+				}
+			}
+		}
+	}
+};
+
+function initDocument() {
+	internationalizeWindow();
+	modified = false;
+	frame = document.getElementById("i_framecontent");
+	var field = document.getElementById("f_content");
+	field.value = HTMLArea.getHTML(editor._doc.body, false, editor);
+	field.form.submit();
+	document.getElementById("f_init").value = "0";
+
+	// assign some global event handlers
+
+	var select = document.getElementById("v_suggestions");
+	select.onchange = function() {
+		document.getElementById("v_replacement").value = this.value;
+	};
+	if (is_ie) {
+		select.attachEvent("ondblclick", replaceClicked);
+	} else {
+		select.addEventListener("dblclick", replaceClicked, true);
+	}
+
+	document.getElementById("b_replace").onclick = replaceClicked;
+	// document.getElementById("b_learn").onclick = learnClicked;
+	document.getElementById("b_replall").onclick = replaceAllClicked;
+	document.getElementById("b_ignore").onclick = ignoreClicked;
+	document.getElementById("b_ignall").onclick = ignoreAllClicked;
+	document.getElementById("b_recheck").onclick = recheckClicked;
+	document.getElementById("b_revert").onclick = revertClicked;
+	document.getElementById("b_info").onclick = displayInfo;
+
+	document.getElementById("b_ok").onclick = saveClicked;
+	document.getElementById("b_cancel").onclick = cancelClicked;
+
+	select = document.getElementById("v_dictionaries");
+	select.onchange = function() {
+		document.getElementById("f_dictionary").value = this.value;
+	};
+};
+
+function getAbsolutePos(el) {
+	var r = { x: el.offsetLeft, y: el.offsetTop };
+	if (el.offsetParent) {
+		var tmp = getAbsolutePos(el.offsetParent);
+		r.x += tmp.x;
+		r.y += tmp.y;
+	}
+	return r;
+};
+
+function wordClicked(scroll) {
+	var self = this;
+	if (scroll) (function() {
+		var pos = getAbsolutePos(self);
+		var ws = { x: frame.offsetWidth - 4,
+			   y: frame.offsetHeight - 4 };
+		var wp = { x: frame.contentWindow.document.body.scrollLeft,
+			   y: frame.contentWindow.document.body.scrollTop };
+		pos.x -= Math.round(ws.x/2);
+		if (pos.x < 0) pos.x = 0;
+		pos.y -= Math.round(ws.y/2);
+		if (pos.y < 0) pos.y = 0;
+		frame.contentWindow.scrollTo(pos.x, pos.y);
+	})();
+	if (currentElement) {
+		var a = allWords[currentElement.__msh_origWord];
+		currentElement.className = currentElement.className.replace(/\s*HA-spellcheck-current\s*/g, " ");
+		for (var i in a) {
+			var el = a[i];
+			if (el != currentElement) {
+				el.className = el.className.replace(/\s*HA-spellcheck-same\s*/g, " ");
+			}
+		}
+	}
+	currentElement = this;
+	this.className += " HA-spellcheck-current";
+	var a = allWords[currentElement.__msh_origWord];
+	for (var i in a) {
+		var el = a[i];
+		if (el != currentElement) {
+			el.className += " HA-spellcheck-same";
+		}
+	}
+	// document.getElementById("b_replall").disabled = (a.length <= 1);
+	// document.getElementById("b_ignall").disabled = (a.length <= 1);
+	var txt;
+	if (a.length == 1) {
+		txt = "one occurrence";
+	} else if (a.length == 2) {
+		txt = "two occurrences";
+	} else {
+		txt = a.length + " occurrences";
+	}
+	var suggestions = suggested_words[this.__msh_origWord];
+	if (suggestions)
+		suggestions = suggestions.split(/,/);
+	else
+		suggestions = [];
+	var select = document.getElementById("v_suggestions");
+	document.getElementById("statusbar").innerHTML = "Found " + txt +
+		' for word "<b>' + currentElement.__msh_origWord + '</b>"';
+	for (var i = select.length; --i >= 0;) {
+		select.remove(i);
+	}
+	for (var i = 0; i < suggestions.length; ++i) {
+		var txt = suggestions[i];
+		var option = document.createElement("option");
+		option.value = txt;
+		option.appendChild(document.createTextNode(txt));
+		select.appendChild(option);
+	}
+	document.getElementById("v_currentWord").innerHTML = this.__msh_origWord;
+	if (suggestions.length > 0) {
+		select.selectedIndex = 0;
+		select.onchange();
+	} else {
+		document.getElementById("v_replacement").value = this.innerHTML;
+	}
+	select.style.display = "none";
+	select.style.display = "block";
+	return false;
+};
+
+function wordMouseOver() {
+	this.className += " HA-spellcheck-hover";
+};
+
+function wordMouseOut() {
+	this.className = this.className.replace(/\s*HA-spellcheck-hover\s*/g, " ");
+};
+
+function displayInfo() {
+	var info = frame.contentWindow.spellcheck_info;
+	if (!info)
+		alert("No information available");
+	else {
+		var txt = "** Document information **";
+		for (var i in info) {
+			txt += "\n" + i + " : " + info[i];
+		}
+		alert(txt);
+	}
+	return false;
+};
+
+function finishedSpellChecking() {
+	// initialization of global variables
+	currentElement = null;
+	wrongWords = null;
+	allWords = {};
+	fixedWords = [];
+	suggested_words = frame.contentWindow.suggested_words;
+
+	document.getElementById("status").innerHTML = "HTMLArea Spell Checker (<a href='readme-tech.html' target='_blank' title='Technical information'>info</a>)";
+	var doc = frame.contentWindow.document;
+        var spans = doc.getElementsByTagName("span");
+        var sps = [];
+	var id = 0;
+        for (var i = 0; i < spans.length; ++i) {
+                var el = spans[i];
+                if (/HA-spellcheck-error/.test(el.className)) {
+                        sps.push(el);
+			el.__msh_wordClicked = wordClicked;
+			el.onclick = function(ev) {
+				ev || (ev = window.event);
+				ev && HTMLArea._stopEvent(ev);
+				return this.__msh_wordClicked(false);
+			};
+			el.onmouseover = wordMouseOver;
+			el.onmouseout = wordMouseOut;
+			el.__msh_id = id++;
+			var txt = (el.__msh_origWord = el.firstChild.data);
+			el.__msh_fixed = false;
+			if (typeof allWords[txt] == "undefined") {
+				allWords[txt] = [el];
+			} else {
+				allWords[txt].push(el);
+			}
+                } else if (/HA-spellcheck-fixed/.test(el.className)) {
+			fixedWords.push(el);
+		}
+        }
+	wrongWords = sps;
+	if (sps.length == 0) {
+		if (!modified) {
+			alert(i18n["NO_ERRORS_CLOSING"]);
+			window.close();
+		} else {
+			alert(i18n["NO_ERRORS"]);
+		}
+		return false;
+	}
+	(currentElement = sps[0]).__msh_wordClicked(true);
+	var as = doc.getElementsByTagName("a");
+	for (var i = as.length; --i >= 0;) {
+		var a = as[i];
+		a.onclick = function() {
+			if (confirm(i18n["CONFIRM_LINK_CLICK"] + ":\n" +
+				    this.href + "\n" + i18n["I will open it in a new page."])) {
+				window.open(this.href);
+			}
+			return false;
+		};
+	}
+	var dicts = doc.getElementById("HA-spellcheck-dictionaries");
+	if (dicts) {
+		dicts.parentNode.removeChild(dicts);
+		dicts = dicts.innerHTML.split(/,/);
+		var select = document.getElementById("v_dictionaries");
+		for (var i = select.length; --i >= 0;) {
+			select.remove(i);
+		}
+		for (var i = 0; i < dicts.length; ++i) {
+			var txt = dicts[i];
+			var option = document.createElement("option");
+			if (/^@(.*)$/.test(txt)) {
+				txt = RegExp.$1;
+				option.selected = true;
+			}
+			option.value = txt;
+			option.appendChild(document.createTextNode(txt));
+			select.appendChild(option);
+		}
+	}
+};
Index: temp/trunk/html/test/naka/HTMLArea/plugins/SpellChecker/lang/ro.js
===================================================================
--- temp/trunk/html/test/naka/HTMLArea/plugins/SpellChecker/lang/ro.js	(revision 1694)
+++ temp/trunk/html/test/naka/HTMLArea/plugins/SpellChecker/lang/ro.js	(revision 1694)
@@ -0,0 +1,37 @@
+// I18N constants
+
+// LANG: "ro", ENCODING: UTF-8
+// Author: Mihai Bazon, http://dynarch.com/mishoo
+
+// FOR TRANSLATORS:
+//
+//   1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE
+//      (at least a valid email address)
+//
+//   2. PLEASE TRY TO USE UTF-8 FOR ENCODING;
+//      (if this is not possible, please include a comment
+//       that states what encoding is necessary.)
+
+SpellChecker.I18N = {
+	"CONFIRM_LINK_CLICK"                    : "Vă rog confirmaţi că vreţi să deschideţi acest link",
+	"Cancel"                                : "Anulează",
+	"Dictionary"                            : "Dicţionar",
+	"Finished list of mispelled words"      : "Am terminat lista de cuvinte greşite",
+	"I will open it in a new page."         : "O voi deschide într-o altă fereastră.",
+	"Ignore all"                            : "Ignoră toate",
+	"Ignore"                                : "Ignoră",
+	"NO_ERRORS"                             : "Nu am găsit nici un cuvânt greşit cu acest dicţionar.",
+	"NO_ERRORS_CLOSING"                     : "Am terminat, nu am detectat nici o greşeală.  Acum închid fereastra...",
+	"OK"                                    : "OK",
+	"Original word"                         : "Cuvântul original",
+	"Please wait.  Calling spell checker."  : "Vă rog aşteptaţi.  Apelez spell-checker-ul.",
+	"Please wait: changing dictionary to"   : "Vă rog aşteptaţi.  Schimb dicţionarul cu",
+	"QUIT_CONFIRMATION"                     : "Doriţi să renunţaţi la modificări şi să închid spell-checker-ul?",
+	"Re-check"                              : "Scanează",
+	"Replace all"                           : "Înlocuieşte toate",
+	"Replace with"                          : "Înlocuieşte cu",
+	"Replace"                               : "Înlocuieşte",
+	"SC-spell-check"                        : "Detectează greşeli",
+	"Suggestions"                           : "Sugestii",
+	"pliz weit ;-)"                         : "va rog ashteptatzi ;-)"
+};
Index: temp/trunk/html/test/naka/HTMLArea/plugins/SpellChecker/lang/en.js
===================================================================
--- temp/trunk/html/test/naka/HTMLArea/plugins/SpellChecker/lang/en.js	(revision 1694)
+++ temp/trunk/html/test/naka/HTMLArea/plugins/SpellChecker/lang/en.js	(revision 1694)
@@ -0,0 +1,38 @@
+// I18N constants
+
+// LANG: "en", ENCODING: UTF-8 | ISO-8859-1
+// Author: Mihai Bazon, http://dynarch.com/mishoo
+
+// FOR TRANSLATORS:
+//
+//   1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE
+//      (at least a valid email address)
+//
+//   2. PLEASE TRY TO USE UTF-8 FOR ENCODING;
+//      (if this is not possible, please include a comment
+//       that states what encoding is necessary.)
+
+SpellChecker.I18N = {
+	"CONFIRM_LINK_CLICK"                    : "Please confirm that you want to open this link",
+	"Cancel"                                : "Cancel",
+	"Dictionary"                            : "Dictionary",
+	"Finished list of mispelled words"      : "Finished list of mispelled words",
+	"I will open it in a new page."         : "I will open it in a new page.",
+	"Ignore all"                            : "Ignore all",
+	"Ignore"                                : "Ignore",
+	"NO_ERRORS"                             : "No mispelled words found with the selected dictionary.",
+	"NO_ERRORS_CLOSING"                     : "Spell check complete, didn't find any mispelled words.  Closing now...",
+	"OK"                                    : "OK",
+	"Original word"                         : "Original word",
+	"Please wait.  Calling spell checker."  : "Please wait.  Calling spell checker.",
+	"Please wait: changing dictionary to"   : "Please wait: changing dictionary to",
+	"QUIT_CONFIRMATION"                     : "This will drop changes and quit spell checker.  Please confirm.",
+	"Re-check"                              : "Re-check",
+	"Replace all"                           : "Replace all",
+	"Replace with"                          : "Replace with",
+	"Replace"                               : "Replace",
+	"Revert"                                : "Revert",
+	"SC-spell-check"                        : "Spell-check",
+	"Suggestions"                           : "Suggestions",
+	"pliz weit ;-)"                         : "pliz weit ;-)"
+};
Index: temp/trunk/html/test/naka/HTMLArea/plugins/SpellChecker/lang/da.js
===================================================================
--- temp/trunk/html/test/naka/HTMLArea/plugins/SpellChecker/lang/da.js	(revision 1694)
+++ temp/trunk/html/test/naka/HTMLArea/plugins/SpellChecker/lang/da.js	(revision 1694)
@@ -0,0 +1,37 @@
+﻿// I18N constants
+
+// LANG: "en", ENCODING: UTF-8 | ISO-8859-1
+// Author: Steen Sønderup, <steen@soenderup.com>
+
+// FOR TRANSLATORS:
+//
+//   1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE
+//      (at least a valid email address)
+//
+//   2. PLEASE TRY TO USE UTF-8 FOR ENCODING;
+//      (if this is not possible, please include a comment
+//       that states what encoding is necessary.)
+
+SpellChecker.I18N = {
+	"CONFIRM_LINK_CLICK"                    : "Vil du følge dette link?",
+	"Cancel"                                : "Anuler",
+	"Dictionary"                            : "Ordbog",
+	"Finished list of mispelled words"      : "Listen med stavefejl er gennemgået",
+	"I will open it in a new page."         : "Jeg vil åbne det i en ny side.",
+	"Ignore all"                            : "Ignorer alle",
+	"Ignore"                                : "Ignorer",
+	"NO_ERRORS"                             : "Der blev ikke fundet nogle stavefejl med den valgte ordbog.",
+	"NO_ERRORS_CLOSING"                     : "Stavekontrollen er gennemført, der blev ikke fundet nogle stavefejl.  Lukker...",
+	"OK"                                    : "OK",
+	"Original word"                         : "Oprindeligt ord",
+	"Please wait.  Calling spell checker."  : "Vent venligst.  Henter stavekontrol.",
+	"Please wait: changing dictionary to"   : "Vent venligst: skifter ordbog til",
+	"QUIT_CONFIRMATION"                     : "Alle dine ændringer vil gå tabt, vil du fortsætte?",
+	"Re-check"                              : "Tjek igen",
+	"Replace all"                           : "Erstat alle",
+	"Replace with"                          : "Erstat med",
+	"Replace"                               : "Erstat",
+	"SC-spell-check"                        : "Stavekontrol",
+	"Suggestions"                           : "Forslag",
+	"pliz weit ;-)"                         : "Vent venligst"
+};
Index: temp/trunk/html/test/naka/HTMLArea/plugins/SpellChecker/lang/de.js
===================================================================
--- temp/trunk/html/test/naka/HTMLArea/plugins/SpellChecker/lang/de.js	(revision 1694)
+++ temp/trunk/html/test/naka/HTMLArea/plugins/SpellChecker/lang/de.js	(revision 1694)
@@ -0,0 +1,28 @@
+// I18N constants
+
+// LANG: "en", ENCODING: UTF-8 | ISO-8859-1
+// Author: Broxx, <broxx@broxx.com>
+
+SpellChecker.I18N = {
+	"CONFIRM_LINK_CLICK"                    : "Wollen Sie diesen Link oeffnen",
+	"Cancel"                                : "Abbrechen",
+	"Dictionary"                            : "Woerterbuch",
+	"Finished list of mispelled words"      : "Liste der nicht bekannten Woerter",
+	"I will open it in a new page."         : "Wird auf neuer Seite geoeffnet",
+	"Ignore all"                            : "Alle ignorieren",
+	"Ignore"                                : "Ignorieren",
+	"NO_ERRORS"                             : "Keine falschen Woerter mit gewaehlten Woerterbuch gefunden",
+	"NO_ERRORS_CLOSING"                     : "Rechtsschreibpruefung wurde ohne Fehler fertiggestellt.  Wird nun geschlossen...",
+	"OK"                                    : "OK",
+	"Original word"                         : "Original Wort",
+	"Please wait.  Calling spell checker."  : "Bitte warten.  Woerterbuch wird durchsucht.",
+	"Please wait: changing dictionary to"   : "Bitte warten: Woerterbuch wechseln zu",
+	"QUIT_CONFIRMATION"                     : "Aenderungen werden nicht uebernommen.  Bitte bestaettigen.",
+	"Re-check"                              : "Neuueberpruefung",
+	"Replace all"                           : "Alle ersetzen",
+	"Replace with"                          : "Ersetzen mit",
+	"Replace"                               : "Ersetzen",
+	"SC-spell-check"                        : "Ueberpruefung",
+	"Suggestions"                           : "Vorschlag",
+	"pliz weit ;-)"                         : "bittsche wartn ;-)"
+};
Index: temp/trunk/html/test/naka/HTMLArea/plugins/SpellChecker/lang/cz.js
===================================================================
--- temp/trunk/html/test/naka/HTMLArea/plugins/SpellChecker/lang/cz.js	(revision 1694)
+++ temp/trunk/html/test/naka/HTMLArea/plugins/SpellChecker/lang/cz.js	(revision 1694)
@@ -0,0 +1,37 @@
+﻿// I18N constants
+
+// LANG: "cz", ENCODING: UTF-8 | ISO-8859-2
+// Author: Jiri Löw, <jirilow@jirilow.com>
+
+// FOR TRANSLATORS:
+//
+//   1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE
+//      (at least a valid email address)
+//
+//   2. PLEASE TRY TO USE UTF-8 FOR ENCODING;
+//      (if this is not possible, please include a comment
+//       that states what encoding is necessary.)
+
+SpellChecker.I18N = {
+	"CONFIRM_LINK_CLICK"                    : "Prosím potvrďte otevření tohoto odkazu",
+	"Cancel"                                : "Zrušit",
+	"Dictionary"                            : "Slovník",
+	"Finished list of mispelled words"      : "Dokončen seznam chybných slov",
+	"I will open it in a new page."         : "Bude otevřen jej v nové stránce.",
+	"Ignore all"                            : "Ignorovat vše",
+	"Ignore"                                : "Ignorovat",
+	"NO_ERRORS"                             : "Podle zvoleného slovníku nebyla nalezena žádná chybná slova.",
+	"NO_ERRORS_CLOSING"                     : "Kontrola správnosti slov dokončena, nebyla nalezena žádná chybná slova. Ukončování ...",
+	"OK"                                    : "OK",
+	"Original word"                         : "Původní slovo",
+	"Please wait.  Calling spell checker."  : "Prosím čekejte. Komunikuace s kontrolou správnosti slov.",
+	"Please wait: changing dictionary to"   : "Prosím čekejte: změna adresáře na",
+	"QUIT_CONFIRMATION"                     : "Změny budou zrušeny a kontrola správnosti slov ukončena. Prosím potvrďte.",
+	"Re-check"                              : "Překontrolovat",
+	"Replace all"                           : "Zaměnit všechno",
+	"Replace with"                          : "Zaměnit za",
+	"Replace"                               : "Zaměnit",
+	"SC-spell-check"                        : "Kontrola správnosti slov",
+	"Suggestions"                           : "Doporučení",
+	"pliz weit ;-)"                         : "strpení prosím ;-)"
+};
Index: temp/trunk/html/test/naka/HTMLArea/plugins/SpellChecker/lang/hu.js
===================================================================
--- temp/trunk/html/test/naka/HTMLArea/plugins/SpellChecker/lang/hu.js	(revision 1694)
+++ temp/trunk/html/test/naka/HTMLArea/plugins/SpellChecker/lang/hu.js	(revision 1694)
@@ -0,0 +1,37 @@
+// I18N constants
+
+// LANG: "hu", ENCODING: UTF-8
+// Author: Miklós Somogyi, <somogyine@vnet.hu>
+
+// FOR TRANSLATORS:
+//
+//   1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE
+//      (at least a valid email address)
+//
+//   2. PLEASE TRY TO USE UTF-8 FOR ENCODING;
+//      (if this is not possible, please include a comment
+//       that states what encoding is necessary.)
+
+SpellChecker.I18N = {
+	"CONFIRM_LINK_CLICK"                    : "Megerősítés",
+	"Cancel"                                : "Mégsem",
+	"Dictionary"                            : "Szótár",
+	"Finished list of mispelled words"      : "A tévesztett szavak listájának vége",
+	"I will open it in a new page."         : "Megnyitás új lapon",
+	"Ignore all"                            : "Minden elvetése",
+	"Ignore"                                : "Elvetés",
+	"NO_ERRORS"                             : "A választott szótár szerint nincs tévesztett szó.",
+	"NO_ERRORS_CLOSING"                     : "A helyesírásellenőrzés kész, tévesztett szó nem fordult elő. Bezárás...",
+	"OK"                                    : "Rendben",
+	"Original word"                         : "Eredeti szó",
+	"Please wait.  Calling spell checker."  : "Kis türelmet, a helyesírásellenőrző hívása folyamatban.",
+	"Please wait: changing dictionary to"   : "Kis türelmet, szótár cseréje",
+	"QUIT_CONFIRMATION"                     : "Kilépés a változások eldobásával. Jóváhagyja?",
+	"Re-check"                              : "Újraellenőrzés",
+	"Replace all"                           : "Mind cseréje",
+	"Replace with"                          : "Csere a következőre:",
+	"Replace"                               : "Csere",
+	"SC-spell-check"                        : "Helyesírásellenőrzés",
+	"Suggestions"                           : "Tippek",
+	"pliz weit ;-)"                         : "Kis türelmet ;-)"
+};
Index: temp/trunk/html/test/naka/HTMLArea/plugins/SpellChecker/lang/it.js
===================================================================
--- temp/trunk/html/test/naka/HTMLArea/plugins/SpellChecker/lang/it.js	(revision 1694)
+++ temp/trunk/html/test/naka/HTMLArea/plugins/SpellChecker/lang/it.js	(revision 1694)
@@ -0,0 +1,28 @@
+// I18N constants
+
+// LANG: "it", ENCODING: UTF-8 | ISO-8859-1
+// Author: Fabio Rotondo, <fabio@rotondo.it>
+
+SpellChecker.I18N = {
+	"CONFIRM_LINK_CLICK"                    : "Devi confermare l'apertura di questo link",
+	"Cancel"                                : "Annulla",
+	"Dictionary"                            : "Dizionario",
+	"Finished list of mispelled words"      : "La lista delle parole scritte male è terminata",
+	"I will open it in a new page."         : "Lo aprirò in una nuova pagina.",
+	"Ignore all"                            : "Ignora sempre",
+	"Ignore"                                : "Ignora",
+	"NO_ERRORS"                             : "Non sono state trovate parole scritte male con il dizionario selezionato.",
+	"NO_ERRORS_CLOSING"                     : "Controllo completato, non sono state trovate parole scritte male. Sto chiudendo...",
+	"OK"                                    : "OK",
+	"Original word"                         : "Parola originale",
+	"Please wait.  Calling spell checker."  : "Attendere.  Sto invocando lo Spell Checker.",
+	"Please wait: changing dictionary to"   : "Attendere. Cambio il dizionario in",
+	"QUIT_CONFIRMATION"                     : "Questo annullerà le modifiche e chiuderà lo Spell Checker. Conferma.",
+	"Re-check"                              : "Ricontrolla",
+	"Replace all"                           : "Sostituisci sempre",
+	"Replace with"                          : "Stostituisci con",
+	"Replace"                               : "Sostituisci",
+	"SC-spell-check"                        : "Spell-check",
+	"Suggestions"                           : "Suggerimenti",
+	"pliz weit ;-)"                         : "Attendere Prego ;-)"
+};
Index: temp/trunk/html/test/naka/HTMLArea/plugins/SpellChecker/readme-tech.html
===================================================================
--- temp/trunk/html/test/naka/HTMLArea/plugins/SpellChecker/readme-tech.html	(revision 1694)
+++ temp/trunk/html/test/naka/HTMLArea/plugins/SpellChecker/readme-tech.html	(revision 1694)
@@ -0,0 +1,114 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 3.2//EN">
+<html>
+  <head>
+    <title>HTMLArea Spell Checker</title>
+  </head>
+
+  <body>
+    <h1>HTMLArea Spell Checker</h1>
+
+    <p>The HTMLArea Spell Checker subsystem consists of the following
+      files:</p>
+
+    <ul>
+
+      <li>spell-checker.js &mdash; the spell checker plugin interface for
+        HTMLArea</li>
+
+      <li>spell-checker-ui.html &mdash; the HTML code for the user
+        interface</li>
+
+      <li>spell-checker-ui.js &mdash; functionality of the user
+        interface</li>
+
+      <li>spell-checker-logic.cgi &mdash; Perl CGI script that checks a text
+        given through POST for spelling errors</li>
+
+      <li>spell-checker-style.css &mdash; style for mispelled words</li>
+
+      <li>lang/en.js &mdash; main language file (English).</li>
+
+    </ul>
+
+    <h2>Process overview</h2>
+
+    <p>
+      When an end-user clicks the "spell-check" button in the HTMLArea
+      editor, a new window is opened with the URL of "spell-check-ui.html".
+      This window initializes itself with the text found in the editor (uses
+      <tt>window.opener.SpellChecker.editor</tt> global variable) and it
+      submits the text to the server-side script "spell-check-logic.cgi".
+      The target of the FORM is an inline frame which is used both to
+      display the text and correcting.
+    </p>
+
+    <p>
+      Further, spell-check-logic.cgi calls Aspell for each portion of plain
+      text found in the given HTML.  It rebuilds an HTML file that contains
+      clear marks of which words are incorrect, along with suggestions for
+      each of them.  This file is then loaded in the inline frame.  Upon
+      loading, a JavaScript function from "spell-check-ui.js" is called.
+      This function will retrieve all mispelled words from the HTML of the
+      iframe and will setup the user interface so that it allows correction.
+    </p>
+
+    <h2>The server-side script (spell-check-logic.cgi)</h2>
+
+    <p>
+      <strong>Unicode safety</strong> &mdash; the program <em>is</em>
+      Unicode safe.  HTML entities are expanded into their corresponding
+      Unicode characters.  These characters will be matched as part of the
+      word passed to Aspell.  All texts passed to Aspell are in Unicode
+      (when appropriate).  <strike>However, Aspell seems to not support Unicode
+      yet (<a
+        href="http://mail.gnu.org/archive/html/aspell-user/2000-11/msg00007.html">thread concerning Aspell and Unicode</a>).
+      This mean that words containing Unicode
+      characters that are not in 0..255 are likely to be reported as "mispelled" by Aspell.</strike>
+    </p>
+
+    <p>
+      <strong style="font-variant: small-caps; color:
+      red;">Update:</strong> though I've never seen it mentioned
+      anywhere, it looks that Aspell <em>does</em>, in fact, speak
+      Unicode.  Or else, maybe <code>Text::Aspell</code> does
+      transparent conversion; anyway, this new version of our
+      SpellChecker plugin is, as tests show so far, fully
+      Unicode-safe... well, probably the <em>only</em> freeware
+      Web-based spell-checker which happens to have Unicode support.
+    </p>
+
+    <p>
+      The Perl Unicode manual (man perluniintro) states:
+    </p>
+
+    <blockquote>
+      <em>
+        Starting from Perl 5.6.0, Perl has had the capacity to handle Unicode
+        natively.  Perl 5.8.0, however, is the first recommended release for
+        serious Unicode work.  The maintenance release 5.6.1 fixed many of the
+        problems of the initial Unicode implementation, but for example regular
+        expressions still do not work with Unicode in 5.6.1.
+      </em>
+    </blockquote>
+
+    <p>In other words, do <em>not</em> assume that this script is
+      Unicode-safe on Perl interpreters older than 5.8.0.</p>
+
+    <p>The following Perl modules are required:</p>
+
+    <ul>
+      <li><a href="http://search.cpan.org/search?query=Text%3A%3AAspell&mode=all" target="_blank">Text::Aspell</a></li>
+      <li><a href="http://search.cpan.org/search?query=XML%3A%3ADOM&mode=all" target="_blank">XML::DOM</a></li>
+      <li><a href="http://search.cpan.org/search?query=CGI&mode=all" target="_blank">CGI</a></li>
+    </ul>
+
+    <p>Of these, only Text::Aspell might need to be installed manually.  The
+      others are likely to be available by default in most Perl distributions.</p>
+
+    <hr />
+    <address><a href="http://dynarch.com/mishoo/">Mihai Bazon</a></address>
+<!-- Created: Thu Jul 17 13:22:27 EEST 2003 -->
+<!-- hhmts start --> Last modified: Fri Jan 30 19:14:11 EET 2004 <!-- hhmts end -->
+<!-- doc-lang: English -->
+  </body>
+</html>
Index: temp/trunk/html/test/naka/HTMLArea/plugins/SpellChecker/spell-check-ui.html
===================================================================
--- temp/trunk/html/test/naka/HTMLArea/plugins/SpellChecker/spell-check-ui.html	(revision 1694)
+++ temp/trunk/html/test/naka/HTMLArea/plugins/SpellChecker/spell-check-ui.html	(revision 1694)
@@ -0,0 +1,122 @@
+<!--
+
+  Strangely, IE sucks with or without the DOCTYPE switch.
+  I thought it would only suck without it.
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
+    "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+
+   Spell Checker Plugin for HTMLArea-3.0
+   Sponsored by www.americanbible.org
+   Implementation by Mihai Bazon, http://dynarch.com/mishoo/
+  
+   (c) dynarch.com 2003.
+   Distributed under the same terms as HTMLArea itself.
+   This notice MUST stay intact for use (see license.txt).
+
+   $Id$
+
+-->
+<html xmlns="http://www.w3.org/1999/xhtml">
+
+  <head>
+    <title>Spell Checker</title>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+    <script type="text/javascript" src="spell-check-ui.js"></script>
+
+    <style type="text/css">
+      html, body { height: 100%; margin: 0px; padding: 0px; background-color: #fff;
+      color: #000; }
+      a:link, a:visited { color: #00f; text-decoration: none; }
+      a:hover { color: #f00; text-decoration: underline; }
+
+      table { background-color: ButtonFace; color: ButtonText;
+      font-family: tahoma,verdana,sans-serif; font-size: 11px; }
+
+      iframe { background-color: #fff; color: #000; height: 100%; width: 100%; }
+
+      .controls { width: 13em; }
+      .controls .sectitle { /* background-color: #736c6c; color: #fff;
+      border-top: 1px solid #000; border-bottom: 1px solid #fff; */
+      text-align: center;
+      font-weight: bold; padding: 2px 4px; }
+      .controls .secbody { margin-bottom: 10px; }
+
+      button, select { font-family: tahoma,verdana,sans-serif; font-size: 11px; }
+      button { width: 6em; padding: 0px; }
+
+      input, select { font-family: fixed,"andale mono",monospace; }
+
+      #v_currentWord { color: #f00; font-weight: bold; }
+      #statusbar { padding: 7px 0px 0px 5px; }
+      #status { font-weight: bold; }
+    </style>
+
+  </head>
+
+  <body onload="initDocument()">
+
+    <form style="display: none;" action="spell-check-logic.cgi"
+          method="post" target="framecontent"
+          accept-charset="UTF-8"
+          ><input type="hidden" name="content" id="f_content"
+          /><input type="hidden" name="dictionary" id="f_dictionary"
+          /><input type="hidden" name="init" id="f_init" value="1"
+    /></form>
+
+    <table style="height: 100%; width: 100%; border-collapse: collapse;" cellspacing="0" cellpadding="0">
+      <tr>
+        <td colspan="2" style="height: 1em; padding: 2px;">
+          <div style="float: right; padding: 2px;"><span>Dictionary</span>
+            <select id="v_dictionaries" style="width: 10em"></select>
+            <button id="b_recheck">Re-check</button>
+          </div>
+          <span id="status">Please wait.  Calling spell checker.</span>
+        </td>
+      </tr>
+      <tr>
+        <td valign="top" class="controls">
+          <div class="secbody" style="text-align: center">
+            <button id="b_info">Info</button>
+          </div>
+          <div class="sectitle">Original word</div>
+          <div class="secbody" id="v_currentWord" style="text-align:
+          center; margin-bottom: 0px;">pliz weit ;-)</div>
+          <div class="secbody" style="text-align: center">
+            <button id="b_revert">Revert</button>
+          </div>
+          <div class="sectitle">Replace with</div>
+          <div class="secbody">
+            <input type="text" id="v_replacement" style="width: 94%; margin-left: 3%;" /><br />
+            <div style="text-align: center; margin-top: 2px;">
+              <button id="b_replace">Replace</button><button
+                id="b_replall">Replace all</button><br /><button
+                id="b_ignore">Ignore</button><button
+                id="b_ignall">Ignore all</button>
+            </div>
+          </div>
+          <div class="sectitle">Suggestions</div>
+          <div class="secbody">
+            <select size="11" style="width: 94%; margin-left: 3%;" id="v_suggestions"></select>
+          </div>
+        </td>
+
+        <td>
+          <iframe src="about:blank" width="100%" height="100%"
+            id="i_framecontent" name="framecontent"></iframe>
+        </td>
+      </tr>
+      <tr>
+        <td style="height: 1em;" colspan="2">
+          <div style="padding: 4px 2px 2px 2px; float: right;">
+            <button id="b_ok">OK</button>
+            <button id="b_cancel">Cancel</button>
+          </div>
+          <div id="statusbar"></div>
+        </td>
+      </tr>
+    </table>
+
+  </body>
+
+</html>
Index: temp/trunk/html/test/naka/HTMLArea/popupdiv.js
===================================================================
--- temp/trunk/html/test/naka/HTMLArea/popupdiv.js	(revision 1694)
+++ temp/trunk/html/test/naka/HTMLArea/popupdiv.js	(revision 1694)
@@ -0,0 +1,369 @@
+/** This file is derived from PopupDiv, developed by Mihai Bazon for
+ * SamWare.net.  Modifications were needed to make it usable in HTMLArea.
+ * HTMLArea is a free WYSIWYG online HTML editor from InteractiveTools.com.
+ *
+ * This file does not function standalone.  It is dependent of global functions
+ * defined in HTMLArea-3.0 (htmlarea.js).
+ *
+ * Please see file htmlarea.js for further details.
+ **/
+
+var is_ie = ( (navigator.userAgent.toLowerCase().indexOf("msie") != -1) &&
+	      (navigator.userAgent.toLowerCase().indexOf("opera") == -1) );
+var is_compat = (document.compatMode == "BackCompat");
+
+function PopupDiv(editor, titleText, handler, initFunction) {
+	var self = this;
+
+	this.editor = editor;
+	this.doc = editor._mdoc;
+	this.handler = handler;
+
+	var el = this.doc.createElement("div");
+	el.className = "content";
+
+	var popup = this.doc.createElement("div");
+	popup.className = "dialog popupdiv";
+	this.element = popup;
+	var s = popup.style;
+	s.position = "absolute";
+	s.left = "0px";
+	s.top = "0px";
+
+	var title = this.doc.createElement("div");
+	title.className = "title";
+	this.title = title;
+	popup.appendChild(title);
+
+	HTMLArea._addEvent(title, "mousedown", function(ev) {
+		self._dragStart(is_ie ? window.event : ev);
+	});
+
+	var button = this.doc.createElement("div");
+	button.className = "button";
+	title.appendChild(button);
+	button.innerHTML = "&#x00d7;";
+	title.appendChild(this.doc.createTextNode(titleText));
+	this.titleText = titleText;
+
+	button.onmouseover = function() {
+		this.className += " button-hilite";
+	};
+	button.onmouseout = function() {
+		this.className = this.className.replace(/\s*button-hilite\s*/g, " ");
+	};
+	button.onclick = function() {
+		this.className = this.className.replace(/\s*button-hilite\s*/g, " ");
+		self.close();
+	};
+
+	popup.appendChild(el);
+	this.content = el;
+
+	this.doc.body.appendChild(popup);
+
+	this.dragging = false;
+	this.onShow = null;
+	this.onClose = null;
+	this.modal = false;
+
+	initFunction(this);
+};
+
+PopupDiv.currentPopup = null;
+
+PopupDiv.prototype.showAtElement = function(el, mode) {
+	this.defaultSize();
+	var pos, ew, eh;
+	var popup = this.element;
+	popup.style.display = "block";
+	var w = popup.offsetWidth;
+	var h = popup.offsetHeight;
+	popup.style.display = "none";
+	if (el != window) {
+		pos = PopupDiv.getAbsolutePos(el);
+		ew = el.offsetWidth;
+		eh = el.offsetHeight;
+	} else {
+		pos = {x:0, y:0};
+		var size = PopupDiv.getWindowSize();
+		ew = size.x;
+		eh = size.y;
+	}
+	var FX = false, FY = false;
+	if (mode.indexOf("l") != -1) {
+		pos.x -= w;
+		FX = true;
+	}
+	if (mode.indexOf("r") != -1) {
+		pos.x += ew;
+		FX = true;
+	}
+	if (mode.indexOf("t") != -1) {
+		pos.y -= h;
+		FY = true;
+	}
+	if (mode.indexOf("b") != -1) {
+		pos.y += eh;
+		FY = true;
+	}
+	if (mode.indexOf("c") != -1) {
+		FX || (pos.x += Math.round((ew - w) / 2));
+		FY || (pos.y += Math.round((eh - h) / 2));
+	}
+	this.showAt(pos.x, pos.y);
+};
+
+PopupDiv.prototype.defaultSize = function() {
+	var s = this.element.style;
+	var cs = this.element.currentStyle;
+	var addX = (is_ie && is_compat) ? (parseInt(cs.borderLeftWidth) +
+					   parseInt(cs.borderRightWidth) +
+					   parseInt(cs.paddingLeft) +
+					   parseInt(cs.paddingRight)) : 0;
+	var addY = (is_ie && is_compat) ? (parseInt(cs.borderTopWidth) +
+					   parseInt(cs.borderBottomWidth) +
+					   parseInt(cs.paddingTop) +
+					   parseInt(cs.paddingBottom)) : 0;
+	s.display = "block";
+	s.width = (this.content.offsetWidth + addX) + "px";
+	s.height = (this.content.offsetHeight + this.title.offsetHeight) + "px";
+	s.display = "none";
+};
+
+PopupDiv.prototype.showAt = function(x, y) {
+	this.defaultSize();
+	var s = this.element.style;
+	s.display = "block";
+	s.left = x + "px";
+	s.top = y + "px";
+	this.hideShowCovered();
+
+	PopupDiv.currentPopup = this;
+	HTMLArea._addEvents(this.doc.body, ["mousedown", "click"], PopupDiv.checkPopup);
+	HTMLArea._addEvents(this.editor._doc.body, ["mousedown", "click"], PopupDiv.checkPopup);
+	if (is_ie && this.modal) {
+		this.doc.body.setCapture(false);
+		this.doc.body.onlosecapture = function() {
+			(PopupDiv.currentPopup) && (this.doc.body.setCapture(false));
+		};
+	}
+	window.event && HTMLArea._stopEvent(window.event);
+
+	if (typeof this.onShow == "function") {
+		this.onShow();
+	} else if (typeof this.onShow == "string") {
+		eval(this.onShow);
+	}
+
+	var field = this.element.getElementsByTagName("input")[0];
+	if (!field) {
+		field = this.element.getElementsByTagName("select")[0];
+	}
+	if (!field) {
+		field = this.element.getElementsByTagName("textarea")[0];
+	}
+	if (field) {
+		field.focus();
+	}
+};
+
+PopupDiv.prototype.close = function() {
+	this.element.style.display = "none";
+	PopupDiv.currentPopup = null;
+	this.hideShowCovered();
+	HTMLArea._removeEvents(this.doc.body, ["mousedown", "click"], PopupDiv.checkPopup);
+	HTMLArea._removeEvents(this.editor._doc.body, ["mousedown", "click"], PopupDiv.checkPopup);
+	is_ie && this.modal && this.doc.body.releaseCapture();
+	if (typeof this.onClose == "function") {
+		this.onClose();
+	} else if (typeof this.onClose == "string") {
+		eval(this.onClose);
+	}
+	this.element.parentNode.removeChild(this.element);
+};
+
+PopupDiv.prototype.getForm = function() {
+	var forms = this.content.getElementsByTagName("form");
+	return (forms.length > 0) ? forms[0] : null;
+};
+
+PopupDiv.prototype.callHandler = function() {
+	var tags = ["input", "textarea", "select"];
+	var params = new Object();
+	for (var ti in tags) {
+		var tag = tags[ti];
+		var els = this.content.getElementsByTagName(tag);
+		for (var j = 0; j < els.length; ++j) {
+			var el = els[j];
+			params[el.name] = el.value;
+		}
+	}
+	this.handler(this, params);
+	return false;
+};
+
+PopupDiv.getAbsolutePos = function(el) {
+	var r = { x: el.offsetLeft, y: el.offsetTop };
+	if (el.offsetParent) {
+		var tmp = PopupDiv.getAbsolutePos(el.offsetParent);
+		r.x += tmp.x;
+		r.y += tmp.y;
+	}
+	return r;
+};
+
+PopupDiv.getWindowSize = function() {
+	if (window.innerHeight) {
+		return { y: window.innerHeight, x: window.innerWidth };
+	}
+	if (this.doc.body.clientHeight) {
+		return { y: this.doc.body.clientHeight, x: this.doc.body.clientWidth };
+	}
+	return { y: this.doc.documentElement.clientHeight, x: this.doc.documentElement.clientWidth };
+};
+
+PopupDiv.prototype.hideShowCovered = function () {
+	var self = this;
+	function isContained(el) {
+		while (el) {
+			if (el == self.element) {
+				return true;
+			}
+			el = el.parentNode;
+		}
+		return false;
+	};
+	var tags = new Array("applet", "select");
+	var el = this.element;
+
+	var p = PopupDiv.getAbsolutePos(el);
+	var EX1 = p.x;
+	var EX2 = el.offsetWidth + EX1;
+	var EY1 = p.y;
+	var EY2 = el.offsetHeight + EY1;
+
+	if (el.style.display == "none") {
+		EX1 = EX2 = EY1 = EY2 = 0;
+	}
+
+	for (var k = tags.length; k > 0; ) {
+		var ar = this.doc.getElementsByTagName(tags[--k]);
+		var cc = null;
+
+		for (var i = ar.length; i > 0;) {
+			cc = ar[--i];
+			if (isContained(cc)) {
+				cc.style.visibility = "visible";
+				continue;
+			}
+
+			p = PopupDiv.getAbsolutePos(cc);
+			var CX1 = p.x;
+			var CX2 = cc.offsetWidth + CX1;
+			var CY1 = p.y;
+			var CY2 = cc.offsetHeight + CY1;
+
+			if ((CX1 > EX2) || (CX2 < EX1) || (CY1 > EY2) || (CY2 < EY1)) {
+				cc.style.visibility = "visible";
+			} else {
+				cc.style.visibility = "hidden";
+			}
+		}
+	}
+};
+
+PopupDiv.prototype._dragStart = function (ev) {
+	if (this.dragging) {
+		return false;
+	}
+	this.dragging = true;
+	PopupDiv.currentPopup = this;
+	var posX = ev.clientX;
+	var posY = ev.clientY;
+	if (is_ie) {
+		posY += this.doc.body.scrollTop;
+		posX += this.doc.body.scrollLeft;
+	} else {
+		posY += window.scrollY;
+		posX += window.scrollX;
+	}
+	var st = this.element.style;
+	this.xOffs = posX - parseInt(st.left);
+	this.yOffs = posY - parseInt(st.top);
+	HTMLArea._addEvent(this.doc, "mousemove", PopupDiv.dragIt);
+	HTMLArea._addEvent(this.doc, "mouseover", HTMLArea._stopEvent);
+	HTMLArea._addEvent(this.doc, "mouseup", PopupDiv.dragEnd);
+	HTMLArea._stopEvent(ev);
+};
+
+PopupDiv.dragIt = function (ev) {
+	var popup = PopupDiv.currentPopup;
+	if (!(popup && popup.dragging)) {
+		return false;
+	}
+	is_ie && (ev = window.event);
+	var posX = ev.clientX;
+	var posY = ev.clientY;
+	if (is_ie) {
+		posY += this.doc.body.scrollTop;
+		posX += this.doc.body.scrollLeft;
+	} else {
+		posY += window.scrollY;
+		posX += window.scrollX;
+	}
+	popup.hideShowCovered();
+	var st = popup.element.style;
+	st.left = (posX - popup.xOffs) + "px";
+	st.top = (posY - popup.yOffs) + "px";
+	HTMLArea._stopEvent(ev);
+};
+
+PopupDiv.dragEnd = function () {
+	var popup = PopupDiv.currentPopup;
+	if (!popup) {
+		return false;
+	}
+	popup.dragging = false;
+	HTMLArea._removeEvent(popup.doc, "mouseup", PopupDiv.dragEnd);
+	HTMLArea._removeEvent(popup.doc, "mouseover", HTMLArea._stopEvent);
+	HTMLArea._removeEvent(popup.doc, "mousemove", PopupDiv.dragIt);
+	popup.hideShowCovered();
+};
+
+PopupDiv.checkPopup = function (ev) {
+	is_ie && (ev = window.event);
+	var el = is_ie ? ev.srcElement : ev.target;
+	var cp = PopupDiv.currentPopup;
+	for (; (el != null) && (el != cp.element); el = el.parentNode);
+	if (el == null) {
+		cp.modal || ev.type == "mouseover" || cp.close();
+		HTMLArea._stopEvent(ev);
+	}
+};
+
+PopupDiv.prototype.addButtons = function() {
+	var self = this;
+	var div = this.doc.createElement("div");
+	this.content.appendChild(div);
+	div.className = "buttons";
+	for (var i = 0; i < arguments.length; ++i) {
+		var btn = arguments[i];
+		var button = this.doc.createElement("button");
+		div.appendChild(button);
+		button.innerHTML = HTMLArea.I18N.buttons[btn];
+		switch (btn) {
+		    case "ok":
+			button.onclick = function() {
+				self.callHandler();
+				self.close();
+			};
+			break;
+		    case "cancel":
+			button.onclick = function() {
+				self.close();
+			};
+			break;
+		}
+	}
+};
Index: temp/trunk/html/test/naka/HTMLArea/reference.html
===================================================================
--- temp/trunk/html/test/naka/HTMLArea/reference.html	(revision 1694)
+++ temp/trunk/html/test/naka/HTMLArea/reference.html	(revision 1694)
@@ -0,0 +1,523 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 3.2//EN">
+<html> <head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<title>HTMLArea-3.0 Reference</title>
+
+<style type="text/css">
+  @import url(htmlarea.css);
+  body { font: 14px verdana,sans-serif; background: #fff; color: #000; }
+  h1, h2 { font-family:tahoma,sans-serif; }
+  h1 { border-bottom: 2px solid #000; }
+  h2 { border-bottom: 1px solid #aaa; }
+  h3, h4 { margin-bottom: 0px; font-family: Georgia,serif; font-style: italic; }
+  h4 { font-size: 90%; margin-left: 1em; }
+  acronym { border-bottom: 1px dotted #063; color: #063; }
+  p { margin-left: 2em; margin-top: 0.3em; }
+  li p { margin-left: 0px; }
+  .abstract { padding: 5px; margin: 0px 10em; font-size: 90%; border: 1px dashed #aaa; background: #eee;}
+  li { margin-left: 2em; }
+  em { color: #042; }
+  a { color: #00f; }
+  a:hover { color: #f00; }
+  a:active { color: #f80; }
+  span.browser { font-weight: bold; color: #864; }
+  .fixme { font-size: 20px; font-weight: bold; color: red; background: #fab;
+padding: 5px; text-align: center; }
+  .code {
+   background: #e4efff; padding: 5px; border: 1px dashed #abc; margin-left: 2em; margin-right: 2em;
+   font-family: fixed,"lucidux mono","andale mono","courier new",monospace;
+  }
+  .note, .warning { font-weight: bold; color: #0a0; font-variant: small-caps; }
+  .warning { color: #a00; }
+
+.string {
+  color: #06c;
+} /* font-lock-string-face */
+.comment {
+  color: #840;
+} /* font-lock-comment-face */
+.variable-name {
+  color: #000;
+} /* font-lock-variable-name-face */
+.type {
+  color: #008;
+  font-weight: bold;
+} /* font-lock-type-face */
+.reference {
+  color: #048;
+} /* font-lock-reference-face */
+.preprocessor {
+  color: #808;
+} /* font-lock-preprocessor-face */
+.keyword {
+  color: #00f;
+  font-weight: bold;
+} /* font-lock-keyword-face */
+.function-name {
+  color: #044;
+} /* font-lock-function-name-face */
+.html-tag {
+  font-weight: bold;
+} /* html-tag-face */
+.html-helper-italic {
+  font-style: italic;
+} /* html-helper-italic-face */
+.html-helper-bold {
+  font-weight: bold;
+} /* html-helper-bold-face */
+
+</style>
+
+<script type="text/javascript">
+  _editor_url = './';
+  _editor_lang = 'en';
+</script>
+<script type="text/javascript" src="htmlarea.js"></script>
+<script type="text/javascript" src="dialog.js"></script>
+<script tyle="text/javascript" src="lang/en.js"></script>
+
+</head>
+
+<body onload="HTMLArea.replace('TA')">
+
+
+<h1>HTMLArea-3.0 Documentation</h1>
+
+<div class="abstract" style="color: red; font-weight: bold">
+
+      This documentation contains valid information, but is outdated in the
+      terms that it does not covers all the features of HTMLArea.  A new
+      documentation project will be started, based on LaTeX.
+
+</div>
+
+
+<h2>Introduction</h2>
+
+<h3>What is HTMLArea?</h3>
+
+<p>HTMLArea is a free <acronym title="What You See Is What You Get"
+>WYSIWYG</acronym> editor replacement for <code>&lt;textarea&gt;</code>
+fields.  By adding a few simple lines of JavaScript code to your web page
+you can replace a regular textarea with a rich text editor that lets your
+users do the following:</p>
+
+<ul>
+  <li>Format text to be bold, italicized, or underlined.</li>
+  <li>Change the face, size, style and color.</li>
+  <li>Left, center, or right-justify paragraphs.</li>
+  <li>Make bulleted or numbered lists.</li>
+  <li>Indent or un-indent paragraphs.</li>
+  <li>Insert a horizontal line.</li>
+  <li>Insert hyperlinks and images.</li>
+  <li>View the raw HTML source of what they're editing.</li>
+  <li>and much more...</li>
+</ul>
+
+<p>Some of the interesting features of HTMLArea that set's it apart from
+other web based WYSIWYG editors are as follows:</p>
+
+<ul>
+  <li>It's lightweight, fast loading and can transform a regular textarea
+  into a rich-text editor with a single line of JavaScript.</li>
+  <li>Generates clean, valid HTML.</li>
+  <li>It degrades gracefully to older or non-supported browsers
+  (they get the original textarea field).</li>
+  <li>It's free and can be incorporated into any free or commercial
+  program.</li>
+  <li>It works with any server-side languages (ASP, PHP, Perl, Java,
+  etc).</li>
+  <li>It's written in JavaScript and can be easily viewed, modified or
+  extended.</li>
+  <li>It remembers entered content when a user navigates away and then hits
+  "back" in their browser.</li>
+  <li>Since it replaces existing textareas it doesn't require a lot of code
+  to add it to your pages (just one line).</li>
+  <li>Did we mention it was free? ;-)</li>
+</ul>
+
+<h3>Is it really free?  What's the catch?</h3>
+
+<p>Yes! It's really free. You can use it, modify it, distribute it with your
+software, or do just about anything you like with it.</p>
+
+<h3>What are the browser requirements?</h3>
+
+<p>HTMLArea requires <span class="browser"><a
+href="http://www.microsoft.com/ie">Internet Explorer</a> &gt;= 5.5</span>
+(Windows only), or <span class="browser"><a
+href="http://mozilla.org">Mozilla</a> &gt;= 1.3-Beta</span> on any platform.
+Any browser based on <a href="http://mozilla.org/newlayout">Gecko</a> will
+also work, provided that Gecko version is at least the one included in
+Mozilla-1.3-Beta (for example, <a
+href="http://galeon.sf.net">Galeon-1.2.8</a>).  However, it degrades
+gracefully to other browsers. They will get a regular textarea field
+instead of a WYSIWYG editor.</p>
+
+<h3>Can I see an example of what it looks like?</h3>
+
+<p>Just make sure you're using one of the browsers mentioned above and see
+below.</p>
+
+<form onsubmit="return false;">
+<textarea id="TA" style="width: 100%; height: 15em;">
+<p>Here is some sample text in textarea that's been transformed with <font
+color="#0000CC"><b>HTMLArea</b></font>.<br />
+You can make things <b>bold</b>, <i>italic</i>, <u>underline</u>.  You can change the
+<font size="3">size</font> and <b><font color="#0000CC">c</font><font color="#00CC00">o</font><font color="#00CCCC">l</font><font color="#CC0000">o</font><font color="#CC00CC">r</font><font color="#CCCC00">s</font><font color="#CCCCCC">!</font></b>
+And lots more...</p>
+
+<p align="center"><font size="4" color="#ff0000"><b><u>Try HTMLArea
+today!</u></b></font><br /></p>
+</textarea>
+</form>
+
+<h3>Where can I find out more info, download the latest version and talk to
+other HTMLArea users?</h3>
+
+<p>You can find out more about HTMLArea and download the latest version on
+the <a href="http://dynarch.com/htmlarea/">HTMLArea
+homepage</a> and you can talk to other HTMLArea users and post any comments
+or suggestions you have in the <a
+href="http://www.interactivetools.com/iforum/Open_Source_C3/htmlArea_v3.0_-_Alpha_Release_F14/"
+>HTMLArea forum</a>.</p>
+
+<h2>Keyboard shortcuts</h2>
+
+<p>The editor provides the following key combinations:</p>
+
+<ul>
+  <li>CTRL-A -- select all</li>
+  <li>CTRL-B -- bold</li>
+  <li>CTRL-I -- italic</li>
+  <li>CTRL-U -- underline</li>
+  <li>CTRL-S -- strikethrough</li>
+  <li>CTRL-L -- justify left</li>
+  <li>CTRL-E -- justify center</li>
+  <li>CTRL-R -- justify right</li>
+  <li>CTRL-J -- justify full</li>
+  <li>CTRL-1 .. CTRL-6 -- headings (&lt;h1&gt; .. &lt;h6&gt;)</li>
+  <li>CTRL-0 (zero) -- clean content pasted from Word</li>
+</ul>
+
+<h2>Installation</h2>
+
+<h3>How do I add HTMLArea to my web page?</h3>
+
+<p>It's easy.  First you need to upload HTMLArea files to your website.
+Just follow these steps.</p>
+
+<ol>
+  <li>Download the latest version from the <a
+  href="http://www.interactivetools.com/products/htmlarea/">htmlArea
+  homepage</a>.</li>
+  <li>Unzip the files onto your local computer (making sure to maintain the
+  directory structure contained in the zip).</li>
+  <li>Create a new folder on your website called /htmlarea/ (make sure it's
+  NOT inside the cgi-bin).</li>
+  <li>Transfer all the HTMLArea files from your local computer into the
+  /htmlarea/ folder on your website.</li>
+  <li>Open the example page /htmlarea/examples/core.html with your browser to make
+  sure everything works.</li>
+</ol>
+
+<p>Once htmlArea is on your website all you need to do is add some
+JavaScript to any pages that you want to add WYSIWYG editors to.  Here's how
+to do that.</p>
+
+<ol>
+
+  <li>Define some global variables.  "_editor_url" has to be the absolute
+  URL where HTMLArea resides within your
+  website; as we discussed, this would be “/htmlarea/”.  "_editor_lang" must
+  be the language code in which you want HTMLArea to appear.  This defaults
+  to "en" (English); for a list of supported languages, please look into
+  the "lang" subdirectory in the distribution.
+  <pre class="code"
+  ><span class="function-name">&lt;</span><span class="html-tag">script</span> <span class="variable-name">type=</span><span class="string">&quot;text/javascript&quot;</span><span class="function-name">&gt;</span>
+   _editor_url = <span class="string">&quot;/htmlarea/&quot;</span>;
+   _editor_lang = <span class="string">&quot;en&quot;</span>;
+<span class="function-name">&lt;</span><span class="html-tag">/script</span><span class="function-name">&gt;</span></pre>
+
+  <li>Include the "htmlarea.js" script:
+  <pre class="code"
+  ><span class="function-name">&lt;</span><span class="html-tag">script</span> <span class="variable-name">type=</span><span class="string">&quot;text/javascript&quot;</span> <span class="variable-name">src=</span><span class="string">&quot;/htmlarea/htmlarea.js&quot;</span><span class="function-name">&gt;</span><span class="paren-face-match">&lt;</span><span class="html-tag">/script</span><span class="paren-face-match">&gt;</span></pre>
+  </li>
+
+  <li><p>If you want to change all your &lt;textarea&gt;-s into
+  HTMLArea-s then you can use the simplest way to create HTMLArea:</p>
+  <pre class="code"
+  ><span class="function-name">&lt;</span><span class="html-tag">script</span> <span class="variable-name">type=</span><span class="string">&quot;text/javascript&quot;</span> <span class="variable-name">defer=</span><span class="string">&quot;1&quot;</span><span class="function-name">&gt;</span>
+    HTMLArea.replaceAll<span class="function-name">()</span>;
+<span class="paren-face-match">&lt;</span><span class="html-tag">/script</span><span class="paren-face-match">&gt;</span></pre>
+  <p><span class="note">Note:</span> you can also add the
+  <code>HTMLArea.replaceAll()</code> code to the <code>onload</code>
+  event handler for the <code>body</code> element, if you find it more appropriate.</p>
+
+  <p>A different approach, if you have more than one textarea and only want
+  to change one of them, is to use <code>HTMLArea.replace("id")</code> --
+  pass the <code>id</code> of your textarea.  Do not use the
+  <code>name</code> attribute anymore, it's not a standard solution!</p>
+
+</ol>
+
+<p>This section applies to HTMLArea-3.0 release candidate 1 or later; prior
+to this version, one needed to include more files; however, now HTMLArea is
+able to include other files too (such as stylesheet, language definition
+file, etc.) so you only need to define the editor path and load
+"htmlarea.js".  Nice, eh? ;-)</p>
+
+<h3>I want to change the editor settings, how do I do that?</h3>
+
+<p>While it's true that all you need is one line of JavaScript to create an
+htmlArea WYSIWYG editor, you can also specify more config settings in the
+code to control how the editor works and looks.  Here's an example of some of
+the available settings:</p>
+
+<pre class="code"
+><span class="keyword">var</span> <span class="variable-name">config</span> = <span class="keyword">new</span> HTMLArea.Config(); <span class="comment">// create a new configuration object
+</span>                                    <span class="comment">// having all the default values
+</span>config.width = '<span class="string">90%</span>';
+config.height = '<span class="string">200px</span>';
+
+<span class="comment">// the following sets a style for the page body (black text on yellow page)
+// and makes all paragraphs be bold by default
+</span>config.pageStyle =
+  '<span class="string">body { background-color: yellow; color: black; font-family: verdana,sans-serif } </span>' +
+  '<span class="string">p { font-width: bold; } </span>';
+
+<span class="comment">// the following replaces the textarea with the given id with a new
+// HTMLArea object having the specified configuration
+</span>HTMLArea.replace('<span class="string">id</span>', config);</pre>
+
+<p><span class="warning">Important:</span> It's recommended that you add
+custom features and configuration to a separate file.  This will ensure you
+that when we release a new official version of HTMLArea you'll have less
+trouble upgrading it.</p>
+
+<h3>How do I customize the toolbar?</h3>
+
+<p>Using the configuration object introduced above allows you to completely
+control what the toolbar contains.  Following is an example of a one-line,
+customized toolbar, much simpler than the default one:</p>
+
+<pre class="code"
+><span class="keyword">var</span> <span class="variable-name">config</span> = <span class="keyword">new</span> HTMLArea.Config();
+config.toolbar = [
+  ['<span class="string">fontname</span>', '<span class="string">space</span>',
+   '<span class="string">fontsize</span>', '<span class="string">space</span>',
+   '<span class="string">formatblock</span>', '<span class="string">space</span>',
+   '<span class="string">bold</span>', '<span class="string">italic</span>', '<span class="string">underline</span>']
+];
+HTMLArea.replace('<span class="string">id</span>', config);</pre>
+
+<p>The toolbar is an Array of Array objects.  Each array in the toolbar
+defines a new line.  The default toolbar looks like this:</p>
+
+<pre class="code"
+>config.toolbar = [
+[ &quot;<span class="string">fontname</span>&quot;, &quot;<span class="string">space</span>&quot;,
+  &quot;<span class="string">fontsize</span>&quot;, &quot;<span class="string">space</span>&quot;,
+  &quot;<span class="string">formatblock</span>&quot;, &quot;<span class="string">space</span>&quot;,
+  &quot;<span class="string">bold</span>&quot;, &quot;<span class="string">italic</span>&quot;, &quot;<span class="string">underline</span>&quot;, &quot;<span class="string">separator</span>&quot;,
+  &quot;<span class="string">strikethrough</span>&quot;, &quot;<span class="string">subscript</span>&quot;, &quot;<span class="string">superscript</span>&quot;, &quot;<span class="string">separator</span>&quot;,
+  &quot;<span class="string">copy</span>&quot;, &quot;<span class="string">cut</span>&quot;, &quot;<span class="string">paste</span>&quot;, &quot;<span class="string">space</span>&quot;, &quot;<span class="string">undo</span>&quot;, &quot;<span class="string">redo</span>&quot; ],
+		
+[ &quot;<span class="string">justifyleft</span>&quot;, &quot;<span class="string">justifycenter</span>&quot;, &quot;<span class="string">justifyright</span>&quot;, &quot;<span class="string">justifyfull</span>&quot;, &quot;<span class="string">separator</span>&quot;,
+  &quot;<span class="string">insertorderedlist</span>&quot;, &quot;<span class="string">insertunorderedlist</span>&quot;, &quot;<span class="string">outdent</span>&quot;, &quot;<span class="string">indent</span>&quot;, &quot;<span class="string">separator</span>&quot;,
+  &quot;<span class="string">forecolor</span>&quot;, &quot;<span class="string">hilitecolor</span>&quot;, &quot;<span class="string">textindicator</span>&quot;, &quot;<span class="string">separator</span>&quot;,
+  &quot;<span class="string">inserthorizontalrule</span>&quot;, &quot;<span class="string">createlink</span>&quot;, &quot;<span class="string">insertimage</span>&quot;, &quot;<span class="string">inserttable</span>&quot;, &quot;<span class="string">htmlmode</span>&quot;, &quot;<span class="string">separator</span>&quot;,
+  &quot;<span class="string">popupeditor</span>&quot;, &quot;<span class="string">separator</span>&quot;, &quot;<span class="string">showhelp</span>&quot;, &quot;<span class="string">about</span>&quot; ]
+];</pre>
+
+<p>Except three strings, all others in the examples above need to be defined
+in the <code>config.btnList</code> object (detailed a bit later in this
+document).  The three exceptions are: 'space', 'separator' and 'linebreak'.
+These three have the following meaning, and need not be present in
+<code>btnList</code>:</p>
+
+<ul>
+  <li>'space' -- Inserts a space of 5 pixels (the width is configurable by external
+  <acronym title="Cascading Style Sheets">CSS</acronym>) at the current
+  position in the toolbar.</li>
+  <li>'separator' -- Inserts a small vertical separator, for visually grouping related
+  buttons.</li>
+  <li>'linebreak' -- Starts a new line in the toolbar.  Subsequent controls will be
+  inserted on the new line.</li>
+</ul>
+
+<p><span class="warning">Important:</span> It's recommended that you add
+custom features and configuration to a separate file.  This will ensure you
+that when we release a new official version of HTMLArea you'll have less
+trouble upgrading it.</p>
+
+<h3>How do I create custom buttons?</h3>
+
+<p>By design, the toolbar is easily extensible.  For adding a custom button
+one needs to follow two steps.</p>
+
+<h4 id="regbtn">1. Register the button in <code>config.btnList</code>.</h4>
+
+<p>For each button in the toolbar, HTMLArea needs to know the following
+information:</p>
+<ul>
+  <li>a name for it (we call it the ID of the button);</li>
+  <li>the path to an image to be displayed in the toolbar;</li>
+  <li>a tooltip for it;</li>
+  <li>whether the button is enabled or not in text mode;</li>
+  <li>what to do when the button is clicked;</li>
+</ul>
+<p>You need to provide all this information for registering a new button
+too.  The button ID can be any string identifier and it's used when
+defining the toolbar, as you saw above.  We recommend starting
+it with "my-" so that it won't clash with the standard ID-s (those from
+the default toolbar).</p>
+
+<p class="note">Register button example #1</p>
+
+<pre class="code"
+><span class="comment">// get a default configuration
+</span><span class="keyword">var</span> <span class="variable-name">config</span> = <span class="keyword">new</span> HTMLArea.Config();
+<span class="comment">// register the new button using Config.registerButton.
+// parameters:        button ID,   tooltip,          image,           textMode,
+</span>config.registerButton(&quot;<span class="string">my-hilite</span>&quot;, &quot;<span class="string">Highlight text</span>&quot;, &quot;<span class="string">my-hilite.gif</span>&quot;, <span class="keyword">false</span>,
+<span class="comment">// function that gets called when the button is clicked
+</span>  <span class="keyword">function</span>(editor, id) {
+    editor.surroundHTML('<span class="string">&lt;span class=&quot;hilite&quot;&gt;</span>', '<span class="string">&lt;/span&gt;</span>');
+  }
+);</pre>
+
+<p>An alternate way of calling registerButton is exemplified above.  Though
+the code might be a little bit larger, using this form makes your code more
+maintainable.  It doesn't even needs comments as it's pretty clear.</p>
+
+<p class="note">Register button example #2</p>
+
+<pre class="code"
+><span class="keyword">var</span> <span class="variable-name">config</span> = <span class="keyword">new</span> HTMLArea.Config();
+config.registerButton({
+  id        : &quot;<span class="string">my-hilite</span>&quot;,
+  tooltip   : &quot;<span class="string">Highlight text</span>&quot;,
+  image     : &quot;<span class="string">my-hilite.gif</span>&quot;,
+  textMode  : <span class="keyword">false</span>,
+  action    : <span class="keyword">function</span>(editor, id) {
+                editor.surroundHTML('<span class="string">&lt;span class=&quot;hilite&quot;&gt;</span>', '<span class="string">&lt;/span&gt;</span>');
+              }
+});</pre>
+
+<p>You might notice that the "action" function receives two parameters:
+<b>editor</b> and <b>id</b>.  In the examples above we only used the
+<b>editor</b> parameter.  But it could be helpful for you to understand
+both:</p>
+
+<ul>
+  <li><b>editor</b> is a reference to the HTMLArea object.  Since our entire
+  code now has an <acronym title="Object Oriented Programming">OOP</acronym>-like
+  design, you need to have a reference to
+  the editor object in order to do things with it.  In previous versions of
+  HTMLArea, in order to identify the object an ID was used -- the ID of the
+  HTML element.  In this version ID-s are no longer necessary.</li>
+
+  <li><b>id</b> is the button ID.  Wondering why is this useful?  Well, you
+  could use the same handler function (presuming that it's not an anonymous
+  function like in the examples above) for more buttons.  You can <a
+  href="#btnex">see an example</a> a bit later in this document.</li>
+</ul>
+
+<h4>2. Inserting it into the toolbar</h4>
+
+<p>At this step you need to specify where in the toolbar to insert the
+button, or just create the whole toolbar again as you saw in the previous
+section.  You use the button ID, as shown in the examples of customizing the
+toolbar in the previous section.</p>
+
+<p>For the sake of completion, following there are another examples.</p>
+
+<p class="note">Append your button to the default toolbar</p>
+
+<pre class="code"
+>config.toolbar.push([ &quot;<span class="string">my-hilite</span>&quot; ]);</pre>
+
+<p class="note">Customized toolbar</p>
+
+<pre class="code"
+>config.toolbar = [
+  ['<span class="string">fontname</span>', '<span class="string">space</span>',
+   '<span class="string">fontsize</span>', '<span class="string">space</span>',
+   '<span class="string">formatblock</span>', '<span class="string">space</span>',
+   '<span class="string">separator</span>', '<span class="string">my-hilite</span>', '<span class="string">separator</span>', '<span class="string">space</span>', <span class="comment">// here's your button
+</span>   '<span class="string">bold</span>', '<span class="string">italic</span>', '<span class="string">underline</span>', '<span class="string">space</span>']
+];</pre>
+
+<p><span class="note">Note:</span> in the example above our new button is
+between two vertical separators.  But this is by no means required.  You can
+put it wherever you like.  Once registered in the btnList (<a
+href="#regbtn">step 1</a>) your custom button behaves just like a default
+button.</p>
+
+<p><span class="warning">Important:</span> It's recommended that you add
+custom features and configuration to a separate file.  This will ensure you
+that when we release a new official version of HTMLArea you'll have less
+trouble upgrading it.</p>
+
+<h4 id="btnex">A complete example</h4>
+
+<p>Please note that it is by no means necessary to include the following
+code into the htmlarea.js file.  On the contrary, it might not work there.
+The configuration system is designed such that you can always customize the
+editor <em>from outside files</em>, thus keeping the htmlarea.js file
+intact.  This will make it easy for you to upgrade your HTMLArea when we
+release a new official version.  OK, I promise it's the last time I said
+this. ;)</p>
+
+<pre class="code"
+><span class="comment">// All our custom buttons will call this function when clicked.
+// We use the <b>buttonId</b> parameter to determine what button
+// triggered the call.
+</span><span class="keyword">function</span> <span class="function-name">clickHandler</span>(editor, buttonId) {
+  <span class="keyword">switch</span> (buttonId) {
+    <span class="keyword">case</span> &quot;<span class="string">my-toc</span>&quot;:
+      editor.insertHTML(&quot;<span class="string">&lt;h1&gt;Table Of Contents&lt;/h1&gt;</span>&quot;);
+      <span class="keyword">break</span>;
+    <span class="keyword">case</span> &quot;<span class="string">my-date</span>&quot;:
+      editor.insertHTML((<span class="keyword">new</span> Date()).toString());
+      <span class="keyword">break</span>;
+    <span class="keyword">case</span> &quot;<span class="string">my-bold</span>&quot;:
+      editor.execCommand(&quot;<span class="string">bold</span>&quot;);
+      editor.execCommand(&quot;<span class="string">italic</span>&quot;);
+      <span class="keyword">break</span>;
+    <span class="keyword">case</span> &quot;<span class="string">my-hilite</span>&quot;:
+      editor.surroundHTML(&quot;<span class="string">&lt;span class=\&quot;hilite\&quot;&gt;</span>&quot;, &quot;<span class="string">&lt;/span&gt;</span>&quot;);
+      <span class="keyword">break</span>;
+  }
+};
+
+<span class="comment">// Create a new configuration object
+</span><span class="keyword">var</span> <span class="variable-name">config</span> = <span class="keyword">new</span> HTMLArea.Config();
+
+<span class="comment">// Register our custom buttons
+</span>config.registerButton(&quot;<span class="string">my-toc</span>&quot;,  &quot;<span class="string">Insert TOC</span>&quot;, &quot;<span class="string">my-toc.gif</span>&quot;, <span class="keyword">false</span>, clickHandler);
+config.registerButton(&quot;<span class="string">my-date</span>&quot;, &quot;<span class="string">Insert date/time</span>&quot;, &quot;<span class="string">my-date.gif</span>&quot;, <span class="keyword">false</span>, clickHandler);
+config.registerButton(&quot;<span class="string">my-bold</span>&quot;, &quot;<span class="string">Toggle bold/italic</span>&quot;, &quot;<span class="string">my-bold.gif</span>&quot;, <span class="keyword">false</span>, clickHandler);
+config.registerButton(&quot;<span class="string">my-hilite</span>&quot;, &quot;<span class="string">Hilite selection</span>&quot;, &quot;<span class="string">my-hilite.gif</span>&quot;, <span class="keyword">false</span>, clickHandler);
+
+<span class="comment">// Append the buttons to the default toolbar
+</span>config.toolbar.push([&quot;<span class="string">linebreak</span>&quot;, &quot;<span class="string">my-toc</span>&quot;, &quot;<span class="string">my-date</span>&quot;, &quot;<span class="string">my-bold</span>&quot;, &quot;<span class="string">my-hilite</span>&quot;]);
+
+<span class="comment">// Replace an existing textarea with an HTMLArea object having the above config.
+</span>HTMLArea.replace(&quot;<span class="string">textAreaID</span>&quot;, config);</pre>
+
+
+<hr />
+<address>&copy; <a href="http://interactivetools.com" title="Visit our website"
+>InteractiveTools.com</a> 2002-2004.
+<br />
+© <a href="http://dynarch.com">dynarch.com</a> 2003-2004<br />
+HTMLArea v3.0 developed by <a
+href="http://dynarch.com/mishoo/">Mihai Bazon</a>.
+<br />
+Documentation written by Mihai Bazon.
+</address>
+<!-- hhmts start --> Last modified: Wed Jan 28 12:18:23 EET 2004 <!-- hhmts end -->
+<!-- doc-lang: English -->
+</body> </html>
Index: temp/trunk/html/test/naka/HTMLArea/popups/fullscreen.html
===================================================================
--- temp/trunk/html/test/naka/HTMLArea/popups/fullscreen.html	(revision 1694)
+++ temp/trunk/html/test/naka/HTMLArea/popups/fullscreen.html	(revision 1694)
@@ -0,0 +1,133 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html>
+  <head>
+    <title>Fullscreen HTMLArea</title>
+    <script type="text/javascript">
+      _editor_url = window.opener._editor_url;
+      _editor_lang = window.opener._editor_lang;
+      var BASE = window.opener.document.baseURI || window.opener.document.URL;
+      var head = document.getElementsByTagName("head")[0];
+      var base = document.createElement("base");
+      base.href = BASE;
+      head.appendChild(base);
+    </script>
+
+    <script type="text/javascript" src="../htmlarea.js"></script>
+
+    <script type="text/javascript">
+	// load HTMLArea scripts that are present in the opener frame
+	var scripts = window.opener.HTMLArea._scripts;
+	for (var i = 4; i < scripts.length; ++i) {
+           document.write("<scr" + "ipt type='text/javascript' src='" + scripts[i] + "'></scr" + "ipt>");
+        }
+    </script>
+
+    <!-- browser takes a coffee break here -->
+    <script type="text/javascript">
+var parent_object  = null;
+var editor	   = null;	// to be initialized later [ function init() ]
+
+/* ---------------------------------------------------------------------- *\
+   Function    : 
+   Description : 
+\* ---------------------------------------------------------------------- */
+
+function _CloseOnEsc(ev) {
+	ev || (ev = window.event);
+	if (ev.keyCode == 27) {
+		// update_parent();
+		window.close();
+		return;
+	}
+}
+
+/* ---------------------------------------------------------------------- *\
+   Function    : resize_editor
+   Description : resize the editor when the user resizes the popup
+\* ---------------------------------------------------------------------- */
+
+function resize_editor() {  // resize editor to fix window
+	var newHeight;
+	if (document.all) {
+		// IE
+		newHeight = document.body.offsetHeight - editor._toolbar.offsetHeight;
+		if (newHeight < 0) { newHeight = 0; }
+	} else {
+		// Gecko
+		newHeight = window.innerHeight - editor._toolbar.offsetHeight;
+	}
+	if (editor.config.statusBar) {
+		newHeight -= editor._statusBar.offsetHeight;
+	}
+	editor._textArea.style.height = editor._iframe.style.height = newHeight + "px";
+}
+
+/* ---------------------------------------------------------------------- *\
+   Function    : init
+   Description : run this code on page load
+\* ---------------------------------------------------------------------- */
+
+function init() {
+	parent_object	   = opener.HTMLArea._object;
+	var config	   = HTMLArea.cloneObject( parent_object.config );
+	config.width	   = "100%";
+	config.height	   = "auto";
+
+	// change maximize button to minimize button
+	config.btnList["popupeditor"] = [ 'Minimize Editor', _editor_url + 'images/fullscreen_minimize.gif', true,
+					  function() { window.close(); } ];
+
+	// generate editor and resize it
+	editor = new HTMLArea("editor", config);
+
+	// register the plugins, if any
+	for (var i in parent_object.plugins) {
+		var plugin = parent_object.plugins[i];
+		editor.registerPlugin2(plugin.name, plugin.args);
+	}
+	// and restore the original toolbar
+        config.toolbar = parent_object.config.toolbar;
+	editor.generate();
+	editor._iframe.style.width = "100%";
+	editor._textArea.style.width = "100%";
+	resize_editor();
+
+	editor.doctype = parent_object.doctype;
+
+	// set child window contents and event handlers, after a small delay
+	setTimeout(function() {
+			   editor.setHTML(parent_object.getInnerHTML());
+
+			   // switch mode if needed
+			   if (parent_object._mode == "textmode") { editor.setMode("textmode"); }
+
+			   // continuously update parent editor window
+			   setInterval(update_parent, 500);
+
+			   // setup event handlers
+			   document.body.onkeypress = _CloseOnEsc;
+			   editor._doc.body.onkeypress = _CloseOnEsc;
+			   editor._textArea.onkeypress = _CloseOnEsc;
+			   window.onresize = resize_editor;
+		   }, 333);			 // give it some time to meet the new frame
+}
+
+/* ---------------------------------------------------------------------- *\
+   Function    : update_parent
+   Description : update parent window editor field with contents from child window
+   \* ---------------------------------------------------------------------- */
+
+function update_parent() {
+	// use the fast version
+	parent_object.setHTML(editor.getInnerHTML());
+}
+
+    </script>
+    <style type="text/css"> html, body { height: 100%; margin: 0px; border: 0px; background-color: buttonface; } </style>
+  </head>
+  <body scroll="no" onload="setTimeout(function(){init();}, 500)" onunload="update_parent()">
+    <form style="margin: 0px; border: 1px solid; border-color: threedshadow threedhighlight threedhighlight threedshadow;">
+      <textarea name="editor" id="editor" style="width:100%; height:300px">&nbsp;</textarea>
+    </form>
+  </body>
+</html>
Index: temp/trunk/html/test/naka/HTMLArea/popups/old_insert_image.html
===================================================================
--- temp/trunk/html/test/naka/HTMLArea/popups/old_insert_image.html	(revision 1694)
+++ temp/trunk/html/test/naka/HTMLArea/popups/old_insert_image.html	(revision 1694)
@@ -0,0 +1,206 @@
+<!-- based on insimage.dlg -->
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD W3 HTML 3.2//EN">
+<HTML  id=dlgImage STYLE="width: 432px; height: 194px; ">
+<HEAD>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+<meta http-equiv="MSThemeCompatible" content="Yes">
+<TITLE>Insert Image</TITLE>
+<style>
+  html, body, button, div, input, select, fieldset { font-family: MS Shell Dlg; font-size: 8pt; position: absolute; };
+</style>
+<SCRIPT defer>
+
+function _CloseOnEsc() {
+  if (event.keyCode == 27) { window.close(); return; }
+}
+
+function _getTextRange(elm) {
+  var r = elm.parentTextEdit.createTextRange();
+  r.moveToElementText(elm);
+  return r;
+}
+
+window.onerror = HandleError
+
+function HandleError(message, url, line) {
+  var str = "An error has occurred in this dialog." + "\n\n"
+  + "Error: " + line + "\n" + message;
+  alert(str);
+  window.close();
+  return true;
+}
+
+function Init() {
+  var elmSelectedImage;
+  var htmlSelectionControl = "Control";
+  var globalDoc = window.dialogArguments;
+  var grngMaster = globalDoc.selection.createRange();
+  
+  // event handlers  
+  document.body.onkeypress = _CloseOnEsc;
+  btnOK.onclick = new Function("btnOKClick()");
+
+  txtFileName.fImageLoaded = false;
+  txtFileName.intImageWidth = 0;
+  txtFileName.intImageHeight = 0;
+
+  if (globalDoc.selection.type == htmlSelectionControl) {
+    if (grngMaster.length == 1) {
+      elmSelectedImage = grngMaster.item(0);
+      if (elmSelectedImage.tagName == "IMG") {
+        txtFileName.fImageLoaded = true;
+        if (elmSelectedImage.src) {
+          txtFileName.value          = elmSelectedImage.src.replace(/^[^*]*(\*\*\*)/, "$1");  // fix placeholder src values that editor converted to abs paths
+          txtFileName.intImageHeight = elmSelectedImage.height;
+          txtFileName.intImageWidth  = elmSelectedImage.width;
+          txtVertical.value          = elmSelectedImage.vspace;
+          txtHorizontal.value        = elmSelectedImage.hspace;
+          txtBorder.value            = elmSelectedImage.border;
+          txtAltText.value           = elmSelectedImage.alt;
+          selAlignment.value         = elmSelectedImage.align;
+        }
+      }
+    }
+  }
+  txtFileName.value = txtFileName.value || "http://";
+  txtFileName.focus();
+}
+
+function _isValidNumber(txtBox) {
+  var val = parseInt(txtBox);
+  if (isNaN(val) || val < 0 || val > 999) { return false; }
+  return true;
+}
+
+function btnOKClick() {
+  var elmImage;
+  var intAlignment;
+  var htmlSelectionControl = "Control";
+  var globalDoc = window.dialogArguments;
+  var grngMaster = globalDoc.selection.createRange();
+  
+  // error checking
+
+  if (!txtFileName.value || txtFileName.value == "http://") { 
+    alert("Image URL must be specified.");
+    txtFileName.focus();
+    return;
+  }
+  if (txtHorizontal.value && !_isValidNumber(txtHorizontal.value)) {
+    alert("Horizontal spacing must be a number between 0 and 999.");
+    txtHorizontal.focus();
+    return;
+  }
+  if (txtBorder.value && !_isValidNumber(txtBorder.value)) {
+    alert("Border thickness must be a number between 0 and 999.");
+    txtBorder.focus();
+    return;
+  }
+  if (txtVertical.value && !_isValidNumber(txtVertical.value)) {
+    alert("Vertical spacing must be a number between 0 and 999.");
+    txtVertical.focus();
+    return;
+  }
+
+  // delete selected content and replace with image
+  if (globalDoc.selection.type == htmlSelectionControl && !txtFileName.fImageLoaded) {
+    grngMaster.execCommand('Delete');
+    grngMaster = globalDoc.selection.createRange();
+  }
+    
+  idstr = "\" id=\"556e697175657e537472696e67";     // new image creation ID
+  if (!txtFileName.fImageLoaded) {
+    grngMaster.execCommand("InsertImage", false, idstr);
+    elmImage = globalDoc.all['556e697175657e537472696e67'];
+    elmImage.removeAttribute("id");
+    elmImage.removeAttribute("src");
+    grngMaster.moveStart("character", -1);
+  } else {
+    elmImage = grngMaster.item(0);
+    if (elmImage.src != txtFileName.value) {
+      grngMaster.execCommand('Delete');
+      grngMaster = globalDoc.selection.createRange();
+      grngMaster.execCommand("InsertImage", false, idstr);
+      elmImage = globalDoc.all['556e697175657e537472696e67'];
+      elmImage.removeAttribute("id");
+      elmImage.removeAttribute("src");
+      grngMaster.moveStart("character", -1);
+      txtFileName.fImageLoaded = false;
+    }
+    grngMaster = _getTextRange(elmImage);
+  }
+
+  if (txtFileName.fImageLoaded) {
+    elmImage.style.width = txtFileName.intImageWidth;
+    elmImage.style.height = txtFileName.intImageHeight;
+  }
+
+  if (txtFileName.value.length > 2040) {
+    txtFileName.value = txtFileName.value.substring(0,2040);
+  }
+  
+  elmImage.src = txtFileName.value;
+  
+  if (txtHorizontal.value != "") { elmImage.hspace = parseInt(txtHorizontal.value); }
+  else                           { elmImage.hspace = 0; }
+
+  if (txtVertical.value != "") { elmImage.vspace = parseInt(txtVertical.value); }
+  else                         { elmImage.vspace = 0; }
+  
+  elmImage.alt = txtAltText.value;
+
+  if (txtBorder.value != "") { elmImage.border = parseInt(txtBorder.value); }
+  else                       { elmImage.border = 0; }
+
+  elmImage.align = selAlignment.value;
+  grngMaster.collapse(false);
+  grngMaster.select();
+  window.close();
+}
+</SCRIPT>
+</HEAD>
+<BODY id=bdy onload="Init()" style="background: threedface; color: windowtext;" scroll=no>
+
+<DIV id=divFileName style="left: 0.98em; top: 1.2168em; width: 7em; height: 1.2168em; ">Image URL:</DIV>
+<INPUT ID=txtFileName type=text style="left: 8.54em; top: 1.0647em; width: 21.5em;height: 2.1294em; " tabIndex=10 onfocus="select()">
+
+<DIV id=divAltText style="left: 0.98em; top: 4.1067em; width: 6.58em; height: 1.2168em; ">Alternate Text:</DIV>
+<INPUT type=text ID=txtAltText tabIndex=15 style="left: 8.54em; top: 3.8025em; width: 21.5em; height: 2.1294em; " onfocus="select()">
+
+<FIELDSET id=fldLayout style="left: .9em; top: 7.1em; width: 17.08em; height: 7.6em;">
+<LEGEND id=lgdLayout>Layout</LEGEND>
+</FIELDSET>
+
+<FIELDSET id=fldSpacing style="left: 18.9em; top: 7.1em; width: 11em; height: 7.6em;">
+<LEGEND id=lgdSpacing>Spacing</LEGEND>
+</FIELDSET>
+
+<DIV id=divAlign style="left: 1.82em; top: 9.126em; width: 4.76em; height: 1.2168em; ">Alignment:</DIV>
+<SELECT size=1 ID=selAlignment tabIndex=20 style="left: 10.36em; top: 8.8218em; width: 6.72em; height: 1.2168em; ">
+<OPTION id=optNotSet value=""> Not set </OPTION>
+<OPTION id=optLeft value=left> Left </OPTION>
+<OPTION id=optRight value=right> Right </OPTION>
+<OPTION id=optTexttop value=textTop> Texttop </OPTION>
+<OPTION id=optAbsMiddle value=absMiddle> Absmiddle </OPTION>
+<OPTION id=optBaseline value=baseline SELECTED> Baseline </OPTION>
+<OPTION id=optAbsBottom value=absBottom> Absbottom </OPTION>
+<OPTION id=optBottom value=bottom> Bottom </OPTION>
+<OPTION id=optMiddle value=middle> Middle </OPTION>
+<OPTION id=optTop value=top> Top </OPTION>
+</SELECT>
+
+<DIV id=divHoriz style="left: 19.88em; top: 9.126em; width: 4.76em; height: 1.2168em; ">Horizontal:</DIV>
+<INPUT ID=txtHorizontal style="left: 24.92em; top: 8.8218em; width: 4.2em; height: 2.1294em; ime-mode: disabled;" type=text size=3 maxlength=3 value="" tabIndex=25 onfocus="select()">
+
+<DIV id=divBorder style="left: 1.82em; top: 12.0159em; width: 8.12em; height: 1.2168em; ">Border Thickness:</DIV>
+<INPUT ID=txtBorder style="left: 10.36em; top: 11.5596em; width: 6.72em; height: 2.1294em; ime-mode: disabled;" type=text size=3 maxlength=3 value="" tabIndex=21 onfocus="select()">
+
+<DIV id=divVert style="left: 19.88em; top: 12.0159em; width: 3.64em; height: 1.2168em; ">Vertical:</DIV>
+<INPUT ID=txtVertical style="left: 24.92em; top: 11.5596em; width: 4.2em; height: 2.1294em; ime-mode: disabled;" type=text size=3 maxlength=3 value="" tabIndex=30 onfocus="select()">
+
+<BUTTON ID=btnOK style="left: 31.36em; top: 1.0647em; width: 7em; height: 2.2em; " type=submit tabIndex=40>OK</BUTTON>
+<BUTTON ID=btnCancel style="left: 31.36em; top: 3.6504em; width: 7em; height: 2.2em; " type=reset tabIndex=45 onClick="window.close();">Cancel</BUTTON>
+
+</BODY>
+</HTML>
Index: temp/trunk/html/test/naka/HTMLArea/popups/insert_image.html
===================================================================
--- temp/trunk/html/test/naka/HTMLArea/popups/insert_image.html	(revision 1694)
+++ temp/trunk/html/test/naka/HTMLArea/popups/insert_image.html	(revision 1694)
@@ -0,0 +1,191 @@
+<html>
+
+<head>
+  <title>Insert Image</title>
+
+<script type="text/javascript" src="popup.js"></script>
+
+<script type="text/javascript">
+
+window.resizeTo(400, 100);
+
+function Init() {
+  __dlg_init();
+  var param = window.dialogArguments;
+  if (param) {
+      document.getElementById("f_url").value = param["f_url"];
+      document.getElementById("f_alt").value = param["f_alt"];
+      document.getElementById("f_border").value = param["f_border"];
+      document.getElementById("f_align").value = param["f_align"];
+      document.getElementById("f_vert").value = param["f_vert"];
+      document.getElementById("f_horiz").value = param["f_horiz"];
+      window.ipreview.location.replace(param.f_url);
+  }
+  document.getElementById("f_url").focus();
+};
+
+function onOK() {
+  var required = {
+    "f_url": "You must enter the URL"
+  };
+  for (var i in required) {
+    var el = document.getElementById(i);
+    if (!el.value) {
+      alert(required[i]);
+      el.focus();
+      return false;
+    }
+  }
+  // pass data back to the calling window
+  var fields = ["f_url", "f_alt", "f_align", "f_border",
+                "f_horiz", "f_vert"];
+  var param = new Object();
+  for (var i in fields) {
+    var id = fields[i];
+    var el = document.getElementById(id);
+    param[id] = el.value;
+  }
+  __dlg_close(param);
+  return false;
+};
+
+function onCancel() {
+  __dlg_close(null);
+  return false;
+};
+
+function onPreview() {
+  var f_url = document.getElementById("f_url");
+  var url = f_url.value;
+  if (!url) {
+    alert("You have to enter an URL first");
+    f_url.focus();
+    return false;
+  }
+  window.ipreview.location.replace(url);
+  return false;
+};
+</script>
+
+<style type="text/css">
+html, body {
+  background: ButtonFace;
+  color: ButtonText;
+  font: 11px Tahoma,Verdana,sans-serif;
+  margin: 0px;
+  padding: 0px;
+}
+body { padding: 5px; }
+table {
+  font: 11px Tahoma,Verdana,sans-serif;
+}
+form p {
+  margin-top: 5px;
+  margin-bottom: 5px;
+}
+.fl { width: 9em; float: left; padding: 2px 5px; text-align: right; }
+.fr { width: 6em; float: left; padding: 2px 5px; text-align: right; }
+fieldset { padding: 0px 10px 5px 5px; }
+select, input, button { font: 11px Tahoma,Verdana,sans-serif; }
+button { width: 70px; }
+.space { padding: 2px; }
+
+.title { background: #ddf; color: #000; font-weight: bold; font-size: 120%; padding: 3px 10px; margin-bottom: 10px;
+border-bottom: 1px solid black; letter-spacing: 2px;
+}
+form { padding: 0px; margin: 0px; }
+</style>
+
+</head>
+
+<body onload="Init()">
+
+<div class="title">Insert Image</div>
+<!--- new stuff --->
+<form action="" method="get">
+<table border="0" width="100%" style="padding: 0px; margin: 0px">
+  <tbody>
+
+  <tr>
+    <td style="width: 7em; text-align: right">Image URL:</td>
+    <td><input type="text" name="url" id="f_url" style="width:75%"
+      title="Enter the image URL here" />
+      <button name="preview" onclick="return onPreview();"
+      title="Preview the image in a new window">Preview</button>
+    </td>
+  </tr>
+  <tr>
+    <td style="width: 7em; text-align: right">Alternate text:</td>
+    <td><input type="text" name="alt" id="f_alt" style="width:100%"
+      title="For browsers that don't support images" /></td>
+  </tr>
+
+  </tbody>
+</table>
+
+<p />
+
+<fieldset style="float: left; margin-left: 5px;">
+<legend>Layout</legend>
+
+<div class="space"></div>
+
+<div class="fl">Alignment:</div>
+<select size="1" name="align" id="f_align"
+  title="Positioning of this image">
+  <option value=""                             >Not set</option>
+  <option value="left"                         >Left</option>
+  <option value="right"                        >Right</option>
+  <option value="texttop"                      >Texttop</option>
+  <option value="absmiddle"                    >Absmiddle</option>
+  <option value="baseline" selected="1"        >Baseline</option>
+  <option value="absbottom"                    >Absbottom</option>
+  <option value="bottom"                       >Bottom</option>
+  <option value="middle"                       >Middle</option>
+  <option value="top"                          >Top</option>
+</select>
+
+<p />
+
+<div class="fl">Border thickness:</div>
+<input type="text" name="border" id="f_border" size="5"
+title="Leave empty for no border" />
+
+<div class="space"></div>
+
+</fieldset>
+
+<fieldset style="float:right; margin-right: 5px;">
+<legend>Spacing</legend>
+
+<div class="space"></div>
+
+<div class="fr">Horizontal:</div>
+<input type="text" name="horiz" id="f_horiz" size="5"
+title="Horizontal padding" />
+
+<p />
+
+<div class="fr">Vertical:</div>
+<input type="text" name="vert" id="f_vert" size="5"
+title="Vertical padding" />
+
+<div class="space"></div>
+
+</fieldset>
+<br clear="all" />
+<table width="100%" style="margin-bottom: 0.2em">
+ <tr>
+  <td valign="bottom">
+    Image Preview:<br />
+    <iframe name="ipreview" id="ipreview" frameborder="0" style="border : 1px solid gray;" height="200" width="300" src=""></iframe>
+  </td>
+  <td valign="bottom" style="text-align: right">
+    <button type="button" name="ok" onclick="return onOK();">OK</button><br>
+    <button type="button" name="cancel" onclick="return onCancel();">Cancel</button>
+  </td>
+ </tr>
+</table>
+</form>
+</body>
+</html>
Index: temp/trunk/html/test/naka/HTMLArea/popups/blank.html
===================================================================
--- temp/trunk/html/test/naka/HTMLArea/popups/blank.html	(revision 1694)
+++ temp/trunk/html/test/naka/HTMLArea/popups/blank.html	(revision 1694)
@@ -0,0 +1,2 @@
+<html>
+</html>
Index: temp/trunk/html/test/naka/HTMLArea/popups/about.html
===================================================================
--- temp/trunk/html/test/naka/HTMLArea/popups/about.html	(revision 1694)
+++ temp/trunk/html/test/naka/HTMLArea/popups/about.html	(revision 1694)
@@ -0,0 +1,378 @@
+<!--
+
+(c) dynarch.com, 2003-2004
+Author: Mihai Bazon, http://dynarch.com/mishoo
+Distributed as part of HTMLArea 3.0
+
+"You are not expected to understand this...  I don't neither."
+
+                      (from The Linux Kernel Source Code,
+                            ./arch/x86_64/ia32/ptrace.c:90)
+
+;-)
+
+-->
+
+<html style="height: 100%">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<title>About HTMLArea</title>
+<script type="text/javascript" src="popup.js"></script>
+<script type="text/javascript">
+window.resizeTo(450, 250);
+var TABS = [];
+var CURRENT_TAB = 0;
+var CONTENT_HEIGHT_DIFF = 0;
+var CONTENT_WIDTH_DIFF = 0;
+function selectTab(idx) {
+  var ct = TABS[CURRENT_TAB];
+  ct.className = ct.className.replace(/\s*tab-current\s*/, ' ');
+  ct = TABS[CURRENT_TAB = idx];
+  ct.className += ' tab-current';
+  for (var i = TABS.length; --i >= 0;) {
+    var area = document.getElementById("tab-area-" + i);
+    if (CURRENT_TAB == i) {
+      area.style.display = "block";
+    } else {
+      area.style.display = "none";
+    }
+  }
+  document.body.style.visibility = "hidden";
+  document.body.style.visibility = "visible";
+  document.cookie = "HTMLAREA-ABOUT-TAB=" + idx;
+}
+var editor = null;
+function initDocument() {
+  editor = window.dialogArguments;
+  HTMLArea = window.opener.HTMLArea;
+
+  var plugins = document.getElementById("plugins");
+  var j = 0;
+  var html = "<table width='99%' cellpadding='0' style='margin-top: 1em; collapse-borders: collapse; border: 1px solid #8b8;'>" +
+	  "<thead><tr>" +
+	  "<td>Name</td>" +
+	  "<td>Developer</td>" +
+	  "<td>Sponsored by</td>" +
+	  "<td>License<sup>*</sup></td>" +
+	  "</tr></thead><tbody>";
+  for (var i in editor.plugins) {
+    var info = editor.plugins[i];
+    html += "<tr><td>" + info.name + " v" + info.version + "</td>" + 
+            "<td><a href='" + info.developer_url + "' target='_blank' title='Visit developer website'>" +
+	    info.developer + "</a></td>" +
+	    "<td><a href='" + info.sponsor_url + "' target='_blank' title='Visit sponsor website'>" +
+	    info.sponsor + "</a></td>" +
+	    "<td>" + info.license + "</td></tr>";
+    ++j;
+  }
+
+  if (j) {
+          html += "</tbody></table>" +
+		  "<p><sup>*</sup> License \"htmlArea\" means that the plugin is distributed under the same terms " +
+		  "as HTMLArea itself.  Such plugins are likely to be those included in the official " +
+		  "HTMLArea distribution</p>";
+	  plugins.innerHTML = "<p>The following plugins have been loaded.</p>" + html;
+  } else {
+	  plugins.innerHTML = "<p>No plugins have been loaded</p>";
+  }
+
+  plugins.innerHTML += "<p>User agent reports:<br/>" + navigator.userAgent + "</p>";
+
+  var content = document.getElementById("content");
+  if (window.innerHeight) {
+    CONTENT_HEIGHT_DIFF = window.innerHeight - 250;
+    CONTENT_WIDTH_DIFF = window.innerWidth - content.offsetWidth;
+  } else {
+    CONTENT_HEIGHT_DIFF = document.body.offsetHeight - 250;
+    CONTENT_WIDTH_DIFF = document.body.offsetWidth - 400;
+  }
+  window.onresize();
+  var bar = document.getElementById("tabbar");
+  j = 0;
+  for (var i = bar.firstChild; i; i = i.nextSibling) {
+    TABS.push(i);
+    i.__msh_tab = j;
+    i.onmousedown = function(ev) { selectTab(this.__msh_tab); HTMLArea._stopEvent(ev || window.event); };
+    var area = document.getElementById("tab-area-" + j);
+    if (/tab-current/.test(i.className)) {
+      CURRENT_TAB = j;
+      area.style.display = "block";
+    } else {
+      area.style.display = "none";
+    }
+    ++j;
+  }
+  if (document.cookie.match(/HTMLAREA-ABOUT-TAB=([0-9]+)/))
+    selectTab(RegExp.$1);
+}
+window.onresize = function() {
+  var content = document.getElementById("content");
+  if (window.innerHeight) {
+    content.style.height = (window.innerHeight - CONTENT_HEIGHT_DIFF) + "px";
+    content.style.width = (window.innerWidth - CONTENT_WIDTH_DIFF) + "px";
+  } else {
+    content.style.height = (document.body.offsetHeight - CONTENT_HEIGHT_DIFF) + "px";
+    //content.style.width = (document.body.offsetWidth - CONTENT_WIDTH_DIFF) + "px";
+  }
+}
+</script>
+<style>
+  html,body,textarea,table { font-family: tahoma,verdana,arial; font-size: 11px;
+padding: 0px; margin: 0px; }
+  tt { font-size: 120%; }
+  body { padding: 0px; background: #cea; color: 000; }
+  a:link, a:visited { color: #00f; }
+  a:hover { color: #f00; }
+  a:active { color: #f80; }
+  button { font: 11px tahoma,verdana,sans-serif; background-color: #cea;
+      border-width: 1px; }
+
+  p { margin: 0.5em 0px; }
+
+  h1 { font: bold 130% georgia,"times new roman",serif; margin: 0px; border-bottom: 1px solid #6a6; }
+  h2 { font: bold 110% georgia,"times new roman",serif; margin: 0.7em 0px; }
+
+  thead {
+    font-weight: bold;
+    background-color: #dfb;
+  }
+
+  .logo, .logo-hover {
+    white-space: nowrap;
+    background-color: #8f4; color: #040; padding: 3px; border-bottom: 1px solid #555;
+    height: 5em;
+  }
+  .logo .brand, .logo-hover .brand {
+    margin-left: 0.5em; margin-right: 0.5em; padding-bottom: 0.1em;
+    font-family: impact,'arial black',arial,sans-serif; font-size: 28px;
+    border-bottom: 1px solid #595; text-align: center;
+    cursor: pointer;
+  }
+  .logo-hover {
+    background-color: #fff;
+  }
+  .logo-hover .brand {
+    color: #800;
+    border-color: #04f;
+  }
+  .logo .letter, .logo-hover .letter { position: relative; font-family: monospace; }
+  .logo .letter1 { top: 0.1em; }
+  .logo .letter2 { top: 0.05em; }
+  .logo .letter3 { top: -0.05em; }
+  .logo .letter4 { top: -0.1em; }
+
+  .logo-hover .letter1 { top: -0.1em; }
+  .logo-hover .letter2 { top: -0.05em; }
+  .logo-hover .letter3 { top: 0.05em; }
+  .logo-hover .letter4 { top: 0.1em; }
+  .logo .version, .logo-hover .version { font-family: georgia,"times new roman",serif; }
+  .logo .release {
+    font-size: 90%; margin-bottom: 1em;
+    text-align: center; color: #484;
+  }
+  .logo .visit { display: none; }
+  .logo-hover .release { display: none; }
+  .logo-hover .visit {
+    font-size: 90%; margin-bottom: 1em;
+    text-align: center; color: #448;
+  }
+  .buttons {
+    text-align: right; padding: 3px; background-color: #8f4;
+    border-top: 1px solid #555;
+  }
+  #tabbar {
+    position: relative;
+    left: 10px;
+  }
+  .tab {
+    color: #454;
+    cursor: pointer;
+    margin-left: -5px;
+    float: left; position: relative;
+    border: 1px solid #555;
+    top: -3px; left: -2px;
+    padding: 2px 10px 3px 10px;
+    border-top: none; background-color: #9b7;
+    -moz-border-radius: 0px 0px 4px 4px;
+    z-index: 0;
+  }
+  .tab-current {
+    color: #000;
+    top: -4px;
+    background-color: #cea;
+    padding: 3px 10px 4px 10px;
+    z-index: 10;
+  }
+  table.sponsors { border-top: 1px solid #aca; }
+  table.sponsors td {
+    border-bottom: 1px solid #aca; vertical-align: top;
+  }
+  table.sponsors tr td { padding: 2px 0px; }
+  table.sponsors tr td.sponsor { text-align: right; padding-right: 0.3em; white-space: nowrap; }
+  li, ol, ul { margin-top: 0px; margin-bottom: 0px; }
+</style></head>
+<body onload="__dlg_init(); initDocument();"
+><table cellspacing="0" cellpadding="0" style="border-collapse: collapse;
+      width: 100%; height: 100%;">
+
+<tr style="height: 1em"><td id="tdheader">
+
+<div class="logo">
+<div class="brand"
+onmouseover="this.parentNode.className='logo-hover';"
+onmouseout="this.parentNode.className='logo';"
+onclick="window.open('http://dynarch.com/htmlarea/');">
+<span class="letter letter1">&lt;H</span><span
+class="letter letter2">T</span><span
+class="letter letter3">M</span><span
+class="letter letter4">L</span>Area <span class="letter">/&gt;</span>
+<span class="version">3.0 <span style="position: relative; top: -0.6em; font-size: 50%; font-weight: normal">[ rev. rc1 ]</span></span></div>
+<div class="release">Compiled on Mar  1, 2004 19:37 GMT</div>
+<div class="visit">Go to http://dynarch.com/htmlarea/ [latest milestone release]</div>
+</div>
+
+</td></tr>
+<tr><td id="tdcontent" style="padding: 0.5em;">
+
+<div style="overflow: auto; height: 250px;" id="content">
+<div id="tab-areas">
+
+<div id="tab-area-0">
+
+  <h1>HTMLArea</h1>
+  
+  <p>A free WYSIWYG editor replacement for <tt>&lt;textarea&gt;</tt> fields.<br />
+  For Mozilla 1.3+ (any platform) or Internet Explorer 5.5+ (Windows).
+  </p>
+
+  <p style="text-align: center"
+  >&copy; 2002-2004 <a href="http://interactivetools.com" target="_blank">interactivetools.com</a>, inc.<br />
+  &copy; 2003-2004 <a href="http://dynarch.com" target="_blank">dynarch.com</a> LLC.<br />
+  All Rights Reserved.</p>
+
+  <h2>Project resources</h2>
+
+  <ul>
+  <li><a href="http://sourceforge.net/projects/itools-htmlarea/" target="_blank"
+  >Project page</a> (@ sourceforge.net)</li>
+  <li><a href="http://sourceforge.net/cvs/?group_id=69750" target="_blank"
+  >Anonymous CVS access</a> (@ sourceforge.net)</li>
+  <li><a href="http://sourceforge.net/tracker/?atid=525656&group_id=69750&func=browse" target="_blank"
+  >Bug system</a> (@ sourceforge.net)</li>
+  <li><a href="http://www.interactivetools.com/forum/gforum.cgi?forum=14;" target="_blank"
+  >Forum</a> (@ interactivetools.com)</li>
+  <li><a href="http://www.dynarch.com/htmlarea/" target="_blank"
+  >Last public release</a> (@ dynarch.com)</li>
+  </ul>
+
+  <p>
+  For download section please see the <a href="http://sourceforge.net/projects/itools-htmlarea/" target="_blank"
+  >project page @ SourceForge</a>.
+  </p>
+
+<p style="margin-top: 1em; text-align: center;">Version 3.0 developed and maintained by <a
+href="http://dynarch.com/mishoo/" title="http://dynarch.com/mishoo/" target="_blank">Mihai Bazon</a> / <a
+href="http://dynarch.com" title="http://dynarch.com/" target="_blank">dynarch.com</a></p>
+
+</div>
+
+<div id="tab-area-1">
+<h1>Thank you</h1>
+
+  <p>
+  <a href="http://dynarch.com" target="_blank">dynarch.com</a> would like to thank the following
+  companies/persons for their <em>donations</em> to support development of HTMLArea (listed alphabetically):
+  </p>
+
+  <ul>
+    <li><a href="http://www.neomedia.ro">Neomedia</a> (Romania)</li>
+    <li><a href="http://www.os3.it" target="_blank">OS3</a> (Italy)</li>
+    <li><a href="http://www.softwerk.net">SoftWerk</a> (Italy)</li>
+  </ul>
+
+  <p>Also many thanks to all people at InteractiveTools.com
+  <a href="http://www.interactivetools.com/forum/gforum.cgi?forum=14;">HTMLArea forums</a> for
+  contributing translations, feedback, bug reports and fixes.</p>
+
+  <p>
+  Last but not least, this project wouldn't have existed without
+  <a href="http://interactivetools.com" target="_blank">InteractiveTools.com</a>.
+  </p>
+
+</div>
+
+<div id="tab-area-2">
+<h1>htmlArea License (based on BSD license)</h1>
+
+<p style="text-align: center">© 2002-2004, interactivetools.com, inc.<br />
+  © 2003-2004 dynarch.com LLC<br />
+  All rights reserved.</p>
+
+<p>
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+</p>
+
+<ol>
+<li>
+Redistributions of source code must retain the above copyright notice,
+this list of conditions and the following disclaimer.
+</li>
+
+<li>
+Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions and the following disclaimer in the documentation
+and/or other materials provided with the distribution.
+</li>
+
+<li>
+Neither the name of interactivetools.com, inc. nor the names of its
+contributors may be used to endorse or promote products derived from this
+software without specific prior written permission.
+</li>
+</ol>
+
+<p>
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGE.
+</p>
+
+</div>
+
+<div id="tab-area-3">
+<h1>Plugins</h1>
+<div id="plugins">
+</div>
+</div>
+
+</div></div>
+
+
+</tr></td>
+<tr style="height: 1em"><td id="tdfooter">
+
+
+<div class="buttons">
+<div id="tabbar"
+><div class="tab tab-current"
+>About</div><div class="tab"
+>Thanks</div><div class="tab"
+>License</div><div class="tab"
+>Plugins</div></div>
+<button type="button" onclick="__dlg_close(null);">I agree it's cool</button>
+</div>
+
+</td></tr></table>
+
+</body></html>
+
+
Index: temp/trunk/html/test/naka/HTMLArea/popups/insert_table.html
===================================================================
--- temp/trunk/html/test/naka/HTMLArea/popups/insert_table.html	(revision 1694)
+++ temp/trunk/html/test/naka/HTMLArea/popups/insert_table.html	(revision 1694)
@@ -0,0 +1,174 @@
+<html>
+
+<head>
+  <title>Insert Table</title>
+
+<script type="text/javascript" src="popup.js"></script>
+
+<script type="text/javascript">
+
+window.resizeTo(400, 100);
+
+function Init() {
+  __dlg_init();
+  document.getElementById("f_rows").focus();
+};
+
+function onOK() {
+  var required = {
+    "f_rows": "You must enter a number of rows",
+    "f_cols": "You must enter a number of columns"
+  };
+  for (var i in required) {
+    var el = document.getElementById(i);
+    if (!el.value) {
+      alert(required[i]);
+      el.focus();
+      return false;
+    }
+  }
+  var fields = ["f_rows", "f_cols", "f_width", "f_unit",
+                "f_align", "f_border", "f_spacing", "f_padding"];
+  var param = new Object();
+  for (var i in fields) {
+    var id = fields[i];
+    var el = document.getElementById(id);
+    param[id] = el.value;
+  }
+  __dlg_close(param);
+  return false;
+};
+
+function onCancel() {
+  __dlg_close(null);
+  return false;
+};
+
+</script>
+
+<style type="text/css">
+html, body {
+  background: ButtonFace;
+  color: ButtonText;
+  font: 11px Tahoma,Verdana,sans-serif;
+  margin: 0px;
+  padding: 0px;
+}
+body { padding: 5px; }
+table {
+  font: 11px Tahoma,Verdana,sans-serif;
+}
+form p {
+  margin-top: 5px;
+  margin-bottom: 5px;
+}
+.fl { width: 9em; float: left; padding: 2px 5px; text-align: right; }
+.fr { width: 7em; float: left; padding: 2px 5px; text-align: right; }
+fieldset { padding: 0px 10px 5px 5px; }
+select, input, button { font: 11px Tahoma,Verdana,sans-serif; }
+button { width: 70px; }
+.space { padding: 2px; }
+
+.title { background: #ddf; color: #000; font-weight: bold; font-size: 120%; padding: 3px 10px; margin-bottom: 10px;
+border-bottom: 1px solid black; letter-spacing: 2px;
+}
+form { padding: 0px; margin: 0px; }
+</style>
+
+</head>
+
+<body onload="Init()">
+
+<div class="title">Insert Table</div>
+
+<form action="" method="get">
+<table border="0" style="padding: 0px; margin: 0px">
+  <tbody>
+
+  <tr>
+    <td style="width: 4em; text-align: right">Rows:</td>
+    <td><input type="text" name="rows" id="f_rows" size="5" title="Number of rows" value="2" /></td>
+    <td></td>
+    <td></td>
+    <td></td>
+  </tr>
+  <tr>
+    <td style="width: 4em; text-align: right">Cols:</td>
+    <td><input type="text" name="cols" id="f_cols" size="5" title="Number of columns" value="4" /></td>
+    <td style="width: 4em; text-align: right">Width:</td>
+    <td><input type="text" name="width" id="f_width" size="5" title="Width of the table" value="100" /></td>
+    <td><select size="1" name="unit" id="f_unit" title="Width unit">
+      <option value="%" selected="1"  >Percent</option>
+      <option value="px"              >Pixels</option>
+      <option value="em"              >Em</option>
+    </select></td>
+  </tr>
+
+  </tbody>
+</table>
+
+<p />
+
+<fieldset style="float: left; margin-left: 5px;">
+<legend>Layout</legend>
+
+<div class="space"></div>
+
+<div class="fl">Alignment:</div>
+<select size="1" name="align" id="f_align"
+  title="Positioning of this image">
+  <option value="" selected="1"                >Not set</option>
+  <option value="left"                         >Left</option>
+  <option value="right"                        >Right</option>
+  <option value="texttop"                      >Texttop</option>
+  <option value="absmiddle"                    >Absmiddle</option>
+  <option value="baseline"                     >Baseline</option>
+  <option value="absbottom"                    >Absbottom</option>
+  <option value="bottom"                       >Bottom</option>
+  <option value="middle"                       >Middle</option>
+  <option value="top"                          >Top</option>
+</select>
+
+<p />
+
+<div class="fl">Border thickness:</div>
+<input type="text" name="border" id="f_border" size="5" value="1"
+title="Leave empty for no border" />
+<!--
+<p />
+
+<div class="fl">Collapse borders:</div>
+<input type="checkbox" name="collapse" id="f_collapse" />
+-->
+<div class="space"></div>
+
+</fieldset>
+
+<fieldset style="float:right; margin-right: 5px;">
+<legend>Spacing</legend>
+
+<div class="space"></div>
+
+<div class="fr">Cell spacing:</div>
+<input type="text" name="spacing" id="f_spacing" size="5" value="1"
+title="Space between adjacent cells" />
+
+<p />
+
+<div class="fr">Cell padding:</div>
+<input type="text" name="padding" id="f_padding" size="5" value="1"
+title="Space between content and border in cell" />
+
+<div class="space"></div>
+
+</fieldset>
+
+<div style="margin-top: 85px; border-top: 1px solid #999; padding: 2px; text-align: right;">
+<button type="button" name="ok" onclick="return onOK();">OK</button>
+<button type="button" name="cancel" onclick="return onCancel();">Cancel</button>
+</div>
+
+</form>
+
+</body>
+</html>
Index: temp/trunk/html/test/naka/HTMLArea/popups/popup.js
===================================================================
--- temp/trunk/html/test/naka/HTMLArea/popups/popup.js	(revision 1694)
+++ temp/trunk/html/test/naka/HTMLArea/popups/popup.js	(revision 1694)
@@ -0,0 +1,109 @@
+// htmlArea v3.0 - Copyright (c) 2002, 2003 interactivetools.com, inc.
+// This copyright notice MUST stay intact for use (see license.txt).
+//
+// Portions (c) dynarch.com, 2003
+//
+// A free WYSIWYG editor replacement for <textarea> fields.
+// For full source code and docs, visit http://www.interactivetools.com/
+//
+// Version 3.0 developed by Mihai Bazon.
+//   http://dynarch.com/mishoo
+//
+// $Id$
+
+function getAbsolutePos(el) {
+	var r = { x: el.offsetLeft, y: el.offsetTop };
+	if (el.offsetParent) {
+		var tmp = getAbsolutePos(el.offsetParent);
+		r.x += tmp.x;
+		r.y += tmp.y;
+	}
+	return r;
+};
+
+function comboSelectValue(c, val) {
+	var ops = c.getElementsByTagName("option");
+	for (var i = ops.length; --i >= 0;) {
+		var op = ops[i];
+		op.selected = (op.value == val);
+	}
+	c.value = val;
+};
+
+function __dlg_onclose() {
+	opener.Dialog._return(null);
+};
+
+function __dlg_init(bottom) {
+	var body = document.body;
+	var body_height = 0;
+	if (typeof bottom == "undefined") {
+		var div = document.createElement("div");
+		body.appendChild(div);
+		var pos = getAbsolutePos(div);
+		body_height = pos.y;
+	} else {
+		var pos = getAbsolutePos(bottom);
+		body_height = pos.y + bottom.offsetHeight;
+	}
+	window.dialogArguments = opener.Dialog._arguments;
+	if (!document.all) {
+		window.sizeToContent();
+		window.sizeToContent();	// for reasons beyond understanding,
+					// only if we call it twice we get the
+					// correct size.
+		window.addEventListener("unload", __dlg_onclose, true);
+		// center on parent
+		var x = opener.screenX + (opener.outerWidth - window.outerWidth) / 2;
+		var y = opener.screenY + (opener.outerHeight - window.outerHeight) / 2;
+		window.moveTo(x, y);
+		window.innerWidth = body.offsetWidth + 5;
+		window.innerHeight = body_height + 2;
+	} else {
+		// window.dialogHeight = body.offsetHeight + 50 + "px";
+		// window.dialogWidth = body.offsetWidth + "px";
+		window.resizeTo(body.offsetWidth, body_height);
+		var ch = body.clientHeight;
+		var cw = body.clientWidth;
+		window.resizeBy(body.offsetWidth - cw, body_height - ch);
+		var W = body.offsetWidth;
+		var H = 2 * body_height - ch;
+		var x = (screen.availWidth - W) / 2;
+		var y = (screen.availHeight - H) / 2;
+		window.moveTo(x, y);
+	}
+	document.body.onkeypress = __dlg_close_on_esc;
+};
+
+function __dlg_translate(i18n) {
+	var types = ["span", "option", "td", "button", "div"];
+	for (var type in types) {
+		var spans = document.getElementsByTagName(types[type]);
+		for (var i = spans.length; --i >= 0;) {
+			var span = spans[i];
+			if (span.firstChild && span.firstChild.data) {
+				var txt = i18n[span.firstChild.data];
+				if (txt)
+					span.firstChild.data = txt;
+			}
+		}
+	}
+	var txt = i18n[document.title];
+	if (txt)
+		document.title = txt;
+};
+
+// closes the dialog and passes the return info upper.
+function __dlg_close(val) {
+	opener.Dialog._return(val);
+	window.close();
+};
+
+function __dlg_close_on_esc(ev) {
+	ev || (ev = window.event);
+	if (ev.keyCode == 27) {
+		window.close();
+		return false;
+	}
+	return true;
+};
Index: temp/trunk/html/test/naka/HTMLArea/popups/custom2.html
===================================================================
--- temp/trunk/html/test/naka/HTMLArea/popups/custom2.html	(revision 1694)
+++ temp/trunk/html/test/naka/HTMLArea/popups/custom2.html	(revision 1694)
@@ -0,0 +1,35 @@
+<html style="width:300px; Height: 60px;">
+ <head>
+  <title>Select Phrase</title>
+<script language="javascript">
+
+var myTitle = window.dialogArguments;
+document.title = myTitle;
+
+
+function returnSelected() {
+  var idx  = document.all.textPulldown.selectedIndex;
+  var text = document.all.textPulldown[idx].text;
+
+  window.returnValue = text;          // set return value
+  window.close();                     // close dialog
+}
+
+</script>
+</head>
+<body bgcolor="#FFFFFF" topmargin=15 leftmargin=0>
+
+<form method=get onSubmit="Set(document.all.ColorHex.value); return false;">
+<div align=center>
+
+<select name="textPulldown">
+<option>The quick brown</option>
+<option>fox jumps over</option>
+<option>the lazy dog.</option>
+</select>
+
+<input type="button" value=" Go " onClick="returnSelected()">
+
+</div>
+</form>
+</body></html>
Index: temp/trunk/html/test/naka/HTMLArea/popups/link.html
===================================================================
--- temp/trunk/html/test/naka/HTMLArea/popups/link.html	(revision 1694)
+++ temp/trunk/html/test/naka/HTMLArea/popups/link.html	(revision 1694)
@@ -0,0 +1,142 @@
+<html>
+
+<head>
+  <title>Insert/Modify Link</title>
+  <script type="text/javascript" src="popup.js"></script>
+  <script type="text/javascript">
+    window.resizeTo(400, 200);
+
+I18N = window.opener.HTMLArea.I18N.dialogs;
+
+function i18n(str) {
+  return (I18N[str] || str);
+};
+
+function onTargetChanged() {
+  var f = document.getElementById("f_other_target");
+  if (this.value == "_other") {
+    f.style.visibility = "visible";
+    f.select();
+    f.focus();
+  } else f.style.visibility = "hidden";
+};
+
+function Init() {
+  __dlg_translate(I18N);
+  __dlg_init();
+  var param = window.dialogArguments;
+  var target_select = document.getElementById("f_target");
+  if (param) {
+      document.getElementById("f_href").value = param["f_href"];
+      document.getElementById("f_title").value = param["f_title"];
+      comboSelectValue(target_select, param["f_target"]);
+      if (target_select.value != param.f_target) {
+        var opt = document.createElement("option");
+        opt.value = param.f_target;
+        opt.innerHTML = opt.value;
+        target_select.appendChild(opt);
+        opt.selected = true;
+      }
+  }
+  var opt = document.createElement("option");
+  opt.value = "_other";
+  opt.innerHTML = i18n("Other");
+  target_select.appendChild(opt);
+  target_select.onchange = onTargetChanged;
+  document.getElementById("f_href").focus();
+  document.getElementById("f_href").select();
+};
+
+function onOK() {
+  var required = {
+    "f_href": i18n("You must enter the URL where this link points to")
+  };
+  for (var i in required) {
+    var el = document.getElementById(i);
+    if (!el.value) {
+      alert(required[i]);
+      el.focus();
+      return false;
+    }
+  }
+  // pass data back to the calling window
+  var fields = ["f_href", "f_title", "f_target" ];
+  var param = new Object();
+  for (var i in fields) {
+    var id = fields[i];
+    var el = document.getElementById(id);
+    param[id] = el.value;
+  }
+  if (param.f_target == "_other")
+    param.f_target = document.getElementById("f_other_target").value;
+  __dlg_close(param);
+  return false;
+};
+
+function onCancel() {
+  __dlg_close(null);
+  return false;
+};
+
+</script>
+
+<style type="text/css">
+html, body {
+  background: ButtonFace;
+  color: ButtonText;
+  font: 11px Tahoma,Verdana,sans-serif;
+  margin: 0px;
+  padding: 0px;
+}
+body { padding: 5px; }
+table {
+  font: 11px Tahoma,Verdana,sans-serif;
+}
+select, input, button { font: 11px Tahoma,Verdana,sans-serif; }
+button { width: 70px; }
+table .label { text-align: right; width: 8em; }
+
+.title { background: #ddf; color: #000; font-weight: bold; font-size: 120%; padding: 3px 10px; margin-bottom: 10px;
+border-bottom: 1px solid black; letter-spacing: 2px;
+}
+
+#buttons {
+      margin-top: 1em; border-top: 1px solid #999;
+      padding: 2px; text-align: right;
+}
+</style>
+
+</head>
+
+<body onload="Init()">
+<div class="title">Insert/Modify Link</div>
+
+<table border="0" style="width: 100%;">
+  <tr>
+    <td class="label">URL:</td>
+    <td><input type="text" id="f_href" style="width: 100%" /></td>
+  </tr>
+  <tr>
+    <td class="label">Title (tooltip):</td>
+    <td><input type="text" id="f_title" style="width: 100%" /></td>
+  </tr>
+  <tr>
+    <td class="label">Target:</td>
+    <td><select id="f_target">
+      <option value="">None (use implicit)</option>
+      <option value="_blank">New window (_blank)</option>
+      <option value="_self">Same frame (_self)</option>
+      <option value="_top">Top frame (_top)</option>
+    </select>
+    <input type="text" name="f_other_target" id="f_other_target" size="10" style="visibility: hidden" />
+    </td>
+  </tr>
+</table>
+
+<div id="buttons">
+  <button type="button" name="ok" onclick="return onOK();">OK</button>
+  <button type="button" name="cancel" onclick="return onCancel();">Cancel</button>
+</div>
+
+</body>
+</html>
Index: temp/trunk/html/test/naka/HTMLArea/popups/select_color.html
===================================================================
--- temp/trunk/html/test/naka/HTMLArea/popups/select_color.html	(revision 1694)
+++ temp/trunk/html/test/naka/HTMLArea/popups/select_color.html	(revision 1694)
@@ -0,0 +1,347 @@
+<!-- note: this version of the color picker is optimized for IE 5.5+ only -->
+
+<html><head><title>Select Color</title>
+
+<script type="text/javascript" src="popup.js"></script>
+
+<script type="text/javascript">
+
+window.resizeTo(240, 182);
+function _CloseOnEsc() {
+  if (event.keyCode == 27) { window.close(); return; }
+}
+
+function Init() {                                                       // run on page load
+  __dlg_init();    // <!-- this can be found in popup.js -->
+  document.body.onkeypress = _CloseOnEsc;
+
+  var color = window.dialogArguments;
+  color = ValidateColor(color) || '000000';
+  View(color);                                                          // set default color
+}
+
+function View(color) {                  // preview color
+  document.getElementById("ColorPreview").style.backgroundColor = '#' + color;
+  document.getElementById("ColorHex").value = '#' + color;
+}
+
+function Set(string) {                   // select color
+  var color = ValidateColor(string);
+  if (color == null) { alert("Invalid color code: " + string); }        // invalid color
+  else {                                                                // valid color
+    View(color);                          // show selected color
+    __dlg_close(color);
+  }
+}
+
+function ValidateColor(string) {                // return valid color code
+  string = string || '';
+  string = string + "";
+  string = string.toUpperCase();
+  var chars = '0123456789ABCDEF';
+  var out   = '';
+
+  for (var i=0; i<string.length; i++) {             // remove invalid color chars
+    var schar = string.charAt(i);
+    if (chars.indexOf(schar) != -1) { out += schar; }
+  }
+
+  if (out.length != 6) { return null; }            // check length
+  return out;
+}
+
+</script>
+</head>
+<body style="background:ButtonFace; margin:0px; padding:0px" onload="Init()">
+
+<form method="get" style="margin:0px; padding:0px" onSubmit="Set(document.getElementById('ColorHex').value); return false;">
+<table border="0px" cellspacing="0px" cellpadding="4" width="100%">
+ <tr>
+  <td style="background:buttonface" valign=center><div style="background-color: #000000; padding: 1; height: 21px; width: 50px"><div id="ColorPreview" style="height: 100%; width: 100%"></div></div></td>
+  <td style="background:buttonface" valign=center><input type="text" name="ColorHex"
+    id="ColorHex" value="" size=15 style="font-size: 12px"></td>
+  <td style="background:buttonface" width=100%></td>
+ </tr>
+</table>
+</form>
+
+<table border="0" cellspacing="1px" cellpadding="0px" width="100%" bgcolor="#000000" style="cursor: hand;">
+<tr>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#003300 onMouseOver=View('003300') onClick=Set('003300') height="10px" width="10px"></td>
+<td bgcolor=#006600 onMouseOver=View('006600') onClick=Set('006600') height="10px" width="10px"></td>
+<td bgcolor=#009900 onMouseOver=View('009900') onClick=Set('009900') height="10px" width="10px"></td>
+<td bgcolor=#00CC00 onMouseOver=View('00CC00') onClick=Set('00CC00') height="10px" width="10px"></td>
+<td bgcolor=#00FF00 onMouseOver=View('00FF00') onClick=Set('00FF00') height="10px" width="10px"></td>
+<td bgcolor=#330000 onMouseOver=View('330000') onClick=Set('330000') height="10px" width="10px"></td>
+<td bgcolor=#333300 onMouseOver=View('333300') onClick=Set('333300') height="10px" width="10px"></td>
+<td bgcolor=#336600 onMouseOver=View('336600') onClick=Set('336600') height="10px" width="10px"></td>
+<td bgcolor=#339900 onMouseOver=View('339900') onClick=Set('339900') height="10px" width="10px"></td>
+<td bgcolor=#33CC00 onMouseOver=View('33CC00') onClick=Set('33CC00') height="10px" width="10px"></td>
+<td bgcolor=#33FF00 onMouseOver=View('33FF00') onClick=Set('33FF00') height="10px" width="10px"></td>
+<td bgcolor=#660000 onMouseOver=View('660000') onClick=Set('660000') height="10px" width="10px"></td>
+<td bgcolor=#663300 onMouseOver=View('663300') onClick=Set('663300') height="10px" width="10px"></td>
+<td bgcolor=#666600 onMouseOver=View('666600') onClick=Set('666600') height="10px" width="10px"></td>
+<td bgcolor=#669900 onMouseOver=View('669900') onClick=Set('669900') height="10px" width="10px"></td>
+<td bgcolor=#66CC00 onMouseOver=View('66CC00') onClick=Set('66CC00') height="10px" width="10px"></td>
+<td bgcolor=#66FF00 onMouseOver=View('66FF00') onClick=Set('66FF00') height="10px" width="10px"></td>
+</tr>
+<tr>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#333333 onMouseOver=View('333333') onClick=Set('333333') height="10px" width="10px"></td>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#000033 onMouseOver=View('000033') onClick=Set('000033') height="10px" width="10px"></td>
+<td bgcolor=#003333 onMouseOver=View('003333') onClick=Set('003333') height="10px" width="10px"></td>
+<td bgcolor=#006633 onMouseOver=View('006633') onClick=Set('006633') height="10px" width="10px"></td>
+<td bgcolor=#009933 onMouseOver=View('009933') onClick=Set('009933') height="10px" width="10px"></td>
+<td bgcolor=#00CC33 onMouseOver=View('00CC33') onClick=Set('00CC33') height="10px" width="10px"></td>
+<td bgcolor=#00FF33 onMouseOver=View('00FF33') onClick=Set('00FF33') height="10px" width="10px"></td>
+<td bgcolor=#330033 onMouseOver=View('330033') onClick=Set('330033') height="10px" width="10px"></td>
+<td bgcolor=#333333 onMouseOver=View('333333') onClick=Set('333333') height="10px" width="10px"></td>
+<td bgcolor=#336633 onMouseOver=View('336633') onClick=Set('336633') height="10px" width="10px"></td>
+<td bgcolor=#339933 onMouseOver=View('339933') onClick=Set('339933') height="10px" width="10px"></td>
+<td bgcolor=#33CC33 onMouseOver=View('33CC33') onClick=Set('33CC33') height="10px" width="10px"></td>
+<td bgcolor=#33FF33 onMouseOver=View('33FF33') onClick=Set('33FF33') height="10px" width="10px"></td>
+<td bgcolor=#660033 onMouseOver=View('660033') onClick=Set('660033') height="10px" width="10px"></td>
+<td bgcolor=#663333 onMouseOver=View('663333') onClick=Set('663333') height="10px" width="10px"></td>
+<td bgcolor=#666633 onMouseOver=View('666633') onClick=Set('666633') height="10px" width="10px"></td>
+<td bgcolor=#669933 onMouseOver=View('669933') onClick=Set('669933') height="10px" width="10px"></td>
+<td bgcolor=#66CC33 onMouseOver=View('66CC33') onClick=Set('66CC33') height="10px" width="10px"></td>
+<td bgcolor=#66FF33 onMouseOver=View('66FF33') onClick=Set('66FF33') height="10px" width="10px"></td>
+</tr>
+<tr>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#666666 onMouseOver=View('666666') onClick=Set('666666') height="10px" width="10px"></td>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#000066 onMouseOver=View('000066') onClick=Set('000066') height="10px" width="10px"></td>
+<td bgcolor=#003366 onMouseOver=View('003366') onClick=Set('003366') height="10px" width="10px"></td>
+<td bgcolor=#006666 onMouseOver=View('006666') onClick=Set('006666') height="10px" width="10px"></td>
+<td bgcolor=#009966 onMouseOver=View('009966') onClick=Set('009966') height="10px" width="10px"></td>
+<td bgcolor=#00CC66 onMouseOver=View('00CC66') onClick=Set('00CC66') height="10px" width="10px"></td>
+<td bgcolor=#00FF66 onMouseOver=View('00FF66') onClick=Set('00FF66') height="10px" width="10px"></td>
+<td bgcolor=#330066 onMouseOver=View('330066') onClick=Set('330066') height="10px" width="10px"></td>
+<td bgcolor=#333366 onMouseOver=View('333366') onClick=Set('333366') height="10px" width="10px"></td>
+<td bgcolor=#336666 onMouseOver=View('336666') onClick=Set('336666') height="10px" width="10px"></td>
+<td bgcolor=#339966 onMouseOver=View('339966') onClick=Set('339966') height="10px" width="10px"></td>
+<td bgcolor=#33CC66 onMouseOver=View('33CC66') onClick=Set('33CC66') height="10px" width="10px"></td>
+<td bgcolor=#33FF66 onMouseOver=View('33FF66') onClick=Set('33FF66') height="10px" width="10px"></td>
+<td bgcolor=#660066 onMouseOver=View('660066') onClick=Set('660066') height="10px" width="10px"></td>
+<td bgcolor=#663366 onMouseOver=View('663366') onClick=Set('663366') height="10px" width="10px"></td>
+<td bgcolor=#666666 onMouseOver=View('666666') onClick=Set('666666') height="10px" width="10px"></td>
+<td bgcolor=#669966 onMouseOver=View('669966') onClick=Set('669966') height="10px" width="10px"></td>
+<td bgcolor=#66CC66 onMouseOver=View('66CC66') onClick=Set('66CC66') height="10px" width="10px"></td>
+<td bgcolor=#66FF66 onMouseOver=View('66FF66') onClick=Set('66FF66') height="10px" width="10px"></td>
+</tr>
+<tr>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#999999 onMouseOver=View('999999') onClick=Set('999999') height="10px" width="10px"></td>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#000099 onMouseOver=View('000099') onClick=Set('000099') height="10px" width="10px"></td>
+<td bgcolor=#003399 onMouseOver=View('003399') onClick=Set('003399') height="10px" width="10px"></td>
+<td bgcolor=#006699 onMouseOver=View('006699') onClick=Set('006699') height="10px" width="10px"></td>
+<td bgcolor=#009999 onMouseOver=View('009999') onClick=Set('009999') height="10px" width="10px"></td>
+<td bgcolor=#00CC99 onMouseOver=View('00CC99') onClick=Set('00CC99') height="10px" width="10px"></td>
+<td bgcolor=#00FF99 onMouseOver=View('00FF99') onClick=Set('00FF99') height="10px" width="10px"></td>
+<td bgcolor=#330099 onMouseOver=View('330099') onClick=Set('330099') height="10px" width="10px"></td>
+<td bgcolor=#333399 onMouseOver=View('333399') onClick=Set('333399') height="10px" width="10px"></td>
+<td bgcolor=#336699 onMouseOver=View('336699') onClick=Set('336699') height="10px" width="10px"></td>
+<td bgcolor=#339999 onMouseOver=View('339999') onClick=Set('339999') height="10px" width="10px"></td>
+<td bgcolor=#33CC99 onMouseOver=View('33CC99') onClick=Set('33CC99') height="10px" width="10px"></td>
+<td bgcolor=#33FF99 onMouseOver=View('33FF99') onClick=Set('33FF99') height="10px" width="10px"></td>
+<td bgcolor=#660099 onMouseOver=View('660099') onClick=Set('660099') height="10px" width="10px"></td>
+<td bgcolor=#663399 onMouseOver=View('663399') onClick=Set('663399') height="10px" width="10px"></td>
+<td bgcolor=#666699 onMouseOver=View('666699') onClick=Set('666699') height="10px" width="10px"></td>
+<td bgcolor=#669999 onMouseOver=View('669999') onClick=Set('669999') height="10px" width="10px"></td>
+<td bgcolor=#66CC99 onMouseOver=View('66CC99') onClick=Set('66CC99') height="10px" width="10px"></td>
+<td bgcolor=#66FF99 onMouseOver=View('66FF99') onClick=Set('66FF99') height="10px" width="10px"></td>
+</tr>
+<tr>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#CCCCCC onMouseOver=View('CCCCCC') onClick=Set('CCCCCC') height="10px" width="10px"></td>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#0000CC onMouseOver=View('0000CC') onClick=Set('0000CC') height="10px" width="10px"></td>
+<td bgcolor=#0033CC onMouseOver=View('0033CC') onClick=Set('0033CC') height="10px" width="10px"></td>
+<td bgcolor=#0066CC onMouseOver=View('0066CC') onClick=Set('0066CC') height="10px" width="10px"></td>
+<td bgcolor=#0099CC onMouseOver=View('0099CC') onClick=Set('0099CC') height="10px" width="10px"></td>
+<td bgcolor=#00CCCC onMouseOver=View('00CCCC') onClick=Set('00CCCC') height="10px" width="10px"></td>
+<td bgcolor=#00FFCC onMouseOver=View('00FFCC') onClick=Set('00FFCC') height="10px" width="10px"></td>
+<td bgcolor=#3300CC onMouseOver=View('3300CC') onClick=Set('3300CC') height="10px" width="10px"></td>
+<td bgcolor=#3333CC onMouseOver=View('3333CC') onClick=Set('3333CC') height="10px" width="10px"></td>
+<td bgcolor=#3366CC onMouseOver=View('3366CC') onClick=Set('3366CC') height="10px" width="10px"></td>
+<td bgcolor=#3399CC onMouseOver=View('3399CC') onClick=Set('3399CC') height="10px" width="10px"></td>
+<td bgcolor=#33CCCC onMouseOver=View('33CCCC') onClick=Set('33CCCC') height="10px" width="10px"></td>
+<td bgcolor=#33FFCC onMouseOver=View('33FFCC') onClick=Set('33FFCC') height="10px" width="10px"></td>
+<td bgcolor=#6600CC onMouseOver=View('6600CC') onClick=Set('6600CC') height="10px" width="10px"></td>
+<td bgcolor=#6633CC onMouseOver=View('6633CC') onClick=Set('6633CC') height="10px" width="10px"></td>
+<td bgcolor=#6666CC onMouseOver=View('6666CC') onClick=Set('6666CC') height="10px" width="10px"></td>
+<td bgcolor=#6699CC onMouseOver=View('6699CC') onClick=Set('6699CC') height="10px" width="10px"></td>
+<td bgcolor=#66CCCC onMouseOver=View('66CCCC') onClick=Set('66CCCC') height="10px" width="10px"></td>
+<td bgcolor=#66FFCC onMouseOver=View('66FFCC') onClick=Set('66FFCC') height="10px" width="10px"></td>
+</tr>
+<tr>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#FFFFFF onMouseOver=View('FFFFFF') onClick=Set('FFFFFF') height="10px" width="10px"></td>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#0000FF onMouseOver=View('0000FF') onClick=Set('0000FF') height="10px" width="10px"></td>
+<td bgcolor=#0033FF onMouseOver=View('0033FF') onClick=Set('0033FF') height="10px" width="10px"></td>
+<td bgcolor=#0066FF onMouseOver=View('0066FF') onClick=Set('0066FF') height="10px" width="10px"></td>
+<td bgcolor=#0099FF onMouseOver=View('0099FF') onClick=Set('0099FF') height="10px" width="10px"></td>
+<td bgcolor=#00CCFF onMouseOver=View('00CCFF') onClick=Set('00CCFF') height="10px" width="10px"></td>
+<td bgcolor=#00FFFF onMouseOver=View('00FFFF') onClick=Set('00FFFF') height="10px" width="10px"></td>
+<td bgcolor=#3300FF onMouseOver=View('3300FF') onClick=Set('3300FF') height="10px" width="10px"></td>
+<td bgcolor=#3333FF onMouseOver=View('3333FF') onClick=Set('3333FF') height="10px" width="10px"></td>
+<td bgcolor=#3366FF onMouseOver=View('3366FF') onClick=Set('3366FF') height="10px" width="10px"></td>
+<td bgcolor=#3399FF onMouseOver=View('3399FF') onClick=Set('3399FF') height="10px" width="10px"></td>
+<td bgcolor=#33CCFF onMouseOver=View('33CCFF') onClick=Set('33CCFF') height="10px" width="10px"></td>
+<td bgcolor=#33FFFF onMouseOver=View('33FFFF') onClick=Set('33FFFF') height="10px" width="10px"></td>
+<td bgcolor=#6600FF onMouseOver=View('6600FF') onClick=Set('6600FF') height="10px" width="10px"></td>
+<td bgcolor=#6633FF onMouseOver=View('6633FF') onClick=Set('6633FF') height="10px" width="10px"></td>
+<td bgcolor=#6666FF onMouseOver=View('6666FF') onClick=Set('6666FF') height="10px" width="10px"></td>
+<td bgcolor=#6699FF onMouseOver=View('6699FF') onClick=Set('6699FF') height="10px" width="10px"></td>
+<td bgcolor=#66CCFF onMouseOver=View('66CCFF') onClick=Set('66CCFF') height="10px" width="10px"></td>
+<td bgcolor=#66FFFF onMouseOver=View('66FFFF') onClick=Set('66FFFF') height="10px" width="10px"></td>
+</tr>
+<tr>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#FF0000 onMouseOver=View('FF0000') onClick=Set('FF0000') height="10px" width="10px"></td>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#990000 onMouseOver=View('990000') onClick=Set('990000') height="10px" width="10px"></td>
+<td bgcolor=#993300 onMouseOver=View('993300') onClick=Set('993300') height="10px" width="10px"></td>
+<td bgcolor=#996600 onMouseOver=View('996600') onClick=Set('996600') height="10px" width="10px"></td>
+<td bgcolor=#999900 onMouseOver=View('999900') onClick=Set('999900') height="10px" width="10px"></td>
+<td bgcolor=#99CC00 onMouseOver=View('99CC00') onClick=Set('99CC00') height="10px" width="10px"></td>
+<td bgcolor=#99FF00 onMouseOver=View('99FF00') onClick=Set('99FF00') height="10px" width="10px"></td>
+<td bgcolor=#CC0000 onMouseOver=View('CC0000') onClick=Set('CC0000') height="10px" width="10px"></td>
+<td bgcolor=#CC3300 onMouseOver=View('CC3300') onClick=Set('CC3300') height="10px" width="10px"></td>
+<td bgcolor=#CC6600 onMouseOver=View('CC6600') onClick=Set('CC6600') height="10px" width="10px"></td>
+<td bgcolor=#CC9900 onMouseOver=View('CC9900') onClick=Set('CC9900') height="10px" width="10px"></td>
+<td bgcolor=#CCCC00 onMouseOver=View('CCCC00') onClick=Set('CCCC00') height="10px" width="10px"></td>
+<td bgcolor=#CCFF00 onMouseOver=View('CCFF00') onClick=Set('CCFF00') height="10px" width="10px"></td>
+<td bgcolor=#FF0000 onMouseOver=View('FF0000') onClick=Set('FF0000') height="10px" width="10px"></td>
+<td bgcolor=#FF3300 onMouseOver=View('FF3300') onClick=Set('FF3300') height="10px" width="10px"></td>
+<td bgcolor=#FF6600 onMouseOver=View('FF6600') onClick=Set('FF6600') height="10px" width="10px"></td>
+<td bgcolor=#FF9900 onMouseOver=View('FF9900') onClick=Set('FF9900') height="10px" width="10px"></td>
+<td bgcolor=#FFCC00 onMouseOver=View('FFCC00') onClick=Set('FFCC00') height="10px" width="10px"></td>
+<td bgcolor=#FFFF00 onMouseOver=View('FFFF00') onClick=Set('FFFF00') height="10px" width="10px"></td>
+</tr>
+<tr>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#00FF00 onMouseOver=View('00FF00') onClick=Set('00FF00') height="10px" width="10px"></td>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#990033 onMouseOver=View('990033') onClick=Set('990033') height="10px" width="10px"></td>
+<td bgcolor=#993333 onMouseOver=View('993333') onClick=Set('993333') height="10px" width="10px"></td>
+<td bgcolor=#996633 onMouseOver=View('996633') onClick=Set('996633') height="10px" width="10px"></td>
+<td bgcolor=#999933 onMouseOver=View('999933') onClick=Set('999933') height="10px" width="10px"></td>
+<td bgcolor=#99CC33 onMouseOver=View('99CC33') onClick=Set('99CC33') height="10px" width="10px"></td>
+<td bgcolor=#99FF33 onMouseOver=View('99FF33') onClick=Set('99FF33') height="10px" width="10px"></td>
+<td bgcolor=#CC0033 onMouseOver=View('CC0033') onClick=Set('CC0033') height="10px" width="10px"></td>
+<td bgcolor=#CC3333 onMouseOver=View('CC3333') onClick=Set('CC3333') height="10px" width="10px"></td>
+<td bgcolor=#CC6633 onMouseOver=View('CC6633') onClick=Set('CC6633') height="10px" width="10px"></td>
+<td bgcolor=#CC9933 onMouseOver=View('CC9933') onClick=Set('CC9933') height="10px" width="10px"></td>
+<td bgcolor=#CCCC33 onMouseOver=View('CCCC33') onClick=Set('CCCC33') height="10px" width="10px"></td>
+<td bgcolor=#CCFF33 onMouseOver=View('CCFF33') onClick=Set('CCFF33') height="10px" width="10px"></td>
+<td bgcolor=#FF0033 onMouseOver=View('FF0033') onClick=Set('FF0033') height="10px" width="10px"></td>
+<td bgcolor=#FF3333 onMouseOver=View('FF3333') onClick=Set('FF3333') height="10px" width="10px"></td>
+<td bgcolor=#FF6633 onMouseOver=View('FF6633') onClick=Set('FF6633') height="10px" width="10px"></td>
+<td bgcolor=#FF9933 onMouseOver=View('FF9933') onClick=Set('FF9933') height="10px" width="10px"></td>
+<td bgcolor=#FFCC33 onMouseOver=View('FFCC33') onClick=Set('FFCC33') height="10px" width="10px"></td>
+<td bgcolor=#FFFF33 onMouseOver=View('FFFF33') onClick=Set('FFFF33') height="10px" width="10px"></td>
+</tr>
+<tr>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#0000FF onMouseOver=View('0000FF') onClick=Set('0000FF') height="10px" width="10px"></td>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#990066 onMouseOver=View('990066') onClick=Set('990066') height="10px" width="10px"></td>
+<td bgcolor=#993366 onMouseOver=View('993366') onClick=Set('993366') height="10px" width="10px"></td>
+<td bgcolor=#996666 onMouseOver=View('996666') onClick=Set('996666') height="10px" width="10px"></td>
+<td bgcolor=#999966 onMouseOver=View('999966') onClick=Set('999966') height="10px" width="10px"></td>
+<td bgcolor=#99CC66 onMouseOver=View('99CC66') onClick=Set('99CC66') height="10px" width="10px"></td>
+<td bgcolor=#99FF66 onMouseOver=View('99FF66') onClick=Set('99FF66') height="10px" width="10px"></td>
+<td bgcolor=#CC0066 onMouseOver=View('CC0066') onClick=Set('CC0066') height="10px" width="10px"></td>
+<td bgcolor=#CC3366 onMouseOver=View('CC3366') onClick=Set('CC3366') height="10px" width="10px"></td>
+<td bgcolor=#CC6666 onMouseOver=View('CC6666') onClick=Set('CC6666') height="10px" width="10px"></td>
+<td bgcolor=#CC9966 onMouseOver=View('CC9966') onClick=Set('CC9966') height="10px" width="10px"></td>
+<td bgcolor=#CCCC66 onMouseOver=View('CCCC66') onClick=Set('CCCC66') height="10px" width="10px"></td>
+<td bgcolor=#CCFF66 onMouseOver=View('CCFF66') onClick=Set('CCFF66') height="10px" width="10px"></td>
+<td bgcolor=#FF0066 onMouseOver=View('FF0066') onClick=Set('FF0066') height="10px" width="10px"></td>
+<td bgcolor=#FF3366 onMouseOver=View('FF3366') onClick=Set('FF3366') height="10px" width="10px"></td>
+<td bgcolor=#FF6666 onMouseOver=View('FF6666') onClick=Set('FF6666') height="10px" width="10px"></td>
+<td bgcolor=#FF9966 onMouseOver=View('FF9966') onClick=Set('FF9966') height="10px" width="10px"></td>
+<td bgcolor=#FFCC66 onMouseOver=View('FFCC66') onClick=Set('FFCC66') height="10px" width="10px"></td>
+<td bgcolor=#FFFF66 onMouseOver=View('FFFF66') onClick=Set('FFFF66') height="10px" width="10px"></td>
+</tr>
+<tr>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#FFFF00 onMouseOver=View('FFFF00') onClick=Set('FFFF00') height="10px" width="10px"></td>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#990099 onMouseOver=View('990099') onClick=Set('990099') height="10px" width="10px"></td>
+<td bgcolor=#993399 onMouseOver=View('993399') onClick=Set('993399') height="10px" width="10px"></td>
+<td bgcolor=#996699 onMouseOver=View('996699') onClick=Set('996699') height="10px" width="10px"></td>
+<td bgcolor=#999999 onMouseOver=View('999999') onClick=Set('999999') height="10px" width="10px"></td>
+<td bgcolor=#99CC99 onMouseOver=View('99CC99') onClick=Set('99CC99') height="10px" width="10px"></td>
+<td bgcolor=#99FF99 onMouseOver=View('99FF99') onClick=Set('99FF99') height="10px" width="10px"></td>
+<td bgcolor=#CC0099 onMouseOver=View('CC0099') onClick=Set('CC0099') height="10px" width="10px"></td>
+<td bgcolor=#CC3399 onMouseOver=View('CC3399') onClick=Set('CC3399') height="10px" width="10px"></td>
+<td bgcolor=#CC6699 onMouseOver=View('CC6699') onClick=Set('CC6699') height="10px" width="10px"></td>
+<td bgcolor=#CC9999 onMouseOver=View('CC9999') onClick=Set('CC9999') height="10px" width="10px"></td>
+<td bgcolor=#CCCC99 onMouseOver=View('CCCC99') onClick=Set('CCCC99') height="10px" width="10px"></td>
+<td bgcolor=#CCFF99 onMouseOver=View('CCFF99') onClick=Set('CCFF99') height="10px" width="10px"></td>
+<td bgcolor=#FF0099 onMouseOver=View('FF0099') onClick=Set('FF0099') height="10px" width="10px"></td>
+<td bgcolor=#FF3399 onMouseOver=View('FF3399') onClick=Set('FF3399') height="10px" width="10px"></td>
+<td bgcolor=#FF6699 onMouseOver=View('FF6699') onClick=Set('FF6699') height="10px" width="10px"></td>
+<td bgcolor=#FF9999 onMouseOver=View('FF9999') onClick=Set('FF9999') height="10px" width="10px"></td>
+<td bgcolor=#FFCC99 onMouseOver=View('FFCC99') onClick=Set('FFCC99') height="10px" width="10px"></td>
+<td bgcolor=#FFFF99 onMouseOver=View('FFFF99') onClick=Set('FFFF99') height="10px" width="10px"></td>
+</tr>
+<tr>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#00FFFF onMouseOver=View('00FFFF') onClick=Set('00FFFF') height="10px" width="10px"></td>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#9900CC onMouseOver=View('9900CC') onClick=Set('9900CC') height="10px" width="10px"></td>
+<td bgcolor=#9933CC onMouseOver=View('9933CC') onClick=Set('9933CC') height="10px" width="10px"></td>
+<td bgcolor=#9966CC onMouseOver=View('9966CC') onClick=Set('9966CC') height="10px" width="10px"></td>
+<td bgcolor=#9999CC onMouseOver=View('9999CC') onClick=Set('9999CC') height="10px" width="10px"></td>
+<td bgcolor=#99CCCC onMouseOver=View('99CCCC') onClick=Set('99CCCC') height="10px" width="10px"></td>
+<td bgcolor=#99FFCC onMouseOver=View('99FFCC') onClick=Set('99FFCC') height="10px" width="10px"></td>
+<td bgcolor=#CC00CC onMouseOver=View('CC00CC') onClick=Set('CC00CC') height="10px" width="10px"></td>
+<td bgcolor=#CC33CC onMouseOver=View('CC33CC') onClick=Set('CC33CC') height="10px" width="10px"></td>
+<td bgcolor=#CC66CC onMouseOver=View('CC66CC') onClick=Set('CC66CC') height="10px" width="10px"></td>
+<td bgcolor=#CC99CC onMouseOver=View('CC99CC') onClick=Set('CC99CC') height="10px" width="10px"></td>
+<td bgcolor=#CCCCCC onMouseOver=View('CCCCCC') onClick=Set('CCCCCC') height="10px" width="10px"></td>
+<td bgcolor=#CCFFCC onMouseOver=View('CCFFCC') onClick=Set('CCFFCC') height="10px" width="10px"></td>
+<td bgcolor=#FF00CC onMouseOver=View('FF00CC') onClick=Set('FF00CC') height="10px" width="10px"></td>
+<td bgcolor=#FF33CC onMouseOver=View('FF33CC') onClick=Set('FF33CC') height="10px" width="10px"></td>
+<td bgcolor=#FF66CC onMouseOver=View('FF66CC') onClick=Set('FF66CC') height="10px" width="10px"></td>
+<td bgcolor=#FF99CC onMouseOver=View('FF99CC') onClick=Set('FF99CC') height="10px" width="10px"></td>
+<td bgcolor=#FFCCCC onMouseOver=View('FFCCCC') onClick=Set('FFCCCC') height="10px" width="10px"></td>
+<td bgcolor=#FFFFCC onMouseOver=View('FFFFCC') onClick=Set('FFFFCC') height="10px" width="10px"></td>
+</tr>
+<tr>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#FF00FF onMouseOver=View('FF00FF') onClick=Set('FF00FF') height="10px" width="10px"></td>
+<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>
+<td bgcolor=#9900FF onMouseOver=View('9900FF') onClick=Set('9900FF') height="10px" width="10px"></td>
+<td bgcolor=#9933FF onMouseOver=View('9933FF') onClick=Set('9933FF') height="10px" width="10px"></td>
+<td bgcolor=#9966FF onMouseOver=View('9966FF') onClick=Set('9966FF') height="10px" width="10px"></td>
+<td bgcolor=#9999FF onMouseOver=View('9999FF') onClick=Set('9999FF') height="10px" width="10px"></td>
+<td bgcolor=#99CCFF onMouseOver=View('99CCFF') onClick=Set('99CCFF') height="10px" width="10px"></td>
+<td bgcolor=#99FFFF onMouseOver=View('99FFFF') onClick=Set('99FFFF') height="10px" width="10px"></td>
+<td bgcolor=#CC00FF onMouseOver=View('CC00FF') onClick=Set('CC00FF') height="10px" width="10px"></td>
+<td bgcolor=#CC33FF onMouseOver=View('CC33FF') onClick=Set('CC33FF') height="10px" width="10px"></td>
+<td bgcolor=#CC66FF onMouseOver=View('CC66FF') onClick=Set('CC66FF') height="10px" width="10px"></td>
+<td bgcolor=#CC99FF onMouseOver=View('CC99FF') onClick=Set('CC99FF') height="10px" width="10px"></td>
+<td bgcolor=#CCCCFF onMouseOver=View('CCCCFF') onClick=Set('CCCCFF') height="10px" width="10px"></td>
+<td bgcolor=#CCFFFF onMouseOver=View('CCFFFF') onClick=Set('CCFFFF') height="10px" width="10px"></td>
+<td bgcolor=#FF00FF onMouseOver=View('FF00FF') onClick=Set('FF00FF') height="10px" width="10px"></td>
+<td bgcolor=#FF33FF onMouseOver=View('FF33FF') onClick=Set('FF33FF') height="10px" width="10px"></td>
+<td bgcolor=#FF66FF onMouseOver=View('FF66FF') onClick=Set('FF66FF') height="10px" width="10px"></td>
+<td bgcolor=#FF99FF onMouseOver=View('FF99FF') onClick=Set('FF99FF') height="10px" width="10px"></td>
+<td bgcolor=#FFCCFF onMouseOver=View('FFCCFF') onClick=Set('FFCCFF') height="10px" width="10px"></td>
+<td bgcolor=#FFFFFF onMouseOver=View('FFFFFF') onClick=Set('FFFFFF') height="10px" width="10px"></td>
+</tr>
+</table>
+
+</body></html>
Index: temp/trunk/html/test/naka/HTMLArea/popups/editor_help.html
===================================================================
--- temp/trunk/html/test/naka/HTMLArea/popups/editor_help.html	(revision 1694)
+++ temp/trunk/html/test/naka/HTMLArea/popups/editor_help.html	(revision 1694)
@@ -0,0 +1,16 @@
+<html>
+ <head>
+  <title>Editor Help</title>
+  <style>
+    body, td, p, div { font-family: arial; font-size: x-small; }
+  </style>
+ </head>
+<body>
+
+<h2>Editor Help<hr></h2>
+
+Todo...
+
+
+</body>
+</html>
Index: temp/trunk/html/test/naka/HTMLArea/popups/old-fullscreen.html
===================================================================
--- temp/trunk/html/test/naka/HTMLArea/popups/old-fullscreen.html	(revision 1694)
+++ temp/trunk/html/test/naka/HTMLArea/popups/old-fullscreen.html	(revision 1694)
@@ -0,0 +1,131 @@
+<html>
+<head><title>Fullscreen Editor</title>
+<style type="text/css"> body {	margin: 0px; border: 0px; background-color: buttonface; } </style>
+
+<script>
+
+// if we pass the "window" object as a argument and then set opener to
+// equal that we can refer to dialogWindows and popupWindows the same way
+if (window.dialogArguments) { opener = window.dialogArguments; }
+
+var _editor_url = "../";
+document.write('<scr'+'ipt src="' +_editor_url+ 'editor.js" language="Javascript1.2"></scr'+'ipt>');
+
+var parent_objname = location.search.substring(1,location.search.length);  // parent editor objname
+var parent_config  = opener.document.all[parent_objname].config;
+
+var config         = cloneObject( parent_config );
+var objname        = 'editor'; // name of this editor
+
+//  DOMViewerObj = config;
+//  DOMViewerName = 'config';
+//  window.open('/innerHTML/domviewer.htm');  
+
+/* ---------------------------------------------------------------------- *\
+  Function    : 
+  Description : 
+\* ---------------------------------------------------------------------- */
+
+function _CloseOnEsc() {
+  if (event.keyCode == 27) {
+    update_parent();
+    window.close();
+    return;
+  }
+}
+
+/* ---------------------------------------------------------------------- *\
+  Function    : cloneObject
+  Description : copy an object by value instead of by reference
+  Usage       : var newObj = cloneObject(oldObj);
+\* ---------------------------------------------------------------------- */
+
+function cloneObject(obj) {
+  var newObj          = new Object; 
+
+  // check for array objects
+  if (obj.constructor.toString().indexOf('function Array(') == 1) {
+    newObj = obj.constructor();
+  }
+
+  for (var n in obj) {
+    var node = obj[n];
+    if (typeof node == 'object') { newObj[n] = cloneObject(node); }
+    else                         { newObj[n] = node; }
+  }
+  
+  return newObj;
+}
+
+/* ---------------------------------------------------------------------- *\
+  Function    : resize_editor
+  Description : resize the editor when the user resizes the popup
+\* ---------------------------------------------------------------------- */
+
+function resize_editor() {  // resize editor to fix window
+  var editor = document.all['_editor_editor'];
+
+  newWidth  = document.body.offsetWidth;
+  newHeight = document.body.offsetHeight - editor.offsetTop;
+
+  if (newWidth < 0) { newWidth = 0; }
+  if (newHeight < 0) { newHeight = 0; }
+
+  editor.style.width  = newWidth;
+  editor.style.height = newHeight;
+}
+
+/* ---------------------------------------------------------------------- *\
+  Function    : init
+  Description : run this code on page load
+\* ---------------------------------------------------------------------- */
+
+function init() {
+  // change maximize button to minimize button
+  config.btnList["popupeditor"] = ['popupeditor', 'Minimize Editor',  'update_parent(); window.close();', 'fullscreen_minimize.gif'];
+
+  // set htmlmode button to refer to THIS editor
+  config.btnList["htmlmode"]    = ['HtmlMode',    'View HTML Source', 'editor_setmode(\'editor\')',  'ed_html.gif'];
+
+  // change image url to be relative to current path
+  config.imgURL = "../images/";
+  
+  // generate editor and resize it
+  editor_generate('editor', config);
+  resize_editor();
+
+  // switch mode if needed
+  if (parent_config.mode == 'textedit') { editor_setmode(objname, 'textedit'); }
+
+  // set child window contents
+  var parentHTML = opener.editor_getHTML(parent_objname);
+  editor_setHTML(objname, parentHTML);
+
+  // continuously update parent editor window
+  window.setInterval(update_parent, 333);
+
+  // setup event handlers
+  document.body.onkeypress = _CloseOnEsc;
+  window.onresize = resize_editor;
+}
+
+/* ---------------------------------------------------------------------- *\
+  Function    : update_parent
+  Description : update parent window editor field with contents from child window
+\* ---------------------------------------------------------------------- */
+
+function update_parent() {
+  var childHTML = editor_getHTML(objname);
+  opener.editor_setHTML(parent_objname, childHTML);
+}
+
+
+</script>
+</head>
+<body scroll="no" onload="init()" onunload="update_parent()">
+
+<div style="margin: 0 0 0 0; border-width: 1; border-style: solid; border-color: threedshadow threedhighlight threedhighlight threedshadow; "></div>
+
+<textarea name="editor" style="width:100%; height:300px"></textarea><br>
+
+</body></html>
Index: temp/trunk/html/test/naka/HTMLArea/htmlarea.js
===================================================================
--- temp/trunk/html/test/naka/HTMLArea/htmlarea.js	(revision 1694)
+++ temp/trunk/html/test/naka/HTMLArea/htmlarea.js	(revision 1694)
@@ -0,0 +1,2175 @@
+// htmlArea v3.0 - Copyright (c) 2002-2004 interactivetools.com, inc.
+// This copyright notice MUST stay intact for use (see license.txt).
+//
+// Portions (c) dynarch.com, 2003-2004
+//
+// A free WYSIWYG editor replacement for <textarea> fields.
+// For full source code and docs, visit http://www.interactivetools.com/
+//
+// Version 3.0 developed by Mihai Bazon.
+//   http://dynarch.com/mishoo
+//
+// $Id$
+
+if (typeof _editor_url == "string") {
+	// Leave exactly one backslash at the end of _editor_url
+	_editor_url = _editor_url.replace(/\x2f*$/, '/');
+} else {
+	alert("WARNING: _editor_url is not set!  You should set this variable to the editor files path; it should preferably be an absolute path, like in '/htmlarea', but it can be relative if you prefer.  Further we will try to load the editor files correctly but we'll probably fail.");
+	_editor_url = '';
+}
+
+// make sure we have a language
+if (typeof _editor_lang == "string") {
+	_editor_lang = _editor_lang.toLowerCase();
+} else {
+	_editor_lang = "en";
+}
+
+// Creates a new HTMLArea object.  Tries to replace the textarea with the given
+// ID with it.
+function HTMLArea(textarea, config) {
+	if (HTMLArea.checkSupportedBrowser()) {
+		if (typeof config == "undefined") {
+			this.config = new HTMLArea.Config();
+		} else {
+			this.config = config;
+		}
+		this._htmlArea = null;
+		this._textArea = textarea;
+		this._editMode = "wysiwyg";
+		this.plugins = {};
+		this._timerToolbar = null;
+		this._timerUndo = null;
+		this._undoQueue = new Array(this.config.undoSteps);
+		this._undoPos = -1;
+		this._customUndo = false;
+		this._mdoc = document; // cache the document, we need it in plugins
+		this.doctype = '';
+	}
+};
+
+// load some scripts
+(function() {
+	var scripts = HTMLArea._scripts = [ _editor_url + "htmlarea.js",
+					    _editor_url + "dialog.js",
+					    _editor_url + "popupwin.js",
+					    _editor_url + "lang/" + _editor_lang + ".js" ];
+	var head = document.getElementsByTagName("head")[0];
+	// start from 1, htmlarea.js is already loaded
+	for (var i = 1; i < scripts.length; ++i) {
+		var script = document.createElement("script");
+		script.src = scripts[i];
+		head.appendChild(script);
+	}
+})();
+
+// cache some regexps
+HTMLArea.RE_tagName = /(<\/|<)\s*([^ \t\n>]+)/ig;
+HTMLArea.RE_doctype = /(<!doctype((.|\n)*?)>)\n?/i;
+HTMLArea.RE_head    = /<head>((.|\n)*?)<\/head>/i;
+HTMLArea.RE_body    = /<body>((.|\n)*?)<\/body>/i;
+
+HTMLArea.Config = function () {
+	this.version = "3.0";
+
+	this.width = "auto";
+	this.height = "auto";
+
+	// enable creation of a status bar?
+	this.statusBar = true;
+
+	// maximum size of the undo queue
+	this.undoSteps = 20;
+
+	// the time interval at which undo samples are taken
+	this.undoTimeout = 500;	// 1/2 sec.
+
+	// the next parameter specifies whether the toolbar should be included
+	// in the size or not.
+	this.sizeIncludesToolbar = true;
+
+	// if true then HTMLArea will retrieve the full HTML, starting with the
+	// <HTML> tag.
+	this.fullPage = false;
+
+	// style included in the iframe document
+	this.pageStyle = "";
+
+	// set to true if you want Word code to be cleaned upon Paste
+	this.killWordOnPaste = false;
+
+	// BaseURL included in the iframe document
+	this.baseURL = document.baseURI || document.URL;
+	if (this.baseURL && this.baseURL.match(/(.*)\/([^\/]+)/))
+		this.baseURL = RegExp.$1 + "/";
+
+	// URL-s
+	this.imgURL = "images/";
+	this.popupURL = "popups/";
+
+	/** CUSTOMIZING THE TOOLBAR
+	 * -------------------------
+	 *
+	 * It is recommended that you customize the toolbar contents in an
+	 * external file (i.e. the one calling HTMLArea) and leave this one
+	 * unchanged.  That's because when we (InteractiveTools.com) release a
+	 * new official version, it's less likely that you will have problems
+	 * upgrading HTMLArea.
+	 */
+	this.toolbar = [
+		[ "fontname", "space",
+		  "fontsize", "space",
+		  "formatblock", "space",
+		  "bold", "italic", "underline", "strikethrough", "separator",
+		  "subscript", "superscript", "separator",
+		  "copy", "cut", "paste", "space", "undo", "redo" ],
+
+		[ "justifyleft", "justifycenter", "justifyright", "justifyfull", "separator",
+		  "lefttoright", "righttoleft", "separator",
+		  "insertorderedlist", "insertunorderedlist", "outdent", "indent", "separator",
+		  "forecolor", "hilitecolor", "separator",
+		  "inserthorizontalrule", "createlink", "insertimage", "inserttable", "htmlmode", "separator",
+		  "popupeditor", "separator", "showhelp", "about" ]
+	];
+
+	this.fontname = {
+		"Arial":	   'arial,helvetica,sans-serif',
+		"Courier New":	   'courier new,courier,monospace',
+		"Georgia":	   'georgia,times new roman,times,serif',
+		"Tahoma":	   'tahoma,arial,helvetica,sans-serif',
+		"Times New Roman": 'times new roman,times,serif',
+		"Verdana":	   'verdana,arial,helvetica,sans-serif',
+		"impact":	   'impact',
+		"WingDings":	   'wingdings'
+	};
+
+	this.fontsize = {
+		"1 (8 pt)":  "1",
+		"2 (10 pt)": "2",
+		"3 (12 pt)": "3",
+		"4 (14 pt)": "4",
+		"5 (18 pt)": "5",
+		"6 (24 pt)": "6",
+		"7 (36 pt)": "7"
+	};
+
+	this.formatblock = {
+		"Heading 1": "h1",
+		"Heading 2": "h2",
+		"Heading 3": "h3",
+		"Heading 4": "h4",
+		"Heading 5": "h5",
+		"Heading 6": "h6",
+		"Normal": "p",
+		"Address": "address",
+		"Formatted": "pre"
+	};
+
+	this.customSelects = {};
+
+	function cut_copy_paste(e, cmd, obj) {
+		e.execCommand(cmd);
+	};
+
+	// ADDING CUSTOM BUTTONS: please read below!
+	// format of the btnList elements is "ID: [ ToolTip, Icon, Enabled in text mode?, ACTION ]"
+	//    - ID: unique ID for the button.  If the button calls document.execCommand
+	//	    it's wise to give it the same name as the called command.
+	//    - ACTION: function that gets called when the button is clicked.
+	//              it has the following prototype:
+	//                 function(editor, buttonName)
+	//              - editor is the HTMLArea object that triggered the call
+	//              - buttonName is the ID of the clicked button
+	//              These 2 parameters makes it possible for you to use the same
+	//              handler for more HTMLArea objects or for more different buttons.
+	//    - ToolTip: default tooltip, for cases when it is not defined in the -lang- file (HTMLArea.I18N)
+	//    - Icon: path to an icon image file for the button (TODO: use one image for all buttons!)
+	//    - Enabled in text mode: if false the button gets disabled for text-only mode; otherwise enabled all the time.
+	this.btnList = {
+		bold: [ "Bold", "ed_format_bold.gif", false, function(e) {e.execCommand("bold");} ],
+		italic: [ "Italic", "ed_format_italic.gif", false, function(e) {e.execCommand("italic");} ],
+		underline: [ "Underline", "ed_format_underline.gif", false, function(e) {e.execCommand("underline");} ],
+		strikethrough: [ "Strikethrough", "ed_format_strike.gif", false, function(e) {e.execCommand("strikethrough");} ],
+		subscript: [ "Subscript", "ed_format_sub.gif", false, function(e) {e.execCommand("subscript");} ],
+		superscript: [ "Superscript", "ed_format_sup.gif", false, function(e) {e.execCommand("superscript");} ],
+		justifyleft: [ "Justify Left", "ed_align_left.gif", false, function(e) {e.execCommand("justifyleft");} ],
+		justifycenter: [ "Justify Center", "ed_align_center.gif", false, function(e) {e.execCommand("justifycenter");} ],
+		justifyright: [ "Justify Right", "ed_align_right.gif", false, function(e) {e.execCommand("justifyright");} ],
+		justifyfull: [ "Justify Full", "ed_align_justify.gif", false, function(e) {e.execCommand("justifyfull");} ],
+		insertorderedlist: [ "Ordered List", "ed_list_num.gif", false, function(e) {e.execCommand("insertorderedlist");} ],
+		insertunorderedlist: [ "Bulleted List", "ed_list_bullet.gif", false, function(e) {e.execCommand("insertunorderedlist");} ],
+		outdent: [ "Decrease Indent", "ed_indent_less.gif", false, function(e) {e.execCommand("outdent");} ],
+		indent: [ "Increase Indent", "ed_indent_more.gif", false, function(e) {e.execCommand("indent");} ],
+		forecolor: [ "Font Color", "ed_color_fg.gif", false, function(e) {e.execCommand("forecolor");} ],
+		hilitecolor: [ "Background Color", "ed_color_bg.gif", false, function(e) {e.execCommand("hilitecolor");} ],
+		inserthorizontalrule: [ "Horizontal Rule", "ed_hr.gif", false, function(e) {e.execCommand("inserthorizontalrule");} ],
+		createlink: [ "Insert Web Link", "ed_link.gif", false, function(e) {e.execCommand("createlink", true);} ],
+		insertimage: [ "Insert/Modify Image", "ed_image.gif", false, function(e) {e.execCommand("insertimage");} ],
+		inserttable: [ "Insert Table", "insert_table.gif", false, function(e) {e.execCommand("inserttable");} ],
+		htmlmode: [ "Toggle HTML Source", "ed_html.gif", true, function(e) {e.execCommand("htmlmode");} ],
+		popupeditor: [ "Enlarge Editor", "fullscreen_maximize.gif", true, function(e) {e.execCommand("popupeditor");} ],
+		about: [ "About this editor", "ed_about.gif", true, function(e) {e.execCommand("about");} ],
+		showhelp: [ "Help using editor", "ed_help.gif", true, function(e) {e.execCommand("showhelp");} ],
+		undo: [ "Undoes your last action", "ed_undo.gif", false, function(e) {e.execCommand("undo");} ],
+		redo: [ "Redoes your last action", "ed_redo.gif", false, function(e) {e.execCommand("redo");} ],
+		cut: [ "Cut selection", "ed_cut.gif", false, cut_copy_paste ],
+		copy: [ "Copy selection", "ed_copy.gif", false, cut_copy_paste ],
+		paste: [ "Paste from clipboard", "ed_paste.gif", false, cut_copy_paste ],
+		lefttoright: [ "Direction left to right", "ed_left_to_right.gif", false, function(e) {e.execCommand("lefttoright");} ],
+		righttoleft: [ "Direction right to left", "ed_right_to_left.gif", false, function(e) {e.execCommand("righttoleft");} ]
+	};
+	/* ADDING CUSTOM BUTTONS
+	 * ---------------------
+	 *
+	 * It is recommended that you add the custom buttons in an external
+	 * file and leave this one unchanged.  That's because when we
+	 * (InteractiveTools.com) release a new official version, it's less
+	 * likely that you will have problems upgrading HTMLArea.
+	 *
+	 * Example on how to add a custom button when you construct the HTMLArea:
+	 *
+	 *   var editor = new HTMLArea("your_text_area_id");
+	 *   var cfg = editor.config; // this is the default configuration
+	 *   cfg.btnList["my-hilite"] =
+	 *	[ function(editor) { editor.surroundHTML('<span style="background:yellow">', '</span>'); }, // action
+	 *	  "Highlight selection", // tooltip
+	 *	  "my_hilite.gif", // image
+	 *	  false // disabled in text mode
+	 *	];
+	 *   cfg.toolbar.push(["linebreak", "my-hilite"]); // add the new button to the toolbar
+	 *
+	 * An alternate (also more convenient and recommended) way to
+	 * accomplish this is to use the registerButton function below.
+	 */
+	// initialize tooltips from the I18N module and generate correct image path
+	for (var i in this.btnList) {
+		var btn = this.btnList[i];
+		btn[1] = _editor_url + this.imgURL + btn[1];
+		if (typeof HTMLArea.I18N.tooltips[i] != "undefined") {
+			btn[0] = HTMLArea.I18N.tooltips[i];
+		}
+	}
+};
+
+/** Helper function: register a new button with the configuration.  It can be
+ * called with all 5 arguments, or with only one (first one).  When called with
+ * only one argument it must be an object with the following properties: id,
+ * tooltip, image, textMode, action.  Examples:
+ *
+ * 1. config.registerButton("my-hilite", "Hilite text", "my-hilite.gif", false, function(editor) {...});
+ * 2. config.registerButton({
+ *      id       : "my-hilite",      // the ID of your button
+ *      tooltip  : "Hilite text",    // the tooltip
+ *      image    : "my-hilite.gif",  // image to be displayed in the toolbar
+ *      textMode : false,            // disabled in text mode
+ *      action   : function(editor) { // called when the button is clicked
+ *                   editor.surroundHTML('<span class="hilite">', '</span>');
+ *                 },
+ *      context  : "p"               // will be disabled if outside a <p> element
+ *    });
+ */
+HTMLArea.Config.prototype.registerButton = function(id, tooltip, image, textMode, action, context) {
+	var the_id;
+	if (typeof id == "string") {
+		the_id = id;
+	} else if (typeof id == "object") {
+		the_id = id.id;
+	} else {
+		alert("ERROR [HTMLArea.Config::registerButton]:\ninvalid arguments");
+		return false;
+	}
+	// check for existing id
+	if (typeof this.customSelects[the_id] != "undefined") {
+		// alert("WARNING [HTMLArea.Config::registerDropdown]:\nA dropdown with the same ID already exists.");
+	}
+	if (typeof this.btnList[the_id] != "undefined") {
+		// alert("WARNING [HTMLArea.Config::registerDropdown]:\nA button with the same ID already exists.");
+	}
+	switch (typeof id) {
+	    case "string": this.btnList[id] = [ tooltip, image, textMode, action, context ]; break;
+	    case "object": this.btnList[id.id] = [ id.tooltip, id.image, id.textMode, id.action, id.context ]; break;
+	}
+};
+
+/** The following helper function registers a dropdown box with the editor
+ * configuration.  You still have to add it to the toolbar, same as with the
+ * buttons.  Call it like this:
+ *
+ * FIXME: add example
+ */
+HTMLArea.Config.prototype.registerDropdown = function(object) {
+	// check for existing id
+	if (typeof this.customSelects[object.id] != "undefined") {
+		// alert("WARNING [HTMLArea.Config::registerDropdown]:\nA dropdown with the same ID already exists.");
+	}
+	if (typeof this.btnList[object.id] != "undefined") {
+		// alert("WARNING [HTMLArea.Config::registerDropdown]:\nA button with the same ID already exists.");
+	}
+	this.customSelects[object.id] = object;
+};
+
+/** Call this function to remove some buttons/drop-down boxes from the toolbar.
+ * Pass as the only parameter a string containing button/drop-down names
+ * delimited by spaces.  Note that the string should also begin with a space
+ * and end with a space.  Example:
+ *
+ *   config.hideSomeButtons(" fontname fontsize textindicator ");
+ *
+ * It's useful because it's easier to remove stuff from the defaul toolbar than
+ * create a brand new toolbar ;-)
+ */
+HTMLArea.Config.prototype.hideSomeButtons = function(remove) {
+	var toolbar = this.toolbar;
+	for (var i in toolbar) {
+		var line = toolbar[i];
+		for (var j = line.length; --j >= 0; ) {
+			if (remove.indexOf(" " + line[j] + " ") >= 0) {
+				var len = 1;
+				if (/separator|space/.test(line[j + 1])) {
+					len = 2;
+				}
+				line.splice(j, len);
+			}
+		}
+	}
+};
+
+/** Helper function: replace all TEXTAREA-s in the document with HTMLArea-s. */
+HTMLArea.replaceAll = function(config) {
+	var tas = document.getElementsByTagName("textarea");
+	for (var i = tas.length; i > 0; (new HTMLArea(tas[--i], config)).generate());
+};
+
+/** Helper function: replaces the TEXTAREA with the given ID with HTMLArea. */
+HTMLArea.replace = function(id, config) {
+	var ta = HTMLArea.getElementById("textarea", id);
+	return ta ? (new HTMLArea(ta, config)).generate() : null;
+};
+
+// Creates the toolbar and appends it to the _htmlarea
+HTMLArea.prototype._createToolbar = function () {
+	var editor = this;	// to access this in nested functions
+
+	var toolbar = document.createElement("div");
+	this._toolbar = toolbar;
+	toolbar.className = "toolbar";
+	toolbar.unselectable = "1";
+	var tb_row = null;
+	var tb_objects = new Object();
+	this._toolbarObjects = tb_objects;
+
+	// creates a new line in the toolbar
+	function newLine() {
+		var table = document.createElement("table");
+		table.border = "0px";
+		table.cellSpacing = "0px";
+		table.cellPadding = "0px";
+		toolbar.appendChild(table);
+		// TBODY is required for IE, otherwise you don't see anything
+		// in the TABLE.
+		var tb_body = document.createElement("tbody");
+		table.appendChild(tb_body);
+		tb_row = document.createElement("tr");
+		tb_body.appendChild(tb_row);
+	}; // END of function: newLine
+	// init first line
+	newLine();
+
+	// updates the state of a toolbar element.  This function is member of
+	// a toolbar element object (unnamed objects created by createButton or
+	// createSelect functions below).
+	function setButtonStatus(id, newval) {
+		var oldval = this[id];
+		var el = this.element;
+		if (oldval != newval) {
+			switch (id) {
+			    case "enabled":
+				if (newval) {
+					HTMLArea._removeClass(el, "buttonDisabled");
+					el.disabled = false;
+				} else {
+					HTMLArea._addClass(el, "buttonDisabled");
+					el.disabled = true;
+				}
+				break;
+			    case "active":
+				if (newval) {
+					HTMLArea._addClass(el, "buttonPressed");
+				} else {
+					HTMLArea._removeClass(el, "buttonPressed");
+				}
+				break;
+			}
+			this[id] = newval;
+		}
+	}; // END of function: setButtonStatus
+
+	// this function will handle creation of combo boxes.  Receives as
+	// parameter the name of a button as defined in the toolBar config.
+	// This function is called from createButton, above, if the given "txt"
+	// doesn't match a button.
+	function createSelect(txt) {
+		var options = null;
+		var el = null;
+		var cmd = null;
+		var customSelects = editor.config.customSelects;
+		var context = null;
+		switch (txt) {
+		    case "fontsize":
+		    case "fontname":
+		    case "formatblock":
+			// the following line retrieves the correct
+			// configuration option because the variable name
+			// inside the Config object is named the same as the
+			// button/select in the toolbar.  For instance, if txt
+			// == "formatblock" we retrieve config.formatblock (or
+			// a different way to write it in JS is
+			// config["formatblock"].
+			options = editor.config[txt];
+			cmd = txt;
+			break;
+		    default:
+			// try to fetch it from the list of registered selects
+			cmd = txt;
+			var dropdown = customSelects[cmd];
+			if (typeof dropdown != "undefined") {
+				options = dropdown.options;
+				context = dropdown.context;
+			} else {
+				alert("ERROR [createSelect]:\nCan't find the requested dropdown definition");
+			}
+			break;
+		}
+		if (options) {
+			el = document.createElement("select");
+			var obj = {
+				name	: txt, // field name
+				element : el,	// the UI element (SELECT)
+				enabled : true, // is it enabled?
+				text	: false, // enabled in text mode?
+				cmd	: cmd, // command ID
+				state	: setButtonStatus, // for changing state
+				context : context
+			};
+			tb_objects[txt] = obj;
+			for (var i in options) {
+				var op = document.createElement("option");
+				op.appendChild(document.createTextNode(i));
+				op.value = options[i];
+				el.appendChild(op);
+			}
+			HTMLArea._addEvent(el, "change", function () {
+				editor._comboSelected(el, txt);
+			});
+		}
+		return el;
+	}; // END of function: createSelect
+
+	// appends a new button to toolbar
+	function createButton(txt) {
+		// the element that will be created
+		var el = null;
+		var btn = null;
+		switch (txt) {
+		    case "separator":
+			el = document.createElement("div");
+			el.className = "separator";
+			break;
+		    case "space":
+			el = document.createElement("div");
+			el.className = "space";
+			break;
+		    case "linebreak":
+			newLine();
+			return false;
+		    case "textindicator":
+			el = document.createElement("div");
+			el.appendChild(document.createTextNode("A"));
+			el.className = "indicator";
+			el.title = HTMLArea.I18N.tooltips.textindicator;
+			var obj = {
+				name	: txt, // the button name (i.e. 'bold')
+				element : el, // the UI element (DIV)
+				enabled : true, // is it enabled?
+				active	: false, // is it pressed?
+				text	: false, // enabled in text mode?
+				cmd	: "textindicator", // the command ID
+				state	: setButtonStatus // for changing state
+			};
+			tb_objects[txt] = obj;
+			break;
+		    default:
+			btn = editor.config.btnList[txt];
+		}
+		if (!el && btn) {
+			el = document.createElement("div");
+			el.title = btn[0];
+			el.className = "button";
+			// let's just pretend we have a button object, and
+			// assign all the needed information to it.
+			var obj = {
+				name	: txt, // the button name (i.e. 'bold')
+				element : el, // the UI element (DIV)
+				enabled : true, // is it enabled?
+				active	: false, // is it pressed?
+				text	: btn[2], // enabled in text mode?
+				cmd	: btn[3], // the command ID
+				state	: setButtonStatus, // for changing state
+				context : btn[4] || null // enabled in a certain context?
+			};
+			tb_objects[txt] = obj;
+			// handlers to emulate nice flat toolbar buttons
+			HTMLArea._addEvent(el, "mouseover", function () {
+				if (obj.enabled) {
+					HTMLArea._addClass(el, "buttonHover");
+				}
+			});
+			HTMLArea._addEvent(el, "mouseout", function () {
+				if (obj.enabled) with (HTMLArea) {
+					_removeClass(el, "buttonHover");
+					_removeClass(el, "buttonActive");
+					(obj.active) && _addClass(el, "buttonPressed");
+				}
+			});
+			HTMLArea._addEvent(el, "mousedown", function (ev) {
+				if (obj.enabled) with (HTMLArea) {
+					_addClass(el, "buttonActive");
+					_removeClass(el, "buttonPressed");
+					_stopEvent(is_ie ? window.event : ev);
+				}
+			});
+			// when clicked, do the following:
+			HTMLArea._addEvent(el, "click", function (ev) {
+				if (obj.enabled) with (HTMLArea) {
+					_removeClass(el, "buttonActive");
+					_removeClass(el, "buttonHover");
+					obj.cmd(editor, obj.name, obj);
+					_stopEvent(is_ie ? window.event : ev);
+				}
+			});
+			var img = document.createElement("img");
+			img.src = btn[1];
+			img.style.width = "18px";
+			img.style.height = "18px";
+			el.appendChild(img);
+		} else if (!el) {
+			el = createSelect(txt);
+		}
+		if (el) {
+			var tb_cell = document.createElement("td");
+			tb_row.appendChild(tb_cell);
+			tb_cell.appendChild(el);
+		} else {
+			alert("FIXME: Unknown toolbar item: " + txt);
+		}
+		return el;
+	};
+
+	var first = true;
+	for (var i in this.config.toolbar) {
+		if (!first) {
+			createButton("linebreak");
+		} else {
+			first = false;
+		}
+		var group = this.config.toolbar[i];
+		for (var j in group) {
+			var code = group[j];
+			if (/^([IT])\[(.*?)\]/.test(code)) {
+				// special case, create text label
+				var l7ed = RegExp.$1 == "I"; // localized?
+				var label = RegExp.$2;
+				if (l7ed) {
+					label = HTMLArea.I18N.custom[label];
+				}
+				var tb_cell = document.createElement("td");
+				tb_row.appendChild(tb_cell);
+				tb_cell.className = "label";
+				tb_cell.innerHTML = label;
+			} else {
+				createButton(code);
+			}
+		}
+	}
+
+	this._htmlArea.appendChild(toolbar);
+};
+
+HTMLArea.prototype._createStatusBar = function() {
+	var statusbar = document.createElement("div");
+	statusbar.className = "statusBar";
+	this._htmlArea.appendChild(statusbar);
+	this._statusBar = statusbar;
+	// statusbar.appendChild(document.createTextNode(HTMLArea.I18N.msg["Path"] + ": "));
+	// creates a holder for the path view
+	div = document.createElement("span");
+	div.className = "statusBarTree";
+	div.innerHTML = HTMLArea.I18N.msg["Path"] + ": ";
+	this._statusBarTree = div;
+	this._statusBar.appendChild(div);
+	if (!this.config.statusBar) {
+		// disable it...
+		statusbar.style.display = "none";
+	}
+};
+
+// Creates the HTMLArea object and replaces the textarea with it.
+HTMLArea.prototype.generate = function () {
+	var editor = this;	// we'll need "this" in some nested functions
+	// get the textarea
+	var textarea = this._textArea;
+	if (typeof textarea == "string") {
+		// it's not element but ID
+		this._textArea = textarea = HTMLArea.getElementById("textarea", textarea);
+	}
+	this._ta_size = {
+		w: textarea.offsetWidth,
+		h: textarea.offsetHeight
+	};
+	textarea.style.display = "none";
+
+	// create the editor framework
+	var htmlarea = document.createElement("div");
+	htmlarea.className = "htmlarea";
+	this._htmlArea = htmlarea;
+
+	// insert the editor before the textarea.
+	textarea.parentNode.insertBefore(htmlarea, textarea);
+
+	if (textarea.form) {
+		// we have a form, on submit get the HTMLArea content and
+		// update original textarea.
+		var f = textarea.form;
+		if (typeof f.onsubmit == "function") {
+			var funcref = f.onsubmit;
+			if (typeof f.__msh_prevOnSubmit == "undefined") {
+				f.__msh_prevOnSubmit = [];
+			}
+			f.__msh_prevOnSubmit.push(funcref);
+		}
+		f.onsubmit = function() {
+			editor._textArea.value = editor.getHTML();
+			var a = this.__msh_prevOnSubmit;
+			// call previous submit methods if they were there.
+			if (typeof a != "undefined") {
+				for (var i in a) {
+					a[i]();
+				}
+			}
+		};
+	}
+
+	// add a handler for the "back/forward" case -- on body.unload we save
+	// the HTML content into the original textarea.
+	window.onunload = function() {
+		editor._textArea.value = editor.getHTML();
+	};
+
+	// creates & appends the toolbar
+	this._createToolbar();
+
+	// create the IFRAME
+	var iframe = document.createElement("iframe");
+	htmlarea.appendChild(iframe);
+
+	this._iframe = iframe;
+
+	// creates & appends the status bar, if the case
+	this._createStatusBar();
+
+	// remove the default border as it keeps us from computing correctly
+	// the sizes.  (somebody tell me why doesn't this work in IE)
+
+	if (!HTMLArea.is_ie) {
+		iframe.style.borderWidth = "1px";
+	// iframe.frameBorder = "1";
+	// iframe.marginHeight = "0";
+	// iframe.marginWidth = "0";
+	}
+
+	// size the IFRAME according to user's prefs or initial textarea
+	var height = (this.config.height == "auto" ? (this._ta_size.h + "px") : this.config.height);
+	height = parseInt(height);
+	var width = (this.config.width == "auto" ? (this._ta_size.w + "px") : this.config.width);
+	width = parseInt(width);
+
+	if (!HTMLArea.is_ie) {
+		height -= 2;
+		width -= 2;
+	}
+
+	iframe.style.width = width + "px";
+	if (this.config.sizeIncludesToolbar) {
+		// substract toolbar height
+		height -= this._toolbar.offsetHeight;
+		height -= this._statusBar.offsetHeight;
+	}
+	if (height < 0) {
+		height = 0;
+	}
+	iframe.style.height = height + "px";
+
+	// the editor including the toolbar now have the same size as the
+	// original textarea.. which means that we need to reduce that a bit.
+	textarea.style.width = iframe.style.width;
+ 	textarea.style.height = iframe.style.height;
+
+	// IMPORTANT: we have to allow Mozilla a short time to recognize the
+	// new frame.  Otherwise we get a stupid exception.
+	function initIframe() {
+		var doc = editor._iframe.contentWindow.document;
+		if (!doc) {
+			// Try again..
+			// FIXME: don't know what else to do here.  Normally
+			// we'll never reach this point.
+			if (HTMLArea.is_gecko) {
+				setTimeout(initIframe, 100);
+				return false;
+			} else {
+				alert("ERROR: IFRAME can't be initialized.");
+			}
+		}
+		if (HTMLArea.is_gecko) {
+			// enable editable mode for Mozilla
+			doc.designMode = "on";
+		}
+		editor._doc = doc;
+		if (!editor.config.fullPage) {
+			doc.open();
+			var html = "<html>\n";
+			html += "<head>\n";
+			if (editor.config.baseURL)
+				html += '<base href="' + editor.config.baseURL + '" />';
+			html += "<style> html,body { border: 0px; } " +
+				editor.config.pageStyle + "</style>\n";
+			html += "</head>\n";
+			html += "<body>\n";
+			html += editor._textArea.value;
+			html += "</body>\n";
+			html += "</html>";
+			doc.write(html);
+			doc.close();
+		} else {
+			var html = editor._textArea.value;
+			if (html.match(HTMLArea.RE_doctype)) {
+				editor.setDoctype(RegExp.$1);
+				html = html.replace(HTMLArea.RE_doctype, "");
+			}
+			doc.open();
+			doc.write(html);
+			doc.close();
+		}
+
+		if (HTMLArea.is_ie) {
+			// enable editable mode for IE.	 For some reason this
+			// doesn't work if done in the same place as for Gecko
+			// (above).
+			doc.body.contentEditable = true;
+		}
+
+		editor.focusEditor();
+		// intercept some events; for updating the toolbar & keyboard handlers
+		HTMLArea._addEvents
+			(doc, ["keydown", "keypress", "mousedown", "mouseup", "drag"],
+			 function (event) {
+				 return editor._editorEvent(HTMLArea.is_ie ? editor._iframe.contentWindow.event : event);
+			 });
+
+		// check if any plugins have registered refresh handlers
+		for (var i in editor.plugins) {
+			var plugin = editor.plugins[i].instance;
+			if (typeof plugin.onGenerate == "function")
+				plugin.onGenerate();
+		}
+
+		setTimeout(function() {
+			editor.updateToolbar();
+		}, 250);
+
+		if (typeof editor.onGenerate == "function")
+			editor.onGenerate();
+	};
+	setTimeout(initIframe, 100);
+};
+
+// Switches editor mode; parameter can be "textmode" or "wysiwyg".  If no
+// parameter was passed this function toggles between modes.
+HTMLArea.prototype.setMode = function(mode) {
+	if (typeof mode == "undefined") {
+		mode = ((this._editMode == "textmode") ? "wysiwyg" : "textmode");
+	}
+	switch (mode) {
+	    case "textmode":
+		this._textArea.value = this.getHTML();
+		this._iframe.style.display = "none";
+		this._textArea.style.display = "block";
+		if (this.config.statusBar) {
+			this._statusBar.innerHTML = HTMLArea.I18N.msg["TEXT_MODE"];
+		}
+		break;
+	    case "wysiwyg":
+		if (HTMLArea.is_gecko) {
+			// disable design mode before changing innerHTML
+			try {
+				this._doc.designMode = "off";
+			} catch(e) {};
+		}
+		if (!this.config.fullPage)
+			this._doc.body.innerHTML = this.getHTML();
+		else
+			this.setFullHTML(this.getHTML());
+		this._iframe.style.display = "block";
+		this._textArea.style.display = "none";
+		if (HTMLArea.is_gecko) {
+			// we need to refresh that info for Moz-1.3a
+			try {
+				this._doc.designMode = "on";
+			} catch(e) {};
+		}
+		if (this.config.statusBar) {
+			this._statusBar.innerHTML = '';
+			this._statusBar.appendChild(document.createTextNode(HTMLArea.I18N.msg["Path"] + ": "));
+			this._statusBar.appendChild(this._statusBarTree);
+		}
+		break;
+	    default:
+		alert("Mode <" + mode + "> not defined!");
+		return false;
+	}
+	this._editMode = mode;
+	this.focusEditor();
+};
+
+HTMLArea.prototype.setFullHTML = function(html) {
+	var save_multiline = RegExp.multiline;
+	RegExp.multiline = true;
+	if (html.match(HTMLArea.RE_doctype)) {
+		this.setDoctype(RegExp.$1);
+		html = html.replace(HTMLArea.RE_doctype, "");
+	}
+	RegExp.multiline = save_multiline;
+	if (!HTMLArea.is_ie) {
+		if (html.match(HTMLArea.RE_head))
+			this._doc.getElementsByTagName("head")[0].innerHTML = RegExp.$1;
+		if (html.match(HTMLArea.RE_body))
+			this._doc.getElementsByTagName("body")[0].innerHTML = RegExp.$1;
+	} else {
+		var html_re = /<html>((.|\n)*?)<\/html>/i;
+		html = html.replace(html_re, "$1");
+		this._doc.open();
+		this._doc.write(html);
+		this._doc.close();
+		this._doc.body.contentEditable = true;
+		return true;
+	}
+};
+
+/***************************************************
+ *  Category: PLUGINS
+ ***************************************************/
+
+// this is the variant of the function above where the plugin arguments are
+// already packed in an array.  Externally, it should be only used in the
+// full-screen editor code, in order to initialize plugins with the same
+// parameters as in the opener window.
+HTMLArea.prototype.registerPlugin2 = function(plugin, args) {
+	if (typeof plugin == "string")
+		plugin = eval(plugin);
+	var obj = new plugin(this, args);
+	if (obj) {
+		var clone = {};
+		var info = plugin._pluginInfo;
+		for (var i in info)
+			clone[i] = info[i];
+		clone.instance = obj;
+		clone.args = args;
+		this.plugins[plugin._pluginInfo.name] = clone;
+	} else
+		alert("Can't register plugin " + plugin.toString() + ".");
+};
+
+// Create the specified plugin and register it with this HTMLArea
+HTMLArea.prototype.registerPlugin = function() {
+	var plugin = arguments[0];
+	var args = [];
+	for (var i = 1; i < arguments.length; ++i)
+		args.push(arguments[i]);
+	this.registerPlugin2(plugin, args);
+};
+
+// static function that loads the required plugin and lang file, based on the
+// language loaded already for HTMLArea.  You better make sure that the plugin
+// _has_ that language, otherwise shit might happen ;-)
+HTMLArea.loadPlugin = function(pluginName) {
+	var dir = _editor_url + "plugins/" + pluginName;
+	var plugin = pluginName.replace(/([a-z])([A-Z])([a-z])/g,
+					function (str, l1, l2, l3) {
+						return l1 + "-" + l2.toLowerCase() + l3;
+					}).toLowerCase() + ".js";
+	var plugin_file = dir + "/" + plugin;
+	var plugin_lang = dir + "/lang/" + HTMLArea.I18N.lang + ".js";
+	HTMLArea._scripts.push(plugin_file, plugin_lang);
+	document.write("<script type='text/javascript' src='" + plugin_file + "'></script>");
+	document.write("<script type='text/javascript' src='" + plugin_lang + "'></script>");
+};
+
+HTMLArea.loadStyle = function(style, plugin) {
+	var url = _editor_url || '';
+	if (typeof plugin != "undefined") {
+		url += "plugins/" + plugin + "/";
+	}
+	url += style;
+	document.write("<style type='text/css'>@import url(" + url + ");</style>");
+};
+HTMLArea.loadStyle("htmlarea.css");
+
+/***************************************************
+ *  Category: EDITOR UTILITIES
+ ***************************************************/
+
+// The following function is a slight variation of the word cleaner code posted
+// by Weeezl (user @ InteractiveTools forums).
+HTMLArea.prototype._wordClean = function() {
+	var D = this.getInnerHTML();
+	if (D.indexOf('class=Mso') >= 0) {
+
+		// make one line
+		D = D.replace(/\r\n/g, ' ').
+			replace(/\n/g, ' ').
+			replace(/\r/g, ' ').
+			replace(/\&nbsp\;/g,' ');
+
+		// keep tags, strip attributes
+		D = D.replace(/ class=[^\s|>]*/gi,'').
+			//replace(/<p [^>]*TEXT-ALIGN: justify[^>]*>/gi,'<p align="justify">').
+			replace(/ style=\"[^>]*\"/gi,'').
+			replace(/ align=[^\s|>]*/gi,'');
+
+		//clean up tags
+		D = D.replace(/<b [^>]*>/gi,'<b>').
+			replace(/<i [^>]*>/gi,'<i>').
+			replace(/<li [^>]*>/gi,'<li>').
+			replace(/<ul [^>]*>/gi,'<ul>');
+
+		// replace outdated tags
+		D = D.replace(/<b>/gi,'<strong>').
+			replace(/<\/b>/gi,'</strong>');
+
+		// mozilla doesn't like <em> tags
+		D = D.replace(/<em>/gi,'<i>').
+			replace(/<\/em>/gi,'</i>');
+
+		// kill unwanted tags
+		D = D.replace(/<\?xml:[^>]*>/g, '').       // Word xml
+			replace(/<\/?st1:[^>]*>/g,'').     // Word SmartTags
+			replace(/<\/?[a-z]\:[^>]*>/g,'').  // All other funny Word non-HTML stuff
+			replace(/<\/?font[^>]*>/gi,'').    // Disable if you want to keep font formatting
+			replace(/<\/?span[^>]*>/gi,' ').
+			replace(/<\/?div[^>]*>/gi,' ').
+			replace(/<\/?pre[^>]*>/gi,' ').
+			replace(/<\/?h[1-6][^>]*>/gi,' ');
+
+		//remove empty tags
+		//D = D.replace(/<strong><\/strong>/gi,'').
+		//replace(/<i><\/i>/gi,'').
+		//replace(/<P[^>]*><\/P>/gi,'');
+
+		// nuke double tags
+		oldlen = D.length + 1;
+		while(oldlen > D.length) {
+			oldlen = D.length;
+			// join us now and free the tags, we'll be free hackers, we'll be free... ;-)
+			D = D.replace(/<([a-z][a-z]*)> *<\/\1>/gi,' ').
+				replace(/<([a-z][a-z]*)> *<([a-z][^>]*)> *<\/\1>/gi,'<$2>');
+		}
+		D = D.replace(/<([a-z][a-z]*)><\1>/gi,'<$1>').
+			replace(/<\/([a-z][a-z]*)><\/\1>/gi,'<\/$1>');
+
+		// nuke double spaces
+		D = D.replace(/  */gi,' ');
+
+		this.setHTML(D);
+		this.updateToolbar();
+	}
+};
+
+HTMLArea.prototype.forceRedraw = function() {
+	this._doc.body.style.visibility = "hidden";
+	this._doc.body.style.visibility = "visible";
+	// this._doc.body.innerHTML = this.getInnerHTML();
+};
+
+// focuses the iframe window.  returns a reference to the editor document.
+HTMLArea.prototype.focusEditor = function() {
+	switch (this._editMode) {
+	    case "wysiwyg" : this._iframe.contentWindow.focus(); break;
+	    case "textmode": this._textArea.focus(); break;
+	    default	   : alert("ERROR: mode " + this._editMode + " is not defined");
+	}
+	return this._doc;
+};
+
+// takes a snapshot of the current text (for undo)
+HTMLArea.prototype._undoTakeSnapshot = function() {
+	++this._undoPos;
+	if (this._undoPos >= this.config.undoSteps) {
+		// remove the first element
+		this._undoQueue.shift();
+		--this._undoPos;
+	}
+	// use the fasted method (getInnerHTML);
+	var take = true;
+	var txt = this.getInnerHTML();
+	if (this._undoPos > 0)
+		take = (this._undoQueue[this._undoPos - 1] != txt);
+	if (take) {
+		this._undoQueue[this._undoPos] = txt;
+	} else {
+		this._undoPos--;
+	}
+};
+
+HTMLArea.prototype.undo = function() {
+	if (this._undoPos > 0) {
+		var txt = this._undoQueue[--this._undoPos];
+		if (txt) this.setHTML(txt);
+		else ++this._undoPos;
+	}
+};
+
+HTMLArea.prototype.redo = function() {
+	if (this._undoPos < this._undoQueue.length - 1) {
+		var txt = this._undoQueue[++this._undoPos];
+		if (txt) this.setHTML(txt);
+		else --this._undoPos;
+	}
+};
+
+// updates enabled/disable/active state of the toolbar elements
+HTMLArea.prototype.updateToolbar = function(noStatus) {
+	var doc = this._doc;
+	var text = (this._editMode == "textmode");
+	var ancestors = null;
+	if (!text) {
+		ancestors = this.getAllAncestors();
+		if (this.config.statusBar && !noStatus) {
+			this._statusBarTree.innerHTML = HTMLArea.I18N.msg["Path"] + ": "; // clear
+			for (var i = ancestors.length; --i >= 0;) {
+				var el = ancestors[i];
+				if (!el) {
+					// hell knows why we get here; this
+					// could be a classic example of why
+					// it's good to check for conditions
+					// that are impossible to happen ;-)
+					continue;
+				}
+				var a = document.createElement("a");
+				a.href = "#";
+				a.el = el;
+				a.editor = this;
+				a.onclick = function() {
+					this.blur();
+					this.editor.selectNodeContents(this.el);
+					this.editor.updateToolbar(true);
+					return false;
+				};
+				a.oncontextmenu = function() {
+					// TODO: add context menu here
+					this.blur();
+					var info = "Inline style:\n\n";
+					info += this.el.style.cssText.split(/;\s*/).join(";\n");
+					alert(info);
+					return false;
+				};
+				var txt = el.tagName.toLowerCase();
+				a.title = el.style.cssText;
+				if (el.id) {
+					txt += "#" + el.id;
+				}
+				if (el.className) {
+					txt += "." + el.className;
+				}
+				a.appendChild(document.createTextNode(txt));
+				this._statusBarTree.appendChild(a);
+				if (i != 0) {
+					this._statusBarTree.appendChild(document.createTextNode(String.fromCharCode(0xbb)));
+				}
+			}
+		}
+	}
+	for (var i in this._toolbarObjects) {
+		var btn = this._toolbarObjects[i];
+		var cmd = i;
+		var inContext = true;
+		if (btn.context && !text) {
+			inContext = false;
+			var context = btn.context;
+			var attrs = [];
+			if (/(.*)\[(.*?)\]/.test(context)) {
+				context = RegExp.$1;
+				attrs = RegExp.$2.split(",");
+			}
+			context = context.toLowerCase();
+			var match = (context == "*");
+			for (var k in ancestors) {
+				if (!ancestors[k]) {
+					// the impossible really happens.
+					continue;
+				}
+				if (match || (ancestors[k].tagName.toLowerCase() == context)) {
+					inContext = true;
+					for (var ka in attrs) {
+						if (!eval("ancestors[k]." + attrs[ka])) {
+							inContext = false;
+							break;
+						}
+					}
+					if (inContext) {
+						break;
+					}
+				}
+			}
+		}
+		btn.state("enabled", (!text || btn.text) && inContext);
+		if (typeof cmd == "function") {
+			continue;
+		}
+		// look-it-up in the custom dropdown boxes
+		var dropdown = this.config.customSelects[cmd];
+		if ((!text || btn.text) && (typeof dropdown != "undefined")) {
+			dropdown.refresh(this);
+			continue;
+		}
+		switch (cmd) {
+		    case "fontname":
+		    case "fontsize":
+		    case "formatblock":
+			if (!text) try {
+				var value = ("" + doc.queryCommandValue(cmd)).toLowerCase();
+				if (!value) {
+					// FIXME: what do we do here?
+					break;
+				}
+				// HACK -- retrieve the config option for this
+				// combo box.  We rely on the fact that the
+				// variable in config has the same name as
+				// button name in the toolbar.
+				var options = this.config[cmd];
+				var k = 0;
+				// btn.element.selectedIndex = 0;
+				for (var j in options) {
+					// FIXME: the following line is scary.
+					if ((j.toLowerCase() == value) ||
+					    (options[j].substr(0, value.length).toLowerCase() == value)) {
+						btn.element.selectedIndex = k;
+						break;
+					}
+					++k;
+				}
+			} catch(e) {};
+			break;
+		    case "textindicator":
+			if (!text) {
+				try {with (btn.element.style) {
+					backgroundColor = HTMLArea._makeColor(
+						doc.queryCommandValue(HTMLArea.is_ie ? "backcolor" : "hilitecolor"));
+					if (/transparent/i.test(backgroundColor)) {
+						// Mozilla
+						backgroundColor = HTMLArea._makeColor(doc.queryCommandValue("backcolor"));
+					}
+					color = HTMLArea._makeColor(doc.queryCommandValue("forecolor"));
+					fontFamily = doc.queryCommandValue("fontname");
+					fontWeight = doc.queryCommandState("bold") ? "bold" : "normal";
+					fontStyle = doc.queryCommandState("italic") ? "italic" : "normal";
+				}} catch (e) {
+					// alert(e + "\n\n" + cmd);
+				}
+			}
+			break;
+		    case "htmlmode": btn.state("active", text); break;
+		    case "lefttoright":
+		    case "righttoleft":
+			var el = this.getParentElement();
+			while (el && !HTMLArea.isBlockElement(el))
+				el = el.parentNode;
+			if (el)
+				btn.state("active", (el.style.direction == ((cmd == "righttoleft") ? "rtl" : "ltr")));
+			break;
+		    default:
+			try {
+				btn.state("active", (!text && doc.queryCommandState(cmd)));
+			} catch (e) {}
+		}
+	}
+	// take undo snapshots
+	if (this._customUndo && !this._timerUndo) {
+		this._undoTakeSnapshot();
+		var editor = this;
+		this._timerUndo = setTimeout(function() {
+			editor._timerUndo = null;
+		}, this.config.undoTimeout);
+	}
+	// check if any plugins have registered refresh handlers
+	for (var i in this.plugins) {
+		var plugin = this.plugins[i].instance;
+		if (typeof plugin.onUpdateToolbar == "function")
+			plugin.onUpdateToolbar();
+	}
+};
+
+/** Returns a node after which we can insert other nodes, in the current
+ * selection.  The selection is removed.  It splits a text node, if needed.
+ */
+HTMLArea.prototype.insertNodeAtSelection = function(toBeInserted) {
+	if (!HTMLArea.is_ie) {
+		var sel = this._getSelection();
+		var range = this._createRange(sel);
+		// remove the current selection
+		sel.removeAllRanges();
+		range.deleteContents();
+		var node = range.startContainer;
+		var pos = range.startOffset;
+		switch (node.nodeType) {
+		    case 3: // Node.TEXT_NODE
+			// we have to split it at the caret position.
+			if (toBeInserted.nodeType == 3) {
+				// do optimized insertion
+				node.insertData(pos, toBeInserted.data);
+				range = this._createRange();
+				range.setEnd(node, pos + toBeInserted.length);
+				range.setStart(node, pos + toBeInserted.length);
+				sel.addRange(range);
+			} else {
+				node = node.splitText(pos);
+				var selnode = toBeInserted;
+				if (toBeInserted.nodeType == 11 /* Node.DOCUMENT_FRAGMENT_NODE */) {
+					selnode = selnode.firstChild;
+				}
+				node.parentNode.insertBefore(toBeInserted, node);
+				this.selectNodeContents(selnode);
+				this.updateToolbar();
+			}
+			break;
+		    case 1: // Node.ELEMENT_NODE
+			var selnode = toBeInserted;
+			if (toBeInserted.nodeType == 11 /* Node.DOCUMENT_FRAGMENT_NODE */) {
+				selnode = selnode.firstChild;
+			}
+			node.insertBefore(toBeInserted, node.childNodes[pos]);
+			this.selectNodeContents(selnode);
+			this.updateToolbar();
+			break;
+		}
+	} else {
+		return null;	// this function not yet used for IE <FIXME>
+	}
+};
+
+// Returns the deepest node that contains both endpoints of the selection.
+HTMLArea.prototype.getParentElement = function() {
+	var sel = this._getSelection();
+	var range = this._createRange(sel);
+	if (HTMLArea.is_ie) {
+		switch (sel.type) {
+		    case "Text":
+		    case "None":
+			// It seems that even for selection of type "None",
+			// there _is_ a parent element and it's value is not
+			// only correct, but very important to us.  MSIE is
+			// certainly the buggiest browser in the world and I
+			// wonder, God, how can Earth stand it?
+			return range.parentElement();
+		    case "Control":
+			return range.item(0);
+		    default:
+			return this._doc.body;
+		}
+	} else try {
+		var p = range.commonAncestorContainer;
+		if (!range.collapsed && range.startContainer == range.endContainer &&
+		    range.startOffset - range.endOffset <= 1 && range.startContainer.hasChildNodes())
+			p = range.startContainer.childNodes[range.startOffset];
+		/*
+		alert(range.startContainer + ":" + range.startOffset + "\n" +
+		      range.endContainer + ":" + range.endOffset);
+		*/
+		while (p.nodeType == 3) {
+			p = p.parentNode;
+		}
+		return p;
+	} catch (e) {
+		return null;
+	}
+};
+
+// Returns an array with all the ancestor nodes of the selection.
+HTMLArea.prototype.getAllAncestors = function() {
+	var p = this.getParentElement();
+	var a = [];
+	while (p && (p.nodeType == 1) && (p.tagName.toLowerCase() != 'body')) {
+		a.push(p);
+		p = p.parentNode;
+	}
+	a.push(this._doc.body);
+	return a;
+};
+
+// Selects the contents inside the given node
+HTMLArea.prototype.selectNodeContents = function(node, pos) {
+	this.focusEditor();
+	this.forceRedraw();
+	var range;
+	var collapsed = (typeof pos != "undefined");
+	if (HTMLArea.is_ie) {
+		range = this._doc.body.createTextRange();
+		range.moveToElementText(node);
+		(collapsed) && range.collapse(pos);
+		range.select();
+	} else {
+		var sel = this._getSelection();
+		range = this._doc.createRange();
+		range.selectNodeContents(node);
+		(collapsed) && range.collapse(pos);
+		sel.removeAllRanges();
+		sel.addRange(range);
+	}
+};
+
+/** Call this function to insert HTML code at the current position.  It deletes
+ * the selection, if any.
+ */
+HTMLArea.prototype.insertHTML = function(html) {
+	var sel = this._getSelection();
+	var range = this._createRange(sel);
+	if (HTMLArea.is_ie) {
+		range.pasteHTML(html);
+	} else {
+		// construct a new document fragment with the given HTML
+		var fragment = this._doc.createDocumentFragment();
+		var div = this._doc.createElement("div");
+		div.innerHTML = html;
+		while (div.firstChild) {
+			// the following call also removes the node from div
+			fragment.appendChild(div.firstChild);
+		}
+		// this also removes the selection
+		var node = this.insertNodeAtSelection(fragment);
+	}
+};
+
+/**
+ *  Call this function to surround the existing HTML code in the selection with
+ *  your tags.  FIXME: buggy!  This function will be deprecated "soon".
+ */
+HTMLArea.prototype.surroundHTML = function(startTag, endTag) {
+	var html = this.getSelectedHTML();
+	// the following also deletes the selection
+	this.insertHTML(startTag + html + endTag);
+};
+
+/// Retrieve the selected block
+HTMLArea.prototype.getSelectedHTML = function() {
+	var sel = this._getSelection();
+	var range = this._createRange(sel);
+	var existing = null;
+	if (HTMLArea.is_ie) {
+		existing = range.htmlText;
+	} else {
+		existing = HTMLArea.getHTML(range.cloneContents(), false, this);
+	}
+	return existing;
+};
+
+/// Return true if we have some selection
+HTMLArea.prototype.hasSelectedText = function() {
+	// FIXME: come _on_ mishoo, you can do better than this ;-)
+	return this.getSelectedHTML() != '';
+};
+
+HTMLArea.prototype._createLink = function(link) {
+	var editor = this;
+	var outparam = null;
+	if (typeof link == "undefined") {
+		link = this.getParentElement();
+		if (link && !/^a$/i.test(link.tagName))
+			link = null;
+	}
+	if (link) outparam = {
+		f_href   : HTMLArea.is_ie ? editor.stripBaseURL(link.href) : link.getAttribute("href"),
+		f_title  : link.title,
+		f_target : link.target
+	};
+	this._popupDialog("link.html", function(param) {
+		if (!param)
+			return false;
+		var a = link;
+		if (!a) {
+			editor._doc.execCommand("createlink", false, param.f_href);
+			a = editor.getParentElement();
+			var sel = editor._getSelection();
+			var range = editor._createRange(sel);
+			if (!HTMLArea.is_ie) {
+				a = range.startContainer;
+				if (!/^a$/i.test(a.tagName))
+					a = a.nextSibling;
+			}
+		} else a.href = param.f_href.trim();
+		if (!/^a$/i.test(a.tagName))
+			return false;
+		a.target = param.f_target.trim();
+		a.title = param.f_title.trim();
+		editor.selectNodeContents(a);
+		editor.updateToolbar();
+	}, outparam);
+};
+
+// Called when the user clicks on "InsertImage" button.  If an image is already
+// there, it will just modify it's properties.
+HTMLArea.prototype._insertImage = function(image) {
+	var editor = this;	// for nested functions
+	var outparam = null;
+	if (typeof image == "undefined") {
+		image = this.getParentElement();
+		if (image && !/^img$/i.test(image.tagName))
+			image = null;
+	}
+	if (image) outparam = {
+		f_url    : HTMLArea.is_ie ? editor.stripBaseURL(image.src) : image.getAttribute("src"),
+		f_alt    : image.alt,
+		f_border : image.border,
+		f_align  : image.align,
+		f_vert   : image.vspace,
+		f_horiz  : image.hspace
+	};
+	this._popupDialog("insert_image.html", function(param) {
+		if (!param) {	// user must have pressed Cancel
+			return false;
+		}
+		var img = image;
+		if (!img) {
+			var sel = editor._getSelection();
+			var range = editor._createRange(sel);
+			editor._doc.execCommand("insertimage", false, param.f_url);
+			if (HTMLArea.is_ie) {
+				img = range.parentElement();
+				// wonder if this works...
+				if (img.tagName.toLowerCase() != "img") {
+					img = img.previousSibling;
+				}
+			} else {
+				img = range.startContainer.previousSibling;
+			}
+		} else {
+			img.src = param.f_url;
+		}
+		for (field in param) {
+			var value = param[field];
+			switch (field) {
+			    case "f_alt"    : img.alt	 = value; break;
+			    case "f_border" : img.border = parseInt(value || "0"); break;
+			    case "f_align"  : img.align	 = value; break;
+			    case "f_vert"   : img.vspace = parseInt(value || "0"); break;
+			    case "f_horiz"  : img.hspace = parseInt(value || "0"); break;
+			}
+		}
+	}, outparam);
+};
+
+// Called when the user clicks the Insert Table button
+HTMLArea.prototype._insertTable = function() {
+	var sel = this._getSelection();
+	var range = this._createRange(sel);
+	var editor = this;	// for nested functions
+	this._popupDialog("insert_table.html", function(param) {
+		if (!param) {	// user must have pressed Cancel
+			return false;
+		}
+		var doc = editor._doc;
+		// create the table element
+		var table = doc.createElement("table");
+		// assign the given arguments
+		for (var field in param) {
+			var value = param[field];
+			if (!value) {
+				continue;
+			}
+			switch (field) {
+			    case "f_width"   : table.style.width = value + param["f_unit"]; break;
+			    case "f_align"   : table.align	 = value; break;
+			    case "f_border"  : table.border	 = parseInt(value); break;
+			    case "f_spacing" : table.cellspacing = parseInt(value); break;
+			    case "f_padding" : table.cellpadding = parseInt(value); break;
+			}
+		}
+		var tbody = doc.createElement("tbody");
+		table.appendChild(tbody);
+		for (var i = 0; i < param["f_rows"]; ++i) {
+			var tr = doc.createElement("tr");
+			tbody.appendChild(tr);
+			for (var j = 0; j < param["f_cols"]; ++j) {
+				var td = doc.createElement("td");
+				tr.appendChild(td);
+				// Mozilla likes to see something inside the cell.
+				(HTMLArea.is_gecko) && td.appendChild(doc.createElement("br"));
+			}
+		}
+		if (HTMLArea.is_ie) {
+			range.pasteHTML(table.outerHTML);
+		} else {
+			// insert the table
+			editor.insertNodeAtSelection(table);
+		}
+		return true;
+	}, null);
+};
+
+/***************************************************
+ *  Category: EVENT HANDLERS
+ ***************************************************/
+
+// el is reference to the SELECT object
+// txt is the name of the select field, as in config.toolbar
+HTMLArea.prototype._comboSelected = function(el, txt) {
+	this.focusEditor();
+	var value = el.options[el.selectedIndex].value;
+	switch (txt) {
+	    case "fontname":
+	    case "fontsize": this.execCommand(txt, false, value); break;
+	    case "formatblock":
+		(HTMLArea.is_ie) && (value = "<" + value + ">");
+		this.execCommand(txt, false, value);
+		break;
+	    default:
+		// try to look it up in the registered dropdowns
+		var dropdown = this.config.customSelects[txt];
+		if (typeof dropdown != "undefined") {
+			dropdown.action(this);
+		} else {
+			alert("FIXME: combo box " + txt + " not implemented");
+		}
+	}
+};
+
+// the execCommand function (intercepts some commands and replaces them with
+// our own implementation)
+HTMLArea.prototype.execCommand = function(cmdID, UI, param) {
+	var editor = this;	// for nested functions
+	this.focusEditor();
+	cmdID = cmdID.toLowerCase();
+	switch (cmdID) {
+	    case "htmlmode" : this.setMode(); break;
+	    case "hilitecolor":
+		(HTMLArea.is_ie) && (cmdID = "backcolor");
+	    case "forecolor":
+		this._popupDialog("select_color.html", function(color) {
+			if (color) { // selection not canceled
+				editor._doc.execCommand(cmdID, false, "#" + color);
+			}
+		}, HTMLArea._colorToRgb(this._doc.queryCommandValue(cmdID)));
+		break;
+	    case "createlink":
+		this._createLink();
+		break;
+	    case "popupeditor":
+		// this object will be passed to the newly opened window
+		HTMLArea._object = this;
+		if (HTMLArea.is_ie) {
+			//if (confirm(HTMLArea.I18N.msg["IE-sucks-full-screen"]))
+			{
+				window.open(this.popupURL("fullscreen.html"), "ha_fullscreen",
+					    "toolbar=no,location=no,directories=no,status=no,menubar=no," +
+					    "scrollbars=no,resizable=yes,width=640,height=480");
+			}
+		} else {
+			window.open(this.popupURL("fullscreen.html"), "ha_fullscreen",
+				    "toolbar=no,menubar=no,personalbar=no,width=640,height=480," +
+				    "scrollbars=no,resizable=yes");
+		}
+		break;
+	    case "undo":
+	    case "redo":
+		if (this._customUndo)
+			this[cmdID]();
+		else
+			this._doc.execCommand(cmdID, UI, param);
+		break;
+	    case "inserttable": this._insertTable(); break;
+	    case "insertimage": this._insertImage(); break;
+	    case "about"    : this._popupDialog("about.html", null, this); break;
+	    case "showhelp" : window.open(_editor_url + "reference.html", "ha_help"); break;
+
+	    case "killword": this._wordClean(); break;
+
+	    case "cut":
+	    case "copy":
+	    case "paste":
+		try {
+			if (this.config.killWordOnPaste)
+				this._wordClean();
+			this._doc.execCommand(cmdID, UI, param);
+		} catch (e) {
+			if (HTMLArea.is_gecko) {
+				if (confirm("Unprivileged scripts cannot access Cut/Copy/Paste programatically " +
+					    "for security reasons.  Click OK to see a technical note at mozilla.org " +
+					    "which shows you how to allow a script to access the clipboard."))
+					window.open("http://mozilla.org/editor/midasdemo/securityprefs.html");
+			}
+		}
+		break;
+	    case "lefttoright":
+	    case "righttoleft":
+		var dir = (cmdID == "righttoleft") ? "rtl" : "ltr";
+		var el = this.getParentElement();
+		while (el && !HTMLArea.isBlockElement(el))
+			el = el.parentNode;
+		if (el) {
+			if (el.style.direction == dir)
+				el.style.direction = "";
+			else
+				el.style.direction = dir;
+		}
+		break;
+	    default: this._doc.execCommand(cmdID, UI, param);
+	}
+	this.updateToolbar();
+	return false;
+};
+
+/** A generic event handler for things that happen in the IFRAME's document.
+ * This function also handles key bindings. */
+HTMLArea.prototype._editorEvent = function(ev) {
+	var editor = this;
+	var keyEvent = (HTMLArea.is_ie && ev.type == "keydown") || (ev.type == "keypress");
+	if (keyEvent) {
+		for (var i in editor.plugins) {
+			var plugin = editor.plugins[i].instance;
+			if (typeof plugin.onKeyPress == "function") plugin.onKeyPress(ev);
+		}
+	}
+	if (keyEvent && ev.ctrlKey) {
+		var sel = null;
+		var range = null;
+		var key = String.fromCharCode(HTMLArea.is_ie ? ev.keyCode : ev.charCode).toLowerCase();
+		var cmd = null;
+		var value = null;
+		switch (key) {
+		    case 'a':
+			if (!HTMLArea.is_ie) {
+				// KEY select all
+				sel = this._getSelection();
+				sel.removeAllRanges();
+				range = this._createRange();
+				range.selectNodeContents(this._doc.body);
+				sel.addRange(range);
+				HTMLArea._stopEvent(ev);
+			}
+			break;
+
+			// simple key commands follow
+
+		    case 'b': cmd = "bold"; break;
+		    case 'i': cmd = "italic"; break;
+		    case 'u': cmd = "underline"; break;
+		    case 's': cmd = "strikethrough"; break;
+		    case 'l': cmd = "justifyleft"; break;
+		    case 'e': cmd = "justifycenter"; break;
+		    case 'r': cmd = "justifyright"; break;
+		    case 'j': cmd = "justifyfull"; break;
+		    case 'z': cmd = "undo"; break;
+		    case 'y': cmd = "redo"; break;
+		    case 'v': cmd = "paste"; break;
+
+		    case '0': cmd = "killword"; break;
+
+			// headings
+		    case '1':
+		    case '2':
+		    case '3':
+		    case '4':
+		    case '5':
+		    case '6':
+			cmd = "formatblock";
+			value = "h" + key;
+			if (HTMLArea.is_ie) {
+				value = "<" + value + ">";
+			}
+			break;
+		}
+		if (cmd) {
+			// execute simple command
+			this.execCommand(cmd, false, value);
+			HTMLArea._stopEvent(ev);
+		}
+	}
+	/*
+	else if (keyEvent) {
+		// other keys here
+		switch (ev.keyCode) {
+		    case 13: // KEY enter
+			// if (HTMLArea.is_ie) {
+			this.insertHTML("<br />");
+			HTMLArea._stopEvent(ev);
+			// }
+			break;
+		}
+	}
+	*/
+	// update the toolbar state after some time
+	if (editor._timerToolbar) {
+		clearTimeout(editor._timerToolbar);
+	}
+	editor._timerToolbar = setTimeout(function() {
+		editor.updateToolbar();
+		editor._timerToolbar = null;
+	}, 50);
+};
+
+// retrieve the HTML
+HTMLArea.prototype.getHTML = function() {
+	switch (this._editMode) {
+	    case "wysiwyg"  :
+		if (!this.config.fullPage) {
+			return HTMLArea.getHTML(this._doc.body, false, this);
+		} else
+			return this.doctype + "\n" + HTMLArea.getHTML(this._doc.documentElement, true, this);
+	    case "textmode" : return this._textArea.value;
+	    default	    : alert("Mode <" + mode + "> not defined!");
+	}
+	return false;
+};
+
+// retrieve the HTML (fastest version, but uses innerHTML)
+HTMLArea.prototype.getInnerHTML = function() {
+	switch (this._editMode) {
+	    case "wysiwyg"  :
+		if (!this.config.fullPage)
+			return this._doc.body.innerHTML;
+		else
+			return this.doctype + "\n" + this._doc.documentElement.innerHTML;
+	    case "textmode" : return this._textArea.value;
+	    default	    : alert("Mode <" + mode + "> not defined!");
+	}
+	return false;
+};
+
+// completely change the HTML inside
+HTMLArea.prototype.setHTML = function(html) {
+	switch (this._editMode) {
+	    case "wysiwyg"  :
+		if (!this.config.fullPage)
+			this._doc.body.innerHTML = html;
+		else
+			// this._doc.documentElement.innerHTML = html;
+			this._doc.body.innerHTML = html;
+		break;
+	    case "textmode" : this._textArea.value = html; break;
+	    default	    : alert("Mode <" + mode + "> not defined!");
+	}
+	return false;
+};
+
+// sets the given doctype (useful when config.fullPage is true)
+HTMLArea.prototype.setDoctype = function(doctype) {
+	this.doctype = doctype;
+};
+
+/***************************************************
+ *  Category: UTILITY FUNCTIONS
+ ***************************************************/
+
+// browser identification
+
+HTMLArea.agt = navigator.userAgent.toLowerCase();
+HTMLArea.is_ie	   = ((HTMLArea.agt.indexOf("msie") != -1) && (HTMLArea.agt.indexOf("opera") == -1));
+HTMLArea.is_opera  = (HTMLArea.agt.indexOf("opera") != -1);
+HTMLArea.is_mac	   = (HTMLArea.agt.indexOf("mac") != -1);
+HTMLArea.is_mac_ie = (HTMLArea.is_ie && HTMLArea.is_mac);
+HTMLArea.is_win_ie = (HTMLArea.is_ie && !HTMLArea.is_mac);
+HTMLArea.is_gecko  = (navigator.product == "Gecko");
+
+// variable used to pass the object to the popup editor window.
+HTMLArea._object = null;
+
+// function that returns a clone of the given object
+HTMLArea.cloneObject = function(obj) {
+	var newObj = new Object;
+
+	// check for array objects
+	if (obj.constructor.toString().indexOf("function Array(") == 1) {
+		newObj = obj.constructor();
+	}
+
+	// check for function objects (as usual, IE is fucked up)
+	if (obj.constructor.toString().indexOf("function Function(") == 1) {
+		newObj = obj; // just copy reference to it
+	} else for (var n in obj) {
+		var node = obj[n];
+		if (typeof node == 'object') { newObj[n] = HTMLArea.cloneObject(node); }
+		else                         { newObj[n] = node; }
+	}
+
+	return newObj;
+};
+
+// FIXME!!! this should return false for IE < 5.5
+HTMLArea.checkSupportedBrowser = function() {
+	if (HTMLArea.is_gecko) {
+		if (navigator.productSub < 20021201) {
+			alert("You need at least Mozilla-1.3 Alpha.\n" +
+			      "Sorry, your Gecko is not supported.");
+			return false;
+		}
+		if (navigator.productSub < 20030210) {
+			alert("Mozilla < 1.3 Beta is not supported!\n" +
+			      "I'll try, though, but it might not work.");
+		}
+	}
+	return HTMLArea.is_gecko || HTMLArea.is_ie;
+};
+
+// selection & ranges
+
+// returns the current selection object
+HTMLArea.prototype._getSelection = function() {
+	if (HTMLArea.is_ie) {
+		return this._doc.selection;
+	} else {
+		return this._iframe.contentWindow.getSelection();
+	}
+};
+
+// returns a range for the current selection
+HTMLArea.prototype._createRange = function(sel) {
+	if (HTMLArea.is_ie) {
+		return sel.createRange();
+	} else {
+		this.focusEditor();
+		if (typeof sel != "undefined") {
+			try {
+				return sel.getRangeAt(0);
+			} catch(e) {
+				return this._doc.createRange();
+			}
+		} else {
+			return this._doc.createRange();
+		}
+	}
+};
+
+// event handling
+
+HTMLArea._addEvent = function(el, evname, func) {
+	if (HTMLArea.is_ie) {
+		el.attachEvent("on" + evname, func);
+	} else {
+		el.addEventListener(evname, func, true);
+	}
+};
+
+HTMLArea._addEvents = function(el, evs, func) {
+	for (var i in evs) {
+		HTMLArea._addEvent(el, evs[i], func);
+	}
+};
+
+HTMLArea._removeEvent = function(el, evname, func) {
+	if (HTMLArea.is_ie) {
+		el.detachEvent("on" + evname, func);
+	} else {
+		el.removeEventListener(evname, func, true);
+	}
+};
+
+HTMLArea._removeEvents = function(el, evs, func) {
+	for (var i in evs) {
+		HTMLArea._removeEvent(el, evs[i], func);
+	}
+};
+
+HTMLArea._stopEvent = function(ev) {
+	if (HTMLArea.is_ie) {
+		ev.cancelBubble = true;
+		ev.returnValue = false;
+	} else {
+		ev.preventDefault();
+		ev.stopPropagation();
+	}
+};
+
+HTMLArea._removeClass = function(el, className) {
+	if (!(el && el.className)) {
+		return;
+	}
+	var cls = el.className.split(" ");
+	var ar = new Array();
+	for (var i = cls.length; i > 0;) {
+		if (cls[--i] != className) {
+			ar[ar.length] = cls[i];
+		}
+	}
+	el.className = ar.join(" ");
+};
+
+HTMLArea._addClass = function(el, className) {
+	// remove the class first, if already there
+	HTMLArea._removeClass(el, className);
+	el.className += " " + className;
+};
+
+HTMLArea._hasClass = function(el, className) {
+	if (!(el && el.className)) {
+		return false;
+	}
+	var cls = el.className.split(" ");
+	for (var i = cls.length; i > 0;) {
+		if (cls[--i] == className) {
+			return true;
+		}
+	}
+	return false;
+};
+
+HTMLArea.isBlockElement = function(el) {
+	var blockTags = " body form textarea fieldset ul ol dl li div " +
+		"p h1 h2 h3 h4 h5 h6 quote pre table thead " +
+		"tbody tfoot tr td iframe address ";
+	return (blockTags.indexOf(" " + el.tagName.toLowerCase() + " ") != -1);
+};
+
+HTMLArea.needsClosingTag = function(el) {
+	var closingTags = " head script style div span tr td tbody table em strong font a title ";
+	return (closingTags.indexOf(" " + el.tagName.toLowerCase() + " ") != -1);
+};
+
+// performs HTML encoding of some given string
+HTMLArea.htmlEncode = function(str) {
+	// we don't need regexp for that, but.. so be it for now.
+	str = str.replace(/&/ig, "&amp;");
+	str = str.replace(/</ig, "&lt;");
+	str = str.replace(/>/ig, "&gt;");
+	str = str.replace(/\x22/ig, "&quot;");
+	// \x22 means '"' -- we use hex reprezentation so that we don't disturb
+	// JS compressors (well, at least mine fails.. ;)
+	return str;
+};
+
+// Retrieves the HTML code from the given node.	 This is a replacement for
+// getting innerHTML, using standard DOM calls.
+HTMLArea.getHTML = function(root, outputRoot, editor) {
+	var html = "";
+	switch (root.nodeType) {
+	    case 1: // Node.ELEMENT_NODE
+	    case 11: // Node.DOCUMENT_FRAGMENT_NODE
+		var closed;
+		var i;
+		var root_tag = (root.nodeType == 1) ? root.tagName.toLowerCase() : '';
+		if (HTMLArea.is_ie && root_tag == "head") {
+			if (outputRoot)
+				html += "<head>";
+			// lowercasize
+			var save_multiline = RegExp.multiline;
+			RegExp.multiline = true;
+			var txt = root.innerHTML.replace(HTMLArea.RE_tagName, function(str, p1, p2) {
+				return p1 + p2.toLowerCase();
+			});
+			RegExp.multiline = save_multiline;
+			html += txt;
+			if (outputRoot)
+				html += "</head>";
+			break;
+		} else if (outputRoot) {
+			closed = (!(root.hasChildNodes() || HTMLArea.needsClosingTag(root)));
+			html = "<" + root.tagName.toLowerCase();
+			var attrs = root.attributes;
+			for (i = 0; i < attrs.length; ++i) {
+				var a = attrs.item(i);
+				if (!a.specified) {
+					continue;
+				}
+				var name = a.nodeName.toLowerCase();
+				if (/_moz|contenteditable|_msh/.test(name)) {
+					// avoid certain attributes
+					continue;
+				}
+				var value;
+				if (name != "style") {
+					// IE5.5 reports 25 when cellSpacing is
+					// 1; other values might be doomed too.
+					// For this reason we extract the
+					// values directly from the root node.
+					// I'm starting to HATE JavaScript
+					// development.  Browser differences
+					// suck.
+					//
+					// Using Gecko the values of href and src are converted to absolute links
+					// unless we get them using nodeValue()
+					if (typeof root[a.nodeName] != "undefined" && name != "href" && name != "src") {
+						value = root[a.nodeName];
+					} else {
+						value = a.nodeValue;
+						// IE seems not willing to return the original values - it converts to absolute
+						// links using a.nodeValue, a.value, a.stringValue, root.getAttribute("href")
+						// So we have to strip the baseurl manually -/
+						if (HTMLArea.is_ie && (name == "href" || name == "src")) {
+							value = editor.stripBaseURL(value);
+						}
+					}
+				} else { // IE fails to put style in attributes list
+					// FIXME: cssText reported by IE is UPPERCASE
+					value = root.style.cssText;
+				}
+				if (/(_moz|^$)/.test(value)) {
+					// Mozilla reports some special tags
+					// here; we don't need them.
+					continue;
+				}
+				html += " " + name + '="' + value + '"';
+			}
+			html += closed ? " />" : ">";
+		}
+		for (i = root.firstChild; i; i = i.nextSibling) {
+			html += HTMLArea.getHTML(i, true, editor);
+		}
+		if (outputRoot && !closed) {
+			html += "</" + root.tagName.toLowerCase() + ">";
+		}
+		break;
+	    case 3: // Node.TEXT_NODE
+		// If a text node is alone in an element and all spaces, replace it with an non breaking one
+		// This partially undoes the damage done by moz, which translates '&nbsp;'s into spaces in the data element
+		if ( !root.previousSibling && !root.nextSibling && root.data.match(/^\s*$/i) ) html = '&nbsp;';
+		else html = HTMLArea.htmlEncode(root.data);
+		break;
+	    case 8: // Node.COMMENT_NODE
+		html = "<!--" + root.data + "-->";
+		break;		// skip comments, for now.
+	}
+	return html;
+};
+
+HTMLArea.prototype.stripBaseURL = function(string) {
+	var baseurl = this.config.baseURL;
+
+	// strip to last directory in case baseurl points to a file
+	baseurl = baseurl.replace(/[^\/]+$/, '');
+	var basere = new RegExp(baseurl);
+	string = string.replace(basere, "");
+
+	// strip host-part of URL which is added by MSIE to links relative to server root
+	baseurl = baseurl.replace(/^(https?:\/\/[^\/]+)(.*)$/, '$1');
+	basere = new RegExp(baseurl);
+	return string.replace(basere, "");
+};
+
+String.prototype.trim = function() {
+	a = this.replace(/^\s+/, '');
+	return a.replace(/\s+$/, '');
+};
+
+// creates a rgb-style color from a number
+HTMLArea._makeColor = function(v) {
+	if (typeof v != "number") {
+		// already in rgb (hopefully); IE doesn't get here.
+		return v;
+	}
+	// IE sends number; convert to rgb.
+	var r = v & 0xFF;
+	var g = (v >> 8) & 0xFF;
+	var b = (v >> 16) & 0xFF;
+	return "rgb(" + r + "," + g + "," + b + ")";
+};
+
+// returns hexadecimal color representation from a number or a rgb-style color.
+HTMLArea._colorToRgb = function(v) {
+	if (!v)
+		return '';
+
+	// returns the hex representation of one byte (2 digits)
+	function hex(d) {
+		return (d < 16) ? ("0" + d.toString(16)) : d.toString(16);
+	};
+
+	if (typeof v == "number") {
+		// we're talking to IE here
+		var r = v & 0xFF;
+		var g = (v >> 8) & 0xFF;
+		var b = (v >> 16) & 0xFF;
+		return "#" + hex(r) + hex(g) + hex(b);
+	}
+
+	if (v.substr(0, 3) == "rgb") {
+		// in rgb(...) form -- Mozilla
+		var re = /rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/;
+		if (v.match(re)) {
+			var r = parseInt(RegExp.$1);
+			var g = parseInt(RegExp.$2);
+			var b = parseInt(RegExp.$3);
+			return "#" + hex(r) + hex(g) + hex(b);
+		}
+		// doesn't match RE?!  maybe uses percentages or float numbers
+		// -- FIXME: not yet implemented.
+		return null;
+	}
+
+	if (v.substr(0, 1) == "#") {
+		// already hex rgb (hopefully :D )
+		return v;
+	}
+
+	// if everything else fails ;)
+	return null;
+};
+
+// modal dialogs for Mozilla (for IE we're using the showModalDialog() call).
+
+// receives an URL to the popup dialog and a function that receives one value;
+// this function will get called after the dialog is closed, with the return
+// value of the dialog.
+HTMLArea.prototype._popupDialog = function(url, action, init) {
+	Dialog(this.popupURL(url), action, init);
+};
+
+// paths
+
+HTMLArea.prototype.imgURL = function(file, plugin) {
+	if (typeof plugin == "undefined")
+		return _editor_url + file;
+	else
+		return _editor_url + "plugins/" + plugin + "/img/" + file;
+};
+
+HTMLArea.prototype.popupURL = function(file) {
+	var url = "";
+	if (file.match(/^plugin:\/\/(.*?)\/(.*)/)) {
+		var plugin = RegExp.$1;
+		var popup = RegExp.$2;
+		if (!/\.html$/.test(popup))
+			popup += ".html";
+		url = _editor_url + "plugins/" + plugin + "/popups/" + popup;
+	} else
+		url = _editor_url + this.config.popupURL + file;
+	return url;
+};
+
+/**
+ * FIX: Internet Explorer returns an item having the _name_ equal to the given
+ * id, even if it's not having any id.  This way it can return a different form
+ * field even if it's not a textarea.  This workarounds the problem by
+ * specifically looking to search only elements having a certain tag name.
+ */
+HTMLArea.getElementById = function(tag, id) {
+	var el, i, objs = document.getElementsByTagName(tag);
+	for (i = objs.length; --i >= 0 && (el = objs[i]);)
+		if (el.id == id)
+			return el;
+	return null;
+};
+
+
+
+// EOF
+// Local variables: //
+// c-basic-offset:8 //
+// indent-tabs-mode:t //
+// End: //
Index: temp/trunk/html/test/naka/HTMLArea/release-notes.html
===================================================================
--- temp/trunk/html/test/naka/HTMLArea/release-notes.html	(revision 1694)
+++ temp/trunk/html/test/naka/HTMLArea/release-notes.html	(revision 1694)
@@ -0,0 +1,165 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 3.2//EN">
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <title>HTMLArea-3.0-rc1 release notes</title>
+    <style>
+      .fixme { color: red; }
+    </style>
+  </head>
+
+  <body>
+
+    <h1>HTMLArea-3.0-rc1 release notes</h1>
+
+    <p>This release was compiled on Mar  1, 2004 [19:37] GMT.</p>
+
+    <h2>3.0-rc1</h2>
+
+    <p>Changes since 3.0-Beta:</p>
+
+    <ul>
+      <li>
+        <b>New plugins</b>
+        <ul>
+          <li>
+            ContextMenu plugin (provides a nice context menu with common
+            operations, including table ops, link ops, etc.)
+          </li>
+          <li>
+            CSS plugin (provides an easy way to insert/change CSS classes)
+          </li>
+          <li>
+            FullPage plugin (allows HTMLArea to edit a whole HTML file,
+            not only the content within &lt;body&gt;.)
+          </li>
+        </ul>
+      </li>
+      <li>
+        <b>Changes in the SpellChecker plugin</b>
+        <ul>
+          <li>
+            Many bugfixes: now it works ;-)  Fully Unicode-safe.
+          </li>
+          <li>
+            Speed and bandwidth optimization: reports the list of
+            suggestions only once for each mispelled word; this helps
+            in cases where you have, for instance, the word “HTMLArea”
+            in 10 places all over the document; the list of
+            suggestions for it--which is kind of huge--will only be
+            included <em>once</em>.
+          </li>
+          <li>
+            User interface improvements: the highlighted word will
+            remain in view; in cases where it's normally outside, the
+            window will be scrolled to it.
+          </li>
+          <li>
+            Added a "Revert" button for those that change their minds ;-)
+          </li>
+          <li>
+            Added a "Info" button which reports information about the
+            document, retrieved by the server-side spell checker:
+            total number of words, total number of mispelled words,
+            number of suggestions made, spell check time, etc.  More
+            can be easily added.  <span class="fixme">FIXME: this part
+            is not yet internationalized.</span>
+          </li>
+          <li>
+            The server-side spell checker now uses XML::DOM instead of
+            HTML::Parser, which means that it will be unable to parse
+            “tag-soup” HTML.  It needs valid code.  Usually HTMLArea
+            generates valid code, but on rare occasions it might fail
+            and the spell checker will report a gross error message.
+            This gonna have to be fixed, but instead of making the
+            spell checker accept invalid HTML I prefer to make
+            HTMLArea generate valid code, so changes are to be done in
+            other places ;-)
+          </li>
+        </ul>
+      </li>
+      <li>
+        <b>Changes in the core editor</b>
+        <ul>
+          <li>
+            Easier to setup: you only need to load
+            <tt>htmlarea.js</tt>; other scripts will be loaded
+            automatically.  <a href="reference.html">Documentation</a>
+            and <a href="examples/">examples</a> updated.
+          </li>
+          <li>
+            Better plugin support (they register information about
+            themselves with the editor; can register event handlers for
+            the editor, etc.)
+          </li>
+          <li>
+            New about box; check it out, it's cool ;-)
+          </li>
+          <li>
+            Word cleaner (can be enabled to automatically kill Word crap
+            on paste (see Config.killWordOnPaste); otherwise accessible by
+            pressing CTRL-0 in the editor; a toolbar button will come up
+            soon)
+          </li>
+          <li>
+            Image preview in "insert image" dialog.  Also allows
+            modification of current image, if selected.
+          </li>
+          <li>
+            New "insert link" dialog, allows target and title
+            specification, allows editing links.
+          </li>
+          <li>
+            Implemented support for text direction (left-to-right or
+            right-to-left).
+          </li>
+          <li>
+            Lots of bug fixes!  ... and more, I guess ;-) an
+            automatically generated <a href="ChangeLog">change log</a>
+            is now available.
+          </li>
+        </ul>
+      </li>
+    </ul>
+
+    <p>I don't have the power to go through the <a
+href="http://sourceforge.net/tracker/?atid=525656&group_id=69750&func=browse">bug
+system</a> at SourceForge
+    now.  Some of the bugs reported there may be fixed; I'll update
+    their status, some other time.  If you reported bugs there and now
+    find them to be fixed, please let me know.</p>
+
+    <h2>3.0-Beta</h2>
+
+    <p>Changes since 3.0-Alpha:</p>
+
+    <ul>
+
+      <li>Performance improvements.</li>
+
+      <li>Many bugs fixed.</li>
+
+      <li>Plugin infrastructure.</li>
+
+      <li>TableOperations plugin.</li>
+
+      <li>SpellChecker plugin.</li>
+
+      <li>Status bar.</li>
+
+      <li>API for registering custom buttons and drop-down boxes in the
+        toolbar.</li>
+
+      <li>Toolbar can contain text labels.</li>
+
+      <li>Cut, copy, paste, undo, redo buttons.</li>
+
+    </ul>
+    <hr />
+    <address><a href="http://dynarch.com/mishoo/">Mihai Bazon</a></address>
+<!-- Created: Sun Aug  3 16:55:08 EEST 2003 -->
+<!-- hhmts start --> Last modified: Sun Feb  1 13:16:10 EET 2004 <!-- hhmts end -->
+<!-- doc-lang: English -->
+  </body>
+</html>
+
+
Index: temp/trunk/html/test/naka/HTMLArea/dialog.js
===================================================================
--- temp/trunk/html/test/naka/HTMLArea/dialog.js	(revision 1694)
+++ temp/trunk/html/test/naka/HTMLArea/dialog.js	(revision 1694)
@@ -0,0 +1,72 @@
+// htmlArea v3.0 - Copyright (c) 2003-2004 interactivetools.com, inc.
+// This copyright notice MUST stay intact for use (see license.txt).
+//
+// Portions (c) dynarch.com, 2003-2004
+//
+// A free WYSIWYG editor replacement for <textarea> fields.
+// For full source code and docs, visit http://www.interactivetools.com/
+//
+// Version 3.0 developed by Mihai Bazon.
+//   http://dynarch.com/mishoo
+//
+// $Id$
+
+// Though "Dialog" looks like an object, it isn't really an object.  Instead
+// it's just namespace for protecting global symbols.
+
+function Dialog(url, action, init) {
+	if (typeof init == "undefined") {
+		init = window;	// pass this window object by default
+	}
+	Dialog._geckoOpenModal(url, action, init);
+};
+
+Dialog._parentEvent = function(ev) {
+	if (Dialog._modal && !Dialog._modal.closed) {
+		Dialog._modal.focus();
+		HTMLArea._stopEvent(ev);
+	}
+};
+
+// should be a function, the return handler of the currently opened dialog.
+Dialog._return = null;
+
+// constant, the currently opened dialog
+Dialog._modal = null;
+
+// the dialog will read it's args from this variable
+Dialog._arguments = null;
+
+Dialog._geckoOpenModal = function(url, action, init) {
+	var dlg = window.open(url, "hadialog",
+			      "toolbar=no,menubar=no,personalbar=no,width=10,height=10," +
+			      "scrollbars=no,resizable=yes");
+	Dialog._modal = dlg;
+	Dialog._arguments = init;
+
+	// capture some window's events
+	function capwin(w) {
+		HTMLArea._addEvent(w, "click", Dialog._parentEvent);
+		HTMLArea._addEvent(w, "mousedown", Dialog._parentEvent);
+		HTMLArea._addEvent(w, "focus", Dialog._parentEvent);
+	};
+	// release the captured events
+	function relwin(w) {
+		HTMLArea._removeEvent(w, "click", Dialog._parentEvent);
+		HTMLArea._removeEvent(w, "mousedown", Dialog._parentEvent);
+		HTMLArea._removeEvent(w, "focus", Dialog._parentEvent);
+	};
+	capwin(window);
+	// capture other frames
+	for (var i = 0; i < window.frames.length; capwin(window.frames[i++]));
+	// make up a function to be called when the Dialog ends.
+	Dialog._return = function (val) {
+		if (val && action) {
+			action(val);
+		}
+		relwin(window);
+		// capture other frames
+		for (var i = 0; i < window.frames.length; relwin(window.frames[i++]));
+		Dialog._modal = null;
+	};
+};
Index: temp/trunk/html/test/naka/HTMLArea/index.html
===================================================================
--- temp/trunk/html/test/naka/HTMLArea/index.html	(revision 1694)
+++ temp/trunk/html/test/naka/HTMLArea/index.html	(revision 1694)
@@ -0,0 +1,199 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 3.2//EN">
+<html>
+  <head>
+    <title>HTMLArea -- the free, customizable online editor</title>
+
+    <style type="text/css">
+      html, body { font-family: georgia,"times new roman",serif; background-color: #fff; color: #000; }
+      .label { text-align: right; padding-right: 0.3em; }
+      .bline { border-bottom: 1px solid #aaa; }
+    </style>
+  </head>
+
+  <body>
+    <div style="float: right; border: 1px solid #aaa; background-color: #eee; padding: 3px; margin-left: 10px; margin-bottom: 10px;">
+      <table cellspacing="0" cellpadding="0" border="0">
+        <tr>
+          <td class="label">Version:</td><td>3.0</td>
+        </tr>
+        <tr>
+          <td class="label">Release:</td><td>rc1 (<a href="release-notes.html">release notes</a>)</td>
+        </tr>
+        <tr>
+          <td class="label bline">Compiled at:</td><td class="bline">Mar  1, 2004 [19:37] GMT</td>
+        </tr>
+        <tr>
+          <td class="label">SourceForge page:</td><td><a href="http://sf.net/projects/itools-htmlarea/">http://sf.net/projects/itools-htmlarea/</a></td>
+      </table>
+    </div>
+    <h1>HTMLArea -- the free<br/>customizable online editor</h1>
+
+    <p>
+      HTMLArea is a free, customizable online editor.  It works inside your
+      browser.  It uses a non-standard feature implemented in Internet
+      Explorer 5.5 or better for Windows and Mozilla 1.3 or better (any
+      platform), therefore it will only work in one of these browsers.
+    </p>
+
+    <p>
+      HTMLArea is copyright <a
+      href="http://interactivetools.com">InteractiveTools.com</a> and <a
+      href="http://dynarch.com">Dynarch.com</a> and it is
+      released under a BSD-style license.  HTMLArea is created and developed
+      upto version 2.03 by InteractiveTools.com.  Version 3.0 developed by
+      <a href="http://dynarch.com/mishoo/">Mihai Bazon</a> for
+      InteractiveTools.  It contains code sponsored by third-party companies as well.
+      Please see our About Box for details about who sponsored what plugins.
+    </p>
+
+    <h2>Online demos</h2>
+
+    <ul>
+
+      <li><a href="examples/core.html">HTMLArea standard</a> -- contains the core
+        editor.</li>
+
+      <li><a href="examples/table-operations.html">HTMLArea + tables</a> --
+        loads the <tt>TableOperations</tt> plugin which provides some extra
+        editing features for tables.</li>
+
+      <li><a href="examples/spell-checker.html">HTMLArea + spell checher</a>
+        -- loads the <tt>SpellChecker</tt> plugin which provides what its
+        name says: a spell checker.  This one requires additional support on
+        the server-side.</li>
+
+      <li><a href="examples/full-page.html">HTMLArea Full HTML Editor</a> --
+        loads the <tt>FullPage</tt> plugin which allows you to edit a full
+        HTML page, including &lt;title&gt;, &lt;!DOCTYPE...&gt; and some
+        other options.</li>
+
+      <li><a href="examples/context-menu.html">HTMLArea with Context
+          Menu</a> -- this plugin provides a nice and useful context menu.</li>
+
+      <li><a href="examples/fully-loaded.html">HTMLArea fully loaded</a> --
+        all of the above. ;-)</li>
+
+    </ul>
+
+    <h2>Installation</h2>
+
+    <p>
+      Installation is (or should be) easy.  You need to unpack the ZIP file
+      in a directory accessible through your webserver.  Supposing you
+      unpack in your <tt>DocumentRoot</tt> and your <tt>DocumentRoot</tt> is
+      <tt>/var/www/html</tt> as in a standard RedHat installation, you need
+      to acomplish the following steps: (the example is for a Unix-like
+      operating system)
+    </p>
+
+    <pre style="margin-left: 2em"
+>
+cd /var/www/html
+unzip /path/to/archive/HTMLArea-3.0-rc1.zip
+mv HTMLArea-3.0-rc1 htmlarea
+find htmlarea/ -type f -exec chmod 644 {} \;
+find htmlarea/ -type d -exec chmod 755 {} \;
+find htmlarea/ -name "*.cgi" -exec chmod 755 {} \;</pre>
+
+    <p>
+      <strong>Notes.</strong> You may chose to symlink "htmlarea" to "HTMLArea-3.0-rc1", in which case your server needs to be configured to
+      "<tt>FollowSymLinks</tt>".  You need to make sure that *.cgi files are
+      interpreted as CGI scripts.  If you want to use the SpellChecker
+      plugin you need to have a recent version of Perl installed (I
+      recommend 5.8.0) on the server, and the module Text::Aspell, available
+      from CPAN.  More info in "<a
+      href="plugins/SpellChecker/readme-tech.html">plugins/SpellChecker/readme-tech.html</a>".
+    </p>
+
+    <p>About how to setup your pages to use the editor, please read the
+      [outdated yet generally valid] <a
+        href="reference.html">documentation</a>.</p>
+
+    <h2>Status and links</h2>
+
+    <p>HTMLArea has reached version 3.0.  As of this version, it
+      supports:</p>
+
+    <ul>
+
+      <li>Customizable toolbar</li>
+
+      <li>Easy internationalization</li>
+
+      <li>Plugin-based infrastructure</li>
+
+      <li>Delivers W3-compliant HTML (with few exceptions)</li>
+
+      <li>Has a subset of Microsoft Word's keyboard shortcuts</li>
+
+      <li>Full-screen editor</li>
+
+      <li>Advanced table operations (by external plugin
+        "TableOperations")</li>
+
+      <li>Spell checker (by external plugin "SpellChecker")</li>
+
+      <li>probably more... ;-)</li>
+
+    </ul>
+
+    <p>We have a <a
+    href="http://sourceforge.net/projects/itools-htmlarea/">project page</a>
+    at <a href="http://sourceforge.net">SourceForge.net</a>.  There you can
+    also find out <a href="http://sourceforge.net/cvs/?group_id=69750">how
+    to retrieve the code from CVS</a>, or you can <a
+    href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/itools-htmlarea">browse
+    the CVS online</a>.  We also have a <a
+    href="http://sourceforge.net/tracker/?atid=525656&group_id=69750&func=browse">bug
+    system</a>, a <a
+    href="http://sourceforge.net/tracker/?atid=525658&group_id=69750&func=browse">patch
+    tracking system</a> and a <a
+    href="http://sourceforge.net/tracker/?atid=525659&group_id=69750&func=browse">feature
+    request page</a>.</p>
+
+    <p>We invite you to say everything you want about HTMLArea <a
+    href="http://www.interactivetools.com/forum/gforum.cgi?forum=14;">on the
+    forums</a> at InteractiveTools.com.  There you should also find the
+    latest news.</p>
+
+    <p>Sometimes I post news about the latest developments on <a
+    href="http://dynarch.com/mishoo/">my personal homepage</a>.</p>
+
+    <h2>"It doesn't work, what's wrong?"</h2>
+
+    <p>If it doesn't work, you have several options:</p>
+
+    <ul>
+
+      <li>Post a message to the forum.  Describe your problem in as much
+      detail as possible.  Include errors you might find in the JavaScript
+      console (if you are a Mozilla user), or errors displayed by IE (though
+      they're most of the times useless).</li>
+
+      <li>If you're positive that you discovered a bug in HTMLArea then feel
+      free to fill a bug report in our bug system.  If you have the time you
+      should check to see if a similar bug was reported or not; it might be
+      fixed already in the CVS ;-) If you're positive that a similar bug was
+      not yet reported, do fill a bug report and please include as much
+      detail as possible, such as your browser, OS, errors from JavaScript
+      console, etc.</li>
+
+      <li>If you want a new feature to be implemented, post it on the
+      features request and someone will hopefully take care of it.</li>
+
+    </ul>
+
+    <p>You can <a href="mailto:mishoo@infoiasi.ro">contact me directly</a>
+    <em>only</em> if you want to pay me for implementing custom features to
+    HTMLArea.  If you want to sponsor these features (that is, allow them to
+    get back into the public HTMLArea distribution) I'll be cheaper. ;-)</p>
+
+    <hr />
+    <address><a href="http://dynarch.com/mishoo/">Mihai Bazon</a></address>
+<!-- Created: Sun Aug  3 14:11:26 EEST 2003 -->
+<!-- hhmts start --> Last modified: Wed Jan 28 11:54:47 EET 2004 <!-- hhmts end -->
+<!-- doc-lang: English -->
+  </body>
+</html>
+
+
Index: temp/trunk/html/test/naka/index.php
===================================================================
--- temp/trunk/html/test/naka/index.php	(revision 1694)
+++ temp/trunk/html/test/naka/index.php	(revision 1694)
@@ -0,0 +1,332 @@
+<?php
+
+require_once("../require.php");
+require_once("./index_csv.php");
+
+class LC_Page {
+	var $arrForm;
+	var $arrHidden;
+	var $arrProducts;
+	var $arrPageMax;
+	function LC_Page() {
+		$this->tpl_mainpage = 'products/index.tpl';
+		$this->tpl_mainno = 'products';
+		$this->tpl_subnavi = 'products/subnavi.tpl';
+		$this->tpl_subno = 'index';
+		$this->tpl_pager = ROOT_DIR . 'data/Smarty/templates/admin/pager.tpl';
+		$this->tpl_subtitle = '¾¦ÉÊ¥Þ¥¹¥¿';
+
+		global $arrPageMax;
+		$this->arrPageMax = $arrPageMax;
+		global $arrDISP;
+		$this->arrDISP = $arrDISP;
+		global $arrSTATUS;
+		$this->arrSTATUS = $arrSTATUS;
+		global $arrPRODUCTSTATUS_COLOR;
+		$this->arrPRODUCTSTATUS_COLOR = $arrPRODUCTSTATUS_COLOR;
+
+	}
+}
+
+//$conn = new SC_DBConn();
+$objPage = new LC_Page();
+$objView = new SC_AdminView();
+
+$objDate = new SC_Date();
+
+// ÅÐÏ¿¡¦¹¹¿·¸¡º÷³«»ÏÇ¯
+$objDate->setStartYear(RELEASE_YEAR);
+$objDate->setEndYear(DATE("Y"));
+$objPage->arrStartYear = $objDate->getYear();
+$objPage->arrStartMonth = $objDate->getMonth();
+$objPage->arrStartDay = $objDate->getDay();
+// ÅÐÏ¿¡¦¹¹¿·¸¡º÷½ªÎ»Ç¯
+$objDate->setStartYear(RELEASE_YEAR);
+$objDate->setEndYear(DATE("Y"));
+$objPage->arrEndYear = $objDate->getYear();
+$objPage->arrEndMonth = $objDate->getMonth();
+$objPage->arrEndDay = $objDate->getDay();
+
+// Ç§¾Ú²ÄÈÝ¤ÎÈ½Äê
+//$objSess = new SC_Session();
+//sfIsSuccess($objSess);
+
+//¥­¥ã¥ó¥Ú¡¼¥ó¤ÎÊÔ½¸»þ
+if(sfIsInt($_POST['campaign_id']) && $_POST['mode'] == "camp_search") {
+	$objQuery = new SC_Query();
+	$search_data = $objQuery->get("dtb_campaign", "search_condition", "campaign_id = ? ", array($_POST['campaign_id']));
+	$arrSearch = unserialize($search_data);
+	foreach ($arrSearch as $key => $val) {
+		$_POST[$key] = $val;
+	}
+}
+
+// POSTÃÍ¤Î°ú¤­·Ñ¤®
+$objPage->arrForm = $_POST;
+
+// ¸¡º÷¥ï¡¼¥É¤Î°ú¤­·Ñ¤®
+foreach ($_POST as $key => $val) {
+	if (ereg("^search_", $key) || ereg("^campaign_", $key)) {
+		switch($key) {
+			case 'search_product_flag':
+			case 'search_status':
+				$objPage->arrHidden[$key] = sfMergeParamCheckBoxes($val);
+				if(!is_array($val)) {
+					$objPage->arrForm[$key] = split("-", $val);
+				}
+				break;
+			default:
+				$objPage->arrHidden[$key] = $val;
+				break;
+		}
+	}
+}
+
+// ¥Ú¡¼¥¸Á÷¤êÍÑ
+$objPage->arrHidden['search_pageno'] = $_POST['search_pageno'];
+
+// ¾¦ÉÊºï½ü
+if ($_POST['mode'] == "delete") {
+	if($_POST['category_id'] != "") {
+		// ¥é¥ó¥¯ÉÕ¤­¥ì¥³¡¼¥É¤Îºï½ü
+		$where = "category_id = " . addslashes($_POST['category_id']);
+		sfDeleteRankRecord("dtb_products", "product_id", $_POST['product_id'], $where);
+	} else {
+		sfDeleteRankRecord("dtb_products", "product_id", $_POST['product_id']);
+	}
+	// »Ò¥Æ¡¼¥Ö¥ë(¾¦ÉÊµ¬³Ê)¤Îºï½ü
+	$objQuery = new SC_Query();
+	$objQuery->delete("dtb_products_class", "product_id = ?", array($_POST['product_id']));
+	
+	// ·ï¿ô¥«¥¦¥ó¥È¥Ð¥Ã¥Á¼Â¹Ô
+	sfCategory_Count($objQuery);	
+}
+
+
+if ($_POST['mode'] == "search" || $_POST['mode'] == "csv"  || $_POST['mode'] == "delete" || $_POST['mode'] == "delete_all" || $_POST['mode'] == "camp_search") {
+	// ÆþÎÏÊ¸»ú¤Î¶¯À©ÊÑ´¹
+	lfConvertParam();
+	// ¥¨¥é¡¼¥Á¥§¥Ã¥¯
+	$objPage->arrErr = lfCheckError();
+
+	$where = "delete = 0";
+
+	// ÆþÎÏ¥¨¥é¡¼¤Ê¤·
+	if (count($objPage->arrErr) == 0) {
+
+		foreach ($objPage->arrForm as $key => $val) {
+				
+			$val = sfManualEscape($val);
+			
+			if($val == "") {
+				continue;
+			}
+			
+			switch ($key) {
+				case 'search_product_id':
+					$where .= " AND product_id = ?";
+					$arrval[] = $val;
+					break;
+				case 'search_product_class_id':
+					$where .= " AND product_id IN (SELECT product_id FROM dtb_products_class WHERE product_class_id = ?)";
+					$arrval[] = $val;
+					break;
+				case 'search_name':
+					$where .= " AND name ILIKE ?";
+					$arrval[] = "%$val%";
+					break;
+				case 'search_category_id':
+					list($tmp_where, $tmp_arrval) = sfGetCatWhere($val);
+					if($tmp_where != "") {
+						$where.= " AND $tmp_where";
+						$arrval = array_merge($arrval, $tmp_arrval);
+					}
+					break;
+				case 'search_product_code':
+					$where .= " AND product_id IN (SELECT product_id FROM dtb_products_class WHERE product_code ILIKE ? GROUP BY product_id)";
+					$arrval[] = "%$val%";
+					break;
+				case 'search_startyear':
+					$date = sfGetTimestamp($_POST['search_startyear'], $_POST['search_startmonth'], $_POST['search_startday']);
+					$where.= " AND update_date >= ?";
+					$arrval[] = $date;
+					break;
+				case 'search_endyear':
+					$date = sfGetTimestamp($_POST['search_endyear'], $_POST['search_endmonth'], $_POST['search_endday']);
+					$where.= " AND update_date <= ?";
+					$arrval[] = $date;
+					break;
+				case 'search_product_flag':
+					global $arrSTATUS;
+					$search_product_flag = sfSearchCheckBoxes($val);
+					if($search_product_flag != "") {
+						$where.= " AND product_flag LIKE ?";
+						$arrval[] = $search_product_flag;					
+					}
+					break;
+				case 'search_status':
+					$tmp_where = "";
+					foreach ($val as $element){
+						if ($element != ""){
+							if ($tmp_where == ""){
+								$tmp_where.="AND (status LIKE ? ";
+							}else{
+								$tmp_where.="OR status LIKE ? ";
+							}
+							$arrval[]=$element;
+						}
+					}
+					if ($tmp_where != ""){
+						$tmp_where.=")";
+						$where.= "$tmp_where";
+					}
+					break;
+				default:
+					break;
+			}
+		}
+
+		$order = "update_date DESC";
+		$objQuery = new SC_Query();
+		
+		switch($_POST['mode']) {
+		case 'csv':
+			// ¥ª¥×¥·¥ç¥ó¤Î»ØÄê
+			$option = "ORDER BY $order";
+			// CSV½ÐÎÏ¥¿¥¤¥È¥ë¹Ô¤ÎºîÀ®
+			$arrOutput = sfSwapArray(sfgetCsvOutput(1, " WHERE csv_id = 1 AND status = 1"));
+			
+			if (count($arrOutput) <= 0) break;
+			
+			$arrOutputCols = $arrOutput['col'];
+			$arrOutputTitle = $arrOutput['disp_name'];
+			
+			$head = sfGetCSVList($arrOutputTitle);
+			
+			$data = lfGetProductsCSV($where, $option, $arrval, $arrOutputCols);
+
+			// CSV¤òÁ÷¿®¤¹¤ë¡£
+			sfCSVDownload($head.$data);
+			exit;
+			break;
+		case 'delete_all':
+			// ¸¡º÷·ë²Ì¤ò¤¹¤Ù¤Æºï½ü
+			$where = "product_id IN (SELECT product_id FROM vw_products_nonclass WHERE $where)";
+			$sqlval['delete'] = 1;
+			$objQuery->update("dtb_products", $sqlval, $where, $arrval);
+			break;
+		default:
+			// ÆÉ¤ß¹þ¤àÎó¤È¥Æ¡¼¥Ö¥ë¤Î»ØÄê
+			$col = "product_id, name, category_id, main_list_image, status, product_code, price01, price02, stock, stock_unlimited";
+			$from = "vw_products_nonclass";
+
+			// ¹Ô¿ô¤Î¼èÆÀ
+			$linemax = $objQuery->count($from, $where, $arrval);
+			$objPage->tpl_linemax = $linemax;				// ²¿·ï¤¬³ºÅö¤·¤Þ¤·¤¿¡£É½¼¨ÍÑ
+
+			// ¥Ú¡¼¥¸Á÷¤ê¤Î½èÍý
+			if(is_numeric($_POST['search_page_max'])) {	
+				$page_max = $_POST['search_page_max'];
+			} else {
+				$page_max = SEARCH_PMAX;
+			}
+
+			// ¥Ú¡¼¥¸Á÷¤ê¤Î¼èÆÀ
+			$objNavi = new SC_PageNavi($_POST['search_pageno'], $linemax, $page_max, "fnNaviSearchPage", NAVI_PMAX);
+			$startno = $objNavi->start_row;
+			$objPage->arrPagenavi = $objNavi->arrPagenavi;
+			
+			//¥­¥ã¥ó¥Ú¡¼¥ó¾¦ÉÊ¸¡º÷»þ¤Ï¡¢Á´·ë²Ì¤Î¾¦ÉÊID¤òÊÑ¿ô¤Ë³ÊÇ¼¤¹¤ë
+			if($_POST['search_mode'] == 'campaign') {
+				$arrRet = $objQuery->select($col, $from, $where, $arrval);
+				if(count($arrRet) > 0) {
+					$arrRet = sfSwapArray($arrRet);
+					$pid = implode("-", $arrRet['product_id']);
+					$objPage->arrHidden['campaign_product_id'] = $pid;
+				}
+			}
+
+			// ¼èÆÀÈÏ°Ï¤Î»ØÄê(³«»Ï¹ÔÈÖ¹æ¡¢¹Ô¿ô¤Î¥»¥Ã¥È)
+			$objQuery->setlimitoffset($page_max, $startno);
+			// É½¼¨½ç½ø
+			$objQuery->setorder($order);
+			// ¸¡º÷·ë²Ì¤Î¼èÆÀ
+			$objPage->arrProducts = $objQuery->select($col, $from, $where, $arrval);
+
+			break;
+		}
+	}
+}
+
+// ¥«¥Æ¥´¥ê¤ÎÆÉ¹þ
+$objPage->arrCatList = sfGetCategoryList();
+$objPage->arrCatIDName = lfGetIDName($objPage->arrCatList);
+
+// ²èÌÌ¤ÎÉ½¼¨
+$objView->assignobj($objPage);
+$objView->display(MAIN_FRAME);
+
+//---------------------------------------------------------------------------------------------------------------------------------------------------------
+
+// ¼èÆÀÊ¸»úÎó¤ÎÊÑ´¹ 
+function lfConvertParam() {
+	global $objPage;
+	/*
+	 *	Ê¸»úÎó¤ÎÊÑ´¹
+	 *	K :  ¡ÖÈ¾³Ñ(ÊÝ¶¸)ÊÒ²¾Ì¾¡×¤ò¡ÖÁ´³ÑÊÒ²¾Ì¾¡×¤ËÊÑ´¹
+	 *	C :  ¡ÖÁ´³Ñ¤Ò¤é²¾Ì¾¡×¤ò¡ÖÁ´³Ñ¤«¤¿²¾Ì¾¡×¤ËÊÑ´¹
+	 *	V :  ÂùÅÀÉÕ¤­¤ÎÊ¸»ú¤ò°ìÊ¸»ú¤ËÊÑ´¹¡£"K","H"¤È¶¦¤Ë»ÈÍÑ¤·¤Þ¤¹	
+	 *	n :  ¡ÖÁ´³Ñ¡×¿ô»ú¤ò¡ÖÈ¾³Ñ(ÊÝ¶¸)¡×¤ËÊÑ´¹
+	 */
+	$arrConvList['search_name'] = "KVa";
+	$arrConvList['search_product_code'] = "KVa";
+	
+	// Ê¸»úÊÑ´¹
+	foreach ($arrConvList as $key => $val) {
+		// POST¤µ¤ì¤Æ¤­¤¿ÃÍ¤Î¤ßÊÑ´¹¤¹¤ë¡£
+		if(isset($objPage->arrForm[$key])) {
+			$objPage->arrForm[$key] = mb_convert_kana($objPage->arrForm[$key] ,$val);
+		}
+	}
+}
+
+// ¥¨¥é¡¼¥Á¥§¥Ã¥¯ 
+// ÆþÎÏ¥¨¥é¡¼¥Á¥§¥Ã¥¯
+function lfCheckError() {
+	$objErr = new SC_CheckError();
+	$objErr->doFunc(array("³«»ÏÆü", "search_startyear", "search_startmonth", "search_startday"), array("CHECK_DATE"));
+	$objErr->doFunc(array("½ªÎ»Æü", "search_endyear", "search_endmonth", "search_endday"), array("CHECK_DATE"));
+	$objErr->doFunc(array("³«»ÏÆü", "½ªÎ»Æü", "search_startyear", "search_startmonth", "search_startday", "search_endyear", "search_endmonth", "search_endday"), array("CHECK_SET_TERM"));
+	return $objErr->arrErr;
+}
+
+// ¥Á¥§¥Ã¥¯¥Ü¥Ã¥¯¥¹ÍÑWHEREÊ¸ºîÀ®
+function lfGetCBWhere($key, $max) {
+	$str = "";
+	$find = false;
+	for ($cnt = 1; $cnt <= $max; $cnt++) {
+		if ($_POST[$key . $cnt] == "1") {
+			$str.= "1";
+			$find = true;
+		} else {
+			$str.= "_";
+		}
+	}
+	if (!$find) {
+		$str = "";
+	}
+	return $str;
+}
+
+// ¥«¥Æ¥´¥êID¤ò¥­¡¼¡¢¥«¥Æ¥´¥êÌ¾¤òÃÍ¤Ë¤¹¤ëÇÛÎó¤òÊÖ¤¹¡£
+function lfGetIDName($arrCatList) {
+	$max = count($arrCatList);
+	for ($cnt = 0; $cnt < $max; $cnt++ ) {
+		$key = $arrCatList[$cnt]['category_id'];
+		$val = $arrCatList[$cnt]['category_name'];
+		$arrRet[$key] = $val;	
+	}
+	return $arrRet;
+}
+
+?>
Index: temp/trunk/html/test/naka/dragdrop/naka1.html
===================================================================
--- temp/trunk/html/test/naka/dragdrop/naka1.html	(revision 1694)
+++ temp/trunk/html/test/naka/dragdrop/naka1.html	(revision 1694)
@@ -0,0 +1,103 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<!-- saved from url=(0054)http://www.res-system.com/weblog/media/1/dragdrop.html -->
+<HTML><HEAD><TITLE>DragDrop Sample</TITLE>
+<META http-equiv=Content-Type content="text/html; charset=EUC-JP">
+<SCRIPT src="./js/dragdrop.js" type=text/javascript></SCRIPT>
+
+<STYLE TYPE="text/css">
+<!--
+.style_item0{
+	BORDER-RIGHT: #000000 1px solid;
+	PADDING-RIGHT: 5px;
+	BORDER-TOP: #000000 1px solid;
+	PADDING-LEFT: 5px;
+	PADDING-BOTTOM: 5px;
+	BORDER-LEFT: #000000 1px solid;
+	CURSOR: move;
+	PADDING-TOP: 5px;
+	BORDER-BOTTOM: #000000 1px solid;
+	POSITION: absolute;
+	BACKGROUND-COLOR: #aaaaff;
+	TEXT-ALIGN: center;
+}
+
+.style_item1{
+	BORDER-RIGHT: #000000 1px solid;
+	PADDING-RIGHT: 5px;
+	BORDER-TOP: #000000 1px solid;
+	PADDING-LEFT: 5px;
+	PADDING-BOTTOM: 5px;
+	BORDER-LEFT: #000000 1px solid;
+	CURSOR: move;
+	PADDING-TOP: 5px;
+	BORDER-BOTTOM: #000000 1px solid;
+	POSITION: absolute;
+	BACKGROUND-COLOR: #ffaaaa;
+	TEXT-ALIGN: center;
+}
+
+.style_item2{
+	BORDER-RIGHT: #000000 1px solid;
+	PADDING-RIGHT: 5px;
+	BORDER-TOP: #000000 1px solid;
+	PADDING-LEFT: 5px;
+	PADDING-BOTTOM: 5px;
+	BORDER-LEFT: #000000 1px solid;
+	CURSOR: move;
+	PADDING-TOP: 5px;
+	BORDER-BOTTOM: #000000 1px solid;
+	POSITION: absolute;
+	BACKGROUND-COLOR: #aaffaa;
+	TEXT-ALIGN: center;
+}
+
+.style_item2{
+	BORDER-RIGHT: #000000 1px solid;
+	PADDING-RIGHT: 5px;
+	BORDER-TOP: #000000 1px solid;
+	PADDING-LEFT: 5px;
+	PADDING-BOTTOM: 5px;
+	BORDER-LEFT: #000000 1px solid;
+	CURSOR: move;
+	PADDING-TOP: 5px;
+	BORDER-BOTTOM: #000000 1px solid;
+	POSITION: absolute;
+	BACKGROUND-COLOR: #aaffaa;
+	TEXT-ALIGN: center;
+}
+
+.style_flame{
+	POSITION: absolute;
+}
+
+-->
+</STYLE>
+
+<META content="MSHTML 6.00.2900.2873" name=GENERATOR></HEAD>
+<BODY>
+<table>
+	<tr><td height="150"></td></tr>
+</table>
+<table width="500" bgcolor="#cccccc"  border="0" cellspacing="1" cellpadding="10" summary=" ">
+<form name="form1" id="form1" method="post" action="./recv_post.php" onsubmit="preSubmit()">
+<input type="hidden" name="item0" value="0">
+<input type="hidden" name="item1" value="0">
+<input type="hidden" name="item2" value="0">
+	<tr>
+		<td bgcolor="#f5f5f5" align="center">flame1</td>
+	</tr>
+	<tr>
+		<td height="200" id="td1" bgcolor="#ffffff"><DIV id="flame0" class="style_flame" style="TOP: 200px; LEFT: 10px; WIDTH: 500px; HEIGHT: 200px;"></DIV></td>
+	</tr>
+</table>
+<table width="500">
+	<tr><td height="5"></td></tr>
+	<tr><td align="center"><input type="submit" name="subm" value="¥¢¥¤¥Æ¥à¤Î¾õ¶·¤òÁ÷¿®"></td></tr>
+</form>
+</table>
+
+<DIV id="item0" class="style_item0" style="TOP: 100px; LEFT: 45px; WIDTH: 100px; HEIGHT: 20px;">item0</DIV>
+<DIV id="item1" class="style_item1" style="TOP: 100px; LEFT: 195px; WIDTH: 100px; HEIGHT: 20px;">item1</DIV>
+<DIV id="item2" class="style_item2" style="TOP: 100px; LEFT: 345px; WIDTH: 100px; HEIGHT: 20px;">item2</DIV>
+</BODY>
+</HTML>
Index: temp/trunk/html/test/naka/dragdrop/naka2.html
===================================================================
--- temp/trunk/html/test/naka/dragdrop/naka2.html	(revision 1694)
+++ temp/trunk/html/test/naka/dragdrop/naka2.html	(revision 1694)
@@ -0,0 +1,91 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<!-- saved from url=(0054)http://www.res-system.com/weblog/media/1/dragdrop.html -->
+<HTML><HEAD><TITLE>DragDrop Sample</TITLE>
+<META http-equiv=Content-Type content="text/html; charset=EUC-JP">
+<SCRIPT src="./js/dragdrop.js" type=text/javascript></SCRIPT>
+
+<STYLE TYPE="text/css">
+<!--
+.style_item0{
+	BORDER-RIGHT: #000000 1px solid;
+	BORDER-TOP: #000000 1px solid;
+	BORDER-LEFT: #000000 1px solid;
+	BORDER-BOTTOM: #000000 1px solid;
+	PADDING-RIGHT: 5px;
+	PADDING-LEFT: 5px;
+	PADDING-BOTTOM: 5px;
+	PADDING-TOP: 5px;	
+	CURSOR: move;
+	POSITION: absolute;
+	BACKGROUND-COLOR: #aaaaff;
+	TEXT-ALIGN: center;
+}
+
+.style_item1{
+	BORDER-RIGHT: #000000 1px solid;
+	BORDER-TOP: #000000 1px solid;
+	BORDER-LEFT: #000000 1px solid;
+	BORDER-BOTTOM: #000000 1px solid;
+	PADDING-RIGHT: 5px;
+	PADDING-LEFT: 5px;
+	PADDING-BOTTOM: 5px;
+	PADDING-TOP: 5px;	
+	CURSOR: move;
+	POSITION: absolute;
+	BACKGROUND-COLOR: #ffaaaa;
+	TEXT-ALIGN: center;
+}
+
+.style_item2{
+	BORDER-RIGHT: #000000 1px solid;
+	BORDER-TOP: #000000 1px solid;
+	BORDER-LEFT: #000000 1px solid;
+	BORDER-BOTTOM: #000000 1px solid;
+	PADDING-RIGHT: 5px;
+	PADDING-LEFT: 5px;
+	PADDING-BOTTOM: 5px;
+	PADDING-TOP: 5px;	
+	CURSOR: move;
+	POSITION: absolute;
+	BACKGROUND-COLOR: #aaffaa;
+	TEXT-ALIGN: center;
+}
+
+.style_flame{
+	POSITION: absolute;
+}
+
+-->
+</STYLE>
+
+<META content="MSHTML 6.00.2900.2873" name=GENERATOR></HEAD>
+<BODY>
+<table>
+	<tr><td height="200"></td></tr>
+</table>
+<table width="500" bgcolor="#cccccc"  border="0" cellspacing="1" cellpadding="10" summary=" ">
+<form name="form1" id="form1" method="post" action="./recv_post.php" onsubmit="preSubmit()">
+<input type="hidden" name="item0" value="0">
+<input type="hidden" name="item1" value="0">
+<input type="hidden" name="item2" value="0">
+	<tr>
+		<td bgcolor="#f5f5f5" align="center">¥«¥´¤ËÆþ¤ì¤ë</td>
+	</tr>
+	<tr>
+		<td height="250" id="td1" bgcolor="#ffffff"><DIV id="flame0" class="style_flame" style="TOP: 250px; LEFT: 10px; WIDTH: 500px; HEIGHT: 250px;"></DIV></td>
+	</tr>
+</table>
+<table width="500">
+	<tr><td height="5"></td></tr>
+	<tr><td align="center"><input type="submit" name="subm" value="¥¢¥¤¥Æ¥à¤Î¾õ¶·¤òÁ÷¿®"></td></tr>
+</form>
+</table>
+
+<DIV id="item0" class="style_item0" style="TOP: 50px; LEFT: 45px; WIDTH: 100px; HEIGHT: 135px;">
+<img src="./img/item0.jpg"></DIV>
+<DIV id="item1" class="style_item1" style="TOP: 50px; LEFT: 195px; WIDTH: 100px; HEIGHT: 75px;">
+<img src="./img/item1.jpg"></DIV>
+<DIV id="item2" class="style_item2" style="TOP: 50px; LEFT: 345px; WIDTH: 100px; HEIGHT: 75px;">
+<img src="./img/item2.jpg"></DIV>
+</BODY>
+</HTML>
Index: temp/trunk/html/test/naka/dragdrop/files/xbs.js
===================================================================
--- temp/trunk/html/test/naka/dragdrop/files/xbs.js	(revision 1694)
+++ temp/trunk/html/test/naka/dragdrop/files/xbs.js	(revision 1694)
@@ -0,0 +1,1462 @@
+/**
+ * XBS (Cross Browser Scripting) Utilities
+ *
+ * Copyright (c) 2004 DRECOM CO.,LTD. All rights reserved.
+ * 
+ * info@drecom.co.jp
+ * http://www.drecom.co.jp/
+ */
+
+//---------------------------------------------------------------------------------
+// Debugging 
+//---------------------------------------------------------------------------------
+/**
+ * Assertion ¤Ë¼ºÇÔ¤·¤¿¤È¤­¤Ë¤³¤ì¤ò throw
+ */
+ASSERT_EXCEPTION = '*** Assertion Failur *** ';
+
+/**
+ * dprint, dinspect ¤Î½ÐÎÏ¤ò¥¹¥È¥Ã¥×¤¹¤ë¤È¤­¤Ï true ¤ËÀßÄê
+ */
+BLOCK_DEBUG_PRINT  = true;
+
+
+/**
+ * v ¤¬ undefined ¤Ç¤Ê¤±¤ì¤Ð true
+ */
+function defined(v) { return (typeof v != 'undefined'); }
+
+/**
+ * ¥ª¥Ö¥¸¥§¥¯¥È¤Î¤¹¤Ù¤Æ¤Î¥×¥í¥Ñ¥Æ¥£¤ò dprint ´Ø¿ô¤ÇÉ½¼¨
+ * 
+ * @param ¥ª¥Ö¥¸¥§¥¯¥È
+ */
+function dinspect(anObj)
+{
+	if (null == anObj) return;
+	for (key in anObj) {
+		dprint(key + ": " + anObj[key]);
+	}
+
+}
+
+function dprint(obj)
+{
+	if (BLOCK_DEBUG_PRINT) {
+		return;
+	}
+	if (typeof dprint.window == "undefined") {
+		dprint.window = window.open("/drecomcms/js/Console.html", 
+			"Console",
+			"width=300, height=600, scrollbars, resizable, menubar");
+	}
+	
+	var t = dprint.window.document.getElementById('console');
+	
+	if (t != null) {
+		t.value = t.value + "\n> " + obj.toString();
+	}
+// Takanori Ishiakwa 04/04/06
+// -----------------------------------------
+// Safari ¤ä Opera ¤Ç¤¦¤Þ¤¯Æ°ºî¤·¤Ê¤¤¤¿¤á
+// TextArea ¥Ð¡¼¥¸¥ç¥ó¤ËÀÚ¤êÂØ¤¨¤¿
+/*
+	if (typeof dprint.window == "undefined") {
+		dprint.window = window.open("", 
+			"Console",
+			"width=300, height=600, scrollbars, resizable, menubar");
+		dprint.window.document.open("text/plain");	
+	}
+	var d = dprint.window.document;
+	
+	if (d == null) return;
+
+	d.writeln("> " + obj.toString());
+	
+	// Opera: mime text/plain ¤ò»ØÄê¤·¤Æ¤â HTML ¤È¤·¤Æ²ò¼á
+	// ¤µ¤ì¤Æ¤¤¤ë¤è¤¦¤Ê¤Î¤Ç¡¢²þ¹Ô¤µ¤»¤ë¤¿¤á¤Ë¥¿¥°¤ò½ÐÎÏ
+	if (window.opera) d.writeln("<br>");
+*/
+}
+
+// ---------------------------------------------------------
+// XBSUtil
+// ---------------------------------------------------------
+// for the purpose of namespace
+/**
+ * ¥Ö¥é¥¦¥¶¸ß´¹¤òÌÜ»Ø¤·¤Æ¡¢¥æ¡¼¥Æ¥£¥ê¥Æ¥£·²¤ò¤Þ¤È¤á¤¿¥ª¥Ö¥¸¥§¥¯¥È
+ * 
+ * @author  Takanori Ishikawa
+ * @version 1.0
+ */
+XBSUtil = new Object();
+
+/**
+ * Í×ÁÇ¤ò´Þ¤à document ¥ª¥Ö¥¸¥§¥¯¥È¤òÊÖ¤¹¡£
+ * 
+ * @param document
+ */
+XBSUtil.getOwnerDocument = function(anElement) 
+{
+	if (anElement.document) {
+		return anElement.document;
+	} else if (anElement.ownerDocument) {
+		return anElement.ownerDocument;
+	}
+	return null;
+}
+
+
+/**
+ * Unicode code points collection
+ * 
+ * ¥×¥í¥°¥é¥àÃæ¤Ç»È¤¦Ê¸»ú¥³¡¼¥É¤ò½¸¤á¤¿¤â¤Î
+ * 
+ * @author Takanori Ishikawa
+ * @version 1.0
+ */
+XBSCType = new Object();
+
+// *** XBSCType ½é´ü²½ *** //
+// ½é´ü²½¥Æ¡¼¥Ö¥ë
+// key: property name
+// value: string (length must be 1)
+XBSCType.template_ = {
+	CR:    '\r',
+	LF:    '\n',
+	TAB:   '\t',
+	SPACE: ' ',
+	LT:    '<',
+	GT:    '>',
+	SLASH: '/',
+	COLON: ':',
+	AMP:   '&',
+	LBRACE:'{',
+	RBRACE:'}'
+};
+
+for (var key in XBSCType.template_) {
+	var c = XBSCType.template_[key];
+	
+	if (c.length != 1) {
+		throw ASSERT_EXCEPTION + 'XBSCType.template_[' + key + '] length must be 1.';
+	}
+	c = c.charCodeAt(0);
+	XBSCType[key] = c;
+}
+// ºï½ü
+delete XBSCType.template_;
+
+/**
+ * isspace
+ */
+XBSCType.isspace = function(c) 
+{
+	return (c == XBSCType.SPACE || c == XBSCType.TAB || c == XBSCType.CR || c == XBSCType.LF);
+}
+
+
+/**
+ * DOM ¥µ¥Ý¡¼¥È¶ñ¹ç¤Ë¤è¤ë¥Ö¥é¥¦¥¶È½ÊÌ
+ * 
+ * <ul>
+ * <li>IE4:   IE4 ÁêÅö</li>
+ * <li>IE5:   IE5 ÁêÅö</li>
+ * <li>NN4:   NN4 ÁêÅö</li>
+ * <li>NN6:   NN6 ÁêÅö</li>
+ * <li>OTHER: ¾åµ­°Ê³°</li>
+ * </ul>
+ */
+OTHER = 0;
+IE4   = 1;
+IE5   = 2;
+NN4   = 3;
+NN6   = 4;
+XBSUtil.DOM = document.all 
+				? (document.getElementById ? IE5 : IE4)
+				: (document.getElementById 
+					? NN6
+					: (document.layers ? NN4 : OTHER));
+
+/**
+ * ¥Æ¥­¥¹¥ÈÁàºî API ¤Î¥µ¥Ý¡¼¥È¶ñ¹ç¤Ë¤è¤ë¥Ö¥é¥¦¥¶È½ÊÌ
+ */
+XBSUtil.Range = null;
+if (document.selection != null && defined(document.selection.createRange)) {
+	XBSUtil.Range = IE5;
+}
+
+
+// ¥¨¥é¡¼»þ¤Ë¤Ï 0 ¤òÊÖ¤¹ parseInt(), 10 ¿Ê¿ô
+XBSUtil.parseIntNoError = function(anObj) {
+	var v = 0;	
+
+	try {
+		v = parseInt(anObj, 10);
+	} catch (e) {
+
+	}
+	if ((typeof v != typeof 0) || isNaN(v)) {
+		v = 0;
+	}
+
+	return v;
+}
+
+/**
+ * DOM:
+ * DocumentImplementation - feature list
+ */
+if (null == XBSUtil.DOM) {
+	throw ASSERT_EXCEPTION + 'XBSUtil.DOM must be not null.';
+}
+XBSUtil.DOM.HTMLEvent = false;
+
+if (document.implementation) {
+	XBSUtil.DOM.HTMLEvent = document.implementation.hasFeature('HTMLEvents', '2.0');
+}
+
+
+/**
+ * Mac: AppleWebKit
+ * 
+ * Apple ¤Î WebKit framework ¤Î¾å¤Ë¹½ÃÛ¤µ¤ì¤¿¥Ö¥é¥¦¥¶¤Ê¤é
+ * ¤³¤³¤Ç XBSUtil.appleWebKit ¥ª¥Ö¥¸¥§¥¯¥È¤òÀ¸À®¡£
+ * 
+ * @field major WebKit ¥á¥¸¥ã¡¼¥Ð¡¼¥¸¥ç¥óÈÖ¹æ (Number)
+ * @field minor WebKit ¥Þ¥¤¥Ê¡¼¥Ð¡¼¥¸¥ç¥óÈÖ¹æ (Number)
+ */
+XBSUtil.appleWebKit = null;
+var _webKitMatch = navigator.userAgent.match(/AppleWebKit\/(\d+)\.?(\d+)?/i);
+if (_webKitMatch != null) {
+	var o = new Object();
+	
+	o.major = XBSUtil.parseIntNoError(_webKitMatch[1]);
+	o.minor = XBSUtil.parseIntNoError(_webKitMatch[2]);	
+	XBSUtil.appleWebKit = o;
+}
+
+/**
+ * Mac IE
+ * 
+ * Mozilla/4.0 (compatible; MSIE 5.0; Mac_PowerPC)
+ */
+/**
+ * Mac: IE
+ * 
+ * IE ¤Î Mac ÈÇ¤Ê¤é
+ * ¤³¤³¤Ç XBSUtil.macIE ¥ª¥Ö¥¸¥§¥¯¥È¤òÀ¸À®¡£
+ * 
+ * @field major IE ¥á¥¸¥ã¡¼¥Ð¡¼¥¸¥ç¥óÈÖ¹æ (Number)
+ * @field minor IE ¥Þ¥¤¥Ê¡¼¥Ð¡¼¥¸¥ç¥óÈÖ¹æ (Number)
+ */
+//
+// »²¹Í¡§ 
+// Mac ¤Î¿©¤¨¤Ê¤¤ÌîÏº¤É¤â
+// http://www.din.or.jp/~hagi3/JavaScript/JSTips/ProbMac5.htm
+// Microsoft
+// http://www.microsoft.com/
+//
+XBSUtil.macIE = null;
+if (navigator.userAgent.match(/Mac/i)) {
+	var _macIEMatch;
+	
+	_macIEMatch = navigator.userAgent.match(/MSIE\s+(\d+)\.?(\d+)?/i);
+	if (_macIEMatch) {
+		var o = new Object();
+
+		o.major = XBSUtil.parseIntNoError(_macIEMatch[1]);
+		o.minor = XBSUtil.parseIntNoError(_macIEMatch[2]);	
+		XBSUtil.macIE = o;
+	}
+}
+/**
+ * Opera
+ *
+ * Opera ¤Ê¤é¤³¤³¤Ç XBSUtil.opera ¥ª¥Ö¥¸¥§¥¯¥È¤òÀ¸À®¡£
+ * 
+ * @field major opera ¥á¥¸¥ã¡¼¥Ð¡¼¥¸¥ç¥óÈÖ¹æ (Number)
+ * @field minor opera ¥Þ¥¤¥Ê¡¼¥Ð¡¼¥¸¥ç¥óÈÖ¹æ (Number)
+ */
+XBSUtil.opera = null;
+if (window.opera) {
+	var o = new Object();
+	
+	o.major = 6;
+	if (document.documentElement)
+		o.major = 7;
+	
+	o.minor = 0;
+	XBSUtil.opera = o;
+}
+
+
+// ---------------------------------------------------------
+// XBSLayer
+// ---------------------------------------------------------
+/**
+ * div Í×ÁÇ¤Ê¤É¤ò¥ì¥¤¥ä¡¼¤È¤·¤Æ°·¤¦¤¿¤á¤Î¥ª¥Ö¥¸¥§¥¯¥È
+ * 
+ * For example:
+ * <pre>
+ *    var layer = new XBSLayer(anIdOfDivElement);
+ *    // some operation...
+ * </pre>
+ *
+ * @author  Takanori Ishikawa
+ * @version 1.0
+ * @see     document.layer
+ * @see     style
+ * 
+ * @param     uniqId  div Í×ÁÇ¤Î id Â°À­
+ * @param     doc     document ¥ª¥Ö¥¸¥§¥¯¥È¡Ê¥ª¥×¥·¥ç¥ó¡§¥Ç¥Õ¥©¥ë¥È¤Ïwindow.document¡Ë
+ */
+function XBSLayer(uniqId, doc)
+{
+	if (uniqId) {
+		this.setLayerImp(XBSLayer.getLayerImpById(uniqId, doc));
+	}
+}
+/**
+ * »ØÄê¤µ¤ì¤¿ div Í×ÁÇ¤¬¤Ê¤±¤ì¤ÐÎã³°¤òÅê¤²¤ë
+ * 
+ * ¤É¤¦¤»¡¢¤¿¤¤¤·¤¿¿ô¤Î¥ì¥¤¥ä¡¼¤Ï¤Ê¤¤¤Î¤Ç¥­¥ã¥Ã¥·¥å
+ */
+XBSLayer.makeLayer = function(uniqId, doc)
+{
+	var lyer = null;
+	
+	if (XBSLayer.makeLayer.$cache == null) {
+		XBSLayer.makeLayer.$cache = new Object();
+	}
+	
+	lyer = XBSLayer.makeLayer.$cache[uniqId];
+	if (null == lyer || (doc && doc != XBSUtil.getOwnerDocument(lyer.getLayerImp()))) {
+		lyer = new XBSLayer(uniqId, doc);
+		
+		if (null == lyer || null == lyer.getLayerImp()) {
+			//b throw ASSERT_EXCEPTION + 'div element (id:' + uniqId + ') is required.';
+		}
+		XBSLayer.makeLayer.$cache[uniqId] = lyer;
+	}
+	
+	return lyer;
+}
+
+/* ---- class properties ---- */
+
+// Visibility constants
+/**
+ * ¥ì¥¤¥ä¡¼¤Î²Ä»ëÂ°À­¤òÉ½¤¹Äê¿ô
+ */
+XBSLayer.VISIBLE   = 1;
+XBSLayer.HIDDEN    = 2;
+XBSLayer.INHERIT   = 3;
+XBSLayer.UNDEFINED = 4;
+
+/**
+ * ¥ì¥¤¥ä¡¼¤ÎÁàºî¤Ë»È¤¦¼ÂÁõ¥ª¥Ö¥¸¥§¥¯¥È¤òÆÀ¤ë
+ *
+ * @param     anId  div Í×ÁÇ¤Î id Â°À­
+ * @param     doc   document ¥ª¥Ö¥¸¥§¥¯¥È¡Ê¥ª¥×¥·¥ç¥ó¡§¥Ç¥Õ¥©¥ë¥È¤Ïwindow.document¡Ë
+ * @return    DOM: element.style, NN: layer
+ */
+XBSLayer.getLayerImpById = function(anId, doc) 
+{
+	var imp = null;
+	
+	if (null == doc) {
+		doc = document;
+	}
+	if (doc.getElementById || doc.all) {
+		imp = doc.getElementById 
+				? doc.getElementById(anId)
+				: doc.all(anId);
+	} else if (doc.layers) {
+		imp = doc.layers[anId];
+	}
+	return imp;
+}
+XBSLayer.getStyleObjectWithLayerImp = function(imp)
+{
+	if (document.getElementById || document.all) {
+		return imp.style;
+	} else {
+		return imp;
+	}
+}
+
+/**
+ * ¿ÆÍ×ÁÇ¤òÆÀ¤ë
+ *
+ * @param     imp  ¼ÂÁõ¥ª¥Ö¥¸¥§¥¯¥È
+ * @return    ¿ÆÍ×ÁÇ
+ */
+XBSLayer.getParentOfLayerImp = function(imp)
+{
+	var parent = null;
+	
+	if (null == imp) {
+		;
+	} else if (defined(imp.parentElement)) {
+		parent = imp.parentElement;
+	} else if (defined(imp.offsetParent)) {
+		parent = imp.offsetParent;
+	}
+
+	return parent;
+}
+
+
+/**
+ * ¥ì¥¤¥ä¡¼¤ÎÁàºî¤Ë»È¤¦¼ÂÁõ¥ª¥Ö¥¸¥§¥¯¥È¤Î²Ä»ëÂ°À­¤òÊÖ¤¹¡£
+ *
+ * @param     imp  ¼ÂÁõ¥ª¥Ö¥¸¥§¥¯¥È
+ * @return    ²Ä»ëÂ°À­¤òÉ½¤¹Äê¿ô
+ * <ul>
+ * <li>XBSLayer.VISIBLE</li>
+ * <li>XBSLayer.HIDDEN</li>
+ * <li>XBSLayer.INHERIT</li>
+ * <li>XBSLayer.UNDEFINED</li>
+ * </ul>
+ */
+XBSLayer.getVisibilityWithLayerImp = function(imp)
+{
+	var v;
+	
+	if (XBSUtil.DOM != NN4) {
+		imp = imp.style;
+	}
+	v = imp.visibility;
+	if (document.all) {
+		if (v == '') return XBSLayer.INHERIT;
+	} else if (!document.getElementById && document.layers) {
+		if (v == 'show') return XBSLayer.VISIBLE;
+		if (v == 'hide') return XBSLayer.HIDDEN;
+	}
+	
+	if (v == 'visible') return XBSLayer.VISIBLE;
+	if (v == 'hidden') return XBSLayer.HIDDEN;
+	if (v == 'inherit') return XBSLayer.INHERIT;
+		
+	return XBSLayer.UNDEFINED;
+}
+XBSLayer.setVisibilityWithLayerImp = function(imp, anEnum)
+{
+	var v = '';
+	
+	if (!document.getElementById && document.layers) {
+		if (anEnum == XBSLayer.VISIBLE) v = 'show';
+		if (anEnum == XBSLayer.HIDDEN) v = 'hide';
+	} else {
+		if (anEnum == XBSLayer.VISIBLE) v = 'visible';
+		if (anEnum == XBSLayer.HIDDEN) v = 'hidden';
+		if (anEnum == XBSLayer.INHERIT) v = 'inherit';
+	}
+	
+	if (XBSUtil.DOM != NN4) {
+		imp = imp.style;
+	}
+	return imp.visibility = v;
+}
+/**
+ * ¥ì¥¤¥ä¡¼¤Î display Â°À­
+ * 
+ * @return ¥ì¥¤¥ä¡¼¤¬ÎÎ°è¤ò»ý¤Ä¾ì¹ç¤Ï true
+ */
+XBSLayer.isBlockWithLayerImp = function(imp)
+{
+	var b = true;
+	
+	if (imp.style.display != null) {
+		b = (imp.style.display != 'none');
+	}
+	return b;
+}
+XBSLayer.setBlockWithLayerImp = function(imp, b)
+{
+	if (imp.style != null) {
+		imp.style.display = b ? 'block' : 'none';
+	}
+}
+
+// Position & Size
+
+
+// zIndex
+XBSLayer.getZIndexWithLayerImp = function(imp)
+{
+	if (XBSUtil.DOM != NN4)
+		imp = imp.style;
+	
+	return imp.zIndex;
+}
+XBSLayer.setZIndexWithLayerImp = function(imp, z)
+{
+	if (XBSUtil.DOM != NN4)
+		imp = imp.style;
+	
+	imp.zIndex = z;
+}
+
+
+// Position
+/**
+ * °ÌÃÖ»ØÄê¤Ë»È¤¦Äê¿ô
+ */
+XBSLayer.LEFT_TOP     = 1;
+XBSLayer.LEFT_BOTTOM  = 2;
+XBSLayer.RIGHT_TOP    = 3;
+XBSLayer.RIGHT_BOTTOM = 4;
+
+/**
+ * ¥æ¡¼¥Æ¥£¥ê¥Æ¥£¡§ »ØÄê¤µ¤ì¤¿¥¤¥Ù¥ó¥È¤Î°ÌÃÖ¤Ë¥ì¥¤¥ä¡¼¤ò°ÜÆ°¡¢É½¼¨
+ * 
+ * @param imp div Í×ÁÇ
+ * @param theEvent ¥¤¥Ù¥ó¥È¥ª¥Ö¥¸¥§¥¯¥È
+ * @param axisType ºÂÉ¸¤ò»ØÄê¤¹¤ë°ÌÃÖ
+ * <ul>
+ * <li>XBSLayer.LEFT_TOP</li>
+ * <li>XBSLayer.LEFT_BOTTOM</li>
+ * <li>XBSLayer.RIGHT_TOP</li>
+ * <li>XBSLayer.RIGHT_BOTTOM</li>
+ * </ul>
+ *
+ * @param offsetX ¤³¤Îµ÷Î¥¤À¤±¥¤¥Ù¥ó¥È¤Î°ÌÃÖ¤«¤éÎ¥¤¹ (x ºÂÉ¸)
+ * @param offsetY ¤³¤Îµ÷Î¥¤À¤±¥¤¥Ù¥ó¥È¤Î°ÌÃÖ¤«¤éÎ¥¤¹ (y ºÂÉ¸)
+ * 
+ */
+XBSLayer.popUpWithLayerImpAtEventLocation = function(imp, theEvent, axisType, offsetX, offsetY)
+{
+	var left   = XBSEvent.getMouseX(theEvent) + offsetX;
+	var top    = XBSEvent.getMouseY(theEvent) + offsetY;
+		
+	XBSLayer.initPositionStyle(imp);
+	XBSLayer.setPositionWIthLayerImp(imp, left, top, axisType);
+	XBSLayer.setVisibilityWithLayerImp(imp, XBSLayer.VISIBLE);
+}
+
+/**
+ * ¥ì¥¤¥ä¡¼¤Î°ÌÃÖ»ØÄê
+ * 
+ * @param imp div Í×ÁÇ
+ * @param x x ºÂÉ¸
+ * @param y y ºÂÉ¸
+ * @param axisType ºÂÉ¸¤ò»ØÄê¤¹¤ë°ÌÃÖ (default: LEFT_TOP)
+ * <ul>
+ * <li>XBSLayer.LEFT_TOP</li>
+ * <li>XBSLayer.LEFT_BOTTOM</li>
+ * <li>XBSLayer.RIGHT_TOP</li>
+ * <li>XBSLayer.RIGHT_BOTTOM</li>
+ * </ul>
+ */
+XBSLayer.setPositionWIthLayerImp = function(imp, x, y, axisType)
+{
+	var left = x;
+	var top  = y;
+	var w = XBSLayer.getWidthWithLayerImp(imp);
+	var h = XBSLayer.getHeightWithLayerImp(imp);
+	
+	if (XBSLayer.LEFT_BOTTOM == axisType) {
+		top -= h;
+	} else if (XBSLayer.RIGHT_TOP == axisType) {
+		left -= w;
+	} else if (XBSLayer.RIGHT_BOTTOM == axisType) {
+		top -= h;
+		left -= w;
+	}
+	if (left < 0) left = 0;
+	if (top < 0) top = 0;
+	
+	XBSLayer.setLeftTopPositionWithLayerImp(imp, left, top)
+}
+/**
+ * ¥ì¥¤¥ä¡¼¤Î°ÌÃÖ¡Êº¸¾å¡Ë¤ò»ØÄê¡£
+ * 
+ * @param imp div Í×ÁÇ
+ * @param top º¸¾å x ºÂÉ¸
+ * @param left º¸¾å y ºÂÉ¸
+ */
+XBSLayer.setLeftTopPositionWithLayerImp = function(imp, left, top)
+{	
+	if (XBSUtil.DOM == NN4) {
+		imp.moveTo(left, top);
+	}else if (imp.style != null) {	
+		imp.style.left = left; imp.style.top = top;
+	}
+}
+/**
+ * ¥ì¥¤¥ä¡¼¤Î°ÌÃÖ¾ðÊó¤ò½é´ü²½¡£¥Ö¥é¥¦¥¶¤Ë¤è¤Ã¤Æ¤Ï¤³¤Î´Ø¿ô¤ò
+ * Â¾¤Î°ÌÃÖ´Ø·¸´Ø¿ô¤è¤ê¤âÁ°¤Ë¸Æ¤Ð¤Ê¤¤¤È·ë²Ì¤¬ÉÔÄê¤Ë¤Ê¤ë¡£
+ * 
+ * @param imp div
+ */
+XBSLayer.initPositionStyle = function(imp)
+{
+	if (document.layers) {
+		return;
+	} else if (typeof imp.style.left == "string") {
+		imp.style.left = imp.offsetLeft + 'px';
+		imp.style.top  = imp.offsetTop  + 'px';
+	} else if (typeof imp.style.pixelLeft != "undefined") {
+		imp.style.pixelLeft = imp.offsetLeft;
+		imp.style.pixelTop  = imp.offsetTop;
+	}
+}
+
+XBSLayer.getLeftWithLayerImp = function(imp)
+{
+	var x = 0;
+
+	if (XBSUtil.DOM == NN6 || XBSUtil.DOM == IE5) {
+		x = imp.offsetLeft;
+	} else if (XBSUtil.DOM == IE4) {
+		x = imp.style.pixelLeft;
+	} else if (XBSUtil.DOM == NN4) {
+		x = imp.clip.left;
+	}
+	return x;
+}
+
+XBSLayer.getTopWithLayerImp = function(imp)
+{
+	var y = 0;
+	if (XBSUtil.DOM == NN6 || XBSUtil.DOM == IE5) {
+		y = imp.offsetTop;
+	} else if (XBSUtil.DOM == IE4) {
+		y = imp.style.pixelTop;
+	} else if (XBSUtil.DOM == NN4) {
+		y = imp.clip.top;
+	}
+	return y;
+}
+
+// Size
+XBSLayer.getWidthWithLayerImp = function(imp) 
+{
+	var w = 0;
+	if (XBSUtil.DOM == NN6 || XBSUtil.DOM == IE5) {
+		w = imp.offsetWidth;
+	} else if (XBSUtil.DOM == IE4) {
+		w = imp.style.pixelWidth;
+	} else if (XBSUtil.DOM == NN4) {
+		w = imp.clip.width;
+	}
+	return w;
+}
+XBSLayer.getHeightWithLayerImp = function(imp)
+{
+	var h = 0;
+	if (XBSUtil.DOM == NN6 || XBSUtil.DOM == IE5) {
+		h = imp.offsetHeight;
+	} else if (XBSUtil.DOM == IE4) {
+		h = imp.style.pixelHeight;
+	} else if (XBSUtil.DOM == NN4) {
+		h = imp.clip.height;
+	}
+	return h;
+}
+XBSLayer.setWidthWithLayerImp = function(imp, w) 
+{
+	if (XBSUtil.DOM == NN6 || XBSUtil.DOM == IE5) {
+		imp.style.width = w;	
+	} else if (XBSUtil.DOM == IE4) {
+		imp.style.pixelWidth = w;
+	} else if (XBSUtil.DOM == NN4) {
+		imp.resizeTo(w, imp.clip.height);
+
+	}
+}
+XBSLayer.setHeightWithLayerImp = function(imp, h)
+{
+	if (XBSUtil.DOM == NN6 || XBSUtil.DOM == IE5) {
+		imp.style.height = h;	
+	} else if (XBSUtil.DOM == IE4) {
+		imp.style.pixelHeight = h;
+	} else if (XBSUtil.DOM == NN4) {
+		imp.resizeTo(imp.clip.width, h);
+	}
+}
+
+// HTML
+XBSLayer.getInnerHTMLWithLayerImp = function(imp)
+{
+	if (defined(imp.innerHTML)) {
+		return imp.innerHTML;
+	}
+	return '';
+}
+XBSLayer.setInnerHTMLWithLayerImp = function(imp, htmlText)
+{
+	if (defined(imp.innerHTML)) {
+		imp.innerHTML = htmlText;
+	} else if (document.layers != null) {
+		imp.document.open();
+		imp.document.write(htmlText);
+		imp.document.close();
+	}
+}
+
+// Cursor
+XBSLayer.setCursorWithLayerImp = function(imp, aName) 
+{
+	if (imp.style != null && defined(imp.style.cursor)) {
+		imp.style.cursor = aName;
+	}
+}
+
+
+
+/* ---- Instance properties ---- */
+/**
+ * ¿ÆÍ×ÁÇ¤Î XBSLayer ¤òÊÖ¤¹
+ */
+XBSLayer.prototype.getParent = function()
+{
+	var imp = XBSLayer.getParentOfLayerImp(this.getLayerImp());
+	if (null == imp) {
+		return null;
+	}
+	var lyer = new XBSLayer();
+	
+	lyer.setLayerImp(imp);
+	return lyer;
+}
+XBSLayer.prototype.getID = function() { 
+	return this.getLayerImp().id;
+}
+XBSLayer.prototype.hasID = function() {
+	var id = this.getID();
+	
+	return id != null && id != '';
+}
+XBSLayer.prototype.isValid = function() {
+	return (this.getLayerImp() != null);
+}
+// Visibility
+XBSLayer.prototype.getVisibility = function()
+{
+	return XBSLayer.getVisibilityWithLayerImp(this.getLayerImp());
+}
+XBSLayer.prototype.setVisibility = function(aEnum)
+{
+	XBSLayer.setVisibilityWithLayerImp(this.getLayerImp(), aEnum);
+}
+
+/**
+ * ¥ì¥¤¥ä¡¼¤¬²Ä»ë¤«¤É¤¦¤«¤òÊÖ¤¹¡£
+ *
+ * @return    boolean
+ */
+XBSLayer.prototype.isVisible  = function()
+{
+	return this.getVisibility() == XBSLayer.HIDDEN ? false : true;
+}
+XBSLayer.prototype.setVisible = function(/* boolean */ flag)
+{
+	this.setVisibility(flag ? XBSLayer.VISIBLE : XBSLayer.HIDDEN);
+}
+XBSLayer.prototype.toggleVisibility = function()
+{
+	this.setVisible(false == this.isVisible())
+}
+/**
+ * ¥ì¥¤¥ä¡¼¤Î display Â°À­
+ * 
+ * @return ¥ì¥¤¥ä¡¼¤¬ÎÎ°è¤ò»ý¤Ä¾ì¹ç¤Ï true
+ */
+XBSLayer.prototype.isBlock  = function()  
+{ return XBSLayer.isBlockWithLayerImp(this.getLayerImp()); }
+XBSLayer.prototype.setBlock = function(b) 
+{ XBSLayer.setBlockWithLayerImp(this.getLayerImp(), b); }
+
+
+/**
+ * ¥ì¥¤¥ä¡¼¤Î z ºÂÉ¸
+ */
+XBSLayer.prototype.getZIndex = function()
+{
+	return XBSLayer.getZIndexWithLayerImp(this.getLayerImp());
+}
+XBSLayer.prototype.setZIndex = function(z)
+{
+	XBSLayer.setZIndexWithLayerImp(this.getLayerImp(), z);
+}
+
+
+XBSLayer.prototype.getStyleObject = function() 
+{
+	return XBSLayer.getStyleObjectWithLayerImp(this.imp);
+}
+XBSLayer.prototype.getLayerImp = function() { return this.imp; }
+XBSLayer.prototype.setLayerImp = function(imp) { this.imp = imp; }
+
+// Position & Size
+XBSLayer.prototype.popUpAtEventLocation = function(theEvent, axisType, offsetX, offsetY)
+{ XBSLayer.popUpWithLayerImpAtEventLocation(this.getLayerImp(), theEvent, axisType, offsetX, offsetY); }
+
+/**
+ * ¥ì¥¤¥ä¡¼¤Î°ÌÃÖ»ØÄê
+ * 
+ * @param x x ºÂÉ¸
+ * @param y y ºÂÉ¸
+ * @param axisType ºÂÉ¸¤ò»ØÄê¤¹¤ë°ÌÃÖ
+ * <ul>
+ * <li>XBSLayer.LEFT_TOP</li>
+ * <li>XBSLayer.LEFT_BOTTOM</li>
+ * <li>XBSLayer.RIGHT_TOP</li>
+ * <li>XBSLayer.RIGHT_BOTTOM</li>
+ * </ul>
+ */
+XBSLayer.prototype.setPosition = function(x, y, axisType)
+{ XBSLayer.setPositionWIthLayerImp(this.getLayerImp(), x, y, axisType); }
+XBSLayer.prototype.setLeftTopPosition = function(left, top) 
+{ 
+	XBSLayer.setLeftTopPositionWithLayerImp(this.getLayerImp(), left, top); 
+}
+
+XBSLayer.prototype.getX = function() { return XBSLayer.getLeftWithLayerImp(this.getLayerImp()); }
+XBSLayer.prototype.getY = function() { return XBSLayer.getTopWithLayerImp(this.getLayerImp()); }
+/**
+ * ºÂÉ¸¤òÀäÂÐÃÍ¤Ç¼èÆÀ
+ */
+XBSLayer.prototype.getAbsolute_ = function(fnName)
+{
+	var ret = 0;
+	var lyer = this;
+	
+	while (lyer != null && lyer.isValid()) {
+		ret += lyer[fnName]();	
+		lyer = lyer.getParent();
+	}
+	return ret;
+	
+}
+XBSLayer.prototype.getAbsoluteX = function()
+{
+	return this.getAbsolute_("getX");
+}
+XBSLayer.prototype.getAbsoluteY = function()
+{
+	return this.getAbsolute_("getY");
+}
+
+XBSLayer.prototype.getWidth  = function() { return XBSLayer.getWidthWithLayerImp(this.getLayerImp()); }
+XBSLayer.prototype.getHeight = function() { return XBSLayer.getHeightWithLayerImp(this.getLayerImp()); }
+XBSLayer.prototype.setWidth  = function(w) { return XBSLayer.setWidthWithLayerImp(this.getLayerImp(), w); }
+XBSLayer.prototype.setHeight = function(h) { return XBSLayer.setHeightWithLayerImp(this.getLayerImp(), h); }
+
+// HTML
+XBSLayer.prototype.getInnerHTML = function()
+{
+	return XBSLayer.getInnerHTMLWithLayerImp(this.getLayerImp());
+}
+XBSLayer.prototype.setInnerHTML= function(htmlText)
+{
+	XBSLayer.setInnerHTMLWithLayerImp(this.getLayerImp(), htmlText);
+}
+
+// Cursor
+XBSLayer.prototype.setCursor = function(aName) { XBSLayer.setCursorWithLayerImp(this.getLayerImp(), aName); }
+
+//---------------------------------------------------------
+// XBSDocument
+//---------------------------------------------------------
+// object for namespace purpose
+/**
+ * ¥É¥­¥å¥á¥ó¥È¾ðÊó¤Î¼èÆÀ
+ * 
+ * @author  Takanori Ishikawa
+ * @version 1.0
+ */
+XBSDocument = new Object();
+
+
+/**
+ * ¥É¥­¥å¥á¥ó¥ÈÁ´ÂÎ¤ÎÂç¤­¤µ
+ * 
+ * @return Éý¡¢¹â¤µ
+ */
+XBSDocument.getWidth = function()
+{
+	var w = 0;
+	
+	if (window.innerWidth != null) {
+		w = window.innerWidth;
+	
+	// 2004-04-13  Takanori Ishikawa  
+	// ------------------------------------------------------------------------
+	// IE: 0 ¤¬ÊÖ¤Ã¤Æ¤¯¤ë
+	/*
+	} else if (document.documentElement && document.documentElement.clientWidth != null) {
+		w = document.documentElement.clientWidth;
+	*/
+	} else if (document.body && document.body.clientWidth != null) {
+		w = document.body.clientWidth;
+	} 
+	return w;
+}
+
+XBSDocument.getHeight = function()
+{
+	var h = 0;
+	
+	if (window.innerHeight != null) {
+		h = window.innerHeight;
+	// 2004-04-13  Takanori Ishikawa  
+	// ------------------------------------------------------------------------
+	// IE: 0 ¤¬ÊÖ¤Ã¤Æ¤¯¤ë
+	/*
+	} else if (document.documentElement && document.documentElement.clientHeight != null) {
+		h = document.documentElement.clientHeight;
+	*/
+	} else if (document.body && document.body.clientHeight != null) {
+		h = document.body.clientHeight;
+	} 
+	return h;
+}
+
+/**
+ * ¥É¥­¥å¥á¥ó¥È¤Î²Ä»ëÎÎ°è¤Îº¸¾åºÂÉ¸
+ * 
+ * @return x, y
+ */
+XBSDocument.getPageOffsetX = function()
+{
+	var x = 0;
+	
+	if (document.body && document.body.scrollLeft != null) {
+		x = document.body.scrollLeft;
+	} else if (document.documentElement && document.documentElement.scrollLeft != null) {
+		x = document.documentElement.scrollLeft;
+	} else if (window.scrollX != null) {
+		x = window.scrollX;
+	} else if (window.pageXOffset != null) {
+		x = window.pageXOffset;
+	}
+	
+	return x;
+}
+XBSDocument.getPageOffsetY = function()
+{
+	var y = 0;
+	
+	if (document.body && document.body.scrollTop != null) {
+		y = document.body.scrollTop;
+	} else if (document.documentElement && document.documentElement.scrollTop != null) {
+		y = document.documentElement.scrollTop;
+	} else if (window.scrollY != null) {
+		y = window.scrollY;
+	} else if (window.pageYOffset != null) {
+		y = window.pageYOffset;
+	}
+	
+	return y;
+}
+
+//---------------------------------------------------------
+//XBSEvent
+//---------------------------------------------------------
+// object for namespace purpose
+/**
+ * ¥¤¥Ù¥ó¥È¥ª¥Ö¥¸¥§¥¯¥È¤ÎÁàºî
+ * 
+ * @author  Takanori Ishikawa
+ * @version 1.0
+ */
+XBSEvent = new Object();
+
+// *** Key code *** //
+/**
+ * Key code (unicode)
+ * 
+ * @see http://www.unicode.org
+ */
+// 0008;<control>;Cc;0;BN;;;;;N;BACKSPACE;;;;
+XBSEvent.BACKSPACE_KEY = 0x08;
+// 0009;<control>;Cc;0;S;;;;;N;CHARACTER TABULATION;;;;
+XBSEvent.TAB_KEY = 0x09;
+// 000A;<control>;Cc;0;B;;;;;N;LINE FEED (LF);;;;
+XBSEvent.LINE_FEED_KEY = 0x0A;
+// 000D;<control>;Cc;0;B;;;;;N;CARRIAGE RETURN (CR);;;;
+XBSEvent.NEW_LINE_KEY = 0x0D;
+
+
+// Modifier keys
+XBSEvent.ALT_KEY_MASK     = 1;
+XBSEvent.SHIFT_KEY_MASK   = 1 << 1;
+XBSEvent.CONTROL_KEY_MASK = 1 << 2;
+XBSEvent.META_KEY_MASK    = 1 << 3;
+
+/**
+  * getMouseX(e), getMouseY(e)
+  *
+  * ¥Þ¥¦¥¹¤¬¥¤¥Ù¥ó¥È¤òµ¯¤³¤·¤¿»þ¤Ë
+  * XºÂÉ¸¡¢YºÂÉ¸¤òÊÖ¤¹´Ø¿ô
+  * 
+  * @param theEvent ¥Þ¥¦¥¹¥¤¥Ù¥ó¥È
+  * @return ºÂÉ¸
+  */
+XBSEvent.getMouseX = function(theEvent)
+{
+	var x = 0;
+	
+	if (null == theEvent) {
+		theEvent = window.event;
+	}
+	// Safari ¤Ï clientX ¤âÀäÂÐºÂÉ¸¤ÇÊÖ¤·¤Æ¤¯¤ë
+	if (XBSUtil.appleWebKit != null) {
+		return theEvent.pageX
+	}
+	
+	if (theEvent.clientX != null) {
+		x = XBSDocument.getPageOffsetX() + theEvent.clientX;
+	} else if (theEvent.pageX != null) {
+		x = theEvent.pageX;
+	} else if (window.opera != null) {  // Ç°¤Î¤¿¤á¡£Æ°ºî³ÎÇ§¤·¤¿¥Ð¡¼¥¸¥ç¥ó¤Ç¤Ï¤³¤Ê¤¤
+		x = (document.documentElement ? window.pageXOffset : 0) + theEvent.clientX;
+	}
+	
+	return x;
+}
+XBSEvent.getMouseY = function(theEvent) {
+	var y = 0;
+	
+	if (null == theEvent) {
+		theEvent = window.event;
+	}
+	
+	// Safari ¤Ï clientY ¤âÀäÂÐºÂÉ¸¤ÇÊÖ¤·¤Æ¤¯¤ë
+	if (XBSUtil.appleWebKit != null) {
+		return theEvent.pageY;
+	}
+	
+	if (theEvent.clientY != null) {
+		y = XBSDocument.getPageOffsetY() + theEvent.clientY;
+	} else if (theEvent.pageY != null) {
+		y = theEvent.pageY;
+	} else if (window.opera != null) {  // Ç°¤Î¤¿¤á¡£Æ°ºî³ÎÇ§¤·¤¿¥Ð¡¼¥¸¥ç¥ó¤Ç¤Ï¤³¤Ê¤¤
+		y = (document.documentElement ? window.pageYOffset : 0) + theEvent.clientY;
+	}
+	
+	return y;
+}
+
+
+/**
+ * Key Event ¤Î Unicode ¥³¡¼¥É¥Ý¥¤¥ó¥È¤òÆÀ¤ë
+ * 
+ * @return code, ¤Ê¤±¤ì¤Ð null
+ */
+XBSEvent.getKeyCode = function(theEvent) 
+{
+	if (theEvent.which != null) {
+		return theEvent.which;
+	} else if (theEvent.keyCode != null) {
+		return theEvent.keyCode;
+	}
+	return null;
+}
+XBSEvent.getTarget = function(theEvent) 
+{
+	if (theEvent.target != null) {
+		return theEvent.target;
+	} else if (theEvent.srcElement != null) {
+		return theEvent.srcElement;
+	}
+	return null;
+}
+
+
+XBSEvent.getModifierFlags = function(theEvent)
+{
+	var flags = 0;
+	
+
+	if (defined(theEvent.ctrlKey)) {
+		if (theEvent.altKey) flags |= XBSEvent.ALT_KEY_MASK;
+		if (theEvent.shiftKey) flags |= XBSEvent.SHIFT_KEY_MASK;
+		if (theEvent.ctrlKey) flags |= XBSEvent.CONTROL_KEY_MASK;
+		if (theEvent.metaKey) flags |= XBSEvent.META_KEY_MASK;
+	} else if (defined(theEvent.modifiers)) {
+		var m = theEvent.modifiers;
+		
+		if (Event.ALT_MASK & m) flags |= XBSEvent.ALT_KEY_MASK;
+		if (Event.SHIFT_KEY_MASK & m) flags |= XBSEvent.SHIFT_KEY_MASK;
+		if (Event.CONTROL_MASK & m) flags |= XBSEvent.CONTROL_KEY_MASK;
+		if (Event.META_MASK & m) flags |= XBSEvent.META_KEY_MASK;
+	}
+	return flags;
+}
+
+
+//---------------------------------------------------------------------------------
+// Utilities
+//---------------------------------------------------------------------------------
+UtilKit = new Object();
+
+/**
+ * »ØÄê¤µ¤ì¤¿¥ª¥Ö¥¸¥§¥¯¥È¤Î¥×¥í¥Ñ¥Æ¥£¤Ë´Ø¿ô¤ò *** ÄÉ²Ã *** ¤¹¤ë¡£
+ * °ÊÁ°¤ËÊÌ¤Î´Ø¿ô¤¬ÅÐÏ¿¤µ¤ì¤Æ¤¤¤ì¤Ð¤½¤ì¤ò¸Æ¤Ó½Ð¤·¤Æ¤«¤é¡¢ÅÐÏ¿¤µ¤ì¤¿´Ø¿ô¤ò¸Æ¤Ó½Ð¤¹¡£
+ * 
+ * NOTE: ÅÏ¤»¤ë°ú¿ô¤Ï¤È¤ê¤¢¤¨¤º 5 ¤Ä¤Þ¤Ç¤È¤·¤¿¡£¤³¤ì¤À¤±¤¢¤ì¤Ð½½Ê¬¤Ê¤Î¤Ç¡£
+ * 
+ * @param anObject ¥ª¥Ö¥¸¥§¥¯¥È
+ * @param funcName ¥×¥í¥Ñ¥Æ¥£Ì¾
+ * @param func     ´Ø¿ôËÜÂÎ
+ */
+UtilKit.addhook = function(anObject, funcName, func)
+{
+	var prev = anObject[funcName];
+	var fns  = new Array();
+	if (typeof prev == typeof UtilKit.addhook) {
+		fns[fns.length] = prev;
+	}
+	fns[fns.length] = func;
+	
+	// dprint("UtilKit.addhook(" + anObject + ", " + funcName + ") nfunc = " + fns.length);
+	anObject[funcName] = function() {
+		// dprint("funcName: " + funcName + ": " + this);
+		for (var i = 0; i < fns.length; i++) {
+			// dprint(fns[i]);
+			
+			// 2004-04-20  Takanori Ishikawa  
+			// -------------------------------------------------------------------
+			// ´Ø¿ôÆâ¤Ç°ú¿ô¤Î¸Ä¿ô¤ò¥Á¥§¥Ã¥¯¤·¤Æ¤¤¤ë²ÄÇ½À­¤â¤¢¤ë¤Î¤Ç¡¢ËÜÅö¤Ï°ú¿ô¸Ä¿ô¤ÇÊ¬´ô¤¹¤Ù¤­¤«¤â
+			// ¤¿¤À¡¢¤½¤Î¾ì¹ç¡¢°ú¿ô¤¬Â­¤ê¤Ê¤¤¾ì¹ç¤Ê¤É¤â¹ÍÎ¸¤¹¤ë¤ÈÌÌÅÝ¤¯¤µ¤¤¤Î¤Ç¼êÈ´¤­
+			 fns[i](
+				arguments[0],
+				arguments[1],
+				arguments[2],
+				arguments[3],
+				arguments[4]);
+			/*
+			var f = fns[i]; var args = arguments;
+			
+			switch (fns.length) {
+			case 0: f(); break;
+			case 1: f(args[0]); break;
+			case 2: f(args[0], args[1]); break;
+			case 3: f(args[0], args[1], args[2]); break;
+			default: ;
+			}
+			*/
+		}
+	};
+}
+
+/**
+ * ¥ª¥Ö¥¸¥§¥¯¥È¤Î¥×¥í¥Ñ¥Æ¥£¤òÊÖ¤¹¡£
+ * null ¤Î¾ì¹ç¤ÏÎã³°¤òÅê¤²¤ë
+ * 
+ * @param obj  object
+ * @param name property name
+ */
+UtilKit.getPropertyNotNull = function(obj, name)
+{
+	var v = obj[name];
+	
+	if (null == v) {
+		throw ASSERT_EXCEPTION + "object: " + obj + " name: " + name + ' must be nut null.';
+	}
+	
+	return v;	
+}
+
+/**
+ * ¥ª¥Ö¥¸¥§¥¯¥È¤òÏÀÍýÃÍ¤ËÊÑ´¹
+ */
+UtilKit.parseBoolean = function(v)
+{
+	if (typeof v == typeof true) {
+		return v;
+	} else if (typeof v == typeof "") {
+		if ('true' == v) 
+			return true;
+		else if ('false' == v) 
+			return false;
+		else
+			return true;
+	} else if (null == v) {
+		return false;
+	} else {
+		return true;
+	}
+}
+/**
+ * ¥ª¥Ö¥¸¥§¥¯¥È¤Î¥×¥í¥Ñ¥Æ¥£¤«¤é¡¢¤½¤ì¤ÎÅÐÏ¿¤µ¤ì¤Æ¤¤¤ë¥­¡¼¤ò¸¡º÷
+ * 
+ * @param anObject ¥ª¥Ö¥¸¥§¥¯¥È
+ * @param aValue   ¥×¥í¥Ñ¥Æ¥£ÃÍ
+ */
+UtilKit.getKeyForValue = function(anObject, aValue)
+{
+	for (var key in anObject) {
+		if (aValue == anObject[key]) {
+			return key;
+		}
+	}
+	return null;
+}
+
+UtilKit.getBgColorById = function(anId, doc)
+{
+	var imp;
+	var style;
+	
+	if (doc == null) {
+		doc = document;
+	}
+	imp = XBSLayer.getLayerImpById(anId, doc);
+	style = imp ? XBSLayer.getStyleObjectWithLayerImp(imp) : null;
+	
+	if (style == null) {
+		return null;
+	}
+	return UtilKit.normalizeRGBColorRep(style.backgroundColor);
+}
+UtilKit.setBgColorById = function(anId, aColor, doc)
+{
+	var imp;
+	var style;
+	
+	if (doc == null) {
+		doc = document;
+	}
+		
+	imp = XBSLayer.getLayerImpById(anId, doc);
+	style = imp ? XBSLayer.getStyleObjectWithLayerImp(imp) : null;
+	
+	if (style == null) {
+		return null;
+	}
+	style.backgroundColor = aColor;
+}
+
+/**
+ * NN, Opera ¤ÏÇØ·Ê¿§¤ò rgb(r, g, b) ¤È¤¤¤¦·Á¼°¤Ç
+ * ÅÏ¤·¤Æ¤¯¤ë¤Î¤Ç¡¢¤½¤ì¤ò #RGB ¤ËÊÑ´¹
+ */
+UtilKit.normalizeRGBColorRep = function(aColor)
+{
+	var m = aColor.match(/rgb\((\d+),\s*(\d+),\s+(\d+)\)/);
+	
+	if (null == m) {
+		return aColor;
+	}
+	var s = "#";
+	
+	for (var i = 1; i <= 3; i++) {
+		var n = m[i];
+		
+		n = XBSUtil.parseIntNoError(n);
+		n = n.toString(16);
+		if (n.length == 1){
+			n = '0' + n;
+		}
+		s += n;
+	}
+	return s;
+}
+
+/**
+ * InitialFirstResponder:
+ *   ¥æ¡¼¥¶¤¬ºÇ½é¤ËÆþÎÏ¤¹¤Ù¤­¥Õ¥©¡¼¥àÍ×ÁÇ
+ * 
+ * InitialFirstResponder ¤òÀßÄê¤¹¤ë´Ø¿ô¤òÊÖ¤¹¡£
+ * ¤³¤Î´Ø¿ô¤Ï¼Â¹Ô¤µ¤ì¤ë¤È¡¢window.initialFirstResponder ¤Ë¤½¤Î¥Õ¥©¡¼¥àÍ×ÁÇ¤ò³ÊÇ¼¤·¡¢
+ * ¤½¤Î¥Õ¥©¡¼¥àÍ×ÁÇ¤ò focus() ¤¹¤ë¡£
+ * window.onload ¤Ç»È¤ï¤ì¤ë¤³¤È¤òÁÛÄê
+ * 
+ */
+UtilKit.makeInitialFirstResponder = function(formName, elementName)
+{
+	return function() {
+		var frm = document.forms[formName];
+	
+		if (frm == null) return;
+		frm = frm[elementName];
+		if (frm == null) return;
+		
+		window.initialFirstResponder = frm;
+		setTimeout("window.initialFirstResponder.focus()", 500);
+	};
+}
+
+
+//---------------------------------------------------------------------------------
+// ContentsChangedListener
+//---------------------------------------------------------------------------------
+/**
+ * 
+ * ¥Ú¡¼¥¸¤ÎÆâÍÆ¤¬ÊÑ¹¹¤µ¤ì¤¿¤«¤É¤¦¤«¤òµ­Ï¿
+ * 
+ * @author Takanori Ishikawa
+ * @version 2004/04/20
+ */
+function ContentsChangedListener(/* Optional */ aName)
+{
+	this.name = aName;
+	if (this.name == null) {
+		this.name = '[undefined listener]';
+	}
+	this.changed = false;
+}
+ContentsChangedListener.prototype.toString = function()
+{ return '[ContentsChangedListener] ' + this.name; }
+
+ContentsChangedListener.prototype.isChanged = function() { return this.changed; }
+ContentsChangedListener.prototype.setChanged = function(b) {
+	if (this.changed != b) {
+		//alert(this + " changed: " + b);
+	}
+	this.changed = b; 
+}
+
+/**
+ * ¥¤¥Ù¥ó¥È¤òÅÐÏ¿¤·¡¢ÅÐÏ¿¤·¤¿¥¤¥Ù¥ó¥È¤¬È¯À¸¤·¤¿¤È¤­¤Ë
+ * ÊÑ¹¹¥Õ¥é¥°¤ò true ¤Ë¤¹¤ë¡£
+ * 
+ * ¼ç¤Ë html Í×ÁÇ¤Î onchange ¥¤¥Ù¥ó¥È¤Ê¤É¤òÊáÂª¤·¡¢
+ * ÊÑ¹¹¥Õ¥é¥°¤òÎ©¤Æ¤ë¤Î¤Ë»È¤¦¡£
+ */
+ContentsChangedListener.prototype.listenEvent = function(anObject, eventName)
+{
+//	2004-04-20  Takanori Ishikawa  
+//	------------------------------------------------------------------------
+//	this ¤Ï´Ø¿ôÆâÉô¤Ç¼Â¹Ô»þ¤Ë²ò¼á¤µ¤ì¤ë¤¿¤á¡¢°ìÅÙÊÑ¿ô¤ËÆþ¤ì¤Æ
+//	ÀÅÅª¥¹¥³¡¼¥×¤ËÂ«Çû¤¹¤ëÉ¬Í×¤¬¤¢¤ë¡Ê²òÊü¤µ¤ì¤Ê¤¤¡©¡Ë
+	var me = this
+	var callback = function(){ me.setChanged(true); };
+	
+	UtilKit.addhook(anObject, eventName, callback);
+}
+
+
+//---------------------------------------------------------------------------------
+// Common
+//---------------------------------------------------------------------------------
+/**
+ * ¥¢¥×¥ê¥±¡¼¥·¥ç¥óÁ´ÂÎ¤ÎÀßÄê
+ * 
+ * @author  Takanori Ishikawa
+ * @version 1.0
+ */
+OEMBlogGlobal = new Object();
+
+/**
+ * µ­»öÊÔ½¸¤Ç Blog ¥Ý¡¼¥¿¥ë¡¦¥«¥Æ¥´¥ê¤ÎÁªÂò¤ò¥¯¥Ã¥­¡¼¤ËÊÝÂ¸¤¹¤ë¤«
+ */
+OEMBlogGlobal.saveTbCategoryToCookie = false;
+
+/**
+ * µ­»öÊÔ½¸¤Ç¥¿¥°ÊÔ½¸µ¡Ç½¡Ê¥¿¥°¤´¤Èºï½ü¡¢°ÜÆ°¤Ê¤É¡Ë¤ò HTML ¥¿¥°¤Ç¤âÍ­¸ú¤Ë¤¹¤ë¤«
+ */
+OEMBlogGlobal.enableTagEditingOnHTML = false;
+
+
+/**
+ * ¹àÌÜÀßÄê¤Î¥Ç¥£¥¹¥¯¥í¡¼¥¸¥ã¥È¥é¥¤¥¢¥ó¥°¥ë¤Ê¤É¤Ç¥¢¥Ë¥á¡¼¥·¥ç¥ó¤òÍ­¸ú¤Ë¤¹¤ë¤«
+ */
+OEMBlogGlobal.enableAnimationFeedback = true;
+
+/**
+ * ²èÁü¤ò¥¢¥Ã¥×¥í¡¼¥É¤¹¤ë¥Ç¥£¥ì¥¯¥È¥ê¤Î¥Ñ¥¹
+ * jsp Â¦¤ÇÅ¬µ¹¹¹¿·¤µ¤ì¤ë¡£
+ */
+OEMBlogGlobal.uploadImageDirectory = null;
+
+/**
+ * ¥¢¥Ã¥×¥í¡¼¥É¤Ç¤­¤ë²èÁü¥Õ¥¡¥¤¥ëÌ¾¤Î·Á¼°
+ */
+OEMBlogGlobal.IMAGE_FILE_PATTERN = /{(º¸:|±¦:)?([a-zA-Z0-9-_.!~'()]+\.[a-zA-Z]+)}/;
+
+/**
+ * ¥µ¥¤¥É¥Ð¡¼¡§ÇÛÃÖ¤Ç¤­¤ë¹àÌÜ¤ÎºÇÂç¿ô
+ * 
+ * @see sidefunc_order.js BoxConfig.maxNBoxes
+ */
+OEMBlogGlobal.PANEL_DISABLE_MAX_NBOXES	= 50;	// ¡Ö»ÈÍÑ¤·¤Ê¤¤µ¡Ç½¡×
+OEMBlogGlobal.PANEL_LEFT_MAX_NBOXES		= 50;	// ¡Ö»ÈÍÑ¤¹¤ëµ¡Ç½¡×º¸
+OEMBlogGlobal.PANEL_RIGHT_MAX_NBOXES	= 50;	// ¡Ö»ÈÍÑ¤¹¤ëµ¡Ç½¡×±¦
+
+
+/**
+ * 
+ * µ­»öÊÔ½¸¡¢¿·µ¬ºîÀ®¤Ç¤Ï°Ê²¼¤ÎÊ¸»úÎó¤ò´Þ¤à¥ê¥ó¥¯¤ò¥¯¥ê¥Ã¥¯¤·¤¿¾ì¹ç¡¢
+ * ¤Þ¤ÀÊÑ¹¹¤¬ÊÝÂ¸¤µ¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð³ÎÇ§¥À¥¤¥¢¥í¥°¤ò½Ð¤¹¡£
+ * 
+ * @see entry_write_edit.js, entry_save_confirm.jsp
+ * @see OEMBlogGlobal.watchOtherLinks
+ */
+OEMBlogGlobal.DOCUMENT_EDITED_WARNING = "ÊÑ¹¹¤ÏÊÝÂ¸¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£<br>¼¡¤Î¥Ú¡¼¥¸¤Ø°Ü¤Ã¤Æ¤â¤è¤í¤·¤¤¤Ç¤¹¤«¡©"
+OEMBlogGlobal.WATCH_OTHER_LINK_LIST = [
+					/* ¾å */
+					'MyPage',			/* ¥Þ¥¤¥Ú¡¼¥¸ */
+					'EntryWrite',		/* µ­»ö¿·µ¬ºîÀ® */
+					'EntryList',		/* µ­»ö°ìÍ÷ */
+					'TopicList',		/* ¥ê¥ó¥¯¥ê¥¹¥È */
+					'SidefuncOrder',	/* ¥µ¥¤¥É¥Ð¡¼ */
+					'DesignChange',		/* ¥Ç¥¶¥¤¥ó */
+					'BlogSetup',		/* ÀßÄê */
+					
+					/* º¸ */
+					'SidefuncOrder',	/* µ¡Ç½ÁªÂò¡¦ÊÂ¤ÓÂØ¤¨ */
+					'SidefuncSetup',	/* É½¼¨Ì¾ÊÑ¹¹ */
+					'SidefuncEditList',		/* µ¡Ç½ÄÉ²Ã */
+					'LinksList',		/* ¥ê¥ó¥¯½¸  ÊÔ½¸ */
+					'CategoryList'		/* ¥«¥Æ¥´¥ê  ÊÔ½¸ */
+					];
+
+
+/**
+ * ¥Æ¥­¥¹¥È¤ÎÃÖ´¹¤Ê¤É¤Ç»ÈÍÑ¤¹¤ë²þ¹Ô¥³¡¼¥É
+ */
+/** TODO: »ÅÍÍ¤Ë¤·¤¿¤¬¤Ã¤Æ¡¢È½ÊÌ¥³¡¼¥É¤ò½ñ¤¯¤³¤È¡£¤È¤ê¤¢¤¨¤º¡¢CRLF ¤Ë¤·¤Æ¤ª¤¯ */
+OEMBlogGlobal.lineSeparator = "\r\n";
+
+
+OEMBlogGlobal.makeWatchOtherLinkFunction = function(aListener, prevFunc)
+{
+	return function(e) {
+		var ret = true;
+			
+		if (prevFunc != null) {
+			ret = prevFunc(e);
+		}
+		if (aListener.isChanged() == false)
+			return ret;
+			
+		return (htmlConfirm(OEMBlogGlobal.DOCUMENT_EDITED_WARNING))
+	};
+}
+OEMBlogGlobal.watchOtherLinks = function(aDocument, aListener)
+{
+	var linkArray = aDocument.links;
+	var nms = OEMBlogGlobal.WATCH_OTHER_LINK_LIST;
+	var link;
+	var count = 0;
+	
+	for (var i = 0; i < linkArray.length; i++) {
+		
+		link = linkArray[i];
+		if (null == link) continue;
+		
+		for (var j = 0; j < nms.length; j++) {
+			if (link.href.indexOf(nms[j]) != -1) {
+				var prevFunc = link.onclick;
+				
+				if (typeof prevFunc != 'function') {
+					prevFunc = null;
+				}
+				link.onclick = OEMBlogGlobal.makeWatchOtherLinkFunction(aListener, prevFunc);
+				
+				count++;
+				break;
+			}
+		}
+		if (count == nms.length) {
+			break;
+		}
+	}
+}
Index: temp/trunk/html/test/naka/dragdrop/files/style.js
===================================================================
--- temp/trunk/html/test/naka/dragdrop/files/style.js	(revision 1694)
+++ temp/trunk/html/test/naka/dragdrop/files/style.js	(revision 1694)
@@ -0,0 +1,23 @@
+
+var d = document;
+var n = navigator;
+var Mac = n.appVersion.indexOf('Mac');
+var MSIE = n.userAgent.indexOf('MSIE');
+var Safari = n.userAgent.indexOf('Safari');
+var Netscape = n.userAgent.indexOf('Netscape');
+var css = null;
+	
+if(Mac>-1){
+	if((Safari>1)||(MSIE>1)){
+		css = 'mac-webkit.css';
+	}else{
+		css = 'mac.css';
+	}
+}else{
+	if(MSIE>1){
+		css = 'win-ie.css';
+	}else{
+		css = 'win.css';
+	}
+}
+d.write('<link rel="stylesheet" href="/drecomcms/css/' + css + '" type="text/css">\n');
Index: temp/trunk/html/test/naka/dragdrop/files/common.js
===================================================================
--- temp/trunk/html/test/naka/dragdrop/files/common.js	(revision 1694)
+++ temp/trunk/html/test/naka/dragdrop/files/common.js	(revision 1694)
@@ -0,0 +1,466 @@
+/*
+ * ¶¦ÄÌ JavaScript
+ *
+ *
+ * Copyright (c) 2003 DRECOM CO.,LTD. All rights reserved.
+ * 
+ * info@drecom.co.jp
+ * http://www.drecom.co.jp/
+ */
+
+/**
+ * ¥Ö¥é¥¦¥¶²èÌÌÎÎ°è¤ÎÉý¤ò¼èÆÀ
+ */
+function getWidth(win)
+{
+	var tmp_width;
+    
+	if (win.document.documentElement) { 
+		tmp_width = win.document.documentElement.clientWidth;
+		if (tmp_width > 0) {
+			return tmp_width;
+		}
+	}
+    if (win.document.all) {
+    	tmp_width = win.document.body.clientWidth;
+		return tmp_width;
+	}
+	return win.innerWidth;
+}
+       
+/**
+ * ¥Ö¥é¥¦¥¶²èÌÌÎÎ°è¤Î¹â¤µ¤ò¼èÆÀ
+ */
+function getHeight(win)
+{
+	var tmp_height;
+    
+	if (win.document.documentElement) {
+		tmp_height = win.document.documentElement.clientHeight;
+		if (tmp_height > 0) {
+			return(tmp_height);
+		}
+	}
+    if (win.document.all) {
+		return(win.document.body.clientHeight);
+	}
+	return(win.innerHeight);
+}
+
+/**
+ * Window¤òÃæ¿´¤Ë°ÜÆ°
+ */
+function moveWindowToCenter(win) {
+	x = (screen.width  - getWidth(win)) / 2;
+	y = (screen.height - getHeight(win)) / 2;
+	win.moveTo(x,y);
+}
+
+/**
+ * ¾ï¤Ë¼êÁ°¤ËÉ½¼¨¤¹¤ë¥¦¥£¥ó¥É¥¦¤ò³«¤¯
+ */
+function openModalWindow(url, name, height, width, scrollbars, resizable, status)
+{
+	ModalWindow = openWindow(url, name, height, width, scrollbars, resizable, status);
+	onfocus = function onFocus(){
+		if (null !=ModalWindow && !ModalWindow.closed) {
+			try {
+				ModalWindow.focus();
+			} catch(e) {
+				document.onmousemove = null;
+			}
+		} else {
+			document.onmousemove = null;
+		}
+	}
+	
+	document.onmousemove = onfocus;
+	
+	return ModalWindow;
+}
+
+/**
+ * ¥¦¥£¥ó¥É¥¦¤ò³«¤¯
+ */
+function openWindow(url, name, height, width, scrollbars, resizable, status, left, top)
+{
+	var window_condition = "height=" + height + ",width=" + width + 
+					((left) ? ",left=" + left : "") + ((top) ? ",top=" + top : "") +
+					",scrollbars=" + scrollbars + ",resizable=" + resizable + ",toolbar=no,status=" + status;
+
+	subWindow = window.open(url, name, window_condition);
+	// ¥Ý¥Ã¥×¥¢¥Ã¥×¥Ö¥í¥Ã¥«¡¼¤Ê¤É¤Ç¥Ö¥í¥Ã¥¯¤µ¤ì¤¿¾ì¹ç¤ËJavaScript¥¨¥é¡¼¤Ë¤Ê¤é¤Ê¤¤¤è¤¦¤Ë
+	if (subWindow) {
+		subWindow.focus();
+	}
+
+	return subWindow;
+}
+
+/**
+ * ¥¦¥£¥ó¥É¥¦¤ò¸å¤í¤Ë³«¤¯
+ */
+function openWindowBack(url, name, height, width, scrollbars, resizable, status)
+{
+	var window_condition = "height=" + height + ",width=" + width + 
+					",scrollbars=" + scrollbars + ",resizable=" + resizable + ",toolbar=no,status=" + status +
+					",left=" + window.screen.width;
+	subWindow = window.open(url, name, window_condition);
+	subWindow.blur();
+	window.focus();
+	subWindow.moveTo(0,0);
+	return subWindow;
+}
+
+/**
+ * Esc¥­¡¼¤Ç¥¦¥£¥ó¥É¥¦¤òÊÄ¤¸¤ë¥¤¥Ù¥ó¥È
+ * 
+ * ¢¨¥µ¥Ö¥¦¥£¥ó¥É¥¦¤Îonload¤Ç
+ *   document.body.onkeypress = subwinCloseOnEsc;
+ * ¤Î¤è¤¦¤Ë»È¤Ã¤Æ¤¯¤À¤µ¤¤¡£
+ */
+function subwinCloseOnEsc(ev)
+{
+	ev || (ev = window.event);
+	if (ev.keyCode == 27) {
+		window.close();
+		return false;
+	}
+	return true;
+}
+
+
+
+// 2004-06-09 Takanori Ishikawa 
+// -----------------------------------------------------------
+// htmlAlert(), htmlConfirm() ¤Ï html ¤ò¤½¤Î¤Þ¤Þ
+// ½ÐÎÏ¤»¤º¡¢¥µ¥Ë¥¿¥¤¥º¤¹¤ë¤è¤¦¤Ë¤·¤¿¡£
+
+// sanitize html message
+function sanitize_msg(msg)
+{
+	msg = msg.replace(/</g, '&lt;');
+	msg = msg.replace(/>/g, '&gt;');
+	msg = msg.replace(/&lt;br\s*&gt;/g, '<br>');
+
+	return msg;
+}
+// alert
+function htmlAlert(msg, height, width)
+{
+	height = (null == height) ? 150: height;
+	width  = (null == width) ? 300: width;
+	msg = sanitize_msg(msg);
+	
+	if (defined(window.showModalDialog)) {
+		showModalDialog("/drecomcms/html/message_box.html", sanitize_msg(msg), "dialogHeight: " + height + "px; dialogWidth: " + width + "px; edge: Raised; center: Yes; help: No; resizable: No; status: No;");
+  	} else {
+		dialogArguments = msg;
+		ModalWindow = open("/drecomcms/html/message_box.html", "sub_alert","height=" + height + ",width=" + width + 
+					",scrollbars=no,resizable=no,toolbar=no,status=no,alwaysRaised=yes");
+		onfocus = function onFocus(){
+			if (null !=ModalWindow && !ModalWindow.closed) {
+				ModalWindow.focus();
+			}
+		}
+		document.onmousemove = onfocus;
+		return ModalWindow;
+	}
+}
+// confirm
+function htmlConfirm(msg, height, width)
+{
+	height = (null == height) ? 150: height;
+	width  = (null == width) ? 300: width;
+	if (defined(window.showModalDialog)) {
+		var value = showModalDialog("/drecomcms/html/confirm.html", sanitize_msg(msg), "dialogHeight: " + height + "px; dialogWidth: " + width + "px; edge: Raised; center: Yes; help: No; resizable: No; status: No;");
+		if (typeof value == "undefined") {
+			value = false;
+		} 
+		return value;
+	} else {
+		return window.confirm(msg.replace(/<br[^>]*\/?>/, '\n'));
+	}
+}
+
+/**
+  * ÍËÆü¤ò¼èÆÀ¤¹¤ë´Ø¿ô
+  * year:  Ç¯
+  * month: ·î
+  * day:   Æü
+  */
+function getDayOfWeek(year, month, day) {
+
+	DateOfWeek	= new Date();
+	DateOfWeek.setYear(year);
+	DateOfWeek.setMonth(month - 1);
+	DateOfWeek.setDate(day);
+	day_of_week_number	= DateOfWeek.getDay();
+
+	days = new Array('Æü','·î','²Ð','¿å','ÌÚ','¶â','ÅÚ');
+	return days[day_of_week_number];
+}
+
+
+// -----------------------------------------------------------
+// ¥Ý¡¼¥¿¥ë¡¢¥Ø¥Ã¥À
+// -----------------------------------------------------------
+/**
+ * INPUT FORM ¤ÎÇØ·Ê¿§ÊÑ¹¹
+ */
+function focusForm(obj,flag){
+	if (obj == null || obj.style == null) {
+		return;	
+	}
+	obj.style.backgroundColor = flag ? '#FFFFCC' : '#FFFFFF' 
+}
+function Skinup(fnr){
+	win = window.open('/contents/skinpop_'+fnr,'skin','width=455,height=300,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes');
+	win.focus();
+}
+function imgSwap(name,gifPath) {
+	document.images[name].src = gifPath ;
+}
+
+
+// -----------------------------------------------------------
+// ²èÁü
+// -----------------------------------------------------------
+/**
+ * ²èÁü¤ÎÉ½¼¨¥µ¥¤¥ºÄ´À°
+ */
+function adjustImageSize(imgElementName, widthMax, heightMax) {
+	var imgs = document.getElementsByName(imgElementName);
+	if (imgs) {
+		if (!imgs.length) {
+			if (widthMax && imgs.width > widthMax) {
+				imgs.height = imgs.height * widthMax / imgs.width;
+				imgs.width = widthMax;
+			}
+			if (heightMax && imgs.height > heightMax) {
+				imgs.width = imgs.width * heightMax / imgs.height;
+				imgs.height = heightMax;
+			}
+		} else {
+			for (i=0; i<imgs.length; i++) {
+				if (widthMax && imgs[i].width > widthMax) {
+					imgs[i].height = imgs[i].height * widthMax / imgs[i].width;
+					imgs[i].width = widthMax;
+				}
+				if (heightMax && imgs[i].height > heightMax) {
+					imgs[i].width = imgs[i].width * heightMax / imgs[i].height;
+					imgs[i].height = heightMax;
+				}
+			}
+		}
+	}
+}
+
+/**
+ * ËÜÊ¸¤ÎHTML¥½¡¼¥¹¤è¤ê³°Éô²èÁüURL("http://¡Á")¤òPickUp
+ */
+function getExternalImageList(orgHtml) {
+
+	var extImageList = new Array();
+	var list = new Array();
+	var n = 0;	
+	var exp;
+	
+	exp = new RegExp("<img [^>]*src=[\"']?http://[^\"']*[\"']?[^>]*>", 'ig');
+	list = orgHtml.match(exp);
+	if (list) {
+		for (var i = 0; i < list.length; i++) {
+			var str = "";
+			exp = new RegExp("src=[\"']?");
+			list[i].match(exp);
+			str = RegExp.rightContext;
+			exp = new RegExp("[\"'\\s>]|/>");
+			if (str) {
+				str.match(exp);
+				str = RegExp.leftContext;
+				
+				var isExist = false;
+				for (var j = 0; j < extImageList.length; j++) {
+					if (extImageList[j] == str) { isExist = true; break; }
+				}
+				if (!isExist) { extImageList[n++] = str; }
+			}
+		}
+	}
+	return extImageList;
+}
+
+/**
+ * ËÜÊ¸¤ÎHTML¥½¡¼¥¹¤è¤ê³°ÉôFlashURL("http://¡Á")¤òPickUp
+ */
+function getExternalFlashList(orgHtml) {
+
+	var extFlashList = new Array();
+	var list = new Array();
+	var n = 0;	
+	var exp;
+
+	var flashTag = "\\{\\\$CMSInclude [^\\\$\\}]*name=\"flash\"\\s*param=\"[^\"]*Movie=http://[^\"]*\"\\s*\\\$\\}";	
+	exp = new RegExp(flashTag, 'ig');	
+	list = orgHtml.match(exp);
+	if (list) {
+		for (var i = 0; i < list.length; i++) {
+			var str = "";
+			exp = new RegExp("Movie=");
+			list[i].match(exp);
+			str = RegExp.rightContext;
+			exp = new RegExp(";");
+			if (str) {
+				str.match(exp);
+				str = RegExp.leftContext;
+
+				var isExist = false;				
+				for (var j = 0; j < extFlashList.length; j++) {
+					if (extFlashList[j] == str) { isExist = true; break; }
+				}
+				if (!isExist) { extFlashList[n++] = str; }
+			}
+		}
+	}
+	return extFlashList;
+}
+ 
+/**
+ * ¥ê¥ó¥¯¤ÎÁ«°ÜÀè¤òÌµ¸ú¤Ë¤¹¤ë¡£
+ * ¡Ê<a>¥¿¥°¤ÎhrefÂ°À­¤ò"javascript:void(0)"¤ËÃÖ´¹¡Ë
+ */
+function replaceLinkInvalid(html) {
+	html = html.replace(/<a [^>]*>/ig, '<a href="javascript:void(0);">');
+	html = html.replace(/openPermLink\([^)]*\)/ig, 'void(0)');
+	return html;
+}
+
+/**
+ * URLÍÑ¤Î¥¨¥¹¥±¡¼¥×¤ò¹Ô¤¤¤Þ¤¹¡£
+ * '&' -> '&amp;'
+ * '>' -> '&gt;'
+ * '<' -> '&lt;'
+ * '"' -> '&quot;'
+ * Î¾Ã¼¤Î¶õÇò¤Ï Trim
+ * ' ' -> '%20'
+ * @param src ÂÐ¾ÝÊ¸»úÎó
+ */
+function /*: String :*/ escapeUrl(/*: String :*/ src) {
+	var s = replaceAll(src, '&', '&amp;');
+	s = replaceAll(s, '>', '&gt;');
+	s = replaceAll(s, '<', '&lt;');
+	s = replaceAll(s, '"', '&quot;');
+	s = trim(s);
+	s = replaceAll(s, ' ', '%20');
+	return s;
+}
+function /*: String :*/ escapeScript(/*: String :*/ src) {
+	var s = replaceAll(src, "\\", "\\\\");
+	s = replaceAll(s, "'", "\\'");
+	s = replaceAll(s, "\"", "\\\"");
+	return s;
+}
+/**
+ * Ê¸»úÎó¤ÎÁ´ÃÖ´¹¤ò¹Ô¤¤¤Þ¤¹¡£
+ * @param src ÂÐ¾ÝÊ¸»úÎó
+ * @param oldc µìÊ¸»úÎó
+ * @param newc ¿·Ê¸»úÎó
+ */
+function /*: String :*/ replaceAll(/*: String :*/src, /*: String :*/oldc, /*: String :*/newc) {
+ var h = "";
+ var b = src;
+ var index = 0;
+ while (true) {
+  index = b.indexOf(oldc, 0);
+  if (index == -1) {
+   break;
+  }
+  src = b.replace(oldc, newc);
+  h += src.substring(0, index + newc.length);
+  b = src.substring(index + newc.length, src.length);
+ }
+ return h + b;
+}
+/**
+ * Î¾Ã¼¤ÎÈ¾³Ñ/Á´³Ñ¥¹¥Ú¡¼¥¹¤ò¼è¤ê½ü¤­¤Þ¤¹¡£
+ * @param src ÂÐ¾ÝÊ¸»úÎó
+ */
+function /*: String :*/ trim(/*: String :*/src ) {
+	var s = trimR(src);
+	return trimL(s);
+}
+/**
+ * ±¦Ã¼¤ÎÈ¾³Ñ/Á´³Ñ¥¹¥Ú¡¼¥¹¤ò¼è¤ê½ü¤­¤Þ¤¹¡£
+ * @param src ÂÐ¾ÝÊ¸»úÎó
+ */
+function /*: String :*/ trimR(/*: String :*/src) {
+	var nLoop = 0;
+	var strFinal = src;
+	var strTemp = src;
+	while (nLoop < strTemp.length) {
+		if ((strFinal.substring(strFinal.length - 1, strFinal.length) == " ") || (strFinal.substring(strFinal.length - 1, strFinal.length) == "¡¡")) {
+			strFinal = strTemp.substring(0, strTemp.length - (nLoop + 1));
+		}
+		else {
+			break;
+		}
+		nLoop++;
+	}
+	return strFinal;
+}
+/**
+ * º¸Ã¼¤ÎÈ¾³Ñ/Á´³Ñ¥¹¥Ú¡¼¥¹¤ò¼è¤ê½ü¤­¤Þ¤¹¡£
+ * @param src ÂÐ¾ÝÊ¸»úÎó
+ */
+function /*: String :*/ trimL(/*: String :*/src) {
+	var nLoop = 0;
+	var strFinal = src;
+	var strTemp = src;
+	while (nLoop < strTemp.length) {
+		if ((strFinal.substring(0, 1) == " ") || (strFinal.substring(0, 1) == "¡¡")) {
+			strFinal = strTemp.substring(nLoop + 1, strTemp.length );
+		}
+		else {
+			break;
+		}
+		nLoop++;
+	}
+	return strFinal;
+}
+
+/**
+ * ·Ñ¾µ
+ */
+function extend(subClass, superClass) {
+    for (var prop in superClass.prototype) {
+        subClass.prototype[prop] = superClass.prototype[prop];
+    }
+}
+
+
+/**
+ * ¥Ý¥Ã¥×¥¢¥Ã¥×¥Ö¥í¥Ã¥«¡¼ÂÐºö
+ * window.onPopupBlocked,window.onPopupNonBlocked¤ò¥ª¡¼¥Ð¡¼¥é¥¤¥É¤·¤Æ¤¯¤À¤µ¤¤¡£
+ */
+window.onPopupBlocked = function(){
+	alert('¥¦¥£¥ó¥É¥¦¤ò³«¤±¤Þ¤»¤ó¤Ç¤·¤¿¡£¥Ý¥Ã¥×¥¢¥Ã¥×¥Ö¥í¥Ã¥«¡¼¤òÍ­¸ú¤Ë¤·¤Æ¤¤¤ë¾ì¹ç¤Ï¡¢Ìµ¸ú¤Ë¤·¤Æ¤¯¤À¤µ¤¤¡£');
+};
+
+window.onPopupNonBlocked = function(){}
+
+if (typeof window.org_open == 'undefined'){
+	window.org_open = window.open;
+	window.open = function() {
+		var win = (2 == window.open.arguments.length)
+					? window.org_open(window.open.arguments[0], window.open.arguments[1])
+					: window.org_open(window.open.arguments[0], window.open.arguments[1], window.open.arguments[2]);
+		if (null == win) {
+			window.onPopupBlocked(window.open.arguments);
+		} else {
+			window.onPopupNonBlocked(window.open.arguments);
+		}
+		return win;
+	}
+}
+
+
Index: temp/trunk/html/test/naka/dragdrop/files/access_key.js
===================================================================
--- temp/trunk/html/test/naka/dragdrop/files/access_key.js	(revision 1694)
+++ temp/trunk/html/test/naka/dragdrop/files/access_key.js	(revision 1694)
@@ -0,0 +1,51 @@
+/*
+ * Access Key Utilities
+ *
+ *
+ * Copyright (c) 2003-2004 DRECOM CO.,LTD. All rights reserved.
+ * 
+ * info@drecom.co.jp
+ * http://www.drecom.co.jp/
+ */
+
+/**
+ * ÊÝÂ¸¥·¥ç¡¼¥È¥«¥Ã¥È¤òÍ­¸ú¤Ë¤¹¤ë¤«¤É¤¦¤«¡£
+ * ¥·¥ç¡¼¥È¥«¥Ã¥È¤è¤ê¤âÀè¤Ë¡¢¥Ö¥é¥¦¥¶¤ÎÊÝÂ¸¥À¥¤¥¢¥í¥°¤¬½Ð¤ë¾ì¹ç¤ÏÌµ¸ú¤Ë¤¹¤ë¡£
+ * 
+ * @return ÊÝÂ¸¥·¥ç¡¼¥È¥«¥Ã¥È¤òÍ­¸ú¤Ë¤¹¤ë¤«¤É¤¦¤«
+ */
+function shortCutSupported()
+{
+	return (document.all != null && null == XBSUtil.opera);
+}
+
+function access_key_onkeydown_hock(theEvent) 
+{
+	if (false == shortCutSupported()) {
+		return true;
+	}
+
+	if (theEvent == null) {
+		theEvent = window.event;
+	}
+	var willCancel = false;
+	var k = XBSEvent.getKeyCode(theEvent);
+	var m = XBSEvent.getModifierFlags(theEvent);
+	if (m & XBSEvent.CONTROL_KEY_MASK){
+		if (k == 83) {  // 's'
+			execSave != null ? execSave() : void(0);
+			willCancel = true;
+		}
+	} else if (m & XBSEvent.ALT_KEY_MASK){
+		if (k == 80) {  // 'p'
+			execPrint != null ? execPrint() : void(0);
+			willCancel = true;
+		}
+	}
+	if (willCancel) {
+		theEvent.returnValue = false;
+		return false;
+	}
+	
+	return true;
+}
Index: temp/trunk/html/test/naka/dragdrop/files/sidefunc_order.js
===================================================================
--- temp/trunk/html/test/naka/dragdrop/files/sidefunc_order.js	(revision 1694)
+++ temp/trunk/html/test/naka/dragdrop/files/sidefunc_order.js	(revision 1694)
@@ -0,0 +1,1019 @@
+/**
+ * 
+ * ¥µ¥¤¥É¥Ð¡¼ÊÔ½¸ JavaScript
+ *
+ * Copyright (c) 2003-2004 DRECOM CO.,LTD. All rights reserved.
+ * 
+ * info@drecom.co.jp
+ * http://www.drecom.co.jp/
+ */
+
+
+//---------------------------------------------------------------------------------
+// ÀßÄê
+//---------------------------------------------------------------------------------
+
+// *** ½é´üÀßÄêÊÑ¿ô *** //
+
+var gSidefuncOrderForm = null;
+var SIDEFUNC_ORDER_FORM_NAME = "SidefuncOrderForm";
+
+
+// 2004-04-13  Takanori Ishikawa  
+// ------------------------------------------------------------------------
+//
+// Mac ¤Î IE5 ¤ÏºÂÉ¸´ØÏ¢¤Îµ¡Ç½¡Ê¤À¤±¤¸¤ã¤Ê¤¤¤±¤É¡Ë¤ÎÂ¿¤¯¤¬¶¸¤Ã¤Æ¤¤¤ë
+// ¤Î¤ÇÅ¬Åö¤ËÂÐ±þ
+//
+// »²¹Í¡§
+// Mac ¤Î¿©¤¨¤Ê¤¤ÌîÏº¤É¤â
+// http://www.din.or.jp/~hagi3/JavaScript/JSTips/ProbMac5.htm
+// Microsoft
+// http://www.microsoft.com/
+//
+var MAC_IE5_PITCH_X;
+var MAC_IE5_PITCH_Y;
+
+MAC_IE5_PITCH_X = MAC_IE5_PITCH_Y = 0;	/* BITCH */
+if (XBSUtil.macIE && XBSUtil.macIE.major >= 5) {
+	MAC_IE5_PITCH_X = -10;
+	MAC_IE5_PITCH_Y = 0;
+}
+
+
+// *** CheckLine *** //
+var CHECKLINE_ID = 'checkline';
+
+
+// --- Panel ---
+// ¼±ÊÌ»Ò
+var PANEL_NAME_DISABLE	= 'DISABLE';	// ³°µ¡Ç½BOX¤ÎID
+var PANEL_NAME_LEFT		= 'LEFT';		// Æâ¡¦º¸µ¡Ç½BOX¤ÎID
+var PANEL_NAME_RIGHT	= 'RIGHT';		// Æâ¡¦±¦µ¡Ç½BOX¤ÎID
+
+//¤¹¤Ù¤Æ¤Î Panel ¤ò¥×¥í¥Ñ¥Æ¥£¤Ë¤â¤Ä¥ª¥Ö¥¸¥§¥¯¥È
+// key ¤Ï name
+var gAllPanels         = new Object();
+
+// º¸¤«¤é¤Î½çÈÖ
+var gPanelNames         = [PANEL_NAME_DISABLE, PANEL_NAME_LEFT, PANEL_NAME_RIGHT];
+
+
+// --- Box ---
+var BOX_ID_PREFIX 		= 'f';			// Box ¤Î ID ¥×¥ê¥Õ¥£¥Ã¥¯¥¹
+var BoxConfig = {
+	width: 		120,	// Box Éý
+	height: 	20,		// Box ¹â¤µ
+	padding: 	10,		// Box ´Ö¤Î¥¹¥Ú¡¼¥¹
+	marginTop: 	5,		// °ìÈÖ¾å¤ÎBox¤È¿Æ¥Ñ¥Í¥ë¤È¤Î¥¹¥Ú¡¼¥¹
+	marginLeft: 5		// Box ¤È¿Æ¥Ñ¥Í¥ë¤Îº¸Â¦¤Î¥¹¥Ú¡¼¥¹
+};
+
+// Box ÇÛÃÖÎÎ°è¤ÎºÇ¾®¹â¤µ
+var MIN_BOXIES_HEIGHT	= 200;
+
+// ¤¹¤Ù¤Æ¤Î Box ¤ò¥×¥í¥Ñ¥Æ¥£¤Ë¤â¤Ä¥ª¥Ö¥¸¥§¥¯¥È
+var gAllBoxes           = new Object();
+
+/**
+ * ¥Ñ¥Í¥ë¤Ë³ÊÇ¼¤Ç¤­¤ëºÇÂç Box ¿ô¤òµ­Ï¿¤·¤¿¥ª¥Ö¥¸¥§¥¯¥È
+ * 
+ * key: ¥Ñ¥Í¥ëÌ¾ value: ¥Ñ¥Í¥ë¤Ë³ÊÇ¼¤Ç¤­¤ëºÇÂç Box ¿ô
+ * 
+ */
+
+BoxConfig.maxNBoxes = new Object();
+BoxConfig.maxNBoxes[PANEL_NAME_DISABLE]	= OEMBlogGlobal.PANEL_DISABLE_MAX_NBOXES;	// ¡Ö»ÈÍÑ¤·¤Ê¤¤µ¡Ç½¡×
+BoxConfig.maxNBoxes[PANEL_NAME_LEFT]	= OEMBlogGlobal.PANEL_LEFT_MAX_NBOXES;		// ¡Ö»ÈÍÑ¤¹¤ëµ¡Ç½¡×º¸
+BoxConfig.maxNBoxes[PANEL_NAME_RIGHT]	= OEMBlogGlobal.PANEL_RIGHT_MAX_NBOXES;		// ¡Ö»ÈÍÑ¤¹¤ëµ¡Ç½¡×±¦
+
+/**
+ * ¥Ú¡¼¥¸ÆÉ¤ß¹þ¤ß»þ¤ÎÇÛÃÖ¥Ç¡¼¥¿
+ */
+gInitialBoxPositionsData = null;
+
+//---------------------------------------------------------
+// ÇÛÃÖ¤Ê¤É
+//---------------------------------------------------------
+/**
+ * HTML ¤Î hidden input Í×ÁÇ¤«¤é¹àÌÜ¤ÎÇÛÃÖ¤Ê¤É¤Î¾ðÊó¤òÆÉ¤ß¼è¤ë¥ª¥Ö¥¸¥§¥¯¥È
+ * 
+ * @author Takanori Ishikawa
+ * @version 2004/04/23
+ */
+SFSettings = new Object();
+
+/**
+ * HTML ¤Î hidden input Í×ÁÇ¤«¤éÀßÄêÃÍ¤òÆÉ¤ß¼è¤ë
+ */
+SFSettings.loadBoxPositions = function()
+{
+	var positions = new Object();
+	var orders       = new Array();
+	var panelNames   = new Array();	
+	
+	// hidden¤«¤ébox_position¤ò¼èÆÀ
+	positions[PANEL_NAME_DISABLE]	= new Array();
+	positions[PANEL_NAME_LEFT]		= new Array();
+	positions[PANEL_NAME_RIGHT]		= new Array();
+	for (var i = 0; i < gSidefuncOrderForm.elements.length; ++i) {
+		var elem = gSidefuncOrderForm.elements[i];
+		
+		if(Box.ORDER_PROPERTY_NAME == elem.name) {
+			orders[orders.length] = elem.value;
+		} else if(Box.POSITION_PROPERTY_NAME == elem.name) {
+			var idx = XBSUtil.parseIntNoError(elem.value);
+			panelNames[panelNames.length] = gPanelNames[idx];
+		} else if (Box.ID_PROPERTY_NAME == elem.name) {
+			;
+		}
+	}
+	for (var i = 0; i < orders.length; i++) {
+		var pnm = panelNames[i];
+		var bid = i;
+		var ord = orders[i];
+		
+		positions[pnm][bid] = ord;
+	}
+	
+	orders     = null;
+	panelNames = null;
+	return positions;
+}
+
+/**
+ * ¸½ºß¤Î¾õÂÖ¤òÃ±°ì¤Î¥ª¥Ö¥¸¥§¥¯¥È¤Ë¥¨¥ó¥³¡¼¥É¤·¤ÆÊÖ¤¹¡£
+ */
+SFSettings.getObjectForPersistent = function()
+{
+	var orders = new Array();
+	var pidxes = new Array();
+	var result = '';
+	
+	if (gSidefuncOrderForm == null) {
+		return result;
+	}
+	for (var i = 0; i < gSidefuncOrderForm.elements.length; ++i) {
+		var elem = gSidefuncOrderForm.elements[i];
+		
+		if(Box.ORDER_PROPERTY_NAME == elem.name) {
+			orders[orders.length] = elem.value;
+		} else if(Box.POSITION_PROPERTY_NAME == elem.name) {
+			pidxes[pidxes.length] = XBSUtil.parseIntNoError(elem.value);
+		}
+	}
+	result += pidxes.join('');
+	result += orders.join('');
+	pidxes = null;
+	orders = null;
+	
+	return result;
+}
+
+//---------------------------------------------------------
+// ContentsChangedListener
+//---------------------------------------------------------
+/**
+ * ¥µ¥¤¥É¥Ð¡¼¤ÎÊÑ¹¹¤ò´Æ»ë¤¹¤ë¥ª¥Ö¥¸¥§¥¯¥È
+ * ContentsChangedListener ¤Î¥µ¥Ö¥¯¥é¥¹
+ * 
+ * @author Takanori Ishikawa
+ * @version 2004/04/23
+ */
+function SFChangedListener(/* Optional */ aName) /* extends ContentsChangedListener */
+{
+}
+SFChangedListener.prototype = new ContentsChangedListener();
+SFChangedListener.prototype.setChanged = function(b) 
+{
+	var persistent = SFSettings.getObjectForPersistent();
+	
+	// 2004-04-23  Takanori Ishikawa 
+	// ------------------------------------------------------------------------
+	// ¤³¤³¤Ç prototype ¤Î¥á¥½¥Ã¥É¤ò¸Æ¤Ó½Ð¤·¤Æ¤â¤¦¤Þ¤¯¤¤¤«¤Ê¤¤¡£
+
+	this.changed = (gInitialBoxPositionsData != persistent);
+}
+
+//---------------------------------------------------------
+// Drag & Drop: SFDragManager (Sidebar Function DragManager)
+//---------------------------------------------------------
+/**
+ * ¥É¥é¥Ã¥°½èÍý¤ÎÍ­¸ú²½¡¢ÅÓÃæ¤Î¾õÂÖ¤òÊÝ»ý¤¹¤ë¤¿¤á¤Î¥ª¥Ö¥¸¥§¥¯¥È
+ * ¥É¥é¥Ã¥°½èÍý¤Ï°ìÅÙ¤Ë¤Ò¤È¤Ä¤·¤«µ¯¤³¤é¤Ê¤¤¤Î¤Ç¡¢¤¤¤Þ¤Î¤È¤³¤í
+ * Singleton ¤È¤·¤Æ¼ÂÁõ
+ * 
+ * For example:
+ * <pre>
+ * // prepare for dragging, enable event handler.
+ * SFDragManager.enableEventHandler();
+ * </pre>
+ *
+ * @author  Takanori Ishikawa
+ * @version 1.0
+ */
+SFDragManager = new Object();
+
+// *** Event Handler *** //
+SFDragManager.ondrop = null;  // ÇÛÃÖ¤¬ÊÑ¹¹¤µ¤ì¤¿
+
+
+// ¥É¥é¥Ã¥°½èÍý¤ËÍøÍÑ¤¹¤ë document ¤Î¥¤¥Ù¥ó¥È¥Ï¥ó¥É¥é¤òÀßÄê
+SFDragManager.enableEventHandler = function ()
+{
+	document.onmousemove = function(e) {
+		if (SFDragManager.box != null)
+			SFDragManager.moveBox(e);
+	};
+	
+	document.onmouseup = function(e) {
+		if (SFDragManager.box != null)
+			SFDragManager.downBox(e);
+	};
+	
+	for (var key in gAllBoxes) {
+		var box = gAllBoxes[key];
+		var src = box ? box.getHTMLElement() : null;
+		
+		if (src != null) {
+			src.onmousedown = SFDragManager.pickUpBox;
+		}
+	}
+}
+
+// ¥É¥é¥Ã¥°½èÍý¤ËÍøÍÑ¤¹¤ë document ¤Î¥¤¥Ù¥ó¥È¥Ï¥ó¥É¥é¤ò²ò½ü
+SFDragManager.disbleEventHandler= function()
+{
+	document.onmousemove	= '';
+	document.onmouseup		= '';
+}
+
+
+//¥É¥é¥Ã¥°Ãæ¤Î¥ª¥Ö¥¸¥§¥¯¥È
+
+SFDragManager.destination = null;	/* °ÜÆ°Àè Panel */
+SFDragManager.source      = null;	/* °ÜÆ°¸µ Panel */
+SFDragManager.box         = null;	/* ¥É¥é¥Ã¥°Ãæ¤Î Panel */
+
+/**
+ * ¥µ¥¤¥É¥Ð¡¼¹àÌÜ¤ÎÊÑ¹¹¤ò´Æ»ë¤¹¤ë¥ª¥Ö¥¸¥§¥¯¥È¤òÊÖ¤¹¡£
+ */
+SFDragManager.getChangedListener = function()
+{
+	if (SFDragManager.getChangedListener.$instance == null) {
+		
+		SFDragManager.getChangedListener.$instance = 
+			new SFChangedListener("[Sidebar Function Order]");
+	}
+	return SFDragManager.getChangedListener.$instance;
+}
+SFDragManager.setUpContentsChangedListener = function()
+{
+	// 2004-04-23  Takanori Ishikawa  
+	// ------------------------------------------------------------------------
+	// ¥µ¥¤¥É¥Ð¡¼¤ÎÇÛÃÖ¤¬ÊÑ¹¹¤µ¤ì¤¿¤«¤É¤¦¤«¤òµ­Ï¿
+	
+	var listener = SFDragManager.getChangedListener();
+	
+	listener.listenEvent(SFDragManager, 'ondrop');
+	OEMBlogGlobal.watchOtherLinks(document, listener);
+}
+
+/**
+  * setOnLoad()
+  *
+  * ¥Ú¡¼¥¸ÆÉ¤ß¹þ¤ß»þ¤Î½é´ü½èÍý
+  */
+SFDragManager.loaded = false;
+SFDragManager.onload = function() 
+{
+	// ¥Õ¥©¡¼¥à½é´ü²½
+	gSidefuncOrderForm = UtilKit.getPropertyNotNull(document, SIDEFUNC_ORDER_FORM_NAME);
+	
+	// ³Æ Panel, Box ¥ª¥Ö¥¸¥§¥¯¥ÈÀ¸À®
+	var boxPositions = SFSettings.loadBoxPositions();
+	gInitialBoxPositionsData = SFSettings.getObjectForPersistent();
+	for (var i = 0; i < gPanelNames.length; i++) {
+		var nm = gPanelNames[i];
+		var panel;
+		
+		panel = new Panel(nm, boxPositions[nm]);
+		
+		for(var key in panel.box_position) {
+			gAllBoxes[key] = new Box(key);
+		}
+		
+		// Box ¤Î½é´üÇÛÃÖ
+		panel.setBoxPosition();
+		Panel[nm] = panel;
+		
+		gAllPanels[nm] = panel;
+	}
+	
+	
+	// ¥É¥é¥Ã¥°½èÍý¤Î½àÈ÷
+	SFDragManager.setUpContentsChangedListener();
+	SFDragManager.enableEventHandler();
+	
+	// onload ¤â¥¤¥Ù¥ó¥È
+	resetPositionsInEventHandler();
+	window.onresize = resetPositionsInEventHandler;
+	
+	SFDragManager.loaded = true;
+	// 2004-04-20  Takanori Ishikawa  
+	// ------------------------------------------------------------------------
+	// Opera ¤Ç¤Ï onload »þÅÀ¤Ç¥ì¥¤¥ä¡¼¤ÎºÆÉÁ²è¤¬´Ö¤Ë¹ç¤ï¤Ê¤¤¡£
+	// ¤³¤Î´Ø¿ô¤ò»È¤Ã¤Æ¡¢ÌµÍý¤ä¤êºÆÉÁ²è¤¹¤ë¡£
+	if (window.opera) {
+		SFDragManager.loaded = false;
+		setTimeout("refreshDisplay()", 0.8*1000);
+	}
+	
+}
+
+
+//---------------------------------------------------------
+// ¥¤¥Ù¥ó¥È½èÍý
+//---------------------------------------------------------
+// CheckLine
+/**
+ *  ¥É¥é¥Ã¥°Ãæ¤Î Box ¤¬ÁÞÆþ¤µ¤ì¤ë²Õ½ê¤ò»Ø¤·¼¨¤¹¤¿¤á¤Î¥é¥¤¥ó 
+ *
+ * @return XBSLayer
+ * @see xbs.js 
+ */
+function getCheckLineLayer()
+{
+	if (null == getCheckLineLayer.layer) {
+		getCheckLineLayer.layer = XBSLayer.makeLayer(CHECKLINE_ID);
+	}
+	return getCheckLineLayer.layer;
+}
+function getPanelAtPosition(x, y)
+{
+	var panel = null;
+	
+	for (var key in gAllPanels) {
+		panel = gAllPanels[key];
+			
+		if (x > panel.panel_section['left']  &&
+			x < panel.panel_section['right'] &&
+			y > panel.panel_section['top']   &&
+			y < panel.panel_section['under']) 
+		{ break; }
+	}
+	return panel;
+}
+
+// 2004-04-13  Takanori Ishikawa  
+// ------------------------------------------------------------------------
+// Mac IE ¤Ç¤Ï¥¤¥Ù¥ó¥È¥Ï¥ó¥É¥é¤ÎÃæ¤ÇºÂÉ¸´Ø·¸¤ÎÁàºî¤ò¹Ô¤¦¤È¤¦¤Þ¤¯¤¤¤«¤Ê¤¤¤Î¤Ç
+// ¤¹¤³¤·ÃÙ¤é¤»¤Æ¼Â¹Ô
+function resetPositionsInEventHandler()
+{
+	if (XBSUtil.macIE && XBSUtil.macIE.major >= 5) {
+		setTimeout("resetPositions()", 1*1000);	
+	} else {
+		resetPositions();
+	}
+}
+
+// *** Reset *** //
+/**
+  * ¤¹¤Ù¤Æ¤Î Box ¤òºÆÇÛÃÖ
+  */
+function resetPositions() 
+{
+	var panel;
+	
+	for (var key in gAllPanels) {
+		panel = gAllPanels[key];
+		if (panel != null) {
+			panel.setSections(); 
+			panel.setBoxPosition(); 
+		}
+	}
+}
+
+/**
+ * ¤¹¤Ù¤Æ¤Î Box ¤ò°ìÅÙ¾Ã¤·¡¢¤¹¤°¤Ë¤¹¤Ù¤ÆÉ½¼¨
+ */
+function refreshDisplay() 
+{
+	var panel;
+	
+	for (var key in gAllPanels) {
+		panel = gAllPanels[key];
+		if (panel != null) {
+			panel.setBoxVisible(false);
+			panel.setBoxVisible(true);		
+		}
+	}
+	SFDragManager.loaded = true;
+}
+
+// -----------------------------------------------------------------
+// ¥Ü¥Ã¥¯¥¹¤Î¥É¥é¥Ã¥°¡õ¥É¥í¥Ã¥×
+// -----------------------------------------------------------------
+
+/**
+  * pickUpBox()
+  * theEvent: ¥¤¥Ù¥ó¥È
+  *
+  * Box¤ò»ý¤Á¾å¤²¤¿(¥¯¥ê¥Ã¥¯¤µ¤ì¤¿)»þ¤Î½èÍý¤ò¤¹¤ë´Ø¿ô
+  */
+SFDragManager.pickUpBox = function(theEvent) {
+	if (null == theEvent) {
+		theEvent = window.event;
+	}
+	if (SFDragManager.box != null || SFDragManager.loaded == false)
+		return;
+	
+	// ¥Þ¥¦¥¹°ÌÃÖ¼èÆÀ
+	var mouse_x	    = XBSEvent.getMouseX(theEvent);
+	var mouse_y	    = XBSEvent.getMouseY(theEvent);
+	var pickedPanel = getPanelAtPosition(mouse_x, mouse_y);
+
+	if (null == pickedPanel) 
+		return;
+
+	// ÁªÂò¤µ¤ì¤¿Box¤ÎÊÂ¤Ó½çÈÖ¹æ¤È id ¤ò¼èÆÀ
+	var beforeId = pickedPanel.orderIndexOfBoxAt(mouse_x, mouse_y);
+	var funcId	= UtilKit.getKeyForValue(pickedPanel.box_position, beforeId);
+	
+	if (null == funcId)
+		return;
+	
+	//Box¥¨¥ì¥á¥ó¥È¼èÆÀ¡¦½èÍý
+	var selected = new XBSLayer(BOX_ID_PREFIX + funcId);
+	if (null == selected) 
+		return;
+
+	selected.setZIndex(selected.getZIndex() +1);
+
+	//ÁªÂò¤µ¤ì¤¿Box¤ÎX,YºÂÉ¸¤òÊÝÂ¸
+	before_box_x	= selected.getX() + MAC_IE5_PITCH_X;
+	before_box_y	= selected.getY() + MAC_IE5_PITCH_Y;
+
+	//¥Þ¥¦¥¹¤ÈBox¸¶ÅÀ¤Îº¹
+	box_to_mouse_x	= mouse_x - before_box_x;
+	box_to_mouse_y	= mouse_y - before_box_y;
+	
+	// ¥É¥é¥Ã¥°³«»Ï
+	SFDragManager.box = selected;
+	SFDragManager.source = pickedPanel;
+	before_order_id = beforeId;
+	function_id = funcId;
+}
+
+/**
+ * 
+ * Box¤ò°ÜÆ°¤¹¤ë´Ø¿ô
+ * 
+ * @param theEvent mousemove ¥¤¥Ù¥ó¥È
+ */
+SFDragManager.moveBox = function(theEvent) {
+	var selected = SFDragManager.box;
+	
+	if (null == selected || SFDragManager.loaded == false)
+		return;
+	if (null == theEvent) {
+		theEvent = window.event;
+	}
+	//
+	// ¥É¥é¥Ã¥°Ãæ¡¢¥¦¥£¥ó¥É¥¦¤«¤é½Ð¤ë»þ¥ê¥»¥Ã¥È¤·¤Æ½ª¤ï¤ë
+	//
+	if (false == Box.canMoveWithEvent(theEvent)) {
+		gAllBoxes[function_id].setPosition(before_box_x, before_box_y);
+		clearMove();
+		
+		return;
+	}
+
+	var mouse_x  = XBSEvent.getMouseX(theEvent);
+	var mouse_y  = XBSEvent.getMouseY(theEvent);
+	var curPanel = getPanelAtPosition(mouse_x, mouse_y);
+	if (null == curPanel) 
+		return;
+	
+	if (curPanel.canDropAtPosition(SFDragManager.source, selected, mouse_x, mouse_y)) {
+		// ¥Á¥§¥Ã¥¯¥é¥¤¥óÉ½¼¨
+		curPanel.showCheckLineAtPosition(mouse_x, mouse_y);
+	}
+
+	//Box°ÜÆ°
+	move_to_x = mouse_x - box_to_mouse_x;
+	move_to_y = mouse_y - box_to_mouse_y;
+	
+	selected.setLeftTopPosition(move_to_x, move_to_y);
+}
+
+
+
+/**
+ * Box ¤ò²¼¤í¤·¤¿»þ¤Î½èÍý
+ * 
+ * @param theEvent ¥¤¥Ù¥ó¥È
+ */
+SFDragManager.downBox = function(theEvent)
+{
+	if (SFDragManager.loaded == false) {
+		return;
+	}
+	if (null == theEvent) {
+		theEvent = window.event;
+	}
+	// ¥Á¥§¥Ã¥¯¥é¥¤¥ó¤ò¾Ã¤¹
+	getCheckLineLayer().setVisible(false);
+
+	// ¥Þ¥¦¥¹°ÌÃÖ¼èÆÀ
+	var mouse_x = XBSEvent.getMouseX(theEvent);
+	var mouse_y = XBSEvent.getMouseY(theEvent);
+	
+	// -------------------------------------
+	// °ÜÆ°ÎÎ°èÆâ¤«³°¤«¥Á¥§¥Ã¥¯
+	// -------------------------------------
+	// °ÜÆ°Àè¤Î¥Ñ¥Í¥ë¤ò¼èÆÀ¤·¡¢¥É¥é¥Ã¥°¾ðÊó¤ò¹¹¿·
+	// ¥É¥é¥Ã¥°Á°¸å¤Î¥Ñ¥Í¥ë
+	var beforePanel = SFDragManager.source;
+	var afterPanel  = getPanelAtPosition(mouse_x, mouse_y);
+	
+	SFDragManager.destination = afterPanel;
+	if (null == beforePanel) {
+		throw ASSERT_EXCEPTION + 'SFDragManager.source must be not null';
+	}
+	
+	var droppedBox = gAllBoxes[function_id];
+	var after_order_id = afterPanel.orderIndexOfMovingAt(mouse_x, mouse_y);
+	
+	// ¥É¥í¥Ã¥×¤Ç¤­¤Ê¤¤¾ì¹ç¡¢Box ¤òÌá¤·¤Æ¡¢¥É¥é¥Ã¥°½èÍý¤ò½ªÎ»¤¹¤ë
+	if (false == afterPanel.canDropAtPosition(beforePanel, droppedBox, mouse_x, mouse_y)) {
+		droppedBox.setPosition(before_box_x, before_box_y);
+		clearMove();
+		return;
+	}
+
+	// °ÜÆ°¤¹¤ëBox¤ò¥Ñ¥Í¥ë¤«¤éºï½ü¤·¡¢½çÈÖ¤òÀ°Íý¤¹¤ë
+	delete beforePanel.box_position[function_id];	
+	for (key in beforePanel.box_position) {
+		if (before_order_id < beforePanel.box_position[key]) {
+			--beforePanel.box_position[key];
+		}
+	}
+
+	//after_order_id¤Î½èÍý
+	if (!(beforePanel.equals(afterPanel) && before_order_id <= after_order_id)) {
+		++after_order_id;
+	}
+
+
+	// ºÇÂç¤Î¥¤¥ó¥Ç¥Ã¥¯¥¹¤ò¹¹¿·
+	if (after_order_id > afterPanel.getMaxOrderIndex() + 1) {
+		after_order_id = afterPanel.getMaxOrderIndex() + 1;
+	}
+
+	//ÁÞÆþ¤¹¤ë´Ö¤ò¤Ä¤¯¤ê¡¢ÁÞÆþ¤¹¤ë
+	for (key in afterPanel.box_position) {
+		if (after_order_id <= afterPanel.box_position[key]) {
+			++afterPanel.box_position[key];
+		}
+	}
+	afterPanel.box_position[function_id] = after_order_id;
+
+	//BoxºÆÇÛÃÖ
+	if (false == beforePanel.equals(afterPanel)) {
+		beforePanel.setBoxPosition();
+	}
+	afterPanel.setBoxPosition();
+
+	// HTML¤ÎhiddenÃÍÊÑ¹¹
+	for (var nm in gAllPanels) {
+		var p = gAllPanels[nm];
+
+		for (key in p.box_position) {
+			gSidefuncOrderForm.elements['order'][key].value = p.box_position[key];
+			gSidefuncOrderForm.elements['position'][key].value = p.getPosition();
+		}
+	}
+
+	// °ÜÆ°¤Î²ò½ü
+	clearMove();
+	if (SFDragManager.ondrop != null && typeof SFDragManager.ondrop == 'function') {
+		SFDragManager.ondrop();
+	}	
+}
+
+
+/**
+  * clearMove()
+  *
+  * Box°ÜÆ°¤ò½ªÎ»¤¹¤ë´Ø¿ô
+  */
+function clearMove() {
+	var selected = SFDragManager.box;
+	
+	selected.setZIndex(selected.getZIndex() -1);
+	SFDragManager.box = null;
+}
+
+
+
+
+//---------------------------------------------------------------------------------
+// Panel
+//---------------------------------------------------------------------------------
+/**
+  * ¸Ä¡¹¤Î¥É¥é¥Ã¥°²ÄÇ½¤Ê¹àÌÜ¤òÊÝ»ý¤¹¤ëÎÎ°è
+  * 
+  * ¤¤¤Þ¤Î¤È¤³¤í¡¢º¸¤«¤é¡Ö»ÈÍÑ¤·¤Ê¤¤µ¡Ç½¡×¡Ö»ÈÍÑ¤¹¤ëµ¡Ç½¡¦º¸¡×¡Ö»ÈÍÑ¤¹¤ëµ¡Ç½¡¦±¦¡×
+  *
+  * @param aPanelName    ¥Ñ¥Í¥ë¤ÎÌ¾Á°
+  * @param aPositionArray Box¤ÎÇÛÃÖ¾ðÊóÇÛÎó
+  *
+  * @author Yusuke Saito
+  * @version 2003/10/10
+  * 
+  * @author Takanori Ishikawa
+  * @version 2004/04/20
+  */
+function Panel(aPanelName, aPositionArray)
+{
+	this.name			   = aPanelName;						// ¥Ñ¥Í¥ë¤ÎÌ¾Á°(div¤Îid)
+	this.box_position	   = aPositionArray;					// Box¤ÎÇÛÃÖ¾ðÊóÇÛÎó
+	this.box_limit_number  = BoxConfig.maxNBoxes[aPanelName];	// ¥Ñ¥Í¥ëÆâ¤ÎºÇÂçBox¿ô
+	
+	this.position = -1;
+	for (var i = 0; i < gPanelNames.length; i++) {
+		if (this.name == gPanelNames[i]) {
+			this.position = i;
+			break;
+		}
+	}
+	
+	// ¥Ñ¥Í¥ë¡¦¥Ü¥Ã¥¯¥¹¡¦°ÜÆ°¤Î³ÆÎÎ°è¤òÀßÄê
+	this.setSections();
+}
+
+/**
+ * Box ¤Î Y offset
+ * 
+ * @param anIndex order index
+ */
+Panel.getBoxSectionOffsetY = function(anIndex)
+{
+	if (Panel.box_section_y == null) {  // Box °ÌÃÖÀßÄê
+		var nboxs = BoxConfig.maxNBoxes[PANEL_NAME_DISABLE];
+		Panel.box_section_y = new Array(nboxs);
+		
+		for (var i = 0; i < nboxs; ++i) {
+			Panel.box_section_y[i] = (BoxConfig.height + BoxConfig.padding) * i + BoxConfig.marginTop;
+		}
+	}
+	return Panel.box_section_y[anIndex];
+}
+
+Panel.prototype.getPosition = function() {
+	return this.position;
+}
+
+/**
+ * description
+ */
+Panel.prototype.toString = function()
+{
+	return '[Panel] ' + this.name;
+}
+
+/**
+ * Èæ³Ó
+ * 
+ * @param aPanel ¥Ñ¥Í¥ë
+ */
+Panel.prototype.equals = function(aPanel)
+{
+	// 2004-04-23  Takanori Ishikawa 
+	// ------------------------------------------------------------------------
+	// instanceof ¤Ï IE 6 ¤Ç¤âÌ¤¥µ¥Ý¡¼¥È	
+	if (aPanel == null || /*false == (aPanel instanceof Panel)*/ typeof aPanel.name == 'undefined') {
+		return false;
+	}	
+	return this.name == aPanel.name;
+}
+
+
+/**
+  * setSections()
+  * 
+  * ¥¦¥£¥ó¥É¥¦¤ò¸¶ÅÀ¤È¤·¤¿¥Ñ¥Í¥ë¤Î£´ÊÕ¤ÎX,YºÂÉ¸¤òÀßÄê¤¹¤ë´Ø¿ô
+  * left:º¸ÊÕX right:±¦ÊÕX top:¾åÊÕY under:²¼ÊÕY
+  */
+Panel.prototype.setSections = function() {
+
+	// ¿Æ¥ì¥¤¥ä¡¼¤Î°ÌÃÖ¼èÆÀ
+	this.setUpPanelSections();
+
+	//BoxÎÎ°è¤ÎÀßÄê
+	this.setBoxSection();
+
+	//Box°ÜÆ°ÀèÎÎ°è¤ÎÀßÄê
+	this.setMoveSection();
+}
+
+
+/**
+  * setUpPanelSections()
+  * 
+  * ¥¦¥£¥ó¥É¥¦¤ò¸¶ÅÀ¤È¤·¤¿¥Ñ¥Í¥ë¤Î£´ÊÕ¤ÎX,YºÂÉ¸¤òÀßÄê¤¹¤ë´Ø¿ô
+  * left:º¸ÊÕX right:±¦ÊÕX top:¾åÊÕY under:²¼ÊÕY
+  */
+Panel.prototype.setUpPanelSections = function() 
+{
+	var psec    = new Object;
+	var lyer = XBSLayer.makeLayer(this.name);
+	
+	psec['left'] = MAC_IE5_PITCH_X; 
+	psec['top']  = MAC_IE5_PITCH_Y;
+	
+	psec['right'] = lyer.getWidth();
+	psec['under'] = lyer.getHeight();
+	while (lyer != null && lyer.isValid() && lyer.hasID()) {
+		
+		psec['left'] += lyer.getX();	
+		psec['top']  += lyer.getY();
+		lyer = lyer.getParent();
+	}
+	psec['right'] += psec['left'];
+	psec['under'] += psec['top'];
+
+	this.panel_section = psec;
+}
+
+/**
+  * setBoxSection()
+  * 
+  * Box¤Î¼ý¤Þ¤ëÎÎ°è¤òÀßÄê¤¹¤ë´Ø¿ô
+  * box_section[ÊÂ¤Ó½çÈÖ¹æ] => (left => º¸ÊÕX, right => ±¦ÊÕX, top => ¾åÊÕY, under => ²¼ÊÕY)
+  */
+Panel.prototype.setBoxSection = function() {
+
+	//BoxÎÎ°è¤ÎÀßÄê
+	this.box_section_left_x		= this.panel_section['left'] + BoxConfig.marginLeft;
+	this.box_section_right_x	= this.box_section_left_x + BoxConfig.width
+
+	this.box_section			= new Array(this.box_limit_number);
+
+	for(i = 0; i < this.box_limit_number; ++i) {
+		this.box_section[i]				= new Array(4);
+		this.box_section[i]['left']		= this.box_section_left_x;
+		this.box_section[i]['right']	= this.box_section_right_x;
+		this.box_section[i]['top']		= Panel.getBoxSectionOffsetY(i) + this.panel_section['top'];
+		this.box_section[i]['under']	= this.box_section[i]['top'] + BoxConfig.height;
+	}
+}
+
+/**
+ * ¥Ñ¥Í¥ë¤ÎÃæ¤Ç°ìÈÖ²¼¤Î Box ¤Î¥¤¥ó¥Ç¥Ã¥¯¥¹¤òÊÖ¤¹
+ * 
+ * @return °ìÈÖ²¼¤Î Box ¤Î¥¤¥ó¥Ç¥Ã¥¯¥¹¡£
+ */
+Panel.prototype.getMaxOrderIndex = function()
+{
+	var max = -1;
+	for(key in this.box_position) {
+		max = (max < this.box_position[key]) ? this.box_position[key] : max;
+	}
+	return Number(max);
+}
+
+/**
+ * »ØÄê¤µ¤ì¤¿°ÌÃÖ¤ËºÇ¤â¶á¤¤¡¢Box ¤òÁÞÆþ²ÄÇ½¤Ê²Õ½ê¤Ë¥Á¥§¥Ã¥¯¥é¥¤¥ó¤òÉ½¼¨¤¹¤ë¡£
+ * 
+ * @param x x ºÂÉ¸
+ * @param y y ºÂÉ¸
+ */
+Panel.prototype.showCheckLineAtPosition = function(x, y)
+{
+	if (typeof x != typeof 0 || typeof y != typeof 0) {
+		throw ASSERT_EXCEPTION + 'x or y arg';
+	}
+	
+	var moveOrderId   = this.orderIndexOfMovingAt(x, y);
+	var maxOrderIndex = this.getMaxOrderIndex();
+	
+	if (null == moveOrderId)
+		return;
+	
+	if (maxOrderIndex < moveOrderId) {
+		moveOrderId = maxOrderIndex;
+	}
+	if (moveOrderId < this.box_limit_number) {
+		// ¥Á¥§¥Ã¥¯¥é¥¤¥ó°ÜÆ°
+		var check_line_left = this.panel_section['left'];
+		var check_line_top = this.move_section[moveOrderId]['top'];
+
+		// °ìÃ¶¥Á¥§¥Ã¥¯¥é¥¤¥ó¤ò¾Ã¤¹
+		getCheckLineLayer().setVisible(false);
+		getCheckLineLayer().setLeftTopPosition(check_line_left, check_line_top);
+		getCheckLineLayer().setVisible(true);
+	}
+}
+
+
+/**
+  * setMoveSection()
+  * 
+  * Box¤ò°ÜÆ°¤Ç¤­¤ëÎÎ°è¤òÀßÄê¤¹¤ë´Ø¿ô
+  * move_section[ÊÂ¤Ó½çÈÖ¹æ] => (left => º¸ÊÕX, right => ±¦ÊÕX, top => ¾åÊÕY, under => ²¼ÊÕY)
+  */
+Panel.prototype.setMoveSection = function() {
+
+	//°ÜÆ°ÎÎ°è¤ÎÀßÄê
+	this.move_section_left_x	= this.panel_section['left'];
+	this.move_section_right_x	= this.move_section_left_x + BoxConfig.width + (BoxConfig.marginLeft * 2);
+	this.move_section			= new Array(this.box_limit_number + 1);
+
+	this.move_section[-1]			= new Array(4);
+	this.move_section[-1]['left']	= this.move_section_left_x;
+	this.move_section[-1]['right']	= this.move_section_right_x;
+	this.move_section[-1]['top']	= this.panel_section['top'] - 7;
+	this.move_section[-1]['under']	= this.panel_section['top'] + (BoxConfig.marginTop / 2) + BoxConfig.height;
+
+	for(i = 0; i < this.box_limit_number; ++i) {
+		this.move_section[i]			= new Array(4);
+		this.move_section[i]['left']	= this.move_section_left_x;
+		this.move_section[i]['right']	= this.move_section_right_x;
+		this.move_section[i]['top']		= this.move_section[i - 1]['under'];
+		this.move_section[i]['under']	= this.move_section[i]['top'] + BoxConfig.height + BoxConfig.padding;
+	}
+}
+
+
+
+Panel.prototype.canDropAtPosition = function(aSourcePanel, aBox, x, y)
+{
+	var orderIndex = this.orderIndexOfMovingAt(x, y);
+	var maxIndex = this.getMaxOrderIndex() + 1;
+
+	// ¥Ñ¥Í¥ë¤«¤é³°¤ì¤¿¡¢
+	// ¥Ñ¥Í¥ë¤ÎºÇÂç Box ¿ô¤òÄ¶¤¨¤ë = false
+	return (orderIndex != null && (this.equals(aSourcePanel) || this.box_limit_number > maxIndex));
+}
+
+/**
+ * °ÜÆ°Ãæ¡¢ÁÞÆþ¤µ¤ì¤ë²Õ½ê¤Î¥¤¥ó¥Ç¥Ã¥¯¥¹¤òÊÖ¤¹¡£
+ * 
+ * @param x x ºÂÉ¸
+ * @param y y ºÂÉ¸
+ * @return ÁÞÆþ¤µ¤ì¤ë¥¤¥ó¥Ç¥Ã¥¯¥¹¡¢¤Ê¤±¤ì¤Ð null
+ */
+Panel.prototype.orderIndexOfMovingAt = function(x, y)
+{
+	return this.findOrderIndexOf_(this.move_section, x, y);
+}
+Panel.prototype.orderIndexOfBoxAt = function(x, y)
+{
+	return this.findOrderIndexOf_(this.box_section, x, y);
+}
+// private
+Panel.prototype.findOrderIndexOf_ = function(sectionDataArray, x, y)
+{
+	for (var i = -1; i < sectionDataArray.length; i++) {
+		var sec = sectionDataArray[i];
+		if (sec == null)
+			continue;
+		
+		if (x >= sec['left'] && x <= sec['right'] &&
+			y >= sec['top']  && y <= sec['under']) {
+	
+			return i
+		}
+	}
+	return null;
+}
+
+/**
+  * setBoxPosition()
+  *
+  * Box¤òºÆÇÛÃÖ¤¹¤ë´Ø¿ô
+  */
+Panel.prototype.setBoxPosition = function() {
+	for (key in this.box_position) {
+		gAllBoxes[key].setPosition(
+			this.panel_section['left'] + BoxConfig.marginLeft,
+			this.panel_section['top']  + Panel.getBoxSectionOffsetY(this.box_position[key]) );
+	}
+}
+
+Panel.prototype.setBoxVisible = function(flag)
+{
+	for (key in this.box_position) {
+		gAllBoxes[key].setVisible(flag);
+	}
+}
+
+
+
+//---------------------------------------------------------------------------------
+// Box
+//---------------------------------------------------------------------------------
+/**
+ * ¸Ä¡¹¤Î¥É¥é¥Ã¥°¤Ç°ÜÆ°²ÄÇ½¤Ê¹àÌÜ
+ * 
+ * @param anId HTML Í×ÁÇ¤Î id Â°À­
+ * 
+ * @author Yusuke Saito
+ * @version 2003/10/10
+ * 
+ * @author Takanori Ishikawa
+ * @version 2004/04/21
+ */
+function Box(anId)
+{	
+	this.uniqID     = anId;
+	this.srcElement = XBSLayer.getLayerImpById(BOX_ID_PREFIX + anId);
+
+	this.setUpSize();
+	this.x = this.y = 0;	
+}
+
+Box.prototype.getFormID = function() { return this.uniqID; }
+Box.prototype.getHTMLElement = function() { return this.srcElement; }
+
+/**
+ * HTML ¤Î hidden input Í×ÁÇ¤ÇÅÏ¤µ¤ì¤ë¥×¥í¥Ñ¥Æ¥£¤ÎÌ¾Á°
+ */
+Box.POSITION_PROPERTY_NAME = "position";
+Box.ORDER_PROPERTY_NAME    = "order";
+Box.NAME_PROPERTY_NAME     = "sidefuncName";
+Box.AUTHOR_PROPERTY_NAME   = "authorCd";
+Box.ID_PROPERTY_NAME       = "sidefuncId";
+
+
+/**
+ * ¥É¥é¥Ã¥°½èÍý¤ÎºÇÃæ¤Ë¸Æ¤Ð¤ì¤ë¡£
+ * 
+ * @param theEvent mousemove
+ * @return ¥É¥é¥Ã¥°½èÍý¤ò¥­¥ã¥ó¥»¥ë¤¹¤ë¾ì¹ç¤Ï¡¢false ¤òÊÖ¤¹¡£
+ */
+Box.MOVABLE_INSET = 5;	/* ¥É¥­¥å¥á¥ó¥È¤ÎÃ¼ - Box.MOVABLE_INSET = ¥É¥é¥Ã¥°²ÄÇ½¤ÊÎÎ°è */
+Box.canMoveWithEvent = function(theEvent) 
+{
+	// ÁêÂÐÅª¤Ê°ÌÃÖ¤¬¤Û¤·¤¤¤Î¤Ç¡¢XBSDocument.getPageOffsetX/Y() ¤ò°ú¤¯
+	var mouse_x = XBSEvent.getMouseX(theEvent) - XBSDocument.getPageOffsetX();
+	var mouse_y = XBSEvent.getMouseY(theEvent) - XBSDocument.getPageOffsetY();
+	
+	if (mouse_x < Box.MOVABLE_INSET || mouse_y < Box.MOVABLE_INSET) {
+		return false;
+	}
+	
+	var maxX = XBSDocument.getWidth() - Box.MOVABLE_INSET;
+	var maxY = XBSDocument.getHeight() - Box.MOVABLE_INSET;
+	
+	if (mouse_x > maxX || mouse_y > maxY) {
+		return false;
+	}
+	
+	return true;
+}
+
+/**
+  * setUpSize()
+  * 
+  * Box¤ÎÂç¤­¤µ¤òÀßÄê¤¹¤ë´Ø¿ô
+  */
+Box.prototype.setUpSize = function() 
+{
+	var imp = this.getHTMLElement();
+	
+	// style.height ¤Ç¤Ê¤¤¤È opera ¤Ç¤¦¤Þ¤¯¤¤¤«¤Ê¤¤
+	if (XBSUtil.DOM == NN6 || XBSUtil.DOM == IE5) {
+		imp.style.height = BoxConfig.height;	
+		imp.style.width = BoxConfig.width;	
+	} else {
+		XBSLayer.setHeightWithLayerImp(imp, BoxConfig.height);
+		XBSLayer.setWidthWithLayerImp(imp, BoxConfig.width);
+	}
+	XBSLayer.setCursorWithLayerImp(imp, 'move');
+}
+
+/**
+  * Box¤Î°ÌÃÖ¤òÀßÄê
+  * 
+  * @param left x
+  * @param top  y
+  */
+Box.prototype.setPosition = function(left, top) 
+{
+	var imp = this.getHTMLElement();
+	XBSLayer.initPositionStyle(imp);
+	XBSLayer.setLeftTopPositionWithLayerImp(imp, left, top);
+	this.x = left; this.y = top;
+}
+/**
+ * Box ¤Î²Ä»ëÂ°À­¤òÀßÄê
+ */
+Box.prototype.setVisible = function(flag)
+{
+	var imp = this.getHTMLElement();
+	XBSLayer.setVisibilityWithLayerImp(imp, flag ? XBSLayer.VISIBLE : XBSLayer.HIDDEN);
+}
Index: temp/trunk/html/test/naka/dragdrop/dragdrop.files/prototype.js
===================================================================
--- temp/trunk/html/test/naka/dragdrop/dragdrop.files/prototype.js	(revision 1694)
+++ temp/trunk/html/test/naka/dragdrop/dragdrop.files/prototype.js	(revision 1694)
@@ -0,0 +1,1044 @@
+/*  Prototype JavaScript framework, version 1.3.0
+ *  (c) 2005 Sam Stephenson <sam@conio.net>
+ *
+ *  THIS FILE IS AUTOMATICALLY GENERATED. When sending patches, please diff
+ *  against the source tree, available from the Prototype darcs repository. 
+ *
+ *  Prototype is freely distributable under the terms of an MIT-style license.
+ *
+ *  For details, see the Prototype web site: http://prototype.conio.net/
+ *
+/*--------------------------------------------------------------------------*/
+
+var Prototype = {
+  Version: '1.3.0',
+  emptyFunction: function() {}
+}
+
+var Class = {
+  create: function() {
+    return function() { 
+      this.initialize.apply(this, arguments);
+    }
+  }
+}
+
+var Abstract = new Object();
+
+Object.extend = function(destination, source) {
+  for (property in source) {
+    destination[property] = source[property];
+  }
+  return destination;
+}
+/*
+Object.prototype.extend = function(object) {
+  return Object.extend.apply(this, [this, object]);
+}
+*/
+Function.prototype.bind = function(object) {
+  var __method = this;
+  return function() {
+    __method.apply(object, arguments);
+  }
+}
+
+Function.prototype.bindAsEventListener = function(object) {
+  var __method = this;
+  return function(event) {
+    __method.call(object, event || window.event);
+  }
+}
+
+Number.prototype.toColorPart = function() {
+  var digits = this.toString(16);
+  if (this < 16) return '0' + digits;
+  return digits;
+}
+
+var Try = {
+  these: function() {
+    var returnValue;
+
+    for (var i = 0; i < arguments.length; i++) {
+      var lambda = arguments[i];
+      try {
+        returnValue = lambda();
+        break;
+      } catch (e) {}
+    }
+
+    return returnValue;
+  }
+}
+
+/*--------------------------------------------------------------------------*/
+
+var PeriodicalExecuter = Class.create();
+PeriodicalExecuter.prototype = {
+  initialize: function(callback, frequency) {
+    this.callback = callback;
+    this.frequency = frequency;
+    this.currentlyExecuting = false;
+
+    this.registerCallback();
+  },
+
+  registerCallback: function() {
+    setInterval(this.onTimerEvent.bind(this), this.frequency * 1000);
+  },
+
+  onTimerEvent: function() {
+    if (!this.currentlyExecuting) {
+      try { 
+        this.currentlyExecuting = true;
+        this.callback(); 
+      } finally { 
+        this.currentlyExecuting = false;
+      }
+    }
+  }
+}
+
+/*--------------------------------------------------------------------------*/
+
+function $() {
+  var elements = new Array();
+
+  for (var i = 0; i < arguments.length; i++) {
+    var element = arguments[i];
+    if (typeof element == 'string')
+      element = document.getElementById(element);
+
+    if (arguments.length == 1) 
+      return element;
+
+    elements.push(element);
+  }
+
+  return elements;
+}
+
+if (!Array.prototype.push) {
+  Array.prototype.push = function() {
+		var startLength = this.length;
+		for (var i = 0; i < arguments.length; i++)
+      this[startLength + i] = arguments[i];
+	  return this.length;
+  }
+}
+
+if (!Function.prototype.apply) {
+  // Based on code from http://www.youngpup.net/
+  Function.prototype.apply = function(object, parameters) {
+    var parameterStrings = new Array();
+    if (!object)     object = window;
+    if (!parameters) parameters = new Array();
+    
+    for (var i = 0; i < parameters.length; i++)
+      parameterStrings[i] = 'parameters[' + i + ']';
+    
+    object.__apply__ = this;
+    var result = eval('object.__apply__(' + 
+      parameterStrings[i].join(', ') + ')');
+    object.__apply__ = null;
+    
+    return result;
+  }
+}
+
+Object.extend(String.prototype, {
+  stripTags: function() {
+    return this.replace(/<\/?[^>]+>/gi, '');
+  },
+
+  escapeHTML: function() {
+    var div = document.createElement('div');
+    var text = document.createTextNode(this);
+    div.appendChild(text);
+    return div.innerHTML;
+  },
+
+  unescapeHTML: function() {
+    var div = document.createElement('div');
+    div.innerHTML = this.stripTags();
+    return div.childNodes[0].nodeValue;
+  }
+});
+
+var Ajax = {
+  getTransport: function() {
+    return Try.these(
+      function() {return new ActiveXObject('Msxml2.XMLHTTP')},
+      function() {return new ActiveXObject('Microsoft.XMLHTTP')},
+      function() {return new XMLHttpRequest()}
+    ) || false;
+  }
+}
+
+Ajax.Base = function() {};
+Ajax.Base.prototype = {
+  setOptions: function(options) {
+    this.options = Object.extend({
+      method:       'post',
+      asynchronous: true,
+      parameters:   ''
+    }, options || {});
+  },
+
+  responseIsSuccess: function() {
+    return this.transport.status == undefined
+        || this.transport.status == 0 
+        || (this.transport.status >= 200 && this.transport.status < 300);
+  },
+
+  responseIsFailure: function() {
+    return !this.responseIsSuccess();
+  }
+}
+
+Ajax.Request = Class.create();
+Ajax.Request.Events = 
+  ['Uninitialized', 'Loading', 'Loaded', 'Interactive', 'Complete'];
+
+Ajax.Request.prototype = Object.extend(new Ajax.Base(), {
+  initialize: function(url, options) {
+    this.transport = Ajax.getTransport();
+    this.setOptions(options);
+    this.request(url);
+  },
+
+  request: function(url) {
+    var parameters = this.options.parameters || '';
+    if (parameters.length > 0) parameters += '&_=';
+
+    try {
+      if (this.options.method == 'get')
+        url += '?' + parameters;
+
+      this.transport.open(this.options.method, url,
+        this.options.asynchronous);
+
+      if (this.options.asynchronous) {
+        this.transport.onreadystatechange = this.onStateChange.bind(this);
+        setTimeout((function() {this.respondToReadyState(1)}).bind(this), 10);
+      }
+
+      this.setRequestHeaders();
+
+      var body = this.options.postBody ? this.options.postBody : parameters;
+      this.transport.send(this.options.method == 'post' ? body : null);
+
+    } catch (e) {
+    }
+  },
+
+  setRequestHeaders: function() {
+    var requestHeaders = 
+      ['X-Requested-With', 'XMLHttpRequest',
+       'X-Prototype-Version', Prototype.Version];
+
+    if (this.options.method == 'post') {
+      requestHeaders.push('Content-type', 
+        'application/x-www-form-urlencoded');
+
+      /* Force "Connection: close" for Mozilla browsers to work around
+       * a bug where XMLHttpReqeuest sends an incorrect Content-length
+       * header. See Mozilla Bugzilla #246651. 
+       */
+      if (this.transport.overrideMimeType)
+        requestHeaders.push('Connection', 'close');
+    }
+
+    if (this.options.requestHeaders)
+      requestHeaders.push.apply(requestHeaders, this.options.requestHeaders);
+
+    for (var i = 0; i < requestHeaders.length; i += 2)
+      this.transport.setRequestHeader(requestHeaders[i], requestHeaders[i+1]);
+  },
+
+  onStateChange: function() {
+    var readyState = this.transport.readyState;
+    if (readyState != 1)
+      this.respondToReadyState(this.transport.readyState);
+  },
+
+  respondToReadyState: function(readyState) {
+    var event = Ajax.Request.Events[readyState];
+
+    if (event == 'Complete')
+      (this.options['on' + this.transport.status]
+       || this.options['on' + this.responseIsSuccess ? 'Success' : 'Failure']
+       || Prototype.emptyFunction)(this.transport);       
+
+    (this.options['on' + event] || Prototype.emptyFunction)(this.transport);    
+  }
+});
+
+Ajax.Updater = Class.create();
+Ajax.Updater.ScriptFragment = '(?:<script.*?>)((\n|.)*?)(?:<\/script>)';
+
+Object.extend(Object.extend(Ajax.Updater.prototype, Ajax.Request.prototype), {
+  initialize: function(container, url, options) {
+    this.containers = {
+      success: container.success ? $(container.success) : $(container),
+      failure: container.failure ? $(container.failure) :
+        (container.success ? null : $(container))
+    }
+
+    this.transport = Ajax.getTransport();
+    this.setOptions(options);
+
+    var onComplete = this.options.onComplete || Prototype.emptyFunction;
+    this.options.onComplete = (function() {
+      this.updateContent();
+      onComplete(this.transport);      
+    }).bind(this);
+
+    this.request(url);
+  },
+
+  updateContent: function() {
+    var receiver = this.responseIsSuccess() ?
+      this.containers.success : this.containers.failure;
+
+    var match    = new RegExp(Ajax.Updater.ScriptFragment, 'img');
+    var response = this.transport.responseText.replace(match, '');
+    var scripts  = this.transport.responseText.match(match);
+
+    if (receiver) {
+      if (this.options.insertion) {
+        new this.options.insertion(receiver, response);
+      } else {
+        receiver.innerHTML = response;
+      }
+    }
+
+    if (this.responseIsSuccess()) {
+      if (this.onComplete)
+        setTimeout((function() {this.onComplete(
+          this.transport)}).bind(this), 10);
+    }
+
+    if (this.options.evalScripts && scripts) {
+      match = new RegExp(Ajax.Updater.ScriptFragment, 'im');
+      setTimeout((function() {
+        for (var i = 0; i < scripts.length; i++)
+          eval(scripts[i].match(match)[1]);
+      }).bind(this), 10);
+    }
+  }
+});
+
+Ajax.PeriodicalUpdater = Class.create();
+Ajax.PeriodicalUpdater.prototype = Object.extend(new Ajax.Base(), {
+  initialize: function(container, url, options) {
+    this.setOptions(options);
+    this.onComplete = this.options.onComplete;
+
+    this.frequency = (this.options.frequency || 2);
+    this.decay = 1;
+
+    this.updater = {};
+    this.container = container;
+    this.url = url;
+
+    this.start();
+  },
+
+  start: function() {
+    this.options.onComplete = this.updateComplete.bind(this);
+    this.onTimerEvent();
+  },
+
+  stop: function() {
+    this.updater.onComplete = undefined;
+    clearTimeout(this.timer);
+    (this.onComplete || Ajax.emptyFunction).apply(this, arguments);
+  },
+
+  updateComplete: function(request) {
+    if (this.options.decay) {
+      this.decay = (request.responseText == this.lastText ? 
+        this.decay * this.options.decay : 1);
+
+      this.lastText = request.responseText;
+    }
+    this.timer = setTimeout(this.onTimerEvent.bind(this), 
+      this.decay * this.frequency * 1000);
+  },
+
+  onTimerEvent: function() {
+    this.updater = new Ajax.Updater(this.container, this.url, this.options);
+  }
+});
+
+document.getElementsByClassName = function(className) {
+  var children = document.getElementsByTagName('*') || document.all;
+  var elements = new Array();
+  
+  for (var i = 0; i < children.length; i++) {
+    var child = children[i];
+    var classNames = child.className.split(' ');
+    for (var j = 0; j < classNames.length; j++) {
+      if (classNames[j] == className) {
+        elements.push(child);
+        break;
+      }
+    }
+  }
+  
+  return elements;
+}
+
+/*--------------------------------------------------------------------------*/
+
+if (!window.Element) {
+  var Element = new Object();
+}
+
+Object.extend(Element, {
+  toggle: function() {
+    for (var i = 0; i < arguments.length; i++) {
+      var element = $(arguments[i]);
+      element.style.display = 
+        (element.style.display == 'none' ? '' : 'none');
+    }
+  },
+
+  hide: function() {
+    for (var i = 0; i < arguments.length; i++) {
+      var element = $(arguments[i]);
+      element.style.display = 'none';
+    }
+  },
+
+  show: function() {
+    for (var i = 0; i < arguments.length; i++) {
+      var element = $(arguments[i]);
+      element.style.display = '';
+    }
+  },
+
+  remove: function(element) {
+    element = $(element);
+    element.parentNode.removeChild(element);
+  },
+   
+  getHeight: function(element) {
+    element = $(element);
+    return element.offsetHeight; 
+  },
+
+  hasClassName: function(element, className) {
+    element = $(element);
+    if (!element)
+      return;
+    var a = element.className.split(' ');
+    for (var i = 0; i < a.length; i++) {
+      if (a[i] == className)
+        return true;
+    }
+    return false;
+  },
+
+  addClassName: function(element, className) {
+    element = $(element);
+    Element.removeClassName(element, className);
+    element.className += ' ' + className;
+  },
+
+  removeClassName: function(element, className) {
+    element = $(element);
+    if (!element)
+      return;
+    var newClassName = '';
+    var a = element.className.split(' ');
+    for (var i = 0; i < a.length; i++) {
+      if (a[i] != className) {
+        if (i > 0)
+          newClassName += ' ';
+        newClassName += a[i];
+      }
+    }
+    element.className = newClassName;
+  },
+  
+  // removes whitespace-only text node children
+  cleanWhitespace: function(element) {
+    var element = $(element);
+    for (var i = 0; i < element.childNodes.length; i++) {
+      var node = element.childNodes[i];
+      if (node.nodeType == 3 && !/\S/.test(node.nodeValue)) 
+        Element.remove(node);
+    }
+  }
+});
+
+var Toggle = new Object();
+Toggle.display = Element.toggle;
+
+/*--------------------------------------------------------------------------*/
+
+Abstract.Insertion = function(adjacency) {
+  this.adjacency = adjacency;
+}
+
+Abstract.Insertion.prototype = {
+  initialize: function(element, content) {
+    this.element = $(element);
+    this.content = content;
+    
+    if (this.adjacency && this.element.insertAdjacentHTML) {
+      this.element.insertAdjacentHTML(this.adjacency, this.content);
+    } else {
+      this.range = this.element.ownerDocument.createRange();
+      if (this.initializeRange) this.initializeRange();
+      this.fragment = this.range.createContextualFragment(this.content);
+      this.insertContent();
+    }
+  }
+}
+
+var Insertion = new Object();
+
+Insertion.Before = Class.create();
+Insertion.Before.prototype = Object.extend(new Abstract.Insertion('beforeBegin'), {
+  initializeRange: function() {
+    this.range.setStartBefore(this.element);
+  },
+  
+  insertContent: function() {
+    this.element.parentNode.insertBefore(this.fragment, this.element);
+  }
+});
+
+Insertion.Top = Class.create();
+Insertion.Top.prototype = Object.extend(new Abstract.Insertion('afterBegin'), {
+  initializeRange: function() {
+    this.range.selectNodeContents(this.element);
+    this.range.collapse(true);
+  },
+  
+  insertContent: function() {  
+    this.element.insertBefore(this.fragment, this.element.firstChild);
+  }
+});
+
+Insertion.Bottom = Class.create();
+Insertion.Bottom.prototype = Object.extend(new Abstract.Insertion('beforeEnd'), {
+  initializeRange: function() {
+    this.range.selectNodeContents(this.element);
+    this.range.collapse(this.element);
+  },
+  
+  insertContent: function() {
+    this.element.appendChild(this.fragment);
+  }
+});
+
+Insertion.After = Class.create();
+Insertion.After.prototype = Object.extend(new Abstract.Insertion('afterEnd'), {
+  initializeRange: function() {
+    this.range.setStartAfter(this.element);
+  },
+  
+  insertContent: function() {
+    this.element.parentNode.insertBefore(this.fragment, 
+      this.element.nextSibling);
+  }
+});
+
+var Field = {
+  clear: function() {
+    for (var i = 0; i < arguments.length; i++)
+      $(arguments[i]).value = '';
+  },
+
+  focus: function(element) {
+    $(element).focus();
+  },
+  
+  present: function() {
+    for (var i = 0; i < arguments.length; i++)
+      if ($(arguments[i]).value == '') return false;
+    return true;
+  },
+  
+  select: function(element) {
+    $(element).select();
+  },
+   
+  activate: function(element) {
+    $(element).focus();
+    $(element).select();
+  }
+}
+
+/*--------------------------------------------------------------------------*/
+
+var Form = {
+  serialize: function(form) {
+    var elements = Form.getElements($(form));
+    var queryComponents = new Array();
+    
+    for (var i = 0; i < elements.length; i++) {
+      var queryComponent = Form.Element.serialize(elements[i]);
+      if (queryComponent)
+        queryComponents.push(queryComponent);
+    }
+    
+    return queryComponents.join('&');
+  },
+  
+  getElements: function(form) {
+    var form = $(form);
+    var elements = new Array();
+
+    for (tagName in Form.Element.Serializers) {
+      var tagElements = form.getElementsByTagName(tagName);
+      for (var j = 0; j < tagElements.length; j++)
+        elements.push(tagElements[j]);
+    }
+    return elements;
+  },
+  
+  getInputs: function(form, typeName, name) {
+    var form = $(form);
+    var inputs = form.getElementsByTagName('input');
+    
+    if (!typeName && !name)
+      return inputs;
+      
+    var matchingInputs = new Array();
+    for (var i = 0; i < inputs.length; i++) {
+      var input = inputs[i];
+      if ((typeName && input.type != typeName) ||
+          (name && input.name != name)) 
+        continue;
+      matchingInputs.push(input);
+    }
+
+    return matchingInputs;
+  },
+
+  disable: function(form) {
+    var elements = Form.getElements(form);
+    for (var i = 0; i < elements.length; i++) {
+      var element = elements[i];
+      element.blur();
+      element.disabled = 'true';
+    }
+  },
+
+  enable: function(form) {
+    var elements = Form.getElements(form);
+    for (var i = 0; i < elements.length; i++) {
+      var element = elements[i];
+      element.disabled = '';
+    }
+  },
+
+  focusFirstElement: function(form) {
+    var form = $(form);
+    var elements = Form.getElements(form);
+    for (var i = 0; i < elements.length; i++) {
+      var element = elements[i];
+      if (element.type != 'hidden' && !element.disabled) {
+        Field.activate(element);
+        break;
+      }
+    }
+  },
+
+  reset: function(form) {
+    $(form).reset();
+  }
+}
+
+Form.Element = {
+  serialize: function(element) {
+    var element = $(element);
+    var method = element.tagName.toLowerCase();
+    var parameter = Form.Element.Serializers[method](element);
+    
+    if (parameter)
+      return encodeURIComponent(parameter[0]) + '=' + 
+        encodeURIComponent(parameter[1]);                   
+  },
+  
+  getValue: function(element) {
+    var element = $(element);
+    var method = element.tagName.toLowerCase();
+    var parameter = Form.Element.Serializers[method](element);
+    
+    if (parameter) 
+      return parameter[1];
+  }
+}
+
+Form.Element.Serializers = {
+  input: function(element) {
+    switch (element.type.toLowerCase()) {
+      case 'submit':
+      case 'hidden':
+      case 'password':
+      case 'text':
+        return Form.Element.Serializers.textarea(element);
+      case 'checkbox':  
+      case 'radio':
+        return Form.Element.Serializers.inputSelector(element);
+    }
+    return false;
+  },
+
+  inputSelector: function(element) {
+    if (element.checked)
+      return [element.name, element.value];
+  },
+
+  textarea: function(element) {
+    return [element.name, element.value];
+  },
+
+  select: function(element) {
+    var value = '';
+    if (element.type == 'select-one') {
+      var index = element.selectedIndex;
+      if (index >= 0)
+        value = element.options[index].value || element.options[index].text;
+    } else {
+      value = new Array();
+      for (var i = 0; i < element.length; i++) {
+        var opt = element.options[i];
+        if (opt.selected)
+          value.push(opt.value || opt.text);
+      }
+    }
+    return [element.name, value];
+  }
+}
+
+/*--------------------------------------------------------------------------*/
+
+var $F = Form.Element.getValue;
+
+/*--------------------------------------------------------------------------*/
+
+Abstract.TimedObserver = function() {}
+Abstract.TimedObserver.prototype = {
+  initialize: function(element, frequency, callback) {
+    this.frequency = frequency;
+    this.element   = $(element);
+    this.callback  = callback;
+    
+    this.lastValue = this.getValue();
+    this.registerCallback();
+  },
+  
+  registerCallback: function() {
+    setInterval(this.onTimerEvent.bind(this), this.frequency * 1000);
+  },
+  
+  onTimerEvent: function() {
+    var value = this.getValue();
+    if (this.lastValue != value) {
+      this.callback(this.element, value);
+      this.lastValue = value;
+    }
+  }
+}
+
+Form.Element.Observer = Class.create();
+Form.Element.Observer.prototype = Object.extend(new Abstract.TimedObserver(), {
+  getValue: function() {
+    return Form.Element.getValue(this.element);
+  }
+});
+
+Form.Observer = Class.create();
+Form.Observer.prototype = Object.extend(new Abstract.TimedObserver(), {
+  getValue: function() {
+    return Form.serialize(this.element);
+  }
+});
+
+/*--------------------------------------------------------------------------*/
+
+Abstract.EventObserver = function() {}
+Abstract.EventObserver.prototype = {
+  initialize: function(element, callback) {
+    this.element  = $(element);
+    this.callback = callback;
+    
+    this.lastValue = this.getValue();
+    if (this.element.tagName.toLowerCase() == 'form')
+      this.registerFormCallbacks();
+    else
+      this.registerCallback(this.element);
+  },
+  
+  onElementEvent: function() {
+    var value = this.getValue();
+    if (this.lastValue != value) {
+      this.callback(this.element, value);
+      this.lastValue = value;
+    }
+  },
+  
+  registerFormCallbacks: function() {
+    var elements = Form.getElements(this.element);
+    for (var i = 0; i < elements.length; i++)
+      this.registerCallback(elements[i]);
+  },
+  
+  registerCallback: function(element) {
+    if (element.type) {
+      switch (element.type.toLowerCase()) {
+        case 'checkbox':  
+        case 'radio':
+          element.target = this;
+          element.prev_onclick = element.onclick || Prototype.emptyFunction;
+          element.onclick = function() {
+            this.prev_onclick(); 
+            this.target.onElementEvent();
+          }
+          break;
+        case 'password':
+        case 'text':
+        case 'textarea':
+        case 'select-one':
+        case 'select-multiple':
+          element.target = this;
+          element.prev_onchange = element.onchange || Prototype.emptyFunction;
+          element.onchange = function() {
+            this.prev_onchange(); 
+            this.target.onElementEvent();
+          }
+          break;
+      }
+    }    
+  }
+}
+
+Form.Element.EventObserver = Class.create();
+Form.Element.EventObserver.prototype = Object.extend(new Abstract.EventObserver(), {
+  getValue: function() {
+    return Form.Element.getValue(this.element);
+  }
+});
+
+Form.EventObserver = Class.create();
+Form.EventObserver.prototype = Object.extend(new Abstract.EventObserver(), {
+  getValue: function() {
+    return Form.serialize(this.element);
+  }
+});
+
+
+if (!window.Event) {
+  var Event = new Object();
+}
+
+Object.extend(Event, {
+  KEY_BACKSPACE: 8,
+  KEY_TAB:       9,
+  KEY_RETURN:   13,
+  KEY_ESC:      27,
+  KEY_LEFT:     37,
+  KEY_UP:       38,
+  KEY_RIGHT:    39,
+  KEY_DOWN:     40,
+  KEY_DELETE:   46,
+
+  element: function(event) {
+    return event.target || event.srcElement;
+  },
+
+  isLeftClick: function(event) {
+    return (((event.which) && (event.which == 1)) ||
+            ((event.button) && (event.button == 1)));
+  },
+
+  pointerX: function(event) {
+    return event.pageX || (event.clientX + 
+      (document.documentElement.scrollLeft || document.body.scrollLeft));
+  },
+
+  pointerY: function(event) {
+    return event.pageY || (event.clientY + 
+      (document.documentElement.scrollTop || document.body.scrollTop));
+  },
+
+  stop: function(event) {
+    if (event.preventDefault) { 
+      event.preventDefault(); 
+      event.stopPropagation(); 
+    } else {
+      event.returnValue = false;
+    }
+  },
+
+  // find the first node with the given tagName, starting from the
+  // node the event was triggered on; traverses the DOM upwards
+  findElement: function(event, tagName) {
+    var element = Event.element(event);
+    while (element.parentNode && (!element.tagName ||
+        (element.tagName.toUpperCase() != tagName.toUpperCase())))
+      element = element.parentNode;
+    return element;
+  },
+  
+  observers: false,
+  
+  _observeAndCache: function(element, name, observer, useCapture) {
+    if(!this.observers) this.observers = [];
+    if(element.addEventListener) {
+      this.observers.push([element,name,observer,useCapture]);
+      element.addEventListener(name, observer, useCapture);
+    } else if (element.attachEvent) {
+      this.observers.push([element,name,observer,useCapture]);
+      element.attachEvent('on'+name, observer);
+    }
+  },
+  
+  unloadCache: function() {
+    if(!Event.observers) return;
+    for(var i=0; i<Event.observers.length; i++) {
+      Event.stopObserving(Event.observers[i][0],Event.observers[i][1],Event.observers[i][2],Event.observers[i][3]);
+      Event.observers[i][0] = null;
+    }
+    Event.observers = false;
+  },
+
+  observe: function(element, name, observer, useCapture) {
+    var element = $(element);
+    useCapture = useCapture || false;
+    
+    if (name == 'keypress') {
+      if (navigator.appVersion.indexOf('AppleWebKit') > 0) {
+        this._observeAndCache(element, 'keydown', observer, useCapture);
+        return;
+      }
+      this._observeAndCache(element, 'keypress', observer, useCapture);
+    } else {
+      this._observeAndCache(element, name, observer, useCapture);
+    }
+  },
+
+  stopObserving: function(element, name, observer, useCapture) {
+    var element = $(element);
+    useCapture = useCapture || false;
+    
+    if (name == 'keypress') {
+      if (navigator.appVersion.indexOf('AppleWebKit') > 0) {
+        element.removeEventListener('keydown', observer, useCapture);
+        return;
+      }
+      if (element.removeEventListener) {
+        element.removeEventListener('keypress', observer, useCapture);
+      } else if (element.detachEvent) {
+        element.detachEvent('onkeydown', observer);
+      }
+    } else {
+      if (element.removeEventListener) {
+        element.removeEventListener(name, observer, useCapture);
+      } else if (element.detachEvent) {
+        element.detachEvent('on' + name, observer);
+      }
+    }
+  }
+});
+
+// prevent memory leaks
+Event.observe(window,'unload', Event.unloadCache, false);
+
+var Position = {
+
+  // set to true if needed, warning: firefox performance problems
+  // NOT neeeded for page scrolling, only if draggable contained in
+  // scrollable elements
+  includeScrollOffsets: false, 
+
+  // must be called before calling withinIncludingScrolloffset, every time the
+  // page is scrolled
+  prepare: function() {
+    this.deltaX =  window.pageXOffset 
+                || document.documentElement.scrollLeft 
+                || document.body.scrollLeft 
+                || 0;
+    this.deltaY =  window.pageYOffset 
+                || document.documentElement.scrollTop 
+                || document.body.scrollTop 
+                || 0;
+  },
+
+  realOffset: function(element) {
+    var valueT = 0, valueL = 0;
+    do {
+      valueT += element.scrollTop  || 0;
+      valueL += element.scrollLeft || 0; 
+      element = element.parentNode;
+    } while (element);
+    return [valueL, valueT];
+  },
+
+  cumulativeOffset: function(element) {
+    var valueT = 0, valueL = 0;
+    do {
+      valueT += element.offsetTop  || 0;
+      valueL += element.offsetLeft || 0;
+      element = element.offsetParent;
+    } while (element);
+    return [valueL, valueT];
+  },
+
+  // caches x/y coordinate pair to use with overlap
+  within: function(element, x, y) {
+    if (this.includeScrollOffsets)
+      return this.withinIncludingScrolloffsets(element, x, y);
+    this.xcomp = x;
+    this.ycomp = y;
+    this.offset = this.cumulativeOffset(element);
+
+    return (y >= this.offset[1] &&
+            y <  this.offset[1] + element.offsetHeight &&
+            x >= this.offset[0] && 
+            x <  this.offset[0] + element.offsetWidth);
+  },
+
+  withinIncludingScrolloffsets: function(element, x, y) {
+    var offsetcache = this.realOffset(element);
+
+    this.xcomp = x + offsetcache[0] - this.deltaX;
+    this.ycomp = y + offsetcache[1] - this.deltaY;
+    this.offset = this.cumulativeOffset(element);
+
+    return (this.ycomp >= this.offset[1] &&
+            this.ycomp <  this.offset[1] + element.offsetHeight &&
+            this.xcomp >= this.offset[0] && 
+            this.xcomp <  this.offset[0] + element.offsetWidth);
+  },
+
+  // within must be called directly before
+  overlap: function(mode, element) {  
+    if (!mode) return 0;  
+    if (mode == 'vertical') 
+      return ((this.offset[1] + element.offsetHeight) - this.ycomp) / 
+        element.offsetHeight;
+    if (mode == 'horizontal')
+      return ((this.offset[0] + element.offsetWidth) - this.xcomp) / 
+        element.offsetWidth;
+  },
+
+  clone: function(source, target) {
+    source = $(source);
+    target = $(target);
+    target.style.position = 'absolute';
+    var offsets = this.cumulativeOffset(source);
+    target.style.top    = offsets[1] + 'px';
+    target.style.left   = offsets[0] + 'px';
+    target.style.width  = source.offsetWidth + 'px';
+    target.style.height = source.offsetHeight + 'px';
+  }
+}
Index: temp/trunk/html/test/naka/dragdrop/dragdrop.files/effects.js
===================================================================
--- temp/trunk/html/test/naka/dragdrop/dragdrop.files/effects.js	(revision 1694)
+++ temp/trunk/html/test/naka/dragdrop/dragdrop.files/effects.js	(revision 1694)
@@ -0,0 +1,612 @@
+// Copyright (c) 2005 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
+//
+// Parts (c) 2005 Justin Palmer (http://encytemedia.com/)
+// Parts (c) 2005 Mark Pilgrim (http://diveintomark.org/)
+// 
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+
+Effect = {}
+Effect2 = Effect; // deprecated
+
+/* ------------- transitions ------------- */
+
+Effect.Transitions = {}
+
+Effect.Transitions.linear = function(pos) {
+  return pos;
+}
+Effect.Transitions.sinoidal = function(pos) {
+  return (-Math.cos(pos*Math.PI)/2) + 0.5;
+}
+Effect.Transitions.reverse  = function(pos) {
+  return 1-pos;
+}
+Effect.Transitions.flicker = function(pos) {
+  return ((-Math.cos(pos*Math.PI)/4) + 0.75) + Math.random(0.25);
+}
+Effect.Transitions.wobble = function(pos) {
+  return (-Math.cos(pos*Math.PI*(9*pos))/2) + 0.5;
+}
+Effect.Transitions.pulse = function(pos) {
+  return (Math.floor(pos*10) % 2 == 0 ? 
+    (pos*10-Math.floor(pos*10)) : 1-(pos*10-Math.floor(pos*10)));
+}
+Effect.Transitions.none = function(pos) {
+  return 0;
+}
+Effect.Transitions.full = function(pos) {
+  return 1;
+}
+
+/* ------------- element ext -------------- */
+
+Element.makePositioned = function(element) {
+  element = $(element);
+  if(element.style.position == "")
+    element.style.position = "relative";
+}
+
+Element.makeClipping = function(element) {
+  element = $(element);
+  element._overflow = element.style.overflow || 'visible';
+  if(element._overflow!='hidden') element.style.overflow = 'hidden';
+}
+
+Element.undoClipping = function(element) {
+  element = $(element);
+  if(element._overflow!='hidden') element.style.overflow = element._overflow;
+}
+
+/* ------------- core effects ------------- */
+
+Effect.Base = function() {};
+Effect.Base.prototype = {
+  setOptions: function(options) {
+    this.options = Object.extend({
+      transition: Effect.Transitions.sinoidal,
+      duration:   1.0,   // seconds
+      fps:        25.0,  // max. 100fps
+      sync:       false, // true for combining
+      from:       0.0,
+      to:         1.0
+    }, options || {});
+  },
+  start: function(options) {
+    this.setOptions(options || {});
+    this.currentFrame = 0;
+    this.startOn      = new Date().getTime();
+    this.finishOn     = this.startOn + (this.options.duration*1000);
+    if(this.options.beforeStart) this.options.beforeStart(this);
+    if(!this.options.sync) this.loop();  
+  },
+  loop: function() {
+    var timePos = new Date().getTime();
+    if(timePos >= this.finishOn) {
+      this.render(this.options.to);
+      if(this.finish) this.finish(); 
+      if(this.options.afterFinish) this.options.afterFinish(this);
+      return;  
+    }
+    var pos   = (timePos - this.startOn) / (this.finishOn - this.startOn);
+    var frame = Math.round(pos * this.options.fps * this.options.duration);
+    if(frame > this.currentFrame) {
+      this.render(pos);
+      this.currentFrame = frame;
+    }
+    this.timeout = setTimeout(this.loop.bind(this), 10);
+  },
+  render: function(pos) {
+    if(this.options.transition) pos = this.options.transition(pos);
+    pos *= (this.options.to-this.options.from);
+    pos += this.options.from; 
+    if(this.options.beforeUpdate) this.options.beforeUpdate(this);
+    if(this.update) this.update(pos);
+    if(this.options.afterUpdate) this.options.afterUpdate(this);  
+  },
+  cancel: function() {
+    if(this.timeout) clearTimeout(this.timeout);
+  }
+}
+
+Effect.Parallel = Class.create();
+Object.extend(Object.extend(Effect.Parallel.prototype, Effect.Base.prototype), {
+  initialize: function(effects) {
+    this.effects = effects || [];
+    this.start(arguments[1]);
+  },
+  update: function(position) {
+    for (var i = 0; i < this.effects.length; i++)
+      this.effects[i].render(position);  
+  },
+  finish: function(position) {
+    for (var i = 0; i < this.effects.length; i++)
+      if(this.effects[i].finish) this.effects[i].finish(position);
+  }
+});
+
+// Internet Explorer caveat: works only on elements the have
+// a 'layout', meaning having a given width or height. 
+// There is no way to safely set this automatically.
+Effect.Opacity = Class.create();
+Object.extend(Object.extend(Effect.Opacity.prototype, Effect.Base.prototype), {
+  initialize: function(element) {
+    this.element = $(element);
+    options = Object.extend({
+      from: 0.0,
+      to:   1.0
+    }, arguments[1] || {});
+    this.start(options);
+  },
+  update: function(position) {
+    this.setOpacity(position);
+  }, 
+  setOpacity: function(opacity) {
+    opacity = (opacity == 1) ? 0.99999 : opacity;
+    this.element.style.opacity = opacity;
+    this.element.style.filter = "alpha(opacity:"+opacity*100+")";
+  }
+});
+
+Effect.MoveBy = Class.create();
+Object.extend(Object.extend(Effect.MoveBy.prototype, Effect.Base.prototype), {
+  initialize: function(element, toTop, toLeft) {
+    this.element      = $(element);
+    this.originalTop  = parseFloat(this.element.style.top || '0');
+    this.originalLeft = parseFloat(this.element.style.left || '0');
+    this.toTop        = toTop;
+    this.toLeft       = toLeft;
+    Element.makePositioned(this.element);
+    this.start(arguments[3]);
+  },
+  update: function(position) {
+    topd  = this.toTop  * position + this.originalTop;
+    leftd = this.toLeft * position + this.originalLeft;
+    this.setPosition(topd, leftd);
+  },
+  setPosition: function(topd, leftd) {
+    this.element.style.top  = topd  + "px";
+    this.element.style.left = leftd + "px";
+  }
+});
+
+Effect.Scale = Class.create();
+Object.extend(Object.extend(Effect.Scale.prototype, Effect.Base.prototype), {
+  initialize: function(element, percent) {
+    this.element = $(element)
+    options = Object.extend({
+      scaleX: true,
+      scaleY: true,
+      scaleContent: true,
+      scaleFromCenter: false,
+      scaleMode: 'box',        // 'box' or 'contents' or {} with provided values
+      scaleFrom: 100.0
+    }, arguments[2] || {});
+    this.originalTop    = this.element.offsetTop;
+    this.originalLeft   = this.element.offsetLeft;
+    if(this.element.style.fontSize=="") this.sizeEm = 1.0;
+    if(this.element.style.fontSize && this.element.style.fontSize.indexOf("em")>0)
+      this.sizeEm      = parseFloat(this.element.style.fontSize);
+    this.factor = (percent/100.0) - (options.scaleFrom/100.0);
+    if(options.scaleMode=='box') {
+      this.originalHeight = this.element.clientHeight;
+      this.originalWidth  = this.element.clientWidth; 
+    } else 
+    if(options.scaleMode=='contents') {
+      this.originalHeight = this.element.scrollHeight;
+      this.originalWidth  = this.element.scrollWidth;
+    } else {
+      this.originalHeight = options.scaleMode.originalHeight;
+      this.originalWidth  = options.scaleMode.originalWidth;
+    }
+    this.start(options);
+  },
+
+  update: function(position) {
+    currentScale = (this.options.scaleFrom/100.0) + (this.factor * position);
+    if(this.options.scaleContent && this.sizeEm) 
+      this.element.style.fontSize = this.sizeEm*currentScale + "em";
+    this.setDimensions(
+      this.originalWidth * currentScale, 
+      this.originalHeight * currentScale);
+  },
+
+  setDimensions: function(width, height) {
+    if(this.options.scaleX) this.element.style.width = width + 'px';
+    if(this.options.scaleY) this.element.style.height = height + 'px';
+    if(this.options.scaleFromCenter) {
+      topd  = (height - this.originalHeight)/2;
+      leftd = (width  - this.originalWidth)/2;
+      if(this.element.style.position=='absolute') {
+        if(this.options.scaleY) this.element.style.top = this.originalTop-topd + "px";
+        if(this.options.scaleX) this.element.style.left = this.originalLeft-leftd + "px";
+      } else {
+        if(this.options.scaleY) this.element.style.top = -topd + "px";
+        if(this.options.scaleX) this.element.style.left = -leftd + "px";
+      }
+    }
+  }
+});
+
+Effect.Highlight = Class.create();
+Object.extend(Object.extend(Effect.Highlight.prototype, Effect.Base.prototype), {
+  initialize: function(element) {
+    this.element = $(element);
+    
+    // try to parse current background color as default for endcolor
+    // browser stores this as: "rgb(255, 255, 255)", convert to "#ffffff" format
+    var endcolor = "#ffffff";
+    var current = this.element.style.backgroundColor;
+    if(current && current.slice(0,4) == "rgb(") {
+      endcolor = "#";
+      var cols = current.slice(4,current.length-1).split(',');
+      var i=0; do { endcolor += parseInt(cols[i]).toColorPart() } while (++i<3); }
+      
+    var options = Object.extend({
+      startcolor:   "#ffff99",
+      endcolor:     endcolor,
+      restorecolor: current 
+    }, arguments[1] || {});
+    
+    // init color calculations
+    this.colors_base = [
+      parseInt(options.startcolor.slice(1,3),16),
+      parseInt(options.startcolor.slice(3,5),16),
+      parseInt(options.startcolor.slice(5),16) ];
+    this.colors_delta = [
+      parseInt(options.endcolor.slice(1,3),16)-this.colors_base[0],
+      parseInt(options.endcolor.slice(3,5),16)-this.colors_base[1],
+      parseInt(options.endcolor.slice(5),16)-this.colors_base[2] ];
+
+    this.start(options);
+  },
+  update: function(position) {
+    var colors = [
+      Math.round(this.colors_base[0]+(this.colors_delta[0]*position)),
+      Math.round(this.colors_base[1]+(this.colors_delta[1]*position)),
+      Math.round(this.colors_base[2]+(this.colors_delta[2]*position)) ];
+    this.element.style.backgroundColor = "#" +
+      colors[0].toColorPart() + colors[1].toColorPart() + colors[2].toColorPart();
+  },
+  finish: function() {
+    this.element.style.backgroundColor = this.options.restorecolor;
+  }
+});
+
+Effect.ScrollTo = Class.create();
+Object.extend(Object.extend(Effect.ScrollTo.prototype, Effect.Base.prototype), {
+  initialize: function(element) {
+    this.element = $(element);
+    Position.prepare();
+    var offsets = Position.cumulativeOffset(this.element);
+    var max = window.innerHeight ? 
+      window.height - window.innerHeight :
+      document.body.scrollHeight - 
+        (document.documentElement.clientHeight ? 
+          document.documentElement.clientHeight : document.body.clientHeight);
+    this.scrollStart = Position.deltaY;
+    this.delta  = (offsets[1] > max ? max : offsets[1]) - this.scrollStart;
+    this.start(arguments[1] || {});
+  },
+  update: function(position) {
+    Position.prepare();
+    window.scrollTo(Position.deltaX, 
+      this.scrollStart + (position*this.delta));
+  }
+});
+
+/* ------------- prepackaged effects ------------- */
+
+Effect.Fade = function(element) {
+  options = Object.extend({
+  from: 1.0,
+  to:   0.0,
+  afterFinish: function(effect) 
+    { Element.hide(effect.element);
+      effect.setOpacity(1); } 
+  }, arguments[1] || {});
+  new Effect.Opacity(element,options);
+}
+
+Effect.Appear = function(element) {
+  options = Object.extend({
+  from: 0.0,
+  to:   1.0,
+  beforeStart: function(effect)  
+    { effect.setOpacity(0);
+      Element.show(effect.element); },
+  afterUpdate: function(effect)  
+    { Element.show(effect.element); }
+  }, arguments[1] || {});
+  new Effect.Opacity(element,options);
+}
+
+Effect.Puff = function(element) {
+  new Effect.Parallel(
+   [ new Effect.Scale(element, 200, { sync: true, scaleFromCenter: true }), 
+     new Effect.Opacity(element, { sync: true, to: 0.0, from: 1.0 } ) ], 
+     { duration: 1.0, 
+      afterUpdate: function(effect) 
+       { effect.effects[0].element.style.position = 'absolute'; },
+      afterFinish: function(effect)
+       { Element.hide(effect.effects[0].element); }
+     }
+   );
+}
+
+Effect.BlindUp = function(element) {
+  Element.makeClipping(element);
+  new Effect.Scale(element, 0, 
+    Object.extend({ scaleContent: false, 
+      scaleX: false, 
+      afterFinish: function(effect) 
+        { 
+          Element.hide(effect.element);
+          Element.undoClipping(effect.element);
+        } 
+    }, arguments[1] || {})
+  );
+}
+
+Effect.BlindDown = function(element) {
+  $(element).style.height   = '0px';
+  Element.makeClipping(element);
+  Element.show(element);
+  new Effect.Scale(element, 100, 
+    Object.extend({ scaleContent: false, 
+      scaleX: false, 
+      scaleMode: 'contents',
+      scaleFrom: 0,
+      afterFinish: function(effect) {
+        Element.undoClipping(effect.element);
+      }
+    }, arguments[1] || {})
+  );
+}
+
+Effect.SwitchOff = function(element) {
+  new Effect.Appear(element,
+    { duration: 0.4,
+     transition: Effect.Transitions.flicker,
+     afterFinish: function(effect)
+      { effect.element.style.overflow = 'hidden';
+        new Effect.Scale(effect.element, 1, 
+         { duration: 0.3, scaleFromCenter: true,
+          scaleX: false, scaleContent: false,
+          afterUpdate: function(effect) { 
+           if(effect.element.style.position=="")
+             effect.element.style.position = 'relative'; },
+          afterFinish: function(effect) { Element.hide(effect.element); }
+         } )
+      }
+    } );
+}
+
+Effect.DropOut = function(element) {
+  new Effect.Parallel(
+    [ new Effect.MoveBy(element, 100, 0, { sync: true }), 
+      new Effect.Opacity(element, { sync: true, to: 0.0, from: 1.0 } ) ], 
+    { duration: 0.5, 
+     afterFinish: function(effect)
+       { Element.hide(effect.effects[0].element); } 
+    });
+}
+
+Effect.Shake = function(element) {
+  new Effect.MoveBy(element, 0, 20, 
+    { duration: 0.05, afterFinish: function(effect) {
+  new Effect.MoveBy(effect.element, 0, -40, 
+    { duration: 0.1, afterFinish: function(effect) { 
+  new Effect.MoveBy(effect.element, 0, 40, 
+    { duration: 0.1, afterFinish: function(effect) {  
+  new Effect.MoveBy(effect.element, 0, -40, 
+    { duration: 0.1, afterFinish: function(effect) {  
+  new Effect.MoveBy(effect.element, 0, 40, 
+    { duration: 0.1, afterFinish: function(effect) {  
+  new Effect.MoveBy(effect.element, 0, -20, 
+    { duration: 0.05, afterFinish: function(effect) {  
+  }}) }}) }}) }}) }}) }});
+}
+
+Effect.SlideDown = function(element) {
+  element = $(element);
+  element.style.height   = '0px';
+  Element.makeClipping(element);
+  Element.cleanWhitespace(element);
+  Element.makePositioned(element.firstChild);
+  Element.show(element);
+  new Effect.Scale(element, 100, 
+   Object.extend({ scaleContent: false, 
+    scaleX: false, 
+    scaleMode: 'contents',
+    scaleFrom: 0,
+    afterUpdate: function(effect) 
+      { effect.element.firstChild.style.bottom = 
+          (effect.originalHeight - effect.element.clientHeight) + 'px'; },
+    afterFinish: function(effect) 
+      {  Element.undoClipping(effect.element); }
+    }, arguments[1] || {})
+  );
+}
+  
+Effect.SlideUp = function(element) {
+  element = $(element);
+  Element.makeClipping(element);
+  Element.cleanWhitespace(element);
+  Element.makePositioned(element.firstChild);
+  Element.show(element);
+  new Effect.Scale(element, 0, 
+   Object.extend({ scaleContent: false, 
+    scaleX: false, 
+    afterUpdate: function(effect) 
+      { effect.element.firstChild.style.bottom = 
+          (effect.originalHeight - effect.element.clientHeight) + 'px'; },
+    afterFinish: function(effect)
+      { 
+        Element.hide(effect.element);
+        Element.undoClipping(effect.element);
+      }
+   }, arguments[1] || {})
+  );
+}
+
+Effect.Squish = function(element) {
+ new Effect.Scale(element, 0, 
+   { afterFinish: function(effect) { Element.hide(effect.element); } });
+}
+
+Effect.Grow = function(element) {
+  element = $(element);
+  var options = arguments[1] || {};
+  
+  var originalWidth = element.clientWidth;
+  var originalHeight = element.clientHeight;
+  element.style.overflow = 'hidden';
+  Element.show(element);
+  
+  var direction = options.direction || 'center';
+  var moveTransition = options.moveTransition || Effect.Transitions.sinoidal;
+  var scaleTransition = options.scaleTransition || Effect.Transitions.sinoidal;
+  var opacityTransition = options.opacityTransition || Effect.Transitions.full;
+  
+  var initialMoveX, initialMoveY;
+  var moveX, moveY;
+  
+  switch (direction) {
+    case 'top-left':
+      initialMoveX = initialMoveY = moveX = moveY = 0; 
+      break;
+    case 'top-right':
+      initialMoveX = originalWidth;
+      initialMoveY = moveY = 0;
+      moveX = -originalWidth;
+      break;
+    case 'bottom-left':
+      initialMoveX = moveX = 0;
+      initialMoveY = originalHeight;
+      moveY = -originalHeight;
+      break;
+    case 'bottom-right':
+      initialMoveX = originalWidth;
+      initialMoveY = originalHeight;
+      moveX = -originalWidth;
+      moveY = -originalHeight;
+      break;
+    case 'center':
+      initialMoveX = originalWidth / 2;
+      initialMoveY = originalHeight / 2;
+      moveX = -originalWidth / 2;
+      moveY = -originalHeight / 2;
+      break;
+  }
+  
+  new Effect.MoveBy(element, initialMoveY, initialMoveX, { 
+    duration: 0.01, 
+    beforeUpdate: function(effect) { $(element).style.height = '0px'; },
+    afterFinish: function(effect) {
+      new Effect.Parallel(
+        [ new Effect.Opacity(element, { sync: true, to: 1.0, from: 0.0, transition: opacityTransition }),
+          new Effect.MoveBy(element, moveY, moveX, { sync: true, transition: moveTransition }),
+          new Effect.Scale(element, 100, { 
+            scaleMode: { originalHeight: originalHeight, originalWidth: originalWidth }, 
+            sync: true, scaleFrom: 0, scaleTo: 100, transition: scaleTransition })],
+        options); }
+    });
+}
+
+Effect.Shrink = function(element) {
+  element = $(element);
+  var options = arguments[1] || {};
+  
+  var originalWidth = element.clientWidth;
+  var originalHeight = element.clientHeight;
+  element.style.overflow = 'hidden';
+  Element.show(element);
+
+  var direction = options.direction || 'center';
+  var moveTransition = options.moveTransition || Effect.Transitions.sinoidal;
+  var scaleTransition = options.scaleTransition || Effect.Transitions.sinoidal;
+  var opacityTransition = options.opacityTransition || Effect.Transitions.none;
+  
+  var moveX, moveY;
+  
+  switch (direction) {
+    case 'top-left':
+      moveX = moveY = 0;
+      break;
+    case 'top-right':
+      moveX = originalWidth;
+      moveY = 0;
+      break;
+    case 'bottom-left':
+      moveX = 0;
+      moveY = originalHeight;
+      break;
+    case 'bottom-right':
+      moveX = originalWidth;
+      moveY = originalHeight;
+      break;
+    case 'center':  
+      moveX = originalWidth / 2;
+      moveY = originalHeight / 2;
+      break;
+  }
+  
+  new Effect.Parallel(
+    [ new Effect.Opacity(element, { sync: true, to: 0.0, from: 1.0, transition: opacityTransition }),
+      new Effect.Scale(element, 0, { sync: true, transition: moveTransition }),
+      new Effect.MoveBy(element, moveY, moveX, { sync: true, transition: scaleTransition }) ],
+    options);
+}
+
+Effect.Pulsate = function(element) {
+  var options    = arguments[1] || {};
+  var transition = options.transition || Effect.Transitions.sinoidal;
+  var reverser   = function(pos){ return transition(1-Effect.Transitions.pulse(pos)) };
+  reverser.bind(transition);
+  new Effect.Opacity(element, 
+    Object.extend(Object.extend({  duration: 3.0,
+       afterFinish: function(effect) { Element.show(effect.element); }
+    }, options), {transition: reverser}));
+}
+
+Effect.Fold = function(element) {
+ $(element).style.overflow = 'hidden';
+ new Effect.Scale(element, 5, Object.extend({   
+   scaleContent: false,
+   scaleTo: 100,
+   scaleX: false,
+   afterFinish: function(effect) {
+   new Effect.Scale(element, 1, { 
+     scaleContent: false, 
+     scaleTo: 0,
+     scaleY: false,
+     afterFinish: function(effect) { Element.hide(effect.element) } });
+ }}, arguments[1] || {}));
+}
+
+// old: new Effect.ContentZoom(element, percent)
+// new: Element.setContentZoom(element, percent) 
+
+Element.setContentZoom = function(element, percent) {
+  var element = $(element);
+  element.style.fontSize = (percent/100) + "em";  
+  if(navigator.appVersion.indexOf('AppleWebKit')>0) window.scrollBy(0,0);
+}
Index: temp/trunk/html/test/naka/dragdrop/dragdrop.files/dragdrop.js
===================================================================
--- temp/trunk/html/test/naka/dragdrop/dragdrop.files/dragdrop.js	(revision 1694)
+++ temp/trunk/html/test/naka/dragdrop/dragdrop.files/dragdrop.js	(revision 1694)
@@ -0,0 +1,537 @@
+// Copyright (c) 2005 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
+// 
+// Element.Class part Copyright (c) 2005 by Rick Olson
+// 
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Element.Class = {
+    // Element.toggleClass(element, className) toggles the class being on/off
+    // Element.toggleClass(element, className1, className2) toggles between both classes,
+    //   defaulting to className1 if neither exist
+    toggle: function(element, className) {
+      if(Element.Class.has(element, className)) {
+        Element.Class.remove(element, className);
+        if(arguments.length == 3) Element.Class.add(element, arguments[2]);
+      } else {
+        Element.Class.add(element, className);
+        if(arguments.length == 3) Element.Class.remove(element, arguments[2]);
+      }
+    },
+
+    // gets space-delimited classnames of an element as an array
+    get: function(element) {
+      element = $(element);
+      return element.className.split(' ');
+    },
+
+    // functions adapted from original functions by Gavin Kistner
+    remove: function(element) {
+      element = $(element);
+      var regEx;
+      for(var i = 1; i < arguments.length; i++) {
+        regEx = new RegExp("^" + arguments[i] + "\\b\\s*|\\s*\\b" + arguments[i] + "\\b", 'g');
+        element.className = element.className.replace(regEx, '')
+      }
+    },
+
+    add: function(element) {
+      element = $(element);
+      for(var i = 1; i < arguments.length; i++) {
+        Element.Class.remove(element, arguments[i]);
+        element.className += (element.className.length > 0 ? ' ' : '') + arguments[i];
+      }
+    },
+
+    // returns true if all given classes exist in said element
+    has: function(element) {
+      element = $(element);
+      if(!element || !element.className) return false;
+      var regEx;
+      for(var i = 1; i < arguments.length; i++) {
+        regEx = new RegExp("\\b" + arguments[i] + "\\b");
+        if(!regEx.test(element.className)) return false;
+      }
+      return true;
+    },
+    
+    // expects arrays of strings and/or strings as optional paramters
+    // Element.Class.has_any(element, ['classA','classB','classC'], 'classD')
+    has_any: function(element) {
+      element = $(element);
+      if(!element || !element.className) return false;
+      var regEx;
+      for(var i = 1; i < arguments.length; i++) {
+        if((typeof arguments[i] == 'object') && 
+          (arguments[i].constructor == Array)) {
+          for(var j = 0; j < arguments[i].length; j++) {
+            regEx = new RegExp("\\b" + arguments[i][j] + "\\b");
+            if(regEx.test(element.className)) return true;
+          }
+        } else {
+          regEx = new RegExp("\\b" + arguments[i] + "\\b");
+          if(regEx.test(element.className)) return true;
+        }
+      }
+      return false;
+    },
+    
+    childrenWith: function(element, className) {
+      var children = $(element).getElementsByTagName('*');
+      var elements = new Array();
+      
+      for (var i = 0; i < children.length; i++) {
+        if (Element.Class.has(children[i], className)) {
+          elements.push(children[i]);
+          break;
+        }
+      }
+      
+      return elements;
+    }
+}
+
+/*--------------------------------------------------------------------------*/
+
+var Droppables = {
+  drops: false,
+  
+  remove: function(element) {
+    for(var i = 0; i < this.drops.length; i++)
+      if(this.drops[i].element == element)
+        this.drops.splice(i,1);
+  },
+  
+  add: function(element) {
+    var element = $(element);
+    var options = Object.extend({
+      greedy:     true,
+      hoverclass: null  
+    }, arguments[1] || {});
+    
+    // cache containers
+    if(options.containment) {
+      options._containers = new Array();
+      var containment = options.containment;
+      if((typeof containment == 'object') && 
+        (containment.constructor == Array)) {
+        for(var i=0; i<containment.length; i++)
+          options._containers.push($(containment[i]));
+      } else {
+        options._containers.push($(containment));
+      }
+      options._containers_length = 
+        options._containers.length-1;
+    }
+    
+    Element.makePositioned(element); // fix IE
+    
+    options.element = element;
+    
+    // activate the droppable    
+    if(!this.drops) this.drops = [];
+    this.drops.push(options);
+  },
+  
+  is_contained: function(element, drop) {
+    var containers = drop._containers;
+    var parentNode = element.parentNode;
+    var i = drop._containers_length;
+    do { if(parentNode==containers[i]) return true; } while (i--);
+    return false;
+  },
+  
+  is_affected: function(pX, pY, element, drop) {
+    return (
+      (drop.element!=element) &&
+      ((!drop._containers) ||
+        this.is_contained(element, drop)) &&
+      ((!drop.accept) ||
+        (Element.Class.has_any(element, drop.accept))) &&
+      Position.within(drop.element, pX, pY) );
+  },
+  
+  deactivate: function(drop) {
+    Element.Class.remove(drop.element, drop.hoverclass);
+    this.last_active = null;
+  },
+  
+  activate: function(drop) {
+    if(this.last_active) this.deactivate(this.last_active);
+    if(drop.hoverclass) {
+      Element.Class.add(drop.element, drop.hoverclass);
+      this.last_active = drop;
+    }
+  },
+  
+  show: function(event, element) {
+    if(!this.drops) return;
+    var pX = Event.pointerX(event);
+    var pY = Event.pointerY(event);
+    Position.prepare();
+    
+    var i = this.drops.length-1; do {
+      var drop = this.drops[i];
+      if(this.is_affected(pX, pY, element, drop)) {
+        if(drop.onHover)
+           drop.onHover(element, drop.element, Position.overlap(drop.overlap, drop.element));
+        if(drop.greedy) { 
+          this.activate(drop);
+          return;
+        }
+      }
+    } while (i--);
+  },
+  
+  fire: function(event, element) {
+    if(!this.last_active) return;
+    Position.prepare();
+    
+    if (this.is_affected(Event.pointerX(event), Event.pointerY(event), element, this.last_active))
+      if (this.last_active.onDrop) 
+        this.last_active.onDrop(element, this.last_active);
+    
+  },
+  
+  reset: function() {
+    if(this.last_active)
+      this.deactivate(this.last_active);
+  }
+}
+
+Draggables = {
+  observers: new Array(),
+  addObserver: function(observer) {
+    this.observers.push(observer);    
+  },
+  removeObserver: function(element) {  // element instead of obsever fixes mem leaks
+    for(var i = 0; i < this.observers.length; i++)
+      if(this.observers[i].element && (this.observers[i].element == element))
+        this.observers.splice(i,1);
+  },
+  notify: function(eventName, draggable) {  // 'onStart', 'onEnd'
+    for(var i = 0; i < this.observers.length; i++)
+      this.observers[i][eventName](draggable);
+  }
+}
+
+/*--------------------------------------------------------------------------*/
+
+Draggable = Class.create();
+Draggable.prototype = {
+  initialize: function(element) {
+    var options = Object.extend({
+      handle: false,
+      starteffect: function(element) { 
+        new Effect.Opacity(element, {duration:0.2, from:1.0, to:0.7}); 
+      },
+      reverteffect: function(element, top_offset, left_offset) {
+        new Effect.MoveBy(element, -top_offset, -left_offset, {duration:0.4});
+      },
+      endeffect: function(element) { 
+         new Effect.Opacity(element, {duration:0.2, from:0.7, to:1.0}); 
+      },
+      zindex: 1000,
+      revert: false
+    }, arguments[1] || {});
+    
+    this.element      = $(element);
+    this.handle       = options.handle ? $(options.handle) : this.element;
+    
+    Element.makePositioned(this.element); // fix IE
+    
+    this.offsetX      = 0;
+    this.offsetY      = 0;
+    this.originalLeft = this.currentLeft();
+    this.originalTop  = this.currentTop();
+    this.originalX    = this.element.offsetLeft;
+    this.originalY    = this.element.offsetTop;
+    this.originalZ    = parseInt(this.element.style.zIndex || "0");
+    
+    this.options      = options;
+    
+    this.active       = false;
+    this.dragging     = false;   
+    
+    this.eventMouseDown = this.startDrag.bindAsEventListener(this);
+    this.eventMouseUp   = this.endDrag.bindAsEventListener(this);
+    this.eventMouseMove = this.update.bindAsEventListener(this);
+    this.eventKeypress  = this.keyPress.bindAsEventListener(this);
+    
+    Event.observe(this.handle, "mousedown", this.eventMouseDown);
+    Event.observe(document, "mouseup", this.eventMouseUp);
+    Event.observe(document, "mousemove", this.eventMouseMove);
+    Event.observe(document, "keypress", this.eventKeypress);
+  },
+  destroy: function() {
+    Event.stopObserving(this.handle, "mousedown", this.eventMouseDown);
+    Event.stopObserving(document, "mouseup", this.eventMouseUp);
+    Event.stopObserving(document, "mousemove", this.eventMouseMove);
+    Event.stopObserving(document, "keypress", this.eventKeypress);
+  },
+  currentLeft: function() {
+    return parseInt(this.element.style.left || '0');
+  },
+  currentTop: function() {
+    return parseInt(this.element.style.top || '0')
+  },
+  startDrag: function(event) {
+    if(Event.isLeftClick(event)) {
+      this.active = true;
+      
+      var style = this.element.style;
+      this.originalY = this.element.offsetTop  - this.currentTop()  - this.originalTop;
+      this.originalX = this.element.offsetLeft - this.currentLeft() - this.originalLeft;
+      this.offsetY =  event.clientY - this.originalY - this.originalTop;
+      this.offsetX =  event.clientX - this.originalX - this.originalLeft;
+      
+      Event.stop(event);
+    }
+  },
+  finishDrag: function(event, success) {
+    this.active = false;
+    this.dragging = false;
+    
+    if(success) Droppables.fire(event, this.element);
+    Draggables.notify('onEnd', this);
+    
+    var revert = this.options.revert;
+    if(revert && typeof revert == 'function') revert = revert(this.element);
+      
+    if(revert && this.options.reverteffect) {
+      this.options.reverteffect(this.element, 
+      this.currentTop()-this.originalTop,
+      this.currentLeft()-this.originalLeft);
+    } else {
+      this.originalLeft = this.currentLeft();
+      this.originalTop  = this.currentTop();
+    }
+    
+    this.element.style.zIndex = this.originalZ;
+      
+    if(this.options.endeffect) 
+      this.options.endeffect(this.element);
+      
+    Droppables.reset();
+  },
+  keyPress: function(event) {
+    if(this.active) {
+      if(event.keyCode==Event.KEY_ESC) {
+        this.finishDrag(event, false);
+        Event.stop(event);
+      }
+    }
+  },
+  endDrag: function(event) {
+    if(this.active && this.dragging) {
+      this.finishDrag(event, true);
+      Event.stop(event);
+    }
+    this.active = false;
+    this.dragging = false;
+  },
+  draw: function(event) {
+    var style = this.element.style;
+    this.originalX = this.element.offsetLeft - this.currentLeft() - this.originalLeft;
+    this.originalY = this.element.offsetTop  - this.currentTop()  - this.originalTop;
+    if((!this.options.constraint) || (this.options.constraint=='horizontal'))
+      style.left = ((event.clientX - this.originalX) - this.offsetX) + "px";
+    if((!this.options.constraint) || (this.options.constraint=='vertical'))
+      style.top  = ((event.clientY - this.originalY) - this.offsetY) + "px";
+    if(style.visibility=="hidden") style.visibility = ""; // fix gecko rendering
+  },
+  update: function(event) {
+   if(this.active) {
+      if(!this.dragging) {
+        var style = this.element.style;
+        this.dragging = true;
+        if(style.position=="") style.position = "relative";
+        style.zIndex = this.options.zindex;
+        Draggables.notify('onStart', this);
+        if(this.options.starteffect) this.options.starteffect(this.element);
+      }
+      
+      Droppables.show(event, this.element);
+      this.draw(event);
+      if(this.options.change) this.options.change(this);
+      
+      // fix AppleWebKit rendering
+      if(navigator.appVersion.indexOf('AppleWebKit')>0) window.scrollBy(0,0); 
+      
+      Event.stop(event);
+   }
+  }
+}
+
+/*--------------------------------------------------------------------------*/
+
+SortableObserver = Class.create();
+SortableObserver.prototype = {
+  initialize: function(element, observer) {
+    this.element   = $(element);
+    this.observer  = observer;
+    this.lastValue = Sortable.serialize(this.element);
+  },
+  onStart: function() {
+    this.lastValue = Sortable.serialize(this.element);
+  },
+  onEnd: function() {    
+    if(this.lastValue != Sortable.serialize(this.element))
+      this.observer(this.element)
+  }
+}
+
+Sortable = {
+  sortables: new Array(),
+  options: function(element){
+    var element = $(element);
+    for(var i=0;i<this.sortables.length;i++)
+      if(this.sortables[i].element == element)
+        return this.sortables[i];
+    return null;        
+  },
+  destroy: function(element){
+    var element = $(element);
+    for(var i=0;i<this.sortables.length;i++) {
+      if(this.sortables[i].element == element) {
+        var s = this.sortables[i];
+        Draggables.removeObserver(s.element);
+        for(var j=0;j<s.droppables.length;j++)
+          Droppables.remove(s.droppables[j]);
+        for(var j=0;j<s.draggables.length;j++)
+          s.draggables[j].destroy();
+        this.sortables.splice(i,1);
+      }
+    }
+  },
+  create: function(element) {
+    var element = $(element);
+    var options = Object.extend({ 
+      element:     element,
+      tag:         'li',       // assumes li children, override with tag: 'tagname'
+      overlap:     'vertical', // one of 'vertical', 'horizontal'
+      constraint:  'vertical', // one of 'vertical', 'horizontal', false
+      containment: element,    // also takes array of elements (or id's); or false
+      handle:      false,      // or a CSS class
+      only:        false,
+      hoverclass:  null,
+      onChange:    function() {},
+      onUpdate:    function() {}
+    }, arguments[1] || {});
+    
+    // clear any old sortable with same element
+    this.destroy(element);
+    
+    // build options for the draggables
+    var options_for_draggable = {
+      revert:      true,
+      constraint:  options.constraint,
+      handle:      handle };
+    if(options.starteffect)
+      options_for_draggable.starteffect = options.starteffect;
+    if(options.reverteffect)
+      options_for_draggable.reverteffect = options.reverteffect;
+    if(options.endeffect)
+      options_for_draggable.endeffect = options.endeffect;
+    if(options.zindex)
+      options_for_draggable.zindex = options.zindex;
+    
+    // build options for the droppables  
+    var options_for_droppable = {
+      overlap:     options.overlap,
+      containment: options.containment,
+      hoverclass:  options.hoverclass,
+      onHover: function(element, dropon, overlap) { 
+        if(overlap>0.5) {
+          if(dropon.previousSibling != element) {
+            var oldParentNode = element.parentNode;
+            element.style.visibility = "hidden"; // fix gecko rendering
+            dropon.parentNode.insertBefore(element, dropon);
+            if(dropon.parentNode!=oldParentNode && oldParentNode.sortable) 
+              oldParentNode.sortable.onChange(element);
+            if(dropon.parentNode.sortable)
+              dropon.parentNode.sortable.onChange(element);
+          }
+        } else {                
+          var nextElement = dropon.nextSibling || null;
+          if(nextElement != element) {
+            var oldParentNode = element.parentNode;
+            element.style.visibility = "hidden"; // fix gecko rendering
+            dropon.parentNode.insertBefore(element, nextElement);
+            if(dropon.parentNode!=oldParentNode && oldParentNode.sortable) 
+              oldParentNode.sortable.onChange(element);
+            if(dropon.parentNode.sortable)
+              dropon.parentNode.sortable.onChange(element);
+          }
+        }
+      }
+    }
+
+    // fix for gecko engine
+    Element.cleanWhitespace(element); 
+    
+    options.draggables = [];
+    options.droppables = [];
+    
+    // make it so 
+    var elements = element.childNodes;
+    for (var i = 0; i < elements.length; i++) 
+      if(elements[i].tagName && elements[i].tagName==options.tag.toUpperCase() &&
+        (!options.only || (Element.Class.has(elements[i], options.only)))) {
+        
+        // handles are per-draggable
+        var handle = options.handle ? 
+          Element.Class.childrenWith(elements[i], options.handle)[0] : elements[i];
+        
+        options.draggables.push(new Draggable(elements[i], Object.extend(options_for_draggable, { handle: handle })));
+        
+        Droppables.add(elements[i], options_for_droppable);
+        options.droppables.push(elements[i]);
+        
+      }
+      
+    // keep reference
+    this.sortables.push(options);
+    
+    // for onupdate
+    Draggables.addObserver(new SortableObserver(element, options.onUpdate));
+
+  },
+  serialize: function(element) {
+    var element = $(element);
+    var sortableOptions = this.options(element);
+    var options = Object.extend({
+      tag:  sortableOptions.tag,
+      only: sortableOptions.only,
+      name: element.id
+    }, arguments[1] || {});
+    
+    var items = $(element).childNodes;
+    var queryComponents = new Array();
+ 
+    for(var i=0; i<items.length; i++)
+      if(items[i].tagName && items[i].tagName==options.tag.toUpperCase() &&
+        (!options.only || (Element.Class.has(items[i], options.only))))
+        queryComponents.push(
+          encodeURIComponent(options.name) + "[]=" + 
+          encodeURIComponent(items[i].id.split("_")[1]));
+
+    return queryComponents.join("&");
+  }
+} 
Index: temp/trunk/html/test/naka/dragdrop/dragdrop.files/controls.js
===================================================================
--- temp/trunk/html/test/naka/dragdrop/dragdrop.files/controls.js	(revision 1694)
+++ temp/trunk/html/test/naka/dragdrop/dragdrop.files/controls.js	(revision 1694)
@@ -0,0 +1,434 @@
+// Copyright (c) 2005 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
+//           (c) 2005 Ivan Krstic (http://blogs.law.harvard.edu/ivan)
+// 
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Element.collectTextNodesIgnoreClass = function(element, ignoreclass) {
+  var children = $(element).childNodes;
+  var text     = "";
+  var classtest = new RegExp("^([^ ]+ )*" + ignoreclass+ "( [^ ]+)*$","i");
+  
+  for (var i = 0; i < children.length; i++) {
+    if(children[i].nodeType==3) {
+      text+=children[i].nodeValue;
+    } else {
+      if((!children[i].className.match(classtest)) && children[i].hasChildNodes())
+        text += Element.collectTextNodesIgnoreClass(children[i], ignoreclass);
+    }
+  }
+  
+  return text;
+}
+
+// Autocompleter.Base handles all the autocompletion functionality 
+// that's independent of the data source for autocompletion. This
+// includes drawing the autocompletion menu, observing keyboard
+// and mouse events, and similar.
+//
+// Specific autocompleters need to provide, at the very least, 
+// a getUpdatedChoices function that will be invoked every time
+// the text inside the monitored textbox changes. This method 
+// should get the text for which to provide autocompletion by
+// invoking this.getEntry(), NOT by directly accessing
+// this.element.value. This is to allow incremental tokenized
+// autocompletion. Specific auto-completion logic (AJAX, etc)
+// belongs in getUpdatedChoices.
+//
+// Tokenized incremental autocompletion is enabled automatically
+// when an autocompleter is instantiated with the 'tokens' option
+// in the options parameter, e.g.:
+// new Ajax.Autocompleter('id','upd', '/url/', { tokens: ',' });
+// will incrementally autocomplete with a comma as the token.
+// Additionally, ',' in the above example can be replaced with
+// a token array, e.g. { tokens: new Array (',', '\n') } which
+// enables autocompletion on multiple tokens. This is most 
+// useful when one of the tokens is \n (a newline), as it 
+// allows smart autocompletion after linebreaks.
+
+var Autocompleter = {}
+Autocompleter.Base = function() {};
+Autocompleter.Base.prototype = {
+  base_initialize: function(element, update, options) {
+    this.element     = $(element); 
+    this.update      = $(update);  
+    this.has_focus   = false; 
+    this.changed     = false; 
+    this.active      = false; 
+    this.index       = 0;     
+    this.entry_count = 0;
+
+    if (this.setOptions)
+      this.setOptions(options);
+    else
+      this.options = {}
+     
+    this.options.tokens       = this.options.tokens || new Array();
+    this.options.frequency    = this.options.frequency || 0.4;
+    this.options.min_chars    = this.options.min_chars || 1;
+    this.options.onShow       = this.options.onShow || 
+    function(element, update){ 
+      if(!update.style.position || update.style.position=='absolute') {
+        update.style.position = 'absolute';
+          var offsets = Position.cumulativeOffset(element);
+          update.style.left = offsets[0] + 'px';
+          update.style.top  = (offsets[1] + element.offsetHeight) + 'px';
+          update.style.width = element.offsetWidth + 'px';
+      }
+      new Effect.Appear(update,{duration:0.15});
+    };
+    this.options.onHide = this.options.onHide || 
+    function(element, update){ new Effect.Fade(update,{duration:0.15}) };
+    
+    if(this.options.indicator)
+      this.indicator = $(this.options.indicator);
+
+    if (typeof(this.options.tokens) == 'string') 
+      this.options.tokens = new Array(this.options.tokens);
+       
+    this.observer = null;
+    
+    Element.hide(this.update);
+    
+    Event.observe(this.element, "blur", this.onBlur.bindAsEventListener(this));
+    Event.observe(this.element, "keypress", this.onKeyPress.bindAsEventListener(this));
+  },
+
+  show: function() {
+    if(this.update.style.display=='none') this.options.onShow(this.element, this.update);
+    if(!this.iefix && (navigator.appVersion.indexOf('MSIE')>0) && this.update.style.position=='absolute') {
+      new Insertion.After(this.update, 
+       '<iframe id="' + this.update.id + '_iefix" '+
+       'style="display:none;filter:progid:DXImageTransform.Microsoft.Alpha(opacity=0);" ' +
+       'src="javascript:false;" frameborder="0" scrolling="no"></iframe>');
+      this.iefix = $(this.update.id+'_iefix');
+    }
+    if(this.iefix) {
+      Position.clone(this.update, this.iefix);
+      this.iefix.style.zIndex = 1;
+      this.update.style.zIndex = 2;
+      Element.show(this.iefix);
+    }
+  },
+  
+  hide: function() {
+    if(this.update.style.display=='') this.options.onHide(this.element, this.update);
+    if(this.iefix) Element.hide(this.iefix);
+  },
+  
+  startIndicator: function() {
+    if(this.indicator) Element.show(this.indicator);
+  },
+  
+  stopIndicator: function() {
+    if(this.indicator) Element.hide(this.indicator);
+  },
+
+  onKeyPress: function(event) {
+    if(this.active)
+      switch(event.keyCode) {
+       case Event.KEY_TAB:
+       case Event.KEY_RETURN:
+         this.select_entry();
+         Event.stop(event);
+       case Event.KEY_ESC:
+         this.hide();
+         this.active = false;
+         return;
+       case Event.KEY_LEFT:
+       case Event.KEY_RIGHT:
+         return;
+       case Event.KEY_UP:
+         this.mark_previous();
+         this.render();
+         if(navigator.appVersion.indexOf('AppleWebKit')>0) Event.stop(event);
+         return;
+       case Event.KEY_DOWN:
+         this.mark_next();
+         this.render();
+         if(navigator.appVersion.indexOf('AppleWebKit')>0) Event.stop(event);
+         return;
+      }
+     else 
+      if(event.keyCode==Event.KEY_TAB || event.keyCode==Event.KEY_RETURN) 
+        return;
+    
+    this.changed = true;
+    this.has_focus = true;
+    
+    if(this.observer) clearTimeout(this.observer);
+      this.observer = 
+        setTimeout(this.onObserverEvent.bind(this), this.options.frequency*1000);
+  },
+  
+  onHover: function(event) {
+    var element = Event.findElement(event, 'LI');
+    if(this.index != element.autocompleteIndex) 
+    {
+        this.index = element.autocompleteIndex;
+        this.render();
+    }
+    Event.stop(event);
+  },
+  
+  onClick: function(event) {
+    var element = Event.findElement(event, 'LI');
+    this.index = element.autocompleteIndex;
+    this.select_entry();
+    Event.stop(event);
+  },
+  
+  onBlur: function(event) {
+    // needed to make click events working
+    setTimeout(this.hide.bind(this), 250);
+    this.has_focus = false;
+    this.active = false;     
+  }, 
+  
+  render: function() {
+    if(this.entry_count > 0) {
+      for (var i = 0; i < this.entry_count; i++)
+        this.index==i ? 
+          Element.addClassName(this.get_entry(i),"selected") : 
+          Element.removeClassName(this.get_entry(i),"selected");
+        
+      if(this.has_focus) { 
+        if(this.get_current_entry().scrollIntoView) 
+          this.get_current_entry().scrollIntoView(false);
+        
+        this.show();
+        this.active = true;
+      }
+    } else this.hide();
+  },
+  
+  mark_previous: function() {
+    if(this.index > 0) this.index--
+      else this.index = this.entry_count-1;
+  },
+  
+  mark_next: function() {
+    if(this.index < this.entry_count-1) this.index++
+      else this.index = 0;
+  },
+  
+  get_entry: function(index) {
+    return this.update.firstChild.childNodes[index];
+  },
+  
+  get_current_entry: function() {
+    return this.get_entry(this.index);
+  },
+  
+  select_entry: function() {
+    this.active = false;
+    value = Element.collectTextNodesIgnoreClass(this.get_current_entry(), 'informal').unescapeHTML();
+    this.updateElement(value);
+    this.element.focus();
+  },
+
+  updateElement: function(value) {
+    var last_token_pos = this.findLastToken();
+    if (last_token_pos != -1) {
+      var new_value = this.element.value.substr(0, last_token_pos + 1);
+      var whitespace = this.element.value.substr(last_token_pos + 1).match(/^\s+/);
+      if (whitespace)
+        new_value += whitespace[0];
+      this.element.value = new_value + value;
+    } else {
+      this.element.value = value;
+    } 
+  },
+  
+  updateChoices: function(choices) {
+    if(!this.changed && this.has_focus) {
+      this.update.innerHTML = choices;
+      Element.cleanWhitespace(this.update);
+      Element.cleanWhitespace(this.update.firstChild);
+
+      if(this.update.firstChild && this.update.firstChild.childNodes) {
+        this.entry_count = 
+          this.update.firstChild.childNodes.length;
+        for (var i = 0; i < this.entry_count; i++) {
+          entry = this.get_entry(i);
+          entry.autocompleteIndex = i;
+          this.addObservers(entry);
+        }
+      } else { 
+        this.entry_count = 0;
+      }
+      
+      this.stopIndicator();
+      
+      this.index = 0;
+      this.render();
+    }
+  },
+
+  addObservers: function(element) {
+    Event.observe(element, "mouseover", this.onHover.bindAsEventListener(this));
+    Event.observe(element, "click", this.onClick.bindAsEventListener(this));
+  },
+
+  onObserverEvent: function() {
+    this.changed = false;   
+    if(this.getEntry().length>=this.options.min_chars) {
+      this.startIndicator();
+      this.getUpdatedChoices();
+    } else {
+      this.active = false;
+      this.hide();
+    }
+  },
+
+  getEntry: function() {
+    var token_pos = this.findLastToken();
+    if (token_pos != -1)
+      var ret = this.element.value.substr(token_pos + 1).replace(/^\s+/,'').replace(/\s+$/,'');
+    else
+      var ret = this.element.value;
+    
+    return /\n/.test(ret) ? '' : ret;
+  },
+
+  findLastToken: function() {
+    var last_token_pos = -1;
+
+    for (var i=0; i<this.options.tokens.length; i++) {
+      var this_token_pos = this.element.value.lastIndexOf(this.options.tokens[i]);
+      if (this_token_pos > last_token_pos)
+        last_token_pos = this_token_pos;
+    }
+    return last_token_pos;
+  }
+}
+
+Ajax.Autocompleter = Class.create();
+Ajax.Autocompleter.prototype = Object.extend(new Autocompleter.Base(), 
+Object.extend(new Ajax.Base(), {
+  initialize: function(element, update, url, options) {
+	  this.base_initialize(element, update, options);
+    this.options.asynchronous = true;
+    this.options.onComplete   = this.onComplete.bind(this)
+    this.options.method       = 'post';
+    this.url                  = url;
+  },
+  
+  getUpdatedChoices: function() {
+    entry = encodeURIComponent(this.element.name) + '=' + 
+      encodeURIComponent(this.getEntry());
+    
+    this.options.parameters = this.options.callback ?
+      this.options.callback(this.element, entry) : entry;
+    new Ajax.Request(this.url, this.options);
+  },
+  
+  onComplete: function(request) {
+    this.updateChoices(request.responseText);
+  }
+
+}));
+
+// The local array autocompleter. Used when you'd prefer to
+// inject an array of autocompletion options into the page, rather
+// than sending out Ajax queries, which can be quite slow sometimes.
+//
+// The constructor takes four parameters. The first two are, as usual,
+// the id of the monitored textbox, and id of the autocompletion menu.
+// The third is the array you want to autocomplete from, and the fourth
+// is the options block.
+//
+// Extra local autocompletion options:
+// - choices - How many autocompletion choices to offer
+//
+// - partial_search - If false, the autocompleter will match entered
+//                    text only at the beginning of strings in the 
+//                    autocomplete array. Defaults to true, which will
+//                    match text at the beginning of any *word* in the
+//                    strings in the autocomplete array. If you want to
+//                    search anywhere in the string, additionally set
+//                    the option full_search to true (default: off).
+//
+// - full_search - Search anywhere in autocomplete array strings.
+//
+// - partial_chars - How many characters to enter before triggering
+//                   a partial match (unlike min_chars, which defines
+//                   how many characters are required to do any match
+//                   at all). Defaults to 2.
+//
+// - ignore_case - Whether to ignore case when autocompleting.
+//                 Defaults to true.
+//
+// It's possible to pass in a custom function as the 'selector' 
+// option, if you prefer to write your own autocompletion logic.
+// In that case, the other options above will not apply unless
+// you support them.
+
+Autocompleter.Local = Class.create();
+Autocompleter.Local.prototype = Object.extend(new Autocompleter.Base(), {
+  initialize: function(element, update, array, options) {
+    this.base_initialize(element, update, options);
+    this.options.array = array;
+  },
+
+  getUpdatedChoices: function() {
+    this.updateChoices(this.options.selector(this));
+  },
+
+  setOptions: function(options) {
+    this.options = Object.extend({
+      choices: 10,
+      partial_search: true,
+      partial_chars: 2,
+      ignore_case: true,
+      full_search: false,
+      selector: function(instance) {
+        var ret       = new Array(); // Beginning matches
+        var partial   = new Array(); // Inside matches
+        var entry     = instance.getEntry();
+        var count     = 0;
+        
+        for (var i = 0; i < instance.options.array.length &&  
+            ret.length < instance.options.choices ; i++) { 
+          var elem = instance.options.array[i];
+          var found_pos = instance.options.ignore_case ? 
+            elem.toLowerCase().indexOf(entry.toLowerCase()) : 
+            elem.indexOf(entry);
+
+          if (found_pos == 0 && elem.length == entry.length) 
+            continue;
+          else if (found_pos == 0) 
+            ret.push("<li><strong>" + elem.substr(0, entry.length) + "</strong>" + 
+              elem.substr(entry.length) + "</li>");
+          else if (entry.length >= instance.options.partial_chars && 
+            instance.options.partial_search && found_pos != -1) {
+            if (!instance.options.full_search && !/\s/.test(elem.substr(found_pos-1,1)))
+              continue;
+            partial.push("<li>" + elem.substr(0, found_pos) + "<strong>" +
+              elem.substr(found_pos, entry.length) + "</strong>" + elem.substr(
+              found_pos + entry.length) + "</li>")
+          }
+        }
+        if (partial.length)
+          ret = ret.concat(partial.slice(0, instance.options.choices - ret.length))
+        return "<ul>" + ret.join('') + "</ul>";
+      }
+    }, options || {});
+  }
+});
Index: temp/trunk/html/test/naka/dragdrop/recv_post.php
===================================================================
--- temp/trunk/html/test/naka/dragdrop/recv_post.php	(revision 1694)
+++ temp/trunk/html/test/naka/dragdrop/recv_post.php	(revision 1694)
@@ -0,0 +1,9 @@
+<?php
+	foreach($_POST as $key => $val){
+		if(ereg("^item", $key)) {
+			if($val == 'in') {
+				print($key . "¤¬¡¢¥Õ¥ì¡¼¥àÆâ¤ËÂ¸ºß¤·¤Þ¤¹¡£</br>\n");
+			}
+		}
+	}
+?>
Index: temp/trunk/html/test/naka/dragdrop/cart.html
===================================================================
--- temp/trunk/html/test/naka/dragdrop/cart.html	(revision 1694)
+++ temp/trunk/html/test/naka/dragdrop/cart.html	(revision 1694)
@@ -0,0 +1,228 @@
+ï»?!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
+<!-- saved from url=(0032)http://demo.script.aculo.us/shop -->
+<HTML lang=en xml:lang="en" xmlns="http://www.w3.org/1999/xhtml"><HEAD><TITLE>script.aculo.us - web 2.0 javascript demos</TITLE>
+<META http-equiv=content-type content="text/html; charset=utf-8"><LINK 
+media=screen href="dragdrop.files/script.aculo.us.css" type=text/css 
+rel=Stylesheet>
+<SCRIPT src="dragdrop.files/prototype.js" type=text/javascript></SCRIPT>
+
+<SCRIPT src="dragdrop.files/effects.js" type=text/javascript></SCRIPT>
+
+<SCRIPT src="dragdrop.files/dragdrop.js" type=text/javascript></SCRIPT>
+
+<SCRIPT src="dragdrop.files/controls.js" type=text/javascript></SCRIPT>
+
+<STYLE type=text/css>DIV.auto_complete {
+	BORDER-RIGHT: #888 1px solid; PADDING-RIGHT: 0px; BORDER-TOP: #888 1px solid; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; MARGIN: 0px; BORDER-LEFT: #888 1px solid; WIDTH: 250px; PADDING-TOP: 0px; BORDER-BOTTOM: #888 1px solid; POSITION: absolute; BACKGROUND-COLOR: white
+}
+UL.contacts {
+	PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 0px; LIST-STYLE-TYPE: none
+}
+UL.contacts LI.selected {
+	BACKGROUND-COLOR: #ffb
+}
+LI.contact {
+	PADDING-RIGHT: 2px; DISPLAY: block; PADDING-LEFT: 2px; PADDING-BOTTOM: 2px; MARGIN: 0px; PADDING-TOP: 2px; LIST-STYLE-TYPE: none; HEIGHT: 32px
+}
+LI.contact DIV.image {
+	FLOAT: left; WIDTH: 32px; MARGIN-RIGHT: 8px; HEIGHT: 32px
+}
+LI.contact DIV.name {
+	FONT-WEIGHT: bold; FONT-SIZE: 12px; LINE-HEIGHT: 1.2em
+}
+LI.contact DIV.email {
+	FONT-SIZE: 10px; COLOR: #888
+}
+#list {
+	PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; MARGIN: 10px 0px 0px; WIDTH: 250px; PADDING-TOP: 0px; LIST-STYLE-TYPE: none
+}
+#list LI {
+	BORDER-RIGHT: #888 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #888 1px solid; PADDING-LEFT: 5px; PADDING-BOTTOM: 5px; MARGIN: 0px 0px 4px; BORDER-LEFT: #888 1px solid; CURSOR: move; PADDING-TOP: 5px; BORDER-BOTTOM: #888 1px solid
+}
+</STYLE>
+
+<META content="MSHTML 6.00.2900.2873" name=GENERATOR></HEAD>
+<BODY>
+<DIV id=header><IMG id=logo alt="script.aculo.us - web 2.0 javascript demos" 
+src="dragdrop.files/logo.gif"> </DIV>
+<UL id=menu>
+  <LI><A href="http://script.aculo.us/">Back to site</A> </LI>
+  <LI><A class=active href="http://demo.script.aculo.us/">Demos</A> </LI></UL>
+<DIV id=tagline>This site demonstrates the <B>Ruby on Rails 0.13</B> AJAX 
+helpers, <BR>which use script.aculo.us effects, drag-and-drop and 
+autocompletion. </DIV>
+<DIV id=sidebar-container>
+<DIV id=sidebar>
+<H1>rails 0.13 Demos</H1>
+<P>script.aculo.us helpers</P>
+<UL>
+  <LI><A href="http://demo.script.aculo.us/ajax/autocompleter">Autocompleting 
+  text fields (basic)</A> 
+  <LI><A 
+  href="http://demo.script.aculo.us/ajax/autocompleter_customized">Autocompleting 
+  text fields (customized)</A> 
+  <LI><A href="http://demo.script.aculo.us/shop">Shopping cart</A> 
+  <LI><A href="http://demo.script.aculo.us/ajax/sortable_elements">Sortable 
+  elements</A> </LI></UL>
+<P>New AJAX features</P>
+<UL>
+  <LI><A href="http://demo.script.aculo.us/ajax/error_handling">Error 
+  handling</A> 
+  <LI><A href="http://demo.script.aculo.us/ajax/update_element">Update element 
+  helper</A> </LI></UL></DIV>
+<DIV class=links><A href="http://www.rubyonrails.org/"><IMG alt="Ruby on Rails" 
+src="dragdrop.files/rails.jpg"></A> <EM>Rails is a full-stack, open-source web 
+framework in Ruby for writing real-world applications with joy and less code 
+than most frameworks spend doing XML sit-ups.</EM> That quite sums it up. So, if 
+you're still working late hours writing definitions of what's in your database 
+because the framework you use works against and not for you -- do yourself a 
+favour, and check out <A href="http://www.rubyonrails.org/">Ruby on Rails</A>. 
+</DIV></DIV>
+<DIV id=content>
+<H1>Silly easy shopping</H1>
+<P>Drag products to the cart to fill it:</P>
+<DIV style="MARGIN-BOTTOM: 20px; HEIGHT: 120px"><IMG class=products id=product_1 
+alt=Mug src="dragdrop.files/product1.png">
+<SCRIPT type=text/javascript>new Draggable('product_1', {revert:true})</SCRIPT>
+ <IMG class=products id=product_2 alt=T-Shirt src="dragdrop.files/product2.png">
+<SCRIPT type=text/javascript>new Draggable('product_2', {revert:true})</SCRIPT>
+ </DIV>
+<H2>Your cart:</H2>
+<DIV class=cart id=cart style="CLEAR: left; MARGIN-TOP: 10px; HEIGHT: 132px">
+<DIV id=items>Here's your shopping cart. We would very much appreciate it if you 
+fill it with stuff. </DIV>
+<DIV style="CLEAR: both"></DIV></DIV>
+<DIV id=wastebin>Drop items here to remove them from the cart. </DIV>
+<DIV style="PADDING-TOP: 10px; HEIGHT: 40px">
+<P id=indicator style="MARGIN-TOP: 0px; DISPLAY: none"><IMG alt=Indicator 
+src="dragdrop.files/indicator.gif"> Updating cart... </P></DIV>
+<SCRIPT type=text/javascript>Droppables.add('cart', {accept:'products', onDrop:function(element){new Ajax.Updater('items', '/shop/add', {onLoading:function(request){Element.show('indicator')}, onComplete:function(request){Element.hide('indicator')}, parameters:'id=' + encodeURIComponent(element.id), evalScripts:true, asynchronous:true})}, hoverclass:'cart-active'})</SCRIPT>
+
+<SCRIPT type=text/javascript>Droppables.add('wastebin', {accept:'cart-items', onDrop:function(element){Element.hide(element); new Ajax.Updater('items', '/shop/remove', {onLoading:function(request){Element.show('indicator')}, onComplete:function(request){Element.hide('indicator')}, parameters:'id=' + encodeURIComponent(element.id), evalScripts:true, asynchronous:true})}, hoverclass:'wastebin-active'})</SCRIPT>
+
+<P><A onclick="new Effect.SlideDown('source'); return false;" href="http://demo.script.aculo.us/shop#">View source</A></P><PRE id=source style="DISPLAY: none"><CODE>
+# view
+&lt;div style="margin-bottom:20px;height:120px;"&gt;
+&lt;% for product in @products %&gt;
+  &lt;%= image_tag "/images/products/product#{product.id}",
+        :id =&gt; "product_#{product.id}",
+        :alt =&gt; product.title, 
+        :class =&gt; "products"  %&gt;
+  &lt;%= draggable_element "product_#{product.id}", :revert =&gt; true %&gt;
+&lt;% end %&gt;
+&lt;/div&gt;
+
+&lt;h2&gt;Your cart:&lt;/h2&gt;
+
+&lt;div id="cart" class="cart" style="clear:left; height:132px;margin-top:10px;"&gt;
+  &lt;div id="wastebin"&gt;
+    Drop items here to remove them from the cart.
+  &lt;/div&gt;
+  &lt;div id="items"&gt;
+    &lt;%= render :partial =&gt; "cart" %&gt;
+  &lt;/div&gt;
+  &lt;div style="clear:both;"&gt;&lt;/div&gt;
+&lt;/div&gt;
+
+&lt;div style="height:40px;padding-top:10px;"&gt;
+&lt;p id="indicator" style="display:none;margin-top:0px;"&gt;
+  &lt;%= image_tag "indicator.gif" %&gt; Updating cart...
+&lt;/p&gt;
+&lt;/div&gt;
+
+&lt;%= drop_receiving_element "cart", 
+      :update =&gt; "items", :url =&gt; { :action =&gt; "add" },
+      :accept =&gt; "products", :hoverclass =&gt; "cart-active",
+      :loading =&gt; "Element.show('indicator')",
+      :complete =&gt; "Element.hide('indicator')" %&gt;
+      
+&lt;%= drop_receiving_element "wastebin", 
+      :update =&gt; "items", :url =&gt; { :action =&gt; "remove" },
+      :accept =&gt; "cart-items", :hoverclass =&gt; "wastebin-active",
+      :before =&gt; "Element.hide(element)",
+      :loading =&gt; "Element.show('indicator')",
+      :complete =&gt; "Element.hide('indicator')" %&gt;
+    
+# controller
+class ShopController &lt; ApplicationController
+  
+  def index
+    session[:cart] ||= {}
+    @products = Product.find(:all)
+  end
+  
+  def add
+    product_id = params[:id].split("_")[1]
+    
+    session[:cart][product_id] = 
+      session[:cart].include?(product_id) ?  
+      session[:cart][product_id]+1 : 1
+  
+    render :partial =&gt; 'cart'
+  end
+  
+  def remove
+    product_id = params[:id].split("_")[1]
+    
+    if session[:cart][product_id] &gt; 1 
+      session[:cart][product_id] = session[:cart][product_id]-1
+    else
+      session[:cart].delete(product_id)
+    end
+    
+    render :partial =&gt; 'cart'
+  end
+  
+end
+
+
+# _cart.rhtml partial
+&lt;% session[:cart].each do |product,quantity| %&gt;
+&lt;div&gt;
+  &lt;% quantity.times do |i| %&gt;
+    &lt;%= image_tag "/images/products/product#{product}", 
+          :class =&gt; "cart-items", 
+          :id =&gt; "item_#{product}_#{i}", 
+          :style =&gt; "position:relative;" %&gt;
+    &lt;%= draggable_element "item_#{product}_#{i}", :revert =&gt; true %&gt;
+  &lt;% end %&gt;
+  &lt;span class="title"&gt;
+    &lt;%= Product.find(product).title + " (#{quantity})" %&gt;
+  &lt;/span&gt;
+&lt;/div&gt;
+&lt;% end %&gt;
+&lt;%= "Here's your shopping cart." if session[:cart].empty? %&gt;
+</CODE></PRE></DIV>
+<DIV id=footer>
+<P>Â© 2005 Thomas Fuchs <A 
+onclick="new Effect.BlindDown('license'); return false;" 
+href="http://demo.script.aculo.us/shop#">License</A> <A 
+href="http://validator.w3.org/check?uri=referer">validate</A> <A 
+href="http://mir.aculo.us/">mir.aculo.us</A> </P>
+<P class=info><A href="http://script.aculo.us/">script.aculo.us</A> demo site 
+version <EM>2005/07/04</EM> </P>
+<DIV id=license style="DISPLAY: none"><PRE>      script.aculo.us:
+      
+      Copyright (c) 2005 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
+      
+      Permission is hereby granted, free of charge, to any person obtaining
+      a copy of this software and associated documentation files (the
+      "Software"), to deal in the Software without restriction, including
+      without limitation the rights to use, copy, modify, merge, publish,
+      distribute, sublicense, and/or sell copies of the Software, and to
+      permit persons to whom the Software is furnished to do so, subject to
+      the following conditions:
+      
+      The above copyright notice and this permission notice shall be
+      included in all copies or substantial portions of the Software.
+      
+      THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+      EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+      MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+      NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+      LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+      OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+      WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+      
+      <A onclick="new Effect.BlindUp('license'); return false;" href="http://demo.script.aculo.us/shop#">Hide</A>
+      </PRE></DIV></DIV></BODY></HTML>
Index: temp/trunk/html/test/naka/dragdrop/drecom.html
===================================================================
--- temp/trunk/html/test/naka/dragdrop/drecom.html	(revision 1694)
+++ temp/trunk/html/test/naka/dragdrop/drecom.html	(revision 1694)
@@ -0,0 +1,141 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<!-- saved from url=(0105)http://members.cms.drecom.jp/sec/SidefuncOrder.blog%3bjsessionid=E8DA4FE5C69A98F200C5E619643544B4.cms-ap1 -->
+<HTML lang=ja><HEAD><TITLE>¥Ñ¡¼¥ÄÁªÂò¡¦ÊÂ¤ÓÂØ¤¨ - ¥É¥ê¥³¥àCMS</TITLE>
+<META http-equiv=Content-Type content=text/html;charset=EUC-JP>
+<META content=CMS,¥É¥ê¥³¥à name=keywords>
+<META content=¥É¥ê¥³¥àCMS name=abstract>
+<META content=¥É¥ê¥³¥àCMS name=description>
+<SCRIPT src="files/style.js" type=text/javascript></SCRIPT>
+<LINK href="files/style.css" type=text/css rel=stylesheet><LINK 
+href="files/text.css" type=text/css rel=stylesheet>
+<SCRIPT src="files/common.js" type=text/javascript></SCRIPT>
+
+<SCRIPT src="files/xbs.js" type=text/javascript></SCRIPT>
+<!-- added by Takanori Ishikawa, 04/04/06 -->
+<SCRIPT src="files/sidefunc_order.js" type=text/javascript></SCRIPT>
+
+<META content="MSHTML 6.00.2900.2873" name=GENERATOR></HEAD>
+<BODY bottomMargin=0 leftMargin=0 topMargin=10 marginwidth="0" marginheight="0">
+ <SCRIPT language=JavaScript>
+    <!--
+      var help_add_sidefunc= '<b>¥µ¥¤¥É¥Ñ¡¼¥Ä¤ÎÄÉ²Ã¡¦ÊÔ½¸</b>¤ò¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£';
+    //-->
+</SCRIPT>
+
+<SCRIPT src="files/access_key.js" type=text/javascript></SCRIPT>
+
+<SCRIPT language=JavaScript>
+<!--
+function showUpdatedMessage() {
+	if (document.SidefuncOrderForm.isUpdated.value == 'true') {
+		htmlAlert("¥µ¥¤¥É¥Ð¡¼¤ÎÊÑ¹¹¤òÊÝÂ¸¤·¤Þ¤·¤¿¡£", 150, 300);
+	}
+}
+
+function nonSelectable(){
+	//
+	// Internet Explorer DHTML
+	// selection object -> empty method
+	// 
+	// ÁªÂò¤µ¤ì¤Ê¤¤¤è¤¦¤Ë¤¹¤ë¡£
+	if (document.selection && document.selection.empty) {
+		document.selection.empty();
+	}
+}
+
+/* onload */
+sidefunc_order_body_onload = function() {
+	// ¥µ¥¤¥É¥Ð¡¼ÊÂ¤ÓÂØ¤¨¥Ñ¥Í¥ë¤Î½é´ü²½
+	resizeBox();
+	SFDragManager.onload();
+	showUpdatedMessage();
+
+	
+	document.onkeydown = access_key_onkeydown_hock;
+}
+
+// invoked by document.onkeydown: Cntl + s
+function execSave()
+{
+	document.SidefuncOrderForm ? document.SidefuncOrderForm.submit() : void(0);
+}
+
+function resizeBox()
+{
+	var divs_ids = Array("out_box", "DISABLE", "in_box", "LEFT", "RIGHT");
+	var div = null;
+	var nBoxiesHeight = (BoxConfig.height + BoxConfig.padding) * 4;
+	nBoxiesHeight = (nBoxiesHeight < MIN_BOXIES_HEIGHT ? MIN_BOXIES_HEIGHT : nBoxiesHeight);
+		
+	
+	for (var i = 0; i < divs_ids.length; i++) {
+		div = XBSLayer.makeLayer(divs_ids[i]);
+		div.setHeight(div.getHeight() + nBoxiesHeight);
+	}
+}	
+	
+UtilKit.addhook(window, 'onload', sidefunc_order_body_onload);
+
+//-->
+</SCRIPT>
+
+      <TABLE class=sidebodybox onmousemove=nonSelectable(); height=400 cellSpacing=0 cellPadding=10 width=620 border=0>
+        <TBODY>
+        <TR>
+        <FORM name=SidefuncOrderForm action="./test.php" method=post><INPUT type=hidden name=isUpdated> 
+          <TD vAlign=top align=middle><BR>
+            <TABLE onmousemove=nonSelectable(); cellSpacing=0 cellPadding=0 
+            width=450 border=0>
+              <TBODY>
+              <TR>
+                <TD width=140>
+                  <DIV id=out_box 
+                  style="BORDER-RIGHT: #000 1px solid; BORDER-TOP: #000 1px solid; BORDER-LEFT: #000 1px solid; WIDTH: 140px; BORDER-BOTTOM: #000 1px solid; POSITION: relative; HEIGHT: 52px">
+                  <DIV class=normalfont 
+                  style="PADDING-RIGHT: 2px; PADDING-LEFT: 2px; BACKGROUND: #eee; PADDING-BOTTOM: 2px; PADDING-TOP: 2px; BORDER-BOTTOM: #000 1px solid" 
+                  align=center>»ÈÍÑ¤·¤Ê¤¤¥Ñ¡¼¥Ä</DIV>
+                  <DIV id=DISABLE 
+                  style="BORDER-RIGHT: #ccc 1px solid; BORDER-TOP: #ccc 1px solid; LEFT: 4px; BORDER-LEFT: #ccc 1px solid; WIDTH: 130px; BORDER-BOTTOM: #ccc 1px solid; POSITION: relative; TOP: 4px; HEIGHT: 20px; BACKGROUND-COLOR: #ffffee"></DIV></DIV></TD>
+                <TD width=10><IMG height=1 src="files/spacer.gif" 
+                  width=10></TD>
+                <TD width=350>
+                  <DIV id=in_box 
+                  style="BORDER-RIGHT: #000 1px solid; BORDER-TOP: #000 1px solid; BORDER-LEFT: #000 1px solid; WIDTH: 350px; BORDER-BOTTOM: #000 1px solid; POSITION: relative; HEIGHT: 52px">
+                  <DIV class=normalfont 
+                  style="PADDING-RIGHT: 2px; PADDING-LEFT: 2px; BACKGROUND: #eee; PADDING-BOTTOM: 2px; PADDING-TOP: 2px; BORDER-BOTTOM: #000 1px solid" 
+                  align=center>»ÈÍÑ¤¹¤ë¥Ñ¡¼¥Ä</DIV>
+                  <DIV id=LEFT 
+                  style="BORDER-RIGHT: #ccc 1px solid; BORDER-TOP: #ccc 1px solid; LEFT: 4px; BORDER-LEFT: #ccc 1px solid; WIDTH: 130px; BORDER-BOTTOM: #ccc 1px solid; POSITION: absolute; TOP: 26px; HEIGHT: 20px; BACKGROUND-COLOR: #eaf2ff"></DIV>
+                  <DIV id=RIGHT 
+                  style="BORDER-RIGHT: #ccc 1px solid; BORDER-TOP: #ccc 1px solid; RIGHT: 4px; BORDER-LEFT: #ccc 1px solid; WIDTH: 130px; BORDER-BOTTOM: #ccc 1px solid; POSITION: absolute; TOP: 26px; HEIGHT: 20px; BACKGROUND-COLOR: #eaf2ff"></DIV></DIV></TD></TR></TBODY></TABLE><BR>
+            <DIV id=checkline 
+            style="VISIBILITY: hidden; WIDTH: 130px; POSITION: absolute; HEIGHT: 1px">
+            <HR color=#ff5555>
+            </DIV>
+            <DIV id=f0 
+            style="BORDER-RIGHT: gray 1px solid; PADDING-RIGHT: 2px; BORDER-TOP: gray 1px solid; PADDING-LEFT: 2px; FONT-SIZE: 12px; PADDING-BOTTOM: 2px; BORDER-LEFT: gray 1px solid; COLOR: #666666; PADDING-TOP: 2px; BORDER-BOTTOM: gray 1px solid; POSITION: absolute; BACKGROUND-COLOR: #ffffff" 
+            align=center>ºÇ¿·¥³¥á¥ó¥È </DIV><INPUT type=hidden value=4 
+            name=sidefuncId> <INPUT type=hidden value=0 name=authorCd> <INPUT 
+            type=hidden value=ºÇ¿·¥³¥á¥ó¥È name=sidefuncName> <INPUT type=hidden 
+            value=0 name=order> <INPUT type=hidden value=0 name=position> 
+            <DIV id=f1 
+            style="BORDER-RIGHT: gray 1px solid; PADDING-RIGHT: 2px; BORDER-TOP: gray 1px solid; PADDING-LEFT: 2px; FONT-SIZE: 12px; PADDING-BOTTOM: 2px; BORDER-LEFT: gray 1px solid; COLOR: #666666; PADDING-TOP: 2px; BORDER-BOTTOM: gray 1px solid; POSITION: absolute; BACKGROUND-COLOR: #ffffff" 
+            align=center>ºÇ¿·¥È¥é¥Ã¥¯¥Ð¥Ã¥¯ </DIV><INPUT type=hidden value=5 
+            name=sidefuncId> <INPUT type=hidden value=0 name=authorCd> <INPUT 
+            type=hidden value=ºÇ¿·¥È¥é¥Ã¥¯¥Ð¥Ã¥¯ name=sidefuncName> <INPUT type=hidden 
+            value=1 name=order> <INPUT type=hidden value=0 name=position> 
+            <DIV id=f2 
+            style="BORDER-RIGHT: gray 1px solid; PADDING-RIGHT: 2px; BORDER-TOP: gray 1px solid; PADDING-LEFT: 2px; FONT-SIZE: 12px; PADDING-BOTTOM: 2px; BORDER-LEFT: gray 1px solid; COLOR: #666666; PADDING-TOP: 2px; BORDER-BOTTOM: gray 1px solid; POSITION: absolute; BACKGROUND-COLOR: #ffffff" 
+            align=center>RSS¥¢¥¤¥³¥ó </DIV><INPUT type=hidden value=9 
+            name=sidefuncId> <INPUT type=hidden value=0 name=authorCd> <INPUT 
+            type=hidden value=RSS¥¢¥¤¥³¥ó name=sidefuncName> <INPUT type=hidden 
+            value=1 name=order> <INPUT type=hidden value=1 name=position> 
+            <DIV id=f3 
+            style="BORDER-RIGHT: gray 1px solid; PADDING-RIGHT: 2px; BORDER-TOP: gray 1px solid; PADDING-LEFT: 2px; FONT-SIZE: 12px; PADDING-BOTTOM: 2px; BORDER-LEFT: gray 1px solid; COLOR: #666666; PADDING-TOP: 2px; BORDER-BOTTOM: gray 1px solid; POSITION: absolute; BACKGROUND-COLOR: #ffffff" 
+            align=center>¥µ¥¤¥É¥á¥Ë¥å¡¼ </DIV><INPUT type=hidden value=10 
+            name=sidefuncId> <INPUT type=hidden value=0 name=authorCd> <INPUT 
+            type=hidden value=¥µ¥¤¥É¥á¥Ë¥å¡¼ name=sidefuncName> <INPUT type=hidden 
+            value=0 name=order> <INPUT type=hidden value=1 name=position> 
+            <DIV style="MARGIN: 20px 0px" align=center><INPUT class=button type=submit value=¡¡ÊÝ¡¡Â¸¡¡></DIV></TD></FORM></TR></TBODY></TABLE></A></TD></TR>
+</TBODY></TABLE>
+</TD></TR></TBODY></TABLE></BODY></HTML>
Index: temp/trunk/html/test/naka/dragdrop/js/dragdrop.js
===================================================================
--- temp/trunk/html/test/naka/dragdrop/js/dragdrop.js	(revision 1694)
+++ temp/trunk/html/test/naka/dragdrop/js/dragdrop.js	(revision 1694)
@@ -0,0 +1,196 @@
+var obj;
+var offsetX;
+var offsetY;
+var arrObj;
+var objParam;
+
+// ¥Ñ¥é¥á¡¼¥¿´ÉÍý¥¯¥é¥¹¤ÎÄêµÁ
+function SC_Param() {
+	this.ITEM_MAX = 3;		
+}
+
+// ¥µ¥¤¥º´ÉÍý¥¯¥é¥¹¤ÎÄêµÁ
+function SC_Size() {
+	this.id = '';
+	this.left = 0;
+	this.top = 0;
+	this.width = 0;
+	this.height = 0;
+	this.obj;
+};
+
+// ¥ª¥ó¥í¡¼¥É½èÍý
+onload=function () {
+	// ¥Ñ¥é¥á¡¼¥¿¤Î½é´ü²½
+	objParam = new SC_Param();
+	
+	// WIN-IE
+	if (document.all) {
+		objlist = document.all.tags("div");
+	// WIN-NN,WIN-FF   
+	} else if (document.getElementsByTagName) {
+		objlist = document.getElementsByTagName("div");
+	} else {
+		return;
+	}
+	
+	arrObj = new Array();
+	for (i = 0; i < objlist.length; i++) {
+		id = objlist[i].id;
+		arrObj[id] = new SC_Size();
+		arrObj[id].id = id;
+		arrObj[id].obj = objlist[id];
+		arrObj[id].left = objlist[id].style.left;
+		arrObj[id].top = objlist[id].style.top;
+		arrObj[id].width = objlist[id].style.width;
+		arrObj[id].height = objlist[id].style.height;
+		arrObj[id].left = Number(arrObj[id].left.replace(/px/, ''));
+		arrObj[id].top = Number(arrObj[id].top.replace(/px/, ''));
+		arrObj[id].width = Number(arrObj[id].width.replace(/px/, ''));
+		arrObj[id].height = Number(arrObj[id].height.replace(/px/, ''));
+		arrObj[id].right = Number(arrObj[id].left) + Number(arrObj[id].width);
+		arrObj[id].bottom =Number(arrObj[id].top) + Number(arrObj[id].height);
+	}
+	
+	// MouseDown¥¤¥Ù¥ó¥È½èÍý¤ÎÆþ¤ìÂØ¤¨
+	objlist['item0'].onmousedown = onMouseDown;
+	objlist['item1'].onmousedown = onMouseDown;
+	objlist['item2'].onmousedown = onMouseDown;
+	
+	document.onmousemove = onMouseMove;
+	document.onmouseup = onMouseUp;
+}
+
+// MouseDown¥¤¥Ù¥ó¥È
+function onMouseDown(e) {
+   obj = this;
+   // WIN-IE
+   if (document.all) {
+      offsetX = event.offsetX + 2;
+      offsetY = event.offsetY + 2;
+   // WIN-NN,WIN-FF
+   } else if (obj.getElementsByTagName) {
+      offsetX = e.pageX - parseInt(obj.style.left);
+      offsetY = e.pageY - parseInt(obj.style.top);
+   }
+   return false;
+}
+
+// MouseMove¥¤¥Ù¥ó¥È
+function onMouseMove(e) {
+	if (!obj) {
+		return true;
+	}	
+	// WIN-IE
+	if (document.all) {
+		x = event.clientX - offsetX;
+		// ²èÌÌ³°¤Ë½Ð¤Ê¤¤¤è¤¦¤ËÀ©¸æ¤¹¤ë¡¡
+		if(x <= 0) {
+			x = 0;
+		}
+		left_max = document.body.clientWidth - arrObj[obj.id].width;
+		if(x >= left_max) {
+			x =left_max;			
+		}
+		obj.style.left = x;
+		// ²èÌÌ³°¤Ë½Ð¤Ê¤¤¤è¤¦¤ËÀ©¸æ¤¹¤ë¡¡
+		y = event.clientY - offsetY;
+		if(y <= 0) {
+			y = 0;
+		}
+		top_max = document.body.clientHeight - arrObj[obj.id].height;
+		if(y >= top_max) {
+			y =top_max;			
+		}
+		obj.style.top = y;		
+	// WIN-NN,WIN-FF
+	} else if (obj.getElementsByTagName) {
+		x = e.pageX - offsetX;
+		// ²èÌÌ³°¤Ë½Ð¤Ê¤¤¤è¤¦¤ËÀ©¸æ¤¹¤ë¡¡
+		if(x <= 0) {
+			x = 0;
+		}
+		left_max = window.innerWidth - arrObj[obj.id].width;
+		if(x >= left_max) {
+			x =left_max;			
+		}
+		obj.style.left = x;
+		
+		y = e.pageY - offsetY;
+		// ²èÌÌ³°¤Ë½Ð¤Ê¤¤¤è¤¦¤ËÀ©¸æ¤¹¤ë¡¡
+		if(y <= 0) {
+			y = 0;
+			obj.style.top = 0;
+		}
+		top_max = window.innerHeight - arrObj[obj.id].height;
+		if(y >= top_max) {
+			y =top_max;			
+		}
+		obj.style.top = y;
+	}
+	
+	if(isInFlame('flame0', obj)) {
+		document.getElementById('td1').style.backgroundColor = '#fffadd';
+	} else {
+		document.getElementById('td1').style.backgroundColor = '#ffffff';
+	}
+	return false;
+}
+
+// MouseUp¥¤¥Ù¥ó¥È
+function onMouseUp(e) {
+	if (!obj) {
+		return true;
+	}
+	
+	if(!isInFlame('flame0', obj)) {
+		// WIN-IE
+		if (document.all) {
+			// ºÇ½é¤Î°ÌÃÖ¤ËÌá¤¹
+			obj.style.left = arrObj[obj.id].left;
+			obj.style.top = arrObj[obj.id].top;
+		// WIN-NN,WIN-FF
+		} else if (obj.getElementsByTagName) {
+			// ºÇ½é¤Î°ÌÃÖ¤ËÌá¤¹
+			obj.style.left = arrObj[obj.id].left;
+			obj.style.top = arrObj[obj.id].top;
+		}
+	}	
+	document.getElementById('td1').style.backgroundColor = '#ffffff';	
+	obj = null;
+}
+
+// ¥Õ¥ì¡¼¥àÆâ¤Ë¥¢¥¤¥Æ¥à¤¬Â¸ºß¤¹¤ë¤«È½Äê¤¹¤ë¡¡
+function isInFlame(flame_id, item) {
+	top_val = item.style.top;
+	top_val = Number(top_val.replace(/px/, ''));
+	bottom_val = top_val + arrObj[item.id].height;
+	left_val = item.style.left;
+	left_val = Number(left_val.replace(/px/, ''))
+	right_val = left_val + arrObj[item.id].width;		
+	if(
+		top_val > arrObj[flame_id].top &&
+		bottom_val < arrObj[flame_id].bottom &&
+		left_val > arrObj[flame_id].left &&
+		right_val < arrObj[flame_id].right
+		) {
+		return true;
+	}
+	return false;
+}
+
+// Á÷¿®Á°¤Î½èÍý
+function preSubmit() {
+	for(i = 0; i < 3; i++) {
+		id = 'item' + i;
+		obj = arrObj[id].obj;
+		if(isInFlame ('flame0', obj)) {
+			document.form1[obj.id].value = "in";
+		} else {
+			document.form1[obj.id].value = "out";
+		}
+	}
+}
+
+
+
Index: temp/trunk/html/test/naka/dragdrop/simple.html
===================================================================
--- temp/trunk/html/test/naka/dragdrop/simple.html	(revision 1694)
+++ temp/trunk/html/test/naka/dragdrop/simple.html	(revision 1694)
@@ -0,0 +1,63 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<!-- saved from url=(0054)http://www.res-system.com/weblog/media/1/dragdrop.html -->
+<HTML><HEAD><TITLE>DragDrop Sample</TITLE>
+<META http-equiv=Content-Type content="text/html; charset=utf-8">
+<SCRIPT type=text/javascript>
+<!--
+var obj;
+var offsetX;
+var offsetY;
+
+onload=function () {
+   if (document.all) {
+   	  // WIN-IE
+      objlist = document.all.tags("div");
+   } else if (document.getElementsByTagName) {
+      // WIN-NN,WIN-FF
+      objlist = document.getElementsByTagName("div");
+   } else {
+   	  alert("3");   
+      return;
+   }
+   for (i = 0; i < objlist.length; i++) {
+      objlist[i].onmousedown = onMouseDown;
+   }
+   document.onmousemove = onMouseMove;
+   document.onmouseup = onMouseUp;
+}
+function onMouseDown(e) {
+   obj = this;
+   if (document.all) {
+      offsetX = event.offsetX + 2;
+      offsetY = event.offsetY + 2;
+   } else if (obj.getElementsByTagName) {
+      offsetX = e.pageX - parseInt(obj.style.left);
+      offsetY = e.pageY - parseInt(obj.style.top);
+   }
+   return false;
+}
+function onMouseMove(e) {
+   if (!obj) {
+      return true;
+   }
+   if (document.all) {
+      obj.style.left = event.clientX - offsetX + document.body.scrollLeft;
+      obj.style.top = event.clientY - offsetY + document.body.scrollTop;
+   } else if (obj.getElementsByTagName) {
+      obj.style.left = e.pageX - offsetX;
+      obj.style.top = e.pageY - offsetY;
+   }
+   return false;
+}
+function onMouseUp(e) {
+   obj = null;
+}
+
+-->
+</SCRIPT>
+
+<META content="MSHTML 6.00.2900.2873" name=GENERATOR></HEAD>
+<BODY>
+<DIV 
+style="BORDER-RIGHT: #000000 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #000000 1px solid; PADDING-LEFT: 5px; LEFT: 200px; PADDING-BOTTOM: 5px; BORDER-LEFT: #000000 1px solid; WIDTH: 200px; CURSOR: move; PADDING-TOP: 5px; BORDER-BOTTOM: #000000 1px solid; POSITION: absolute; TOP: 100px; HEIGHT: 50px; BACKGROUND-COLOR: #eeeeee; TEXT-ALIGN: center">Web 
+Artisan Blog </DIV></BODY></HTML>
Index: temp/trunk/html/test/naka/pie.php
===================================================================
--- temp/trunk/html/test/naka/pie.php	(revision 1694)
+++ temp/trunk/html/test/naka/pie.php	(revision 1694)
@@ -0,0 +1,44 @@
+<?php
+require_once("./class/SC_GraphPie.php");
+require_once("./class/SC_GraphLine.php");
+
+$objGraphPie = new SC_GraphPie();
+$objGraphLine = new SC_GraphLine();
+
+$arrLegend = array(
+	'»î¸³1',
+	'»î¸³2',
+	'»î¸³3',
+	'»î¸³4',
+	'»î¸³5',
+	'»î¸³6',
+	'»î¸³7',
+	'»î¸³8',
+	'»î¸³5',
+	'»î¸³6',
+	'»î¸³7',
+	'»î¸³8'	
+);
+
+$arrData = array(
+	250,
+	23,
+	33,
+	58,
+	120,
+	300,
+	223,
+	100
+);
+
+// ¥Ç¡¼¥¿¤ò¥»¥Ã¥È¤¹¤ë
+$objGraphPie->setData($arrData);
+// ËÞÎã¤ò¥»¥Ã¥È¤¹¤ë
+$objGraphPie->setLegend($arrLegend);
+
+// ±ß¥°¥é¥ÕÉÁ²è
+$objGraphPie->drawGraph();
+
+// ¥°¥é¥Õ¤Î½ÐÎÏ
+$objGraphPie->outputGraph();
+?>
Index: temp/trunk/html/test/naka/class/lib.php
===================================================================
--- temp/trunk/html/test/naka/class/lib.php	(revision 1694)
+++ temp/trunk/html/test/naka/class/lib.php	(revision 1694)
@@ -0,0 +1,57 @@
+<?php
+
+// ±ß¤ÎÃæ¿´ÅÀ¤ÈÄ¾·Â¤«¤é¸Ì¤Î½ªÃ¼ºÂÉ¸¤ò»»½Ð¤¹¤ë¡£
+/*
+	$cx	: Ãæ¿´ÅÀXºÂÉ¸
+	$cy	: Ãæ¿´ÅÀYºÂÉ¸
+	$r	: È¾·Â
+	$e	: ³ÑÅÙ
+*/
+function lfGetArcPos($cx, $cy, $cw, $ch, $e) {
+	// »°³Ñ´Ø¿ôÍÑ¤Î³ÑÅÙ¤òµá¤á¤ë
+	$s = 90 - $e;
+	$r = $cw / 2;
+	// °ÌÃÖ¤òµá¤á¤ë
+	$x = $cx + ($r * cos(deg2rad($s)));
+	$y = $cy - (($r * sin(deg2rad($s))) * ($ch / $cw));		
+	return array(round($x), round($y));
+}
+
+
+
+/* ²èÁü¤Ë¥Æ¥­¥¹¥È¤òÉÁ²è¤¹¤ë */
+function lfImageText($dst_image, $text, $font_size, $left, $top, $font, $arrRGB) {
+	$color = ImageColorAllocate($dst_image, $arrRGB[0], $arrRGB[1], $arrRGB[2]);
+	$text = mb_convert_encoding($text, "UTF-8", "EUC-JP");
+	// É½¼¨³ÑÅÙ	
+	$angle = 0;
+	// ¥Æ¥­¥¹¥ÈÉÁ²è
+	ImageTTFText($dst_image, $font_size, $angle, $left, $top, $color, $font, $text);
+}
+
+// É½¼¨¿§¤Î¼èÆÀ
+function lfGetImageColor($image, $array) {
+	if(count($array) != 3) {
+		return NULL;
+	}
+	$ret = imagecolorallocate($image, $array[0], $array[1], $array[2]);
+	return $ret;
+}
+
+// ±ÆÍÑÉ½¼¨¿§¤Î¼èÆÀ
+function lfGetImageDarkColor($image, $array) {
+	if(count($array) != 3) {
+		return NULL;
+	}
+	$i = 0;
+	foreach($array as $val) {
+		$dark[$i] = $val - 45;
+		if($dark[$i] < 0) {
+			$dark[$i] = 0;
+		}
+		$i++;
+	}
+	$ret = imagecolorallocate($image, $dark[0], $dark[1], $dark[2]);
+	return $ret;
+}
+?>
Index: temp/trunk/html/test/naka/class/SC_GraphBar.php
===================================================================
--- temp/trunk/html/test/naka/class/SC_GraphBar.php	(revision 1694)
+++ temp/trunk/html/test/naka/class/SC_GraphBar.php	(revision 1694)
@@ -0,0 +1,78 @@
+<?
+$SC_GRAPHBAR_DIR = realpath(dirname( __FILE__));
+require_once($SC_GRAPHBAR_DIR . "/SC_GraphLine.php");	
+
+// ÀÞ¤ìÀþ¥°¥é¥ÕÀ¸À®¥¯¥é¥¹
+class SC_GraphBar extends SC_GraphLine{
+    // ¥³¥ó¥¹¥È¥é¥¯¥¿
+	function SC_GraphLine(
+		$bgw = BG_WIDTH, $bgh = BG_HEIGHT, $left = LINE_LEFT, $top = LINE_TOP,
+		$area_width = LINE_AREA_WIDTH, $area_height = LINE_AREA_HEIGHT) {
+		parent::SC_GraphLine($bgw, $bgh, $left, $top, $area_width, $area_height);	
+	}
+	
+	// ¥°¥é¥Õ¤ÎÉÁ²è
+	function drawGraph() {
+		$this->drawYLine();
+		$this->drawXLine(true);
+		
+		// ËÀ¥°¥é¥Õ¤ÎÉÁ²è
+		for($i = 0; $i < $this->line_max; $i++) {
+			$this->drawBar($i);
+		}
+		
+		// ¥é¥Ù¥ë¤ÎÉÁ²è
+		for($i = 0; $i < $this->line_max; $i++) {
+			$this->drawLabel($i);
+		}
+		
+		// ËÞÎã¤ÎÉÁ²è
+		$this->drawLegend();	
+	}
+	
+	// ËÀ¥°¥é¥Õ¤ÎÉÁ²è
+	function drawBar($line_no) {
+		$arrPointList = $this->arrPointList[$line_no];
+		// ¥Ç¡¼¥¿¿ô¤ò¿ô¤¨¤ë
+		$count = count($arrPointList);
+		// È¾ÌÜÀ¹¤ê¤ÎÉý¤òµá¤á¤ë
+		$half_scale = intval($this->area_width / ($count + 1) / 2);
+		// ÌÜÀ¹¤ê¤ÎÉý¤òµá¤á¤ë
+		$scale_width = intval($this->area_width / ($count + 1));
+		// ËÀ¥°¥é¥Õ¤Î¥µ¥¤¥º¤òµá¤á¤ë
+		$bar_width = intval(($scale_width - (BAR_PAD * 2)) / $this->line_max);
+		// ¿§¿ô¤Î¼èÆÀ
+		$c_max = count($this->arrColor);
+		for($i = 0; $i < $count; $i++) {
+			$left = $arrPointList[$i][0] - $half_scale + BAR_PAD + ($bar_width * $line_no);
+			$top = $arrPointList[$i][1];
+			$right = $left + $bar_width;
+			$bottom = $this->top + $this->area_height;
+			
+			// ±Æ¤ÎÉÁ²è
+			if($this->shade_on) {
+				imagefilledrectangle($this->image, $left + 2, $top + 2, $right + 2, $bottom, $this->shade_color);
+			}
+			//imagefilledrectangle($this->image, $left, $top, $right, $bottom, $this->arrColor[($i % $c_max)]);
+			imagefilledrectangle($this->image, $left, $top, $right, $bottom, $this->arrColor[$line_no]);			
+			imagerectangle($this->image, $left, $top, $right, $bottom, $this->flame_color);					
+		}
+	}
+	
+	// ¥é¥Ù¥ë¤òÉÁ²è¤¹¤ë
+	function drawLabel($line_no) {
+		$arrData = $this->arrDataList[$line_no];
+		$arrPointList = $this->arrPointList[$line_no];
+		$count = count($arrPointList);
+		for($i = 0; $i < $count; $i++) {
+			$x = $arrPointList[$i][0];
+			$y = $arrPointList[$i][1];
+			$text_width = $this->getTextWidth(number_format($arrData[$i]), FONT_SIZE);
+			$y_pos = $y - FONT_SIZE - 5;
+			$x_pos = $x - $text_width / 2;
+			$this->setText(FONT_SIZE, $x_pos, $y_pos, number_format($arrData[$i]));
+		}
+	}
+	
+}
+?>
Index: temp/trunk/html/test/naka/class/SC_GraphLine.php
===================================================================
--- temp/trunk/html/test/naka/class/SC_GraphLine.php	(revision 1694)
+++ temp/trunk/html/test/naka/class/SC_GraphLine.php	(revision 1694)
@@ -0,0 +1,268 @@
+<?
+$SC_GRAPHLINE_DIR = realpath(dirname( __FILE__));
+require_once($SC_GRAPHLINE_DIR . "/SC_GraphBase.php");	
+
+// ÀÞ¤ìÀþ¥°¥é¥ÕÀ¸À®¥¯¥é¥¹
+class SC_GraphLine extends SC_GraphBase{
+	var $area_width;
+	var $area_height;
+	var $ygrid_on;
+	var $graph_max;		// ¥°¥é¥Õ¤Î¥¨¥ê¥¢ºÇÂçÃÍ(Y¼´ÄºÅÀ¤ÎÃÍ)
+	var $arrXLabel;		
+	var $XTitle;		// X¼´¥¿¥¤¥È¥ë
+	var $YTitle;		// Y¼´¥¿¥¤¥È¥ë
+	var $arrDataList;	// ¥°¥é¥Õ¥Ç¡¼¥¿¤ò³ÊÇ¼
+	var $arrPointList;	// ÀÞ¤ìÀþºÂÉ¸¤ò³ÊÇ¼
+	var $line_max;		// Ê£¿ô¤ÎÉÁ²è¤Î¾ì¹ç¤Ë²Ã»»¤·¤Æ¤¤¤¯
+			
+    // ¥³¥ó¥¹¥È¥é¥¯¥¿
+	function SC_GraphLine(
+		$bgw = BG_WIDTH, $bgh = BG_HEIGHT, $left = LINE_LEFT, $top = LINE_TOP,
+		$area_width = LINE_AREA_WIDTH, $area_height = LINE_AREA_HEIGHT) {
+		parent::SC_GraphBase($bgw, $bgh, $left, $top);	
+		$this->area_width = $area_width;
+		$this->area_height = $area_height;
+		$this->ygrid_on = true;
+		$this->line_max = 0;
+		$this->graph_max = 0;
+	}
+	
+	// Y¼´¥¿¥¤¥È¥ë
+	function drawYTitle() {
+		// Y¼´¤Ë¥¿¥¤¥È¥ë¤òÆþ¤ì¤ë
+		if($this->YTitle != "") {
+			$text_width = $this->getTextWidth($this->YTitle, FONT_SIZE);
+			$x_pos = $this->left - ($text_width / 2);
+			$y_pos = $this->top - FONT_SIZE - LINE_YTITLE_PAD;		
+			$this->setText(FONT_SIZE, $x_pos, $y_pos, $this->YTitle);
+		}
+	}
+	
+	// X¼´¥¿¥¤¥È¥ë
+	function drawXTitle() {
+		// Y¼´¤Ë¥¿¥¤¥È¥ë¤òÆþ¤ì¤ë
+		if($this->XTitle != "") {
+			$text_width = $this->getTextWidth($this->XTitle, FONT_SIZE);
+			$x_pos = $this->left + $this->area_width - ($text_width / 2);
+			$y_pos = $this->top + $this->area_height + LINE_XTITLE_PAD;
+			$this->setText(FONT_SIZE, $x_pos, $y_pos, $this->XTitle);
+		}
+	}
+	
+	// Y¼´¤ÎÉÁ²è
+	function drawYLine() {
+		imageline($this->image, $this->left, $this->top, $this->left, $this->top + $this->area_height, $this->flame_color);
+		// ÌÜÀ¹¤êÉý¤òµá¤á¤ë(Ãæ´ÖÅÀ¤Ï¼«Æ°)
+		$size = $this->area_height / (LINE_Y_SCALE * 2);
+		// ¾å¤«¤éÌÜÀ¹¤ê¤òÆþ¤ì¤Æ¤¤¤¯
+		$pos = 0;
+		for($i = 0; $i < (LINE_Y_SCALE * 2); $i++) {
+			// ÌÜÀ¹¤êÉý
+			if(($i % 2) == 0) {
+				$sw = LINE_SCALE_SIZE;
+				if($this->ygrid_on) {
+					imageline($this->image, $this->left, $this->top + $pos, $this->left + $this->area_width, $this->top + $pos, $this->grid_color);
+				}
+			} else {
+				$sw = LINE_SCALE_SIZE / 2;
+			}
+			imageline($this->image, $this->left, $this->top + $pos, $this->left + $sw, $this->top + $pos, $this->flame_color);
+			$pos += $size;
+		}
+		// Y¼´¤ËÌÜÀ¹¤êÃÍ¤òÆþ¤ì¤ë
+		$this->setYScale();
+		$this->drawYTitle();	
+	}
+	
+	// X¼´¤ÎÉÁ²è
+	function drawXLine($bar = false) {
+		imageline($this->image, $this->left, $this->top + $this->area_height, $this->left + $this->area_width, $this->top + $this->area_height, $this->flame_color);
+		$arrPointList = $this->arrPointList[0];
+		$count = count($arrPointList);
+		
+		// ËÀ¥°¥é¥Õ¤Î¾ì¹ç¤ÏÈ¾ÌÜÀ¹¤ê¤º¤é¤¹
+		if($bar) {
+			$half_scale = intval($this->area_width / ($count + 1) / 2);
+		} else {
+			$half_scale = 0;
+		}
+		
+		// ¥é¥Ù¥ë¤ÎÉ½¼¨¥¤¥ó¥¿¡¼¥Ð¥ë¤ò»»½Ð
+		$interval = ceil($count / LINE_XLABEL_MAX);	// ÀÚ¤ê¾å¤²				
+		for($i = 0; $i < $count; $i++) {
+			// X¼´¤ËÌÜÀ¹¤ê¤òÆþ¤ì¤ë
+			$x = $arrPointList[$i][0];
+			$pos = $this->top + $this->area_height;
+			imageline($this->image, $x - $half_scale, $pos, $x - $half_scale, $pos - LINE_SCALE_SIZE,  $this->flame_color);			
+			// ¥é¥Ù¥ë¤òÆþ¤ì¤ë
+			if(($i % $interval) == 0) {
+				$text_width = $this->getTextWidth($this->arrXLabel[$i], FONT_SIZE);
+				$x_pos = $x - ($text_width / 2);
+				$this->setText(FONT_SIZE, $x_pos, $pos + FONT_SIZE, $this->arrXLabel[$i]);
+			}
+		}
+		
+		// ËÀ¥°¥é¥Õ¤Î¾ì¹ç¤ÏºÇ¸å¤ÎÌÜÀ¹¤ê¤ò°ì¤ÄÄÉ²Ã¤¹¤ë
+		if($bar) {
+			imageline($this->image, $x + $half_scale, $pos, $x + $half_scale, $pos - LINE_SCALE_SIZE,  $this->flame_color);	
+		}
+		
+		$this->drawXTitle();
+	}
+		
+	// ¥°¥ê¥Ã¥ÉÉ½¼¨
+	function setYGridOn($ygrid_on) {
+		$this->ygrid_on = $ygrid_on;
+	}
+	
+	// ¥Ý¥¤¥ó¥È¤ÎÉÁ²è
+	function setMark($line_no, $left, $top, $size = LINE_MARK_SIZE) {
+		// ¶ö¿ô¤ËÊÑ´¹¤·¤Æ¤ª¤¯
+		$size += $size % 2;
+		$array = array(
+			$left, $top - ($size / 2),
+			$left + ($size / 2), $top,
+			$left, $top + ($size / 2),
+			$left - ($size / 2), $top,
+		);		
+		imagefilledpolygon($this->image, $array, 4, $this->arrColor[$line_no]);
+		imagepolygon($this->image, $array, 4, $this->flame_color);
+ 		imagesetpixel ($this->image, $left, $top + ($size / 2), $this->flame_color);
+	}	
+	
+	// Y¼´ÌÜÀ¹¤ê¤ËÃÍ¤òÆþ¤ì¤ë
+	function setYScale() {
+		// 1ÌÜÀ¹¤ê¤ÎÃÍ
+		$number = intval($this->graph_max / LINE_Y_SCALE);				
+		// ÌÜÀ¹¤êÉý¤òµá¤á¤ë
+		$size = $this->area_height / LINE_Y_SCALE;
+		$pos = 0;
+		for($i = 0; $i <= LINE_Y_SCALE; $i++) {
+			$snumber = $number * (LINE_Y_SCALE - $i);
+			$disp_number = number_format($snumber);
+			$num_width = $this->getTextWidth($disp_number, FONT_SIZE);
+			$this->setText(FONT_SIZE, $this->left - $num_width - 2, $this->top + $pos - (FONT_SIZE / 2), $disp_number);
+			$pos += $size;
+		}
+	}
+	
+	// 
+	function setMax($arrData) {
+		// ¥Ç¡¼¥¿¤ÎºÇÂçÃÍ¤ò¼èÆÀ¤¹¤ë¡£
+		$data_max = max($arrData);
+		// 10¤Î²¿ÇÜ¤«¤ò¼èÆÀ
+		$figure = strlen($data_max) - 1;
+		// ¼¡¤Î·å¤ò·×»»¤¹¤ë
+		$tenval = pow(10, $figure);
+		// ¥°¥é¥Õ¾å¤Ç¤ÎºÇÂçÃÍ¤òµá¤á¤ë
+		$this->graph_max = $tenval * (intval($data_max / $tenval) + 1);
+		// ºÇÂçÃÍ¤¬10Ì¤Ëþ¤Î¾ì¹ç¤ÎÂÐ±þ
+		if($this->graph_max < 10) {
+			$this->graph_max = 10;
+		}	
+	}
+	
+	// ¥°¥é¥Õ¤ÎÉÁ²è
+	function drawGraph() {
+		// ¥°¥é¥ÕÇØ·Ê¤òÉÁ²è
+		$this->drawYLine();
+		$this->drawXLine();
+		
+		// ÀÞ¤ìÀþ¥°¥é¥ÕÉÁ²è
+		for($i = 0; $i < $this->line_max; $i++) {
+			$this->drawLine($i);
+		}
+		
+		// ¥Þ¡¼¥¯¤òÉÁ²è
+		for($i = 0; $i < $this->line_max; $i++) {
+			$this->drawMark($i);
+		}
+		
+		// ¥é¥Ù¥ë¤òÉÁ²è
+		for($i = 0; $i < $this->line_max; $i++) {
+			$this->drawLabel($i);		
+		}
+
+		// ËÞÎã¤ÎÉÁ²è
+		$this->drawLegend();	
+	}
+	
+	// ¥é¥¤¥ó¤òÉÁ²è¤¹¤ë
+	function drawLine($line_no) {
+		$arrPointList = $this->arrPointList[$line_no];
+		
+		$count = count($arrPointList);
+		for($i = 0; $i < $count; $i++) {
+			$x = $arrPointList[$i][0];
+			$y = $arrPointList[$i][1];
+			if(isset($arrPointList[$i + 1])) {
+				$next_x = $arrPointList[$i + 1][0];
+				$next_y = $arrPointList[$i + 1][1];
+				imageline($this->image, $x, $y, $next_x, $next_y, $this->arrColor[$line_no]);
+			}
+		}
+	}
+	
+	// ¥Þ¡¼¥¯¤òÉÁ²è¤¹¤ë
+	function drawMark($line_no) {
+		$arrPointList = $this->arrPointList[$line_no];
+		$count = count($arrPointList);
+		for($i = 0; $i < $count; $i++) {
+			$x = $arrPointList[$i][0];
+			$y = $arrPointList[$i][1];			
+			$this->setMark($line_no, $x, $y);
+		}
+	}
+	
+	// ¥é¥Ù¥ë¤òÉÁ²è¤¹¤ë
+	function drawLabel($line_no) {
+		$arrData = $this->arrDataList[$line_no];
+		$arrPointList = $this->arrPointList[$line_no];
+		$count = count($arrPointList);
+		for($i = 0; $i < $count; $i++) {
+			$x = $arrPointList[$i][0];
+			$y = $arrPointList[$i][1];
+			$text_width = $this->getTextWidth(number_format($arrData[$i]), FONT_SIZE);
+			$y_pos = $y - FONT_SIZE - 5;
+			$x_pos = $x - $text_width / 2;
+			$this->setText(FONT_SIZE, $x_pos, $y_pos, number_format($arrData[$i]));
+		}
+	}
+	
+	// ¥Ç¡¼¥¿¤ò¥»¥Ã¥È¤¹¤ë
+	function setData($arrData) {
+		$this->arrDataList[$this->line_max] = array_values((array)$arrData);
+		$this->setMax($this->arrDataList[$this->line_max]);
+		// ÃÍ¤ÎÉÁ²èÊÑ´¹Î¨
+		$rate = $this->area_height / $this->graph_max;
+		// ÉÁ²èÎ¨¤ò·×»»
+		$count = count($this->arrDataList[$this->line_max]);
+		$scale_width = $this->area_width / ($count + 1);		
+		$this->arrPointList[$this->line_max] = array();
+		for($i = 0; $i < $count; $i++) {
+			// XºÂÉ¸¤òµá¤á¤ë
+			$x = intval($this->left + ($scale_width * ($i + 1)));
+			// YºÂÉ¸¤òµá¤á¤ë
+			$y = intval($this->top + $this->area_height - ($this->arrDataList[$this->line_max][$i] * $rate));
+			// XYºÂÉ¸¤òÊÝÂ¸¤¹¤ë
+			$this->arrPointList[$this->line_max][] = array($x, $y);
+		}
+		$this->line_max++;
+	}
+	
+	// X¼´¥é¥Ù¥ë¤ò¥»¥Ã¥È¤¹¤ë
+	function setXLabel($arrXLabel) {
+		$this->arrXLabel = array_values((array)$arrXLabel);
+	}
+	
+	// X¼´¥¿¥¤¥È¥ë¤ò¥»¥Ã¥È¤¹¤ë
+	function setXTitle($title) {
+		$this->XTitle = $title;
+	}
+	
+	// Y¼´¥¿¥¤¥È¥ë¤ò¥»¥Ã¥È¤¹¤ë
+	function setYTitle($title) {
+		$this->YTitle = $title;
+	}	
+}
+?>
Index: temp/trunk/html/test/naka/class/SC_GraphBase.php
===================================================================
--- temp/trunk/html/test/naka/class/SC_GraphBase.php	(revision 1694)
+++ temp/trunk/html/test/naka/class/SC_GraphBase.php	(revision 1694)
@@ -0,0 +1,209 @@
+<?php
+
+$SC_GRAPHPIE_DIR = realpath(dirname( __FILE__));
+require_once($SC_GRAPHPIE_DIR . "/config.php");
+require_once($SC_GRAPHPIE_DIR . "/lib.php");	
+
+// SC_Graph¶¦ÄÌ¥¯¥é¥¹
+class SC_GraphBase {
+	var $arrRGB;
+	var $arrColor;
+	var $arrDarkColor;
+	var $image;
+	var $left;
+	var $top;
+	var $shade_color;
+	var $flame_color;
+	var $shade_on;
+	var $text_color;
+	var $labelbg_color;
+	var $bgw;
+	var $bgh;
+	var $clabelbg_color;
+	var $title_color;
+	var $text_top;
+	var $mark_color;
+	var $arrLegend;
+	
+	// ¥³¥ó¥¹¥È¥é¥¯¥¿
+	function SC_GraphBase($bgw = BG_WIDTH, $bgh = BG_HEIGHT, $left, $top) {
+		global $ARR_GRAPH_RGB;
+		global $ARR_BG_COLOR;
+		global $ARR_SHADE_COLOR;
+		global $ARR_FLAME_COLOR;
+		global $ARR_TEXT_COLOR;
+		global $ARR_LABELBG_COLOR;
+		global $ARR_LEGENDBG_COLOR;
+		global $ARR_TITLE_COLOR;
+		global $ARR_GRID_COLOR;
+		
+		// ²èÁüºîÀ®
+		$this->bgw = $bgw;
+		$this->bgh = $bgh;	
+		$this->image = imagecreatetruecolor($bgw, $bgh);
+		// ¥¢¥ó¥Á¥¨¥¤¥ê¥¢¥¹Í­¸ú
+		imageantialias($this->image, true);
+		// ÇØ·Ê¿§¤ò¥»¥Ã¥È
+		imagefill($this->image, 0, 0, lfGetImageColor($this->image, $ARR_BG_COLOR));
+		// »ÈÍÑ¿§¤ÎÀ¸À®
+		$this->setColorList($ARR_GRAPH_RGB);
+		// ¥°¥é¥ÕÉÁ²è°ÌÃÖ¤ÎÀßÄê
+		$this->left = $left;
+		$this->top = $top;
+		$this->shade_color = lfGetImageColor($this->image, $ARR_SHADE_COLOR);
+		$this->flame_color = lfGetImageColor($this->image, $ARR_FLAME_COLOR);
+		$this->text_color = lfGetImageColor($this->image, $ARR_TEXT_COLOR);
+		$this->labelbg_color = lfGetImageColor($this->image, $ARR_LABELBG_COLOR);
+		$this->clabelbg_color = lfGetImageColor($this->image, $ARR_LEGENDBG_COLOR);
+		$this->title_color = lfGetImageColor($this->image, $ARR_TITLE_COLOR);
+		$this->grid_color = lfGetImageColor($this->image, $ARR_GRID_COLOR);
+			
+		// ±Æ¤¢¤ê
+		$this->shade_on = true;
+    }
+	
+	// ¥ª¥Ö¥¸¥§¥¯¥È¥«¥é¡¼¤ÎÀßÄê
+	function setColorList($arrRGB) {
+		$this->arrRGB = $arrRGB;
+		$count = count($this->arrRGB);
+		// ÄÌ¾ï¿§¤ÎÀßÄê
+		for($i = 0; $i < $count; $i++) {
+			$this->arrColor[$i] = lfGetImageColor($this->image, $this->arrRGB[$i]);
+		}
+		// °Å¿§¤ÎÀßÄê
+		for($i = 0; $i < $count; $i++) {
+			$this->arrDarkColor[$i] = lfGetImageDarkColor($this->image, $this->arrRGB[$i]);
+		}		
+	}
+	
+	// ±Æ¤Î¤¢¤ê¤Ê¤·
+	function setShadeOn($shade_on) {
+		$this->shade_on = $shade_on;
+	}
+	
+	// ²èÁü¤ò½ÐÎÏ¤¹¤ë
+	function outputGraph($header = true) {
+		if($header) {
+			header('Content-type: image/png');
+		}
+		imagepng($this->image);
+		imagedestroy($this->image);
+	}
+	
+	// ÉÁ²è»þ¤Î¥Æ¥­¥¹¥ÈÉý¤òµá¤á¤ë
+	function getTextWidth($text, $font_size) {
+		$text_len = strlen($text);
+		$ret = $font_size * $text_len * TEXT_RATE;	
+		/*
+			¢¨Àµ³Î¤ÊÃÍ¤¬¼èÆÀ¤Ç¤­¤Ê¤«¤Ã¤¿¤Î¤ÇÇÑ»ß
+			// ¥Æ¥­¥¹¥ÈÉý¤Î¼èÆÀ
+			$arrPos = imagettfbbox($font_size, 0, FONT_PATH, $text);
+			$ret = $arrPos[2] - $arrPos[0];
+		*/
+		return $ret;
+	}
+	
+	// ¥Æ¥­¥¹¥È¤ò½ÐÎÏ¤¹¤ë
+	function setText($font_size, $left, $top, $text, $color = NULL, $angle = 0, $labelbg = false) {
+		// »þ·×²ó¤ê¤Ë³ÑÅÙ¤òÊÑ¹¹
+		$angle = -$angle;		
+		// ¥é¥Ù¥ëÇØ·Ê
+		if($labelbg) {
+			$text_width = $this->getTextWidth($text, $font_size);
+			imagefilledrectangle($this->image, $left - 2, $top - 2, $left + $text_width + 2, $top + $font_size + 2, $this->labelbg_color);
+		}
+		$text = mb_convert_encoding($text, "UTF-8", "EUC-JP");
+		if($color != NULL) {
+			ImageTTFText($this->image, $font_size, $angle, $left, $top + $font_size, $color, FONT_PATH, $text);
+		} else {
+			ImageTTFText($this->image, $font_size, $angle, $left, $top + $font_size, $this->text_color, FONT_PATH, $text);			
+		}
+	}
+	
+	// ¥¿¥¤¥È¥ë¤ò½ÐÎÏ¤¹¤ë
+	function drawTitle($text, $font_size = TITLE_FONT_SIZE) {
+		// ½ÐÎÏ°ÌÃÖ¤Î»»½Ð
+		$text_width = $this->getTextWidth($text, $font_size);
+		$left = ($this->bgw - $text_width) / 2;
+		$top = TITLE_TOP;
+		$this->setText($font_size, $left, $top, $text, $this->title_color);		
+	}
+	
+	// ¥í¥°¤ò½ÐÎÏ¤¹¤ë
+	function debugPrint($text) {
+		$text = mb_convert_encoding($text, "UTF-8", "EUC-JP");
+		if(!isset($this->text_top)) {
+			$this->text_top = FONT_SIZE + LINE_PAD;
+		}		
+		// ¥Æ¥­¥¹¥ÈÉÁ²è
+		ImageTTFText($this->image, FONT_SIZE, 0, LINE_PAD, $this->text_top, $this->text_color, FONT_PATH, $text);
+		$this->text_top += FONT_SIZE + LINE_PAD;
+	}
+		
+	// ¥«¥é¡¼¥é¥Ù¥ë¤òÉÁ²è
+	function drawLegend($legend_max = "", $clabelbg = true) {
+		// ËÞÎã¤¬ÅÐÏ¿¤µ¤ì¤Æ¤¤¤Ê¤±¤ì¤ÐÃæ»ß
+		if(count($this->arrLegend) <= 0) {
+			return;
+		}		
+		
+		if($legend_max != "") {
+			$label_max = $legend_max;
+		} else {
+			$label_max = count($this->arrLegend);
+		}
+
+		$height_max = 0;
+		$text_max = 0;
+		$width_max = 0;
+		
+		// °ìÈÖÊ¸»ú¿ô¤¬Â¿¤¤¤â¤Î¤ò¼èÆÀ
+		for($i = 0; $i < $label_max; $i++) {
+			$text_len = strlen($this->arrLegend[$i]);
+			if($text_max < $text_len) {
+				$text_max = $text_len;
+			}
+			$height_max += FONT_SIZE + LINE_PAD;
+		}
+		$width_max = FONT_SIZE * $text_max * TEXT_RATE;		
+
+		// 	¥«¥é¡¼¥¢¥¤¥³¥ó¤ÈÊ¸»ú´Ö¤ò´Þ¤á¤¿Éý
+		$width_max += FONT_SIZE + (LINE_PAD * 2);	
+		$left = $this->bgw - $width_max - LEGEND_RIGHT;
+		$top = LEGEND_TOP;
+		// ¥«¥é¡¼¥é¥Ù¥ëÇØ·Ê¤ÎÉÁ²è
+		if($clabelbg) {
+			$this->drawClabelBG($left - LINE_PAD, $top, $left + $width_max, $top + $height_max + LINE_PAD);
+		}
+		$top += LINE_PAD;
+				
+		// ¿§¿ô¤Î¼èÆÀ
+		$c_max = count($this->arrColor);
+		for($i = 0; $i < $label_max; $i++) {			
+			// ¥«¥é¡¼¥¢¥¤¥³¥ó¤ÎÉ½¼¨
+			imagerectangle($this->image, $left, $top, $left + FONT_SIZE, $top + FONT_SIZE, $this->flame_color);
+			imagefilledrectangle($this->image, $left + 1, $top + 1, $left + FONT_SIZE - 1, $top + FONT_SIZE - 1, $this->arrColor[($i % $c_max)]);
+			// ¥é¥Ù¥ë¤ÎÉ½¼¨
+			$this->setText(FONT_SIZE, $left + FONT_SIZE + LINE_PAD, $top, $this->arrLegend[$i]);
+			$top += FONT_SIZE + LINE_PAD;
+		}
+	}
+	
+	// ¥«¥é¡¼¥é¥Ù¥ëÇØ·Ê¤ÎÉÁ²è
+	function drawClabelBG($left, $top, $right, $bottom) {
+		// ±Æ¤ÎÉÁ²è
+		if($this->shade_on) {
+			imagefilledrectangle($this->image, $left + 2, $top + 2, $right + 2, $bottom + 2, $this->shade_color);
+		}
+		// ¥«¥é¡¼¥é¥Ù¥ëÇØ·Ê¤ÎÉÁ²è
+		imagefilledrectangle($this->image, $left, $top, $right, $bottom, $this->clabelbg_color);
+		imagerectangle($this->image, $left, $top, $right, $bottom, $this->flame_color);
+	}
+	
+	// ËÞÎã¤ò¥»¥Ã¥È¤¹¤ë
+	function setLegend($arrLegend) {
+		$this->arrLegend = array_values((array)$arrLegend);
+	}
+}
+
+?>
Index: temp/trunk/html/test/naka/class/SC_GraphPie.php
===================================================================
--- temp/trunk/html/test/naka/class/SC_GraphPie.php	(revision 1694)
+++ temp/trunk/html/test/naka/class/SC_GraphPie.php	(revision 1694)
@@ -0,0 +1,192 @@
+<?php
+
+$SC_GRAPHPIE_DIR = realpath(dirname( __FILE__));
+require_once($SC_GRAPHPIE_DIR . "/SC_GraphBase.php");	
+
+// ±ß¥°¥é¥ÕÀ¸À®¥¯¥é¥¹
+class SC_GraphPie extends SC_GraphBase{
+	var $cw;
+	var $ch;
+	var $cz;
+	var $cx;
+	var $cy;
+	var $arrLabel;
+	var $arrData;
+	
+    // ¥³¥ó¥¹¥È¥é¥¯¥¿
+	function SC_GraphPie($bgw = BG_WIDTH, $bgh = BG_HEIGHT, $left = PIE_LEFT, $top = PIE_TOP) {
+		parent::SC_GraphBase($bgw, $bgh, $left, $top);
+		// ¥µ¥¤¥ºÀßÄê
+		$this->setSize(PIE_WIDTH, PIE_HEIGHT, PIE_THICK);
+		// °ÌÃÖÀßÄê
+		$this->setPosition($this->left + ($this->cw / 2), $this->top + ($this->ch / 2));
+    }
+	
+	// ¥Ç¡¼¥¿¤ò360¡ëÃÍ¤ËÊÑ´¹¤¹¤ë
+	function getCircleData($array) {
+		if(!is_array($array)) {
+			return;
+		}
+		$arrRet = array();
+		foreach($array as $val) {
+			$total += $val;			
+		}
+		if($total <= 0) {
+			return;
+		}		
+		$rate = 360 / $total;
+		// ¥é¥Ù¥ëÉ½¼¨ÍÑ
+		$p_rate = 100 / $total;
+		$cnt = 0;
+		foreach($array as $val) {
+			$ret = round($val * $rate);
+			$new_total+= $ret;
+			$arrRet[] = $ret;
+			// ¥Ñ¡¼¥»¥ó¥ÈÉ½¼¨ÍÑ
+			$this->arrLabel[] = round($val * $p_rate) . " %";
+			$cnt++;
+		}
+		// ¹ç·×¤¬360¤Ë¤Ê¤ë¤è¤¦¤ËÊäÀµ¤·¤Æ¤ª¤¯
+		$arrRet[0] -= $new_total - 360;
+		return $arrRet;
+	}	
+		
+	// ±ß¤Î°ÌÃÖÀßÄê¤ò¹Ô¤¦
+	function setPosition($cx, $cy) {
+		$this->cx = $cx;
+		$this->cy = $cy;
+	}
+		
+	// ±ß¤Î¥µ¥¤¥ºÀßÄê¤ò¹Ô¤¦
+	function setSize($cw, $ch, $cz = 0) {
+		$this->cw = $cw;
+		$this->ch = $ch;
+		$this->cz = $cz;
+	}
+	
+	// ±Æ¤ÎÉÁ²è
+	function drawShade() {
+		$move = 1;
+		for($i = ($this->cy + $this->cz); $i <= ($this->cy + $this->cz + ($this->cz * PIE_SHADE_IMPACT)); $i++) {
+			imagefilledarc($this->image, $this->cx + $move, $i, $this->cw, $this->ch, 0, 360, $this->shade_color, IMG_ARC_PIE);
+			$move += 0.5;
+		}
+	}
+	
+	// ¥Ç¡¼¥¿¤ò¥»¥Ã¥È¤¹¤ë
+	function setData($arrData) {
+		$this->arrData = array_values($arrData);
+	}
+	
+	// ±ß¥°¥é¥Õ¤òÉÁ²è¤¹¤ë
+	function drawGraph() {
+		$x = $this->cx;
+		$y = $this->cy;
+		$z = $this->cz;
+		$h = $this->ch;
+		$w = $this->cw;
+		
+		$arrRad = $this->getCircleData($this->arrData);
+		$rd_max = count($arrRad);
+		
+		// ¥Ç¡¼¥¿¤¬Â¸ºß¤·¤Ê¤¤¾ì¹ç
+		if($rd_max <= 0) {
+			return;
+		}
+		
+		// ±Æ¤ÎÉÁ²è
+		if($this->shade_on) {
+			$this->drawShade();
+		}
+			
+		// ¿§¿ô¤Î¼èÆÀ
+		$c_max = count($this->arrColor);
+		$dc_max = count($this->arrDarkColor);
+		
+		// Â¦ÌÌ¤ÎÉÁ²è		
+		for ($i = ($y + $z - 1); $i >= $y; $i--) {
+			$start = 0;
+			for($j = 0; $j < $rd_max; $j++) {
+				$end = $start + $arrRad[$j];
+				if($start == 0 && $end == 360) {
+					// -90¢·270¤Ç»ØÄê¤¹¤ë¤È±ß¤¬ÉÁ²è¤Ç¤­¤Ê¤¤¤Î¤Ç0¢·360¤Ë»ØÄê
+					imagearc($this->image, $x, $i, $w, $h, 0, 360, $this->arrDarkColor[($j % $dc_max)]);
+				} else {
+					// -90¡ë¤Ï12»þ¤Î°ÌÃÖ¤«¤é³«»Ï¤¹¤ë¤è¤¦¤ËÊäÀµ¤·¤Æ¤¤¤ë
+					imagearc($this->image, $x, $i, $w, $h, $start - 90, $end - 90, $this->arrDarkColor[($j % $dc_max)]);	
+				}			
+				$start = $end;
+			}
+		}
+		// ÄìÌÌ¤ÎÉÁ²è
+		imagearc($this->image, $x, $y + $z, $w, $h, 0, 180 , $this->flame_color);
+
+		// ¾åÌÌ¤ÎÉÁ²è
+		$start = 0;
+		for($i = 0; $i < $rd_max; $i++) {
+			$end = $start + $arrRad[$i];
+			if($start == 0 && $end == 360) {
+				// -90¢·270¤Ç»ØÄê¤¹¤ë¤È±ß¤¬ÉÁ²è¤Ç¤­¤Ê¤¤¤Î¤Ç0¢·360¤Ë»ØÄê
+				imagefilledarc($this->image, $x, $y, $w, $h, 0, 360, $this->arrColor[($i % $c_max)], IMG_ARC_PIE);			
+			} else {
+				// -90¡ë¤Ï12»þ¤Î°ÌÃÖ¤«¤é³«»Ï¤¹¤ë¤è¤¦¤ËÊäÀµ¤·¤Æ¤¤¤ë¡£		
+				imagefilledarc($this->image, $x, $y, $w, $h, $start - 90, $end - 90, $this->arrColor[($i % $c_max)], IMG_ARC_PIE);
+			}
+			$start = $end;
+		}
+
+		// ¾åÌÌ¤Î±ï¼è¤ê
+		$start = 0;
+		for($i = 0; $i < $rd_max; $i++) {
+			$end = $start + $arrRad[$i];
+			if($start == 0 && $end == 360) {
+				// -90¢·270¤Ç»ØÄê¤¹¤ë¤È±ß¤¬ÉÁ²è¤Ç¤­¤Ê¤¤¤Î¤Ç0¢·360¤Ë»ØÄê
+				imagearc($this->image, $x, $y, $w, $h, 0, 360 , $this->flame_color);
+			}
+			// -90¡ë¤Ï12»þ¤Î°ÌÃÖ¤«¤é³«»Ï¤¹¤ë¤è¤¦¤ËÊäÀµ¤·¤Æ¤¤¤ë¡£
+			imagefilledarc($this->image, $x, $y, $w, $h, $start - 90, $end - 90, $this->flame_color, IMG_ARC_EDGED|IMG_ARC_NOFILL);
+			$start = $end;
+		}
+
+		// Â¦ÌÌ¤Î±ï¼è¤ê
+		imageline($this->image, $x + ($w / 2), $y, $x + ($w / 2), $y + $z, $this->flame_color);
+		imageline($this->image, $x - ($w / 2), $y, $x - ($w / 2), $y + $z, $this->flame_color);
+		$start = 0;
+		for($i = 0; $i < $rd_max; $i++) {
+			$end = $start + $arrRad[$i];
+			// Á°ÌÌ¤Î¤ß
+			if($end > 90 && $end < 270) {
+				list($ax, $ay) = lfGetArcPos($x, $y, $w, $h, $end);
+				// ¥é¥¤¥ó¤Î¤º¤ì¤òÊäÀµ¤¹¤ë
+				if($end > 180) {
+					$ax = $ax + 1;
+				}
+				imageline($this->image, $ax, $ay, $ax, $ay + $z, $this->flame_color);
+			}
+			$start = $end;	
+		}
+				
+		// ¥é¥Ù¥ë¤ÎÉÁ²è
+		$this->drawLabel($arrRad);
+		// ËÞÎã¤ÎÉÁ²è
+		$this->drawLegend(count($this->arrData));			
+	}
+	
+	// ±ß¥°¥é¥Õ¤Î¥é¥Ù¥ë¤òÉÁ²è¤¹¤ë
+	function drawLabel($arrRad) {
+		$rd_max = count($arrRad);
+		$start = 0;
+		for($i = 0; $i < $rd_max; $i++) {
+			$center = $start + ($arrRad[$i] / 2);
+			$end = $start + $arrRad[$i];
+			list($sx, $sy) = lfGetArcPos($this->cx, $this->cy, ($this->cw / 1.5), ($this->ch / 1.5), $center);
+			list($ex, $ey) = lfGetArcPos($this->cx, $this->cy, ($this->cw * 1.5), ($this->ch * 1.5), $center);
+			// »Ø¼¨Àþ¤ÎÉÁ²è
+			imageline($this->image, $sx, $sy, $ex + 2, $ey - PIE_LABEL_UP, $this->flame_color);
+			$this->setText(FONT_SIZE, $ex - 10, $ey - PIE_LABEL_UP - FONT_SIZE, $this->arrLabel[$i], NULL, 0, true);
+			$start = $end;
+		}
+	}	
+}
+
+?>
Index: temp/trunk/html/test/naka/class/config.php
===================================================================
--- temp/trunk/html/test/naka/class/config.php	(revision 1694)
+++ temp/trunk/html/test/naka/class/config.php	(revision 1694)
@@ -0,0 +1,93 @@
+<?php
+
+/*
+	¶¦ÄÌ 
+*/
+// TTF¥Õ¥©¥ó¥È¥Õ¥¡¥¤¥ë
+define("FONT_PATH", "/home/web/os-test.lockon.co.jp/data/fonts/ipag.ttf");
+define("FONT_SIZE", 8);			// ¥Õ¥©¥ó¥È¥µ¥¤¥º
+define("TITLE_FONT_SIZE", 10);	// ¥¿¥¤¥È¥ë¥Õ¥©¥ó¥È¥µ¥¤¥º
+define("BG_WIDTH", 720);		// ÇØ·ÊÉý
+define("BG_HEIGHT", 400);		// ÇØ·Ê¹â¤µ
+define("LINE_PAD", 5);			// ¹Ô´Ö
+define("TEXT_RATE", 0.75);		// ¥Õ¥©¥ó¥ÈÊäÀµÃÍ(¼ÂºÝ¤ÎÉÁ²èÉý/¥Õ¥©¥ó¥È¥µ¥¤¥º)
+
+/*
+	±ß¥°¥é¥Õ
+*/
+define("PIE_LEFT", 200);			// ±ß¥°¥é¥Õ°ÌÃÖ
+define("PIE_TOP", 150);				// ±ß¥°¥é¥Õ°ÌÃÖ
+define("PIE_WIDTH", 230);			// ±ß¥°¥é¥ÕÉý
+define("PIE_HEIGHT", 100);			// ±ß¥°¥é¥Õ¹â¤µ
+define("PIE_THICK", 100);			// ±ß¥°¥é¥ÕÂÀ¤µ
+define("PIE_LABEL_UP", 20);			// ±ß¥°¥é¥Õ¤Î¥é¥Ù¥ë°ÌÃÖ¤ò¾å¤Ë¤¢¤²¤ë
+define("PIE_SHADE_IMPACT", 0.3);	// ÃÍ¤¬Âç¤­¤¤¤Û¤É±Æ¤¬Ä¹¤¯¤Ê¤ë
+
+/*
+	ÀÞ¤ìÀþ¥°¥é¥Õ
+*/
+define("LINE_Y_SCALE", 10);			// Y¼´¤ÎÌÜÀ¹¤ê¿ô
+define("LINE_X_SCALE", 10);			// X¼´¤ÎÌÜÀ¹¤ê¿ô
+define("LINE_LEFT", 60);			// Àþ¥°¥é¥Õ°ÌÃÖ
+define("LINE_TOP", 50);				// Àþ¥°¥é¥Õ°ÌÃÖ
+define("LINE_AREA_WIDTH", 600);		// Àþ¥°¥é¥ÕÇØ·Ê¤Î¥µ¥¤¥º
+define("LINE_AREA_HEIGHT", 300);	// Àþ¥°¥é¥ÕÇØ·Ê¤Î¥µ¥¤¥º
+define("LINE_MARK_SIZE", 6);		// Àþ¥°¥é¥Õ¥Þ¡¼¥¯¤Î¥µ¥¤¥º
+define("LINE_SCALE_SIZE", 6);		// ÌÜÀ¹¤êÉý
+define("LINE_XLABEL_MAX", 30);		// X¼´¤Î¥é¥Ù¥ë¤ÎÉ½¼¨À©¸Â¿ô
+define("LINE_XTITLE_PAD", 25);		// X¼´¤Î¥¿¥¤¥È¥ë¤È¼´¤Î´Ö³Ö
+define("LINE_YTITLE_PAD", 15);		// Y¼´¤Î¥¿¥¤¥È¥ë¤È¼´¤Î´Ö³Ö
+
+/* 
+	ËÀ¥°¥é¥Õ
+*/
+define("BAR_PAD", 6);				// ¥°¥é¥Õ¤ÈÌÜÀ¹¤ê¤Î´Ö³Ö
+
+/*
+	¥¿¥¤¥È¥ë¥é¥Ù¥ë
+*/
+define("TITLE_TOP", 10);	// ÇØ·ÊÏÈ¤È¤Î¾åÉý
+
+/*
+	ËÞÎã
+*/
+define("LEGEND_TOP", 10); 	// ÇØ·ÊÏÈ¤È¤Î¾åÉý
+define("LEGEND_RIGHT", 10); // ÇØ·ÊÏÈ¤È¤Î±¦Éý
+
+
+/*
+	É½¼¨¿§
+*/
+// ËÞÎãÇØ·Ê
+$ARR_LEGENDBG_COLOR = array(245,245,245);
+// ¥é¥Ù¥ëÇØ·Ê
+$ARR_LABELBG_COLOR = array(255,255,255);
+// ¥°¥é¥Õ¥«¥é¡¼
+$ARR_GRAPH_RGB = array(
+	array(200,50,50),
+	array(50,50,200),
+	array(50,200,50),
+	array(255,255,255),
+	array(244,200,200),
+	array(200,200,255),
+	array(50,200,50),
+	array(255,255,255),
+	array(244,244,244),
+);
+// ±Æ¤Î¿§
+$ARR_SHADE_COLOR = array(100,100,100);
+// ±ï¤Î¿§
+$ARR_FLAME_COLOR = array(100, 100, 140);
+// Ê¸»ú¿§
+$ARR_TEXT_COLOR = array(0, 0, 0);
+// ÇØ·Ê¥«¥é¡¼
+$ARR_BG_COLOR = array(255,252,232);	
+// ¥¿¥¤¥È¥ëÊ¸»ú¿§
+$ARR_TITLE_COLOR = array(100, 50, 50);
+// ¥°¥ê¥Ã¥ÉÀþ¿§
+$ARR_GRID_COLOR = array(200, 200, 200);
+// ¥Þ¡¼¥¯¤Î¿§
+$ARR_MARK_COLOR = array(130, 130, 255);
+
+
+?>
Index: temp/trunk/html/test/naka/test.php
===================================================================
--- temp/trunk/html/test/naka/test.php	(revision 1694)
+++ temp/trunk/html/test/naka/test.php	(revision 1694)
@@ -0,0 +1,81 @@
+<?php
+
+require_once("../../require.php");
+
+sfGetParentsArray("dtb_category","parent_category_id", "category_id", 230);
+sfGetChildrenArray("dtb_category","parent_category_id", "category_id", 6);
+
+/* ³¬ÁØ¹½Â¤¤Î¥Æ¡¼¥Ö¥ë¤«¤é»ÒIDÇÛÎó¤ò¼èÆÀ¤¹¤ë */
+function sfGetChildrenArray($table, $pid_name, $id_name, $id) {
+	$objQuery = new SC_Query();
+	$col = $pid_name . "," . $id_name;
+ 	$arrData = $objQuery->select($col, $table);
+	
+	$arrPID = array();
+	$arrPID[] = $id;
+	$arrChildren = array();
+	$arrChildren[] = $id;
+	
+	$arrRet = sfGetChildrenArraySub($arrData, $pid_name, $id_name, $arrPID);
+	
+	while(count($arrRet) > 0) {
+		$arrChildren = array_merge($arrChildren, $arrRet);
+		$arrRet = sfGetChildrenArraySub($arrData, $pid_name, $id_name, $arrRet);
+	}
+	
+	return $arrChildren;
+}
+
+/* ¿ÆIDÄ¾²¼¤Î»ÒID¤ò¤¹¤Ù¤Æ¼èÆÀ¤¹¤ë */
+function sfGetChildrenArraySub($arrData, $pid_name, $id_name, $arrPID) {
+	$arrChildren = array();
+	$max = count($arrData);
+	
+	for($i = 0; $i < $max; $i++) {
+		foreach($arrPID as $val) {
+			if($arrData[$i][$pid_name] == $val) {
+				$arrChildren[] = $arrData[$i][$id_name];
+			}
+		}
+	}
+	return $arrChildren;
+}
+
+
+/* ³¬ÁØ¹½Â¤¤Î¥Æ¡¼¥Ö¥ë¤«¤é¿ÆIDÇÛÎó¤ò¼èÆÀ¤¹¤ë */
+function sfGetParentsArray($table, $pid_name, $id_name, $id) {
+	$objQuery = new SC_Query();
+	$col = $pid_name . "," . $id_name;
+ 	$arrData = $objQuery->select($col, $table);
+	
+	$arrParents = array();
+	$arrParents[] = $id;
+	$child = $id;
+	
+	$ret = sfGetParentsArraySub($arrData, $pid_name, $id_name, $child);
+	
+	while($ret != "") {
+		$arrParents = array_merge($arrParents, $ret);
+		$ret = sfGetParentsArraySub($arrData, $pid_name, $id_name, $ret);
+	}
+	
+	$arrParents = array_reverse($arrParents);
+	
+	return $arrParents;
+}
+
+/* »ÒID½êÂ°¤¹¤ë¿ÆID¤ò¼èÆÀ¤¹¤ë */
+function sfGetParentsArraySub($arrData, $pid_name, $id_name, $child) {
+	$max = count($arrData);
+	$parent = "";
+	for($i = 0; $i < $max; $i++) {
+		if($arrData[$i][$id_name] == $child) {
+			$parent = $arrData[$i][$pid_name];
+			break;
+		}
+	}
+	return $parent;
+}
+
+
+?>
Index: temp/trunk/html/test/naka/flush.php
===================================================================
--- temp/trunk/html/test/naka/flush.php	(revision 1694)
+++ temp/trunk/html/test/naka/flush.php	(revision 1694)
@@ -0,0 +1,11 @@
+<?php
+
+print("test");
+flush();
+
+sleep(2);
+
+print("aa");
+flush();
+
+?>
Index: temp/trunk/html/test/naka/tool/file.php
===================================================================
--- temp/trunk/html/test/naka/tool/file.php	(revision 1694)
+++ temp/trunk/html/test/naka/tool/file.php	(revision 1694)
@@ -0,0 +1,24 @@
+<?php
+
+$fp = fopen("test.txt", 'r');
+while (!feof($fp)) {
+	$ret = fgets($fp, 1024);
+	$ret = ereg_replace("\n", "", $ret);
+	
+	if($ret != "" && !ereg("^-", $ret)) {
+		print("#$ret\n");
+		print("define host {\n");
+		print("\tuse\tgeneric-host\n");
+		print("\thost_name\t$ret\n");
+		print("\talias\t$ret\n");
+		print("\taddress\t$ret\n");
+		print("}\n");
+		print("\n");
+		$line.= $ret . ",";		
+	}
+}
+fclose($fp);
+
+print($line);
+
+?>
Index: temp/trunk/html/test/naka/tool/test.txt
===================================================================
--- temp/trunk/html/test/naka/tool/test.txt	(revision 1694)
+++ temp/trunk/html/test/naka/tool/test.txt	(revision 1694)
@@ -0,0 +1,159 @@
+210.188.192.1
+210.188.192.2
+210.188.192.3
+210.188.192.4
+210.188.192.5
+210.188.192.6
+-
+210.188.192.7
+210.188.192.8
+210.188.192.9
+210.188.192.10
+210.188.192.11
+210.188.192.12
+210.188.192.13
+-
+-
+-210.188.192.14
+210.188.192.15
+210.188.192.16
+-210.188.192.17
+210.188.192.18
+210.188.192.19
+-210.188.192.20
+210.188.192.21
+210.188.192.22
+210.188.192.23
+210.188.192.24
+210.188.192.25
+-210.188.192.26
+210.188.192.27
+210.188.192.28
+-210.188.192.29
+-210.188.192.30
+-
+-
+-
+-
+-
+-
+-
+
+-
+-
+210.188.212.129
+210.188.212.130
+-210.188.212.131
+-210.188.212.132
+-210.188.212.133
+210.188.212.134
+-210.188.212.135
+210.188.212.136
+210.188.212.137
+210.188.212.138
+-210.188.212.139
+-210.188.212.140
+-210.188.212.141
+-210.188.212.142
+210.188.212.143
+210.188.212.144
+-210.188.212.145
+-
+-210.188.212.146
+210.188.212.147
+-210.188.212.148
+-210.188.212.149
+210.188.212.150
+-210.188.212.151
+-210.188.212.152
+-210.188.212.153
+-210.188.212.154
+-210.188.212.155
+-210.188.212.156
+-210.188.212.157
+-210.188.212.158
+-
+210.188.212.161
+210.188.212.162
+210.188.212.163
+-210.188.212.164
+210.188.212.165
+-
+-
+-
+-
+192.168.0.5
+192.168.0.145
+192.168.0.6
+192.168.0.7
+192.168.0.8
+192.168.0.9
+192.168.0.10
+192.168.0.210
+-
+192.168.0.211
+192.168.0.201
+192.168.0.13
+-
+-192.168.0.30
+-
+192.168.0.203
+192.168.0.18
+192.168.0.19
+-
+-
+-
+-
+-
+-
+-
+-
+-
+192.168.0.202
+-
+192.168.0.101
+192.168.0.102
+-192.168.0.103
+192.168.0.104
+192.168.0.105
+
+192.168.0.121
+
+192.168.0.149
+
+-
+-
+192.168.0.131
+
+-192.168.0.133
+192.168.0.134
+-
+-
+-
+-
+192.168.0.139
+-
+192.168.0.141
+192.168.0.142
+192.168.0.143
+192.168.0.144
+192.168.0.205
+192.168.0.206
+
+192.168.0.147
+192.168.0.148
+
+
+192.168.0.207
+192.168.0.208
+192.168.0.209
+
+
+
+
+-
+-
+-
+192.168.0.163
+192.168.0.164
+-192.168.0.165
Index: temp/trunk/html/test/naka/line.php
===================================================================
--- temp/trunk/html/test/naka/line.php	(revision 1694)
+++ temp/trunk/html/test/naka/line.php	(revision 1694)
@@ -0,0 +1,132 @@
+<?php
+require_once("./class/SC_GraphPie.php");
+require_once("./class/SC_GraphLine.php");
+
+$objGraphPie = new SC_GraphPie();
+$objGraphLine = new SC_GraphLine();
+
+$arrData1 = array(
+	3250,
+	423,
+	533,
+	1158,
+	1120,
+	1300,
+	2223,
+	100,
+	250,
+	23,
+	33,
+	58,
+	120,
+	3300,
+	4223,
+	5120,
+	2300,
+	3223,
+	100,
+	4250,
+	23,
+	100
+);
+
+$arrData2 = array(
+	3300,
+	4223,
+	5120,
+	2300,
+	3223,
+	100,
+	4250,
+	23,
+	3250,
+	423,
+	533,
+	1158,
+	1120,
+	1300,
+	2223,
+	100,
+	250,
+	23,
+	33,
+	58,
+	120,
+	100
+);
+
+$arrData3 = array(
+	6223,
+	6223,
+	6223,
+	6300,
+	3223,
+	2223,
+	6300,
+	6223,
+	5120,
+	2300,
+	3223,
+	6223,
+	6223,
+	3300,
+	4223,
+	5120,
+	6300,
+	3223,
+	2223,
+	3223,
+	2223,
+);
+
+$arrXLabel = array(
+	'1·î',
+	'2·î',
+	'3·î',
+	'4·î',
+	'5·î',
+	'6·î',
+	'7·î',
+	'1·î',
+	'2·î',
+	'3·î',
+	'4·î',
+	'5·î',
+	'6·î',
+	'7·î',	
+	'1·î',
+	'2·î',
+	'3·î',
+	'4·î',
+	'5·î',
+	'6·î',
+	'7·î',
+	'1·î',
+	'2·î',
+	'3·î',
+	'4·î',
+	'5·î',
+	'6·î',
+	'7·î',
+	'8·î'
+);
+
+$arrLegend = array(
+	'»î¸³1',
+	'»î¸³2',
+	'»î¸³3'
+);
+
+// ¥°¥é¥ÕÉÁ²è
+$objGraphLine->setXLabel($arrXLabel);
+$objGraphLine->setXTitle("´ü´Ö(·î)");
+$objGraphLine->setYTitle("Çä¾å¤²(±ß)");
+$objGraphLine->setData($arrData1);
+//$objGraphLine->setData($arrData2);
+//$objGraphLine->setData($arrData3);
+// ËÞÎã¤ò¥»¥Ã¥È¤¹¤ë
+$objGraphLine->setLegend($arrLegend);
+$objGraphLine->drawGraph();
+$objGraphLine->outputGraph();
+
+?>
Index: temp/trunk/html/test/naka/info.php
===================================================================
--- temp/trunk/html/test/naka/info.php	(revision 1694)
+++ temp/trunk/html/test/naka/info.php	(revision 1694)
@@ -0,0 +1,3 @@
+<?php
+	phpinfo();
+?>
Index: temp/trunk/html/test/naka/image/test.php
===================================================================
--- temp/trunk/html/test/naka/image/test.php	(revision 1694)
+++ temp/trunk/html/test/naka/image/test.php	(revision 1694)
@@ -0,0 +1,26 @@
+<?php
+header("Content-type: image/jpeg");
+$im  = imagecreatetruecolor(200, 200);
+$w   = imagecolorallocate($im, 255, 255, 255);
+$red = imagecolorallocate($im, 255, 0, 0);
+
+/* 5 ¥Ô¥¯¥»¥ë¤ÎÀÖÀþ¤È 5 ¥Ô¥¯¥»¥ë¤ÎÇòÀþ¤ÎÇËÀþ¤òÉÁ²è¤¹¤ë */
+$style = array($red, $red, $red, $red, $red, $w, $w, $w, $w, $w);
+imagesetstyle($im, $style);
+imageline($im, 0, 0, 100, 100, IMG_COLOR_STYLED);
+
+/*
+// imagesetstyle ¤òÊ»ÍÑ¤·¤¿ imagesetbrush() ¤ò»ÈÍÑ¤·¤Æ happy face ¤ÎÀþ¤òÉÁ²è¤¹¤ë
+$style = array($w, $w, $w, $w, $w, $w, $w, $w, $w, $w, $w, $w, $red);
+imagesetstyle($im, $style);
+
+$brush = imagecreatefrompng("http://www.libpng.org/pub/png/images/smile.happy.png");
+$w2 = imagecolorallocate($brush, 255, 255, 255);
+imagecolortransparent($brush, $w2);
+imagesetbrush($im, $brush);
+imageline($im, 100, 0, 0, 100, IMG_COLOR_STYLEDBRUSHED);
+*/
+
+imagejpeg($im);
+imagedestroy($im);
+?>
Index: temp/trunk/html/test/naka/test1.php
===================================================================
--- temp/trunk/html/test/naka/test1.php	(revision 1694)
+++ temp/trunk/html/test/naka/test1.php	(revision 1694)
@@ -0,0 +1,10 @@
+<?php
+
+require_once("../../require.php");
+
+$arrRet = sfGetChildrenArray("dtb_category","parent_category_id", "category_id", 1);
+
+sfPrintR($arrRet);
+
+
+?>
