Index: trunk/CHANGELOG
===================================================================
--- trunk/CHANGELOG	(revision 551)
+++ trunk/CHANGELOG	(revision 552)
@@ -10,11 +10,13 @@
 # = Bugfix
 ! = Update/Change
 
-------------------------------------- 2.7.0 -------------------------------------
+------------------------------------- 2.7.0 -------------------------------------
+18-Jan-2008 Thomas Hornik
++	added new module-based search-function
++	added new publish-by-date code
 17-Jan-2008 Christian Sommer
 #	fixed bug in frontend login and multiple groups (only in conjunction with E_ALL)
 !	removed the PAGE_EXTENSION from frontend login
-
 17-Jan-2008 Matthias Gallas
 #	Reintroduced changes from changeset 520 and 540 wich where overwritten 
 	by changeset 546
Index: trunk/wb/upgrade-script.php
===================================================================
--- trunk/wb/upgrade-script.php	(nonexistent)
+++ trunk/wb/upgrade-script.php	(revision 552)
@@ -0,0 +1,208 @@
+<?php
+
+// $Id: $
+
+/*
+
+ Website Baker Project <http://www.websitebaker.org/>
+ Copyright (C) 2004-2008, Ryan Djurovich
+
+ Website Baker is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ Website Baker is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Website Baker; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+*/
+
+//
+// upgrade-script for Website Baker from version 2.6.7 to 2.7
+//
+
+require('config.php');
+require(WB_PATH.'/framework/functions.php');
+
+?>
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+<title>Upgrade-Script</title>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+</head>
+<body>
+<style type="text/css">
+<!--
+*.red { background-color:#FF0000 }
+*.green { background-color:#00FF00 }
+-->
+</style>
+
+<h2>Upgrade-script</h2>
+<p>
+will upgrade Website Baker 2.6.5 / 2.6.7 to version 2.7
+</p>
+<?php
+
+$OK   = '<span class="green">OK</span>';
+$FAIL = '<span class="red">failed</span>';
+
+
+/**********************************************************
+ *  - modules-based search
+ */
+function db_add_search_key_value($key, $value) {
+	global $database; global $OK; global $FAIL;
+	$query = $database->query("SELECT value FROM ".TABLE_PREFIX."search WHERE name = '$key' LIMIT 1");
+	if($query->numRows() > 0) {
+		echo "$key: allready there. $OK.<br />";
+		return true;
+	} else {
+		$database->query("INSERT INTO D".TABLE_PREFIX."search (name,value,extra) VALUES ('$key', '$value', '')");
+		echo mysql_error()?'<br />':'';
+		$query = $database->query("SELECT value FROM ".TABLE_PREFIX."search WHERE name = '$key' LIMIT 1");
+		if($query->numRows() > 0) {
+			echo "$key: $OK.<br />";
+			return true;
+		} else {
+			echo "$key: $FAIL!<br />";
+			return false;
+		}
+	}
+}
+
+
+echo "<br /><u>Adding module_order and max_excerpt to search-table</u><br />";
+// module_order - in which order to show the search-results
+// max_excerpt - how many lines of excerpt to print per matching page
+
+$cfg = array(
+	'module_order' => 'faqbaker,manual,wysiwyg',
+	'max_excerpt' => '15'
+);
+foreach($cfg as $key=>$value) {
+	db_add_search_key_value($key, $value);
+}
+
+
+echo "<br /><u>Changing results_loop in search-table</u><br />";
+// adding [EXCERPT]
+
+$query = $database->query("SELECT value FROM ".TABLE_PREFIX."search WHERE name = 'results_loop' LIMIT 1");
+if($query->numRows() > 0) {
+	$fetch_results_loop = $query->fetchRow();
+	$string = $fetch_results_loop['value'];
+	if(preg_match("/\[EXCERPT\]/", $string)) {
+		echo "[EXCERPT] is allready there. $OK.<br />";
+	} else {
+		$string = preg_replace("/10px;\">\[DESCRIPTION\]/", "5px;\">[DESCRIPTION]", $string);
+		$string .= "<tr><td colspan=\"2\" style=\"text-align: justify; padding-bottom: 10px;\">[EXCERPT]</td></tr>";
+		$string = addslashes($string);
+		$database->query("UPDATE ".TABLE_PREFIX."search SET name='results_loop',value='".$string."',extra='' WHERE name = 'results_loop' LIMIT 1");
+		echo mysql_error().'<br />';
+		$query = $database->query("SELECT value FROM ".TABLE_PREFIX."search WHERE name = 'results_loop' LIMIT 1");
+		if($query->numRows() > 0) {
+			$fetch_results_loop = $query->fetchRow();
+			$string = $fetch_results_loop['value'];
+			if(preg_match("/\[EXCERPT\]/", $string)) {
+				echo "[EXCERPT] added. $OK.<br />";
+			} else {
+				echo "adding [EXCERPT] $FAIL!<br />";
+			}
+		}
+	}
+}
+
+echo "<br /><u>Changing \"Header:\" in search-table</u><br />";
+// adding [SEARCH_PATH]
+
+$query = $database->query("SELECT value FROM ".TABLE_PREFIX."search WHERE name = 'header' LIMIT 1");
+if($query->numRows() > 0) {
+	$fetch_header = $query->fetchRow();
+	$string = $fetch_header['value'];
+	if(preg_match("/\[SEARCH_PATH\]/", $string)) {
+		echo "[SEARCH_PATH] is allready there. $OK.<br />";
+	} else {
+		$string = preg_replace("/<input type=\"text\" name=\"string\" value=\"\[SEARCH_STRING\]\" style=\"width: 100%;\" \/>/", "<input type=\"hidden\" name=\"search_path\" value=\"[SEARCH_PATH]\" /><input type=\"text\" name=\"string\" value=\"[SEARCH_STRING]\" style=\"width: 100%;\" />", $string);
+		$string = addslashes($string);
+		$database->query("UPDATE ".TABLE_PREFIX."search SET name='header',value='".$string."',extra='' WHERE name = 'header' LIMIT 1");
+		echo mysql_error().'<br />';
+		$query = $database->query("SELECT value FROM ".TABLE_PREFIX."search WHERE name = 'header' LIMIT 1");
+		if($query->numRows() > 0) {
+			$fetch_header = $query->fetchRow();
+			$string = $fetch_header['value'];
+			if(preg_match("/\[SEARCH_PATH\]/", $string)) {
+				echo "[SEARCH_PATH] added. $OK.<br />";
+			} else {
+				echo "adding [SEARCH_PATH] $FAIL!<br />";
+			}
+		}
+	}
+}
+
+echo "<br /><u>Adding some internal config-elements to search-table</u><br />";
+// These are global config-elements which don't appear in settings-page. Change them in the database if needed.
+// cfg_show_description - whether to show page-description on the results page (true/false), def: true
+// cfg_search_description - whether to search in page-description (true/false), def: true [only used while searching title/link/description/keywords]
+// cfg_search_keywords - whether to search in page-keywords (true/false), def: true [only used while searching title/link/description/keywords]
+// cfg_enable_old_search - use old search-method, too (true/false), def: true [use old method as fallback]
+$cfg = array(
+	'cfg_show_description' => 'true',
+	'cfg_search_description' => 'true',
+	'cfg_search_keywords' => 'true',
+	'cfg_enable_old_search' => 'true'
+);
+foreach($cfg as $key=>$value) {
+	db_add_search_key_value($key, $value);
+}
+
+
+/**********************************************************
+ *  - publish-by-date
+ */
+echo "<br /><u>Adding fields 'publ_start' and 'publ_end' to table 'sections'</u><br />";
+// Add fields "publ_start" and "publ_end" to table "sections"
+// check if fields are present
+$table = TABLE_PREFIX."sections";
+$query = $database->query("DESCRIBE $table 'publ_start'");
+if($query->numRows() == 0) { // add field
+	$query = $database->query("ALTER TABLE $table ADD publ_start INT NOT NULL DEFAULT '0'");
+	$query = $database->query("DESCRIBE $table 'publ_start'");
+	if($query->numRows() > 0) {
+		echo "'publ_start' added. $OK.<br />";
+	} else {
+		echo "adding 'publ_start' $FAIL!<br />";
+	}
+} else {
+	echo "'publ_start' allready there. $OK.<br />";
+}
+$query = $database->query("DESCRIBE $table 'publ_end'");
+if($query->numRows() == 0) { // add field
+	$query = $database->query("ALTER TABLE $table ADD publ_end INT NOT NULL DEFAULT '0'");
+	$query = $database->query("DESCRIBE $table 'publ_end'");
+	if($query->numRows() > 0) {
+		echo "'publ_end' added. $OK.<br />";
+	} else {
+		echo "adding 'publ_end' $FAIL!<br />";
+	}
+} else {
+	echo "'publ_end' allready there. $OK<br />";
+}
+
+
+
+
+echo "<br /><br />Done<br />";
+
+?>
+
+</body>
+</html>

Property changes on: trunk/wb/upgrade-script.php
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: trunk/wb/include/jscalendar/img.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: trunk/wb/include/jscalendar/img.gif
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Index: trunk/wb/include/jscalendar/lang/calendar-ko-utf8.js
===================================================================
--- trunk/wb/include/jscalendar/lang/calendar-ko-utf8.js	(nonexistent)
+++ trunk/wb/include/jscalendar/lang/calendar-ko-utf8.js	(revision 552)
@@ -0,0 +1,120 @@
+// ** I18N
+
+// Calendar EN language
+// Author: Mihai Bazon, <mihai_bazon@yahoo.com>
+// Translation: Yourim Yi <yyi@yourim.net>
+// Encoding: EUC-KR
+// lang : ko
+// Distributed under the same terms as the calendar itself.
+
+// For translators: please use UTF-8 if possible.  We strongly believe that
+// Unicode is the answer to a real internationalized world.  Also please
+// include your contact information in the header, as can be seen above.
+
+// full day names
+
+Calendar._DN = new Array
+("일요일",
+ "월요일",
+ "화요일",
+ "수요일",
+ "목요일",
+ "금요일",
+ "토요일",
+ "일요일");
+
+// Please note that the following array of short day names (and the same goes
+// for short month names, _SMN) isn't absolutely necessary.  We give it here
+// for exemplification on how one can customize the short day names, but if
+// they are simply the first N letters of the full name you can simply say:
+//
+//   Calendar._SDN_len = N; // short day name length
+//   Calendar._SMN_len = N; // short month name length
+//
+// If N = 3 then this is not needed either since we assume a value of 3 if not
+// present, to be compatible with translation files that were written before
+// this feature.
+
+// short day names
+Calendar._SDN = new Array
+("일",
+ "월",
+ "화",
+ "수",
+ "목",
+ "금",
+ "토",
+ "일");
+
+// full month names
+Calendar._MN = new Array
+("1월",
+ "2월",
+ "3월",
+ "4월",
+ "5월",
+ "6월",
+ "7월",
+ "8월",
+ "9월",
+ "10월",
+ "11월",
+ "12월");
+
+// short month names
+Calendar._SMN = new Array
+("1",
+ "2",
+ "3",
+ "4",
+ "5",
+ "6",
+ "7",
+ "8",
+ "9",
+ "10",
+ "11",
+ "12");
+
+// tooltips
+Calendar._TT = {};
+Calendar._TT["INFO"] = "calendar 에 대해서";
+
+Calendar._TT["ABOUT"] =
+"DHTML Date/Time Selector\n" +
+"(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n" + // don't translate this this ;-)
+"\n"+
+"최신 버전을 받으시려면 http://www.dynarch.com/projects/calendar/ 에 방문하세요\n" +
+"\n"+
+"GNU LGPL 라이센스로 배포됩니다. \n"+
+"라이센스에 대한 자세한 내용은 http://gnu.org/licenses/lgpl.html 을 읽으세요." +
+"\n\n" +
+"날짜 선택:\n" +
+"- 연도를 선택하려면 \xab, \xbb 버튼을 사용합니다\n" +
+"- 달을 선택하려면 " + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a) + " 버튼을 누르세요\n" +
+"- 계속 누르고 있으면 위 값들을 빠르게 선택하실 수 있습니다.";
+Calendar._TT["ABOUT_TIME"] = "\n\n" +
+"시간 선택:\n" +
+"- 마우스로 누르면 시간이 증가합니다\n" +
+"- Shift 키와 함께 누르면 감소합니다\n" +
+"- 누른 상태에서 마우스를 움직이면 좀 더 빠르게 값이 변합니다.\n";
+
+Calendar._TT["PREV_YEAR"] = "지난 해 (길게 누르면 목록)";
+Calendar._TT["PREV_MONTH"] = "지난 달 (길게 누르면 목록)";
+Calendar._TT["GO_TODAY"] = "오늘 날짜로";
+Calendar._TT["NEXT_MONTH"] = "다음 달 (길게 누르면 목록)";
+Calendar._TT["NEXT_YEAR"] = "다음 해 (길게 누르면 목록)";
+Calendar._TT["SEL_DATE"] = "날짜를 선택하세요";
+Calendar._TT["DRAG_TO_MOVE"] = "마우스 드래그로 이동 하세요";
+Calendar._TT["PART_TODAY"] = " (오늘)";
+Calendar._TT["MON_FIRST"] = "월요일을 한 주의 시작 요일로";
+Calendar._TT["SUN_FIRST"] = "일요일을 한 주의 시작 요일로";
+Calendar._TT["CLOSE"] = "닫기";
+Calendar._TT["TODAY"] = "오늘";
+Calendar._TT["TIME_PART"] = "(Shift-)클릭 또는 드래그 하세요";
+
+// date formats
+Calendar._TT["DEF_DATE_FORMAT"] = "%Y-%m-%d";
+Calendar._TT["TT_DATE_FORMAT"] = "%b/%e [%a]";
+
+Calendar._TT["WK"] = "주";

Property changes on: trunk/wb/include/jscalendar/lang/calendar-ko-utf8.js
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: trunk/wb/include/jscalendar/lang/calendar-fi.js
===================================================================
--- trunk/wb/include/jscalendar/lang/calendar-fi.js	(nonexistent)
+++ trunk/wb/include/jscalendar/lang/calendar-fi.js	(revision 552)
@@ -0,0 +1,98 @@
+﻿// ** I18N
+
+// Calendar FI language (Finnish, Suomi)
+// Author: Jarno Käyhkö, <gambler@phnet.fi>
+// Encoding: UTF-8
+// Distributed under the same terms as the calendar itself.
+
+// full day names
+Calendar._DN = new Array
+("Sunnuntai",
+ "Maanantai",
+ "Tiistai",
+ "Keskiviikko",
+ "Torstai",
+ "Perjantai",
+ "Lauantai",
+ "Sunnuntai");
+
+// short day names
+Calendar._SDN = new Array
+("Su",
+ "Ma",
+ "Ti",
+ "Ke",
+ "To",
+ "Pe",
+ "La",
+ "Su");
+
+// full month names
+Calendar._MN = new Array
+("Tammikuu",
+ "Helmikuu",
+ "Maaliskuu",
+ "Huhtikuu",
+ "Toukokuu",
+ "Kesäkuu",
+ "Heinäkuu",
+ "Elokuu",
+ "Syyskuu",
+ "Lokakuu",
+ "Marraskuu",
+ "Joulukuu");
+
+// short month names
+Calendar._SMN = new Array
+("Tam",
+ "Hel",
+ "Maa",
+ "Huh",
+ "Tou",
+ "Kes",
+ "Hei",
+ "Elo",
+ "Syy",
+ "Lok",
+ "Mar",
+ "Jou");
+
+// tooltips
+Calendar._TT = {};
+Calendar._TT["INFO"] = "Tietoja kalenterista";
+
+Calendar._TT["ABOUT"] =
+"DHTML Date/Time Selector\n" +
+"(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n" + // don't translate this this ;-)
+"Uusin versio osoitteessa: http://www.dynarch.com/projects/calendar/\n" +
+"Julkaistu GNU LGPL lisenssin alaisuudessa. Lisätietoja osoitteessa http://gnu.org/licenses/lgpl.html" +
+"\n\n" +
+"Päivämäärä valinta:\n" +
+"- Käytä \xab, \xbb painikkeita valitaksesi vuosi\n" +
+"- Käytä " + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a) + " painikkeita valitaksesi kuukausi\n" +
+"- Pitämällä hiiren painiketta minkä tahansa yllä olevan painikkeen kohdalla, saat näkyviin valikon nopeampaan siirtymiseen.";
+Calendar._TT["ABOUT_TIME"] = "\n\n" +
+"Ajan valinta:\n" +
+"- Klikkaa kellonajan numeroita lisätäksesi aikaa\n" +
+"- tai pitämällä Shift-näppäintä pohjassa saat aikaa taaksepäin\n" +
+"- tai klikkaa ja pidä hiiren painike pohjassa sekä liikuta hiirtä muuttaaksesi aikaa nopeasti eteen- ja taaksepäin.";
+
+Calendar._TT["PREV_YEAR"] = "Edell. vuosi (paina hetki, näet valikon)";
+Calendar._TT["PREV_MONTH"] = "Edell. kuukausi (paina hetki, näet valikon)";
+Calendar._TT["GO_TODAY"] = "Siirry tähän päivään";
+Calendar._TT["NEXT_MONTH"] = "Seur. kuukausi (paina hetki, näet valikon)";
+Calendar._TT["NEXT_YEAR"] = "Seur. vuosi (paina hetki, näet valikon)";
+Calendar._TT["SEL_DATE"] = "Valitse päivämäärä";
+Calendar._TT["DRAG_TO_MOVE"] = "Siirrä kalenterin paikkaa";
+Calendar._TT["PART_TODAY"] = " (tänään)";
+Calendar._TT["MON_FIRST"] = "Näytä maanantai ensimmäisenä";
+Calendar._TT["SUN_FIRST"] = "Näytä sunnuntai ensimmäisenä";
+Calendar._TT["CLOSE"] = "Sulje";
+Calendar._TT["TODAY"] = "Tänään";
+Calendar._TT["TIME_PART"] = "(Shift-) Klikkaa tai liikuta muuttaaksesi aikaa";
+
+// date formats
+Calendar._TT["DEF_DATE_FORMAT"] = "%d.%m.%Y";
+Calendar._TT["TT_DATE_FORMAT"] = "%d.%m.%Y";
+
+Calendar._TT["WK"] = "Vko";

Property changes on: trunk/wb/include/jscalendar/lang/calendar-fi.js
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: trunk/wb/include/jscalendar/lang/cn_utf8.js
===================================================================
--- trunk/wb/include/jscalendar/lang/cn_utf8.js	(nonexistent)
+++ trunk/wb/include/jscalendar/lang/cn_utf8.js	(revision 552)
@@ -0,0 +1,123 @@
+// ** I18N
+
+// Calendar EN language
+// Author: Mihai Bazon, <mishoo@infoiasi.ro>
+// Encoding: any
+// Translator : Niko <nikoused@gmail.com>
+// Distributed under the same terms as the calendar itself.
+
+// For translators: please use UTF-8 if possible.  We strongly believe that
+// Unicode is the answer to a real internationalized world.  Also please
+// include your contact information in the header, as can be seen above.
+
+// full day names
+Calendar._DN = new Array
+("\u5468\u65e5",//\u5468\u65e5
+ "\u5468\u4e00",//\u5468\u4e00
+ "\u5468\u4e8c",//\u5468\u4e8c
+ "\u5468\u4e09",//\u5468\u4e09
+ "\u5468\u56db",//\u5468\u56db
+ "\u5468\u4e94",//\u5468\u4e94
+ "\u5468\u516d",//\u5468\u516d
+ "\u5468\u65e5");//\u5468\u65e5
+
+// Please note that the following array of short day names (and the same goes
+// for short month names, _SMN) isn't absolutely necessary.  We give it here
+// for exemplification on how one can customize the short day names, but if
+// they are simply the first N letters of the full name you can simply say:
+//
+//   Calendar._SDN_len = N; // short day name length
+//   Calendar._SMN_len = N; // short month name length
+//
+// If N = 3 then this is not needed either since we assume a value of 3 if not
+// present, to be compatible with translation files that were written before
+// this feature.
+
+// short day names
+Calendar._SDN = new Array
+("\u5468\u65e5",
+ "\u5468\u4e00",
+ "\u5468\u4e8c",
+ "\u5468\u4e09",
+ "\u5468\u56db",
+ "\u5468\u4e94",
+ "\u5468\u516d",
+ "\u5468\u65e5");
+
+// full month names
+Calendar._MN = new Array
+("\u4e00\u6708",
+ "\u4e8c\u6708",
+ "\u4e09\u6708",
+ "\u56db\u6708",
+ "\u4e94\u6708",
+ "\u516d\u6708",
+ "\u4e03\u6708",
+ "\u516b\u6708",
+ "\u4e5d\u6708",
+ "\u5341\u6708",
+ "\u5341\u4e00\u6708",
+ "\u5341\u4e8c\u6708");
+
+// short month names
+Calendar._SMN = new Array
+("\u4e00\u6708",
+ "\u4e8c\u6708",
+ "\u4e09\u6708",
+ "\u56db\u6708",
+ "\u4e94\u6708",
+ "\u516d\u6708",
+ "\u4e03\u6708",
+ "\u516b\u6708",
+ "\u4e5d\u6708",
+ "\u5341\u6708",
+ "\u5341\u4e00\u6708",
+ "\u5341\u4e8c\u6708");
+
+// tooltips
+Calendar._TT = {};
+Calendar._TT["INFO"] = "\u5173\u4e8e";
+
+Calendar._TT["ABOUT"] =
+"   DHTML \u65e5\u8d77/\u65f6\u95f4\u9009\u62e9\u63a7\u4ef6\n" +
+"(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n" + // don't translate this this ;-)
+"For latest version visit: \u6700\u65b0\u7248\u672c\u8bf7\u767b\u9646http://www.dynarch.com/projects/calendar/\u5bdf\u770b\n" +
+"\u9075\u5faaGNU LGPL.  \u7ec6\u8282\u53c2\u9605 http://gnu.org/licenses/lgpl.html" +
+"\n\n" +
+"\u65e5\u671f\u9009\u62e9:\n" +
+"- \u70b9\u51fb\xab(\xbb)\u6309\u94ae\u9009\u62e9\u4e0a(\u4e0b)\u4e00\u5e74\u5ea6.\n" +
+"- \u70b9\u51fb" + String.fromCharCode(0x2039) + "(" + String.fromCharCode(0x203a) + ")\u6309\u94ae\u9009\u62e9\u4e0a(\u4e0b)\u4e2a\u6708\u4efd.\n" +
+"- \u957f\u65f6\u95f4\u6309\u7740\u6309\u94ae\u5c06\u51fa\u73b0\u66f4\u591a\u9009\u62e9\u9879.";
+Calendar._TT["ABOUT_TIME"] = "\n\n" +
+"\u65f6\u95f4\u9009\u62e9:\n" +
+"-\u5728\u65f6\u95f4\u90e8\u5206(\u5206\u6216\u8005\u79d2)\u4e0a\u5355\u51fb\u9f20\u6807\u5de6\u952e\u6765\u589e\u52a0\u5f53\u524d\u65f6\u95f4\u90e8\u5206(\u5206\u6216\u8005\u79d2)\n" +
+"-\u5728\u65f6\u95f4\u90e8\u5206(\u5206\u6216\u8005\u79d2)\u4e0a\u6309\u4f4fShift\u952e\u540e\u5355\u51fb\u9f20\u6807\u5de6\u952e\u6765\u51cf\u5c11\u5f53\u524d\u65f6\u95f4\u90e8\u5206(\u5206\u6216\u8005\u79d2).";
+
+Calendar._TT["PREV_YEAR"] = "\u4e0a\u4e00\u5e74";
+Calendar._TT["PREV_MONTH"] = "\u4e0a\u4e2a\u6708";
+Calendar._TT["GO_TODAY"] = "\u5230\u4eca\u5929";
+Calendar._TT["NEXT_MONTH"] = "\u4e0b\u4e2a\u6708";
+Calendar._TT["NEXT_YEAR"] = "\u4e0b\u4e00\u5e74";
+Calendar._TT["SEL_DATE"] = "\u9009\u62e9\u65e5\u671f";
+Calendar._TT["DRAG_TO_MOVE"] = "\u62d6\u52a8";
+Calendar._TT["PART_TODAY"] = " (\u4eca\u5929)";
+
+// the following is to inform that "%s" is to be the first day of week
+// %s will be replaced with the day name.
+Calendar._TT["DAY_FIRST"] = "%s\u4e3a\u8fd9\u5468\u7684\u7b2c\u4e00\u5929";
+
+// This may be locale-dependent.  It specifies the week-end days, as an array
+// of comma-separated numbers.  The numbers are from 0 to 6: 0 means Sunday, 1
+// means Monday, etc.
+Calendar._TT["WEEKEND"] = "0,6";
+
+Calendar._TT["CLOSE"] = "\u5173\u95ed";
+Calendar._TT["TODAY"] = "\u4eca\u5929";
+Calendar._TT["TIME_PART"] = "(\u6309\u7740Shift\u952e)\u5355\u51fb\u6216\u62d6\u52a8\u6539\u53d8\u503c";
+
+// date formats
+Calendar._TT["DEF_DATE_FORMAT"] = "%Y-%m-%d";
+Calendar._TT["TT_DATE_FORMAT"] = "%a, %b %e\u65e5";
+
+Calendar._TT["WK"] = "\u5468";
+Calendar._TT["TIME"] = "\u65f6\u95f4:";

Property changes on: trunk/wb/include/jscalendar/lang/cn_utf8.js
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: trunk/wb/include/jscalendar/lang/calendar-ru_win_.js
===================================================================
--- trunk/wb/include/jscalendar/lang/calendar-ru_win_.js	(nonexistent)
+++ trunk/wb/include/jscalendar/lang/calendar-ru_win_.js	(revision 552)
@@ -0,0 +1,123 @@
+// ** I18N
+
+// Calendar RU language
+// Translation: Sly Golovanov, http://golovanov.net, <sly@golovanov.net>
+// Encoding: any
+// Distributed under the same terms as the calendar itself.
+
+// For translators: please use UTF-8 if possible.  We strongly believe that
+// Unicode is the answer to a real internationalized world.  Also please
+// include your contact information in the header, as can be seen above.
+
+// full day names
+Calendar._DN = new Array
+("",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "");
+
+// Please note that the following array of short day names (and the same goes
+// for short month names, _SMN) isn't absolutely necessary.  We give it here
+// for exemplification on how one can customize the short day names, but if
+// they are simply the first N letters of the full name you can simply say:
+//
+//   Calendar._SDN_len = N; // short day name length
+//   Calendar._SMN_len = N; // short month name length
+//
+// If N = 3 then this is not needed either since we assume a value of 3 if not
+// present, to be compatible with translation files that were written before
+// this feature.
+
+// short day names
+Calendar._SDN = new Array
+("",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "");
+
+// full month names
+Calendar._MN = new Array
+("",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "");
+
+// short month names
+Calendar._SMN = new Array
+("",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "");
+
+// tooltips
+Calendar._TT = {};
+Calendar._TT["INFO"] = " ...";
+
+Calendar._TT["ABOUT"] =
+"DHTML Date/Time Selector\n" +
+"(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n" + // don't translate this this ;-)
+"For latest version visit: http://www.dynarch.com/projects/calendar/\n" +
+"Distributed under GNU LGPL.  See http://gnu.org/licenses/lgpl.html for details." +
+"\n\n" +
+"  :\n" +
+"-    \xab, \xbb   \n" +
+"-    " + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a) + "   \n" +
+"-    ,     .";
+Calendar._TT["ABOUT_TIME"] = "\n\n" +
+"  :\n" +
+"-        \n" +
+"-      Shift  \n" +
+"-      /,    .";
+
+Calendar._TT["PREV_YEAR"] = "   (  )";
+Calendar._TT["PREV_MONTH"] = "   (  )";
+Calendar._TT["GO_TODAY"] = "";
+Calendar._TT["NEXT_MONTH"] = "   (  )";
+Calendar._TT["NEXT_YEAR"] = "   (  )";
+Calendar._TT["SEL_DATE"] = " ";
+Calendar._TT["DRAG_TO_MOVE"] = " ";
+Calendar._TT["PART_TODAY"] = " ()";
+
+// the following is to inform that "%s" is to be the first day of week
+// %s will be replaced with the day name.
+Calendar._TT["DAY_FIRST"] = "    %s";
+
+// This may be locale-dependent.  It specifies the week-end days, as an array
+// of comma-separated numbers.  The numbers are from 0 to 6: 0 means Sunday, 1
+// means Monday, etc.
+Calendar._TT["WEEKEND"] = "0,6";
+
+Calendar._TT["CLOSE"] = "";
+Calendar._TT["TODAY"] = "";
+Calendar._TT["TIME_PART"] = "(Shift-)    ";
+
+// date formats
+Calendar._TT["DEF_DATE_FORMAT"] = "%Y-%m-%d";
+Calendar._TT["TT_DATE_FORMAT"] = "%e %b, %a";
+
+Calendar._TT["WK"] = "";
+Calendar._TT["TIME"] = ":";

Property changes on: trunk/wb/include/jscalendar/lang/calendar-ru_win_.js
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: trunk/wb/include/jscalendar/lang/calendar-es.js
===================================================================
--- trunk/wb/include/jscalendar/lang/calendar-es.js	(nonexistent)
+++ trunk/wb/include/jscalendar/lang/calendar-es.js	(revision 552)
@@ -0,0 +1,129 @@
+// ** I18N
+
+// Calendar ES (spanish) language
+// Author: Mihai Bazon, <mihai_bazon@yahoo.com>
+// Updater: Servilio Afre Puentes <servilios@yahoo.com>
+// Updated: 2004-06-03
+// Encoding: utf-8
+// Distributed under the same terms as the calendar itself.
+
+// For translators: please use UTF-8 if possible.  We strongly believe that
+// Unicode is the answer to a real internationalized world.  Also please
+// include your contact information in the header, as can be seen above.
+
+// full day names
+Calendar._DN = new Array
+("Domingo",
+ "Lunes",
+ "Martes",
+ "Mircoles",
+ "Jueves",
+ "Viernes",
+ "Sbado",
+ "Domingo");
+
+// Please note that the following array of short day names (and the same goes
+// for short month names, _SMN) isn't absolutely necessary.  We give it here
+// for exemplification on how one can customize the short day names, but if
+// they are simply the first N letters of the full name you can simply say:
+//
+//   Calendar._SDN_len = N; // short day name length
+//   Calendar._SMN_len = N; // short month name length
+//
+// If N = 3 then this is not needed either since we assume a value of 3 if not
+// present, to be compatible with translation files that were written before
+// this feature.
+
+// short day names
+Calendar._SDN = new Array
+("Dom",
+ "Lun",
+ "Mar",
+ "Mi",
+ "Jue",
+ "Vie",
+ "Sb",
+ "Dom");
+
+// First day of the week. "0" means display Sunday first, "1" means display
+// Monday first, etc.
+Calendar._FD = 1;
+
+// full month names
+Calendar._MN = new Array
+("Enero",
+ "Febrero",
+ "Marzo",
+ "Abril",
+ "Mayo",
+ "Junio",
+ "Julio",
+ "Agosto",
+ "Septiembre",
+ "Octubre",
+ "Noviembre",
+ "Diciembre");
+
+// short month names
+Calendar._SMN = new Array
+("Ene",
+ "Feb",
+ "Mar",
+ "Abr",
+ "May",
+ "Jun",
+ "Jul",
+ "Ago",
+ "Sep",
+ "Oct",
+ "Nov",
+ "Dic");
+
+// tooltips
+Calendar._TT = {};
+Calendar._TT["INFO"] = "Acerca del calendario";
+
+Calendar._TT["ABOUT"] =
+"Selector DHTML de Fecha/Hora\n" +
+"(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n" + // don't translate this this ;-)
+"Para conseguir la ltima versin visite: http://www.dynarch.com/projects/calendar/\n" +
+"Distribuido bajo licencia GNU LGPL. Visite http://gnu.org/licenses/lgpl.html para ms detalles." +
+"\n\n" +
+"Seleccin de fecha:\n" +
+"- Use los botones \xab, \xbb para seleccionar el ao\n" +
+"- Use los botones " + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a) + " para seleccionar el mes\n" +
+"- Mantenga pulsado el ratn en cualquiera de estos botones para una seleccin rpida.";
+Calendar._TT["ABOUT_TIME"] = "\n\n" +
+"Seleccin de hora:\n" +
+"- Pulse en cualquiera de las partes de la hora para incrementarla\n" +
+"- o pulse las maysculas mientras hace clic para decrementarla\n" +
+"- o haga clic y arrastre el ratn para una seleccin ms rpida.";
+
+Calendar._TT["PREV_YEAR"] = "Ao anterior (mantener para men)";
+Calendar._TT["PREV_MONTH"] = "Mes anterior (mantener para men)";
+Calendar._TT["GO_TODAY"] = "Ir a hoy";
+Calendar._TT["NEXT_MONTH"] = "Mes siguiente (mantener para men)";
+Calendar._TT["NEXT_YEAR"] = "Ao siguiente (mantener para men)";
+Calendar._TT["SEL_DATE"] = "Seleccionar fecha";
+Calendar._TT["DRAG_TO_MOVE"] = "Arrastrar para mover";
+Calendar._TT["PART_TODAY"] = " (hoy)";
+
+// the following is to inform that "%s" is to be the first day of week
+// %s will be replaced with the day name.
+Calendar._TT["DAY_FIRST"] = "Hacer %s primer da de la semana";
+
+// This may be locale-dependent.  It specifies the week-end days, as an array
+// of comma-separated numbers.  The numbers are from 0 to 6: 0 means Sunday, 1
+// means Monday, etc.
+Calendar._TT["WEEKEND"] = "0,6";
+
+Calendar._TT["CLOSE"] = "Cerrar";
+Calendar._TT["TODAY"] = "Hoy";
+Calendar._TT["TIME_PART"] = "(Mayscula-)Clic o arrastre para cambiar valor";
+
+// date formats
+Calendar._TT["DEF_DATE_FORMAT"] = "%d/%m/%Y";
+Calendar._TT["TT_DATE_FORMAT"] = "%A, %e de %B de %Y";
+
+Calendar._TT["WK"] = "sem";
+Calendar._TT["TIME"] = "Hora:";

Property changes on: trunk/wb/include/jscalendar/lang/calendar-es.js
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: trunk/wb/include/jscalendar/lang/calendar-du.js
===================================================================
--- trunk/wb/include/jscalendar/lang/calendar-du.js	(nonexistent)
+++ trunk/wb/include/jscalendar/lang/calendar-du.js	(revision 552)
@@ -0,0 +1,45 @@
+// ** I18N
+Calendar._DN = new Array
+("Zondag",
+ "Maandag",
+ "Dinsdag",
+ "Woensdag",
+ "Donderdag",
+ "Vrijdag",
+ "Zaterdag",
+ "Zondag");
+Calendar._MN = new Array
+("Januari",
+ "Februari",
+ "Maart",
+ "April",
+ "Mei",
+ "Juni",
+ "Juli",
+ "Augustus",
+ "September",
+ "Oktober",
+ "November",
+ "December");
+
+// tooltips
+Calendar._TT = {};
+Calendar._TT["TOGGLE"] = "Toggle startdag van de week";
+Calendar._TT["PREV_YEAR"] = "Vorig jaar (indrukken voor menu)";
+Calendar._TT["PREV_MONTH"] = "Vorige month (indrukken voor menu)";
+Calendar._TT["GO_TODAY"] = "Naar Vandaag";
+Calendar._TT["NEXT_MONTH"] = "Volgende Maand (indrukken voor menu)";
+Calendar._TT["NEXT_YEAR"] = "Volgend jaar (indrukken voor menu)";
+Calendar._TT["SEL_DATE"] = "Selecteer datum";
+Calendar._TT["DRAG_TO_MOVE"] = "Sleep om te verplaatsen";
+Calendar._TT["PART_TODAY"] = " (vandaag)";
+Calendar._TT["MON_FIRST"] = "Toon Maandag eerst";
+Calendar._TT["SUN_FIRST"] = "Toon Zondag eerst";
+Calendar._TT["CLOSE"] = "Sluiten";
+Calendar._TT["TODAY"] = "Vandaag";
+
+// date formats
+Calendar._TT["DEF_DATE_FORMAT"] = "y-mm-dd";
+Calendar._TT["TT_DATE_FORMAT"] = "D, M d";
+
+Calendar._TT["WK"] = "wk";

Property changes on: trunk/wb/include/jscalendar/lang/calendar-du.js
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: trunk/wb/include/jscalendar/lang/calendar-ko.js
===================================================================
--- trunk/wb/include/jscalendar/lang/calendar-ko.js	(nonexistent)
+++ trunk/wb/include/jscalendar/lang/calendar-ko.js	(revision 552)
@@ -0,0 +1,120 @@
+// ** I18N
+
+// Calendar EN language
+// Author: Mihai Bazon, <mihai_bazon@yahoo.com>
+// Translation: Yourim Yi <yyi@yourim.net>
+// Encoding: EUC-KR
+// lang : ko
+// Distributed under the same terms as the calendar itself.
+
+// For translators: please use UTF-8 if possible.  We strongly believe that
+// Unicode is the answer to a real internationalized world.  Also please
+// include your contact information in the header, as can be seen above.
+
+// full day names
+
+Calendar._DN = new Array
+("Ͽ",
+ "",
+ "ȭ",
+ "",
+ "",
+ "ݿ",
+ "",
+ "Ͽ");
+
+// Please note that the following array of short day names (and the same goes
+// for short month names, _SMN) isn't absolutely necessary.  We give it here
+// for exemplification on how one can customize the short day names, but if
+// they are simply the first N letters of the full name you can simply say:
+//
+//   Calendar._SDN_len = N; // short day name length
+//   Calendar._SMN_len = N; // short month name length
+//
+// If N = 3 then this is not needed either since we assume a value of 3 if not
+// present, to be compatible with translation files that were written before
+// this feature.
+
+// short day names
+Calendar._SDN = new Array
+("",
+ "",
+ "ȭ",
+ "",
+ "",
+ "",
+ "",
+ "");
+
+// full month names
+Calendar._MN = new Array
+("1",
+ "2",
+ "3",
+ "4",
+ "5",
+ "6",
+ "7",
+ "8",
+ "9",
+ "10",
+ "11",
+ "12");
+
+// short month names
+Calendar._SMN = new Array
+("1",
+ "2",
+ "3",
+ "4",
+ "5",
+ "6",
+ "7",
+ "8",
+ "9",
+ "10",
+ "11",
+ "12");
+
+// tooltips
+Calendar._TT = {};
+Calendar._TT["INFO"] = "calendar  ؼ";
+
+Calendar._TT["ABOUT"] =
+"DHTML Date/Time Selector\n" +
+"(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n" + // don't translate this this ;-)
+"\n"+
+"ֽ  ÷ http://www.dynarch.com/projects/calendar/  湮ϼ\n" +
+"\n"+
+"GNU LGPL ̼ ˴ϴ. \n"+
+"̼  ڼ  http://gnu.org/licenses/lgpl.html  ." +
+"\n\n" +
+"¥ :\n" +
+"-  Ϸ \xab, \xbb ư մϴ\n" +
+"-  Ϸ " + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a) + " ư \n" +
+"-       Ͻ  ֽϴ.";
+Calendar._TT["ABOUT_TIME"] = "\n\n" +
+"ð :\n" +
+"- 콺  ð մϴ\n" +
+"- Shift Ű Բ  մϴ\n" +
+"-  ¿ 콺 ̸     մϴ.\n";
+
+Calendar._TT["PREV_YEAR"] = "  (  )";
+Calendar._TT["PREV_MONTH"] = "  (  )";
+Calendar._TT["GO_TODAY"] = " ¥";
+Calendar._TT["NEXT_MONTH"] = "  (  )";
+Calendar._TT["NEXT_YEAR"] = "  (  )";
+Calendar._TT["SEL_DATE"] = "¥ ϼ";
+Calendar._TT["DRAG_TO_MOVE"] = "콺 巡׷ ̵ ϼ";
+Calendar._TT["PART_TODAY"] = " ()";
+Calendar._TT["MON_FIRST"] = "    Ϸ";
+Calendar._TT["SUN_FIRST"] = "Ͽ    Ϸ";
+Calendar._TT["CLOSE"] = "ݱ";
+Calendar._TT["TODAY"] = "";
+Calendar._TT["TIME_PART"] = "(Shift-)Ŭ Ǵ 巡 ϼ";
+
+// date formats
+Calendar._TT["DEF_DATE_FORMAT"] = "%Y-%m-%d";
+Calendar._TT["TT_DATE_FORMAT"] = "%b/%e [%a]";
+
+Calendar._TT["WK"] = "";

Property changes on: trunk/wb/include/jscalendar/lang/calendar-ko.js
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: trunk/wb/include/jscalendar/lang/calendar-big5-utf8.js
===================================================================
--- trunk/wb/include/jscalendar/lang/calendar-big5-utf8.js	(nonexistent)
+++ trunk/wb/include/jscalendar/lang/calendar-big5-utf8.js	(revision 552)
@@ -0,0 +1,123 @@
+// ** I18N
+
+// Calendar big5-utf8 language
+// Author: Gary Fu, <gary@garyfu.idv.tw>
+// Encoding: utf8
+// Distributed under the same terms as the calendar itself.
+
+// For translators: please use UTF-8 if possible.  We strongly believe that
+// Unicode is the answer to a real internationalized world.  Also please
+// include your contact information in the header, as can be seen above.
+	
+// full day names
+Calendar._DN = new Array
+("星期日",
+ "星期一",
+ "星期二",
+ "星期三",
+ "星期四",
+ "星期五",
+ "星期六",
+ "星期日");
+
+// Please note that the following array of short day names (and the same goes
+// for short month names, _SMN) isn't absolutely necessary.  We give it here
+// for exemplification on how one can customize the short day names, but if
+// they are simply the first N letters of the full name you can simply say:
+//
+//   Calendar._SDN_len = N; // short day name length
+//   Calendar._SMN_len = N; // short month name length
+//
+// If N = 3 then this is not needed either since we assume a value of 3 if not
+// present, to be compatible with translation files that were written before
+// this feature.
+
+// short day names
+Calendar._SDN = new Array
+("日",
+ "一",
+ "二",
+ "三",
+ "四",
+ "五",
+ "六",
+ "日");
+
+// full month names
+Calendar._MN = new Array
+("一月",
+ "二月",
+ "三月",
+ "四月",
+ "五月",
+ "六月",
+ "七月",
+ "八月",
+ "九月",
+ "十月",
+ "十一月",
+ "十二月");
+
+// short month names
+Calendar._SMN = new Array
+("一月",
+ "二月",
+ "三月",
+ "四月",
+ "五月",
+ "六月",
+ "七月",
+ "八月",
+ "九月",
+ "十月",
+ "十一月",
+ "十二月");
+
+// tooltips
+Calendar._TT = {};
+Calendar._TT["INFO"] = "關於";
+
+Calendar._TT["ABOUT"] =
+"DHTML Date/Time Selector\n" +
+"(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n" + // don't translate this this ;-)
+"For latest version visit: http://www.dynarch.com/projects/calendar/\n" +
+"Distributed under GNU LGPL.  See http://gnu.org/licenses/lgpl.html for details." +
+"\n\n" +
+"日期選擇方法:\n" +
+"- 使用 \xab, \xbb 按鈕可選擇年份\n" +
+"- 使用 " + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a) + " 按鈕可選擇月份\n" +
+"- 按住上面的按鈕可以加快選取";
+Calendar._TT["ABOUT_TIME"] = "\n\n" +
+"時間選擇方法:\n" +
+"- 點擊任何的時間部份可增加其值\n" +
+"- 同時按Shift鍵再點擊可減少其值\n" +
+"- 點擊並拖曳可加快改變的值";
+
+Calendar._TT["PREV_YEAR"] = "上一年 (按住選單)";
+Calendar._TT["PREV_MONTH"] = "下一年 (按住選單)";
+Calendar._TT["GO_TODAY"] = "到今日";
+Calendar._TT["NEXT_MONTH"] = "上一月 (按住選單)";
+Calendar._TT["NEXT_YEAR"] = "下一月 (按住選單)";
+Calendar._TT["SEL_DATE"] = "選擇日期";
+Calendar._TT["DRAG_TO_MOVE"] = "拖曳";
+Calendar._TT["PART_TODAY"] = " (今日)";
+
+// the following is to inform that "%s" is to be the first day of week
+// %s will be replaced with the day name.
+Calendar._TT["DAY_FIRST"] = "將 %s 顯示在前";
+
+// This may be locale-dependent.  It specifies the week-end days, as an array
+// of comma-separated numbers.  The numbers are from 0 to 6: 0 means Sunday, 1
+// means Monday, etc.
+Calendar._TT["WEEKEND"] = "0,6";
+
+Calendar._TT["CLOSE"] = "關閉";
+Calendar._TT["TODAY"] = "今日";
+Calendar._TT["TIME_PART"] = "點擊or拖曳可改變時間(同時按Shift為減)";
+
+// date formats
+Calendar._TT["DEF_DATE_FORMAT"] = "%Y-%m-%d";
+Calendar._TT["TT_DATE_FORMAT"] = "%a, %b %e";
+
+Calendar._TT["WK"] = "週";
+Calendar._TT["TIME"] = "Time:";

Property changes on: trunk/wb/include/jscalendar/lang/calendar-big5-utf8.js
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: trunk/wb/include/jscalendar/lang/calendar-si.js
===================================================================
--- trunk/wb/include/jscalendar/lang/calendar-si.js	(nonexistent)
+++ trunk/wb/include/jscalendar/lang/calendar-si.js	(revision 552)
@@ -0,0 +1,94 @@
+/* Slovenian language file for the DHTML Calendar version 0.9.2 
+* Author David Milost <mercy@volja.net>, January 2004.
+* Feel free to use this script under the terms of the GNU Lesser General
+* Public License, as long as you do not remove or alter this notice.
+*/
+ // full day names
+Calendar._DN = new Array
+("Nedelja",
+ "Ponedeljek",
+ "Torek",
+ "Sreda",
+ "Četrtek",
+ "Petek",
+ "Sobota",
+ "Nedelja");
+ // short day names
+ Calendar._SDN = new Array
+("Ned",
+ "Pon",
+ "Tor",
+ "Sre",
+ "Čet",
+ "Pet",
+ "Sob",
+ "Ned");
+// short month names
+Calendar._SMN = new Array
+("Jan",
+ "Feb",
+ "Mar",
+ "Apr",
+ "Maj",
+ "Jun",
+ "Jul",
+ "Avg",
+ "Sep",
+ "Okt",
+ "Nov",
+ "Dec");
+  // full month names
+Calendar._MN = new Array
+("Januar",
+ "Februar",
+ "Marec",
+ "April",
+ "Maj",
+ "Junij",
+ "Julij",
+ "Avgust",
+ "September",
+ "Oktober",
+ "November",
+ "December");
+
+// tooltips
+// tooltips
+Calendar._TT = {};
+Calendar._TT["INFO"] = "O koledarju";
+
+Calendar._TT["ABOUT"] =
+"DHTML Date/Time Selector\n" +
+"(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n" + // don't translate this this ;-)
+"Za zadnjo verzijo pojdine na naslov: http://www.dynarch.com/projects/calendar/\n" +
+"Distribuirano pod GNU LGPL.  Poglejte http://gnu.org/licenses/lgpl.html za podrobnosti." +
+"\n\n" +
+"Izbor datuma:\n" +
+"- Uporabite \xab, \xbb gumbe za izbor leta\n" +
+"- Uporabite " + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a) + " gumbe za izbor meseca\n" +
+"- Zadržite klik na kateremkoli od zgornjih gumbov za hiter izbor.";
+Calendar._TT["ABOUT_TIME"] = "\n\n" +
+"Izbor ćasa:\n" +
+"- Kliknite na katerikoli del ćasa za poveć. le-tega\n" +
+"- ali Shift-click za zmanj. le-tega\n" +
+"- ali kliknite in povlecite za hiter izbor.";
+
+Calendar._TT["TOGGLE"] = "Spremeni dan s katerim se prićne teden";
+Calendar._TT["PREV_YEAR"] = "Predhodnje leto (dolg klik za meni)";
+Calendar._TT["PREV_MONTH"] = "Predhodnji mesec (dolg klik za meni)";
+Calendar._TT["GO_TODAY"] = "Pojdi na tekoći dan";
+Calendar._TT["NEXT_MONTH"] = "Naslednji mesec (dolg klik za meni)";
+Calendar._TT["NEXT_YEAR"] = "Naslednje leto (dolg klik za meni)";
+Calendar._TT["SEL_DATE"] = "Izberite datum";
+Calendar._TT["DRAG_TO_MOVE"] = "Pritisni in povleci za spremembo pozicije";
+Calendar._TT["PART_TODAY"] = " (danes)";
+Calendar._TT["MON_FIRST"] = "Prikaži ponedeljek kot prvi dan";
+Calendar._TT["SUN_FIRST"] = "Prikaži nedeljo kot prvi dan";
+Calendar._TT["CLOSE"] = "Zapri";
+Calendar._TT["TODAY"] = "Danes";
+
+// date formats
+Calendar._TT["DEF_DATE_FORMAT"] = "%Y-%m-%d";
+Calendar._TT["TT_DATE_FORMAT"] = "%a, %b %e";
+
+Calendar._TT["WK"] = "Ted";
\ No newline at end of file

Property changes on: trunk/wb/include/jscalendar/lang/calendar-si.js
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: trunk/wb/include/jscalendar/lang/calendar-no.js
===================================================================
--- trunk/wb/include/jscalendar/lang/calendar-no.js	(nonexistent)
+++ trunk/wb/include/jscalendar/lang/calendar-no.js	(revision 552)
@@ -0,0 +1,114 @@
+// ** I18N
+
+// Calendar NO language
+// Author: Daniel Holmen, <daniel.holmen@ciber.no>
+// Encoding: UTF-8
+// Distributed under the same terms as the calendar itself.
+
+// For translators: please use UTF-8 if possible.  We strongly believe that
+// Unicode is the answer to a real internationalized world.  Also please
+// include your contact information in the header, as can be seen above.
+
+// full day names
+Calendar._DN = new Array
+("Søndag",
+ "Mandag",
+ "Tirsdag",
+ "Onsdag",
+ "Torsdag",
+ "Fredag",
+ "Lørdag",
+ "Søndag");
+
+// Please note that the following array of short day names (and the same goes
+// for short month names, _SMN) isn't absolutely necessary.  We give it here
+// for exemplification on how one can customize the short day names, but if
+// they are simply the first N letters of the full name you can simply say:
+//
+//   Calendar._SDN_len = N; // short day name length
+//   Calendar._SMN_len = N; // short month name length
+//
+// If N = 3 then this is not needed either since we assume a value of 3 if not
+// present, to be compatible with translation files that were written before
+// this feature.
+
+// short day names
+Calendar._SDN = new Array
+("Søn",
+ "Man",
+ "Tir",
+ "Ons",
+ "Tor",
+ "Fre",
+ "Lør",
+ "Søn");
+
+// full month names
+Calendar._MN = new Array
+("Januar",
+ "Februar",
+ "Mars",
+ "April",
+ "Mai",
+ "Juni",
+ "Juli",
+ "August",
+ "September",
+ "Oktober",
+ "November",
+ "Desember");
+
+// short month names
+Calendar._SMN = new Array
+("Jan",
+ "Feb",
+ "Mar",
+ "Apr",
+ "Mai",
+ "Jun",
+ "Jul",
+ "Aug",
+ "Sep",
+ "Okt",
+ "Nov",
+ "Des");
+
+// tooltips
+Calendar._TT = {};
+Calendar._TT["INFO"] = "Om kalenderen";
+
+Calendar._TT["ABOUT"] =
+"DHTML Dato-/Tidsvelger\n" +
+"(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n" + // don't translate this this ;-)
+"For nyeste versjon, gå til: http://www.dynarch.com/projects/calendar/\n" +
+"Distribuert under GNU LGPL.  Se http://gnu.org/licenses/lgpl.html for detaljer." +
+"\n\n" +
+"Datovalg:\n" +
+"- Bruk knappene \xab og \xbb for å velge år\n" +
+"- Bruk knappene " + String.fromCharCode(0x2039) + " og " + String.fromCharCode(0x203a) + " for å velge måned\n" +
+"- Hold inne musknappen eller knappene over for raskere valg.";
+Calendar._TT["ABOUT_TIME"] = "\n\n" +
+"Tidsvalg:\n" +
+"- Klikk på en av tidsdelene for å øke den\n" +
+"- eller Shift-klikk for å senke verdien\n" +
+"- eller klikk-og-dra for raskere valg..";
+
+Calendar._TT["PREV_YEAR"] = "Forrige. år (hold for meny)";
+Calendar._TT["PREV_MONTH"] = "Forrige. måned (hold for meny)";
+Calendar._TT["GO_TODAY"] = "Gå til idag";
+Calendar._TT["NEXT_MONTH"] = "Neste måned (hold for meny)";
+Calendar._TT["NEXT_YEAR"] = "Neste år (hold for meny)";
+Calendar._TT["SEL_DATE"] = "Velg dato";
+Calendar._TT["DRAG_TO_MOVE"] = "Dra for å flytte";
+Calendar._TT["PART_TODAY"] = " (idag)";
+Calendar._TT["MON_FIRST"] = "Vis mandag først";
+Calendar._TT["SUN_FIRST"] = "Vis søndag først";
+Calendar._TT["CLOSE"] = "Lukk";
+Calendar._TT["TODAY"] = "Idag";
+Calendar._TT["TIME_PART"] = "(Shift-)Klikk eller dra for å endre verdi";
+
+// date formats
+Calendar._TT["DEF_DATE_FORMAT"] = "%d.%m.%Y";
+Calendar._TT["TT_DATE_FORMAT"] = "%a, %b %e";
+
+Calendar._TT["WK"] = "uke";
\ No newline at end of file

Property changes on: trunk/wb/include/jscalendar/lang/calendar-no.js
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: trunk/wb/include/jscalendar/lang/calendar-hu.js
===================================================================
--- trunk/wb/include/jscalendar/lang/calendar-hu.js	(nonexistent)
+++ trunk/wb/include/jscalendar/lang/calendar-hu.js	(revision 552)
@@ -0,0 +1,124 @@
+// ** I18N
+
+// Calendar HU language
+// Author: ???
+// Modifier: KARASZI Istvan, <jscalendar@spam.raszi.hu>
+// Encoding: any
+// Distributed under the same terms as the calendar itself.
+
+// For translators: please use UTF-8 if possible.  We strongly believe that
+// Unicode is the answer to a real internationalized world.  Also please
+// include your contact information in the header, as can be seen above.
+
+// full day names
+Calendar._DN = new Array
+("Vasrnap",
+ "Htf",
+ "Kedd",
+ "Szerda",
+ "Cstrtk",
+ "Pntek",
+ "Szombat",
+ "Vasrnap");
+
+// Please note that the following array of short day names (and the same goes
+// for short month names, _SMN) isn't absolutely necessary.  We give it here
+// for exemplification on how one can customize the short day names, but if
+// they are simply the first N letters of the full name you can simply say:
+//
+//   Calendar._SDN_len = N; // short day name length
+//   Calendar._SMN_len = N; // short month name length
+//
+// If N = 3 then this is not needed either since we assume a value of 3 if not
+// present, to be compatible with translation files that were written before
+// this feature.
+
+// short day names
+Calendar._SDN = new Array
+("v",
+ "h",
+ "k",
+ "sze",
+ "cs",
+ "p",
+ "szo",
+ "v");
+
+// full month names
+Calendar._MN = new Array
+("janur",
+ "februr",
+ "mrcius",
+ "prilis",
+ "mjus",
+ "jnius",
+ "jlius",
+ "augusztus",
+ "szeptember",
+ "oktber",
+ "november",
+ "december");
+
+// short month names
+Calendar._SMN = new Array
+("jan",
+ "feb",
+ "mr",
+ "pr",
+ "mj",
+ "jn",
+ "jl",
+ "aug",
+ "sze",
+ "okt",
+ "nov",
+ "dec");
+
+// tooltips
+Calendar._TT = {};
+Calendar._TT["INFO"] = "A kalendriumrl";
+
+Calendar._TT["ABOUT"] =
+"DHTML dtum/id kivlaszt\n" +
+"(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n" + // don't translate this this ;-)
+"a legfrissebb verzi megtallhat: http://www.dynarch.com/projects/calendar/\n" +
+"GNU LGPL alatt terjesztve.  Lsd a http://gnu.org/licenses/lgpl.html oldalt a rszletekhez." +
+"\n\n" +
+"Dtum vlaszts:\n" +
+"- hasznlja a \xab, \xbb gombokat az v kivlasztshoz\n" +
+"- hasznlja a " + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a) + " gombokat a hnap kivlasztshoz\n" +
+"- tartsa lenyomva az egrgombot a gyors vlasztshoz.";
+Calendar._TT["ABOUT_TIME"] = "\n\n" +
+"Id vlaszts:\n" +
+"- kattintva nvelheti az idt\n" +
+"- shift-tel kattintva cskkentheti\n" +
+"- lenyomva tartva s hzva gyorsabban kivlaszthatja.";
+
+Calendar._TT["PREV_YEAR"] = "Elz v (tartsa nyomva a menhz)";
+Calendar._TT["PREV_MONTH"] = "Elz hnap (tartsa nyomva a menhz)";
+Calendar._TT["GO_TODAY"] = "Mai napra ugrs";
+Calendar._TT["NEXT_MONTH"] = "Kv. hnap (tartsa nyomva a menhz)";
+Calendar._TT["NEXT_YEAR"] = "Kv. v (tartsa nyomva a menhz)";
+Calendar._TT["SEL_DATE"] = "Vlasszon dtumot";
+Calendar._TT["DRAG_TO_MOVE"] = "Hzza a mozgatshoz";
+Calendar._TT["PART_TODAY"] = " (ma)";
+
+// the following is to inform that "%s" is to be the first day of week
+// %s will be replaced with the day name.
+Calendar._TT["DAY_FIRST"] = "%s legyen a ht els napja";
+
+// This may be locale-dependent.  It specifies the week-end days, as an array
+// of comma-separated numbers.  The numbers are from 0 to 6: 0 means Sunday, 1
+// means Monday, etc.
+Calendar._TT["WEEKEND"] = "0,6";
+
+Calendar._TT["CLOSE"] = "Bezr";
+Calendar._TT["TODAY"] = "Ma";
+Calendar._TT["TIME_PART"] = "(Shift-)Klikk vagy hzs az rtk vltoztatshoz";
+
+// date formats
+Calendar._TT["DEF_DATE_FORMAT"] = "%Y-%m-%d";
+Calendar._TT["TT_DATE_FORMAT"] = "%b %e, %a";
+
+Calendar._TT["WK"] = "ht";
+Calendar._TT["TIME"] = "id:";

Property changes on: trunk/wb/include/jscalendar/lang/calendar-hu.js
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: trunk/wb/include/jscalendar/lang/calendar-sk.js
===================================================================
--- trunk/wb/include/jscalendar/lang/calendar-sk.js	(nonexistent)
+++ trunk/wb/include/jscalendar/lang/calendar-sk.js	(revision 552)
@@ -0,0 +1,99 @@
+// ** I18N
+
+// Calendar SK language
+// Author: Peter Valach (pvalach@gmx.net)
+// Encoding: utf-8
+// Last update: 2003/10/29
+// Distributed under the same terms as the calendar itself.
+
+// full day names
+Calendar._DN = new Array
+("NedeÄľa",
+ "Pondelok",
+ "Utorok",
+ "Streda",
+ "Ĺ tvrtok",
+ "Piatok",
+ "Sobota",
+ "NedeÄľa");
+
+// short day names
+Calendar._SDN = new Array
+("Ned",
+ "Pon",
+ "Uto",
+ "Str",
+ "Ĺ tv",
+ "Pia",
+ "Sob",
+ "Ned");
+
+// full month names
+Calendar._MN = new Array
+("JanuĂˇr",
+ "FebruĂˇr",
+ "Marec",
+ "AprĂ­l",
+ "MĂˇj",
+ "JĂşn",
+ "JĂşl",
+ "August",
+ "September",
+ "OktĂłber",
+ "November",
+ "December");
+
+// short month names
+Calendar._SMN = new Array
+("Jan",
+ "Feb",
+ "Mar",
+ "Apr",
+ "MĂˇj",
+ "JĂşn",
+ "JĂşl",
+ "Aug",
+ "Sep",
+ "Okt",
+ "Nov",
+ "Dec");
+
+// tooltips
+Calendar._TT = {};
+Calendar._TT["INFO"] = "O kalendĂˇri";
+
+Calendar._TT["ABOUT"] =
+"DHTML Date/Time Selector\n" +
+"(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n" +
+"PoslednĂş verziu nĂˇjdete na: http://www.dynarch.com/projects/calendar/\n" +
+"DistribuovanĂ© pod GNU LGPL.  ViÄŹ http://gnu.org/licenses/lgpl.html pre detaily." +
+"\n\n" +
+"VĂ˝ber dĂˇtumu:\n" +
+"- PouĹľite tlaÄŤidlĂˇ \xab, \xbb pre vĂ˝ber roku\n" +
+"- PouĹľite tlaÄŤidlĂˇ " + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a) + " pre vĂ˝ber mesiaca\n" +
+"- Ak ktorĂ©koÄľvek z tĂ˝chto tlaÄŤidiel podrĹľĂ­te dlhĹˇie, zobrazĂ­ sa rĂ˝chly vĂ˝ber.";
+Calendar._TT["ABOUT_TIME"] = "\n\n" +
+"VĂ˝ber ÄŤasu:\n" +
+"- Kliknutie na niektorĂş poloĹľku ÄŤasu ju zvĂ˝Ĺˇi\n" +
+"- Shift-klik ju znĂ­Ĺľi\n" +
+"- Ak podrĹľĂ­te tlaÄŤĂ­tko stlaÄŤenĂ©, posĂşvanĂ­m menĂ­te hodnotu.";
+
+Calendar._TT["PREV_YEAR"] = "PredoĹˇlĂ˝ rok (podrĹľte pre menu)";
+Calendar._TT["PREV_MONTH"] = "PredoĹˇlĂ˝ mesiac (podrĹľte pre menu)";
+Calendar._TT["GO_TODAY"] = "PrejsĹĄ na dneĹˇok";
+Calendar._TT["NEXT_MONTH"] = "Nasl. mesiac (podrĹľte pre menu)";
+Calendar._TT["NEXT_YEAR"] = "Nasl. rok (podrĹľte pre menu)";
+Calendar._TT["SEL_DATE"] = "ZvoÄľte dĂˇtum";
+Calendar._TT["DRAG_TO_MOVE"] = "PodrĹľanĂ­m tlaÄŤĂ­tka zmenĂ­te polohu";
+Calendar._TT["PART_TODAY"] = " (dnes)";
+Calendar._TT["MON_FIRST"] = "ZobraziĹĄ pondelok ako prvĂ˝";
+Calendar._TT["SUN_FIRST"] = "ZobraziĹĄ nedeÄľu ako prvĂş";
+Calendar._TT["CLOSE"] = "ZavrieĹĄ";
+Calendar._TT["TODAY"] = "Dnes";
+Calendar._TT["TIME_PART"] = "(Shift-)klik/ĹĄahanie zmenĂ­ hodnotu";
+
+// date formats
+Calendar._TT["DEF_DATE_FORMAT"] = "$d. %m. %Y";
+Calendar._TT["TT_DATE_FORMAT"] = "%a, %e. %b";
+
+Calendar._TT["WK"] = "tĂ˝Ĺľ";

Property changes on: trunk/wb/include/jscalendar/lang/calendar-sk.js
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: trunk/wb/include/jscalendar/lang/calendar-he-utf8.js
===================================================================
--- trunk/wb/include/jscalendar/lang/calendar-he-utf8.js	(nonexistent)
+++ trunk/wb/include/jscalendar/lang/calendar-he-utf8.js	(revision 552)
@@ -0,0 +1,123 @@
+// ** I18N
+
+// Calendar EN language
+// Author: Idan Sofer, <idan@idanso.dyndns.org>
+// Encoding: UTF-8
+// Distributed under the same terms as the calendar itself.
+
+// For translators: please use UTF-8 if possible.  We strongly believe that
+// Unicode is the answer to a real internationalized world.  Also please
+// include your contact information in the header, as can be seen above.
+
+// full day names
+Calendar._DN = new Array
+("ראשון",
+ "שני",
+ "שלישי",
+ "רביעי",
+ "חמישי",
+ "שישי",
+ "שבת",
+ "ראשון");
+
+// Please note that the following array of short day names (and the same goes
+// for short month names, _SMN) isn't absolutely necessary.  We give it here
+// for exemplification on how one can customize the short day names, but if
+// they are simply the first N letters of the full name you can simply say:
+//
+//   Calendar._SDN_len = N; // short day name length
+//   Calendar._SMN_len = N; // short month name length
+//
+// If N = 3 then this is not needed either since we assume a value of 3 if not
+// present, to be compatible with translation files that were written before
+// this feature.
+
+// short day names
+Calendar._SDN = new Array
+("א",
+ "ב",
+ "ג",
+ "ד",
+ "ה",
+ "ו",
+ "ש",
+ "א");
+
+// full month names
+Calendar._MN = new Array
+("ינואר",
+ "פברואר",
+ "מרץ",
+ "אפריל",
+ "מאי",
+ "יוני",
+ "יולי",
+ "אוגוסט",
+ "ספטמבר",
+ "אוקטובר",
+ "נובמבר",
+ "דצמבר");
+
+// short month names
+Calendar._SMN = new Array
+("ינא",
+ "פבר",
+ "מרץ",
+ "אפר",
+ "מאי",
+ "יונ",
+ "יול",
+ "אוג",
+ "ספט",
+ "אוק",
+ "נוב",
+ "דצמ");
+
+// tooltips
+Calendar._TT = {};
+Calendar._TT["INFO"] = "אודות השנתון";
+
+Calendar._TT["ABOUT"] =
+"בחרן תאריך/שעה DHTML\n" +
+"(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n" + // don't translate this this ;-)
+"הגירסא האחרונה זמינה ב: http://www.dynarch.com/projects/calendar/\n" +
+"מופץ תחת זיכיון ה GNU LGPL.  עיין ב http://gnu.org/licenses/lgpl.html לפרטים נוספים." +
+"\n\n" +
+בחירת תאריך:\n" +
+"- השתמש בכפתורים \xab, \xbb לבחירת שנה\n" +
+"- השתמש בכפתורים " + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a) + " לבחירת חודש\n" +
+"- החזק העכבר לחוץ מעל הכפתורים המוזכרים לעיל לבחירה מהירה יותר.";
+Calendar._TT["ABOUT_TIME"] = "\n\n" +
+"בחירת זמן:\n" +
+"- לחץ על כל אחד מחלקי הזמן כדי להוסיף\n" +
+"- או shift בשילוב עם לחיצה כדי להחסיר\n" +
+"- או לחץ וגרור לפעולה מהירה יותר.";
+
+Calendar._TT["PREV_YEAR"] = "שנה קודמת - החזק לקבלת תפריט";
+Calendar._TT["PREV_MONTH"] = "חודש קודם - החזק לקבלת תפריט";
+Calendar._TT["GO_TODAY"] = "עבור להיום";
+Calendar._TT["NEXT_MONTH"] = "חודש הבא - החזק לתפריט";
+Calendar._TT["NEXT_YEAR"] = "שנה הבאה - החזק לתפריט";
+Calendar._TT["SEL_DATE"] = "בחר תאריך";
+Calendar._TT["DRAG_TO_MOVE"] = "גרור להזזה";
+Calendar._TT["PART_TODAY"] = " )היום(";
+
+// the following is to inform that "%s" is to be the first day of week
+// %s will be replaced with the day name.
+Calendar._TT["DAY_FIRST"] = "הצג %s קודם";
+
+// This may be locale-dependent.  It specifies the week-end days, as an array
+// of comma-separated numbers.  The numbers are from 0 to 6: 0 means Sunday, 1
+// means Monday, etc.
+Calendar._TT["WEEKEND"] = "6";
+
+Calendar._TT["CLOSE"] = "סגור";
+Calendar._TT["TODAY"] = "היום";
+Calendar._TT["TIME_PART"] = "(שיפט-)לחץ וגרור כדי לשנות ערך";
+
+// date formats
+Calendar._TT["DEF_DATE_FORMAT"] = "%Y-%m-%d";
+Calendar._TT["TT_DATE_FORMAT"] = "%a, %b %e";
+
+Calendar._TT["WK"] = "wk";
+Calendar._TT["TIME"] = "שעה::";

Property changes on: trunk/wb/include/jscalendar/lang/calendar-he-utf8.js
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: trunk/wb/include/jscalendar/lang/calendar-ro.js
===================================================================
--- trunk/wb/include/jscalendar/lang/calendar-ro.js	(nonexistent)
+++ trunk/wb/include/jscalendar/lang/calendar-ro.js	(revision 552)
@@ -0,0 +1,66 @@
+// ** I18N
+Calendar._DN = new Array
+("Duminică",
+ "Luni",
+ "Marţi",
+ "Miercuri",
+ "Joi",
+ "Vineri",
+ "Sâmbătă",
+ "Duminică");
+Calendar._SDN_len = 2;
+Calendar._MN = new Array
+("Ianuarie",
+ "Februarie",
+ "Martie",
+ "Aprilie",
+ "Mai",
+ "Iunie",
+ "Iulie",
+ "August",
+ "Septembrie",
+ "Octombrie",
+ "Noiembrie",
+ "Decembrie");
+
+// tooltips
+Calendar._TT = {};
+
+Calendar._TT["INFO"] = "Despre calendar";
+
+Calendar._TT["ABOUT"] =
+"DHTML Date/Time Selector\n" +
+"(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n" + // don't translate this this ;-)
+"Pentru ultima versiune vizitaţi: http://www.dynarch.com/projects/calendar/\n" +
+"Distribuit sub GNU LGPL.  See http://gnu.org/licenses/lgpl.html for details." +
+"\n\n" +
+"Selecţia datei:\n" +
+"- Folosiţi butoanele \xab, \xbb pentru a selecta anul\n" +
+"- Folosiţi butoanele " + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a) + " pentru a selecta luna\n" +
+"- Tineţi butonul mouse-ului apăsat pentru selecţie mai rapidă.";
+Calendar._TT["ABOUT_TIME"] = "\n\n" +
+"Selecţia orei:\n" +
+"- Click pe ora sau minut pentru a mări valoarea cu 1\n" +
+"- Sau Shift-Click pentru a micşora valoarea cu 1\n" +
+"- Sau Click şi drag pentru a selecta mai repede.";
+
+Calendar._TT["PREV_YEAR"] = "Anul precedent (lung pt menu)";
+Calendar._TT["PREV_MONTH"] = "Luna precedentă (lung pt menu)";
+Calendar._TT["GO_TODAY"] = "Data de azi";
+Calendar._TT["NEXT_MONTH"] = "Luna următoare (lung pt menu)";
+Calendar._TT["NEXT_YEAR"] = "Anul următor (lung pt menu)";
+Calendar._TT["SEL_DATE"] = "Selectează data";
+Calendar._TT["DRAG_TO_MOVE"] = "Trage pentru a mişca";
+Calendar._TT["PART_TODAY"] = " (astăzi)";
+Calendar._TT["DAY_FIRST"] = "Afişează %s prima zi";
+Calendar._TT["WEEKEND"] = "0,6";
+Calendar._TT["CLOSE"] = "Închide";
+Calendar._TT["TODAY"] = "Astăzi";
+Calendar._TT["TIME_PART"] = "(Shift-)Click sau drag pentru a selecta";
+
+// date formats
+Calendar._TT["DEF_DATE_FORMAT"] = "%d-%m-%Y";
+Calendar._TT["TT_DATE_FORMAT"] = "%A, %d %B";
+
+Calendar._TT["WK"] = "spt";
+Calendar._TT["TIME"] = "Ora:";

Property changes on: trunk/wb/include/jscalendar/lang/calendar-ro.js
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: trunk/wb/include/jscalendar/lang/calendar-af.js
===================================================================
--- trunk/wb/include/jscalendar/lang/calendar-af.js	(nonexistent)
+++ trunk/wb/include/jscalendar/lang/calendar-af.js	(revision 552)
@@ -0,0 +1,39 @@
+// ** I18N Afrikaans
+Calendar._DN = new Array
+("Sondag",
+ "Maandag",
+ "Dinsdag",
+ "Woensdag",
+ "Donderdag",
+ "Vrydag",
+ "Saterdag",
+ "Sondag");
+Calendar._MN = new Array
+("Januarie",
+ "Februarie",
+ "Maart",
+ "April",
+ "Mei",
+ "Junie",
+ "Julie",
+ "Augustus",
+ "September",
+ "Oktober",
+ "November",
+ "Desember");
+
+// tooltips
+Calendar._TT = {};
+Calendar._TT["TOGGLE"] = "Verander eerste dag van die week";
+Calendar._TT["PREV_YEAR"] = "Vorige jaar (hou vir keuselys)";
+Calendar._TT["PREV_MONTH"] = "Vorige maand (hou vir keuselys)";
+Calendar._TT["GO_TODAY"] = "Gaan na vandag";
+Calendar._TT["NEXT_MONTH"] = "Volgende maand (hou vir keuselys)";
+Calendar._TT["NEXT_YEAR"] = "Volgende jaar (hou vir keuselys)";
+Calendar._TT["SEL_DATE"] = "Kies datum";
+Calendar._TT["DRAG_TO_MOVE"] = "Sleep om te skuif";
+Calendar._TT["PART_TODAY"] = " (vandag)";
+Calendar._TT["MON_FIRST"] = "Vertoon Maandag eerste";
+Calendar._TT["SUN_FIRST"] = "Display Sunday first";
+Calendar._TT["CLOSE"] = "Close";
+Calendar._TT["TODAY"] = "Today";

Property changes on: trunk/wb/include/jscalendar/lang/calendar-af.js
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: trunk/wb/include/jscalendar/lang/calendar-ru.js
===================================================================
--- trunk/wb/include/jscalendar/lang/calendar-ru.js	(nonexistent)
+++ trunk/wb/include/jscalendar/lang/calendar-ru.js	(revision 552)
@@ -0,0 +1,123 @@
+// ** I18N
+
+// Calendar RU language
+// Translation: Sly Golovanov, http://golovanov.net, <sly@golovanov.net>
+// Encoding: any
+// Distributed under the same terms as the calendar itself.
+
+// For translators: please use UTF-8 if possible.  We strongly believe that
+// Unicode is the answer to a real internationalized world.  Also please
+// include your contact information in the header, as can be seen above.
+
+// full day names
+Calendar._DN = new Array
+("воскресенье",
+ "понедельник",
+ "вторник",
+ "среда",
+ "четверг",
+ "пятница",
+ "суббота",
+ "воскресенье");
+
+// Please note that the following array of short day names (and the same goes
+// for short month names, _SMN) isn't absolutely necessary.  We give it here
+// for exemplification on how one can customize the short day names, but if
+// they are simply the first N letters of the full name you can simply say:
+//
+//   Calendar._SDN_len = N; // short day name length
+//   Calendar._SMN_len = N; // short month name length
+//
+// If N = 3 then this is not needed either since we assume a value of 3 if not
+// present, to be compatible with translation files that were written before
+// this feature.
+
+// short day names
+Calendar._SDN = new Array
+("вск",
+ "пон",
+ "втр",
+ "срд",
+ "чет",
+ "пят",
+ "суб",
+ "вск");
+
+// full month names
+Calendar._MN = new Array
+("январь",
+ "февраль",
+ "март",
+ "апрель",
+ "май",
+ "июнь",
+ "июль",
+ "август",
+ "сентябрь",
+ "октябрь",
+ "ноябрь",
+ "декабрь");
+
+// short month names
+Calendar._SMN = new Array
+("янв",
+ "фев",
+ "мар",
+ "апр",
+ "май",
+ "июн",
+ "июл",
+ "авг",
+ "сен",
+ "окт",
+ "ноя",
+ "дек");
+
+// tooltips
+Calendar._TT = {};
+Calendar._TT["INFO"] = "О календаре...";
+
+Calendar._TT["ABOUT"] =
+"DHTML Date/Time Selector\n" +
+"(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n" + // don't translate this this ;-)
+"For latest version visit: http://www.dynarch.com/projects/calendar/\n" +
+"Distributed under GNU LGPL.  See http://gnu.org/licenses/lgpl.html for details." +
+"\n\n" +
+"Как выбрать дату:\n" +
+"- При помощи кнопок \xab, \xbb можно выбрать год\n" +
+"- При помощи кнопок " + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a) + " можно выбрать месяц\n" +
+"- Подержите эти кнопки нажатыми, чтобы появилось меню быстрого выбора.";
+Calendar._TT["ABOUT_TIME"] = "\n\n" +
+"Как выбрать время:\n" +
+"- При клике на часах или минутах они увеличиваются\n" +
+"- при клике с нажатой клавишей Shift они уменьшаются\n" +
+"- если нажать и двигать мышкой влево/вправо, они будут меняться быстрее.";
+
+Calendar._TT["PREV_YEAR"] = "На год назад (удерживать для меню)";
+Calendar._TT["PREV_MONTH"] = "На месяц назад (удерживать для меню)";
+Calendar._TT["GO_TODAY"] = "Сегодня";
+Calendar._TT["NEXT_MONTH"] = "На месяц вперед (удерживать для меню)";
+Calendar._TT["NEXT_YEAR"] = "На год вперед (удерживать для меню)";
+Calendar._TT["SEL_DATE"] = "Выберите дату";
+Calendar._TT["DRAG_TO_MOVE"] = "Перетаскивайте мышкой";
+Calendar._TT["PART_TODAY"] = " (сегодня)";
+
+// the following is to inform that "%s" is to be the first day of week
+// %s will be replaced with the day name.
+Calendar._TT["DAY_FIRST"] = "Первый день недели будет %s";
+
+// This may be locale-dependent.  It specifies the week-end days, as an array
+// of comma-separated numbers.  The numbers are from 0 to 6: 0 means Sunday, 1
+// means Monday, etc.
+Calendar._TT["WEEKEND"] = "0,6";
+
+Calendar._TT["CLOSE"] = "Закрыть";
+Calendar._TT["TODAY"] = "Сегодня";
+Calendar._TT["TIME_PART"] = "(Shift-)клик или нажать и двигать";
+
+// date formats
+Calendar._TT["DEF_DATE_FORMAT"] = "%Y-%m-%d";
+Calendar._TT["TT_DATE_FORMAT"] = "%e %b, %a";
+
+Calendar._TT["WK"] = "нед";
+Calendar._TT["TIME"] = "Время:";

Property changes on: trunk/wb/include/jscalendar/lang/calendar-ru.js
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: trunk/wb/include/jscalendar/lang/calendar-al.js
===================================================================
--- trunk/wb/include/jscalendar/lang/calendar-al.js	(nonexistent)
+++ trunk/wb/include/jscalendar/lang/calendar-al.js	(revision 552)
@@ -0,0 +1,101 @@
+// Calendar ALBANIAN language
+//author Rigels Gordani rige@hotmail.com
+
+// ditet
+Calendar._DN = new Array
+("E Diele",
+"E Hene",
+"E Marte",
+"E Merkure",
+"E Enjte",
+"E Premte",
+"E Shtune",
+"E Diele");
+
+//ditet shkurt
+Calendar._SDN = new Array
+("Die",
+"Hen",
+"Mar",
+"Mer",
+"Enj",
+"Pre",
+"Sht",
+"Die");
+
+// muajt
+Calendar._MN = new Array
+("Janar",
+"Shkurt",
+"Mars",
+"Prill",
+"Maj",
+"Qeshor",
+"Korrik",
+"Gusht",
+"Shtator",
+"Tetor",
+"Nentor",
+"Dhjetor");
+
+// muajte shkurt
+Calendar._SMN = new Array
+("Jan",
+"Shk",
+"Mar",
+"Pri",
+"Maj",
+"Qes",
+"Kor",
+"Gus",
+"Sht",
+"Tet",
+"Nen",
+"Dhj");
+
+// ndihmesa
+Calendar._TT = {};
+Calendar._TT["INFO"] = "Per kalendarin";
+
+Calendar._TT["ABOUT"] =
+"Zgjedhes i ores/dates ne DHTML \n" +
+"\n\n" +"Zgjedhja e Dates:\n" +
+"- Perdor butonat \xab, \xbb per te zgjedhur vitin\n" +
+"- Perdor  butonat" + String.fromCharCode(0x2039) + ", " + 
+String.fromCharCode(0x203a) +
+" per te  zgjedhur muajin\n" +
+"- Mbani shtypur butonin e mousit per nje zgjedje me te shpejte.";
+Calendar._TT["ABOUT_TIME"] = "\n\n" +
+"Zgjedhja e kohes:\n" +
+"- Kliko tek ndonje nga pjeset e ores per ta rritur ate\n" +
+"- ose kliko me Shift per ta zvogeluar ate\n" +
+"- ose cliko dhe terhiq per zgjedhje me te shpejte.";
+
+Calendar._TT["PREV_YEAR"] = "Viti i shkuar (prit per menune)";
+Calendar._TT["PREV_MONTH"] = "Muaji i shkuar (prit per menune)";
+Calendar._TT["GO_TODAY"] = "Sot";
+Calendar._TT["NEXT_MONTH"] = "Muaji i ardhshem (prit per menune)";
+Calendar._TT["NEXT_YEAR"] = "Viti i ardhshem (prit per menune)";
+Calendar._TT["SEL_DATE"] = "Zgjidh daten";
+Calendar._TT["DRAG_TO_MOVE"] = "Terhiqe per te levizur";
+Calendar._TT["PART_TODAY"] = " (sot)";
+
+// "%s" eshte dita e pare e javes
+// %s do te zevendesohet me emrin e dite
+Calendar._TT["DAY_FIRST"] = "Trego te %s te paren";
+
+
+Calendar._TT["WEEKEND"] = "0,6";
+
+Calendar._TT["CLOSE"] = "Mbyll";
+Calendar._TT["TODAY"] = "Sot";
+Calendar._TT["TIME_PART"] = "Kliko me (Shift-)ose terhiqe per te ndryshuar 
+vleren";
+
+// date formats
+Calendar._TT["DEF_DATE_FORMAT"] = "%Y-%m-%d";
+Calendar._TT["TT_DATE_FORMAT"] = "%a, %b %e";
+
+Calendar._TT["WK"] = "Java";
+Calendar._TT["TIME"] = "Koha:";
+

Property changes on: trunk/wb/include/jscalendar/lang/calendar-al.js
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: trunk/wb/include/jscalendar/lang/calendar-hr-utf8.js
===================================================================
--- trunk/wb/include/jscalendar/lang/calendar-hr-utf8.js	(nonexistent)
+++ trunk/wb/include/jscalendar/lang/calendar-hr-utf8.js	(revision 552)
@@ -0,0 +1,49 @@
+/* Croatian language file for the DHTML Calendar version 0.9.2 
+* Author Krunoslav Zubrinic <krunoslav.zubrinic@vip.hr>, June 2003.
+* Feel free to use this script under the terms of the GNU Lesser General
+* Public License, as long as you do not remove or alter this notice.
+*/
+Calendar._DN = new Array
+("Nedjelja",
+ "Ponedjeljak",
+ "Utorak",
+ "Srijeda",
+ "Četvrtak",
+ "Petak",
+ "Subota",
+ "Nedjelja");
+Calendar._MN = new Array
+("Siječanj",
+ "Veljača",
+ "Ožujak",
+ "Travanj",
+ "Svibanj",
+ "Lipanj",
+ "Srpanj",
+ "Kolovoz",
+ "Rujan",
+ "Listopad",
+ "Studeni",
+ "Prosinac");
+
+// tooltips
+Calendar._TT = {};
+Calendar._TT["TOGGLE"] = "Promjeni dan s kojim počinje tjedan";
+Calendar._TT["PREV_YEAR"] = "Prethodna godina (dugi pritisak za meni)";
+Calendar._TT["PREV_MONTH"] = "Prethodni mjesec (dugi pritisak za meni)";
+Calendar._TT["GO_TODAY"] = "Idi na tekući dan";
+Calendar._TT["NEXT_MONTH"] = "Slijedeći mjesec (dugi pritisak za meni)";
+Calendar._TT["NEXT_YEAR"] = "Slijedeća godina (dugi pritisak za meni)";
+Calendar._TT["SEL_DATE"] = "Izaberite datum";
+Calendar._TT["DRAG_TO_MOVE"] = "Pritisni i povuci za promjenu pozicije";
+Calendar._TT["PART_TODAY"] = " (today)";
+Calendar._TT["MON_FIRST"] = "Prikaži ponedjeljak kao prvi dan";
+Calendar._TT["SUN_FIRST"] = "Prikaži nedjelju kao prvi dan";
+Calendar._TT["CLOSE"] = "Zatvori";
+Calendar._TT["TODAY"] = "Danas";
+
+// date formats
+Calendar._TT["DEF_DATE_FORMAT"] = "dd-mm-y";
+Calendar._TT["TT_DATE_FORMAT"] = "DD, dd.mm.y";
+
+Calendar._TT["WK"] = "Tje";
\ No newline at end of file

Property changes on: trunk/wb/include/jscalendar/lang/calendar-hr-utf8.js
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: trunk/wb/include/jscalendar/lang/calendar-pl-utf8.js
===================================================================
--- trunk/wb/include/jscalendar/lang/calendar-pl-utf8.js	(nonexistent)
+++ trunk/wb/include/jscalendar/lang/calendar-pl-utf8.js	(revision 552)
@@ -0,0 +1,93 @@
+﻿// ** I18N
+
+// Calendar PL language
+// Author: Dariusz Pietrzak, <eyck@ghost.anime.pl>
+// Author: Janusz Piwowarski, <jpiw@go2.pl>
+// Encoding: utf-8
+// Distributed under the same terms as the calendar itself.
+
+Calendar._DN = new Array
+("Niedziela",
+ "Poniedziałek",
+ "Wtorek",
+ "Środa",
+ "Czwartek",
+ "Piątek",
+ "Sobota",
+ "Niedziela");
+Calendar._SDN = new Array
+("Nie",
+ "Pn",
+ "Wt",
+ "Śr",
+ "Cz",
+ "Pt",
+ "So",
+ "Nie");
+Calendar._MN = new Array
+("Styczeń",
+ "Luty",
+ "Marzec",
+ "Kwiecień",
+ "Maj",
+ "Czerwiec",
+ "Lipiec",
+ "Sierpień",
+ "Wrzesień",
+ "Październik",
+ "Listopad",
+ "Grudzień");
+Calendar._SMN = new Array
+("Sty",
+ "Lut",
+ "Mar",
+ "Kwi",
+ "Maj",
+ "Cze",
+ "Lip",
+ "Sie",
+ "Wrz",
+ "Paź",
+ "Lis",
+ "Gru");
+
+// tooltips
+Calendar._TT = {};
+Calendar._TT["INFO"] = "O kalendarzu";
+
+Calendar._TT["ABOUT"] =
+"DHTML Date/Time Selector\n" +
+"(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n" + // don't translate this this ;-)
+"Aby pobrać najnowszą wersję, odwiedź: http://www.dynarch.com/projects/calendar/\n" +
+"Dostępny na licencji GNU LGPL. Zobacz szczegóły na http://gnu.org/licenses/lgpl.html." +
+"\n\n" +
+"Wybór daty:\n" +
+"- Użyj przycisków \xab, \xbb by wybrać rok\n" +
+"- Użyj przycisków " + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a) + " by wybrać miesiąc\n" +
+"- Przytrzymaj klawisz myszy nad jednym z powyższych przycisków dla szybszego wyboru.";
+Calendar._TT["ABOUT_TIME"] = "\n\n" +
+"Wybór czasu:\n" +
+"- Kliknij na jednym z pól czasu by zwiększyć jego wartość\n" +
+"- lub kliknij trzymając Shift by zmiejszyć jego wartość\n" +
+"- lub kliknij i przeciągnij dla szybszego wyboru.";
+
+//Calendar._TT["TOGGLE"] = "Zmień pierwszy dzień tygodnia";
+Calendar._TT["PREV_YEAR"] = "Poprzedni rok (przytrzymaj dla menu)";
+Calendar._TT["PREV_MONTH"] = "Poprzedni miesiąc (przytrzymaj dla menu)";
+Calendar._TT["GO_TODAY"] = "Idź do dzisiaj";
+Calendar._TT["NEXT_MONTH"] = "Następny miesiąc (przytrzymaj dla menu)";
+Calendar._TT["NEXT_YEAR"] = "Następny rok (przytrzymaj dla menu)";
+Calendar._TT["SEL_DATE"] = "Wybierz datę";
+Calendar._TT["DRAG_TO_MOVE"] = "Przeciągnij by przesunąć";
+Calendar._TT["PART_TODAY"] = " (dzisiaj)";
+Calendar._TT["MON_FIRST"] = "Wyświetl poniedziałek jako pierwszy";
+Calendar._TT["SUN_FIRST"] = "Wyświetl niedzielę jako pierwszą";
+Calendar._TT["CLOSE"] = "Zamknij";
+Calendar._TT["TODAY"] = "Dzisiaj";
+Calendar._TT["TIME_PART"] = "(Shift-)Kliknij lub przeciągnij by zmienić wartość";
+
+// date formats
+Calendar._TT["DEF_DATE_FORMAT"] = "%Y-%m-%d";
+Calendar._TT["TT_DATE_FORMAT"] = "%e %B, %A";
+
+Calendar._TT["WK"] = "ty";

Property changes on: trunk/wb/include/jscalendar/lang/calendar-pl-utf8.js
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: trunk/wb/include/jscalendar/lang/calendar-el.js
===================================================================
--- trunk/wb/include/jscalendar/lang/calendar-el.js	(nonexistent)
+++ trunk/wb/include/jscalendar/lang/calendar-el.js	(revision 552)
@@ -0,0 +1,89 @@
+﻿// ** I18N
+Calendar._DN = new Array
+("Κυριακή",
+ "Δευτέρα",
+ "Τρίτη",
+ "Τετάρτη",
+ "Πέμπτη",
+ "Παρασκευή",
+ "Σάββατο",
+ "Κυριακή");
+
+Calendar._SDN = new Array
+("Κυ",
+ "Δε",
+ "Tρ",
+ "Τε",
+ "Πε",
+ "Πα",
+ "Σα",
+ "Κυ");
+
+Calendar._MN = new Array
+("Ιανουάριος",
+ "Φεβρουάριος",
+ "Μάρτιος",
+ "Απρίλιος",
+ "Μάϊος",
+ "Ιούνιος",
+ "Ιούλιος",
+ "Αύγουστος",
+ "Σεπτέμβριος",
+ "Οκτώβριος",
+ "Νοέμβριος",
+ "Δεκέμβριος");
+
+Calendar._SMN = new Array
+("Ιαν",
+ "Φεβ",
+ "Μαρ",
+ "Απρ",
+ "Μαι",
+ "Ιουν",
+ "Ιουλ",
+ "Αυγ",
+ "Σεπ",
+ "Οκτ",
+ "Νοε",
+ "Δεκ");
+
+// tooltips
+Calendar._TT = {};
+Calendar._TT["INFO"] = "Για το ημερολόγιο";
+
+Calendar._TT["ABOUT"] =
+"Επιλογέας ημερομηνίας/ώρας σε DHTML\n" +
+"(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n" + // don't translate this this ;-)
+"Για τελευταία έκδοση: http://www.dynarch.com/projects/calendar/\n" +
+"Distributed under GNU LGPL.  See http://gnu.org/licenses/lgpl.html for details." +
+"\n\n" +
+"Επιλογή ημερομηνίας:\n" +
+"- Χρησιμοποιείστε τα κουμπιά \xab, \xbb για επιλογή έτους\n" +
+"- Χρησιμοποιείστε τα κουμπιά " + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a) + " για επιλογή μήνα\n" +
+"- Κρατήστε κουμπί ποντικού πατημένο στα παραπάνω κουμπιά για πιο γρήγορη επιλογή.";
+Calendar._TT["ABOUT_TIME"] = "\n\n" +
+"Επιλογή ώρας:\n" +
+"- Κάντε κλικ σε ένα από τα μέρη της ώρας για αύξηση\n" +
+"- ή Shift-κλικ για μείωση\n" +
+"- ή κλικ και μετακίνηση για πιο γρήγορη επιλογή.";
+Calendar._TT["TOGGLE"] = "Μπάρα πρώτης ημέρας της εβδομάδας";
+Calendar._TT["PREV_YEAR"] = "Προηγ. έτος (κρατήστε για το μενού)";
+Calendar._TT["PREV_MONTH"] = "Προηγ. μήνας (κρατήστε για το μενού)";
+Calendar._TT["GO_TODAY"] = "Σήμερα";
+Calendar._TT["NEXT_MONTH"] = "Επόμενος μήνας (κρατήστε για το μενού)";
+Calendar._TT["NEXT_YEAR"] = "Επόμενο έτος (κρατήστε για το μενού)";
+Calendar._TT["SEL_DATE"] = "Επιλέξτε ημερομηνία";
+Calendar._TT["DRAG_TO_MOVE"] = "Σύρτε για να μετακινήσετε";
+Calendar._TT["PART_TODAY"] = " (σήμερα)";
+Calendar._TT["MON_FIRST"] = "Εμφάνιση Δευτέρας πρώτα";
+Calendar._TT["SUN_FIRST"] = "Εμφάνιση Κυριακής πρώτα";
+Calendar._TT["CLOSE"] = "Κλείσιμο";
+Calendar._TT["TODAY"] = "Σήμερα";
+Calendar._TT["TIME_PART"] = "(Shift-)κλικ ή μετακίνηση για αλλαγή";
+
+// date formats
+Calendar._TT["DEF_DATE_FORMAT"] = "dd-mm-y";
+Calendar._TT["TT_DATE_FORMAT"] = "D, d M";
+
+Calendar._TT["WK"] = "εβδ";
+

Property changes on: trunk/wb/include/jscalendar/lang/calendar-el.js
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: trunk/wb/include/jscalendar/lang/calendar-cs-win.js
===================================================================
--- trunk/wb/include/jscalendar/lang/calendar-cs-win.js	(nonexistent)
+++ trunk/wb/include/jscalendar/lang/calendar-cs-win.js	(revision 552)
@@ -0,0 +1,65 @@
+/* 
+	calendar-cs-win.js
+	language: Czech
+	encoding: windows-1250
+	author: Lubos Jerabek (xnet@seznam.cz)
+	        Jan Uhlir (espinosa@centrum.cz)
+*/
+
+// ** I18N
+Calendar._DN  = new Array('Nedle','Pondl','ter','Steda','tvrtek','Ptek','Sobota','Nedle');
+Calendar._SDN = new Array('Ne','Po','t','St','t','P','So','Ne');
+Calendar._MN  = new Array('Leden','nor','Bezen','Duben','Kvten','erven','ervenec','Srpen','Z','jen','Listopad','Prosinec');
+Calendar._SMN = new Array('Led','no','Be','Dub','Kv','rv','vc','Srp','Z','j','Lis','Pro');
+
+// tooltips
+Calendar._TT = {};
+Calendar._TT["INFO"] = "O komponent kalend";
+Calendar._TT["TOGGLE"] = "Zmna prvnho dne v tdnu";
+Calendar._TT["PREV_YEAR"] = "Pedchoz rok (pidr pro menu)";
+Calendar._TT["PREV_MONTH"] = "Pedchoz msc (pidr pro menu)";
+Calendar._TT["GO_TODAY"] = "Dnen datum";
+Calendar._TT["NEXT_MONTH"] = "Dal msc (pidr pro menu)";
+Calendar._TT["NEXT_YEAR"] = "Dal rok (pidr pro menu)";
+Calendar._TT["SEL_DATE"] = "Vyber datum";
+Calendar._TT["DRAG_TO_MOVE"] = "Chy a thni, pro pesun";
+Calendar._TT["PART_TODAY"] = " (dnes)";
+Calendar._TT["MON_FIRST"] = "Uka jako prvn Pondl";
+//Calendar._TT["SUN_FIRST"] = "Uka jako prvn Nedli";
+
+Calendar._TT["ABOUT"] =
+"DHTML Date/Time Selector\n" +
+"(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n" + // don't translate this this ;-)
+"For latest version visit: http://www.dynarch.com/projects/calendar/\n" +
+"Distributed under GNU LGPL.  See http://gnu.org/licenses/lgpl.html for details." +
+"\n\n" +
+"Vbr datumu:\n" +
+"- Use the \xab, \xbb buttons to select year\n" +
+"- Pouijte tlatka " + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a) + " k vbru msce\n" +
+"- Podrte tlatko myi na jakmkoliv z tch tlatek pro rychlej vbr.";
+
+Calendar._TT["ABOUT_TIME"] = "\n\n" +
+"Vbr asu:\n" +
+"- Kliknte na jakoukoliv z st vbru asu pro zven.\n" +
+"- nebo Shift-click pro snen\n" +
+"- nebo kliknte a thnte pro rychlej vbr.";
+
+// the following is to inform that "%s" is to be the first day of week
+// %s will be replaced with the day name.
+Calendar._TT["DAY_FIRST"] = "Zobraz %s prvn";
+
+// This may be locale-dependent.  It specifies the week-end days, as an array
+// of comma-separated numbers.  The numbers are from 0 to 6: 0 means Sunday, 1
+// means Monday, etc.
+Calendar._TT["WEEKEND"] = "0,6";
+
+Calendar._TT["CLOSE"] = "Zavt";
+Calendar._TT["TODAY"] = "Dnes";
+Calendar._TT["TIME_PART"] = "(Shift-)Klikni nebo thni pro zmnu hodnoty";
+
+// date formats
+Calendar._TT["DEF_DATE_FORMAT"] = "d.m.yy";
+Calendar._TT["TT_DATE_FORMAT"] = "%a, %b %e";
+
+Calendar._TT["WK"] = "wk";
+Calendar._TT["TIME"] = "as:";

Property changes on: trunk/wb/include/jscalendar/lang/calendar-cs-win.js
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: trunk/wb/include/jscalendar/lang/calendar-en.js
===================================================================
--- trunk/wb/include/jscalendar/lang/calendar-en.js	(nonexistent)
+++ trunk/wb/include/jscalendar/lang/calendar-en.js	(revision 552)
@@ -0,0 +1,127 @@
+// ** I18N
+
+// Calendar EN language
+// Author: Mihai Bazon, <mihai_bazon@yahoo.com>
+// Encoding: any
+// Distributed under the same terms as the calendar itself.
+
+// For translators: please use UTF-8 if possible.  We strongly believe that
+// Unicode is the answer to a real internationalized world.  Also please
+// include your contact information in the header, as can be seen above.
+
+// full day names
+Calendar._DN = new Array
+("Sunday",
+ "Monday",
+ "Tuesday",
+ "Wednesday",
+ "Thursday",
+ "Friday",
+ "Saturday",
+ "Sunday");
+
+// Please note that the following array of short day names (and the same goes
+// for short month names, _SMN) isn't absolutely necessary.  We give it here
+// for exemplification on how one can customize the short day names, but if
+// they are simply the first N letters of the full name you can simply say:
+//
+//   Calendar._SDN_len = N; // short day name length
+//   Calendar._SMN_len = N; // short month name length
+//
+// If N = 3 then this is not needed either since we assume a value of 3 if not
+// present, to be compatible with translation files that were written before
+// this feature.
+
+// short day names
+Calendar._SDN = new Array
+("Sun",
+ "Mon",
+ "Tue",
+ "Wed",
+ "Thu",
+ "Fri",
+ "Sat",
+ "Sun");
+
+// First day of the week. "0" means display Sunday first, "1" means display
+// Monday first, etc.
+Calendar._FD = 0;
+
+// full month names
+Calendar._MN = new Array
+("January",
+ "February",
+ "March",
+ "April",
+ "May",
+ "June",
+ "July",
+ "August",
+ "September",
+ "October",
+ "November",
+ "December");
+
+// short month names
+Calendar._SMN = new Array
+("Jan",
+ "Feb",
+ "Mar",
+ "Apr",
+ "May",
+ "Jun",
+ "Jul",
+ "Aug",
+ "Sep",
+ "Oct",
+ "Nov",
+ "Dec");
+
+// tooltips
+Calendar._TT = {};
+Calendar._TT["INFO"] = "About the calendar";
+
+Calendar._TT["ABOUT"] =
+"DHTML Date/Time Selector\n" +
+"(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n" + // don't translate this this ;-)
+"For latest version visit: http://www.dynarch.com/projects/calendar/\n" +
+"Distributed under GNU LGPL.  See http://gnu.org/licenses/lgpl.html for details." +
+"\n\n" +
+"Date selection:\n" +
+"- Use the \xab, \xbb buttons to select year\n" +
+"- Use the " + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a) + " buttons to select month\n" +
+"- Hold mouse button on any of the above buttons for faster selection.";
+Calendar._TT["ABOUT_TIME"] = "\n\n" +
+"Time selection:\n" +
+"- Click on any of the time parts to increase it\n" +
+"- or Shift-click to decrease it\n" +
+"- or click and drag for faster selection.";
+
+Calendar._TT["PREV_YEAR"] = "Prev. year (hold for menu)";
+Calendar._TT["PREV_MONTH"] = "Prev. month (hold for menu)";
+Calendar._TT["GO_TODAY"] = "Go Today";
+Calendar._TT["NEXT_MONTH"] = "Next month (hold for menu)";
+Calendar._TT["NEXT_YEAR"] = "Next year (hold for menu)";
+Calendar._TT["SEL_DATE"] = "Select date";
+Calendar._TT["DRAG_TO_MOVE"] = "Drag to move";
+Calendar._TT["PART_TODAY"] = " (today)";
+
+// the following is to inform that "%s" is to be the first day of week
+// %s will be replaced with the day name.
+Calendar._TT["DAY_FIRST"] = "Display %s first";
+
+// This may be locale-dependent.  It specifies the week-end days, as an array
+// of comma-separated numbers.  The numbers are from 0 to 6: 0 means Sunday, 1
+// means Monday, etc.
+Calendar._TT["WEEKEND"] = "0,6";
+
+Calendar._TT["CLOSE"] = "Close";
+Calendar._TT["TODAY"] = "Today";
+Calendar._TT["TIME_PART"] = "(Shift-)Click or drag to change value";
+
+// date formats
+Calendar._TT["DEF_DATE_FORMAT"] = "%Y-%m-%d";
+Calendar._TT["TT_DATE_FORMAT"] = "%a, %b %e";
+
+Calendar._TT["WK"] = "wk";
+Calendar._TT["TIME"] = "Time:";

Property changes on: trunk/wb/include/jscalendar/lang/calendar-en.js
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: trunk/wb/include/jscalendar/lang/calendar-br.js
===================================================================
--- trunk/wb/include/jscalendar/lang/calendar-br.js	(nonexistent)
+++ trunk/wb/include/jscalendar/lang/calendar-br.js	(revision 552)
@@ -0,0 +1,108 @@
+﻿// ** I18N
+
+// Calendar pt-BR language
+// Author: Fernando Dourado, <fernando.dourado@ig.com.br>
+// Encoding: any
+// Distributed under the same terms as the calendar itself.
+
+// For translators: please use UTF-8 if possible.  We strongly believe that
+// Unicode is the answer to a real internationalized world.  Also please
+// include your contact information in the header, as can be seen above.
+
+// full day names
+Calendar._DN = new Array
+("Domingo",
+ "Segunda",
+ "Terça",
+ "Quarta",
+ "Quinta",
+ "Sexta",
+ "Sabádo",
+ "Domingo");
+
+// Please note that the following array of short day names (and the same goes
+// for short month names, _SMN) isn't absolutely necessary.  We give it here
+// for exemplification on how one can customize the short day names, but if
+// they are simply the first N letters of the full name you can simply say:
+//
+//   Calendar._SDN_len = N; // short day name length
+//   Calendar._SMN_len = N; // short month name length
+//
+// If N = 3 then this is not needed either since we assume a value of 3 if not
+// present, to be compatible with translation files that were written before
+// this feature.
+
+// short day names
+// [No changes using default values]
+
+// full month names
+Calendar._MN = new Array
+("Janeiro",
+ "Fevereiro",
+ "Março",
+ "Abril",
+ "Maio",
+ "Junho",
+ "Julho",
+ "Agosto",
+ "Setembro",
+ "Outubro",
+ "Novembro",
+ "Dezembro");
+
+// short month names
+// [No changes using default values]
+
+// tooltips
+Calendar._TT = {};
+Calendar._TT["INFO"] = "Sobre o calendário";
+
+Calendar._TT["ABOUT"] =
+"DHTML Date/Time Selector\n" +
+"(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n" + // don't translate this this ;-)
+"For latest version visit: http://www.dynarch.com/projects/calendar/\n" +
+"Distributed under GNU LGPL.  See http://gnu.org/licenses/lgpl.html for details." +
+"\n\n" +
+"Translate to portuguese Brazil (pt-BR) by Fernando Dourado (fernando.dourado@ig.com.br)\n" +
+"Tradução para o português Brasil (pt-BR) por Fernando Dourado (fernando.dourado@ig.com.br)" +
+"\n\n" +
+"Selecionar data:\n" +
+"- Use as teclas \xab, \xbb para selecionar o ano\n" +
+"- Use as teclas " + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a) + " para selecionar o mês\n" +
+"- Clique e segure com o mouse em qualquer botão para selecionar rapidamente.";
+
+Calendar._TT["ABOUT_TIME"] = "\n\n" +
+"Selecionar hora:\n" +
+"- Clique em qualquer uma das partes da hora para aumentar\n" +
+"- ou Shift-clique para diminuir\n" +
+"- ou clique e arraste para selecionar rapidamente.";
+
+Calendar._TT["PREV_YEAR"] = "Ano anterior (clique e segure para menu)";
+Calendar._TT["PREV_MONTH"] = "Mês anterior (clique e segure para menu)";
+Calendar._TT["GO_TODAY"] = "Ir para a data atual";
+Calendar._TT["NEXT_MONTH"] = "Próximo mês (clique e segure para menu)";
+Calendar._TT["NEXT_YEAR"] = "Próximo ano (clique e segure para menu)";
+Calendar._TT["SEL_DATE"] = "Selecione uma data";
+Calendar._TT["DRAG_TO_MOVE"] = "Clique e segure para mover";
+Calendar._TT["PART_TODAY"] = " (hoje)";
+
+// the following is to inform that "%s" is to be the first day of week
+// %s will be replaced with the day name.
+Calendar._TT["DAY_FIRST"] = "Exibir %s primeiro";
+
+// This may be locale-dependent.  It specifies the week-end days, as an array
+// of comma-separated numbers.  The numbers are from 0 to 6: 0 means Sunday, 1
+// means Monday, etc.
+Calendar._TT["WEEKEND"] = "0,6";
+
+Calendar._TT["CLOSE"] = "Fechar";
+Calendar._TT["TODAY"] = "Hoje";
+Calendar._TT["TIME_PART"] = "(Shift-)Clique ou arraste para mudar o valor";
+
+// date formats
+Calendar._TT["DEF_DATE_FORMAT"] = "%d/%m/%Y";
+Calendar._TT["TT_DATE_FORMAT"] = "%d de %B de %Y";
+
+Calendar._TT["WK"] = "sem";
+Calendar._TT["TIME"] = "Hora:";
+

Property changes on: trunk/wb/include/jscalendar/lang/calendar-br.js
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: trunk/wb/include/jscalendar/lang/calendar-lt-utf8.js
===================================================================
--- trunk/wb/include/jscalendar/lang/calendar-lt-utf8.js	(nonexistent)
+++ trunk/wb/include/jscalendar/lang/calendar-lt-utf8.js	(revision 552)
@@ -0,0 +1,114 @@
+// ** I18N
+
+// Calendar LT language
+// Author: Martynas Majeris, <martynas@solmetra.lt>
+// Encoding: UTF-8
+// Distributed under the same terms as the calendar itself.
+
+// For translators: please use UTF-8 if possible.  We strongly believe that
+// Unicode is the answer to a real internationalized world.  Also please
+// include your contact information in the header, as can be seen above.
+
+// full day names
+Calendar._DN = new Array
+("Sekmadienis",
+ "Pirmadienis",
+ "Antradienis",
+ "Trečiadienis",
+ "Ketvirtadienis",
+ "Pentadienis",
+ "Šeštadienis",
+ "Sekmadienis");
+
+// Please note that the following array of short day names (and the same goes
+// for short month names, _SMN) isn't absolutely necessary.  We give it here
+// for exemplification on how one can customize the short day names, but if
+// they are simply the first N letters of the full name you can simply say:
+//
+//   Calendar._SDN_len = N; // short day name length
+//   Calendar._SMN_len = N; // short month name length
+//
+// If N = 3 then this is not needed either since we assume a value of 3 if not
+// present, to be compatible with translation files that were written before
+// this feature.
+
+// short day names
+Calendar._SDN = new Array
+("Sek",
+ "Pir",
+ "Ant",
+ "Tre",
+ "Ket",
+ "Pen",
+ "Šeš",
+ "Sek");
+
+// full month names
+Calendar._MN = new Array
+("Sausis",
+ "Vasaris",
+ "Kovas",
+ "Balandis",
+ "Gegužė",
+ "Birželis",
+ "Liepa",
+ "Rugpjūtis",
+ "Rugsėjis",
+ "Spalis",
+ "Lapkritis",
+ "Gruodis");
+
+// short month names
+Calendar._SMN = new Array
+("Sau",
+ "Vas",
+ "Kov",
+ "Bal",
+ "Geg",
+ "Bir",
+ "Lie",
+ "Rgp",
+ "Rgs",
+ "Spa",
+ "Lap",
+ "Gru");
+
+// tooltips
+Calendar._TT = {};
+Calendar._TT["INFO"] = "Apie kalendorių";
+
+Calendar._TT["ABOUT"] =
+"DHTML Date/Time Selector\n" +
+"(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n" + // don't translate this this ;-)
+"Naujausią versiją rasite: http://www.dynarch.com/projects/calendar/\n" +
+"Platinamas pagal GNU LGPL licenciją. Aplankykite http://gnu.org/licenses/lgpl.html" +
+"\n\n" +
+"Datos pasirinkimas:\n" +
+"- Metų pasirinkimas: \xab, \xbb\n" +
+"- Mėnesio pasirinkimas: " + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a) + "\n" +
+"- Nuspauskite ir laikykite pelės klavišą greitesniam pasirinkimui.";
+Calendar._TT["ABOUT_TIME"] = "\n\n" +
+"Laiko pasirinkimas:\n" +
+"- Spustelkite ant valandų arba minučių - skaičius padidės vienetu.\n" +
+"- Jei spausite kartu su Shift, skaičius sumažės.\n" +
+"- Greitam pasirinkimui spustelkite ir pajudinkite pelę.";
+
+Calendar._TT["PREV_YEAR"] = "Ankstesni metai (laikykite, jei norite meniu)";
+Calendar._TT["PREV_MONTH"] = "Ankstesnis mėnuo (laikykite, jei norite meniu)";
+Calendar._TT["GO_TODAY"] = "Pasirinkti šiandieną";
+Calendar._TT["NEXT_MONTH"] = "Kitas mėnuo (laikykite, jei norite meniu)";
+Calendar._TT["NEXT_YEAR"] = "Kiti metai (laikykite, jei norite meniu)";
+Calendar._TT["SEL_DATE"] = "Pasirinkite datą";
+Calendar._TT["DRAG_TO_MOVE"] = "Tempkite";
+Calendar._TT["PART_TODAY"] = " (šiandien)";
+Calendar._TT["MON_FIRST"] = "Pirma savaitės diena - pirmadienis";
+Calendar._TT["SUN_FIRST"] = "Pirma savaitės diena - sekmadienis";
+Calendar._TT["CLOSE"] = "Uždaryti";
+Calendar._TT["TODAY"] = "Šiandien";
+Calendar._TT["TIME_PART"] = "Spustelkite arba tempkite jei norite pakeisti";
+
+// date formats
+Calendar._TT["DEF_DATE_FORMAT"] = "%Y-%m-%d";
+Calendar._TT["TT_DATE_FORMAT"] = "%A, %Y-%m-%d";
+
+Calendar._TT["WK"] = "sav";

Property changes on: trunk/wb/include/jscalendar/lang/calendar-lt-utf8.js
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: trunk/wb/include/jscalendar/lang/calendar-fr.js
===================================================================
--- trunk/wb/include/jscalendar/lang/calendar-fr.js	(nonexistent)
+++ trunk/wb/include/jscalendar/lang/calendar-fr.js	(revision 552)
@@ -0,0 +1,125 @@
+// ** I18N
+
+// Calendar EN language
+// Author: Mihai Bazon, <mihai_bazon@yahoo.com>
+// Encoding: any
+// Distributed under the same terms as the calendar itself.
+
+// For translators: please use UTF-8 if possible.  We strongly believe that
+// Unicode is the answer to a real internationalized world.  Also please
+// include your contact information in the header, as can be seen above.
+
+// Translator: David Duret, <pilgrim@mala-template.net> from previous french version
+
+// full day names
+Calendar._DN = new Array
+("Dimanche",
+ "Lundi",
+ "Mardi",
+ "Mercredi",
+ "Jeudi",
+ "Vendredi",
+ "Samedi",
+ "Dimanche");
+
+// Please note that the following array of short day names (and the same goes
+// for short month names, _SMN) isn't absolutely necessary.  We give it here
+// for exemplification on how one can customize the short day names, but if
+// they are simply the first N letters of the full name you can simply say:
+//
+//   Calendar._SDN_len = N; // short day name length
+//   Calendar._SMN_len = N; // short month name length
+//
+// If N = 3 then this is not needed either since we assume a value of 3 if not
+// present, to be compatible with translation files that were written before
+// this feature.
+
+// short day names
+Calendar._SDN = new Array
+("Dim",
+ "Lun",
+ "Mar",
+ "Mar",
+ "Jeu",
+ "Ven",
+ "Sam",
+ "Dim");
+
+// full month names
+Calendar._MN = new Array
+("Janvier",
+ "Fvrier",
+ "Mars",
+ "Avril",
+ "Mai",
+ "Juin",
+ "Juillet",
+ "Aot",
+ "Septembre",
+ "Octobre",
+ "Novembre",
+ "Dcembre");
+
+// short month names
+Calendar._SMN = new Array
+("Jan",
+ "Fev",
+ "Mar",
+ "Avr",
+ "Mai",
+ "Juin",
+ "Juil",
+ "Aout",
+ "Sep",
+ "Oct",
+ "Nov",
+ "Dec");
+
+// tooltips
+Calendar._TT = {};
+Calendar._TT["INFO"] = "A propos du calendrier";
+
+Calendar._TT["ABOUT"] =
+"DHTML Date/Heure Selecteur\n" +
+"(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n" + // don't translate this this ;-)
+"Pour la derniere version visitez : http://www.dynarch.com/projects/calendar/\n" +
+"Distribu par GNU LGPL.  Voir http://gnu.org/licenses/lgpl.html pour les details." +
+"\n\n" +
+"Selection de la date :\n" +
+"- Utiliser les bouttons \xab, \xbb  pour selectionner l\'annee\n" +
+"- Utiliser les bouttons " + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a) + " pour selectionner les mois\n" +
+"- Garder la souris sur n'importe quels boutons pour une selection plus rapide";
+Calendar._TT["ABOUT_TIME"] = "\n\n" +
+"Selection de l\'heure :\n" +
+"- Cliquer sur heures ou minutes pour incrementer\n" +
+"- ou Maj-clic pour decrementer\n" +
+"- ou clic et glisser-deplacer pour une selection plus rapide";
+
+Calendar._TT["PREV_YEAR"] = "Anne prc. (maintenir pour menu)";
+Calendar._TT["PREV_MONTH"] = "Mois prc. (maintenir pour menu)";
+Calendar._TT["GO_TODAY"] = "Atteindre la date du jour";
+Calendar._TT["NEXT_MONTH"] = "Mois suiv. (maintenir pour menu)";
+Calendar._TT["NEXT_YEAR"] = "Anne suiv. (maintenir pour menu)";
+Calendar._TT["SEL_DATE"] = "Slectionner une date";
+Calendar._TT["DRAG_TO_MOVE"] = "Dplacer";
+Calendar._TT["PART_TODAY"] = " (Aujourd'hui)";
+
+// the following is to inform that "%s" is to be the first day of week
+// %s will be replaced with the day name.
+Calendar._TT["DAY_FIRST"] = "Afficher %s en premier";
+
+// This may be locale-dependent.  It specifies the week-end days, as an array
+// of comma-separated numbers.  The numbers are from 0 to 6: 0 means Sunday, 1
+// means Monday, etc.
+Calendar._TT["WEEKEND"] = "0,6";
+
+Calendar._TT["CLOSE"] = "Fermer";
+Calendar._TT["TODAY"] = "Aujourd'hui";
+Calendar._TT["TIME_PART"] = "(Maj-)Clic ou glisser pour modifier la valeur";
+
+// date formats
+Calendar._TT["DEF_DATE_FORMAT"] = "%d/%m/%Y";
+Calendar._TT["TT_DATE_FORMAT"] = "%a, %b %e";
+
+Calendar._TT["WK"] = "Sem.";
+Calendar._TT["TIME"] = "Heure :";

Property changes on: trunk/wb/include/jscalendar/lang/calendar-fr.js
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: trunk/wb/include/jscalendar/lang/calendar-hr.js
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: trunk/wb/include/jscalendar/lang/calendar-hr.js
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Index: trunk/wb/include/jscalendar/lang/calendar-jp.js
===================================================================
--- trunk/wb/include/jscalendar/lang/calendar-jp.js	(nonexistent)
+++ trunk/wb/include/jscalendar/lang/calendar-jp.js	(revision 552)
@@ -0,0 +1,45 @@
+// ** I18N
+Calendar._DN = new Array
+("",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "y",
+ "");
+Calendar._MN = new Array
+("1",
+ "2",
+ "3",
+ "4",
+ "5",
+ "6",
+ "7",
+ "8",
+ "9",
+ "10",
+ "11",
+ "12");
+
+// tooltips
+Calendar._TT = {};
+Calendar._TT["TOGGLE"] = "T̍ŏ̗j؂ւ";
+Calendar._TT["PREV_YEAR"] = "ON";
+Calendar._TT["PREV_MONTH"] = "O";
+Calendar._TT["GO_TODAY"] = "";
+Calendar._TT["NEXT_MONTH"] = "";
+Calendar._TT["NEXT_YEAR"] = "N";
+Calendar._TT["SEL_DATE"] = "tI";
+Calendar._TT["DRAG_TO_MOVE"] = "EBhËړ";
+Calendar._TT["PART_TODAY"] = " ()";
+Calendar._TT["MON_FIRST"] = "j擪";
+Calendar._TT["SUN_FIRST"] = "j擪";
+Calendar._TT["CLOSE"] = "";
+Calendar._TT["TODAY"] = "";
+
+// date formats
+Calendar._TT["DEF_DATE_FORMAT"] = "y-mm-dd";
+Calendar._TT["TT_DATE_FORMAT"] = "%m %d (%a)";
+
+Calendar._TT["WK"] = "T";

Property changes on: trunk/wb/include/jscalendar/lang/calendar-jp.js
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: trunk/wb/include/jscalendar/lang/calendar-nl.js
===================================================================
--- trunk/wb/include/jscalendar/lang/calendar-nl.js	(nonexistent)
+++ trunk/wb/include/jscalendar/lang/calendar-nl.js	(revision 552)
@@ -0,0 +1,73 @@
+// ** I18N
+Calendar._DN = new Array
+("Zondag",
+ "Maandag",
+ "Dinsdag",
+ "Woensdag",
+ "Donderdag",
+ "Vrijdag",
+ "Zaterdag",
+ "Zondag");
+
+Calendar._SDN_len = 2;
+
+Calendar._MN = new Array
+("Januari",
+ "Februari",
+ "Maart",
+ "April",
+ "Mei",
+ "Juni",
+ "Juli",
+ "Augustus",
+ "September",
+ "Oktober",
+ "November",
+ "December");
+
+// tooltips
+Calendar._TT = {};
+Calendar._TT["INFO"] = "Info";
+
+Calendar._TT["ABOUT"] =
+"DHTML Datum/Tijd Selector\n" +
+"(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n" +
+"Ga voor de meest recente versie naar: http://www.dynarch.com/projects/calendar/\n" +
+"Verspreid onder de GNU LGPL. Zie http://gnu.org/licenses/lgpl.html voor details." +
+"\n\n" +
+"Datum selectie:\n" +
+"- Gebruik de \xab \xbb knoppen om een jaar te selecteren\n" +
+"- Gebruik de " + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a) + " knoppen om een maand te selecteren\n" +
+"- Houd de muis ingedrukt op de genoemde knoppen voor een snellere selectie.";
+Calendar._TT["ABOUT_TIME"] = "\n\n" +
+"Tijd selectie:\n" +
+"- Klik op een willekeurig onderdeel van het tijd gedeelte om het te verhogen\n" +
+"- of Shift-klik om het te verlagen\n" +
+"- of klik en sleep voor een snellere selectie.";
+
+//Calendar._TT["TOGGLE"] = "Selecteer de eerste week-dag";
+Calendar._TT["PREV_YEAR"] = "Vorig jaar (ingedrukt voor menu)";
+Calendar._TT["PREV_MONTH"] = "Vorige maand (ingedrukt voor menu)";
+Calendar._TT["GO_TODAY"] = "Ga naar Vandaag";
+Calendar._TT["NEXT_MONTH"] = "Volgende maand (ingedrukt voor menu)";
+Calendar._TT["NEXT_YEAR"] = "Volgend jaar (ingedrukt voor menu)";
+Calendar._TT["SEL_DATE"] = "Selecteer datum";
+Calendar._TT["DRAG_TO_MOVE"] = "Klik en sleep om te verplaatsen";
+Calendar._TT["PART_TODAY"] = " (vandaag)";
+//Calendar._TT["MON_FIRST"] = "Toon Maandag eerst";
+//Calendar._TT["SUN_FIRST"] = "Toon Zondag eerst";
+
+Calendar._TT["DAY_FIRST"] = "Toon %s eerst";
+
+Calendar._TT["WEEKEND"] = "0,6";
+
+Calendar._TT["CLOSE"] = "Sluiten";
+Calendar._TT["TODAY"] = "(vandaag)";
+Calendar._TT["TIME_PART"] = "(Shift-)Klik of sleep om de waarde te veranderen";
+
+// date formats
+Calendar._TT["DEF_DATE_FORMAT"] = "%d-%m-%Y";
+Calendar._TT["TT_DATE_FORMAT"] = "%a, %e %b %Y";
+
+Calendar._TT["WK"] = "wk";
+Calendar._TT["TIME"] = "Tijd:";
\ No newline at end of file

Property changes on: trunk/wb/include/jscalendar/lang/calendar-nl.js
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: trunk/wb/include/jscalendar/lang/calendar-pl.js
===================================================================
--- trunk/wb/include/jscalendar/lang/calendar-pl.js	(nonexistent)
+++ trunk/wb/include/jscalendar/lang/calendar-pl.js	(revision 552)
@@ -0,0 +1,56 @@
+// ** I18N
+// Calendar PL language
+// Author: Artur Filipiak, <imagen@poczta.fm>
+// January, 2004
+// Encoding: UTF-8
+Calendar._DN = new Array
+("Niedziela", "Poniedziałek", "Wtorek", "Środa", "Czwartek", "Piątek", "Sobota", "Niedziela");
+
+Calendar._SDN = new Array
+("N", "Pn", "Wt", "Śr", "Cz", "Pt", "So", "N");
+
+Calendar._MN = new Array
+("Styczeń", "Luty", "Marzec", "Kwiecień", "Maj", "Czerwiec", "Lipiec", "Sierpień", "Wrzesień", "Październik", "Listopad", "Grudzień");
+
+Calendar._SMN = new Array
+("Sty", "Lut", "Mar", "Kwi", "Maj", "Cze", "Lip", "Sie", "Wrz", "Paź", "Lis", "Gru");
+
+// tooltips
+Calendar._TT = {};
+Calendar._TT["INFO"] = "O kalendarzu";
+
+Calendar._TT["ABOUT"] =
+"DHTML Date/Time Selector\n" +
+"(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n" + // don't translate this this ;-)
+"For latest version visit: http://www.dynarch.com/projects/calendar/\n" +
+"Distributed under GNU LGPL.  See http://gnu.org/licenses/lgpl.html for details." +
+"\n\n" +
+"Wybór daty:\n" +
+"- aby wybrać rok użyj przycisków \xab, \xbb\n" +
+"- aby wybrać miesiąc użyj przycisków " + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a) + "\n" +
+"- aby przyspieszyć wybór przytrzymaj wciśnięty przycisk myszy nad ww. przyciskami.";
+Calendar._TT["ABOUT_TIME"] = "\n\n" +
+"Wybór czasu:\n" +
+"- aby zwiększyć wartość kliknij na dowolnym elemencie selekcji czasu\n" +
+"- aby zmniejszyć wartość użyj dodatkowo klawisza Shift\n" +
+"- możesz również poruszać myszkę w lewo i prawo wraz z wciśniętym lewym klawiszem.";
+
+Calendar._TT["PREV_YEAR"] = "Poprz. rok (przytrzymaj dla menu)";
+Calendar._TT["PREV_MONTH"] = "Poprz. miesiąc (przytrzymaj dla menu)";
+Calendar._TT["GO_TODAY"] = "Pokaż dziś";
+Calendar._TT["NEXT_MONTH"] = "Nast. miesiąc (przytrzymaj dla menu)";
+Calendar._TT["NEXT_YEAR"] = "Nast. rok (przytrzymaj dla menu)";
+Calendar._TT["SEL_DATE"] = "Wybierz datę";
+Calendar._TT["DRAG_TO_MOVE"] = "Przesuń okienko";
+Calendar._TT["PART_TODAY"] = " (dziś)";
+Calendar._TT["MON_FIRST"] = "Pokaż Poniedziałek jako pierwszy";
+Calendar._TT["SUN_FIRST"] = "Pokaż Niedzielę jako pierwszą";
+Calendar._TT["CLOSE"] = "Zamknij";
+Calendar._TT["TODAY"] = "Dziś";
+Calendar._TT["TIME_PART"] = "(Shift-)klik | drag, aby zmienić wartość";
+
+// date formats
+Calendar._TT["DEF_DATE_FORMAT"] = "%Y.%m.%d";
+Calendar._TT["TT_DATE_FORMAT"] = "%a, %b %e";
+
+Calendar._TT["WK"] = "wk";
\ No newline at end of file

Property changes on: trunk/wb/include/jscalendar/lang/calendar-pl.js
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: trunk/wb/include/jscalendar/lang/calendar-it.js
===================================================================
--- trunk/wb/include/jscalendar/lang/calendar-it.js	(nonexistent)
+++ trunk/wb/include/jscalendar/lang/calendar-it.js	(revision 552)
@@ -0,0 +1,124 @@
+// ** I18N
+
+// Calendar EN language
+// Author: Mihai Bazon, <mihai_bazon@yahoo.com>
+// Translator: Fabio Di Bernardini, <altraqua@email.it>
+// Encoding: any
+// Distributed under the same terms as the calendar itself.
+
+// For translators: please use UTF-8 if possible.  We strongly believe that
+// Unicode is the answer to a real internationalized world.  Also please
+// include your contact information in the header, as can be seen above.
+
+// full day names
+Calendar._DN = new Array
+("Domenica",
+ "Lunedì",
+ "Martedì",
+ "Mercoledì",
+ "Giovedì",
+ "Venerdì",
+ "Sabato",
+ "Domenica");
+
+// Please note that the following array of short day names (and the same goes
+// for short month names, _SMN) isn't absolutely necessary.  We give it here
+// for exemplification on how one can customize the short day names, but if
+// they are simply the first N letters of the full name you can simply say:
+//
+//   Calendar._SDN_len = N; // short day name length
+//   Calendar._SMN_len = N; // short month name length
+//
+// If N = 3 then this is not needed either since we assume a value of 3 if not
+// present, to be compatible with translation files that were written before
+// this feature.
+
+// short day names
+Calendar._SDN = new Array
+("Dom",
+ "Lun",
+ "Mar",
+ "Mer",
+ "Gio",
+ "Ven",
+ "Sab",
+ "Dom");
+
+// full month names
+Calendar._MN = new Array
+("Gennaio",
+ "Febbraio",
+ "Marzo",
+ "Aprile",
+ "Maggio",
+ "Giugno",
+ "Luglio",
+ "Augosto",
+ "Settembre",
+ "Ottobre",
+ "Novembre",
+ "Dicembre");
+
+// short month names
+Calendar._SMN = new Array
+("Gen",
+ "Feb",
+ "Mar",
+ "Apr",
+ "Mag",
+ "Giu",
+ "Lug",
+ "Ago",
+ "Set",
+ "Ott",
+ "Nov",
+ "Dic");
+
+// tooltips
+Calendar._TT = {};
+Calendar._TT["INFO"] = "Informazioni sul calendario";
+
+Calendar._TT["ABOUT"] =
+"DHTML Date/Time Selector\n" +
+"(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n" + // don't translate this this ;-)
+"Per gli aggiornamenti: http://www.dynarch.com/projects/calendar/\n" +
+"Distribuito sotto licenza GNU LGPL.  Vedi http://gnu.org/licenses/lgpl.html per i dettagli." +
+"\n\n" +
+"Selezione data:\n" +
+"- Usa \xab, \xbb per selezionare l'anno\n" +
+"- Usa  " + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a) + " per i mesi\n" +
+"- Tieni premuto a lungo il mouse per accedere alle funzioni di selezione veloce.";
+Calendar._TT["ABOUT_TIME"] = "\n\n" +
+"Selezione orario:\n" +
+"- Clicca sul numero per incrementarlo\n" +
+"- o Shift+click per decrementarlo\n" +
+"- o click e sinistra o destra per variarlo.";
+
+Calendar._TT["PREV_YEAR"] = "Anno prec.(clicca a lungo per il menù)";
+Calendar._TT["PREV_MONTH"] = "Mese prec. (clicca a lungo per il menù)";
+Calendar._TT["GO_TODAY"] = "Oggi";
+Calendar._TT["NEXT_MONTH"] = "Pross. mese (clicca a lungo per il menù)";
+Calendar._TT["NEXT_YEAR"] = "Pross. anno (clicca a lungo per il menù)";
+Calendar._TT["SEL_DATE"] = "Seleziona data";
+Calendar._TT["DRAG_TO_MOVE"] = "Trascina per spostarlo";
+Calendar._TT["PART_TODAY"] = " (oggi)";
+
+// the following is to inform that "%s" is to be the first day of week
+// %s will be replaced with the day name.
+Calendar._TT["DAY_FIRST"] = "Mostra prima %s";
+
+// This may be locale-dependent.  It specifies the week-end days, as an array
+// of comma-separated numbers.  The numbers are from 0 to 6: 0 means Sunday, 1
+// means Monday, etc.
+Calendar._TT["WEEKEND"] = "0,6";
+
+Calendar._TT["CLOSE"] = "Chiudi";
+Calendar._TT["TODAY"] = "Oggi";
+Calendar._TT["TIME_PART"] = "(Shift-)Click o trascina per cambiare il valore";
+
+// date formats
+Calendar._TT["DEF_DATE_FORMAT"] = "%d-%m-%Y";
+Calendar._TT["TT_DATE_FORMAT"] = "%a:%b:%e";
+
+Calendar._TT["WK"] = "set";
+Calendar._TT["TIME"] = "Ora:";

Property changes on: trunk/wb/include/jscalendar/lang/calendar-it.js
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: trunk/wb/include/jscalendar/lang/calendar-lt.js
===================================================================
--- trunk/wb/include/jscalendar/lang/calendar-lt.js	(nonexistent)
+++ trunk/wb/include/jscalendar/lang/calendar-lt.js	(revision 552)
@@ -0,0 +1,114 @@
+// ** I18N
+
+// Calendar LT language
+// Author: Martynas Majeris, <martynas@solmetra.lt>
+// Encoding: Windows-1257
+// Distributed under the same terms as the calendar itself.
+
+// For translators: please use UTF-8 if possible.  We strongly believe that
+// Unicode is the answer to a real internationalized world.  Also please
+// include your contact information in the header, as can be seen above.
+
+// full day names
+Calendar._DN = new Array
+("Sekmadienis",
+ "Pirmadienis",
+ "Antradienis",
+ "Treiadienis",
+ "Ketvirtadienis",
+ "Pentadienis",
+ "etadienis",
+ "Sekmadienis");
+
+// Please note that the following array of short day names (and the same goes
+// for short month names, _SMN) isn't absolutely necessary.  We give it here
+// for exemplification on how one can customize the short day names, but if
+// they are simply the first N letters of the full name you can simply say:
+//
+//   Calendar._SDN_len = N; // short day name length
+//   Calendar._SMN_len = N; // short month name length
+//
+// If N = 3 then this is not needed either since we assume a value of 3 if not
+// present, to be compatible with translation files that were written before
+// this feature.
+
+// short day names
+Calendar._SDN = new Array
+("Sek",
+ "Pir",
+ "Ant",
+ "Tre",
+ "Ket",
+ "Pen",
+ "e",
+ "Sek");
+
+// full month names
+Calendar._MN = new Array
+("Sausis",
+ "Vasaris",
+ "Kovas",
+ "Balandis",
+ "Gegu",
+ "Birelis",
+ "Liepa",
+ "Rugpjtis",
+ "Rugsjis",
+ "Spalis",
+ "Lapkritis",
+ "Gruodis");
+
+// short month names
+Calendar._SMN = new Array
+("Sau",
+ "Vas",
+ "Kov",
+ "Bal",
+ "Geg",
+ "Bir",
+ "Lie",
+ "Rgp",
+ "Rgs",
+ "Spa",
+ "Lap",
+ "Gru");
+
+// tooltips
+Calendar._TT = {};
+Calendar._TT["INFO"] = "Apie kalendori";
+
+Calendar._TT["ABOUT"] =
+"DHTML Date/Time Selector\n" +
+"(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n" + // don't translate this this ;-)
+"Naujausi versij rasite: http://www.dynarch.com/projects/calendar/\n" +
+"Platinamas pagal GNU LGPL licencij. Aplankykite http://gnu.org/licenses/lgpl.html" +
+"\n\n" +
+"Datos pasirinkimas:\n" +
+"- Met pasirinkimas: \xab, \xbb\n" +
+"- Mnesio pasirinkimas: " + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a) + "\n" +
+"- Nuspauskite ir laikykite pels klavi greitesniam pasirinkimui.";
+Calendar._TT["ABOUT_TIME"] = "\n\n" +
+"Laiko pasirinkimas:\n" +
+"- Spustelkite ant valand arba minui - skaius padids vienetu.\n" +
+"- Jei spausite kartu su Shift, skaiius sumas.\n" +
+"- Greitam pasirinkimui spustelkite ir pajudinkite pel.";
+
+Calendar._TT["PREV_YEAR"] = "Ankstesni metai (laikykite, jei norite meniu)";
+Calendar._TT["PREV_MONTH"] = "Ankstesnis mnuo (laikykite, jei norite meniu)";
+Calendar._TT["GO_TODAY"] = "Pasirinkti iandien";
+Calendar._TT["NEXT_MONTH"] = "Kitas mnuo (laikykite, jei norite meniu)";
+Calendar._TT["NEXT_YEAR"] = "Kiti metai (laikykite, jei norite meniu)";
+Calendar._TT["SEL_DATE"] = "Pasirinkite dat";
+Calendar._TT["DRAG_TO_MOVE"] = "Tempkite";
+Calendar._TT["PART_TODAY"] = " (iandien)";
+Calendar._TT["MON_FIRST"] = "Pirma savaits diena - pirmadienis";
+Calendar._TT["SUN_FIRST"] = "Pirma savaits diena - sekmadienis";
+Calendar._TT["CLOSE"] = "Udaryti";
+Calendar._TT["TODAY"] = "iandien";
+Calendar._TT["TIME_PART"] = "Spustelkite arba tempkite jei norite pakeisti";
+
+// date formats
+Calendar._TT["DEF_DATE_FORMAT"] = "%Y-%m-%d";
+Calendar._TT["TT_DATE_FORMAT"] = "%A, %Y-%m-%d";
+
+Calendar._TT["WK"] = "sav";

Property changes on: trunk/wb/include/jscalendar/lang/calendar-lt.js
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: trunk/wb/include/jscalendar/lang/calendar-lv.js
===================================================================
--- trunk/wb/include/jscalendar/lang/calendar-lv.js	(nonexistent)
+++ trunk/wb/include/jscalendar/lang/calendar-lv.js	(revision 552)
@@ -0,0 +1,123 @@
+// ** I18N
+
+// Calendar LV language
+// Author: Juris Valdovskis, <juris@dc.lv>
+// Encoding: cp1257
+// Distributed under the same terms as the calendar itself.
+
+// For translators: please use UTF-8 if possible.  We strongly believe that
+// Unicode is the answer to a real internationalized world.  Also please
+// include your contact information in the header, as can be seen above.
+
+// full day names
+Calendar._DN = new Array
+("Svtdiena",
+ "Pirmdiena",
+ "Otrdiena",
+ "Trediena",
+ "Ceturdiena",
+ "Piektdiena",
+ "Sestdiena",
+ "Svtdiena");
+
+// Please note that the following array of short day names (and the same goes
+// for short month names, _SMN) isn't absolutely necessary.  We give it here
+// for exemplification on how one can customize the short day names, but if
+// they are simply the first N letters of the full name you can simply say:
+//
+//   Calendar._SDN_len = N; // short day name length
+//   Calendar._SMN_len = N; // short month name length
+//
+// If N = 3 then this is not needed either since we assume a value of 3 if not
+// present, to be compatible with translation files that were written before
+// this feature.
+
+// short day names
+Calendar._SDN = new Array
+("Sv",
+ "Pr",
+ "Ot",
+ "Tr",
+ "Ce",
+ "Pk",
+ "Se",
+ "Sv");
+
+// full month names
+Calendar._MN = new Array
+("Janvris",
+ "Februris",
+ "Marts",
+ "Aprlis",
+ "Maijs",
+ "Jnijs",
+ "Jlijs",
+ "Augusts",
+ "Septembris",
+ "Oktobris",
+ "Novembris",
+ "Decembris");
+
+// short month names
+Calendar._SMN = new Array
+("Jan",
+ "Feb",
+ "Mar",
+ "Apr",
+ "Mai",
+ "Jn",
+ "Jl",
+ "Aug",
+ "Sep",
+ "Okt",
+ "Nov",
+ "Dec");
+
+// tooltips
+Calendar._TT = {};
+Calendar._TT["INFO"] = "Par kalendru";
+
+Calendar._TT["ABOUT"] =
+"DHTML Date/Time Selector\n" +
+"(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n" + // don't translate this this ;-)
+"For latest version visit: http://www.dynarch.com/projects/calendar/\n" +
+"Distributed under GNU LGPL.  See http://gnu.org/licenses/lgpl.html for details." +
+"\n\n" +
+"Datuma izvle:\n" +
+"- Izmanto \xab, \xbb pogas, lai izvltos gadu\n" +
+"- Izmanto " + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a) + "pogas, lai izvltos mnesi\n" +
+"- Turi nospiestu peles pogu uz jebkuru no augstk mintajm pogm, lai patrintu izvli.";
+Calendar._TT["ABOUT_TIME"] = "\n\n" +
+"Laika izvle:\n" +
+"- Uzklikini uz jebkuru no laika dam, lai palielintu to\n" +
+"- vai Shift-klikis, lai samazintu to\n" +
+"- vai noklikini un velc uz attiecgo virzienu lai maintu trk.";
+
+Calendar._TT["PREV_YEAR"] = "Iepr. gads (turi izvlnei)";
+Calendar._TT["PREV_MONTH"] = "Iepr. mnesis (turi izvlnei)";
+Calendar._TT["GO_TODAY"] = "odien";
+Calendar._TT["NEXT_MONTH"] = "Nkoais mnesis (turi izvlnei)";
+Calendar._TT["NEXT_YEAR"] = "Nkoais gads (turi izvlnei)";
+Calendar._TT["SEL_DATE"] = "Izvlies datumu";
+Calendar._TT["DRAG_TO_MOVE"] = "Velc, lai prvietotu";
+Calendar._TT["PART_TODAY"] = " (odien)";
+
+// the following is to inform that "%s" is to be the first day of week
+// %s will be replaced with the day name.
+Calendar._TT["DAY_FIRST"] = "Attlot %s k pirmo";
+
+// This may be locale-dependent.  It specifies the week-end days, as an array
+// of comma-separated numbers.  The numbers are from 0 to 6: 0 means Sunday, 1
+// means Monday, etc.
+Calendar._TT["WEEKEND"] = "1,7";
+
+Calendar._TT["CLOSE"] = "Aizvrt";
+Calendar._TT["TODAY"] = "odien";
+Calendar._TT["TIME_PART"] = "(Shift-)Klikis vai prvieto, lai maintu";
+
+// date formats
+Calendar._TT["DEF_DATE_FORMAT"] = "%d-%m-%Y";
+Calendar._TT["TT_DATE_FORMAT"] = "%a, %e %b";
+
+Calendar._TT["WK"] = "wk";
+Calendar._TT["TIME"] = "Laiks:";

Property changes on: trunk/wb/include/jscalendar/lang/calendar-lv.js
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: trunk/wb/include/jscalendar/lang/calendar-zh.js
===================================================================
--- trunk/wb/include/jscalendar/lang/calendar-zh.js	(nonexistent)
+++ trunk/wb/include/jscalendar/lang/calendar-zh.js	(revision 552)
@@ -0,0 +1,119 @@
+// ** I18N
+
+// Calendar ZH language
+// Author: muziq, <muziq@sina.com>
+// Encoding: GB2312 or GBK
+// Distributed under the same terms as the calendar itself.
+
+// full day names
+Calendar._DN = new Array
+("",
+ "һ",
+ "ڶ",
+ "",
+ "",
+ "",
+ "",
+ "");
+
+// Please note that the following array of short day names (and the same goes
+// for short month names, _SMN) isn't absolutely necessary.  We give it here
+// for exemplification on how one can customize the short day names, but if
+// they are simply the first N letters of the full name you can simply say:
+//
+//   Calendar._SDN_len = N; // short day name length
+//   Calendar._SMN_len = N; // short month name length
+//
+// If N = 3 then this is not needed either since we assume a value of 3 if not
+// present, to be compatible with translation files that were written before
+// this feature.
+
+// short day names
+Calendar._SDN = new Array
+("",
+ "һ",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "");
+
+// full month names
+Calendar._MN = new Array
+("һ",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "ʮ",
+ "ʮһ",
+ "ʮ");
+
+// short month names
+Calendar._SMN = new Array
+("һ",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "ʮ",
+ "ʮһ",
+ "ʮ");
+
+// tooltips
+Calendar._TT = {};
+Calendar._TT["INFO"] = "";
+
+Calendar._TT["ABOUT"] =
+"DHTML Date/Time Selector\n" +
+"(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n" + // don't translate this this ;-)
+"For latest version visit: http://www.dynarch.com/projects/calendar/\n" +
+"Distributed under GNU LGPL.  See http://gnu.org/licenses/lgpl.html for details." +
+"\n\n" +
+"ѡ:\n" +
+"-  \xab, \xbb ťѡ\n" +
+"-  " + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a) + " ťѡ·\n" +
+"- ϰťɴӲ˵пѡݻ·";
+Calendar._TT["ABOUT_TIME"] = "\n\n" +
+"ѡʱ:\n" +
+"- Сʱӿʹֵһ\n" +
+"- סShiftСʱӿʹֵһ\n" +
+"- ϶ɽпѡ";
+
+Calendar._TT["PREV_YEAR"] = "һ (ס˵)";
+Calendar._TT["PREV_MONTH"] = "һ (ס˵)";
+Calendar._TT["GO_TODAY"] = "ת";
+Calendar._TT["NEXT_MONTH"] = "һ (ס˵)";
+Calendar._TT["NEXT_YEAR"] = "һ (ס˵)";
+Calendar._TT["SEL_DATE"] = "ѡ";
+Calendar._TT["DRAG_TO_MOVE"] = "϶";
+Calendar._TT["PART_TODAY"] = " ()";
+
+// the following is to inform that "%s" is to be the first day of week
+// %s will be replaced with the day name.
+Calendar._TT["DAY_FIRST"] = "ʾ%s";
+
+// This may be locale-dependent.  It specifies the week-end days, as an array
+// of comma-separated numbers.  The numbers are from 0 to 6: 0 means Sunday, 1
+// means Monday, etc.
+Calendar._TT["WEEKEND"] = "0,6";
+
+Calendar._TT["CLOSE"] = "ر";
+Calendar._TT["TODAY"] = "";
+Calendar._TT["TIME_PART"] = "(Shift-)϶ıֵ";
+
+// date formats
+Calendar._TT["DEF_DATE_FORMAT"] = "%Y-%m-%d";
+Calendar._TT["TT_DATE_FORMAT"] = "%A, %b %e";
+
+Calendar._TT["WK"] = "";
+Calendar._TT["TIME"] = "ʱ:";

Property changes on: trunk/wb/include/jscalendar/lang/calendar-zh.js
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: trunk/wb/include/jscalendar/lang/calendar-sp.js
===================================================================
--- trunk/wb/include/jscalendar/lang/calendar-sp.js	(nonexistent)
+++ trunk/wb/include/jscalendar/lang/calendar-sp.js	(revision 552)
@@ -0,0 +1,110 @@
+// ** I18N
+
+// Calendar SP language
+// Author: Rafael Velasco <rvu_at_idecnet_dot_com>
+// Encoding: any
+// Distributed under the same terms as the calendar itself.
+
+// For translators: please use UTF-8 if possible.  We strongly believe that
+// Unicode is the answer to a real internationalized world.  Also please
+// include your contact information in the header, as can be seen above.
+
+// full day names
+Calendar._DN = new Array
+("Domingo",
+ "Lunes",
+ "Martes",
+ "Miercoles",
+ "Jueves",
+ "Viernes",
+ "Sabado",
+ "Domingo");
+
+Calendar._SDN = new Array
+("Dom",
+ "Lun",
+ "Mar",
+ "Mie",
+ "Jue",
+ "Vie",
+ "Sab",
+ "Dom");
+
+// full month names
+Calendar._MN = new Array
+("Enero",
+ "Febrero",
+ "Marzo",
+ "Abril",
+ "Mayo",
+ "Junio",
+ "Julio",
+ "Agosto",
+ "Septiembre",
+ "Octubre",
+ "Noviembre",
+ "Diciembre");
+
+// short month names
+Calendar._SMN = new Array
+("Ene",
+ "Feb",
+ "Mar",
+ "Abr",
+ "May",
+ "Jun",
+ "Jul",
+ "Ago",
+ "Sep",
+ "Oct",
+ "Nov",
+ "Dic");
+
+// tooltips
+Calendar._TT = {};
+Calendar._TT["INFO"] = "Informacin del Calendario";
+
+Calendar._TT["ABOUT"] =
+"DHTML Date/Time Selector\n" +
+"(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n" + // don't translate this this ;-)
+"Nuevas versiones en: http://www.dynarch.com/projects/calendar/\n" +
+"Distribuida bajo licencia GNU LGPL.  Para detalles vea http://gnu.org/licenses/lgpl.html ." +
+"\n\n" +
+"Seleccin de Fechas:\n" +
+"- Use  \xab, \xbb para seleccionar el ao\n" +
+"- Use " + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a) + " para seleccionar el mes\n" +
+"- Mantenga presionado el botn del ratn en cualquiera de las opciones superiores para un acceso rapido .";
+Calendar._TT["ABOUT_TIME"] = "\n\n" +
+"Seleccin del Reloj:\n" +
+"- Seleccione la hora para cambiar el reloj\n" +
+"- o presione  Shift-click para disminuirlo\n" +
+"- o presione click y arrastre del ratn para una seleccin rapida.";
+
+Calendar._TT["PREV_YEAR"] = "Ao anterior (Presione para menu)";
+Calendar._TT["PREV_MONTH"] = "Mes Anterior (Presione para menu)";
+Calendar._TT["GO_TODAY"] = "Ir a Hoy";
+Calendar._TT["NEXT_MONTH"] = "Mes Siguiente (Presione para menu)";
+Calendar._TT["NEXT_YEAR"] = "Ao Siguiente (Presione para menu)";
+Calendar._TT["SEL_DATE"] = "Seleccione fecha";
+Calendar._TT["DRAG_TO_MOVE"] = "Arrastre y mueva";
+Calendar._TT["PART_TODAY"] = " (Hoy)";
+
+// the following is to inform that "%s" is to be the first day of week
+// %s will be replaced with the day name.
+Calendar._TT["DAY_FIRST"] = "Mostrar %s primero";
+
+// This may be locale-dependent.  It specifies the week-end days, as an array
+// of comma-separated numbers.  The numbers are from 0 to 6: 0 means Sunday, 1
+// means Monday, etc.
+Calendar._TT["WEEKEND"] = "0,6";
+
+Calendar._TT["CLOSE"] = "Cerrar";
+Calendar._TT["TODAY"] = "Hoy";
+Calendar._TT["TIME_PART"] = "(Shift-)Click o arrastra para cambar el valor";
+
+// date formats
+Calendar._TT["DEF_DATE_FORMAT"] = "%dd-%mm-%yy";
+Calendar._TT["TT_DATE_FORMAT"] = "%A, %e de %B de %Y";
+
+Calendar._TT["WK"] = "Sm";
+Calendar._TT["TIME"] = "Hora:";

Property changes on: trunk/wb/include/jscalendar/lang/calendar-sp.js
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: trunk/wb/include/jscalendar/lang/calendar-ca.js
===================================================================
--- trunk/wb/include/jscalendar/lang/calendar-ca.js	(nonexistent)
+++ trunk/wb/include/jscalendar/lang/calendar-ca.js	(revision 552)
@@ -0,0 +1,123 @@
+// ** I18N
+
+// Calendar CA language
+// Author: Mihai Bazon, <mihai_bazon@yahoo.com>
+// Encoding: any
+// Distributed under the same terms as the calendar itself.
+
+// For translators: please use UTF-8 if possible.  We strongly believe that
+// Unicode is the answer to a real internationalized world.  Also please
+// include your contact information in the header, as can be seen above.
+
+// full day names
+Calendar._DN = new Array
+("Diumenge",
+ "Dilluns",
+ "Dimarts",
+ "Dimecres",
+ "Dijous",
+ "Divendres",
+ "Dissabte",
+ "Diumenge");
+
+// Please note that the following array of short day names (and the same goes
+// for short month names, _SMN) isn't absolutely necessary.  We give it here
+// for exemplification on how one can customize the short day names, but if
+// they are simply the first N letters of the full name you can simply say:
+//
+//   Calendar._SDN_len = N; // short day name length
+//   Calendar._SMN_len = N; // short month name length
+//
+// If N = 3 then this is not needed either since we assume a value of 3 if not
+// present, to be compatible with translation files that were written before
+// this feature.
+
+// short day names
+Calendar._SDN = new Array
+("Diu",
+ "Dil",
+ "Dmt",
+ "Dmc",
+ "Dij",
+ "Div",
+ "Dis",
+ "Diu");
+
+// full month names
+Calendar._MN = new Array
+("Gener",
+ "Febrer",
+ "Mar",
+ "Abril",
+ "Maig",
+ "Juny",
+ "Juliol",
+ "Agost",
+ "Setembre",
+ "Octubre",
+ "Novembre",
+ "Desembre");
+
+// short month names
+Calendar._SMN = new Array
+("Gen",
+ "Feb",
+ "Mar",
+ "Abr",
+ "Mai",
+ "Jun",
+ "Jul",
+ "Ago",
+ "Set",
+ "Oct",
+ "Nov",
+ "Des");
+
+// tooltips
+Calendar._TT = {};
+Calendar._TT["INFO"] = "Sobre el calendari";
+
+Calendar._TT["ABOUT"] =
+"DHTML Selector de Data/Hora\n" +
+"(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n" + // don't translate this this ;-)
+"For latest version visit: http://www.dynarch.com/projects/calendar/\n" +
+"Distributed under GNU LGPL.  See http://gnu.org/licenses/lgpl.html for details." +
+"\n\n" +
+"Sel.lecci de Dates:\n" +
+"- Fes servir els botons \xab, \xbb per sel.leccionar l'any\n" +
+"- Fes servir els botons " + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a) + " per se.lecciconar el mes\n" +
+"- Mant el ratol apretat en qualsevol dels anteriors per sel.lecci rpida.";
+Calendar._TT["ABOUT_TIME"] = "\n\n" +
+"Time selection:\n" +
+"- claca en qualsevol de les parts de la hora per augmentar-les\n" +
+"- o Shift-click per decrementar-la\n" +
+"- or click and arrastra per sel.lecci rpida.";
+
+Calendar._TT["PREV_YEAR"] = "Any anterior (Mantenir per menu)";
+Calendar._TT["PREV_MONTH"] = "Mes anterior (Mantenir per menu)";
+Calendar._TT["GO_TODAY"] = "Anar a avui";
+Calendar._TT["NEXT_MONTH"] = "Mes segent (Mantenir per menu)";
+Calendar._TT["NEXT_YEAR"] = "Any segent (Mantenir per menu)";
+Calendar._TT["SEL_DATE"] = "Sel.leccionar data";
+Calendar._TT["DRAG_TO_MOVE"] = "Arrastrar per moure";
+Calendar._TT["PART_TODAY"] = " (avui)";
+
+// the following is to inform that "%s" is to be the first day of week
+// %s will be replaced with the day name.
+Calendar._TT["DAY_FIRST"] = "Mostra %s primer";
+
+// This may be locale-dependent.  It specifies the week-end days, as an array
+// of comma-separated numbers.  The numbers are from 0 to 6: 0 means Sunday, 1
+// means Monday, etc.
+Calendar._TT["WEEKEND"] = "0,6";
+
+Calendar._TT["CLOSE"] = "Tanca";
+Calendar._TT["TODAY"] = "Avui";
+Calendar._TT["TIME_PART"] = "(Shift-)Click a arrastra per canviar el valor";
+
+// date formats
+Calendar._TT["DEF_DATE_FORMAT"] = "%Y-%m-%d";
+Calendar._TT["TT_DATE_FORMAT"] = "%a, %b %e";
+
+Calendar._TT["WK"] = "st";
+Calendar._TT["TIME"] = "Hora:";

Property changes on: trunk/wb/include/jscalendar/lang/calendar-ca.js
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: trunk/wb/include/jscalendar/lang/calendar-pt.js
===================================================================
--- trunk/wb/include/jscalendar/lang/calendar-pt.js	(nonexistent)
+++ trunk/wb/include/jscalendar/lang/calendar-pt.js	(revision 552)
@@ -0,0 +1,123 @@
+// ** I18N
+
+// Calendar pt_BR language
+// Author: Adalberto Machado, <betosm@terra.com.br>
+// Encoding: any
+// Distributed under the same terms as the calendar itself.
+
+// For translators: please use UTF-8 if possible.  We strongly believe that
+// Unicode is the answer to a real internationalized world.  Also please
+// include your contact information in the header, as can be seen above.
+
+// full day names
+Calendar._DN = new Array
+("Domingo",
+ "Segunda",
+ "Terca",
+ "Quarta",
+ "Quinta",
+ "Sexta",
+ "Sabado",
+ "Domingo");
+
+// Please note that the following array of short day names (and the same goes
+// for short month names, _SMN) isn't absolutely necessary.  We give it here
+// for exemplification on how one can customize the short day names, but if
+// they are simply the first N letters of the full name you can simply say:
+//
+//   Calendar._SDN_len = N; // short day name length
+//   Calendar._SMN_len = N; // short month name length
+//
+// If N = 3 then this is not needed either since we assume a value of 3 if not
+// present, to be compatible with translation files that were written before
+// this feature.
+
+// short day names
+Calendar._SDN = new Array
+("Dom",
+ "Seg",
+ "Ter",
+ "Qua",
+ "Qui",
+ "Sex",
+ "Sab",
+ "Dom");
+
+// full month names
+Calendar._MN = new Array
+("Janeiro",
+ "Fevereiro",
+ "Marco",
+ "Abril",
+ "Maio",
+ "Junho",
+ "Julho",
+ "Agosto",
+ "Setembro",
+ "Outubro",
+ "Novembro",
+ "Dezembro");
+
+// short month names
+Calendar._SMN = new Array
+("Jan",
+ "Fev",
+ "Mar",
+ "Abr",
+ "Mai",
+ "Jun",
+ "Jul",
+ "Ago",
+ "Set",
+ "Out",
+ "Nov",
+ "Dez");
+
+// tooltips
+Calendar._TT = {};
+Calendar._TT["INFO"] = "Sobre o calendario";
+
+Calendar._TT["ABOUT"] =
+"DHTML Date/Time Selector\n" +
+"(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n" + // don't translate this this ;-)
+"Ultima versao visite: http://www.dynarch.com/projects/calendar/\n" +
+"Distribuido sobre GNU LGPL.  Veja http://gnu.org/licenses/lgpl.html para detalhes." +
+"\n\n" +
+"Selecao de data:\n" +
+"- Use os botoes \xab, \xbb para selecionar o ano\n" +
+"- Use os botoes " + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a) + " para selecionar o mes\n" +
+"- Segure o botao do mouse em qualquer um desses botoes para selecao rapida.";
+Calendar._TT["ABOUT_TIME"] = "\n\n" +
+"Selecao de hora:\n" +
+"- Clique em qualquer parte da hora para incrementar\n" +
+"- ou Shift-click para decrementar\n" +
+"- ou clique e segure para selecao rapida.";
+
+Calendar._TT["PREV_YEAR"] = "Ant. ano (segure para menu)";
+Calendar._TT["PREV_MONTH"] = "Ant. mes (segure para menu)";
+Calendar._TT["GO_TODAY"] = "Hoje";
+Calendar._TT["NEXT_MONTH"] = "Prox. mes (segure para menu)";
+Calendar._TT["NEXT_YEAR"] = "Prox. ano (segure para menu)";
+Calendar._TT["SEL_DATE"] = "Selecione a data";
+Calendar._TT["DRAG_TO_MOVE"] = "Arraste para mover";
+Calendar._TT["PART_TODAY"] = " (hoje)";
+
+// the following is to inform that "%s" is to be the first day of week
+// %s will be replaced with the day name.
+Calendar._TT["DAY_FIRST"] = "Mostre %s primeiro";
+
+// This may be locale-dependent.  It specifies the week-end days, as an array
+// of comma-separated numbers.  The numbers are from 0 to 6: 0 means Sunday, 1
+// means Monday, etc.
+Calendar._TT["WEEKEND"] = "0,6";
+
+Calendar._TT["CLOSE"] = "Fechar";
+Calendar._TT["TODAY"] = "Hoje";
+Calendar._TT["TIME_PART"] = "(Shift-)Click ou arraste para mudar valor";
+
+// date formats
+Calendar._TT["DEF_DATE_FORMAT"] = "%d/%m/%Y";
+Calendar._TT["TT_DATE_FORMAT"] = "%a, %e %b";
+
+Calendar._TT["WK"] = "sm";
+Calendar._TT["TIME"] = "Hora:";

Property changes on: trunk/wb/include/jscalendar/lang/calendar-pt.js
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: trunk/wb/include/jscalendar/lang/calendar-da.js
===================================================================
--- trunk/wb/include/jscalendar/lang/calendar-da.js	(nonexistent)
+++ trunk/wb/include/jscalendar/lang/calendar-da.js	(revision 552)
@@ -0,0 +1,123 @@
+// ** I18N
+
+// Calendar DA language
+// Author: Michael Thingmand Henriksen, <michael (a) thingmand dot dk>
+// Encoding: any
+// Distributed under the same terms as the calendar itself.
+
+// For translators: please use UTF-8 if possible. We strongly believe that
+// Unicode is the answer to a real internationalized world. Also please
+// include your contact information in the header, as can be seen above.
+
+// full day names
+Calendar._DN = new Array
+("Søndag",
+"Mandag",
+"Tirsdag",
+"Onsdag",
+"Torsdag",
+"Fredag",
+"Lørdag",
+"Søndag");
+
+// Please note that the following array of short day names (and the same goes
+// for short month names, _SMN) isn't absolutely necessary. We give it here
+// for exemplification on how one can customize the short day names, but if
+// they are simply the first N letters of the full name you can simply say:
+//
+// Calendar._SDN_len = N; // short day name length
+// Calendar._SMN_len = N; // short month name length
+//
+// If N = 3 then this is not needed either since we assume a value of 3 if not
+// present, to be compatible with translation files that were written before
+// this feature.
+
+// short day names
+Calendar._SDN = new Array
+("Søn",
+"Man",
+"Tir",
+"Ons",
+"Tor",
+"Fre",
+"Lør",
+"Søn");
+
+// full month names
+Calendar._MN = new Array
+("Januar",
+"Februar",
+"Marts",
+"April",
+"Maj",
+"Juni",
+"Juli",
+"August",
+"September",
+"Oktober",
+"November",
+"December");
+
+// short month names
+Calendar._SMN = new Array
+("Jan",
+"Feb",
+"Mar",
+"Apr",
+"Maj",
+"Jun",
+"Jul",
+"Aug",
+"Sep",
+"Okt",
+"Nov",
+"Dec");
+
+// tooltips
+Calendar._TT = {};
+Calendar._TT["INFO"] = "Om Kalenderen";
+
+Calendar._TT["ABOUT"] =
+"DHTML Date/Time Selector\n" +
+"(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n" + // don't translate this this ;-)
+"For den seneste version besøg: http://www.dynarch.com/projects/calendar/\n"; +
+"Distribueret under GNU LGPL. Se http://gnu.org/licenses/lgpl.html for detajler." +
+"\n\n" +
+"Valg af dato:\n" +
+"- Brug \xab, \xbb knapperne for at vælge år\n" +
+"- Brug " + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a) + " knapperne for at vælge måned\n" +
+"- Hold knappen på musen nede på knapperne ovenfor for hurtigere valg.";
+Calendar._TT["ABOUT_TIME"] = "\n\n" +
+"Valg af tid:\n" +
+"- Klik på en vilkårlig del for større værdi\n" +
+"- eller Shift-klik for for mindre værdi\n" +
+"- eller klik og træk for hurtigere valg.";
+
+Calendar._TT["PREV_YEAR"] = "Ét år tilbage (hold for menu)";
+Calendar._TT["PREV_MONTH"] = "Én måned tilbage (hold for menu)";
+Calendar._TT["GO_TODAY"] = "Gå til i dag";
+Calendar._TT["NEXT_MONTH"] = "Én måned frem (hold for menu)";
+Calendar._TT["NEXT_YEAR"] = "Ét år frem (hold for menu)";
+Calendar._TT["SEL_DATE"] = "Vælg dag";
+Calendar._TT["DRAG_TO_MOVE"] = "Træk vinduet";
+Calendar._TT["PART_TODAY"] = " (i dag)";
+
+// the following is to inform that "%s" is to be the first day of week
+// %s will be replaced with the day name.
+Calendar._TT["DAY_FIRST"] = "Vis %s først";
+
+// This may be locale-dependent. It specifies the week-end days, as an array
+// of comma-separated numbers. The numbers are from 0 to 6: 0 means Sunday, 1
+// means Monday, etc.
+Calendar._TT["WEEKEND"] = "0,6";
+
+Calendar._TT["CLOSE"] = "Luk";
+Calendar._TT["TODAY"] = "I dag";
+Calendar._TT["TIME_PART"] = "(Shift-)klik eller træk for at ændre værdi";
+
+// date formats
+Calendar._TT["DEF_DATE_FORMAT"] = "%d-%m-%Y";
+Calendar._TT["TT_DATE_FORMAT"] = "%a, %b %e";
+
+Calendar._TT["WK"] = "Uge";
+Calendar._TT["TIME"] = "Tid:";

Property changes on: trunk/wb/include/jscalendar/lang/calendar-da.js
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: trunk/wb/include/jscalendar/lang/calendar-tr.js
===================================================================
--- trunk/wb/include/jscalendar/lang/calendar-tr.js	(nonexistent)
+++ trunk/wb/include/jscalendar/lang/calendar-tr.js	(revision 552)
@@ -0,0 +1,58 @@
+//////////////////////////////////////////////////////////////////////////////////////////////
+//	Turkish Translation by Nuri AKMAN
+//	Location: Ankara/TURKEY
+//	e-mail	: nuriakman@hotmail.com
+//	Date	: April, 9 2003
+//
+//	Note: if Turkish Characters does not shown on you screen
+//		  please include falowing line your html code:
+//
+//		  <meta http-equiv="Content-Type" content="text/html; charset=windows-1254">
+//
+//////////////////////////////////////////////////////////////////////////////////////////////
+
+// ** I18N
+Calendar._DN = new Array
+("Pazar",
+ "Pazartesi",
+ "Sal",
+ "aramba",
+ "Perembe",
+ "Cuma",
+ "Cumartesi",
+ "Pazar");
+Calendar._MN = new Array
+("Ocak",
+ "ubat",
+ "Mart",
+ "Nisan",
+ "Mays",
+ "Haziran",
+ "Temmuz",
+ "Austos",
+ "Eyll",
+ "Ekim",
+ "Kasm",
+ "Aralk");
+
+// tooltips
+Calendar._TT = {};
+Calendar._TT["TOGGLE"] = "Haftann ilk gnn kaydr";
+Calendar._TT["PREV_YEAR"] = "nceki Yl (Men iin basl tutunuz)";
+Calendar._TT["PREV_MONTH"] = "nceki Ay (Men iin basl tutunuz)";
+Calendar._TT["GO_TODAY"] = "Bugn'e git";
+Calendar._TT["NEXT_MONTH"] = "Sonraki Ay (Men iin basl tutunuz)";
+Calendar._TT["NEXT_YEAR"] = "Sonraki Yl (Men iin basl tutunuz)";
+Calendar._TT["SEL_DATE"] = "Tarih seiniz";
+Calendar._TT["DRAG_TO_MOVE"] = "Tamak iin srkleyiniz";
+Calendar._TT["PART_TODAY"] = " (bugn)";
+Calendar._TT["MON_FIRST"] = "Takvim Pazartesi gnnden balasn";
+Calendar._TT["SUN_FIRST"] = "Takvim Pazar gnnden balasn";
+Calendar._TT["CLOSE"] = "Kapat";
+Calendar._TT["TODAY"] = "Bugn";
+
+// date formats
+Calendar._TT["DEF_DATE_FORMAT"] = "dd-mm-y";
+Calendar._TT["TT_DATE_FORMAT"] = "d MM y, DD";
+
+Calendar._TT["WK"] = "Hafta";

Property changes on: trunk/wb/include/jscalendar/lang/calendar-tr.js
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: trunk/wb/include/jscalendar/lang/calendar-big5.js
===================================================================
--- trunk/wb/include/jscalendar/lang/calendar-big5.js	(nonexistent)
+++ trunk/wb/include/jscalendar/lang/calendar-big5.js	(revision 552)
@@ -0,0 +1,123 @@
+// ** I18N
+
+// Calendar big5 language
+// Author: Gary Fu, <gary@garyfu.idv.tw>
+// Encoding: big5
+// Distributed under the same terms as the calendar itself.
+
+// For translators: please use UTF-8 if possible.  We strongly believe that
+// Unicode is the answer to a real internationalized world.  Also please
+// include your contact information in the header, as can be seen above.
+	
+// full day names
+Calendar._DN = new Array
+("P",
+ "P@",
+ "PG",
+ "PT",
+ "P|",
+ "P",
+ "P",
+ "P");
+
+// Please note that the following array of short day names (and the same goes
+// for short month names, _SMN) isn't absolutely necessary.  We give it here
+// for exemplification on how one can customize the short day names, but if
+// they are simply the first N letters of the full name you can simply say:
+//
+//   Calendar._SDN_len = N; // short day name length
+//   Calendar._SMN_len = N; // short month name length
+//
+// If N = 3 then this is not needed either since we assume a value of 3 if not
+// present, to be compatible with translation files that were written before
+// this feature.
+
+// short day names
+Calendar._SDN = new Array
+("",
+ "@",
+ "G",
+ "T",
+ "|",
+ "",
+ "",
+ "");
+
+// full month names
+Calendar._MN = new Array
+("@",
+ "G",
+ "T",
+ "|",
+ "",
+ "",
+ "C",
+ "K",
+ "E",
+ "Q",
+ "Q@",
+ "QG");
+
+// short month names
+Calendar._SMN = new Array
+("@",
+ "G",
+ "T",
+ "|",
+ "",
+ "",
+ "C",
+ "K",
+ "E",
+ "Q",
+ "Q@",
+ "QG");
+
+// tooltips
+Calendar._TT = {};
+Calendar._TT["INFO"] = "";
+
+Calendar._TT["ABOUT"] =
+"DHTML Date/Time Selector\n" +
+"(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n" + // don't translate this this ;-)
+"For latest version visit: http://www.dynarch.com/projects/calendar/\n" +
+"Distributed under GNU LGPL.  See http://gnu.org/licenses/lgpl.html for details." +
+"\n\n" +
+"ܤk:\n" +
+"- ϥ \xab, \xbb siܦ~\n" +
+"- ϥ " + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a) + " siܤ\n" +
+"- WsiH[ֿ";
+Calendar._TT["ABOUT_TIME"] = "\n\n" +
+"ɶܤk:\n" +
+"- I󪺮ɶiW[\n" +
+"- PɫShiftAIi֨\n" +
+"- Ié즲i[֧ܪ";
+
+Calendar._TT["PREV_YEAR"] = "W@~ ()";
+Calendar._TT["PREV_MONTH"] = "U@~ ()";
+Calendar._TT["GO_TODAY"] = "줵";
+Calendar._TT["NEXT_MONTH"] = "W@ ()";
+Calendar._TT["NEXT_YEAR"] = "U@ ()";
+Calendar._TT["SEL_DATE"] = "ܤ";
+Calendar._TT["DRAG_TO_MOVE"] = "즲";
+Calendar._TT["PART_TODAY"] = " ()";
+
+// the following is to inform that "%s" is to be the first day of week
+// %s will be replaced with the day name.
+Calendar._TT["DAY_FIRST"] = "N %s ܦbe";
+
+// This may be locale-dependent.  It specifies the week-end days, as an array
+// of comma-separated numbers.  The numbers are from 0 to 6: 0 means Sunday, 1
+// means Monday, etc.
+Calendar._TT["WEEKEND"] = "0,6";
+
+Calendar._TT["CLOSE"] = "";
+Calendar._TT["TODAY"] = "";
+Calendar._TT["TIME_PART"] = "Ior즲iܮɶ(PɫShift)";
+
+// date formats
+Calendar._TT["DEF_DATE_FORMAT"] = "%Y-%m-%d";
+Calendar._TT["TT_DATE_FORMAT"] = "%a, %b %e";
+
+Calendar._TT["WK"] = "g";
+Calendar._TT["TIME"] = "Time:";

Property changes on: trunk/wb/include/jscalendar/lang/calendar-big5.js
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: trunk/wb/include/jscalendar/lang/calendar-bg.js
===================================================================
--- trunk/wb/include/jscalendar/lang/calendar-bg.js	(nonexistent)
+++ trunk/wb/include/jscalendar/lang/calendar-bg.js	(revision 552)
@@ -0,0 +1,124 @@
+// ** I18N
+
+// Calendar BG language
+// Author: Mihai Bazon, <mihai_bazon@yahoo.com>
+// Translator: Valentin Sheiretsky, <valio@valio.eu.org>
+// Encoding: Windows-1251
+// Distributed under the same terms as the calendar itself.
+
+// For translators: please use UTF-8 if possible.  We strongly believe that
+// Unicode is the answer to a real internationalized world.  Also please
+// include your contact information in the header, as can be seen above.
+
+// full day names
+Calendar._DN = new Array
+("",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "");
+
+// Please note that the following array of short day names (and the same goes
+// for short month names, _SMN) isn't absolutely necessary.  We give it here
+// for exemplification on how one can customize the short day names, but if
+// they are simply the first N letters of the full name you can simply say:
+//
+//   Calendar._SDN_len = N; // short day name length
+//   Calendar._SMN_len = N; // short month name length
+//
+// If N = 3 then this is not needed either since we assume a value of 3 if not
+// present, to be compatible with translation files that were written before
+// this feature.
+
+// short day names
+Calendar._SDN = new Array
+("",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "");
+
+// full month names
+Calendar._MN = new Array
+("",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "");
+
+// short month names
+Calendar._SMN = new Array
+("",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "");
+
+// tooltips
+Calendar._TT = {};
+Calendar._TT["INFO"] = "  ";
+
+Calendar._TT["ABOUT"] =
+"DHTML Date/Time Selector\n" +
+"(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n" + // don't translate this this ;-)
+"For latest version visit: http://www.dynarch.com/projects/calendar/\n" +
+"Distributed under GNU LGPL.  See http://gnu.org/licenses/lgpl.html for details." +
+"\n\n" +
+"Date selection:\n" +
+"- Use the \xab, \xbb buttons to select year\n" +
+"- Use the " + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a) + " buttons to select month\n" +
+"- Hold mouse button on any of the above buttons for faster selection.";
+Calendar._TT["ABOUT_TIME"] = "\n\n" +
+"Time selection:\n" +
+"- Click on any of the time parts to increase it\n" +
+"- or Shift-click to decrease it\n" +
+"- or click and drag for faster selection.";
+
+Calendar._TT["PREV_YEAR"] = "  (  )";
+Calendar._TT["PREV_MONTH"] = "  (  )";
+Calendar._TT["GO_TODAY"] = " ";
+Calendar._TT["NEXT_MONTH"] = "  (  )";
+Calendar._TT["NEXT_YEAR"] = "  (  )";
+Calendar._TT["SEL_DATE"] = " ";
+Calendar._TT["DRAG_TO_MOVE"] = "";
+Calendar._TT["PART_TODAY"] = " ()";
+
+// the following is to inform that "%s" is to be the first day of week
+// %s will be replaced with the day name.
+Calendar._TT["DAY_FIRST"] = "%s   ";
+
+// This may be locale-dependent.  It specifies the week-end days, as an array
+// of comma-separated numbers.  The numbers are from 0 to 6: 0 means Sunday, 1
+// means Monday, etc.
+Calendar._TT["WEEKEND"] = "0,6";
+
+Calendar._TT["CLOSE"] = "";
+Calendar._TT["TODAY"] = "";
+Calendar._TT["TIME_PART"] = "(Shift-)Click  drag    ";
+
+// date formats
+Calendar._TT["DEF_DATE_FORMAT"] = "%Y-%m-%d";
+Calendar._TT["TT_DATE_FORMAT"] = "%A - %e %B %Y";
+
+Calendar._TT["WK"] = "";
+Calendar._TT["TIME"] = ":";

Property changes on: trunk/wb/include/jscalendar/lang/calendar-bg.js
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: trunk/wb/include/jscalendar/lang/calendar-de.js
===================================================================
--- trunk/wb/include/jscalendar/lang/calendar-de.js	(nonexistent)
+++ trunk/wb/include/jscalendar/lang/calendar-de.js	(revision 552)
@@ -0,0 +1,124 @@
+// ** I18N
+
+// Calendar DE language
+// Author: Jack (tR), <jack@jtr.de>
+// Encoding: any
+// Distributed under the same terms as the calendar itself.
+
+// For translators: please use UTF-8 if possible.  We strongly believe that
+// Unicode is the answer to a real internationalized world.  Also please
+// include your contact information in the header, as can be seen above.
+
+// full day names
+Calendar._DN = new Array
+("Sonntag",
+ "Montag",
+ "Dienstag",
+ "Mittwoch",
+ "Donnerstag",
+ "Freitag",
+ "Samstag",
+ "Sonntag");
+
+// Please note that the following array of short day names (and the same goes
+// for short month names, _SMN) isn't absolutely necessary.  We give it here
+// for exemplification on how one can customize the short day names, but if
+// they are simply the first N letters of the full name you can simply say:
+//
+//   Calendar._SDN_len = N; // short day name length
+//   Calendar._SMN_len = N; // short month name length
+//
+// If N = 3 then this is not needed either since we assume a value of 3 if not
+// present, to be compatible with translation files that were written before
+// this feature.
+
+// short day names
+Calendar._SDN = new Array
+("So",
+ "Mo",
+ "Di",
+ "Mi",
+ "Do",
+ "Fr",
+ "Sa",
+ "So");
+
+// full month names
+Calendar._MN = new Array
+("Januar",
+ "Februar",
+ "M\u00e4rz",
+ "April",
+ "Mai",
+ "Juni",
+ "Juli",
+ "August",
+ "September",
+ "Oktober",
+ "November",
+ "Dezember");
+
+// short month names
+Calendar._SMN = new Array
+("Jan",
+ "Feb",
+ "M\u00e4r",
+ "Apr",
+ "May",
+ "Jun",
+ "Jul",
+ "Aug",
+ "Sep",
+ "Okt",
+ "Nov",
+ "Dez");
+
+// tooltips
+Calendar._TT = {};
+Calendar._TT["INFO"] = "\u00DCber dieses Kalendarmodul";
+
+Calendar._TT["ABOUT"] =
+"DHTML Date/Time Selector\n" +
+"(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n" + // don't translate this ;-)
+"For latest version visit: http://www.dynarch.com/projects/calendar/\n" +
+"Distributed under GNU LGPL.  See http://gnu.org/licenses/lgpl.html for details." +
+"\n\n" +
+"Datum ausw\u00e4hlen:\n" +
+"- Benutzen Sie die \xab, \xbb Buttons um das Jahr zu w\u00e4hlen\n" +
+"- Benutzen Sie die " + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a) + " Buttons um den Monat zu w\u00e4hlen\n" +
+"- F\u00fcr eine Schnellauswahl halten Sie die Maustaste \u00fcber diesen Buttons fest.";
+Calendar._TT["ABOUT_TIME"] = "\n\n" +
+"Zeit ausw\u00e4hlen:\n" +
+"- Klicken Sie auf die Teile der Uhrzeit, um diese zu erh\u00F6hen\n" +
+"- oder klicken Sie mit festgehaltener Shift-Taste um diese zu verringern\n" +
+"- oder klicken und festhalten f\u00fcr Schnellauswahl.";
+
+Calendar._TT["TOGGLE"] = "Ersten Tag der Woche w\u00e4hlen";
+Calendar._TT["PREV_YEAR"] = "Voriges Jahr (Festhalten f\u00fcr Schnellauswahl)";
+Calendar._TT["PREV_MONTH"] = "Voriger Monat (Festhalten f\u00fcr Schnellauswahl)";
+Calendar._TT["GO_TODAY"] = "Heute ausw\u00e4hlen";
+Calendar._TT["NEXT_MONTH"] = "N\u00e4chst. Monat (Festhalten f\u00fcr Schnellauswahl)";
+Calendar._TT["NEXT_YEAR"] = "N\u00e4chst. Jahr (Festhalten f\u00fcr Schnellauswahl)";
+Calendar._TT["SEL_DATE"] = "Datum ausw\u00e4hlen";
+Calendar._TT["DRAG_TO_MOVE"] = "Zum Bewegen festhalten";
+Calendar._TT["PART_TODAY"] = " (Heute)";
+
+// the following is to inform that "%s" is to be the first day of week
+// %s will be replaced with the day name.
+Calendar._TT["DAY_FIRST"] = "Woche beginnt mit %s ";
+
+// This may be locale-dependent.  It specifies the week-end days, as an array
+// of comma-separated numbers.  The numbers are from 0 to 6: 0 means Sunday, 1
+// means Monday, etc.
+Calendar._TT["WEEKEND"] = "0,6";
+
+Calendar._TT["CLOSE"] = "Schlie\u00dfen";
+Calendar._TT["TODAY"] = "Heute";
+Calendar._TT["TIME_PART"] = "(Shift-)Klick oder Festhalten und Ziehen um den Wert zu \u00e4ndern";
+
+// date formats
+Calendar._TT["DEF_DATE_FORMAT"] = "%d.%m.%Y";
+Calendar._TT["TT_DATE_FORMAT"] = "%a, %b %e";
+
+Calendar._TT["WK"] = "wk";
+Calendar._TT["TIME"] = "Zeit:";

Property changes on: trunk/wb/include/jscalendar/lang/calendar-de.js
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: trunk/wb/include/jscalendar/lang/calendar-sv.js
===================================================================
--- trunk/wb/include/jscalendar/lang/calendar-sv.js	(nonexistent)
+++ trunk/wb/include/jscalendar/lang/calendar-sv.js	(revision 552)
@@ -0,0 +1,93 @@
+// ** I18N
+
+// Calendar SV language (Swedish, svenska)
+// Author: Mihai Bazon, <mihai_bazon@yahoo.com>
+// Translation team: <sv@li.org>
+// Translator: Leonard Norrgrd <leonard.norrgard@refactor.fi>
+// Last translator: Leonard Norrgrd <leonard.norrgard@refactor.fi>
+// Encoding: iso-latin-1
+// Distributed under the same terms as the calendar itself.
+
+// For translators: please use UTF-8 if possible.  We strongly believe that
+// Unicode is the answer to a real internationalized world.  Also please
+// include your contact information in the header, as can be seen above.
+
+// full day names
+Calendar._DN = new Array
+("sndag",
+ "mndag",
+ "tisdag",
+ "onsdag",
+ "torsdag",
+ "fredag",
+ "lrdag",
+ "sndag");
+
+// Please note that the following array of short day names (and the same goes
+// for short month names, _SMN) isn't absolutely necessary.  We give it here
+// for exemplification on how one can customize the short day names, but if
+// they are simply the first N letters of the full name you can simply say:
+//
+//   Calendar._SDN_len = N; // short day name length
+//   Calendar._SMN_len = N; // short month name length
+//
+// If N = 3 then this is not needed either since we assume a value of 3 if not
+// present, to be compatible with translation files that were written before
+// this feature.
+Calendar._SDN_len = 2;
+Calendar._SMN_len = 3;
+
+// full month names
+Calendar._MN = new Array
+("januari",
+ "februari",
+ "mars",
+ "april",
+ "maj",
+ "juni",
+ "juli",
+ "augusti",
+ "september",
+ "oktober",
+ "november",
+ "december");
+
+// tooltips
+Calendar._TT = {};
+Calendar._TT["INFO"] = "Om kalendern";
+
+Calendar._TT["ABOUT"] =
+"DHTML Datum/tid-vljare\n" +
+"(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n" + // don't translate this this ;-)
+"Fr senaste version g till: http://www.dynarch.com/projects/calendar/\n" +
+"Distribueras under GNU LGPL.  Se http://gnu.org/licenses/lgpl.html fr detaljer." +
+"\n\n" +
+"Val av datum:\n" +
+"- Anvnd knapparna \xab, \xbb fr att vlja r\n" +
+"- Anvnd knapparna " + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a) + " fr att vlja mnad\n" +
+"- Hll musknappen nedtryckt p ngon av ovanstende knappar fr snabbare val.";
+Calendar._TT["ABOUT_TIME"] = "\n\n" +
+"Val av tid:\n" +
+"- Klicka p en del av tiden fr att ka den delen\n" +
+"- eller skift-klicka fr att minska den\n" +
+"- eller klicka och drag fr snabbare val.";
+
+Calendar._TT["PREV_YEAR"] = "Fregende r (hll fr menu)";
+Calendar._TT["PREV_MONTH"] = "Fregende mnad (hll fr menu)";
+Calendar._TT["GO_TODAY"] = "G till dagens datum";
+Calendar._TT["NEXT_MONTH"] = "Fljande mnad (hll fr menu)";
+Calendar._TT["NEXT_YEAR"] = "Fljande r (hll fr menu)";
+Calendar._TT["SEL_DATE"] = "Vlj datum";
+Calendar._TT["DRAG_TO_MOVE"] = "Drag fr att flytta";
+Calendar._TT["PART_TODAY"] = " (idag)";
+Calendar._TT["MON_FIRST"] = "Visa mndag frst";
+Calendar._TT["SUN_FIRST"] = "Visa sndag frst";
+Calendar._TT["CLOSE"] = "Stng";
+Calendar._TT["TODAY"] = "Idag";
+Calendar._TT["TIME_PART"] = "(Skift-)klicka eller drag fr att ndra tid";
+
+// date formats
+Calendar._TT["DEF_DATE_FORMAT"] = "%Y-%m-%d";
+Calendar._TT["TT_DATE_FORMAT"] = "%A %d %b %Y";
+
+Calendar._TT["WK"] = "vecka";

Property changes on: trunk/wb/include/jscalendar/lang/calendar-sv.js
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: trunk/wb/include/jscalendar/lang/calendar-cs-utf8.js
===================================================================
--- trunk/wb/include/jscalendar/lang/calendar-cs-utf8.js	(nonexistent)
+++ trunk/wb/include/jscalendar/lang/calendar-cs-utf8.js	(revision 552)
@@ -0,0 +1,65 @@
+/* 
+	calendar-cs-win.js
+	language: Czech
+	encoding: windows-1250
+	author: Lubos Jerabek (xnet@seznam.cz)
+	        Jan Uhlir (espinosa@centrum.cz)
+*/
+
+// ** I18N
+Calendar._DN  = new Array('Neděle','Pondělí','Úterý','Středa','Čtvrtek','Pátek','Sobota','Neděle');
+Calendar._SDN = new Array('Ne','Po','Út','St','Čt','Pá','So','Ne');
+Calendar._MN  = new Array('Leden','Únor','Březen','Duben','Květen','Červen','Červenec','Srpen','Září','Říjen','Listopad','Prosinec');
+Calendar._SMN = new Array('Led','Úno','Bře','Dub','Kvě','Črv','Čvc','Srp','Zář','Říj','Lis','Pro');
+
+// tooltips
+Calendar._TT = {};
+Calendar._TT["INFO"] = "O komponentě kalendář";
+Calendar._TT["TOGGLE"] = "Změna prvního dne v týdnu";
+Calendar._TT["PREV_YEAR"] = "Předchozí rok (přidrž pro menu)";
+Calendar._TT["PREV_MONTH"] = "Předchozí měsíc (přidrž pro menu)";
+Calendar._TT["GO_TODAY"] = "Dnešní datum";
+Calendar._TT["NEXT_MONTH"] = "Další měsíc (přidrž pro menu)";
+Calendar._TT["NEXT_YEAR"] = "Další rok (přidrž pro menu)";
+Calendar._TT["SEL_DATE"] = "Vyber datum";
+Calendar._TT["DRAG_TO_MOVE"] = "Chyť a táhni, pro přesun";
+Calendar._TT["PART_TODAY"] = " (dnes)";
+Calendar._TT["MON_FIRST"] = "Ukaž jako první Pondělí";
+//Calendar._TT["SUN_FIRST"] = "Ukaž jako první Neděli";
+
+Calendar._TT["ABOUT"] =
+"DHTML Date/Time Selector\n" +
+"(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n" + // don't translate this this ;-)
+"For latest version visit: http://www.dynarch.com/projects/calendar/\n" +
+"Distributed under GNU LGPL.  See http://gnu.org/licenses/lgpl.html for details." +
+"\n\n" +
+"Výběr datumu:\n" +
+"- Use the \xab, \xbb buttons to select year\n" +
+"- Použijte tlačítka " + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a) + " k výběru měsíce\n" +
+"- Podržte tlačítko myši na jakémkoliv z těch tlačítek pro rychlejší výběr.";
+
+Calendar._TT["ABOUT_TIME"] = "\n\n" +
+"Výběr času:\n" +
+"- Klikněte na jakoukoliv z částí výběru času pro zvýšení.\n" +
+"- nebo Shift-click pro snížení\n" +
+"- nebo klikněte a táhněte pro rychlejší výběr.";
+
+// the following is to inform that "%s" is to be the first day of week
+// %s will be replaced with the day name.
+Calendar._TT["DAY_FIRST"] = "Zobraz %s první";
+
+// This may be locale-dependent.  It specifies the week-end days, as an array
+// of comma-separated numbers.  The numbers are from 0 to 6: 0 means Sunday, 1
+// means Monday, etc.
+Calendar._TT["WEEKEND"] = "0,6";
+
+Calendar._TT["CLOSE"] = "Zavřít";
+Calendar._TT["TODAY"] = "Dnes";
+Calendar._TT["TIME_PART"] = "(Shift-)Klikni nebo táhni pro změnu hodnoty";
+
+// date formats
+Calendar._TT["DEF_DATE_FORMAT"] = "d.m.yy";
+Calendar._TT["TT_DATE_FORMAT"] = "%a, %b %e";
+
+Calendar._TT["WK"] = "wk";
+Calendar._TT["TIME"] = "Čas:";

Property changes on: trunk/wb/include/jscalendar/lang/calendar-cs-utf8.js
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: trunk/wb/include/jscalendar/calendar-setup.js
===================================================================
--- trunk/wb/include/jscalendar/calendar-setup.js	(nonexistent)
+++ trunk/wb/include/jscalendar/calendar-setup.js	(revision 552)
@@ -0,0 +1,203 @@
+/*  Copyright Mihai Bazon, 2002, 2003  |  http://dynarch.com/mishoo/
+ * ---------------------------------------------------------------------------
+ *
+ * The DHTML Calendar
+ *
+ * Details and latest version at:
+ * http://dynarch.com/mishoo/calendar.epl
+ *
+ * This script is distributed under the GNU Lesser General Public License.
+ * Read the entire license text here: http://www.gnu.org/licenses/lgpl.html
+ *
+ * This file defines helper functions for setting up the calendar.  They are
+ * intended to help non-programmers get a working calendar on their site
+ * quickly.  This script should not be seen as part of the calendar.  It just
+ * shows you what one can do with the calendar, while in the same time
+ * providing a quick and simple method for setting it up.  If you need
+ * exhaustive customization of the calendar creation process feel free to
+ * modify this code to suit your needs (this is recommended and much better
+ * than modifying calendar.js itself).
+ */
+
+// $Id: calendar-setup.js,v 1.25 2005/03/07 09:51:33 mishoo Exp $
+
+/**
+ *  This function "patches" an input field (or other element) to use a calendar
+ *  widget for date selection.
+ *
+ *  The "params" is a single object that can have the following properties:
+ *
+ *    prop. name   | description
+ *  -------------------------------------------------------------------------------------------------
+ *   inputField    | the ID of an input field to store the date
+ *   displayArea   | the ID of a DIV or other element to show the date
+ *   button        | ID of a button or other element that will trigger the calendar
+ *   eventName     | event that will trigger the calendar, without the "on" prefix (default: "click")
+ *   ifFormat      | date format that will be stored in the input field
+ *   daFormat      | the date format that will be used to display the date in displayArea
+ *   singleClick   | (true/false) wether the calendar is in single click mode or not (default: true)
+ *   firstDay      | numeric: 0 to 6.  "0" means display Sunday first, "1" means display Monday first, etc.
+ *   align         | alignment (default: "Br"); if you don't know what's this see the calendar documentation
+ *   range         | array with 2 elements.  Default: [1900, 2999] -- the range of years available
+ *   weekNumbers   | (true/false) if it's true (default) the calendar will display week numbers
+ *   flat          | null or element ID; if not null the calendar will be a flat calendar having the parent with the given ID
+ *   flatCallback  | function that receives a JS Date object and returns an URL to point the browser to (for flat calendar)
+ *   disableFunc   | function that receives a JS Date object and should return true if that date has to be disabled in the calendar
+ *   onSelect      | function that gets called when a date is selected.  You don't _have_ to supply this (the default is generally okay)
+ *   onClose       | function that gets called when the calendar is closed.  [default]
+ *   onUpdate      | function that gets called after the date is updated in the input field.  Receives a reference to the calendar.
+ *   date          | the date that the calendar will be initially displayed to
+ *   showsTime     | default: false; if true the calendar will include a time selector
+ *   timeFormat    | the time format; can be "12" or "24", default is "12"
+ *   electric      | if true (default) then given fields/date areas are updated for each move; otherwise they're updated only on close
+ *   step          | configures the step of the years in drop-down boxes; default: 2
+ *   position      | configures the calendar absolute position; default: null
+ *   cache         | if "true" (but default: "false") it will reuse the same calendar object, where possible
+ *   showOthers    | if "true" (but default: "false") it will show days from other months too
+ *
+ *  None of them is required, they all have default values.  However, if you
+ *  pass none of "inputField", "displayArea" or "button" you'll get a warning
+ *  saying "nothing to setup".
+ */
+Calendar.setup = function (params) {
+	function param_default(pname, def) { if (typeof params[pname] == "undefined") { params[pname] = def; } };
+
+	param_default("inputField",     null);
+	param_default("displayArea",    null);
+	param_default("button",         null);
+	param_default("eventName",      "click");
+	param_default("ifFormat",       "%Y/%m/%d");
+	param_default("daFormat",       "%Y/%m/%d");
+	param_default("singleClick",    true);
+	param_default("disableFunc",    null);
+	param_default("dateStatusFunc", params["disableFunc"]);	// takes precedence if both are defined
+	param_default("dateText",       null);
+	param_default("firstDay",       null);
+	param_default("align",          "Br");
+	param_default("range",          [1900, 2999]);
+	param_default("weekNumbers",    true);
+	param_default("flat",           null);
+	param_default("flatCallback",   null);
+	param_default("onSelect",       null);
+	param_default("onClose",        null);
+	param_default("onUpdate",       null);
+	param_default("date",           null);
+	param_default("showsTime",      false);
+	param_default("timeFormat",     "24");
+	param_default("electric",       true);
+	param_default("step",           2);
+	param_default("position",       null);
+	param_default("cache",          false);
+	param_default("showOthers",     false);
+	param_default("multiple",       null);
+
+	var tmp = ["inputField", "displayArea", "button"];
+	for (var i in tmp) {
+		if (typeof params[tmp[i]] == "string") {
+			params[tmp[i]] = document.getElementById(params[tmp[i]]);
+		}
+	}
+	if (!(params.flat || params.multiple || params.inputField || params.displayArea || params.button)) {
+		alert("Calendar.setup:\n  Nothing to setup (no fields found).  Please check your code");
+		return false;
+	}
+
+	function onSelect(cal) {
+		var p = cal.params;
+		var update = (cal.dateClicked || p.electric);
+		if (update && p.inputField) {
+			p.inputField.value = cal.date.print(p.ifFormat);
+			if (typeof p.inputField.onchange == "function")
+				p.inputField.onchange();
+		}
+		if (update && p.displayArea)
+			p.displayArea.innerHTML = cal.date.print(p.daFormat);
+		if (update && typeof p.onUpdate == "function")
+			p.onUpdate(cal);
+		if (update && p.flat) {
+			if (typeof p.flatCallback == "function")
+				p.flatCallback(cal);
+		}
+		if (update && p.singleClick && cal.dateClicked)
+			cal.callCloseHandler();
+	};
+
+	if (params.flat != null) {
+		if (typeof params.flat == "string")
+			params.flat = document.getElementById(params.flat);
+		if (!params.flat) {
+			alert("Calendar.setup:\n  Flat specified but can't find parent.");
+			return false;
+		}
+		var cal = new Calendar(params.firstDay, params.date, params.onSelect || onSelect);
+		cal.showsOtherMonths = params.showOthers;
+		cal.showsTime = params.showsTime;
+		cal.time24 = (params.timeFormat == "24");
+		cal.params = params;
+		cal.weekNumbers = params.weekNumbers;
+		cal.setRange(params.range[0], params.range[1]);
+		cal.setDateStatusHandler(params.dateStatusFunc);
+		cal.getDateText = params.dateText;
+		if (params.ifFormat) {
+			cal.setDateFormat(params.ifFormat);
+		}
+		if (params.inputField && typeof params.inputField.value == "string") {
+			cal.parseDate(params.inputField.value);
+		}
+		cal.create(params.flat);
+		cal.show();
+		return false;
+	}
+
+	var triggerEl = params.button || params.displayArea || params.inputField;
+	triggerEl["on" + params.eventName] = function() {
+		var dateEl = params.inputField || params.displayArea;
+		var dateFmt = params.inputField ? params.ifFormat : params.daFormat;
+		var mustCreate = false;
+		var cal = window.calendar;
+//		if (dateEl)
+//			params.date = Date.parseDate(dateEl.value || dateEl.innerHTML, dateFmt);
+//by nib: checks wether inputfield is empty or not. orig code only checked wether inputfield exists, so param.date was never read!
+if (dateEl.value.replace(/^\s+|\s+$/g,"").length != 0 || dateEl.innerHTML.replace(/^\s+|\s+$/g,"").length != 0)
+params.date = Date.parseDate(dateEl.value || dateEl.innerHTML, dateFmt);
+		if (!(cal && params.cache)) {
+			window.calendar = cal = new Calendar(params.firstDay,
+							     params.date,
+							     params.onSelect || onSelect,
+							     params.onClose || function(cal) { cal.hide(); });
+			cal.showsTime = params.showsTime;
+			cal.time24 = (params.timeFormat == "24");
+			cal.weekNumbers = params.weekNumbers;
+			mustCreate = true;
+		} else {
+			if (params.date)
+				cal.setDate(params.date);
+			cal.hide();
+		}
+		if (params.multiple) {
+			cal.multiple = {};
+			for (var i = params.multiple.length; --i >= 0;) {
+				var d = params.multiple[i];
+				var ds = d.print("%Y%m%d");
+				cal.multiple[ds] = d;
+			}
+		}
+		cal.showsOtherMonths = params.showOthers;
+		cal.yearStep = params.step;
+		cal.setRange(params.range[0], params.range[1]);
+		cal.params = params;
+		cal.setDateStatusHandler(params.dateStatusFunc);
+		cal.getDateText = params.dateText;
+		cal.setDateFormat(dateFmt);
+		if (mustCreate)
+			cal.create();
+		cal.refresh();
+		if (!params.position)
+			cal.showAtElement(params.button || params.displayArea || params.inputField, params.align);
+		else
+			cal.showAt(params.position[0], params.position[1]);
+		return false;
+	};
+
+	return cal;
+};

Property changes on: trunk/wb/include/jscalendar/calendar-setup.js
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: trunk/wb/include/jscalendar/calendar-system.css
===================================================================
--- trunk/wb/include/jscalendar/calendar-system.css	(nonexistent)
+++ trunk/wb/include/jscalendar/calendar-system.css	(revision 552)
@@ -0,0 +1,251 @@
+/* The main calendar widget.  DIV containing a table. */
+
+.calendar {
+  position: relative;
+  display: none;
+  border: 1px solid;
+  border-color: #fff #000 #000 #fff;
+  font-size: 11px;
+  cursor: default;
+  background: Window;
+  color: WindowText;
+  font-family: tahoma,verdana,sans-serif;
+}
+
+.calendar table {
+  border: 1px solid;
+  border-color: #fff #000 #000 #fff;
+  font-size: 11px;
+  cursor: default;
+  background: Window;
+  color: WindowText;
+  font-family: tahoma,verdana,sans-serif;
+}
+
+/* Header part -- contains navigation buttons and day names. */
+
+.calendar .button { /* "<<", "<", ">", ">>" buttons have this class */
+  text-align: center;
+  padding: 1px;
+  border: 1px solid;
+  border-color: ButtonHighlight ButtonShadow ButtonShadow ButtonHighlight;
+  background: ButtonFace;
+}
+
+.calendar .nav {
+  background: ButtonFace url(menuarrow.gif) no-repeat 100% 100%;
+}
+
+.calendar thead .title { /* This holds the current "month, year" */
+  font-weight: bold;
+  padding: 1px;
+  border: 1px solid #000;
+  background: ActiveCaption;
+  color: CaptionText;
+  text-align: center;
+}
+
+.calendar thead .headrow { /* Row <TR> containing navigation buttons */
+}
+
+.calendar thead .daynames { /* Row <TR> containing the day names */
+}
+
+.calendar thead .name { /* Cells <TD> containing the day names */
+  border-bottom: 1px solid ButtonShadow;
+  padding: 2px;
+  text-align: center;
+  background: ButtonFace;
+  color: ButtonText;
+}
+
+.calendar thead .weekend { /* How a weekend day name shows in header */
+  color: #f00;
+}
+
+.calendar thead .hilite { /* How do the buttons in header appear when hover */
+  border: 2px solid;
+  padding: 0px;
+  border-color: ButtonHighlight ButtonShadow ButtonShadow ButtonHighlight;
+}
+
+.calendar thead .active { /* Active (pressed) buttons in header */
+  border-width: 1px;
+  padding: 2px 0px 0px 2px;
+  border-color: ButtonShadow ButtonHighlight ButtonHighlight ButtonShadow;
+}
+
+/* The body part -- contains all the days in month. */
+
+.calendar tbody .day { /* Cells <TD> containing month days dates */
+  width: 2em;
+  text-align: right;
+  padding: 2px 4px 2px 2px;
+}
+.calendar tbody .day.othermonth {
+  font-size: 80%;
+  color: #aaa;
+}
+.calendar tbody .day.othermonth.oweekend {
+  color: #faa;
+}
+
+.calendar table .wn {
+  padding: 2px 3px 2px 2px;
+  border-right: 1px solid ButtonShadow;
+  background: ButtonFace;
+  color: ButtonText;
+}
+
+.calendar tbody .rowhilite td {
+  background: Highlight;
+  color: HighlightText;
+}
+
+.calendar tbody td.hilite { /* Hovered cells <TD> */
+  padding: 1px 3px 1px 1px;
+  border-top: 1px solid #fff;
+  border-right: 1px solid #000;
+  border-bottom: 1px solid #000;
+  border-left: 1px solid #fff;
+}
+
+.calendar tbody td.active { /* Active (pressed) cells <TD> */
+  padding: 2px 2px 0px 2px;
+  border: 1px solid;
+  border-color: ButtonShadow ButtonHighlight ButtonHighlight ButtonShadow;
+}
+
+.calendar tbody td.selected { /* Cell showing selected date */
+  font-weight: bold;
+  border: 1px solid;
+  border-color: ButtonShadow ButtonHighlight ButtonHighlight ButtonShadow;
+  padding: 2px 2px 0px 2px;
+  background: ButtonFace;
+  color: ButtonText;
+}
+
+.calendar tbody td.weekend { /* Cells showing weekend days */
+  color: #f00;
+}
+
+.calendar tbody td.today { /* Cell showing today date */
+  font-weight: bold;
+  color: #00f;
+}
+
+.calendar tbody td.disabled { color: GrayText; }
+
+.calendar tbody .emptycell { /* Empty cells (the best is to hide them) */
+  visibility: hidden;
+}
+
+.calendar tbody .emptyrow { /* Empty row (some months need less than 6 rows) */
+  display: none;
+}
+
+/* The footer part -- status bar and "Close" button */
+
+.calendar tfoot .footrow { /* The <TR> in footer (only one right now) */
+}
+
+.calendar tfoot .ttip { /* Tooltip (status bar) cell <TD> */
+  background: ButtonFace;
+  padding: 1px;
+  border: 1px solid;
+  border-color: ButtonShadow ButtonHighlight ButtonHighlight ButtonShadow;
+  color: ButtonText;
+  text-align: center;
+}
+
+.calendar tfoot .hilite { /* Hover style for buttons in footer */
+  border-top: 1px solid #fff;
+  border-right: 1px solid #000;
+  border-bottom: 1px solid #000;
+  border-left: 1px solid #fff;
+  padding: 1px;
+  background: #e4e0d8;
+}
+
+.calendar tfoot .active { /* Active (pressed) style for buttons in footer */
+  padding: 2px 0px 0px 2px;
+  border-top: 1px solid #000;
+  border-right: 1px solid #fff;
+  border-bottom: 1px solid #fff;
+  border-left: 1px solid #000;
+}
+
+/* Combo boxes (menus that display months/years for direct selection) */
+
+.calendar .combo {
+  position: absolute;
+  display: none;
+  width: 4em;
+  top: 0px;
+  left: 0px;
+  cursor: default;
+  border: 1px solid;
+  border-color: ButtonHighlight ButtonShadow ButtonShadow ButtonHighlight;
+  background: Menu;
+  color: MenuText;
+  font-size: 90%;
+  padding: 1px;
+  z-index: 100;
+}
+
+.calendar .combo .label,
+.calendar .combo .label-IEfix {
+  text-align: center;
+  padding: 1px;
+}
+
+.calendar .combo .label-IEfix {
+  width: 4em;
+}
+
+.calendar .combo .active {
+  padding: 0px;
+  border: 1px solid #000;
+}
+
+.calendar .combo .hilite {
+  background: Highlight;
+  color: HighlightText;
+}
+
+.calendar td.time {
+  border-top: 1px solid ButtonShadow;
+  padding: 1px 0px;
+  text-align: center;
+  background-color: ButtonFace;
+}
+
+.calendar td.time .hour,
+.calendar td.time .minute,
+.calendar td.time .ampm {
+  padding: 0px 3px 0px 4px;
+  border: 1px solid #889;
+  font-weight: bold;
+  background-color: Menu;
+}
+
+.calendar td.time .ampm {
+  text-align: center;
+}
+
+.calendar td.time .colon {
+  padding: 0px 2px 0px 3px;
+  font-weight: bold;
+}
+
+.calendar td.time span.hilite {
+  border-color: #000;
+  background-color: Highlight;
+  color: HighlightText;
+}
+
+.calendar td.time span.active {
+  border-color: #f00;
+  background-color: #000;
+  color: #0f0;
+}

Property changes on: trunk/wb/include/jscalendar/calendar-system.css
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: trunk/wb/include/jscalendar/menuarrow.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: trunk/wb/include/jscalendar/menuarrow.gif
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Index: trunk/wb/include/jscalendar/calendar.js
===================================================================
--- trunk/wb/include/jscalendar/calendar.js	(nonexistent)
+++ trunk/wb/include/jscalendar/calendar.js	(revision 552)
@@ -0,0 +1,1806 @@
+/*  Copyright Mihai Bazon, 2002-2005  |  www.bazon.net/mishoo
+ * -----------------------------------------------------------
+ *
+ * The DHTML Calendar, version 1.0 "It is happening again"
+ *
+ * Details and latest version at:
+ * www.dynarch.com/projects/calendar
+ *
+ * This script is developed by Dynarch.com.  Visit us at www.dynarch.com.
+ *
+ * This script is distributed under the GNU Lesser General Public License.
+ * Read the entire license text here: http://www.gnu.org/licenses/lgpl.html
+ */
+
+// $Id: calendar.js,v 1.51 2005/03/07 16:44:31 mishoo Exp $
+
+/** The Calendar object constructor. */
+Calendar = function (firstDayOfWeek, dateStr, onSelected, onClose) {
+	// member variables
+	this.activeDiv = null;
+	this.currentDateEl = null;
+	this.getDateStatus = null;
+	this.getDateToolTip = null;
+	this.getDateText = null;
+	this.timeout = null;
+	this.onSelected = onSelected || null;
+	this.onClose = onClose || null;
+	this.dragging = false;
+	this.hidden = false;
+	this.minYear = 1970;
+	this.maxYear = 2050;
+	this.dateFormat = Calendar._TT["DEF_DATE_FORMAT"];
+	this.ttDateFormat = Calendar._TT["TT_DATE_FORMAT"];
+	this.isPopup = true;
+	this.weekNumbers = true;
+	this.firstDayOfWeek = typeof firstDayOfWeek == "number" ? firstDayOfWeek : Calendar._FD; // 0 for Sunday, 1 for Monday, etc.
+	this.showsOtherMonths = false;
+	this.dateStr = dateStr;
+	this.ar_days = null;
+	this.showsTime = false;
+	this.time24 = true;
+	this.yearStep = 2;
+	this.hiliteToday = true;
+	this.multiple = null;
+	// HTML elements
+	this.table = null;
+	this.element = null;
+	this.tbody = null;
+	this.firstdayname = null;
+	// Combo boxes
+	this.monthsCombo = null;
+	this.yearsCombo = null;
+	this.hilitedMonth = null;
+	this.activeMonth = null;
+	this.hilitedYear = null;
+	this.activeYear = null;
+	// Information
+	this.dateClicked = false;
+
+	// one-time initializations
+	if (typeof Calendar._SDN == "undefined") {
+		// table of short day names
+		if (typeof Calendar._SDN_len == "undefined")
+			Calendar._SDN_len = 3;
+		var ar = new Array();
+		for (var i = 8; i > 0;) {
+			ar[--i] = Calendar._DN[i].substr(0, Calendar._SDN_len);
+		}
+		Calendar._SDN = ar;
+		// table of short month names
+		if (typeof Calendar._SMN_len == "undefined")
+			Calendar._SMN_len = 3;
+		ar = new Array();
+		for (var i = 12; i > 0;) {
+			ar[--i] = Calendar._MN[i].substr(0, Calendar._SMN_len);
+		}
+		Calendar._SMN = ar;
+	}
+};
+
+// ** constants
+
+/// "static", needed for event handlers.
+Calendar._C = null;
+
+/// detect a special case of "web browser"
+Calendar.is_ie = ( /msie/i.test(navigator.userAgent) &&
+		   !/opera/i.test(navigator.userAgent) );
+
+Calendar.is_ie5 = ( Calendar.is_ie && /msie 5\.0/i.test(navigator.userAgent) );
+
+/// detect Opera browser
+Calendar.is_opera = /opera/i.test(navigator.userAgent);
+
+/// detect KHTML-based browsers
+Calendar.is_khtml = /Konqueror|Safari|KHTML/i.test(navigator.userAgent);
+
+// BEGIN: UTILITY FUNCTIONS; beware that these might be moved into a separate
+//        library, at some point.
+
+Calendar.getAbsolutePos = function(el) {
+	var SL = 0, ST = 0;
+	var is_div = /^div$/i.test(el.tagName);
+	if (is_div && el.scrollLeft)
+		SL = el.scrollLeft;
+	if (is_div && el.scrollTop)
+		ST = el.scrollTop;
+	var r = { x: el.offsetLeft - SL, y: el.offsetTop - ST };
+	if (el.offsetParent) {
+		var tmp = this.getAbsolutePos(el.offsetParent);
+		r.x += tmp.x;
+		r.y += tmp.y;
+	}
+	return r;
+};
+
+Calendar.isRelated = function (el, evt) {
+	var related = evt.relatedTarget;
+	if (!related) {
+		var type = evt.type;
+		if (type == "mouseover") {
+			related = evt.fromElement;
+		} else if (type == "mouseout") {
+			related = evt.toElement;
+		}
+	}
+	while (related) {
+		if (related == el) {
+			return true;
+		}
+		related = related.parentNode;
+	}
+	return false;
+};
+
+Calendar.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(" ");
+};
+
+Calendar.addClass = function(el, className) {
+	Calendar.removeClass(el, className);
+	el.className += " " + className;
+};
+
+// FIXME: the following 2 functions totally suck, are useless and should be replaced immediately.
+Calendar.getElement = function(ev) {
+	var f = Calendar.is_ie ? window.event.srcElement : ev.currentTarget;
+	while (f.nodeType != 1 || /^div$/i.test(f.tagName))
+		f = f.parentNode;
+	return f;
+};
+
+Calendar.getTargetElement = function(ev) {
+	var f = Calendar.is_ie ? window.event.srcElement : ev.target;
+	while (f.nodeType != 1)
+		f = f.parentNode;
+	return f;
+};
+
+Calendar.stopEvent = function(ev) {
+	ev || (ev = window.event);
+	if (Calendar.is_ie) {
+		ev.cancelBubble = true;
+		ev.returnValue = false;
+	} else {
+		ev.preventDefault();
+		ev.stopPropagation();
+	}
+	return false;
+};
+
+Calendar.addEvent = function(el, evname, func) {
+	if (el.attachEvent) { // IE
+		el.attachEvent("on" + evname, func);
+	} else if (el.addEventListener) { // Gecko / W3C
+		el.addEventListener(evname, func, true);
+	} else {
+		el["on" + evname] = func;
+	}
+};
+
+Calendar.removeEvent = function(el, evname, func) {
+	if (el.detachEvent) { // IE
+		el.detachEvent("on" + evname, func);
+	} else if (el.removeEventListener) { // Gecko / W3C
+		el.removeEventListener(evname, func, true);
+	} else {
+		el["on" + evname] = null;
+	}
+};
+
+Calendar.createElement = function(type, parent) {
+	var el = null;
+	if (document.createElementNS) {
+		// use the XHTML namespace; IE won't normally get here unless
+		// _they_ "fix" the DOM2 implementation.
+		el = document.createElementNS("http://www.w3.org/1999/xhtml", type);
+	} else {
+		el = document.createElement(type);
+	}
+	if (typeof parent != "undefined") {
+		parent.appendChild(el);
+	}
+	return el;
+};
+
+// END: UTILITY FUNCTIONS
+
+// BEGIN: CALENDAR STATIC FUNCTIONS
+
+/** Internal -- adds a set of events to make some element behave like a button. */
+Calendar._add_evs = function(el) {
+	with (Calendar) {
+		addEvent(el, "mouseover", dayMouseOver);
+		addEvent(el, "mousedown", dayMouseDown);
+		addEvent(el, "mouseout", dayMouseOut);
+		if (is_ie) {
+			addEvent(el, "dblclick", dayMouseDblClick);
+			el.setAttribute("unselectable", true);
+		}
+	}
+};
+
+Calendar.findMonth = function(el) {
+	if (typeof el.month != "undefined") {
+		return el;
+	} else if (typeof el.parentNode.month != "undefined") {
+		return el.parentNode;
+	}
+	return null;
+};
+
+Calendar.findYear = function(el) {
+	if (typeof el.year != "undefined") {
+		return el;
+	} else if (typeof el.parentNode.year != "undefined") {
+		return el.parentNode;
+	}
+	return null;
+};
+
+Calendar.showMonthsCombo = function () {
+	var cal = Calendar._C;
+	if (!cal) {
+		return false;
+	}
+	var cal = cal;
+	var cd = cal.activeDiv;
+	var mc = cal.monthsCombo;
+	if (cal.hilitedMonth) {
+		Calendar.removeClass(cal.hilitedMonth, "hilite");
+	}
+	if (cal.activeMonth) {
+		Calendar.removeClass(cal.activeMonth, "active");
+	}
+	var mon = cal.monthsCombo.getElementsByTagName("div")[cal.date.getMonth()];
+	Calendar.addClass(mon, "active");
+	cal.activeMonth = mon;
+	var s = mc.style;
+	s.display = "block";
+	if (cd.navtype < 0)
+		s.left = cd.offsetLeft + "px";
+	else {
+		var mcw = mc.offsetWidth;
+		if (typeof mcw == "undefined")
+			// Konqueror brain-dead techniques
+			mcw = 50;
+		s.left = (cd.offsetLeft + cd.offsetWidth - mcw) + "px";
+	}
+	s.top = (cd.offsetTop + cd.offsetHeight) + "px";
+};
+
+Calendar.showYearsCombo = function (fwd) {
+	var cal = Calendar._C;
+	if (!cal) {
+		return false;
+	}
+	var cal = cal;
+	var cd = cal.activeDiv;
+	var yc = cal.yearsCombo;
+	if (cal.hilitedYear) {
+		Calendar.removeClass(cal.hilitedYear, "hilite");
+	}
+	if (cal.activeYear) {
+		Calendar.removeClass(cal.activeYear, "active");
+	}
+	cal.activeYear = null;
+	var Y = cal.date.getFullYear() + (fwd ? 1 : -1);
+	var yr = yc.firstChild;
+	var show = false;
+	for (var i = 12; i > 0; --i) {
+		if (Y >= cal.minYear && Y <= cal.maxYear) {
+			yr.innerHTML = Y;
+			yr.year = Y;
+			yr.style.display = "block";
+			show = true;
+		} else {
+			yr.style.display = "none";
+		}
+		yr = yr.nextSibling;
+		Y += fwd ? cal.yearStep : -cal.yearStep;
+	}
+	if (show) {
+		var s = yc.style;
+		s.display = "block";
+		if (cd.navtype < 0)
+			s.left = cd.offsetLeft + "px";
+		else {
+			var ycw = yc.offsetWidth;
+			if (typeof ycw == "undefined")
+				// Konqueror brain-dead techniques
+				ycw = 50;
+			s.left = (cd.offsetLeft + cd.offsetWidth - ycw) + "px";
+		}
+		s.top = (cd.offsetTop + cd.offsetHeight) + "px";
+	}
+};
+
+// event handlers
+
+Calendar.tableMouseUp = function(ev) {
+	var cal = Calendar._C;
+	if (!cal) {
+		return false;
+	}
+	if (cal.timeout) {
+		clearTimeout(cal.timeout);
+	}
+	var el = cal.activeDiv;
+	if (!el) {
+		return false;
+	}
+	var target = Calendar.getTargetElement(ev);
+	ev || (ev = window.event);
+	Calendar.removeClass(el, "active");
+	if (target == el || target.parentNode == el) {
+		Calendar.cellClick(el, ev);
+	}
+	var mon = Calendar.findMonth(target);
+	var date = null;
+	if (mon) {
+		date = new Date(cal.date);
+		if (mon.month != date.getMonth()) {
+			date.setMonth(mon.month);
+			cal.setDate(date);
+			cal.dateClicked = false;
+			cal.callHandler();
+		}
+	} else {
+		var year = Calendar.findYear(target);
+		if (year) {
+			date = new Date(cal.date);
+			if (year.year != date.getFullYear()) {
+				date.setFullYear(year.year);
+				cal.setDate(date);
+				cal.dateClicked = false;
+				cal.callHandler();
+			}
+		}
+	}
+	with (Calendar) {
+		removeEvent(document, "mouseup", tableMouseUp);
+		removeEvent(document, "mouseover", tableMouseOver);
+		removeEvent(document, "mousemove", tableMouseOver);
+		cal._hideCombos();
+		_C = null;
+		return stopEvent(ev);
+	}
+};
+
+Calendar.tableMouseOver = function (ev) {
+	var cal = Calendar._C;
+	if (!cal) {
+		return;
+	}
+	var el = cal.activeDiv;
+	var target = Calendar.getTargetElement(ev);
+	if (target == el || target.parentNode == el) {
+		Calendar.addClass(el, "hilite active");
+		Calendar.addClass(el.parentNode, "rowhilite");
+	} else {
+		if (typeof el.navtype == "undefined" || (el.navtype != 50 && (el.navtype == 0 || Math.abs(el.navtype) > 2)))
+			Calendar.removeClass(el, "active");
+		Calendar.removeClass(el, "hilite");
+		Calendar.removeClass(el.parentNode, "rowhilite");
+	}
+	ev || (ev = window.event);
+	if (el.navtype == 50 && target != el) {
+		var pos = Calendar.getAbsolutePos(el);
+		var w = el.offsetWidth;
+		var x = ev.clientX;
+		var dx;
+		var decrease = true;
+		if (x > pos.x + w) {
+			dx = x - pos.x - w;
+			decrease = false;
+		} else
+			dx = pos.x - x;
+
+		if (dx < 0) dx = 0;
+		var range = el._range;
+		var current = el._current;
+		var count = Math.floor(dx / 10) % range.length;
+		for (var i = range.length; --i >= 0;)
+			if (range[i] == current)
+				break;
+		while (count-- > 0)
+			if (decrease) {
+				if (--i < 0)
+					i = range.length - 1;
+			} else if ( ++i >= range.length )
+				i = 0;
+		var newval = range[i];
+		el.innerHTML = newval;
+
+		cal.onUpdateTime();
+	}
+	var mon = Calendar.findMonth(target);
+	if (mon) {
+		if (mon.month != cal.date.getMonth()) {
+			if (cal.hilitedMonth) {
+				Calendar.removeClass(cal.hilitedMonth, "hilite");
+			}
+			Calendar.addClass(mon, "hilite");
+			cal.hilitedMonth = mon;
+		} else if (cal.hilitedMonth) {
+			Calendar.removeClass(cal.hilitedMonth, "hilite");
+		}
+	} else {
+		if (cal.hilitedMonth) {
+			Calendar.removeClass(cal.hilitedMonth, "hilite");
+		}
+		var year = Calendar.findYear(target);
+		if (year) {
+			if (year.year != cal.date.getFullYear()) {
+				if (cal.hilitedYear) {
+					Calendar.removeClass(cal.hilitedYear, "hilite");
+				}
+				Calendar.addClass(year, "hilite");
+				cal.hilitedYear = year;
+			} else if (cal.hilitedYear) {
+				Calendar.removeClass(cal.hilitedYear, "hilite");
+			}
+		} else if (cal.hilitedYear) {
+			Calendar.removeClass(cal.hilitedYear, "hilite");
+		}
+	}
+	return Calendar.stopEvent(ev);
+};
+
+Calendar.tableMouseDown = function (ev) {
+	if (Calendar.getTargetElement(ev) == Calendar.getElement(ev)) {
+		return Calendar.stopEvent(ev);
+	}
+};
+
+Calendar.calDragIt = function (ev) {
+	var cal = Calendar._C;
+	if (!(cal && cal.dragging)) {
+		return false;
+	}
+	var posX;
+	var posY;
+	if (Calendar.is_ie) {
+		posY = window.event.clientY + document.body.scrollTop;
+		posX = window.event.clientX + document.body.scrollLeft;
+	} else {
+		posX = ev.pageX;
+		posY = ev.pageY;
+	}
+	cal.hideShowCovered();
+	var st = cal.element.style;
+	st.left = (posX - cal.xOffs) + "px";
+	st.top = (posY - cal.yOffs) + "px";
+	return Calendar.stopEvent(ev);
+};
+
+Calendar.calDragEnd = function (ev) {
+	var cal = Calendar._C;
+	if (!cal) {
+		return false;
+	}
+	cal.dragging = false;
+	with (Calendar) {
+		removeEvent(document, "mousemove", calDragIt);
+		removeEvent(document, "mouseup", calDragEnd);
+		tableMouseUp(ev);
+	}
+	cal.hideShowCovered();
+};
+
+Calendar.dayMouseDown = function(ev) {
+	var el = Calendar.getElement(ev);
+	if (el.disabled) {
+		return false;
+	}
+	var cal = el.calendar;
+	cal.activeDiv = el;
+	Calendar._C = cal;
+	if (el.navtype != 300) with (Calendar) {
+		if (el.navtype == 50) {
+			el._current = el.innerHTML;
+			addEvent(document, "mousemove", tableMouseOver);
+		} else
+			addEvent(document, Calendar.is_ie5 ? "mousemove" : "mouseover", tableMouseOver);
+		addClass(el, "hilite active");
+		addEvent(document, "mouseup", tableMouseUp);
+	} else if (cal.isPopup) {
+		cal._dragStart(ev);
+	}
+	if (el.navtype == -1 || el.navtype == 1) {
+		if (cal.timeout) clearTimeout(cal.timeout);
+		cal.timeout = setTimeout("Calendar.showMonthsCombo()", 250);
+	} else if (el.navtype == -2 || el.navtype == 2) {
+		if (cal.timeout) clearTimeout(cal.timeout);
+		cal.timeout = setTimeout((el.navtype > 0) ? "Calendar.showYearsCombo(true)" : "Calendar.showYearsCombo(false)", 250);
+	} else {
+		cal.timeout = null;
+	}
+	return Calendar.stopEvent(ev);
+};
+
+Calendar.dayMouseDblClick = function(ev) {
+	Calendar.cellClick(Calendar.getElement(ev), ev || window.event);
+	if (Calendar.is_ie) {
+		document.selection.empty();
+	}
+};
+
+Calendar.dayMouseOver = function(ev) {
+	var el = Calendar.getElement(ev);
+	if (Calendar.isRelated(el, ev) || Calendar._C || el.disabled) {
+		return false;
+	}
+	if (el.ttip) {
+		if (el.ttip.substr(0, 1) == "_") {
+			el.ttip = el.caldate.print(el.calendar.ttDateFormat) + el.ttip.substr(1);
+		}
+		el.calendar.tooltips.innerHTML = el.ttip;
+	}
+	if (el.navtype != 300) {
+		Calendar.addClass(el, "hilite");
+		if (el.caldate) {
+			Calendar.addClass(el.parentNode, "rowhilite");
+		}
+	}
+	return Calendar.stopEvent(ev);
+};
+
+Calendar.dayMouseOut = function(ev) {
+	with (Calendar) {
+		var el = getElement(ev);
+		if (isRelated(el, ev) || _C || el.disabled)
+			return false;
+		removeClass(el, "hilite");
+		if (el.caldate)
+			removeClass(el.parentNode, "rowhilite");
+		if (el.calendar)
+			el.calendar.tooltips.innerHTML = _TT["SEL_DATE"];
+		return stopEvent(ev);
+	}
+};
+
+/**
+ *  A generic "click" handler :) handles all types of buttons defined in this
+ *  calendar.
+ */
+Calendar.cellClick = function(el, ev) {
+	var cal = el.calendar;
+	var closing = false;
+	var newdate = false;
+	var date = null;
+	if (typeof el.navtype == "undefined") {
+		if (cal.currentDateEl) {
+			Calendar.removeClass(cal.currentDateEl, "selected");
+			Calendar.addClass(el, "selected");
+			closing = (cal.currentDateEl == el);
+			if (!closing) {
+				cal.currentDateEl = el;
+			}
+		}
+		cal.date.setDateOnly(el.caldate);
+		date = cal.date;
+		var other_month = !(cal.dateClicked = !el.otherMonth);
+		if (!other_month && !cal.currentDateEl)
+			cal._toggleMultipleDate(new Date(date));
+		else
+			newdate = !el.disabled;
+		// a date was clicked
+		if (other_month)
+			cal._init(cal.firstDayOfWeek, date);
+	} else {
+		if (el.navtype == 200) {
+			Calendar.removeClass(el, "hilite");
+			cal.callCloseHandler();
+			return;
+		}
+		date = new Date(cal.date);
+		if (el.navtype == 0)
+			date.setDateOnly(new Date()); // TODAY
+		// unless "today" was clicked, we assume no date was clicked so
+		// the selected handler will know not to close the calenar when
+		// in single-click mode.
+		// cal.dateClicked = (el.navtype == 0);
+		cal.dateClicked = false;
+		var year = date.getFullYear();
+		var mon = date.getMonth();
+		function setMonth(m) {
+			var day = date.getDate();
+			var max = date.getMonthDays(m);
+			if (day > max) {
+				date.setDate(max);
+			}
+			date.setMonth(m);
+		};
+		switch (el.navtype) {
+		    case 400:
+			Calendar.removeClass(el, "hilite");
+			var text = Calendar._TT["ABOUT"];
+			if (typeof text != "undefined") {
+				text += cal.showsTime ? Calendar._TT["ABOUT_TIME"] : "";
+			} else {
+				// FIXME: this should be removed as soon as lang files get updated!
+				text = "Help and about box text is not translated into this language.\n" +
+					"If you know this language and you feel generous please update\n" +
+					"the corresponding file in \"lang\" subdir to match calendar-en.js\n" +
+					"and send it back to <mihai_bazon@yahoo.com> to get it into the distribution  ;-)\n\n" +
+					"Thank you!\n" +
+					"http://dynarch.com/mishoo/calendar.epl\n";
+			}
+			alert(text);
+			return;
+		    case -2:
+			if (year > cal.minYear) {
+				date.setFullYear(year - 1);
+			}
+			break;
+		    case -1:
+			if (mon > 0) {
+				setMonth(mon - 1);
+			} else if (year-- > cal.minYear) {
+				date.setFullYear(year);
+				setMonth(11);
+			}
+			break;
+		    case 1:
+			if (mon < 11) {
+				setMonth(mon + 1);
+			} else if (year < cal.maxYear) {
+				date.setFullYear(year + 1);
+				setMonth(0);
+			}
+			break;
+		    case 2:
+			if (year < cal.maxYear) {
+				date.setFullYear(year + 1);
+			}
+			break;
+		    case 100:
+			cal.setFirstDayOfWeek(el.fdow);
+			return;
+		    case 50:
+			var range = el._range;
+			var current = el.innerHTML;
+			for (var i = range.length; --i >= 0;)
+				if (range[i] == current)
+					break;
+			if (ev && ev.shiftKey) {
+				if (--i < 0)
+					i = range.length - 1;
+			} else if ( ++i >= range.length )
+				i = 0;
+			var newval = range[i];
+			el.innerHTML = newval;
+			cal.onUpdateTime();
+			return;
+		    case 0:
+			// TODAY will bring us here
+			if ((typeof cal.getDateStatus == "function") &&
+			    cal.getDateStatus(date, date.getFullYear(), date.getMonth(), date.getDate())) {
+				return false;
+			}
+			break;
+		}
+		if (!date.equalsTo(cal.date)) {
+			cal.setDate(date);
+			newdate = true;
+		} else if (el.navtype == 0)
+			newdate = closing = true;
+	}
+	if (newdate) {
+		ev && cal.callHandler();
+	}
+	if (closing) {
+		Calendar.removeClass(el, "hilite");
+		ev && cal.callCloseHandler();
+	}
+};
+
+// END: CALENDAR STATIC FUNCTIONS
+
+// BEGIN: CALENDAR OBJECT FUNCTIONS
+
+/**
+ *  This function creates the calendar inside the given parent.  If _par is
+ *  null than it creates a popup calendar inside the BODY element.  If _par is
+ *  an element, be it BODY, then it creates a non-popup calendar (still
+ *  hidden).  Some properties need to be set before calling this function.
+ */
+Calendar.prototype.create = function (_par) {
+	var parent = null;
+	if (! _par) {
+		// default parent is the document body, in which case we create
+		// a popup calendar.
+		parent = document.getElementsByTagName("body")[0];
+		this.isPopup = true;
+	} else {
+		parent = _par;
+		this.isPopup = false;
+	}
+	this.date = this.dateStr ? new Date(this.dateStr) : new Date();
+
+	var table = Calendar.createElement("table");
+	this.table = table;
+	table.cellSpacing = 0;
+	table.cellPadding = 0;
+	table.calendar = this;
+	Calendar.addEvent(table, "mousedown", Calendar.tableMouseDown);
+
+	var div = Calendar.createElement("div");
+	this.element = div;
+	div.className = "calendar";
+	if (this.isPopup) {
+		div.style.position = "absolute";
+		div.style.display = "none";
+	}
+	div.appendChild(table);
+
+	var thead = Calendar.createElement("thead", table);
+	var cell = null;
+	var row = null;
+
+	var cal = this;
+	var hh = function (text, cs, navtype) {
+		cell = Calendar.createElement("td", row);
+		cell.colSpan = cs;
+		cell.className = "button";
+		if (navtype != 0 && Math.abs(navtype) <= 2)
+			cell.className += " nav";
+		Calendar._add_evs(cell);
+		cell.calendar = cal;
+		cell.navtype = navtype;
+		cell.innerHTML = "<div unselectable='on'>" + text + "</div>";
+		return cell;
+	};
+
+	row = Calendar.createElement("tr", thead);
+	var title_length = 6;
+	(this.isPopup) && --title_length;
+	(this.weekNumbers) && ++title_length;
+
+	hh("?", 1, 400).ttip = Calendar._TT["INFO"];
+	this.title = hh("", title_length, 300);
+	this.title.className = "title";
+	if (this.isPopup) {
+		this.title.ttip = Calendar._TT["DRAG_TO_MOVE"];
+		this.title.style.cursor = "move";
+		hh("&#x00d7;", 1, 200).ttip = Calendar._TT["CLOSE"];
+	}
+
+	row = Calendar.createElement("tr", thead);
+	row.className = "headrow";
+
+	this._nav_py = hh("&#x00ab;", 1, -2);
+	this._nav_py.ttip = Calendar._TT["PREV_YEAR"];
+
+	this._nav_pm = hh("&#x2039;", 1, -1);
+	this._nav_pm.ttip = Calendar._TT["PREV_MONTH"];
+
+	this._nav_now = hh(Calendar._TT["TODAY"], this.weekNumbers ? 4 : 3, 0);
+	this._nav_now.ttip = Calendar._TT["GO_TODAY"];
+
+	this._nav_nm = hh("&#x203a;", 1, 1);
+	this._nav_nm.ttip = Calendar._TT["NEXT_MONTH"];
+
+	this._nav_ny = hh("&#x00bb;", 1, 2);
+	this._nav_ny.ttip = Calendar._TT["NEXT_YEAR"];
+
+	// day names
+	row = Calendar.createElement("tr", thead);
+	row.className = "daynames";
+	if (this.weekNumbers) {
+		cell = Calendar.createElement("td", row);
+		cell.className = "name wn";
+		cell.innerHTML = Calendar._TT["WK"];
+	}
+	for (var i = 7; i > 0; --i) {
+		cell = Calendar.createElement("td", row);
+		if (!i) {
+			cell.navtype = 100;
+			cell.calendar = this;
+			Calendar._add_evs(cell);
+		}
+	}
+	this.firstdayname = (this.weekNumbers) ? row.firstChild.nextSibling : row.firstChild;
+	this._displayWeekdays();
+
+	var tbody = Calendar.createElement("tbody", table);
+	this.tbody = tbody;
+
+	for (i = 6; i > 0; --i) {
+		row = Calendar.createElement("tr", tbody);
+		if (this.weekNumbers) {
+			cell = Calendar.createElement("td", row);
+		}
+		for (var j = 7; j > 0; --j) {
+			cell = Calendar.createElement("td", row);
+			cell.calendar = this;
+			Calendar._add_evs(cell);
+		}
+	}
+
+	if (this.showsTime) {
+		row = Calendar.createElement("tr", tbody);
+		row.className = "time";
+
+		cell = Calendar.createElement("td", row);
+		cell.className = "time";
+		cell.colSpan = 2;
+		cell.innerHTML = Calendar._TT["TIME"] || "&nbsp;";
+
+		cell = Calendar.createElement("td", row);
+		cell.className = "time";
+		cell.colSpan = this.weekNumbers ? 4 : 3;
+
+		(function(){
+			function makeTimePart(className, init, range_start, range_end) {
+				var part = Calendar.createElement("span", cell);
+				part.className = className;
+				part.innerHTML = init;
+				part.calendar = cal;
+				part.ttip = Calendar._TT["TIME_PART"];
+				part.navtype = 50;
+				part._range = [];
+				if (typeof range_start != "number")
+					part._range = range_start;
+				else {
+					for (var i = range_start; i <= range_end; ++i) {
+						var txt;
+						if (i < 10 && range_end >= 10) txt = '0' + i;
+						else txt = '' + i;
+						part._range[part._range.length] = txt;
+					}
+				}
+				Calendar._add_evs(part);
+				return part;
+			};
+			var hrs = cal.date.getHours();
+			var mins = cal.date.getMinutes();
+			var t12 = !cal.time24;
+			var pm = (hrs > 12);
+			if (t12 && pm) hrs -= 12;
+			var H = makeTimePart("hour", hrs, t12 ? 1 : 0, t12 ? 12 : 23);
+			var span = Calendar.createElement("span", cell);
+			span.innerHTML = ":";
+			span.className = "colon";
+			var M = makeTimePart("minute", mins, 0, 59);
+			var AP = null;
+			cell = Calendar.createElement("td", row);
+			cell.className = "time";
+			cell.colSpan = 2;
+			if (t12)
+				AP = makeTimePart("ampm", pm ? "pm" : "am", ["am", "pm"]);
+			else
+				cell.innerHTML = "&nbsp;";
+
+			cal.onSetTime = function() {
+				var pm, hrs = this.date.getHours(),
+					mins = this.date.getMinutes();
+				if (t12) {
+					pm = (hrs >= 12);
+					if (pm) hrs -= 12;
+					if (hrs == 0) hrs = 12;
+					AP.innerHTML = pm ? "pm" : "am";
+				}
+				H.innerHTML = (hrs < 10) ? ("0" + hrs) : hrs;
+				M.innerHTML = (mins < 10) ? ("0" + mins) : mins;
+			};
+
+			cal.onUpdateTime = function() {
+				var date = this.date;
+				var h = parseInt(H.innerHTML, 10);
+				if (t12) {
+					if (/pm/i.test(AP.innerHTML) && h < 12)
+						h += 12;
+					else if (/am/i.test(AP.innerHTML) && h == 12)
+						h = 0;
+				}
+				var d = date.getDate();
+				var m = date.getMonth();
+				var y = date.getFullYear();
+				date.setHours(h);
+				date.setMinutes(parseInt(M.innerHTML, 10));
+				date.setFullYear(y);
+				date.setMonth(m);
+				date.setDate(d);
+				this.dateClicked = false;
+				this.callHandler();
+			};
+		})();
+	} else {
+		this.onSetTime = this.onUpdateTime = function() {};
+	}
+
+	var tfoot = Calendar.createElement("tfoot", table);
+
+	row = Calendar.createElement("tr", tfoot);
+	row.className = "footrow";
+
+	cell = hh(Calendar._TT["SEL_DATE"], this.weekNumbers ? 8 : 7, 300);
+	cell.className = "ttip";
+	if (this.isPopup) {
+		cell.ttip = Calendar._TT["DRAG_TO_MOVE"];
+		cell.style.cursor = "move";
+	}
+	this.tooltips = cell;
+
+	div = Calendar.createElement("div", this.element);
+	this.monthsCombo = div;
+	div.className = "combo";
+	for (i = 0; i < Calendar._MN.length; ++i) {
+		var mn = Calendar.createElement("div");
+		mn.className = Calendar.is_ie ? "label-IEfix" : "label";
+		mn.month = i;
+		mn.innerHTML = Calendar._SMN[i];
+		div.appendChild(mn);
+	}
+
+	div = Calendar.createElement("div", this.element);
+	this.yearsCombo = div;
+	div.className = "combo";
+	for (i = 12; i > 0; --i) {
+		var yr = Calendar.createElement("div");
+		yr.className = Calendar.is_ie ? "label-IEfix" : "label";
+		div.appendChild(yr);
+	}
+
+	this._init(this.firstDayOfWeek, this.date);
+	parent.appendChild(this.element);
+};
+
+/** keyboard navigation, only for popup calendars */
+Calendar._keyEvent = function(ev) {
+	var cal = window._dynarch_popupCalendar;
+	if (!cal || cal.multiple)
+		return false;
+	(Calendar.is_ie) && (ev = window.event);
+	var act = (Calendar.is_ie || ev.type == "keypress"),
+		K = ev.keyCode;
+	if (ev.ctrlKey) {
+		switch (K) {
+		    case 37: // KEY left
+			act && Calendar.cellClick(cal._nav_pm);
+			break;
+		    case 38: // KEY up
+			act && Calendar.cellClick(cal._nav_py);
+			break;
+		    case 39: // KEY right
+			act && Calendar.cellClick(cal._nav_nm);
+			break;
+		    case 40: // KEY down
+			act && Calendar.cellClick(cal._nav_ny);
+			break;
+		    default:
+			return false;
+		}
+	} else switch (K) {
+	    case 32: // KEY space (now)
+		Calendar.cellClick(cal._nav_now);
+		break;
+	    case 27: // KEY esc
+		act && cal.callCloseHandler();
+		break;
+	    case 37: // KEY left
+	    case 38: // KEY up
+	    case 39: // KEY right
+	    case 40: // KEY down
+		if (act) {
+			var prev, x, y, ne, el, step;
+			prev = K == 37 || K == 38;
+			step = (K == 37 || K == 39) ? 1 : 7;
+			function setVars() {
+				el = cal.currentDateEl;
+				var p = el.pos;
+				x = p & 15;
+				y = p >> 4;
+				ne = cal.ar_days[y][x];
+			};setVars();
+			function prevMonth() {
+				var date = new Date(cal.date);
+				date.setDate(date.getDate() - step);
+				cal.setDate(date);
+			};
+			function nextMonth() {
+				var date = new Date(cal.date);
+				date.setDate(date.getDate() + step);
+				cal.setDate(date);
+			};
+			while (1) {
+				switch (K) {
+				    case 37: // KEY left
+					if (--x >= 0)
+						ne = cal.ar_days[y][x];
+					else {
+						x = 6;
+						K = 38;
+						continue;
+					}
+					break;
+				    case 38: // KEY up
+					if (--y >= 0)
+						ne = cal.ar_days[y][x];
+					else {
+						prevMonth();
+						setVars();
+					}
+					break;
+				    case 39: // KEY right
+					if (++x < 7)
+						ne = cal.ar_days[y][x];
+					else {
+						x = 0;
+						K = 40;
+						continue;
+					}
+					break;
+				    case 40: // KEY down
+					if (++y < cal.ar_days.length)
+						ne = cal.ar_days[y][x];
+					else {
+						nextMonth();
+						setVars();
+					}
+					break;
+				}
+				break;
+			}
+			if (ne) {
+				if (!ne.disabled)
+					Calendar.cellClick(ne);
+				else if (prev)
+					prevMonth();
+				else
+					nextMonth();
+			}
+		}
+		break;
+	    case 13: // KEY enter
+		if (act)
+			Calendar.cellClick(cal.currentDateEl, ev);
+		break;
+	    default:
+		return false;
+	}
+	return Calendar.stopEvent(ev);
+};
+
+/**
+ *  (RE)Initializes the calendar to the given date and firstDayOfWeek
+ */
+Calendar.prototype._init = function (firstDayOfWeek, date) {
+	var today = new Date(),
+		TY = today.getFullYear(),
+		TM = today.getMonth(),
+		TD = today.getDate();
+	this.table.style.visibility = "hidden";
+	var year = date.getFullYear();
+	if (year < this.minYear) {
+		year = this.minYear;
+		date.setFullYear(year);
+	} else if (year > this.maxYear) {
+		year = this.maxYear;
+		date.setFullYear(year);
+	}
+	this.firstDayOfWeek = firstDayOfWeek;
+	this.date = new Date(date);
+	var month = date.getMonth();
+	var mday = date.getDate();
+	var no_days = date.getMonthDays();
+
+	// calendar voodoo for computing the first day that would actually be
+	// displayed in the calendar, even if it's from the previous month.
+	// WARNING: this is magic. ;-)
+	date.setDate(1);
+	var day1 = (date.getDay() - this.firstDayOfWeek) % 7;
+	if (day1 < 0)
+		day1 += 7;
+	date.setDate(-day1);
+	date.setDate(date.getDate() + 1);
+
+	var row = this.tbody.firstChild;
+	var MN = Calendar._SMN[month];
+	var ar_days = this.ar_days = new Array();
+	var weekend = Calendar._TT["WEEKEND"];
+	var dates = this.multiple ? (this.datesCells = {}) : null;
+	for (var i = 0; i < 6; ++i, row = row.nextSibling) {
+		var cell = row.firstChild;
+		if (this.weekNumbers) {
+			cell.className = "day wn";
+			cell.innerHTML = date.getWeekNumber();
+			cell = cell.nextSibling;
+		}
+		row.className = "daysrow";
+		var hasdays = false, iday, dpos = ar_days[i] = [];
+		for (var j = 0; j < 7; ++j, cell = cell.nextSibling, date.setDate(iday + 1)) {
+			iday = date.getDate();
+			var wday = date.getDay();
+			cell.className = "day";
+			cell.pos = i << 4 | j;
+			dpos[j] = cell;
+			var current_month = (date.getMonth() == month);
+			if (!current_month) {
+				if (this.showsOtherMonths) {
+					cell.className += " othermonth";
+					cell.otherMonth = true;
+				} else {
+					cell.className = "emptycell";
+					cell.innerHTML = "&nbsp;";
+					cell.disabled = true;
+					continue;
+				}
+			} else {
+				cell.otherMonth = false;
+				hasdays = true;
+			}
+			cell.disabled = false;
+			cell.innerHTML = this.getDateText ? this.getDateText(date, iday) : iday;
+			if (dates)
+				dates[date.print("%Y%m%d")] = cell;
+			if (this.getDateStatus) {
+				var status = this.getDateStatus(date, year, month, iday);
+				if (this.getDateToolTip) {
+					var toolTip = this.getDateToolTip(date, year, month, iday);
+					if (toolTip)
+						cell.title = toolTip;
+				}
+				if (status === true) {
+					cell.className += " disabled";
+					cell.disabled = true;
+				} else {
+					if (/disabled/i.test(status))
+						cell.disabled = true;
+					cell.className += " " + status;
+				}
+			}
+			if (!cell.disabled) {
+				cell.caldate = new Date(date);
+				cell.ttip = "_";
+				if (!this.multiple && current_month
+				    && iday == mday && this.hiliteToday) {
+					cell.className += " selected";
+					this.currentDateEl = cell;
+				}
+				if (date.getFullYear() == TY &&
+				    date.getMonth() == TM &&
+				    iday == TD) {
+					cell.className += " today";
+					cell.ttip += Calendar._TT["PART_TODAY"];
+				}
+				if (weekend.indexOf(wday.toString()) != -1)
+					cell.className += cell.otherMonth ? " oweekend" : " weekend";
+			}
+		}
+		if (!(hasdays || this.showsOtherMonths))
+			row.className = "emptyrow";
+	}
+	this.title.innerHTML = Calendar._MN[month] + ", " + year;
+	this.onSetTime();
+	this.table.style.visibility = "visible";
+	this._initMultipleDates();
+	// PROFILE
+	// this.tooltips.innerHTML = "Generated in " + ((new Date()) - today) + " ms";
+};
+
+Calendar.prototype._initMultipleDates = function() {
+	if (this.multiple) {
+		for (var i in this.multiple) {
+			var cell = this.datesCells[i];
+			var d = this.multiple[i];
+			if (!d)
+				continue;
+			if (cell)
+				cell.className += " selected";
+		}
+	}
+};
+
+Calendar.prototype._toggleMultipleDate = function(date) {
+	if (this.multiple) {
+		var ds = date.print("%Y%m%d");
+		var cell = this.datesCells[ds];
+		if (cell) {
+			var d = this.multiple[ds];
+			if (!d) {
+				Calendar.addClass(cell, "selected");
+				this.multiple[ds] = date;
+			} else {
+				Calendar.removeClass(cell, "selected");
+				delete this.multiple[ds];
+			}
+		}
+	}
+};
+
+Calendar.prototype.setDateToolTipHandler = function (unaryFunction) {
+	this.getDateToolTip = unaryFunction;
+};
+
+/**
+ *  Calls _init function above for going to a certain date (but only if the
+ *  date is different than the currently selected one).
+ */
+Calendar.prototype.setDate = function (date) {
+	if (!date.equalsTo(this.date)) {
+		this._init(this.firstDayOfWeek, date);
+	}
+};
+
+/**
+ *  Refreshes the calendar.  Useful if the "disabledHandler" function is
+ *  dynamic, meaning that the list of disabled date can change at runtime.
+ *  Just * call this function if you think that the list of disabled dates
+ *  should * change.
+ */
+Calendar.prototype.refresh = function () {
+	this._init(this.firstDayOfWeek, this.date);
+};
+
+/** Modifies the "firstDayOfWeek" parameter (pass 0 for Synday, 1 for Monday, etc.). */
+Calendar.prototype.setFirstDayOfWeek = function (firstDayOfWeek) {
+	this._init(firstDayOfWeek, this.date);
+	this._displayWeekdays();
+};
+
+/**
+ *  Allows customization of what dates are enabled.  The "unaryFunction"
+ *  parameter must be a function object that receives the date (as a JS Date
+ *  object) and returns a boolean value.  If the returned value is true then
+ *  the passed date will be marked as disabled.
+ */
+Calendar.prototype.setDateStatusHandler = Calendar.prototype.setDisabledHandler = function (unaryFunction) {
+	this.getDateStatus = unaryFunction;
+};
+
+/** Customization of allowed year range for the calendar. */
+Calendar.prototype.setRange = function (a, z) {
+	this.minYear = a;
+	this.maxYear = z;
+};
+
+/** Calls the first user handler (selectedHandler). */
+Calendar.prototype.callHandler = function () {
+	if (this.onSelected) {
+		this.onSelected(this, this.date.print(this.dateFormat));
+	}
+};
+
+/** Calls the second user handler (closeHandler). */
+Calendar.prototype.callCloseHandler = function () {
+	if (this.onClose) {
+		this.onClose(this);
+	}
+	this.hideShowCovered();
+};
+
+/** Removes the calendar object from the DOM tree and destroys it. */
+Calendar.prototype.destroy = function () {
+	var el = this.element.parentNode;
+	el.removeChild(this.element);
+	Calendar._C = null;
+	window._dynarch_popupCalendar = null;
+};
+
+/**
+ *  Moves the calendar element to a different section in the DOM tree (changes
+ *  its parent).
+ */
+Calendar.prototype.reparent = function (new_parent) {
+	var el = this.element;
+	el.parentNode.removeChild(el);
+	new_parent.appendChild(el);
+};
+
+// This gets called when the user presses a mouse button anywhere in the
+// document, if the calendar is shown.  If the click was outside the open
+// calendar this function closes it.
+Calendar._checkCalendar = function(ev) {
+	var calendar = window._dynarch_popupCalendar;
+	if (!calendar) {
+		return false;
+	}
+	var el = Calendar.is_ie ? Calendar.getElement(ev) : Calendar.getTargetElement(ev);
+	for (; el != null && el != calendar.element; el = el.parentNode);
+	if (el == null) {
+		// calls closeHandler which should hide the calendar.
+		window._dynarch_popupCalendar.callCloseHandler();
+		return Calendar.stopEvent(ev);
+	}
+};
+
+/** Shows the calendar. */
+Calendar.prototype.show = function () {
+	var rows = this.table.getElementsByTagName("tr");
+	for (var i = rows.length; i > 0;) {
+		var row = rows[--i];
+		Calendar.removeClass(row, "rowhilite");
+		var cells = row.getElementsByTagName("td");
+		for (var j = cells.length; j > 0;) {
+			var cell = cells[--j];
+			Calendar.removeClass(cell, "hilite");
+			Calendar.removeClass(cell, "active");
+		}
+	}
+	this.element.style.display = "block";
+	this.hidden = false;
+	if (this.isPopup) {
+		window._dynarch_popupCalendar = this;
+		Calendar.addEvent(document, "keydown", Calendar._keyEvent);
+		Calendar.addEvent(document, "keypress", Calendar._keyEvent);
+		Calendar.addEvent(document, "mousedown", Calendar._checkCalendar);
+	}
+	this.hideShowCovered();
+};
+
+/**
+ *  Hides the calendar.  Also removes any "hilite" from the class of any TD
+ *  element.
+ */
+Calendar.prototype.hide = function () {
+	if (this.isPopup) {
+		Calendar.removeEvent(document, "keydown", Calendar._keyEvent);
+		Calendar.removeEvent(document, "keypress", Calendar._keyEvent);
+		Calendar.removeEvent(document, "mousedown", Calendar._checkCalendar);
+	}
+	this.element.style.display = "none";
+	this.hidden = true;
+	this.hideShowCovered();
+};
+
+/**
+ *  Shows the calendar at a given absolute position (beware that, depending on
+ *  the calendar element style -- position property -- this might be relative
+ *  to the parent's containing rectangle).
+ */
+Calendar.prototype.showAt = function (x, y) {
+	var s = this.element.style;
+	s.left = x + "px";
+	s.top = y + "px";
+	this.show();
+};
+
+/** Shows the calendar near a given element. */
+Calendar.prototype.showAtElement = function (el, opts) {
+	var self = this;
+	var p = Calendar.getAbsolutePos(el);
+	if (!opts || typeof opts != "string") {
+		this.showAt(p.x, p.y + el.offsetHeight);
+		return true;
+	}
+	function fixPosition(box) {
+		if (box.x < 0)
+			box.x = 0;
+		if (box.y < 0)
+			box.y = 0;
+		var cp = document.createElement("div");
+		var s = cp.style;
+		s.position = "absolute";
+		s.right = s.bottom = s.width = s.height = "0px";
+		document.body.appendChild(cp);
+		var br = Calendar.getAbsolutePos(cp);
+		document.body.removeChild(cp);
+		if (Calendar.is_ie) {
+			br.y += document.body.scrollTop;
+			br.x += document.body.scrollLeft;
+		} else {
+			br.y += window.scrollY;
+			br.x += window.scrollX;
+		}
+		var tmp = box.x + box.width - br.x;
+		if (tmp > 0) box.x -= tmp;
+		tmp = box.y + box.height - br.y;
+		if (tmp > 0) box.y -= tmp;
+	};
+	this.element.style.display = "block";
+	Calendar.continuation_for_the_fucking_khtml_browser = function() {
+		var w = self.element.offsetWidth;
+		var h = self.element.offsetHeight;
+		self.element.style.display = "none";
+		var valign = opts.substr(0, 1);
+		var halign = "l";
+		if (opts.length > 1) {
+			halign = opts.substr(1, 1);
+		}
+		// vertical alignment
+		switch (valign) {
+		    case "T": p.y -= h; break;
+		    case "B": p.y += el.offsetHeight; break;
+		    case "C": p.y += (el.offsetHeight - h) / 2; break;
+		    case "t": p.y += el.offsetHeight - h; break;
+		    case "b": break; // already there
+		}
+		// horizontal alignment
+		switch (halign) {
+		    case "L": p.x -= w; break;
+		    case "R": p.x += el.offsetWidth; break;
+		    case "C": p.x += (el.offsetWidth - w) / 2; break;
+		    case "l": p.x += el.offsetWidth - w; break;
+		    case "r": break; // already there
+		}
+		p.width = w;
+		p.height = h + 40;
+		self.monthsCombo.style.display = "none";
+		fixPosition(p);
+		self.showAt(p.x, p.y);
+	};
+	if (Calendar.is_khtml)
+		setTimeout("Calendar.continuation_for_the_fucking_khtml_browser()", 10);
+	else
+		Calendar.continuation_for_the_fucking_khtml_browser();
+};
+
+/** Customizes the date format. */
+Calendar.prototype.setDateFormat = function (str) {
+	this.dateFormat = str;
+};
+
+/** Customizes the tooltip date format. */
+Calendar.prototype.setTtDateFormat = function (str) {
+	this.ttDateFormat = str;
+};
+
+/**
+ *  Tries to identify the date represented in a string.  If successful it also
+ *  calls this.setDate which moves the calendar to the given date.
+ */
+Calendar.prototype.parseDate = function(str, fmt) {
+	if (!fmt)
+		fmt = this.dateFormat;
+	this.setDate(Date.parseDate(str, fmt));
+};
+
+Calendar.prototype.hideShowCovered = function () {
+	if (!Calendar.is_ie && !Calendar.is_opera)
+		return;
+	function getVisib(obj){
+		var value = obj.style.visibility;
+		if (!value) {
+			if (document.defaultView && typeof (document.defaultView.getComputedStyle) == "function") { // Gecko, W3C
+				if (!Calendar.is_khtml)
+					value = document.defaultView.
+						getComputedStyle(obj, "").getPropertyValue("visibility");
+				else
+					value = '';
+			} else if (obj.currentStyle) { // IE
+				value = obj.currentStyle.visibility;
+			} else
+				value = '';
+		}
+		return value;
+	};
+
+	var tags = new Array("applet", "iframe", "select");
+	var el = this.element;
+
+	var p = Calendar.getAbsolutePos(el);
+	var EX1 = p.x;
+	var EX2 = el.offsetWidth + EX1;
+	var EY1 = p.y;
+	var EY2 = el.offsetHeight + EY1;
+
+	for (var k = tags.length; k > 0; ) {
+		var ar = document.getElementsByTagName(tags[--k]);
+		var cc = null;
+
+		for (var i = ar.length; i > 0;) {
+			cc = ar[--i];
+
+			p = Calendar.getAbsolutePos(cc);
+			var CX1 = p.x;
+			var CX2 = cc.offsetWidth + CX1;
+			var CY1 = p.y;
+			var CY2 = cc.offsetHeight + CY1;
+
+			if (this.hidden || (CX1 > EX2) || (CX2 < EX1) || (CY1 > EY2) || (CY2 < EY1)) {
+				if (!cc.__msh_save_visibility) {
+					cc.__msh_save_visibility = getVisib(cc);
+				}
+				cc.style.visibility = cc.__msh_save_visibility;
+			} else {
+				if (!cc.__msh_save_visibility) {
+					cc.__msh_save_visibility = getVisib(cc);
+				}
+				cc.style.visibility = "hidden";
+			}
+		}
+	}
+};
+
+/** Internal function; it displays the bar with the names of the weekday. */
+Calendar.prototype._displayWeekdays = function () {
+	var fdow = this.firstDayOfWeek;
+	var cell = this.firstdayname;
+	var weekend = Calendar._TT["WEEKEND"];
+	for (var i = 0; i < 7; ++i) {
+		cell.className = "day name";
+		var realday = (i + fdow) % 7;
+		if (i) {
+			cell.ttip = Calendar._TT["DAY_FIRST"].replace("%s", Calendar._DN[realday]);
+			cell.navtype = 100;
+			cell.calendar = this;
+			cell.fdow = realday;
+			Calendar._add_evs(cell);
+		}
+		if (weekend.indexOf(realday.toString()) != -1) {
+			Calendar.addClass(cell, "weekend");
+		}
+		cell.innerHTML = Calendar._SDN[(i + fdow) % 7];
+		cell = cell.nextSibling;
+	}
+};
+
+/** Internal function.  Hides all combo boxes that might be displayed. */
+Calendar.prototype._hideCombos = function () {
+	this.monthsCombo.style.display = "none";
+	this.yearsCombo.style.display = "none";
+};
+
+/** Internal function.  Starts dragging the element. */
+Calendar.prototype._dragStart = function (ev) {
+	if (this.dragging) {
+		return;
+	}
+	this.dragging = true;
+	var posX;
+	var posY;
+	if (Calendar.is_ie) {
+		posY = window.event.clientY + document.body.scrollTop;
+		posX = window.event.clientX + document.body.scrollLeft;
+	} else {
+		posY = ev.clientY + window.scrollY;
+		posX = ev.clientX + window.scrollX;
+	}
+	var st = this.element.style;
+	this.xOffs = posX - parseInt(st.left);
+	this.yOffs = posY - parseInt(st.top);
+	with (Calendar) {
+		addEvent(document, "mousemove", calDragIt);
+		addEvent(document, "mouseup", calDragEnd);
+	}
+};
+
+// BEGIN: DATE OBJECT PATCHES
+
+/** Adds the number of days array to the Date object. */
+Date._MD = new Array(31,28,31,30,31,30,31,31,30,31,30,31);
+
+/** Constants used for time computations */
+Date.SECOND = 1000 /* milliseconds */;
+Date.MINUTE = 60 * Date.SECOND;
+Date.HOUR   = 60 * Date.MINUTE;
+Date.DAY    = 24 * Date.HOUR;
+Date.WEEK   =  7 * Date.DAY;
+
+Date.parseDate = function(str, fmt) {
+	var today = new Date();
+	var y = 0;
+	var m = -1;
+	var d = 0;
+	var a = str.split(/\W+/);
+	var b = fmt.match(/%./g);
+	var i = 0, j = 0;
+	var hr = 0;
+	var min = 0;
+	for (i = 0; i < a.length; ++i) {
+		if (!a[i])
+			continue;
+		switch (b[i]) {
+		    case "%d":
+		    case "%e":
+			d = parseInt(a[i], 10);
+			break;
+
+		    case "%m":
+			m = parseInt(a[i], 10) - 1;
+			break;
+
+		    case "%Y":
+		    case "%y":
+			y = parseInt(a[i], 10);
+			(y < 100) && (y += (y > 29) ? 1900 : 2000);
+			break;
+
+		    case "%b":
+		    case "%B":
+			for (j = 0; j < 12; ++j) {
+				if (Calendar._MN[j].substr(0, a[i].length).toLowerCase() == a[i].toLowerCase()) { m = j; break; }
+			}
+			break;
+
+		    case "%H":
+		    case "%I":
+		    case "%k":
+		    case "%l":
+			hr = parseInt(a[i], 10);
+			break;
+
+		    case "%P":
+		    case "%p":
+			if (/pm/i.test(a[i]) && hr < 12)
+				hr += 12;
+			else if (/am/i.test(a[i]) && hr >= 12)
+				hr -= 12;
+			break;
+
+		    case "%M":
+			min = parseInt(a[i], 10);
+			break;
+		}
+	}
+	if (isNaN(y)) y = today.getFullYear();
+	if (isNaN(m)) m = today.getMonth();
+	if (isNaN(d)) d = today.getDate();
+	if (isNaN(hr)) hr = today.getHours();
+	if (isNaN(min)) min = today.getMinutes();
+	if (y != 0 && m != -1 && d != 0)
+		return new Date(y, m, d, hr, min, 0);
+	y = 0; m = -1; d = 0;
+	for (i = 0; i < a.length; ++i) {
+		if (a[i].search(/[a-zA-Z]+/) != -1) {
+			var t = -1;
+			for (j = 0; j < 12; ++j) {
+				if (Calendar._MN[j].substr(0, a[i].length).toLowerCase() == a[i].toLowerCase()) { t = j; break; }
+			}
+			if (t != -1) {
+				if (m != -1) {
+					d = m+1;
+				}
+				m = t;
+			}
+		} else if (parseInt(a[i], 10) <= 12 && m == -1) {
+			m = a[i]-1;
+		} else if (parseInt(a[i], 10) > 31 && y == 0) {
+			y = parseInt(a[i], 10);
+			(y < 100) && (y += (y > 29) ? 1900 : 2000);
+		} else if (d == 0) {
+			d = a[i];
+		}
+	}
+	if (y == 0)
+		y = today.getFullYear();
+	if (m != -1 && d != 0)
+		return new Date(y, m, d, hr, min, 0);
+	return today;
+};
+
+/** Returns the number of days in the current month */
+Date.prototype.getMonthDays = function(month) {
+	var year = this.getFullYear();
+	if (typeof month == "undefined") {
+		month = this.getMonth();
+	}
+	if (((0 == (year%4)) && ( (0 != (year%100)) || (0 == (year%400)))) && month == 1) {
+		return 29;
+	} else {
+		return Date._MD[month];
+	}
+};
+
+/** Returns the number of day in the year. */
+Date.prototype.getDayOfYear = function() {
+	var now = new Date(this.getFullYear(), this.getMonth(), this.getDate(), 0, 0, 0);
+	var then = new Date(this.getFullYear(), 0, 0, 0, 0, 0);
+	var time = now - then;
+	return Math.floor(time / Date.DAY);
+};
+
+/** Returns the number of the week in year, as defined in ISO 8601. */
+Date.prototype.getWeekNumber = function() {
+	var d = new Date(this.getFullYear(), this.getMonth(), this.getDate(), 0, 0, 0);
+	var DoW = d.getDay();
+	d.setDate(d.getDate() - (DoW + 6) % 7 + 3); // Nearest Thu
+	var ms = d.valueOf(); // GMT
+	d.setMonth(0);
+	d.setDate(4); // Thu in Week 1
+	return Math.round((ms - d.valueOf()) / (7 * 864e5)) + 1;
+};
+
+/** Checks date and time equality */
+Date.prototype.equalsTo = function(date) {
+	return ((this.getFullYear() == date.getFullYear()) &&
+		(this.getMonth() == date.getMonth()) &&
+		(this.getDate() == date.getDate()) &&
+		(this.getHours() == date.getHours()) &&
+		(this.getMinutes() == date.getMinutes()));
+};
+
+/** Set only the year, month, date parts (keep existing time) */
+Date.prototype.setDateOnly = function(date) {
+	var tmp = new Date(date);
+	this.setDate(1);
+	this.setFullYear(tmp.getFullYear());
+	this.setMonth(tmp.getMonth());
+	this.setDate(tmp.getDate());
+};
+
+/** Prints the date in a string according to the given format. */
+Date.prototype.print = function (str) {
+	var m = this.getMonth();
+	var d = this.getDate();
+	var y = this.getFullYear();
+	var wn = this.getWeekNumber();
+	var w = this.getDay();
+	var s = {};
+	var hr = this.getHours();
+	var pm = (hr >= 12);
+	var ir = (pm) ? (hr - 12) : hr;
+	var dy = this.getDayOfYear();
+	if (ir == 0)
+		ir = 12;
+	var min = this.getMinutes();
+	var sec = this.getSeconds();
+	s["%a"] = Calendar._SDN[w]; // abbreviated weekday name [FIXME: I18N]
+	s["%A"] = Calendar._DN[w]; // full weekday name
+	s["%b"] = Calendar._SMN[m]; // abbreviated month name [FIXME: I18N]
+	s["%B"] = Calendar._MN[m]; // full month name
+	// FIXME: %c : preferred date and time representation for the current locale
+	s["%C"] = 1 + Math.floor(y / 100); // the century number
+	s["%d"] = (d < 10) ? ("0" + d) : d; // the day of the month (range 01 to 31)
+	s["%e"] = d; // the day of the month (range 1 to 31)
+	// FIXME: %D : american date style: %m/%d/%y
+	// FIXME: %E, %F, %G, %g, %h (man strftime)
+	s["%H"] = (hr < 10) ? ("0" + hr) : hr; // hour, range 00 to 23 (24h format)
+	s["%I"] = (ir < 10) ? ("0" + ir) : ir; // hour, range 01 to 12 (12h format)
+	s["%j"] = (dy < 100) ? ((dy < 10) ? ("00" + dy) : ("0" + dy)) : dy; // day of the year (range 001 to 366)
+	s["%k"] = hr;		// hour, range 0 to 23 (24h format)
+	s["%l"] = ir;		// hour, range 1 to 12 (12h format)
+	s["%m"] = (m < 9) ? ("0" + (1+m)) : (1+m); // month, range 01 to 12
+	s["%M"] = (min < 10) ? ("0" + min) : min; // minute, range 00 to 59
+	s["%n"] = "\n";		// a newline character
+	s["%p"] = pm ? "PM" : "AM";
+	s["%P"] = pm ? "pm" : "am";
+	// FIXME: %r : the time in am/pm notation %I:%M:%S %p
+	// FIXME: %R : the time in 24-hour notation %H:%M
+	s["%s"] = Math.floor(this.getTime() / 1000);
+	s["%S"] = (sec < 10) ? ("0" + sec) : sec; // seconds, range 00 to 59
+	s["%t"] = "\t";		// a tab character
+	// FIXME: %T : the time in 24-hour notation (%H:%M:%S)
+	s["%U"] = s["%W"] = s["%V"] = (wn < 10) ? ("0" + wn) : wn;
+	s["%u"] = w + 1;	// the day of the week (range 1 to 7, 1 = MON)
+	s["%w"] = w;		// the day of the week (range 0 to 6, 0 = SUN)
+	// FIXME: %x : preferred date representation for the current locale without the time
+	// FIXME: %X : preferred time representation for the current locale without the date
+	s["%y"] = ('' + y).substr(2, 2); // year without the century (range 00 to 99)
+	s["%Y"] = y;		// year with the century
+	s["%%"] = "%";		// a literal '%' character
+
+	var re = /%./g;
+	if (!Calendar.is_ie5 && !Calendar.is_khtml)
+		return str.replace(re, function (par) { return s[par] || par; });
+
+	var a = str.match(re);
+	for (var i = 0; i < a.length; i++) {
+		var tmp = s[a[i]];
+		if (tmp) {
+			re = new RegExp(a[i], 'g');
+			str = str.replace(re, tmp);
+		}
+	}
+
+	return str;
+};
+
+Date.prototype.__msh_oldSetFullYear = Date.prototype.setFullYear;
+Date.prototype.setFullYear = function(y) {
+	var d = new Date(this);
+	d.__msh_oldSetFullYear(y);
+	if (d.getMonth() != this.getMonth())
+		this.setDate(28);
+	this.__msh_oldSetFullYear(y);
+};
+
+// END: DATE OBJECT PATCHES
+
+
+// global object that remembers the calendar
+window._dynarch_popupCalendar = null;

Property changes on: trunk/wb/include/jscalendar/calendar.js
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: trunk/wb/include/jscalendar/menuarrow2.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: trunk/wb/include/jscalendar/menuarrow2.gif
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Index: trunk/wb/include/jscalendar/wb-setup.php
===================================================================
--- trunk/wb/include/jscalendar/wb-setup.php	(nonexistent)
+++ trunk/wb/include/jscalendar/wb-setup.php	(revision 552)
@@ -0,0 +1,82 @@
+<?php
+
+// $Id: $
+
+/*
+
+ Website Baker Project <http://www.websitebaker.org/>
+ Copyright (C) 2004-2008, Ryan Djurovich
+
+ Website Baker is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ Website Baker is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Website Baker; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+*/
+
+/*
+	import jscalendar css and scripts
+*/
+
+if(!defined('WB_URL')) {
+	header('Location: ../index.php');
+	exit(0);
+}
+
+?>
+<style type="text/css">
+<?php
+require_once(WB_PATH."/include/jscalendar/calendar-system.css");
+?>
+</style>
+<script type="text/javascript" src="<?php echo WB_URL ?>/include/jscalendar/calendar.js"></script>
+<?php // some stuff for jscalendar
+	// language
+	$jscal_lang = defined('LANGUAGE')?strtolower(LANGUAGE):"en";
+	$jscal_lang = $jscal_lang!=""?$jscal_lang:"en";
+	if(!file_exists(WB_PATH."/include/jscalendar/lang/calendar-$jscal_lang.js")) {
+		$jscal_lang = "en";
+	}
+	// today
+	$jscal_today = date("Y/m/d");
+	// first-day-of-week
+	$jscal_firstday = "1"; // monday
+	if(LANGUAGE=="EN")
+		$jscal_firstday = "0"; // sunday
+	// date and time format for the text-field and for jscal's "ifFormat". We offer dd.mm.yyyy or yyyy-mm-dd or mm/dd/yyyy
+	switch(DATE_FORMAT) {
+		case 'd.m.Y':
+		case 'd M Y':
+		case 'l, jS F, Y':
+		case 'jS F, Y':
+		case 'D M d, Y':
+		case 'd-m-Y':
+		case 'd/m/Y':
+			$jscal_format = "d.m.Y H:i"; // dd.mm.yyyy hh:mm
+			$jscal_ifformat = "%d.%m.%Y %H:%M";
+			break;
+		case 'm/d/Y':
+		case 'm-d-Y':
+		case 'M d Y':
+		case 'm.d.Y':
+			$jscal_format = "m/d/Y H:i"; // mm/dd/yyyy hh:mm
+			$jscal_ifformat = "%m/%d/%Y %H:%M";
+			break;
+		default:
+			$jscal_format = "Y-m-d H:i"; // yyyy-mm-dd hh:mm
+			$jscal_ifformat = "%Y-%m-%d %H:%M";
+			break;
+	}
+	// load scripts for jscalendar
+?>
+<script type="text/javascript" src="<?php echo WB_URL ?>/include/jscalendar/lang/calendar-<?php echo $jscal_lang ?>.js"></script>
+<script type="text/javascript" src="<?php echo WB_URL ?>/include/jscalendar/calendar-setup.js"></script>

Property changes on: trunk/wb/include/jscalendar/wb-setup.php
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: trunk/wb/include/jscalendar/README
===================================================================
--- trunk/wb/include/jscalendar/README	(nonexistent)
+++ trunk/wb/include/jscalendar/README	(revision 552)
@@ -0,0 +1,33 @@
+The DHTML Calendar
+-------------------
+
+  Author: Mihai Bazon, <mihai_bazon@yahoo.com>
+          http://dynarch.com/mishoo/
+
+  This program is free software published under the
+  terms of the GNU Lesser General Public License.
+
+  For the entire license text please refer to
+  http://www.gnu.org/licenses/lgpl.html
+
+Contents
+---------
+
+  calendar.js     -- the main program file
+  lang/*.js       -- internalization files
+  *.css           -- color themes
+  cal.html        -- example usage file
+  doc/            -- documentation, in PDF and HTML
+  simple-1.html   -- quick setup examples [popup calendars]
+  simple-2.html   -- quick setup example for flat calendar
+  calendar.php    -- PHP wrapper
+  test.php        -- test file for the PHP wrapper
+
+Homepage
+---------
+
+  For details and latest versions please refer to calendar
+  homepage, located on my website:
+
+    http://dynarch.com/mishoo/calendar.epl
+

Property changes on: trunk/wb/include/jscalendar/README
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: trunk/wb/search/search.php
===================================================================
--- trunk/wb/search/search.php	(revision 551)
+++ trunk/wb/search/search.php	(revision 552)
@@ -23,6 +23,8 @@
 
 */
 
+// most of this is still the same code as in 2.6.7, but rearranged heavily
+
 if(!defined('WB_URL')) { 
 	header('Location: index.php');
 	exit(0);
@@ -34,369 +36,601 @@
 // Check if search is enabled
 if(SHOW_SEARCH != true) {
 	echo $TEXT['SEARCH'].' '.$TEXT['DISABLED'];
-} else {
-	
-	// Make pages_listed and items_listed blank arrays
-	$pages_listed = array();
-	$items_listed = array();
+	return;
+}
 
-	// Get the search type
-	$match = 'all';
-	if(isset($_REQUEST['match'])) {
-		$match = $_REQUEST['match'];
+// this is for timing-tests only
+//$overall_start_time = microtime(true);
+
+// search-module-extension: get helper-functions
+require_once(WB_PATH.'/search/search_modext.php');
+// search-module-extension: Get "search.php" for each module, if present
+// looks in modules/module/ and modules/module_searchext/
+$search_funcs = array();
+$query = $database->query("SELECT DISTINCT directory FROM ".TABLE_PREFIX."addons WHERE type = 'module' AND directory NOT LIKE '%_searchext'");
+if($query->numRows() > 0) {
+	while($module = $query->fetchRow()) {
+		$func_name = $module['directory']."_search";
+		$file = WB_PATH.'/modules/'.$module['directory'].'/search.php';
+		if(!file_exists($file)) {
+			$file = WB_PATH.'/modules/'.$module['directory'].'_searchext/search.php';
+			if(!file_exists($file)) {
+				$file='';
+			}
+		}
+		if($file!='') {
+			include_once($file);
+			if(function_exists($module['directory']."_search")) {
+				$search_funcs[$module['directory']] = $func_name;
+			}
+		}
 	}
+}
 
-	// Get search string
-	if(isset($_REQUEST['string'])) {
-		if ($match!='exact') {
-			$string=str_replace(',', '', $_REQUEST['string']);
+// Get the search type
+$match = 'all';
+if(isset($_REQUEST['match'])) {
+	$match = $_REQUEST['match'];
+}
+
+// Get the path to search into. Normally left blank
+/* possible values:
+ * - a single path: "/en/" - search only pages whose link contains 'path' ("/en/machinery/bender-x09")
+ * - a bunch of alternative pathes: "/en/,/machinery/,docs/" - alternatives paths, seperated by comma
+ * - a bunch of paths to exclude: "-/about,/info,/jp/,/light" - search all, exclude these.
+ * These different styles can't be mixed.
+ */
+$search_path_SQL = "";
+$search_path = "";
+if(isset($_REQUEST['search_path'])) {
+	$search_path = $_REQUEST['search_path'];
+	if($search_path != '') {
+		$search_path_SQL = "AND ( ";
+		$not = "";
+		$op = "OR";
+		if($search_path[0] == '-') {
+			$not = "NOT";
+			$op = "AND";
+			$paths = explode(',', substr($search_path, 1) );
 		} else {
-			$string=$_REQUEST['string'];
+			$paths = explode(',',$search_path);
 		}
-		$string = $wb->add_slashes($string);
-		// remove some bad chars like _single_ '"', '&'. '!", ...
-		$string = preg_replace("/(^|\s+)([-=+_&!;#]|\\\\\"|\\\\')+(?=\s+|$)/", "", $string);
-		$string = strtr(my_htmlspecialchars($string), array('\&quot;'=>'&quot;'));
-		// reverse potential magic_quotes action
-		$original_string=$wb->strip_slashes($string);
-		// Double backslashes (mySQL needs doubly escaped backslashes in LIKE comparisons)
-		$string = $wb->escape_backslashes($original_string);
-		// convert a copy of $string to HTML-ENTITIES
-		$string_entities = umlauts_to_entities($string);
-		// and do some convertion to both
-		require(WB_PATH.'/search/search_convert.php');
-		$search_string = $string_entities;
+		$i=0;
+		foreach($paths as $p) {
+			if($i++ > 0) {
+				$search_path_SQL .= " $op";
+			}
+			$search_path_SQL .= " link $not LIKE '%$p%'";			
+		}
+		$search_path_SQL .= " )";
+	}
+}
+
+// TODO: with the new method, there is no need for search_entities_string anymore.
+//   When the old method disappears, it can be removed, too.
+//   BTW: in this case, there is no need for 
+//   $text = umlauts_to_entities(strip_tags($content), strtoupper(DEFAULT_CHARSET), 0);
+//   in wb/modules/wysiwyg/save.php anymore, too. Change that back to $text=strip_tags($content);
+
+// Get search string
+$search_normal_string = 'unset';
+$search_entities_string = 'unset';
+$search_display_string = '';
+$string = '';
+if(isset($_REQUEST['string'])) {
+	if ($match!='exact') {
+		$string=str_replace(',', '', $_REQUEST['string']);
 	} else {
-		$string = '';
-		$search_string = '';
+		$string=$_REQUEST['string'];
 	}
-	
-	// Work-out what to do (match all words, any words, or do exact match), and do relevant with query settings
-	$all_checked = '';
-	$any_checked = '';
-	$exact_checked = '';
-	if($match != 'exact') {
-		// Split string into array with explode() function
-		$exploded_string = explode(' ', $string);
-		// Make sure there is no blank values in the array
-		$string = array();
-		foreach($exploded_string AS $each_exploded_string) {
-			if($each_exploded_string != '') {
-				$string[] = $each_exploded_string;
-			}
+	// redo possible magic quotes
+	$string = $wb->strip_slashes($string);
+	$string = htmlspecialchars($string);
+	$search_display_string = $string;
+	// simulate mysql_real_escape_string()
+	$string = strtr($string, array("\x00"=>"\\\x00", "\n"=>"\\\n", "\r"=>"\\\r", '\\'=>'\\\\','\''=>'\\\'','"'=>"\\\"","\x1a"=>"\\\x1a"));
+	// remove some bad chars
+	$string = preg_replace("/(^|\s+)([.])+(?=\s+|$)/", "", $string);
+	// mySQL needs four backslashes to match one in LIKE comparisons)
+	$string = str_replace('\\\\', '\\\\\\\\', $string);
+	$string = trim($string);
+	// convert a copy of $string to HTML-ENTITIES
+	$string_entities = umlauts_to_entities($string);
+	$search_normal_string = $string;
+	$search_entities_string = $string_entities;
+}
+
+// Get list of usernames and display names
+$query = $database->query("SELECT user_id,username,display_name FROM ".TABLE_PREFIX."users");
+$users = array('0' => array('display_name' => $TEXT['UNKNOWN'], 'username' => strtolower($TEXT['UNKNOWN'])));
+if($query->numRows() > 0) {
+	while($user = $query->fetchRow()) {
+		$users[$user['user_id']] = array('display_name' => $user['display_name'], 'username' => $user['username']);
+	}
+}
+
+// Get search settings
+$query = $database->query("SELECT value FROM ".TABLE_PREFIX."search WHERE name = 'header' LIMIT 1");
+$fetch_header = $query->fetchRow();
+$query = $database->query("SELECT value FROM ".TABLE_PREFIX."search WHERE name = 'footer' LIMIT 1");
+$fetch_footer = $query->fetchRow();
+$query = $database->query("SELECT value FROM ".TABLE_PREFIX."search WHERE name = 'results_header' LIMIT 1");
+$fetch_results_header = $query->fetchRow();
+$query = $database->query("SELECT value FROM ".TABLE_PREFIX."search WHERE name = 'results_footer' LIMIT 1");
+$fetch_results_footer = $query->fetchRow();
+$query = $database->query("SELECT value FROM ".TABLE_PREFIX."search WHERE name = 'results_loop' LIMIT 1");
+$fetch_results_loop = $query->fetchRow();
+$query = $database->query("SELECT value FROM ".TABLE_PREFIX."search WHERE name = 'no_results' LIMIT 1");
+$fetch_no_results = $query->fetchRow();
+$query = $database->query("SELECT value FROM ".TABLE_PREFIX."search WHERE name = 'module_order' LIMIT 1");
+if($query->numRows() > 0) { $fetch_module_order = $query->fetchRow();
+} else { $fetch_module_order['value'] = ""; }
+$query = $database->query("SELECT value FROM ".TABLE_PREFIX."search WHERE name = 'max_excerpt' LIMIT 1");
+if($query->numRows() > 0) { $fetch_max_excerpt = $query->fetchRow();
+} else { $fetch_max_excerpt['value'] = '15'; }
+$search_max_excerpt = (int)$fetch_max_excerpt['value'];
+$query = $database->query("SELECT value FROM ".TABLE_PREFIX."search WHERE name = 'cfg_show_description' LIMIT 1");
+if($query->numRows() > 0) { $fetch_cfg_show_description = $query->fetchRow();
+} else { $fetch_cfg_show_description['value'] = 'true'; }
+if($fetch_cfg_show_description['value'] == 'false') { $cfg_show_description = false;
+} else { $cfg_show_description = true; }
+$query = $database->query("SELECT value FROM ".TABLE_PREFIX."search WHERE name = 'cfg_search_description' LIMIT 1");
+if($query->numRows() > 0) { $fetch_cfg_search_description = $query->fetchRow();
+} else { $fetch_cfg_search_description['value'] = 'true'; }
+if($fetch_cfg_search_description['value'] == 'false') { $cfg_search_description = false;
+} else { $cfg_search_description = true; }
+$query = $database->query("SELECT value FROM ".TABLE_PREFIX."search WHERE name = 'cfg_search_keywords' LIMIT 1");
+if($query->numRows() > 0) { $fetch_cfg_search_keywords = $query->fetchRow();
+} else { $fetch_cfg_search_keywords['value'] = 'true'; }
+if($fetch_cfg_search_keywords['value'] == 'false') { $cfg_search_keywords = false;
+} else { $cfg_search_keywords = true; }
+$query = $database->query("SELECT value FROM ".TABLE_PREFIX."search WHERE name = 'cfg_enable_old_search' LIMIT 1");
+if($query->numRows() > 0) { $fetch_cfg_enable_old_search = $query->fetchRow();
+} else { $fetch_cfg_enable_old_search['value'] = 'true'; }
+if($fetch_cfg_enable_old_search['value'] == 'false') { $cfg_enable_old_search = false;
+} else { $cfg_enable_old_search = true; }
+// Replace vars in search settings with values
+$vars = array('[SEARCH_STRING]', '[WB_URL]', '[PAGE_EXTENSION]', '[TEXT_RESULTS_FOR]');
+$values = array($search_display_string, WB_URL, PAGE_EXTENSION, $TEXT['RESULTS_FOR']);
+$search_footer = str_replace($vars, $values, ($fetch_footer['value']));
+$search_results_header = str_replace($vars, $values, ($fetch_results_header['value']));
+$search_results_footer = str_replace($vars, $values, ($fetch_results_footer['value']));
+$search_module_order = $fetch_module_order['value'];
+
+// check $search_max_excerpt
+if(!is_numeric($search_max_excerpt)) {
+	$search_max_excerpt = 15;
+}
+
+// Work-out what to do (match all words, any words, or do exact match), and do relevant with query settings
+$all_checked = '';
+$any_checked = '';
+$exact_checked = '';
+$search_normal_array = array();
+$search_entities_array = array();
+if($match != 'exact') {
+	// Split string into array with explode() function
+	$exploded_string = explode(' ', $search_normal_string);
+	// Make sure there is no blank values in the array
+	foreach($exploded_string AS $each_exploded_string) {
+		if($each_exploded_string != '') {
+			$search_normal_array[] = $each_exploded_string;
 		}
-		// Split $string_entities, too
-		$exploded_string = explode(' ', $string_entities);
-		// Make sure there is no blank values in the array
-		$string_entities = array();
-		foreach($exploded_string AS $each_exploded_string) {
-			if($each_exploded_string != '') {
-				$string_entities[] = $each_exploded_string;
-			}
+	}
+	// Split $string_entities, too
+	$exploded_string = explode(' ', $search_entities_string);
+	// Make sure there is no blank values in the array
+	foreach($exploded_string AS $each_exploded_string) {
+		if($each_exploded_string != '') {
+			$search_entities_array[] = $each_exploded_string;
 		}
-		if ($match == 'any') {
-			$any_checked = ' checked="checked"';
-			$logical_operator = ' OR';
-		} else {
-			$all_checked = ' checked="checked"';
-			$logical_operator = ' AND';
-		}
+	}
+	if ($match == 'any') {
+		$any_checked = ' checked="checked"';
+		$logical_operator = ' OR';
 	} else {
-		$exact_checked = ' checked="checked"';
-		$exact_string=$string;
-		$string=array();
-		$string[]=$exact_string;
-		$exact_string=$string_entities;
-		$string_entities=array();
-		$string_entities[]=$exact_string;
-	}	
-	// Get list of usernames and display names
-	$query_users = $database->query("SELECT user_id,username,display_name FROM ".TABLE_PREFIX."users");
-	$users = array('0' => array('display_name' => $TEXT['UNKNOWN'], 'username' => strtolower($TEXT['UNKNOWN'])));
-	if($query_users->numRows() > 0) {
-		while($user = $query_users->fetchRow()) {
-			$users[$user['user_id']] = array('display_name' => $user['display_name'], 'username' => $user['username']);
+		$all_checked = ' checked="checked"';
+		$logical_operator = ' AND';
+	}
+} else {
+	$exact_checked = ' checked="checked"';
+	$exact_string=$search_normal_string;
+	$search_normal_array[]=$exact_string;
+	$exact_string=$search_entities_string;
+	$search_entities_array[]=$exact_string;
+}	
+// make an extra copy of $string_entities for use in a regex
+require_once(WB_PATH.'/search/search_convert.php');
+$search_words = array();
+foreach ($search_entities_array AS $str) {
+	$str = entities_to_umlauts($str, 'UTF-8');
+	$str = preg_quote($str, '/');
+	$str = strtr($str, $string_ul_umlauts);
+	// special-feature: '|' means word-boundary (\b). Searching for 'the|' will find the, but not thema.
+	// this doesn't work correctly for unicode-chars: '|test' will work, but '|über' not.
+	$str = strtr($str, array('\\|'=>'\b'));
+	$search_words[] = $str;
+}
+
+// Do extra vars/values replacement
+$vars = array('[SEARCH_STRING]', '[WB_URL]', '[PAGE_EXTENSION]', '[TEXT_SEARCH]', '[TEXT_ALL_WORDS]', '[TEXT_ANY_WORDS]', '[TEXT_EXACT_MATCH]', '[TEXT_MATCH]', '[TEXT_MATCHING]', '[ALL_CHECKED]', '[ANY_CHECKED]', '[EXACT_CHECKED]', '[REFERRER_ID]', '[SEARCH_PATH]');
+$values = array($search_display_string, WB_URL, PAGE_EXTENSION, $TEXT['SEARCH'], $TEXT['ALL_WORDS'], $TEXT['ANY_WORDS'], $TEXT['EXACT_MATCH'], $TEXT['MATCH'], $TEXT['MATCHING'], $all_checked, $any_checked, $exact_checked, REFERRER_ID, $search_path);
+$search_header = str_replace($vars, $values, ($fetch_header['value']));
+$vars = array('[TEXT_NO_RESULTS]');
+$values = array($TEXT['NO_RESULTS']);
+$search_no_results = str_replace($vars, $values, ($fetch_no_results['value']));
+
+// Show search header
+echo $search_header;
+// Show search results_header
+echo $search_results_header;
+
+// Work-out if the user has already entered their details or not
+if($search_normal_string != '') {
+
+	// Get modules
+	$table = TABLE_PREFIX."sections";
+	$get_modules = $database->query("SELECT DISTINCT module FROM $table WHERE module != '' ");
+	$modules = array();
+	if($get_modules->numRows() > 0) {
+		while($module = $get_modules->fetchRow()) {
+			$modules[] = $module['module']; // $modules is an array of strings
 		}
 	}
-	
-	// Get search settings
-	$query_header = $database->query("SELECT value FROM ".TABLE_PREFIX."search WHERE name = 'header' LIMIT 1");
-	$fetch_header = $query_header->fetchRow();
-	$query_footer = $database->query("SELECT value FROM ".TABLE_PREFIX."search WHERE name = 'footer' LIMIT 1");
-	$fetch_footer = $query_footer->fetchRow();
-	$query_results_header = $database->query("SELECT value FROM ".TABLE_PREFIX."search WHERE name = 'results_header' LIMIT 1");
-	$fetch_results_header = $query_results_header->fetchRow();
-	$query_results_footer = $database->query("SELECT value FROM ".TABLE_PREFIX."search WHERE name = 'results_footer' LIMIT 1");
-	$fetch_results_footer = $query_results_footer->fetchRow();
-	$query_results_loop = $database->query("SELECT value FROM ".TABLE_PREFIX."search WHERE name = 'results_loop' LIMIT 1");
-	$fetch_results_loop = $query_results_loop->fetchRow();
-	$query_no_results = $database->query("SELECT value FROM ".TABLE_PREFIX."search WHERE name = 'no_results' LIMIT 1");
-	$fetch_no_results = $query_no_results->fetchRow();
-	
-	// Replace vars in search settings with values
-	$vars = array('[SEARCH_STRING]', '[WB_URL]', '[PAGE_EXTENSION]', '[TEXT_RESULTS_FOR]');
-	$values = array($search_string, WB_URL, PAGE_EXTENSION, $TEXT['RESULTS_FOR']);
-	$search_footer = str_replace($vars, $values, ($fetch_footer['value']));
-	$search_results_header = str_replace($vars, $values, ($fetch_results_header['value']));
-	$search_results_footer = str_replace($vars, $values, ($fetch_results_footer['value']));
-	// Do extra vars/values replacement
-	$vars = array('[SEARCH_STRING]', '[WB_URL]', '[PAGE_EXTENSION]', '[TEXT_SEARCH]', '[TEXT_ALL_WORDS]', '[TEXT_ANY_WORDS]', '[TEXT_EXACT_MATCH]', '[TEXT_MATCH]', '[TEXT_MATCHING]', '[ALL_CHECKED]', '[ANY_CHECKED]', '[EXACT_CHECKED]', '[REFERRER_ID]');
-	$values = array($search_string, WB_URL, PAGE_EXTENSION, $TEXT['SEARCH'], $TEXT['ALL_WORDS'], $TEXT['ANY_WORDS'], $TEXT['EXACT_MATCH'], $TEXT['MATCH'], $TEXT['MATCHING'], $all_checked, $any_checked, $exact_checked, REFERRER_ID);
-	$search_header = str_replace($vars, $values, ($fetch_header['value']));
-	$vars = array('[TEXT_NO_RESULTS]');
-	$values = array($TEXT['NO_RESULTS']);
-	$search_no_results = str_replace($vars, $values, ($fetch_no_results['value']));
-	
-	// Show search header
-	echo $search_header;
-	
-	// Work-out if the user has already entered their details or not
-	if($string != '' AND $string != ' ' AND $string != '  ' AND $string != array()) {
-		
-		// Show search results_header
-		echo $search_results_header;
-		// Search page details only, such as description, keywords, etc.
-		$query_pages = "SELECT page_id, page_title, menu_title, link, description, modified_when, modified_by, visibility FROM ".TABLE_PREFIX."pages WHERE ";
-		$count = 0;
-		foreach($string AS $each_string) {
-			if($count != 0) { 
-				$query_pages .= $logical_operator;
+
+	// sort module search-order
+	// get the modules from $search_module_order first ...
+	$sorted_modules = array();
+	$m = count($modules);
+	$search_modules = explode(',', $search_module_order);
+	foreach($search_modules AS $item) {
+		$item = trim($item);
+		for($i=0; $i < $m; $i++) {
+			if(isset($modules[$i]) && $modules[$i] == $item) {
+				$sorted_modules[] = $modules[$i];
+				unset($modules[$i]);
+				break;
 			}
-			$query_pages .= " visibility != 'none' AND visibility != 'deleted' AND searching = '1'".
-			" AND (page_title LIKE '%$each_string%' OR menu_title LIKE '%$each_string%' OR description LIKE '%$each_string%' OR keywords LIKE '%$each_string%')";
-			$count = $count+1;
 		}
-		$count = 0;
-		$query_pages .= ' OR';
-		foreach($string_entities AS $each_string) {
-			if($count != 0) { 
-				$query_pages .= $logical_operator;
-			}
-			$query_pages .= " visibility != 'none' AND visibility != 'deleted' AND searching = '1'".
-			" AND (page_title LIKE '%$each_string%' OR menu_title LIKE '%$each_string%' OR description LIKE '%$each_string%' OR keywords LIKE '%$each_string%')";
-			$count = $count+1;
+	}
+	// ... then add the rest
+	foreach($modules AS $item) {
+		$sorted_modules[] = $item;
+	}
+
+	// First, use an alternative search-method, without sql's 'LIKE'.
+	// 'LIKE' won't find upper/lower-variants of umlauts, cyrillic or greek chars without propperly set setlocale();
+	// and even if setlocale() is set, it won't work for multi-linguale sites.
+	// Use the search-module-extension instead.
+	// This is somewhat slower than the orginial method.
+	// CHANGES WITH V1.3: before V1.3 we called [module]-search() for a given page only once and searched in all [module]-sections on this page;
+	// since V1.3 we call [module]-search() for very single section.
+	$seen_pages = array(); // seen pages per module.
+	$pages_listed = array(); // seen pages.
+	foreach($sorted_modules AS $module_name) {
+		$seen_pages[$module_name] = array();
+		if(!isset($search_funcs[$module_name])) {
+			continue; // there is no search_func for this module
 		}
-		$query_pages = $database->query($query_pages);
-		// Loop through pages
-		if($query_pages->numRows() > 0) {
-			while($page = $query_pages->fetchRow()) {
-				
-				// check if user is allowed to see the page (for private-pages)
-				$visibility = $page['visibility'];
-				if($visibility == 'private') {
-					$access_denied = true;
-					$rightsquery = $database->query("SELECT ".
-						TABLE_PREFIX."pages.viewing_groups, ".
-						TABLE_PREFIX."pages.viewing_users
-						FROM ".TABLE_PREFIX."pages
-						WHERE ".TABLE_PREFIX."pages.page_id='".$page['page_id']."' LIMIT 1 "
-					);
-					$viewing_groups=array() ; $viewing_users=array();
-					if($rightsquery->numRows() > 0) {
-						if($res = $rightsquery->fetchRow()) {
-							$viewing_groups = explode(',', $res['viewing_groups']);
-							$viewing_users = explode(',', $res['viewing_users']);
-						}
-					}
-					if($wb->is_authenticated() == true) {
-						if(in_array($wb->get_group_id(), $viewing_groups) || (in_array($wb->get_user_id(), $viewing_users))) {
-							$access_denied = false;
-						}
-					}
-					if($access_denied) {
+		// get each section for $module_name
+		$table_s = TABLE_PREFIX."sections";	
+		$table_p = TABLE_PREFIX."pages";
+		$sections_query = $database->query("
+			SELECT s.section_id, s.page_id, s.module, s.publ_start, s.publ_end,
+			       p.page_title, p.menu_title, p.link, p.description, p.keywords, p.modified_when, p.modified_by,
+			       p.visibility, p.viewing_groups, p.viewing_users
+			FROM $table_s AS s INNER JOIN $table_p AS p ON s.page_id = p.page_id
+			WHERE s.module = '$module_name' AND p.visibility NOT IN ('none','deleted') AND p.searching = '1' $search_path_SQL
+			ORDER BY s.section_id, s.position ASC
+		");
+		if($sections_query->numRows() > 0) {
+			while($res = $sections_query->fetchRow()) {
+				// TODO: add a "section is searchable: yes/no" config-element into "Manage Sections" - ???
+				//       and show this section only if section is searchable
+				// Only show this section if it is not "out of publication-date"
+				$now = time();
+				if( !( $now<$res['publ_end'] && ($now>$res['publ_start'] || $res['publ_start']==0) ||
+					$now>$res['publ_start'] && $res['publ_end']==0) ) {
+					continue;
+				}
+				$search_func_vars = array(
+					'database' => $database,
+					'page_id' => $res['page_id'],
+					'section_id' => $res['section_id'],
+					'page_title' => $res['page_title'],
+					'page_menu_title' => $res['menu_title'],
+					'page_description' => ($cfg_show_description?$res['description']:""),
+					'page_keywords' => $res['keywords'],
+					'page_link' => $res['link'],
+					'page_modified_when' => $res['modified_when'],
+					'page_modified_by' => $res['modified_by'],
+					'users' => $users,
+					'search_words' => $search_words, // needed for preg_match_all
+					'search_match' => $match,
+					'search_url_array' => $search_normal_array, // needed for url-string only
+					'results_loop_string' => $fetch_results_loop['value'],
+					'default_max_excerpt' => $search_max_excerpt
+				);
+				// Only show this page if we are allowed to see it
+				//if(is_access_denied($res['visibility'], $res['viewing_groups'], $res['viewing_users'])) {
+				if($admin->page_is_visible($res) == false) {
+					if($res['visibility'] == 'registered') { // don't show excerpt
+						$search_func_vars['default_max_excerpt'] = 0;
+						$search_func_vars['page_description'] = $TEXT['REGISTERED'];
+					} else { // private
 						continue;
 					}
 				}
-				
-				// Get page link
-				$link = page_link($page['link']);
-				
-				//Add search string for highlighting
-				if ($match!='exact') {
-					$sstring = implode(" ", $string);
-					$link = $link."?searchresult=1&amp;sstring=".urlencode($sstring);
-				}
-				else {
-					$sstring = strtr($string[0], " ", "_");
-					$link = $link."?searchresult=2&amp;sstring=".urlencode($sstring);
-				}
-				
-				// Set vars to be replaced by values
-				$vars = array('[LINK]', '[TITLE]', '[DESCRIPTION]', '[USERNAME]','[DISPLAY_NAME]','[DATE]','[TIME]','[TEXT_LAST_UPDATED_BY]','[TEXT_ON]');
-				if($page['modified_when'] > 0) {
-					$date = gmdate(DATE_FORMAT, $page['modified_when']+TIMEZONE);
-					$time = gmdate(TIME_FORMAT, $page['modified_when']+TIMEZONE);
+				$uf_res = call_user_func($search_funcs[$module_name], $search_func_vars);
+				if($uf_res) {
+					$pages_listed[$res['page_id']] = true;
+					$seen_pages[$module_name][$res['page_id']] = true;
 				} else {
-					$date = $TEXT['UNKNOWN'].' '.$TEXT['DATE'];
-					$time = $TEXT['UNKNOWN'].' '.$TEXT['TIME'];
+					$seen_pages[$module_name][$res['page_id']] = true;
 				}
-				$values = array($link, ($page['page_title']),($page['description']), $users[$page['modified_by']]['username'], $users[$page['modified_by']]['display_name'], $date, $time, $TEXT['LAST_UPDATED_BY'], strtolower($TEXT['ON']));
-				// Show loop code with vars replaced by values
-				if($values != array()) {
-					echo str_replace($vars, $values, ($fetch_results_loop['value']));
+			}
+		}
+	}
+
+	// Search page details only, such as description, keywords, etc, but only of unseen pages.
+	$max_excerpt_num = 0; // we don't want excerpt here
+	$divider = ".";
+	$table = TABLE_PREFIX."pages";
+	$query_pages = $database->query("
+		SELECT page_id, page_title, menu_title, link, description, keywords, modified_when, modified_by,
+		       visibility, viewing_groups, viewing_users
+		FROM $table
+		WHERE visibility NOT IN ('none','deleted') AND searching = '1' $search_path_SQL"
+	);
+	if($query_pages->numRows() > 0) {
+		while($page = $query_pages->fetchRow()) {
+			if (isset($pages_listed[$page['page_id']])) {
+				continue;
+			}
+			$func_vars = array(
+				'database' => $database,
+				'page_id' => $page['page_id'],
+				'page_title' => $page['page_title'],
+				'page_menu_title' => $page['menu_title'],
+				'page_description' => ($cfg_show_description?$page['description']:""),
+				'page_keywords' => $page['keywords'],
+				'page_link' => $page['link'],
+				'page_modified_when' => $page['modified_when'],
+				'page_modified_by' => $page['modified_by'],
+				'users' => $users,
+				'search_words' => $search_words, // needed for preg_match_all
+				'search_match' => $match,
+				'search_url_array' => $search_normal_array, // needed for url-string only
+				'results_loop_string' => $fetch_results_loop['value'],
+				'default_max_excerpt' => $max_excerpt_num
+			);
+			// Only show this page if we are allowed to see it
+			//if(is_access_denied($page['visibility'], $page['viewing_groups'], $page['viewing_users'])) {
+			if($admin->page_is_visible($page) == false) {
+				if($page['visibility'] != 'registered') {
+					continue;
+				} else { // page: registered, user: access denied
+					$func_vars['page_description'] = 'registered';
 				}
-				// Say that we have already listed this page id
+			}
+			if($admin->page_is_active($page) == false) {
+				continue;
+			}
+			$text = $func_vars['page_title'].$divider
+				.$func_vars['page_menu_title'].$divider
+				.($cfg_search_description?$func_vars['page_description']:"").$divider
+				.($cfg_search_keywords?$func_vars['page_keywords']:"").$divider;
+			$mod_vars = array(
+				'page_link' => $func_vars['page_link'],
+				'page_link_target' => "",
+				'page_title' => $func_vars['page_title'],
+				'page_description' => $func_vars['page_description'],
+				'page_modified_when' => $func_vars['page_modified_when'],
+				'page_modified_by' => $func_vars['page_modified_by'],
+				'text' => $text,
+				'max_excerpt_num' => $func_vars['default_max_excerpt']
+			);
+			if(print_excerpt2($mod_vars, $func_vars)) {
 				$pages_listed[$page['page_id']] = true;
-				// Set values to blank
-				$value = array();
 			}
 		}
-		// Get modules that have registered for custom query's to be conducted
-		$get_modules = $database->query("SELECT value,extra FROM ".TABLE_PREFIX."search WHERE name = 'module'");
-		// Loop through each module
-		if($get_modules->numRows() > 0) {
-			while($module = $get_modules->fetchRow()) {
-				// Get module name
-				$module_name = $module['value'];
-				// Get fields to use for title, link, etc.
-				$fields = unserialize($module['extra']);
-				// Get query start
-				$get_query_start = $database->query("SELECT value FROM ".TABLE_PREFIX."search WHERE name = 'query_start' AND extra = '$module_name' LIMIT 1");
-				if($get_query_start->numRows() > 0) {
-					// Fetch query start
-					$fetch_query_start = $get_query_start->fetchRow();
-					// Prepare query start for execution by replacing {TP} with the TABLE_PREFIX
-					$query_start = str_replace('[TP]', TABLE_PREFIX, ($fetch_query_start['value']));
-					// Get query end
-					$get_query_end = $database->query("SELECT value FROM ".TABLE_PREFIX."search WHERE name = 'query_end' AND extra = '$module_name' LIMIT 1");
-					if($get_query_end->numRows() > 0) {
-						// Fetch query start
-						$fetch_query_end = $get_query_end->fetchRow();
-						// Set query end
-						$query_end = ($fetch_query_end['value']);
-						// Get query body
-						$get_query_body = $database->query("SELECT value FROM ".TABLE_PREFIX."search WHERE name = 'query_body' AND extra = '$module_name' LIMIT 1");
-						if($get_query_body->numRows() > 0) {
-							// Fetch query start
-							$fetch_query_body = $get_query_body->fetchRow();
-							// Prepare query body for execution by replacing {STRING} with the correct one
-							$query_body = str_replace(array('[TP]','[O]','[W]'), array(TABLE_PREFIX,'LIKE','%'), ($fetch_query_body['value']));
-							// Loop through query body for each string, then combine with start and end
-							$prepared_query = $query_start;
-							$count = 0;
-							foreach($string AS $each_string) {
-								if($count != 0) {
-									$prepared_query .= $logical_operator;
+	}
+
+	// Now use the old method for pages not displayed by the new method above
+	// in case someone has old modules without search.php.
+
+	// Get modules
+	$table_search = TABLE_PREFIX."search";
+	$table_sections = TABLE_PREFIX."sections";
+	$get_modules = $database->query("
+		SELECT DISTINCT s.value, s.extra
+		FROM $table_search AS s INNER JOIN $table_sections AS sec
+			ON s.value = sec.module
+		WHERE s.name = 'module'
+	");
+	$modules = array();
+	if($get_modules->numRows() > 0) {
+		while($module = $get_modules->fetchRow()) {
+			$modules[] = $module; // $modules in an array of arrays
+		}
+	}
+	// sort module search-order
+	// get the modules from $search_module_order first ...
+	$sorted_modules = array();
+	$m = count($modules);
+	$search_modules = explode(',', $search_module_order);
+	foreach($search_modules AS $item) {
+		$item = trim($item);
+		for($i=0; $i < $m; $i++) {
+			if(isset($modules[$i]) && $modules[$i]['value'] == $item) {
+				$sorted_modules[] = $modules[$i];
+				unset($modules[$i]);
+				break;
+			}
+		}
+	}
+	// ... then add the rest
+	foreach($modules AS $item) {
+		$sorted_modules[] = $item;
+	}
+
+	if($cfg_enable_old_search) {
+		$search_path_SQL = str_replace(' link ', ' '.TABLE_PREFIX.'pages.link ', $search_path_SQL);
+		foreach($sorted_modules AS $module) {
+			$query_start = '';
+			$query_body = '';
+			$query_end = '';
+			$prepared_query = '';
+			// Get module name
+			$module_name = $module['value'];
+			if(!isset($seen_pages[$module_name])) {
+				$seen_pages[$module_name]=array();
+			}
+			// skip module 'code' - it doesn't make sense to search in a code section
+			if($module_name=="code")
+				continue;
+			// Get fields to use for title, link, etc.
+			$fields = unserialize($module['extra']);
+			// Get query start
+			$get_query_start = $database->query("SELECT value FROM ".TABLE_PREFIX."search WHERE name = 'query_start' AND extra = '$module_name' LIMIT 1");
+			if($get_query_start->numRows() > 0) {
+				// Fetch query start
+				$fetch_query_start = $get_query_start->fetchRow();
+				// Prepare query start for execution by replacing {TP} with the TABLE_PREFIX
+				$query_start = str_replace('[TP]', TABLE_PREFIX, ($fetch_query_start['value']));
+			}
+			// Get query end
+			$get_query_end = $database->query("SELECT value FROM ".TABLE_PREFIX."search WHERE name = 'query_end' AND extra = '$module_name' LIMIT 1");
+			if($get_query_end->numRows() > 0) {
+				// Fetch query end
+				$fetch_query_end = $get_query_end->fetchRow();
+				// Set query end
+				$query_end = ($fetch_query_end['value']);
+			}
+			// Get query body
+			$get_query_body = $database->query("SELECT value FROM ".TABLE_PREFIX."search WHERE name = 'query_body' AND extra = '$module_name' LIMIT 1");
+			if($get_query_body->numRows() > 0) {
+				// Fetch query body
+				$fetch_query_body = $get_query_body->fetchRow();
+				// Prepare query body for execution by replacing {STRING} with the correct one
+				$query_body = str_replace(array('[TP]','[O]','[W]'), array(TABLE_PREFIX,'LIKE','%'), ($fetch_query_body['value']));
+				// Loop through query body for each string, then combine with start and end
+				$prepared_query = $query_start." ( ( ( ";
+				$count = 0;
+				foreach($search_normal_array AS $string) {
+					if($count != 0) {
+						$prepared_query .= " ) ".$logical_operator." ( ";
+					}
+					$prepared_query .= str_replace('[STRING]', $string, $query_body);
+					$count = $count+1;
+				}
+				$count=0;
+				$prepared_query .= ' ) ) OR ( ( ';
+				foreach($search_entities_array AS $string) {
+					if($count != 0) {
+						$prepared_query .= " ) ".$logical_operator." ( ";
+					}
+					$prepared_query .= str_replace('[STRING]', $string, $query_body);
+					$count = $count+1;
+				}
+				$prepared_query .= " ) ) ) ".$query_end;
+	
+				// Execute query
+				$page_query = $database->query($prepared_query." ".$search_path_SQL);
+
+				// Loop through queried items
+				if($page_query->numRows() > 0) {
+					while($page = $page_query->fetchRow()) {
+						// Only show this page if it hasn't already been listed
+						if(isset($seen_pages[$module_name][$page['page_id']]) || isset($pages_listed[$page['page_id']])) {
+							continue;
+						}
+						
+						// don't list pages with visibility == none|deleted and check if user is allowed to see the page
+						$p_table = TABLE_PREFIX."pages";
+						$viewquery = $database->query("
+							SELECT visibility, viewing_groups, viewing_users
+							FROM $p_table
+							WHERE page_id='{$page['page_id']}'
+						");
+						$visibility = 'none'; $viewing_groups="" ; $viewing_users="";
+						if($viewquery->numRows() > 0) {
+							if($res = $viewquery->fetchRow()) {
+								$visibility = $res['visibility'];
+								$viewing_groups = $res['viewing_groups'];
+								$viewing_users = $res['viewing_users'];
+								if($visibility == 'deleted' || $visibility == 'none') {
+									continue;
 								}
-								$prepared_query .= str_replace('[STRING]', $each_string, $query_body);
-								$count = $count+1;
-							}
-							$count=0;
-							$prepared_query .= ' OR ';
-							foreach($string_entities AS $each_string) {
-								if($count != 0) {
-									$prepared_query .= $logical_operator;
-								}
-								$prepared_query .= str_replace('[STRING]', $each_string, $query_body);
-								$count = $count+1;
-							}
-							
-							$prepared_query .= $query_end;
-							
-							// Execute query
-							$query = $database->query($prepared_query);
-							// Loop though queried items
-							if($query->numRows() > 0) {
-								while($page = $query->fetchRow()) {
-									// Only show this page if it hasn't already been list
-									if(!isset($fields['page_id']) OR !isset($pages_listed[$page[$fields['page_id']]])) {
-										
-										
-										// don't list pages with visibility == none|deleted
-										$viewquery = $database->query("SELECT ".
-											TABLE_PREFIX."pages.visibility
-											FROM ".TABLE_PREFIX."pages
-											WHERE ".TABLE_PREFIX."pages.page_id='".$page[$fields['page_id']]."' LIMIT 1 "
-										);
-										$visibility = 'public';
-										if($viewquery->numRows() > 0) {
-											if($res = $viewquery->fetchRow()) {
-												$visibility = $res['visibility'];
-											}
-										}
-										if($visibility == 'deleted' || $visibility == 'none') {
-											continue;
-										}
-										// check if user is allowed to see the page (for private-pages)
-										if($visibility == 'private') {
-											$access_denied = true;
-											$rightsquery = $database->query("SELECT ".
-												TABLE_PREFIX."pages.viewing_groups, ".
-												TABLE_PREFIX."pages.viewing_users
-												FROM ".TABLE_PREFIX."pages
-												WHERE ".TABLE_PREFIX."pages.page_id='".$page[$fields['page_id']]."' LIMIT 1 "
-											);
-											$viewing_groups=array() ; $viewing_users=array();
-											if($rightsquery->numRows() > 0) {
-												if($res = $rightsquery->fetchRow()) {
-													$viewing_groups = explode(',', $res['viewing_groups']);
-													$viewing_users = explode(',', $res['viewing_users']);
-												}
-											}
-											if($wb->is_authenticated() == true) {
-												if(in_array($wb->get_group_id(), $viewing_groups) || (in_array($wb->get_user_id(), $viewing_users))) {
-													$access_denied = false;
-												}
-											}
-											if($access_denied) {
-												continue;
-											}
-										}
-											
-										// Get page link
-										$link = page_link($page[$fields['link']]);
-										
-										//Add search string for highlighting
-										if ($match!='exact') {
-											$sstring = implode(" ", $string);
-											$link = $link."?searchresult=1&amp;sstring=".urlencode($sstring);
-										}
-										else {
-											$sstring = strtr($string[0], " ", "_");
-											$link = $link."?searchresult=2&amp;sstring=".urlencode($sstring);
-										}
-										
-										// Set vars to be replaced by values
-										$vars = array('[LINK]', '[TITLE]', '[DESCRIPTION]', '[USERNAME]','[DISPLAY_NAME]','[DATE]','[TIME]','[TEXT_LAST_UPDATED_BY]','[TEXT_ON]');
-										if($page[$fields['modified_when']] > 0) {
-											$date = gmdate(DATE_FORMAT, $page[$fields['modified_when']]+TIMEZONE);
-											$time = gmdate(TIME_FORMAT, $page[$fields['modified_when']]+TIMEZONE);
-										} else {
-											$date = $TEXT['UNKNOWN'].' '.$TEXT['DATE'];
-											$time = $TEXT['UNKNOWN'].' '.$TEXT['TIME'];
-										}
-										$values = array($link, ($page[$fields['title']]), ($page[$fields['description']]), $users[$page[$fields['modified_by']]]['username'], $users[$page[$fields['modified_by']]]['display_name'], $date, $time, $TEXT['LAST_UPDATED_BY'], strtolower($TEXT['ON']));
-										// Show loop code with vars replaced by values
-										echo str_replace($vars, $values, ($fetch_results_loop['value']));
-										// Say that this page or item has been listed if we can
-										if(isset($fields['page_id'])) {
-											$pages_listed[$page[$fields['page_id']]] = true;
-										} elseif(isset($fields['item_id'])) {
-											$items_listed[$page[$fields['item_id']]] = true;
-										}
+								if($visibility == 'private') {
+									//if(is_access_denied($visibility, $viewing_groups, $viewing_users)) {
+									if($admin->page_is_visible(array(
+										'page_id'=>$page[$fields['page_id']],
+										'visibility' =>$visibility,
+										'viewing_groups'=>$viewing_groups,
+										'viewing_users'=>$viewing_users
+									)) == false) {
+										continue;
 									}
 								}
+								if($admin->page_is_active(array('page_id'=>$page[$fields['page_id']]))==false) {
+									continue;
+								}
 							}
 						}
+	
+						// Get page link
+						$link = page_link($page['link']);
+						// Add search string for highlighting
+						if ($match!='exact') {
+							$sstring = implode(" ", $search_normal_array);
+							$link = $link."?searchresult=1&amp;sstring=".urlencode($sstring);
+						} else {
+							$sstring = strtr($search_normal_array[0], " ", "_");
+							$link = $link."?searchresult=2&amp;sstring=".urlencode($sstring);
+						}
+						// Set vars to be replaced by values
+						if(!isset($page['description'])) { $page['description'] = ""; }
+						if(!isset($page['modified_when'])) { $page['modified_when'] = 0; }
+						if(!isset($page['modified_by'])) { $page['modified_by'] = 0; }
+						$vars = array('[LINK]', '[TITLE]', '[DESCRIPTION]', '[USERNAME]','[DISPLAY_NAME]','[DATE]','[TIME]','[TEXT_LAST_UPDATED_BY]','[TEXT_ON]','[EXCERPT]');
+						if($page['modified_when'] > 0) {
+							$date = gmdate(DATE_FORMAT, $page['modified_when']+TIMEZONE);
+							$time = gmdate(TIME_FORMAT, $page['modified_when']+TIMEZONE);
+						} else {
+							$date = $TEXT['UNKNOWN'].' '.$TEXT['DATE'];
+							$time = $TEXT['UNKNOWN'].' '.$TEXT['TIME'];
+						}
+						$excerpt="";
+						if($cfg_show_description == 0) {
+							$page['description'] = "";
+						}
+						$values = array($link, $page['page_title'], $page['description'], $users[$page['modified_by']]['username'], $users[$page['modified_by']]['display_name'], $date, $time, $TEXT['LAST_UPDATED_BY'], strtolower($TEXT['ON']), $excerpt);
+						// Show loop code with vars replaced by values
+						echo str_replace($vars, $values, ($fetch_results_loop['value']));
+						// Say that this page has been listed
+						$seen_pages[$module_name][$page['page_id']] = true;
+						$pages_listed[$page['page_id']] = true;
 					}
 				}
 			}
-			
-			// Show search results_footer
-			echo $search_results_footer;
-			
 		}
-	
-		// Say no items found if we should
-		if($pages_listed == array() AND $items_listed == array()) {
-			echo $search_no_results;
-		}
-		
 	}
-	
-	// Show search footer
-	echo $search_footer;
-	
+
+	// Say no items found if we should
+	if(count($pages_listed) == 0) {
+		echo $search_no_results;
+	}
+} else {
+	echo $search_no_results;
 }
 
-?>
\ No newline at end of file
+// Show search results_footer
+echo $search_results_footer;
+// Show search footer
+echo $search_footer;
+
+//$overall_end_time = microtime(true); // for testing only
+//$time=$overall_end_time-$overall_start_time; print "<br />Timings - Overall: $time<br />";
+
+?>
Index: trunk/wb/search/search_modext.php
===================================================================
--- trunk/wb/search/search_modext.php	(nonexistent)
+++ trunk/wb/search/search_modext.php	(revision 552)
@@ -0,0 +1,351 @@
+<?php
+
+// $Id: $
+
+/*
+
+ Website Baker Project <http://www.websitebaker.org/>
+ Copyright (C) 2004-2008, Ryan Djurovich
+
+ Website Baker is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ Website Baker is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Website Baker; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+*/
+
+// make the url-string for highlighting
+function make_url_searchstring($search_match, $search_url_array) {
+	$link = "";
+	if ($search_match != 'exact') {
+		$str = implode(" ", $search_url_array);
+		$link = "?searchresult=1&amp;sstring=".urlencode($str);
+	} else {
+		$str = strtr($search_url_array[0], " ", "_");
+		$link = "?searchresult=2&amp;sstring=".urlencode($str);
+	}
+	return $link;
+}
+
+// make date and time for "last modified by... on ..."-string
+function get_page_modified($page_modified_when) {
+	global $TEXT;
+	if($page_modified_when > 0) {
+		$date = gmdate(DATE_FORMAT, $page_modified_when+TIMEZONE);
+		$time = gmdate(TIME_FORMAT, $page_modified_when+TIMEZONE);
+	} else {
+		$date = $TEXT['UNKNOWN'].' '.$TEXT['DATE'];
+		$time = $TEXT['UNKNOWN'].' '.$TEXT['TIME'];
+	}
+	return array($date, $time);
+}
+
+// make username and displayname for "last modified by... on ..."-string
+function get_page_modified_by($page_modified_by, $users) {
+	global $TEXT;
+	if($page_modified_by > 0) {
+			$username = $users[$page_modified_by]['username'];
+			$displayname = $users[$page_modified_by]['display_name'];
+		} else {
+			$username = "";
+			$displayname = $TEXT['UNKNOWN'];
+		}
+	return array($username, $displayname);
+}
+
+// checks if _all_ searchwords matches
+function is_all_matched($text, $search_words) {
+	$all_matched = true;
+	foreach ($search_words AS $word) {
+		if(!preg_match('/'.$word.'/iu', $text)) {
+			$all_matched = false;
+			break;
+		}
+	}
+	return $all_matched;
+}
+
+// checks if _any_ of the searchwords matches
+function is_any_matched($text, $search_words) {
+	$any_matched = false;
+	$word = "(".implode("|", $search_words).")";
+	if(preg_match('/'.$word.'/iu', $text)) {
+		$any_matched = true;
+	}
+	return $any_matched;
+}
+
+// work-out if user is in $viewing_groups or $viewing_users
+function is_access_denied($visibility, $viewing_groups_str, $viewing_users_str) {
+	global $wb;
+	$access_denied = false;
+	if($visibility == 'private' || $visibility == 'registered') {
+		$access_denied = true;
+		if($wb->is_authenticated() == true) {
+			$viewing_groups = explode(',', $viewing_groups_str);
+			$viewing_users = explode(',', $viewing_users_str);
+			if(in_array($wb->get_group_id(), $viewing_groups) || (in_array($wb->get_user_id(), $viewing_users))) {
+				$access_denied = false;
+			}
+		}
+	}
+	return $access_denied;
+}
+
+// collects the matches from text in excerpt_array
+function get_excerpts($text, $search_words, $max_excerpt_num) {
+	$match_array = array();
+	$excerpt_array = array();
+	$word = "(".implode("|", $search_words).")";
+	
+	$text = strtr($text, array('&lt;'=>'<', '&gt;'=>'>', '&amp;'=>'&', '&quot;'=>'"', '&#39;'=>'\'', '&nbsp;'=>"\xC2\xA0"));
+	$word = strtr($word, array('&lt;'=>'<', '&gt;'=>'>', '&amp;'=>'&', '&quot;'=>'"', '&#39;'=>'\'', '&nbsp;'=>"\xC2\xA0"));
+	// Build the regex-string
+	//...INVERTED EXCLAMATION MARK - INVERTED QUESTION MARK - DOUBLE EXCLAMATION MARK - INTERROBANG - EXCLAMATION QUESTION MARK - QUESTION EXCLAMATION MARK - DOUBLE QUESTION MARK - HALFWIDTH IDEOGRAPHIC FULL STOP - IDEOGRAPHIC FULL STOP - IDEOGRAPHIC COMMA
+	$str1=".!?;"."\xC2\xA1"."\xC2\xBF"."\xE2\x80\xBC"."\xE2\x80\xBD"."\xE2\x81\x89"."\xE2\x81\x88"."\xE2\x81\x87"."\xEF\xBD\xA1"."\xE3\x80\x82"."\xE3\x80\x81";
+	// ...DOUBLE EXCLAMATION MARK - INTERROBANG - EXCLAMATION QUESTION MARK - QUESTION EXCLAMATION MARK - DOUBLE QUESTION MARK - HALFWIDTH IDEOGRAPHIC FULL STOP - IDEOGRAPHIC FULL STOP - IDEOGRAPHIC COMMA
+	$str2=".!?;"."\xE2\x80\xBC"."\xE2\x80\xBD"."\xE2\x81\x89"."\xE2\x81\x88"."\xE2\x81\x87"."\xEF\xBD\xA1"."\xE3\x80\x82"."\xE3\x80\x81";
+	// "{0,200}?'.$word.'" : the '?' (ungreedy) is for performance-tuning; try a step-by-step-trace to see what i mean. 
+	if(preg_match_all('/(?:^|\b|['.$str1.'])([^'.$str1.']{0,200}?'.$word.'[^'.$str2.']{0,200}(?:['.$str2.']|\b|$))/isu', $text, $match_array)) {
+		foreach($match_array[1] AS $string) {
+			$excerpt_array[] = trim($string);
+		}
+	}
+	return $excerpt_array;
+}
+
+// makes excerpt_array a string ready to print out
+function prepare_excerpts($excerpt_array, $search_words, $max_excerpt_num) {
+	// excerpts: text before and after a single excerpt, html-tag for markup
+	$EXCERPT_BEFORE =       '...&nbsp;';
+	$EXCERPT_AFTER =        '&nbsp;...<br />';
+	$EXCERPT_MARKUP_START = '<b>';
+	$EXCERPT_MARKUP_END =   '</b>';
+	// remove duplicate matches from $excerpt_array, if any.
+	$excerpt_array = array_unique($excerpt_array);
+	// use the first $max_excerpt_num excerpts only
+	if(count($excerpt_array) > $max_excerpt_num) {
+		$excerpt_array = array_slice($excerpt_array, 0, $max_excerpt_num);
+	}
+	// prepare search-string
+	$string = "(".implode("|", $search_words).")";
+	$string = strtr($string, array('&lt;'=>'<', '&gt;'=>'>', '&amp;'=>'&', '&quot;'=>'"', '&#39;'=>'\'', '&nbsp;'=>"\xC2\xA0"));
+	// we want markup on search-results page,
+	// but we need some 'magic' to prevent <br />, <b>... from being highlighted
+	$excerpt = '';
+	foreach($excerpt_array as $str) {
+		$excerpt .= '#,,#'.preg_replace("/($string)/iu","#,,,,#$1#,,,,,#",$str).'#,,,#';
+	}
+	$excerpt = strtr($excerpt, array('<'=>'&lt;', '>'=>'&gt;', '&'=>'&amp;', '"'=>'&quot;', '\''=>'&#39;'));
+	$excerpt = strtr($excerpt, array('#,,,,#'=>$EXCERPT_MARKUP_START, '#,,,,,#'=>$EXCERPT_MARKUP_END));
+	$excerpt = strtr($excerpt, array('#,,#'=>$EXCERPT_BEFORE, '#,,,#'=>$EXCERPT_AFTER));
+	// prepare to write out
+	if(DEFAULT_CHARSET != 'utf-8') {
+		$excerpt = umlauts_to_entities($excerpt, 'UTF-8');
+	}
+	return $excerpt;
+}
+
+// work out what the link-target should be
+function make_url_target($page_link_target, $text, $search_words) {
+	// 1. e.g. $page_link_target=="&monthno=5&year=2007" - module-dependent target. Do nothing.
+	// 2. $page_link_target=="#!wb_section_..." - the user wants the section-target, so do nothing.
+	// 3. $page_link_target=="#wb_section_..." - try to find a better target, use the section-target as fallback.
+	// 4. $page_link_target=="" - do nothing
+	if(version_compare(PHP_VERSION, '4.3.0', ">=") && substr($page_link_target,0,12)=='#wb_section_') {
+		$word = '('.implode('|', $search_words).')';
+		preg_match('/'.$word.'/iu', $text, $match, PREG_OFFSET_CAPTURE);
+		if($match && is_array($match[0])) {
+			$x=$match[0][1];
+			// is there an anchor nearby?
+			if (preg_match_all('/<(?:[^>]+id|\s*a[^>]+name)\s*=\s*"(.*)"/iuU', $text, $match, PREG_OFFSET_CAPTURE)) {
+				$anchor='';
+				foreach($match[1] AS $array) {
+					if($array[1] > $x) {
+						break;
+					}
+					$anchor = $array[0];
+				}
+				if($anchor != '') {
+					$page_link_target = '#'.$anchor;
+				}
+			}
+		}
+	}
+	elseif(substr($page_link_target,0,13)=='#!wb_section_') {
+		$page_link_target = '#'.substr($page_link_target, 2);
+	}
+	return $page_link_target;
+}
+
+// wrapper for compatibility with old print_excerpt()
+function print_excerpt($page_link, $page_link_target, $page_title, $page_description, $page_modified_when, $page_modified_by, $text, $max_excerpt_num, $func_vars, $pic_link="") {
+	$mod_vars = array(
+		'page_link' => $page_link,
+		'page_link_target' => $page_link_target,
+		'page_title' => $page_title,
+		'page_description' => $page_description,
+		'page_modified_when' => $page_modified_when,
+		'page_modified_by' => $page_modified_by,
+		'text' => $text,
+		'max_excerpt_num' => $max_excerpt_num,
+		'pic_link' => $pic_link
+	);
+	print_excerpt2($mod_vars, $func_vars);
+}
+
+/* These functions can be used in module-supplied search_funcs
+ * -----------------------------------------------------------
+ * print_excerpt2() - the main-function to use in all search_funcs
+ * print_excerpt() - wrapper for compatibility-reason. Use print_excerpt2() instead.
+ * list_files_dirs() - lists all files and dirs below a given directory
+ * clear_filelist() - keeps only wanted or removes unwanted entries in file-list.
+ */
+ 
+// prints the excerpts for one section
+function print_excerpt2($mod_vars, $func_vars) {
+	extract($func_vars, EXTR_PREFIX_ALL, 'func');
+	extract($mod_vars, EXTR_PREFIX_ALL, 'mod');
+	global $TEXT;
+	// check $mod_...vars
+	if(!isset($mod_page_link))          $mod_page_link = $func_page_link;
+	if(!isset($mod_page_link_target))   $mod_page_link_target = "";
+	if(!isset($mod_page_title))         $mod_page_title = $func_page_title;
+	if(!isset($mod_page_description))   $mod_page_description = $func_page_description;
+	if(!isset($mod_page_modified_when)) $mod_page_modified_when = $func_page_modified_when;
+	if(!isset($mod_page_modified_by))   $mod_page_modified_by = $func_page_modified_by;
+	if(!isset($mod_text))               $mod_text = "";
+	if(!isset($mod_max_excerpt_num))    $mod_max_excerpt_num = $func_default_max_excerpt;
+	if(!isset($mod_pic_link))           $mod_pic_link = "";
+	if(!isset($mod_no_highlight))       $mod_no_highlight = false;
+	if($mod_text == "") // nothing to do
+		{ return false; }
+	if($mod_no_highlight) // no highlighting
+		{ $mod_page_link_target = "&nohighlight".$mod_page_link_target; }
+
+	// prepare the text (part 1): remove lf and cr, convert \" to ", remove comments, style, scripting and unnecessary whitespace, convert to utf8
+	$mod_text = strtr($mod_text, array("\x0D\x0A" => ' ', "\x0D" => ' ', "\x0A" => ' ', '\"' => '"'));
+	$mod_text = preg_replace('/(<!--.*?-->|<style.*?<\/style>|<script.*?<\/script>|\s+)/i', ' ', $mod_text);
+	$mod_text = entities_to_umlauts($mod_text, 'UTF-8');
+
+	// make the link from $mod_page_link, add target
+	$link = "";
+	$link = page_link($mod_page_link);
+	$link .= make_url_searchstring($func_search_match, $func_search_url_array);
+	$link .= make_url_target($mod_page_link_target, $mod_text, $func_search_words);
+
+	// prepare the text (part 2): convert some special tags to '.', strip tags
+	$mod_text = preg_replace('/<(br( \/)?|dt|\/dd|\/?(h[1-6]|tr|table|p|li|ul|pre|code|div|hr))[^>]*>/i', '.', $mod_text);
+	$mod_text = strip_tags($mod_text);
+
+// unhtmlspecialchars
+//	$mod_text = strtr($mod_text, array('&lt;'=>'<', '&gt;'=>'>', '&amp;'=>'&', '&quot;'=>'"', '&#39;'=>'\'', '&nbsp;'=>"\xC2\xA0"));
+//	$tmp_words = array();
+//	foreach($func_search_words as $w) {
+//		$tmp_words[] = strtr($w, array('&lt;'=>'<', '&gt;'=>'>', '&amp;'=>'&', '&quot;'=>'"', '&#39;'=>'\'', '&nbsp;'=>"\xC2\xA0"));
+//	}
+//	$func_search_words = $tmp_words;
+
+	// Do a fast scan over $mod_text first. This will speedup things a lot.
+	if($func_search_match == 'all') {
+		if(!is_all_matched($mod_text, $func_search_words)) {
+			return false;
+		}
+	}
+	elseif(!is_any_matched($mod_text, $func_search_words)) {
+		return false;
+	}
+
+	// now get the excerpt
+	$excerpt = "";
+	$excerpt_array = array();
+	if($mod_max_excerpt_num > 0) {
+		if(!$excerpt_array = get_excerpts($mod_text, $func_search_words, $mod_max_excerpt_num)) {
+			return false;
+		}
+		$excerpt = prepare_excerpts($excerpt_array, $func_search_words, $mod_max_excerpt_num);
+	}
+
+	// handle image
+	if($mod_pic_link != "") {
+		$excerpt = '<table width="100%" cellspacing="0" cellpadding="0" border="0"><tbody><tr><td width="110" valign="top"><a href="'.$link.'"><img src="'.WB_URL.'/'.MEDIA_DIRECTORY.$mod_pic_link.'" alt="" /></a></td><td>'.$excerpt.'</td></tr></tbody></table>';
+	}
+
+	// print-out the excerpt
+	$vars = array();
+	$values = array();
+	list($date, $time) = get_page_modified($mod_page_modified_when);
+	list($username, $displayname) = get_page_modified_by($mod_page_modified_by, $func_users);
+	$vars = array('[LINK]', '[TITLE]', '[DESCRIPTION]', '[USERNAME]','[DISPLAY_NAME]','[DATE]','[TIME]','[TEXT_LAST_UPDATED_BY]','[TEXT_ON]','[EXCERPT]');
+	$values = array(
+		$link,
+		$mod_page_title,
+		$mod_page_description,
+		$username,
+		$displayname,
+		$date,
+		$time,
+		$TEXT['LAST_UPDATED_BY'],
+		$TEXT['ON'],
+		$excerpt
+	);
+	echo str_replace($vars, $values, $func_results_loop_string);
+	return true;
+}
+
+// list all files and dirs in $dir (recursive), omits '.' and '..'
+// returns an array of two arrays ($files[] and $dirs[]).
+// usage: list($files,$dirs) = list_files_dirs($directory);
+//        $depth: get subdirs (true/false)
+function list_files_dirs($dir, $depth=true, $files=array(), $dirs=array()) {
+	$dh=opendir($dir);
+	while(($file = readdir($dh)) !== false) {
+		if($file == '.' || $file == '..') {
+			continue;
+		}
+		if(is_dir($dir.'/'.$file)) {
+			if($depth) {
+				$dirs[] = $dir.'/'.$file;
+				list($files, $dirs) = list_files_dirs($dir.'/'.$file, $depth, $files, $dirs);
+			}
+		} else {
+			$files[] = $dir.'/'.$file;
+		}
+	}
+	closedir($dh);
+	natcasesort($files);
+	natcasesort($dirs);
+	return(array($files, $dirs));
+}
+
+// keeps only wanted entries in array $files. $str have to be an eregi()-compatible regex
+function clear_filelist($files, $str, $keep=true) {
+	// $keep = true  : remove all non-matching entries
+	// $keep = false : remove all matching entries
+	$c_filelist = array();
+	if($str == '')
+		return $files;
+	foreach($files as $file) {
+		if($keep) {
+			if(eregi($str, $file)) {
+				$c_filelist[] = $file;
+			}
+		} else {
+			if(!eregi($str, $file)) {
+				$c_filelist[] = $file;
+			}
+		}
+	}
+	return($c_filelist);
+}
+
+?>

Property changes on: trunk/wb/search/search_modext.php
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: trunk/wb/install/save.php
===================================================================
--- trunk/wb/install/save.php	(revision 551)
+++ trunk/wb/install/save.php	(revision 552)
@@ -1,663 +1,680 @@
-<?php
-
-// $Id$
-
-/*
-
- Website Baker Project <http://www.websitebaker.org/>
- Copyright (C) 2004-2008, Ryan Djurovich
-
- Website Baker is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- Website Baker is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with Website Baker; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-
-*/
-
-// Start a session
-if(!defined('SESSION_STARTED')) {
-	session_name('wb_session_id');
-	session_start();
-	define('SESSION_STARTED', true);
-}
-
-// Function to set error
-function set_error($message) {
-	global $_POST;
-	if(isset($message) AND $message != '') {
-		// Copy values entered into session so user doesn't have to re-enter everything
-		if(isset($_POST['website_title'])) {
-			$_SESSION['wb_url'] = $_POST['wb_url'];
-			$_SESSION['wb_path'] = $_POST['wb_path'];
-			$_SESSION['default_timezone'] = $_POST['default_timezone'];
-			if(!isset($_POST['operating_system'])) {
-				$_SESSION['operating_system'] = 'linux';
-			} else {
-				$_SESSION['operating_system'] = $_POST['operating_system'];
-			}
-			if(!isset($_POST['world_writeable'])) {
-				$_SESSION['world_writeable'] = false;
-			} else {
-				$_SESSION['world_writeable'] = true;
-			}
-			$_SESSION['database_host'] = $_POST['database_host'];
-			$_SESSION['database_username'] = $_POST['database_username'];
-			$_SESSION['database_password'] = $_POST['database_password'];
-			$_SESSION['database_name'] = $_POST['database_name'];
-			$_SESSION['table_prefix'] = $_POST['table_prefix'];
-			if(!isset($_POST['install_tables'])) {
-				$_SESSION['install_tables'] = false;
-			} else {
-				$_SESSION['install_tables'] = true;
-			}
-			$_SESSION['website_title'] = $_POST['website_title'];
-			$_SESSION['admin_username'] = $_POST['admin_username'];
-			$_SESSION['admin_email'] = $_POST['admin_email'];
-			$_SESSION['admin_password'] = $_POST['admin_password'];
-		}
-		// Set the message
-		$_SESSION['message'] = $message;
-		// Specify that session support is enabled
-		$_SESSION['session_support'] = '<font class="good">Enabled</font>';
-		// Redirect to first page again and exit
-		header('Location: index.php?sessions_checked=true');
-		exit();
-	}
-}
-
-// Dummy class to allow modules' install scripts to call $admin->print_error
-class admin_dummy
-{
-	var $error='';
-	function print_error($message)
-	{
-		$this->error=$message;
-	}
-}
-
-// Function to workout what the default permissions are for files created by the webserver
-function default_file_mode($temp_dir) {
-	$v = explode(".",PHP_VERSION);
-	$v = $v[0].$v[1];
-	if($v > 41 AND is_writable($temp_dir)) {
-		$filename = $temp_dir.'/test_permissions.txt';
-		$handle = fopen($filename, 'w');
-		fwrite($handle, 'This file is to get the default file permissions');
-		fclose($handle);
-		$default_file_mode = '0'.substr(sprintf('%o', fileperms($filename)), -3);
-		unlink($filename);
-	} else {
-		$default_file_mode = '0777';
-	}
-	return $default_file_mode;
-}
-
-// Function to workout what the default permissions are for directories created by the webserver
-function default_dir_mode($temp_dir) {
-	$v = explode(".",PHP_VERSION);
-	$v = $v[0].$v[1];
-	if($v > 41 AND is_writable($temp_dir)) {
-		$dirname = $temp_dir.'/test_permissions/';
-		mkdir($dirname);
-		$default_dir_mode = '0'.substr(sprintf('%o', fileperms($dirname)), -3);
-		rmdir($dirname);
-	} else {
-		$default_dir_mode = '0777';
-	}
-	return $default_dir_mode;
-}
-
-function add_slashes($input) {
-		if ( get_magic_quotes_gpc() || ( !is_string($input) ) ) {
-			return $input;
-		}
-		$output = addslashes($input);
-		return $output;
-	}
-
-// Begin check to see if form was even submitted
-// Set error if no post vars found
-if(!isset($_POST['website_title'])) {
-	set_error('Please fill-in the form below');
-}
-// End check to see if form was even submitted
-
-// Begin path and timezone details code
-
-// Check if user has entered the installation url
-if(!isset($_POST['wb_url']) OR $_POST['wb_url'] == '') {
-	set_error('Please enter an absolute URL');
-} else {
-	$wb_url = $_POST['wb_url'];
-}
-// Remove any slashes at the end of the URL
-if(substr($wb_url, strlen($wb_url)-1, 1) == "/") {
-	$wb_url = substr($wb_url, 0, strlen($wb_url)-1);
-}
-if(substr($wb_url, strlen($wb_url)-1, 1) == "\\") {
-	$wb_url = substr($wb_url, 0, strlen($wb_url)-1);
-}
-if(substr($wb_url, strlen($wb_url)-1, 1) == "/") {
-	$wb_url = substr($wb_url, 0, strlen($wb_url)-1);
-}
-if(substr($wb_url, strlen($wb_url)-1, 1) == "\\") {
-	$wb_url = substr($wb_url, 0, strlen($wb_url)-1);
-}
-// Get the default time zone
-if(!isset($_POST['default_timezone']) OR !is_numeric($_POST['default_timezone'])) {
-	set_error('Please select a valid default timezone');
-} else {
-	$default_timezone = $_POST['default_timezone']*60*60;
-}
-// End path and timezone details code
-
-// Begin operating system specific code
-// Get operating system
-if(!isset($_POST['operating_system']) OR $_POST['operating_system'] != 'linux' AND $_POST['operating_system'] != 'windows') {
-	set_error('Please select a valid operating system');
-} else {
-	$operating_system = $_POST['operating_system'];
-}
-// Work-out file permissions
-if($operating_system == 'windows') {
-	$file_mode = '0777';
-	$dir_mode = '0777';
-} elseif(isset($_POST['world_writeable']) AND $_POST['world_writeable'] == 'true') {
-	$file_mode = '0777';
-	$dir_mode = '0777';
-} else {
-	$file_mode = default_file_mode('../temp');
-	$dir_mode = default_dir_mode('../temp');
-}
-// End operating system specific code
-
-// Begin database details code
-// Check if user has entered a database host
-if(!isset($_POST['database_host']) OR $_POST['database_host'] == '') {
-	set_error('Please enter a database host name');
-} else {
-	$database_host = $_POST['database_host'];
-}
-// Check if user has entered a database username
-if(!isset($_POST['database_username']) OR $_POST['database_username'] == '') {
-	set_error('Please enter a database username');
-} else {
-	$database_username = $_POST['database_username'];
-}
-// Check if user has entered a database password
-if(!isset($_POST['database_password'])) {
-	set_error('Please enter a database password');
-} else {
-	$database_password = $_POST['database_password'];
-}
-// Check if user has entered a database name
-if(!isset($_POST['database_name']) OR $_POST['database_name'] == '') {
-	set_error('Please enter a database name');
-} else {
-	$database_name = $_POST['database_name'];
-}
-// Get table prefix
-$table_prefix = $_POST['table_prefix'];
-// Find out if the user wants to install tables and data
-if(isset($_POST['install_tables']) AND $_POST['install_tables'] == 'true') {
-	$install_tables = true;
-} else {
-	$install_tables = false;
-}
-// End database details code
-
-// Begin website title code
-// Get website title
-if(!isset($_POST['website_title']) OR $_POST['website_title'] == '') {
-	set_error('Please enter a website title');
-} else {
-	$website_title = add_slashes($_POST['website_title']);
-}
-// End website title code
-
-// Begin admin user details code
-// Get admin username
-if(!isset($_POST['admin_username']) OR $_POST['admin_username'] == '') {
-	set_error('Please enter a username for the Administrator account');
-} else {
-	$admin_username = $_POST['admin_username'];
-}
-// Get admin email and validate it
-if(!isset($_POST['admin_email']) OR $_POST['admin_email'] == '') {
-	set_error('Please enter an email for the Administrator account');
-} else {
-	if(eregi("^([0-9a-zA-Z]+[-._+&])*[0-9a-zA-Z]+@([-0-9a-zA-Z]+[.])+[a-zA-Z]{2,6}$", $_POST['admin_email'])) {
-		$admin_email = $_POST['admin_email'];
-	} else {
-		set_error('Please enter a valid email address for the Administrator account');
-	}
-}
-// Get the two admin passwords entered, and check that they match
-if(!isset($_POST['admin_password']) OR $_POST['admin_password'] == '') {
-	set_error('Please enter a password for the Administrator account');
-} else {
-	$admin_password = $_POST['admin_password'];
-}
-if(!isset($_POST['admin_repassword']) OR $_POST['admin_repassword'] == '') {
-	set_error('Please make sure you re-enter the password for the Administrator account');
-} else {
-	$admin_repassword = $_POST['admin_repassword'];
-}
-if($admin_password != $admin_repassword) {
-	set_error('Sorry, the two Administrator account passwords you entered do not match');
-}
-// End admin user details code
-
-// Try and write settings to config file
-$config_content = "" .
-"<?php\n".
-"\n".
-"define('DB_TYPE', 'mysql');\n".
-"define('DB_HOST', '$database_host');\n".
-"define('DB_USERNAME', '$database_username');\n".
-"define('DB_PASSWORD', '$database_password');\n".
-"define('DB_NAME', '$database_name');\n".
-"define('TABLE_PREFIX', '$table_prefix');\n".
-"\n".
-"define('WB_PATH', dirname(__FILE__));\n".
-"define('WB_URL', '$wb_url');\n".
-"define('ADMIN_PATH', WB_PATH.'/admin');\n".
-"define('ADMIN_URL', '$wb_url/admin');\n".
-"\n".
-"require_once(WB_PATH.'/framework/initialize.php');\n".
-"\n".
-"?>";
-
-$config_filename = '../config.php';
-
-// Check if the file exists and is writable first.
-if(file_exists($config_filename) AND is_writable($config_filename)) {
-	if(!$handle = fopen($config_filename, 'w')) {
-		set_error("Cannot open the configuration file ($config_filename)");
-	} else {
-		if (fwrite($handle, $config_content) === FALSE) {
-			set_error("Cannot write to the configuration file ($config_filename)");
-		}
-		// Close file
-		fclose($handle);
-	}
-} else {
-	set_error("The configuration file $config_filename is not writable. Change its permissions so it is, then re-run step 4.");
-}
-
-// Define configuration vars
-define('DB_TYPE', 'mysql');
-define('DB_HOST', $database_host);
-define('DB_USERNAME', $database_username);
-define('DB_PASSWORD', $database_password);
-define('DB_NAME', $database_name);
-define('TABLE_PREFIX', $table_prefix);
-define('WB_PATH', str_replace(array('/install','\install'), '',dirname(__FILE__)));
-define('WB_URL', $wb_url);
-define('ADMIN_PATH', WB_PATH.'/admin');
-define('ADMIN_URL', $wb_url.'/admin');
-
-// Check if the user has entered a correct path
-if(!file_exists(WB_PATH.'/framework/class.admin.php')) {
-	set_error('It appears the Absolute path that you entered is incorrect');
-}
-
-// Try connecting to database	
-if(!mysql_connect(DB_HOST, DB_USERNAME, DB_PASSWORD)) {
-	set_error('Database host name, username and/or password incorrect. MySQL Error:<br />'.mysql_error());
-}
-
-// Try to create the database
-mysql_query('CREATE DATABASE '.$database_name);
-
-// Close the mysql connection
-mysql_close();
-
-// Include WB functions file
-require_once(WB_PATH.'/framework/functions.php');
-
-// Re-connect to the database, this time using in-build database class
-require_once(WB_PATH.'/framework/class.login.php');
-$database=new database();
-
-// Check if we should install tables
-if($install_tables == true) {
-	
-	// Remove tables if they exist
-
-	// Pages table
-	$pages = "DROP TABLE IF EXISTS `".TABLE_PREFIX."pages`";
-	$database->query($pages);
-	// Sections table
-	$sections = "DROP TABLE IF EXISTS `".TABLE_PREFIX."sections`";
-	$database->query($sections);
-	// Settings table
-	$settings = "DROP TABLE IF EXISTS `".TABLE_PREFIX."settings`";
-	$database->query($settings);
-	// Users table
-	$users = "DROP TABLE IF EXISTS `".TABLE_PREFIX."users`";
-	$database->query($users);
-	// Groups table
-	$groups = "DROP TABLE IF EXISTS `".TABLE_PREFIX."groups`";
-	$database->query($groups);
-	// Search table
-	$search = "DROP TABLE IF EXISTS `".TABLE_PREFIX."search`";
-	$database->query($search);
-	// Addons table
-	$addons = "DROP TABLE IF EXISTS `".TABLE_PREFIX."addons`";
-	$database->query($addons);
-				
-	// Try installing tables
-	
-	// Pages table
-	$pages = 'CREATE TABLE `'.TABLE_PREFIX.'pages` ( `page_id` INT NOT NULL auto_increment,'
-	       . ' `parent` INT NOT NULL DEFAULT \'0\','
-	       . ' `root_parent` INT NOT NULL DEFAULT \'0\','
-	       . ' `level` INT NOT NULL DEFAULT \'0\','
-	       . ' `link` TEXT NOT NULL,'
-	       . ' `target` VARCHAR( 7 ) NOT NULL DEFAULT \'\' ,'
-	       . ' `page_title` VARCHAR( 255 ) NOT NULL DEFAULT \'\' ,'
-	       . ' `menu_title` VARCHAR( 255 ) NOT NULL DEFAULT \'\' ,'
-	       . ' `description` TEXT NOT NULL ,'
-	       . ' `keywords` TEXT NOT NULL ,'
-	       . ' `page_trail` TEXT NOT NULL  ,'
-	       . ' `template` VARCHAR( 255 ) NOT NULL DEFAULT \'\' ,'
-	       . ' `visibility` VARCHAR( 255 ) NOT NULL DEFAULT \'\' ,'
-	       . ' `position` INT NOT NULL DEFAULT \'0\','
-	       . ' `menu` INT NOT NULL DEFAULT \'0\','
-	       . ' `language` VARCHAR( 5 ) NOT NULL DEFAULT \'\' ,'
-	       . ' `searching` INT NOT NULL DEFAULT \'0\','
-	       . ' `admin_groups` TEXT NOT NULL ,'
-	       . ' `admin_users` TEXT NOT NULL ,'
-	       . ' `viewing_groups` TEXT NOT NULL ,'
-	       . ' `viewing_users` TEXT NOT NULL ,'
-	       . ' `modified_when` INT NOT NULL DEFAULT \'0\','
-	       . ' `modified_by` INT NOT NULL  DEFAULT \'0\','
-	       . ' PRIMARY KEY ( `page_id` ) '
-	       . ' )';
-	$database->query($pages);
-	
-	// Sections table
-	$pages = 'CREATE TABLE `'.TABLE_PREFIX.'sections` ( `section_id` INT NOT NULL auto_increment,'
-	       . ' `page_id` INT NOT NULL DEFAULT \'0\','
-	       . ' `position` INT NOT NULL DEFAULT \'0\','
-	       . ' `module` VARCHAR( 255 ) NOT NULL DEFAULT \'\' ,'
-	       . ' `block` VARCHAR( 255 ) NOT NULL DEFAULT \'\' ,'
-	       . ' PRIMARY KEY ( `section_id` ) '
-	       . ' )';
-	$database->query($pages);
-	
-	require(WB_PATH.'/admin/interface/version.php');
-	
-	// Settings table
-	$settings='CREATE TABLE `'.TABLE_PREFIX.'settings` ( `setting_id` INT NOT NULL auto_increment,'
-		. ' `name` VARCHAR( 255 ) NOT NULL DEFAULT \'\' ,'
-		. ' `value` TEXT NOT NULL ,'
-		. ' PRIMARY KEY ( `setting_id` ) '
-		. ' )';
-	$database->query($settings);
-
-	$settings_rows=	"INSERT INTO `".TABLE_PREFIX."settings` "
-	." (name, value) VALUES "
-	." ('wb_version', '".VERSION."'),"
-	." ('website_title', '$website_title'),"
-	." ('website_description', ''),"
-	." ('website_keywords', ''),"
-	." ('website_header', ''),"
-	." ('website_footer', ''),"
-	." ('wysiwyg_style', 'font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px;'),"
-	." ('rename_files_on_upload', 'php,asp,phpx,aspx'),"
-	." ('er_level', ''),"
-	." ('default_language', 'EN'),"
-	." ('app_name', 'wb'),"
-	." ('default_timezone', '$default_timezone'),"
-	." ('default_date_format', 'M d Y'),"
-	." ('default_time_format', 'g:i A'),"
-	." ('home_folders', 'true'),"
-	." ('default_template', 'round'),"
-	." ('default_charset', 'utf-8'),"
-	." ('multiple_menus', 'false'),"
-	." ('page_level_limit', '4'),"
-	." ('intro_page', 'false'),"
-	." ('page_trash', 'disabled'),"
-	." ('homepage_redirection', 'false'),"
-	." ('page_languages', 'false'),"
-	." ('wysiwyg_editor', 'fckeditor'),"
-	." ('manage_sections', 'true'),"
-	." ('section_blocks', 'false'),"
-	." ('smart_login', 'false'),"
-	." ('captcha_verification', 'true'),"
-	." ('frontend_login', 'false'),"
-	." ('frontend_signup', 'false'),"
-	." ('server_email', '$admin_email'),"
-	." ('search', 'public'),"
-	." ('page_extension', '.php'),"
-	." ('page_spacer', '-'),"
-	." ('pages_directory', '/pages'),"
-	." ('media_directory', '/media'),"
-	." ('operating_system', '$operating_system'),"
-	." ('string_file_mode', '$file_mode'),"
-	." ('string_dir_mode', '$dir_mode'),"
-	." ('wbmailer_routine', 'phpmail'),"
-	." ('wbmailer_smtp_host', ''),"
-	." ('wbmailer_smtp_auth', ''),"
-	." ('wbmailer_smtp_username', ''),"
-	." ('wbmailer_smtp_password', '')";
-	$database->query($settings_rows);
-	
-	// Users table
-	$users = 'CREATE TABLE `'.TABLE_PREFIX.'users` ( `user_id` INT NOT NULL auto_increment,'
-	       . ' `group_id` INT NOT NULL DEFAULT \'0\','
-	       . ' `groups_id` VARCHAR( 255 ) NOT NULL DEFAULT \'0\','
-	       . ' `active` INT NOT NULL DEFAULT \'0\','
-	       . ' `username` VARCHAR( 255 ) NOT NULL DEFAULT \'\' ,'
-	       . ' `password` VARCHAR( 255 ) NOT NULL DEFAULT \'\' ,'
-	       . ' `remember_key` VARCHAR( 255 ) NOT NULL DEFAULT \'\','
-	       . ' `last_reset` INT NOT NULL DEFAULT \'0\','
-	       . ' `display_name` VARCHAR( 255 ) NOT NULL DEFAULT \'\' ,'
-	       . ' `email` TEXT NOT NULL ,'
-	       . ' `timezone` INT NOT NULL DEFAULT \'0\','
-	       . ' `date_format` VARCHAR( 255 ) NOT NULL DEFAULT \'\' ,'
-	       . ' `time_format` VARCHAR( 255 ) NOT NULL DEFAULT \'\' ,'
-	       . ' `language` VARCHAR( 5 ) NOT NULL DEFAULT \'\' ,'
-	       . ' `home_folder` TEXT NOT NULL ,'
-	       . ' `login_when` INT NOT NULL  DEFAULT \'0\','
-	       . ' `login_ip` VARCHAR( 15 ) NOT NULL DEFAULT \'\' ,'
-	       . ' PRIMARY KEY ( `user_id` ) '
-	       . ' )';
-	$database->query($users);
-	
-	// Groups table
-	$groups = 'CREATE TABLE `'.TABLE_PREFIX.'groups` ( `group_id` INT NOT NULL auto_increment,'
-	        . ' `name` VARCHAR( 255 ) NOT NULL DEFAULT \'\' ,'
-	        . ' `system_permissions` TEXT NOT NULL ,'
-	        . ' `module_permissions` TEXT NOT NULL ,'
-	        . ' `template_permissions` TEXT NOT NULL ,'
-	        . ' PRIMARY KEY ( `group_id` ) '
-	        . ' )';
-	$database->query($groups);
-	
-	// Search settings table
-	$search = 'CREATE TABLE `'.TABLE_PREFIX.'search` ( `search_id` INT NOT NULL auto_increment,'
-	        . ' `name` VARCHAR( 255 ) NOT NULL DEFAULT \'\' ,'
-	        . ' `value` TEXT NOT NULL ,'
-	        . ' `extra` TEXT NOT NULL ,'
-	        . ' PRIMARY KEY ( `search_id` ) '
-	        . ' )';
-	$database->query($search);
-	
-	// Addons table
-	$addons = 'CREATE TABLE `'.TABLE_PREFIX.'addons` ( '
-			.'`addon_id` INT NOT NULL auto_increment ,'
-			.'`type` VARCHAR( 255 ) NOT NULL DEFAULT \'\' ,'
-			.'`directory` VARCHAR( 255 ) NOT NULL DEFAULT \'\' ,'
-			.'`name` VARCHAR( 255 ) NOT NULL DEFAULT \'\' ,'
-			.'`description` TEXT NOT NULL ,'
-			.'`function` VARCHAR( 255 ) NOT NULL DEFAULT \'\' ,'
-			.'`version` VARCHAR( 255 ) NOT NULL DEFAULT \'\' ,'
-			.'`platform` VARCHAR( 255 ) NOT NULL DEFAULT \'\' ,'
-			.'`author` VARCHAR( 255 ) NOT NULL DEFAULT \'\' ,'
-			.'`license` VARCHAR( 255 ) NOT NULL DEFAULT \'\' ,'
-			.' PRIMARY KEY ( `addon_id` ) '
-			.' )';
-	$database->query($addons);
-
-	// Insert default data
-	
-	// Admin group
-	$full_system_permissions = 'pages,pages_view,pages_add,pages_add_l0,pages_settings,pages_modify,pages_intro,pages_delete,media,media_view,media_upload,media_rename,media_delete,media_create,addons,modules,modules_view,modules_install,modules_uninstall,templates,templates_view,templates_install,templates_uninstall,languages,languages_view,languages_install,languages_uninstall,settings,settings_basic,settings_advanced,access,users,users_view,users_add,users_modify,users_delete,groups,groups_view,groups_add,groups_modify,groups_delete,admintools';
-	$insert_admin_group = "INSERT INTO `".TABLE_PREFIX."groups` VALUES ('1', 'Administrators', '$full_system_permissions', '', '')";
-	$database->query($insert_admin_group);
-	// Admin user
-	$insert_admin_user = "INSERT INTO `".TABLE_PREFIX."users` (user_id,group_id,groups_id,active,username,password,email,display_name) VALUES ('1','1','1','1','$admin_username','".md5($admin_password)."','$admin_email','Administrator')";
-	$database->query($insert_admin_user);
-	
-	// Search header
-	$search_header = addslashes('
-<h1>[TEXT_SEARCH]</h1>
-
-<form name="search" action="[WB_URL]/search/index.php" method="get">
-<table cellpadding="3" cellspacing="0" border="0" width="500">
-<tr>
-<td>
-<input type="text" name="string" value="[SEARCH_STRING]" style="width: 100%;" />
-</td>
-<td width="150">
-<input type="submit" value="[TEXT_SEARCH]" style="width: 100%;" />
-</td>
-</tr>
-<tr>
-<td colspan="2">
-<input type="radio" name="match" id="match_all" value="all"[ALL_CHECKED] />
-<label for="match_all">[TEXT_ALL_WORDS]</label>
-<input type="radio" name="match" id="match_any" value="any"[ANY_CHECKED] />
-<label for="match_any">[TEXT_ANY_WORDS]</label>
-<input type="radio" name="match" id="match_exact" value="exact"[EXACT_CHECKED] />
-<label for="match_exact">[TEXT_EXACT_MATCH]</label>
-</td>
-</tr>
-</table>
-
-</form>
-
-<hr />
-	');
-	$insert_search_header = "INSERT INTO `".TABLE_PREFIX."search` VALUES ('', 'header', '$search_header', '')";
-	$database->query($insert_search_header);
-	// Search footer
-	$search_footer = addslashes('');
-	$insert_search_footer = "INSERT INTO `".TABLE_PREFIX."search` VALUES ('', 'footer', '$search_footer', '')";
-	$database->query($insert_search_footer);
-	// Search results header
-	$search_results_header = addslashes(''.
-'[TEXT_RESULTS_FOR] \'<b>[SEARCH_STRING]</b>\':
-<table cellpadding="2" cellspacing="0" border="0" width="100%" style="padding-top: 10px;">');
-	$insert_search_results_header = "INSERT INTO `".TABLE_PREFIX."search` VALUES ('', 'results_header', '$search_results_header', '')";
-	$database->query($insert_search_results_header);
-	// Search results loop
-	$search_results_loop = addslashes(''.
-'<tr style="background-color: #F0F0F0;">
-<td><a href="[LINK]">[TITLE]</a></td>
-<td align="right">[TEXT_LAST_UPDATED_BY] [DISPLAY_NAME] ([USERNAME]) [TEXT_ON] [DATE]</td>
-</tr>
-<tr><td colspan="2" style="text-align: justify; padding-bottom: 10px;">[DESCRIPTION]</td></tr>');
-
-	$insert_search_results_loop = "INSERT INTO `".TABLE_PREFIX."search` VALUES ('', 'results_loop', '$search_results_loop', '')";
-	$database->query($insert_search_results_loop);
-	// Search results footer
-	$search_results_footer = addslashes("</table>");
-	$insert_search_results_footer = "INSERT INTO `".TABLE_PREFIX."search` VALUES ('', 'results_footer', '$search_results_footer', '')";
-	$database->query($insert_search_results_footer);
-	// Search no results
-	$search_no_results = addslashes('<br />[TEXT_NO_RESULTS]');
-	$insert_search_no_results = "INSERT INTO `".TABLE_PREFIX."search` VALUES ('', 'no_results', '$search_no_results', '')";
-	$database->query($insert_search_no_results);
-	// Search template
-	$database->query("INSERT INTO `".TABLE_PREFIX."search` (name) VALUES ('template')");
-		
-	require_once(WB_PATH.'/framework/initialize.php');
-	
-	// Include the PclZip class file (thanks to 
-	require_once(WB_PATH.'/include/pclzip/pclzip.lib.php');
-			
-	// Install add-ons
-	if(file_exists(WB_PATH.'/install/modules')) {
-		// Unpack pre-packaged modules
-			
-	}
-	if(file_exists(WB_PATH.'/install/templates')) {
-		// Unpack pre-packaged templates
-		
-	}
-	if(file_exists(WB_PATH.'/install/languages')) {
-		// Unpack pre-packaged languages
-		
-	}
-	
-	$admin=new admin_dummy();
-	// Load addons into DB
-	$dirs['modules'] = WB_PATH.'/modules/';
-	$dirs['templates'] = WB_PATH.'/templates/';
-	$dirs['languages'] = WB_PATH.'/languages/';
-	foreach($dirs AS $type => $dir) {
-		if($handle = opendir($dir)) {
-			while(false !== ($file = readdir($handle))) {
-				if($file != '' AND substr($file, 0, 1) != '.' AND $file != 'admin.php' AND $file != 'index.php') {
-					// Get addon type
-					if($type == 'modules') {
-						load_module($dir.'/'.$file, true);
-						// Pretty ugly hack to let modules run $admin->set_error
-						// See dummy class definition admin_dummy above
-						if ($admin->error!='') {
-							set_error($admin->error);
-						}
-					} elseif($type == 'templates') {
-						load_template($dir.'/'.$file);
-					} elseif($type == 'languages') {
-						load_language($dir.'/'.$file);
-					}
-				}
-			}
-		closedir($handle);
-		}
-	}
-	
-	// Check if there was a database error
-	if($database->is_error()) {
-		set_error($database->get_error());
-	}
-	
-}
-
-// Log the user in and go to Website Baker Administration
-$thisApp = new Login(
-							array(
-									"MAX_ATTEMPS" => "50",
-									"WARNING_URL" => ADMIN_URL."/login/warning.html",
-									"USERNAME_FIELDNAME" => 'admin_username',
-									"PASSWORD_FIELDNAME" => 'admin_password',
-									"REMEMBER_ME_OPTION" => SMART_LOGIN,
-									"MIN_USERNAME_LEN" => "2",
-									"MIN_PASSWORD_LEN" => "2",
-									"MAX_USERNAME_LEN" => "30",
-									"MAX_PASSWORD_LEN" => "30",
-									'LOGIN_URL' => ADMIN_URL."/login/index.php",
-									'DEFAULT_URL' => ADMIN_URL."/start/index.php",
-									'TEMPLATE_DIR' => ADMIN_PATH."/login",
-									'TEMPLATE_FILE' => "template.html",
-									'FRONTEND' => false,
-									'FORGOTTEN_DETAILS_APP' => ADMIN_URL."/login/forgot/index.php",
-									'USERS_TABLE' => TABLE_PREFIX."users",
-									'GROUPS_TABLE' => TABLE_PREFIX."groups",
-							)
-					);
-?>
\ No newline at end of file
+<?php
+
+// $Id$
+
+/*
+
+ Website Baker Project <http://www.websitebaker.org/>
+ Copyright (C) 2004-2008, Ryan Djurovich
+
+ Website Baker is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ Website Baker is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Website Baker; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+*/
+
+// Start a session
+if(!defined('SESSION_STARTED')) {
+	session_name('wb_session_id');
+	session_start();
+	define('SESSION_STARTED', true);
+}
+
+// Function to set error
+function set_error($message) {
+	global $_POST;
+	if(isset($message) AND $message != '') {
+		// Copy values entered into session so user doesn't have to re-enter everything
+		if(isset($_POST['website_title'])) {
+			$_SESSION['wb_url'] = $_POST['wb_url'];
+			$_SESSION['wb_path'] = $_POST['wb_path'];
+			$_SESSION['default_timezone'] = $_POST['default_timezone'];
+			if(!isset($_POST['operating_system'])) {
+				$_SESSION['operating_system'] = 'linux';
+			} else {
+				$_SESSION['operating_system'] = $_POST['operating_system'];
+			}
+			if(!isset($_POST['world_writeable'])) {
+				$_SESSION['world_writeable'] = false;
+			} else {
+				$_SESSION['world_writeable'] = true;
+			}
+			$_SESSION['database_host'] = $_POST['database_host'];
+			$_SESSION['database_username'] = $_POST['database_username'];
+			$_SESSION['database_password'] = $_POST['database_password'];
+			$_SESSION['database_name'] = $_POST['database_name'];
+			$_SESSION['table_prefix'] = $_POST['table_prefix'];
+			if(!isset($_POST['install_tables'])) {
+				$_SESSION['install_tables'] = false;
+			} else {
+				$_SESSION['install_tables'] = true;
+			}
+			$_SESSION['website_title'] = $_POST['website_title'];
+			$_SESSION['admin_username'] = $_POST['admin_username'];
+			$_SESSION['admin_email'] = $_POST['admin_email'];
+			$_SESSION['admin_password'] = $_POST['admin_password'];
+		}
+		// Set the message
+		$_SESSION['message'] = $message;
+		// Specify that session support is enabled
+		$_SESSION['session_support'] = '<font class="good">Enabled</font>';
+		// Redirect to first page again and exit
+		header('Location: index.php?sessions_checked=true');
+		exit();
+	}
+}
+
+// Dummy class to allow modules' install scripts to call $admin->print_error
+class admin_dummy
+{
+	var $error='';
+	function print_error($message)
+	{
+		$this->error=$message;
+	}
+}
+
+// Function to workout what the default permissions are for files created by the webserver
+function default_file_mode($temp_dir) {
+	$v = explode(".",PHP_VERSION);
+	$v = $v[0].$v[1];
+	if($v > 41 AND is_writable($temp_dir)) {
+		$filename = $temp_dir.'/test_permissions.txt';
+		$handle = fopen($filename, 'w');
+		fwrite($handle, 'This file is to get the default file permissions');
+		fclose($handle);
+		$default_file_mode = '0'.substr(sprintf('%o', fileperms($filename)), -3);
+		unlink($filename);
+	} else {
+		$default_file_mode = '0777';
+	}
+	return $default_file_mode;
+}
+
+// Function to workout what the default permissions are for directories created by the webserver
+function default_dir_mode($temp_dir) {
+	$v = explode(".",PHP_VERSION);
+	$v = $v[0].$v[1];
+	if($v > 41 AND is_writable($temp_dir)) {
+		$dirname = $temp_dir.'/test_permissions/';
+		mkdir($dirname);
+		$default_dir_mode = '0'.substr(sprintf('%o', fileperms($dirname)), -3);
+		rmdir($dirname);
+	} else {
+		$default_dir_mode = '0777';
+	}
+	return $default_dir_mode;
+}
+
+function add_slashes($input) {
+		if ( get_magic_quotes_gpc() || ( !is_string($input) ) ) {
+			return $input;
+		}
+		$output = addslashes($input);
+		return $output;
+	}
+
+// Begin check to see if form was even submitted
+// Set error if no post vars found
+if(!isset($_POST['website_title'])) {
+	set_error('Please fill-in the form below');
+}
+// End check to see if form was even submitted
+
+// Begin path and timezone details code
+
+// Check if user has entered the installation url
+if(!isset($_POST['wb_url']) OR $_POST['wb_url'] == '') {
+	set_error('Please enter an absolute URL');
+} else {
+	$wb_url = $_POST['wb_url'];
+}
+// Remove any slashes at the end of the URL
+if(substr($wb_url, strlen($wb_url)-1, 1) == "/") {
+	$wb_url = substr($wb_url, 0, strlen($wb_url)-1);
+}
+if(substr($wb_url, strlen($wb_url)-1, 1) == "\\") {
+	$wb_url = substr($wb_url, 0, strlen($wb_url)-1);
+}
+if(substr($wb_url, strlen($wb_url)-1, 1) == "/") {
+	$wb_url = substr($wb_url, 0, strlen($wb_url)-1);
+}
+if(substr($wb_url, strlen($wb_url)-1, 1) == "\\") {
+	$wb_url = substr($wb_url, 0, strlen($wb_url)-1);
+}
+// Get the default time zone
+if(!isset($_POST['default_timezone']) OR !is_numeric($_POST['default_timezone'])) {
+	set_error('Please select a valid default timezone');
+} else {
+	$default_timezone = $_POST['default_timezone']*60*60;
+}
+// End path and timezone details code
+
+// Begin operating system specific code
+// Get operating system
+if(!isset($_POST['operating_system']) OR $_POST['operating_system'] != 'linux' AND $_POST['operating_system'] != 'windows') {
+	set_error('Please select a valid operating system');
+} else {
+	$operating_system = $_POST['operating_system'];
+}
+// Work-out file permissions
+if($operating_system == 'windows') {
+	$file_mode = '0777';
+	$dir_mode = '0777';
+} elseif(isset($_POST['world_writeable']) AND $_POST['world_writeable'] == 'true') {
+	$file_mode = '0777';
+	$dir_mode = '0777';
+} else {
+	$file_mode = default_file_mode('../temp');
+	$dir_mode = default_dir_mode('../temp');
+}
+// End operating system specific code
+
+// Begin database details code
+// Check if user has entered a database host
+if(!isset($_POST['database_host']) OR $_POST['database_host'] == '') {
+	set_error('Please enter a database host name');
+} else {
+	$database_host = $_POST['database_host'];
+}
+// Check if user has entered a database username
+if(!isset($_POST['database_username']) OR $_POST['database_username'] == '') {
+	set_error('Please enter a database username');
+} else {
+	$database_username = $_POST['database_username'];
+}
+// Check if user has entered a database password
+if(!isset($_POST['database_password'])) {
+	set_error('Please enter a database password');
+} else {
+	$database_password = $_POST['database_password'];
+}
+// Check if user has entered a database name
+if(!isset($_POST['database_name']) OR $_POST['database_name'] == '') {
+	set_error('Please enter a database name');
+} else {
+	$database_name = $_POST['database_name'];
+}
+// Get table prefix
+$table_prefix = $_POST['table_prefix'];
+// Find out if the user wants to install tables and data
+if(isset($_POST['install_tables']) AND $_POST['install_tables'] == 'true') {
+	$install_tables = true;
+} else {
+	$install_tables = false;
+}
+// End database details code
+
+// Begin website title code
+// Get website title
+if(!isset($_POST['website_title']) OR $_POST['website_title'] == '') {
+	set_error('Please enter a website title');
+} else {
+	$website_title = add_slashes($_POST['website_title']);
+}
+// End website title code
+
+// Begin admin user details code
+// Get admin username
+if(!isset($_POST['admin_username']) OR $_POST['admin_username'] == '') {
+	set_error('Please enter a username for the Administrator account');
+} else {
+	$admin_username = $_POST['admin_username'];
+}
+// Get admin email and validate it
+if(!isset($_POST['admin_email']) OR $_POST['admin_email'] == '') {
+	set_error('Please enter an email for the Administrator account');
+} else {
+	if(eregi("^([0-9a-zA-Z]+[-._+&])*[0-9a-zA-Z]+@([-0-9a-zA-Z]+[.])+[a-zA-Z]{2,6}$", $_POST['admin_email'])) {
+		$admin_email = $_POST['admin_email'];
+	} else {
+		set_error('Please enter a valid email address for the Administrator account');
+	}
+}
+// Get the two admin passwords entered, and check that they match
+if(!isset($_POST['admin_password']) OR $_POST['admin_password'] == '') {
+	set_error('Please enter a password for the Administrator account');
+} else {
+	$admin_password = $_POST['admin_password'];
+}
+if(!isset($_POST['admin_repassword']) OR $_POST['admin_repassword'] == '') {
+	set_error('Please make sure you re-enter the password for the Administrator account');
+} else {
+	$admin_repassword = $_POST['admin_repassword'];
+}
+if($admin_password != $admin_repassword) {
+	set_error('Sorry, the two Administrator account passwords you entered do not match');
+}
+// End admin user details code
+
+// Try and write settings to config file
+$config_content = "" .
+"<?php\n".
+"\n".
+"define('DB_TYPE', 'mysql');\n".
+"define('DB_HOST', '$database_host');\n".
+"define('DB_USERNAME', '$database_username');\n".
+"define('DB_PASSWORD', '$database_password');\n".
+"define('DB_NAME', '$database_name');\n".
+"define('TABLE_PREFIX', '$table_prefix');\n".
+"\n".
+"define('WB_PATH', dirname(__FILE__));\n".
+"define('WB_URL', '$wb_url');\n".
+"define('ADMIN_PATH', WB_PATH.'/admin');\n".
+"define('ADMIN_URL', '$wb_url/admin');\n".
+"\n".
+"require_once(WB_PATH.'/framework/initialize.php');\n".
+"\n".
+"?>";
+
+$config_filename = '../config.php';
+
+// Check if the file exists and is writable first.
+if(file_exists($config_filename) AND is_writable($config_filename)) {
+	if(!$handle = fopen($config_filename, 'w')) {
+		set_error("Cannot open the configuration file ($config_filename)");
+	} else {
+		if (fwrite($handle, $config_content) === FALSE) {
+			set_error("Cannot write to the configuration file ($config_filename)");
+		}
+		// Close file
+		fclose($handle);
+	}
+} else {
+	set_error("The configuration file $config_filename is not writable. Change its permissions so it is, then re-run step 4.");
+}
+
+// Define configuration vars
+define('DB_TYPE', 'mysql');
+define('DB_HOST', $database_host);
+define('DB_USERNAME', $database_username);
+define('DB_PASSWORD', $database_password);
+define('DB_NAME', $database_name);
+define('TABLE_PREFIX', $table_prefix);
+define('WB_PATH', str_replace(array('/install','\install'), '',dirname(__FILE__)));
+define('WB_URL', $wb_url);
+define('ADMIN_PATH', WB_PATH.'/admin');
+define('ADMIN_URL', $wb_url.'/admin');
+
+// Check if the user has entered a correct path
+if(!file_exists(WB_PATH.'/framework/class.admin.php')) {
+	set_error('It appears the Absolute path that you entered is incorrect');
+}
+
+// Try connecting to database	
+if(!mysql_connect(DB_HOST, DB_USERNAME, DB_PASSWORD)) {
+	set_error('Database host name, username and/or password incorrect. MySQL Error:<br />'.mysql_error());
+}
+
+// Try to create the database
+mysql_query('CREATE DATABASE '.$database_name);
+
+// Close the mysql connection
+mysql_close();
+
+// Include WB functions file
+require_once(WB_PATH.'/framework/functions.php');
+
+// Re-connect to the database, this time using in-build database class
+require_once(WB_PATH.'/framework/class.login.php');
+$database=new database();
+
+// Check if we should install tables
+if($install_tables == true) {
+	
+	// Remove tables if they exist
+
+	// Pages table
+	$pages = "DROP TABLE IF EXISTS `".TABLE_PREFIX."pages`";
+	$database->query($pages);
+	// Sections table
+	$sections = "DROP TABLE IF EXISTS `".TABLE_PREFIX."sections`";
+	$database->query($sections);
+	// Settings table
+	$settings = "DROP TABLE IF EXISTS `".TABLE_PREFIX."settings`";
+	$database->query($settings);
+	// Users table
+	$users = "DROP TABLE IF EXISTS `".TABLE_PREFIX."users`";
+	$database->query($users);
+	// Groups table
+	$groups = "DROP TABLE IF EXISTS `".TABLE_PREFIX."groups`";
+	$database->query($groups);
+	// Search table
+	$search = "DROP TABLE IF EXISTS `".TABLE_PREFIX."search`";
+	$database->query($search);
+	// Addons table
+	$addons = "DROP TABLE IF EXISTS `".TABLE_PREFIX."addons`";
+	$database->query($addons);
+				
+	// Try installing tables
+	
+	// Pages table
+	$pages = 'CREATE TABLE `'.TABLE_PREFIX.'pages` ( `page_id` INT NOT NULL auto_increment,'
+	       . ' `parent` INT NOT NULL DEFAULT \'0\','
+	       . ' `root_parent` INT NOT NULL DEFAULT \'0\','
+	       . ' `level` INT NOT NULL DEFAULT \'0\','
+	       . ' `link` TEXT NOT NULL,'
+	       . ' `target` VARCHAR( 7 ) NOT NULL DEFAULT \'\' ,'
+	       . ' `page_title` VARCHAR( 255 ) NOT NULL DEFAULT \'\' ,'
+	       . ' `menu_title` VARCHAR( 255 ) NOT NULL DEFAULT \'\' ,'
+	       . ' `description` TEXT NOT NULL ,'
+	       . ' `keywords` TEXT NOT NULL ,'
+	       . ' `page_trail` TEXT NOT NULL  ,'
+	       . ' `template` VARCHAR( 255 ) NOT NULL DEFAULT \'\' ,'
+	       . ' `visibility` VARCHAR( 255 ) NOT NULL DEFAULT \'\' ,'
+	       . ' `position` INT NOT NULL DEFAULT \'0\','
+	       . ' `menu` INT NOT NULL DEFAULT \'0\','
+	       . ' `language` VARCHAR( 5 ) NOT NULL DEFAULT \'\' ,'
+	       . ' `searching` INT NOT NULL DEFAULT \'0\','
+	       . ' `admin_groups` TEXT NOT NULL ,'
+	       . ' `admin_users` TEXT NOT NULL ,'
+	       . ' `viewing_groups` TEXT NOT NULL ,'
+	       . ' `viewing_users` TEXT NOT NULL ,'
+	       . ' `modified_when` INT NOT NULL DEFAULT \'0\','
+	       . ' `modified_by` INT NOT NULL  DEFAULT \'0\','
+	       . ' PRIMARY KEY ( `page_id` ) '
+	       . ' )';
+	$database->query($pages);
+	
+	// Sections table
+	$pages = 'CREATE TABLE `'.TABLE_PREFIX.'sections` ( `section_id` INT NOT NULL auto_increment,'
+	       . ' `page_id` INT NOT NULL DEFAULT \'0\','
+	       . ' `position` INT NOT NULL DEFAULT \'0\','
+	       . ' `module` VARCHAR( 255 ) NOT NULL DEFAULT \'\' ,'
+	       . ' `block` VARCHAR( 255 ) NOT NULL DEFAULT \'\' ,'
+	       . ' `publ_start` VARCHAR( 255 ) NOT NULL DEFAULT \'0\' ,'
+	       . ' `publ_end` VARCHAR( 255 ) NOT NULL DEFAULT \'0\' ,' 
+	       . ' PRIMARY KEY ( `section_id` ) '
+	       . ' )';
+	$database->query($pages);
+
+	require(WB_PATH.'/admin/interface/version.php');
+	
+	// Settings table
+	$settings='CREATE TABLE `'.TABLE_PREFIX.'settings` ( `setting_id` INT NOT NULL auto_increment,'
+		. ' `name` VARCHAR( 255 ) NOT NULL DEFAULT \'\' ,'
+		. ' `value` TEXT NOT NULL ,'
+		. ' PRIMARY KEY ( `setting_id` ) '
+		. ' )';
+	$database->query($settings);
+
+	$settings_rows=	"INSERT INTO `".TABLE_PREFIX."settings` "
+	." (name, value) VALUES "
+	." ('wb_version', '".VERSION."'),"
+	." ('website_title', '$website_title'),"
+	." ('website_description', ''),"
+	." ('website_keywords', ''),"
+	." ('website_header', ''),"
+	." ('website_footer', ''),"
+	." ('wysiwyg_style', 'font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px;'),"
+	." ('rename_files_on_upload', 'php,asp,phpx,aspx'),"
+	." ('er_level', ''),"
+	." ('default_language', 'EN'),"
+	." ('app_name', 'wb'),"
+	." ('default_timezone', '$default_timezone'),"
+	." ('default_date_format', 'M d Y'),"
+	." ('default_time_format', 'g:i A'),"
+	." ('home_folders', 'true'),"
+	." ('default_template', 'round'),"
+	." ('default_charset', 'utf-8'),"
+	." ('multiple_menus', 'false'),"
+	." ('page_level_limit', '4'),"
+	." ('intro_page', 'false'),"
+	." ('page_trash', 'disabled'),"
+	." ('homepage_redirection', 'false'),"
+	." ('page_languages', 'false'),"
+	." ('wysiwyg_editor', 'fckeditor'),"
+	." ('manage_sections', 'true'),"
+	." ('section_blocks', 'false'),"
+	." ('smart_login', 'false'),"
+	." ('captcha_verification', 'true'),"
+	." ('frontend_login', 'false'),"
+	." ('frontend_signup', 'false'),"
+	." ('server_email', '$admin_email'),"
+	." ('search', 'public'),"
+	." ('page_extension', '.php'),"
+	." ('page_spacer', '-'),"
+	." ('pages_directory', '/pages'),"
+	." ('media_directory', '/media'),"
+	." ('operating_system', '$operating_system'),"
+	." ('string_file_mode', '$file_mode'),"
+	." ('string_dir_mode', '$dir_mode'),"
+	." ('wbmailer_routine', 'phpmail'),"
+	." ('wbmailer_smtp_host', ''),"
+	." ('wbmailer_smtp_auth', ''),"
+	." ('wbmailer_smtp_username', ''),"
+	." ('wbmailer_smtp_password', '')";
+	$database->query($settings_rows);
+	
+	// Users table
+	$users = 'CREATE TABLE `'.TABLE_PREFIX.'users` ( `user_id` INT NOT NULL auto_increment,'
+	       . ' `group_id` INT NOT NULL DEFAULT \'0\','
+	       . ' `groups_id` VARCHAR( 255 ) NOT NULL DEFAULT \'0\','
+	       . ' `active` INT NOT NULL DEFAULT \'0\','
+	       . ' `username` VARCHAR( 255 ) NOT NULL DEFAULT \'\' ,'
+	       . ' `password` VARCHAR( 255 ) NOT NULL DEFAULT \'\' ,'
+	       . ' `remember_key` VARCHAR( 255 ) NOT NULL DEFAULT \'\','
+	       . ' `last_reset` INT NOT NULL DEFAULT \'0\','
+	       . ' `display_name` VARCHAR( 255 ) NOT NULL DEFAULT \'\' ,'
+	       . ' `email` TEXT NOT NULL ,'
+	       . ' `timezone` INT NOT NULL DEFAULT \'0\','
+	       . ' `date_format` VARCHAR( 255 ) NOT NULL DEFAULT \'\' ,'
+	       . ' `time_format` VARCHAR( 255 ) NOT NULL DEFAULT \'\' ,'
+	       . ' `language` VARCHAR( 5 ) NOT NULL DEFAULT \'\' ,'
+	       . ' `home_folder` TEXT NOT NULL ,'
+	       . ' `login_when` INT NOT NULL  DEFAULT \'0\','
+	       . ' `login_ip` VARCHAR( 15 ) NOT NULL DEFAULT \'\' ,'
+	       . ' PRIMARY KEY ( `user_id` ) '
+	       . ' )';
+	$database->query($users);
+	
+	// Groups table
+	$groups = 'CREATE TABLE `'.TABLE_PREFIX.'groups` ( `group_id` INT NOT NULL auto_increment,'
+	        . ' `name` VARCHAR( 255 ) NOT NULL DEFAULT \'\' ,'
+	        . ' `system_permissions` TEXT NOT NULL ,'
+	        . ' `module_permissions` TEXT NOT NULL ,'
+	        . ' `template_permissions` TEXT NOT NULL ,'
+	        . ' PRIMARY KEY ( `group_id` ) '
+	        . ' )';
+	$database->query($groups);
+	
+	// Search settings table
+	$search = 'CREATE TABLE `'.TABLE_PREFIX.'search` ( `search_id` INT NOT NULL auto_increment,'
+	        . ' `name` VARCHAR( 255 ) NOT NULL DEFAULT \'\' ,'
+	        . ' `value` TEXT NOT NULL ,'
+	        . ' `extra` TEXT NOT NULL ,'
+	        . ' PRIMARY KEY ( `search_id` ) '
+	        . ' )';
+	$database->query($search);
+	
+	// Addons table
+	$addons = 'CREATE TABLE `'.TABLE_PREFIX.'addons` ( '
+			.'`addon_id` INT NOT NULL auto_increment ,'
+			.'`type` VARCHAR( 255 ) NOT NULL DEFAULT \'\' ,'
+			.'`directory` VARCHAR( 255 ) NOT NULL DEFAULT \'\' ,'
+			.'`name` VARCHAR( 255 ) NOT NULL DEFAULT \'\' ,'
+			.'`description` TEXT NOT NULL ,'
+			.'`function` VARCHAR( 255 ) NOT NULL DEFAULT \'\' ,'
+			.'`version` VARCHAR( 255 ) NOT NULL DEFAULT \'\' ,'
+			.'`platform` VARCHAR( 255 ) NOT NULL DEFAULT \'\' ,'
+			.'`author` VARCHAR( 255 ) NOT NULL DEFAULT \'\' ,'
+			.'`license` VARCHAR( 255 ) NOT NULL DEFAULT \'\' ,'
+			.' PRIMARY KEY ( `addon_id` ) '
+			.' )';
+	$database->query($addons);
+
+	// Insert default data
+	
+	// Admin group
+	$full_system_permissions = 'pages,pages_view,pages_add,pages_add_l0,pages_settings,pages_modify,pages_intro,pages_delete,media,media_view,media_upload,media_rename,media_delete,media_create,addons,modules,modules_view,modules_install,modules_uninstall,templates,templates_view,templates_install,templates_uninstall,languages,languages_view,languages_install,languages_uninstall,settings,settings_basic,settings_advanced,access,users,users_view,users_add,users_modify,users_delete,groups,groups_view,groups_add,groups_modify,groups_delete,admintools';
+	$insert_admin_group = "INSERT INTO `".TABLE_PREFIX."groups` VALUES ('1', 'Administrators', '$full_system_permissions', '', '')";
+	$database->query($insert_admin_group);
+	// Admin user
+	$insert_admin_user = "INSERT INTO `".TABLE_PREFIX."users` (user_id,group_id,groups_id,active,username,password,email,display_name) VALUES ('1','1','1','1','$admin_username','".md5($admin_password)."','$admin_email','Administrator')";
+	$database->query($insert_admin_user);
+	
+	// Search header
+	$search_header = addslashes('
+<h1>[TEXT_SEARCH]</h1>
+
+<form name="search" action="[WB_URL]/search/index.php" method="get">
+<table cellpadding="3" cellspacing="0" border="0" width="500">
+<tr>
+<td>
+<input type="hidden" name="search_path" value="[SEARCH_PATH]" />
+<input type="text" name="string" value="[SEARCH_STRING]" style="width: 100%;" />
+</td>
+<td width="150">
+<input type="submit" value="[TEXT_SEARCH]" style="width: 100%;" />
+</td>
+</tr>
+<tr>
+<td colspan="2">
+<input type="radio" name="match" id="match_all" value="all"[ALL_CHECKED] />
+<label for="match_all">[TEXT_ALL_WORDS]</label>
+<input type="radio" name="match" id="match_any" value="any"[ANY_CHECKED] />
+<label for="match_any">[TEXT_ANY_WORDS]</label>
+<input type="radio" name="match" id="match_exact" value="exact"[EXACT_CHECKED] />
+<label for="match_exact">[TEXT_EXACT_MATCH]</label>
+</td>
+</tr>
+</table>
+
+</form>
+
+<hr />
+	');
+	$insert_search_header = "INSERT INTO `".TABLE_PREFIX."search` VALUES ('', 'header', '$search_header', '')";
+	$database->query($insert_search_header);
+	// Search footer
+	$search_footer = addslashes('');
+	$insert_search_footer = "INSERT INTO `".TABLE_PREFIX."search` VALUES ('', 'footer', '$search_footer', '')";
+	$database->query($insert_search_footer);
+	// Search results header
+	$search_results_header = addslashes(''.
+'[TEXT_RESULTS_FOR] \'<b>[SEARCH_STRING]</b>\':
+<table cellpadding="2" cellspacing="0" border="0" width="100%" style="padding-top: 10px;">');
+	$insert_search_results_header = "INSERT INTO `".TABLE_PREFIX."search` VALUES ('', 'results_header', '$search_results_header', '')";
+	$database->query($insert_search_results_header);
+	// Search results loop
+	$search_results_loop = addslashes(''.
+'<tr style="background-color: #F0F0F0;">
+<td><a href="[LINK]">[TITLE]</a></td>
+<td align="right">[TEXT_LAST_UPDATED_BY] [DISPLAY_NAME] ([USERNAME]) [TEXT_ON] [DATE]</td>
+</tr>
+<tr><td colspan="2" style="text-align: justify; padding-bottom: 5px;">[DESCRIPTION]</td></tr>
+<tr><td colspan="2" style="text-align: justify; padding-bottom: 10px;">[EXCERPT]</td></tr>');
+
+	$insert_search_results_loop = "INSERT INTO `".TABLE_PREFIX."search` VALUES ('', 'results_loop', '$search_results_loop', '')";
+	$database->query($insert_search_results_loop);
+	// Search results footer
+	$search_results_footer = addslashes("</table>");
+	$insert_search_results_footer = "INSERT INTO `".TABLE_PREFIX."search` VALUES ('', 'results_footer', '$search_results_footer', '')";
+	$database->query($insert_search_results_footer);
+	// Search no results
+	$search_no_results = addslashes('<br />[TEXT_NO_RESULTS]');
+	$insert_search_no_results = "INSERT INTO `".TABLE_PREFIX."search` VALUES ('', 'no_results', '$search_no_results', '')";
+	$database->query($insert_search_no_results);
+	// Search module-order
+	$search_module_order = addslashes('faqbaker,manual,wysiwyg');
+	$insert_search_module_order = "INSERT INTO `".TABLE_PREFIX."search` VALUES ('', 'module_order', '$search_module_order', '')";
+	$database->query($insert_search_module_order);
+	// Search max lines of excerpt
+	$search_max_excerpt = addslashes('15');
+	$insert_search_max_excerpt = "INSERT INTO `".TABLE_PREFIX."search` VALUES ('', 'max_excerpt', '$search_max_excerpt', '')";
+	$database->query($insert_search_max_excerpt);
+	// some config-elements
+	$database->query("INSERT INTO `".TABLE_PREFIX."search` VALUES ('', 'cfg_enable_old_search', 'true', '')");
+	$database->query("INSERT INTO `".TABLE_PREFIX."search` VALUES ('', 'cfg_search_keywords', 'true', '')");
+	$database->query("INSERT INTO `".TABLE_PREFIX."search` VALUES ('', 'cfg_search_description', 'true', '')");
+	$database->query("INSERT INTO `".TABLE_PREFIX."search` VALUES ('', 'cfg_show_description', 'true', '')");
+	// Search template
+	$database->query("INSERT INTO `".TABLE_PREFIX."search` (name) VALUES ('template')");
+		
+	require_once(WB_PATH.'/framework/initialize.php');
+	
+	// Include the PclZip class file (thanks to 
+	require_once(WB_PATH.'/include/pclzip/pclzip.lib.php');
+			
+	// Install add-ons
+	if(file_exists(WB_PATH.'/install/modules')) {
+		// Unpack pre-packaged modules
+			
+	}
+	if(file_exists(WB_PATH.'/install/templates')) {
+		// Unpack pre-packaged templates
+		
+	}
+	if(file_exists(WB_PATH.'/install/languages')) {
+		// Unpack pre-packaged languages
+		
+	}
+	
+	$admin=new admin_dummy();
+	// Load addons into DB
+	$dirs['modules'] = WB_PATH.'/modules/';
+	$dirs['templates'] = WB_PATH.'/templates/';
+	$dirs['languages'] = WB_PATH.'/languages/';
+	foreach($dirs AS $type => $dir) {
+		if($handle = opendir($dir)) {
+			while(false !== ($file = readdir($handle))) {
+				if($file != '' AND substr($file, 0, 1) != '.' AND $file != 'admin.php' AND $file != 'index.php') {
+					// Get addon type
+					if($type == 'modules') {
+						load_module($dir.'/'.$file, true);
+						// Pretty ugly hack to let modules run $admin->set_error
+						// See dummy class definition admin_dummy above
+						if ($admin->error!='') {
+							set_error($admin->error);
+						}
+					} elseif($type == 'templates') {
+						load_template($dir.'/'.$file);
+					} elseif($type == 'languages') {
+						load_language($dir.'/'.$file);
+					}
+				}
+			}
+		closedir($handle);
+		}
+	}
+	
+	// Check if there was a database error
+	if($database->is_error()) {
+		set_error($database->get_error());
+	}
+	
+}
+
+// Log the user in and go to Website Baker Administration
+$thisApp = new Login(
+							array(
+									"MAX_ATTEMPS" => "50",
+									"WARNING_URL" => ADMIN_URL."/login/warning.html",
+									"USERNAME_FIELDNAME" => 'admin_username',
+									"PASSWORD_FIELDNAME" => 'admin_password',
+									"REMEMBER_ME_OPTION" => SMART_LOGIN,
+									"MIN_USERNAME_LEN" => "2",
+									"MIN_PASSWORD_LEN" => "2",
+									"MAX_USERNAME_LEN" => "30",
+									"MAX_PASSWORD_LEN" => "30",
+									'LOGIN_URL' => ADMIN_URL."/login/index.php",
+									'DEFAULT_URL' => ADMIN_URL."/start/index.php",
+									'TEMPLATE_DIR' => ADMIN_PATH."/login",
+									'TEMPLATE_FILE' => "template.html",
+									'FRONTEND' => false,
+									'FORGOTTEN_DETAILS_APP' => ADMIN_URL."/login/forgot/index.php",
+									'USERS_TABLE' => TABLE_PREFIX."users",
+									'GROUPS_TABLE' => TABLE_PREFIX."groups",
+							)
+					);
+?>
Index: trunk/wb/languages/EN.php
===================================================================
--- trunk/wb/languages/EN.php	(revision 551)
+++ trunk/wb/languages/EN.php	(revision 552)
@@ -1,546 +1,551 @@
-<?php
-
-// $Id$
-
-/*
-
- Website Baker Project <http://www.websitebaker.org/>
- Copyright (C) 2004-2008, Ryan Djurovich
-
- Website Baker is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- Website Baker is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with Website Baker; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-
-*/
-
-// Define that this file is loaded
-if(!defined('LANGUAGE_LOADED')) {
-	define('LANGUAGE_LOADED', true);
-}
-
-// Set the language information
-$language_code = 'EN';
-$language_name = 'English';
-$language_version = '2.7';
-$language_platform = '2.7.x';
-$language_author = 'Ryan Djurovich, Christian Sommer';
-$language_license = 'GNU General Public License';
-
-// Menu titles
-$MENU['START'] = 'Start';
-$MENU['PAGES'] = 'Pages';
-$MENU['MEDIA'] = 'Media';
-$MENU['ADDONS'] = 'Add-ons';
-$MENU['MODULES'] = 'Modules';
-$MENU['TEMPLATES'] = 'Templates';
-$MENU['LANGUAGES'] = 'Languages';
-$MENU['PREFERENCES'] = 'Preferences';
-$MENU['SETTINGS'] = 'Settings';
-$MENU['ADMINTOOLS'] = 'Admin-Tools';
-$MENU['ACCESS'] = 'Access';
-$MENU['USERS'] = 'Users';
-$MENU['GROUPS'] = 'Groups';
-$MENU['HELP'] = 'Help';
-$MENU['VIEW'] = 'View';
-$MENU['LOGOUT'] = 'Log-out';
-$MENU['LOGIN'] = 'Login';
-$MENU['FORGOT'] = 'Retrieve Login Details';
-
-// Section overviews
-$OVERVIEW['START'] = 'Administration overview';
-$OVERVIEW['PAGES'] = 'Manage your websites pages...';
-$OVERVIEW['MEDIA'] = 'Manage files stored in the media folder...';
-$OVERVIEW['MODULES'] = 'Manage Website Baker modules...';
-$OVERVIEW['TEMPLATES'] = 'Change the look and feel of your website with templates...';
-$OVERVIEW['LANGUAGES'] = 'Manage Website Baker languages...';
-$OVERVIEW['PREFERENCES'] = 'Change preferences such as email address, password, etc... ';
-$OVERVIEW['SETTINGS'] = 'Changes settings for Website Baker...';
-$OVERVIEW['USERS'] = 'Manage users who can log-in to Website Baker...';
-$OVERVIEW['GROUPS'] = 'Manage user groups and their system permissions...';
-$OVERVIEW['HELP'] = 'Got a questions? Find your answer...';
-$OVERVIEW['VIEW'] = 'Quickly view and browse your website in a new window...';
-
-// Headings
-$HEADING['MODIFY_DELETE_PAGE'] = 'Modify/Delete Page';
-$HEADING['DELETED_PAGES'] = 'Deleted Pages';
-$HEADING['ADD_PAGE'] = 'Add Page';
-$HEADING['ADD_HEADING'] = 'Add Heading';
-$HEADING['MODIFY_PAGE'] = 'Modify Page';
-$HEADING['MODIFY_PAGE_SETTINGS'] = 'Modify Page Settings';
-$HEADING['MODIFY_ADVANCED_PAGE_SETTINGS'] = 'Modify Advanced Page Settings';
-$HEADING['MANAGE_SECTIONS'] = 'Manage Sections';
-$HEADING['MODIFY_INTRO_PAGE'] = 'Modify Intro Page';
-
-$HEADING['BROWSE_MEDIA'] = 'Browse Media';
-$HEADING['CREATE_FOLDER'] = 'Create Folder';
-$HEADING['UPLOAD_FILES'] = 'Upload File(s)';
-
-$HEADING['INSTALL_MODULE'] = 'Install Module';
-$HEADING['UNINSTALL_MODULE'] = 'Uninstall Module';
-$HEADING['MODULE_DETAILS'] = 'Module Details';
-
-$HEADING['INSTALL_TEMPLATE'] = 'Install Template';
-$HEADING['UNINSTALL_TEMPLATE'] = 'Uninstall Template';
-$HEADING['TEMPLATE_DETAILS'] = 'Template Details';
-
-$HEADING['INSTALL_LANGUAGE'] = 'Install Language';
-$HEADING['UNINSTALL_LANGUAGE'] = 'Uninstall Language';
-$HEADING['LANGUAGE_DETAILS'] = 'Language Details';
-
-$HEADING['MY_SETTINGS'] = 'My Settings';
-$HEADING['MY_EMAIL'] = 'My Email';
-$HEADING['MY_PASSWORD'] = 'My Password';
-
-$HEADING['GENERAL_SETTINGS'] = 'General Settings';
-$HEADING['DEFAULT_SETTINGS'] = 'Default Settings';
-$HEADING['SEARCH_SETTINGS'] = 'Search Settings';
-$HEADING['FILESYSTEM_SETTINGS'] = 'Filesystem Settings';
-$HEADING['SERVER_SETTINGS'] = 'Server Settings';
-$HEADING['WBMAILER_SETTINGS'] = 'Mailer Settings';
-$HEADING['ADMINISTRATION_TOOLS'] = 'Administration Tools';
-
-$HEADING['MODIFY_DELETE_USER'] = 'Modify/Delete User';
-$HEADING['ADD_USER'] = 'Add User';
-$HEADING['MODIFY_USER'] = 'Modify User';
-
-$HEADING['MODIFY_DELETE_GROUP'] = 'Modify/Delete Group';
-$HEADING['ADD_GROUP'] = 'Add Group';
-$HEADING['MODIFY_GROUP'] = 'Modify Group';
-
-// Other text
-$TEXT['ADD'] = 'Add';
-$TEXT['MODIFY'] = 'Modify';
-$TEXT['SETTINGS'] = 'Settings';
-$TEXT['DELETE'] = 'Delete';
-$TEXT['SAVE'] = 'Save';
-$TEXT['RESET'] = 'Reset';
-$TEXT['LOGIN'] = 'Login';
-$TEXT['RELOAD'] = 'Reload';
-$TEXT['CANCEL'] = 'Cancel';
-$TEXT['NAME'] = 'Name';
-$TEXT['PLEASE_SELECT'] = 'Please select';
-$TEXT['TITLE'] = 'Title';
-$TEXT['PARENT'] = 'Parent';
-$TEXT['TYPE'] = 'Type';
-$TEXT['VISIBILITY'] = 'Visibility';
-$TEXT['PRIVATE'] = 'Private';
-$TEXT['PUBLIC'] = 'Public';
-$TEXT['NONE'] = 'None';
-$TEXT['NONE_FOUND'] = 'None Found';
-$TEXT['CURRENT'] = 'Current';
-$TEXT['CHANGE'] = 'Change';
-$TEXT['WINDOW'] = 'Window';
-$TEXT['DESCRIPTION'] = 'Description';
-$TEXT['KEYWORDS'] = 'Keywords';
-$TEXT['ADMINISTRATORS'] = 'Administrators';
-$TEXT['PRIVATE_VIEWERS'] = 'Private Viewers';
-$TEXT['EXPAND'] = 'Expand';
-$TEXT['COLLAPSE'] = 'Collapse';
-$TEXT['MOVE_UP'] = 'Move Up';
-$TEXT['MOVE_DOWN'] = 'Move Down';
-$TEXT['RENAME'] = 'Rename';
-$TEXT['MODIFY_SETTINGS'] = 'Modify Settings';
-$TEXT['MODIFY_CONTENT'] = 'Modify Content';
-$TEXT['VIEW'] = 'View';
-$TEXT['UP'] = 'Up';
-$TEXT['FORGOTTEN_DETAILS'] = 'Forgotten your details?';
-$TEXT['NEED_TO_LOGIN'] = 'Need to log-in?';
-$TEXT['SEND_DETAILS'] = 'Send Details';
-$TEXT['USERNAME'] = 'Username';
-$TEXT['PASSWORD'] = 'Password';
-$TEXT['HOME'] = 'Home';
-$TEXT['TARGET_FOLDER'] = 'Target folder';
-$TEXT['OVERWRITE_EXISTING'] = 'Overwrite existing';
-$TEXT['FILE'] = 'File';
-$TEXT['FILES'] = 'Files';
-$TEXT['FOLDER'] = 'Folder';
-$TEXT['FOLDERS'] = 'Folders';
-$TEXT['CREATE_FOLDER'] = 'Create Folder';
-$TEXT['UPLOAD_FILES'] = 'Upload File(s)';
-$TEXT['CURRENT_FOLDER'] = 'Current Folder';
-$TEXT['TO'] = 'To';
-$TEXT['FROM'] = 'From';
-$TEXT['INSTALL'] = 'Install';
-$TEXT['UNINSTALL'] = 'Uninstall';
-$TEXT['VIEW_DETAILS'] = 'View Details';
-$TEXT['DISPLAY_NAME'] = 'Display Name';
-$TEXT['AUTHOR'] = 'Author';
-$TEXT['VERSION'] = 'Version';
-$TEXT['DESIGNED_FOR'] = 'Designed For';
-$TEXT['DESCRIPTION'] = 'Description';
-$TEXT['EMAIL'] = 'Email';
-$TEXT['LANGUAGE'] = 'Language';
-$TEXT['TIMEZONE'] = 'Timezone';
-$TEXT['CURRENT_PASSWORD'] = 'Current Password';
-$TEXT['NEW_PASSWORD'] = 'New Password';
-$TEXT['RETYPE_NEW_PASSWORD'] = 'Re-type New Password';
-$TEXT['ACTIVE'] = 'Active';
-$TEXT['DISABLED'] = 'Disabled';
-$TEXT['ENABLED'] = 'Enabled';
-$TEXT['RETYPE_PASSWORD'] = 'Re-type Password';
-$TEXT['GROUP'] = 'Group';
-$TEXT['SYSTEM_PERMISSIONS'] = 'System Permissions';
-$TEXT['MODULE_PERMISSIONS'] = 'Module Permissions';
-$TEXT['SHOW_ADVANCED'] = 'Show Advanced Options';
-$TEXT['HIDE_ADVANCED'] = 'Hide Advanced Options';
-$TEXT['BASIC'] = 'Basic';
-$TEXT['ADVANCED'] = 'Advanced';
-$TEXT['WEBSITE'] = 'Website';
-$TEXT['DEFAULT'] = 'Default';
-$TEXT['KEYWORDS'] = 'Keywords';
-$TEXT['TEXT'] = 'Text';
-$TEXT['HEADER'] = 'Header';
-$TEXT['FOOTER'] = 'Footer';
-$TEXT['TEMPLATE'] = 'Template';
-$TEXT['INSTALLATION'] = 'Installation';
-$TEXT['DATABASE'] = 'Database';
-$TEXT['HOST'] = 'Host';
-$TEXT['INTRO'] = 'Intro';
-$TEXT['PAGE'] = 'Page';
-$TEXT['SIGNUP'] = 'Sign-up';
-$TEXT['PHP_ERROR_LEVEL'] = 'PHP Error Reporting Level';
-$TEXT['ADMIN'] = 'Admin';
-$TEXT['PATH'] = 'Path';
-$TEXT['URL'] = 'URL';
-$TEXT['FRONTEND'] = 'Front-end';
-$TEXT['EXTENSION'] = 'Extension';
-$TEXT['TABLE_PREFIX'] = 'Table Prefix';
-$TEXT['CHANGES'] = 'Changes';
-$TEXT['ADMINISTRATION'] = 'Administration';
-$TEXT['FORGOT_DETAILS'] = 'Forgot Details?';
-$TEXT['LOGGED_IN'] = 'Logged-In';
-$TEXT['WELCOME_BACK'] = 'Welcome back';
-$TEXT['FULL_NAME'] = 'Full Name';
-$TEXT['ACCOUNT_SIGNUP'] = 'Account Sign-Up';
-$TEXT['LINK'] = 'Link';
-$TEXT['TARGET'] = 'Target';
-$TEXT['NEW_WINDOW'] = 'New Window';
-$TEXT['SAME_WINDOW'] = 'Same Window';
-$TEXT['TOP_FRAME'] = 'Top Frame';
-$TEXT['PAGE_LEVEL_LIMIT'] = 'Page Level Limit';
-$TEXT['SUCCESS'] = 'Success';
-$TEXT['ERROR'] = 'Error';
-$TEXT['ARE_YOU_SURE'] = 'Are you sure?';
-$TEXT['YES'] = 'Yes';
-$TEXT['NO'] = 'No';
-$TEXT['SYSTEM_DEFAULT'] = 'System Default';
-$TEXT['PAGE_TITLE'] = 'Page Title';
-$TEXT['MENU_TITLE'] = 'Menu Title';
-$TEXT['ACTIONS'] = 'Actions';
-$TEXT['UNKNOWN'] = 'Unknown';
-$TEXT['BLOCK'] = 'Block';
-$TEXT['SEARCH'] = 'Search';
-$TEXT['SEARCHING'] = 'Searching';
-$TEXT['POST'] = 'Post';
-$TEXT['COMMENT'] = 'Comment';
-$TEXT['COMMENTS'] = 'Comments';
-$TEXT['COMMENTING'] = 'Commenting';
-$TEXT['SHORT'] = 'Short';
-$TEXT['LONG'] = 'Long';
-$TEXT['LOOP'] = 'Loop';
-$TEXT['FIELD'] = 'Field';
-$TEXT['REQUIRED'] = 'Required';
-$TEXT['LENGTH'] = 'Length';
-$TEXT['MESSAGE'] = 'Message';
-$TEXT['SUBJECT'] = 'Subject';
-$TEXT['MATCH'] = 'Match';
-$TEXT['ALL_WORDS'] = 'All Words';
-$TEXT['ANY_WORDS'] = 'Any Words';
-$TEXT['EXACT_MATCH'] = 'Exact Match';
-$TEXT['SHOW'] = 'Show';
-$TEXT['HIDE'] = 'Hide';
-$TEXT['START_PUBLISHING'] = 'Start Publishing';
-$TEXT['FINISH_PUBLISHING'] = 'Finish Publishing';
-$TEXT['DATE'] = 'Date';
-$TEXT['START'] = 'Start';
-$TEXT['END'] = 'End';
-$TEXT['IMAGE'] = 'Image';
-$TEXT['ICON'] = 'Icon';
-$TEXT['SECTION'] = 'Section';
-$TEXT['DATE_FORMAT'] = 'Date Format';
-$TEXT['TIME_FORMAT'] = 'Time Format';
-$TEXT['RESULTS'] = 'Results';
-$TEXT['RESIZE'] = 'Re-size';
-$TEXT['MANAGE'] = 'Manage';
-$TEXT['CODE'] = 'Code';
-$TEXT['WIDTH'] = 'Width';
-$TEXT['HEIGHT'] = 'Height';
-$TEXT['MORE'] = 'More';
-$TEXT['READ_MORE'] = 'Read More';
-$TEXT['CHANGE_SETTINGS'] = 'Change Settings';
-$TEXT['CURRENT_PAGE'] = 'Current Page';
-$TEXT['CLOSE'] = 'Close';
-$TEXT['INTRO_PAGE'] = 'Intro Page';
-$TEXT['INSTALLATION_URL'] = 'Installation URL';
-$TEXT['INSTALLATION_PATH'] = 'Installation Path';
-$TEXT['PAGE_EXTENSION'] = 'Page Extension';
-$TEXT['NO_RESULTS'] = 'No Results';
-$TEXT['WEBSITE_TITLE'] = 'Website Title';
-$TEXT['WEBSITE_DESCRIPTION'] = 'Website Description';
-$TEXT['WEBSITE_KEYWORDS'] = 'Website Keywords';
-$TEXT['WEBSITE_HEADER'] = 'Website Header';
-$TEXT['WEBSITE_FOOTER'] = 'Website Footer';
-$TEXT['RESULTS_HEADER'] = 'Results Header';
-$TEXT['RESULTS_LOOP'] = 'Results Loop';
-$TEXT['RESULTS_FOOTER'] = 'Results Footer';
-$TEXT['LEVEL'] = 'Level';
-$TEXT['NOT_FOUND'] = 'Not Found';
-$TEXT['PAGE_SPACER'] = 'Page Spacer';
-$TEXT['MATCHING'] = 'Matching';
-$TEXT['TEMPLATE_PERMISSIONS'] = 'Template Permissions';
-$TEXT['PAGES_DIRECTORY'] = 'Pages Directory';
-$TEXT['MEDIA_DIRECTORY'] = 'Media Directory';
-$TEXT['FILE_MODE'] = 'File Mode';
-$TEXT['USER'] = 'User';
-$TEXT['OTHERS'] = 'Others';
-$TEXT['READ'] = 'Read';
-$TEXT['WRITE'] = 'Write';
-$TEXT['EXECUTE'] = 'Execute';
-$TEXT['SMART_LOGIN'] = 'Smart Login';
-$TEXT['REMEMBER_ME'] = 'Remember Me';
-$TEXT['FILESYSTEM_PERMISSIONS'] = 'Filesystem Permissions';
-$TEXT['DIRECTORIES'] = 'Directories';
-$TEXT['DIRECTORY_MODE'] = 'Directory Mode';
-$TEXT['LIST_OPTIONS'] = 'List Options';
-$TEXT['OPTION'] = 'Option';
-$TEXT['ALLOW_MULTIPLE_SELECTIONS'] = 'Allow Multiple Selections';
-$TEXT['TEXTFIELD'] = 'Textfield';
-$TEXT['TEXTAREA'] = 'Textarea';
-$TEXT['SELECT_BOX'] = 'Select Box';
-$TEXT['CHECKBOX_GROUP'] = 'Checkbox Group';
-$TEXT['RADIO_BUTTON_GROUP'] = 'Radio Button Group';
-$TEXT['SIZE'] = 'Size';
-$TEXT['DEFAULT_TEXT'] = 'Default Text';
-$TEXT['SEPERATOR'] = 'Separator';
-$TEXT['BACK'] = 'Back';
-$TEXT['UNDER_CONSTRUCTION'] = 'Under Construction';
-$TEXT['MULTISELECT'] = 'Multi-select';
-$TEXT['SHORT_TEXT'] = 'Short Text';
-$TEXT['LONG_TEXT'] = 'Long Text';
-$TEXT['HOMEPAGE_REDIRECTION'] = 'Homepage Redirection';
-$TEXT['HEADING'] = 'Heading';
-$TEXT['MULTIPLE_MENUS'] = 'Multiple Menus';
-$TEXT['REGISTERED'] = 'Registered';
-$TEXT['START'] = 'Start';
-$TEXT['SECTION_BLOCKS'] = 'Section Blocks';
-$TEXT['REGISTERED_VIEWERS'] = 'Registered Viewers';
-$TEXT['ALLOWED_VIEWERS'] = 'Allowed Viewers';
-$TEXT['SUBMISSION_ID'] = 'Submission ID';
-$TEXT['SUBMISSIONS'] = 'Submissions';
-$TEXT['SUBMITTED'] = 'Submitted';
-$TEXT['MAX_SUBMISSIONS_PER_HOUR'] = 'Max. Submissions Per Hour';
-$TEXT['SUBMISSIONS_STORED_IN_DATABASE'] = 'Submissions Stored In Database';
-$TEXT['EMAIL_ADDRESS'] = 'Email Address';
-$TEXT['CUSTOM'] = 'Custom';
-$TEXT['ANONYMOUS'] = 'Anonymous';
-$TEXT['SERVER_OPERATING_SYSTEM'] = 'Server Operating System';
-$TEXT['WORLD_WRITEABLE_FILE_PERMISSIONS'] = 'World-writeable file permissions';
-$TEXT['LINUX_UNIX_BASED'] = 'Linux/Unix based';
-$TEXT['WINDOWS'] = 'Windows';
-$TEXT['HOME_FOLDER'] = 'Home Folder';
-$TEXT['HOME_FOLDERS'] = 'Home Folders';
-$TEXT['PAGE_TRASH'] = 'Page Trash';
-$TEXT['INLINE'] = 'In-line';
-$TEXT['SEPARATE'] = 'Separate';
-$TEXT['DELETED'] = 'Deleted';
-$TEXT['VIEW_DELETED_PAGES'] = 'View Deleted Pages';
-$TEXT['EMPTY_TRASH'] = 'Empty Trash';
-$TEXT['TRASH_EMPTIED'] = 'Trash Emptied';
-$TEXT['ADD_SECTION'] = 'Add Section';
-$TEXT['POST_HEADER'] = 'Post Header';
-$TEXT['POST_FOOTER'] = 'Post Footer';
-$TEXT['POSTS_PER_PAGE'] = 'Posts Per Page';
-$TEXT['RESIZE_IMAGE_TO'] = 'Resize Image To';
-$TEXT['UNLIMITED'] = 'Unlimited';
-$TEXT['OF'] = 'Of';
-$TEXT['OUT_OF'] = 'Out Of';
-$TEXT['NEXT'] = 'Next';
-$TEXT['PREVIOUS'] = 'Previous';
-$TEXT['NEXT_PAGE'] = 'Next Page';
-$TEXT['PREVIOUS_PAGE'] = 'Previous Page';
-$TEXT['ON'] = 'On';
-$TEXT['LAST_UPDATED_BY'] = 'Last Updated By';
-$TEXT['RESULTS_FOR'] = 'Results For';
-$TEXT['TIME'] = 'Time';
-$TEXT['WYSIWYG_STYLE'] = 'WYSIWYG Style';
-$TEXT['WYSIWYG_EDITOR'] = "WYSIWYG Editor";
-$TEXT['SERVER_EMAIL'] = 'Server Email';
-$TEXT['MENU'] = 'Menu';
-$TEXT['MANAGE_GROUPS'] = 'Manage Groups';
-$TEXT['MANAGE_USERS'] = 'Manage Users';
-$TEXT['PAGE_LANGUAGES'] = 'Page Languages';
-$TEXT['HIDDEN'] = 'Hidden';
-$TEXT['MAIN'] = 'Main';
-$TEXT['RENAME_FILES_ON_UPLOAD'] = 'Rename Files On Upload';
-$TEXT['APP_NAME'] = 'Application Name';
-$TEXT['SESSION_IDENTIFIER'] = 'Session Identifier';
-$TEXT['BACKUP'] = 'Backup';
-$TEXT['RESTORE'] = 'Restore';
-$TEXT['BACKUP_DATABASE'] = 'Backup Database';
-$TEXT['RESTORE_DATABASE'] = 'Restore Database';
-$TEXT['BACKUP_ALL_TABLES'] = 'Backup all tables in database';
-$TEXT['BACKUP_WB_SPECIFIC'] = 'Backup only WB-specific tables';
-$TEXT['BACKUP_MEDIA'] = 'Backup Media';
-$TEXT['RESTORE_MEDIA'] = 'Restore Media';
-$TEXT['ADMINISTRATION_TOOL'] = 'Administration tool';
-$TEXT['CAPTCHA_VERIFICATION'] = 'Captcha Verification';
-$TEXT['VERIFICATION'] = 'Verification';
-$TEXT['DEFAULT_CHARSET'] = 'Default Charset';
-$TEXT['CHARSET'] = 'Charset';
-$TEXT['WBMAILER_NOTICE'] = 'Some service providers do not support sending mail via PHP. If your provider requires you to use SMTP for sending mail, you must know the SMTP host address. If you are not sure about these settings, or you do not know the SMTP host of your domain, use the default "PHP mail()" setting. You can change the settings	later if needed.';
-$TEXT['WBMAILER_FUNCTION'] = 'Mail routine';
-$TEXT['WBMAILER_SMTP_HOST'] = 'SMTP host';
-$TEXT['WBMAILER_PHP'] = 'PHP MAIL';
-$TEXT['WBMAILER_SMTP'] = 'SMTP';
-$TEXT['WBMAILER_SMTP_AUTH'] = 'SMTP authentification';
-$TEXT['WBMAILER_SMTP_AUTH_NOTICE'] = 'only activate if your SMTP host requires authentification';
-$TEXT['WBMAILER_SMTP_USERNAME'] = 'SMTP username';
-$TEXT['WBMAILER_SMTP_PASSWORD'] = 'SMTP password';
-$TEXT['PLEASE_LOGIN'] = 'Please login';
-
-// Success/error messages
-$MESSAGE['FRONTEND']['SORRY_NO_VIEWING_PERMISSIONS'] = 'Sorry, you do not have permissions to view this page';
-
-$MESSAGE['ADMIN']['INSUFFICIENT_PRIVELLIGES'] = 'Insufficient privelliges to be here';
-
-$MESSAGE['LOGIN']['BOTH_BLANK'] = 'Please enter your username and password below';
-$MESSAGE['LOGIN']['USERNAME_BLANK'] = 'Please enter a username';
-$MESSAGE['LOGIN']['PASSWORD_BLANK'] = 'Please enter a password';
-$MESSAGE['LOGIN']['USERNAME_TOO_SHORT'] = 'Supplied username to short';
-$MESSAGE['LOGIN']['PASSWORD_TOO_SHORT'] = 'Supplied password to short';
-$MESSAGE['LOGIN']['USERNAME_TOO_LONG'] = 'Supplied username to long';
-$MESSAGE['LOGIN']['PASSWORD_TOO_LONG'] = 'Supplied password to long';
-$MESSAGE['LOGIN']['AUTHENTICATION_FAILED'] = 'Username or password incorrect';
-
-$MESSAGE['SIGNUP']['NO_EMAIL'] = 'You must enter an email address';
-
-$MESSAGE['FORGOT_PASS']['NO_DATA'] = 'Please enter your email address below';
-$MESSAGE['FORGOT_PASS']['EMAIL_NOT_FOUND'] = 'The email that you entered cannot be found in the database';
-$MESSAGE['FORGOT_PASS']['CANNOT_EMAIL'] = 'Unable to email password, please contact system administrator';
-$MESSAGE['FORGOT_PASS']['PASSWORD_RESET'] = 'Your username and password have been sent to your email address';
-$MESSAGE['FORGOT_PASS']['ALREADY_RESET'] = 'Password cannot be reset more than once per hour, sorry';
-
-$MESSAGE['START']['WELCOME_MESSAGE'] = 'Welcome to Website Baker Administration';
-$MESSAGE['START']['INSTALL_DIR_EXISTS'] = 'Warning, Installation Directory Still Exists!';
-$MESSAGE['START']['CURRENT_USER'] = 'You are currently logged in as:';
-
-$MESSAGE['SETTINGS']['UNABLE_OPEN_CONFIG'] = 'Unable to open the configuration file';
-$MESSAGE['SETTINGS']['UNABLE_WRITE_CONFIG'] = 'Cannot write to configuration file';
-$MESSAGE['SETTINGS']['SAVED'] = 'Settings saved successfully';
-$MESSAGE['SETTINGS']['MODE_SWITCH_WARNING'] = 'Please Note: Pressing this button resets all unsaved changes';
-$MESSAGE['SETTINGS']['WORLD_WRITEABLE_WARNING'] = 'Please note: this is only recommended for testing environments';
-
-$MESSAGE['USERS']['ADDED'] = 'User added successfully';
-$MESSAGE['USERS']['SAVED'] = 'User saved successfully';
-$MESSAGE['USERS']['DELETED'] = 'User deleted successfully';
-$MESSAGE['USERS']['NO_GROUP'] = 'No group was selected';
-$MESSAGE['USERS']['USERNAME_TOO_SHORT'] = 'The username you entered was too short';
-$MESSAGE['USERS']['PASSWORD_TOO_SHORT'] = 'The password you entered was too short';
-$MESSAGE['USERS']['PASSWORD_MISMATCH'] = 'The passwords you entered do not match';
-$MESSAGE['USERS']['INVALID_EMAIL'] = 'The email address you entered is invalid';
-$MESSAGE['USERS']['EMAIL_TAKEN'] = 'The email you entered is already in use';
-$MESSAGE['USERS']['USERNAME_TAKEN'] = 'The username you entered is already taken';
-$MESSAGE['USERS']['CHANGING_PASSWORD'] = 'Please note: You should only enter values in the above fields if you wish to change this users password';
-$MESSAGE['USERS']['CONFIRM_DELETE'] = 'Are you sure you want to delete the selected user?';
-
-$MESSAGE['GROUPS']['ADDED'] = 'Group added successfully';
-$MESSAGE['GROUPS']['SAVED'] = 'Group saved successfully';
-$MESSAGE['GROUPS']['DELETED'] = 'Group deleted successfully';
-$MESSAGE['GROUPS']['GROUP_NAME_BLANK'] = 'Group name is blank';
-$MESSAGE['GROUPS']['CONFIRM_DELETE'] = 'Are you sure you want to delete the selected group (and any users that belong to it)?';
-$MESSAGE['GROUPS']['NO_GROUPS_FOUND'] = 'No groups found';
-$MESSAGE['GROUPS']['GROUP_NAME_EXISTS'] = 'Group name already exists';
-
-$MESSAGE['PREFERENCES']['DETAILS_SAVED'] = 'Details saved successfully';
-$MESSAGE['PREFERENCES']['EMAIL_UPDATED'] = 'Email updated successfully';
-$MESSAGE['PREFERENCES']['CURRENT_PASSWORD_INCORRECT'] = 'The (current) password you entered is incorrect';
-$MESSAGE['PREFERENCES']['PASSWORD_CHANGED'] = 'Password changed successfully';
-
-$MESSAGE['TEMPLATES']['CHANGE_TEMPLATE_NOTICE'] = 'Please note: to change the template you must go to the Settings section';
-
-$MESSAGE['MEDIA']['DIR_DOT_DOT_SLASH'] = 'Cannot include ../ in the folder name';
-$MESSAGE['MEDIA']['DIR_DOES_NOT_EXIST'] = 'Directory does not exist';
-$MESSAGE['MEDIA']['TARGET_DOT_DOT_SLASH'] = 'Cannot have ../ in the folder target';
-$MESSAGE['MEDIA']['NAME_DOT_DOT_SLASH'] = 'Cannot include ../ in the name';
-$MESSAGE['MEDIA']['NAME_INDEX_PHP'] = 'Cannot use index.php as the name';
-$MESSAGE['MEDIA']['NONE_FOUND'] = 'No media found in the current folder';
-$MESSAGE['MEDIA']['FILE_NOT_FOUND'] = 'File not found';
-$MESSAGE['MEDIA']['DELETED_FILE'] = 'File deleted successfully';
-$MESSAGE['MEDIA']['DELETED_DIR'] = 'Folder deleted successfully';
-$MESSAGE['MEDIA']['CONFIRM_DELETE'] = 'Are you sure you want to delete the following file or folder?';
-$MESSAGE['MEDIA']['CANNOT_DELETE_FILE'] = 'Cannot delete the selected file';
-$MESSAGE['MEDIA']['CANNOT_DELETE_DIR'] = 'Cannot delete the selected folder';
-$MESSAGE['MEDIA']['BLANK_NAME'] = 'You did not enter a new name';
-$MESSAGE['MEDIA']['BLANK_EXTENSION'] = 'You did not enter a file extension';
-$MESSAGE['MEDIA']['RENAMED'] = 'Rename successful';
-$MESSAGE['MEDIA']['CANNOT_RENAME'] = 'Rename unsuccessful';
-$MESSAGE['MEDIA']['FILE_EXISTS'] = 'A file matching the name you entered already exists';
-$MESSAGE['MEDIA']['DIR_EXISTS'] = 'A folder matching the name you entered already exists';
-$MESSAGE['MEDIA']['DIR_MADE'] = 'Folder created successfully';
-$MESSAGE['MEDIA']['DIR_NOT_MADE'] = 'Unable to create folder';
-$MESSAGE['MEDIA']['SINGLE_UPLOADED'] = ' file was successfully uploaded';
-$MESSAGE['MEDIA']['UPLOADED'] = ' files were successfully uploaded';
-
-$MESSAGE['PAGES']['ADDED'] = 'Page added successfully';
-$MESSAGE['PAGES']['ADDED_HEADING'] = 'Page heading added successfully';
-$MESSAGE['PAGES']['PAGE_EXISTS'] = 'A page with the same or similar title exists';
-$MESSAGE['PAGES']['CANNOT_CREATE_ACCESS_FILE'] = 'Error creating access file in the /pages directory (insufficient privileges)';
-$MESSAGE['PAGES']['CANNOT_DELETE_ACCESS_FILE'] = 'Error deleting access file in the /pages directory (insufficient privileges)';
-$MESSAGE['PAGES']['NOT_FOUND'] = 'Page not found';
-$MESSAGE['PAGES']['SAVED'] = 'Page saved successfully';
-$MESSAGE['PAGES']['SAVED_SETTINGS'] = 'Page settings saved successfully';
-$MESSAGE['PAGES']['NOT_SAVED'] = 'Error saving page';
-$MESSAGE['PAGES']['DELETE_CONFIRM'] = 'Are you sure you want to delete the selected page (and all of its sub-pages)';
-$MESSAGE['PAGES']['DELETED'] = 'Page deleted successfully';
-$MESSAGE['PAGES']['RESTORED'] = 'Page restored successfully';
-$MESSAGE['PAGES']['BLANK_PAGE_TITLE'] = 'Please enter a page title';
-$MESSAGE['PAGES']['BLANK_MENU_TITLE'] = 'Please enter a menu title';
-$MESSAGE['PAGES']['REORDERED'] = 'Page re-ordered successfully';
-$MESSAGE['PAGES']['CANNOT_REORDER'] = 'Error re-ordering page';
-$MESSAGE['PAGES']['INSUFFICIENT_PERMISSIONS'] = 'You do not have permissions to modify this page';
-$MESSAGE['PAGES']['INTRO_NOT_WRITABLE'] = 'Cannot write to file /pages/intro.php (insufficient privileges)';
-$MESSAGE['PAGES']['INTRO_SAVED'] = 'Intro page saved successfully';
-$MESSAGE['PAGES']['LAST_MODIFIED'] = 'Last modification by';
-$MESSAGE['PAGES']['INTRO_LINK'] = 'Click HERE to modify the intro page';
-$MESSAGE['PAGES']['SECTIONS_PROPERTIES_SAVED'] = 'Section properties saved successfully';
-$MESSAGE['PAGES']['RETURN_TO_PAGES'] = 'Return to pages';
-
-$MESSAGE['GENERIC']['FILL_IN_ALL'] = 'Please go back and fill-in all fields';
-$MESSAGE['GENERIC']['FILE_TYPE'] = 'Please note that the file you upload must be of the following format:';
-$MESSAGE['GENERIC']['FILE_TYPES'] = 'Please note that the file you upload must be in one of the following formats:';
-$MESSAGE['GENERIC']['CANNOT_UPLOAD'] = 'Cannot upload file';
-$MESSAGE['GENERIC']['ALREADY_INSTALLED'] = 'Already installed';
-$MESSAGE['GENERIC']['NOT_INSTALLED'] = 'Not installed';
-$MESSAGE['GENERIC']['CANNOT_UNINSTALL'] = 'Cannot uninstall';
-$MESSAGE['GENERIC']['CANNOT_UNZIP'] = 'Cannot unzip file';
-$MESSAGE['GENERIC']['INSTALLED'] = 'Installed successfully';
-$MESSAGE['GENERIC']['UPGRADED'] = 'Upgraded successfully';
-$MESSAGE['GENERIC']['UNINSTALLED'] = 'Uninstalled successfully';
-$MESSAGE['GENERIC']['BAD_PERMISSIONS'] = 'Unable to write to the target directory';
-$MESSAGE['GENERIC']['INVALID'] = 'The file you uploaded is invalid';
-$MESSAGE['GENERIC']['CANNOT_UNINSTALL_IN_USE'] = 'Cannot Uninstall: the selected file is in use';
-$MESSAGE['GENERIC']['WEBSITE_UNDER_CONSTRUCTION'] = 'Website Under Construction';
-$MESSAGE['GENERIC']['PLEASE_CHECK_BACK_SOON'] = 'Please check back soon...';
-$MESSAGE['GENERIC']['PLEASE_BE_PATIENT'] = 'Please be patient, this might take a while.';
-$MESSAGE['GENERIC']['ERROR_OPENING_FILE'] = 'Error opening file.';
-
-$MESSAGE['MOD_FORM']['REQUIRED_FIELDS'] = 'You must enter details for the following fields';
-$MESSAGE['MOD_FORM']['EXCESS_SUBMISSIONS'] = 'Sorry, this form has been submitted too many times so far this hour. Please retry in the next hour.';
-$MESSAGE['MOD_FORM']['INCORRECT_CAPTCHA'] = 'The verification number (also known as Captcha) that you entered is incorrect. If you are having problems reading the Captcha, please email: '.SERVER_EMAIL;
-
-$MESSAGE['MOD_RELOAD']['PLEASE_SELECT'] = 'Please selected which add-ons you would like to have reloaded';
-$MESSAGE['MOD_RELOAD']['MODULES_RELOADED'] = 'Modules reloaded successfully';
-$MESSAGE['MOD_RELOAD']['TEMPLATES_RELOADED'] = 'Templates reloaded successfully';
-$MESSAGE['MOD_RELOAD']['LANGUAGES_RELOADED'] = 'Languages reloaded successfully';
-
-?>
+<?php
+
+// $Id$
+
+/*
+
+ Website Baker Project <http://www.websitebaker.org/>
+ Copyright (C) 2004-2008, Ryan Djurovich
+
+ Website Baker is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ Website Baker is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Website Baker; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+*/
+
+// Define that this file is loaded
+if(!defined('LANGUAGE_LOADED')) {
+	define('LANGUAGE_LOADED', true);
+}
+
+// Set the language information
+$language_code = 'EN';
+$language_name = 'English';
+$language_version = '2.7';
+$language_platform = '2.7.x';
+$language_author = 'Ryan Djurovich, Christian Sommer';
+$language_license = 'GNU General Public License';
+
+// Menu titles
+$MENU['START'] = 'Start';
+$MENU['PAGES'] = 'Pages';
+$MENU['MEDIA'] = 'Media';
+$MENU['ADDONS'] = 'Add-ons';
+$MENU['MODULES'] = 'Modules';
+$MENU['TEMPLATES'] = 'Templates';
+$MENU['LANGUAGES'] = 'Languages';
+$MENU['PREFERENCES'] = 'Preferences';
+$MENU['SETTINGS'] = 'Settings';
+$MENU['ADMINTOOLS'] = 'Admin-Tools';
+$MENU['ACCESS'] = 'Access';
+$MENU['USERS'] = 'Users';
+$MENU['GROUPS'] = 'Groups';
+$MENU['HELP'] = 'Help';
+$MENU['VIEW'] = 'View';
+$MENU['LOGOUT'] = 'Log-out';
+$MENU['LOGIN'] = 'Login';
+$MENU['FORGOT'] = 'Retrieve Login Details';
+
+// Section overviews
+$OVERVIEW['START'] = 'Administration overview';
+$OVERVIEW['PAGES'] = 'Manage your websites pages...';
+$OVERVIEW['MEDIA'] = 'Manage files stored in the media folder...';
+$OVERVIEW['MODULES'] = 'Manage Website Baker modules...';
+$OVERVIEW['TEMPLATES'] = 'Change the look and feel of your website with templates...';
+$OVERVIEW['LANGUAGES'] = 'Manage Website Baker languages...';
+$OVERVIEW['PREFERENCES'] = 'Change preferences such as email address, password, etc... ';
+$OVERVIEW['SETTINGS'] = 'Changes settings for Website Baker...';
+$OVERVIEW['USERS'] = 'Manage users who can log-in to Website Baker...';
+$OVERVIEW['GROUPS'] = 'Manage user groups and their system permissions...';
+$OVERVIEW['HELP'] = 'Got a questions? Find your answer...';
+$OVERVIEW['VIEW'] = 'Quickly view and browse your website in a new window...';
+
+// Headings
+$HEADING['MODIFY_DELETE_PAGE'] = 'Modify/Delete Page';
+$HEADING['DELETED_PAGES'] = 'Deleted Pages';
+$HEADING['ADD_PAGE'] = 'Add Page';
+$HEADING['ADD_HEADING'] = 'Add Heading';
+$HEADING['MODIFY_PAGE'] = 'Modify Page';
+$HEADING['MODIFY_PAGE_SETTINGS'] = 'Modify Page Settings';
+$HEADING['MODIFY_ADVANCED_PAGE_SETTINGS'] = 'Modify Advanced Page Settings';
+$HEADING['MANAGE_SECTIONS'] = 'Manage Sections';
+$HEADING['MODIFY_INTRO_PAGE'] = 'Modify Intro Page';
+
+$HEADING['BROWSE_MEDIA'] = 'Browse Media';
+$HEADING['CREATE_FOLDER'] = 'Create Folder';
+$HEADING['UPLOAD_FILES'] = 'Upload File(s)';
+
+$HEADING['INSTALL_MODULE'] = 'Install Module';
+$HEADING['UNINSTALL_MODULE'] = 'Uninstall Module';
+$HEADING['MODULE_DETAILS'] = 'Module Details';
+
+$HEADING['INSTALL_TEMPLATE'] = 'Install Template';
+$HEADING['UNINSTALL_TEMPLATE'] = 'Uninstall Template';
+$HEADING['TEMPLATE_DETAILS'] = 'Template Details';
+
+$HEADING['INSTALL_LANGUAGE'] = 'Install Language';
+$HEADING['UNINSTALL_LANGUAGE'] = 'Uninstall Language';
+$HEADING['LANGUAGE_DETAILS'] = 'Language Details';
+
+$HEADING['MY_SETTINGS'] = 'My Settings';
+$HEADING['MY_EMAIL'] = 'My Email';
+$HEADING['MY_PASSWORD'] = 'My Password';
+
+$HEADING['GENERAL_SETTINGS'] = 'General Settings';
+$HEADING['DEFAULT_SETTINGS'] = 'Default Settings';
+$HEADING['SEARCH_SETTINGS'] = 'Search Settings';
+$HEADING['FILESYSTEM_SETTINGS'] = 'Filesystem Settings';
+$HEADING['SERVER_SETTINGS'] = 'Server Settings';
+$HEADING['WBMAILER_SETTINGS'] = 'Mailer Settings';
+$HEADING['ADMINISTRATION_TOOLS'] = 'Administration Tools';
+
+$HEADING['MODIFY_DELETE_USER'] = 'Modify/Delete User';
+$HEADING['ADD_USER'] = 'Add User';
+$HEADING['MODIFY_USER'] = 'Modify User';
+
+$HEADING['MODIFY_DELETE_GROUP'] = 'Modify/Delete Group';
+$HEADING['ADD_GROUP'] = 'Add Group';
+$HEADING['MODIFY_GROUP'] = 'Modify Group';
+
+// Other text
+$TEXT['ADD'] = 'Add';
+$TEXT['MODIFY'] = 'Modify';
+$TEXT['SETTINGS'] = 'Settings';
+$TEXT['DELETE'] = 'Delete';
+$TEXT['SAVE'] = 'Save';
+$TEXT['RESET'] = 'Reset';
+$TEXT['LOGIN'] = 'Login';
+$TEXT['RELOAD'] = 'Reload';
+$TEXT['CANCEL'] = 'Cancel';
+$TEXT['NAME'] = 'Name';
+$TEXT['PLEASE_SELECT'] = 'Please select';
+$TEXT['TITLE'] = 'Title';
+$TEXT['PARENT'] = 'Parent';
+$TEXT['TYPE'] = 'Type';
+$TEXT['VISIBILITY'] = 'Visibility';
+$TEXT['PRIVATE'] = 'Private';
+$TEXT['PUBLIC'] = 'Public';
+$TEXT['NONE'] = 'None';
+$TEXT['NONE_FOUND'] = 'None Found';
+$TEXT['CURRENT'] = 'Current';
+$TEXT['CHANGE'] = 'Change';
+$TEXT['WINDOW'] = 'Window';
+$TEXT['DESCRIPTION'] = 'Description';
+$TEXT['KEYWORDS'] = 'Keywords';
+$TEXT['ADMINISTRATORS'] = 'Administrators';
+$TEXT['PRIVATE_VIEWERS'] = 'Private Viewers';
+$TEXT['EXPAND'] = 'Expand';
+$TEXT['COLLAPSE'] = 'Collapse';
+$TEXT['MOVE_UP'] = 'Move Up';
+$TEXT['MOVE_DOWN'] = 'Move Down';
+$TEXT['RENAME'] = 'Rename';
+$TEXT['MODIFY_SETTINGS'] = 'Modify Settings';
+$TEXT['MODIFY_CONTENT'] = 'Modify Content';
+$TEXT['VIEW'] = 'View';
+$TEXT['UP'] = 'Up';
+$TEXT['FORGOTTEN_DETAILS'] = 'Forgotten your details?';
+$TEXT['NEED_TO_LOGIN'] = 'Need to log-in?';
+$TEXT['SEND_DETAILS'] = 'Send Details';
+$TEXT['USERNAME'] = 'Username';
+$TEXT['PASSWORD'] = 'Password';
+$TEXT['HOME'] = 'Home';
+$TEXT['TARGET_FOLDER'] = 'Target folder';
+$TEXT['OVERWRITE_EXISTING'] = 'Overwrite existing';
+$TEXT['FILE'] = 'File';
+$TEXT['FILES'] = 'Files';
+$TEXT['FOLDER'] = 'Folder';
+$TEXT['FOLDERS'] = 'Folders';
+$TEXT['CREATE_FOLDER'] = 'Create Folder';
+$TEXT['UPLOAD_FILES'] = 'Upload File(s)';
+$TEXT['CURRENT_FOLDER'] = 'Current Folder';
+$TEXT['TO'] = 'To';
+$TEXT['FROM'] = 'From';
+$TEXT['INSTALL'] = 'Install';
+$TEXT['UNINSTALL'] = 'Uninstall';
+$TEXT['VIEW_DETAILS'] = 'View Details';
+$TEXT['DISPLAY_NAME'] = 'Display Name';
+$TEXT['AUTHOR'] = 'Author';
+$TEXT['VERSION'] = 'Version';
+$TEXT['DESIGNED_FOR'] = 'Designed For';
+$TEXT['DESCRIPTION'] = 'Description';
+$TEXT['EMAIL'] = 'Email';
+$TEXT['LANGUAGE'] = 'Language';
+$TEXT['TIMEZONE'] = 'Timezone';
+$TEXT['CURRENT_PASSWORD'] = 'Current Password';
+$TEXT['NEW_PASSWORD'] = 'New Password';
+$TEXT['RETYPE_NEW_PASSWORD'] = 'Re-type New Password';
+$TEXT['ACTIVE'] = 'Active';
+$TEXT['DISABLED'] = 'Disabled';
+$TEXT['ENABLED'] = 'Enabled';
+$TEXT['RETYPE_PASSWORD'] = 'Re-type Password';
+$TEXT['GROUP'] = 'Group';
+$TEXT['SYSTEM_PERMISSIONS'] = 'System Permissions';
+$TEXT['MODULE_PERMISSIONS'] = 'Module Permissions';
+$TEXT['SHOW_ADVANCED'] = 'Show Advanced Options';
+$TEXT['HIDE_ADVANCED'] = 'Hide Advanced Options';
+$TEXT['BASIC'] = 'Basic';
+$TEXT['ADVANCED'] = 'Advanced';
+$TEXT['WEBSITE'] = 'Website';
+$TEXT['DEFAULT'] = 'Default';
+$TEXT['KEYWORDS'] = 'Keywords';
+$TEXT['TEXT'] = 'Text';
+$TEXT['HEADER'] = 'Header';
+$TEXT['FOOTER'] = 'Footer';
+$TEXT['TEMPLATE'] = 'Template';
+$TEXT['INSTALLATION'] = 'Installation';
+$TEXT['DATABASE'] = 'Database';
+$TEXT['HOST'] = 'Host';
+$TEXT['INTRO'] = 'Intro';
+$TEXT['PAGE'] = 'Page';
+$TEXT['SIGNUP'] = 'Sign-up';
+$TEXT['PHP_ERROR_LEVEL'] = 'PHP Error Reporting Level';
+$TEXT['ADMIN'] = 'Admin';
+$TEXT['PATH'] = 'Path';
+$TEXT['URL'] = 'URL';
+$TEXT['FRONTEND'] = 'Front-end';
+$TEXT['EXTENSION'] = 'Extension';
+$TEXT['TABLE_PREFIX'] = 'Table Prefix';
+$TEXT['CHANGES'] = 'Changes';
+$TEXT['ADMINISTRATION'] = 'Administration';
+$TEXT['FORGOT_DETAILS'] = 'Forgot Details?';
+$TEXT['LOGGED_IN'] = 'Logged-In';
+$TEXT['WELCOME_BACK'] = 'Welcome back';
+$TEXT['FULL_NAME'] = 'Full Name';
+$TEXT['ACCOUNT_SIGNUP'] = 'Account Sign-Up';
+$TEXT['LINK'] = 'Link';
+$TEXT['TARGET'] = 'Target';
+$TEXT['NEW_WINDOW'] = 'New Window';
+$TEXT['SAME_WINDOW'] = 'Same Window';
+$TEXT['TOP_FRAME'] = 'Top Frame';
+$TEXT['PAGE_LEVEL_LIMIT'] = 'Page Level Limit';
+$TEXT['SUCCESS'] = 'Success';
+$TEXT['ERROR'] = 'Error';
+$TEXT['ARE_YOU_SURE'] = 'Are you sure?';
+$TEXT['YES'] = 'Yes';
+$TEXT['NO'] = 'No';
+$TEXT['SYSTEM_DEFAULT'] = 'System Default';
+$TEXT['PAGE_TITLE'] = 'Page Title';
+$TEXT['MENU_TITLE'] = 'Menu Title';
+$TEXT['ACTIONS'] = 'Actions';
+$TEXT['UNKNOWN'] = 'Unknown';
+$TEXT['BLOCK'] = 'Block';
+$TEXT['SEARCH'] = 'Search';
+$TEXT['SEARCHING'] = 'Searching';
+$TEXT['POST'] = 'Post';
+$TEXT['COMMENT'] = 'Comment';
+$TEXT['COMMENTS'] = 'Comments';
+$TEXT['COMMENTING'] = 'Commenting';
+$TEXT['SHORT'] = 'Short';
+$TEXT['LONG'] = 'Long';
+$TEXT['LOOP'] = 'Loop';
+$TEXT['FIELD'] = 'Field';
+$TEXT['REQUIRED'] = 'Required';
+$TEXT['LENGTH'] = 'Length';
+$TEXT['MESSAGE'] = 'Message';
+$TEXT['SUBJECT'] = 'Subject';
+$TEXT['MATCH'] = 'Match';
+$TEXT['ALL_WORDS'] = 'All Words';
+$TEXT['ANY_WORDS'] = 'Any Words';
+$TEXT['EXACT_MATCH'] = 'Exact Match';
+$TEXT['SHOW'] = 'Show';
+$TEXT['HIDE'] = 'Hide';
+$TEXT['START_PUBLISHING'] = 'Start Publishing';
+$TEXT['FINISH_PUBLISHING'] = 'Finish Publishing';
+$TEXT['DATE'] = 'Date';
+$TEXT['START'] = 'Start';
+$TEXT['END'] = 'End';
+$TEXT['IMAGE'] = 'Image';
+$TEXT['ICON'] = 'Icon';
+$TEXT['SECTION'] = 'Section';
+$TEXT['DATE_FORMAT'] = 'Date Format';
+$TEXT['TIME_FORMAT'] = 'Time Format';
+$TEXT['RESULTS'] = 'Results';
+$TEXT['RESIZE'] = 'Re-size';
+$TEXT['MANAGE'] = 'Manage';
+$TEXT['CODE'] = 'Code';
+$TEXT['WIDTH'] = 'Width';
+$TEXT['HEIGHT'] = 'Height';
+$TEXT['MORE'] = 'More';
+$TEXT['READ_MORE'] = 'Read More';
+$TEXT['CHANGE_SETTINGS'] = 'Change Settings';
+$TEXT['CURRENT_PAGE'] = 'Current Page';
+$TEXT['CLOSE'] = 'Close';
+$TEXT['INTRO_PAGE'] = 'Intro Page';
+$TEXT['INSTALLATION_URL'] = 'Installation URL';
+$TEXT['INSTALLATION_PATH'] = 'Installation Path';
+$TEXT['PAGE_EXTENSION'] = 'Page Extension';
+$TEXT['NO_RESULTS'] = 'No Results';
+$TEXT['WEBSITE_TITLE'] = 'Website Title';
+$TEXT['WEBSITE_DESCRIPTION'] = 'Website Description';
+$TEXT['WEBSITE_KEYWORDS'] = 'Website Keywords';
+$TEXT['WEBSITE_HEADER'] = 'Website Header';
+$TEXT['WEBSITE_FOOTER'] = 'Website Footer';
+$TEXT['RESULTS_HEADER'] = 'Results Header';
+$TEXT['RESULTS_LOOP'] = 'Results Loop';
+$TEXT['RESULTS_FOOTER'] = 'Results Footer';
+$TEXT['LEVEL'] = 'Level';
+$TEXT['NOT_FOUND'] = 'Not Found';
+$TEXT['PAGE_SPACER'] = 'Page Spacer';
+$TEXT['MATCHING'] = 'Matching';
+$TEXT['TEMPLATE_PERMISSIONS'] = 'Template Permissions';
+$TEXT['PAGES_DIRECTORY'] = 'Pages Directory';
+$TEXT['MEDIA_DIRECTORY'] = 'Media Directory';
+$TEXT['FILE_MODE'] = 'File Mode';
+$TEXT['USER'] = 'User';
+$TEXT['OTHERS'] = 'Others';
+$TEXT['READ'] = 'Read';
+$TEXT['WRITE'] = 'Write';
+$TEXT['EXECUTE'] = 'Execute';
+$TEXT['SMART_LOGIN'] = 'Smart Login';
+$TEXT['REMEMBER_ME'] = 'Remember Me';
+$TEXT['FILESYSTEM_PERMISSIONS'] = 'Filesystem Permissions';
+$TEXT['DIRECTORIES'] = 'Directories';
+$TEXT['DIRECTORY_MODE'] = 'Directory Mode';
+$TEXT['LIST_OPTIONS'] = 'List Options';
+$TEXT['OPTION'] = 'Option';
+$TEXT['ALLOW_MULTIPLE_SELECTIONS'] = 'Allow Multiple Selections';
+$TEXT['TEXTFIELD'] = 'Textfield';
+$TEXT['TEXTAREA'] = 'Textarea';
+$TEXT['SELECT_BOX'] = 'Select Box';
+$TEXT['CHECKBOX_GROUP'] = 'Checkbox Group';
+$TEXT['RADIO_BUTTON_GROUP'] = 'Radio Button Group';
+$TEXT['SIZE'] = 'Size';
+$TEXT['DEFAULT_TEXT'] = 'Default Text';
+$TEXT['SEPERATOR'] = 'Separator';
+$TEXT['BACK'] = 'Back';
+$TEXT['UNDER_CONSTRUCTION'] = 'Under Construction';
+$TEXT['MULTISELECT'] = 'Multi-select';
+$TEXT['SHORT_TEXT'] = 'Short Text';
+$TEXT['LONG_TEXT'] = 'Long Text';
+$TEXT['HOMEPAGE_REDIRECTION'] = 'Homepage Redirection';
+$TEXT['HEADING'] = 'Heading';
+$TEXT['MULTIPLE_MENUS'] = 'Multiple Menus';
+$TEXT['REGISTERED'] = 'Registered';
+$TEXT['START'] = 'Start';
+$TEXT['SECTION_BLOCKS'] = 'Section Blocks';
+$TEXT['REGISTERED_VIEWERS'] = 'Registered Viewers';
+$TEXT['ALLOWED_VIEWERS'] = 'Allowed Viewers';
+$TEXT['SUBMISSION_ID'] = 'Submission ID';
+$TEXT['SUBMISSIONS'] = 'Submissions';
+$TEXT['SUBMITTED'] = 'Submitted';
+$TEXT['MAX_SUBMISSIONS_PER_HOUR'] = 'Max. Submissions Per Hour';
+$TEXT['SUBMISSIONS_STORED_IN_DATABASE'] = 'Submissions Stored In Database';
+$TEXT['EMAIL_ADDRESS'] = 'Email Address';
+$TEXT['CUSTOM'] = 'Custom';
+$TEXT['ANONYMOUS'] = 'Anonymous';
+$TEXT['SERVER_OPERATING_SYSTEM'] = 'Server Operating System';
+$TEXT['WORLD_WRITEABLE_FILE_PERMISSIONS'] = 'World-writeable file permissions';
+$TEXT['LINUX_UNIX_BASED'] = 'Linux/Unix based';
+$TEXT['WINDOWS'] = 'Windows';
+$TEXT['HOME_FOLDER'] = 'Home Folder';
+$TEXT['HOME_FOLDERS'] = 'Home Folders';
+$TEXT['PAGE_TRASH'] = 'Page Trash';
+$TEXT['INLINE'] = 'In-line';
+$TEXT['SEPARATE'] = 'Separate';
+$TEXT['DELETED'] = 'Deleted';
+$TEXT['VIEW_DELETED_PAGES'] = 'View Deleted Pages';
+$TEXT['EMPTY_TRASH'] = 'Empty Trash';
+$TEXT['TRASH_EMPTIED'] = 'Trash Emptied';
+$TEXT['ADD_SECTION'] = 'Add Section';
+$TEXT['POST_HEADER'] = 'Post Header';
+$TEXT['POST_FOOTER'] = 'Post Footer';
+$TEXT['POSTS_PER_PAGE'] = 'Posts Per Page';
+$TEXT['RESIZE_IMAGE_TO'] = 'Resize Image To';
+$TEXT['UNLIMITED'] = 'Unlimited';
+$TEXT['OF'] = 'Of';
+$TEXT['OUT_OF'] = 'Out Of';
+$TEXT['NEXT'] = 'Next';
+$TEXT['PREVIOUS'] = 'Previous';
+$TEXT['NEXT_PAGE'] = 'Next Page';
+$TEXT['PREVIOUS_PAGE'] = 'Previous Page';
+$TEXT['ON'] = 'On';
+$TEXT['LAST_UPDATED_BY'] = 'Last Updated By';
+$TEXT['RESULTS_FOR'] = 'Results For';
+$TEXT['TIME'] = 'Time';
+$TEXT['WYSIWYG_STYLE'] = 'WYSIWYG Style';
+$TEXT['WYSIWYG_EDITOR'] = "WYSIWYG Editor";
+$TEXT['SERVER_EMAIL'] = 'Server Email';
+$TEXT['MENU'] = 'Menu';
+$TEXT['MANAGE_GROUPS'] = 'Manage Groups';
+$TEXT['MANAGE_USERS'] = 'Manage Users';
+$TEXT['PAGE_LANGUAGES'] = 'Page Languages';
+$TEXT['HIDDEN'] = 'Hidden';
+$TEXT['MAIN'] = 'Main';
+$TEXT['RENAME_FILES_ON_UPLOAD'] = 'Rename Files On Upload';
+$TEXT['APP_NAME'] = 'Application Name';
+$TEXT['SESSION_IDENTIFIER'] = 'Session Identifier';
+$TEXT['BACKUP'] = 'Backup';
+$TEXT['RESTORE'] = 'Restore';
+$TEXT['BACKUP_DATABASE'] = 'Backup Database';
+$TEXT['RESTORE_DATABASE'] = 'Restore Database';
+$TEXT['BACKUP_ALL_TABLES'] = 'Backup all tables in database';
+$TEXT['BACKUP_WB_SPECIFIC'] = 'Backup only WB-specific tables';
+$TEXT['BACKUP_MEDIA'] = 'Backup Media';
+$TEXT['RESTORE_MEDIA'] = 'Restore Media';
+$TEXT['ADMINISTRATION_TOOL'] = 'Administration tool';
+$TEXT['CAPTCHA_VERIFICATION'] = 'Captcha Verification';
+$TEXT['VERIFICATION'] = 'Verification';
+$TEXT['DEFAULT_CHARSET'] = 'Default Charset';
+$TEXT['CHARSET'] = 'Charset';
+$TEXT['MODULE_ORDER'] = 'Module-order for searching';
+$TEXT['MAX_EXCERPT'] = 'Max lines of excerpt';
+$TEXT['PUBL_START_DATE'] = 'Start date';
+$TEXT['PUBL_END_DATE'] = 'End date';
+$TEXT['WBMAILER_NOTICE'] = 'Some service providers do not support sending mail via PHP. If your provider requires you to use SMTP for sending mail, you must know the SMTP host address. If you are not sure about these settings, or you do not know the SMTP host of your domain, use the default "PHP mail()" setting. You can change the settings	later if needed.';
+$TEXT['WBMAILER_FUNCTION'] = 'Mail routine';
+$TEXT['WBMAILER_SMTP_HOST'] = 'SMTP host';
+$TEXT['WBMAILER_PHP'] = 'PHP MAIL';
+$TEXT['WBMAILER_SMTP'] = 'SMTP';
+$TEXT['WBMAILER_SMTP_AUTH'] = 'SMTP authentification';
+$TEXT['WBMAILER_SMTP_AUTH_NOTICE'] = 'only activate if your SMTP host requires authentification';
+$TEXT['WBMAILER_SMTP_USERNAME'] = 'SMTP username';
+$TEXT['WBMAILER_SMTP_PASSWORD'] = 'SMTP password';
+$TEXT['PLEASE_LOGIN'] = 'Please login';
+
+// Success/error messages
+$MESSAGE['FRONTEND']['SORRY_NO_VIEWING_PERMISSIONS'] = 'Sorry, you do not have permissions to view this page';
+$MESSAGE['FRONTEND']['SORRY_NO_ACTIVE_SECTIONS'] = 'Sorry, no active content to display';
+
+$MESSAGE['ADMIN']['INSUFFICIENT_PRIVELLIGES'] = 'Insufficient privelliges to be here';
+
+$MESSAGE['LOGIN']['BOTH_BLANK'] = 'Please enter your username and password below';
+$MESSAGE['LOGIN']['USERNAME_BLANK'] = 'Please enter a username';
+$MESSAGE['LOGIN']['PASSWORD_BLANK'] = 'Please enter a password';
+$MESSAGE['LOGIN']['USERNAME_TOO_SHORT'] = 'Supplied username to short';
+$MESSAGE['LOGIN']['PASSWORD_TOO_SHORT'] = 'Supplied password to short';
+$MESSAGE['LOGIN']['USERNAME_TOO_LONG'] = 'Supplied username to long';
+$MESSAGE['LOGIN']['PASSWORD_TOO_LONG'] = 'Supplied password to long';
+$MESSAGE['LOGIN']['AUTHENTICATION_FAILED'] = 'Username or password incorrect';
+
+$MESSAGE['SIGNUP']['NO_EMAIL'] = 'You must enter an email address';
+
+$MESSAGE['FORGOT_PASS']['NO_DATA'] = 'Please enter your email address below';
+$MESSAGE['FORGOT_PASS']['EMAIL_NOT_FOUND'] = 'The email that you entered cannot be found in the database';
+$MESSAGE['FORGOT_PASS']['CANNOT_EMAIL'] = 'Unable to email password, please contact system administrator';
+$MESSAGE['FORGOT_PASS']['PASSWORD_RESET'] = 'Your username and password have been sent to your email address';
+$MESSAGE['FORGOT_PASS']['ALREADY_RESET'] = 'Password cannot be reset more than once per hour, sorry';
+
+$MESSAGE['START']['WELCOME_MESSAGE'] = 'Welcome to Website Baker Administration';
+$MESSAGE['START']['INSTALL_DIR_EXISTS'] = 'Warning, Installation Directory Still Exists!';
+$MESSAGE['START']['CURRENT_USER'] = 'You are currently logged in as:';
+
+$MESSAGE['SETTINGS']['UNABLE_OPEN_CONFIG'] = 'Unable to open the configuration file';
+$MESSAGE['SETTINGS']['UNABLE_WRITE_CONFIG'] = 'Cannot write to configuration file';
+$MESSAGE['SETTINGS']['SAVED'] = 'Settings saved successfully';
+$MESSAGE['SETTINGS']['MODE_SWITCH_WARNING'] = 'Please Note: Pressing this button resets all unsaved changes';
+$MESSAGE['SETTINGS']['WORLD_WRITEABLE_WARNING'] = 'Please note: this is only recommended for testing environments';
+
+$MESSAGE['USERS']['ADDED'] = 'User added successfully';
+$MESSAGE['USERS']['SAVED'] = 'User saved successfully';
+$MESSAGE['USERS']['DELETED'] = 'User deleted successfully';
+$MESSAGE['USERS']['NO_GROUP'] = 'No group was selected';
+$MESSAGE['USERS']['USERNAME_TOO_SHORT'] = 'The username you entered was too short';
+$MESSAGE['USERS']['PASSWORD_TOO_SHORT'] = 'The password you entered was too short';
+$MESSAGE['USERS']['PASSWORD_MISMATCH'] = 'The passwords you entered do not match';
+$MESSAGE['USERS']['INVALID_EMAIL'] = 'The email address you entered is invalid';
+$MESSAGE['USERS']['EMAIL_TAKEN'] = 'The email you entered is already in use';
+$MESSAGE['USERS']['USERNAME_TAKEN'] = 'The username you entered is already taken';
+$MESSAGE['USERS']['CHANGING_PASSWORD'] = 'Please note: You should only enter values in the above fields if you wish to change this users password';
+$MESSAGE['USERS']['CONFIRM_DELETE'] = 'Are you sure you want to delete the selected user?';
+
+$MESSAGE['GROUPS']['ADDED'] = 'Group added successfully';
+$MESSAGE['GROUPS']['SAVED'] = 'Group saved successfully';
+$MESSAGE['GROUPS']['DELETED'] = 'Group deleted successfully';
+$MESSAGE['GROUPS']['GROUP_NAME_BLANK'] = 'Group name is blank';
+$MESSAGE['GROUPS']['CONFIRM_DELETE'] = 'Are you sure you want to delete the selected group (and any users that belong to it)?';
+$MESSAGE['GROUPS']['NO_GROUPS_FOUND'] = 'No groups found';
+$MESSAGE['GROUPS']['GROUP_NAME_EXISTS'] = 'Group name already exists';
+
+$MESSAGE['PREFERENCES']['DETAILS_SAVED'] = 'Details saved successfully';
+$MESSAGE['PREFERENCES']['EMAIL_UPDATED'] = 'Email updated successfully';
+$MESSAGE['PREFERENCES']['CURRENT_PASSWORD_INCORRECT'] = 'The (current) password you entered is incorrect';
+$MESSAGE['PREFERENCES']['PASSWORD_CHANGED'] = 'Password changed successfully';
+
+$MESSAGE['TEMPLATES']['CHANGE_TEMPLATE_NOTICE'] = 'Please note: to change the template you must go to the Settings section';
+
+$MESSAGE['MEDIA']['DIR_DOT_DOT_SLASH'] = 'Cannot include ../ in the folder name';
+$MESSAGE['MEDIA']['DIR_DOES_NOT_EXIST'] = 'Directory does not exist';
+$MESSAGE['MEDIA']['TARGET_DOT_DOT_SLASH'] = 'Cannot have ../ in the folder target';
+$MESSAGE['MEDIA']['NAME_DOT_DOT_SLASH'] = 'Cannot include ../ in the name';
+$MESSAGE['MEDIA']['NAME_INDEX_PHP'] = 'Cannot use index.php as the name';
+$MESSAGE['MEDIA']['NONE_FOUND'] = 'No media found in the current folder';
+$MESSAGE['MEDIA']['FILE_NOT_FOUND'] = 'File not found';
+$MESSAGE['MEDIA']['DELETED_FILE'] = 'File deleted successfully';
+$MESSAGE['MEDIA']['DELETED_DIR'] = 'Folder deleted successfully';
+$MESSAGE['MEDIA']['CONFIRM_DELETE'] = 'Are you sure you want to delete the following file or folder?';
+$MESSAGE['MEDIA']['CANNOT_DELETE_FILE'] = 'Cannot delete the selected file';
+$MESSAGE['MEDIA']['CANNOT_DELETE_DIR'] = 'Cannot delete the selected folder';
+$MESSAGE['MEDIA']['BLANK_NAME'] = 'You did not enter a new name';
+$MESSAGE['MEDIA']['BLANK_EXTENSION'] = 'You did not enter a file extension';
+$MESSAGE['MEDIA']['RENAMED'] = 'Rename successful';
+$MESSAGE['MEDIA']['CANNOT_RENAME'] = 'Rename unsuccessful';
+$MESSAGE['MEDIA']['FILE_EXISTS'] = 'A file matching the name you entered already exists';
+$MESSAGE['MEDIA']['DIR_EXISTS'] = 'A folder matching the name you entered already exists';
+$MESSAGE['MEDIA']['DIR_MADE'] = 'Folder created successfully';
+$MESSAGE['MEDIA']['DIR_NOT_MADE'] = 'Unable to create folder';
+$MESSAGE['MEDIA']['SINGLE_UPLOADED'] = ' file was successfully uploaded';
+$MESSAGE['MEDIA']['UPLOADED'] = ' files were successfully uploaded';
+
+$MESSAGE['PAGES']['ADDED'] = 'Page added successfully';
+$MESSAGE['PAGES']['ADDED_HEADING'] = 'Page heading added successfully';
+$MESSAGE['PAGES']['PAGE_EXISTS'] = 'A page with the same or similar title exists';
+$MESSAGE['PAGES']['CANNOT_CREATE_ACCESS_FILE'] = 'Error creating access file in the /pages directory (insufficient privileges)';
+$MESSAGE['PAGES']['CANNOT_DELETE_ACCESS_FILE'] = 'Error deleting access file in the /pages directory (insufficient privileges)';
+$MESSAGE['PAGES']['NOT_FOUND'] = 'Page not found';
+$MESSAGE['PAGES']['SAVED'] = 'Page saved successfully';
+$MESSAGE['PAGES']['SAVED_SETTINGS'] = 'Page settings saved successfully';
+$MESSAGE['PAGES']['NOT_SAVED'] = 'Error saving page';
+$MESSAGE['PAGES']['DELETE_CONFIRM'] = 'Are you sure you want to delete the selected page (and all of its sub-pages)';
+$MESSAGE['PAGES']['DELETED'] = 'Page deleted successfully';
+$MESSAGE['PAGES']['RESTORED'] = 'Page restored successfully';
+$MESSAGE['PAGES']['BLANK_PAGE_TITLE'] = 'Please enter a page title';
+$MESSAGE['PAGES']['BLANK_MENU_TITLE'] = 'Please enter a menu title';
+$MESSAGE['PAGES']['REORDERED'] = 'Page re-ordered successfully';
+$MESSAGE['PAGES']['CANNOT_REORDER'] = 'Error re-ordering page';
+$MESSAGE['PAGES']['INSUFFICIENT_PERMISSIONS'] = 'You do not have permissions to modify this page';
+$MESSAGE['PAGES']['INTRO_NOT_WRITABLE'] = 'Cannot write to file /pages/intro.php (insufficient privileges)';
+$MESSAGE['PAGES']['INTRO_SAVED'] = 'Intro page saved successfully';
+$MESSAGE['PAGES']['LAST_MODIFIED'] = 'Last modification by';
+$MESSAGE['PAGES']['INTRO_LINK'] = 'Click HERE to modify the intro page';
+$MESSAGE['PAGES']['SECTIONS_PROPERTIES_SAVED'] = 'Section properties saved successfully';
+$MESSAGE['PAGES']['RETURN_TO_PAGES'] = 'Return to pages';
+
+$MESSAGE['GENERIC']['FILL_IN_ALL'] = 'Please go back and fill-in all fields';
+$MESSAGE['GENERIC']['FILE_TYPE'] = 'Please note that the file you upload must be of the following format:';
+$MESSAGE['GENERIC']['FILE_TYPES'] = 'Please note that the file you upload must be in one of the following formats:';
+$MESSAGE['GENERIC']['CANNOT_UPLOAD'] = 'Cannot upload file';
+$MESSAGE['GENERIC']['ALREADY_INSTALLED'] = 'Already installed';
+$MESSAGE['GENERIC']['NOT_INSTALLED'] = 'Not installed';
+$MESSAGE['GENERIC']['CANNOT_UNINSTALL'] = 'Cannot uninstall';
+$MESSAGE['GENERIC']['CANNOT_UNZIP'] = 'Cannot unzip file';
+$MESSAGE['GENERIC']['INSTALLED'] = 'Installed successfully';
+$MESSAGE['GENERIC']['UPGRADED'] = 'Upgraded successfully';
+$MESSAGE['GENERIC']['UNINSTALLED'] = 'Uninstalled successfully';
+$MESSAGE['GENERIC']['BAD_PERMISSIONS'] = 'Unable to write to the target directory';
+$MESSAGE['GENERIC']['INVALID'] = 'The file you uploaded is invalid';
+$MESSAGE['GENERIC']['CANNOT_UNINSTALL_IN_USE'] = 'Cannot Uninstall: the selected file is in use';
+$MESSAGE['GENERIC']['WEBSITE_UNDER_CONSTRUCTION'] = 'Website Under Construction';
+$MESSAGE['GENERIC']['PLEASE_CHECK_BACK_SOON'] = 'Please check back soon...';
+$MESSAGE['GENERIC']['PLEASE_BE_PATIENT'] = 'Please be patient, this might take a while.';
+$MESSAGE['GENERIC']['ERROR_OPENING_FILE'] = 'Error opening file.';
+
+$MESSAGE['MOD_FORM']['REQUIRED_FIELDS'] = 'You must enter details for the following fields';
+$MESSAGE['MOD_FORM']['EXCESS_SUBMISSIONS'] = 'Sorry, this form has been submitted too many times so far this hour. Please retry in the next hour.';
+$MESSAGE['MOD_FORM']['INCORRECT_CAPTCHA'] = 'The verification number (also known as Captcha) that you entered is incorrect. If you are having problems reading the Captcha, please email: '.SERVER_EMAIL;
+
+$MESSAGE['MOD_RELOAD']['PLEASE_SELECT'] = 'Please selected which add-ons you would like to have reloaded';
+$MESSAGE['MOD_RELOAD']['MODULES_RELOADED'] = 'Modules reloaded successfully';
+$MESSAGE['MOD_RELOAD']['TEMPLATES_RELOADED'] = 'Templates reloaded successfully';
+$MESSAGE['MOD_RELOAD']['LANGUAGES_RELOADED'] = 'Languages reloaded successfully';
+
+?>
Index: trunk/wb/admin/pages/sections_save.php
===================================================================
--- trunk/wb/admin/pages/sections_save.php	(revision 551)
+++ trunk/wb/admin/pages/sections_save.php	(revision 552)
@@ -85,14 +85,32 @@
 		if(!is_numeric(array_search($section['module'], $module_permissions))) {
 			// Update the section record with properties
 			$section_id = $section['section_id'];
-			$sql = '';
+			$sql = ''; $publ_start = 0; $publ_end = 0;
+			$dst = date("I")?" DST":""; // daylight saving time?
 			if(isset($_POST['block'.$section_id]) AND $_POST['block'.$section_id] != '') {
 				$sql = "block = '".$admin->add_slashes($_POST['block'.$section_id])."'";
-				$query = "UPDATE ".TABLE_PREFIX."sections SET $sql WHERE section_id = '$section_id' LIMIT 1";
-				if($sql != '') {
-					$database->query($query);
+			}
+			// update publ_start and publ_end, trying to make use of the strtotime()-features like "next week", "+1 month", ...
+			if(isset($_POST['start_date'.$section_id]) AND isset($_POST['end_date'.$section_id])) {
+				if(trim($_POST['start_date'.$section_id]) == '0' OR trim($_POST['start_date'.$section_id]) == '') {
+					$publ_start = 0;
+				} else {
+					$publ_start = strtotime($_POST['start_date'.$section_id]);
 				}
+				if(trim($_POST['end_date'.$section_id]) == '0' OR trim($_POST['end_date'.$section_id]) == '') {
+					$publ_end = 0;
+				} else {
+					$publ_end = strtotime($_POST['end_date'.$section_id], $publ_start);
+				}
+				if($sql != '')
+					$sql .= ",";
+				$sql .= " publ_start = '".$publ_start."'";
+				$sql .= ", publ_end = '".$publ_end."'";
 			}
+			$query = "UPDATE ".TABLE_PREFIX."sections SET $sql WHERE section_id = '$section_id' LIMIT 1";
+			if($sql != '') {
+				$database->query($query);
+			}
 		}
 	}
 }
@@ -106,4 +124,4 @@
 // Print admin footer
 $admin->print_footer();
 
-?>
\ No newline at end of file
+?>
Index: trunk/wb/admin/pages/index.php
===================================================================
--- trunk/wb/admin/pages/index.php	(revision 551)
+++ trunk/wb/admin/pages/index.php	(revision 552)
@@ -250,8 +250,33 @@
 					<?php } ?>
 				</td>
 				
-				
+				<!-- 'MANAGE DATES' BUTTON -->
 				<td width="20">
+				<?php
+				// Work-out if we should show the "manage dates" link
+				if(MANAGE_SECTIONS == 'enabled' && $admin->get_permission('pages_modify')==true && $can_modify==true) {
+					$query_sections = $database->query("SELECT publ_start, publ_end FROM ".TABLE_PREFIX."sections WHERE page_id = '{$page['page_id']}' AND module != 'menu_link'");
+					if($query_sections->numRows() > 0) {
+						$mdate_display=false;
+						while($mdate_res = $query_sections->fetchRow()) {
+							if($mdate_res['publ_start']!='0' || $mdate_res['publ_end']!='0') {
+								$mdate_display=true;
+								break;
+							}
+						}
+						if($mdate_display==1) {
+							$file=$admin->page_is_active($page)?"clock_16.png":"clock_red_16.png";
+							?>
+							<a href="<?php echo ADMIN_URL; ?>/pages/sections.php?page_id=<?php echo $page['page_id']; ?>" title="<?php echo $HEADING['MANAGE_SECTIONS']; ?>">
+							<img src="<?php echo ADMIN_URL."/images/$file"; ?>" border="0" alt="<?php echo $HEADING['MANAGE_SECTIONS']; ?>" />	
+							</a>
+						<?php } else { ?>
+							<img src="<?php echo ADMIN_URL; ?>/images/noclock_16.png" border="0" alt="<?php echo $HEADING['MANAGE_SECTIONS']; ?>" />	
+						<?php } ?>
+					<?php } ?>
+				<?php } ?>
+				</td>
+				<td width="20">
 				<?php if($page['position'] != 1) { ?>
 					<?php if($page['visibility'] != 'deleted') { ?>
 						<?php if($admin->get_permission('pages_settings') == true AND $can_modify == true) { ?>
@@ -592,4 +617,4 @@
 // Print admin 
 $admin->print_footer();
 
-?>
\ No newline at end of file
+?>
Index: trunk/wb/admin/pages/settings2.php
===================================================================
--- trunk/wb/admin/pages/settings2.php	(revision 551)
+++ trunk/wb/admin/pages/settings2.php	(revision 552)
@@ -44,8 +44,8 @@
 $page_title = my_htmlspecialchars($page_title);
 $menu_title = $admin->get_post_escaped('menu_title');
 $menu_title = my_htmlspecialchars($menu_title);
-$description = $admin->add_slashes($admin->get_post('description'));
-$keywords = $admin->add_slashes($admin->get_post('keywords'));
+$description = my_htmlspecialchars($admin->add_slashes($admin->get_post('description')));
+$keywords = my_htmlspecialchars($admin->add_slashes($admin->get_post('keywords')));
 $parent = $admin->get_post('parent');
 $visibility = $admin->get_post('visibility');
 $template = $admin->get_post('template');
Index: trunk/wb/admin/pages/sections.php
===================================================================
--- trunk/wb/admin/pages/sections.php	(revision 551)
+++ trunk/wb/admin/pages/sections.php	(revision 552)
@@ -135,7 +135,16 @@
 	// Make our own menu list
 	$block[1] = $TEXT['MAIN'];
 }
+?>
 
+<?php // include jscalendar-setup
+	require_once(WB_PATH."/include/jscalendar/wb-setup.php");
+	// override some vars:
+	//$jscal_lang = "en"; //- calendar-language (default: wb-backend-language)
+	//$jscal_today = ""; // - date, the calendar offers if the text-field is empty (default: today)
+	//$jscal_firstday = "0"; // - first-day-of-week (0-sunday, 1-monday, ...) (default: 0(EN) or 1(everything else))
+	//$jscal_format = "Y-m-d H:i"; // - initial-format used for the text-field (default: from wb-backend-date-format)
+	//$jscal_ifformat = "%Y-%m-%d %H:%M"; // - format for jscalendar (default: wb-backend-date-format)
 ?>
 <table cellpadding="5" cellspacing="0" border="0" align="center" width="100%" height="50" style="margin-bottom: 10px;">
 <tr style="background-color: #F0F0F0;">
@@ -154,7 +163,7 @@
 </table>
 
 <?php
-$query_sections = $database->query("SELECT section_id,module,position,block FROM ".TABLE_PREFIX."sections WHERE page_id = '$page_id' ORDER BY position ASC");
+$query_sections = $database->query("SELECT section_id,module,position,block,publ_start,publ_end FROM ".TABLE_PREFIX."sections WHERE page_id = '$page_id' ORDER BY position ASC");
 if($query_sections->numRows() > 0) {
 ?>
 <form name="section_properties" action="<?php echo ADMIN_URL; ?>/pages/sections_save.php?page_id=<?php echo $page_id; ?>" method="post">
@@ -165,6 +174,8 @@
 	<?php if(SECTION_BLOCKS) { ?>
 	<td style="display: {DISPLAY_BLOCK}"><?php echo $TEXT['BLOCK']; ?>:</td>
 	<?php } ?>
+	<td><?php echo $TEXT['PUBL_START_DATE']; ?>:</td>
+	<td><?php echo $TEXT['PUBL_END_DATE']; ?>:</td>
 	<td colspan="3" width="60"><?php echo $TEXT['ACTIONS']; ?>:</td>
 </tr>
 <?php
@@ -175,7 +186,7 @@
 		if(!is_numeric(array_search($section['module'], $module_permissions))) {
 			?>
 			<tr>
-				<td style="width: 250px;"><a href="<?php echo ADMIN_URL; ?>/pages/modify.php?page_id=<?php echo $page_id; ?>#<?php echo $section['section_id']; ?>"><?php echo $module_name; ?></a></td>
+				<td style="width: <?php if(SECTION_BLOCKS) print "120"; else print "200"; ?>px;"><a href="<?php echo ADMIN_URL; ?>/pages/modify.php?page_id=<?php echo $page_id; ?>#<?php echo $section['section_id']; ?>"><?php echo $module_name; ?></a></td>
 				<?php if(SECTION_BLOCKS) { ?>
 				<td>
 					<select name="block<?php echo $section['section_id']; ?>" style="width: 150px;">
@@ -188,7 +199,11 @@
 						?>
 					</select>
 				</td>
-				<?php } ?>
+				<?php } // jscalendar-stuff following ?>
+				<td><input type="text" id="start_date<?php echo $section['section_id']; ?>" name="start_date<?php echo $section['section_id']; ?>" value="<?php if($section['publ_start']==0) print ""; else print date($jscal_format, $section['publ_start'])?>" style="width: 120px;" />
+					<img src="<?php echo WB_URL ?>/include/jscalendar/img.gif" id="trigger_start<?php echo $section['section_id']; ?>" style="cursor: pointer; border: 1px solid red;" title="Calendar" onmouseover="this.style.background='red';" onmouseout="this.style.background=''" /></td>
+				<td><input type="text" id="end_date<?php echo $section['section_id']; ?>" name="end_date<?php echo $section['section_id']; ?>" value="<?php if($section['publ_end']==0) print ""; else print date($jscal_format, $section['publ_end'])?>" style="width: 120px;" />
+					<img src="<?php echo WB_URL ?>/include/jscalendar/img.gif" id="trigger_stop<?php echo $section['section_id']; ?>" style="cursor: pointer; border: 1px solid red;" title="Calendar" onmouseover="this.style.background='red';" onmouseout="this.style.background=''" /></td>
 				<td width="20">
 					<?php if($section['position'] != 1) { ?>
 					<a href="<?php echo ADMIN_URL; ?>/pages/move_up.php?page_id=<?php echo $page_id; ?>&section_id=<?php echo $section['section_id']; ?>">
@@ -214,17 +229,58 @@
 	}
 	?>
 	<tr>
-		<td>&nbsp;</td>
-		<?php if(SECTION_BLOCKS) { ?>
-		<td><input type="submit" name="save" value="<?php echo $TEXT['SAVE']; ?>" style="width: 150px;" /></td>
-		<?php } ?>
-		<td colspan="3" width="60">&nbsp;</td>
+		<td align="center" colspan="<?php if(SECTION_BLOCKS) print "7"; else print "6"; ?>"><input type="submit" name="save" value="<?php echo $TEXT['SAVE']; ?>" style="width: 150px;" /></td>
 	</tr>
 	</table>
 
 </form>
-
 <?php
+	// now add the calendars -- remember to to set the range to [1970, 2037] if the date is used as timestamp!
+	// the loop is simply a copy from above.
+	$query_sections = $database->query("SELECT section_id,module FROM ".TABLE_PREFIX."sections WHERE page_id = '$page_id' ORDER BY position ASC");
+	if($query_sections->numRows() > 0) {
+		$num_sections = $query_sections->numRows();
+		while($section = $query_sections->fetchRow()) {
+			// Get the modules real name
+			$module_name=$database->get_one("SELECT name FROM ".TABLE_PREFIX."addons WHERE directory='".$section['module']."'");
+			if(!is_numeric(array_search($section['module'], $module_permissions))) {
+	?>			
+				<script type="text/javascript">
+					Calendar.setup(
+						{
+							inputField  : "start_date<?php echo $section['section_id']; ?>",
+							ifFormat    : "<?php echo $jscal_ifformat ?>",
+							button      : "trigger_start<?php echo $section['section_id']; ?>",
+							firstDay    : <?php echo $jscal_firstday ?>,
+							showsTime   : "true",
+							timeFormat  : "24",
+							date        : "<?php echo $jscal_today ?>",
+							range       : [1970, 2037],
+							step        : 1
+						}
+					);
+				</script>
+				<script type="text/javascript">
+					Calendar.setup(
+						{
+							inputField  : "end_date<?php echo $section['section_id']; ?>",
+							ifFormat    : "<?php echo $jscal_ifformat ?>",
+							button      : "trigger_stop<?php echo $section['section_id']; ?>",
+							firstDay    : <?php echo $jscal_firstday ?>,
+							showsTime   : "true",
+							timeFormat  : "24",
+							date        : "<?php echo $jscal_today ?>",
+							range       : [1970, 2037],
+							step        : 1
+						}
+					);
+				</script>
+<?php
+			}
+		}
+	}
+?>
+<?php
 }
 
 // Work-out if we should show the "Add Section" form
@@ -268,4 +324,4 @@
 // Print admin footer
 $admin->print_footer();
 
-?>
\ No newline at end of file
+?>
Index: trunk/wb/admin/settings/index.php
===================================================================
--- trunk/wb/admin/settings/index.php	(revision 551)
+++ trunk/wb/admin/settings/index.php	(revision 552)
@@ -1,617 +1,627 @@
-<?php
-
-// $Id$
-
-/*
-
- Website Baker Project <http://www.websitebaker.org/>
- Copyright (C) 2004-2008, Ryan Djurovich
-
- Website Baker is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- Website Baker is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with Website Baker; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-
-*/
-
-require('../../config.php');
-require_once(WB_PATH.'/framework/class.admin.php');
-if(isset($_GET['advanced']) AND $_GET['advanced'] == 'yes') {
-	$admin = new admin('Settings', 'settings_advanced');
-} else {
-	$admin = new admin('Settings', 'settings_basic');
-}
-
-// Include the WB functions file
-require_once(WB_PATH.'/framework/functions.php');
-
-// Create new template object
-$template = new Template(ADMIN_PATH.'/settings');
-$template->set_file('page', 'template.html');
-$template->set_block('page', 'main_block', 'main');
-
-// Query current settings in the db, then loop through them and print them
-$query = "SELECT * FROM ".TABLE_PREFIX."settings";
-$results = $database->query($query);
-while($setting = $results->fetchRow()) {
-	$setting_name = $setting['name'];
-	$setting_value = htmlspecialchars($setting['value']);
-	$template->set_var(strtoupper($setting_name),$setting_value);
-}
-
-// Query current settings in the db, then loop through them and print them
-$query = "SELECT * FROM ".TABLE_PREFIX."search WHERE extra = ''";
-$results = $database->query($query);
-while($setting = $results->fetchRow()) {
-	$setting_name = $setting['name'];
-	$setting_value = htmlspecialchars(($setting['value']));
-	switch($setting_name) {
-		// Search header
-		case 'header':
-			$template->set_var('SEARCH_HEADER', $setting_value);
-		break;
-		// Search results header
-		case 'results_header':
-			$template->set_var('SEARCH_RESULTS_HEADER', $setting_value);
-		break;
-		// Search results loop
-		case 'results_loop':
-			$template->set_var('SEARCH_RESULTS_LOOP', $setting_value);
-		break;
-		// Search results footer
-		case 'results_footer':
-			$template->set_var('SEARCH_RESULTS_FOOTER', $setting_value);
-		break;
-		// Search no results
-		case 'no_results':
-			$template->set_var('SEARCH_NO_RESULTS', $setting_value);
-		break;
-		// Search footer
-		case 'footer':
-			$template->set_var('SEARCH_FOOTER', $setting_value);
-		break;
-		// Search template
-		case 'template':
-			$search_template = $setting_value;
-		break;
-	}
-}
-
-// Do the same for settings stored in config file as with ones in db
-$database_type = '';
-
-// Tell the browser whether or not to show advanced options
-if(isset($_GET['advanced']) AND $_GET['advanced'] == 'yes') {
-	$template->set_var('DISPLAY_ADVANCED', '');
-	$template->set_var('ADVANCED', 'yes');
-	$template->set_var('ADVANCED_BUTTON', '<< '.$TEXT['HIDE_ADVANCED']);
-	$template->set_var('ADVANCED_LINK', 'index.php?advanced=no');
-	$template->set_var('BASIC_FILE_PERMS_ID', 'hide');
-	$template->set_var('ADVANCED_FILE_PERMS_ID', 'file_perms_box');
-} else {
-	$template->set_var('DISPLAY_ADVANCED', 'none');
-	$template->set_var('ADVANCED', 'no');
-	$template->set_var('ADVANCED_BUTTON', $TEXT['SHOW_ADVANCED'].' >>');
-	$template->set_var('ADVANCED_LINK', 'index.php?advanced=yes');
-	$template->set_var('BASIC_FILE_PERMS_ID', 'file_perms_box');
-	$template->set_var('ADVANCED_FILE_PERMS_ID', 'hide');
-}
-
-$template->set_var(array(	
-									'PAGES_DIRECTORY' => PAGES_DIRECTORY,
-									'MEDIA_DIRECTORY' => MEDIA_DIRECTORY,
-									'PAGE_EXTENSION' => PAGE_EXTENSION,
-									'PAGE_SPACER' => PAGE_SPACER,
-									'WB_PATH' => WB_PATH,
-									'WB_URL' => WB_URL,
-									'ADMIN_PATH' => ADMIN_PATH,
-									'ADMIN_URL' => ADMIN_URL,
-									'DATABASE_TYPE' => DB_TYPE,
-									'DATABASE_HOST' => DB_HOST,
-									'DATABASE_USERNAME' => DB_USERNAME,
-									'DATABASE_NAME' => DB_NAME,
-									'TABLE_PREFIX' => TABLE_PREFIX
-								 )
-						 );
-
-// Insert language values
-$template->set_block('main_block', 'language_list_block', 'language_list');
-$result = $database->query("SELECT * FROM ".TABLE_PREFIX."addons WHERE type = 'language' order by directory");
-if($result->numRows() > 0) {
-	while ($addon = $result->fetchRow()) {
-		// Insert code and name
-		$template->set_var(array(
-								'CODE' => $addon['directory'],
-								'NAME' => $addon['name']
-								));
-		// Check if it is selected
-		if(DEFAULT_LANGUAGE == $addon['directory']) {
-			$template->set_var('SELECTED', ' selected');
-		} else {
-			$template->set_var('SELECTED', '');
-		}
-		$template->parse('language_list', 'language_list_block', true);
-	}
-}
-
-// Insert default timezone values
-require(ADMIN_PATH.'/interface/timezones.php');
-$template->set_block('main_block', 'timezone_list_block', 'timezone_list');
-foreach($TIMEZONES AS $hour_offset => $title) {
-	// Make sure we dont list "System Default" as we are setting this value!
-	if($hour_offset != '-20') {
-		$template->set_var('VALUE', $hour_offset);
-		$template->set_var('NAME', $title);
-		if(DEFAULT_TIMEZONE == $hour_offset*60*60) {
-			$template->set_var('SELECTED', 'selected');
-		} else {
-			$template->set_var('SELECTED', '');
-		}
-		$template->parse('timezone_list', 'timezone_list_block', true);
-	}
-}
-
-// Insert default charset values
-require(ADMIN_PATH.'/interface/charsets.php');
-$template->set_block('main_block', 'charset_list_block', 'charset_list');
-foreach($CHARSETS AS $code => $title) {
-	$template->set_var('VALUE', $code);
-	$template->set_var('NAME', $title);
-	if(DEFAULT_CHARSET == $code) {
-		$template->set_var('SELECTED', 'selected');
-	} else {
-		$template->set_var('SELECTED', '');
-	}
-	$template->parse('charset_list', 'charset_list_block', true);
-}
-
-// Insert date format list
-require(ADMIN_PATH.'/interface/date_formats.php');
-$template->set_block('main_block', 'date_format_list_block', 'date_format_list');
-foreach($DATE_FORMATS AS $format => $title) {
-	$format = str_replace('|', ' ', $format); // Add's white-spaces (not able to be stored in array key)
-	if($format != 'system_default') {
-		$template->set_var('VALUE', $format);
-	} else {
-		$template->set_var('VALUE', '');
-	}
-	$template->set_var('NAME', $title);
-	if(DEFAULT_DATE_FORMAT == $format) {
-		$template->set_var('SELECTED', 'selected');
-	} else {
-		$template->set_var('SELECTED', '');
-	}
-	$template->parse('date_format_list', 'date_format_list_block', true);
-}
-
-// Insert time format list
-require(ADMIN_PATH.'/interface/time_formats.php');
-$template->set_block('main_block', 'time_format_list_block', 'time_format_list');
-foreach($TIME_FORMATS AS $format => $title) {
-	$format = str_replace('|', ' ', $format); // Add's white-spaces (not able to be stored in array key)
-	if($format != 'system_default') {
-		$template->set_var('VALUE', $format);
-	} else {
-		$template->set_var('VALUE', '');
-	}
-	$template->set_var('NAME', $title);
-	if(DEFAULT_TIME_FORMAT == $format) {
-		$template->set_var('SELECTED', 'selected');
-	} else {
-		$template->set_var('SELECTED', '');
-	}
-	$template->parse('time_format_list', 'time_format_list_block', true);
-}
-
-// Insert templates
-$template->set_block('main_block', 'template_list_block', 'template_list');
-$result = $database->query("SELECT * FROM ".TABLE_PREFIX."addons WHERE type = 'template' order by name");
-if($result->numRows() > 0) {
-	while($addon = $result->fetchRow()) {
-		$template->set_var('FILE', $addon['directory']);
-		$template->set_var('NAME', $addon['name']);
-		if(($addon['directory'] == DEFAULT_TEMPLATE) ? $selected = ' selected' : $selected = '');
-		$template->set_var('SELECTED', $selected);
-		$template->parse('template_list', 'template_list_block', true);
-	}
-}
-
-// Insert WYSIWYG modules
-$template->set_block('main_block', 'editor_list_block', 'editor_list');
-$file='none';  
-$module_name=$TEXT['NONE'];  
-$template->set_var('FILE', $file);  
-$template->set_var('NAME', $module_name);  
-if((!defined('WYSIWYG_EDITOR') OR $file == WYSIWYG_EDITOR) ? $selected = ' selected' : $selected = '');  
-$template->set_var('SELECTED', $selected);  
-$template->parse('editor_list', 'editor_list_block', true);  
-$result = $database->query("SELECT * FROM ".TABLE_PREFIX."addons WHERE type = 'module' AND function = 'wysiwyg'");
-if($result->numRows() > 0) {
-	while($addon = $result->fetchRow()) {
-		$template->set_var('FILE', $addon['directory']);
-		$template->set_var('NAME', $addon['name']);
-		if((defined('WYSIWYG_EDITOR') AND $addon['directory'] == WYSIWYG_EDITOR) ? $selected = ' selected' : $selected = '');
-		$template->set_var('SELECTED', $selected);
-		$template->parse('editor_list', 'editor_list_block', true);
-	}
-}
-
-// Insert templates for search settings
-$template->set_block('main_block', 'search_template_list_block', 'search_template_list');
-if($search_template == '') { $selected = ' selected'; } else { $selected = ''; }
-$template->set_var(array('FILE' => '', 'NAME' => $TEXT['SYSTEM_DEFAULT'], 'SELECTED' => $selected));
-$template->parse('search_template_list', 'search_template_list_block', true);
-$result = $database->query("SELECT * FROM ".TABLE_PREFIX."addons WHERE type = 'template' order by name");
-if($result->numRows() > 0) {
-	while($addon = $result->fetchRow()) {
-		$template->set_var('FILE', $addon['directory']);
-		$template->set_var('NAME', $addon['name']);
-		if($addon['directory'] == $search_template ? $selected = ' selected' : $selected = '');
-		$template->set_var('SELECTED', $selected);
-		$template->parse('search_template_list', 'search_template_list_block', true);
-	}
-}
-
-// Insert default error reporting values
-require(ADMIN_PATH.'/interface/er_levels.php');
-$template->set_block('main_block', 'error_reporting_list_block', 'error_reporting_list');
-foreach($ER_LEVELS AS $value => $title) {
-	$template->set_var('VALUE', $value);
-	$template->set_var('NAME', $title);
-	if(ER_LEVEL == $value) {
-		$template->set_var('SELECTED', 'selected');
-	} else {
-		$template->set_var('SELECTED', '');
-	}
-	$template->parse('error_reporting_list', 'error_reporting_list_block', true);
-}
-
-// Insert permissions values
-if($admin->get_permission('settings_advanced') != true) {
-	$template->set_var('DISPLAY_ADVANCED_BUTTON', 'hide');
-}
-
-// Insert page level limits
-$template->set_block('main_block', 'page_level_limit_list_block', 'page_level_limit_list');
-for($i = 1; $i <= 10; $i++) {
-	$template->set_var('NUMBER', $i);
-	if(PAGE_LEVEL_LIMIT == $i) {
-		$template->set_var('SELECTED', 'selected');
-	} else {
-		$template->set_var('SELECTED', '');
-	}
-	$template->parse('page_level_limit_list', 'page_level_limit_list_block', true);
-}
-
-// Work-out if multiple menus feature is enabled
-if(defined('MULTIPLE_MENUS') AND MULTIPLE_MENUS == true) {
-	$template->set_var('MULTIPLE_MENUS_ENABLED', ' checked');
-} else {
-	$template->set_var('MULTIPLE_MENUS_DISABLED', ' checked');
-}
-
-// Work-out if page languages feature is enabled
-if(defined('PAGE_LANGUAGES') AND PAGE_LANGUAGES == true) {
-        $template->set_var('PAGE_LANGUAGES_ENABLED', ' checked');
-} else {
-        $template->set_var('PAGE_LANGUAGES_DISABLED', ' checked');
-}
-
-// Work-out if smart login feature is enabled
-if(defined('SMART_LOGIN') AND SMART_LOGIN == true) {
-	$template->set_var('SMART_LOGIN_ENABLED', ' checked');
-} else {
-	$template->set_var('SMART_LOGIN_DISABLED', ' checked');
-}
-
-// Work-out if captcha verification feature is enabled
-if(defined('CAPTCHA_VERIFICATION') AND CAPTCHA_VERIFICATION == true) {
-	$template->set_var('CAPTCHA_VERIFICATION_ENABLED', ' checked');
-} else {
-	$template->set_var('CAPTCHA_VERIFICATION_DISABLED', ' checked');
-}
-if(extension_loaded('gd') AND function_exists('imageCreateFromJpeg')) { /* Make's sure GD library is installed */
-	$template->set_var('GD_EXTENSION_ENABLED', '');
-} else {
-	$template->set_var('GD_EXTENSION_ENABLED', 'none');
-}
-
-// Work-out if section blocks feature is enabled
-if(defined('SECTION_BLOCKS') AND SECTION_BLOCKS == true) {
-	$template->set_var('SECTION_BLOCKS_ENABLED', ' checked');
-} else {
-	$template->set_var('SECTION_BLOCKS_DISABLED', ' checked');
-}
-
-// Work-out if homepage redirection feature is enabled
-if(defined('HOMEPAGE_REDIRECTION') AND HOMEPAGE_REDIRECTION == true) {
-	$template->set_var('HOMEPAGE_REDIRECTION_ENABLED', ' checked');
-} else {
-	$template->set_var('HOMEPAGE_REDIRECTION_DISABLED', ' checked');
-}
-
-// Work-out which server os should be checked
-if(OPERATING_SYSTEM == 'linux') {
-	$template->set_var('LINUX_SELECTED', ' checked');
-} elseif(OPERATING_SYSTEM == 'windows') {
-	$template->set_var('WINDOWS_SELECTED', ' checked');
-}
-
-// Work-out if manage sections feature is enabled
-if(MANAGE_SECTIONS) {
-	$template->set_var('MANAGE_SECTIONS_ENABLED', ' checked');
-} else {
-	$template->set_var('MANAGE_SECTIONS_DISABLED', ' checked');
-}
-
-// Work-out which wbmailer routine should be checked
-if(WBMAILER_ROUTINE == 'phpmail') {
-	$template->set_var('PHPMAIL_SELECTED', ' checked');
-	$template->set_var('SMTP_VISIBILITY', 'hidden');
-	$template->set_var('SMTP_VISIBILITY_AUTH', 'hidden');
-} elseif(WBMAILER_ROUTINE == 'smtp') {
-	$template->set_var('SMTPMAIL_SELECTED', ' checked');
-	$template->set_var('SMTP_VISIBILITY', 'visible');
-}
-
-// Work-out if SMTP authentification should be checked
-if(WBMAILER_SMTP_AUTH) {
-	$template->set_var('SMTP_AUTH_SELECTED', ' checked');
-	if(WBMAILER_ROUTINE == 'smtp') {
-		$template->set_var('SMTP_VISIBILITY_AUTH', 'visible');
-	} else {
-		$template->set_var('SMTP_VISIBILITY_AUTH', 'hidden');
-	}
-} else {
-	$template->set_var('SMTP_VISIBILITY_AUTH', 'hidden');
-}
-
-// Work-out if intro feature is enabled
-if(INTRO_PAGE) {
-	$template->set_var('INTRO_PAGE_ENABLED', ' checked');
-} else {
-	$template->set_var('INTRO_PAGE_DISABLED', ' checked');
-}
-
-// Work-out if frontend login feature is enabled
-if(FRONTEND_LOGIN) {
-	$template->set_var('PRIVATE_ENABLED', ' checked');
-} else {
-	$template->set_var('PRIVATE_DISABLED', ' checked');
-}
-
-// Work-out if page trash feature is disabled, in-line, or separate
-if(PAGE_TRASH == 'disabled') {
-	$template->set_var('PAGE_TRASH_DISABLED', ' checked');
-	$template->set_var('DISPLAY_PAGE_TRASH_SEPARATE', ' display: none;');
-} elseif(PAGE_TRASH == 'inline') {
-	$template->set_var('PAGE_TRASH_INLINE', ' checked');
-	$template->set_var('DISPLAY_PAGE_TRASH_SEPARATE', ' display: none;');
-} elseif(PAGE_TRASH == 'separate') {
-	$template->set_var('PAGE_TRASH_SEPARATE', ' checked');
-	$template->set_var('DISPLAY_PAGE_TRASH_SEPARATE', ' display: inline;');
-}
-
-// Work-out if media home folde feature is enabled
-if(HOME_FOLDERS) {
-	$template->set_var('HOME_FOLDERS_ENABLED', ' checked');
-} else {
-	$template->set_var('HOME_FOLDERS_DISABLED', ' checked');
-}
-
-// Insert search select
-if(SEARCH == 'private') {
-	$template->set_var('PRIVATE_SEARCH', 'selected');
-} elseif(SEARCH == 'registered') {
-	$template->set_var('REGISTERED_SEARCH', 'selected');
-} elseif(SEARCH == 'none') {
-	$template->set_var('NONE_SEARCH', 'selected');
-}
-
-// Work-out if 777 permissions are set
-if(STRING_FILE_MODE == '0777' AND STRING_DIR_MODE == '0777') {
-	$template->set_var('WORLD_WRITEABLE_SELECTED', ' checked');
-}
-
-// Work-out which file mode boxes are checked
-if(extract_permission(STRING_FILE_MODE, 'u', 'r')) {
-	$template->set_var('FILE_U_R_CHECKED', 'checked');
-}
-if(extract_permission(STRING_FILE_MODE, 'u', 'w')) {
-	$template->set_var('FILE_U_W_CHECKED', 'checked');
-}
-if(extract_permission(STRING_FILE_MODE, 'u', 'e')) {
-	$template->set_var('FILE_U_E_CHECKED', 'checked');
-}
-if(extract_permission(STRING_FILE_MODE, 'g', 'r')) {
-	$template->set_var('FILE_G_R_CHECKED', 'checked');
-}
-if(extract_permission(STRING_FILE_MODE, 'g', 'w')) {
-	$template->set_var('FILE_G_W_CHECKED', 'checked');
-}
-if(extract_permission(STRING_FILE_MODE, 'g', 'e')) {
-	$template->set_var('FILE_G_E_CHECKED', 'checked');
-}
-if(extract_permission(STRING_FILE_MODE, 'o', 'r')) {
-	$template->set_var('FILE_O_R_CHECKED', 'checked');
-}
-if(extract_permission(STRING_FILE_MODE, 'o', 'w')) {
-	$template->set_var('FILE_O_W_CHECKED', 'checked');
-}
-if(extract_permission(STRING_FILE_MODE, 'o', 'e')) {
-	$template->set_var('FILE_O_E_CHECKED', 'checked');
-}
-// Work-out which dir mode boxes are checked
-if(extract_permission(STRING_DIR_MODE, 'u', 'r')) {
-	$template->set_var('DIR_U_R_CHECKED', 'checked');
-}
-if(extract_permission(STRING_DIR_MODE, 'u', 'w')) {
-	$template->set_var('DIR_U_W_CHECKED', 'checked');
-}
-if(extract_permission(STRING_DIR_MODE, 'u', 'e')) {
-	$template->set_var('DIR_U_E_CHECKED', 'checked');
-}
-if(extract_permission(STRING_DIR_MODE, 'g', 'r')) {
-	$template->set_var('DIR_G_R_CHECKED', 'checked');
-}
-if(extract_permission(STRING_DIR_MODE, 'g', 'w')) {
-	$template->set_var('DIR_G_W_CHECKED', 'checked');
-}
-if(extract_permission(STRING_DIR_MODE, 'g', 'e')) {
-	$template->set_var('DIR_G_E_CHECKED', 'checked');
-}
-if(extract_permission(STRING_DIR_MODE, 'o', 'r')) {
-	$template->set_var('DIR_O_R_CHECKED', 'checked');
-}
-if(extract_permission(STRING_DIR_MODE, 'o', 'w')) {
-	$template->set_var('DIR_O_W_CHECKED', 'checked');
-}
-if(extract_permission(STRING_DIR_MODE, 'o', 'e')) {
-	$template->set_var('DIR_O_E_CHECKED', 'checked');
-}
-
-// Insert Server Email value into template
-$template->set_var('SERVER_EMAIL', SERVER_EMAIL);
-
-// Insert groups into signup list
-$template->set_block('main_block', 'group_list_block', 'group_list');
-$results = $database->query("SELECT group_id, name FROM ".TABLE_PREFIX."groups WHERE group_id != '1'");
-if($results->numRows() > 0) {
-	while($group = $results->fetchRow()) {
-		$template->set_var('ID', $group['group_id']);
-		$template->set_var('NAME', $group['name']);
-		if(FRONTEND_SIGNUP == $group['group_id']) {
-			$template->set_var('SELECTED', 'selected');
-		} else {
-			$template->set_var('SELECTED', '');
-		}
-		$template->parse('group_list', 'group_list_block', true);
-	}
-} else {
-	$template->set_var('ID', 'disabled');
-	$template->set_var('NAME', $MESSAGE['GROUPS']['NO_GROUPS_FOUND']);
-	$template->parse('group_list', 'group_list_block', true);
-}
-
-// Insert language headings
-$template->set_var(array(
-								'HEADING_GENERAL_SETTINGS' => $HEADING['GENERAL_SETTINGS'],
-								'HEADING_DEFAULT_SETTINGS' => $HEADING['DEFAULT_SETTINGS'],
-								'HEADING_SEARCH_SETTINGS' => $HEADING['SEARCH_SETTINGS'],
-								'HEADING_SERVER_SETTINGS' => $HEADING['SERVER_SETTINGS'],
-								'HEADING_WBMAILER_SETTINGS' => $HEADING['WBMAILER_SETTINGS'],
-								'HEADING_ADMINISTRATION_TOOLS' => $HEADING['ADMINISTRATION_TOOLS']
-								)
-						);
-// Insert language text and messages
-$template->set_var(array(
-								'TEXT_WEBSITE_TITLE' => $TEXT['WEBSITE_TITLE'],
-								'TEXT_WEBSITE_DESCRIPTION' => $TEXT['WEBSITE_DESCRIPTION'],
-								'TEXT_WEBSITE_KEYWORDS' => $TEXT['WEBSITE_KEYWORDS'],
-								'TEXT_WEBSITE_HEADER' => $TEXT['WEBSITE_HEADER'],
-								'TEXT_WEBSITE_FOOTER' => $TEXT['WEBSITE_FOOTER'],
-								'TEXT_HEADER' => $TEXT['HEADER'],
-								'TEXT_FOOTER' => $TEXT['FOOTER'],
-								'TEXT_VISIBILITY' => $TEXT['VISIBILITY'],
-								'TEXT_RESULTS_HEADER' => $TEXT['RESULTS_HEADER'],
-								'TEXT_RESULTS_LOOP' => $TEXT['RESULTS_LOOP'],
-								'TEXT_RESULTS_FOOTER' => $TEXT['RESULTS_FOOTER'],
-								'TEXT_NO_RESULTS' => $TEXT['NO_RESULTS'],
-								'TEXT_TEXT' => $TEXT['TEXT'],
-								'TEXT_DEFAULT' => $TEXT['DEFAULT'],
-								'TEXT_LANGUAGE' => $TEXT['LANGUAGE'],
-								'TEXT_TIMEZONE' => $TEXT['TIMEZONE'],
-								'TEXT_CHARSET' => $TEXT['CHARSET'],
-								'TEXT_DATE_FORMAT' => $TEXT['DATE_FORMAT'],
-								'TEXT_TIME_FORMAT' => $TEXT['TIME_FORMAT'],
-								'TEXT_TEMPLATE' => $TEXT['TEMPLATE'],
-								'TEXT_WYSIWYG_EDITOR' => $TEXT['WYSIWYG_EDITOR'],
-								'TEXT_PAGE_LEVEL_LIMIT' => $TEXT['PAGE_LEVEL_LIMIT'],
-								'TEXT_INTRO_PAGE' => $TEXT['INTRO_PAGE'],
-								'TEXT_FRONTEND' => $TEXT['FRONTEND'],
-								'TEXT_LOGIN' => $TEXT['LOGIN'],
-								'TEXT_SIGNUP' => $TEXT['SIGNUP'],
-								'TEXT_PHP_ERROR_LEVEL' => $TEXT['PHP_ERROR_LEVEL'],
-								'TEXT_PAGES_DIRECTORY' => $TEXT['PAGES_DIRECTORY'],
-								'TEXT_MEDIA_DIRECTORY' => $TEXT['MEDIA_DIRECTORY'],
-								'TEXT_PAGE_EXTENSION' => $TEXT['PAGE_EXTENSION'],
-								'TEXT_PAGE_SPACER' => $TEXT['PAGE_SPACER'],
-								'TEXT_RENAME_FILES_ON_UPLOAD' => $TEXT['RENAME_FILES_ON_UPLOAD'],
-								'TEXT_APP_NAME' => $TEXT['APP_NAME'],
-								'TEXT_SESSION_IDENTIFIER' => $TEXT['SESSION_IDENTIFIER'],
-								'TEXT_SERVER_OPERATING_SYSTEM' => $TEXT['SERVER_OPERATING_SYSTEM'],
-								'TEXT_LINUX_UNIX_BASED' => $TEXT['LINUX_UNIX_BASED'],
-								'TEXT_WINDOWS' => $TEXT['WINDOWS'],
-								'TEXT_ADMIN' => $TEXT['ADMIN'],
-								'TEXT_TYPE' => $TEXT['TYPE'],
-								'TEXT_DATABASE' => $TEXT['DATABASE'],
-								'TEXT_HOST' => $TEXT['HOST'],
-								'TEXT_USERNAME' => $TEXT['USERNAME'],
-								'TEXT_PASSWORD' => $TEXT['PASSWORD'],
-								'TEXT_NAME' => $TEXT['NAME'],
-								'TEXT_TABLE_PREFIX' => $TEXT['TABLE_PREFIX'],
-								'TEXT_SAVE' => $TEXT['SAVE'],
-								'TEXT_RESET' => $TEXT['RESET'],
-								'TEXT_CHANGES' => $TEXT['CHANGES'],
-								'TEXT_ENABLED' => $TEXT['ENABLED'],
-								'TEXT_DISABLED' => $TEXT['DISABLED'],
-								'TEXT_MANAGE_SECTIONS' => $HEADING['MANAGE_SECTIONS'],
-								'TEXT_MANAGE' => $TEXT['MANAGE'],
-								'TEXT_SEARCH' => $TEXT['SEARCH'],
-								'TEXT_PUBLIC' => $TEXT['PUBLIC'],
-								'TEXT_PRIVATE' => $TEXT['PRIVATE'],
-								'TEXT_REGISTERED' => $TEXT['REGISTERED'],
-								'TEXT_NONE' => $TEXT['NONE'],
-								'TEXT_FILES' => strtoupper(substr($TEXT['FILES'], 0, 1)).substr($TEXT['FILES'], 1),
-								'TEXT_DIRECTORIES' => $TEXT['DIRECTORIES'],
-								'TEXT_FILESYSTEM_PERMISSIONS' => $TEXT['FILESYSTEM_PERMISSIONS'],
-								'TEXT_USER' => $TEXT['USER'],
-								'TEXT_GROUP' => $TEXT['GROUP'],
-								'TEXT_OTHERS' => $TEXT['OTHERS'],
-								'TEXT_READ' => $TEXT['READ'],
-								'TEXT_WRITE' => $TEXT['WRITE'],
-								'TEXT_EXECUTE' => $TEXT['EXECUTE'],
-								'TEXT_SMART_LOGIN' => $TEXT['SMART_LOGIN'],
-								'TEXT_CAPTCHA_VERIFICATION' => $TEXT['CAPTCHA_VERIFICATION'],
-								'TEXT_MULTIPLE_MENUS' => $TEXT['MULTIPLE_MENUS'],
-								'TEXT_HOMEPAGE_REDIRECTION' => $TEXT['HOMEPAGE_REDIRECTION'],
-								'TEXT_SECTION_BLOCKS' => $TEXT['SECTION_BLOCKS'],
-								'TEXT_PLEASE_SELECT' => $TEXT['PLEASE_SELECT'],
-								'TEXT_PAGE_TRASH' => $TEXT['PAGE_TRASH'],
-								'TEXT_PAGE_LANGUAGES' => $TEXT['PAGE_LANGUAGES'],
-								'TEXT_INLINE' => $TEXT['INLINE'],
-								'TEXT_SEPARATE' => $TEXT['SEPARATE'],
-								'TEXT_HOME_FOLDERS' => $TEXT['HOME_FOLDERS'],
-								'TEXT_WYSIWYG_STYLE' => $TEXT['WYSIWYG_STYLE'],
-								'TEXT_SERVER_EMAIL' => $TEXT['SERVER_EMAIL'],
-								'TEXT_WORLD_WRITEABLE_FILE_PERMISSIONS' => $TEXT['WORLD_WRITEABLE_FILE_PERMISSIONS'],
-								'TEXT_WBMAILER_NOTICE' => $TEXT['WBMAILER_NOTICE'],
-								'TEXT_WBMAILER_FUNCTION' => $TEXT['WBMAILER_FUNCTION'],
-								'TEXT_WBMAILER_SMTP_HOST' => $TEXT['WBMAILER_SMTP_HOST'],
-								'TEXT_WBMAILER_PHP' => $TEXT['WBMAILER_PHP'],
-								'TEXT_WBMAILER_SMTP' => $TEXT['WBMAILER_SMTP'],
-								'TEXT_WBMAILER_SMTP_AUTH' => $TEXT['WBMAILER_SMTP_AUTH'],
-								'TEXT_WBMAILER_SMTP_AUTH_NOTICE' => $TEXT['WBMAILER_SMTP_AUTH_NOTICE'],
-								'TEXT_WBMAILER_SMTP_USERNAME' => $TEXT['WBMAILER_SMTP_USERNAME'],
-								'TEXT_WBMAILER_SMTP_PASSWORD' => $TEXT['WBMAILER_SMTP_PASSWORD'],
-								'MODE_SWITCH_WARNING' => $MESSAGE['SETTINGS']['MODE_SWITCH_WARNING'],
-								'WORLD_WRITEABLE_WARNING' => $MESSAGE['SETTINGS']['WORLD_WRITEABLE_WARNING']
-								)
-						);
-
-// Parse template objects output
-$template->parse('main', 'main_block', false);
-$template->pparse('output', 'page');
-
-$admin->print_footer();
-
-?>
\ No newline at end of file
+<?php
+
+// $Id$
+
+/*
+
+ Website Baker Project <http://www.websitebaker.org/>
+ Copyright (C) 2004-2008, Ryan Djurovich
+
+ Website Baker is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ Website Baker is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Website Baker; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+*/
+
+require('../../config.php');
+require_once(WB_PATH.'/framework/class.admin.php');
+if(isset($_GET['advanced']) AND $_GET['advanced'] == 'yes') {
+	$admin = new admin('Settings', 'settings_advanced');
+} else {
+	$admin = new admin('Settings', 'settings_basic');
+}
+
+// Include the WB functions file
+require_once(WB_PATH.'/framework/functions.php');
+
+// Create new template object
+$template = new Template(ADMIN_PATH.'/settings');
+$template->set_file('page', 'template.html');
+$template->set_block('page', 'main_block', 'main');
+
+// Query current settings in the db, then loop through them and print them
+$query = "SELECT * FROM ".TABLE_PREFIX."settings";
+$results = $database->query($query);
+while($setting = $results->fetchRow()) {
+	$setting_name = $setting['name'];
+	$setting_value = htmlspecialchars($setting['value']);
+	$template->set_var(strtoupper($setting_name),$setting_value);
+}
+
+// Query current settings in the db, then loop through them and print them
+$query = "SELECT * FROM ".TABLE_PREFIX."search WHERE extra = ''";
+$results = $database->query($query);
+while($setting = $results->fetchRow()) {
+	$setting_name = $setting['name'];
+	$setting_value = htmlspecialchars(($setting['value']));
+	switch($setting_name) {
+		// Search header
+		case 'header':
+			$template->set_var('SEARCH_HEADER', $setting_value);
+		break;
+		// Search results header
+		case 'results_header':
+			$template->set_var('SEARCH_RESULTS_HEADER', $setting_value);
+		break;
+		// Search results loop
+		case 'results_loop':
+			$template->set_var('SEARCH_RESULTS_LOOP', $setting_value);
+		break;
+		// Search results footer
+		case 'results_footer':
+			$template->set_var('SEARCH_RESULTS_FOOTER', $setting_value);
+		break;
+		// Search no results
+		case 'no_results':
+			$template->set_var('SEARCH_NO_RESULTS', $setting_value);
+		break;
+		// Search footer
+		case 'footer':
+			$template->set_var('SEARCH_FOOTER', $setting_value);
+		break;
+		// Search module-order
+		case 'module_order':
+			$template->set_var('SEARCH_MODULE_ORDER', $setting_value);
+		break;
+		// Search max lines of excerpt
+		case 'max_excerpt':
+			$template->set_var('SEARCH_MAX_EXCERPT', $setting_value);
+		break;
+		// Search template
+		case 'template':
+			$search_template = $setting_value;
+		break;
+	}
+}
+
+// Do the same for settings stored in config file as with ones in db
+$database_type = '';
+
+// Tell the browser whether or not to show advanced options
+if(isset($_GET['advanced']) AND $_GET['advanced'] == 'yes') {
+	$template->set_var('DISPLAY_ADVANCED', '');
+	$template->set_var('ADVANCED', 'yes');
+	$template->set_var('ADVANCED_BUTTON', '<< '.$TEXT['HIDE_ADVANCED']);
+	$template->set_var('ADVANCED_LINK', 'index.php?advanced=no');
+	$template->set_var('BASIC_FILE_PERMS_ID', 'hide');
+	$template->set_var('ADVANCED_FILE_PERMS_ID', 'file_perms_box');
+} else {
+	$template->set_var('DISPLAY_ADVANCED', 'none');
+	$template->set_var('ADVANCED', 'no');
+	$template->set_var('ADVANCED_BUTTON', $TEXT['SHOW_ADVANCED'].' >>');
+	$template->set_var('ADVANCED_LINK', 'index.php?advanced=yes');
+	$template->set_var('BASIC_FILE_PERMS_ID', 'file_perms_box');
+	$template->set_var('ADVANCED_FILE_PERMS_ID', 'hide');
+}
+
+$template->set_var(array(	
+									'PAGES_DIRECTORY' => PAGES_DIRECTORY,
+									'MEDIA_DIRECTORY' => MEDIA_DIRECTORY,
+									'PAGE_EXTENSION' => PAGE_EXTENSION,
+									'PAGE_SPACER' => PAGE_SPACER,
+									'WB_PATH' => WB_PATH,
+									'WB_URL' => WB_URL,
+									'ADMIN_PATH' => ADMIN_PATH,
+									'ADMIN_URL' => ADMIN_URL,
+									'DATABASE_TYPE' => DB_TYPE,
+									'DATABASE_HOST' => DB_HOST,
+									'DATABASE_USERNAME' => DB_USERNAME,
+									'DATABASE_NAME' => DB_NAME,
+									'TABLE_PREFIX' => TABLE_PREFIX
+								 )
+						 );
+
+// Insert language values
+$template->set_block('main_block', 'language_list_block', 'language_list');
+$result = $database->query("SELECT * FROM ".TABLE_PREFIX."addons WHERE type = 'language' order by directory");
+if($result->numRows() > 0) {
+	while ($addon = $result->fetchRow()) {
+		// Insert code and name
+		$template->set_var(array(
+								'CODE' => $addon['directory'],
+								'NAME' => $addon['name']
+								));
+		// Check if it is selected
+		if(DEFAULT_LANGUAGE == $addon['directory']) {
+			$template->set_var('SELECTED', ' selected');
+		} else {
+			$template->set_var('SELECTED', '');
+		}
+		$template->parse('language_list', 'language_list_block', true);
+	}
+}
+
+// Insert default timezone values
+require(ADMIN_PATH.'/interface/timezones.php');
+$template->set_block('main_block', 'timezone_list_block', 'timezone_list');
+foreach($TIMEZONES AS $hour_offset => $title) {
+	// Make sure we dont list "System Default" as we are setting this value!
+	if($hour_offset != '-20') {
+		$template->set_var('VALUE', $hour_offset);
+		$template->set_var('NAME', $title);
+		if(DEFAULT_TIMEZONE == $hour_offset*60*60) {
+			$template->set_var('SELECTED', 'selected');
+		} else {
+			$template->set_var('SELECTED', '');
+		}
+		$template->parse('timezone_list', 'timezone_list_block', true);
+	}
+}
+
+// Insert default charset values
+require(ADMIN_PATH.'/interface/charsets.php');
+$template->set_block('main_block', 'charset_list_block', 'charset_list');
+foreach($CHARSETS AS $code => $title) {
+	$template->set_var('VALUE', $code);
+	$template->set_var('NAME', $title);
+	if(DEFAULT_CHARSET == $code) {
+		$template->set_var('SELECTED', 'selected');
+	} else {
+		$template->set_var('SELECTED', '');
+	}
+	$template->parse('charset_list', 'charset_list_block', true);
+}
+
+// Insert date format list
+require(ADMIN_PATH.'/interface/date_formats.php');
+$template->set_block('main_block', 'date_format_list_block', 'date_format_list');
+foreach($DATE_FORMATS AS $format => $title) {
+	$format = str_replace('|', ' ', $format); // Add's white-spaces (not able to be stored in array key)
+	if($format != 'system_default') {
+		$template->set_var('VALUE', $format);
+	} else {
+		$template->set_var('VALUE', '');
+	}
+	$template->set_var('NAME', $title);
+	if(DEFAULT_DATE_FORMAT == $format) {
+		$template->set_var('SELECTED', 'selected');
+	} else {
+		$template->set_var('SELECTED', '');
+	}
+	$template->parse('date_format_list', 'date_format_list_block', true);
+}
+
+// Insert time format list
+require(ADMIN_PATH.'/interface/time_formats.php');
+$template->set_block('main_block', 'time_format_list_block', 'time_format_list');
+foreach($TIME_FORMATS AS $format => $title) {
+	$format = str_replace('|', ' ', $format); // Add's white-spaces (not able to be stored in array key)
+	if($format != 'system_default') {
+		$template->set_var('VALUE', $format);
+	} else {
+		$template->set_var('VALUE', '');
+	}
+	$template->set_var('NAME', $title);
+	if(DEFAULT_TIME_FORMAT == $format) {
+		$template->set_var('SELECTED', 'selected');
+	} else {
+		$template->set_var('SELECTED', '');
+	}
+	$template->parse('time_format_list', 'time_format_list_block', true);
+}
+
+// Insert templates
+$template->set_block('main_block', 'template_list_block', 'template_list');
+$result = $database->query("SELECT * FROM ".TABLE_PREFIX."addons WHERE type = 'template' order by name");
+if($result->numRows() > 0) {
+	while($addon = $result->fetchRow()) {
+		$template->set_var('FILE', $addon['directory']);
+		$template->set_var('NAME', $addon['name']);
+		if(($addon['directory'] == DEFAULT_TEMPLATE) ? $selected = ' selected' : $selected = '');
+		$template->set_var('SELECTED', $selected);
+		$template->parse('template_list', 'template_list_block', true);
+	}
+}
+
+// Insert WYSIWYG modules
+$template->set_block('main_block', 'editor_list_block', 'editor_list');
+$file='none';  
+$module_name=$TEXT['NONE'];  
+$template->set_var('FILE', $file);  
+$template->set_var('NAME', $module_name);  
+if((!defined('WYSIWYG_EDITOR') OR $file == WYSIWYG_EDITOR) ? $selected = ' selected' : $selected = '');  
+$template->set_var('SELECTED', $selected);  
+$template->parse('editor_list', 'editor_list_block', true);  
+$result = $database->query("SELECT * FROM ".TABLE_PREFIX."addons WHERE type = 'module' AND function = 'wysiwyg'");
+if($result->numRows() > 0) {
+	while($addon = $result->fetchRow()) {
+		$template->set_var('FILE', $addon['directory']);
+		$template->set_var('NAME', $addon['name']);
+		if((defined('WYSIWYG_EDITOR') AND $addon['directory'] == WYSIWYG_EDITOR) ? $selected = ' selected' : $selected = '');
+		$template->set_var('SELECTED', $selected);
+		$template->parse('editor_list', 'editor_list_block', true);
+	}
+}
+
+// Insert templates for search settings
+$template->set_block('main_block', 'search_template_list_block', 'search_template_list');
+if($search_template == '') { $selected = ' selected'; } else { $selected = ''; }
+$template->set_var(array('FILE' => '', 'NAME' => $TEXT['SYSTEM_DEFAULT'], 'SELECTED' => $selected));
+$template->parse('search_template_list', 'search_template_list_block', true);
+$result = $database->query("SELECT * FROM ".TABLE_PREFIX."addons WHERE type = 'template' order by name");
+if($result->numRows() > 0) {
+	while($addon = $result->fetchRow()) {
+		$template->set_var('FILE', $addon['directory']);
+		$template->set_var('NAME', $addon['name']);
+		if($addon['directory'] == $search_template ? $selected = ' selected' : $selected = '');
+		$template->set_var('SELECTED', $selected);
+		$template->parse('search_template_list', 'search_template_list_block', true);
+	}
+}
+
+// Insert default error reporting values
+require(ADMIN_PATH.'/interface/er_levels.php');
+$template->set_block('main_block', 'error_reporting_list_block', 'error_reporting_list');
+foreach($ER_LEVELS AS $value => $title) {
+	$template->set_var('VALUE', $value);
+	$template->set_var('NAME', $title);
+	if(ER_LEVEL == $value) {
+		$template->set_var('SELECTED', 'selected');
+	} else {
+		$template->set_var('SELECTED', '');
+	}
+	$template->parse('error_reporting_list', 'error_reporting_list_block', true);
+}
+
+// Insert permissions values
+if($admin->get_permission('settings_advanced') != true) {
+	$template->set_var('DISPLAY_ADVANCED_BUTTON', 'hide');
+}
+
+// Insert page level limits
+$template->set_block('main_block', 'page_level_limit_list_block', 'page_level_limit_list');
+for($i = 1; $i <= 10; $i++) {
+	$template->set_var('NUMBER', $i);
+	if(PAGE_LEVEL_LIMIT == $i) {
+		$template->set_var('SELECTED', 'selected');
+	} else {
+		$template->set_var('SELECTED', '');
+	}
+	$template->parse('page_level_limit_list', 'page_level_limit_list_block', true);
+}
+
+// Work-out if multiple menus feature is enabled
+if(defined('MULTIPLE_MENUS') AND MULTIPLE_MENUS == true) {
+	$template->set_var('MULTIPLE_MENUS_ENABLED', ' checked');
+} else {
+	$template->set_var('MULTIPLE_MENUS_DISABLED', ' checked');
+}
+
+// Work-out if page languages feature is enabled
+if(defined('PAGE_LANGUAGES') AND PAGE_LANGUAGES == true) {
+        $template->set_var('PAGE_LANGUAGES_ENABLED', ' checked');
+} else {
+        $template->set_var('PAGE_LANGUAGES_DISABLED', ' checked');
+}
+
+// Work-out if smart login feature is enabled
+if(defined('SMART_LOGIN') AND SMART_LOGIN == true) {
+	$template->set_var('SMART_LOGIN_ENABLED', ' checked');
+} else {
+	$template->set_var('SMART_LOGIN_DISABLED', ' checked');
+}
+
+// Work-out if captcha verification feature is enabled
+if(defined('CAPTCHA_VERIFICATION') AND CAPTCHA_VERIFICATION == true) {
+	$template->set_var('CAPTCHA_VERIFICATION_ENABLED', ' checked');
+} else {
+	$template->set_var('CAPTCHA_VERIFICATION_DISABLED', ' checked');
+}
+if(extension_loaded('gd') AND function_exists('imageCreateFromJpeg')) { /* Make's sure GD library is installed */
+	$template->set_var('GD_EXTENSION_ENABLED', '');
+} else {
+	$template->set_var('GD_EXTENSION_ENABLED', 'none');
+}
+
+// Work-out if section blocks feature is enabled
+if(defined('SECTION_BLOCKS') AND SECTION_BLOCKS == true) {
+	$template->set_var('SECTION_BLOCKS_ENABLED', ' checked');
+} else {
+	$template->set_var('SECTION_BLOCKS_DISABLED', ' checked');
+}
+
+// Work-out if homepage redirection feature is enabled
+if(defined('HOMEPAGE_REDIRECTION') AND HOMEPAGE_REDIRECTION == true) {
+	$template->set_var('HOMEPAGE_REDIRECTION_ENABLED', ' checked');
+} else {
+	$template->set_var('HOMEPAGE_REDIRECTION_DISABLED', ' checked');
+}
+
+// Work-out which server os should be checked
+if(OPERATING_SYSTEM == 'linux') {
+	$template->set_var('LINUX_SELECTED', ' checked');
+} elseif(OPERATING_SYSTEM == 'windows') {
+	$template->set_var('WINDOWS_SELECTED', ' checked');
+}
+
+// Work-out if manage sections feature is enabled
+if(MANAGE_SECTIONS) {
+	$template->set_var('MANAGE_SECTIONS_ENABLED', ' checked');
+} else {
+	$template->set_var('MANAGE_SECTIONS_DISABLED', ' checked');
+}
+
+// Work-out which wbmailer routine should be checked
+if(WBMAILER_ROUTINE == 'phpmail') {
+	$template->set_var('PHPMAIL_SELECTED', ' checked');
+	$template->set_var('SMTP_VISIBILITY', 'hidden');
+	$template->set_var('SMTP_VISIBILITY_AUTH', 'hidden');
+} elseif(WBMAILER_ROUTINE == 'smtp') {
+	$template->set_var('SMTPMAIL_SELECTED', ' checked');
+	$template->set_var('SMTP_VISIBILITY', 'visible');
+}
+
+// Work-out if SMTP authentification should be checked
+if(WBMAILER_SMTP_AUTH) {
+	$template->set_var('SMTP_AUTH_SELECTED', ' checked');
+	if(WBMAILER_ROUTINE == 'smtp') {
+		$template->set_var('SMTP_VISIBILITY_AUTH', 'visible');
+	} else {
+		$template->set_var('SMTP_VISIBILITY_AUTH', 'hidden');
+	}
+} else {
+	$template->set_var('SMTP_VISIBILITY_AUTH', 'hidden');
+}
+
+// Work-out if intro feature is enabled
+if(INTRO_PAGE) {
+	$template->set_var('INTRO_PAGE_ENABLED', ' checked');
+} else {
+	$template->set_var('INTRO_PAGE_DISABLED', ' checked');
+}
+
+// Work-out if frontend login feature is enabled
+if(FRONTEND_LOGIN) {
+	$template->set_var('PRIVATE_ENABLED', ' checked');
+} else {
+	$template->set_var('PRIVATE_DISABLED', ' checked');
+}
+
+// Work-out if page trash feature is disabled, in-line, or separate
+if(PAGE_TRASH == 'disabled') {
+	$template->set_var('PAGE_TRASH_DISABLED', ' checked');
+	$template->set_var('DISPLAY_PAGE_TRASH_SEPARATE', ' display: none;');
+} elseif(PAGE_TRASH == 'inline') {
+	$template->set_var('PAGE_TRASH_INLINE', ' checked');
+	$template->set_var('DISPLAY_PAGE_TRASH_SEPARATE', ' display: none;');
+} elseif(PAGE_TRASH == 'separate') {
+	$template->set_var('PAGE_TRASH_SEPARATE', ' checked');
+	$template->set_var('DISPLAY_PAGE_TRASH_SEPARATE', ' display: inline;');
+}
+
+// Work-out if media home folde feature is enabled
+if(HOME_FOLDERS) {
+	$template->set_var('HOME_FOLDERS_ENABLED', ' checked');
+} else {
+	$template->set_var('HOME_FOLDERS_DISABLED', ' checked');
+}
+
+// Insert search select
+if(SEARCH == 'private') {
+	$template->set_var('PRIVATE_SEARCH', 'selected');
+} elseif(SEARCH == 'registered') {
+	$template->set_var('REGISTERED_SEARCH', 'selected');
+} elseif(SEARCH == 'none') {
+	$template->set_var('NONE_SEARCH', 'selected');
+}
+
+// Work-out if 777 permissions are set
+if(STRING_FILE_MODE == '0777' AND STRING_DIR_MODE == '0777') {
+	$template->set_var('WORLD_WRITEABLE_SELECTED', ' checked');
+}
+
+// Work-out which file mode boxes are checked
+if(extract_permission(STRING_FILE_MODE, 'u', 'r')) {
+	$template->set_var('FILE_U_R_CHECKED', 'checked');
+}
+if(extract_permission(STRING_FILE_MODE, 'u', 'w')) {
+	$template->set_var('FILE_U_W_CHECKED', 'checked');
+}
+if(extract_permission(STRING_FILE_MODE, 'u', 'e')) {
+	$template->set_var('FILE_U_E_CHECKED', 'checked');
+}
+if(extract_permission(STRING_FILE_MODE, 'g', 'r')) {
+	$template->set_var('FILE_G_R_CHECKED', 'checked');
+}
+if(extract_permission(STRING_FILE_MODE, 'g', 'w')) {
+	$template->set_var('FILE_G_W_CHECKED', 'checked');
+}
+if(extract_permission(STRING_FILE_MODE, 'g', 'e')) {
+	$template->set_var('FILE_G_E_CHECKED', 'checked');
+}
+if(extract_permission(STRING_FILE_MODE, 'o', 'r')) {
+	$template->set_var('FILE_O_R_CHECKED', 'checked');
+}
+if(extract_permission(STRING_FILE_MODE, 'o', 'w')) {
+	$template->set_var('FILE_O_W_CHECKED', 'checked');
+}
+if(extract_permission(STRING_FILE_MODE, 'o', 'e')) {
+	$template->set_var('FILE_O_E_CHECKED', 'checked');
+}
+// Work-out which dir mode boxes are checked
+if(extract_permission(STRING_DIR_MODE, 'u', 'r')) {
+	$template->set_var('DIR_U_R_CHECKED', 'checked');
+}
+if(extract_permission(STRING_DIR_MODE, 'u', 'w')) {
+	$template->set_var('DIR_U_W_CHECKED', 'checked');
+}
+if(extract_permission(STRING_DIR_MODE, 'u', 'e')) {
+	$template->set_var('DIR_U_E_CHECKED', 'checked');
+}
+if(extract_permission(STRING_DIR_MODE, 'g', 'r')) {
+	$template->set_var('DIR_G_R_CHECKED', 'checked');
+}
+if(extract_permission(STRING_DIR_MODE, 'g', 'w')) {
+	$template->set_var('DIR_G_W_CHECKED', 'checked');
+}
+if(extract_permission(STRING_DIR_MODE, 'g', 'e')) {
+	$template->set_var('DIR_G_E_CHECKED', 'checked');
+}
+if(extract_permission(STRING_DIR_MODE, 'o', 'r')) {
+	$template->set_var('DIR_O_R_CHECKED', 'checked');
+}
+if(extract_permission(STRING_DIR_MODE, 'o', 'w')) {
+	$template->set_var('DIR_O_W_CHECKED', 'checked');
+}
+if(extract_permission(STRING_DIR_MODE, 'o', 'e')) {
+	$template->set_var('DIR_O_E_CHECKED', 'checked');
+}
+
+// Insert Server Email value into template
+$template->set_var('SERVER_EMAIL', SERVER_EMAIL);
+
+// Insert groups into signup list
+$template->set_block('main_block', 'group_list_block', 'group_list');
+$results = $database->query("SELECT group_id, name FROM ".TABLE_PREFIX."groups WHERE group_id != '1'");
+if($results->numRows() > 0) {
+	while($group = $results->fetchRow()) {
+		$template->set_var('ID', $group['group_id']);
+		$template->set_var('NAME', $group['name']);
+		if(FRONTEND_SIGNUP == $group['group_id']) {
+			$template->set_var('SELECTED', 'selected');
+		} else {
+			$template->set_var('SELECTED', '');
+		}
+		$template->parse('group_list', 'group_list_block', true);
+	}
+} else {
+	$template->set_var('ID', 'disabled');
+	$template->set_var('NAME', $MESSAGE['GROUPS']['NO_GROUPS_FOUND']);
+	$template->parse('group_list', 'group_list_block', true);
+}
+
+// Insert language headings
+$template->set_var(array(
+								'HEADING_GENERAL_SETTINGS' => $HEADING['GENERAL_SETTINGS'],
+								'HEADING_DEFAULT_SETTINGS' => $HEADING['DEFAULT_SETTINGS'],
+								'HEADING_SEARCH_SETTINGS' => $HEADING['SEARCH_SETTINGS'],
+								'HEADING_SERVER_SETTINGS' => $HEADING['SERVER_SETTINGS'],
+								'HEADING_WBMAILER_SETTINGS' => $HEADING['WBMAILER_SETTINGS'],
+								'HEADING_ADMINISTRATION_TOOLS' => $HEADING['ADMINISTRATION_TOOLS']
+								)
+						);
+// Insert language text and messages
+$template->set_var(array(
+								'TEXT_WEBSITE_TITLE' => $TEXT['WEBSITE_TITLE'],
+								'TEXT_WEBSITE_DESCRIPTION' => $TEXT['WEBSITE_DESCRIPTION'],
+								'TEXT_WEBSITE_KEYWORDS' => $TEXT['WEBSITE_KEYWORDS'],
+								'TEXT_WEBSITE_HEADER' => $TEXT['WEBSITE_HEADER'],
+								'TEXT_WEBSITE_FOOTER' => $TEXT['WEBSITE_FOOTER'],
+								'TEXT_HEADER' => $TEXT['HEADER'],
+								'TEXT_FOOTER' => $TEXT['FOOTER'],
+								'TEXT_VISIBILITY' => $TEXT['VISIBILITY'],
+								'TEXT_RESULTS_HEADER' => $TEXT['RESULTS_HEADER'],
+								'TEXT_RESULTS_LOOP' => $TEXT['RESULTS_LOOP'],
+								'TEXT_RESULTS_FOOTER' => $TEXT['RESULTS_FOOTER'],
+								'TEXT_NO_RESULTS' => $TEXT['NO_RESULTS'],
+								'TEXT_TEXT' => $TEXT['TEXT'],
+								'TEXT_DEFAULT' => $TEXT['DEFAULT'],
+								'TEXT_LANGUAGE' => $TEXT['LANGUAGE'],
+								'TEXT_TIMEZONE' => $TEXT['TIMEZONE'],
+								'TEXT_CHARSET' => $TEXT['CHARSET'],
+								'TEXT_DATE_FORMAT' => $TEXT['DATE_FORMAT'],
+								'TEXT_TIME_FORMAT' => $TEXT['TIME_FORMAT'],
+								'TEXT_TEMPLATE' => $TEXT['TEMPLATE'],
+								'TEXT_WYSIWYG_EDITOR' => $TEXT['WYSIWYG_EDITOR'],
+								'TEXT_PAGE_LEVEL_LIMIT' => $TEXT['PAGE_LEVEL_LIMIT'],
+								'TEXT_INTRO_PAGE' => $TEXT['INTRO_PAGE'],
+								'TEXT_FRONTEND' => $TEXT['FRONTEND'],
+								'TEXT_LOGIN' => $TEXT['LOGIN'],
+								'TEXT_SIGNUP' => $TEXT['SIGNUP'],
+								'TEXT_PHP_ERROR_LEVEL' => $TEXT['PHP_ERROR_LEVEL'],
+								'TEXT_PAGES_DIRECTORY' => $TEXT['PAGES_DIRECTORY'],
+								'TEXT_MEDIA_DIRECTORY' => $TEXT['MEDIA_DIRECTORY'],
+								'TEXT_PAGE_EXTENSION' => $TEXT['PAGE_EXTENSION'],
+								'TEXT_PAGE_SPACER' => $TEXT['PAGE_SPACER'],
+								'TEXT_RENAME_FILES_ON_UPLOAD' => $TEXT['RENAME_FILES_ON_UPLOAD'],
+								'TEXT_APP_NAME' => $TEXT['APP_NAME'],
+								'TEXT_SESSION_IDENTIFIER' => $TEXT['SESSION_IDENTIFIER'],
+								'TEXT_SERVER_OPERATING_SYSTEM' => $TEXT['SERVER_OPERATING_SYSTEM'],
+								'TEXT_LINUX_UNIX_BASED' => $TEXT['LINUX_UNIX_BASED'],
+								'TEXT_WINDOWS' => $TEXT['WINDOWS'],
+								'TEXT_ADMIN' => $TEXT['ADMIN'],
+								'TEXT_TYPE' => $TEXT['TYPE'],
+								'TEXT_DATABASE' => $TEXT['DATABASE'],
+								'TEXT_HOST' => $TEXT['HOST'],
+								'TEXT_USERNAME' => $TEXT['USERNAME'],
+								'TEXT_PASSWORD' => $TEXT['PASSWORD'],
+								'TEXT_NAME' => $TEXT['NAME'],
+								'TEXT_TABLE_PREFIX' => $TEXT['TABLE_PREFIX'],
+								'TEXT_SAVE' => $TEXT['SAVE'],
+								'TEXT_RESET' => $TEXT['RESET'],
+								'TEXT_CHANGES' => $TEXT['CHANGES'],
+								'TEXT_ENABLED' => $TEXT['ENABLED'],
+								'TEXT_DISABLED' => $TEXT['DISABLED'],
+								'TEXT_MANAGE_SECTIONS' => $HEADING['MANAGE_SECTIONS'],
+								'TEXT_MANAGE' => $TEXT['MANAGE'],
+								'TEXT_SEARCH' => $TEXT['SEARCH'],
+								'TEXT_PUBLIC' => $TEXT['PUBLIC'],
+								'TEXT_PRIVATE' => $TEXT['PRIVATE'],
+								'TEXT_REGISTERED' => $TEXT['REGISTERED'],
+								'TEXT_NONE' => $TEXT['NONE'],
+								'TEXT_FILES' => strtoupper(substr($TEXT['FILES'], 0, 1)).substr($TEXT['FILES'], 1),
+								'TEXT_DIRECTORIES' => $TEXT['DIRECTORIES'],
+								'TEXT_FILESYSTEM_PERMISSIONS' => $TEXT['FILESYSTEM_PERMISSIONS'],
+								'TEXT_USER' => $TEXT['USER'],
+								'TEXT_GROUP' => $TEXT['GROUP'],
+								'TEXT_OTHERS' => $TEXT['OTHERS'],
+								'TEXT_READ' => $TEXT['READ'],
+								'TEXT_WRITE' => $TEXT['WRITE'],
+								'TEXT_EXECUTE' => $TEXT['EXECUTE'],
+								'TEXT_SMART_LOGIN' => $TEXT['SMART_LOGIN'],
+								'TEXT_CAPTCHA_VERIFICATION' => $TEXT['CAPTCHA_VERIFICATION'],
+								'TEXT_MULTIPLE_MENUS' => $TEXT['MULTIPLE_MENUS'],
+								'TEXT_HOMEPAGE_REDIRECTION' => $TEXT['HOMEPAGE_REDIRECTION'],
+								'TEXT_SECTION_BLOCKS' => $TEXT['SECTION_BLOCKS'],
+								'TEXT_PLEASE_SELECT' => $TEXT['PLEASE_SELECT'],
+								'TEXT_PAGE_TRASH' => $TEXT['PAGE_TRASH'],
+								'TEXT_PAGE_LANGUAGES' => $TEXT['PAGE_LANGUAGES'],
+								'TEXT_INLINE' => $TEXT['INLINE'],
+								'TEXT_SEPARATE' => $TEXT['SEPARATE'],
+								'TEXT_HOME_FOLDERS' => $TEXT['HOME_FOLDERS'],
+								'TEXT_WYSIWYG_STYLE' => $TEXT['WYSIWYG_STYLE'],
+								'TEXT_SERVER_EMAIL' => $TEXT['SERVER_EMAIL'],
+								'TEXT_WORLD_WRITEABLE_FILE_PERMISSIONS' => $TEXT['WORLD_WRITEABLE_FILE_PERMISSIONS'],
+								'TEXT_WBMAILER_NOTICE' => $TEXT['WBMAILER_NOTICE'],
+								'TEXT_WBMAILER_FUNCTION' => $TEXT['WBMAILER_FUNCTION'],
+								'TEXT_WBMAILER_SMTP_HOST' => $TEXT['WBMAILER_SMTP_HOST'],
+								'TEXT_WBMAILER_PHP' => $TEXT['WBMAILER_PHP'],
+								'TEXT_WBMAILER_SMTP' => $TEXT['WBMAILER_SMTP'],
+								'TEXT_WBMAILER_SMTP_AUTH' => $TEXT['WBMAILER_SMTP_AUTH'],
+								'TEXT_WBMAILER_SMTP_AUTH_NOTICE' => $TEXT['WBMAILER_SMTP_AUTH_NOTICE'],
+								'TEXT_WBMAILER_SMTP_USERNAME' => $TEXT['WBMAILER_SMTP_USERNAME'],
+								'TEXT_WBMAILER_SMTP_PASSWORD' => $TEXT['WBMAILER_SMTP_PASSWORD'],
+								'MODE_SWITCH_WARNING' => $MESSAGE['SETTINGS']['MODE_SWITCH_WARNING'],
+								'WORLD_WRITEABLE_WARNING' => $MESSAGE['SETTINGS']['WORLD_WRITEABLE_WARNING'],
+								'TEXT_MODULE_ORDER' => $TEXT['MODULE_ORDER'],
+								'TEXT_MAX_EXCERPT' => $TEXT['MAX_EXCERPT']
+								)
+						);
+
+// Parse template objects output
+$template->parse('main', 'main_block', false);
+$template->pparse('output', 'page');
+
+$admin->print_footer();
+
+?>
Index: trunk/wb/admin/settings/template.html
===================================================================
--- trunk/wb/admin/settings/template.html	(revision 551)
+++ trunk/wb/admin/settings/template.html	(revision 552)
@@ -1,670 +1,682 @@
-</div><!-- BEGIN main_block -->
-
-<script language="javascript" type="text/javascript">
-function change_os(type) {
-	if(type == 'linux') {
-		document.getElementById('file_perms_box1').style.display = 'block';
-		document.getElementById('file_perms_box2').style.display = 'block';
-		document.getElementById('file_perms_box3').style.display = 'block';
-	} else if(type == 'windows') {
-		document.getElementById('file_perms_box1').style.display = 'none';
-		document.getElementById('file_perms_box2').style.display = 'none';
-		document.getElementById('file_perms_box3').style.display = 'none';
-	}
-}
-
-function change_wbmailer(type) {
-	if(type == 'smtp') {
-		document.getElementById('wbmailer_smtp_host').style.visibility = 'visible';
-		document.getElementById('wbmailer_smtp_auth_mode').style.visibility = 'visible';
-		document.getElementById('wbmailer_smtp_username').style.visibility = 'visible';
-		document.getElementById('wbmailer_smtp_password').style.visibility = 'visible';
-		if( document.settings.wbmailer_smtp_auth.checked == true ) {
-			document.getElementById('wbmailer_smtp_username').style.visibility = 'visible';
-			document.getElementById('wbmailer_smtp_password').style.visibility = 'visible';
-		} else {
-			document.getElementById('wbmailer_smtp_username').style.visibility = 'hidden';
-			document.getElementById('wbmailer_smtp_password').style.visibility = 'hidden';
-		}
-	} else if(type == 'phpmail') {
-		document.getElementById('wbmailer_smtp_host').style.visibility = 'hidden';
-		document.getElementById('wbmailer_smtp_auth_mode').style.visibility = 'hidden';
-		document.getElementById('wbmailer_smtp_username').style.visibility = 'hidden';
-		document.getElementById('wbmailer_smtp_password').style.visibility = 'hidden';
-		document.getElementById('wbmailer_smtp_username').style.visibility = 'hidden';
-		document.getElementById('wbmailer_smtp_password').style.visibility = 'hidden';
-	}
-}
-
-function toggle_wbmailer_auth() {
-	if( document.settings.wbmailer_smtp_auth.checked == true ) {
-		document.getElementById('wbmailer_smtp_username').style.visibility = 'visible';
-		document.getElementById('wbmailer_smtp_password').style.visibility = 'visible';
-	} else {
-		document.getElementById('wbmailer_smtp_username').style.visibility = 'hidden';
-		document.getElementById('wbmailer_smtp_password').style.visibility = 'hidden';
-	}
-}
-</script>
-
-<style>
-.settings_table td {
-	vertical-align: top;
-	text-align: left;
-}
-.setting_name {
-	width: 180px;
-}
-.setting_value input, .setting_value select, .setting_value textarea {
-	width: 100%;
-}
-.setting_value textarea {
-	height: 50px;
-}
-#file_mode input {
-	width: 12px;
-	height: 12px;
-}
-#dir_mode input {
-	width: 12px;
-	height: 12px;
-}
-.advanced {
-	display: {DISPLAY_ADVANCED};
-}
-.save, .reset {
-	width: 100px;
-}
-#hide2 {
-	display: none;
-}
-</style>
-
-<form name="settings" action="save.php" method="post">
-<input type="hidden" name="advanced" value="{ADVANCED}" />
-
-<table cellpadding="3" cellspacing="0" border="0" align="center" width="100%" class="settings_table">
-<tr>
-	<td colspan="3">
-		<h2>{HEADING_GENERAL_SETTINGS}</h2>
-	</td>
-</tr>
-<tr>
-	<td class="setting_name">{TEXT_WEBSITE_TITLE}:</td>
-	<td class="setting_value" colspan="2">
-		<input type="text" name="website_title" value="{WEBSITE_TITLE}" />
-	</td>
-	<script language="javascript" type="text/javascript">
-	document.settings.website_title.focus();
-	</script>
-</tr>
-<tr>
-	<td class="setting_name">{TEXT_WEBSITE_DESCRIPTION}:</td>
-	<td class="setting_value" colspan="2">
-		<textarea name="website_description">{WEBSITE_DESCRIPTION}</textarea>
-	</td>
-</tr>
-<tr>
-	<td class="setting_name">{TEXT_WEBSITE_KEYWORDS}:</td>
-	<td class="setting_value" colspan="2">
-		<textarea name="website_keywords">{WEBSITE_KEYWORDS}</textarea>
-	</td>
-</tr>
-<tr class="advanced">
-	<td class="setting_name">{TEXT_WEBSITE_HEADER}:</td>
-	<td class="setting_value" colspan="2">
-		<textarea name="website_header">{WEBSITE_HEADER}</textarea>
-	</td>
-</tr>
-<tr>
-	<td class="setting_name">{TEXT_WEBSITE_FOOTER}:</td>
-	<td class="setting_value" colspan="2">
-		<textarea name="website_footer">{WEBSITE_FOOTER}</textarea>
-	</td>
-</tr>
-<tr class="advanced">
-	<td class="setting_name">{TEXT_PAGE_LEVEL_LIMIT}:</td>
-	<td class="setting_value" colspan="2">
-		<select name="page_level_limit">
-		<!-- BEGIN page_level_limit_list_block -->
-			<option value="{NUMBER}"{SELECTED}>{NUMBER}</option>
-		<!-- END page_level_limit_list_block -->
-		</select>
-	</td>
-</tr>
-<tr>
-	<td class="setting_name">{TEXT_PAGE_TRASH}:</td>
-	<td class="setting_value" colspan="2">
-		<input type="radio" name="page_trash" id="page_trash_disabled" style="width: 14px; height: 14px;" value="disabled"{PAGE_TRASH_DISABLED} />
-		<label for="page_trash_disabled">{TEXT_DISABLED}</label>
-		<input type="radio" name="page_trash" id="page_trash_inline" style="width: 14px; height: 14px;" value="inline"{PAGE_TRASH_INLINE} />
-		<label for="page_trash_inline">{TEXT_INLINE}</label>
-		<div style="margin: 0; padding: 0;{DISPLAY_PAGE_TRASH_SEPARATE}">
-			<input type="radio" name="page_trash" id="page_trash_separate" style="width: 14px; height: 14px;" value="separate"{PAGE_TRASH_SEPARATE} />
-			<label for="page_trash_separate">{TEXT_SEPARATE}</label>
-		</div>
-	</td>
-</tr>
-<tr class="advanced">
-        <td class="setting_name">{TEXT_PAGE_LANGUAGES}:</td>
-        <td class="setting_value" colspan="2">
-                <input type="radio" name="page_languages" id="page_languages_true" style="width: 14px; height: 14px;" value="true"{PAGE_LANGUAGES_ENABLED} />
-                <label for="page_languages_true">{TEXT_ENABLED}</label>
-                <input type="radio" name="page_languages" id="page_languages_false" style="width: 14px; height: 14px;" value="false"{PAGE_LANGUAGES_DISABLED} />
-                <label for="page_languages_false">{TEXT_DISABLED}</label>
-		</td>
-</tr>
-<tr class="advanced">
-	<td class="setting_name">{TEXT_MULTIPLE_MENUS}:</td>
-	<td class="setting_value" colspan="2">
-		<input type="radio" name="multiple_menus" id="multiple_menus_true" style="width: 14px; height: 14px;" value="true"{MULTIPLE_MENUS_ENABLED} />
-		<label for="multiple_menus_true">{TEXT_ENABLED}</label>
-		<input type="radio" name="multiple_menus" id="multiple_menus_false" style="width: 14px; height: 14px;" value="false"{MULTIPLE_MENUS_DISABLED} />
-		<label for="multiple_menus_false">{TEXT_DISABLED}</label>
-	</td>
-</tr>
-<tr>
-	<td class="setting_name">{TEXT_HOME_FOLDERS}:</td>
-	<td class="setting_value" colspan="2">
-		<input type="radio" name="home_folders" id="home_folders_true" style="width: 14px; height: 14px;" value="true"{HOME_FOLDERS_ENABLED} />
-		<label for="home_folders_true">{TEXT_ENABLED}</label>
-		<input type="radio" name="home_folders" id="home_folders_false" style="width: 14px; height: 14px;" value="false"{HOME_FOLDERS_DISABLED} />
-		<label for="home_folders_false">{TEXT_DISABLED}</label>
-	</td>
-</tr>
-<tr class="advanced">
-	<td class="setting_name">{TEXT_MANAGE_SECTIONS}:</td>
-	<td class="setting_value" colspan="2">
-		<input type="radio" name="manage_sections" id="manage_sections_true" style="width: 14px; height: 14px;" value="true"{MANAGE_SECTIONS_ENABLED} />
-		<label for="manage_sections_true">{TEXT_ENABLED}</label>
-		<input type="radio" name="manage_sections" id="manage_sections_false" style="width: 14px; height: 14px;" value="false"{MANAGE_SECTIONS_DISABLED} />
-		<label for="manage_sections_false">{TEXT_DISABLED}</label>
-	</td>
-</tr>
-<tr class="advanced">
-	<td class="setting_name">{TEXT_SECTION_BLOCKS}:</td>
-	<td class="setting_value" colspan="2">
-		<input type="radio" name="section_blocks" id="section_blocks_true" style="width: 14px; height: 14px;" value="true"{SECTION_BLOCKS_ENABLED} />
-		<label for="section_blocks_true">{TEXT_ENABLED}</label>
-		<input type="radio" name="section_blocks" id="section_blocks_false" style="width: 14px; height: 14px;" value="false"{SECTION_BLOCKS_DISABLED} />
-		<label for="section_blocks_false">{TEXT_DISABLED}</label>
-	</td>
-</tr>
-<tr>
-	<td class="setting_name">{TEXT_INTRO_PAGE}:</td>
-	<td class="setting_value" colspan="2">
-		<input type="radio" name="intro_page" id="intro_page_true" style="width: 14px; height: 14px;" value="true"{INTRO_PAGE_ENABLED} />
-		<label for="intro_page_true">{TEXT_ENABLED}</label>
-		<input type="radio" name="intro_page" id="intro_page_false" style="width: 14px; height: 14px;" value="false"{INTRO_PAGE_DISABLED} />
-		<label for="intro_page_false">{TEXT_DISABLED}</label>
-	</td>
-</tr>
-<tr class="advanced">
-	<td class="setting_name">{TEXT_HOMEPAGE_REDIRECTION}:</td>
-	<td class="setting_value" colspan="2">
-		<input type="radio" name="homepage_redirection" id="homepage_redirection_true" style="width: 14px; height: 14px;" value="true"{HOMEPAGE_REDIRECTION_ENABLED} />
-		<label for="homepage_redirection_true">{TEXT_ENABLED}</label>
-		<input type="radio" name="homepage_redirection" id="homepage_redirection_false" style="width: 14px; height: 14px;" value="false"{HOMEPAGE_REDIRECTION_DISABLED} />
-		<label for="homepage_redirection_false">{TEXT_DISABLED}</label>
-	</td>
-</tr>
-<tr class="advanced">
-	<td class="setting_name">{TEXT_SMART_LOGIN}:</td>
-	<td class="setting_value" colspan="2">
-		<input type="radio" name="smart_login" id="smart_login_true" style="width: 14px; height: 14px;" value="true"{SMART_LOGIN_ENABLED} />
-		<label for="smart_login_true">{TEXT_ENABLED}</label>
-		<input type="radio" name="smart_login" id="smart_login_false" style="width: 14px; height: 14px;" value="false"{SMART_LOGIN_DISABLED} />
-		<label for="smart_login_false">{TEXT_DISABLED}</label>
-	</td>
-</tr>
-<tr class="advanced" style="display: {GD_EXTENSION_LOADED};">
-	<td class="setting_name">{TEXT_CAPTCHA_VERIFICATION}:</td>
-	<td class="setting_value" colspan="2">
-		<input type="radio" name="captcha_verification" id="captcha_verification_true" style="width: 14px; height: 14px;" value="true"{CAPTCHA_VERIFICATION_ENABLED} />
-		<label for="captcha_verification_true">{TEXT_ENABLED}</label>
-		<input type="radio" name="captcha_verification" id="captcha_verification_false" style="width: 14px; height: 14px;" value="false"{CAPTCHA_VERIFICATION_DISABLED} />
-		<label for="captcha_verification_false">{TEXT_DISABLED}</label>
-	</td>
-</tr>
-<tr>
-	<td class="setting_name">{TEXT_LOGIN}:</td>
-	<td class="setting_value" colspan="2">
-		<input type="radio" name="frontend_login" id="frontend_login_true" style="width: 14px; height: 14px;" value="true"{PRIVATE_ENABLED} />
-		<label for="frontend_login_true">{TEXT_ENABLED}</label>
-		<input type="radio" name="frontend_login" id="frontend_login_false" style="width: 14px; height: 14px;" value="false"{PRIVATE_DISABLED} />
-		<label for="frontend_login_false">{TEXT_DISABLED}</label>
-	</td>
-</tr>
-<tr>
-	<td class="setting_name">{TEXT_SIGNUP}:</td>
-	<td class="setting_value" colspan="2">
-		<select name="frontend_signup">
-			<option value="false">{TEXT_DISABLED}</option>
-			<!-- BEGIN group_list_block -->
-				<option value="{ID}" {SELECTED}>{NAME}</option>
-			<!-- END group_list_block -->
-		</select>
-	</td>
-</tr>
-<tr class="advanced">
-	<td class="setting_name">{TEXT_PHP_ERROR_LEVEL}:</td>
-	<td class="setting_value" colspan="2">
-		<select name="er_level">
-			<option value="">{TEXT_PLEASE_SELECT}...</option>
-			<!-- BEGIN error_reporting_list_block -->
-				<option value="{VALUE}"{SELECTED}>{NAME}</option>
-			<!-- END error_reporting_list_block -->
-		</select>
-	</td>
-</tr>
-<tr class="advanced">
-	<td class="setting_name">{TEXT_WYSIWYG_STYLE}:</td>
-	<td class="setting_value" colspan="2">
-		<input type="text" name="wysiwyg_style" value="{WYSIWYG_STYLE}" />
-	</td>
-</tr>
-<tr class="advanced">
-	<td class="setting_name">{TEXT_SERVER_EMAIL}:</td>
-	<td class="setting_value" colspan="2">
-		<input type="text" name="server_email" value="{SERVER_EMAIL}" />
-	</td>
-</tr>
-<tr class="advanced">
-	<td class="setting_name">{TEXT_WYSIWYG_EDITOR}:</td>
-	<td class="setting_value" colspan="2">
-		<select name="wysiwyg_editor">
-		<!-- BEGIN editor_list_block -->
-			<option value="{FILE}"{SELECTED}>{NAME}</option>
-		<!-- END editor_list_block -->
-		</select>
-	</td>
-</tr>
-<tr>
-	<td>&nbsp;</td>
-	<td>
-		<input type="submit" name="submit" value="{TEXT_SAVE}" class="save" />
-		<input type="reset" name="reset" value="{TEXT_RESET}" class="reset" />
-	</td>
-	<td style="text-align: right;">
-		<button onclick="window.location = '{ADVANCED_LINK}'; return false;" class="{DISPLAY_ADVANCED_BUTTON}">{ADVANCED_BUTTON}</button>
-	</td>
-</tr>
-<tr>
-	<td colspan="3" style="padding-top: 10px;">
-		<h2>{HEADING_DEFAULT_SETTINGS}</h2>
-	</td>
-</tr>
-<tr>
-	<td class="setting_name">{TEXT_LANGUAGE}:</td>
-	<td class="setting_value" colspan="2">
-		<select name="default_language">
-			<!-- BEGIN language_list_block -->
-			<option value="{CODE}"{SELECTED}>{NAME} ({CODE})</option>
-			<!-- END language_list_block -->
-		</select>
-	</td>
-</tr>
-<tr class="advanced">
-	<td class="setting_name">{TEXT_CHARSET}:</td>
-	<td class="setting_value" colspan="2">
-		<select name="default_charset">
-			<option value="">{TEXT_PLEASE_SELECT}...</option>
-			<!-- BEGIN charset_list_block -->
-				<option value="{VALUE}" {SELECTED}>{NAME}</option>
-			<!-- END charset_list_block -->
-		</select>
-	</td>
-</tr>
-<tr>
-	<td class="setting_name">{TEXT_TIMEZONE}:</td>
-	<td class="setting_value" colspan="2">
-		<select name="default_timezone">
-			<option value="0">{TEXT_PLEASE_SELECT}...</option>
-			<!-- BEGIN timezone_list_block -->
-				<option value="{VALUE}" {SELECTED}>{NAME}</option>
-			<!-- END timezone_list_block -->
-		</select>
-	</td>
-</tr>
-<tr>
-	<td class="setting_name">{TEXT_DATE_FORMAT}:</td>
-	<td class="setting_value" colspan="2">
-		<select name="default_date_format">
-			<option value="M d Y">{TEXT_PLEASE_SELECT}...</option>
-			<!-- BEGIN date_format_list_block -->
-				<option value="{VALUE}" {SELECTED}>{NAME}</option>
-			<!-- END date_format_list_block -->
-		</select>
-	</td>
-</tr>
-<tr>
-	<td class="setting_name">{TEXT_TIME_FORMAT}:</td>
-	<td class="setting_value" colspan="2">
-		<select name="default_time_format">
-			<option value="g:i A">{TEXT_PLEASE_SELECT}...</option>
-			<!-- BEGIN time_format_list_block -->
-				<option value="{VALUE}" {SELECTED}>{NAME}</option>
-			<!-- END time_format_list_block -->
-		</select>
-	</td>
-</tr>
-<tr>
-	<td class="setting_name">{TEXT_TEMPLATE}:</td>
-	<td class="setting_value" colspan="2">
-		<select name="default_template">
-		<!-- BEGIN template_list_block -->
-			<option value="{FILE}"{SELECTED}>{NAME}</option>
-		<!-- END template_list_block -->
-		</select>
-	</td>
-</tr>
-<tr>
-	<td>&nbsp;</td>
-	<td>
-		<input type="submit" name="submit" value="{TEXT_SAVE}" class="save" />
-		<input type="reset" name="reset" value="{TEXT_RESET}" class="reset" />
-	</td>
-	<td style="text-align: right;">
-		<button onclick="window.location = '{ADVANCED_LINK}'; return false;" class="{DISPLAY_ADVANCED_BUTTON}">{ADVANCED_BUTTON}</button>
-	</td>
-</tr>
-<tr>
-	<td colspan="3" style="padding-top: 10px;">
-		<h2>{HEADING_SEARCH_SETTINGS}</h2>
-	</td>
-</tr>
-<tr>
-	<td class="setting_name">{TEXT_VISIBILITY}:</td>
-	<td class="setting_value" colspan="2">
-		<select name="search">
-			<option value="public">{TEXT_PUBLIC}</option>
-			<option value="private" {PRIVATE_SEARCH}>{TEXT_PRIVATE}</option>
-			<option value="registered" {REGISTERED_SEARCH}>{TEXT_REGISTERED}</option>
-			<option value="none" {NONE_SEARCH}>{TEXT_NONE}</option>
-		</select>
-	</td>
-</tr>
-<tr>
-	<td class="setting_name">{TEXT_TEMPLATE}:</td>
-	<td class="setting_value" colspan="2">
-		<select name="search_template">
-		<!-- BEGIN search_template_list_block -->
-			<option value="{FILE}"{SELECTED}>{NAME}</option>
-		<!-- END search_template_list_block -->
-		</select>
-	</td>
-</tr>
-<tr class="advanced">
-	<td class="setting_name">{TEXT_HEADER}:</td>
-	<td class="setting_value" colspan="2">
-		<textarea name="search_header" style="height: 100px;">{SEARCH_HEADER}</textarea>
-	</td>
-</tr>
-<tr class="advanced">
-	<td class="setting_name">{TEXT_RESULTS_HEADER}:</td>
-	<td class="setting_value" colspan="2">
-		<textarea name="search_results_header">{SEARCH_RESULTS_HEADER}</textarea>
-	</td>
-</tr>
-<tr class="advanced">
-	<td class="setting_name">{TEXT_RESULTS_LOOP}:</td>
-	<td class="setting_value" colspan="2">
-		<textarea name="search_results_loop">{SEARCH_RESULTS_LOOP}</textarea>
-	</td>
-</tr>
-<tr class="advanced">
-	<td class="setting_name">{TEXT_RESULTS_FOOTER}:</td>
-	<td class="setting_value" colspan="2">
-		<textarea name="search_results_footer">{SEARCH_RESULTS_FOOTER}</textarea>
-	</td>
-</tr>
-<tr class="advanced">
-	<td class="setting_name">{TEXT_NO_RESULTS}:</td>
-	<td class="setting_value" colspan="2">
-		<input type="text" name="search_no_results" value="{SEARCH_NO_RESULTS}" />
-	</td>
-</tr>
-<tr class="advanced">
-	<td class="setting_name">{TEXT_FOOTER}:</td>
-	<td class="setting_value" colspan="2">
-		<textarea name="search_footer">{SEARCH_FOOTER}</textarea>
-	</td>
-</tr>
-<tr>
-	<td>&nbsp;</td>
-	<td>
-		<input type="submit" name="submit" value="{TEXT_SAVE}" class="save" />
-		<input type="reset" name="reset" value="{TEXT_RESET}" class="reset" />
-	</td>
-	<td style="text-align: right;">
-		<button onclick="window.location = '{ADVANCED_LINK}'; return false;" class="{DISPLAY_ADVANCED_BUTTON}">{ADVANCED_BUTTON}</button>
-	</td>
-</tr>
-<tr>
-	<td colspan="3" style="padding-top: 10px;">
-		<h2>{HEADING_SERVER_SETTINGS}</h2>
-	</td>
-</tr>
-<tr>
-	<td class="setting_name">{TEXT_SERVER_OPERATING_SYSTEM}:</td>
-	<td class="setting_value" colspan="2">
-		<input type="radio" name="operating_system" id="operating_system_linux" onclick="javascript: change_os('linux');" style="width: 14px; height: 14px;" value="linux"{LINUX_SELECTED} />
-		<label for="operating_system_linux" onclick="javascript: change_os('linux');">{TEXT_LINUX_UNIX_BASED}</label>
-		<input type="radio" name="operating_system" id="operating_system_windows" onclick="javascript: change_os('windows');"" style="width: 14px; height: 14px;" value="windows"{WINDOWS_SELECTED} />
-		<label for="operating_system_windows" onclick="javascript: change_os('windows');">{TEXT_WINDOWS}</label>
-	</td>
-</tr>
-<tr>
-	<td class="setting_name"><div id="{BASIC_FILE_PERMS_ID}1" style="margin: 0; padding: 0;">&nbsp;</div></td>
-	<td class="setting_value" colspan="3">
-		<div id="{BASIC_FILE_PERMS_ID}2" style="margin: 0; padding: 0;">
-			<input type="checkbox" name="world_writeable" id="world_writeable" style="width: 14px; height: 14px;" value="true"{WORLD_WRITEABLE_SELECTED} />
-			<label for="world_writeable">
-				{TEXT_WORLD_WRITEABLE_FILE_PERMISSIONS} (777)
-			</label>
-			<br />
-			<font class="note">({WORLD_WRITEABLE_WARNING})</font>
-		</div>
-		<div id="{BASIC_FILE_PERMS_ID}3" style="margin: 0; padding: 0;"></div>
-	</td>
-</tr>
-<tr class="advanced">
-	<td class="setting_name"><div id="{ADVANCED_FILE_PERMS_ID}1" style="margin: 0; padding: 0;">{TEXT_FILESYSTEM_PERMISSIONS}:</div></td>
-	<td class="setting_value" id="file_mode" align="left">
-		<table cellpadding="2" cellspacing="0" border="0" width="100%" style="border-right: 1px solid #DDDDDD;" id="{ADVANCED_FILE_PERMS_ID}2">
-		<tr>
-			<td colspan="3" style="text-align: center; font-weight: bold;">
-				{TEXT_FILES}:
-			</td>
-		</tr>
-		<tr>
-			<td>{TEXT_USER}:</td>
-			<td>{TEXT_GROUP}:</td>
-			<td>{TEXT_OTHERS}:</td>
-		</tr>
-		<tr>
-			<td>
-				<input type="checkbox" name="file_u_r" id="file_u_r" value="true"{FILE_U_R_CHECKED} />
-				<label for="file_u_r">{TEXT_READ}</label>
-				<br />
-				<input type="checkbox" name="file_u_w" id="file_u_w" value="true"{FILE_U_W_CHECKED} />
-				<label for="file_u_w">{TEXT_WRITE}</label>
-				<br />
-				<input type="checkbox" name="file_u_e" id="file_u_e" value="true"{FILE_U_E_CHECKED} />
-				<label for="file_u_e">{TEXT_EXECUTE}</label>
-			</td>
-			<td>
-				<input type="checkbox" name="file_g_r" id="file_g_r" value="true"{FILE_G_R_CHECKED} />
-				<label for="file_g_r">{TEXT_READ}</label>
-				<br />
-				<input type="checkbox" name="file_g_w" id="file_g_w" value="true"{FILE_G_W_CHECKED} />
-				<label for="file_g_w">{TEXT_WRITE}</label>
-				<br />
-				<input type="checkbox" name="file_g_e" id="file_g_e" value="true"{FILE_G_E_CHECKED} />
-				<label for="file_g_e">{TEXT_EXECUTE}</label>
-			</td>
-			<td>
-				<input type="checkbox" name="file_o_r" id="file_o_r" value="true"{FILE_O_R_CHECKED} />
-				<label for="file_o_r">{TEXT_READ}</label>
-				<br />
-				<input type="checkbox" name="file_o_w" id="file_o_w" value="true"{FILE_O_W_CHECKED} />
-				<label for="file_o_w">{TEXT_WRITE}</label>
-				<br />
-				<input type="checkbox" name="file_o_e" id="file_o_e" value="true"{FILE_O_E_CHECKED} />
-				<label for="file_o_e">{TEXT_EXECUTE}</label>
-			</td>
-		</tr>
-		</table>
-	</td>
-	<td class="setting_value" id="dir_mode" style="text-align: right;">
-		<table cellpadding="2" cellspacing="0" border="0" width="100%" id="{ADVANCED_FILE_PERMS_ID}3">
-		<tr>
-			<td colspan="3" style="text-align: center; font-weight: bold;">
-				{TEXT_DIRECTORIES}:
-			</td>
-		</tr>
-		<tr>
-			<td>{TEXT_USER}:</td>
-			<td>{TEXT_GROUP}:</td>
-			<td>{TEXT_OTHERS}:</td>
-		</tr>
-		<tr>
-			<td>
-				<input type="checkbox" name="dir_u_r" id="dir_u_r" value="true"{DIR_U_R_CHECKED} />
-				<label for="dir_u_r">{TEXT_READ}</label>
-				<br />
-				<input type="checkbox" name="dir_u_w" id="dir_u_w" value="true"{DIR_U_W_CHECKED} />
-				<label for="dir_u_w">{TEXT_WRITE}</label>
-				<br />
-				<input type="checkbox" name="dir_u_e" id="dir_u_e" value="true"{DIR_U_E_CHECKED} />
-				<label for="dir_u_e">{TEXT_EXECUTE}</label>
-			</td>
-			<td>
-				<input type="checkbox" name="dir_g_r" id="dir_g_r" value="true"{DIR_G_R_CHECKED} />
-				<label for="dir_g_r">{TEXT_READ}</label>
-				<br />
-				<input type="checkbox" name="dir_g_w" id="dir_g_w" value="true"{DIR_G_W_CHECKED} />
-				<label for="dir_g_w">{TEXT_WRITE}</label>
-				<br />
-				<input type="checkbox" name="dir_g_e" id="dir_g_e" value="true"{DIR_G_E_CHECKED} />
-				<label for="dir_g_e">{TEXT_EXECUTE}</label>
-			</td>
-			<td>
-				<input type="checkbox" name="dir_o_r" id="dir_o_r" value="true"{DIR_O_R_CHECKED} />
-				<label for="dir_o_r">{TEXT_READ}</label>
-				<br />
-				<input type="checkbox" name="dir_o_w" id="dir_o_w" value="true"{DIR_O_W_CHECKED} />
-				<label for="dir_o_w">{TEXT_WRITE}</label>
-				<br />
-				<input type="checkbox" name="dir_o_e" id="dir_o_e" value="true"{DIR_O_E_CHECKED} />
-				<label for="dir_o_e">{TEXT_EXECUTE}</label>
-			</td>
-		</tr>
-		</table>
-	</td>
-</tr>
-<tr class="advanced">
-	<td class="setting_name">{TEXT_PAGES_DIRECTORY}:</td>
-	<td class="setting_value" colspan="2">
-		<input type="text" name="pages_directory" value="{PAGES_DIRECTORY}" />
-	</td>
-</tr>
-<tr class="advanced">
-	<td class="setting_name">{TEXT_MEDIA_DIRECTORY}:</td>
-	<td class="setting_value" colspan="2">
-		<input type="text" name="media_directory" value="{MEDIA_DIRECTORY}" />
-	</td>
-</tr>
-<!-- The following lines are deactivated as the Page Extension Feature doesn't work on every server
-<tr class="advanced">
-	<td class="setting_name">{TEXT_PAGE_EXTENSION}:</td>
-	<td class="setting_value" colspan="2">
-		<input type="text" name="page_extension" value="{PAGE_EXTENSION}" />
-	</td>
-</tr>
--->
-<tr class="advanced">
-	<td class="setting_name">{TEXT_PAGE_SPACER}:</td>
-	<td class="setting_value" colspan="2">
-		<input type="text" name="page_spacer" value="{PAGE_SPACER}" />
-	</td>
-</tr>
-<tr class="advanced">
-	<td class="setting_name">{TEXT_RENAME_FILES_ON_UPLOAD}:</td>
-	<td class="setting_value" colspan="2">
-		<input type="text" name="rename_files_on_upload" value="{RENAME_FILES_ON_UPLOAD}" />
-	</td>
-</tr>
-<tr class="advanced">
-	<td class="setting_name">{TEXT_SESSION_IDENTIFIER}:</td>
-	<td class="setting_value" colspan="2">
-		<input type="text" name="app_name" value="{APP_NAME}" />
-	</td>
-</tr>
-<tr>
-	<td colspan="3" style="padding-top: 10px;">
-		<h2>{HEADING_WBMAILER_SETTINGS}</h2>
-		<div style="border: 1px solid #CCC; background-color: #EEE; padding: 5px;">
-			<strong> Please Note:</strong>
-			<br \>
-			{TEXT_WBMAILER_NOTICE}
-		</div>
-	</td>
-</tr>
-<tr>
-	<td class="setting_name">{TEXT_WBMAILER_FUNCTION}:</td>
-	<td class="setting_value" colspan="2">
-		<input type="radio" name="wbmailer_routine" id="wbmailer_routine_phpmail" onclick="javascript: change_wbmailer('phpmail');" style="width: 14px; height: 14px;" value="phpmail"{PHPMAIL_SELECTED} />
-		<label for="wbmailer_routine_phpmail" onclick="javascript: change_wbmailer('phpmail');">{TEXT_WBMAILER_PHP}</label>
-		<input type="radio" name="wbmailer_routine" id="wbmailer_routine_smtp" onclick="javascript: change_wbmailer('smtp');"" style="width: 14px; height: 14px;" value="smtp"{SMTPMAIL_SELECTED} />
-		<label for="wbmailer_routine_smtp" onclick="javascript: change_wbmailer('smtp');">{TEXT_WBMAILER_SMTP}</label>
-	</td>
-</tr>
-<tr id="wbmailer_smtp_host" style="visibility:{SMTP_VISIBILITY};">
-	<td class="setting_name">{TEXT_WBMAILER_SMTP_HOST}:</td>
-	<td class="setting_value" colspan="2">
-		<input type="text" name="wbmailer_smtp_host" value="{WBMAILER_SMTP_HOST}" />
-	</td>
-</tr>
-<tr id="wbmailer_smtp_auth_mode" style="visibility:{SMTP_VISIBILITY};">
-	<td class="setting_name">{TEXT_WBMAILER_SMTP_AUTH}:</td>
-	<td class="setting_value" colspan="3">
-		<input type="checkbox" name="wbmailer_smtp_auth" id="wbmailer_smtp_auth" onclick="javascript: toggle_wbmailer_auth();" style="width: 14px; height: 14px;" value="true"{SMTP_AUTH_SELECTED} />
-		<label for="wbmailer_smtp_auth" onclick="javascript: toggle_wbmailer_auth(this.value);">({TEXT_WBMAILER_SMTP_AUTH_NOTICE})</label>
-	</td>
-</tr>
-<tr id="wbmailer_smtp_username" style="visibility:{SMTP_VISIBILITY_AUTH};">
-	<td class="setting_name">{TEXT_WBMAILER_SMTP_USERNAME}:</td>
-	<td class="setting_value" colspan="2">
-		<input type="text" name="wbmailer_smtp_username" value="{WBMAILER_SMTP_USERNAME}" />
-	</td>
-</tr>
-<tr id="wbmailer_smtp_password" style="visibility:{SMTP_VISIBILITY_AUTH};">
-	<td class="setting_name">{TEXT_WBMAILER_SMTP_PASSWORD}:</td>
-	<td class="setting_value" colspan="2">
-		<input type="password" name="wbmailer_smtp_password" value="{WBMAILER_SMTP_PASSWORD}" />
-	</td>
-</tr>
-<tr>
-	<td>&nbsp;</td>
-	<td>
-		<input type="submit" name="submit" value="{TEXT_SAVE}" class="save" />
-		<input type="reset" name="reset" value="{TEXT_RESET}" class="reset" />
-	</td>
-	<td style="text-align: right;">
-		<button onclick="window.location = '{ADVANCED_LINK}'; return false;" class="{DISPLAY_ADVANCED_BUTTON}">{ADVANCED_BUTTON}</button>
-	</td>
-</tr>
-</table>
-
-</form>
-
-<hr />
-
-<button onclick="window.location = '{ADVANCED_LINK}'; return false;" class="{DISPLAY_ADVANCED_BUTTON}">{ADVANCED_BUTTON}</button>
-
-<font class="{DISPLAY_ADVANCED_BUTTON}">
-&nbsp; {MODE_SWITCH_WARNING}
-</font>
-
-<!-- END main_block -->
\ No newline at end of file
+</div><!-- BEGIN main_block -->
+
+<script language="javascript" type="text/javascript">
+function change_os(type) {
+	if(type == 'linux') {
+		document.getElementById('file_perms_box1').style.display = 'block';
+		document.getElementById('file_perms_box2').style.display = 'block';
+		document.getElementById('file_perms_box3').style.display = 'block';
+	} else if(type == 'windows') {
+		document.getElementById('file_perms_box1').style.display = 'none';
+		document.getElementById('file_perms_box2').style.display = 'none';
+		document.getElementById('file_perms_box3').style.display = 'none';
+	}
+}
+
+function change_wbmailer(type) {
+	if(type == 'smtp') {
+		document.getElementById('wbmailer_smtp_host').style.visibility = 'visible';
+		document.getElementById('wbmailer_smtp_auth_mode').style.visibility = 'visible';
+		document.getElementById('wbmailer_smtp_username').style.visibility = 'visible';
+		document.getElementById('wbmailer_smtp_password').style.visibility = 'visible';
+		if( document.settings.wbmailer_smtp_auth.checked == true ) {
+			document.getElementById('wbmailer_smtp_username').style.visibility = 'visible';
+			document.getElementById('wbmailer_smtp_password').style.visibility = 'visible';
+		} else {
+			document.getElementById('wbmailer_smtp_username').style.visibility = 'hidden';
+			document.getElementById('wbmailer_smtp_password').style.visibility = 'hidden';
+		}
+	} else if(type == 'phpmail') {
+		document.getElementById('wbmailer_smtp_host').style.visibility = 'hidden';
+		document.getElementById('wbmailer_smtp_auth_mode').style.visibility = 'hidden';
+		document.getElementById('wbmailer_smtp_username').style.visibility = 'hidden';
+		document.getElementById('wbmailer_smtp_password').style.visibility = 'hidden';
+		document.getElementById('wbmailer_smtp_username').style.visibility = 'hidden';
+		document.getElementById('wbmailer_smtp_password').style.visibility = 'hidden';
+	}
+}
+
+function toggle_wbmailer_auth() {
+	if( document.settings.wbmailer_smtp_auth.checked == true ) {
+		document.getElementById('wbmailer_smtp_username').style.visibility = 'visible';
+		document.getElementById('wbmailer_smtp_password').style.visibility = 'visible';
+	} else {
+		document.getElementById('wbmailer_smtp_username').style.visibility = 'hidden';
+		document.getElementById('wbmailer_smtp_password').style.visibility = 'hidden';
+	}
+}
+</script>
+
+<style>
+.settings_table td {
+	vertical-align: top;
+	text-align: left;
+}
+.setting_name {
+	width: 180px;
+}
+.setting_value input, .setting_value select, .setting_value textarea {
+	width: 100%;
+}
+.setting_value textarea {
+	height: 50px;
+}
+#file_mode input {
+	width: 12px;
+	height: 12px;
+}
+#dir_mode input {
+	width: 12px;
+	height: 12px;
+}
+.advanced {
+	display: {DISPLAY_ADVANCED};
+}
+.save, .reset {
+	width: 100px;
+}
+#hide2 {
+	display: none;
+}
+</style>
+
+<form name="settings" action="save.php" method="post">
+<input type="hidden" name="advanced" value="{ADVANCED}" />
+
+<table cellpadding="3" cellspacing="0" border="0" align="center" width="100%" class="settings_table">
+<tr>
+	<td colspan="3">
+		<h2>{HEADING_GENERAL_SETTINGS}</h2>
+	</td>
+</tr>
+<tr>
+	<td class="setting_name">{TEXT_WEBSITE_TITLE}:</td>
+	<td class="setting_value" colspan="2">
+		<input type="text" name="website_title" value="{WEBSITE_TITLE}" />
+	</td>
+	<script language="javascript" type="text/javascript">
+	document.settings.website_title.focus();
+	</script>
+</tr>
+<tr>
+	<td class="setting_name">{TEXT_WEBSITE_DESCRIPTION}:</td>
+	<td class="setting_value" colspan="2">
+		<textarea name="website_description">{WEBSITE_DESCRIPTION}</textarea>
+	</td>
+</tr>
+<tr>
+	<td class="setting_name">{TEXT_WEBSITE_KEYWORDS}:</td>
+	<td class="setting_value" colspan="2">
+		<textarea name="website_keywords">{WEBSITE_KEYWORDS}</textarea>
+	</td>
+</tr>
+<tr class="advanced">
+	<td class="setting_name">{TEXT_WEBSITE_HEADER}:</td>
+	<td class="setting_value" colspan="2">
+		<textarea name="website_header">{WEBSITE_HEADER}</textarea>
+	</td>
+</tr>
+<tr>
+	<td class="setting_name">{TEXT_WEBSITE_FOOTER}:</td>
+	<td class="setting_value" colspan="2">
+		<textarea name="website_footer">{WEBSITE_FOOTER}</textarea>
+	</td>
+</tr>
+<tr class="advanced">
+	<td class="setting_name">{TEXT_PAGE_LEVEL_LIMIT}:</td>
+	<td class="setting_value" colspan="2">
+		<select name="page_level_limit">
+		<!-- BEGIN page_level_limit_list_block -->
+			<option value="{NUMBER}"{SELECTED}>{NUMBER}</option>
+		<!-- END page_level_limit_list_block -->
+		</select>
+	</td>
+</tr>
+<tr>
+	<td class="setting_name">{TEXT_PAGE_TRASH}:</td>
+	<td class="setting_value" colspan="2">
+		<input type="radio" name="page_trash" id="page_trash_disabled" style="width: 14px; height: 14px;" value="disabled"{PAGE_TRASH_DISABLED} />
+		<label for="page_trash_disabled">{TEXT_DISABLED}</label>
+		<input type="radio" name="page_trash" id="page_trash_inline" style="width: 14px; height: 14px;" value="inline"{PAGE_TRASH_INLINE} />
+		<label for="page_trash_inline">{TEXT_INLINE}</label>
+		<div style="margin: 0; padding: 0;{DISPLAY_PAGE_TRASH_SEPARATE}">
+			<input type="radio" name="page_trash" id="page_trash_separate" style="width: 14px; height: 14px;" value="separate"{PAGE_TRASH_SEPARATE} />
+			<label for="page_trash_separate">{TEXT_SEPARATE}</label>
+		</div>
+	</td>
+</tr>
+<tr class="advanced">
+        <td class="setting_name">{TEXT_PAGE_LANGUAGES}:</td>
+        <td class="setting_value" colspan="2">
+                <input type="radio" name="page_languages" id="page_languages_true" style="width: 14px; height: 14px;" value="true"{PAGE_LANGUAGES_ENABLED} />
+                <label for="page_languages_true">{TEXT_ENABLED}</label>
+                <input type="radio" name="page_languages" id="page_languages_false" style="width: 14px; height: 14px;" value="false"{PAGE_LANGUAGES_DISABLED} />
+                <label for="page_languages_false">{TEXT_DISABLED}</label>
+		</td>
+</tr>
+<tr class="advanced">
+	<td class="setting_name">{TEXT_MULTIPLE_MENUS}:</td>
+	<td class="setting_value" colspan="2">
+		<input type="radio" name="multiple_menus" id="multiple_menus_true" style="width: 14px; height: 14px;" value="true"{MULTIPLE_MENUS_ENABLED} />
+		<label for="multiple_menus_true">{TEXT_ENABLED}</label>
+		<input type="radio" name="multiple_menus" id="multiple_menus_false" style="width: 14px; height: 14px;" value="false"{MULTIPLE_MENUS_DISABLED} />
+		<label for="multiple_menus_false">{TEXT_DISABLED}</label>
+	</td>
+</tr>
+<tr>
+	<td class="setting_name">{TEXT_HOME_FOLDERS}:</td>
+	<td class="setting_value" colspan="2">
+		<input type="radio" name="home_folders" id="home_folders_true" style="width: 14px; height: 14px;" value="true"{HOME_FOLDERS_ENABLED} />
+		<label for="home_folders_true">{TEXT_ENABLED}</label>
+		<input type="radio" name="home_folders" id="home_folders_false" style="width: 14px; height: 14px;" value="false"{HOME_FOLDERS_DISABLED} />
+		<label for="home_folders_false">{TEXT_DISABLED}</label>
+	</td>
+</tr>
+<tr class="advanced">
+	<td class="setting_name">{TEXT_MANAGE_SECTIONS}:</td>
+	<td class="setting_value" colspan="2">
+		<input type="radio" name="manage_sections" id="manage_sections_true" style="width: 14px; height: 14px;" value="true"{MANAGE_SECTIONS_ENABLED} />
+		<label for="manage_sections_true">{TEXT_ENABLED}</label>
+		<input type="radio" name="manage_sections" id="manage_sections_false" style="width: 14px; height: 14px;" value="false"{MANAGE_SECTIONS_DISABLED} />
+		<label for="manage_sections_false">{TEXT_DISABLED}</label>
+	</td>
+</tr>
+<tr class="advanced">
+	<td class="setting_name">{TEXT_SECTION_BLOCKS}:</td>
+	<td class="setting_value" colspan="2">
+		<input type="radio" name="section_blocks" id="section_blocks_true" style="width: 14px; height: 14px;" value="true"{SECTION_BLOCKS_ENABLED} />
+		<label for="section_blocks_true">{TEXT_ENABLED}</label>
+		<input type="radio" name="section_blocks" id="section_blocks_false" style="width: 14px; height: 14px;" value="false"{SECTION_BLOCKS_DISABLED} />
+		<label for="section_blocks_false">{TEXT_DISABLED}</label>
+	</td>
+</tr>
+<tr>
+	<td class="setting_name">{TEXT_INTRO_PAGE}:</td>
+	<td class="setting_value" colspan="2">
+		<input type="radio" name="intro_page" id="intro_page_true" style="width: 14px; height: 14px;" value="true"{INTRO_PAGE_ENABLED} />
+		<label for="intro_page_true">{TEXT_ENABLED}</label>
+		<input type="radio" name="intro_page" id="intro_page_false" style="width: 14px; height: 14px;" value="false"{INTRO_PAGE_DISABLED} />
+		<label for="intro_page_false">{TEXT_DISABLED}</label>
+	</td>
+</tr>
+<tr class="advanced">
+	<td class="setting_name">{TEXT_HOMEPAGE_REDIRECTION}:</td>
+	<td class="setting_value" colspan="2">
+		<input type="radio" name="homepage_redirection" id="homepage_redirection_true" style="width: 14px; height: 14px;" value="true"{HOMEPAGE_REDIRECTION_ENABLED} />
+		<label for="homepage_redirection_true">{TEXT_ENABLED}</label>
+		<input type="radio" name="homepage_redirection" id="homepage_redirection_false" style="width: 14px; height: 14px;" value="false"{HOMEPAGE_REDIRECTION_DISABLED} />
+		<label for="homepage_redirection_false">{TEXT_DISABLED}</label>
+	</td>
+</tr>
+<tr class="advanced">
+	<td class="setting_name">{TEXT_SMART_LOGIN}:</td>
+	<td class="setting_value" colspan="2">
+		<input type="radio" name="smart_login" id="smart_login_true" style="width: 14px; height: 14px;" value="true"{SMART_LOGIN_ENABLED} />
+		<label for="smart_login_true">{TEXT_ENABLED}</label>
+		<input type="radio" name="smart_login" id="smart_login_false" style="width: 14px; height: 14px;" value="false"{SMART_LOGIN_DISABLED} />
+		<label for="smart_login_false">{TEXT_DISABLED}</label>
+	</td>
+</tr>
+<tr class="advanced" style="display: {GD_EXTENSION_LOADED};">
+	<td class="setting_name">{TEXT_CAPTCHA_VERIFICATION}:</td>
+	<td class="setting_value" colspan="2">
+		<input type="radio" name="captcha_verification" id="captcha_verification_true" style="width: 14px; height: 14px;" value="true"{CAPTCHA_VERIFICATION_ENABLED} />
+		<label for="captcha_verification_true">{TEXT_ENABLED}</label>
+		<input type="radio" name="captcha_verification" id="captcha_verification_false" style="width: 14px; height: 14px;" value="false"{CAPTCHA_VERIFICATION_DISABLED} />
+		<label for="captcha_verification_false">{TEXT_DISABLED}</label>
+	</td>
+</tr>
+<tr>
+	<td class="setting_name">{TEXT_LOGIN}:</td>
+	<td class="setting_value" colspan="2">
+		<input type="radio" name="frontend_login" id="frontend_login_true" style="width: 14px; height: 14px;" value="true"{PRIVATE_ENABLED} />
+		<label for="frontend_login_true">{TEXT_ENABLED}</label>
+		<input type="radio" name="frontend_login" id="frontend_login_false" style="width: 14px; height: 14px;" value="false"{PRIVATE_DISABLED} />
+		<label for="frontend_login_false">{TEXT_DISABLED}</label>
+	</td>
+</tr>
+<tr>
+	<td class="setting_name">{TEXT_SIGNUP}:</td>
+	<td class="setting_value" colspan="2">
+		<select name="frontend_signup">
+			<option value="false">{TEXT_DISABLED}</option>
+			<!-- BEGIN group_list_block -->
+				<option value="{ID}" {SELECTED}>{NAME}</option>
+			<!-- END group_list_block -->
+		</select>
+	</td>
+</tr>
+<tr class="advanced">
+	<td class="setting_name">{TEXT_PHP_ERROR_LEVEL}:</td>
+	<td class="setting_value" colspan="2">
+		<select name="er_level">
+			<option value="">{TEXT_PLEASE_SELECT}...</option>
+			<!-- BEGIN error_reporting_list_block -->
+				<option value="{VALUE}"{SELECTED}>{NAME}</option>
+			<!-- END error_reporting_list_block -->
+		</select>
+	</td>
+</tr>
+<tr class="advanced">
+	<td class="setting_name">{TEXT_WYSIWYG_STYLE}:</td>
+	<td class="setting_value" colspan="2">
+		<input type="text" name="wysiwyg_style" value="{WYSIWYG_STYLE}" />
+	</td>
+</tr>
+<tr class="advanced">
+	<td class="setting_name">{TEXT_SERVER_EMAIL}:</td>
+	<td class="setting_value" colspan="2">
+		<input type="text" name="server_email" value="{SERVER_EMAIL}" />
+	</td>
+</tr>
+<tr class="advanced">
+	<td class="setting_name">{TEXT_WYSIWYG_EDITOR}:</td>
+	<td class="setting_value" colspan="2">
+		<select name="wysiwyg_editor">
+		<!-- BEGIN editor_list_block -->
+			<option value="{FILE}"{SELECTED}>{NAME}</option>
+		<!-- END editor_list_block -->
+		</select>
+	</td>
+</tr>
+<tr>
+	<td>&nbsp;</td>
+	<td>
+		<input type="submit" name="submit" value="{TEXT_SAVE}" class="save" />
+		<input type="reset" name="reset" value="{TEXT_RESET}" class="reset" />
+	</td>
+	<td style="text-align: right;">
+		<button onclick="window.location = '{ADVANCED_LINK}'; return false;" class="{DISPLAY_ADVANCED_BUTTON}">{ADVANCED_BUTTON}</button>
+	</td>
+</tr>
+<tr>
+	<td colspan="3" style="padding-top: 10px;">
+		<h2>{HEADING_DEFAULT_SETTINGS}</h2>
+	</td>
+</tr>
+<tr>
+	<td class="setting_name">{TEXT_LANGUAGE}:</td>
+	<td class="setting_value" colspan="2">
+		<select name="default_language">
+			<!-- BEGIN language_list_block -->
+			<option value="{CODE}"{SELECTED}>{NAME} ({CODE})</option>
+			<!-- END language_list_block -->
+		</select>
+	</td>
+</tr>
+<tr class="advanced">
+	<td class="setting_name">{TEXT_CHARSET}:</td>
+	<td class="setting_value" colspan="2">
+		<select name="default_charset">
+			<option value="">{TEXT_PLEASE_SELECT}...</option>
+			<!-- BEGIN charset_list_block -->
+				<option value="{VALUE}" {SELECTED}>{NAME}</option>
+			<!-- END charset_list_block -->
+		</select>
+	</td>
+</tr>
+<tr>
+	<td class="setting_name">{TEXT_TIMEZONE}:</td>
+	<td class="setting_value" colspan="2">
+		<select name="default_timezone">
+			<option value="0">{TEXT_PLEASE_SELECT}...</option>
+			<!-- BEGIN timezone_list_block -->
+				<option value="{VALUE}" {SELECTED}>{NAME}</option>
+			<!-- END timezone_list_block -->
+		</select>
+	</td>
+</tr>
+<tr>
+	<td class="setting_name">{TEXT_DATE_FORMAT}:</td>
+	<td class="setting_value" colspan="2">
+		<select name="default_date_format">
+			<option value="M d Y">{TEXT_PLEASE_SELECT}...</option>
+			<!-- BEGIN date_format_list_block -->
+				<option value="{VALUE}" {SELECTED}>{NAME}</option>
+			<!-- END date_format_list_block -->
+		</select>
+	</td>
+</tr>
+<tr>
+	<td class="setting_name">{TEXT_TIME_FORMAT}:</td>
+	<td class="setting_value" colspan="2">
+		<select name="default_time_format">
+			<option value="g:i A">{TEXT_PLEASE_SELECT}...</option>
+			<!-- BEGIN time_format_list_block -->
+				<option value="{VALUE}" {SELECTED}>{NAME}</option>
+			<!-- END time_format_list_block -->
+		</select>
+	</td>
+</tr>
+<tr>
+	<td class="setting_name">{TEXT_TEMPLATE}:</td>
+	<td class="setting_value" colspan="2">
+		<select name="default_template">
+		<!-- BEGIN template_list_block -->
+			<option value="{FILE}"{SELECTED}>{NAME}</option>
+		<!-- END template_list_block -->
+		</select>
+	</td>
+</tr>
+<tr>
+	<td>&nbsp;</td>
+	<td>
+		<input type="submit" name="submit" value="{TEXT_SAVE}" class="save" />
+		<input type="reset" name="reset" value="{TEXT_RESET}" class="reset" />
+	</td>
+	<td style="text-align: right;">
+		<button onclick="window.location = '{ADVANCED_LINK}'; return false;" class="{DISPLAY_ADVANCED_BUTTON}">{ADVANCED_BUTTON}</button>
+	</td>
+</tr>
+<tr>
+	<td colspan="3" style="padding-top: 10px;">
+		<h2>{HEADING_SEARCH_SETTINGS}</h2>
+	</td>
+</tr>
+<tr>
+	<td class="setting_name">{TEXT_VISIBILITY}:</td>
+	<td class="setting_value" colspan="2">
+		<select name="search">
+			<option value="public">{TEXT_PUBLIC}</option>
+			<option value="private" {PRIVATE_SEARCH}>{TEXT_PRIVATE}</option>
+			<option value="registered" {REGISTERED_SEARCH}>{TEXT_REGISTERED}</option>
+			<option value="none" {NONE_SEARCH}>{TEXT_NONE}</option>
+		</select>
+	</td>
+</tr>
+<tr>
+	<td class="setting_name">{TEXT_TEMPLATE}:</td>
+	<td class="setting_value" colspan="2">
+		<select name="search_template">
+		<!-- BEGIN search_template_list_block -->
+			<option value="{FILE}"{SELECTED}>{NAME}</option>
+		<!-- END search_template_list_block -->
+		</select>
+	</td>
+</tr>
+<tr class="advanced">
+	<td class="setting_name">{TEXT_HEADER}:</td>
+	<td class="setting_value" colspan="2">
+		<textarea name="search_header" style="height: 100px;">{SEARCH_HEADER}</textarea>
+	</td>
+</tr>
+<tr class="advanced">
+	<td class="setting_name">{TEXT_RESULTS_HEADER}:</td>
+	<td class="setting_value" colspan="2">
+		<textarea name="search_results_header">{SEARCH_RESULTS_HEADER}</textarea>
+	</td>
+</tr>
+<tr class="advanced">
+	<td class="setting_name">{TEXT_RESULTS_LOOP}:</td>
+	<td class="setting_value" colspan="2">
+		<textarea name="search_results_loop">{SEARCH_RESULTS_LOOP}</textarea>
+	</td>
+</tr>
+<tr class="advanced">
+	<td class="setting_name">{TEXT_RESULTS_FOOTER}:</td>
+	<td class="setting_value" colspan="2">
+		<textarea name="search_results_footer">{SEARCH_RESULTS_FOOTER}</textarea>
+	</td>
+</tr>
+<tr class="advanced">
+	<td class="setting_name">{TEXT_NO_RESULTS}:</td>
+	<td class="setting_value" colspan="2">
+		<input type="text" name="search_no_results" value="{SEARCH_NO_RESULTS}" />
+	</td>
+</tr>
+<tr class="advanced">
+	<td class="setting_name">{TEXT_FOOTER}:</td>
+	<td class="setting_value" colspan="2">
+		<textarea name="search_footer">{SEARCH_FOOTER}</textarea>
+	</td>
+</tr>
+<tr class="advanced">
+	<td class="setting_name">{TEXT_MODULE_ORDER}:</td>
+	<td class="setting_value" colspan="2">
+		<input type="text" name="search_module_order" value="{SEARCH_MODULE_ORDER}" />
+	</td>
+</tr>
+<tr class="advanced">
+	<td class="setting_name">{TEXT_MAX_EXCERPT}:</td>
+	<td class="setting_value" colspan="2">
+		<input type="text" name="search_max_excerpt" value="{SEARCH_MAX_EXCERPT}" />
+	</td>
+</tr>
+<tr>
+	<td>&nbsp;</td>
+	<td>
+		<input type="submit" name="submit" value="{TEXT_SAVE}" class="save" />
+		<input type="reset" name="reset" value="{TEXT_RESET}" class="reset" />
+	</td>
+	<td style="text-align: right;">
+		<button onclick="window.location = '{ADVANCED_LINK}'; return false;" class="{DISPLAY_ADVANCED_BUTTON}">{ADVANCED_BUTTON}</button>
+	</td>
+</tr>
+<tr>
+	<td colspan="3" style="padding-top: 10px;">
+		<h2>{HEADING_SERVER_SETTINGS}</h2>
+	</td>
+</tr>
+<tr>
+	<td class="setting_name">{TEXT_SERVER_OPERATING_SYSTEM}:</td>
+	<td class="setting_value" colspan="2">
+		<input type="radio" name="operating_system" id="operating_system_linux" onclick="javascript: change_os('linux');" style="width: 14px; height: 14px;" value="linux"{LINUX_SELECTED} />
+		<label for="operating_system_linux" onclick="javascript: change_os('linux');">{TEXT_LINUX_UNIX_BASED}</label>
+		<input type="radio" name="operating_system" id="operating_system_windows" onclick="javascript: change_os('windows');"" style="width: 14px; height: 14px;" value="windows"{WINDOWS_SELECTED} />
+		<label for="operating_system_windows" onclick="javascript: change_os('windows');">{TEXT_WINDOWS}</label>
+	</td>
+</tr>
+<tr>
+	<td class="setting_name"><div id="{BASIC_FILE_PERMS_ID}1" style="margin: 0; padding: 0;">&nbsp;</div></td>
+	<td class="setting_value" colspan="3">
+		<div id="{BASIC_FILE_PERMS_ID}2" style="margin: 0; padding: 0;">
+			<input type="checkbox" name="world_writeable" id="world_writeable" style="width: 14px; height: 14px;" value="true"{WORLD_WRITEABLE_SELECTED} />
+			<label for="world_writeable">
+				{TEXT_WORLD_WRITEABLE_FILE_PERMISSIONS} (777)
+			</label>
+			<br />
+			<font class="note">({WORLD_WRITEABLE_WARNING})</font>
+		</div>
+		<div id="{BASIC_FILE_PERMS_ID}3" style="margin: 0; padding: 0;"></div>
+	</td>
+</tr>
+<tr class="advanced">
+	<td class="setting_name"><div id="{ADVANCED_FILE_PERMS_ID}1" style="margin: 0; padding: 0;">{TEXT_FILESYSTEM_PERMISSIONS}:</div></td>
+	<td class="setting_value" id="file_mode" align="left">
+		<table cellpadding="2" cellspacing="0" border="0" width="100%" style="border-right: 1px solid #DDDDDD;" id="{ADVANCED_FILE_PERMS_ID}2">
+		<tr>
+			<td colspan="3" style="text-align: center; font-weight: bold;">
+				{TEXT_FILES}:
+			</td>
+		</tr>
+		<tr>
+			<td>{TEXT_USER}:</td>
+			<td>{TEXT_GROUP}:</td>
+			<td>{TEXT_OTHERS}:</td>
+		</tr>
+		<tr>
+			<td>
+				<input type="checkbox" name="file_u_r" id="file_u_r" value="true"{FILE_U_R_CHECKED} />
+				<label for="file_u_r">{TEXT_READ}</label>
+				<br />
+				<input type="checkbox" name="file_u_w" id="file_u_w" value="true"{FILE_U_W_CHECKED} />
+				<label for="file_u_w">{TEXT_WRITE}</label>
+				<br />
+				<input type="checkbox" name="file_u_e" id="file_u_e" value="true"{FILE_U_E_CHECKED} />
+				<label for="file_u_e">{TEXT_EXECUTE}</label>
+			</td>
+			<td>
+				<input type="checkbox" name="file_g_r" id="file_g_r" value="true"{FILE_G_R_CHECKED} />
+				<label for="file_g_r">{TEXT_READ}</label>
+				<br />
+				<input type="checkbox" name="file_g_w" id="file_g_w" value="true"{FILE_G_W_CHECKED} />
+				<label for="file_g_w">{TEXT_WRITE}</label>
+				<br />
+				<input type="checkbox" name="file_g_e" id="file_g_e" value="true"{FILE_G_E_CHECKED} />
+				<label for="file_g_e">{TEXT_EXECUTE}</label>
+			</td>
+			<td>
+				<input type="checkbox" name="file_o_r" id="file_o_r" value="true"{FILE_O_R_CHECKED} />
+				<label for="file_o_r">{TEXT_READ}</label>
+				<br />
+				<input type="checkbox" name="file_o_w" id="file_o_w" value="true"{FILE_O_W_CHECKED} />
+				<label for="file_o_w">{TEXT_WRITE}</label>
+				<br />
+				<input type="checkbox" name="file_o_e" id="file_o_e" value="true"{FILE_O_E_CHECKED} />
+				<label for="file_o_e">{TEXT_EXECUTE}</label>
+			</td>
+		</tr>
+		</table>
+	</td>
+	<td class="setting_value" id="dir_mode" style="text-align: right;">
+		<table cellpadding="2" cellspacing="0" border="0" width="100%" id="{ADVANCED_FILE_PERMS_ID}3">
+		<tr>
+			<td colspan="3" style="text-align: center; font-weight: bold;">
+				{TEXT_DIRECTORIES}:
+			</td>
+		</tr>
+		<tr>
+			<td>{TEXT_USER}:</td>
+			<td>{TEXT_GROUP}:</td>
+			<td>{TEXT_OTHERS}:</td>
+		</tr>
+		<tr>
+			<td>
+				<input type="checkbox" name="dir_u_r" id="dir_u_r" value="true"{DIR_U_R_CHECKED} />
+				<label for="dir_u_r">{TEXT_READ}</label>
+				<br />
+				<input type="checkbox" name="dir_u_w" id="dir_u_w" value="true"{DIR_U_W_CHECKED} />
+				<label for="dir_u_w">{TEXT_WRITE}</label>
+				<br />
+				<input type="checkbox" name="dir_u_e" id="dir_u_e" value="true"{DIR_U_E_CHECKED} />
+				<label for="dir_u_e">{TEXT_EXECUTE}</label>
+			</td>
+			<td>
+				<input type="checkbox" name="dir_g_r" id="dir_g_r" value="true"{DIR_G_R_CHECKED} />
+				<label for="dir_g_r">{TEXT_READ}</label>
+				<br />
+				<input type="checkbox" name="dir_g_w" id="dir_g_w" value="true"{DIR_G_W_CHECKED} />
+				<label for="dir_g_w">{TEXT_WRITE}</label>
+				<br />
+				<input type="checkbox" name="dir_g_e" id="dir_g_e" value="true"{DIR_G_E_CHECKED} />
+				<label for="dir_g_e">{TEXT_EXECUTE}</label>
+			</td>
+			<td>
+				<input type="checkbox" name="dir_o_r" id="dir_o_r" value="true"{DIR_O_R_CHECKED} />
+				<label for="dir_o_r">{TEXT_READ}</label>
+				<br />
+				<input type="checkbox" name="dir_o_w" id="dir_o_w" value="true"{DIR_O_W_CHECKED} />
+				<label for="dir_o_w">{TEXT_WRITE}</label>
+				<br />
+				<input type="checkbox" name="dir_o_e" id="dir_o_e" value="true"{DIR_O_E_CHECKED} />
+				<label for="dir_o_e">{TEXT_EXECUTE}</label>
+			</td>
+		</tr>
+		</table>
+	</td>
+</tr>
+<tr class="advanced">
+	<td class="setting_name">{TEXT_PAGES_DIRECTORY}:</td>
+	<td class="setting_value" colspan="2">
+		<input type="text" name="pages_directory" value="{PAGES_DIRECTORY}" />
+	</td>
+</tr>
+<tr class="advanced">
+	<td class="setting_name">{TEXT_MEDIA_DIRECTORY}:</td>
+	<td class="setting_value" colspan="2">
+		<input type="text" name="media_directory" value="{MEDIA_DIRECTORY}" />
+	</td>
+</tr>
+<!-- The following lines are deactivated as the Page Extension Feature doesn't work on every server
+<tr class="advanced">
+	<td class="setting_name">{TEXT_PAGE_EXTENSION}:</td>
+	<td class="setting_value" colspan="2">
+		<input type="text" name="page_extension" value="{PAGE_EXTENSION}" />
+	</td>
+</tr>
+-->
+<tr class="advanced">
+	<td class="setting_name">{TEXT_PAGE_SPACER}:</td>
+	<td class="setting_value" colspan="2">
+		<input type="text" name="page_spacer" value="{PAGE_SPACER}" />
+	</td>
+</tr>
+<tr class="advanced">
+	<td class="setting_name">{TEXT_RENAME_FILES_ON_UPLOAD}:</td>
+	<td class="setting_value" colspan="2">
+		<input type="text" name="rename_files_on_upload" value="{RENAME_FILES_ON_UPLOAD}" />
+	</td>
+</tr>
+<tr class="advanced">
+	<td class="setting_name">{TEXT_SESSION_IDENTIFIER}:</td>
+	<td class="setting_value" colspan="2">
+		<input type="text" name="app_name" value="{APP_NAME}" />
+	</td>
+</tr>
+<tr>
+	<td colspan="3" style="padding-top: 10px;">
+		<h2>{HEADING_WBMAILER_SETTINGS}</h2>
+		<div style="border: 1px solid #CCC; background-color: #EEE; padding: 5px;">
+			<strong> Please Note:</strong>
+			<br \>
+			{TEXT_WBMAILER_NOTICE}
+		</div>
+	</td>
+</tr>
+<tr>
+	<td class="setting_name">{TEXT_WBMAILER_FUNCTION}:</td>
+	<td class="setting_value" colspan="2">
+		<input type="radio" name="wbmailer_routine" id="wbmailer_routine_phpmail" onclick="javascript: change_wbmailer('phpmail');" style="width: 14px; height: 14px;" value="phpmail"{PHPMAIL_SELECTED} />
+		<label for="wbmailer_routine_phpmail" onclick="javascript: change_wbmailer('phpmail');">{TEXT_WBMAILER_PHP}</label>
+		<input type="radio" name="wbmailer_routine" id="wbmailer_routine_smtp" onclick="javascript: change_wbmailer('smtp');"" style="width: 14px; height: 14px;" value="smtp"{SMTPMAIL_SELECTED} />
+		<label for="wbmailer_routine_smtp" onclick="javascript: change_wbmailer('smtp');">{TEXT_WBMAILER_SMTP}</label>
+	</td>
+</tr>
+<tr id="wbmailer_smtp_host" style="visibility:{SMTP_VISIBILITY};">
+	<td class="setting_name">{TEXT_WBMAILER_SMTP_HOST}:</td>
+	<td class="setting_value" colspan="2">
+		<input type="text" name="wbmailer_smtp_host" value="{WBMAILER_SMTP_HOST}" />
+	</td>
+</tr>
+<tr id="wbmailer_smtp_auth_mode" style="visibility:{SMTP_VISIBILITY};">
+	<td class="setting_name">{TEXT_WBMAILER_SMTP_AUTH}:</td>
+	<td class="setting_value" colspan="3">
+		<input type="checkbox" name="wbmailer_smtp_auth" id="wbmailer_smtp_auth" onclick="javascript: toggle_wbmailer_auth();" style="width: 14px; height: 14px;" value="true"{SMTP_AUTH_SELECTED} />
+		<label for="wbmailer_smtp_auth" onclick="javascript: toggle_wbmailer_auth(this.value);">({TEXT_WBMAILER_SMTP_AUTH_NOTICE})</label>
+	</td>
+</tr>
+<tr id="wbmailer_smtp_username" style="visibility:{SMTP_VISIBILITY_AUTH};">
+	<td class="setting_name">{TEXT_WBMAILER_SMTP_USERNAME}:</td>
+	<td class="setting_value" colspan="2">
+		<input type="text" name="wbmailer_smtp_username" value="{WBMAILER_SMTP_USERNAME}" />
+	</td>
+</tr>
+<tr id="wbmailer_smtp_password" style="visibility:{SMTP_VISIBILITY_AUTH};">
+	<td class="setting_name">{TEXT_WBMAILER_SMTP_PASSWORD}:</td>
+	<td class="setting_value" colspan="2">
+		<input type="password" name="wbmailer_smtp_password" value="{WBMAILER_SMTP_PASSWORD}" />
+	</td>
+</tr>
+<tr>
+	<td>&nbsp;</td>
+	<td>
+		<input type="submit" name="submit" value="{TEXT_SAVE}" class="save" />
+		<input type="reset" name="reset" value="{TEXT_RESET}" class="reset" />
+	</td>
+	<td style="text-align: right;">
+		<button onclick="window.location = '{ADVANCED_LINK}'; return false;" class="{DISPLAY_ADVANCED_BUTTON}">{ADVANCED_BUTTON}</button>
+	</td>
+</tr>
+</table>
+
+</form>
+
+<hr />
+
+<button onclick="window.location = '{ADVANCED_LINK}'; return false;" class="{DISPLAY_ADVANCED_BUTTON}">{ADVANCED_BUTTON}</button>
+
+<font class="{DISPLAY_ADVANCED_BUTTON}">
+&nbsp; {MODE_SWITCH_WARNING}
+</font>
+
+<!-- END main_block -->
Index: trunk/wb/admin/images/noclock_16.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: trunk/wb/admin/images/noclock_16.png
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Index: trunk/wb/admin/images/clock_16.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: trunk/wb/admin/images/clock_16.png
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Index: trunk/wb/admin/images/clock_red_16.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: trunk/wb/admin/images/clock_red_16.png
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Index: trunk/wb/modules/wysiwyg/search.php
===================================================================
--- trunk/wb/modules/wysiwyg/search.php	(nonexistent)
+++ trunk/wb/modules/wysiwyg/search.php	(revision 552)
@@ -0,0 +1,63 @@
+<?php
+
+// $Id: $
+
+/*
+
+ Website Baker Project <http://www.websitebaker.org/>
+ Copyright (C) 2004-2008, Ryan Djurovich
+
+ Website Baker is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ Website Baker is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Website Baker; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+*/
+
+function wysiwyg_search($func_vars) {
+	extract($func_vars, EXTR_PREFIX_ALL, 'func');
+	
+	// how many lines of excerpt we want to have at most
+	$max_excerpt_num = $func_default_max_excerpt;
+	$divider = ".";
+	$result = false;
+	
+	// we have to get 'content' instead of 'text', because strip_tags() dosen't remove scripting well.
+	// scripting will be removed later on automatically
+	$table = TABLE_PREFIX."mod_wysiwyg";
+	$query = $func_database->query("
+		SELECT content
+		FROM $table
+		WHERE section_id='$func_section_id'
+	");
+
+	if($query->numRows() > 0) {
+		if($res = $query->fetchRow()) {
+			$mod_vars = array(
+				'page_link' => $func_page_link,
+				'page_link_target' => "#wb_section_$func_section_id",
+				'page_title' => $func_page_title,
+				'page_description' => $func_page_description,
+				'page_modified_when' => $func_page_modified_when,
+				'page_modified_by' => $func_page_modified_by,
+				'text' => $res['content'].$divider,
+				'max_excerpt_num' => $max_excerpt_num
+			);
+			if(print_excerpt2($mod_vars, $func_vars)) {
+				$result = true;
+			}
+		}
+	}
+	return $result;
+}
+
+?>

Property changes on: trunk/wb/modules/wysiwyg/search.php
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: trunk/wb/modules/form/search.php
===================================================================
--- trunk/wb/modules/form/search.php	(nonexistent)
+++ trunk/wb/modules/form/search.php	(revision 552)
@@ -0,0 +1,65 @@
+<?php
+
+// $Id: $
+
+/*
+
+ Website Baker Project <http://www.websitebaker.org/>
+ Copyright (C) 2004-2008, Ryan Djurovich
+
+ Website Baker is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ Website Baker is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Website Baker; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+*/
+
+function form_search($func_vars) {
+	extract($func_vars, EXTR_PREFIX_ALL, 'func');
+	
+	// how many lines of excerpt we want to have at most
+	$max_excerpt_num = $func_default_max_excerpt;
+	$divider = ".";
+	$result = false;
+	
+	// fetch all form-fields on this page
+	$table = TABLE_PREFIX."mod_form_fields";
+	$query = $func_database->query("
+		SELECT title, value
+		FROM $table
+		WHERE section_id='$func_section_id'
+		ORDER BY position ASC
+	");
+	// now call print_excerpt() only once for all items
+	if($query->numRows() > 0) {
+		$text="";
+		while($res = $query->fetchRow()) {
+			$text .= $res['title'].$divider.$res['value'].$divider;
+		}
+		$mod_vars = array(
+			'page_link' => $func_page_link,
+			'page_link_target' => "#wb_section_$func_section_id",
+			'page_title' => $func_page_title,
+			'page_description' => $func_page_description,
+			'page_modified_when' => $func_page_modified_when,
+			'page_modified_by' => $func_page_modified_by,
+			'text' => $text,
+			'max_excerpt_num' => $max_excerpt_num
+		);
+		if(print_excerpt2($mod_vars, $func_vars)) {
+			$result = true;
+		}
+	}
+	return $result;
+}
+
+?>

Property changes on: trunk/wb/modules/form/search.php
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: trunk/wb/modules/news/search.php
===================================================================
--- trunk/wb/modules/news/search.php	(nonexistent)
+++ trunk/wb/modules/news/search.php	(revision 552)
@@ -0,0 +1,109 @@
+<?php
+
+// $Id: $
+
+/*
+
+ Website Baker Project <http://www.websitebaker.org/>
+ Copyright (C) 2004-2008, Ryan Djurovich
+
+ Website Baker is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ Website Baker is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Website Baker; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+*/
+
+function news_search($func_vars) {
+	extract($func_vars, EXTR_PREFIX_ALL, 'func');
+
+	// how many lines of excerpt we want to have at most
+	$max_excerpt_num = $func_default_max_excerpt;
+	// do we want excerpt from comments?
+	$excerpt_from_comments = true; // TODO: make this configurable
+	$divider = ".";
+	$result = false;
+
+	// fetch all active news-posts (from active groups) in this section.
+	$table_posts = TABLE_PREFIX."mod_news_posts";
+	$table_groups = TABLE_PREFIX."mod_news_groups";
+	$query = $func_database->query("
+		SELECT p.post_id, p.title, p.content_short, p.content_long, p.link, p.posted_when, p.posted_by
+		FROM $table_posts AS p LEFT OUTER JOIN $table_groups AS g ON p.group_id = g.group_id
+		WHERE p.section_id='$func_section_id' AND p.active = '1' AND ( g.active IS NULL OR g.active = '1' )
+		ORDER BY p.post_id DESC
+	");
+	// now call print_excerpt() for every single post
+	if($query->numRows() > 0) {
+		while($res = $query->fetchRow()) {
+			$text = $res['title'].$divider.$res['content_short'].$divider.$res['content_long'].$divider;
+			// fetch comments and add to $text
+			if($excerpt_from_comments) {
+				$table = TABLE_PREFIX."mod_news_comments";
+				$commentquery = $func_database->query("
+					SELECT title, comment
+					FROM $table
+					WHERE post_id='{$res['post_id']}'
+					ORDER BY commented_when ASC
+				");
+				if($commentquery->numRows() > 0) {
+					while($c_res = $commentquery->fetchRow()) {
+						$text .= $c_res['title'].$divider.$c_res['comment'].$divider;
+					}
+				}
+			}
+			$mod_vars = array(
+				'page_link' => $res['link'], // use direct link to news-item
+				'page_link_target' => "",
+				'page_title' => $func_page_title,
+				'page_description' => $res['title'], // use news-title as description
+				'page_modified_when' => $res['posted_when'],
+				'page_modified_by' => $res['posted_by'],
+				'text' => $text,
+				'max_excerpt_num' => $max_excerpt_num
+			);
+			if(print_excerpt2($mod_vars, $func_vars)) {
+				$result = true;
+			}
+		}
+	}
+	
+	// now fetch group-titles - ignore those without (active) postings
+	$table_groups = TABLE_PREFIX."mod_news_groups";
+	$table_posts = TABLE_PREFIX."mod_news_posts";
+	$query = $func_database->query("
+		SELECT DISTINCT g.title, g.group_id
+		FROM $table_groups AS g INNER JOIN $table_posts AS p ON g.group_id = p.group_id
+		WHERE g.section_id='$func_section_id' AND g.active = '1' AND p.active = '1'
+	");
+	// now call print_excerpt() for every single group, too
+	if($query->numRows() > 0) {
+		while($res = $query->fetchRow()) {
+			$mod_vars = array(
+				'page_link' => $func_page_link,
+				'page_link_target' => "&g=".$res['group_id'],
+				'page_title' => $func_page_title,
+				'page_description' => $func_page_description,
+				'page_modified_when' => $func_page_modified_when,
+				'page_modified_by' => $func_page_modified_by,
+				'text' => $res['title'].$divider,
+				'max_excerpt_num' => $max_excerpt_num
+			);
+			if(print_excerpt2($mod_vars, $func_vars)) {
+				$result = true;
+			}
+		}
+	}
+	return $result;
+}
+
+?>

Property changes on: trunk/wb/modules/news/search.php
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: trunk/wb/framework/convert.php
===================================================================
--- trunk/wb/framework/convert.php	(revision 551)
+++ trunk/wb/framework/convert.php	(nonexistent)
@@ -1,301 +0,0 @@
-<?php
-
-// $Id$
-
-/*
-
- Website Baker Project <http://www.websitebaker.org/>
- Copyright (C) 2004-2008, Ryan Djurovich
-
- Website Baker is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- Website Baker is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with Website Baker; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-
-*/
-
-/*
-Character Conversion file
-to convert some entities to there 7bit equivalents
-*/
-if(!defined('WB_URL')) {
-	header('Location: ../index.php');
-	exit(0);
-}
-
-$conversion_array = array(
-
-//### LATIN
-'&Aacute;'=>'A','&aacute;'=>'a','&Acirc;'=>'A','&acirc;'=>'a','&AElig;'=>'AE','&aelig;'=>'ae','&Agrave;'=>'A','&agrave;'=>'a','&Aring;'=>'A','&aring;'=>'a','&Atilde;'=>'A','&atilde;'=>'a','&Auml;'=>'AE','&auml;'=>'ae',
-'&Ccedil;'=>'C','&ccedil;'=>'c',
-'&Eacute;'=>'E','&eacute;'=>'e','&Ecirc;'=>'E','&ecirc;'=>'e','&Egrave;'=>'E','&egrave;'=>'e','&Euml;'=>'E','&euml;'=>'e',
-'&Iacute;'=>'I','&iacute;'=>'i','&Icirc;'=>'I','&icirc;'=>'i','&Igrave;'=>'I','&igrave;'=>'i','&Iuml;'=>'I','&iuml;'=>'i',
-'&Ntilde;'=>'N','&ntilde;'=>'n',
-'&Oacute;'=>'O','&oacute;'=>'o','&Ocirc;'=>'O','&ocirc;'=>'o','&OElig;'=>'OE','&oelig;'=>'oe','&Ograve;'=>'O','&ograve;'=>'o','&Otilde;'=>'O','&otilde;'=>'o','&Ouml;'=>'OE','&ouml;'=>'oe',
-'&Scaron;'=>'S','&scaron;'=>'s',
-'&szlig;'=>'ss',
-'&Uacute;'=>'U','&uacute;'=>'u','&Ucirc;'=>'U','&ucirc;'=>'u','&Ugrave;'=>'U','&ugrave;'=>'u','&Uuml;'=>'UE','&uuml;'=>'ue',
-'&Yacute;'=>'Y','&yacute;'=>'y','&Yuml;'=>'Y','&yuml;'=>'y',
-'&#138;'=>'S',
-'&#140;'=>'OE','&#156;'=>'oe',
-'&#154;'=>'s',
-'&#159;'=>'Y',
-'&copy;'=>'(c)','&reg;'=>'(r)','&ETH;'=>'D','&times;'=>'x','&Oslash;'=>'O','&THORN;'=>'TH','&eth;'=>'d','&oslash;'=>'o','&thorn;'=>'th',
-'&#39;'=>'-','&apos;'=>'-','&quot;'=>'-',
-// latin extended-A
-'&#256;'=>'A','&#257;'=>'a','&#258;'=>'A','&#259;'=>'a','&#260;'=>'A','&#261;'=>'a',
-'&#262;'=>'C','&#263;'=>'c','&#264;'=>'C','&#265;'=>'c','&#269;'=>'c','&#268;'=>'C','&#267;'=>'c','&#266;'=>'C',
-'&#273;'=>'d','&#272;'=>'D','&#271;'=>'d','&#270;'=>'D',
-'&#275;'=>'e','&#274;'=>'E','&#276;'=>'E','&#277;'=>'e','&#278;'=>'E','&#279;'=>'e','&#280;'=>'E','&#281;'=>'e','&#282;'=>'E','&#283;'=>'e',
-'&#284;'=>'G','&#285;'=>'g','&#286;'=>'G','&#287;'=>'g','&#288;'=>'G','&#289;'=>'g','&#290;'=>'G','&#291;'=>'g',
-'&#292;'=>'H','&#293;'=>'h','&#294;'=>'H','&#295;'=>'h',
-'&#296;'=>'I','&#297;'=>'i','&#298;'=>'I','&#299;'=>'i','&#300;'=>'I','&#301;'=>'i','&#302;'=>'I','&#303;'=>'i','&#304;'=>'I','&#305;'=>'i',
-'&#306;'=>'IJ','&#307;'=>'ij',
-'&#308;'=>'J','&#309;'=>'j',
-'&#310;'=>'K','&#311;'=>'k','&#312;'=>'k',
-'&#313;'=>'L','&#314;'=>'l','&#315;'=>'L','&#316;'=>'l','&#317;'=>'L','&#318;'=>'l','&#319;'=>'L','&#320;'=>'l','&#321;'=>'L','&#322;'=>'l',
-'&#323;'=>'N','&#324;'=>'n','&#325;'=>'N','&#326;'=>'n','&#327;'=>'N','&#328;'=>'n','&#329;'=>'n','&#330;'=>'N','&#331;'=>'n',
-'&#332;'=>'O','&#333;'=>'o','&#334;'=>'O','&#335;'=>'o','&#336;'=>'O','&#337;'=>'o',
-'&#340;'=>'R','&#341;'=>'r','&#342;'=>'R','&#343;'=>'r','&#344;'=>'R','&#345;'=>'r',
-'&#346;'=>'S','&#347;'=>'s','&#348;'=>'S','&#349;'=>'s','&#350;'=>'S','&#351;'=>'s',
-'&#354;'=>'T','&#355;'=>'t','&#356;'=>'T','&#357;'=>'t','&#358;'=>'T','&#359;'=>'t',
-'&#360;'=>'U','&#361;'=>'u','&#362;'=>'U','&#363;'=>'u','&#364;'=>'U','&#365;'=>'u','&#366;'=>'U','&#367;'=>'u','&#368;'=>'U','&#369;'=>'u','&#370;'=>'U','&#371;'=>'u',
-'&#372;'=>'W','&#373;'=>'w',
-'&#374;'=>'Y','&#375;'=>'y','&#376;'=>'Y',
-'&#377;'=>'Z','&#378;'=>'z','&#379;'=>'Z','&#380;'=>'z','&#381;'=>'Z','&#382;'=>'z',
-'&#383;'=>'s',
-'&#64256;'=>'ff','&#64257;'=>'fi','&#64258;'=>'fl','&#64259;'=>'ffi','&#64260;'=>'ffl',
-'&#64261;'=>'st',
-'&#64262;'=>'st',
-// latin extended-b
-'&#384;'=>'b','&#385;'=>'B','&#386;'=>'B','&#387;'=>'b','&#388;'=>'6','&#389;'=>'6',
-'&#390;'=>'O','&#391;'=>'C','&#392;'=>'c','&#393;'=>'D','&#394;'=>'D','&#395;'=>'D',
-'&#396;'=>'d','&#397;'=>'d','&#398;'=>'E','&#399;'=>'e','&#400;'=>'E','&#401;'=>'F',
-'&fnof;'=>'f','&#403;'=>'G','&#404;'=>'G','&#405;'=>'hw','&#406;'=>'I','&#407;'=>'I',
-'&#408;'=>'K','&#409;'=>'k','&#410;'=>'l','&#411;'=>'l','&#412;'=>'M','&#413;'=>'N',
-'&#414;'=>'n','&#415;'=>'O','&#416;'=>'O','&#417;'=>'o','&#418;'=>'OI','&#419;'=>'oi',
-'&#420;'=>'P','&#421;'=>'p','&#422;'=>'YR','&#423;'=>'2','&#424;'=>'2','&#425;'=>'ESH',
-'&#426;'=>'esh','&#427;'=>'t','&#428;'=>'T','&#429;'=>'t','&#430;'=>'T','&#431;'=>'U',
-'&#432;'=>'u','&#433;'=>'V','&#434;'=>'v','&#435;'=>'Y','&#436;'=>'y','&#437;'=>'Z',
-'&#438;'=>'z','&#439;'=>'EZH','&#440;'=>'EZH','&#441;'=>'ezh','&#442;'=>'ezh','&#443;'=>'2',
-'&#444;'=>'5','&#445;'=>'5','&#446;'=>'-','&#447;'=>'w','&#448;'=>'-','&#449;'=>'-',
-'&#450;'=>'-','&#451;'=>'-','&#452;'=>'DZ','&#453;'=>'DZ','&#454;'=>'dz','&#455;'=>'LJ',
-'&#456;'=>'Lj','&#457;'=>'lj','&#458;'=>'NJ','&#459;'=>'Nj','&#460;'=>'nj','&#461;'=>'A',
-'&#462;'=>'a','&#463;'=>'I','&#464;'=>'i','&#465;'=>'O','&#466;'=>'o','&#467;'=>'U',
-'&#468;'=>'u','&#469;'=>'U','&#470;'=>'u','&#471;'=>'U','&#472;'=>'u','&#473;'=>'U',
-'&#474;'=>'u','&#475;'=>'U','&#476;'=>'u','&#477;'=>'e','&#478;'=>'A','&#479;'=>'a',
-'&#480;'=>'A','&#481;'=>'a','&#482;'=>'AE','&#483;'=>'ae','&#484;'=>'G','&#485;'=>'g',
-'&#486;'=>'G','&#487;'=>'g','&#488;'=>'K','&#489;'=>'k','&#490;'=>'O','&#491;'=>'o',
-'&#492;'=>'O','&#493;'=>'o','&#494;'=>'EZH','&#495;'=>'ezh','&#496;'=>'j','&#497;'=>'DZ',
-'&#498;'=>'Dz','&#499;'=>'dz','&#500;'=>'G','&#501;'=>'g','&#502;'=>'HW','&#503;'=>'W',
-'&#504;'=>'N','&#505;'=>'n','&#506;'=>'A','&#507;'=>'a','&#508;'=>'AE','&#509;'=>'ae',
-'&#510;'=>'O','&#511;'=>'o','&#512;'=>'A','&#513;'=>'a','&#514;'=>'A','&#515;'=>'a',
-'&#516;'=>'E','&#517;'=>'e','&#518;'=>'E','&#519;'=>'e','&#520;'=>'I','&#521;'=>'i',
-'&#522;'=>'I','&#523;'=>'i','&#524;'=>'O','&#525;'=>'o','&#526;'=>'O','&#527;'=>'o',
-'&#528;'=>'R','&#529;'=>'r','&#530;'=>'R','&#531;'=>'r','&#532;'=>'U','&#533;'=>'u',
-'&#534;'=>'U','&#535;'=>'u','&#536;'=>'S','&#537;'=>'s','&#538;'=>'T','&#539;'=>'t',
-'&#540;'=>'Y','&#541;'=>'y','&#542;'=>'H','&#543;'=>'h','&#544;'=>'n','&#545;'=>'d',
-'&#546;'=>'OU','&#547;'=>'ou','&#548;'=>'Z','&#549;'=>'z','&#550;'=>'A','&#551;'=>'a',
-'&#552;'=>'E','&#553;'=>'e','&#554;'=>'O','&#555;'=>'o','&#556;'=>'O','&#557;'=>'o',
-'&#558;'=>'O','&#559;'=>'o','&#560;'=>'O','&#561;'=>'o','&#562;'=>'Y','&#563;'=>'y',
-'&#564;'=>'l','&#565;'=>'n','&#566;'=>'t','&#567;'=>'j','&#568;'=>'db','&#569;'=>'qp',
-'&#570;'=>'A','&#571;'=>'C','&#572;'=>'c','&#573;'=>'L','&#574;'=>'T','&#575;'=>'s',
-'&#576;'=>'z','&#577;'=>'-',
-// latin extended additional
-'&#7680;'=>'A','&#7681;'=>'a',
-'&#7682;'=>'B','&#7683;'=>'b','&#7684;'=>'B','&#7685;'=>'b','&#7686;'=>'B','&#7687;'=>'b',
-'&#7688;'=>'C','&#7689;'=>'c',
-'&#7690;'=>'D','&#7691;'=>'d','&#7692;'=>'D','&#7693;'=>'d','&#7694;'=>'D','&#7695;'=>'d','&#7696;'=>'D','&#7697;'=>'d','&#7698;'=>'D','&#7699;'=>'d',
-'&#7700;'=>'E','&#7701;'=>'e','&#7702;'=>'E','&#7703;'=>'e','&#7704;'=>'E','&#7705;'=>'e','&#7706;'=>'E','&#7707;'=>'e','&#7708;'=>'E','&#7709;'=>'e',
-'&#7710;'=>'F','&#7711;'=>'f',
-'&#7712;'=>'G','&#7713;'=>'g',
-'&#7714;'=>'H','&#7715;'=>'h','&#7716;'=>'H','&#7717;'=>'h','&#7718;'=>'H','&#7719;'=>'h','&#7720;'=>'H','&#7721;'=>'h','&#7722;'=>'H','&#7723;'=>'h',
-'&#7724;'=>'I','&#7725;'=>'i','&#7726;'=>'I','&#7727;'=>'i',
-'&#7728;'=>'K','&#7729;'=>'k','&#7730;'=>'K','&#7731;'=>'k','&#7732;'=>'K','&#7733;'=>'k',
-'&#7734;'=>'L','&#7735;'=>'l','&#7736;'=>'L','&#7737;'=>'l','&#7738;'=>'L','&#7739;'=>'l','&#7740;'=>'L','&#7741;'=>'l',
-'&#7742;'=>'M','&#7743;'=>'m','&#7744;'=>'M','&#7745;'=>'m','&#7746;'=>'M','&#7747;'=>'m',
-'&#7748;'=>'N','&#7749;'=>'n','&#7750;'=>'N','&#7751;'=>'n','&#7752;'=>'N','&#7753;'=>'n','&#7754;'=>'N','&#7755;'=>'n',
-'&#7756;'=>'O','&#7757;'=>'o','&#7758;'=>'O','&#7759;'=>'o','&#7760;'=>'O','&#7761;'=>'o','&#7762;'=>'O','&#7763;'=>'o',
-'&#7764;'=>'P','&#7765;'=>'p','&#7766;'=>'P','&#7767;'=>'p',
-'&#7768;'=>'R','&#7769;'=>'r','&#7770;'=>'R','&#7771;'=>'r','&#7772;'=>'R','&#7773;'=>'r','&#7774;'=>'R','&#7775;'=>'r',
-'&#7776;'=>'S','&#7777;'=>'s','&#7778;'=>'S','&#7779;'=>'s','&#7780;'=>'S','&#7781;'=>'s','&#7782;'=>'S','&#7783;'=>'s','&#7784;'=>'S','&#7785;'=>'s',
-'&#7786;'=>'T','&#7787;'=>'t','&#7788;'=>'T','&#7789;'=>'t','&#7790;'=>'T','&#7791;'=>'t','&#7792;'=>'T','&#7793;'=>'t',
-'&#7794;'=>'U','&#7795;'=>'u','&#7796;'=>'U','&#7797;'=>'u','&#7798;'=>'U','&#7799;'=>'u','&#7800;'=>'U','&#7801;'=>'u','&#7802;'=>'U','&#7803;'=>'u',
-'&#7804;'=>'V','&#7805;'=>'v','&#7806;'=>'V','&#7807;'=>'v',
-'&#7808;'=>'W','&#7809;'=>'w','&#7810;'=>'W','&#7811;'=>'w','&#7812;'=>'W','&#7813;'=>'w','&#7814;'=>'W','&#7815;'=>'w','&#7816;'=>'W','&#7817;'=>'w',
-'&#7818;'=>'X','&#7819;'=>'x','&#7820;'=>'X','&#7821;'=>'x',
-'&#7822;'=>'Y','&#7823;'=>'y',
-'&#7824;'=>'Z','&#7825;'=>'z','&#7826;'=>'Z','&#7827;'=>'z','&#7828;'=>'Z','&#7829;'=>'z',
-'&#7830;'=>'h',
-'&#7831;'=>'t',
-'&#7832;'=>'w',
-'&#7833;'=>'y',
-'&#7834;'=>'a',
-'&#7835;'=>'f',
-'&#7840;'=>'A','&#7841;'=>'a','&#7842;'=>'A','&#7843;'=>'a','&#7844;'=>'A','&#7845;'=>'a','&#7846;'=>'A','&#7847;'=>'a','&#7848;'=>'A','&#7849;'=>'a',
-'&#7850;'=>'A','&#7851;'=>'a','&#7852;'=>'A','&#7853;'=>'a','&#7854;'=>'A','&#7855;'=>'a','&#7856;'=>'A','&#7857;'=>'a','&#7858;'=>'A','&#7859;'=>'a','&#7860;'=>'A','&#7861;'=>'a','&#7862;'=>'A','&#7863;'=>'a',
-'&#7864;'=>'E','&#7865;'=>'e','&#7866;'=>'E','&#7867;'=>'e','&#7868;'=>'E','&#7869;'=>'e','&#7870;'=>'E','&#7871;'=>'e','&#7872;'=>'E','&#7873;'=>'e','&#7874;'=>'E','&#7875;'=>'e','&#7876;'=>'E','&#7877;'=>'e','&#7878;'=>'E','&#7879;'=>'e',
-'&#7880;'=>'I','&#7881;'=>'i','&#7882;'=>'I','&#7883;'=>'i',
-'&#7884;'=>'O','&#7885;'=>'o','&#7886;'=>'O','&#7887;'=>'o','&#7888;'=>'O','&#7889;'=>'o','&#7890;'=>'O','&#7891;'=>'o','&#7892;'=>'O','&#7893;'=>'o','&#7894;'=>'O','&#7895;'=>'o',
-'&#7896;'=>'O','&#7897;'=>'o','&#7898;'=>'O','&#7899;'=>'o','&#7900;'=>'O','&#7901;'=>'o','&#7902;'=>'O','&#7903;'=>'o','&#7904;'=>'O','&#7905;'=>'o','&#7906;'=>'O','&#7907;'=>'o',
-'&#7908;'=>'U','&#7909;'=>'u','&#7910;'=>'U','&#7911;'=>'u','&#7912;'=>'U','&#7913;'=>'u','&#7914;'=>'U','&#7915;'=>'u','&#7916;'=>'U','&#7917;'=>'u','&#7918;'=>'U','&#7919;'=>'u','&#7920;'=>'U','&#7921;'=>'u',
-'&#7922;'=>'Y','&#7923;'=>'y','&#7924;'=>'Y','&#7925;'=>'y','&#7926;'=>'Y','&#7927;'=>'y','&#7928;'=>'Y','&#7929;'=>'y',
-
-//### CYRILLIC (transliteration following iso 9:1995)
-'&#1040;'=>'A','&#1072;'=>'a', // A
-'&#1232;'=>'A','&#1233;'=>'a', // A WITH BREVE
-'&#1234;'=>'A','&#1235;'=>'a', // A WITH DIAERESIS
-'&#1236;'=>'A','&#1237;'=>'a', // LIGATURE A IE
-'&#1240;'=>'A','&#1241;'=>'a', // SCHWA
-'&#1242;'=>'A','&#1243;'=>'a', // SCHWA WITH DIAERESIS
-'&#1041;'=>'B','&#1073;'=>'b', // BE
-'&#1042;'=>'V','&#1074;'=>'v', // VE
-'&#1043;'=>'G','&#1075;'=>'g', // GHE
-'&#1168;'=>'G','&#1169;'=>'g', // GHE WITH UPTURN
-'&#1172;'=>'G','&#1173;'=>'g', // GHE WITH MIDDLE HOOK
-'&#1170;'=>'G','&#1171;'=>'g', // GHE WITH STROKE
-'&#1270;'=>'G','&#1271;'=>'g', // GHE WITH DESCENDER
-'&#1044;'=>'D','&#1076;'=>'d', // DE
-'&#1026;'=>'D','&#1106;'=>'d', // DJE
-'&#1027;'=>'G','&#1107;'=>'g', // GJE
-'&#1024;'=>'E','&#1104;'=>'e', // IE WITH GRAVE
-'&#1045;'=>'E','&#1077;'=>'e', // IE
-'&#1025;'=>'E','&#1105;'=>'e', // IO
-'&#1238;'=>'E','&#1239;'=>'e', // IE WITH BREVE
-'&#1028;'=>'E','&#1108;'=>'e', // UKRAINIAN IE
-'&#1212;'=>'C','&#1213;'=>'c', // ABKHASIAN CHE
-'&#1214;'=>'C','&#1215;'=>'c', // ABKHASIAN CHE WITH DESCENDER
-'&#1046;'=>'Z','&#1078;'=>'z', // ZHE
-'&#1217;'=>'Z','&#1218;'=>'z', // ZHE WITH BREVE
-'&#1244;'=>'Z','&#1245;'=>'z', // ZHE WITH DIAERESIS
-'&#1174;'=>'Z','&#1175;'=>'z', // ZHE WITH DESCENDER
-'&#1047;'=>'Z','&#1079;'=>'z', // ZE
-'&#1246;'=>'Z','&#1247;'=>'z', // ZE WITH DIAERESIS
-'&#1029;'=>'Z','&#1109;'=>'z', // DZE
-'&#1248;'=>'Z','&#1249;'=>'z', // ABKHASIAN DZE
-'&#1037;'=>'I','&#1117;'=>'i', // I WITH GRAVE
-'&#1048;'=>'I','&#1080;'=>'i', // I
-'&#1250;'=>'I','&#1251;'=>'i', // I WITH MACRON
-'&#1252;'=>'I','&#1253;'=>'i', // I WITH DIAERESIS
-'&#1030;'=>'I','&#1110;'=>'i', // BYELORUSSIAN-UKRAINIAN I
-'&#1031;'=>'I','&#1111;'=>'i', // YI
-'&#1049;'=>'J','&#1081;'=>'j', // SHORT I
-'&#1032;'=>'J','&#1112;'=>'j', // JE
-'&#1050;'=>'K','&#1082;'=>'k', // KA
-'&#1178;'=>'K','&#1179;'=>'k', // KA WITH DESCENDER
-'&#1180;'=>'K','&#1181;'=>'k', // KA WITH VERTICAL STROKE
-'&#1182;'=>'K','&#1183;'=>'k', // KA WITH STROKE
-'&#1184;'=>'K','&#1185;'=>'k', // BASHKIR KA
-'&#1051;'=>'L','&#1083;'=>'l', // EL
-'&#1033;'=>'L','&#1113;'=>'l', // LJE
-'&#1052;'=>'M','&#1084;'=>'m', // EM
-'&#1053;'=>'N','&#1085;'=>'n', // EN
-'&#1034;'=>'N','&#1114;'=>'n', // NJE
-'&#1188;'=>'N','&#1189;'=>'n', // LIGATURE EN GHE
-'&#1186;'=>'N','&#1187;'=>'n', // EN WITH DESCENDER
-'&#1054;'=>'O','&#1086;'=>'o', // O
-'&#1254;'=>'O','&#1255;'=>'o', // O WITH DIAERESIS
-'&#1256;'=>'O','&#1257;'=>'o', // BARRED O
-'&#1258;'=>'O','&#1259;'=>'o', // BARRED O WITH DIAERESIS
-'&#1055;'=>'P','&#1087;'=>'p', // PE
-'&#1190;'=>'P','&#1191;'=>'p', // PE WITH MIDDLE HOOK
-'&#1056;'=>'R','&#1088;'=>'r', // ER
-'&#1057;'=>'S','&#1089;'=>'s', // ES
-'&#1194;'=>'C','&#1195;'=>'c', // ES WITH DESCENDER
-'&#1058;'=>'T','&#1090;'=>'t', // TE
-'&#1196;'=>'T','&#1197;'=>'t', // TE WITH DESCENDER
-'&#1035;'=>'C','&#1115;'=>'c', // TSHE
-'&#1036;'=>'K','&#1116;'=>'k', // KJE
-'&#1059;'=>'U','&#1091;'=>'u', // U
-'&#1038;'=>'U','&#1118;'=>'u', // SHORT U
-'&#1262;'=>'U','&#1263;'=>'u', // U WITH MACRON
-'&#1264;'=>'U','&#1265;'=>'u', // U WITH DIAERESIS
-'&#1266;'=>'U','&#1267;'=>'u', // U WITH DOUBLE ACUTE
-'&#1198;'=>'U','&#1199;'=>'u', // STRAIGHT U
-'&#1200;'=>'U','&#1201;'=>'u', // STRAIGHT U WITH STROKE
-'&#1060;'=>'F','&#1092;'=>'f', // EF
-'&#1061;'=>'H','&#1093;'=>'h', // HA
-'&#1202;'=>'H','&#1203;'=>'h', // HA WITH DESCENDER
-'&#1210;'=>'H','&#1211;'=>'h', // SHHA
-'&#1062;'=>'C','&#1094;'=>'c', // TSE
-'&#1204;'=>'C','&#1205;'=>'c', // LIGATURE TE TSE
-'&#1063;'=>'C','&#1095;'=>'c', // CHE
-'&#1268;'=>'C','&#1269;'=>'c', // CHE WITH DIAERESIS
-'&#1206;'=>'C','&#1207;'=>'c', // CHE WITH DESCENDER
-'&#1208;'=>'C','&#1209;'=>'c', // CHE WITH VERTICAL STROKE
-'&#1039;'=>'D','&#1119;'=>'d', // DZHE
-'&#1064;'=>'S','&#1096;'=>'s', // SHA
-'&#1065;'=>'S','&#1097;'=>'s', // SHCHA
-'&#1067;'=>'Y','&#1099;'=>'y', // YERU
-'&#1272;'=>'Y','&#1273;'=>'y', // YERU WITH DIAERESIS
-'&#1069;'=>'E','&#1101;'=>'e', // E
-'&#1260;'=>'E','&#1261;'=>'e', // E WITH DIAERESIS
-'&#1070;'=>'U','&#1102;'=>'u', // YU
-'&#1071;'=>'A','&#1103;'=>'a', // YA
-'&#1122;'=>'E','&#1123;'=>'e', // YAT
-'&#1130;'=>'A','&#1131;'=>'a', // BIG YUS
-'&#1138;'=>'F','&#1139;'=>'f', // FITA
-'&#1140;'=>'Y','&#1141;'=>'y', // IZHITSA
-'&#1142;'=>'Y','&#1143;'=>'y', // IZHITSA WITH DOUBLE GRAVE ACCENT
-'&#1192;'=>'O','&#1193;'=>'o', // ABKHASIAN HA
-'&#1120;'=>'O','&#1121;'=>'o', // OMEGA
-'&#1124;'=>'E','&#1125;'=>'e', // IOTIFIED E
-'&#1126;'=>'U','&#1127;'=>'u', // LITTLE YUS (???)
-'&#1128;'=>'U','&#1129;'=>'u', // IOTIFIED LITTLE YUS (???)
-'&#1132;'=>'U','&#1133;'=>'u', // IOTIFIED BIG YUS (???)
-'&#1134;'=>'K','&#1135;'=>'k', // KSI (???)
-'&#1136;'=>'P','&#1137;'=>'p', // PSI (???)
-'&#1144;'=>'U','&#1145;'=>'u', // UK
-'&#1146;'=>'O','&#1147;'=>'o', // ROUND OMEGA (???)
-'&#1148;'=>'O','&#1149;'=>'o', // OMEGA WITH TITLO (???)
-'&#1150;'=>'O','&#1151;'=>'o', // OT (???)
-'&#1152;'=>'K','&#1153;'=>'k', // KOPPA (???)
-'&#1162;'=>'J','&#1163;'=>'j', // SHORT I WITH TAIL
-'&#1166;'=>'R','&#1166;'=>'r', // ER WITH TICK
-'&#1176;'=>'Z','&#1177;'=>'z', // ZE WITH DESCENDER
-'&#1219;'=>'K','&#1220;'=>'k', // KA WITH HOOK
-'&#1221;'=>'L','&#1222;'=>'l', // EL WITH TAIL
-'&#1223;'=>'N','&#1224;'=>'n', // EN WITH HOOK
-'&#1225;'=>'N','&#1226;'=>'n', // EN WITH TAIL
-'&#1227;'=>'C','&#1228;'=>'c', // KHAKASSIAN CHE
-'&#1229;'=>'M','&#1230;'=>'m', // EM WITH TAIL
-// specialchars
-'&#1098;'=>'-','&#1066;'=>'-', // HARD SIGN
-'&#1068;'=>'-','&#1100;'=>'-', // SOFT SIGN
-'&#1164;'=>'-', // SEMISOFT SIGN
-'&#1216;'=>'-', // PALOCHKA
-'&#769;'=>'',
-
-//### (new) GREEK (transcription following wikipedia: http://de.wikipedia.org/w/index.php?title=Wikipedia:Namenskonventionen/Neugriechisch&oldid=29601735 )
-// groups of two chars
-'&alpha;&iota;'=>'e','&Alpha;&iota;'=>'E',
-'&epsilon;&iota;'=>'i','&Epsilon;&iota;'=>'I',
-'&omicron;&iota;'=>'i','&Omicron;&iota;'=>'I',
-'&omicron;&upsilon;'=>'ou','&Omicron;&upsilon;'=>'Ou',
-'&alpha;&upsilon;'=>'av','&Alpha;&upsilon;'=>'Av',
-'&epsilon;&upsilon;'=>'ev','&Epsilon;&upsilon;'=>'Ev',
-'&eta;&upsilon;'=>'iv','&Eta;&upsilon;'=>'Iv',
-'&mu;&pi;'=>'mp','&Mu;&pi;'=>'B',
-'&nu;&tau;'=>'nt','&Nu;&tau;'=>'D',
-'&tau;&zeta;'=>'tz','&Tau;&zeta;'=>'Tz',
-'&gamma;&kappa;'=>'ng','&Gamma;&kappa;'=>'G',
-'&gamma;&gamma;'=>'ng','&Gamma;&gamma;'=>'Ng',
-// single chars
-'&#902;'=>'A','&#904;'=>'E','&#905;'=>'I','&#906;'=>'I','&#908;'=>'O','&#910;'=>'Y','&#911;'=>'O','&#912;'=>'i',
-'&Alpha;'=>'A','&Beta;'=>'V','&Gamma;'=>'G','&Delta;'=>'D','&Epsilon;'=>'E','&Zeta;'=>'Z','&Eta;'=>'I','&Theta;'=>'Th','&Iota;'=>'I','&Kappa;'=>'K','&Lambda;'=>'L','&Mu;'=>'M','&Nu;'=>'N','&Xi;'=>'X','&Omicron;'=>'O','&Pi;'=>'P','&Rho;'=>'R','&Sigma;'=>'S','&Tau;'=>'T','&Upsilon;'=>'Y','&Phi;'=>'F','&Chi;'=>'Ch','&Psi;'=>'Ps','&Omega;'=>'O',
-'&#938;'=>'I','&#939;'=>'Y','&#940;'=>'a','&#941;'=>'e','&#942;'=>'i','&#943;'=>'i','&#944;'=>'y',
-'&alpha;'=>'a','&beta;'=>'v','&gamma;'=>'g','&delta;'=>'d','&epsilon;'=>'e','&zeta;'=>'z','&eta;'=>'i','&theta;'=>'th','&iota;'=>'i','&kappa;'=>'k','&lambda;'=>'l','&mu;'=>'m','&nu;'=>'n','&xi;'=>'x','&omicron;'=>'o','&pi;'=>'p','&rho;'=>'r','&sigmaf;'=>'s','&sigma;'=>'s','&tau;'=>'t','&upsilon;'=>'y','&phi;'=>'f','&chi;'=>'ch','&psi;'=>'ps','&omega;'=>'o',
-'&#970;'=>'i','&#971;'=>'y','&#972;'=>'o','&#973;'=>'y','&#974;'=>'o','&#976;'=>'b','&thetasym;'=>'th','&upsih;'=>'y','&#979;'=>'y','&#980;'=>'y'
-
-);
-
-?>
\ No newline at end of file

Property changes on: trunk/wb/framework/convert.php
___________________________________________________________________
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Deleted: svn:keywords
## -1 +0,0 ##
-Id
\ No newline at end of property
Index: trunk/wb/framework/class.wb.php
===================================================================
--- trunk/wb/framework/class.wb.php	(revision 551)
+++ trunk/wb/framework/class.wb.php	(revision 552)
@@ -1,336 +1,338 @@
-<?php
-
-// $Id$
-
-/*
-
- Website Baker Project <http://www.websitebaker.org/>
- Copyright (C) 2004-2008, Ryan Djurovich
-
- Website Baker is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- Website Baker is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with Website Baker; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-
-*/
-
-/*
-
-wb class
-
-This class is the basis for admin and frontend classes.
-
-*/
-
-// Include PHPLIB template class
-require_once(WB_PATH."/include/phplib/template.inc");
-
-require_once(WB_PATH.'/framework/class.database.php');
-
-// Include new wbmailer class (subclass of PHPmailer)
-require_once(WB_PATH."/framework/class.wbmailer.php");
-
-class wb
-{
-	// General initialization function 
-	// performed when frontend or backend is loaded.
-	function wb() {
-	}
-	
-	// Check whether a page is visible or not.
-	// This will check page-visibility and user- and group-rights.
-	/* page_is_visible() returns
-		false: if page-visibility is 'none' or 'deleted', or page-vis. is 'registered' or 'private' and user isn't allowed to see the page.
-		true: if page-visibility is 'public' or 'hidden', or page-vis. is 'registered' or 'private' and user _is_ allowed to see the page.
-	*/
-	function page_is_visible($page) {
-		$show_it = false; // shall we show the page?
-		$page_id = $page['page_id'];
-		$visibility = $page['visibility'];
-		$viewing_groups = $page['viewing_groups'];
-		$viewing_users = $page['viewing_users'];
-		// First check if visibility is 'none', 'deleted'
-		if($visibility == 'none') {
-			return(false);
-		} elseif($visibility == 'deleted') {
-			return(false);
-		}
-		// Now check if visibility is 'hidden', 'private' or 'registered'
-		if($visibility == 'hidden') { // hidden: hide the menu-link, but show the page
-			$show_it = true;
-		} elseif($visibility == 'private' || $visibility == 'registered') {
-			// Check if the user is logged in
-			if($this->is_authenticated() == true) {
-				// Now check if the user has perms to view the page
-				if(in_array($this->get_group_id(), explode(',', $viewing_groups)) || in_array($this->get_user_id(), explode(',', $viewing_users))) {
-					$show_it = true;
-				} else {
-					$show_it = false;
-				}
-			} else {
-				$show_it = false;
-			}
-		} elseif($visibility == 'public') {
-			$show_it = true;
-		} else {
-			$show_it = false;
-		}
-		return($show_it);
-	}
-
-	// Check whether we should show a page or not (for front-end)
-	function show_page($page) {
-		// First check if the page is set to private
-		if($page['visibility'] == 'private' OR $page['visibility'] == 'registered') {
-			// Check if the user is logged in
-			if($this->is_authenticated() == true) {
-				// Now check if the user has perms to view it
-				$viewing_groups = explode(',', $page['viewing_groups']);
-				$viewing_users = explode(',', $page['viewing_users']);
-				$in_group = FALSE;
-				foreach($this->get_groups_id() as $cur_gid){
-				    if (in_array($cur_gid, $viewing_groups)) {
-				        $in_group = TRUE;
-				    }
-				}
-				if(($in_group) OR is_numeric(array_search($this->get_user_id(), $viewing_users))) {
-					return true;
-				} else {
-					return false;
-				}
-			} else {
-				return false;
-			}
-		} elseif($page['visibility'] == 'public') {
-			return true;
-		} else {
-			return false;
-		}
-	}
-
-	// Check if the user is already authenticated or not
-	function is_authenticated() {
-		if(isset($_SESSION['USER_ID']) AND $_SESSION['USER_ID'] != "" AND is_numeric($_SESSION['USER_ID'])) {
-			return true;
-		} else {
-			return false;
-		}
-	}
-	// Modified addslashes function which takes into account magic_quotes
-	function add_slashes($input) {
-		if ( get_magic_quotes_gpc() || ( !is_string($input) ) ) {
-			return $input;
-		}
-		$output = addslashes($input);
-		return $output;
-	}
-
-	// Ditto for stripslashes
-	function strip_slashes($input) {
-		if ( !get_magic_quotes_gpc() || ( !is_string($input) ) ) {
-			return $input;
-		}
-		$output = stripslashes($input);
-		return $output;
-	}
-
-	// Escape backslashes for use with mySQL LIKE strings
-	function escape_backslashes($input) {
-		return str_replace("\\","\\\\",$input);
-	}
-
-	function page_link($link){
-		// Check for :// in the link (used in URL's) as well as mailto:
-		if(strstr($link, '://') == '' AND substr($link, 0, 7) != 'mailto:') {
-			return WB_URL.PAGES_DIRECTORY.$link.'.php';
-		} else {
-			return $link;
-		}
-	}
-	
-	// Get POST data
-	function get_post($field) {
-		if(isset($_POST[$field])) {
-			return $_POST[$field];
-		} else {
-			return null;
-		}
-	}
-
-	// Get POST data and escape it
-	function get_post_escaped($field) {
-		$result = $this->get_post($field);
-		return (is_null($result)) ? null : $this->add_slashes($result);
-	}
-	
-	// Get GET data
-	function get_get($field) {
-		if(isset($_GET[$field])) {
-			return $_GET[$field];
-		} else {
-			return null;
-		}
-	}
-
-	// Get SESSION data
-	function get_session($field) {
-		if(isset($_SESSION[$field])) {
-			return $_SESSION[$field];
-		} else {
-			return null;
-		}
-	}
-
-	// Get SERVER data
-	function get_server($field) {
-		if(isset($_SERVER[$field])) {
-			return $_SERVER[$field];
-		} else {
-			return null;
-		}
-	}
-
-	// Get the current users id
-	function get_user_id() {
-		return $_SESSION['USER_ID'];
-	}
-
-	// Get the current users group id
-	function get_group_id() {
-		return $_SESSION['GROUP_ID'];
-	}
-
-	// Get the current users group ids
-	function get_groups_id() {
-		return split(",", $_SESSION['GROUPS_ID']);
-	}
-
-	// Get the current users group name
-	function get_group_name() {
-		return implode(",", $_SESSION['GROUP_NAME']);
-	}
-
-	// Get the current users group name
-	function get_groups_name() {
-		return $_SESSION['GROUP_NAME'];
-	}
-
-	// Get the current users username
-	function get_username() {
-		return $_SESSION['USERNAME'];
-	}
-
-	// Get the current users display name
-	function get_display_name() {
-		return ($_SESSION['DISPLAY_NAME']);
-	}
-
-	// Get the current users email address
-	function get_email() {
-		return $_SESSION['EMAIL'];
-	}
-
-	// Get the current users home folder
-	function get_home_folder() {
-		return $_SESSION['HOME_FOLDER'];
-	}
-
-	// Get the current users timezone
-	function get_timezone() {
-		if(!isset($_SESSION['USE_DEFAULT_TIMEZONE'])) {
-			return $_SESSION['TIMEZONE'];
-		} else {
-			return '-72000';
-		}
-	}
-
-	// Validate supplied email address
-	function validate_email($email) {
-		if(eregi("^([0-9a-zA-Z]+[-._+&])*[0-9a-zA-Z]+@([-0-9a-zA-Z]+[.])+[a-zA-Z]{2,6}$", $email)) {
-			return true;
-		} else {
-			return false;
-		}
-	}
-
-	// Print a success message which then automatically redirects the user to another page
-	function print_success($message, $redirect = 'index.php') {
-		global $TEXT;
-		$success_template = new Template(ADMIN_PATH.'/interface');
-		$success_template->set_file('page', 'success.html');
-		$success_template->set_block('page', 'main_block', 'main');
-		$success_template->set_var('MESSAGE', $message);
-		$success_template->set_var('REDIRECT', $redirect);
-		$success_template->set_var('NEXT', $TEXT['NEXT']);
-		$success_template->parse('main', 'main_block', false);
-		$success_template->pparse('output', 'page');
-	}
-	
-	// Print an error message
-	function print_error($message, $link = 'index.php', $auto_footer = true) {
-		global $TEXT;
-		$success_template = new Template(ADMIN_PATH.'/interface');
-		$success_template->set_file('page', 'error.html');
-		$success_template->set_block('page', 'main_block', 'main');
-		$success_template->set_var('MESSAGE', $message);
-		$success_template->set_var('LINK', $link);
-		$success_template->set_var('BACK', $TEXT['BACK']);
-		$success_template->parse('main', 'main_block', false);
-		$success_template->pparse('output', 'page');
-		if($auto_footer == true) {
-			$this->print_footer();
-		}
-		exit();
-	}
-
-	// Validate send email
-	function mail($fromaddress, $toaddress, $subject, $message) {
-		/* 
-			INTEGRATED OPEN SOURCE PHPMAILER CLASS FOR SMTP SUPPORT AND MORE
-			SOME SERVICE PROVIDERS DO NOT SUPPORT SENDING MAIL VIA PHP AS IT DOES NOT PROVIDE SMTP AUTHENTICATION
-			NEW WBMAILER CLASS IS ABLE TO SEND OUT MESSAGES USING SMTP WHICH RESOLVE THESE ISSUE (C. Sommer)
-
-			NOTE:
-			To use SMTP for sending out mails, you have to specify the SMTP host of your domain
-			via the Settings panel in the backend of Website Baker
-		*/ 
-
-		$fromaddress = preg_replace('/[\r\n]/', '', $fromaddress);
-		$toaddress = preg_replace('/[\r\n]/', '', $toaddress);
-		$subject = preg_replace('/[\r\n]/', '', $subject);
-		$message = preg_replace('/[\r\n]/', '<br \>', $message);
-		
-		// create PHPMailer object and define default settings
-		$myMail = new wbmailer();
-      
-		// set user defined from address
-		if ($fromaddress!='') {
-			$myMail->From = $fromaddress;                            // FROM:
-			$myMail->AddReplyTo($fromaddress);                       // REPLY TO:
-		}
-		
-		// define recepient and information to send out
-		$myMail->AddAddress($toaddress);                            // TO:
-		$myMail->Subject = $subject;                                // SUBJECT
-		$myMail->Body = $message;                                   // CONTENT (HTML)
-		$myMail->AltBody = strip_tags($message);                    // CONTENT (TEXT)
-		
-		// check if there are any send mail errors, otherwise say successful
-		if (!$myMail->Send()) {
-			return false;
-		} else {
-			return true;
-		}
-	}
-
-}
-?>
+<?php
+
+// $Id$
+
+/*
+
+ Website Baker Project <http://www.websitebaker.org/>
+ Copyright (C) 2004-2008, Ryan Djurovich
+
+ Website Baker is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ Website Baker is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Website Baker; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+*/
+
+/*
+
+wb class
+
+This class is the basis for admin and frontend classes.
+
+*/
+
+// Include PHPLIB template class
+require_once(WB_PATH."/include/phplib/template.inc");
+
+require_once(WB_PATH.'/framework/class.database.php');
+
+// Include new wbmailer class (subclass of PHPmailer)
+require_once(WB_PATH."/framework/class.wbmailer.php");
+
+class wb
+{
+	// General initialization function 
+	// performed when frontend or backend is loaded.
+	function wb() {
+	}
+	
+	// Check whether a page is visible or not.
+	// This will check page-visibility and user- and group-rights.
+	/* page_is_visible() returns
+		false: if page-visibility is 'none' or 'deleted', or page-vis. is 'registered' or 'private' and user isn't allowed to see the page.
+		true: if page-visibility is 'public' or 'hidden', or page-vis. is 'registered' or 'private' and user _is_ allowed to see the page.
+	*/
+	function page_is_visible($page) {
+		$show_it = false; // shall we show the page?
+		$page_id = $page['page_id'];
+		$visibility = $page['visibility'];
+		$viewing_groups = $page['viewing_groups'];
+		$viewing_users = $page['viewing_users'];
+		// First check if visibility is 'none', 'deleted'
+		if($visibility == 'none') {
+			return(false);
+		} elseif($visibility == 'deleted') {
+			return(false);
+		}
+		// Now check if visibility is 'hidden', 'private' or 'registered'
+		if($visibility == 'hidden') { // hidden: hide the menu-link, but show the page
+			$show_it = true;
+		} elseif($visibility == 'private' || $visibility == 'registered') {
+			// Check if the user is logged in
+			if($this->is_authenticated() == true) {
+				// Now check if the user has perms to view the page
+				$in_group = false;
+				foreach($this->get_groups_id() as $cur_gid){
+				    if(in_array($cur_gid, explode(',', $viewing_groups))) {
+				        $in_group = true;
+				    }
+				}
+				if($in_group || in_array($this->get_user_id(), explode(',', $viewing_users))) {
+					$show_it = true;
+				} else {
+					$show_it = false;
+				}
+			} else {
+				$show_it = false;
+			}
+		} elseif($visibility == 'public') {
+			$show_it = true;
+		} else {
+			$show_it = false;
+		}
+		return($show_it);
+	}
+	// Check if there is at least one active section on this page
+	function page_is_active($page) {
+		global $database;
+		$has_active_sections = false;
+		$page_id = $page['page_id'];
+		$now = time();
+		$query_sections = $database->query("SELECT publ_start,publ_end FROM ".TABLE_PREFIX."sections WHERE page_id = '$page_id'");
+		if($query_sections->numRows() != 0) {
+			while($section = $query_sections->fetchRow()) {
+				if($now<$section['publ_end'] && ($now>$section['publ_start'] || $section['publ_start']==0) || $now>$section['publ_start'] && $section['publ_end']==0) {
+					$has_active_sections = true;
+					break;
+				}
+			}
+		}
+		return($has_active_sections);
+	}
+
+	// Check whether we should show a page or not (for front-end)
+	function show_page($page) {
+		if($this->page_is_visible($page) && $this->page_is_active($page)) {
+			return true;
+		} else {
+			return false;
+		}
+	}
+
+	// Check if the user is already authenticated or not
+	function is_authenticated() {
+		if(isset($_SESSION['USER_ID']) AND $_SESSION['USER_ID'] != "" AND is_numeric($_SESSION['USER_ID'])) {
+			return true;
+		} else {
+			return false;
+		}
+	}
+	// Modified addslashes function which takes into account magic_quotes
+	function add_slashes($input) {
+		if ( get_magic_quotes_gpc() || ( !is_string($input) ) ) {
+			return $input;
+		}
+		$output = addslashes($input);
+		return $output;
+	}
+
+	// Ditto for stripslashes
+	function strip_slashes($input) {
+		if ( !get_magic_quotes_gpc() || ( !is_string($input) ) ) {
+			return $input;
+		}
+		$output = stripslashes($input);
+		return $output;
+	}
+
+	// Escape backslashes for use with mySQL LIKE strings
+	function escape_backslashes($input) {
+		return str_replace("\\","\\\\",$input);
+	}
+
+	function page_link($link){
+		// Check for :// in the link (used in URL's) as well as mailto:
+		if(strstr($link, '://') == '' AND substr($link, 0, 7) != 'mailto:') {
+			return WB_URL.PAGES_DIRECTORY.$link.'.php';
+		} else {
+			return $link;
+		}
+	}
+	
+	// Get POST data
+	function get_post($field) {
+		if(isset($_POST[$field])) {
+			return $_POST[$field];
+		} else {
+			return null;
+		}
+	}
+
+	// Get POST data and escape it
+	function get_post_escaped($field) {
+		$result = $this->get_post($field);
+		return (is_null($result)) ? null : $this->add_slashes($result);
+	}
+	
+	// Get GET data
+	function get_get($field) {
+		if(isset($_GET[$field])) {
+			return $_GET[$field];
+		} else {
+			return null;
+		}
+	}
+
+	// Get SESSION data
+	function get_session($field) {
+		if(isset($_SESSION[$field])) {
+			return $_SESSION[$field];
+		} else {
+			return null;
+		}
+	}
+
+	// Get SERVER data
+	function get_server($field) {
+		if(isset($_SERVER[$field])) {
+			return $_SERVER[$field];
+		} else {
+			return null;
+		}
+	}
+
+	// Get the current users id
+	function get_user_id() {
+		return $_SESSION['USER_ID'];
+	}
+
+	// Get the current users group id
+	function get_group_id() {
+		return $_SESSION['GROUP_ID'];
+	}
+
+	// Get the current users group ids
+	function get_groups_id() {
+		return split(",", $_SESSION['GROUPS_ID']);
+	}
+
+	// Get the current users group name
+	function get_group_name() {
+		return implode(",", $_SESSION['GROUP_NAME']);
+	}
+
+	// Get the current users group name
+	function get_groups_name() {
+		return $_SESSION['GROUP_NAME'];
+	}
+
+	// Get the current users username
+	function get_username() {
+		return $_SESSION['USERNAME'];
+	}
+
+	// Get the current users display name
+	function get_display_name() {
+		return ($_SESSION['DISPLAY_NAME']);
+	}
+
+	// Get the current users email address
+	function get_email() {
+		return $_SESSION['EMAIL'];
+	}
+
+	// Get the current users home folder
+	function get_home_folder() {
+		return $_SESSION['HOME_FOLDER'];
+	}
+
+	// Get the current users timezone
+	function get_timezone() {
+		if(!isset($_SESSION['USE_DEFAULT_TIMEZONE'])) {
+			return $_SESSION['TIMEZONE'];
+		} else {
+			return '-72000';
+		}
+	}
+
+	// Validate supplied email address
+	function validate_email($email) {
+		if(eregi("^([0-9a-zA-Z]+[-._+&])*[0-9a-zA-Z]+@([-0-9a-zA-Z]+[.])+[a-zA-Z]{2,6}$", $email)) {
+			return true;
+		} else {
+			return false;
+		}
+	}
+
+	// Print a success message which then automatically redirects the user to another page
+	function print_success($message, $redirect = 'index.php') {
+		global $TEXT;
+		$success_template = new Template(ADMIN_PATH.'/interface');
+		$success_template->set_file('page', 'success.html');
+		$success_template->set_block('page', 'main_block', 'main');
+		$success_template->set_var('MESSAGE', $message);
+		$success_template->set_var('REDIRECT', $redirect);
+		$success_template->set_var('NEXT', $TEXT['NEXT']);
+		$success_template->parse('main', 'main_block', false);
+		$success_template->pparse('output', 'page');
+	}
+	
+	// Print an error message
+	function print_error($message, $link = 'index.php', $auto_footer = true) {
+		global $TEXT;
+		$success_template = new Template(ADMIN_PATH.'/interface');
+		$success_template->set_file('page', 'error.html');
+		$success_template->set_block('page', 'main_block', 'main');
+		$success_template->set_var('MESSAGE', $message);
+		$success_template->set_var('LINK', $link);
+		$success_template->set_var('BACK', $TEXT['BACK']);
+		$success_template->parse('main', 'main_block', false);
+		$success_template->pparse('output', 'page');
+		if($auto_footer == true) {
+			$this->print_footer();
+		}
+		exit();
+	}
+
+	// Validate send email
+	function mail($fromaddress, $toaddress, $subject, $message) {
+		/* 
+			INTEGRATED OPEN SOURCE PHPMAILER CLASS FOR SMTP SUPPORT AND MORE
+			SOME SERVICE PROVIDERS DO NOT SUPPORT SENDING MAIL VIA PHP AS IT DOES NOT PROVIDE SMTP AUTHENTICATION
+			NEW WBMAILER CLASS IS ABLE TO SEND OUT MESSAGES USING SMTP WHICH RESOLVE THESE ISSUE (C. Sommer)
+
+			NOTE:
+			To use SMTP for sending out mails, you have to specify the SMTP host of your domain
+			via the Settings panel in the backend of Website Baker
+		*/ 
+
+		$fromaddress = preg_replace('/[\r\n]/', '', $fromaddress);
+		$toaddress = preg_replace('/[\r\n]/', '', $toaddress);
+		$subject = preg_replace('/[\r\n]/', '', $subject);
+		$message = preg_replace('/[\r\n]/', '<br \>', $message);
+		
+		// create PHPMailer object and define default settings
+		$myMail = new wbmailer();
+      
+		// set user defined from address
+		if ($fromaddress!='') {
+			$myMail->From = $fromaddress;                            // FROM:
+			$myMail->AddReplyTo($fromaddress);                       // REPLY TO:
+		}
+		
+		// define recepient and information to send out
+		$myMail->AddAddress($toaddress);                            // TO:
+		$myMail->Subject = $subject;                                // SUBJECT
+		$myMail->Body = $message;                                   // CONTENT (HTML)
+		$myMail->AltBody = strip_tags($message);                    // CONTENT (TEXT)
+		
+		// check if there are any send mail errors, otherwise say successful
+		if (!$myMail->Send()) {
+			return false;
+		} else {
+			return true;
+		}
+	}
+
+}
+?>
Index: trunk/wb/framework/functions-utf8.php
===================================================================
--- trunk/wb/framework/functions-utf8.php	(nonexistent)
+++ trunk/wb/framework/functions-utf8.php	(revision 552)
@@ -0,0 +1,1098 @@
+<?php
+
+// $Id: $
+
+/*
+
+ Website Baker Project <http://www.websitebaker.org/>
+ Copyright (C) 2004-2008, Ryan Djurovich
+
+ Website Baker is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ Website Baker is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Website Baker; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+*/
+
+/*
+ * A large part of this file is based on 'utf8.php' from the DokuWiki-project.
+ * (http://www.splitbrain.org/projects/dokuwiki):
+ **
+ * UTF8 helper functions
+ * @license    LGPL (http://www.gnu.org/copyleft/lesser.html)
+ * @author     Andreas Gohr <andi@splitbrain.org>
+ **
+ * modified for use with Website Baker
+ * from thorn, Jan. 2008
+ */
+
+// Functions we use in Website Baker:
+//   entities_to_7bit()
+//   entities_to_umlauts2()
+//   umlauts_to_entities2()
+
+if(!defined('WB_URL')) {
+	header('Location: ../index.php');
+	exit(0);
+}
+
+/*
+ * check for mb_string support
+ */
+if(!defined('UTF8_MBSTRING')){
+  if(function_exists('mb_substr') && !defined('UTF8_NOMBSTRING')){
+    define('UTF8_MBSTRING',1);
+  }else{
+    define('UTF8_MBSTRING',0);
+  }
+}
+
+if(UTF8_MBSTRING){ mb_internal_encoding('UTF-8'); }
+
+require_once(WB_PATH.'/framework/charsets_table.php');
+
+/*
+ * Checks if a string contains 7bit ASCII only
+ *
+ * @author Andreas Gohr <andi@splitbrain.org>
+ */
+function utf8_isASCII($str){
+  for($i=0; $i<strlen($str); $i++){
+    if(ord($str{$i}) >127) return false;
+  }
+  return true;
+}
+
+/*
+ * Strips all highbyte chars
+ *
+ * Returns a pure ASCII7 string
+ *
+ * @author Andreas Gohr <andi@splitbrain.org>
+ */
+function utf8_strip($str){
+  $ascii = '';
+  for($i=0; $i<strlen($str); $i++){
+    if(ord($str{$i}) <128){
+      $ascii .= $str{$i};
+    }
+  }
+  return $ascii;
+}
+
+/*
+ * Tries to detect if a string is in Unicode encoding
+ *
+ * @author <bmorel@ssi.fr>
+ * @link   http://www.php.net/manual/en/function.utf8-encode.php
+ */
+function utf8_check($Str) {
+ for ($i=0; $i<strlen($Str); $i++) {
+  $b = ord($Str[$i]);
+  if ($b < 0x80) continue; # 0bbbbbbb
+  elseif (($b & 0xE0) == 0xC0) $n=1; # 110bbbbb
+  elseif (($b & 0xF0) == 0xE0) $n=2; # 1110bbbb
+  elseif (($b & 0xF8) == 0xF0) $n=3; # 11110bbb
+  elseif (($b & 0xFC) == 0xF8) $n=4; # 111110bb
+  elseif (($b & 0xFE) == 0xFC) $n=5; # 1111110b
+  else return false; # Does not match any model
+  for ($j=0; $j<$n; $j++) { # n bytes matching 10bbbbbb follow ?
+   if ((++$i == strlen($Str)) || ((ord($Str[$i]) & 0xC0) != 0x80))
+   return false;
+  }
+ }
+ return true;
+}
+
+/*
+ * Unicode aware replacement for strlen()
+ *
+ * utf8_decode() converts characters that are not in ISO-8859-1
+ * to '?', which, for the purpose of counting, is alright - It's
+ * even faster than mb_strlen.
+ *
+ * @author <chernyshevsky at hotmail dot com>
+ * @see    strlen()
+ * @see    utf8_decode()
+ */
+function utf8_strlen($string){
+  return strlen(utf8_decode($string));
+}
+
+/*
+ * UTF-8 aware alternative to substr
+ *
+ * Return part of a string given character offset (and optionally length)
+ *
+ * @author Harry Fuecks <hfuecks@gmail.com>
+ * @author Chris Smith <chris@jalakai.co.uk>
+ * @param string
+ * @param integer number of UTF-8 characters offset (from left)
+ * @param integer (optional) length in UTF-8 characters from offset
+ * @return mixed string or false if failure
+ */
+function utf8_substr($str, $offset, $length = null) {
+    if(UTF8_MBSTRING){
+        if( $length === null ){
+            return mb_substr($str, $offset);
+        }else{
+            return mb_substr($str, $offset, $length);
+        }
+    }
+
+    /*
+     * Notes:
+     *
+     * no mb string support, so we'll use pcre regex's with 'u' flag
+     * pcre only supports repetitions of less than 65536, in order to accept up to MAXINT values for
+     * offset and length, we'll repeat a group of 65535 characters when needed (ok, up to MAXINT-65536)
+     *
+     * substr documentation states false can be returned in some cases (e.g. offset > string length)
+     * mb_substr never returns false, it will return an empty string instead.
+     *
+     * calculating the number of characters in the string is a relatively expensive operation, so
+     * we only carry it out when necessary. It isn't necessary for +ve offsets and no specified length
+     */
+
+    // cast parameters to appropriate types to avoid multiple notices/warnings
+    $str = (string)$str;                          // generates E_NOTICE for PHP4 objects, but not PHP5 objects
+    $offset = (int)$offset;
+    if (!is_null($length)) $length = (int)$length;
+
+    // handle trivial cases
+    if ($length === 0) return '';
+    if ($offset < 0 && $length < 0 && $length < $offset) return '';
+
+    $offset_pattern = '';
+    $length_pattern = '';
+
+    // normalise -ve offsets (we could use a tail anchored pattern, but they are horribly slow!)
+    if ($offset < 0) {
+      $strlen = strlen(utf8_decode($str));        // see notes
+      $offset = $strlen + $offset;
+      if ($offset < 0) $offset = 0;
+    }
+
+    // establish a pattern for offset, a non-captured group equal in length to offset
+    if ($offset > 0) {
+      $Ox = (int)($offset/65535);
+      $Oy = $offset%65535;
+
+      if ($Ox) $offset_pattern = '(?:.{65535}){'.$Ox.'}';
+      $offset_pattern = '^(?:'.$offset_pattern.'.{'.$Oy.'})';
+    } else {
+      $offset_pattern = '^';                      // offset == 0; just anchor the pattern
+    }
+
+    // establish a pattern for length
+    if (is_null($length)) {
+      $length_pattern = '(.*)$';                  // the rest of the string
+    } else {
+
+      if (!isset($strlen)) $strlen = strlen(utf8_decode($str));    // see notes
+      if ($offset > $strlen) return '';           // another trivial case
+
+      if ($length > 0) {
+
+        $length = min($strlen-$offset, $length);  // reduce any length that would go passed the end of the string
+
+        $Lx = (int)($length/65535);
+        $Ly = $length%65535;
+
+        // +ve length requires ... a captured group of length characters
+        if ($Lx) $length_pattern = '(?:.{65535}){'.$Lx.'}';
+        $length_pattern = '('.$length_pattern.'.{'.$Ly.'})';
+
+      } else if ($length < 0) {
+
+        if ($length < ($offset - $strlen)) return '';
+
+        $Lx = (int)((-$length)/65535);
+        $Ly = (-$length)%65535;
+
+        // -ve length requires ... capture everything except a group of -length characters
+        //                         anchored at the tail-end of the string
+        if ($Lx) $length_pattern = '(?:.{65535}){'.$Lx.'}';
+        $length_pattern = '(.*)(?:'.$length_pattern.'.{'.$Ly.'})$';
+      }
+    }
+
+    if (!preg_match('#'.$offset_pattern.$length_pattern.'#us',$str,$match)) return '';
+    return $match[1];
+}
+
+/*
+ * Unicode aware replacement for substr_replace()
+ *
+ * @author Andreas Gohr <andi@splitbrain.org>
+ * @see    substr_replace()
+ */
+function utf8_substr_replace($string, $replacement, $start , $length=0 ){
+  $ret = '';
+  if($start>0) $ret .= utf8_substr($string, 0, $start);
+  $ret .= $replacement;
+  $ret .= utf8_substr($string, $start+$length);
+  return $ret;
+}
+
+/*
+ * Unicode aware replacement for ltrim()
+ *
+ * @author Andreas Gohr <andi@splitbrain.org>
+ * @see    ltrim()
+ * @return string
+ */
+function utf8_ltrim($str,$charlist=''){
+  if($charlist == '') return ltrim($str);
+
+  //quote charlist for use in a characterclass
+  $charlist = preg_replace('!([\\\\\\-\\]\\[/])!','\\\${1}',$charlist);
+
+  return preg_replace('/^['.$charlist.']+/u','',$str);
+}
+
+/*
+ * Unicode aware replacement for rtrim()
+ *
+ * @author Andreas Gohr <andi@splitbrain.org>
+ * @see    rtrim()
+ * @return string
+ */
+function  utf8_rtrim($str,$charlist=''){
+  if($charlist == '') return rtrim($str);
+
+  //quote charlist for use in a characterclass
+  $charlist = preg_replace('!([\\\\\\-\\]\\[/])!','\\\${1}',$charlist);
+
+  return preg_replace('/['.$charlist.']+$/u','',$str);
+}
+
+/*
+ * Unicode aware replacement for trim()
+ *
+ * @author Andreas Gohr <andi@splitbrain.org>
+ * @see    trim()
+ * @return string
+ */
+function  utf8_trim($str,$charlist='') {
+  if($charlist == '') return trim($str);
+
+  return utf8_ltrim(utf8_rtrim($str,$charlist),$charlist);
+}
+
+/*
+ * This is a unicode aware replacement for strtolower()
+ *
+ * Uses mb_string extension if available
+ *
+ * @author Leo Feyer <leo@typolight.org>
+ * @see    strtolower()
+ * @see    utf8_strtoupper()
+ */
+function utf8_strtolower($string){
+  if(UTF8_MBSTRING) return mb_strtolower($string,'utf-8');
+
+  global $UTF8_UPPER_TO_LOWER;
+  return strtr($string,$UTF8_UPPER_TO_LOWER);
+}
+
+/*
+ * This is a unicode aware replacement for strtoupper()
+ *
+ * Uses mb_string extension if available
+ *
+ * @author Leo Feyer <leo@typolight.org>
+ * @see    strtoupper()
+ * @see    utf8_strtoupper()
+ */
+function utf8_strtoupper($string){
+  if(UTF8_MBSTRING) return mb_strtoupper($string,'utf-8');
+
+  global $UTF8_LOWER_TO_UPPER;
+  return strtr($string,$UTF8_LOWER_TO_UPPER);
+}
+
+/*
+ * Romanize a non-latin string
+ *
+ * @author Andreas Gohr <andi@splitbrain.org>
+ */
+function utf8_romanize($string){
+  if(utf8_isASCII($string)) return $string; //nothing to do
+
+  global $UTF8_ROMANIZATION;
+  return strtr($string,$UTF8_ROMANIZATION);
+}
+
+/*
+ * Removes special characters (nonalphanumeric) from a UTF-8 string
+ *
+ * This function adds the controlchars 0x00 to 0x19 to the array of
+ * stripped chars (they are not included in $UTF8_SPECIAL_CHARS2)
+ *
+ * @author Andreas Gohr <andi@splitbrain.org>
+ * @param  string $string     The UTF8 string to strip of special chars
+ * @param  string $repl       Replace special with this string
+ * @param  string $additional Additional chars to strip (used in regexp char class)
+ */
+function utf8_stripspecials($string,$repl='',$additional=''){
+  global $UTF8_SPECIAL_CHARS2;
+
+  static $specials = null;
+  if(is_null($specials)){
+    $specials = preg_quote($UTF8_SPECIAL_CHARS2, '/');
+  }
+
+  return preg_replace('/['.$additional.'\x00-\x19'.$specials.']/u',$repl,$string);
+}
+
+/*
+ * This is an Unicode aware replacement for strpos
+ *
+ * @author Leo Feyer <leo@typolight.org>
+ * @see    strpos()
+ * @param  string
+ * @param  string
+ * @param  integer
+ * @return integer
+ */
+function utf8_strpos($haystack, $needle, $offset=0){
+    $comp = 0;
+    $length = null;
+
+    while (is_null($length) || $length < $offset) {
+        $pos = strpos($haystack, $needle, $offset + $comp);
+
+        if ($pos === false)
+            return false;
+
+        $length = utf8_strlen(substr($haystack, 0, $pos));
+
+        if ($length < $offset)
+            $comp = $pos - $length;
+    }
+
+    return $length;
+}
+
+/*
+ * Encodes UTF-8 characters to HTML entities
+ *
+ * @author Tom N Harris <tnharris@whoopdedo.org>
+ * @author <vpribish at shopping dot com>
+ * @link   http://www.php.net/manual/en/function.utf8-decode.php
+ */
+function utf8_tohtml ($str) {
+    $ret = '';
+    foreach (utf8_to_unicode($str) as $cp) {
+        if ($cp < 0x80)
+            $ret .= chr($cp);
+        //elseif ($cp < 0x100)
+        //    $ret .= "&#$cp;";
+        else
+            $ret .= "&#$cp;";
+        //    $ret .= '&#x'.dechex($cp).';';
+    }
+    return $ret;
+}
+
+/*
+ * Decodes HTML entities to UTF-8 characters
+ *
+ * Convert any &#..; entity to a codepoint,
+ * The entities flag defaults to only decoding numeric entities.
+ * Pass HTML_ENTITIES and named entities, including &amp; &lt; etc.
+ * are handled as well. Avoids the problem that would occur if you
+ * had to decode "&amp;#38;&#38;amp;#38;"
+ *
+ * unhtmlspecialchars(utf8_unhtml($s)) -> "&#38;&#38;"
+ * utf8_unhtml(unhtmlspecialchars($s)) -> "&&amp#38;"
+ * what it should be                   -> "&#38;&amp#38;"
+ *
+ * @author Tom N Harris <tnharris@whoopdedo.org>
+ * @param  string  $str      UTF-8 encoded string
+ * @param  boolean $entities Flag controlling decoding of named entities.
+ * @return UTF-8 encoded string with numeric (and named) entities replaced.
+ */
+function utf8_unhtml($str, $entities=null) {
+    static $decoder = null;
+    if (is_null($decoder))
+      $decoder = new utf8_entity_decoder();
+    if (is_null($entities))
+        return preg_replace_callback('/(&#([Xx])?([0-9A-Za-z]+);)/m',
+                                     'utf8_decode_numeric', $str);
+    else
+        return preg_replace_callback('/&(#)?([Xx])?([0-9A-Za-z]+);/m',
+                                     array(&$decoder, 'decode'), $str);
+}
+function utf8_decode_numeric($ent) {
+    switch ($ent[2]) {
+      case 'X':
+      case 'x':
+          $cp = hexdec($ent[3]);
+          break;
+      default:
+          $cp = intval($ent[3]);
+          break;
+    }
+    return unicode_to_utf8(array($cp));
+}
+class utf8_entity_decoder {
+    var $table;
+    function utf8_entity_decoder() {
+        $table = get_html_translation_table(HTML_ENTITIES);
+        $table = array_flip($table);
+        $this->table = array_map(array(&$this,'makeutf8'), $table);
+    }
+    function makeutf8($c) {
+        return unicode_to_utf8(array(ord($c)));
+    }
+    function decode($ent) {
+        if ($ent[1] == '#') {
+            return utf8_decode_numeric($ent);
+        } elseif (array_key_exists($ent[0],$this->table)) {
+            return $this->table[$ent[0]];
+        } else {
+            return $ent[0];
+        }
+    }
+}
+
+/*
+ * Takes an UTF-8 string and returns an array of ints representing the
+ * Unicode characters. Astral planes are supported ie. the ints in the
+ * output can be > 0xFFFF. Occurrances of the BOM are ignored. Surrogates
+ * are not allowed.
+ *
+ * If $strict is set to true the function returns false if the input
+ * string isn't a valid UTF-8 octet sequence and raises a PHP error at
+ * level E_USER_WARNING
+ *
+ * Note: this function has been modified slightly in this library to
+ * trigger errors on encountering bad bytes
+ *
+ * @author <hsivonen@iki.fi>
+ * @author Harry Fuecks <hfuecks@gmail.com>
+ * @param  string  UTF-8 encoded string
+ * @param  boolean Check for invalid sequences?
+ * @return mixed array of unicode code points or false if UTF-8 invalid
+ * @see    unicode_to_utf8
+ * @link   http://hsivonen.iki.fi/php-utf8/
+ * @link   http://sourceforge.net/projects/phputf8/
+ */
+function utf8_to_unicode($str,$strict=false) {
+    $mState = 0;     // cached expected number of octets after the current octet
+                     // until the beginning of the next UTF8 character sequence
+    $mUcs4  = 0;     // cached Unicode character
+    $mBytes = 1;     // cached expected number of octets in the current sequence
+
+    $out = array();
+
+    $len = strlen($str);
+
+    for($i = 0; $i < $len; $i++) {
+
+        $in = ord($str{$i});
+
+        if ( $mState == 0) {
+
+            // When mState is zero we expect either a US-ASCII character or a
+            // multi-octet sequence.
+            if (0 == (0x80 & ($in))) {
+                // US-ASCII, pass straight through.
+                $out[] = $in;
+                $mBytes = 1;
+
+            } else if (0xC0 == (0xE0 & ($in))) {
+                // First octet of 2 octet sequence
+                $mUcs4 = ($in);
+                $mUcs4 = ($mUcs4 & 0x1F) << 6;
+                $mState = 1;
+                $mBytes = 2;
+
+            } else if (0xE0 == (0xF0 & ($in))) {
+                // First octet of 3 octet sequence
+                $mUcs4 = ($in);
+                $mUcs4 = ($mUcs4 & 0x0F) << 12;
+                $mState = 2;
+                $mBytes = 3;
+
+            } else if (0xF0 == (0xF8 & ($in))) {
+                // First octet of 4 octet sequence
+                $mUcs4 = ($in);
+                $mUcs4 = ($mUcs4 & 0x07) << 18;
+                $mState = 3;
+                $mBytes = 4;
+
+            } else if (0xF8 == (0xFC & ($in))) {
+                /* First octet of 5 octet sequence.
+                 *
+                 * This is illegal because the encoded codepoint must be either
+                 * (a) not the shortest form or
+                 * (b) outside the Unicode range of 0-0x10FFFF.
+                 * Rather than trying to resynchronize, we will carry on until the end
+                 * of the sequence and let the later error handling code catch it.
+                 */
+                $mUcs4 = ($in);
+                $mUcs4 = ($mUcs4 & 0x03) << 24;
+                $mState = 4;
+                $mBytes = 5;
+
+            } else if (0xFC == (0xFE & ($in))) {
+                // First octet of 6 octet sequence, see comments for 5 octet sequence.
+                $mUcs4 = ($in);
+                $mUcs4 = ($mUcs4 & 1) << 30;
+                $mState = 5;
+                $mBytes = 6;
+
+            } elseif($strict) {
+                /* Current octet is neither in the US-ASCII range nor a legal first
+                 * octet of a multi-octet sequence.
+                 */
+                trigger_error(
+                        'utf8_to_unicode: Illegal sequence identifier '.
+                            'in UTF-8 at byte '.$i,
+                        E_USER_WARNING
+                    );
+                return false;
+
+            }
+
+        } else {
+
+            // When mState is non-zero, we expect a continuation of the multi-octet
+            // sequence
+            if (0x80 == (0xC0 & ($in))) {
+
+                // Legal continuation.
+                $shift = ($mState - 1) * 6;
+                $tmp = $in;
+                $tmp = ($tmp & 0x0000003F) << $shift;
+                $mUcs4 |= $tmp;
+
+                /*
+                 * End of the multi-octet sequence. mUcs4 now contains the final
+                 * Unicode codepoint to be output
+                 */
+                if (0 == --$mState) {
+
+                    /*
+                     * Check for illegal sequences and codepoints.
+                     */
+                    // From Unicode 3.1, non-shortest form is illegal
+                    if (((2 == $mBytes) && ($mUcs4 < 0x0080)) ||
+                        ((3 == $mBytes) && ($mUcs4 < 0x0800)) ||
+                        ((4 == $mBytes) && ($mUcs4 < 0x10000)) ||
+                        (4 < $mBytes) ||
+                        // From Unicode 3.2, surrogate characters are illegal
+                        (($mUcs4 & 0xFFFFF800) == 0xD800) ||
+                        // Codepoints outside the Unicode range are illegal
+                        ($mUcs4 > 0x10FFFF)) {
+
+                        if($strict){
+                            trigger_error(
+                                    'utf8_to_unicode: Illegal sequence or codepoint '.
+                                        'in UTF-8 at byte '.$i,
+                                    E_USER_WARNING
+                                );
+
+                            return false;
+                        }
+
+                    }
+
+                    if (0xFEFF != $mUcs4) {
+                        // BOM is legal but we don't want to output it
+                        $out[] = $mUcs4;
+                    }
+
+                    //initialize UTF8 cache
+                    $mState = 0;
+                    $mUcs4  = 0;
+                    $mBytes = 1;
+                }
+
+            } elseif($strict) {
+                /*
+                 *((0xC0 & (*in) != 0x80) && (mState != 0))
+                 * Incomplete multi-octet sequence.
+                 */
+                trigger_error(
+                        'utf8_to_unicode: Incomplete multi-octet '.
+                        '   sequence in UTF-8 at byte '.$i,
+                        E_USER_WARNING
+                    );
+
+                return false;
+            }
+        }
+    }
+    return $out;
+}
+
+/*
+ * Takes an array of ints representing the Unicode characters and returns
+ * a UTF-8 string. Astral planes are supported ie. the ints in the
+ * input can be > 0xFFFF. Occurrances of the BOM are ignored. Surrogates
+ * are not allowed.
+ *
+ * If $strict is set to true the function returns false if the input
+ * array contains ints that represent surrogates or are outside the
+ * Unicode range and raises a PHP error at level E_USER_WARNING
+ *
+ * Note: this function has been modified slightly in this library to use
+ * output buffering to concatenate the UTF-8 string (faster) as well as
+ * reference the array by it's keys
+ *
+ * @param  array of unicode code points representing a string
+ * @param  boolean Check for invalid sequences?
+ * @return mixed UTF-8 string or false if array contains invalid code points
+ * @author <hsivonen@iki.fi>
+ * @author Harry Fuecks <hfuecks@gmail.com>
+ * @see    utf8_to_unicode
+ * @link   http://hsivonen.iki.fi/php-utf8/
+ * @link   http://sourceforge.net/projects/phputf8/
+ */
+function unicode_to_utf8($arr,$strict=false) {
+    if (!is_array($arr)) return '';
+    ob_start();
+
+    foreach (array_keys($arr) as $k) {
+
+        # ASCII range (including control chars)
+        if ( ($arr[$k] >= 0) && ($arr[$k] <= 0x007f) ) {
+
+            echo chr($arr[$k]);
+
+        # 2 byte sequence
+        } else if ($arr[$k] <= 0x07ff) {
+
+            echo chr(0xc0 | ($arr[$k] >> 6));
+            echo chr(0x80 | ($arr[$k] & 0x003f));
+
+        # Byte order mark (skip)
+        } else if($arr[$k] == 0xFEFF) {
+
+            // nop -- zap the BOM
+
+        # Test for illegal surrogates
+        } else if ($arr[$k] >= 0xD800 && $arr[$k] <= 0xDFFF) {
+
+            // found a surrogate
+            if($strict){
+                trigger_error(
+                    'unicode_to_utf8: Illegal surrogate '.
+                        'at index: '.$k.', value: '.$arr[$k],
+                    E_USER_WARNING
+                    );
+                return false;
+            }
+
+        # 3 byte sequence
+        } else if ($arr[$k] <= 0xffff) {
+
+            echo chr(0xe0 | ($arr[$k] >> 12));
+            echo chr(0x80 | (($arr[$k] >> 6) & 0x003f));
+            echo chr(0x80 | ($arr[$k] & 0x003f));
+
+        # 4 byte sequence
+        } else if ($arr[$k] <= 0x10ffff) {
+
+            echo chr(0xf0 | ($arr[$k] >> 18));
+            echo chr(0x80 | (($arr[$k] >> 12) & 0x3f));
+            echo chr(0x80 | (($arr[$k] >> 6) & 0x3f));
+            echo chr(0x80 | ($arr[$k] & 0x3f));
+
+        } elseif($strict) {
+
+            trigger_error(
+                'unicode_to_utf8: Codepoint out of Unicode range '.
+                    'at index: '.$k.', value: '.$arr[$k],
+                E_USER_WARNING
+                );
+
+            // out of range
+            return false;
+        }
+    }
+
+    $result = ob_get_contents();
+    ob_end_clean();
+    return $result;
+}
+
+/*
+ * Replace bad bytes with an alternative character
+ *
+ * ASCII character is recommended for replacement char
+ *
+ * PCRE Pattern to locate bad bytes in a UTF-8 string
+ * Comes from W3 FAQ: Multilingual Forms
+ * Note: modified to include full ASCII range including control chars
+ *
+ * @author Harry Fuecks <hfuecks@gmail.com>
+ * @see http://www.w3.org/International/questions/qa-forms-utf-8
+ * @param string to search
+ * @param string to replace bad bytes with (defaults to '?') - use ASCII
+ * @return string
+ */
+function utf8_bad_replace($str, $replace = '') {
+    $UTF8_BAD =
+     '([\x00-\x7F]'.                          # ASCII (including control chars)
+     '|[\xC2-\xDF][\x80-\xBF]'.               # non-overlong 2-byte
+     '|\xE0[\xA0-\xBF][\x80-\xBF]'.           # excluding overlongs
+     '|[\xE1-\xEC\xEE\xEF][\x80-\xBF]{2}'.    # straight 3-byte
+     '|\xED[\x80-\x9F][\x80-\xBF]'.           # excluding surrogates
+     '|\xF0[\x90-\xBF][\x80-\xBF]{2}'.        # planes 1-3
+     '|[\xF1-\xF3][\x80-\xBF]{3}'.            # planes 4-15
+     '|\xF4[\x80-\x8F][\x80-\xBF]{2}'.        # plane 16
+     '|(.{1}))';                              # invalid byte
+    ob_start();
+    while (preg_match('/'.$UTF8_BAD.'/S', $str, $matches)) {
+        if ( !isset($matches[2])) {
+            echo $matches[0];
+        } else {
+            echo $replace;
+        }
+        $str = substr($str,strlen($matches[0]));
+    }
+    $result = ob_get_contents();
+    ob_end_clean();
+    return $result;
+}
+
+/*
+ * URL-Encode a filename to allow unicodecharacters
+ *
+ * Slashes are not encoded
+ *
+ * When the second parameter is true the string will
+ * be encoded only if non ASCII characters are detected -
+ * This makes it safe to run it multiple times on the
+ * same string (default is true)
+ *
+ * @author Andreas Gohr <andi@splitbrain.org>
+ * @see    urlencode
+ */
+function utf8_encodeFN($file,$safe=true){
+  if($safe && preg_match('#^[a-zA-Z0-9/_\-.%]+$#',$file)){
+    return $file;
+  }
+  $file = urlencode($file);
+  $file = str_replace('%2F','/',$file);
+  return $file;
+}
+
+/*
+ * URL-Decode a filename
+ *
+ * This is just a wrapper around urldecode
+ *
+ * @author Andreas Gohr <andi@splitbrain.org>
+ * @see    urldecode
+ */
+function utf8_decodeFN($file){
+  $file = urldecode($file);
+  return $file;
+}
+
+/*
+ * Moved some functions from framework/functions.php to here - thorn
+ */
+
+/*
+ * Decode HTML entities to UTF-8 characters
+ * 
+ * Will replace all numeric and named entities, except
+ * &gt; &lt; &apos; &quot; &#39; &nbsp;
+ * 
+ * @param  string UTF-8 or ASCII encoded string
+ * @return string UTF-8 encoded string with numeric and named entities replaced.
+ */
+function utf8_entities_to_umlauts($str) {
+	global $named_to_numbered_entities;
+	// we have to prevent "&#39;" from beeing decoded
+	$str = str_replace("&#39;", "&_#39;", $str);
+	$str = strtr($str, $named_to_numbered_entities);
+	$str = utf8_unhtml($str);
+	$str = str_replace("&_#39;", "&#39;", $str);
+
+	return($str);
+}
+
+/*
+ * Encode UTF-8 characters to HTML entities
+ *
+ * Will replace all UTF-8 encoded characters to numeric/named entities
+ *
+ * @param  string UTF-8 encoded string
+ * @param  bool Replace numbered by named entities
+ * @return string ASCII encoded string with all UTF-8 characters replaced by numeric/named entities
+ */
+function utf8_umlauts_to_entities($str, $named_entities=true) {
+	global $numbered_to_named_entities;
+	$str = utf8_tohtml($str);
+	if($named_entities)
+		$str = strtr($str, $numbered_to_named_entities);
+	return($str);
+}
+
+/*
+ * Converts from various charsets to UTF-8
+ *
+ * Will convert a string from various charsets to UTF-8.
+ * HTML-entities will be converted, too.
+ * In case of error the returned string is unchanged, and a message is emitted.
+ * Supported charsets are:
+ * direct: iso_8859_1 iso_8859_2 iso_8859_3 iso_8859_4 iso_8859_5
+ *         iso_8859_6 iso_8859_7 iso_8859_8 iso_8859_9 iso_8859_10 iso_8859_11
+ * mb_convert_encoding: all wb charsets (except those from 'direct'); but not GB2312
+ * iconv:  all wb charsets (except those from 'direct')
+ *
+ * @param  string  A string in supported encoding
+ * @param  string  The charset to convert from, defaults to DEFAULT_CHARSET
+ * @return string  A string in UTF-8-encoding, with all entities decoded, too.
+ *                 String is unchanged in case of error.
+ */
+function charset_to_utf8($str, $charset_in=DEFAULT_CHARSET) {
+	global $iso_8859_2_to_utf8, $iso_8859_3_to_utf8, $iso_8859_4_to_utf8, $iso_8859_5_to_utf8, $iso_8859_6_to_utf8, $iso_8859_7_to_utf8, $iso_8859_8_to_utf8, $iso_8859_9_to_utf8, $iso_8859_10_to_utf8, $iso_8859_11_to_utf8;
+	$charset_in = strtoupper($charset_in);
+	if ($charset_in == "") { $charset_in = 'UTF-8'; }
+	$wrong_ISO8859 = false;
+	$converted = false;
+
+	if((!function_exists('iconv') && !UTF8_MBSTRING && ($charset_in=='big5' || $charset_in=='iso-2022-jp' || $charset_in=='iso-2022-kr')) || (!function_exists('iconv') && $charset_in=='gb2312')) {
+		// Nothing we can do here :-(
+		// Charset is one of those obscure ISO-2022... or BIG5, GB2312 or something
+		// and we can't use mb_convert_encoding() or iconv();
+		// Emit an error-message.
+		trigger_error("Can't convert from $charset_in without mb_convert_encoding() or iconv(). Use UTF-8 instead.", E_USER_WARNING);
+		return($str);
+	}
+
+	// check if we have UTF-8 or a plain ASCII string
+	if($charset_in == 'UTF-8' || utf8_isASCII($str)) {
+		// we have utf-8. Just replace HTML-entities and return
+		if(preg_match('/&[#0-9a-zA-Z]+;/',$str))
+			return(utf8_entities_to_umlauts($str));
+		else // nothing to do
+			return($str);
+	}
+	
+	// Convert $str to utf8
+	if(substr($charset_in,0,8) == 'ISO-8859') {
+		switch($charset_in) {
+			case 'ISO-8859-1': $str=utf8_encode($str); break;
+			case 'ISO-8859-2': $str=strtr($str, $iso_8859_2_to_utf8); break;
+			case 'ISO-8859-3': $str=strtr($str, $iso_8859_3_to_utf8); break;
+			case 'ISO-8859-4': $str=strtr($str, $iso_8859_4_to_utf8); break;
+			case 'ISO-8859-5': $str=strtr($str, $iso_8859_5_to_utf8); break;
+			case 'ISO-8859-6': $str=strtr($str, $iso_8859_6_to_utf8); break;
+			case 'ISO-8859-7': $str=strtr($str, $iso_8859_7_to_utf8); break;
+			case 'ISO-8859-8': $str=strtr($str, $iso_8859_8_to_utf8); break;
+			case 'ISO-8859-9': $str=strtr($str, $iso_8859_9_to_utf8); break;
+			case 'ISO-8859-10': $str=strtr($str, $iso_8859_10_to_utf8); break;
+			case 'ISO-8859-11': $str=strtr($str, $iso_8859_11_to_utf8); break;
+			default: $wrong_ISO8859 = true;
+		}
+		if(!$wrong_ISO8859)
+			$converted = true;
+	}
+	if(!$converted && UTF8_MBSTRING && $charset_in != 'GB2312') {
+		// $charset is neither UTF-8 nor a known ISO-8859...
+		// Try mb_convert_encoding() - but there's no GB2312 encoding in php's mb_* functions
+		$str = mb_convert_encoding($str, 'UTF-8', $charset_in);
+		$converted = true;
+	} elseif(!$converted) { // Try iconv
+		if(function_exists('iconv')) {
+			$str = iconv($charset_in, 'UTF-8', $str);
+			$converted = true;
+		}
+	}
+	if($converted) {
+		// we have utf-8, now replace HTML-entities and return
+		if(preg_match('/&[#0-9a-zA-Z]+;/',$str))
+			$str = utf8_entities_to_umlauts($str);
+		// just to be sure, replace bad characters
+		$str = utf8_bad_replace($str, '?');
+		return($str);
+	}
+	
+	// Nothing we can do here :-(
+	// Charset is one of those obscure ISO-2022... or BIG5, GB2312 or something
+	// and we can't use mb_convert_encoding() or iconv();
+	// Emit an error-message.
+	trigger_error("Can't convert from $charset_in without mb_convert_encoding() or iconv(). Use UTF-8 instead.", E_USER_WARNING);
+	
+	return $str;
+}
+
+/*
+ * Converts from UTF-8 to various charsets
+ *
+ * Will convert a string from UTF-8 to various charsets.
+ * HTML-entities will be converted, too.
+ * In case of error the returned string is unchanged, and a message is emitted.
+ * Supported charsets are:
+ * direct: iso_8859_1 iso_8859_2 iso_8859_3 iso_8859_4 iso_8859_5
+ *         iso_8859_6 iso_8859_7 iso_8859_8 iso_8859_9 iso_8859_10 iso_8859_11
+ * mb_convert_encoding: all wb charsets (except those from 'direct'); but not GB2312
+ * iconv:  all wb charsets (except those from 'direct')
+ *
+ * @param  string  An UTF-8 encoded string
+ * @param  string  The charset to convert to, defaults to DEFAULT_CHARSET
+ * @return string  A string in a supported encoding, with all entities decoded, too.
+ *                 String is unchanged in case of error.
+ */
+function utf8_to_charset($str, $charset_out=DEFAULT_CHARSET) {
+	global $utf8_to_iso_8859_2, $utf8_to_iso_8859_3, $utf8_to_iso_8859_4, $utf8_to_iso_8859_5, $utf8_to_iso_8859_6, $utf8_to_iso_8859_7, $utf8_to_iso_8859_8, $utf8_to_iso_8859_9, $utf8_to_iso_8859_10, $utf8_to_iso_8859_11;
+	$charset_out = strtoupper($charset_out);
+	$wrong_ISO8859 = false;
+	$converted = false;
+
+	if((!function_exists('iconv') && !UTF8_MBSTRING && ($charset_out=='big5' || $charset_out=='iso-2022-jp' || $charset_out=='iso-2022-kr')) || (!function_exists('iconv') && $charset_out=='gb2312')) {
+		// Nothing we can do here :-(
+		// Charset is one of those obscure ISO-2022... or BIG5, GB2312 or something
+		// and we can't use mb_convert_encoding() or iconv();
+		// Emit an error-message.
+		trigger_error("Can't convert into $charset_out without mb_convert_encoding() or iconv(). Use UTF-8 instead.", E_USER_WARNING);
+		return($str);
+	}
+	
+	// replace HTML-entities first
+	if(preg_match('/&[#0-9a-zA-Z]+;/',$str))
+		$str = utf8_entities_to_umlauts($str);
+	
+	// check if we need to convert
+	if($charset_out == 'UTF-8' || utf8_isASCII($str)) {
+		// Nothing to do. Just return
+			return($str);
+	}
+	
+	// Convert $str to $charset_out
+	if(substr($charset_out,0,8) == 'ISO-8859') {
+		switch($charset_out) {
+			case 'ISO-8859-1': $str=utf8_decode($str); break;
+			case 'ISO-8859-2': $str=strtr($str, $utf8_to_iso_8859_2); break;
+			case 'ISO-8859-3': $str=strtr($str, $utf8_to_iso_8859_3); break;
+			case 'ISO-8859-4': $str=strtr($str, $utf8_to_iso_8859_4); break;
+			case 'ISO-8859-5': $str=strtr($str, $utf8_to_iso_8859_5); break;
+			case 'ISO-8859-6': $str=strtr($str, $utf8_to_iso_8859_6); break;
+			case 'ISO-8859-7': $str=strtr($str, $utf8_to_iso_8859_7); break;
+			case 'ISO-8859-8': $str=strtr($str, $utf8_to_iso_8859_8); break;
+			case 'ISO-8859-9': $str=strtr($str, $utf8_to_iso_8859_9); break;
+			case 'ISO-8859-10': $str=strtr($str, $utf8_to_iso_8859_10); break;
+			case 'ISO-8859-11': $str=strtr($str, $utf8_to_iso_8859_11); break;
+			default: $wrong_ISO8859 = true;
+		}
+		if(!$wrong_ISO8859)
+			$converted = true;
+	}
+	if(!$converted && UTF8_MBSTRING && $charset_out != 'GB2312') {
+		// $charset is neither UTF-8 nor a known ISO-8859...
+		// Try mb_convert_encoding() - but there's no GB2312 encoding in php's mb_* functions
+		$str = mb_convert_encoding($str, $charset_out, 'UTF-8');
+		$converted = true;
+	} elseif(!$converted) { // Try iconv
+		if(function_exists('iconv')) {
+			$str = iconv('UTF-8', $charset_out, $str);
+			$converted = true;
+		}
+	}
+	if($converted) {
+		return($str);
+	}
+	
+	// Nothing we can do here :-(
+	// Charset is one of those obscure ISO-2022... or BIG5, GB2312 or something
+	// and we can't use mb_convert_encoding() or iconv();
+	// Emit an error-message.
+	trigger_error("Can't convert into $charset_out without mb_convert_encoding() or iconv(). Use UTF-8 instead.", E_USER_WARNING);
+	
+	return $str;
+}
+
+/*
+ * convert Filenames to ASCII
+ *
+ * Convert all non-ASCII characters and all HTML-entities to their plain 7bit equivalents
+ * Characters without an equivalent will be converted to hex-values.
+ * The name entities_to_7bit() is somewhat misleading, but kept for compatibility-reasons.
+ *
+ * @param  string  Filename to convert (all encodings from charset_to_utf8() are allowed)
+ * @return string  ASCII encoded string, to use as filename in wb's page_filename() and media_filename
+ */
+function entities_to_7bit($str) {
+	// convert to UTF-8
+	$str = charset_to_utf8($str);
+	// replace some specials
+	$str = utf8_stripspecials($str, '_');
+	// translate non-ASCII characters to ASCII
+	$str = utf8_romanize($str);
+	// missed some? - Many UTF-8-chars can't be romanized
+	// convert to HTML-entities, and replace entites by hex-numbers
+	$str = utf8_umlauts_to_entities($str, false);
+	$str = str_replace('&#39;', '&apos;', $str);
+	$str = preg_replace('/&#([0-9]+);/e', "dechex('$1')",  $str);
+	// maybe there are some &gt; &lt; &apos; &quot; &amp; &nbsp; left, replace them too
+	$entities = array('&gt;'=>'_','&lt;'=>'_','&apos;'=>'_','&quot;'=>'_','&amp;'=>'_','&nbsp;'=>' ');
+	$str = strtr($str, $entities);
+	
+	return($str);
+}
+
+/*
+ * Convert a string from mixed html-entities/umlauts to pure $charset_out-umlauts
+ * 
+ * Will replace all numeric and named entities except
+ * &gt; &lt; &apos; &quot; &#39; &nbsp;
+ * In case of error the returned string is unchanged, and a message is emitted.
+ * Supported charsets are:
+ * direct: iso_8859_1 iso_8859_2 iso_8859_3 iso_8859_4 iso_8859_5
+ *         iso_8859_6 iso_8859_7 iso_8859_8 iso_8859_9 iso_8859_10 iso_8859_11
+ * mb_convert_encoding: all wb charsets (except those from 'direct'); but not GB2312
+ * iconv:  all wb charsets (except those from 'direct')
+ * 
+ * @param  string  A string in DEFAULT_CHARSET encoding
+ * @return string  A string in $charset_out encoding with numeric and named entities replaced.
+ *         The string is unchanged in case of error. 
+ */
+function entities_to_umlauts2($string, $charset_out=DEFAULT_CHARSET) {
+	$string = charset_to_utf8($string, DEFAULT_CHARSET);
+	if(utf8_check($string))
+		$string = utf8_to_charset($string, $charset_out);
+	return ($string);
+}
+
+/*
+ * Convert a string from mixed html-entities/umlauts to pure ASCII with HTML-entities
+ * 
+ * Will convert a string in $charset_in encoding to a pure ASCII string with HTML-entities.
+ * In case of error the returned string is unchanged, and a message is emitted.
+ * Supported charsets are:
+ * direct: iso_8859_1 iso_8859_2 iso_8859_3 iso_8859_4 iso_8859_5
+ *         iso_8859_6 iso_8859_7 iso_8859_8 iso_8859_9 iso_8859_10 iso_8859_11
+ * mb_convert_encoding: all wb charsets (except those from 'direct'); but not GB2312
+ * iconv:  all wb charsets (except those from 'direct')
+ * 
+ * @param  string  A string in $charset_in encoding
+ * @return string  A string in ASCII encoding with numeric and named entities.
+ *         The string is unchanged in case of error. 
+ */
+function umlauts_to_entities2($string, $charset_in=DEFAULT_CHARSET) {
+	$string = charset_to_utf8($string, $charset_in);
+	if(utf8_check($string))
+		$string = utf8_umlauts_to_entities($string);
+	return($string);
+}
+
+?>
\ No newline at end of file

Property changes on: trunk/wb/framework/functions-utf8.php
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: trunk/wb/framework/charsets_table.php
===================================================================
--- trunk/wb/framework/charsets_table.php	(revision 551)
+++ trunk/wb/framework/charsets_table.php	(revision 552)
@@ -23,6 +23,11 @@
 
 */
 
+if(!defined('WB_URL')) {
+	header('Location: ../index.php');
+	exit(0);
+}
+
 global $iso_8859_2_to_utf8;
 $iso_8859_2_to_utf8 = array(
 	"\x80"=>"\xc2\x80","\x81"=>"\xc2\x81","\x82"=>"\xc2\x82","\x83"=>"\xc2\x83","\x84"=>"\xc2\x84","\x85"=>"\xc2\x85","\x86"=>"\xc2\x86","\x87"=>"\xc2\x87",
@@ -386,4 +391,1072 @@
 	"\xe0\xb9\x94"=>"\xf4","\xe0\xb9\x95"=>"\xf5","\xe0\xb9\x96"=>"\xf6","\xe0\xb9\x97"=>"\xf7","\xe0\xb9\x98"=>"\xf8","\xe0\xb9\x99"=>"\xf9","\xe0\xb9\x9a"=>"\xfa","\xe0\xb9\x9b"=>"\xfb"
 );
 
+// nicht enthalten &gt; &lt; &apos; &#39; &quot; &amp; &nbsp;
+global $named_to_numbered_entities;
+$named_to_numbered_entities=array(
+	'&Aacute;'=>'&#193;','&aacute;'=>'&#225;',
+	'&Acirc;'=>'&#194;','&acirc;'=>'&#226;','&acute;'=>'&#180;','&AElig;'=>'&#198;','&aelig;'=>'&#230;',
+	'&Agrave;'=>'&#192;','&agrave;'=>'&#224;','&alefsym;'=>'&#8501;','&Alpha;'=>'&#913;','&alpha;'=>'&#945;',
+	'&and;'=>'&#8743;','&ang;'=>'&#8736;','&Aring;'=>'&#197;','&aring;'=>'&#229;',
+	'&asymp;'=>'&#8776;','&Atilde;'=>'&#195;','&atilde;'=>'&#227;','&Auml;'=>'&#196;','&auml;'=>'&#228;',
+	'&bdquo;'=>'&#8222;','&Beta;'=>'&#914;','&beta;'=>'&#946;','&brvbar;'=>'&#166;','&bull;'=>'&#8226;',
+	'&cap;'=>'&#8745;','&Ccedil;'=>'&#199;','&ccedil;'=>'&#231;','&cedil;'=>'&#184;','&cent;'=>'&#162;',
+	'&Chi;'=>'&#935;','&chi;'=>'&#967;','&circ;'=>'&#710;','&clubs;'=>'&#9827;','&cong;'=>'&#8773;',
+	'&copy;'=>'&#169;','&crarr;'=>'&#8629;','&cup;'=>'&#8746;','&curren;'=>'&#164;','&Dagger;'=>'&#8225;',
+	'&dagger;'=>'&#8224;','&dArr;'=>'&#8659;','&darr;'=>'&#8595;','&deg;'=>'&#176;','&Delta;'=>'&#916;',
+	'&delta;'=>'&#948;','&diams;'=>'&v#9830;','&divide;'=>'&#247;','&Eacute;'=>'&#201;','&eacute;'=>'&#233;',
+	'&Ecirc;'=>'&#202;','&ecirc;'=>'&#234;','&Egrave;'=>'&#200;','&egrave;'=>'&#232;','&empty;'=>'&#8709;',
+	'&emsp;'=>'&#8195;','&ensp;'=>'&#8194;','&Epsilon;'=>'&#917;','&epsilon;'=>'&#949;','&equiv;'=>'&#8801;',
+	'&Eta;'=>'&#919;','&eta;'=>'&#951;','&ETH;'=>'&#208;','&eth;'=>'&#240;','&Euml;'=>'&#203;','&euml;'=>'&#235;',
+	'&euro;'=>'&#8364;','&exist;'=>'&#8707;','&fnof;'=>'&#402;','&forall;'=>'&#8704;','&frac12;'=>'&#189;',
+	'&frac14;'=>'&#188;','&frac34;'=>'&#190;','&frasl;'=>'&#8260;','&Gamma;'=>'&#915;','&gamma;'=>'&#947;',
+	'&ge;'=>'&#8805;','&hArr;'=>'&#8660;','&harr;'=>'&#8596;','&hearts;'=>'&#9829;',
+	'&hellip;'=>'&#8230;','&Iacute;'=>'&#205;','&iacute;'=>'&#237;','&Icirc;'=>'&#206;','&icirc;'=>'&#238;',
+	'&iexcl;'=>'&#161;','&Igrave;'=>'&#204;','&igrave;'=>'&#236;','&image;'=>'&#8465;','&infin;'=>'&#8734;',
+	'&int;'=>'&#8747;','&Iota;'=>'&#921;','&iota;'=>'&#953;','&iquest;'=>'&#191;','&isin;'=>'&#8712;',
+	'&Iuml;'=>'&#207;','&iuml;'=>'&#239;','&Kappa;'=>'&#922;','&kappa;'=>'&#954;','&Lambda;'=>'&#923;',
+	'&lambda;'=>'&#955;','&lang;'=>'&#9001;','&laquo;'=>'&#171;','&lArr;'=>'&#8656;','&larr;'=>'&#8592;',
+	'&lceil;'=>'&#8968;','&ldquo;'=>'&#8220;','&le;'=>'&#8804;','&lfloor;'=>'&#8970;','&lowast;'=>'&#8727;',
+	'&loz;'=>'&#9674;','&lrm;'=>'&#8206;','&lsaquo;'=>'&#8249;','&lsquo;'=>'&#8216;',
+	'&macr;'=>'&#175;','&mdash;'=>'&#8212;','&micro;'=>'&#181;','&middot;'=>'&#183;','&minus;'=>'&#8722;',
+	'&Mu;'=>'&#924;','&mu;'=>'&#956;','&nabla;'=>'&#8711;','&ndash;'=>'&#8211;',
+	'&ne;'=>'&#8800;','&ni;'=>'&#8715;','&not;'=>'&#172;','&notin;'=>'&#8713;','&nsub;'=>'&#8836;',
+	'&Ntilde;'=>'&#209;','&ntilde;'=>'&#241;','&Nu;'=>'&#925;','&nu;'=>'&#957;','&Oacute;'=>'&#211;',
+	'&oacute;'=>'&#243;','&Ocirc;'=>'&#212;','&ocirc;'=>'&#244;','&OElig;'=>'&#338;','&oelig;'=>'&#339;',
+	'&Ograve;'=>'&#210;','&ograve;'=>'&#242;','&oline;'=>'&#8254;','&Omega;'=>'&#937;','&omega;'=>'&#969;',
+	'&Omicron;'=>'&#927;','&omicron;'=>'&#959;','&oplus;'=>'&#8853;','&or;'=>'&#8744;','&ordf;'=>'&#170;',
+	'&ordm;'=>'&#186;','&Oslash;'=>'&#216;','&oslash;'=>'&#248;','&Otilde;'=>'&#213;','&otilde;'=>'&#245;',
+	'&otimes;'=>'&#8855;','&Ouml;'=>'&#214;','&ouml;'=>'&#246;','&para;'=>'&#182;','&part;'=>'&#8706;',
+	'&permil;'=>'&#8240;','&perp;'=>'&#8869;','&Phi;'=>'&#934;','&phi;'=>'&#966;','&Pi;'=>'&#928;',
+	'&pi;'=>'&#960;','&piv;'=>'&#982;','&plusmn;'=>'&#177;','&pound;'=>'&#163;','&Prime;'=>'&#8243;',
+	'&prime;'=>'&#8242;','&prod;'=>'&#8719;','&prop;'=>'&#8733;','&Psi;'=>'&#936;','&psi;'=>'&#968;',
+	'&radic;'=>'&#8730;','&rang;'=>'&#9002;','&raquo;'=>'&#187;','&rArr;'=>'&#8658;',
+	'&rarr;'=>'&#8594;','&rceil;'=>'&#8969;','&rdquo;'=>'&#8221;','&real;'=>'&#8476;','&reg;'=>'&#174;',
+	'&rfloor;'=>'&#8971;','&Rho;'=>'&#929;','&rho;'=>'&#961;','&rlm;'=>'&#8207;','&rsaquo;'=>'&#8250;',
+	'&rsquo;'=>'&#8217;','&sbquo;'=>'&#8218;','&Scaron;'=>'&#352;','&scaron;'=>'&#353;','&sdot;'=>'&#8901;',
+	'&sect;'=>'&#167;','&shy;'=>'&#173;','&Sigma;'=>'&#931;','&sigma;'=>'&#963;','&sigmaf;'=>'&#962;',
+	'&sim;'=>'&#8764;','&spades;'=>'&#9824;','&sub;'=>'&#8834;','&sube;'=>'&#8838;','&sum;'=>'&#8721;',
+	'&sup;'=>'&#8835;','&sup1;'=>'&#185;','&sup2;'=>'&#178;','&sup3;'=>'&#179;','&supe;'=>'&#8839;',
+	'&szlig;'=>'&#223;','&Tau;'=>'&#932;','&tau;'=>'&#964;','&there4;'=>'&#8756;','&Theta;'=>'&#920;',
+	'&theta;'=>'&#952;','&thetasym;'=>'&#977;','&thinsp;'=>'&#8201;','&THORN;'=>'&#222;','&thorn;'=>'&#254;',
+	'&tilde;'=>'&#732;','&times;'=>'&#215;','&trade;'=>'&#8482;','&Uacute;'=>'&#218;','&uacute;'=>'&#250;',
+	'&uArr;'=>'&#8657;','&uarr;'=>'&#8593;','&Ucirc;'=>'&#219;','&ucirc;'=>'&#251;','&Ugrave;'=>'&#217;',
+	'&ugrave;'=>'&#249;','&uml;'=>'&#168;','&upsih;'=>'&#978;','&Upsilon;'=>'&#933;','&upsilon;'=>'&#965;',
+	'&Uuml;'=>'&#220;','&uuml;'=>'&#252;','&weierp;'=>'&#8472;','&Xi;'=>'&#926;','&xi;'=>'&#958;',
+	'&Yacute;'=>'&#221;','&yacute;'=>'&#253;','&yen;'=>'&#165;','&Yuml;'=>'&#376;','&yuml;'=>'&#255;',
+	'&Zeta;'=>'&#918;','&zeta;'=>'&#950;','&zwj;'=>'&#8205;','&zwnj;'=>'&#8204;'
+);
+// nicht enthalten &gt; &lt; &apos; &#39; &quot; &amp; &nbsp;
+global $numbered_to_named_entities;
+$numbered_to_named_entities=array(
+	'&#193;'=>'&Aacute;','&#225;'=>'&aacute;','&#194;'=>'&Acirc;','&#226;'=>'&acirc;','&#180;'=>'&acute;',
+	'&#198;'=>'&AElig;','&#230;'=>'&aelig;','&#192;'=>'&Agrave;','&#224;'=>'&agrave;','&#8501;'=>'&alefsym;',
+	'&#913;'=>'&Alpha;','&#945;'=>'&alpha;','&#8743;'=>'&and;','&#8736;'=>'&ang;',
+	'&#197;'=>'&Aring;','&#229;'=>'&aring;','&#8776;'=>'&asymp;','&#195;'=>'&Atilde;',
+	'&#227;'=>'&atilde;','&#196;'=>'&Auml;','&#228;'=>'&auml;','&#8222;'=>'&bdquo;','&#914;'=>'&Beta;',
+	'&#946;'=>'&beta;','&#166;'=>'&brvbar;','&#8226;'=>'&bull;','&#8745;'=>'&cap;','&#199;'=>'&Ccedil;',
+	'&#231;'=>'&ccedil;','&#184;'=>'&cedil;','&#162;'=>'&cent;','&#935;'=>'&Chi;','&#967;'=>'&chi;',
+	'&#710;'=>'&circ;','&#9827;'=>'&clubs;','&#8773;'=>'&cong;','&#169;'=>'&copy;','&#8629;'=>'&crarr;',
+	'&#8746;'=>'&cup;','&#164;'=>'&curren;','&#8225;'=>'&Dagger;','&#8224;'=>'&dagger;','&#8659;'=>'&dArr;',
+	'&#8595;'=>'&darr;','&#176;'=>'&deg;','&#916;'=>'&Delta;','&#948;'=>'&delta;','&v#9830;'=>'&diams;',
+	'&#247;'=>'&divide;','&#201;'=>'&Eacute;','&#233;'=>'&eacute;','&#202;'=>'&Ecirc;','&#234;'=>'&ecirc;',
+	'&#200;'=>'&Egrave;','&#232;'=>'&egrave;','&#8709;'=>'&empty;','&#8195;'=>'&emsp;','&#8194;'=>'&ensp;',
+	'&#917;'=>'&Epsilon;','&#949;'=>'&epsilon;','&#8801;'=>'&equiv;','&#919;'=>'&Eta;','&#951;'=>'&eta;',
+	'&#208;'=>'&ETH;','&#240;'=>'&eth;','&#203;'=>'&Euml;','&#235;'=>'&euml;','&#8364;'=>'&euro;',
+	'&#8707;'=>'&exist;','&#402;'=>'&fnof;','&#8704;'=>'&forall;','&#189;'=>'&frac12;','&#188;'=>'&frac14;',
+	'&#190;'=>'&frac34;','&#8260;'=>'&frasl;','&#915;'=>'&Gamma;','&#947;'=>'&gamma;','&#8805;'=>'&ge;',
+	'&#8660;'=>'&hArr;','&#8596;'=>'&harr;','&#9829;'=>'&hearts;','&#8230;'=>'&hellip;',
+	'&#205;'=>'&Iacute;','&#237;'=>'&iacute;','&#206;'=>'&Icirc;','&#238;'=>'&icirc;','&#161;'=>'&iexcl;',
+	'&#204;'=>'&Igrave;','&#236;'=>'&igrave;','&#8465;'=>'&image;','&#8734;'=>'&infin;','&#8747;'=>'&int;',
+	'&#921;'=>'&Iota;','&#953;'=>'&iota;','&#191;'=>'&iquest;','&#8712;'=>'&isin;','&#207;'=>'&Iuml;',
+	'&#239;'=>'&iuml;','&#922;'=>'&Kappa;','&#954;'=>'&kappa;','&#923;'=>'&Lambda;','&#955;'=>'&lambda;',
+	'&#9001;'=>'&lang;','&#171;'=>'&laquo;','&#8656;'=>'&lArr;','&#8592;'=>'&larr;','&#8968;'=>'&lceil;',
+	'&#8220;'=>'&ldquo;','&#8804;'=>'&le;','&#8970;'=>'&lfloor;','&#8727;'=>'&lowast;','&#9674;'=>'&loz;',
+	'&#8206;'=>'&lrm;','&#8249;'=>'&lsaquo;','&#8216;'=>'&lsquo;','&#175;'=>'&macr;',
+	'&#8212;'=>'&mdash;','&#181;'=>'&micro;','&#183;'=>'&middot;','&#8722;'=>'&minus;','&#924;'=>'&Mu;',
+	'&#956;'=>'&mu;','&#8711;'=>'&nabla;','&#8211;'=>'&ndash;','&#8800;'=>'&ne;',
+	'&#8715;'=>'&ni;','&#172;'=>'&not;','&#8713;'=>'&notin;','&#8836;'=>'&nsub;','&#209;'=>'&Ntilde;',
+	'&#241;'=>'&ntilde;','&#925;'=>'&Nu;','&#957;'=>'&nu;','&#211;'=>'&Oacute;','&#243;'=>'&oacute;',
+	'&#212;'=>'&Ocirc;','&#244;'=>'&ocirc;','&#338;'=>'&OElig;','&#339;'=>'&oelig;','&#210;'=>'&Ograve;',
+	'&#242;'=>'&ograve;','&#8254;'=>'&oline;','&#937;'=>'&Omega;','&#969;'=>'&omega;','&#927;'=>'&Omicron;',
+	'&#959;'=>'&omicron;','&#8853;'=>'&oplus;','&#8744;'=>'&or;','&#170;'=>'&ordf;','&#186;'=>'&ordm;',
+	'&#216;'=>'&Oslash;','&#248;'=>'&oslash;','&#213;'=>'&Otilde;','&#245;'=>'&otilde;','&#8855;'=>'&otimes;',
+	'&#214;'=>'&Ouml;','&#246;'=>'&ouml;','&#182;'=>'&para;','&#8706;'=>'&part;','&#8240;'=>'&permil;',
+	'&#8869;'=>'&perp;','&#934;'=>'&Phi;','&#966;'=>'&phi;','&#928;'=>'&Pi;','&#960;'=>'&pi;','&#982;'=>'&piv;',
+	'&#177;'=>'&plusmn;','&#163;'=>'&pound;','&#8243;'=>'&Prime;','&#8242;'=>'&prime;','&#8719;'=>'&prod;',
+	'&#8733;'=>'&prop;','&#936;'=>'&Psi;','&#968;'=>'&psi;','&#8730;'=>'&radic;',
+	'&#9002;'=>'&rang;','&#187;'=>'&raquo;','&#8658;'=>'&rArr;','&#8594;'=>'&rarr;','&#8969;'=>'&rceil;',
+	'&#8221;'=>'&rdquo;','&#8476;'=>'&real;','&#174;'=>'&reg;','&#8971;'=>'&rfloor;','&#929;'=>'&Rho;',
+	'&#961;'=>'&rho;','&#8207;'=>'&rlm;','&#8250;'=>'&rsaquo;','&#8217;'=>'&rsquo;','&#8218;'=>'&sbquo;',
+	'&#352;'=>'&Scaron;','&#353;'=>'&scaron;','&#8901;'=>'&sdot;','&#167;'=>'&sect;','&#173;'=>'&shy;',
+	'&#931;'=>'&Sigma;','&#963;'=>'&sigma;','&#962;'=>'&sigmaf;','&#8764;'=>'&sim;','&#9824;'=>'&spades;',
+	'&#8834;'=>'&sub;','&#8838;'=>'&sube;','&#8721;'=>'&sum;','&#8835;'=>'&sup;','&#185;'=>'&sup1;',
+	'&#178;'=>'&sup2;','&#179;'=>'&sup3;','&#8839;'=>'&supe;','&#223;'=>'&szlig;','&#932;'=>'&Tau;',
+	'&#964;'=>'&tau;','&#8756;'=>'&there4;','&#920;'=>'&Theta;','&#952;'=>'&theta;','&#977;'=>'&thetasym;',
+	'&#8201;'=>'&thinsp;','&#222;'=>'&THORN;','&#254;'=>'&thorn;','&#732;'=>'&tilde;','&#215;'=>'&times;',
+	'&#8482;'=>'&trade;','&#218;'=>'&Uacute;','&#250;'=>'&uacute;','&#8657;'=>'&uArr;','&#8593;'=>'&uarr;',
+	'&#219;'=>'&Ucirc;','&#251;'=>'&ucirc;','&#217;'=>'&Ugrave;','&#249;'=>'&ugrave;','&#168;'=>'&uml;',
+	'&#978;'=>'&upsih;','&#933;'=>'&Upsilon;','&#965;'=>'&upsilon;','&#220;'=>'&Uuml;','&#252;'=>'&uuml;',
+	'&#8472;'=>'&weierp;','&#926;'=>'&Xi;','&#958;'=>'&xi;','&#221;'=>'&Yacute;','&#253;'=>'&yacute;',
+	'&#165;'=>'&yen;','&#376;'=>'&Yuml;','&#255;'=>'&yuml;','&#918;'=>'&Zeta;','&#950;'=>'&zeta;','&#8205;'=>'&zwj;',
+	'&#8204;'=>'&zwnj;'
+);
+
+/*
+ * The following part of this file is based on 'utf8.php' from the DokuWiki-project.
+ * (http://www.splitbrain.org/projects/dokuwiki):
+ **
+ * UTF8 helper functions
+ * @license    LGPL (http://www.gnu.org/copyleft/lesser.html)
+ * @author     Andreas Gohr <andi@splitbrain.org>
+ **
+ * modified for use with Website Baker
+ * from thorn, Jan. 2008
+ */
+
+// only needed if no mb_string available
+// extended - thorn
+if(!UTF8_MBSTRING){
+  /**
+   * UTF-8 Case lookup table
+   *
+   * This lookuptable defines the upper case letters to their correspponding
+   * lower case letter in UTF-8
+   *
+   * @author Andreas Gohr <andi@splitbrain.org>
+   * @author thorn <thorn@nettest.thekk.de>
+   */
+	global $UTF8_LOWER_TO_UPPER;
+	$UTF8_LOWER_TO_UPPER = array(
+		"\x61"=>"\x41","\x62"=>"\x42","\x63"=>"\x43","\x64"=>"\x44",
+		"\x65"=>"\x45","\x66"=>"\x46","\x67"=>"\x47","\x68"=>"\x48",
+		"\x69"=>"\x49","\x6a"=>"\x4a","\x6b"=>"\x4b","\x6c"=>"\x4c",
+		"\x6d"=>"\x4d","\x6e"=>"\x4e","\x6f"=>"\x4f","\x70"=>"\x50",
+		"\x71"=>"\x51","\x72"=>"\x52","\x73"=>"\x53","\x74"=>"\x54",
+		"\x75"=>"\x55","\x76"=>"\x56","\x77"=>"\x57","\x78"=>"\x58",
+		"\x79"=>"\x59","\x7a"=>"\x5a","\xc2\xb5"=>"\xce\x9c","\xc3\xa0"=>"\xc3\x80",
+		"\xc3\xa1"=>"\xc3\x81","\xc3\xa2"=>"\xc3\x82","\xc3\xa3"=>"\xc3\x83","\xc3\xa4"=>"\xc3\x84",
+		"\xc3\xa5"=>"\xc3\x85","\xc3\xa6"=>"\xc3\x86","\xc3\xa7"=>"\xc3\x87","\xc3\xa8"=>"\xc3\x88",
+		"\xc3\xa9"=>"\xc3\x89","\xc3\xaa"=>"\xc3\x8a","\xc3\xab"=>"\xc3\x8b","\xc3\xac"=>"\xc3\x8c",
+		"\xc3\xad"=>"\xc3\x8d","\xc3\xae"=>"\xc3\x8e","\xc3\xaf"=>"\xc3\x8f","\xc3\xb0"=>"\xc3\x90",
+		"\xc3\xb1"=>"\xc3\x91","\xc3\xb2"=>"\xc3\x92","\xc3\xb3"=>"\xc3\x93","\xc3\xb4"=>"\xc3\x94",
+		"\xc3\xb5"=>"\xc3\x95","\xc3\xb6"=>"\xc3\x96","\xc3\xb8"=>"\xc3\x98","\xc3\xb9"=>"\xc3\x99",
+		"\xc3\xba"=>"\xc3\x9a","\xc3\xbb"=>"\xc3\x9b","\xc3\xbc"=>"\xc3\x9c","\xc3\xbd"=>"\xc3\x9d",
+		"\xc3\xbe"=>"\xc3\x9e","\xc3\xbf"=>"\xc5\xb8","\xc4\x81"=>"\xc4\x80","\xc4\x83"=>"\xc4\x82",
+		"\xc4\x85"=>"\xc4\x84","\xc4\x87"=>"\xc4\x86","\xc4\x89"=>"\xc4\x88","\xc4\x8b"=>"\xc4\x8a",
+		"\xc4\x8d"=>"\xc4\x8c","\xc4\x8f"=>"\xc4\x8e","\xc4\x91"=>"\xc4\x90","\xc4\x93"=>"\xc4\x92",
+		"\xc4\x95"=>"\xc4\x94","\xc4\x97"=>"\xc4\x96","\xc4\x99"=>"\xc4\x98","\xc4\x9b"=>"\xc4\x9a",
+		"\xc4\x9d"=>"\xc4\x9c","\xc4\x9f"=>"\xc4\x9e","\xc4\xa1"=>"\xc4\xa0","\xc4\xa3"=>"\xc4\xa2",
+		"\xc4\xa5"=>"\xc4\xa4","\xc4\xa7"=>"\xc4\xa6","\xc4\xa9"=>"\xc4\xa8","\xc4\xab"=>"\xc4\xaa",
+		"\xc4\xad"=>"\xc4\xac","\xc4\xaf"=>"\xc4\xae","\xc4\xb1"=>"\x49","\xc4\xb3"=>"\xc4\xb2",
+		"\xc4\xb5"=>"\xc4\xb4","\xc4\xb7"=>"\xc4\xb6","\xc4\xba"=>"\xc4\xb9","\xc4\xbc"=>"\xc4\xbb",
+		"\xc4\xbe"=>"\xc4\xbd","\xc5\x80"=>"\xc4\xbf","\xc5\x82"=>"\xc5\x81","\xc5\x84"=>"\xc5\x83",
+		"\xc5\x86"=>"\xc5\x85","\xc5\x88"=>"\xc5\x87","\xc5\x8b"=>"\xc5\x8a","\xc5\x8d"=>"\xc5\x8c",
+		"\xc5\x8f"=>"\xc5\x8e","\xc5\x91"=>"\xc5\x90","\xc5\x93"=>"\xc5\x92","\xc5\x95"=>"\xc5\x94",
+		"\xc5\x97"=>"\xc5\x96","\xc5\x99"=>"\xc5\x98","\xc5\x9b"=>"\xc5\x9a","\xc5\x9d"=>"\xc5\x9c",
+		"\xc5\x9f"=>"\xc5\x9e","\xc5\xa1"=>"\xc5\xa0","\xc5\xa3"=>"\xc5\xa2","\xc5\xa5"=>"\xc5\xa4",
+		"\xc5\xa7"=>"\xc5\xa6","\xc5\xa9"=>"\xc5\xa8","\xc5\xab"=>"\xc5\xaa","\xc5\xad"=>"\xc5\xac",
+		"\xc5\xaf"=>"\xc5\xae","\xc5\xb1"=>"\xc5\xb0","\xc5\xb3"=>"\xc5\xb2","\xc5\xb5"=>"\xc5\xb4",
+		"\xc5\xb7"=>"\xc5\xb6","\xc5\xba"=>"\xc5\xb9","\xc5\xbc"=>"\xc5\xbb","\xc5\xbe"=>"\xc5\xbd",
+		"\xc5\xbf"=>"\x53","\xc6\x83"=>"\xc6\x82","\xc6\x85"=>"\xc6\x84","\xc6\x88"=>"\xc6\x87",
+		"\xc6\x8c"=>"\xc6\x8b","\xc6\x92"=>"\xc6\x91","\xc6\x95"=>"\xc7\xb6","\xc6\x99"=>"\xc6\x98",
+		"\xc6\xa1"=>"\xc6\xa0","\xc6\xa3"=>"\xc6\xa2","\xc6\xa5"=>"\xc6\xa4","\xc6\xa8"=>"\xc6\xa7",
+		"\xc6\xad"=>"\xc6\xac","\xc6\xb0"=>"\xc6\xaf","\xc6\xb4"=>"\xc6\xb3","\xc6\xb6"=>"\xc6\xb5",
+		"\xc6\xb9"=>"\xc6\xb8","\xc6\xbd"=>"\xc6\xbc","\xc6\xbf"=>"\xc7\xb7","\xc7\x85"=>"\xc7\x84",
+		"\xc7\x86"=>"\xc7\x84","\xc7\x88"=>"\xc7\x87","\xc7\x89"=>"\xc7\x87","\xc7\x8b"=>"\xc7\x8a",
+		"\xc7\x8c"=>"\xc7\x8a","\xc7\x8e"=>"\xc7\x8d","\xc7\x90"=>"\xc7\x8f","\xc7\x92"=>"\xc7\x91",
+		"\xc7\x94"=>"\xc7\x93","\xc7\x96"=>"\xc7\x95","\xc7\x98"=>"\xc7\x97","\xc7\x9a"=>"\xc7\x99",
+		"\xc7\x9c"=>"\xc7\x9b","\xc7\x9d"=>"\xc6\x8e","\xc7\x9f"=>"\xc7\x9e","\xc7\xa1"=>"\xc7\xa0",
+		"\xc7\xa3"=>"\xc7\xa2","\xc7\xa5"=>"\xc7\xa4","\xc7\xa7"=>"\xc7\xa6","\xc7\xa9"=>"\xc7\xa8",
+		"\xc7\xab"=>"\xc7\xaa","\xc7\xad"=>"\xc7\xac","\xc7\xaf"=>"\xc7\xae","\xc7\xb2"=>"\xc7\xb1",
+		"\xc7\xb3"=>"\xc7\xb1","\xc7\xb5"=>"\xc7\xb4","\xc7\xb9"=>"\xc7\xb8","\xc7\xbb"=>"\xc7\xba",
+		"\xc7\xbd"=>"\xc7\xbc","\xc7\xbf"=>"\xc7\xbe","\xc8\x81"=>"\xc8\x80","\xc8\x83"=>"\xc8\x82",
+		"\xc8\x85"=>"\xc8\x84","\xc8\x87"=>"\xc8\x86","\xc8\x89"=>"\xc8\x88","\xc8\x8b"=>"\xc8\x8a",
+		"\xc8\x8d"=>"\xc8\x8c","\xc8\x8f"=>"\xc8\x8e","\xc8\x91"=>"\xc8\x90","\xc8\x93"=>"\xc8\x92",
+		"\xc8\x95"=>"\xc8\x94","\xc8\x97"=>"\xc8\x96","\xc8\x99"=>"\xc8\x98","\xc8\x9b"=>"\xc8\x9a",
+		"\xc8\x9d"=>"\xc8\x9c","\xc8\x9f"=>"\xc8\x9e","\xc8\xa3"=>"\xc8\xa2","\xc8\xa5"=>"\xc8\xa4",
+		"\xc8\xa7"=>"\xc8\xa6","\xc8\xa9"=>"\xc8\xa8","\xc8\xab"=>"\xc8\xaa","\xc8\xad"=>"\xc8\xac",
+		"\xc8\xaf"=>"\xc8\xae","\xc8\xb1"=>"\xc8\xb0","\xc8\xb3"=>"\xc8\xb2","\xc9\x93"=>"\xc6\x81",
+		"\xc9\x94"=>"\xc6\x86","\xc9\x96"=>"\xc6\x89","\xc9\x97"=>"\xc6\x8a","\xc9\x99"=>"\xc6\x8f",
+		"\xc9\x9b"=>"\xc6\x90","\xc9\xa0"=>"\xc6\x93","\xc9\xa3"=>"\xc6\x94","\xc9\xa8"=>"\xc6\x97",
+		"\xc9\xa9"=>"\xc6\x96","\xc9\xaf"=>"\xc6\x9c","\xc9\xb2"=>"\xc6\x9d","\xc9\xb5"=>"\xc6\x9f",
+		"\xca\x80"=>"\xc6\xa6","\xca\x83"=>"\xc6\xa9","\xca\x88"=>"\xc6\xae","\xca\x8a"=>"\xc6\xb1",
+		"\xca\x8b"=>"\xc6\xb2","\xca\x92"=>"\xc6\xb7","\xcd\x85"=>"\xce\x99","\xce\xac"=>"\xce\x86",
+		"\xce\xad"=>"\xce\x88","\xce\xae"=>"\xce\x89","\xce\xaf"=>"\xce\x8a","\xce\xb1"=>"\xce\x91",
+		"\xce\xb2"=>"\xce\x92","\xce\xb3"=>"\xce\x93","\xce\xb4"=>"\xce\x94","\xce\xb5"=>"\xce\x95",
+		"\xce\xb6"=>"\xce\x96","\xce\xb7"=>"\xce\x97","\xce\xb8"=>"\xce\x98","\xce\xb9"=>"\xce\x99",
+		"\xce\xba"=>"\xce\x9a","\xce\xbb"=>"\xce\x9b","\xce\xbc"=>"\xce\x9c","\xce\xbd"=>"\xce\x9d",
+		"\xce\xbe"=>"\xce\x9e","\xce\xbf"=>"\xce\x9f","\xcf\x80"=>"\xce\xa0","\xcf\x81"=>"\xce\xa1",
+		"\xcf\x82"=>"\xce\xa3","\xcf\x83"=>"\xce\xa3","\xcf\x84"=>"\xce\xa4","\xcf\x85"=>"\xce\xa5",
+		"\xcf\x86"=>"\xce\xa6","\xcf\x87"=>"\xce\xa7","\xcf\x88"=>"\xce\xa8","\xcf\x89"=>"\xce\xa9",
+		"\xcf\x8a"=>"\xce\xaa","\xcf\x8b"=>"\xce\xab","\xcf\x8c"=>"\xce\x8c","\xcf\x8d"=>"\xce\x8e",
+		"\xcf\x8e"=>"\xce\x8f","\xcf\x90"=>"\xce\x92","\xcf\x91"=>"\xce\x98","\xcf\x95"=>"\xce\xa6",
+		"\xcf\x96"=>"\xce\xa0","\xcf\x9b"=>"\xcf\x9a","\xcf\x9d"=>"\xcf\x9c","\xcf\x9f"=>"\xcf\x9e",
+		"\xcf\xa1"=>"\xcf\xa0","\xcf\xa3"=>"\xcf\xa2","\xcf\xa5"=>"\xcf\xa4","\xcf\xa7"=>"\xcf\xa6",
+		"\xcf\xa9"=>"\xcf\xa8","\xcf\xab"=>"\xcf\xaa","\xcf\xad"=>"\xcf\xac","\xcf\xaf"=>"\xcf\xae",
+		"\xcf\xb0"=>"\xce\x9a","\xcf\xb1"=>"\xce\xa1","\xcf\xb2"=>"\xce\xa3","\xcf\xb5"=>"\xce\x95",
+		"\xd0\xb0"=>"\xd0\x90","\xd0\xb1"=>"\xd0\x91","\xd0\xb2"=>"\xd0\x92","\xd0\xb3"=>"\xd0\x93",
+		"\xd0\xb4"=>"\xd0\x94","\xd0\xb5"=>"\xd0\x95","\xd0\xb6"=>"\xd0\x96","\xd0\xb7"=>"\xd0\x97",
+		"\xd0\xb8"=>"\xd0\x98","\xd0\xb9"=>"\xd0\x99","\xd0\xba"=>"\xd0\x9a","\xd0\xbb"=>"\xd0\x9b",
+		"\xd0\xbc"=>"\xd0\x9c","\xd0\xbd"=>"\xd0\x9d","\xd0\xbe"=>"\xd0\x9e","\xd0\xbf"=>"\xd0\x9f",
+		"\xd1\x80"=>"\xd0\xa0","\xd1\x81"=>"\xd0\xa1","\xd1\x82"=>"\xd0\xa2","\xd1\x83"=>"\xd0\xa3",
+		"\xd1\x84"=>"\xd0\xa4","\xd1\x85"=>"\xd0\xa5","\xd1\x86"=>"\xd0\xa6","\xd1\x87"=>"\xd0\xa7",
+		"\xd1\x88"=>"\xd0\xa8","\xd1\x89"=>"\xd0\xa9","\xd1\x8a"=>"\xd0\xaa","\xd1\x8b"=>"\xd0\xab",
+		"\xd1\x8c"=>"\xd0\xac","\xd1\x8d"=>"\xd0\xad","\xd1\x8e"=>"\xd0\xae","\xd1\x8f"=>"\xd0\xaf",
+		"\xd1\x90"=>"\xd0\x80","\xd1\x91"=>"\xd0\x81","\xd1\x92"=>"\xd0\x82","\xd1\x93"=>"\xd0\x83",
+		"\xd1\x94"=>"\xd0\x84","\xd1\x95"=>"\xd0\x85","\xd1\x96"=>"\xd0\x86","\xd1\x97"=>"\xd0\x87",
+		"\xd1\x98"=>"\xd0\x88","\xd1\x99"=>"\xd0\x89","\xd1\x9a"=>"\xd0\x8a","\xd1\x9b"=>"\xd0\x8b",
+		"\xd1\x9c"=>"\xd0\x8c","\xd1\x9d"=>"\xd0\x8d","\xd1\x9e"=>"\xd0\x8e","\xd1\x9f"=>"\xd0\x8f",
+		"\xd1\xa1"=>"\xd1\xa0","\xd1\xa3"=>"\xd1\xa2","\xd1\xa5"=>"\xd1\xa4","\xd1\xa7"=>"\xd1\xa6",
+		"\xd1\xa9"=>"\xd1\xa8","\xd1\xab"=>"\xd1\xaa","\xd1\xad"=>"\xd1\xac","\xd1\xaf"=>"\xd1\xae",
+		"\xd1\xb1"=>"\xd1\xb0","\xd1\xb3"=>"\xd1\xb2","\xd1\xb5"=>"\xd1\xb4","\xd1\xb7"=>"\xd1\xb6",
+		"\xd1\xb9"=>"\xd1\xb8","\xd1\xbb"=>"\xd1\xba","\xd1\xbd"=>"\xd1\xbc","\xd1\xbf"=>"\xd1\xbe",
+		"\xd2\x81"=>"\xd2\x80","\xd2\x8d"=>"\xd2\x8c","\xd2\x8f"=>"\xd2\x8e","\xd2\x91"=>"\xd2\x90",
+		"\xd2\x93"=>"\xd2\x92","\xd2\x95"=>"\xd2\x94","\xd2\x97"=>"\xd2\x96","\xd2\x99"=>"\xd2\x98",
+		"\xd2\x9b"=>"\xd2\x9a","\xd2\x9d"=>"\xd2\x9c","\xd2\x9f"=>"\xd2\x9e","\xd2\xa1"=>"\xd2\xa0",
+		"\xd2\xa3"=>"\xd2\xa2","\xd2\xa5"=>"\xd2\xa4","\xd2\xa7"=>"\xd2\xa6","\xd2\xa9"=>"\xd2\xa8",
+		"\xd2\xab"=>"\xd2\xaa","\xd2\xad"=>"\xd2\xac","\xd2\xaf"=>"\xd2\xae","\xd2\xb1"=>"\xd2\xb0",
+		"\xd2\xb3"=>"\xd2\xb2","\xd2\xb5"=>"\xd2\xb4","\xd2\xb7"=>"\xd2\xb6","\xd2\xb9"=>"\xd2\xb8",
+		"\xd2\xbb"=>"\xd2\xba","\xd2\xbd"=>"\xd2\xbc","\xd2\xbf"=>"\xd2\xbe","\xd3\x82"=>"\xd3\x81",
+		"\xd3\x84"=>"\xd3\x83","\xd3\x88"=>"\xd3\x87","\xd3\x8c"=>"\xd3\x8b","\xd3\x91"=>"\xd3\x90",
+		"\xd3\x93"=>"\xd3\x92","\xd3\x95"=>"\xd3\x94","\xd3\x97"=>"\xd3\x96","\xd3\x99"=>"\xd3\x98",
+		"\xd3\x9b"=>"\xd3\x9a","\xd3\x9d"=>"\xd3\x9c","\xd3\x9f"=>"\xd3\x9e","\xd3\xa1"=>"\xd3\xa0",
+		"\xd3\xa3"=>"\xd3\xa2","\xd3\xa5"=>"\xd3\xa4","\xd3\xa7"=>"\xd3\xa6","\xd3\xa9"=>"\xd3\xa8",
+		"\xd3\xab"=>"\xd3\xaa","\xd3\xad"=>"\xd3\xac","\xd3\xaf"=>"\xd3\xae","\xd3\xb1"=>"\xd3\xb0",
+		"\xd3\xb3"=>"\xd3\xb2","\xd3\xb5"=>"\xd3\xb4","\xd3\xb9"=>"\xd3\xb8","\xd5\xa1"=>"\xd4\xb1",
+		"\xd5\xa2"=>"\xd4\xb2","\xd5\xa3"=>"\xd4\xb3","\xd5\xa4"=>"\xd4\xb4","\xd5\xa5"=>"\xd4\xb5",
+		"\xd5\xa6"=>"\xd4\xb6","\xd5\xa7"=>"\xd4\xb7","\xd5\xa8"=>"\xd4\xb8","\xd5\xa9"=>"\xd4\xb9",
+		"\xd5\xaa"=>"\xd4\xba","\xd5\xab"=>"\xd4\xbb","\xd5\xac"=>"\xd4\xbc","\xd5\xad"=>"\xd4\xbd",
+		"\xd5\xae"=>"\xd4\xbe","\xd5\xaf"=>"\xd4\xbf","\xd5\xb0"=>"\xd5\x80","\xd5\xb1"=>"\xd5\x81",
+		"\xd5\xb2"=>"\xd5\x82","\xd5\xb3"=>"\xd5\x83","\xd5\xb4"=>"\xd5\x84","\xd5\xb5"=>"\xd5\x85",
+		"\xd5\xb6"=>"\xd5\x86","\xd5\xb7"=>"\xd5\x87","\xd5\xb8"=>"\xd5\x88","\xd5\xb9"=>"\xd5\x89",
+		"\xd5\xba"=>"\xd5\x8a","\xd5\xbb"=>"\xd5\x8b","\xd5\xbc"=>"\xd5\x8c","\xd5\xbd"=>"\xd5\x8d",
+		"\xd5\xbe"=>"\xd5\x8e","\xd5\xbf"=>"\xd5\x8f","\xd6\x80"=>"\xd5\x90","\xd6\x81"=>"\xd5\x91",
+		"\xd6\x82"=>"\xd5\x92","\xd6\x83"=>"\xd5\x93","\xd6\x84"=>"\xd5\x94","\xd6\x85"=>"\xd5\x95",
+		"\xd6\x86"=>"\xd5\x96","\xe1\xb8\x81"=>"\xe1\xb8\x80","\xe1\xb8\x83"=>"\xe1\xb8\x82","\xe1\xb8\x85"=>"\xe1\xb8\x84",
+		"\xe1\xb8\x87"=>"\xe1\xb8\x86","\xe1\xb8\x89"=>"\xe1\xb8\x88","\xe1\xb8\x8b"=>"\xe1\xb8\x8a","\xe1\xb8\x8d"=>"\xe1\xb8\x8c",
+		"\xe1\xb8\x8f"=>"\xe1\xb8\x8e","\xe1\xb8\x91"=>"\xe1\xb8\x90","\xe1\xb8\x93"=>"\xe1\xb8\x92","\xe1\xb8\x95"=>"\xe1\xb8\x94",
+		"\xe1\xb8\x97"=>"\xe1\xb8\x96","\xe1\xb8\x99"=>"\xe1\xb8\x98","\xe1\xb8\x9b"=>"\xe1\xb8\x9a","\xe1\xb8\x9d"=>"\xe1\xb8\x9c",
+		"\xe1\xb8\x9f"=>"\xe1\xb8\x9e","\xe1\xb8\xa1"=>"\xe1\xb8\xa0","\xe1\xb8\xa3"=>"\xe1\xb8\xa2","\xe1\xb8\xa5"=>"\xe1\xb8\xa4",
+		"\xe1\xb8\xa7"=>"\xe1\xb8\xa6","\xe1\xb8\xa9"=>"\xe1\xb8\xa8","\xe1\xb8\xab"=>"\xe1\xb8\xaa","\xe1\xb8\xad"=>"\xe1\xb8\xac",
+		"\xe1\xb8\xaf"=>"\xe1\xb8\xae","\xe1\xb8\xb1"=>"\xe1\xb8\xb0","\xe1\xb8\xb3"=>"\xe1\xb8\xb2","\xe1\xb8\xb5"=>"\xe1\xb8\xb4",
+		"\xe1\xb8\xb7"=>"\xe1\xb8\xb6","\xe1\xb8\xb9"=>"\xe1\xb8\xb8","\xe1\xb8\xbb"=>"\xe1\xb8\xba","\xe1\xb8\xbd"=>"\xe1\xb8\xbc",
+		"\xe1\xb8\xbf"=>"\xe1\xb8\xbe","\xe1\xb9\x81"=>"\xe1\xb9\x80","\xe1\xb9\x83"=>"\xe1\xb9\x82","\xe1\xb9\x85"=>"\xe1\xb9\x84",
+		"\xe1\xb9\x87"=>"\xe1\xb9\x86","\xe1\xb9\x89"=>"\xe1\xb9\x88","\xe1\xb9\x8b"=>"\xe1\xb9\x8a","\xe1\xb9\x8d"=>"\xe1\xb9\x8c",
+		"\xe1\xb9\x8f"=>"\xe1\xb9\x8e","\xe1\xb9\x91"=>"\xe1\xb9\x90","\xe1\xb9\x93"=>"\xe1\xb9\x92","\xe1\xb9\x95"=>"\xe1\xb9\x94",
+		"\xe1\xb9\x97"=>"\xe1\xb9\x96","\xe1\xb9\x99"=>"\xe1\xb9\x98","\xe1\xb9\x9b"=>"\xe1\xb9\x9a","\xe1\xb9\x9d"=>"\xe1\xb9\x9c",
+		"\xe1\xb9\x9f"=>"\xe1\xb9\x9e","\xe1\xb9\xa1"=>"\xe1\xb9\xa0","\xe1\xb9\xa3"=>"\xe1\xb9\xa2","\xe1\xb9\xa5"=>"\xe1\xb9\xa4",
+		"\xe1\xb9\xa7"=>"\xe1\xb9\xa6","\xe1\xb9\xa9"=>"\xe1\xb9\xa8","\xe1\xb9\xab"=>"\xe1\xb9\xaa","\xe1\xb9\xad"=>"\xe1\xb9\xac",
+		"\xe1\xb9\xaf"=>"\xe1\xb9\xae","\xe1\xb9\xb1"=>"\xe1\xb9\xb0","\xe1\xb9\xb3"=>"\xe1\xb9\xb2","\xe1\xb9\xb5"=>"\xe1\xb9\xb4",
+		"\xe1\xb9\xb7"=>"\xe1\xb9\xb6","\xe1\xb9\xb9"=>"\xe1\xb9\xb8","\xe1\xb9\xbb"=>"\xe1\xb9\xba","\xe1\xb9\xbd"=>"\xe1\xb9\xbc",
+		"\xe1\xb9\xbf"=>"\xe1\xb9\xbe","\xe1\xba\x81"=>"\xe1\xba\x80","\xe1\xba\x83"=>"\xe1\xba\x82","\xe1\xba\x85"=>"\xe1\xba\x84",
+		"\xe1\xba\x87"=>"\xe1\xba\x86","\xe1\xba\x89"=>"\xe1\xba\x88","\xe1\xba\x8b"=>"\xe1\xba\x8a","\xe1\xba\x8d"=>"\xe1\xba\x8c",
+		"\xe1\xba\x8f"=>"\xe1\xba\x8e","\xe1\xba\x91"=>"\xe1\xba\x90","\xe1\xba\x93"=>"\xe1\xba\x92","\xe1\xba\x95"=>"\xe1\xba\x94",
+		"\xe1\xba\x9b"=>"\xe1\xb9\xa0","\xe1\xba\xa1"=>"\xe1\xba\xa0","\xe1\xba\xa3"=>"\xe1\xba\xa2","\xe1\xba\xa5"=>"\xe1\xba\xa4",
+		"\xe1\xba\xa7"=>"\xe1\xba\xa6","\xe1\xba\xa9"=>"\xe1\xba\xa8","\xe1\xba\xab"=>"\xe1\xba\xaa","\xe1\xba\xad"=>"\xe1\xba\xac",
+		"\xe1\xba\xaf"=>"\xe1\xba\xae","\xe1\xba\xb1"=>"\xe1\xba\xb0","\xe1\xba\xb3"=>"\xe1\xba\xb2","\xe1\xba\xb5"=>"\xe1\xba\xb4",
+		"\xe1\xba\xb7"=>"\xe1\xba\xb6","\xe1\xba\xb9"=>"\xe1\xba\xb8","\xe1\xba\xbb"=>"\xe1\xba\xba","\xe1\xba\xbd"=>"\xe1\xba\xbc",
+		"\xe1\xba\xbf"=>"\xe1\xba\xbe","\xe1\xbb\x81"=>"\xe1\xbb\x80","\xe1\xbb\x83"=>"\xe1\xbb\x82","\xe1\xbb\x85"=>"\xe1\xbb\x84",
+		"\xe1\xbb\x87"=>"\xe1\xbb\x86","\xe1\xbb\x89"=>"\xe1\xbb\x88","\xe1\xbb\x8b"=>"\xe1\xbb\x8a","\xe1\xbb\x8d"=>"\xe1\xbb\x8c",
+		"\xe1\xbb\x8f"=>"\xe1\xbb\x8e","\xe1\xbb\x91"=>"\xe1\xbb\x90","\xe1\xbb\x93"=>"\xe1\xbb\x92","\xe1\xbb\x95"=>"\xe1\xbb\x94",
+		"\xe1\xbb\x97"=>"\xe1\xbb\x96","\xe1\xbb\x99"=>"\xe1\xbb\x98","\xe1\xbb\x9b"=>"\xe1\xbb\x9a","\xe1\xbb\x9d"=>"\xe1\xbb\x9c",
+		"\xe1\xbb\x9f"=>"\xe1\xbb\x9e","\xe1\xbb\xa1"=>"\xe1\xbb\xa0","\xe1\xbb\xa3"=>"\xe1\xbb\xa2","\xe1\xbb\xa5"=>"\xe1\xbb\xa4",
+		"\xe1\xbb\xa7"=>"\xe1\xbb\xa6","\xe1\xbb\xa9"=>"\xe1\xbb\xa8","\xe1\xbb\xab"=>"\xe1\xbb\xaa","\xe1\xbb\xad"=>"\xe1\xbb\xac",
+		"\xe1\xbb\xaf"=>"\xe1\xbb\xae","\xe1\xbb\xb1"=>"\xe1\xbb\xb0","\xe1\xbb\xb3"=>"\xe1\xbb\xb2","\xe1\xbb\xb5"=>"\xe1\xbb\xb4",
+		"\xe1\xbb\xb7"=>"\xe1\xbb\xb6","\xe1\xbb\xb9"=>"\xe1\xbb\xb8","\xe1\xbc\x80"=>"\xe1\xbc\x88","\xe1\xbc\x81"=>"\xe1\xbc\x89",
+		"\xe1\xbc\x82"=>"\xe1\xbc\x8a","\xe1\xbc\x83"=>"\xe1\xbc\x8b","\xe1\xbc\x84"=>"\xe1\xbc\x8c","\xe1\xbc\x85"=>"\xe1\xbc\x8d",
+		"\xe1\xbc\x86"=>"\xe1\xbc\x8e","\xe1\xbc\x87"=>"\xe1\xbc\x8f","\xe1\xbc\x90"=>"\xe1\xbc\x98","\xe1\xbc\x91"=>"\xe1\xbc\x99",
+		"\xe1\xbc\x92"=>"\xe1\xbc\x9a","\xe1\xbc\x93"=>"\xe1\xbc\x9b","\xe1\xbc\x94"=>"\xe1\xbc\x9c","\xe1\xbc\x95"=>"\xe1\xbc\x9d",
+		"\xe1\xbc\xa0"=>"\xe1\xbc\xa8","\xe1\xbc\xa1"=>"\xe1\xbc\xa9","\xe1\xbc\xa2"=>"\xe1\xbc\xaa","\xe1\xbc\xa3"=>"\xe1\xbc\xab",
+		"\xe1\xbc\xa4"=>"\xe1\xbc\xac","\xe1\xbc\xa5"=>"\xe1\xbc\xad","\xe1\xbc\xa6"=>"\xe1\xbc\xae","\xe1\xbc\xa7"=>"\xe1\xbc\xaf",
+		"\xe1\xbc\xb0"=>"\xe1\xbc\xb8","\xe1\xbc\xb1"=>"\xe1\xbc\xb9","\xe1\xbc\xb2"=>"\xe1\xbc\xba","\xe1\xbc\xb3"=>"\xe1\xbc\xbb",
+		"\xe1\xbc\xb4"=>"\xe1\xbc\xbc","\xe1\xbc\xb5"=>"\xe1\xbc\xbd","\xe1\xbc\xb6"=>"\xe1\xbc\xbe","\xe1\xbc\xb7"=>"\xe1\xbc\xbf",
+		"\xe1\xbd\x80"=>"\xe1\xbd\x88","\xe1\xbd\x81"=>"\xe1\xbd\x89","\xe1\xbd\x82"=>"\xe1\xbd\x8a","\xe1\xbd\x83"=>"\xe1\xbd\x8b",
+		"\xe1\xbd\x84"=>"\xe1\xbd\x8c","\xe1\xbd\x85"=>"\xe1\xbd\x8d","\xe1\xbd\x91"=>"\xe1\xbd\x99","\xe1\xbd\x93"=>"\xe1\xbd\x9b",
+		"\xe1\xbd\x95"=>"\xe1\xbd\x9d","\xe1\xbd\x97"=>"\xe1\xbd\x9f","\xe1\xbd\xa0"=>"\xe1\xbd\xa8","\xe1\xbd\xa1"=>"\xe1\xbd\xa9",
+		"\xe1\xbd\xa2"=>"\xe1\xbd\xaa","\xe1\xbd\xa3"=>"\xe1\xbd\xab","\xe1\xbd\xa4"=>"\xe1\xbd\xac","\xe1\xbd\xa5"=>"\xe1\xbd\xad",
+		"\xe1\xbd\xa6"=>"\xe1\xbd\xae","\xe1\xbd\xa7"=>"\xe1\xbd\xaf","\xe1\xbd\xb0"=>"\xe1\xbe\xba","\xe1\xbd\xb1"=>"\xe1\xbe\xbb",
+		"\xe1\xbd\xb2"=>"\xe1\xbf\x88","\xe1\xbd\xb3"=>"\xe1\xbf\x89","\xe1\xbd\xb4"=>"\xe1\xbf\x8a","\xe1\xbd\xb5"=>"\xe1\xbf\x8b",
+		"\xe1\xbd\xb6"=>"\xe1\xbf\x9a","\xe1\xbd\xb7"=>"\xe1\xbf\x9b","\xe1\xbd\xb8"=>"\xe1\xbf\xb8","\xe1\xbd\xb9"=>"\xe1\xbf\xb9",
+		"\xe1\xbd\xba"=>"\xe1\xbf\xaa","\xe1\xbd\xbb"=>"\xe1\xbf\xab","\xe1\xbd\xbc"=>"\xe1\xbf\xba","\xe1\xbd\xbd"=>"\xe1\xbf\xbb",
+		"\xe1\xbe\x80"=>"\xe1\xbe\x88","\xe1\xbe\x81"=>"\xe1\xbe\x89","\xe1\xbe\x82"=>"\xe1\xbe\x8a","\xe1\xbe\x83"=>"\xe1\xbe\x8b",
+		"\xe1\xbe\x84"=>"\xe1\xbe\x8c","\xe1\xbe\x85"=>"\xe1\xbe\x8d","\xe1\xbe\x86"=>"\xe1\xbe\x8e","\xe1\xbe\x87"=>"\xe1\xbe\x8f",
+		"\xe1\xbe\x90"=>"\xe1\xbe\x98","\xe1\xbe\x91"=>"\xe1\xbe\x99","\xe1\xbe\x92"=>"\xe1\xbe\x9a","\xe1\xbe\x93"=>"\xe1\xbe\x9b",
+		"\xe1\xbe\x94"=>"\xe1\xbe\x9c","\xe1\xbe\x95"=>"\xe1\xbe\x9d","\xe1\xbe\x96"=>"\xe1\xbe\x9e","\xe1\xbe\x97"=>"\xe1\xbe\x9f",
+		"\xe1\xbe\xa0"=>"\xe1\xbe\xa8","\xe1\xbe\xa1"=>"\xe1\xbe\xa9","\xe1\xbe\xa2"=>"\xe1\xbe\xaa","\xe1\xbe\xa3"=>"\xe1\xbe\xab",
+		"\xe1\xbe\xa4"=>"\xe1\xbe\xac","\xe1\xbe\xa5"=>"\xe1\xbe\xad","\xe1\xbe\xa6"=>"\xe1\xbe\xae","\xe1\xbe\xa7"=>"\xe1\xbe\xaf",
+		"\xe1\xbe\xb0"=>"\xe1\xbe\xb8","\xe1\xbe\xb1"=>"\xe1\xbe\xb9","\xe1\xbe\xb3"=>"\xe1\xbe\xbc","\xe1\xbe\xbe"=>"\xce\x99",
+		"\xe1\xbf\x83"=>"\xe1\xbf\x8c","\xe1\xbf\x90"=>"\xe1\xbf\x98","\xe1\xbf\x91"=>"\xe1\xbf\x99","\xe1\xbf\xa0"=>"\xe1\xbf\xa8",
+		"\xe1\xbf\xa1"=>"\xe1\xbf\xa9","\xe1\xbf\xa5"=>"\xe1\xbf\xac","\xe1\xbf\xb3"=>"\xe1\xbf\xbc","\xe2\x85\xb0"=>"\xe2\x85\xa0",
+		"\xe2\x85\xb1"=>"\xe2\x85\xa1","\xe2\x85\xb2"=>"\xe2\x85\xa2","\xe2\x85\xb3"=>"\xe2\x85\xa3","\xe2\x85\xb4"=>"\xe2\x85\xa4",
+		"\xe2\x85\xb5"=>"\xe2\x85\xa5","\xe2\x85\xb6"=>"\xe2\x85\xa6","\xe2\x85\xb7"=>"\xe2\x85\xa7","\xe2\x85\xb8"=>"\xe2\x85\xa8",
+		"\xe2\x85\xb9"=>"\xe2\x85\xa9","\xe2\x85\xba"=>"\xe2\x85\xaa","\xe2\x85\xbb"=>"\xe2\x85\xab","\xe2\x85\xbc"=>"\xe2\x85\xac",
+		"\xe2\x85\xbd"=>"\xe2\x85\xad","\xe2\x85\xbe"=>"\xe2\x85\xae","\xe2\x85\xbf"=>"\xe2\x85\xaf","\xe2\x93\x90"=>"\xe2\x92\xb6",
+		"\xe2\x93\x91"=>"\xe2\x92\xb7","\xe2\x93\x92"=>"\xe2\x92\xb8","\xe2\x93\x93"=>"\xe2\x92\xb9","\xe2\x93\x94"=>"\xe2\x92\xba",
+		"\xe2\x93\x95"=>"\xe2\x92\xbb","\xe2\x93\x96"=>"\xe2\x92\xbc","\xe2\x93\x97"=>"\xe2\x92\xbd","\xe2\x93\x98"=>"\xe2\x92\xbe",
+		"\xe2\x93\x99"=>"\xe2\x92\xbf","\xe2\x93\x9a"=>"\xe2\x93\x80","\xe2\x93\x9b"=>"\xe2\x93\x81","\xe2\x93\x9c"=>"\xe2\x93\x82",
+		"\xe2\x93\x9d"=>"\xe2\x93\x83","\xe2\x93\x9e"=>"\xe2\x93\x84","\xe2\x93\x9f"=>"\xe2\x93\x85","\xe2\x93\xa0"=>"\xe2\x93\x86",
+		"\xe2\x93\xa1"=>"\xe2\x93\x87","\xe2\x93\xa2"=>"\xe2\x93\x88","\xe2\x93\xa3"=>"\xe2\x93\x89","\xe2\x93\xa4"=>"\xe2\x93\x8a",
+		"\xe2\x93\xa5"=>"\xe2\x93\x8b","\xe2\x93\xa6"=>"\xe2\x93\x8c","\xe2\x93\xa7"=>"\xe2\x93\x8d","\xe2\x93\xa8"=>"\xe2\x93\x8e",
+		"\xe2\x93\xa9"=>"\xe2\x93\x8f","\xef\xbd\x81"=>"\xef\xbc\xa1","\xef\xbd\x82"=>"\xef\xbc\xa2","\xef\xbd\x83"=>"\xef\xbc\xa3",
+		"\xef\xbd\x84"=>"\xef\xbc\xa4","\xef\xbd\x85"=>"\xef\xbc\xa5","\xef\xbd\x86"=>"\xef\xbc\xa6","\xef\xbd\x87"=>"\xef\xbc\xa7",
+		"\xef\xbd\x88"=>"\xef\xbc\xa8","\xef\xbd\x89"=>"\xef\xbc\xa9","\xef\xbd\x8a"=>"\xef\xbc\xaa","\xef\xbd\x8b"=>"\xef\xbc\xab",
+		"\xef\xbd\x8c"=>"\xef\xbc\xac","\xef\xbd\x8d"=>"\xef\xbc\xad","\xef\xbd\x8e"=>"\xef\xbc\xae","\xef\xbd\x8f"=>"\xef\xbc\xaf",
+		"\xef\xbd\x90"=>"\xef\xbc\xb0","\xef\xbd\x91"=>"\xef\xbc\xb1","\xef\xbd\x92"=>"\xef\xbc\xb2","\xef\xbd\x93"=>"\xef\xbc\xb3",
+		"\xef\xbd\x94"=>"\xef\xbc\xb4","\xef\xbd\x95"=>"\xef\xbc\xb5","\xef\xbd\x96"=>"\xef\xbc\xb6","\xef\xbd\x97"=>"\xef\xbc\xb7",
+		"\xef\xbd\x98"=>"\xef\xbc\xb8","\xef\xbd\x99"=>"\xef\xbc\xb9","\xef\xbd\x9a"=>"\xef\xbc\xba","\xf0\x90\x90\xa8"=>"\xf0\x90\x90\x80",
+		"\xf0\x90\x90\xa9"=>"\xf0\x90\x90\x81","\xf0\x90\x90\xaa"=>"\xf0\x90\x90\x82","\xf0\x90\x90\xab"=>"\xf0\x90\x90\x83","\xf0\x90\x90\xac"=>"\xf0\x90\x90\x84",
+		"\xf0\x90\x90\xad"=>"\xf0\x90\x90\x85","\xf0\x90\x90\xae"=>"\xf0\x90\x90\x86","\xf0\x90\x90\xaf"=>"\xf0\x90\x90\x87","\xf0\x90\x90\xb0"=>"\xf0\x90\x90\x88",
+		"\xf0\x90\x90\xb1"=>"\xf0\x90\x90\x89","\xf0\x90\x90\xb2"=>"\xf0\x90\x90\x8a","\xf0\x90\x90\xb3"=>"\xf0\x90\x90\x8b","\xf0\x90\x90\xb4"=>"\xf0\x90\x90\x8c",
+		"\xf0\x90\x90\xb5"=>"\xf0\x90\x90\x8d","\xf0\x90\x90\xb6"=>"\xf0\x90\x90\x8e","\xf0\x90\x90\xb7"=>"\xf0\x90\x90\x8f","\xf0\x90\x90\xb8"=>"\xf0\x90\x90\x90",
+		"\xf0\x90\x90\xb9"=>"\xf0\x90\x90\x91","\xf0\x90\x90\xba"=>"\xf0\x90\x90\x92","\xf0\x90\x90\xbb"=>"\xf0\x90\x90\x93","\xf0\x90\x90\xbc"=>"\xf0\x90\x90\x94",
+		"\xf0\x90\x90\xbd"=>"\xf0\x90\x90\x95","\xf0\x90\x90\xbe"=>"\xf0\x90\x90\x96","\xf0\x90\x90\xbf"=>"\xf0\x90\x90\x97","\xf0\x90\x91\x80"=>"\xf0\x90\x90\x98",
+		"\xf0\x90\x91\x81"=>"\xf0\x90\x90\x99","\xf0\x90\x91\x82"=>"\xf0\x90\x90\x9a","\xf0\x90\x91\x83"=>"\xf0\x90\x90\x9b","\xf0\x90\x91\x84"=>"\xf0\x90\x90\x9c",
+		"\xf0\x90\x91\x85"=>"\xf0\x90\x90\x9d","\xf0\x90\x91\x86"=>"\xf0\x90\x90\x9e","\xf0\x90\x91\x87"=>"\xf0\x90\x90\x9f","\xf0\x90\x91\x88"=>"\xf0\x90\x90\xa0",
+		"\xf0\x90\x91\x89"=>"\xf0\x90\x90\xa1","\xf0\x90\x91\x8a"=>"\xf0\x90\x90\xa2","\xf0\x90\x91\x8b"=>"\xf0\x90\x90\xa3","\xf0\x90\x91\x8c"=>"\xf0\x90\x90\xa4",
+		"\xf0\x90\x91\x8d"=>"\xf0\x90\x90\xa5","\xc3\x9f"=>"\x53\x53","\xef\xac\x80"=>"\x46\x46","\xef\xac\x81"=>"\x46\x49",
+		"\xef\xac\x82"=>"\x46\x4c","\xef\xac\x83"=>"\x46\x46\x49","\xef\xac\x84"=>"\x46\x46\x4c","\xef\xac\x85"=>"\x53\x54",
+		"\xef\xac\x86"=>"\x53\x54"
+	);
+  /**
+   * UTF-8 Case lookup table
+   *
+   * This lookuptable defines the lower case letters to their correspponding
+   * upper case letter in UTF-8
+   *
+   * @author Andreas Gohr <andi@splitbrain.org>
+   * @author thorn <thorn@nettest.thekk.de>
+   */
+	global $UTF8_UPPER_TO_LOWER;
+	$UTF8_UPPER_TO_LOWER = array(
+		"\x41"=>"\x61","\x42"=>"\x62","\x43"=>"\x63","\x44"=>"\x64",
+		"\x45"=>"\x65","\x46"=>"\x66","\x47"=>"\x67","\x48"=>"\x68",
+		"\x49"=>"\x69","\x4a"=>"\x6a","\x4b"=>"\x6b","\x4c"=>"\x6c",
+		"\x4d"=>"\x6d","\x4e"=>"\x6e","\x4f"=>"\x6f","\x50"=>"\x70",
+		"\x51"=>"\x71","\x52"=>"\x72","\x53"=>"\x73","\x54"=>"\x74",
+		"\x55"=>"\x75","\x56"=>"\x76","\x57"=>"\x77","\x58"=>"\x78",
+		"\x59"=>"\x79","\x5a"=>"\x7a","\xc3\x80"=>"\xc3\xa0","\xc3\x81"=>"\xc3\xa1",
+		"\xc3\x82"=>"\xc3\xa2","\xc3\x83"=>"\xc3\xa3","\xc3\x84"=>"\xc3\xa4","\xc3\x85"=>"\xc3\xa5",
+		"\xc3\x86"=>"\xc3\xa6","\xc3\x87"=>"\xc3\xa7","\xc3\x88"=>"\xc3\xa8","\xc3\x89"=>"\xc3\xa9",
+		"\xc3\x8a"=>"\xc3\xaa","\xc3\x8b"=>"\xc3\xab","\xc3\x8c"=>"\xc3\xac","\xc3\x8d"=>"\xc3\xad",
+		"\xc3\x8e"=>"\xc3\xae","\xc3\x8f"=>"\xc3\xaf","\xc3\x90"=>"\xc3\xb0","\xc3\x91"=>"\xc3\xb1",
+		"\xc3\x92"=>"\xc3\xb2","\xc3\x93"=>"\xc3\xb3","\xc3\x94"=>"\xc3\xb4","\xc3\x95"=>"\xc3\xb5",
+		"\xc3\x96"=>"\xc3\xb6","\xc3\x98"=>"\xc3\xb8","\xc3\x99"=>"\xc3\xb9","\xc3\x9a"=>"\xc3\xba",
+		"\xc3\x9b"=>"\xc3\xbb","\xc3\x9c"=>"\xc3\xbc","\xc3\x9d"=>"\xc3\xbd","\xc3\x9e"=>"\xc3\xbe",
+		"\xc4\x80"=>"\xc4\x81","\xc4\x82"=>"\xc4\x83","\xc4\x84"=>"\xc4\x85","\xc4\x86"=>"\xc4\x87",
+		"\xc4\x88"=>"\xc4\x89","\xc4\x8a"=>"\xc4\x8b","\xc4\x8c"=>"\xc4\x8d","\xc4\x8e"=>"\xc4\x8f",
+		"\xc4\x90"=>"\xc4\x91","\xc4\x92"=>"\xc4\x93","\xc4\x94"=>"\xc4\x95","\xc4\x96"=>"\xc4\x97",
+		"\xc4\x98"=>"\xc4\x99","\xc4\x9a"=>"\xc4\x9b","\xc4\x9c"=>"\xc4\x9d","\xc4\x9e"=>"\xc4\x9f",
+		"\xc4\xa0"=>"\xc4\xa1","\xc4\xa2"=>"\xc4\xa3","\xc4\xa4"=>"\xc4\xa5","\xc4\xa6"=>"\xc4\xa7",
+		"\xc4\xa8"=>"\xc4\xa9","\xc4\xaa"=>"\xc4\xab","\xc4\xac"=>"\xc4\xad","\xc4\xae"=>"\xc4\xaf",
+		"\xc4\xb0"=>"\x69","\xc4\xb2"=>"\xc4\xb3","\xc4\xb4"=>"\xc4\xb5","\xc4\xb6"=>"\xc4\xb7",
+		"\xc4\xb9"=>"\xc4\xba","\xc4\xbb"=>"\xc4\xbc","\xc4\xbd"=>"\xc4\xbe","\xc4\xbf"=>"\xc5\x80",
+		"\xc5\x81"=>"\xc5\x82","\xc5\x83"=>"\xc5\x84","\xc5\x85"=>"\xc5\x86","\xc5\x87"=>"\xc5\x88",
+		"\xc5\x8a"=>"\xc5\x8b","\xc5\x8c"=>"\xc5\x8d","\xc5\x8e"=>"\xc5\x8f","\xc5\x90"=>"\xc5\x91",
+		"\xc5\x92"=>"\xc5\x93","\xc5\x94"=>"\xc5\x95","\xc5\x96"=>"\xc5\x97","\xc5\x98"=>"\xc5\x99",
+		"\xc5\x9a"=>"\xc5\x9b","\xc5\x9c"=>"\xc5\x9d","\xc5\x9e"=>"\xc5\x9f","\xc5\xa0"=>"\xc5\xa1",
+		"\xc5\xa2"=>"\xc5\xa3","\xc5\xa4"=>"\xc5\xa5","\xc5\xa6"=>"\xc5\xa7","\xc5\xa8"=>"\xc5\xa9",
+		"\xc5\xaa"=>"\xc5\xab","\xc5\xac"=>"\xc5\xad","\xc5\xae"=>"\xc5\xaf","\xc5\xb0"=>"\xc5\xb1",
+		"\xc5\xb2"=>"\xc5\xb3","\xc5\xb4"=>"\xc5\xb5","\xc5\xb6"=>"\xc5\xb7","\xc5\xb8"=>"\xc3\xbf",
+		"\xc5\xb9"=>"\xc5\xba","\xc5\xbb"=>"\xc5\xbc","\xc5\xbd"=>"\xc5\xbe","\xc6\x81"=>"\xc9\x93",
+		"\xc6\x82"=>"\xc6\x83","\xc6\x84"=>"\xc6\x85","\xc6\x86"=>"\xc9\x94","\xc6\x87"=>"\xc6\x88",
+		"\xc6\x89"=>"\xc9\x96","\xc6\x8a"=>"\xc9\x97","\xc6\x8b"=>"\xc6\x8c","\xc6\x8e"=>"\xc7\x9d",
+		"\xc6\x8f"=>"\xc9\x99","\xc6\x90"=>"\xc9\x9b","\xc6\x91"=>"\xc6\x92","\xc6\x93"=>"\xc9\xa0",
+		"\xc6\x94"=>"\xc9\xa3","\xc6\x96"=>"\xc9\xa9","\xc6\x97"=>"\xc9\xa8","\xc6\x98"=>"\xc6\x99",
+		"\xc6\x9c"=>"\xc9\xaf","\xc6\x9d"=>"\xc9\xb2","\xc6\x9f"=>"\xc9\xb5","\xc6\xa0"=>"\xc6\xa1",
+		"\xc6\xa2"=>"\xc6\xa3","\xc6\xa4"=>"\xc6\xa5","\xc6\xa6"=>"\xca\x80","\xc6\xa7"=>"\xc6\xa8",
+		"\xc6\xa9"=>"\xca\x83","\xc6\xac"=>"\xc6\xad","\xc6\xae"=>"\xca\x88","\xc6\xaf"=>"\xc6\xb0",
+		"\xc6\xb1"=>"\xca\x8a","\xc6\xb2"=>"\xca\x8b","\xc6\xb3"=>"\xc6\xb4","\xc6\xb5"=>"\xc6\xb6",
+		"\xc6\xb7"=>"\xca\x92","\xc6\xb8"=>"\xc6\xb9","\xc6\xbc"=>"\xc6\xbd","\xc7\x84"=>"\xc7\x86",
+		"\xc7\x85"=>"\xc7\x86","\xc7\x87"=>"\xc7\x89","\xc7\x88"=>"\xc7\x89","\xc7\x8a"=>"\xc7\x8c",
+		"\xc7\x8b"=>"\xc7\x8c","\xc7\x8d"=>"\xc7\x8e","\xc7\x8f"=>"\xc7\x90","\xc7\x91"=>"\xc7\x92",
+		"\xc7\x93"=>"\xc7\x94","\xc7\x95"=>"\xc7\x96","\xc7\x97"=>"\xc7\x98","\xc7\x99"=>"\xc7\x9a",
+		"\xc7\x9b"=>"\xc7\x9c","\xc7\x9e"=>"\xc7\x9f","\xc7\xa0"=>"\xc7\xa1","\xc7\xa2"=>"\xc7\xa3",
+		"\xc7\xa4"=>"\xc7\xa5","\xc7\xa6"=>"\xc7\xa7","\xc7\xa8"=>"\xc7\xa9","\xc7\xaa"=>"\xc7\xab",
+		"\xc7\xac"=>"\xc7\xad","\xc7\xae"=>"\xc7\xaf","\xc7\xb1"=>"\xc7\xb3","\xc7\xb2"=>"\xc7\xb3",
+		"\xc7\xb4"=>"\xc7\xb5","\xc7\xb6"=>"\xc6\x95","\xc7\xb7"=>"\xc6\xbf","\xc7\xb8"=>"\xc7\xb9",
+		"\xc7\xba"=>"\xc7\xbb","\xc7\xbc"=>"\xc7\xbd","\xc7\xbe"=>"\xc7\xbf","\xc8\x80"=>"\xc8\x81",
+		"\xc8\x82"=>"\xc8\x83","\xc8\x84"=>"\xc8\x85","\xc8\x86"=>"\xc8\x87","\xc8\x88"=>"\xc8\x89",
+		"\xc8\x8a"=>"\xc8\x8b","\xc8\x8c"=>"\xc8\x8d","\xc8\x8e"=>"\xc8\x8f","\xc8\x90"=>"\xc8\x91",
+		"\xc8\x92"=>"\xc8\x93","\xc8\x94"=>"\xc8\x95","\xc8\x96"=>"\xc8\x97","\xc8\x98"=>"\xc8\x99",
+		"\xc8\x9a"=>"\xc8\x9b","\xc8\x9c"=>"\xc8\x9d","\xc8\x9e"=>"\xc8\x9f","\xc8\xa2"=>"\xc8\xa3",
+		"\xc8\xa4"=>"\xc8\xa5","\xc8\xa6"=>"\xc8\xa7","\xc8\xa8"=>"\xc8\xa9","\xc8\xaa"=>"\xc8\xab",
+		"\xc8\xac"=>"\xc8\xad","\xc8\xae"=>"\xc8\xaf","\xc8\xb0"=>"\xc8\xb1","\xc8\xb2"=>"\xc8\xb3",
+		"\xce\x86"=>"\xce\xac","\xce\x88"=>"\xce\xad","\xce\x89"=>"\xce\xae","\xce\x8a"=>"\xce\xaf",
+		"\xce\x8c"=>"\xcf\x8c","\xce\x8e"=>"\xcf\x8d","\xce\x8f"=>"\xcf\x8e","\xce\x91"=>"\xce\xb1",
+		"\xce\x92"=>"\xce\xb2","\xce\x93"=>"\xce\xb3","\xce\x94"=>"\xce\xb4","\xce\x95"=>"\xce\xb5",
+		"\xce\x96"=>"\xce\xb6","\xce\x97"=>"\xce\xb7","\xce\x98"=>"\xce\xb8","\xce\x99"=>"\xce\xb9",
+		"\xce\x9a"=>"\xce\xba","\xce\x9b"=>"\xce\xbb","\xce\x9c"=>"\xce\xbc","\xce\x9d"=>"\xce\xbd",
+		"\xce\x9e"=>"\xce\xbe","\xce\x9f"=>"\xce\xbf","\xce\xa0"=>"\xcf\x80","\xce\xa1"=>"\xcf\x81",
+		"\xce\xa3"=>"\xcf\x83","\xce\xa4"=>"\xcf\x84","\xce\xa5"=>"\xcf\x85","\xce\xa6"=>"\xcf\x86",
+		"\xce\xa7"=>"\xcf\x87","\xce\xa8"=>"\xcf\x88","\xce\xa9"=>"\xcf\x89","\xce\xaa"=>"\xcf\x8a",
+		"\xce\xab"=>"\xcf\x8b","\xcf\x9a"=>"\xcf\x9b","\xcf\x9c"=>"\xcf\x9d","\xcf\x9e"=>"\xcf\x9f",
+		"\xcf\xa0"=>"\xcf\xa1","\xcf\xa2"=>"\xcf\xa3","\xcf\xa4"=>"\xcf\xa5","\xcf\xa6"=>"\xcf\xa7",
+		"\xcf\xa8"=>"\xcf\xa9","\xcf\xaa"=>"\xcf\xab","\xcf\xac"=>"\xcf\xad","\xcf\xae"=>"\xcf\xaf",
+		"\xcf\xb4"=>"\xce\xb8","\xd0\x80"=>"\xd1\x90","\xd0\x81"=>"\xd1\x91","\xd0\x82"=>"\xd1\x92",
+		"\xd0\x83"=>"\xd1\x93","\xd0\x84"=>"\xd1\x94","\xd0\x85"=>"\xd1\x95","\xd0\x86"=>"\xd1\x96",
+		"\xd0\x87"=>"\xd1\x97","\xd0\x88"=>"\xd1\x98","\xd0\x89"=>"\xd1\x99","\xd0\x8a"=>"\xd1\x9a",
+		"\xd0\x8b"=>"\xd1\x9b","\xd0\x8c"=>"\xd1\x9c","\xd0\x8d"=>"\xd1\x9d","\xd0\x8e"=>"\xd1\x9e",
+		"\xd0\x8f"=>"\xd1\x9f","\xd0\x90"=>"\xd0\xb0","\xd0\x91"=>"\xd0\xb1","\xd0\x92"=>"\xd0\xb2",
+		"\xd0\x93"=>"\xd0\xb3","\xd0\x94"=>"\xd0\xb4","\xd0\x95"=>"\xd0\xb5","\xd0\x96"=>"\xd0\xb6",
+		"\xd0\x97"=>"\xd0\xb7","\xd0\x98"=>"\xd0\xb8","\xd0\x99"=>"\xd0\xb9","\xd0\x9a"=>"\xd0\xba",
+		"\xd0\x9b"=>"\xd0\xbb","\xd0\x9c"=>"\xd0\xbc","\xd0\x9d"=>"\xd0\xbd","\xd0\x9e"=>"\xd0\xbe",
+		"\xd0\x9f"=>"\xd0\xbf","\xd0\xa0"=>"\xd1\x80","\xd0\xa1"=>"\xd1\x81","\xd0\xa2"=>"\xd1\x82",
+		"\xd0\xa3"=>"\xd1\x83","\xd0\xa4"=>"\xd1\x84","\xd0\xa5"=>"\xd1\x85","\xd0\xa6"=>"\xd1\x86",
+		"\xd0\xa7"=>"\xd1\x87","\xd0\xa8"=>"\xd1\x88","\xd0\xa9"=>"\xd1\x89","\xd0\xaa"=>"\xd1\x8a",
+		"\xd0\xab"=>"\xd1\x8b","\xd0\xac"=>"\xd1\x8c","\xd0\xad"=>"\xd1\x8d","\xd0\xae"=>"\xd1\x8e",
+		"\xd0\xaf"=>"\xd1\x8f","\xd1\xa0"=>"\xd1\xa1","\xd1\xa2"=>"\xd1\xa3","\xd1\xa4"=>"\xd1\xa5",
+		"\xd1\xa6"=>"\xd1\xa7","\xd1\xa8"=>"\xd1\xa9","\xd1\xaa"=>"\xd1\xab","\xd1\xac"=>"\xd1\xad",
+		"\xd1\xae"=>"\xd1\xaf","\xd1\xb0"=>"\xd1\xb1","\xd1\xb2"=>"\xd1\xb3","\xd1\xb4"=>"\xd1\xb5",
+		"\xd1\xb6"=>"\xd1\xb7","\xd1\xb8"=>"\xd1\xb9","\xd1\xba"=>"\xd1\xbb","\xd1\xbc"=>"\xd1\xbd",
+		"\xd1\xbe"=>"\xd1\xbf","\xd2\x80"=>"\xd2\x81","\xd2\x8c"=>"\xd2\x8d","\xd2\x8e"=>"\xd2\x8f",
+		"\xd2\x90"=>"\xd2\x91","\xd2\x92"=>"\xd2\x93","\xd2\x94"=>"\xd2\x95","\xd2\x96"=>"\xd2\x97",
+		"\xd2\x98"=>"\xd2\x99","\xd2\x9a"=>"\xd2\x9b","\xd2\x9c"=>"\xd2\x9d","\xd2\x9e"=>"\xd2\x9f",
+		"\xd2\xa0"=>"\xd2\xa1","\xd2\xa2"=>"\xd2\xa3","\xd2\xa4"=>"\xd2\xa5","\xd2\xa6"=>"\xd2\xa7",
+		"\xd2\xa8"=>"\xd2\xa9","\xd2\xaa"=>"\xd2\xab","\xd2\xac"=>"\xd2\xad","\xd2\xae"=>"\xd2\xaf",
+		"\xd2\xb0"=>"\xd2\xb1","\xd2\xb2"=>"\xd2\xb3","\xd2\xb4"=>"\xd2\xb5","\xd2\xb6"=>"\xd2\xb7",
+		"\xd2\xb8"=>"\xd2\xb9","\xd2\xba"=>"\xd2\xbb","\xd2\xbc"=>"\xd2\xbd","\xd2\xbe"=>"\xd2\xbf",
+		"\xd3\x81"=>"\xd3\x82","\xd3\x83"=>"\xd3\x84","\xd3\x87"=>"\xd3\x88","\xd3\x8b"=>"\xd3\x8c",
+		"\xd3\x90"=>"\xd3\x91","\xd3\x92"=>"\xd3\x93","\xd3\x94"=>"\xd3\x95","\xd3\x96"=>"\xd3\x97",
+		"\xd3\x98"=>"\xd3\x99","\xd3\x9a"=>"\xd3\x9b","\xd3\x9c"=>"\xd3\x9d","\xd3\x9e"=>"\xd3\x9f",
+		"\xd3\xa0"=>"\xd3\xa1","\xd3\xa2"=>"\xd3\xa3","\xd3\xa4"=>"\xd3\xa5","\xd3\xa6"=>"\xd3\xa7",
+		"\xd3\xa8"=>"\xd3\xa9","\xd3\xaa"=>"\xd3\xab","\xd3\xac"=>"\xd3\xad","\xd3\xae"=>"\xd3\xaf",
+		"\xd3\xb0"=>"\xd3\xb1","\xd3\xb2"=>"\xd3\xb3","\xd3\xb4"=>"\xd3\xb5","\xd3\xb8"=>"\xd3\xb9",
+		"\xd4\xb1"=>"\xd5\xa1","\xd4\xb2"=>"\xd5\xa2","\xd4\xb3"=>"\xd5\xa3","\xd4\xb4"=>"\xd5\xa4",
+		"\xd4\xb5"=>"\xd5\xa5","\xd4\xb6"=>"\xd5\xa6","\xd4\xb7"=>"\xd5\xa7","\xd4\xb8"=>"\xd5\xa8",
+		"\xd4\xb9"=>"\xd5\xa9","\xd4\xba"=>"\xd5\xaa","\xd4\xbb"=>"\xd5\xab","\xd4\xbc"=>"\xd5\xac",
+		"\xd4\xbd"=>"\xd5\xad","\xd4\xbe"=>"\xd5\xae","\xd4\xbf"=>"\xd5\xaf","\xd5\x80"=>"\xd5\xb0",
+		"\xd5\x81"=>"\xd5\xb1","\xd5\x82"=>"\xd5\xb2","\xd5\x83"=>"\xd5\xb3","\xd5\x84"=>"\xd5\xb4",
+		"\xd5\x85"=>"\xd5\xb5","\xd5\x86"=>"\xd5\xb6","\xd5\x87"=>"\xd5\xb7","\xd5\x88"=>"\xd5\xb8",
+		"\xd5\x89"=>"\xd5\xb9","\xd5\x8a"=>"\xd5\xba","\xd5\x8b"=>"\xd5\xbb","\xd5\x8c"=>"\xd5\xbc",
+		"\xd5\x8d"=>"\xd5\xbd","\xd5\x8e"=>"\xd5\xbe","\xd5\x8f"=>"\xd5\xbf","\xd5\x90"=>"\xd6\x80",
+		"\xd5\x91"=>"\xd6\x81","\xd5\x92"=>"\xd6\x82","\xd5\x93"=>"\xd6\x83","\xd5\x94"=>"\xd6\x84",
+		"\xd5\x95"=>"\xd6\x85","\xd5\x96"=>"\xd6\x86","\xe1\xb8\x80"=>"\xe1\xb8\x81","\xe1\xb8\x82"=>"\xe1\xb8\x83",
+		"\xe1\xb8\x84"=>"\xe1\xb8\x85","\xe1\xb8\x86"=>"\xe1\xb8\x87","\xe1\xb8\x88"=>"\xe1\xb8\x89","\xe1\xb8\x8a"=>"\xe1\xb8\x8b",
+		"\xe1\xb8\x8c"=>"\xe1\xb8\x8d","\xe1\xb8\x8e"=>"\xe1\xb8\x8f","\xe1\xb8\x90"=>"\xe1\xb8\x91","\xe1\xb8\x92"=>"\xe1\xb8\x93",
+		"\xe1\xb8\x94"=>"\xe1\xb8\x95","\xe1\xb8\x96"=>"\xe1\xb8\x97","\xe1\xb8\x98"=>"\xe1\xb8\x99","\xe1\xb8\x9a"=>"\xe1\xb8\x9b",
+		"\xe1\xb8\x9c"=>"\xe1\xb8\x9d","\xe1\xb8\x9e"=>"\xe1\xb8\x9f","\xe1\xb8\xa0"=>"\xe1\xb8\xa1","\xe1\xb8\xa2"=>"\xe1\xb8\xa3",
+		"\xe1\xb8\xa4"=>"\xe1\xb8\xa5","\xe1\xb8\xa6"=>"\xe1\xb8\xa7","\xe1\xb8\xa8"=>"\xe1\xb8\xa9","\xe1\xb8\xaa"=>"\xe1\xb8\xab",
+		"\xe1\xb8\xac"=>"\xe1\xb8\xad","\xe1\xb8\xae"=>"\xe1\xb8\xaf","\xe1\xb8\xb0"=>"\xe1\xb8\xb1","\xe1\xb8\xb2"=>"\xe1\xb8\xb3",
+		"\xe1\xb8\xb4"=>"\xe1\xb8\xb5","\xe1\xb8\xb6"=>"\xe1\xb8\xb7","\xe1\xb8\xb8"=>"\xe1\xb8\xb9","\xe1\xb8\xba"=>"\xe1\xb8\xbb",
+		"\xe1\xb8\xbc"=>"\xe1\xb8\xbd","\xe1\xb8\xbe"=>"\xe1\xb8\xbf","\xe1\xb9\x80"=>"\xe1\xb9\x81","\xe1\xb9\x82"=>"\xe1\xb9\x83",
+		"\xe1\xb9\x84"=>"\xe1\xb9\x85","\xe1\xb9\x86"=>"\xe1\xb9\x87","\xe1\xb9\x88"=>"\xe1\xb9\x89","\xe1\xb9\x8a"=>"\xe1\xb9\x8b",
+		"\xe1\xb9\x8c"=>"\xe1\xb9\x8d","\xe1\xb9\x8e"=>"\xe1\xb9\x8f","\xe1\xb9\x90"=>"\xe1\xb9\x91","\xe1\xb9\x92"=>"\xe1\xb9\x93",
+		"\xe1\xb9\x94"=>"\xe1\xb9\x95","\xe1\xb9\x96"=>"\xe1\xb9\x97","\xe1\xb9\x98"=>"\xe1\xb9\x99","\xe1\xb9\x9a"=>"\xe1\xb9\x9b",
+		"\xe1\xb9\x9c"=>"\xe1\xb9\x9d","\xe1\xb9\x9e"=>"\xe1\xb9\x9f","\xe1\xb9\xa0"=>"\xe1\xb9\xa1","\xe1\xb9\xa2"=>"\xe1\xb9\xa3",
+		"\xe1\xb9\xa4"=>"\xe1\xb9\xa5","\xe1\xb9\xa6"=>"\xe1\xb9\xa7","\xe1\xb9\xa8"=>"\xe1\xb9\xa9","\xe1\xb9\xaa"=>"\xe1\xb9\xab",
+		"\xe1\xb9\xac"=>"\xe1\xb9\xad","\xe1\xb9\xae"=>"\xe1\xb9\xaf","\xe1\xb9\xb0"=>"\xe1\xb9\xb1","\xe1\xb9\xb2"=>"\xe1\xb9\xb3",
+		"\xe1\xb9\xb4"=>"\xe1\xb9\xb5","\xe1\xb9\xb6"=>"\xe1\xb9\xb7","\xe1\xb9\xb8"=>"\xe1\xb9\xb9","\xe1\xb9\xba"=>"\xe1\xb9\xbb",
+		"\xe1\xb9\xbc"=>"\xe1\xb9\xbd","\xe1\xb9\xbe"=>"\xe1\xb9\xbf","\xe1\xba\x80"=>"\xe1\xba\x81","\xe1\xba\x82"=>"\xe1\xba\x83",
+		"\xe1\xba\x84"=>"\xe1\xba\x85","\xe1\xba\x86"=>"\xe1\xba\x87","\xe1\xba\x88"=>"\xe1\xba\x89","\xe1\xba\x8a"=>"\xe1\xba\x8b",
+		"\xe1\xba\x8c"=>"\xe1\xba\x8d","\xe1\xba\x8e"=>"\xe1\xba\x8f","\xe1\xba\x90"=>"\xe1\xba\x91","\xe1\xba\x92"=>"\xe1\xba\x93",
+		"\xe1\xba\x94"=>"\xe1\xba\x95","\xe1\xba\xa0"=>"\xe1\xba\xa1","\xe1\xba\xa2"=>"\xe1\xba\xa3","\xe1\xba\xa4"=>"\xe1\xba\xa5",
+		"\xe1\xba\xa6"=>"\xe1\xba\xa7","\xe1\xba\xa8"=>"\xe1\xba\xa9","\xe1\xba\xaa"=>"\xe1\xba\xab","\xe1\xba\xac"=>"\xe1\xba\xad",
+		"\xe1\xba\xae"=>"\xe1\xba\xaf","\xe1\xba\xb0"=>"\xe1\xba\xb1","\xe1\xba\xb2"=>"\xe1\xba\xb3","\xe1\xba\xb4"=>"\xe1\xba\xb5",
+		"\xe1\xba\xb6"=>"\xe1\xba\xb7","\xe1\xba\xb8"=>"\xe1\xba\xb9","\xe1\xba\xba"=>"\xe1\xba\xbb","\xe1\xba\xbc"=>"\xe1\xba\xbd",
+		"\xe1\xba\xbe"=>"\xe1\xba\xbf","\xe1\xbb\x80"=>"\xe1\xbb\x81","\xe1\xbb\x82"=>"\xe1\xbb\x83","\xe1\xbb\x84"=>"\xe1\xbb\x85",
+		"\xe1\xbb\x86"=>"\xe1\xbb\x87","\xe1\xbb\x88"=>"\xe1\xbb\x89","\xe1\xbb\x8a"=>"\xe1\xbb\x8b","\xe1\xbb\x8c"=>"\xe1\xbb\x8d",
+		"\xe1\xbb\x8e"=>"\xe1\xbb\x8f","\xe1\xbb\x90"=>"\xe1\xbb\x91","\xe1\xbb\x92"=>"\xe1\xbb\x93","\xe1\xbb\x94"=>"\xe1\xbb\x95",
+		"\xe1\xbb\x96"=>"\xe1\xbb\x97","\xe1\xbb\x98"=>"\xe1\xbb\x99","\xe1\xbb\x9a"=>"\xe1\xbb\x9b","\xe1\xbb\x9c"=>"\xe1\xbb\x9d",
+		"\xe1\xbb\x9e"=>"\xe1\xbb\x9f","\xe1\xbb\xa0"=>"\xe1\xbb\xa1","\xe1\xbb\xa2"=>"\xe1\xbb\xa3","\xe1\xbb\xa4"=>"\xe1\xbb\xa5",
+		"\xe1\xbb\xa6"=>"\xe1\xbb\xa7","\xe1\xbb\xa8"=>"\xe1\xbb\xa9","\xe1\xbb\xaa"=>"\xe1\xbb\xab","\xe1\xbb\xac"=>"\xe1\xbb\xad",
+		"\xe1\xbb\xae"=>"\xe1\xbb\xaf","\xe1\xbb\xb0"=>"\xe1\xbb\xb1","\xe1\xbb\xb2"=>"\xe1\xbb\xb3","\xe1\xbb\xb4"=>"\xe1\xbb\xb5",
+		"\xe1\xbb\xb6"=>"\xe1\xbb\xb7","\xe1\xbb\xb8"=>"\xe1\xbb\xb9","\xe1\xbc\x88"=>"\xe1\xbc\x80","\xe1\xbc\x89"=>"\xe1\xbc\x81",
+		"\xe1\xbc\x8a"=>"\xe1\xbc\x82","\xe1\xbc\x8b"=>"\xe1\xbc\x83","\xe1\xbc\x8c"=>"\xe1\xbc\x84","\xe1\xbc\x8d"=>"\xe1\xbc\x85",
+		"\xe1\xbc\x8e"=>"\xe1\xbc\x86","\xe1\xbc\x8f"=>"\xe1\xbc\x87","\xe1\xbc\x98"=>"\xe1\xbc\x90","\xe1\xbc\x99"=>"\xe1\xbc\x91",
+		"\xe1\xbc\x9a"=>"\xe1\xbc\x92","\xe1\xbc\x9b"=>"\xe1\xbc\x93","\xe1\xbc\x9c"=>"\xe1\xbc\x94","\xe1\xbc\x9d"=>"\xe1\xbc\x95",
+		"\xe1\xbc\xa8"=>"\xe1\xbc\xa0","\xe1\xbc\xa9"=>"\xe1\xbc\xa1","\xe1\xbc\xaa"=>"\xe1\xbc\xa2","\xe1\xbc\xab"=>"\xe1\xbc\xa3",
+		"\xe1\xbc\xac"=>"\xe1\xbc\xa4","\xe1\xbc\xad"=>"\xe1\xbc\xa5","\xe1\xbc\xae"=>"\xe1\xbc\xa6","\xe1\xbc\xaf"=>"\xe1\xbc\xa7",
+		"\xe1\xbc\xb8"=>"\xe1\xbc\xb0","\xe1\xbc\xb9"=>"\xe1\xbc\xb1","\xe1\xbc\xba"=>"\xe1\xbc\xb2","\xe1\xbc\xbb"=>"\xe1\xbc\xb3",
+		"\xe1\xbc\xbc"=>"\xe1\xbc\xb4","\xe1\xbc\xbd"=>"\xe1\xbc\xb5","\xe1\xbc\xbe"=>"\xe1\xbc\xb6","\xe1\xbc\xbf"=>"\xe1\xbc\xb7",
+		"\xe1\xbd\x88"=>"\xe1\xbd\x80","\xe1\xbd\x89"=>"\xe1\xbd\x81","\xe1\xbd\x8a"=>"\xe1\xbd\x82","\xe1\xbd\x8b"=>"\xe1\xbd\x83",
+		"\xe1\xbd\x8c"=>"\xe1\xbd\x84","\xe1\xbd\x8d"=>"\xe1\xbd\x85","\xe1\xbd\x99"=>"\xe1\xbd\x91","\xe1\xbd\x9b"=>"\xe1\xbd\x93",
+		"\xe1\xbd\x9d"=>"\xe1\xbd\x95","\xe1\xbd\x9f"=>"\xe1\xbd\x97","\xe1\xbd\xa8"=>"\xe1\xbd\xa0","\xe1\xbd\xa9"=>"\xe1\xbd\xa1",
+		"\xe1\xbd\xaa"=>"\xe1\xbd\xa2","\xe1\xbd\xab"=>"\xe1\xbd\xa3","\xe1\xbd\xac"=>"\xe1\xbd\xa4","\xe1\xbd\xad"=>"\xe1\xbd\xa5",
+		"\xe1\xbd\xae"=>"\xe1\xbd\xa6","\xe1\xbd\xaf"=>"\xe1\xbd\xa7","\xe1\xbe\x88"=>"\xe1\xbe\x80","\xe1\xbe\x89"=>"\xe1\xbe\x81",
+		"\xe1\xbe\x8a"=>"\xe1\xbe\x82","\xe1\xbe\x8b"=>"\xe1\xbe\x83","\xe1\xbe\x8c"=>"\xe1\xbe\x84","\xe1\xbe\x8d"=>"\xe1\xbe\x85",
+		"\xe1\xbe\x8e"=>"\xe1\xbe\x86","\xe1\xbe\x8f"=>"\xe1\xbe\x87","\xe1\xbe\x98"=>"\xe1\xbe\x90","\xe1\xbe\x99"=>"\xe1\xbe\x91",
+		"\xe1\xbe\x9a"=>"\xe1\xbe\x92","\xe1\xbe\x9b"=>"\xe1\xbe\x93","\xe1\xbe\x9c"=>"\xe1\xbe\x94","\xe1\xbe\x9d"=>"\xe1\xbe\x95",
+		"\xe1\xbe\x9e"=>"\xe1\xbe\x96","\xe1\xbe\x9f"=>"\xe1\xbe\x97","\xe1\xbe\xa8"=>"\xe1\xbe\xa0","\xe1\xbe\xa9"=>"\xe1\xbe\xa1",
+		"\xe1\xbe\xaa"=>"\xe1\xbe\xa2","\xe1\xbe\xab"=>"\xe1\xbe\xa3","\xe1\xbe\xac"=>"\xe1\xbe\xa4","\xe1\xbe\xad"=>"\xe1\xbe\xa5",
+		"\xe1\xbe\xae"=>"\xe1\xbe\xa6","\xe1\xbe\xaf"=>"\xe1\xbe\xa7","\xe1\xbe\xb8"=>"\xe1\xbe\xb0","\xe1\xbe\xb9"=>"\xe1\xbe\xb1",
+		"\xe1\xbe\xba"=>"\xe1\xbd\xb0","\xe1\xbe\xbb"=>"\xe1\xbd\xb1","\xe1\xbe\xbc"=>"\xe1\xbe\xb3","\xe1\xbf\x88"=>"\xe1\xbd\xb2",
+		"\xe1\xbf\x89"=>"\xe1\xbd\xb3","\xe1\xbf\x8a"=>"\xe1\xbd\xb4","\xe1\xbf\x8b"=>"\xe1\xbd\xb5","\xe1\xbf\x8c"=>"\xe1\xbf\x83",
+		"\xe1\xbf\x98"=>"\xe1\xbf\x90","\xe1\xbf\x99"=>"\xe1\xbf\x91","\xe1\xbf\x9a"=>"\xe1\xbd\xb6","\xe1\xbf\x9b"=>"\xe1\xbd\xb7",
+		"\xe1\xbf\xa8"=>"\xe1\xbf\xa0","\xe1\xbf\xa9"=>"\xe1\xbf\xa1","\xe1\xbf\xaa"=>"\xe1\xbd\xba","\xe1\xbf\xab"=>"\xe1\xbd\xbb",
+		"\xe1\xbf\xac"=>"\xe1\xbf\xa5","\xe1\xbf\xb8"=>"\xe1\xbd\xb8","\xe1\xbf\xb9"=>"\xe1\xbd\xb9","\xe1\xbf\xba"=>"\xe1\xbd\xbc",
+		"\xe1\xbf\xbb"=>"\xe1\xbd\xbd","\xe1\xbf\xbc"=>"\xe1\xbf\xb3","\xe2\x84\xa6"=>"\xcf\x89","\xe2\x84\xaa"=>"\x6b",
+		"\xe2\x84\xab"=>"\xc3\xa5","\xe2\x85\xa0"=>"\xe2\x85\xb0","\xe2\x85\xa1"=>"\xe2\x85\xb1","\xe2\x85\xa2"=>"\xe2\x85\xb2",
+		"\xe2\x85\xa3"=>"\xe2\x85\xb3","\xe2\x85\xa4"=>"\xe2\x85\xb4","\xe2\x85\xa5"=>"\xe2\x85\xb5","\xe2\x85\xa6"=>"\xe2\x85\xb6",
+		"\xe2\x85\xa7"=>"\xe2\x85\xb7","\xe2\x85\xa8"=>"\xe2\x85\xb8","\xe2\x85\xa9"=>"\xe2\x85\xb9","\xe2\x85\xaa"=>"\xe2\x85\xba",
+		"\xe2\x85\xab"=>"\xe2\x85\xbb","\xe2\x85\xac"=>"\xe2\x85\xbc","\xe2\x85\xad"=>"\xe2\x85\xbd","\xe2\x85\xae"=>"\xe2\x85\xbe",
+		"\xe2\x85\xaf"=>"\xe2\x85\xbf","\xe2\x92\xb6"=>"\xe2\x93\x90","\xe2\x92\xb7"=>"\xe2\x93\x91","\xe2\x92\xb8"=>"\xe2\x93\x92",
+		"\xe2\x92\xb9"=>"\xe2\x93\x93","\xe2\x92\xba"=>"\xe2\x93\x94","\xe2\x92\xbb"=>"\xe2\x93\x95","\xe2\x92\xbc"=>"\xe2\x93\x96",
+		"\xe2\x92\xbd"=>"\xe2\x93\x97","\xe2\x92\xbe"=>"\xe2\x93\x98","\xe2\x92\xbf"=>"\xe2\x93\x99","\xe2\x93\x80"=>"\xe2\x93\x9a",
+		"\xe2\x93\x81"=>"\xe2\x93\x9b","\xe2\x93\x82"=>"\xe2\x93\x9c","\xe2\x93\x83"=>"\xe2\x93\x9d","\xe2\x93\x84"=>"\xe2\x93\x9e",
+		"\xe2\x93\x85"=>"\xe2\x93\x9f","\xe2\x93\x86"=>"\xe2\x93\xa0","\xe2\x93\x87"=>"\xe2\x93\xa1","\xe2\x93\x88"=>"\xe2\x93\xa2",
+		"\xe2\x93\x89"=>"\xe2\x93\xa3","\xe2\x93\x8a"=>"\xe2\x93\xa4","\xe2\x93\x8b"=>"\xe2\x93\xa5","\xe2\x93\x8c"=>"\xe2\x93\xa6",
+		"\xe2\x93\x8d"=>"\xe2\x93\xa7","\xe2\x93\x8e"=>"\xe2\x93\xa8","\xe2\x93\x8f"=>"\xe2\x93\xa9","\xef\xbc\xa1"=>"\xef\xbd\x81",
+		"\xef\xbc\xa2"=>"\xef\xbd\x82","\xef\xbc\xa3"=>"\xef\xbd\x83","\xef\xbc\xa4"=>"\xef\xbd\x84","\xef\xbc\xa5"=>"\xef\xbd\x85",
+		"\xef\xbc\xa6"=>"\xef\xbd\x86","\xef\xbc\xa7"=>"\xef\xbd\x87","\xef\xbc\xa8"=>"\xef\xbd\x88","\xef\xbc\xa9"=>"\xef\xbd\x89",
+		"\xef\xbc\xaa"=>"\xef\xbd\x8a","\xef\xbc\xab"=>"\xef\xbd\x8b","\xef\xbc\xac"=>"\xef\xbd\x8c","\xef\xbc\xad"=>"\xef\xbd\x8d",
+		"\xef\xbc\xae"=>"\xef\xbd\x8e","\xef\xbc\xaf"=>"\xef\xbd\x8f","\xef\xbc\xb0"=>"\xef\xbd\x90","\xef\xbc\xb1"=>"\xef\xbd\x91",
+		"\xef\xbc\xb2"=>"\xef\xbd\x92","\xef\xbc\xb3"=>"\xef\xbd\x93","\xef\xbc\xb4"=>"\xef\xbd\x94","\xef\xbc\xb5"=>"\xef\xbd\x95",
+		"\xef\xbc\xb6"=>"\xef\xbd\x96","\xef\xbc\xb7"=>"\xef\xbd\x97","\xef\xbc\xb8"=>"\xef\xbd\x98","\xef\xbc\xb9"=>"\xef\xbd\x99",
+		"\xef\xbc\xba"=>"\xef\xbd\x9a","\xf0\x90\x90\x80"=>"\xf0\x90\x90\xa8","\xf0\x90\x90\x81"=>"\xf0\x90\x90\xa9","\xf0\x90\x90\x82"=>"\xf0\x90\x90\xaa",
+		"\xf0\x90\x90\x83"=>"\xf0\x90\x90\xab","\xf0\x90\x90\x84"=>"\xf0\x90\x90\xac","\xf0\x90\x90\x85"=>"\xf0\x90\x90\xad","\xf0\x90\x90\x86"=>"\xf0\x90\x90\xae",
+		"\xf0\x90\x90\x87"=>"\xf0\x90\x90\xaf","\xf0\x90\x90\x88"=>"\xf0\x90\x90\xb0","\xf0\x90\x90\x89"=>"\xf0\x90\x90\xb1","\xf0\x90\x90\x8a"=>"\xf0\x90\x90\xb2",
+		"\xf0\x90\x90\x8b"=>"\xf0\x90\x90\xb3","\xf0\x90\x90\x8c"=>"\xf0\x90\x90\xb4","\xf0\x90\x90\x8d"=>"\xf0\x90\x90\xb5","\xf0\x90\x90\x8e"=>"\xf0\x90\x90\xb6",
+		"\xf0\x90\x90\x8f"=>"\xf0\x90\x90\xb7","\xf0\x90\x90\x90"=>"\xf0\x90\x90\xb8","\xf0\x90\x90\x91"=>"\xf0\x90\x90\xb9","\xf0\x90\x90\x92"=>"\xf0\x90\x90\xba",
+		"\xf0\x90\x90\x93"=>"\xf0\x90\x90\xbb","\xf0\x90\x90\x94"=>"\xf0\x90\x90\xbc","\xf0\x90\x90\x95"=>"\xf0\x90\x90\xbd","\xf0\x90\x90\x96"=>"\xf0\x90\x90\xbe",
+		"\xf0\x90\x90\x97"=>"\xf0\x90\x90\xbf","\xf0\x90\x90\x98"=>"\xf0\x90\x91\x80","\xf0\x90\x90\x99"=>"\xf0\x90\x91\x81","\xf0\x90\x90\x9a"=>"\xf0\x90\x91\x82",
+		"\xf0\x90\x90\x9b"=>"\xf0\x90\x91\x83","\xf0\x90\x90\x9c"=>"\xf0\x90\x91\x84","\xf0\x90\x90\x9d"=>"\xf0\x90\x91\x85","\xf0\x90\x90\x9e"=>"\xf0\x90\x91\x86",
+		"\xf0\x90\x90\x9f"=>"\xf0\x90\x91\x87","\xf0\x90\x90\xa0"=>"\xf0\x90\x91\x88","\xf0\x90\x90\xa1"=>"\xf0\x90\x91\x89","\xf0\x90\x90\xa2"=>"\xf0\x90\x91\x8a",
+		"\xf0\x90\x90\xa3"=>"\xf0\x90\x91\x8b","\xf0\x90\x90\xa4"=>"\xf0\x90\x91\x8c","\xf0\x90\x90\xa5"=>"\xf0\x90\x91\x8d"
+	);
+}; // end of case lookup tables
+
+/**
+ * UTF-8 array of common special characters
+ *
+ * This array should contain all special characters (not a letter or digit)
+ * defined in the various local charsets - it's not a complete list of non-alphanum
+ * characters in UTF-8. It's not perfect but should match most cases of special
+ * chars.
+ *
+ * The controlchars 0x00 to 0x19 are _not_ included in this array. The space 0x20 is!
+ * These chars are _not_ in the array either:  _ (0x5f), : 0x3a, . 0x2e, - 0x2d, * 0x2a
+ *
+ * @author Andreas Gohr <andi@splitbrain.org>
+ * @see    utf8_stripspecials()
+ */
+$UTF8_SPECIAL_CHARS2="\x1A\x1b\x1c\x1d\x1e\x1f\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2b\x2c\x2f\x3b".
+	"\x3c\x3d\x3e\x3f\x40\x5b\x5c\x5d\x5e\x60\x7b\x7c\x7d\x7e\x7f\xc2\x80\xc2\x81\xc2".
+	"\x82\xc2\x83\xc2\x84\xc2\x85\xc2\x86\xc2\x87\xc2\x88\xc2\x89\xc2\x8a\xc2\x8b\xc2".
+	"\x8c\xc2\x8d\xc2\x8e\xc2\x8f\xc2\x90\xc2\x91\xc2\x92\xc2\x93\xc2\x94\xc2\x95\xef".
+	"\xbf\xbd\xef\xbf\xbd\xc2\x97\xc2\x98\xc2\x99\xc2\x9a\xc2\x9b\xc2\x9c\xc2\x9d\xc2".
+	"\x9e\xc2\x9f\x20\xc2\xa1\xc2\xa2\xc2\xa3\xc2\xa4\xc2\xa5\xc2\xa6\xc2\xa7\xc2\xa8".
+	"\xc2\xa9\xc2\xaa\xc2\xab\xc2\xac\xc2\xad\xc2\xae\xc2\xaf\xc2\xb0\xc2\xb1\xc2\xb2".
+	"\xc2\xb3\xc2\xb4\xc2\xb5\xc2\xb6\xc2\xb7\xc2\xb8\xc2\xb9\xc2\xba\xc2\xbb\xc2\xbc".
+	"\xc2\xbd\xef\xbf\xbd\xef\xbf\xbd\xc2\xbf\xc3\x97\xc3\xb7\xcb\x87\xcb\x98\xcb\x99".
+	"\xcb\x9a\xcb\x9b\xcb\x9c\xcb\x9d\xcc\x80\xcc\x81\xcc\x83\xcc\x89\xcc\xa3\xce\x84".
+	"\xce\x85\xce\x87\xce\xb2\xcf\x86\xcf\x91\xcf\x92\xcf\x95\xcf\x96\xd6\xb0\xd6\xb1".
+	"\xd6\xb2\xd6\xb3\xd6\xb4\xd6\xb5\xd6\xb6\xd6\xb7\xd6\xb8\xd6\xb9\xd6\xbb\xd6\xbc".
+	"\xd6\xbd\xd6\xbe\xd6\xbf\xef\xbf\xbd\xef\xbf\xbd\xd7\x81\xd7\x82\xd7\x83\xd7\xb3".
+	"\xd7\xb4\xd8\x8c\xd8\x9b\xd8\x9f\xd9\x80\xd9\x8b\xd9\x8c\xd9\x8d\xd9\x8e\xd9\x8f".
+	"\xd9\x90\xd9\x91\xd9\x92\xd9\xaa\xe0\xb8\xbf\xe2\x80\x8c\xe2\x80\x8d\xe2\x80\x8e".
+	"\xe2\x80\x8f\xe2\x80\x93\xe2\x80\x94\xe2\x80\x95\xe2\x80\x97\xe2\x80\x98\xe2\x80".
+	"\x99\xe2\x80\x9a\xe2\x80\x9c\xe2\x80\x9d\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xe2".
+	"\x80\xa0\xe2\x80\xa1\xe2\x80\xa2\xe2\x80\xa6\xe2\x80\xb0\xe2\x80\xb2\xe2\x80\xb3".
+	"\xe2\x80\xb9\xe2\x80\xba\xe2\x81\x84\xe2\x82\xa7\xe2\x82\xaa\xe2\x82\xab\xe2\x82".
+	"\xac\xe2\x84\x96\xe2\x84\x98\xe2\x84\xa2\xe2\x84\xa6\xe2\x84\xb5\xe2\x86\x90\xe2".
+	"\x86\x91\xe2\x86\x92\xe2\x86\x93\xe2\x86\x94\xe2\x86\x95\xe2\x86\xb5\xe2\x87\x90".
+	"\xe2\x87\x91\xe2\x87\x92\xe2\x87\x93\xe2\x87\x94\xe2\x88\x80\xe2\x88\x82\xe2\x88".
+	"\x83\xe2\x88\x85\xe2\x88\x86\xe2\x88\x87\xe2\x88\x88\xe2\x88\x89\xe2\x88\x8b\xe2".
+	"\x88\x8f\xe2\x88\x91\xe2\x88\x92\xe2\x88\x95\xe2\x88\x97\xe2\x88\x99\xe2\x88\x9a".
+	"\xe2\x88\x9d\xe2\x88\x9e\xe2\x88\xa0\xe2\x88\xa7\xe2\x88\xa8\xef\xbf\xbd\xef\xbf".
+	"\xbd\xe2\x88\xaa\xe2\x88\xab\xe2\x88\xb4\xe2\x88\xbc\xe2\x89\x85\xe2\x89\x88\xe2".
+	"\x89\xa0\xe2\x89\xa1\xe2\x89\xa4\xe2\x89\xa5\xe2\x8a\x82\xe2\x8a\x83\xe2\x8a\x84".
+	"\xe2\x8a\x86\xe2\x8a\x87\xe2\x8a\x95\xe2\x8a\x97\xe2\x8a\xa5\xe2\x8b\x85\xe2\x8c".
+	"\x90\xe2\x8c\xa0\xe2\x8c\xa1\xe2\x8c\xa9\xe2\x8c\xaa\xe2\x91\xa9\xe2\x94\x80\xef".
+	"\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xe2\x94\x8c\xe2\x94\x90\xe2\x94\x94\xe2\x94\x98".
+	"\xe2\x94\x9c\xe2\x94\xa4\xe2\x94\xac\xe2\x94\xb4\xe2\x94\xbc\xe2\x95\x90\xe2\x95".
+	"\x91\xe2\x95\x92\xe2\x95\x93\xe2\x95\x94\xe2\x95\x95\xe2\x95\x96\xe2\x95\x97\xe2".
+	"\x95\x98\xe2\x95\x99\xe2\x95\x9a\xe2\x95\x9b\xe2\x95\x9c\xe2\x95\x9d\xe2\x95\x9e".
+	"\xe2\x95\x9f\xe2\x95\xa0\xe2\x95\xa1\xe2\x95\xa2\xe2\x95\xa3\xe2\x95\xa4\xe2\x95".
+	"\xa5\xe2\x95\xa6\xe2\x95\xa7\xe2\x95\xa8\xe2\x95\xa9\xe2\x95\xaa\xe2\x95\xab\xe2".
+	"\x95\xac\xe2\x96\x80\xe2\x96\x84\xe2\x96\x88\xe2\x96\x8c\xe2\x96\x90\xe2\x96\x91".
+	"\xe2\x96\x92\xe2\x96\x93\xe2\x96\xa0\xe2\x96\xb2\xe2\x96\xbc\xe2\x97\x86\xe2\x97".
+	"\x8a\xe2\x97\x8f\xef\xbf\xbd\xef\xbf\xbd\xe2\x98\x85\xe2\x98\x8e\xe2\x98\x9b\xe2".
+	"\x98\x9e\xe2\x99\xa0\xe2\x99\xa3\xe2\x99\xa5\xe2\x99\xa6\xe2\x9c\x81\xe2\x9c\x82".
+	"\xe2\x9c\x83\xe2\x9c\x84\xe2\x9c\x86\xe2\x9c\x87\xe2\x9c\x88\xe2\x9c\x89\xe2\x9c".
+	"\x8c\xe2\x9c\x8d\xe2\x9c\x8e\xe2\x9c\x8f\xe2\x9c\x90\xe2\x9c\x91\xe2\x9c\x92\xe2".
+	"\x9c\x93\xe2\x9c\x94\xe2\x9c\x95\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xe2\x9c\x97".
+	"\xe2\x9c\x98\xe2\x9c\x99\xe2\x9c\x9a\xe2\x9c\x9b\xe2\x9c\x9c\xe2\x9c\x9d\xe2\x9c".
+	"\x9e\xe2\x9c\x9f\xe2\x9c\xa0\xe2\x9c\xa1\xe2\x9c\xa2\xe2\x9c\xa3\xe2\x9c\xa4\xe2".
+	"\x9c\xa5\xe2\x9c\xa6\xe2\x9c\xa7\xe2\x9c\xa9\xe2\x9c\xaa\xe2\x9c\xab\xe2\x9c\xac".
+	"\xe2\x9c\xad\xe2\x9c\xae\xe2\x9c\xaf\xe2\x9c\xb0\xe2\x9c\xb1\xe2\x9c\xb2\xe2\x9c".
+	"\xb3\xe2\x9c\xb4\xe2\x9c\xb5\xe2\x9c\xb6\xe2\x9c\xb7\xe2\x9c\xb8\xe2\x9c\xb9\xe2".
+	"\x9c\xba\xe2\x9c\xbb\xe2\x9c\xbc\xe2\x9c\xbd\xe2\x9c\xbe\xe2\x9c\xbf\xe2\x9d\x80".
+	"\xe2\x9d\x81\xe2\x9d\x82\xe2\x9d\x83\xe2\x9d\x84\xe2\x9d\x85\xe2\x9d\x86\xe2\x9d".
+	"\x87\xe2\x9d\x88\xe2\x9d\x89\xe2\x9d\x8a\xe2\x9d\x8b\xef\xbf\xbd\xef\xbf\xbd\xe2".
+	"\x9d\x8f\xe2\x9d\x90\xe2\x9d\x91\xe2\x9d\x92\xe2\x9d\x96\xe2\x9d\x98\xe2\x9d\x99".
+	"\xe2\x9d\x9a\xe2\x9d\x9b\xe2\x9d\x9c\xe2\x9d\x9d\xe2\x9d\x9e\xe2\x9d\xa1\xe2\x9d".
+	"\xa2\xe2\x9d\xa3\xe2\x9d\xa4\xe2\x9d\xa5\xe2\x9d\xa6\xe2\x9d\xa7\xe2\x9d\xbf\xe2".
+	"\x9e\x89\xe2\x9e\x93\xe2\x9e\x94\xe2\x9e\x98\xe2\x9e\x99\xe2\x9e\x9a\xef\xbf\xbd".
+	"\xef\xbf\xbd\xef\xbf\xbd\xe2\x9e\x9c\xe2\x9e\x9d\xe2\x9e\x9e\xe2\x9e\x9f\xe2\x9e".
+	"\xa0\xe2\x9e\xa1\xe2\x9e\xa2\xe2\x9e\xa3\xe2\x9e\xa4\xe2\x9e\xa5\xe2\x9e\xa6\xe2".
+	"\x9e\xa7\xe2\x9e\xa8\xe2\x9e\xa9\xe2\x9e\xaa\xe2\x9e\xab\xe2\x9e\xac\xe2\x9e\xad".
+	"\xe2\x9e\xae\xe2\x9e\xaf\xe2\x9e\xb1\xe2\x9e\xb2\xe2\x9e\xb3\xe2\x9e\xb4\xe2\x9e".
+	"\xb5\xe2\x9e\xb6\xe2\x9e\xb7\xe2\x9e\xb8\xe2\x9e\xb9\xe2\x9e\xba\xe2\x9e\xbb\xe2".
+	"\x9e\xbc\xe2\x9e\xbd\xe2\x9e\xbe\xe3\x80\x80\xe3\x80\x81\xe3\x80\x82\xe3\x80\x83".
+	"\xe3\x80\x88\xe3\x80\x89\xe3\x80\x8a\xe3\x80\x8b\xe3\x80\x8c\xe3\x80\x8d\xe3\x80".
+	"\x8e\xe3\x80\x8f\xe3\x80\x90\xe3\x80\x91\xe3\x80\x92\xe3\x80\x94\xe3\x80\x95\xe3".
+	"\x80\x96\xe3\x80\x97\xe3\x80\x98\xe3\x80\x99\xe3\x80\x9a\xe3\x80\x9b\xe3\x80\xb6".
+	"\xef\x9b\x99\xef\x9b\x9a\xef\x9b\x9b\xef\xa3\x97\xef\xa3\x98\xef\xa3\x99\xef\xa3".
+	"\x9a\xef\xa3\x9b\xef\xa3\x9c\xef\xa3\x9d\xef\xa3\x9e\xef\xa3\x9f\xef\xa3\xa0\xef".
+	"\xa3\xa1\xef\xa3\xa2\xef\xa3\xa3\xef\xa3\xa4\xef\xa3\xa5\xef\xbf\xbd\xef\xbf\xbd".
+	"\xef\xa3\xa7\xef\xa3\xa8\xef\xa3\xa9\xef\xa3\xaa\xef\xa3\xab\xef\xa3\xac\xef\xa3".
+	"\xad\xef\xa3\xae\xef\xa3\xaf\xef\xa3\xb0\xef\xa3\xb1\xef\xa3\xb2\xef\xa3\xb3\xef".
+	"\xa3\xb4\xef\xa3\xb5\xef\xa3\xb6\xef\xa3\xb7\xef\xa3\xb8\xef\xa3\xb9\xef\xa3\xba".
+	"\xef\xa3\xbb\xef\xa3\xbc\xef\xa3\xbd\xef\xa3\xbe\xef\xb9\xbc\xef\xb9\xbd\xef\xbc".
+	"\x81\xef\xbc\x82\xef\xbc\x83\xef\xbc\x84\xef\xbc\x85\xef\xbc\x86\xef\xbc\x87\xef".
+	"\xbc\x88\xef\xbc\x89\xef\xbc\x8a\xef\xbc\x8b\xef\xbc\x8c\xef\xbc\x8d\xef\xbc\x8e".
+	"\xef\xbc\x8f\xef\xbc\x9a\xef\xbc\x9b\xef\xbc\x9c\xef\xbc\x9d\xef\xbc\x9e\xef\xbc".
+	"\x9f\xef\xbc\xa0\xef\xbc\xbb\xef\xbc\xbc\xef\xbc\xbd\xef\xbc\xbe\xef\xbd\x80\xef".
+	"\xbd\x9b\xef\xbd\x9c\xef\xbd\x9d\xef\xbd\x9e\xef\xbd\x9f\xef\xbd\xa0\xef\xbd\xa1".
+	"\xef\xbd\xa2\xef\xbd\xa3\xef\xbd\xa4\xef\xbd\xa5\xef\xbf\xa0\xef\xbf\xa1\xef\xbf".
+	"\xa2\xef\xbf\xa3\xef\xbf\xa4\xef\xbf\xa5\xef\xbf\xa6\xef\xbf\xa8\xef\xbf\xa9\xef".
+	"\xbf\xaa\xef\xbf\xab\xef\xbf\xac\xef\xbf\xad\xef\xbf\xae";
+
+/**
+ * Romanization lookup table
+ *
+ * This lookup tables provides a way to transform strings written in a language
+ * different from the ones based upon latin letters into plain ASCII.
+ *
+ * Please note: this is not a scientific transliteration table. It only works
+ * oneway from nonlatin to ASCII and it works by simple character replacement
+ * only. Specialities of each language are not supported.
+ *
+ * @author Andreas Gohr <andi@splitbrain.org>
+ * @author Vitaly Blokhin <vitinfo@vitn.com>
+ * @link   http://www.uconv.com/translit.htm
+ * @author Bisqwit <bisqwit@iki.fi>
+ * @link   http://kanjidict.stc.cx/hiragana.php?src=2
+ * @link   http://www.translatum.gr/converter/greek-transliteration.htm
+ * @link   http://en.wikipedia.org/wiki/Royal_Thai_General_System_of_Transcription
+ * @link   http://www.btranslations.com/resources/romanization/korean.asp
+ * @author Arthit Suriyawongkul <arthit@gmail.com>
+ * @author thorn <thorn@nettest.thekk.de>
+ */
+global $UTF8_ROMANIZATION;
+$UTF8_ROMANIZATION = array(
+	// Latin
+	"\xc3\x81"=>"A","\xc3\xa1"=>"a","\xc3\x82"=>"A",
+	"\xc3\xa2"=>"a","\xc3\x86"=>"Ae","\xc3\xa6"=>"ae","\xc3\x80"=>"A",
+	"\xc3\xa0"=>"a","\xc3\x85"=>"A","\xc3\xa5"=>"a","\xc3\x83"=>"A",
+	"\xc3\xa3"=>"a","\xc3\x84"=>"Ae","\xc3\xa4"=>"ae","\xc3\x87"=>"C",
+	"\xc3\xa7"=>"c","\xc3\x89"=>"E","\xc3\xa9"=>"e","\xc3\x8a"=>"E",
+	"\xc3\xaa"=>"e","\xc3\x88"=>"E","\xc3\xa8"=>"e","\xc3\x8b"=>"E",
+	"\xc3\xab"=>"e","\xc3\x8d"=>"I","\xc3\xad"=>"i","\xc3\x8e"=>"I",
+	"\xc3\xae"=>"i","\xc3\x8c"=>"I","\xc3\xac"=>"i","\xc3\x8f"=>"I",
+	"\xc3\xaf"=>"i","\xc3\x91"=>"N","\xc3\xb1"=>"n","\xc3\x93"=>"O",
+	"\xc3\xb3"=>"o","\xc3\x94"=>"O","\xc3\xb4"=>"o","\xc5\x92"=>"Oe",
+	"\xc5\x93"=>"oe","\xc3\x92"=>"O","\xc3\xb2"=>"o","\xc3\x95"=>"O",
+	"\xc3\xb5"=>"o","\xc3\x96"=>"Oe","\xc3\xb6"=>"oe","\xc5\xa0"=>"S",
+	"\xc5\xa1"=>"s","\xc3\x9f"=>"ss","\xc3\x9a"=>"U","\xc3\xba"=>"u",
+	"\xc3\x9b"=>"U","\xc3\xbb"=>"u","\xc3\x99"=>"U","\xc3\xb9"=>"u",
+	"\xc3\x9c"=>"Ue","\xc3\xbc"=>"ue","\xc3\x9d"=>"Y","\xc3\xbd"=>"y",
+	"\xc5\xb8"=>"Y","\xc3\xbf"=>"y","\xc2\xa9"=>"(c)","\xc2\xae"=>"(r)",
+	"\xc3\x90"=>"D","\xc3\x97"=>"x","\xc3\x98"=>"O","\xc3\x9e"=>"Th",
+	"\xc3\xb0"=>"d","\xc3\xb8"=>"o","\xc3\xbe"=>"th","\x27"=>"-",
+	"\x22"=>"-","\xc4\x80"=>"A","\xc4\x81"=>"a","\xc4\x82"=>"A",
+	"\xc4\x83"=>"a","\xc4\x84"=>"A","\xc4\x85"=>"a","\xc4\x86"=>"C",
+	"\xc4\x87"=>"c","\xc4\x88"=>"C","\xc4\x89"=>"c","\xc4\x8d"=>"c",
+	"\xc4\x8c"=>"C","\xc4\x8b"=>"c","\xc4\x8a"=>"C","\xc4\x91"=>"d",
+	"\xc4\x90"=>"D","\xc4\x8f"=>"d","\xc4\x8e"=>"D","\xc4\x93"=>"e",
+	"\xc4\x92"=>"E","\xc4\x94"=>"E","\xc4\x95"=>"e","\xc4\x96"=>"E",
+	"\xc4\x97"=>"e","\xc4\x98"=>"E","\xc4\x99"=>"e","\xc4\x9a"=>"E",
+	"\xc4\x9b"=>"e","\xc4\x9c"=>"G","\xc4\x9d"=>"g","\xc4\x9e"=>"G",
+	"\xc4\x9f"=>"g","\xc4\xa0"=>"G","\xc4\xa1"=>"g","\xc4\xa2"=>"G",
+	"\xc4\xa3"=>"g","\xc4\xa4"=>"H","\xc4\xa5"=>"h","\xc4\xa6"=>"H",
+	"\xc4\xa7"=>"h","\xc4\xa8"=>"I","\xc4\xa9"=>"i","\xc4\xaa"=>"I",
+	"\xc4\xab"=>"i","\xc4\xac"=>"I","\xc4\xad"=>"i","\xc4\xae"=>"I",
+	"\xc4\xaf"=>"i","\xc4\xb0"=>"I","\xc4\xb1"=>"i","\xc4\xb2"=>"IJ",
+	"\xc4\xb3"=>"ij","\xc4\xb4"=>"J","\xc4\xb5"=>"j","\xc4\xb6"=>"K",
+	"\xc4\xb7"=>"k","\xc4\xb8"=>"k","\xc4\xb9"=>"L","\xc4\xba"=>"l",
+	"\xc4\xbb"=>"L","\xc4\xbc"=>"l","\xc4\xbd"=>"L","\xc4\xbe"=>"l",
+	"\xc4\xbf"=>"L","\xc5\x80"=>"l","\xc5\x81"=>"L","\xc5\x82"=>"l",
+	"\xc5\x83"=>"N","\xc5\x84"=>"n","\xc5\x85"=>"N","\xc5\x86"=>"n",
+	"\xc5\x87"=>"N","\xc5\x88"=>"n","\xc5\x89"=>"n","\xc5\x8a"=>"N",
+	"\xc5\x8b"=>"n","\xc5\x8c"=>"O","\xc5\x8d"=>"o","\xc5\x8e"=>"O",
+	"\xc5\x8f"=>"o","\xc5\x90"=>"O","\xc5\x91"=>"o","\xc5\x94"=>"R",
+	"\xc5\x95"=>"r","\xc5\x96"=>"R","\xc5\x97"=>"r","\xc5\x98"=>"R",
+	"\xc5\x99"=>"r","\xc5\x9a"=>"S","\xc5\x9b"=>"s","\xc5\x9c"=>"S",
+	"\xc5\x9d"=>"s","\xc5\x9e"=>"S","\xc5\x9f"=>"s","\xc5\xa2"=>"T",
+	"\xc5\xa3"=>"t","\xc5\xa4"=>"T","\xc5\xa5"=>"t","\xc5\xa6"=>"T",
+	"\xc5\xa7"=>"t","\xc5\xa8"=>"U","\xc5\xa9"=>"u","\xc5\xaa"=>"U",
+	"\xc5\xab"=>"u","\xc5\xac"=>"U","\xc5\xad"=>"u","\xc5\xae"=>"U",
+	"\xc5\xaf"=>"u","\xc5\xb0"=>"U","\xc5\xb1"=>"u","\xc5\xb2"=>"U",
+	"\xc5\xb3"=>"u","\xc5\xb4"=>"W","\xc5\xb5"=>"w","\xc5\xb6"=>"Y",
+	"\xc5\xb7"=>"y","\xc5\xb9"=>"Z","\xc5\xba"=>"z","\xc5\xbb"=>"Z",
+	"\xc5\xbc"=>"z","\xc5\xbd"=>"Z","\xc5\xbe"=>"z","\xc5\xbf"=>"s",
+	"\xef\xac\x80"=>"ff","\xef\xac\x81"=>"fi","\xef\xac\x82"=>"fl","\xef\xac\x83"=>"ffi",
+	"\xef\xac\x84"=>"ffl","\xef\xac\x85"=>"st","\xef\xac\x86"=>"st","\xc6\x80"=>"b",
+	"\xc6\x81"=>"B","\xc6\x82"=>"B","\xc6\x83"=>"b","\xc6\x84"=>"6",
+	"\xc6\x85"=>"6","\xc6\x86"=>"O","\xc6\x87"=>"C","\xc6\x88"=>"c",
+	"\xc6\x89"=>"D","\xc6\x8a"=>"D","\xc6\x8b"=>"D","\xc6\x8c"=>"d",
+	"\xc6\x8d"=>"d","\xc6\x8e"=>"E","\xc6\x8f"=>"e","\xc6\x90"=>"E",
+	"\xc6\x91"=>"F","\xc6\x92"=>"f","\xc6\x93"=>"G","\xc6\x94"=>"G",
+	"\xc6\x95"=>"hw","\xc6\x96"=>"I","\xc6\x97"=>"I","\xc6\x98"=>"K",
+	"\xc6\x99"=>"k","\xc6\x9a"=>"l","\xc6\x9b"=>"l","\xc6\x9c"=>"M",
+	"\xc6\x9d"=>"N","\xc6\x9e"=>"n","\xc6\x9f"=>"O","\xc6\xa0"=>"O",
+	"\xc6\xa1"=>"o","\xc6\xa2"=>"OI","\xc6\xa3"=>"oi","\xc6\xa4"=>"P",
+	"\xc6\xa5"=>"p","\xc6\xa6"=>"YR","\xc6\xa7"=>"2","\xc6\xa8"=>"2",
+	"\xc6\xa9"=>"ESH","\xc6\xaa"=>"esh","\xc6\xab"=>"t","\xc6\xac"=>"T",
+	"\xc6\xad"=>"t","\xc6\xae"=>"T","\xc6\xaf"=>"U","\xc6\xb0"=>"u",
+	"\xc6\xb1"=>"V","\xc6\xb2"=>"v","\xc6\xb3"=>"Y","\xc6\xb4"=>"y",
+	"\xc6\xb5"=>"Z","\xc6\xb6"=>"z","\xc6\xb7"=>"EZH","\xc6\xb8"=>"EZH",
+	"\xc6\xb9"=>"ezh","\xc6\xba"=>"ezh","\xc6\xbb"=>"2","\xc6\xbc"=>"5",
+	"\xc6\xbd"=>"5","\xc6\xbe"=>"-","\xc6\xbf"=>"w","\xc7\x80"=>"-",
+	"\xc7\x81"=>"-","\xc7\x82"=>"-","\xc7\x83"=>"-","\xc7\x84"=>"DZ",
+	"\xc7\x85"=>"DZ","\xc7\x86"=>"dz","\xc7\x87"=>"LJ","\xc7\x88"=>"Lj",
+	"\xc7\x89"=>"lj","\xc7\x8a"=>"NJ","\xc7\x8b"=>"Nj","\xc7\x8c"=>"nj",
+	"\xc7\x8d"=>"A","\xc7\x8e"=>"a","\xc7\x8f"=>"I","\xc7\x90"=>"i",
+	"\xc7\x91"=>"O","\xc7\x92"=>"o","\xc7\x93"=>"U","\xc7\x94"=>"u",
+	"\xc7\x95"=>"U","\xc7\x96"=>"u","\xc7\x97"=>"U","\xc7\x98"=>"u",
+	"\xc7\x99"=>"U","\xc7\x9a"=>"u","\xc7\x9b"=>"U","\xc7\x9c"=>"u",
+	"\xc7\x9d"=>"e","\xc7\x9e"=>"A","\xc7\x9f"=>"a","\xc7\xa0"=>"A",
+	"\xc7\xa1"=>"a","\xc7\xa2"=>"AE","\xc7\xa3"=>"ae","\xc7\xa4"=>"G",
+	"\xc7\xa5"=>"g","\xc7\xa6"=>"G","\xc7\xa7"=>"g","\xc7\xa8"=>"K",
+	"\xc7\xa9"=>"k","\xc7\xaa"=>"O","\xc7\xab"=>"o","\xc7\xac"=>"O",
+	"\xc7\xad"=>"o","\xc7\xae"=>"EZH","\xc7\xaf"=>"ezh","\xc7\xb0"=>"j",
+	"\xc7\xb1"=>"DZ","\xc7\xb2"=>"Dz","\xc7\xb3"=>"dz","\xc7\xb4"=>"G",
+	"\xc7\xb5"=>"g","\xc7\xb6"=>"HW","\xc7\xb7"=>"W","\xc7\xb8"=>"N",
+	"\xc7\xb9"=>"n","\xc7\xba"=>"A","\xc7\xbb"=>"a","\xc7\xbc"=>"AE",
+	"\xc7\xbd"=>"ae","\xc7\xbe"=>"O","\xc7\xbf"=>"o","\xc8\x80"=>"A",
+	"\xc8\x81"=>"a","\xc8\x82"=>"A","\xc8\x83"=>"a","\xc8\x84"=>"E",
+	"\xc8\x85"=>"e","\xc8\x86"=>"E","\xc8\x87"=>"e","\xc8\x88"=>"I",
+	"\xc8\x89"=>"i","\xc8\x8a"=>"I","\xc8\x8b"=>"i","\xc8\x8c"=>"O",
+	"\xc8\x8d"=>"o","\xc8\x8e"=>"O","\xc8\x8f"=>"o","\xc8\x90"=>"R",
+	"\xc8\x91"=>"r","\xc8\x92"=>"R","\xc8\x93"=>"r","\xc8\x94"=>"U",
+	"\xc8\x95"=>"u","\xc8\x96"=>"U","\xc8\x97"=>"u","\xc8\x98"=>"S",
+	"\xc8\x99"=>"s","\xc8\x9a"=>"T","\xc8\x9b"=>"t","\xc8\x9c"=>"Y",
+	"\xc8\x9d"=>"y","\xc8\x9e"=>"H","\xc8\x9f"=>"h","\xc8\xa0"=>"n",
+	"\xc8\xa1"=>"d","\xc8\xa2"=>"OU","\xc8\xa3"=>"ou","\xc8\xa4"=>"Z",
+	"\xc8\xa5"=>"z","\xc8\xa6"=>"A","\xc8\xa7"=>"a","\xc8\xa8"=>"E",
+	"\xc8\xa9"=>"e","\xc8\xaa"=>"O","\xc8\xab"=>"o","\xc8\xac"=>"O",
+	"\xc8\xad"=>"o","\xc8\xae"=>"O","\xc8\xaf"=>"o","\xc8\xb0"=>"O",
+	"\xc8\xb1"=>"o","\xc8\xb2"=>"Y","\xc8\xb3"=>"y","\xc8\xb4"=>"l",
+	"\xc8\xb5"=>"n","\xc8\xb6"=>"t","\xc8\xb7"=>"j","\xc8\xb8"=>"db",
+	"\xc8\xb9"=>"qp","\xc8\xba"=>"A","\xc8\xbb"=>"C","\xc8\xbc"=>"c",
+	"\xc8\xbd"=>"L","\xc8\xbe"=>"T","\xc8\xbf"=>"s","\xc9\x80"=>"z",
+	"\xc9\x81"=>"-","\xe1\xb8\x80"=>"A","\xe1\xb8\x81"=>"a","\xe1\xb8\x82"=>"B",
+	"\xe1\xb8\x83"=>"b","\xe1\xb8\x84"=>"B","\xe1\xb8\x85"=>"b","\xe1\xb8\x86"=>"B",
+	"\xe1\xb8\x87"=>"b","\xe1\xb8\x88"=>"C","\xe1\xb8\x89"=>"c","\xe1\xb8\x8a"=>"D",
+	"\xe1\xb8\x8b"=>"d","\xe1\xb8\x8c"=>"D","\xe1\xb8\x8d"=>"d","\xe1\xb8\x8e"=>"D",
+	"\xe1\xb8\x8f"=>"d","\xe1\xb8\x90"=>"D","\xe1\xb8\x91"=>"d","\xe1\xb8\x92"=>"D",
+	"\xe1\xb8\x93"=>"d","\xe1\xb8\x94"=>"E","\xe1\xb8\x95"=>"e","\xe1\xb8\x96"=>"E",
+	"\xe1\xb8\x97"=>"e","\xe1\xb8\x98"=>"E","\xe1\xb8\x99"=>"e","\xe1\xb8\x9a"=>"E",
+	"\xe1\xb8\x9b"=>"e","\xe1\xb8\x9c"=>"E","\xe1\xb8\x9d"=>"e","\xe1\xb8\x9e"=>"F",
+	"\xe1\xb8\x9f"=>"f","\xe1\xb8\xa0"=>"G","\xe1\xb8\xa1"=>"g","\xe1\xb8\xa2"=>"H",
+	"\xe1\xb8\xa3"=>"h","\xe1\xb8\xa4"=>"H","\xe1\xb8\xa5"=>"h","\xe1\xb8\xa6"=>"H",
+	"\xe1\xb8\xa7"=>"h","\xe1\xb8\xa8"=>"H","\xe1\xb8\xa9"=>"h","\xe1\xb8\xaa"=>"H",
+	"\xe1\xb8\xab"=>"h","\xe1\xb8\xac"=>"I","\xe1\xb8\xad"=>"i","\xe1\xb8\xae"=>"I",
+	"\xe1\xb8\xaf"=>"i","\xe1\xb8\xb0"=>"K","\xe1\xb8\xb1"=>"k","\xe1\xb8\xb2"=>"K",
+	"\xe1\xb8\xb3"=>"k","\xe1\xb8\xb4"=>"K","\xe1\xb8\xb5"=>"k","\xe1\xb8\xb6"=>"L",
+	"\xe1\xb8\xb7"=>"l","\xe1\xb8\xb8"=>"L","\xe1\xb8\xb9"=>"l","\xe1\xb8\xba"=>"L",
+	"\xe1\xb8\xbb"=>"l","\xe1\xb8\xbc"=>"L","\xe1\xb8\xbd"=>"l","\xe1\xb8\xbe"=>"M",
+	"\xe1\xb8\xbf"=>"m","\xe1\xb9\x80"=>"M","\xe1\xb9\x81"=>"m","\xe1\xb9\x82"=>"M",
+	"\xe1\xb9\x83"=>"m","\xe1\xb9\x84"=>"N","\xe1\xb9\x85"=>"n","\xe1\xb9\x86"=>"N",
+	"\xe1\xb9\x87"=>"n","\xe1\xb9\x88"=>"N","\xe1\xb9\x89"=>"n","\xe1\xb9\x8a"=>"N",
+	"\xe1\xb9\x8b"=>"n","\xe1\xb9\x8c"=>"O","\xe1\xb9\x8d"=>"o","\xe1\xb9\x8e"=>"O",
+	"\xe1\xb9\x8f"=>"o","\xe1\xb9\x90"=>"O","\xe1\xb9\x91"=>"o","\xe1\xb9\x92"=>"O",
+	"\xe1\xb9\x93"=>"o","\xe1\xb9\x94"=>"P","\xe1\xb9\x95"=>"p","\xe1\xb9\x96"=>"P",
+	"\xe1\xb9\x97"=>"p","\xe1\xb9\x98"=>"R","\xe1\xb9\x99"=>"r","\xe1\xb9\x9a"=>"R",
+	"\xe1\xb9\x9b"=>"r","\xe1\xb9\x9c"=>"R","\xe1\xb9\x9d"=>"r","\xe1\xb9\x9e"=>"R",
+	"\xe1\xb9\x9f"=>"r","\xe1\xb9\xa0"=>"S","\xe1\xb9\xa1"=>"s","\xe1\xb9\xa2"=>"S",
+	"\xe1\xb9\xa3"=>"s","\xe1\xb9\xa4"=>"S","\xe1\xb9\xa5"=>"s","\xe1\xb9\xa6"=>"S",
+	"\xe1\xb9\xa7"=>"s","\xe1\xb9\xa8"=>"S","\xe1\xb9\xa9"=>"s","\xe1\xb9\xaa"=>"T",
+	"\xe1\xb9\xab"=>"t","\xe1\xb9\xac"=>"T","\xe1\xb9\xad"=>"t","\xe1\xb9\xae"=>"T",
+	"\xe1\xb9\xaf"=>"t","\xe1\xb9\xb0"=>"T","\xe1\xb9\xb1"=>"t","\xe1\xb9\xb2"=>"U",
+	"\xe1\xb9\xb3"=>"u","\xe1\xb9\xb4"=>"U","\xe1\xb9\xb5"=>"u","\xe1\xb9\xb6"=>"U",
+	"\xe1\xb9\xb7"=>"u","\xe1\xb9\xb8"=>"U","\xe1\xb9\xb9"=>"u","\xe1\xb9\xba"=>"U",
+	"\xe1\xb9\xbb"=>"u","\xe1\xb9\xbc"=>"V","\xe1\xb9\xbd"=>"v","\xe1\xb9\xbe"=>"V",
+	"\xe1\xb9\xbf"=>"v","\xe1\xba\x80"=>"W","\xe1\xba\x81"=>"w","\xe1\xba\x82"=>"W",
+	"\xe1\xba\x83"=>"w","\xe1\xba\x84"=>"W","\xe1\xba\x85"=>"w","\xe1\xba\x86"=>"W",
+	"\xe1\xba\x87"=>"w","\xe1\xba\x88"=>"W","\xe1\xba\x89"=>"w","\xe1\xba\x8a"=>"X",
+	"\xe1\xba\x8b"=>"x","\xe1\xba\x8c"=>"X","\xe1\xba\x8d"=>"x","\xe1\xba\x8e"=>"Y",
+	"\xe1\xba\x8f"=>"y","\xe1\xba\x90"=>"Z","\xe1\xba\x91"=>"z","\xe1\xba\x92"=>"Z",
+	"\xe1\xba\x93"=>"z","\xe1\xba\x94"=>"Z","\xe1\xba\x95"=>"z","\xe1\xba\x96"=>"h",
+	"\xe1\xba\x97"=>"t","\xe1\xba\x98"=>"w","\xe1\xba\x99"=>"y","\xe1\xba\x9a"=>"a",
+	"\xe1\xba\x9b"=>"s","\xe1\xba\xa0"=>"A","\xe1\xba\xa1"=>"a","\xe1\xba\xa2"=>"A",
+	"\xe1\xba\xa3"=>"a","\xe1\xba\xa4"=>"A","\xe1\xba\xa5"=>"a","\xe1\xba\xa6"=>"A",
+	"\xe1\xba\xa7"=>"a","\xe1\xba\xa8"=>"A","\xe1\xba\xa9"=>"a","\xe1\xba\xaa"=>"A",
+	"\xe1\xba\xab"=>"a","\xe1\xba\xac"=>"A","\xe1\xba\xad"=>"a","\xe1\xba\xae"=>"A",
+	"\xe1\xba\xaf"=>"a","\xe1\xba\xb0"=>"A","\xe1\xba\xb1"=>"a","\xe1\xba\xb2"=>"A",
+	"\xe1\xba\xb3"=>"a","\xe1\xba\xb4"=>"A","\xe1\xba\xb5"=>"a","\xe1\xba\xb6"=>"A",
+	"\xe1\xba\xb7"=>"a","\xe1\xba\xb8"=>"E","\xe1\xba\xb9"=>"e","\xe1\xba\xba"=>"E",
+	"\xe1\xba\xbb"=>"e","\xe1\xba\xbc"=>"E","\xe1\xba\xbd"=>"e","\xe1\xba\xbe"=>"E",
+	"\xe1\xba\xbf"=>"e","\xe1\xbb\x80"=>"E","\xe1\xbb\x81"=>"e","\xe1\xbb\x82"=>"E",
+	"\xe1\xbb\x83"=>"e","\xe1\xbb\x84"=>"E","\xe1\xbb\x85"=>"e","\xe1\xbb\x86"=>"E",
+	"\xe1\xbb\x87"=>"e","\xe1\xbb\x88"=>"I","\xe1\xbb\x89"=>"i","\xe1\xbb\x8a"=>"I",
+	"\xe1\xbb\x8b"=>"i","\xe1\xbb\x8c"=>"O","\xe1\xbb\x8d"=>"o","\xe1\xbb\x8e"=>"O",
+	"\xe1\xbb\x8f"=>"o","\xe1\xbb\x90"=>"O","\xe1\xbb\x91"=>"o","\xe1\xbb\x92"=>"O",
+	"\xe1\xbb\x93"=>"o","\xe1\xbb\x94"=>"O","\xe1\xbb\x95"=>"o","\xe1\xbb\x96"=>"O",
+	"\xe1\xbb\x97"=>"o","\xe1\xbb\x98"=>"O","\xe1\xbb\x99"=>"o","\xe1\xbb\x9a"=>"O",
+	"\xe1\xbb\x9b"=>"o","\xe1\xbb\x9c"=>"O","\xe1\xbb\x9d"=>"o","\xe1\xbb\x9e"=>"O",
+	"\xe1\xbb\x9f"=>"o","\xe1\xbb\xa0"=>"O","\xe1\xbb\xa1"=>"o","\xe1\xbb\xa2"=>"O",
+	"\xe1\xbb\xa3"=>"o","\xe1\xbb\xa4"=>"U","\xe1\xbb\xa5"=>"u","\xe1\xbb\xa6"=>"U",
+	"\xe1\xbb\xa7"=>"u","\xe1\xbb\xa8"=>"U","\xe1\xbb\xa9"=>"u","\xe1\xbb\xaa"=>"U",
+	"\xe1\xbb\xab"=>"u","\xe1\xbb\xac"=>"U","\xe1\xbb\xad"=>"u","\xe1\xbb\xae"=>"U",
+	"\xe1\xbb\xaf"=>"u","\xe1\xbb\xb0"=>"U","\xe1\xbb\xb1"=>"u","\xe1\xbb\xb2"=>"Y",
+	"\xe1\xbb\xb3"=>"y","\xe1\xbb\xb4"=>"Y","\xe1\xbb\xb5"=>"y","\xe1\xbb\xb6"=>"Y",
+	"\xe1\xbb\xb7"=>"y","\xe1\xbb\xb8"=>"Y","\xe1\xbb\xb9"=>"y",
+	// Cyrilic
+	"\xd0\x90"=>"A","\xd0\xb0"=>"a","\xd3\x90"=>"A","\xd3\x91"=>"a",
+	"\xd3\x92"=>"A","\xd3\x93"=>"a","\xd3\x94"=>"A","\xd3\x95"=>"a",
+	"\xd3\x98"=>"A","\xd3\x99"=>"a","\xd3\x9a"=>"A","\xd3\x9b"=>"a",
+	"\xd0\x91"=>"B","\xd0\xb1"=>"b","\xd0\x92"=>"V","\xd0\xb2"=>"v",
+	"\xd0\x93"=>"G","\xd0\xb3"=>"g","\xd2\x90"=>"Gh","\xd2\x91"=>"gh",
+	"\xd2\x94"=>"G","\xd2\x95"=>"g","\xd2\x92"=>"G","\xd2\x93"=>"g",
+	"\xd3\xb6"=>"G","\xd3\xb7"=>"g","\xd0\x94"=>"D","\xd0\xb4"=>"d",
+	"\xd0\x82"=>"D","\xd1\x92"=>"d","\xd0\x83"=>"G","\xd1\x93"=>"g",
+	"\xd0\x80"=>"E","\xd1\x90"=>"e","\xd0\x95"=>"E","\xd0\xb5"=>"e",
+	"\xd0\x81"=>"Jo","\xd1\x91"=>"jo","\xd3\x96"=>"E","\xd3\x97"=>"e",
+	"\xd0\x84"=>"Je","\xd1\x94"=>"je","\xd2\xbc"=>"C","\xd2\xbd"=>"c",
+	"\xd2\xbe"=>"C","\xd2\xbf"=>"c","\xd0\x96"=>"Zh","\xd0\xb6"=>"zh",
+	"\xd3\x81"=>"Z","\xd3\x82"=>"z","\xd3\x9c"=>"Z","\xd3\x9d"=>"z",
+	"\xd2\x96"=>"Z","\xd2\x97"=>"z","\xd0\x97"=>"Z","\xd0\xb7"=>"z",
+	"\xd3\x9e"=>"Z","\xd3\x9f"=>"z","\xd0\x85"=>"Z","\xd1\x95"=>"z",
+	"\xd3\xa0"=>"Z","\xd3\xa1"=>"z","\xd0\x8d"=>"I","\xd1\x9d"=>"i",
+	"\xd0\x98"=>"I","\xd0\xb8"=>"i","\xd3\xa2"=>"I","\xd3\xa3"=>"i",
+	"\xd3\xa4"=>"I","\xd3\xa5"=>"i","\xd0\x86"=>"I","\xd1\x96"=>"i",
+	"\xd0\x87"=>"Ji","\xd1\x97"=>"ji","\xd0\x99"=>"J","\xd0\xb9"=>"j",
+	"\xd0\x88"=>"J","\xd1\x98"=>"j","\xd0\x9a"=>"K","\xd0\xba"=>"k",
+	"\xd2\x9a"=>"K","\xd2\x9b"=>"k","\xd2\x9c"=>"K","\xd2\x9d"=>"k",
+	"\xd2\x9e"=>"K","\xd2\x9f"=>"k","\xd2\xa0"=>"K","\xd2\xa1"=>"k",
+	"\xd0\x9b"=>"L","\xd0\xbb"=>"l","\xd0\x89"=>"L","\xd1\x99"=>"l",
+	"\xd0\x9c"=>"M","\xd0\xbc"=>"m","\xd0\x9d"=>"N","\xd0\xbd"=>"n",
+	"\xd0\x8a"=>"N","\xd1\x9a"=>"n","\xd2\xa4"=>"N","\xd2\xa5"=>"n",
+	"\xd2\xa2"=>"N","\xd2\xa3"=>"n","\xd0\x9e"=>"O","\xd0\xbe"=>"o",
+	"\xd3\xa6"=>"O","\xd3\xa7"=>"o","\xd3\xa8"=>"O","\xd3\xa9"=>"o",
+	"\xd3\xaa"=>"O","\xd3\xab"=>"o","\xd0\x9f"=>"P","\xd0\xbf"=>"p",
+	"\xd2\xa6"=>"P","\xd2\xa7"=>"p","\xd0\xa0"=>"R","\xd1\x80"=>"r",
+	"\xd0\xa1"=>"S","\xd1\x81"=>"s","\xd2\xaa"=>"C","\xd2\xab"=>"c",
+	"\xd0\xa2"=>"T","\xd1\x82"=>"t","\xd2\xac"=>"T","\xd2\xad"=>"t",
+	"\xd0\x8b"=>"C","\xd1\x9b"=>"c","\xd0\x8c"=>"K","\xd1\x9c"=>"k",
+	"\xd0\xa3"=>"U","\xd1\x83"=>"u","\xd0\x8e"=>"U","\xd1\x9e"=>"u",
+	"\xd3\xae"=>"U","\xd3\xaf"=>"u","\xd3\xb0"=>"U","\xd3\xb1"=>"u",
+	"\xd3\xb2"=>"U","\xd3\xb3"=>"u","\xd2\xae"=>"U","\xd2\xaf"=>"u",
+	"\xd2\xb0"=>"U","\xd2\xb1"=>"u","\xd0\xa4"=>"F","\xd1\x84"=>"f",
+	"\xd0\xa5"=>"X","\xd1\x85"=>"x","\xd2\xb2"=>"H","\xd2\xb3"=>"h",
+	"\xd2\xba"=>"H","\xd2\xbb"=>"h","\xd0\xa6"=>"C","\xd1\x86"=>"c",
+	"\xd2\xb4"=>"C","\xd2\xb5"=>"c","\xd0\xa7"=>"Ch","\xd1\x87"=>"ch",
+	"\xd3\xb4"=>"C","\xd3\xb5"=>"c","\xd2\xb6"=>"C","\xd2\xb7"=>"c",
+	"\xd2\xb8"=>"C","\xd2\xb9"=>"c","\xd0\x8f"=>"D","\xd1\x9f"=>"d",
+	"\xd0\xa8"=>"Sh","\xd1\x88"=>"sh","\xd0\xa9"=>"Sch","\xd1\x89"=>"sch",
+	"\xd0\xab"=>"Y","\xd1\x8b"=>"y","\xd3\xb8"=>"Y","\xd3\xb9"=>"y",
+	"\xd0\xad"=>"Eh","\xd1\x8d"=>"eh","\xd3\xac"=>"E","\xd3\xad"=>"e",
+	"\xd0\xae"=>"Ju","\xd1\x8e"=>"ju","\xd0\xaf"=>"Ja","\xd1\x8f"=>"ja",
+	"\xd1\xa2"=>"E","\xd1\xa3"=>"e","\xd1\xaa"=>"A","\xd1\xab"=>"a",
+	"\xd1\xb2"=>"F","\xd1\xb3"=>"f","\xd1\xb4"=>"Y","\xd1\xb5"=>"y",
+	"\xd1\xb6"=>"Y","\xd1\xb7"=>"y","\xd2\xa8"=>"O","\xd2\xa9"=>"o",
+	"\xd1\xa0"=>"O","\xd1\xa1"=>"o","\xd1\xa4"=>"E","\xd1\xa5"=>"e",
+	"\xd1\xa6"=>"U","\xd1\xa7"=>"u","\xd1\xa8"=>"U","\xd1\xa9"=>"u",
+	"\xd1\xac"=>"U","\xd1\xad"=>"u","\xd1\xae"=>"K","\xd1\xaf"=>"k",
+	"\xd1\xb0"=>"P","\xd1\xb1"=>"p","\xd1\xb8"=>"U","\xd1\xb9"=>"u",
+	"\xd1\xba"=>"O","\xd1\xbb"=>"o","\xd1\xbc"=>"O","\xd1\xbd"=>"o",
+	"\xd1\xbe"=>"O","\xd1\xbf"=>"o","\xd2\x80"=>"K","\xd2\x81"=>"k",
+	"\xd2\x8a"=>"J","\xd2\x8b"=>"j","\xd2\x8e"=>"r","\xd2\x98"=>"Z",
+	"\xd2\x99"=>"z","\xd3\x83"=>"K","\xd3\x84"=>"k","\xd3\x85"=>"L",
+	"\xd3\x86"=>"l","\xd3\x87"=>"N","\xd3\x88"=>"n","\xd3\x89"=>"N",
+	"\xd3\x8a"=>"n","\xd3\x8b"=>"C","\xd3\x8c"=>"c","\xd3\x8d"=>"M",
+	"\xd3\x8e"=>"m","\xd1\x8a"=>"","\xd0\xaa"=>"","\xd0\xac"=>"",
+	"\xd1\x8c"=>"","\xd2\x8c"=>"-","\xd3\x80"=>"-","\xcc\x81"=>"",
+	// Greek
+	"\xce\xb1\xce\xb9"=>"e","\xce\x91\xce\xb9"=>"E","\xce\xb5\xce\xb9"=>"i",
+	"\xce\x95\xce\xb9"=>"I","\xce\xbf\xce\xb9"=>"i","\xce\x9f\xce\xb9"=>"I","\xce\xbf\xcf\x85"=>"ou",
+	"\xce\x9f\xcf\x85"=>"Ou","\xce\xb1\xcf\x85"=>"av","\xce\x91\xcf\x85"=>"Av","\xce\xb5\xcf\x85"=>"ev",
+	"\xce\x95\xcf\x85"=>"Ev","\xce\xb7\xcf\x85"=>"iv","\xce\x97\xcf\x85"=>"Iv","\xce\xbc\xcf\x80"=>"mp",
+	"\xce\x9c\xcf\x80"=>"B","\xce\xbd\xcf\x84"=>"nt","\xce\x9d\xcf\x84"=>"D","\xcf\x84\xce\xb6"=>"tz",
+	"\xce\xa4\xce\xb6"=>"Tz","\xce\xb3\xce\xba"=>"ng","\xce\x93\xce\xba"=>"G","\xce\xb3\xce\xb3"=>"ng",
+	"\xce\x93\xce\xb3"=>"Ng","\xce\x86"=>"A","\xce\x88"=>"E","\xce\x89"=>"I",
+	"\xce\x8a"=>"I","\xce\x8c"=>"O","\xce\x8e"=>"Y","\xce\x8f"=>"O",
+	"\xce\x90"=>"i","\xce\x91"=>"A","\xce\x92"=>"V","\xce\x93"=>"G",
+	"\xce\x94"=>"D","\xce\x95"=>"E","\xce\x96"=>"Z","\xce\x97"=>"I",
+	"\xce\x98"=>"Th","\xce\x99"=>"I","\xce\x9a"=>"K","\xce\x9b"=>"L",
+	"\xce\x9c"=>"M","\xce\x9d"=>"N","\xce\x9e"=>"X","\xce\x9f"=>"O",
+	"\xce\xa0"=>"P","\xce\xa1"=>"R","\xce\xa3"=>"S","\xce\xa4"=>"T",
+	"\xce\xa5"=>"Y","\xce\xa6"=>"F","\xce\xa7"=>"Ch","\xce\xa8"=>"Ps",
+	"\xce\xa9"=>"O","\xce\xaa"=>"I","\xce\xab"=>"Y","\xce\xac"=>"a",
+	"\xce\xad"=>"e","\xce\xae"=>"i","\xce\xaf"=>"i","\xce\xb0"=>"y",
+	"\xce\xb1"=>"a","\xce\xb2"=>"v","\xce\xb3"=>"g","\xce\xb4"=>"d",
+	"\xce\xb5"=>"e","\xce\xb6"=>"z","\xce\xb7"=>"i","\xce\xb8"=>"th",
+	"\xce\xb9"=>"i","\xce\xba"=>"k","\xce\xbb"=>"l","\xce\xbc"=>"m",
+	"\xce\xbd"=>"n","\xce\xbe"=>"x","\xce\xbf"=>"o","\xcf\x80"=>"p",
+	"\xcf\x81"=>"r","\xcf\x82"=>"s","\xcf\x83"=>"s","\xcf\x84"=>"t",
+	"\xcf\x85"=>"y","\xcf\x86"=>"f","\xcf\x87"=>"ch","\xcf\x88"=>"ps",
+	"\xcf\x89"=>"o","\xcf\x8a"=>"i","\xcf\x8b"=>"y","\xcf\x8c"=>"o",
+	"\xcf\x8d"=>"y","\xcf\x8e"=>"o","\xcf\x90"=>"b","\xcf\x91"=>"th",
+	"\xcf\x92"=>"y","\xcf\x93"=>"y","\xcf\x94"=>"y",
+	// Georgian
+	"\xe1\x83\x90"=>"a","\xe1\x83\x91"=>"b","\xe1\x83\x92"=>"g","\xe1\x83\x93"=>"d",
+	"\xe1\x83\x94"=>"e","\xe1\x83\x95"=>"v","\xe1\x83\x96"=>"z","\xe1\x83\x97"=>"th",
+	"\xe1\x83\x98"=>"i","\xe1\x83\x99"=>"p","\xe1\x83\x9a"=>"l","\xe1\x83\x9b"=>"m",
+	"\xe1\x83\x9c"=>"n","\xe1\x83\x9d"=>"o","\xe1\x83\x9e"=>"p","\xe1\x83\x9f"=>"zh",
+	"\xe1\x83\xa0"=>"r","\xe1\x83\xa1"=>"s","\xe1\x83\xa2"=>"t","\xe1\x83\xa3"=>"u",
+	"\xe1\x83\xa4"=>"ph","\xe1\x83\xa5"=>"kh","\xe1\x83\xa6"=>"gh","\xe1\x83\xa7"=>"q",
+	"\xe1\x83\xa8"=>"sh","\xe1\x83\xa9"=>"ch","\xe1\x83\xaa"=>"c","\xe1\x83\xab"=>"dh",
+	"\xe1\x83\xac"=>"w","\xe1\x83\xad"=>"j","\xe1\x83\xae"=>"x","\xe1\x83\xaf"=>"jh",
+	"\xe1\x83\xb0"=>"xh",
+	// Sanskrit
+	"\xe0\xa4\x85\xe0\xa4\x82"=>"amh","\xe0\xa4\x85\xe0\xa4\x83"=>"aq","\xe0\xa4\x95"=>"k","\xe0\xa4\x96"=>"kh",
+	"\xe0\xa4\x85"=>"a","\xe0\xa4\x86"=>"ah",
+	"\xe0\xa4\x87"=>"i","\xe0\xa4\x88"=>"ih","\xe0\xa4\x89"=>"u","\xe0\xa4\x8a"=>"uh",
+	"\xe0\xa4\x8b"=>"ry","\xe0\xa5\xa0"=>"ryh","\xe0\xa4\x8c"=>"ly","\xe0\xa5\xa1"=>"lyh",
+	"\xe0\xa4\x8f"=>"e","\xe0\xa4\x90"=>"ay","\xe0\xa4\x93"=>"o","\xe0\xa4\x94"=>"aw",
+	"\xe0\xa4\x97"=>"g","\xe0\xa4\x98"=>"gh","\xe0\xa4\x99"=>"nh","\xe0\xa4\x9a"=>"c",
+	"\xe0\xa4\x9b"=>"ch","\xe0\xa4\x9c"=>"j","\xe0\xa4\x9d"=>"jh","\xe0\xa4\x9e"=>"ny",
+	"\xe0\xa4\x9f"=>"tq","\xe0\xa4\xa0"=>"tqh","\xe0\xa4\xa1"=>"dq","\xe0\xa4\xa2"=>"dqh",
+	"\xe0\xa4\xa3"=>"nq","\xe0\xa4\xa4"=>"t","\xe0\xa4\xa5"=>"th","\xe0\xa4\xa6"=>"d",
+	"\xe0\xa4\xa7"=>"dh","\xe0\xa4\xa8"=>"n","\xe0\xa4\xaa"=>"p","\xe0\xa4\xab"=>"ph",
+	"\xe0\xa4\xac"=>"b","\xe0\xa4\xad"=>"bh","\xe0\xa4\xae"=>"m","\xe0\xa4\xaf"=>"z",
+	"\xe0\xa4\xb0"=>"r","\xe0\xa4\xb2"=>"l","\xe0\xa4\xb5"=>"v","\xe0\xa4\xb6"=>"sh",
+	"\xe0\xa4\xb7"=>"sqh","\xe0\xa4\xb8"=>"s","\xe0\xa4\xb9"=>"x",
+	// Hebrew
+	"\xd7\x90"=>"a","\xd7\x91"=>"b","\xd7\x92"=>"g","\xd7\x93"=>"d",
+	"\xd7\x94"=>"h","\xd7\x95"=>"v","\xd7\x96"=>"z","\xd7\x97"=>"kh",
+	"\xd7\x98"=>"th","\xd7\x99"=>"y","\xd7\x9a"=>"h","\xd7\x9b"=>"k",
+	"\xd7\x9c"=>"l","\xd7\x9d"=>"m","\xd7\x9e"=>"m","\xd7\x9f"=>"n",
+	"\xd7\xa0"=>"n","\xd7\xa1"=>"s","\xd7\xa2"=>"ah","\xd7\xa3"=>"f",
+	"\xd7\xa4"=>"p","\xd7\xa5"=>"c","\xd7\xa6"=>"c","\xd7\xa7"=>"q",
+	"\xd7\xa8"=>"r","\xd7\xa9"=>"sh","\xd7\xaa"=>"t",
+	// Arabic
+	"\xd8\xa7"=>"a","\xd8\xa8"=>"b","\xd8\xaa"=>"t","\xd8\xab"=>"th",
+	"\xd8\xac"=>"g","\xd8\xad"=>"xh","\xd8\xae"=>"x","\xd8\xaf"=>"d",
+	"\xd8\xb0"=>"dh","\xd8\xb1"=>"r","\xd8\xb2"=>"z","\xd8\xb3"=>"s",
+	"\xd8\xb4"=>"sh","\xd8\xb5"=>"s_","\xd8\xb6"=>"d_","\xd8\xb7"=>"t_",
+	"\xd8\xb8"=>"z_","\xd8\xb9"=>"y","\xd8\xba"=>"gh","\xd9\x81"=>"f",
+	"\xd9\x82"=>"q","\xd9\x83"=>"k","\xd9\x84"=>"l","\xd9\x85"=>"m",
+	"\xd9\x86"=>"n","\xd9\x87"=>"x_","\xd9\x88"=>"u","\xd9\x8a"=>"i",
+	// Japanese hiragana
+	"\xe3\x81\xb3\xe3\x82\x83"=>"bya","\xe3\x81\xb3\xe3\x81\x87"=>"bye","\xe3\x81\xb3\xe3\x81\x83"=>"byi",
+	"\xe3\x81\xb3\xe3\x82\x87"=>"byo","\xe3\x81\xb3\xe3\x82\x85"=>"byu","\xe3\x81\xa1\xe3\x82\x83"=>"tya","\xe3\x81\xa1\xe3\x81\x87"=>"tye",
+	"\xe3\x81\xa1"=>"ti","\xe3\x81\xa1\xe3\x82\x87"=>"tyo","\xe3\x81\xa1\xe3\x82\x85"=>"tyu","\xe3\x81\xa1\xe3\x81\x83"=>"tyi",
+	"\xe3\x81\xa7\xe3\x82\x83"=>"dha","\xe3\x81\xa7\xe3\x81\x87"=>"dhe","\xe3\x81\xa7\xe3\x81\x83"=>"dhi","\xe3\x81\xa7\xe3\x82\x87"=>"dho",
+	"\xe3\x81\xa7\xe3\x82\x85"=>"dhu","\xe3\x81\xa9\xe3\x81\x81"=>"dwa","\xe3\x81\xa9\xe3\x81\x87"=>"dwe","\xe3\x81\xa9\xe3\x81\x83"=>"dwi",
+	"\xe3\x81\xa9\xe3\x81\x89"=>"dwo","\xe3\x81\xa9\xe3\x81\x85"=>"dwu","\xe3\x81\xa2\xe3\x82\x83"=>"dya","\xe3\x81\xa2\xe3\x81\x87"=>"dye",
+	"\xe3\x81\xa2\xe3\x81\x83"=>"dyi","\xe3\x81\xa2\xe3\x82\x87"=>"dyo","\xe3\x81\xa2\xe3\x82\x85"=>"dyu","\xe3\x81\xa2"=>"di",
+	"\xe3\x81\xb5\xe3\x81\x81"=>"fa","\xe3\x81\xb5\xe3\x81\x87"=>"fe","\xe3\x81\xb5\xe3\x81\x83"=>"fi","\xe3\x81\xb5\xe3\x81\x89"=>"fo",
+	"\xe3\x81\xb5\xe3\x81\x85"=>"fwu","\xe3\x81\xb5\xe3\x82\x83"=>"fya","\xe3\x81\xb5\xe3\x82\x87"=>"fyo","\xe3\x81\xb5\xe3\x82\x85"=>"fyu",
+	"\xe3\x81\x8e\xe3\x82\x83"=>"gya","\xe3\x81\x8e\xe3\x81\x87"=>"gye","\xe3\x81\x8e\xe3\x81\x83"=>"gyi","\xe3\x81\x8e\xe3\x82\x87"=>"gyo",
+	"\xe3\x81\x8e\xe3\x82\x85"=>"gyu","\xe3\x81\xb2\xe3\x82\x83"=>"hya","\xe3\x81\xb2\xe3\x81\x87"=>"hye","\xe3\x81\xb2\xe3\x81\x83"=>"hyi",
+	"\xe3\x81\xb2\xe3\x82\x87"=>"hyo","\xe3\x81\xb2\xe3\x82\x85"=>"hyu","\xe3\x81\x98\xe3\x82\x83"=>"ja","\xe3\x81\x98\xe3\x81\x87"=>"je",
+	"\xe3\x81\x98\xe3\x81\x83"=>"zyi","\xe3\x81\x98\xe3\x82\x87"=>"jo","\xe3\x81\x98\xe3\x82\x85"=>"ju","\xe3\x81\x8d\xe3\x82\x83"=>"kya",
+	"\xe3\x81\x8d\xe3\x81\x87"=>"kye","\xe3\x81\x8d\xe3\x81\x83"=>"kyi","\xe3\x81\x8d\xe3\x82\x87"=>"kyo","\xe3\x81\x8d\xe3\x82\x85"=>"kyu",
+	"\xe3\x82\x8a\xe3\x82\x83"=>"rya","\xe3\x82\x8a\xe3\x81\x87"=>"rye","\xe3\x82\x8a\xe3\x81\x83"=>"ryi","\xe3\x82\x8a\xe3\x82\x87"=>"ryo",
+	"\xe3\x82\x8a\xe3\x82\x85"=>"ryu","\xe3\x81\xbf\xe3\x82\x83"=>"mya","\xe3\x81\xbf\xe3\x81\x87"=>"mye","\xe3\x81\xbf\xe3\x81\x83"=>"myi",
+	"\xe3\x81\xbf\xe3\x82\x87"=>"myo","\xe3\x81\xbf\xe3\x82\x85"=>"myu","\xe3\x82\x93"=>"n","\xe3\x81\xab\xe3\x82\x83"=>"nya",
+	"\xe3\x81\xab\xe3\x81\x87"=>"nye","\xe3\x81\xab\xe3\x81\x83"=>"nyi","\xe3\x81\xab\xe3\x82\x87"=>"nyo","\xe3\x81\xab\xe3\x82\x85"=>"nyu",
+	"\xe3\x81\xb4\xe3\x82\x83"=>"pya","\xe3\x81\xb4\xe3\x81\x87"=>"pye","\xe3\x81\xb4\xe3\x81\x83"=>"pyi","\xe3\x81\xb4\xe3\x82\x87"=>"pyo",
+	"\xe3\x81\xb4\xe3\x82\x85"=>"pyu","\xe3\x81\x97\xe3\x82\x83"=>"sya","\xe3\x81\x97\xe3\x81\x87"=>"sye","\xe3\x81\x97"=>"si",
+	"\xe3\x81\x97\xe3\x82\x87"=>"syo","\xe3\x81\x97\xe3\x82\x85"=>"syu","\xe3\x81\x99\xe3\x81\x81"=>"swa","\xe3\x81\x99\xe3\x81\x87"=>"swe",
+	"\xe3\x81\x99\xe3\x81\x83"=>"swi","\xe3\x81\x99\xe3\x81\x89"=>"swo","\xe3\x81\x99\xe3\x81\x85"=>"swu","\xe3\x81\x97\xe3\x81\x83"=>"syi",
+	"\xe3\x81\xa6\xe3\x82\x83"=>"tha","\xe3\x81\xa6\xe3\x81\x87"=>"the","\xe3\x81\xa6\xe3\x81\x83"=>"thi","\xe3\x81\xa6\xe3\x82\x87"=>"tho",
+	"\xe3\x81\xa6\xe3\x82\x85"=>"thu","\xe3\x81\xa4\xe3\x82\x83"=>"tsa","\xe3\x81\xa4\xe3\x81\x87"=>"tse","\xe3\x81\xa4\xe3\x81\x83"=>"tsi",
+	"\xe3\x81\xa4\xe3\x82\x87"=>"tso","\xe3\x81\xa4"=>"tu","\xe3\x81\xa8\xe3\x81\x81"=>"twa","\xe3\x81\xa8\xe3\x81\x87"=>"twe",
+	"\xe3\x81\xa8\xe3\x81\x83"=>"twi","\xe3\x81\xa8\xe3\x81\x89"=>"two","\xe3\x81\xa8\xe3\x81\x85"=>"twu","\xe3\x83\xb4\xe3\x82\x83"=>"vya",
+	"\xe3\x83\xb4\xe3\x81\x87"=>"ve","\xe3\x83\xb4\xe3\x81\x83"=>"vi","\xe3\x83\xb4\xe3\x82\x87"=>"vyo","\xe3\x83\xb4\xe3\x82\x85"=>"vyu",
+	"\xe3\x81\x86\xe3\x81\x81"=>"wha","\xe3\x81\x86\xe3\x81\x87"=>"we","\xe3\x81\x86\xe3\x81\x83"=>"wi","\xe3\x81\x86\xe3\x81\x89"=>"who",
+	"\xe3\x81\x86\xe3\x81\x85"=>"whu","\xe3\x82\x91"=>"wye","\xe3\x82\x90"=>"wyi","\xe3\x81\x82"=>"a",
+	"\xe3\x81\x88"=>"e","\xe3\x81\x84"=>"yi","\xe3\x81\x8a"=>"o","\xe3\x81\x86"=>"u",
+	"\xe3\x81\xb0"=>"ba","\xe3\x81\xb9"=>"be","\xe3\x81\xb3"=>"bi","\xe3\x81\xbc"=>"bo",
+	"\xe3\x81\xb6"=>"bu","\xe3\x81\xa0"=>"da","\xe3\x81\xa7"=>"de","\xe3\x81\xa9"=>"do",
+	"\xe3\x81\xa5"=>"du","\xe3\x81\xb5"=>"hu","\xe3\x81\x8c"=>"ga","\xe3\x81\x92"=>"ge",
+	"\xe3\x81\x8e"=>"gi","\xe3\x81\x94"=>"go","\xe3\x81\x90"=>"gu","\xe3\x81\xaf"=>"ha",
+	"\xe3\x81\xb8"=>"he","\xe3\x81\xb2"=>"hi","\xe3\x81\xbb"=>"ho","\xe3\x81\x98"=>"zi",
+	"\xe3\x81\x8b"=>"ka","\xe3\x81\x91"=>"ke","\xe3\x81\x8d"=>"ki","\xe3\x81\x93"=>"ko",
+	"\xe3\x81\x8f"=>"ku","\xe3\x82\x89"=>"ra","\xe3\x82\x8c"=>"re","\xe3\x82\x8a"=>"ri",
+	"\xe3\x82\x8d"=>"ro","\xe3\x82\x8b"=>"ru","\xe3\x81\xbe"=>"ma","\xe3\x82\x81"=>"me",
+	"\xe3\x81\xbf"=>"mi","\xe3\x82\x82"=>"mo","\xe3\x82\x80"=>"mu","\xe3\x81\xaa"=>"na",
+	"\xe3\x81\xad"=>"ne","\xe3\x81\xab"=>"ni","\xe3\x81\xae"=>"no","\xe3\x81\xac"=>"nu",
+	"\xe3\x81\xb1"=>"pa","\xe3\x81\xba"=>"pe","\xe3\x81\xb4"=>"pi","\xe3\x81\xbd"=>"po",
+	"\xe3\x81\xb7"=>"pu","\xe3\x81\x95"=>"sa","\xe3\x81\x9b"=>"se","\xe3\x81\x9d"=>"so",
+	"\xe3\x81\x99"=>"su","\xe3\x81\x9f"=>"ta","\xe3\x81\xa6"=>"te","\xe3\x81\xa8"=>"to",
+	"\xe3\x83\xb4\xe3\x81\x81"=>"va","\xe3\x83\xb4\xe3\x81\x89"=>"vo","\xe3\x83\xb4"=>"vu","\xe3\x82\x8f"=>"wa",
+	"\xe3\x82\x92"=>"wo","\xe3\x82\x84"=>"ya","\xe3\x81\x84\xe3\x81\x87"=>"ye","\xe3\x82\x88"=>"yo",
+	"\xe3\x82\x86"=>"yu","\xe3\x81\x96"=>"za","\xe3\x81\x9c"=>"ze","\xe3\x81\x9e"=>"zo",
+	"\xe3\x81\x9a"=>"zu",
+	// Japanese katakana
+	"\xe3\x83\x93\xe3\x83\xa3"=>"bya","\xe3\x83\x93\xe3\x82\xa7"=>"bye",
+	"\xe3\x83\x93\xe3\x82\xa3"=>"byi","\xe3\x83\x93\xe3\x83\xa7"=>"byo","\xe3\x83\x93\xe3\x83\xa5"=>"byu","\xe3\x83\x81\xe3\x83\xa3"=>"tya",
+	"\xe3\x83\x81\xe3\x82\xa7"=>"tye","\xe3\x83\x81"=>"ti","\xe3\x83\x81\xe3\x83\xa7"=>"tyo","\xe3\x83\x81\xe3\x83\xa5"=>"tyu",
+	"\xe3\x83\x81\xe3\x82\xa3"=>"tyi","\xe3\x83\x87\xe3\x83\xa3"=>"dha","\xe3\x83\x87\xe3\x82\xa7"=>"dhe","\xe3\x83\x87\xe3\x82\xa3"=>"dhi",
+	"\xe3\x83\x87\xe3\x83\xa7"=>"dho","\xe3\x83\x87\xe3\x83\xa5"=>"dhu","\xe3\x83\x89\xe3\x82\xa1"=>"dwa","\xe3\x83\x89\xe3\x82\xa7"=>"dwe",
+	"\xe3\x83\x89\xe3\x82\xa3"=>"dwi","\xe3\x83\x89\xe3\x82\xa9"=>"dwo","\xe3\x83\x89\xe3\x82\xa5"=>"dwu","\xe3\x83\x82\xe3\x83\xa3"=>"dya",
+	"\xe3\x83\x82\xe3\x82\xa7"=>"dye","\xe3\x83\x82\xe3\x82\xa3"=>"dyi","\xe3\x83\x82\xe3\x83\xa7"=>"dyo","\xe3\x83\x82\xe3\x83\xa5"=>"dyu",
+	"\xe3\x83\x82"=>"di","\xe3\x83\x95\xe3\x82\xa1"=>"fa","\xe3\x83\x95\xe3\x82\xa7"=>"fe","\xe3\x83\x95\xe3\x82\xa3"=>"fi",
+	"\xe3\x83\x95\xe3\x82\xa9"=>"fo","\xe3\x83\x95\xe3\x82\xa5"=>"fwu","\xe3\x83\x95\xe3\x83\xa3"=>"fya","\xe3\x83\x95\xe3\x83\xa7"=>"fyo",
+	"\xe3\x83\x95\xe3\x83\xa5"=>"fyu","\xe3\x82\xae\xe3\x83\xa3"=>"gya","\xe3\x82\xae\xe3\x82\xa7"=>"gye","\xe3\x82\xae\xe3\x82\xa3"=>"gyi",
+	"\xe3\x82\xae\xe3\x83\xa7"=>"gyo","\xe3\x82\xae\xe3\x83\xa5"=>"gyu","\xe3\x83\x92\xe3\x83\xa3"=>"hya","\xe3\x83\x92\xe3\x82\xa7"=>"hye",
+	"\xe3\x83\x92\xe3\x82\xa3"=>"hyi","\xe3\x83\x92\xe3\x83\xa7"=>"hyo","\xe3\x83\x92\xe3\x83\xa5"=>"hyu","\xe3\x82\xb8\xe3\x83\xa3"=>"ja",
+	"\xe3\x82\xb8\xe3\x82\xa7"=>"je","\xe3\x82\xb8\xe3\x82\xa3"=>"zyi","\xe3\x82\xb8\xe3\x83\xa7"=>"jo","\xe3\x82\xb8\xe3\x83\xa5"=>"ju",
+	"\xe3\x82\xad\xe3\x83\xa3"=>"kya","\xe3\x82\xad\xe3\x82\xa7"=>"kye","\xe3\x82\xad\xe3\x82\xa3"=>"kyi","\xe3\x82\xad\xe3\x83\xa7"=>"kyo",
+	"\xe3\x82\xad\xe3\x83\xa5"=>"kyu","\xe3\x83\xaa\xe3\x83\xa3"=>"rya","\xe3\x83\xaa\xe3\x82\xa7"=>"rye","\xe3\x83\xaa\xe3\x82\xa3"=>"ryi",
+	"\xe3\x83\xaa\xe3\x83\xa7"=>"ryo","\xe3\x83\xaa\xe3\x83\xa5"=>"ryu","\xe3\x83\x9f\xe3\x83\xa3"=>"mya","\xe3\x83\x9f\xe3\x82\xa7"=>"mye",
+	"\xe3\x83\x9f\xe3\x82\xa3"=>"myi","\xe3\x83\x9f\xe3\x83\xa7"=>"myo","\xe3\x83\x9f\xe3\x83\xa5"=>"myu","\xe3\x83\xb3"=>"n",
+	"\xe3\x83\x8b\xe3\x83\xa3"=>"nya","\xe3\x83\x8b\xe3\x82\xa7"=>"nye","\xe3\x83\x8b\xe3\x82\xa3"=>"nyi","\xe3\x83\x8b\xe3\x83\xa7"=>"nyo",
+	"\xe3\x83\x8b\xe3\x83\xa5"=>"nyu","\xe3\x83\x94\xe3\x83\xa3"=>"pya","\xe3\x83\x94\xe3\x82\xa7"=>"pye","\xe3\x83\x94\xe3\x82\xa3"=>"pyi",
+	"\xe3\x83\x94\xe3\x83\xa7"=>"pyo","\xe3\x83\x94\xe3\x83\xa5"=>"pyu","\xe3\x82\xb7\xe3\x83\xa3"=>"sya","\xe3\x82\xb7\xe3\x82\xa7"=>"sye",
+	"\xe3\x82\xb7"=>"si","\xe3\x82\xb7\xe3\x83\xa7"=>"syo","\xe3\x82\xb7\xe3\x83\xa5"=>"syu","\xe3\x82\xb9\xe3\x82\xa1"=>"swa",
+	"\xe3\x82\xb9\xe3\x82\xa7"=>"swe","\xe3\x82\xb9\xe3\x82\xa3"=>"swi","\xe3\x82\xb9\xe3\x82\xa9"=>"swo","\xe3\x82\xb9\xe3\x82\xa5"=>"swu",
+	"\xe3\x82\xb7\xe3\x82\xa3"=>"syi","\xe3\x83\x86\xe3\x83\xa3"=>"tha","\xe3\x83\x86\xe3\x82\xa7"=>"the","\xe3\x83\x86\xe3\x82\xa3"=>"thi",
+	"\xe3\x83\x86\xe3\x83\xa7"=>"tho","\xe3\x83\x86\xe3\x83\xa5"=>"thu","\xe3\x83\x84\xe3\x83\xa3"=>"tsa","\xe3\x83\x84\xe3\x82\xa7"=>"tse",
+	"\xe3\x83\x84\xe3\x82\xa3"=>"tsi","\xe3\x83\x84\xe3\x83\xa7"=>"tso","\xe3\x83\x84"=>"tu","\xe3\x83\x88\xe3\x82\xa1"=>"twa",
+	"\xe3\x83\x88\xe3\x82\xa7"=>"twe","\xe3\x83\x88\xe3\x82\xa3"=>"twi","\xe3\x83\x88\xe3\x82\xa9"=>"two","\xe3\x83\x88\xe3\x82\xa5"=>"twu",
+	"\xe3\x83\xb4\xe3\x83\xa3"=>"vya","\xe3\x83\xb4\xe3\x82\xa7"=>"ve","\xe3\x83\xb4\xe3\x82\xa3"=>"vi","\xe3\x83\xb4\xe3\x83\xa7"=>"vyo",
+	"\xe3\x83\xb4\xe3\x83\xa5"=>"vyu","\xe3\x82\xa6\xe3\x82\xa1"=>"wha","\xe3\x82\xa6\xe3\x82\xa7"=>"we","\xe3\x82\xa6\xe3\x82\xa3"=>"wi",
+	"\xe3\x82\xa6\xe3\x82\xa9"=>"who","\xe3\x82\xa6\xe3\x82\xa5"=>"whu","\xe3\x83\xb1"=>"wye","\xe3\x83\xb0"=>"wyi",
+	"\xe3\x82\xa2"=>"a","\xe3\x82\xa8"=>"e","\xe3\x82\xa4"=>"yi","\xe3\x82\xaa"=>"o",
+	"\xe3\x82\xa6"=>"u","\xe3\x83\x90"=>"ba","\xe3\x83\x99"=>"be","\xe3\x83\x93"=>"bi",
+	"\xe3\x83\x9c"=>"bo","\xe3\x83\x96"=>"bu","\xe3\x83\x80"=>"da","\xe3\x83\x87"=>"de",
+	"\xe3\x83\x89"=>"do","\xe3\x83\x85"=>"du","\xe3\x83\x95"=>"hu","\xe3\x82\xac"=>"ga",
+	"\xe3\x82\xb2"=>"ge","\xe3\x82\xae"=>"gi","\xe3\x82\xb4"=>"go","\xe3\x82\xb0"=>"gu",
+	"\xe3\x83\x8f"=>"ha","\xe3\x83\x98"=>"he","\xe3\x83\x92"=>"hi","\xe3\x83\x9b"=>"ho",
+	"\xe3\x82\xb8"=>"zi","\xe3\x82\xab"=>"ka","\xe3\x82\xb1"=>"ke","\xe3\x82\xad"=>"ki",
+	"\xe3\x82\xb3"=>"ko","\xe3\x82\xaf"=>"ku","\xe3\x83\xa9"=>"ra","\xe3\x83\xac"=>"re",
+	"\xe3\x83\xaa"=>"ri","\xe3\x83\xad"=>"ro","\xe3\x83\xab"=>"ru","\xe3\x83\x9e"=>"ma",
+	"\xe3\x83\xa1"=>"me","\xe3\x83\x9f"=>"mi","\xe3\x83\xa2"=>"mo","\xe3\x83\xa0"=>"mu",
+	"\xe3\x83\x8a"=>"na","\xe3\x83\x8d"=>"ne","\xe3\x83\x8b"=>"ni","\xe3\x83\x8e"=>"no",
+	"\xe3\x83\x8c"=>"nu","\xe3\x83\x91"=>"pa","\xe3\x83\x9a"=>"pe","\xe3\x83\x94"=>"pi",
+	"\xe3\x83\x9d"=>"po","\xe3\x83\x97"=>"pu","\xe3\x82\xb5"=>"sa","\xe3\x82\xbb"=>"se",
+	"\xe3\x82\xbd"=>"so","\xe3\x82\xb9"=>"su","\xe3\x82\xbf"=>"ta","\xe3\x83\x86"=>"te",
+	"\xe3\x83\x88"=>"to","\xe3\x83\xb4\xe3\x82\xa1"=>"va","\xe3\x83\xb4\xe3\x82\xa9"=>"vo","\xe3\x83\xaf"=>"wa",
+	"\xe3\x83\xb2"=>"wo","\xe3\x83\xa4"=>"ya","\xe3\x82\xa4\xe3\x82\xa7"=>"ye","\xe3\x83\xa8"=>"yo",
+	"\xe3\x83\xa6"=>"yu","\xe3\x82\xb6"=>"za","\xe3\x82\xbc"=>"ze","\xe3\x82\xbe"=>"zo",
+	"\xe3\x82\xba"=>"zu","\xe3\x83\xbc"=>"-",
+	// Thai
+	"\xe0\xb8\xb5\xe0\xb8\xa2\xe0\xb8\xb0"=>"ia",
+	"\xe0\xb8\xb5\xe0\xb8\xa2"=>"ia","\xe0\xb8\xb7\xe0\xb8\xad\xe0\xb8\xb0"=>"uea","\xe0\xb8\xb7\xe0\xb8\xad"=>"uea","\xe0\xb8\xb1\xe0\xb8\xa7\xe0\xb8\xb0"=>"ua",
+	"\xe0\xb8\xb1\xe0\xb8\xa7"=>"ua","\xe0\xb8\xa3\xe0\xb8\xa3"=>"a","\xe0\xb8\xa6\xe0\xb9\x85"=>"lue","\xe0\xb9\x83"=>"ai",
+	"\xe0\xb9\x84"=>"ai","\xe0\xb8\xb1\xe0\xb8\xa2"=>"ai","\xe0\xb8\xb2\xe0\xb8\xa2"=>"ai","\xe0\xb8\xb2\xe0\xb8\xa7"=>"ao",
+	"\xe0\xb8\xb8\xe0\xb8\xa2"=>"ui","\xe0\xb8\xad\xe0\xb8\xa2"=>"oi","\xe0\xb8\xb7\xe0\xb8\xad\xe0\xb8\xa2"=>"ueai","\xe0\xb8\xa7\xe0\xb8\xa2"=>"uai",
+	"\xe0\xb8\x81"=>"k","\xe0\xb8\x82"=>"kh","\xe0\xb8\x83"=>"kh","\xe0\xb8\x84"=>"kh",
+	"\xe0\xb8\x85"=>"kh","\xe0\xb8\x86"=>"kh","\xe0\xb8\x87"=>"ng","\xe0\xb8\x88"=>"ch",
+	"\xe0\xb8\x89"=>"ch","\xe0\xb8\x8a"=>"ch","\xe0\xb8\x8b"=>"s","\xe0\xb8\x8c"=>"ch",
+	"\xe0\xb8\x8d"=>"y","\xe0\xb8\x8e"=>"d","\xe0\xb8\x8f"=>"t","\xe0\xb8\x90"=>"th",
+	"\xe0\xb8\x91"=>"d","\xe0\xb8\x92"=>"th","\xe0\xb8\x93"=>"n","\xe0\xb8\x94"=>"d",
+	"\xe0\xb8\x95"=>"t","\xe0\xb8\x96"=>"th","\xe0\xb8\x97"=>"th","\xe0\xb8\x98"=>"th",
+	"\xe0\xb8\x99"=>"n","\xe0\xb8\x9a"=>"b","\xe0\xb8\x9b"=>"p","\xe0\xb8\x9c"=>"ph",
+	"\xe0\xb8\x9d"=>"f","\xe0\xb8\x9e"=>"ph","\xe0\xb8\x9f"=>"f","\xe0\xb8\xa0"=>"ph",
+	"\xe0\xb8\xa1"=>"m","\xe0\xb8\xa2"=>"y","\xe0\xb8\xa3"=>"r","\xe0\xb8\xa4"=>"rue",
+	"\xe0\xb8\xa4\xe0\xb9\x85"=>"rue","\xe0\xb8\xa5"=>"l","\xe0\xb8\xa6"=>"lue","\xe0\xb8\xa7"=>"w",
+	"\xe0\xb8\xa8"=>"s","\xe0\xb8\xa9"=>"s","\xe0\xb8\xaa"=>"s","\xe0\xb8\xab"=>"h",
+	"\xe0\xb8\xac"=>"l","\xe0\xb8\xae"=>"h","\xe0\xb8\xb0"=>"a","\xe0\xb8\xb1"=>"a",
+	"\xe0\xb8\xb2"=>"a","\xe0\xb9\x85"=>"a","\xe0\xb8\xb3"=>"am","\xe0\xb9\x8d\xe0\xb8\xb2"=>"am",
+	"\xe0\xb8\xb4"=>"i","\xe0\xb8\xb5"=>"ue","\xe0\xb8\xb6"=>"ue","\xe0\xb8\xb8"=>"u",
+	"\xe0\xb8\xb9"=>"u","\xe0\xb9\x80"=>"e","\xe0\xb9\x81"=>"ae","\xe0\xb9\x82"=>"o",
+	"\xe0\xb8\xad"=>"o","\xe0\xb8\xb4\xe0\xb8\xa7"=>"io","\xe0\xb9\x87\xe0\xb8\xa7"=>"eo","\xe0\xb8\xb5\xe0\xb8\xa2\xe0\xb8\xa7"=>"iao",
+	"\xe0\xb9\x88"=>"","\xe0\xb9\x89"=>"","\xe0\xb9\x8a"=>"","\xe0\xb9\x8b"=>"",
+	"\xe0\xb9\x87"=>"","\xe0\xb9\x8c"=>"","\xe0\xb9\x8e"=>"","\xe0\xb9\x8d"=>"",
+	"\xe0\xb8\xba"=>"","\xe0\xb9\x86"=>"2","\xe0\xb9\x8f"=>"o","\xe0\xb8\xaf"=>"-",
+	"\xe0\xb9\x9a"=>"-","\xe0\xb9\x9b"=>"-","\xe0\xb9\x90"=>"0","\xe0\xb9\x91"=>"1",
+	"\xe0\xb9\x92"=>"2","\xe0\xb9\x93"=>"3","\xe0\xb9\x94"=>"4","\xe0\xb9\x95"=>"5",
+	"\xe0\xb9\x96"=>"6","\xe0\xb9\x97"=>"7","\xe0\xb9\x98"=>"8","\xe0\xb9\x99"=>"9",
+	// Korean
+	"\xe3\x84\xb1"=>"k","\xe3\x85\x8b"=>"kh","\xe3\x84\xb2"=>"kk",
+	"\xe3\x84\xb7"=>"t","\xe3\x85\x8c"=>"th","\xe3\x84\xb8"=>"tt","\xe3\x85\x82"=>"p",
+	"\xe3\x85\x8d"=>"ph","\xe3\x85\x83"=>"pp","\xe3\x85\x88"=>"c","\xe3\x85\x8a"=>"ch",
+	"\xe3\x85\x89"=>"cc","\xe3\x85\x85"=>"s","\xe3\x85\x86"=>"ss","\xe3\x85\x8e"=>"h",
+	"\xe3\x85\x87"=>"ng","\xe3\x84\xb4"=>"n","\xe3\x84\xb9"=>"l","\xe3\x85\x81"=>"m",
+	"\xe3\x85\x8f"=>"a","\xe3\x85\x93"=>"e","\xe3\x85\x97"=>"o","\xe3\x85\x9c"=>"wu",
+	"\xe3\x85\xa1"=>"u","\xe3\x85\xa3"=>"i","\xe3\x85\x90"=>"ay","\xe3\x85\x94"=>"ey",
+	"\xe3\x85\x9a"=>"oy","\xe3\x85\x98"=>"wa","\xe3\x85\x9d"=>"we","\xe3\x85\x9f"=>"wi",
+	"\xe3\x85\x99"=>"way","\xe3\x85\x9e"=>"wey","\xe3\x85\xa2"=>"uy","\xe3\x85\x91"=>"ya",
+	"\xe3\x85\x95"=>"ye","\xe3\x85\x9b"=>"oy","\xe3\x85\xa0"=>"yu","\xe3\x85\x92"=>"yay",
+	"\xe3\x85\x96"=>"yey"
+);
+
 ?>
\ No newline at end of file
Index: trunk/wb/framework/class.frontend.php
===================================================================
--- trunk/wb/framework/class.frontend.php	(revision 551)
+++ trunk/wb/framework/class.frontend.php	(revision 552)
@@ -52,6 +52,7 @@
 	var $page_trail=array();
 	
 	var $page_access_denied;
+	var $page_no_active_sections;
 	
 	// website settings
 	var $website_title,$website_description,$website_keywords,$website_header,$website_footer;
@@ -197,21 +198,27 @@
 		define('TEMPLATE_DIR', WB_URL.'/templates/'.TEMPLATE);
 
 		// Check if user is allowed to view this page
-		if(VISIBILITY == 'private' OR VISIBILITY == 'registered') {
-			// Check if the user is authenticated
-			if($this->is_authenticated() == false) {
-				// User needs to login first
-				header("Location: ".WB_URL."/account/login.php?redirect=".$this->link);
-				exit(0);
-			}
-			// Check if we should show this page
-			if($this->show_page($this->page) == false) {
+		if($this->page && $this->page_is_visible($this->page) == false) {
+			if(VISIBILITY == 'deleted' OR VISIBILITY == 'none') {
+				// User isnt allowed on this page so tell them
 				$this->page_access_denied=true;
+			} elseif(VISIBILITY == 'private' OR VISIBILITY == 'registered') {
+				// Check if the user is authenticated
+				if($this->is_authenticated() == false) {
+					// User needs to login first
+					header("Location: ".WB_URL."/account/login".PAGE_EXTENSION.'?redirect='.$this->link);
+					exit(0);
+				} else {
+					// User isnt allowed on this page so tell them
+					$this->page_access_denied=true;
+				}
+				
 			}
-		} elseif(VISIBILITY == 'deleted' OR VISIBILITY == 'none') {
-			// User isnt allowed on this page so tell them
-			$this->page_access_denied=true;
 		}
+		// check if there is at least one active section
+		if($this->page && $this->page_is_active($this->page) == false) {
+			$this->page_no_active_sections=true;
+		}
 	}
 
 	function get_website_settings() {
@@ -339,26 +346,12 @@
 			echo "\n".$this->menu_header;
 			// Loop through pages
 			while($page = $query_menu->fetchRow()) {
-				// Check if this page should be shown
-				// $this->extra_where_sql will show menu-title from private pages only if user is authenticated,
-				// but we have to check if user is in viewing_groups or viewing_users for this page
-				if($page['visibility'] == 'private') {
-					$viewing_groups = explode(',', $page['viewing_groups']);
-					$viewing_users = explode(',', $page['viewing_users']);
-					
-					$is_viewing_user = in_array($this->get_user_id(), $viewing_users);
-
-					$access_granted = FALSE;
-					foreach ($this->get_groups_id() as $group_id) {
-
-						if(in_array($group_id, $viewing_groups) || ($is_viewing_user)) {
-							$access_granted = TRUE;
-						}
-					}
-					if (!$access_granted) {
-						continue;
-					}
+				// check whether to show this menu-link
+				if($this->page_is_active($page)==false && $page['link']!=$this->default_link && !INTRO_PAGE) {
+					continue; // no active sections
 				}
+				if($this->page_is_visible($page)==false)
+					continue;
 				// Create vars
 				$vars = array('[class]','[a]', '[/a]', '[menu_title]', '[page_title]');
 				// Work-out class
@@ -405,4 +398,4 @@
 	}
 }
 
-?>
\ No newline at end of file
+?>
Index: trunk/wb/framework/frontend.functions.php
===================================================================
--- trunk/wb/framework/frontend.functions.php	(revision 551)
+++ trunk/wb/framework/frontend.functions.php	(revision 552)
@@ -1,370 +1,396 @@
-<?php
-
-// $Id$
-
-/*
-
- Website Baker Project <http://www.websitebaker.org/>
- Copyright (C) 2004-2008, Ryan Djurovich
-
- Website Baker is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- Website Baker is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with Website Baker; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-
-*/
-
-/*
-	This file is purely for ensuring compatibility with 3rd party
-	contributions made for WB version 2.5.2 or below
-*/
-if(!defined('WB_URL')) {
-	header('Location: ../index.php');
-	exit(0);
-}
-
-// references to objects and variables that changed their names
-
-$admin = &$wb;
-
-$default_link=&$wb->default_link;
-
-$page_trail=&$wb->page_trail;
-$page_description=&$wb->page_description;
-$page_keywords=&$wb->page_keywords;
-$page_link=&$wb->link;
-
-// extra_sql is not used anymore - this is basically a register_globals exploit prevention...
-$extra_sql=&$wb->extra_sql;
-$extra_where_sql=&$wb->extra_where_sql;
-
-$query="SELECT directory FROM ".TABLE_PREFIX."addons WHERE type = 'module' AND function = 'snippet'";
-$query_result=$database->query($query);
-if ($query_result->numRows()>0) {
-	while ($row = $query_result->fetchRow()) {
-		$module_dir = $row['directory'];
-		if (file_exists(WB_PATH.'/modules/'.$module_dir.'/include.php')) {
-			include(WB_PATH.'/modules/'.$module_dir.'/include.php');
-		}
-	}
-}
-
-// Frontend functions
-if (!function_exists('page_link')) {
-	function page_link($link) {
-		global $wb;
-		return $wb->page_link($link);
-	}
-}
-
-//function to highlight search results
-function search_highlight($foo='', $arr_string=array()) {
-	require_once(WB_PATH.'/framework/functions.php');
-	require(WB_PATH.'/search/search_convert.php');
-	$foo = entities_to_umlauts($foo, 'UTF-8');
-	array_walk($arr_string, create_function('&$v,$k','$v = preg_quote($v, \'/\');'));
-	$search_string = implode("|", $arr_string);
-	$string = entities_to_umlauts($search_string, 'UTF-8');
-	$string = strtr($string, $string_ul_umlauts);
-	// do some magic to prevent &lt; &gt; ... from being highlighted
-	$foo = strtr($foo, array("&lt;"=>"!,,!", "&gt;"=>"!,,,!", "&amp;"=>"!,,,,!", "&quot;"=>"!,,,,,!", "&#39;"=>"!,,,,,,!"));
-	$string = strtr($string, array("&lt;"=>"!,,!", "&gt;"=>"!,,,!", "&amp;"=>"!,,,,!", "&quot;"=>"!,,,,,!", "&#39;"=>"!,,,,,,!"));
-	$foo = preg_replace('/('.$string.')(?=[^>]*<)/iUS', '<span class="highlight">$1</span>',$foo);
-	$pos = strpos($foo, '<');
-	if ($pos === false) { // "===" means identicaly
-		$foo = preg_replace('/('.$string.')/i', '<span class="highlight">$1</span>',$foo);
-	}
-	$foo = strtr($foo, array("!,,!"=>"&lt;", "!,,,!"=>"&gt;", "!,,,,!"=>"&amp;", "!,,,,,!"=>"&quot;", "!,,,,,,!"=>"&#39;"));
-	//$foo = umlauts_to_defcharset($foo, 'UTF-8');
-	if(DEFAULT_CHARSET != 'utf-8') {
-		$foo = umlauts_to_entities($foo, 'UTF-8');
-	}
-	return $foo;
-}
-
-// Old menu call invokes new menu function
-if (!function_exists('page_menu')) {
-	function page_menu($parent = 0, $menu_number = 1, $item_template = '<li[class]>[a] [menu_title] [/a]</li>', $menu_header = '<ul>', $menu_footer = '</ul>', $default_class = ' class="menu_default"', $current_class = ' class="menu_current"', $recurse = LEVEL) {
-		global $wb;
-		$wb->menu_number=$menu_number;
-		$wb->menu_item_template=$item_template;
-		$wb->menu_item_footer='';
-		$wb->menu_parent = $parent;
-		$wb->menu_header = $menu_header; 
-		$wb->menu_footer = $menu_footer;
-		$wb->menu_default_class = $default_class;
-		$wb->menu_current_class = $current_class;
-		$wb->menu_recurse = $recurse+2; 	
-		$wb->menu();
-		unset($wb->menu_parent);
-		unset($wb->menu_number);
-		unset($wb->menu_item_template);
-		unset($wb->menu_item_footer);
-		unset($wb->menu_header);
-		unset($wb->menu_footer);
-		unset($wb->menu_default_class);
-		unset($wb->menu_current_class);
-		unset($wb->menu_start_level);
-		unset($wb->menu_collapse);
-		unset($wb->menu_recurse);
-	}
-}
-
-if (!function_exists('show_menu')) {
-	function show_menu($menu_number = NULL, $start_level=NULL, $recurse = NULL, $collapse = NULL, $item_template = NULL, $item_footer = NULL, $menu_header = NULL, $menu_footer = NULL, $default_class = NULL, $current_class = NULL, $parent = NULL) {
-		global $wb;
-		if (isset($menu_number))
-			$wb->menu_number=$menu_number;
-		if (isset($start_level))
-			$wb->menu_start_level=$start_level;
-		if (isset($recurse))
-			$wb->menu_recurse=$recurse;
-		if (isset($collapse))
-			$wb->menu_collapse=$collapse;
-		if (isset($item_template))
-			$wb->menu_item_template=$item_template;
-		if (isset($item_footer))
-			$wb->menu_item_footer=$item_footer;
-		if (isset($menu_header))
-			$wb->menu_header=$menu_header;
-		if (isset($menu_footer))
-			$wb->menu_footer=$menu_footer;
-		if (isset($default_class))
-			$wb->menu_default_class=$default_class;
-		if (isset($current_class))
-			$wb->menu_current_class=$current_class;
-		if (isset($parent))
-			$wb->menu_parent=$parent;
-		$wb->menu();
-		unset($wb->menu_recurse);
-		unset($wb->menu_parent);
-		unset($wb->menu_start_level);
-	}
-}
-
-if (!function_exists('page_content')) {
-	function page_content($block = 1) {
-		// Get outside objects
-		global $TEXT,$MENU,$HEADING,$MESSAGE;
-		global $globals;
-		global $database;
-		global $wb;
-		$admin = & $wb;
-		if ($wb->page_access_denied==true) {
-	        echo $MESSAGE['FRONTEND']['SORRY_NO_VIEWING_PERMISSIONS'];
-			exit();
-		}
-		if(isset($globals) AND is_array($globals)) { foreach($globals AS $global_name) { global $$global_name; } }
-		// Make sure block is numeric
-		if(!is_numeric($block)) { $block = 1; }
-		// Include page content
-		if(!defined('PAGE_CONTENT') OR $block!=1) {
-			$page_id=$wb->page_id;
-			// First get all sections for this page
-			$query_sections = $database->query("SELECT section_id,module FROM ".TABLE_PREFIX."sections WHERE page_id = '".$page_id."' AND block = '$block' ORDER BY position");
-			// If none were found, check if default content is supposed to be shown
-			if($query_sections->numRows() == 0) {
-				if ($wb->default_block_content=='none') {
-					return;
-				}
-				if (is_numeric($wb->default_block_content)) {
-					$page_id=$wb->default_block_content;
-				} else {
-					$page_id=$wb->default_page_id;
-				}				
-				$query_sections = $database->query("SELECT section_id,module FROM ".TABLE_PREFIX."sections WHERE page_id = '".$page_id."' AND block = '$block' ORDER BY position");
-				// Still no cotent found? Give it up, there's just nothing to show!
-				if($query_sections->numRows() == 0) {
-					return;
-				}
-			}
-			// Loop through them and include their module file
-			while($section = $query_sections->fetchRow()) {
-				$section_id = $section['section_id'];
-				$module = $section['module'];
-				// highlights searchresults
-				if (isset($_GET['searchresult']) AND is_numeric($_GET['searchresult']) ) {
-					if (isset($_GET['sstring']) AND !empty($_GET['sstring']) ){
-						$arr_string = explode(" ", $_GET['sstring']);
-						if($_GET['searchresult'] == 2) {
-							// exact match
-							$arr_string[0] = strtr($arr_string[0], "_"," ");
-						}
-						ob_start(); //start output buffer
-						require(WB_PATH.'/modules/'.$module.'/view.php');
-						$foo = ob_get_contents();    // put outputbuffer in $foo
-						ob_end_clean();             // clear outputbuffer
-						echo search_highlight($foo, $arr_string);
-					}
-				} else {
-					require(WB_PATH.'/modules/'.$module.'/view.php');
-				}
-			}
-		} else {
-			require(PAGE_CONTENT);
-		}
-	}
-}
-
-if (!function_exists('show_content')) {
-	function show_content($block=1) {
-		page_content($block);
-	}
-}
-
-if (!function_exists('show_breadcrumbs')) {
-	function show_breadcrumbs($sep=' > ',$tier=1,$links=true,$depth=-1) {
-		global $wb;
-		$page_id=$wb->page_id;
-		if ($page_id!=0)
-		{
-	 		global $database;
-			$bca=$wb->page_trail;
-			$counter=0;
-			foreach ($bca as $temp)
-			{
-		        if ($counter>=($tier-1) AND ($depth<0 OR $tier+$depth>$counter))
-		        {
-					if ($counter>=$tier) echo $sep;
-					$query_menu=$database->query("SELECT menu_title,link FROM ".TABLE_PREFIX."pages WHERE page_id=$temp");
-					$page=$query_menu->fetchRow();
-					if ($links==true AND $temp!=$page_id)
-						echo '<a href="'.page_link($page['link']).'">'.$page['menu_title'].'</a>';
-					else
-					    echo $page['menu_title'];
-		        }
-	            $counter++;
-			}
-		}
-	}
-}
-
-// Function for page title
-if (!function_exists('page_title')) {
-	function page_title($spacer = ' - ', $template = '[WEBSITE_TITLE][SPACER][PAGE_TITLE]') {
-		$vars = array('[WEBSITE_TITLE]', '[PAGE_TITLE]', '[MENU_TITLE]', '[SPACER]');
-		$values = array(WEBSITE_TITLE, PAGE_TITLE, MENU_TITLE, $spacer);
-		echo str_replace($vars, $values, $template);
-	}
-}
-
-// Function for page description
-if (!function_exists('page_description')) {
-	function page_description() {
-		global $wb;
-		if ($wb->page_description!='') {
-			echo $wb->page_description;
-		} else {
-			echo WEBSITE_DESCRIPTION;
-		}
-	}
-}
-
-// Function for page keywords
-if (!function_exists('page_keywords')) {
-	function page_keywords() {
-		global $wb;
-		if ($wb->page_keywords!='') {
-			echo $wb->page_keywords;
-		} else {
-			echo WEBSITE_KEYWORDS;
-		}
-	}
-}
-
-// Function for page header
-if (!function_exists('page_header')) {
-	function page_header($date_format = 'Y') {
-		echo WEBSITE_HEADER;
-	}
-}
-
-// Function for page footer
-if (!function_exists('page_footer')) {
-	function page_footer($date_format = 'Y') {
-		global $starttime;
-		$vars = array('[YEAR]', '[PROCESS_TIME]');
-		$processtime=array_sum(explode(" ",microtime()))-$starttime;
-		$values = array(date($date_format),$processtime);
-		echo str_replace($vars, $values, WEBSITE_FOOTER);
-	}
-}
-
-// Function to add optional module Javascript or CSS stylesheets into the <head> section of the frontend
-if(!function_exists('register_frontend_modfiles')) {
-	function register_frontend_modfiles($file_id="css") {
-		// sanity check of parameter passed to the function
-		$file_id = strtolower($file_id);
-		if($file_id !== "css" && $file_id !== "javascript" && $file_id !== "js") { 
-			return;
-		}
-
-		global $wb, $database;
-		// define default baselink and filename for optional module javascript and stylesheet files
-		$head_links = "";
-		if($file_id == "css") {
-      $base_link = '<link href="'.WB_URL.'/modules/{MODULE_DIRECTORY}/frontend.css"'; 
-			$base_link.= ' rel="stylesheet" type="text/css" media="screen" />';
-			$base_file = "frontend.css";
-		} else {
-			$base_link = '<script type="text/javascript" src="'.WB_URL.'/modules/{MODULE_DIRECTORY}/frontend.js"></script>';
-			$base_file = "frontend.js";
-		}
-
-  	// gather information for all models embedded on actual page
-		$page_id = $wb->page_id;
-    $query_modules = $database->query("SELECT module FROM " .TABLE_PREFIX ."sections 
-			WHERE page_id=$page_id AND module<>'wysiwyg'");
-
-    while($row = $query_modules->fetchRow()) {
-			// check if page module directory contains a frontend.js or frontend.css file
-    	if(file_exists(WB_PATH ."/modules/" .$row['module'] ."/$base_file")) {
-				// create link with frontend.js or frontend.css source for the current module
-				$tmp_link = str_replace("{MODULE_DIRECTORY}", $row['module'], $base_link);
-
-        // define constant indicating that the register_frontent_files was invoked
-				if($file_id == 'css') {
-					define('MOD_FRONTEND_CSS_REGISTERED', true);
-				} else {
-					define('MOD_FRONTEND_JAVASCRIPT_REGISTERED', true);
-				}
-
-        // ensure that frontend.js or frontend.css is only added once per module type
-        if(strpos($head_links, $tmp_link) === false) {
-					$head_links .= $tmp_link ."\n";
-				}
-			}
-    }
-  	// write out links with all external module javascript/CSS files, remove last line feed
-		echo $head_links;
-	}
-}
-
-// Begin WB < 2.4.x template compatibility code
-	// Make extra_sql accessable through private_sql
-	$private_sql = $extra_sql;
-	$private_where_sql = $extra_where_sql;
-	// Query pages for menu
-	$menu1 = $database->query("SELECT page_id,menu_title,page_title,link,target,visibility$extra_sql FROM ".TABLE_PREFIX."pages WHERE parent = '0' AND $extra_where_sql ORDER BY position ASC");
-	// Check if current pages is a parent page and if we need its submenu
-	if(PARENT == 0) {
-		// Get the pages submenu
-		$menu2 = $database->query("SELECT page_id,menu_title,page_title,link,target,visibility$extra_sql FROM ".TABLE_PREFIX."pages WHERE parent = '".PAGE_ID."' AND $extra_where_sql ORDER BY position ASC");
-	} else {
-		// Get the pages submenu
-		$menu2 = $database->query("SELECT page_id,menu_title,page_title,link,target,visibility$extra_sql FROM ".TABLE_PREFIX."pages WHERE parent = '".PARENT."' AND $extra_where_sql ORDER BY position ASC");
-	}
-// End WB < 2.4.x template compatibility code
-// Include template file
-
-
-?>
\ No newline at end of file
+<?php
+
+// $Id$
+
+/*
+
+ Website Baker Project <http://www.websitebaker.org/>
+ Copyright (C) 2004-2008, Ryan Djurovich
+
+ Website Baker is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ Website Baker is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Website Baker; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+*/
+
+/*
+	This file is purely for ensuring compatibility with 3rd party
+	contributions made for WB version 2.5.2 or below
+*/
+if(!defined('WB_URL')) {
+	header('Location: ../index.php');
+	exit(0);
+}
+
+// references to objects and variables that changed their names
+
+$admin = &$wb;
+
+$default_link=&$wb->default_link;
+
+$page_trail=&$wb->page_trail;
+$page_description=&$wb->page_description;
+$page_keywords=&$wb->page_keywords;
+$page_link=&$wb->link;
+
+// extra_sql is not used anymore - this is basically a register_globals exploit prevention...
+$extra_sql=&$wb->extra_sql;
+$extra_where_sql=&$wb->extra_where_sql;
+
+$query="SELECT directory FROM ".TABLE_PREFIX."addons WHERE type = 'module' AND function = 'snippet'";
+$query_result=$database->query($query);
+if ($query_result->numRows()>0) {
+	while ($row = $query_result->fetchRow()) {
+		$module_dir = $row['directory'];
+		if (file_exists(WB_PATH.'/modules/'.$module_dir.'/include.php')) {
+			include(WB_PATH.'/modules/'.$module_dir.'/include.php');
+		}
+	}
+}
+
+// Frontend functions
+if (!function_exists('page_link')) {
+	function page_link($link) {
+		global $wb;
+		return $wb->page_link($link);
+	}
+}
+
+//function to highlight search results
+if (!function_exists('search_highlight')) {
+function search_highlight($foo='', $arr_string=array()) {
+	require_once(WB_PATH.'/framework/functions.php');
+	require_once(WB_PATH.'/search/search_convert.php');
+
+	$foo = entities_to_umlauts($foo, 'UTF-8');
+	array_walk($arr_string, create_function('&$v,$k','$v = preg_quote($v, \'/\');'));
+	$search_string = implode("|", $arr_string);
+	$string = entities_to_umlauts($search_string, 'UTF-8');
+	$string = strtr($string, $string_ul_umlauts);
+	// special-feature: '|' means word-boundary (\b). Searching for 'the|' will find 'the', but not 'thema'.
+	$string = strtr($string, array('\\|'=>'\b'));
+	
+	// the highlighting
+	// match $string, but not inside <style>...</style>, <script>...</script>, <!--...--> or HTML-Tags
+	// split $string into pieces - "cut away" styles, scripts, comments, and HTML-tags
+	$matches = preg_split("/(<style.*<\/style>|<script.*<\/script>|<!--.*-->|<.*>)/iUs",$foo,-1,(PREG_SPLIT_DELIM_CAPTURE|PREG_SPLIT_NO_EMPTY));
+	if(is_array($matches) && $matches != array()) {
+		$foo = "";
+		$string = strtr($string, array('&lt;'=>'<', '&gt;'=>'>', '&amp;'=>'&', '&quot;'=>'"', '&#39;'=>'\'', '&nbsp;'=>"\xC2\xA0"));
+		foreach($matches as $match) {
+			if($match{0}!="<") {
+				$match = strtr($match, array('&lt;'=>'<', '&gt;'=>'>', '&amp;'=>'&', '&quot;'=>'"', '&#39;'=>'\'', '&nbsp;'=>"\xC2\xA0"));
+				$match = preg_replace('/('.$string.')/iS', '_span class=_highlight__$1_/span_',$match);
+				$match = strtr($match, array('<'=>'&lt;', '>'=>'&gt;', '&'=>'&amp;', '"'=>'&quot;', '\''=>'&#39;', "\xC2\xA0"=>'&nbsp;'));
+				$match = str_replace(array('_span class=_highlight__', '_/span_'), array('<span class="highlight">', '</span>'), $match);
+			}
+			$foo .= $match;
+		}
+	}
+	
+	if(DEFAULT_CHARSET != 'utf-8') {
+		$foo = umlauts_to_entities($foo, 'UTF-8');
+	}
+	return $foo;
+}
+}
+
+// Old menu call invokes new menu function
+if (!function_exists('page_menu')) {
+	function page_menu($parent = 0, $menu_number = 1, $item_template = '<li[class]>[a] [menu_title] [/a]</li>', $menu_header = '<ul>', $menu_footer = '</ul>', $default_class = ' class="menu_default"', $current_class = ' class="menu_current"', $recurse = LEVEL) {
+		global $wb;
+		$wb->menu_number=$menu_number;
+		$wb->menu_item_template=$item_template;
+		$wb->menu_item_footer='';
+		$wb->menu_parent = $parent;
+		$wb->menu_header = $menu_header; 
+		$wb->menu_footer = $menu_footer;
+		$wb->menu_default_class = $default_class;
+		$wb->menu_current_class = $current_class;
+		$wb->menu_recurse = $recurse+2; 	
+		$wb->menu();
+		unset($wb->menu_parent);
+		unset($wb->menu_number);
+		unset($wb->menu_item_template);
+		unset($wb->menu_item_footer);
+		unset($wb->menu_header);
+		unset($wb->menu_footer);
+		unset($wb->menu_default_class);
+		unset($wb->menu_current_class);
+		unset($wb->menu_start_level);
+		unset($wb->menu_collapse);
+		unset($wb->menu_recurse);
+	}
+}
+
+if (!function_exists('show_menu')) {
+	function show_menu($menu_number = NULL, $start_level=NULL, $recurse = NULL, $collapse = NULL, $item_template = NULL, $item_footer = NULL, $menu_header = NULL, $menu_footer = NULL, $default_class = NULL, $current_class = NULL, $parent = NULL) {
+		global $wb;
+		if (isset($menu_number))
+			$wb->menu_number=$menu_number;
+		if (isset($start_level))
+			$wb->menu_start_level=$start_level;
+		if (isset($recurse))
+			$wb->menu_recurse=$recurse;
+		if (isset($collapse))
+			$wb->menu_collapse=$collapse;
+		if (isset($item_template))
+			$wb->menu_item_template=$item_template;
+		if (isset($item_footer))
+			$wb->menu_item_footer=$item_footer;
+		if (isset($menu_header))
+			$wb->menu_header=$menu_header;
+		if (isset($menu_footer))
+			$wb->menu_footer=$menu_footer;
+		if (isset($default_class))
+			$wb->menu_default_class=$default_class;
+		if (isset($current_class))
+			$wb->menu_current_class=$current_class;
+		if (isset($parent))
+			$wb->menu_parent=$parent;
+		$wb->menu();
+		unset($wb->menu_recurse);
+		unset($wb->menu_parent);
+		unset($wb->menu_start_level);
+	}
+}
+
+if (!function_exists('page_content')) {
+	function page_content($block = 1) {
+		// Get outside objects
+		global $TEXT,$MENU,$HEADING,$MESSAGE;
+		global $globals;
+		global $database;
+		global $wb;
+		$admin = & $wb;
+		if ($wb->page_access_denied==true) {
+	        echo $MESSAGE['FRONTEND']['SORRY_NO_VIEWING_PERMISSIONS'];
+			exit();
+		}
+		if ($wb->page_no_active_sections==true) {
+	        echo $MESSAGE['FRONTEND']['SORRY_NO_ACTIVE_SECTIONS'];
+			exit();
+		}
+		if(isset($globals) AND is_array($globals)) { foreach($globals AS $global_name) { global $$global_name; } }
+		// Make sure block is numeric
+		if(!is_numeric($block)) { $block = 1; }
+		// Include page content
+		if(!defined('PAGE_CONTENT') OR $block!=1) {
+			$page_id=$wb->page_id;
+			// First get all sections for this page
+			$query_sections = $database->query("SELECT section_id,module,publ_start,publ_end FROM ".TABLE_PREFIX."sections WHERE page_id = '".$page_id."' AND block = '$block' ORDER BY position");
+			// If none were found, check if default content is supposed to be shown
+			if($query_sections->numRows() == 0) {
+				if ($wb->default_block_content=='none') {
+					return;
+				}
+				if (is_numeric($wb->default_block_content)) {
+					$page_id=$wb->default_block_content;
+				} else {
+					$page_id=$wb->default_page_id;
+				}				
+				$query_sections = $database->query("SELECT section_id,module,publ_start,publ_end FROM ".TABLE_PREFIX."sections WHERE page_id = '".$page_id."' AND block = '$block' ORDER BY position");
+				// Still no cotent found? Give it up, there's just nothing to show!
+				if($query_sections->numRows() == 0) {
+					return;
+				}
+			}
+			// Loop through them and include their module file
+			while($section = $query_sections->fetchRow()) {
+				// skip this section if it is out of publication-date
+				$now = time();
+				if( !( $now<$section['publ_end'] && ($now>$section['publ_start'] || $section['publ_start']==0) ||
+					$now>$section['publ_start'] && $section['publ_end']==0) ) {
+					continue;
+				}
+				$section_id = $section['section_id'];
+				$module = $section['module'];
+				// make a anchor for every section. This is for the search_extension
+				echo "<a id=\"wb_section_$section_id\" name=\"wb_section_$section_id\"></a>";
+				// highlights searchresults
+				if (isset($_GET['searchresult']) AND is_numeric($_GET['searchresult']) AND !isset($_GET['nohighlight'])) {
+					if (isset($_GET['sstring']) AND !empty($_GET['sstring']) ){
+						$arr_string = explode(" ", $_GET['sstring']);
+						if($_GET['searchresult'] == 2) {
+							// exact match
+							$arr_string[0] = strtr($arr_string[0], "_"," ");
+						}
+						ob_start(); //start output buffer
+						require(WB_PATH.'/modules/'.$module.'/view.php');
+						$foo = ob_get_contents();    // put outputbuffer in $foo
+						ob_end_clean();             // clear outputbuffer
+						echo search_highlight($foo, $arr_string);
+					}
+				} else {
+					require(WB_PATH.'/modules/'.$module.'/view.php');
+				}
+			}
+		} else {
+			require(PAGE_CONTENT);
+		}
+	}
+}
+
+if (!function_exists('show_content')) {
+	function show_content($block=1) {
+		page_content($block);
+	}
+}
+
+if (!function_exists('show_breadcrumbs')) {
+	function show_breadcrumbs($sep=' > ',$tier=1,$links=true,$depth=-1) {
+		global $wb;
+		$page_id=$wb->page_id;
+		if ($page_id!=0)
+		{
+	 		global $database;
+			$bca=$wb->page_trail;
+			$counter=0;
+			foreach ($bca as $temp)
+			{
+		        if ($counter>=($tier-1) AND ($depth<0 OR $tier+$depth>$counter))
+		        {
+					if ($counter>=$tier) echo $sep;
+					$query_menu=$database->query("SELECT menu_title,link FROM ".TABLE_PREFIX."pages WHERE page_id=$temp");
+					$page=$query_menu->fetchRow();
+					if ($links==true AND $temp!=$page_id)
+						echo '<a href="'.page_link($page['link']).'">'.$page['menu_title'].'</a>';
+					else
+					    echo $page['menu_title'];
+		        }
+	            $counter++;
+			}
+		}
+	}
+}
+
+// Function for page title
+if (!function_exists('page_title')) {
+	function page_title($spacer = ' - ', $template = '[WEBSITE_TITLE][SPACER][PAGE_TITLE]') {
+		$vars = array('[WEBSITE_TITLE]', '[PAGE_TITLE]', '[MENU_TITLE]', '[SPACER]');
+		$values = array(WEBSITE_TITLE, PAGE_TITLE, MENU_TITLE, $spacer);
+		echo str_replace($vars, $values, $template);
+	}
+}
+
+// Function for page description
+if (!function_exists('page_description')) {
+	function page_description() {
+		global $wb;
+		if ($wb->page_description!='') {
+			echo $wb->page_description;
+		} else {
+			echo WEBSITE_DESCRIPTION;
+		}
+	}
+}
+
+// Function for page keywords
+if (!function_exists('page_keywords')) {
+	function page_keywords() {
+		global $wb;
+		if ($wb->page_keywords!='') {
+			echo $wb->page_keywords;
+		} else {
+			echo WEBSITE_KEYWORDS;
+		}
+	}
+}
+
+// Function for page header
+if (!function_exists('page_header')) {
+	function page_header($date_format = 'Y') {
+		echo WEBSITE_HEADER;
+	}
+}
+
+// Function for page footer
+if (!function_exists('page_footer')) {
+	function page_footer($date_format = 'Y') {
+		global $starttime;
+		$vars = array('[YEAR]', '[PROCESS_TIME]');
+		$processtime=array_sum(explode(" ",microtime()))-$starttime;
+		$values = array(date($date_format),$processtime);
+		echo str_replace($vars, $values, WEBSITE_FOOTER);
+	}
+}
+
+// Function to add optional module Javascript or CSS stylesheets into the <head> section of the frontend
+if(!function_exists('register_frontend_modfiles')) {
+	function register_frontend_modfiles($file_id="css") {
+		// sanity check of parameter passed to the function
+		$file_id = strtolower($file_id);
+		if($file_id !== "css" && $file_id !== "javascript" && $file_id !== "js") { 
+			return;
+		}
+
+		global $wb, $database;
+		// define default baselink and filename for optional module javascript and stylesheet files
+		$head_links = "";
+		if($file_id == "css") {
+      $base_link = '<link href="'.WB_URL.'/modules/{MODULE_DIRECTORY}/frontend.css"'; 
+			$base_link.= ' rel="stylesheet" type="text/css" media="screen" />';
+			$base_file = "frontend.css";
+		} else {
+			$base_link = '<script type="text/javascript" src="'.WB_URL.'/modules/{MODULE_DIRECTORY}/frontend.js"></script>';
+			$base_file = "frontend.js";
+		}
+
+  	// gather information for all models embedded on actual page
+		$page_id = $wb->page_id;
+    $query_modules = $database->query("SELECT module FROM " .TABLE_PREFIX ."sections 
+			WHERE page_id=$page_id AND module<>'wysiwyg'");
+
+    while($row = $query_modules->fetchRow()) {
+			// check if page module directory contains a frontend.js or frontend.css file
+    	if(file_exists(WB_PATH ."/modules/" .$row['module'] ."/$base_file")) {
+				// create link with frontend.js or frontend.css source for the current module
+				$tmp_link = str_replace("{MODULE_DIRECTORY}", $row['module'], $base_link);
+
+        // define constant indicating that the register_frontent_files was invoked
+				if($file_id == 'css') {
+					define('MOD_FRONTEND_CSS_REGISTERED', true);
+				} else {
+					define('MOD_FRONTEND_JAVASCRIPT_REGISTERED', true);
+				}
+
+        // ensure that frontend.js or frontend.css is only added once per module type
+        if(strpos($head_links, $tmp_link) === false) {
+					$head_links .= $tmp_link ."\n";
+				}
+			}
+    }
+  	// write out links with all external module javascript/CSS files, remove last line feed
+		echo $head_links;
+	}
+}
+
+// Begin WB < 2.4.x template compatibility code
+	// Make extra_sql accessable through private_sql
+	$private_sql = $extra_sql;
+	$private_where_sql = $extra_where_sql;
+	// Query pages for menu
+	$menu1 = $database->query("SELECT page_id,menu_title,page_title,link,target,visibility$extra_sql FROM ".TABLE_PREFIX."pages WHERE parent = '0' AND $extra_where_sql ORDER BY position ASC");
+	// Check if current pages is a parent page and if we need its submenu
+	if(PARENT == 0) {
+		// Get the pages submenu
+		$menu2 = $database->query("SELECT page_id,menu_title,page_title,link,target,visibility$extra_sql FROM ".TABLE_PREFIX."pages WHERE parent = '".PAGE_ID."' AND $extra_where_sql ORDER BY position ASC");
+	} else {
+		// Get the pages submenu
+		$menu2 = $database->query("SELECT page_id,menu_title,page_title,link,target,visibility$extra_sql FROM ".TABLE_PREFIX."pages WHERE parent = '".PARENT."' AND $extra_where_sql ORDER BY position ASC");
+	}
+// End WB < 2.4.x template compatibility code
+// Include template file
+
+
+?>
Index: trunk/wb/framework/functions.php
===================================================================
--- trunk/wb/framework/functions.php	(revision 551)
+++ trunk/wb/framework/functions.php	(revision 552)
@@ -341,545 +341,50 @@
 }
 
 // Function as replacement for php's htmlspecialchars()
+// Will not mangle HTML-entities
 function my_htmlspecialchars($string) {
-	$string = preg_replace("/&(?=[#a-z0-9]+;)/i", "_x_", $string);
-	$string = strtr($string, array("<"=>"&lt;", ">"=>"&gt;", "&"=>"&amp;", "\""=>"&quot;", "\'"=>"&#39;"));
-	$string = preg_replace("/_x_(?=[#a-z0-9]+;)/i", "&", $string);
+	$string = preg_replace('/&(?=[#a-z0-9]+;)/i', '__amp;_', $string);
+	$string = strtr($string, array('<'=>'&lt;', '>'=>'&gt;', '&'=>'&amp;', '"'=>'&quot;', '\''=>'&#39;'));
+	$string = preg_replace('/__amp;_(?=[#a-z0-9]+;)/i', '&', $string);
 	return($string);
 }
 
-// Function to convert a string from $from- to $to-encoding, using mysql
-function my_mysql_iconv($string, $from, $to) {
-	// keep current character set values
-	global $database;
-	$query = $database->query("SELECT @@character_set_client");
-	if($query->numRows() > 0) {
-		$res = $query->fetchRow();
-		$character_set_database = $res['@@character_set_client'];
-	}	else { echo mysql_error()."\n<br />"; }
-	$query = $database->query("SELECT @@character_set_results");
-	if($query->numRows() > 0) {
-		$res = $query->fetchRow();
-		$character_set_results = $res['@@character_set_results'];
-	}	else { echo mysql_error()."\n<br />"; }
-	$query = $database->query("SELECT @@collation_connection");
-	if($query->numRows() > 0) {
-		$res = $query->fetchRow();
-		$collation_results = $res['@@collation_connection'];
-	}	else { echo mysql_error()."\n<br />"; }
-	// set new character set values
-	$query = $database->query("SET character_set_client=$from");
-	$query = $database->query("SET character_set_results=$to");
-	$query = $database->query("SET collation_connection=utf8_unicode_ci");
-	$string_escaped = mysql_real_escape_string($string);
-	// convert the string
-	$query = $database->query("SELECT '$string_escaped'");
-	if($query->numRows() > 0) {
-		$res = $query->fetchRow();
-		$converted_string = $res[0];
-	}	else { echo mysql_error()."\n<br />"; }
-	// restore previous character set values
-	$query = $database->query("SET character_set_client=$character_set_database");
-	$query = $database->query("SET character_set_results=$character_set_results");
-	$query = $database->query("SET collation_connection=$collation_results");
-	return $converted_string;
-}
-
-// Function as wrapper for mb_convert_encoding
-// converts $charset_in to $charset_out or 
-// UTF-8 to HTML-ENTITIES or HTML-ENTITIES to UTF-8
-function mb_convert_encoding_wrapper($string, $charset_out, $charset_in) {
-	if ($charset_out == $charset_in) {
-		return $string;
+// init utf8-functions -- workaround to prevent functions-utf8.php and charsets_table.php (~140kB) to be loaded more than once
+// functions and arrays from functions-utf8.php and charsets_table.php will be in global name-space
+function init_utf8funcs() {
+	static $utf8_ok=0;
+	if($utf8_ok == 0) {
+		++$utf8_ok;
+		// debug XXX to be removed
+		if($utf8_ok > 1)
+			trigger_error("init_utf8funcs: utf8_ok > 1", E_USER_ERROR);
+		// XXX remove end
+		require_once(WB_PATH.'/framework/functions-utf8.php');
 	}
-	$use_iconv = true;
-	$use_mbstring = true;
-	/*
-	if(version_compare(PHP_VERSION, "5.1.0", "<")) {
-		$use_mbstring = false; // don't rely on mb_convert_encoding if php<5.1.0
-		$use_iconv = false; // don't rely on iconv neither
-	}
-	*/
-	
-	// try mb_convert_encoding(). This can handle to or from HTML-ENTITIES, too
-	if ($use_mbstring && function_exists('mb_convert_encoding')) {
-		// there's no GB2312 or ISO-8859-11 encoding in php's mb_* functions
-		if ($charset_in=='ISO-8859-11' || $charset_in=='GB2312') {
-			if ($use_iconv && function_exists('iconv')) {
-				$string = iconv($charset_in, 'UTF-8', $string);
-			}
-			else {
-				if ($charset_in == 'GB2312') {
-					$string=my_mysql_iconv($string, 'gb2312', 'utf8');
-				} else {
-					$string=my_mysql_iconv($string, 'tis620', 'utf8');
-				}
-			}
-			$charset_in='UTF-8';
-			if ($charset_out == 'UTF-8') {
-				return $string;
-			}
-		}
-		if ($charset_out=='ISO-8859-11' || $charset_out=='GB2312') {
-			$string=mb_convert_encoding($string, 'UTF-8', $charset_in);
-			if ($use_iconv && function_exists('iconv')) {
-				$string = iconv('UTF-8', $charset_out, $string);
-			}
-			else {
-				if ($charset_out == 'GB2312') {
-					$string=my_mysql_iconv($string, 'utf8', 'gb2312');
-				} else {
-					$string=my_mysql_iconv($string, 'utf8', 'tis620');
-				}
-			}
-		} else {
-			$string = strtr($string, array("&lt;"=>"&_lt;", "&gt;"=>"&_gt;", "&amp;"=>"&_amp;", "&quot;"=>"&_quot;", "&#39;"=>"&_#39;"));
-			$string=mb_convert_encoding($string, $charset_out, $charset_in);
-			$string = strtr($string, array("&_lt;"=>"&lt;", "&_gt;"=>"&gt;", "&_amp;"=>"&amp;", "&_quot;"=>"&quot;", "&_#39;"=>"&#39;"));
-		}
-		return $string;
-	}
-
-	// try iconv(). This can't handle to or from HTML-ENTITIES.
-	if ($use_iconv && function_exists('iconv') && $charset_out!='HTML-ENTITIES' && $charset_in!='HTML-ENTITIES' ) {
-		$string = iconv($charset_in, $charset_out, $string);
-		return $string;
-	}
-
-	// do the UTF-8->HTML-ENTITIES or HTML-ENTITIES->UTF-8 translation if mb_convert_encoding isn't available
-	if (($charset_in=='HTML-ENTITIES' && $charset_out=='UTF-8') || ($charset_in=='UTF-8' && $charset_out=='HTML-ENTITIES')) {
-		$string = string_decode_encode_entities($string, $charset_out, $charset_in);
-		return $string;
-	}
-
-	// mb_convert_encoding() and iconv() aren't available, so use my_mysql_iconv()
-	if ($charset_in == 'ISO-8859-1') { $mysqlcharset_from = 'latin1'; }
-	elseif ($charset_in == 'ISO-8859-2') { $mysqlcharset_from = 'latin2'; }
-	elseif ($charset_in == 'ISO-8859-3') { $mysqlcharset_from = 'latin1'; }
-	elseif ($charset_in == 'ISO-8859-4') { $mysqlcharset_from = 'latin7'; }
-	elseif ($charset_in == 'ISO-8859-5') { $string = convert_cyr_string ($string, "iso8859-5", "windows-1251" ); $mysqlcharset_from = 'cp1251'; }
-	elseif ($charset_in == 'ISO-8859-6') { $mysqlcharset_from = ''; } //?
-	elseif ($charset_in == 'ISO-8859-7') { $mysqlcharset_from = 'greek'; }
-	elseif ($charset_in == 'ISO-8859-8') { $mysqlcharset_from = 'hebrew'; }
-	elseif ($charset_in == 'ISO-8859-9') { $mysqlcharset_from = 'latin5'; }
-	elseif ($charset_in == 'ISO-8859-10') { $mysqlcharset_from = 'latin1'; }
-	elseif ($charset_in == 'BIG5') { $mysqlcharset_from = 'big5'; }
-	elseif ($charset_in == 'ISO-2022-JP') { $mysqlcharset_from = ''; } //?
-	elseif ($charset_in == 'ISO-2022-KR') { $mysqlcharset_from = ''; } //?
-	elseif ($charset_in == 'GB2312') { $mysqlcharset_from = 'gb2312'; }
-	elseif ($charset_in == 'ISO-8859-11') { $mysqlcharset_from = 'tis620'; }
-	elseif ($charset_in == 'UTF-8') { $mysqlcharset_from = 'utf8'; }
-	else { $mysqlcharset_from = 'latin1'; }
-
-	if ($charset_out == 'ISO-8859-1') { $mysqlcharset_to = 'latin1'; }
-	elseif ($charset_out == 'ISO-8859-2') { $mysqlcharset_to = 'latin2'; }
-	elseif ($charset_out == 'ISO-8859-3') { $mysqlcharset_to = 'latin1'; }
-	elseif ($charset_out == 'ISO-8859-4') { $mysqlcharset_to = 'latin7'; }
-	elseif ($charset_out == 'ISO-8859-5') { $mysqlcharset_to = 'cp1251'; } // use convert_cyr_string afterwards
-	elseif ($charset_out == 'ISO-8859-6') { $mysqlcharset_to = ''; } //?
-	elseif ($charset_out == 'ISO-8859-7') { $mysqlcharset_to = 'greek'; }
-	elseif ($charset_out == 'ISO-8859-8') { $mysqlcharset_to = 'hebrew'; }
-	elseif ($charset_out == 'ISO-8859-9') { $mysqlcharset_to = 'latin5'; }
-	elseif ($charset_out == 'ISO-8859-10') { $mysqlcharset_to = 'latin1'; }
-	elseif ($charset_out == 'BIG5') { $mysqlcharset_to = 'big5'; }
-	elseif ($charset_out == 'ISO-2022-JP') { $mysqlcharset_to = ''; } //?
-	elseif ($charset_out == 'ISO-2022-KR') { $mysqlcharset_to = ''; } //?
-	elseif ($charset_out == 'GB2312') { $mysqlcharset_to = 'gb2312'; }
-	elseif ($charset_out == 'ISO-8859-11') { $mysqlcharset_to = 'tis620'; }
-	elseif ($charset_out == 'UTF-8') { $mysqlcharset_to = 'utf8'; }
-	else { $mysqlcharset_to = 'latin1'; }
-
-	if ($mysqlcharset_from!="" && $mysqlcharset_to!="" && $mysqlcharset_from!=$mysqlcharset_to) {
-		$string=my_mysql_iconv($string, $mysqlcharset_from, $mysqlcharset_to);
-		if ($mysqlcharset_to == 'cp1251') { 
-			$string = convert_cyr_string ($string, "windows-1251", "iso-8859-5" );
-		}
-		return($string);
-	}
-
-	// $string is unchanged. This will happen if we have to deal with ISO-8859-6 or ISO-2022-JP or -KR
-	// and mbstring _and_ iconv aren't available.
-	return $string;
 }
 
-// Decodes or encodes html-entities. Works for utf-8 only!
-function string_decode_encode_entities($string, $out='HTML-ENTITIES', $in='UTF-8') {
-	if(!(($in=='UTF-8' || $in=='HTML-ENTITIES') && ($out=='UTF-8' || $out=='HTML-ENTITIES'))) {
-		return $string;
-	}
-	$named_to_numbered_entities=array(
-		'&Aacute;'=>'&#193;','&aacute;'=>'&#225;',
-		'&Acirc;'=>'&#194;','&acirc;'=>'&#226;','&acute;'=>'&#180;','&AElig;'=>'&#198;','&aelig;'=>'&#230;',
-		'&Agrave;'=>'&#192;','&agrave;'=>'&#224;','&alefsym;'=>'&#8501;','&Alpha;'=>'&#913;','&alpha;'=>'&#945;',
-		'&and;'=>'&#8743;','&ang;'=>'&#8736;','&apos;'=>'&#39;','&Aring;'=>'&#197;','&aring;'=>'&#229;',
-		'&asymp;'=>'&#8776;','&Atilde;'=>'&#195;','&atilde;'=>'&#227;','&Auml;'=>'&#196;','&auml;'=>'&#228;',
-		'&bdquo;'=>'&#8222;','&Beta;'=>'&#914;','&beta;'=>'&#946;','&brvbar;'=>'&#166;','&bull;'=>'&#8226;',
-		'&cap;'=>'&#8745;','&Ccedil;'=>'&#199;','&ccedil;'=>'&#231;','&cedil;'=>'&#184;','&cent;'=>'&#162;',
-		'&Chi;'=>'&#935;','&chi;'=>'&#967;','&circ;'=>'&#710;','&clubs;'=>'&#9827;','&cong;'=>'&#8773;',
-		'&copy;'=>'&#169;','&crarr;'=>'&#8629;','&cup;'=>'&#8746;','&curren;'=>'&#164;','&Dagger;'=>'&#8225;',
-		'&dagger;'=>'&#8224;','&dArr;'=>'&#8659;','&darr;'=>'&#8595;','&deg;'=>'&#176;','&Delta;'=>'&#916;',
-		'&delta;'=>'&#948;','&diams;'=>'&v#9830;','&divide;'=>'&#247;','&Eacute;'=>'&#201;','&eacute;'=>'&#233;',
-		'&Ecirc;'=>'&#202;','&ecirc;'=>'&#234;','&Egrave;'=>'&#200;','&egrave;'=>'&#232;','&empty;'=>'&#8709;',
-		'&emsp;'=>'&#8195;','&ensp;'=>'&#8194;','&Epsilon;'=>'&#917;','&epsilon;'=>'&#949;','&equiv;'=>'&#8801;',
-		'&Eta;'=>'&#919;','&eta;'=>'&#951;','&ETH;'=>'&#208;','&eth;'=>'&#240;','&Euml;'=>'&#203;','&euml;'=>'&#235;',
-		'&euro;'=>'&#8364;','&exist;'=>'&#8707;','&fnof;'=>'&#402;','&forall;'=>'&#8704;','&frac12;'=>'&#189;',
-		'&frac14;'=>'&#188;','&frac34;'=>'&#190;','&frasl;'=>'&#8260;','&Gamma;'=>'&#915;','&gamma;'=>'&#947;',
-		'&ge;'=>'&#8805;','&hArr;'=>'&#8660;','&harr;'=>'&#8596;','&hearts;'=>'&#9829;',
-		'&hellip;'=>'&#8230;','&Iacute;'=>'&#205;','&iacute;'=>'&#237;','&Icirc;'=>'&#206;','&icirc;'=>'&#238;',
-		'&iexcl;'=>'&#161;','&Igrave;'=>'&#204;','&igrave;'=>'&#236;','&image;'=>'&#8465;','&infin;'=>'&#8734;',
-		'&int;'=>'&#8747;','&Iota;'=>'&#921;','&iota;'=>'&#953;','&iquest;'=>'&#191;','&isin;'=>'&#8712;',
-		'&Iuml;'=>'&#207;','&iuml;'=>'&#239;','&Kappa;'=>'&#922;','&kappa;'=>'&#954;','&Lambda;'=>'&#923;',
-		'&lambda;'=>'&#955;','&lang;'=>'&#9001;','&laquo;'=>'&#171;','&lArr;'=>'&#8656;','&larr;'=>'&#8592;',
-		'&lceil;'=>'&#8968;','&ldquo;'=>'&#8220;','&le;'=>'&#8804;','&lfloor;'=>'&#8970;','&lowast;'=>'&#8727;',
-		'&loz;'=>'&#9674;','&lrm;'=>'&#8206;','&lsaquo;'=>'&#8249;','&lsquo;'=>'&#8216;',
-		'&macr;'=>'&#175;','&mdash;'=>'&#8212;','&micro;'=>'&#181;','&middot;'=>'&#183;','&minus;'=>'&#8722;',
-		'&Mu;'=>'&#924;','&mu;'=>'&#956;','&nabla;'=>'&#8711;','&nbsp;'=>'&#160;','&ndash;'=>'&#8211;',
-		'&ne;'=>'&#8800;','&ni;'=>'&#8715;','&not;'=>'&#172;','&notin;'=>'&#8713;','&nsub;'=>'&#8836;',
-		'&Ntilde;'=>'&#209;','&ntilde;'=>'&#241;','&Nu;'=>'&#925;','&nu;'=>'&#957;','&Oacute;'=>'&#211;',
-		'&oacute;'=>'&#243;','&Ocirc;'=>'&#212;','&ocirc;'=>'&#244;','&OElig;'=>'&#338;','&oelig;'=>'&#339;',
-		'&Ograve;'=>'&#210;','&ograve;'=>'&#242;','&oline;'=>'&#8254;','&Omega;'=>'&#937;','&omega;'=>'&#969;',
-		'&Omicron;'=>'&#927;','&omicron;'=>'&#959;','&oplus;'=>'&#8853;','&or;'=>'&#8744;','&ordf;'=>'&#170;',
-		'&ordm;'=>'&#186;','&Oslash;'=>'&#216;','&oslash;'=>'&#248;','&Otilde;'=>'&#213;','&otilde;'=>'&#245;',
-		'&otimes;'=>'&#8855;','&Ouml;'=>'&#214;','&ouml;'=>'&#246;','&para;'=>'&#182;','&part;'=>'&#8706;',
-		'&permil;'=>'&#8240;','&perp;'=>'&#8869;','&Phi;'=>'&#934;','&phi;'=>'&#966;','&Pi;'=>'&#928;',
-		'&pi;'=>'&#960;','&piv;'=>'&#982;','&plusmn;'=>'&#177;','&pound;'=>'&#163;','&Prime;'=>'&#8243;',
-		'&prime;'=>'&#8242;','&prod;'=>'&#8719;','&prop;'=>'&#8733;','&Psi;'=>'&#936;','&psi;'=>'&#968;',
-		'&quot;'=>'&#34;','&radic;'=>'&#8730;','&rang;'=>'&#9002;','&raquo;'=>'&#187;','&rArr;'=>'&#8658;',
-		'&rarr;'=>'&#8594;','&rceil;'=>'&#8969;','&rdquo;'=>'&#8221;','&real;'=>'&#8476;','&reg;'=>'&#174;',
-		'&rfloor;'=>'&#8971;','&Rho;'=>'&#929;','&rho;'=>'&#961;','&rlm;'=>'&#8207;','&rsaquo;'=>'&#8250;',
-		'&rsquo;'=>'&#8217;','&sbquo;'=>'&#8218;','&Scaron;'=>'&#352;','&scaron;'=>'&#353;','&sdot;'=>'&#8901;',
-		'&sect;'=>'&#167;','&shy;'=>'&#173;','&Sigma;'=>'&#931;','&sigma;'=>'&#963;','&sigmaf;'=>'&#962;',
-		'&sim;'=>'&#8764;','&spades;'=>'&#9824;','&sub;'=>'&#8834;','&sube;'=>'&#8838;','&sum;'=>'&#8721;',
-		'&sup;'=>'&#8835;','&sup1;'=>'&#185;','&sup2;'=>'&#178;','&sup3;'=>'&#179;','&supe;'=>'&#8839;',
-		'&szlig;'=>'&#223;','&Tau;'=>'&#932;','&tau;'=>'&#964;','&there4;'=>'&#8756;','&Theta;'=>'&#920;',
-		'&theta;'=>'&#952;','&thetasym;'=>'&#977;','&thinsp;'=>'&#8201;','&THORN;'=>'&#222;','&thorn;'=>'&#254;',
-		'&tilde;'=>'&#732;','&times;'=>'&#215;','&trade;'=>'&#8482;','&Uacute;'=>'&#218;','&uacute;'=>'&#250;',
-		'&uArr;'=>'&#8657;','&uarr;'=>'&#8593;','&Ucirc;'=>'&#219;','&ucirc;'=>'&#251;','&Ugrave;'=>'&#217;',
-		'&ugrave;'=>'&#249;','&uml;'=>'&#168;','&upsih;'=>'&#978;','&Upsilon;'=>'&#933;','&upsilon;'=>'&#965;',
-		'&Uuml;'=>'&#220;','&uuml;'=>'&#252;','&weierp;'=>'&#8472;','&Xi;'=>'&#926;','&xi;'=>'&#958;',
-		'&Yacute;'=>'&#221;','&yacute;'=>'&#253;','&yen;'=>'&#165;','&Yuml;'=>'&#376;','&yuml;'=>'&#255;',
-		'&Zeta;'=>'&#918;','&zeta;'=>'&#950;','&zwj;'=>'&#8205;','&zwnj;'=>'&#8204;'
-	);
-	$numbered_to_named_entities=array(
-		'&#193;'=>'&Aacute;','&#225;'=>'&aacute;','&#194;'=>'&Acirc;','&#226;'=>'&acirc;','&#180;'=>'&acute;',
-		'&#198;'=>'&AElig;','&#230;'=>'&aelig;','&#192;'=>'&Agrave;','&#224;'=>'&agrave;','&#8501;'=>'&alefsym;',
-		'&#913;'=>'&Alpha;','&#945;'=>'&alpha;','&#8743;'=>'&and;','&#8736;'=>'&ang;',
-		'&#39;'=>'&apos;','&#197;'=>'&Aring;','&#229;'=>'&aring;','&#8776;'=>'&asymp;','&#195;'=>'&Atilde;',
-		'&#227;'=>'&atilde;','&#196;'=>'&Auml;','&#228;'=>'&auml;','&#8222;'=>'&bdquo;','&#914;'=>'&Beta;',
-		'&#946;'=>'&beta;','&#166;'=>'&brvbar;','&#8226;'=>'&bull;','&#8745;'=>'&cap;','&#199;'=>'&Ccedil;',
-		'&#231;'=>'&ccedil;','&#184;'=>'&cedil;','&#162;'=>'&cent;','&#935;'=>'&Chi;','&#967;'=>'&chi;',
-		'&#710;'=>'&circ;','&#9827;'=>'&clubs;','&#8773;'=>'&cong;','&#169;'=>'&copy;','&#8629;'=>'&crarr;',
-		'&#8746;'=>'&cup;','&#164;'=>'&curren;','&#8225;'=>'&Dagger;','&#8224;'=>'&dagger;','&#8659;'=>'&dArr;',
-		'&#8595;'=>'&darr;','&#176;'=>'&deg;','&#916;'=>'&Delta;','&#948;'=>'&delta;','&v#9830;'=>'&diams;',
-		'&#247;'=>'&divide;','&#201;'=>'&Eacute;','&#233;'=>'&eacute;','&#202;'=>'&Ecirc;','&#234;'=>'&ecirc;',
-		'&#200;'=>'&Egrave;','&#232;'=>'&egrave;','&#8709;'=>'&empty;','&#8195;'=>'&emsp;','&#8194;'=>'&ensp;',
-		'&#917;'=>'&Epsilon;','&#949;'=>'&epsilon;','&#8801;'=>'&equiv;','&#919;'=>'&Eta;','&#951;'=>'&eta;',
-		'&#208;'=>'&ETH;','&#240;'=>'&eth;','&#203;'=>'&Euml;','&#235;'=>'&euml;','&#8364;'=>'&euro;',
-		'&#8707;'=>'&exist;','&#402;'=>'&fnof;','&#8704;'=>'&forall;','&#189;'=>'&frac12;','&#188;'=>'&frac14;',
-		'&#190;'=>'&frac34;','&#8260;'=>'&frasl;','&#915;'=>'&Gamma;','&#947;'=>'&gamma;','&#8805;'=>'&ge;',
-		'&#8660;'=>'&hArr;','&#8596;'=>'&harr;','&#9829;'=>'&hearts;','&#8230;'=>'&hellip;',
-		'&#205;'=>'&Iacute;','&#237;'=>'&iacute;','&#206;'=>'&Icirc;','&#238;'=>'&icirc;','&#161;'=>'&iexcl;',
-		'&#204;'=>'&Igrave;','&#236;'=>'&igrave;','&#8465;'=>'&image;','&#8734;'=>'&infin;','&#8747;'=>'&int;',
-		'&#921;'=>'&Iota;','&#953;'=>'&iota;','&#191;'=>'&iquest;','&#8712;'=>'&isin;','&#207;'=>'&Iuml;',
-		'&#239;'=>'&iuml;','&#922;'=>'&Kappa;','&#954;'=>'&kappa;','&#923;'=>'&Lambda;','&#955;'=>'&lambda;',
-		'&#9001;'=>'&lang;','&#171;'=>'&laquo;','&#8656;'=>'&lArr;','&#8592;'=>'&larr;','&#8968;'=>'&lceil;',
-		'&#8220;'=>'&ldquo;','&#8804;'=>'&le;','&#8970;'=>'&lfloor;','&#8727;'=>'&lowast;','&#9674;'=>'&loz;',
-		'&#8206;'=>'&lrm;','&#8249;'=>'&lsaquo;','&#8216;'=>'&lsquo;','&#175;'=>'&macr;',
-		'&#8212;'=>'&mdash;','&#181;'=>'&micro;','&#183;'=>'&middot;','&#8722;'=>'&minus;','&#924;'=>'&Mu;',
-		'&#956;'=>'&mu;','&#8711;'=>'&nabla;','&#160;'=>'&nbsp;','&#8211;'=>'&ndash;','&#8800;'=>'&ne;',
-		'&#8715;'=>'&ni;','&#172;'=>'&not;','&#8713;'=>'&notin;','&#8836;'=>'&nsub;','&#209;'=>'&Ntilde;',
-		'&#241;'=>'&ntilde;','&#925;'=>'&Nu;','&#957;'=>'&nu;','&#211;'=>'&Oacute;','&#243;'=>'&oacute;',
-		'&#212;'=>'&Ocirc;','&#244;'=>'&ocirc;','&#338;'=>'&OElig;','&#339;'=>'&oelig;','&#210;'=>'&Ograve;',
-		'&#242;'=>'&ograve;','&#8254;'=>'&oline;','&#937;'=>'&Omega;','&#969;'=>'&omega;','&#927;'=>'&Omicron;',
-		'&#959;'=>'&omicron;','&#8853;'=>'&oplus;','&#8744;'=>'&or;','&#170;'=>'&ordf;','&#186;'=>'&ordm;',
-		'&#216;'=>'&Oslash;','&#248;'=>'&oslash;','&#213;'=>'&Otilde;','&#245;'=>'&otilde;','&#8855;'=>'&otimes;',
-		'&#214;'=>'&Ouml;','&#246;'=>'&ouml;','&#182;'=>'&para;','&#8706;'=>'&part;','&#8240;'=>'&permil;',
-		'&#8869;'=>'&perp;','&#934;'=>'&Phi;','&#966;'=>'&phi;','&#928;'=>'&Pi;','&#960;'=>'&pi;','&#982;'=>'&piv;',
-		'&#177;'=>'&plusmn;','&#163;'=>'&pound;','&#8243;'=>'&Prime;','&#8242;'=>'&prime;','&#8719;'=>'&prod;',
-		'&#8733;'=>'&prop;','&#936;'=>'&Psi;','&#968;'=>'&psi;','&#34;'=>'&quot;','&#8730;'=>'&radic;',
-		'&#9002;'=>'&rang;','&#187;'=>'&raquo;','&#8658;'=>'&rArr;','&#8594;'=>'&rarr;','&#8969;'=>'&rceil;',
-		'&#8221;'=>'&rdquo;','&#8476;'=>'&real;','&#174;'=>'&reg;','&#8971;'=>'&rfloor;','&#929;'=>'&Rho;',
-		'&#961;'=>'&rho;','&#8207;'=>'&rlm;','&#8250;'=>'&rsaquo;','&#8217;'=>'&rsquo;','&#8218;'=>'&sbquo;',
-		'&#352;'=>'&Scaron;','&#353;'=>'&scaron;','&#8901;'=>'&sdot;','&#167;'=>'&sect;','&#173;'=>'&shy;',
-		'&#931;'=>'&Sigma;','&#963;'=>'&sigma;','&#962;'=>'&sigmaf;','&#8764;'=>'&sim;','&#9824;'=>'&spades;',
-		'&#8834;'=>'&sub;','&#8838;'=>'&sube;','&#8721;'=>'&sum;','&#8835;'=>'&sup;','&#185;'=>'&sup1;',
-		'&#178;'=>'&sup2;','&#179;'=>'&sup3;','&#8839;'=>'&supe;','&#223;'=>'&szlig;','&#932;'=>'&Tau;',
-		'&#964;'=>'&tau;','&#8756;'=>'&there4;','&#920;'=>'&Theta;','&#952;'=>'&theta;','&#977;'=>'&thetasym;',
-		'&#8201;'=>'&thinsp;','&#222;'=>'&THORN;','&#254;'=>'&thorn;','&#732;'=>'&tilde;','&#215;'=>'&times;',
-		'&#8482;'=>'&trade;','&#218;'=>'&Uacute;','&#250;'=>'&uacute;','&#8657;'=>'&uArr;','&#8593;'=>'&uarr;',
-		'&#219;'=>'&Ucirc;','&#251;'=>'&ucirc;','&#217;'=>'&Ugrave;','&#249;'=>'&ugrave;','&#168;'=>'&uml;',
-		'&#978;'=>'&upsih;','&#933;'=>'&Upsilon;','&#965;'=>'&upsilon;','&#220;'=>'&Uuml;','&#252;'=>'&uuml;',
-		'&#8472;'=>'&weierp;','&#926;'=>'&Xi;','&#958;'=>'&xi;','&#221;'=>'&Yacute;','&#253;'=>'&yacute;',
-		'&#165;'=>'&yen;','&#376;'=>'&Yuml;','&#255;'=>'&yuml;','&#918;'=>'&Zeta;','&#950;'=>'&zeta;','&#8205;'=>'&zwj;',
-		'&#8204;'=>'&zwnj;'
-	);
-		
-	if ($in == 'HTML-ENTITIES') {
-		$string = strtr($string, $named_to_numbered_entities);
-		$string = preg_replace("/&#([0-9]+);/e", "code_to_utf8($1)", $string);
-	}
-	elseif ($out == 'HTML-ENTITIES') {
-		$char = "";
-		$i=0;
-		$len=strlen($string);
-		if($len==0) return $string;
-		do {
-			if(ord($string{$i}) <= 127) $ud = $string{$i++};
-			elseif(ord($string{$i}) <= 223) $ud = (ord($string{$i++})-192)*64 + (ord($string{$i++})-128);
-			elseif(ord($string{$i}) <= 239) $ud = (ord($string{$i++})-224)*4096 + (ord($string{$i++})-128)*64 + (ord($string{$i++})-128);
-			elseif(ord($string{$i}) <= 247) $ud = (ord($string{$i++})-240)*262144 + (ord($string{$i++})-128)*4096 + (ord($string{$i++})-128)*64 + (ord($string{$i++})-128);
-			elseif(ord($string{$i}) <= 251) $ud = ord($string{$i++}); // error!
-			if($ud > 127) {
-				$char .= "&#$ud;";
-			} else {
-				$char .= $ud;
-			}
-		} while($i < $len);
-		$string = $char;
-		$string = strtr($string, $numbered_to_named_entities);
-		// do ' and "
-		$string = strtr($string, array('\''=>'&#39;', '\"'=>'&quot;'));
-	}
-	return $string;
+// Convert a string from mixed html-entities/umlauts to pure $charset_out-umlauts
+// Will replace all numeric and named entities except &gt; &lt; &apos; &quot; &#39; &nbsp;
+// In case of error the returned string is unchanged, and a message is emitted.
+function entities_to_umlauts($string, $charset_out=DEFAULT_CHARSET) {
+	//init utf8-functions -- workaround to prevent functions-utf8.php and charsets_table.php (~140kB) to be loaded more than once
+	init_utf8funcs();
+	return entities_to_umlauts2($string, $charset_out);
 }
 
-// support-function for string_decode_encode_entities()
-function code_to_utf8($num) {
-	if ($num <= 0x7F) {
-		return chr($num);
-	} elseif ($num <= 0x7FF) {
-		return chr(($num >> 6) + 192) . chr(($num & 63) + 128);
-	} elseif ($num <= 0xFFFF) {
-		 return chr(($num >> 12) + 224) . chr((($num >> 6) & 63) + 128) . chr(($num & 63) + 128);
-	} elseif ($num <= 0x1FFFFF) {
-		return chr(($num >> 18) + 240) . chr((($num >> 12) & 63) + 128) . chr((($num >> 6) & 63) + 128) . chr(($num & 63) + 128);
-	}
-	return " ";
-}
-
-// Function to convert a string from mixed html-entities/umlauts to pure utf-8-umlauts
-function string_to_utf8($string, $charset=DEFAULT_CHARSET) {
-	$charset = strtoupper($charset);
-	if ($charset == '') { $charset = 'ISO-8859-1'; }
-
-	if (!is_UTF8($string)) {
-		$string=mb_convert_encoding_wrapper($string, 'UTF-8', $charset);
-	}
-	// check if we really get UTF-8. We don't get UTF-8 if charset is ISO-8859-6 or ISO-2022-JP/KR
-	// and mb_string AND iconv aren't available.
-	if (is_UTF8($string)) {
-		$string=mb_convert_encoding_wrapper($string, 'HTML-ENTITIES', 'UTF-8');
-		$string=mb_convert_encoding_wrapper($string, 'UTF-8', 'HTML-ENTITIES');
-	} else {
-		// nothing we can do here :-(
-	}
-	return($string);
-}
-
-// function to check if a string is UTF-8
-function is_UTF8 ($str) {
-	if (strlen($str) < 4000) {
-		// see http://bugs.php.net/bug.php?id=24460 and http://bugs.php.net/bug.php?id=27070 and http://ilia.ws/archives/5-Top-10-ways-to-crash-PHP.html for this.
-		// 4000 works for me ...
-		return preg_match('/^(?:[\x09\x0A\x0D\x20-\x7E]|[\xC2-\xDF][\x80-\xBF]|\xE0[\xA0-\xBF][\x80-\xBF]|[\xE1-\xEC\xEE\xEF][\x80-\xBF]{2}|\xED[\x80-\x9F][\x80-\xBF]|\xF0[\x90-\xBF][\x80-\xBF]{2}|[\xF1-\xF3][\x80-\xBF]{3}|\xF4[\x80-\x8F][\x80-\xBF]{2})*$/s', $str);
-	}	else {
-		$isUTF8 = true;
-		while($str{0}) {
-			if (preg_match("/^[\x09\x0A\x0D\x20-\x7E]/", $str)) { $str = substr($str, 1); continue; }
-			if (preg_match("/^[\xC2-\xDF][\x80-\xBF]/", $str)) { $str = substr($str, 2); continue; }
-			if (preg_match("/^\xE0[\xA0-\xBF][\x80-\xBF]/", $str)) { $str = substr($str, 3); continue; }
-			if (preg_match("/^[\xE1-\xEC\xEE\xEF][\x80-\xBF]{2}/", $str)) { $str = substr($str, 3); continue; }
-			if (preg_match("/^\xED[\x80-\x9F][\x80-\xBF]/", $str)) { $str = substr($str, 3); continue; }
-			if (preg_match("/^\xF0[\x90-\xBF][\x80-\xBF]{2}/", $str)) { $str = substr($str, 4); continue; }
-			if (preg_match("/^[\xF1-\xF3][\x80-\xBF]{3}/", $str)) { $str = substr($str, 4); continue; }
-			if (preg_match("/^\xF4[\x80-\x8F][\x80-\xBF]{2}/", $str)) { $str = substr($str, 4); continue; }
-			if (preg_match("/^$/", $str)) { break; }
-			$isUTF8 = false;
-			break;
-		}
-		return ($isUTF8);
-	}
-}
-
-// Function to convert a string from mixed html-entities/umlauts to pure $charset_out-umlauts
-function entities_to_umlauts($string, $charset_out=DEFAULT_CHARSET) {
-	$charset_out = strtoupper($charset_out);
-	if ($charset_out == '') { $charset_out = 'ISO-8859-1'; }
-	$charset_in = strtoupper(DEFAULT_CHARSET);
-	require_once(WB_PATH.'/framework/charsets_table.php');
-	global $iso_8859_2_to_utf8, $iso_8859_3_to_utf8, $iso_8859_4_to_utf8, $iso_8859_5_to_utf8, $iso_8859_6_to_utf8, $iso_8859_7_to_utf8, $iso_8859_8_to_utf8, $iso_8859_9_to_utf8, $iso_8859_10_to_utf8, $iso_8859_11_to_utf8;
-	global $utf8_to_iso_8859_2, $utf8_to_iso_8859_3, $utf8_to_iso_8859_4, $utf8_to_iso_8859_5, $utf8_to_iso_8859_6, $utf8_to_iso_8859_7, $utf8_to_iso_8859_8, $utf8_to_iso_8859_9, $utf8_to_iso_8859_10, $utf8_to_iso_8859_11;
-
-	// string to utf-8, entities_to_utf8
-	if (substr($charset_in,0,8) == 'ISO-8859' || $charset_in == 'UTF-8') {
-		if ($charset_in == 'ISO-8859-1') {
-			$string=utf8_encode($string);
-		} elseif ($charset_in == 'ISO-8859-2') {
-			$string = strtr($string, $iso_8859_2_to_utf8);
-		} elseif ($charset_in == 'ISO-8859-3') {
-			$string = strtr($string, $iso_8859_3_to_utf8);
-		} elseif ($charset_in == 'ISO-8859-4') {
-			$string = strtr($string, $iso_8859_4_to_utf8);
-		} elseif ($charset_in == 'ISO-8859-5') {
-			$string = strtr($string, $iso_8859_5_to_utf8);
-		} elseif ($charset_in == 'ISO-8859-6') {
-			$string = strtr($string, $iso_8859_6_to_utf8);
-		} elseif ($charset_in == 'ISO-8859-7') {
-			$string = strtr($string, $iso_8859_7_to_utf8);
-		} elseif ($charset_in == 'ISO-8859-8') {
-			$string = strtr($string, $iso_8859_8_to_utf8);
-		} elseif ($charset_in == 'ISO-8859-9') {
-			$string = strtr($string, $iso_8859_9_to_utf8);
-		} elseif ($charset_in == 'ISO-8859-10') {
-			$string = strtr($string, $iso_8859_10_to_utf8);
-		} elseif ($charset_in == 'ISO-8859-11') {
-			$string = strtr($string, $iso_8859_11_to_utf8);
-		}
-		// decode html-entities
-		if(preg_match("/&[#a-zA-Z0-9]+;/", $string)) {
-			$string=string_decode_encode_entities($string, 'UTF-8', 'HTML-ENTITIES');
-			//$string=mb_convert_encoding_wrapper($string, 'HTML-ENTITIES', 'UTF-8'); // alternative to string_decode_encode_entities()
-			//$string=mb_convert_encoding_wrapper($string, 'UTF-8', 'HTML-ENTITIES');
-		}
-	}
-	else {
-		$string = string_to_utf8($string); // will decode html-entities, too.
-	}
-	// string to $charset_out
-	if($charset_out == 'ISO-8859-1') {
-			$string=utf8_decode($string);
-	} elseif($charset_out == 'ISO-8859-2') {
-		$string = strtr($string, $utf8_to_iso_8859_2);
-	} elseif($charset_out == 'ISO-8859-3') {
-		$string = strtr($string, $utf8_to_iso_8859_3);
-	} elseif($charset_out == 'ISO-8859-4') {
-		$string = strtr($string, $utf8_to_iso_8859_4);
-	} elseif($charset_out == 'ISO-8859-5') {
-		$string = strtr($string, $utf8_to_iso_8859_5);
-	} elseif($charset_out == 'ISO-8859-6') {
-		$string = strtr($string, $utf8_to_iso_8859_6);
-	} elseif($charset_out == 'ISO-8859-7') {
-		$string = strtr($string, $utf8_to_iso_8859_7);
-	} elseif($charset_out == 'ISO-8859-8') {
-		$string = strtr($string, $utf8_to_iso_8859_8);
-	} elseif($charset_out == 'ISO-8859-9') {
-		$string = strtr($string, $utf8_to_iso_8859_9);
-	} elseif($charset_out == 'ISO-8859-10') {
-		$string = strtr($string, $utf8_to_iso_8859_10);
-	} elseif($charset_out == 'ISO-8859-11') {
-		$string = strtr($string, $utf8_to_iso_8859_11);
-	} elseif($charset_out != 'UTF-8') {
-		if(is_UTF8($string)) {
-			$string=mb_convert_encoding_wrapper($string, $charset_out, 'UTF-8');
-		}
-	}
-	return $string;
-}	
-
-// Function to convert a string from mixed html-entitites/$charset_in-umlauts to pure html-entities
+// Will convert a string in $charset_in encoding to a pure ASCII string with HTML-entities.
+// In case of error the returned string is unchanged, and a message is emitted.
 function umlauts_to_entities($string, $charset_in=DEFAULT_CHARSET) {
-	$charset_in = strtoupper($charset_in);
-	if ($charset_in == "") { $charset_in = 'ISO-8859-1'; }
-	require_once(WB_PATH.'/framework/charsets_table.php');
-	global $iso_8859_2_to_utf8, $iso_8859_3_to_utf8, $iso_8859_4_to_utf8, $iso_8859_5_to_utf8, $iso_8859_6_to_utf8, $iso_8859_7_to_utf8, $iso_8859_8_to_utf8, $iso_8859_9_to_utf8, $iso_8859_10_to_utf8, $iso_8859_11_to_utf8;
-
-	// string to utf-8, umlauts_to_entities
-	if ($charset_in == 'UTF-8' || substr($charset_in,0,8) == 'ISO-8859') {
-		if ($charset_in == 'ISO-8859-1') {
-			$string=utf8_encode($string);
-		} elseif ($charset_in == 'ISO-8859-2') {
-			$string = strtr($string, $iso_8859_2_to_utf8);
-		} elseif ($charset_in == 'ISO-8859-3') {
-			$string = strtr($string, $iso_8859_3_to_utf8);
-		} elseif ($charset_in == 'ISO-8859-4') {
-			$string = strtr($string, $iso_8859_4_to_utf8);
-		} elseif ($charset_in == 'ISO-8859-5') {
-			$string = strtr($string, $iso_8859_5_to_utf8);
-		} elseif ($charset_in == 'ISO-8859-6') {
-			$string = strtr($string, $iso_8859_6_to_utf8);
-		} elseif ($charset_in == 'ISO-8859-7') {
-			$string = strtr($string, $iso_8859_7_to_utf8);
-		} elseif ($charset_in == 'ISO-8859-8') {
-			$string = strtr($string, $iso_8859_8_to_utf8);
-		} elseif ($charset_in == 'ISO-8859-9') {
-			$string = strtr($string, $iso_8859_9_to_utf8);
-		} elseif ($charset_in == 'ISO-8859-10') {
-			$string = strtr($string, $iso_8859_10_to_utf8);
-		} elseif ($charset_in == 'ISO-8859-11') {
-			$string = strtr($string, $iso_8859_11_to_utf8);
-		}
-		// encode html-entities
-		$string=string_decode_encode_entities($string, 'HTML-ENTITIES', 'UTF-8');
-		//$string=mb_convert_encoding_wrapper($string, 'HTML-ENTITIES', 'UTF-8');
-	}
-	else {
-		$string = string_to_utf8($string, $charset_in);
-		// encode html-entities
-		if (is_UTF8($string)) {
-			$string=string_decode_encode_entities($string, 'HTML-ENTITIES', 'UTF-8');
-			//$string=mb_convert_encoding_wrapper($string, 'HTML-ENTITIES', 'UTF-8');
-		}
-	}
-	return $string;
+	//init utf8-functions -- workaround to prevent functions-utf8.php and charsets_table.php (~140kB) to be loaded more than once
+	init_utf8funcs();
+	return umlauts_to_entities2($string, $charset_in);
 }
 
-function umlauts_to_defcharset($string, $charset) {
-		$charset_out = strtoupper(DEFAULT_CHARSET);
-		if ($charset_out == "") { $charset_out = 'ISO-8859-1'; }
-		require_once(WB_PATH.'/framework/charsets_table.php');
-		global $utf8_to_iso_8859_2, $utf8_to_iso_8859_3, $utf8_to_iso_8859_4, $utf8_to_iso_8859_5, $utf8_to_iso_8859_6, $utf8_to_iso_8859_7, $utf8_to_iso_8859_8, $utf8_to_iso_8859_9, $utf8_to_iso_8859_10, $utf8_to_iso_8859_11;
-		
-		if($charset_out == $charset) {
-			return $string;
-		}
-
-		if($charset == 'UTF-8') {
-			if($charset_out == 'ISO-8859-1') {
-				$string = utf8_decode($string);
-			} elseif ($charset_out == 'ISO-8859-2') {
-				$string = strtr($string, $utf8_to_iso_8859_2);
-			} elseif ($charset_out == 'ISO-8859-3') {
-				$string = strtr($string, $utf8_to_iso_8859_3);
-			} elseif ($charset_out == 'ISO-8859-4') {
-				$string = strtr($string, $utf8_to_iso_8859_4);
-			} elseif ($charset_out == 'ISO-8859-5') {
-				$string = strtr($string, $utf8_to_iso_8859_5);
-			} elseif ($charset_out == 'ISO-8859-6') {
-				$string = strtr($string, $utf8_to_iso_8859_6);
-			} elseif ($charset_out == 'ISO-8859-7') {
-				$string = strtr($string, $utf8_to_iso_8859_7);
-			} elseif ($charset_out == 'ISO-8859-8') {
-				$string = strtr($string, $utf8_to_iso_8859_8);
-			} elseif ($charset_out == 'ISO-8859-9') {
-				$string = strtr($string, $utf8_to_iso_8859_9);
-			} elseif ($charset_out == 'ISO-8859-10') {
-				$string = strtr($string, $utf8_to_iso_8859_10);
-			} elseif ($charset_out == 'ISO-8859-11') {
-				$string = strtr($string, $utf8_to_iso_8859_11);
-			}
-			else {
-				$string=mb_convert_encoding_wrapper($string, $charset_out, $charset);
-			}
-		}
-		else {
-			$string=mb_convert_encoding_wrapper($string, $charset_out, $charset);
-		}
-		
-	return $string;
-}
-	
-// translate any latin/greek/cyrillic html-entities to their plain 7bit equivalents
-// and numbered-entities into hex
-function entities_to_7bit($string) {
-	require(WB_PATH.'/framework/convert.php');
-	$string = strtr($string, $conversion_array);
-	$string = preg_replace('/&#([0-9]+);/e', "dechex('$1')",  $string);
-	return($string);
-}
-
 // Function to convert a page title to a page filename
 function page_filename($string) {
-	$string = entities_to_7bit(umlauts_to_entities($string));
+	//init utf8-functions -- workaround to prevent functions-utf8.php and charsets_table.php (~140kB) to be loaded more than once
+	init_utf8funcs();
+	$string = entities_to_7bit($string);
 	// Now replace spaces with page spcacer
 	$string = trim($string);
 	$string = preg_replace('/(\s)+/', PAGE_SPACER, $string);
@@ -903,7 +408,9 @@
 
 // Function to convert a desired media filename to a clean filename
 function media_filename($string) {
-	$string = entities_to_7bit(umlauts_to_entities($string));
+	//init utf8-functions -- workaround to prevent functions-utf8.php and charsets_table.php (~140kB) to be loaded more than once
+	init_utf8funcs();
+	$string = entities_to_7bit($string);
 	// Now remove all bad characters
 	$bad = array(
 	'\'', // '
