// BEGIN l10ns.js
var LocalizedStrings = {"ja":{"Could not retrieve the latest revision of the page":"ページの最新のリビジョンを取得することができませんでした。","Link to tag '%1'. Click to edit.":"'%1' タグへのリンク: クリックして編集してください。","Display the search results for the given phrase within a workspace. Use this form to edit the properties for the search.":"ワークスペース内で使われているフレーズについて検索結果を表示します。このフォームを使用して検索のプロパティを編集してください。","Attachment filename:":"添付ファイル名:","Search Technorati for '%1'. Click to edit.":"Technorati で '%1' を検索します。 クリックして編集してください。","Switch to %1 to use this feature.":"この機能を使うには %1 に切り替えてください。","Page title is too long after URL encoding":"URL のエンコード処理を行うと、ページタイトル が長くなりすぎます。全角文字は28字まで使用できます。","Search for '%1'. Click to edit.":"'%1' を検索する。 クリックして編集してください。","User Name":"ユーザ名","Create Table":"表の作成","Link to Attachment":"添付ファイルへのリンク","Can't have a 0 for a size.":"0 は入力できません。","Loading...":"読み込み中...","Display a link to a file attached to a page. Use this form to edit the properities of the link.":"ページに添付されているファイルへのリンクを表示します。このフォームを使用してリンクのプロパティを編集してください。","There are no optional properties for a Convoq Link.":"Convoq リンクに関するオプショナルプロパティはありません。","You have unsaved changes. Are you sure you want to navigate away from this page? If you click 'OK', all edit changes will be lost. Click 'Cancel' if you want to stay on the current page.":"変更が保存されていません。 このページから離れますか？ 'OK' をクリックすると、すべての変更内容が失われます。変更を保存し、このページに残りたい場合は、'キャンセル' をクリックしてください。","Edit More":"さらに編集","'%1' has an invalid value":"'%1' に無効な値が含まれます","recent changes":"最近の更新","You cannot compare a revision to itself.":"同じリビジョンと比較することはできません。","In:":"場所:","Inline RSS":"RSS のインライン","Table of Contents":"目次","Display a table of contents for a page. Each header or section on the page is listed as a link in the table of contents. Click \\\"Save\\\" now, or click \\\"More options\\\" to edit the properties for the table of contents.":"ページの目次を表示します。ページの各ヘッダやセクションが目次の中にリンクとして一覧表示されます。 \\\"保存\\\" をクリックするか、あるいは、 \\\"オプションを表示\\\" をクリックし、目次のプロパティを編集してください。","Enter a tag and click \\\"Add tag\\\". The tag will be saved when you save the page.":"タグを入力し ”タグを追加” をクリックしてください。タグはページ保存時に追加されます。","Optional properties include specifying which workspace to use and whether to display page titles or whole pages.":"使用するワークスペース、また、ページのタイトルを表示させるか、ページ全体を表示させるか、オプショナルプロパティで指定できます。","RSS feed URL:":"RSS フィード URL:","error -> To send email, you must specify a recipient":"エラー -> Email を送るには宛先を指定してください。","No tag entered":"タグが入力されていません。","Advanced content is shown inside a grey border. Switch to %1 to edit areas inside a grey border.":"灰色の点線ボックス内の内容は高度編集モードでのみ編集可能です。ボックス内を編集するには %1 に切り替えてください。","Could not remove page from watchlist":"ウォッチリストからページを削除することができませんでした。","Display the contents of another page within the current page. Use this form to edit the properties for the page include.":"現在のページの中に、別のページの内容を表示します。このフォームを使用して挿入するページのプロパティを編集してください。","Unlink":"リンクをはずす","Search term:":"検索するワード:","Heading 1":"見出し1","Atom feed URL:":"Atom フィード URL:","Link to '%1' in '%2'. Click to edit.":"'%2' の '%1' へのリンクです。 クリックして編集してください。","There are no optional properties for page include.":"ページ挿入に関するオプショナルプロパティはありません。","Insert table":"表を挿入","page does not exist":"ページが存在しません。","Link to file '%1'. Click to edit.":"'%1' ファイルへのリンクです。 クリックして編集してください。","There are no optional properties for an Google search.":"Google 検索に関するオプショナルプロパティはありません。","Display a link to an AIM screen name. The icon will show whether the person is online. Clicking the link will start an IM conversation with the person if your IM client is properly configured. Use this form to edit the properties of the link.":"AIM スクリーンネームへのリンクを表示します。相手がオンラインかどうかアイコンで表示されます。 IM クライアントがきちんと設定されていれば、リンクをクリックすると IM で会話を開始することができます。このフォームを使用してリンクのプロパティを編集してください。","Underline":"下線","Bulleted List":"箇条書き","Technorati: %1":"Technorati: %1","Weblog Link":"ウェブログリンク","Date in Local Time":"ローカルタイム","Tag":"タグ","Display an image on this page. The image must be already uploaded as an attachment to this page or another page. Use this form to edit the properties of the displayed image.":"このページに画像を表示します。画像は添付として、このページ、あるいは、別のページにすでにアップロードされているはずです。このフォームを使用して表示された画像のプロパティを編集してください。","You must select two revisions to compare.":"比較したいリビジョンを2つ選択してください。","External Link":"外部リンクの作成","Weblog on:":"ウェブログ","Enter your destination url here:":"ここにリンクしたいサイトの URL を入力してください。","User's email:":"ユーザの Email:","Use %1 to change the number of rows and columns in a table.":"%1 を使用して、表の行数と列数を変更してください。","in:":"場所","Display a link to a Skype name. Clicking the link will start a Skype call with the person if your Skype client is properly configured. Use this form to edit the properties of the link.":"Skype 名へのリンクを表示します。 Skype クライアントがきちんと設定されていれば、リンクをクリックすると Skype 通話が開始されます。このフォームを使用してリンクのプロパティを編集してください。","Title":"タイトル","Tag List":"タグ一覧","Other workspace:":"別のワークスペース","That seems like a bit too large for a table.":"表にしては少し大きすぎるようです。","Tag Link":"タグリンク","the current page":"現在のページ","Increase Indent":"インデントを増やす","%asis_content":"(オプショナル)","Advanced Content in Grey Border":"高度編集モードの編集内容を灰色の点線ボックス内に表示","[Style]":"スタイル","Display pages with the '%1' tag. Click to edit.":"'%1' タグが付いたページを表示します。クリックして編集してください。","Heading 3":"見出し3","Please enter the number of table rows:":"表の行の数字を入力してください:","Strikethrough":"取り消し線","Unexpected Widget >>%1<< in parseWidget":"parseWidget で予期しない Widget >>%1<<","You have unsaved changes. Do you want to save those changes? If you click 'OK', all edit changes will be lost. Click 'Cancel' if you want to save changes before navigating away from this page.":"変更が保存されていません。 変更を破棄しますか？ 'OK' をクリックすると、すべての変更内容が失われます。このページから離れる前に変更を保存する場合は、'キャンセル' をクリックしてください。","Numbering":"番号付き箇条書き","Show full name for '%1'. Click to edit.":"'%1' に対するフルネームを表示します。クリックして編集してください。","Display a list of the most recently changed pages in a workspace that have a specific tag. By default only the page title is displayed. Use this form to edit the list properties.":"特定のタグが付いているワークスペースで、最も最近変更のあったページ一覧を表示します。初期設定では、ページのタイトルのみが表示されます。このフォームを使用してリストのプロパティを編集してください。","Click \\\"Browse\\\" to find the file you want to upload. When you click \\\"Add another file,\\\" these files will be added to the list of attachments for this page, and uploaded when you save the page.":"\\\"参照\\\" をクリックし、アップロードしたいファイルを選択してください。 \\\"別のファイルを追加\\\" をクリックすると、これらのファイルがこのページの添付リストに追加され、ページを保存した時にアップロードされます。","Heading 2":"見出し2","Weblog name:":"ウェブログ名:","There are no optional properties for a Yahoo! link.":"Yahoo! リンクに関するオプショナルプロパティはありません。","Search type:":"検索対象:","Plese click \\\"Browse\\\" and select a file to upload.":"\\\"参照\\\" をクリックして、アップロードするファイルを選択してください。","You must check at least one page in order to create a PDF.":"PDFを生成するためには少なくとも一つのページをチェックしなければいけません。","Skype name:":"Skype 名:","Select a form and generates a new form page.":"フォームを選択してください。新しいフォームページを作成します。","Create Link":"リンクの作成","Include an Image":"画像の挿入","Numbered List":"番号付き箇条書き","Insert Socialtext link":"リンクの作成","Optional parameters include specifying which workspace to use and whether to display page titles or whole pages.":"使用するワークスペース、また、ページのタイトルを表示させるか、ページ全体を表示させるか、オプショナルパラメーターで指定できます。","Instant message to '%1' using Yahoo! Click to edit.":"'%1' への Yahoo! インスタントメッセージです。クリックして編集してください。","Google Search":"Google 検索","unformatted: %1":"レイアウトなし: %1","Attached to:":"添付:","toc: %1":"目次: %1","Convoq name:":"Convoq 名:","Display a link to a Convoq name. Clicking the link will start a Convoq call with the person if your Convoq client is properly configured. Use this form to edit the properties of the Convoq link.":"Convoq 名へのリンクを表示します。Convoq クライアントがきちんと設定されていれば、リンクをクリックすると Convoq コールが開始されます。このフォームを使用してConvoq リンクのプロパティを編集してください。","Page title:":"ページのタイトル:","recent changes: %1":"最近の更新: %1","Display a link to a weblog. Use this form to edit the properties of the link.":"ウェブログへのリンクを表示します。このフォームを使用してリンクのプロパティを編集してください。","Error":"エラー","There are no optional properties for a user name.":"ユーザ名に関するオプショナルプロパティはありません。","user: %1":"ユーザ: %1","File attached to:":"ファイルの添付先:","Remove %1 from the queue":"キューから%1を削除","Please enter the number of table columns:":"表の列の数字を入力してください:","Display a link to a Yahoo! instant message ID. The icon will show whether the person is online. Clicking the link will start an IM conversation with the person if your IM client is properly configured. Use this form to edit the properties of the link.":"Yahoo! インスタントメッセージ ID へのリンクを表示します。相手がオンラインかどうかアイコンで表示されます。IM クライアントがきちんと設定されていれば、リンクをクリックすると IM で会話を開始することができます。このフォームを使用してリンクのプロパティを編集してください。","include: %1":"挿入: %1","Include unformatted text in the page. This text will not be treated as wiki text. Use this form to edit the text.":"ページにレイアウトなしのテキストを挿入します。このテキストには wiki 記法が適用されません。このフォームを使用してテキストを編集してください。","feed: %1":"フィード: %1","Attachment Link":"添付ファイルへのリンク","Convoq: %1":"Convoq: %1","Use this form to edit the properties of the link to a page section.":"このフォームを使用してページセクションへのリンクのプロパティを編集してください。","Bullets":"箇条書き","Display '%1' in reader's time zone. Click to edit.":"ユーザのタイムゾーンで '%1' を表示します。クリックして編集してください。","Attachments":"添付","Display a list of the most recent entries from a weblog in a workspace. By default only the weblog entry names are displayed. Use this form to edit the list properties.":"ワークスペースのウェブログから、最も最近のエントリ一覧を表示します。初期設定では、ウェブログのエントリ名のみが表示されます。このフォームを使用してリストのプロパティを編集してください。","Link to weblog '%1'. Click to edit.":"'%1' ウェブログへのリンク: クリックして編集してください。","You have unsaved changes. Are you sure you want to navigate away from this page? If you click 'OK', all edit changes will be lost. Click 'Cancel' if you want to save changes and stay on the current page.":"変更が保存されていません。 このページから離れますか？ 'OK' をクリックすると、すべての変更内容が失われます。変更を保存し、このページに残りたい場合は、'キャンセル' をクリックしてください。","Table & Advanced Editing":"表 & 高度編集","Google: %1":"Google: %1","Page Include":"ページの挿入","Link to a Section":"セクションへのリンク","Search for:":"検索するワード:","Search:":"検索:","Inter-workspace link":"ワークスペース間のリンク","Link text:":"リンクの文字:","Workspace:":"ワークスペース:","Page in:":"ページ:","Are you sure you want to delete this page?":"このページを本当に削除しますか？","Heading 6":"見出し6","Optional properties include link text, and the name of a different workspace for the tags.":"オプショナルプロパティで、リンクの文字、そのタグに対する別のワークスペース名を指定できます。","weblog: %1":"ウェブログ: %1","Attached Image":"添付画像","Watch this page":"このページをウォッチする","Display the weblog '%1'. Click to edit.":"ウェブログ '%1' を表示します。 クリックして編集してください。","section: %1":"セクション: %1","Page Title required if Workspace Id specified":"ワークスペース ID が指定されている場合は、ページのタイトルが 必要です。","Display the content of an RSS feed. Use this form to edit the properties of the inline RSS feed.":"RSS フィードの内容を表示します。このフォームを使用して インライン RSS フィードのプロパティを編集してください。","What's new in the '%1' workspace. Click to edit.":"'%1' ワークスペースの更新情報です。クリックして編集してください。","Add links to these attachments at the top of the page? Images will appear in the page.":"このページのトップにある添付にリンクを追加しますか？ ページに画像が表示されます。","There are no optional properties for an Atom feed.":"ATOM フィードに関するオプショナルプロパティはありません。","date: %1":"日: %1","New Form Page":"新しいフォームページ","AIM Link":"AIM リンク","Use Advanced Mode for %1":"%1 については高度編集モードを使用してください。","Enter a tag and click \\\"Add another tag\\\". The tag will be saved when you save the page.":"タグを入力し ”別のタグを追加” をクリックしてください。","Convoq Link":"Convoq リンク","Display result for searching '%1'. Click to edit.":"'%1' の検索結果を表示します。クリックして編集してください。","Pages tagged with":"でタグの付いたページ","Cancel":"キャンセル","Display the content of an Atom feed. Use this form to edit the properties of the inline Atom feed.":"Atom フィードの内容を表示します。このフォームを使用してインラインAtom フィードのプロパティを編集してください。","Requires one of: %1":"次から少なくとも 1つは必要です: %1","Optionally, specify that the page contents should be displayed.":"オプションとして、ページの内容を表示するように指定できます。","wiki text":"wiki テキスト","Display a link to a list of pages with a specific tag. Use this form to edit the properties of the link.":"特定のタグがついたページ一覧へのリンクを表示します。このフォームを使用してリンクのプロパティを編集してください。","Table Edit Tip":"表の編集のコツ","file: %1":"ファイル: %1","Pages in:":"ページ:","Unformatted Content":"レイアウトなしテキスト","You must specify a page name":"ページ名を指定してください。","Optional properties include the name of the workspace to search, whether to search in the page title, text or tags, and whether to display full results or just page titles.":"オプショナルプロパティで、検索するワークスペース名、また、ページタイトル、テキスト、タグのうち、どれで検索するのか指定できます。完全検索結果を表示させるか、ページタイトルのみを表示させるかも指定することができます。","Preview":"プレビュー","Include the weblog '%1'. Click to edit.":"'%1' ウェブログを挿入します。クリックして編集してください。","Add file":"ファイルを追加","Expand zip archives and attach individual files to the page?":"zip アーカイブを解凍し、個々のファイルをページに添付しますか？","Include the page '%1'. Click to edit.":"'%1' ページを挿入します。クリックして編集してください。","Heading 5":"見出し5","Optional properties include specifying a different page for the attachment, and link text.":"オプショナルプロパティで、添付するページ、リンクの文字を指定できます。","Display the results from a Google search. Use this form to edit the properties for the search.":"Google による検索結果を表示します。このフォームを使用して検索のプロパティを編集してください。","Skype Link":"Skype リンク","There are no optional properties for unformatted text.":"レイアウトなしのテキストに関するオプショナルプロパティはありません。","Optional properties include the title of another page to which the image is attached, and link text. If link text is specified then a link to the image is displayed instead of the image.":"オプショナルプロパティで、画像が添付されている別のページの名前、リンクの文字を指定できます。リンクの文字が指定されている場合は、画像ではなく、画像へのリンクが表示されます。","Unformatted":"レイアウトなしテキスト","Could not add page to watchlist":"ウォッチリストにページを追加することができませんでした。","Optional properties include the text to display for the link, and a target section within the linked page.":"オプショナルプロパティで、リンクの文字、リンク先のセクションを指定できます。","Link to '%1'. Click to edit.":"'%1' へのリンクです。 クリックして編集してください。","Add another tag":"別のタグを追加","Add another file":"別のファイルを追加","selection_start: %1":"selection_start: %1","Text":"テキスト","Headers and<br/>sections in:":"見出しと<br/>セクション:","Section name:":"セクション名:","Unformatted content:":"レイアウトなしテキスト:","Italic":"イタリック","AIM: %1":"AIM: %1","Save":"保存","the workspace named":"別のワークスペース","Yahoo! IM: %1":"Yahoo! IM: %1","'%1' is a required field":"'%1' は必要な項目です","You must check at least one page in order to create a Word document.":"Word文書を生成するためには少なくとも一つのページをチェックしなければいけません。","Insert...":"挿入 ...","Instant message to '%1' using AIM. Click to edit.":"'%1' への AIM インスタントメッセージです。クリックして編集してください。","Display what's new in the '%1' workspace. Click to edit.":"'%1' ワークスペースの更新情報を表示します。 クリックして編集してください。","toc":"目次","error -> \\\"%1\\\" is not a valid email address":"エラー -> \\\"%1\\\" は有効な Email アドレスではありません。","weblog list: %1":"ウェブログ一覧: %1","Yahoo! IM Link":"Yahoo! IM リンク","This is not an editable widget. Please edit it in advanced mode.":"この widget は編集できません。高度編集モードで編集してください。","Insert attachment":"添付の挿入","Skype: %1":"Skype: %1","There are no optional properties for an AIM link.":"AIM リンクに関するオプショナルプロパティはありません。","Untitled Page":"タイトルなし","Display a list of pages recently changed in a workspace. By default only the page titles are displayed. Use this form to edit the list properties.":"ワークスペースで最近変更があったページの一覧を表示します。初期設定では、ページのタイトルのみが表示されます。このフォームを使用してリストのプロパティを編集してください。","Horizontal Rule":"水平線","Click \\\"Browse\\\" to find the file you want to upload. When you click \\\"Add file,\\\" this file will be added to the list of attachments for this page, and uploaded when you save the page.":"\\\"参照\\\"をクリックし、アップロードしたいファイルを選択してください。\\\"ファイルを追加\\\" をクリックすると、このファイルがこのページの添付リストに追加され、ページを保存した時にアップロードされます。","Fewer options":"オプション >>","type link text here":"ここにリンクの文字をタイプしてください。","Use %1 to generate a form. Click to edit.":"%1 を使用してフォームを作成してください。クリックして編集してください。","tag: %1":"タグ: %1","Bold":"太字","\\\",\\\"":"\\\",\\\"","Files To upload:":"アップロードするファイル:","tag list: %1":"タグ一覧: %1","Add a link to this attachment at the top of the page? Images will appear in the page.":"このページのトップにある添付にリンクを追加しますか？ 添付ファイルが画像の場合は、、画像がページ内に表示されます。","Please select the text you would like to turn into a link.":"リンクに変換したいテキストを選択してください。","Display the full name for the given email address or user name. Use this form to edit the properties of the user name.":"与えられた Email アドレス、あるいは、ユーザ名に対してフルネームを表示します。このフォームを使用してユーザ名のプロパティを編集してください。","the page titled":"別のページ","More Indented":"インデントを増やす","More options":"他のオプション","Display the results for a Technorati search. Use this form to edit the properties for the search.":"Technorati による検索結果を表示します。このフォームを使用して検索のプロパティを編集してください。","Preformatted":"レイアウト表示","Full results:":"内容を表示:","Call '%1' using Convoq. Click to edit.":"'%1' と Convoq 通話を開始します。クリックして編集してください。","Images":"画像","Heading 4":"見出し4","Optionally, specify which page's headers and sections to use for the table of contents.":"オプションとして、どのページの見出しとセクションを目次に使用するか指定できます。","You must select one of the options or click cancel":"オプションの中から1つ選択するか、キャンセルをクリックしてください。","form: %1":"フォーム: %1","Table of contents for '%1'. Click to edit.":"'%1' の目次。クリックして編集してください。","About Wikiwyg":"Wikiwygにつぃて","Section marker '%1'. Click to edit.":"'%1' セクションマーカー。 クリックして編集してください。","Section Marker":"セクションマーカー","Yahoo! ID:":"Yahoo! ID:","There are no optional properties for a section marker.":"セクションマーカーに関するオプショナルプロパティはありません。","That doesn't appear to be a valid number.":"有効な数字のようではありません。","There are no optional properties for a new form page.":"新しいフォームページに関するオプショナルプロパティはありません。","Include the '%1' Atom feed. Click to edit.":"'%1' Atom フィードを挿入します。クリックして編集してください。","image: %1":"画像: %1","Display the given date and time in the individually-set time zone for each reader. Use this form to edit the date and time to be displayed":"各ユーザが個々に設定したタイムゾーンで日時を表示します。このフォームを使用して表示される日時を編集してください。","Replace this text with your own.":"このテキストを書き換えてください。","There are no optional properties for a date display.":"日時の表示に関するオプショナルプロパティはありません。","the current workspace":"現在のワークスペース","Tag name:":"タグ名:","Decrease Indent":"インデントを減らす","New search":"ワードを入力","\\\"%1\\\" is a reserved page name. Please use a different name":"\\\"%1\\\" は予約されたページ名です。別の名前を使用してください。","Use this form to edit the properties of the link.":"このフォームを使用してリンクのプロパティを編集してください。","Call '%1' using Skype. Click to edit.":"'%1' と Skype 通話を開始します。クリックして編集してください。","Optional properties include the text to display for the link, and the title of a different page.":"オプショナルプロパティで、リンクの文字、リンク先のページのタイトルを指定できます。","Advanced Mode":"高度編集モード","If you click 'OK', all edit changes will be lost!":"'OK'をクリックすると、すべての編集内容が失われます！","or":"あるいは","Strike Through":"取り消し線","Search Results":"検索結果","Insert web link":"外部リンクの作成","Add a section marker at the current cursor location. You can link to a section marker using a \\\"Section Link\\\". Use this form to edit the properties for the section marker.":"カーソルが今ある位置にセクションマーカーを追加します。 \\\"セクションリンク\\\" でセクションマーカーへリンクすることができます。このフォームを使用してセクションマーカーのプロパティを編集してください。","link: %1 (%2 )":"リンク: %1 (%2 )","link: %1":"リンク: %1","Less Indented":"インデントを減らす","There are no optional properties for an RSS feed.":"RSS フィードに関するオプショナルプロパティはありません。","search: %1":"検索: %1","Display image '%1'. Click to edit.":"画像 '%1' を表示します。クリックして編集してください。","Pages with the '%1' tag. Click to edit.":"'%1' タグの付いたページです。クリックして編集してください。","Other page in:":"別のページ:","Insert image":"画像の挿入","YYYY-MM-DD&nbsp;HH:MM:SS:":"YYYY-MM-DD&nbsp;HH:MM:SS:","No matches":"一致するページがありません。","Safari does not support simple mode editing":"Safari は簡易編集モードに対応していません。","Search Google for '%1'. Click to edit.":"Google で '%1' を検索する。 クリックして編集してください。","Expand zip archive and attach individual files to the page?":"zip アーカイブを解凍し、個々のファイルをページに添付しますか？","Add tag":"タグを追加","There are no optional properties for a Technorati search.":"Technorati リンクに関するオプショナルプロパティはありません。","AIM screen name:":"AIM スクリーンネーム:","Technorati Search":"Technorati 検索","What's New":"更新情報","There are no optional properties for a Skype link.":"Skype リンクに関するオプショナルプロパティはありません。","Inline Atom":"Atom のインライン","Optional properties include link text, and the name of a different workspace for the weblog.":"オプショナルプロパティには、リンクの文字、ワークスペース名があります。","Watching this page":"このページをウォッチ中","Normal Text":"ノーマルテキスト","Saving...":"保存中...","Weblog List":"ウェブログ一覧","Include the '%1' RSS feed. Click to edit.":"'%1' RSS フィードを挿入します。クリックして編集してください。","Form name:":"フォーム名:"},"zj":{"Could not retrieve the latest revision of the page":"cおうLd nお7 rえ7Rいえvえ 7hえ Lあ7えS7 rえvいsいおN おf 7Hえ pあgえ","Link to tag '%1'. Click to edit.":"lいnK 7お 7あg '%1'. cLいCk 7お えdい7.","Display the search results for the given phrase within a workspace. Use this form to edit the properties for the search.":"dいsPlあy 7Hえ sえあRcH RえSうL7S FおR 7hえ GいVえN PhRあSえ wい7HいN あ WおRkSpあcえ. うSえ 7HいS FおRm 7お えdい7 7Hえ pRおPえR7いえS FおR 7hえ SえあrCh.","Attachment filename:":"あ77あcHmえn7 FいLえNあMえ:","Search Technorati for '%1'. Click to edit.":"sえあRcH 7えChNおRあ7い fおr '%1'. cLいCk 7お えdい7.","Switch to %1 to use this feature.":"sWい7cH 7お %1 7お うSえ 7HいS Fえあ7うrえ.","Page title is too long after URL encoding":"pあgえ 7い7lえ いs 7おお lおnG あf7えR うrL えnCおDいNg","Search for '%1'. Click to edit.":"sえあRcH FおR '%1'. ClいcK 7お えDい7.","User Name":"うSえR NあMえ","Create Table":"cRえあ7え 7あ8lえ","Link to Attachment":"lいnK 7お あ77あcHmえn7","Can't have a 0 for a size.":"cあn'7 hあvえ あ 0 FおR あ SいZえ.","You have unsaved changes. Are you sure you want to navigate away from this page? If you click 'OK', all edit changes will be lost. Click 'Cancel' if you want to stay on the current page.":"yおう hあvえ うnSあVえD ChあnGえS. あRえ yおう sうrえ Yおう WあN7 7お NあVいGあ7え あWあY Frおm 7HいS PあGえ? いf yおう cLいCk 'おk', あLl えDい7 ChあnGえS WいLl 8え LおS7. ClいcK 'cあnCえL' いF Yおう WあN7 7お S7あy おN 7hえ CうRrえn7 PあGえ.","There are no optional properties for a Convoq Link.":"7HえRえ あRえ nお おp7いおnあl pRおPえR7いえS FおR あ CおNvおq lいnK.","Display a link to a file attached to a page. Use this form to edit the properities of the link.":"dいsPlあy あ lいnK 7お あ fいlえ あ77あChえd 7お あ PあGえ. うsえ 7hいs fおrM 7お えDい7 7hえ Prおpえrい7いえS おf 7Hえ lいnK.","Loading...":"lおあDいNg...","Edit More":"えDい7 MおRえ","'%1' has an invalid value":"'%1' HあS あn いNvあlいd vあlうえ","recent changes":"rえcえn7 ChあnGえS","You cannot compare a revision to itself.":"yおう cあnNお7 CおMpあrえ あ RえVいSいおn 7お い7SえLf.","Inline RSS":"いNlいnえ RsS","In:":"いN:","Display a table of contents for a page. Each header or section on the page is listed as a link in the table of contents. Click \\\"Save\\\" now, or click \\\"More options\\\" to edit the properties for the table of contents.":"dいsPlあy あ 7あ8Lえ おF CおN7えn7s fおr あ pあgえ. えあcH Hえあdえr おR SえC7いおN おn 7Hえ pあgえ いs lいs7えD あs あ lいnK いn 7Hえ 7あ8Lえ おF CおN7えn7s. ClいcK \\\"SあVえ\\\" nおw, おr cLいCk \\\"mおrえ おp7いおnS\\\" 7お えDい7 7hえ Prおpえr7いえs fおr 7Hえ 7あ8Lえ おF CおN7えn7s.","Table of Contents":"7あ8Lえ おF CおN7えn7s","Enter a tag and click \\\"Add tag\\\". The tag will be saved when you save the page.":"えN7えr あ 7あg あNd cLいCk \\\"あDd 7あg\\\". 7hえ 7あG WいLl 8え SあVえD Whえn yおう sあvえ 7hえ PあGえ.","Optional properties include specifying which workspace to use and whether to display page titles or whole pages.":"おP7いおNあL Prおpえr7いえs いNcLうDえ sPえCいFyいnG WhいcH WおRkSpあcえ 7お うSえ あNd wHえ7hえr 7お DいSpLあY PあGえ 7い7LえS おr wHおLえ pあgえs.","RSS feed URL:":"rSs fええD うrL:","No tag entered":"nお 7あG えn7えRえD","error -> To send email, you must specify a recipient":"えRrおr -> 7お sえnD えmあいL, yおう mうs7 SpえcいfY あ RえCいPいえn7","Advanced content is shown inside a grey border. Switch to %1 to edit areas inside a grey border.":"あDvあnCえD CおN7えn7 いs sHおWn いNsいdえ あ Grえy 8おrDえR. sWい7cH 7お %1 7お えDい7 あrえあS いnSいDえ あ gRえY 8おRdえr.","Could not remove page from watchlist":"cおうLd nお7 rえmおvえ PあGえ fRおM Wあ7cHlいs7","Display the contents of another page within the current page. Use this form to edit the properties for the page include.":"dいsPlあy 7Hえ cおn7えN7S おf あNお7hえr pあgえ Wい7hいn 7Hえ cうrRえN7 pあgえ. うSえ 7HいS FおRm 7お えdい7 7Hえ pRおPえR7いえS FおR 7hえ PあGえ いNcLうDえ.","Unlink":"うNlいnK","Heading 1":"hえあDいNg 1","Search term:":"sえあRcH 7えRm:","Atom feed URL:":"あ7おM Fええd うRl:","Link to '%1' in '%2'. Click to edit.":"lいnK 7お '%1' いn '%2'. cLいCk 7お えdい7.","There are no optional properties for page include.":"7HえRえ あRえ nお おp7いおnあl pRおPえR7いえS FおR PあGえ いNcLうDえ.","Insert table":"いNsえr7 7あ8lえ","Link to file '%1'. Click to edit.":"lいnK 7お fいlえ '%1'. ClいcK 7お えDい7.","page does not exist":"pあgえ Dおえs nお7 えXいS7","Display a link to an AIM screen name. The icon will show whether the person is online. Clicking the link will start an IM conversation with the person if your IM client is properly configured. Use this form to edit the properties of the link.":"dいsPlあy あ lいnK 7お あN あいM ScRええn nあmえ. 7Hえ いCおN WいLl sHおW Whえ7HえR 7hえ PえRsおn いS おnLいNえ. ClいcKいNg 7Hえ lいnK WいLl s7あR7 あN いm cおnVえRsあ7いおN Wい7h 7Hえ pえrSおN いf yおうR いm cLいえn7 いs pRおPえRlY CおNfいgうrえd. うsえ 7hいs fおrM 7お えDい7 7hえ Prおpえr7いえs おF 7hえ LいNk.","There are no optional properties for an Google search.":"7HえRえ あRえ nお おp7いおnあl pRおPえR7いえS FおR あn gおおGlえ SえあrCh.","Underline":"うNdえrLいNえ","Technorati: %1":"7えcHnおrあ7い: %1","Bulleted List":"8うlLえ7えD LいS7","Weblog Link":"wえ8LおG LいNk","Date in Local Time":"dあ7え いn lおcあl 7いmえ","Tag":"7あg","Display an image on this page. The image must be already uploaded as an attachment to this page or another page. Use this form to edit the properties of the displayed image.":"dいsPlあy あN いmあgえ おn 7HいS PあGえ. 7hえ いmあgえ MうS7 8え あlRえあdY うpLおあdえd あS あn あ77あcHmえn7 7お 7HいS PあGえ おR あnお7HえR PあGえ. うsえ 7hいs fおrM 7お えDい7 7hえ Prおpえr7いえs おF 7hえ DいSpLあYえD いmあgえ.","You must select two revisions to compare.":"yおう mうs7 SえLえC7 7Wお rえvいsいおNs 7お CおMpあrえ.","User's email:":"うSえR'S えmあいL:","Enter your destination url here:":"えN7えr yおうR DえS7いnあ7いおN うrL HえRえ:","Weblog on:":"wえ8LおG おn:","External Link":"えX7えrNあL LいNk","Use %1 to change the number of rows and columns in a table.":"うSえ %1 7お cHあNgえ 7hえ NうM8えr おF RおWs あNd cおlうmNs いN あ 7あ8lえ.","in:":"いN:","Display a link to a Skype name. Clicking the link will start a Skype call with the person if your Skype client is properly configured. Use this form to edit the properties of the link.":"dいsPlあy あ lいnK 7お あ sKyPえ nあmえ. cLいCkいnG 7hえ LいNk wいlL S7あr7 あ SkYpえ CあLl wい7H 7hえ PえRsおn いF Yおうr sKyPえ cLいえn7 いs pRおPえRlY CおNfいgうrえd. うsえ 7hいs fおrM 7お えDい7 7hえ Prおpえr7いえs おF 7hえ LいNk.","Title":"7い7Lえ","Tag List":"7あg lいs7","Other workspace:":"お7hえr wおrKsPあCえ:","That seems like a bit too large for a table.":"7Hあ7 SええmS LいKえ あ 8い7 7おお lあrGえ fおr あ 7あ8Lえ.","the current page":"7Hえ cうrRえN7 pあgえ","Tag Link":"7あg lいnK","Increase Indent":"いNcRえあsえ いnDえN7","%asis_content":"%あsいs_cおn7えN7","Advanced Content in Grey Border":"あDvあnCえD CおN7えn7 いn gRえY 8おRdえr","[Style]":"[S7Ylえ]","Display pages with the '%1' tag. Click to edit.":"dいsPlあy pあgえs wい7H 7hえ '%1' 7あg. ClいcK 7お えDい7.","Heading 3":"hえあDいNg 3","Please enter the number of table rows:":"pLえあsえ えn7えR 7hえ NうM8えr おF 7あ8lえ RおWs:","Strikethrough":"s7rいkえ7HrおうGh","Unexpected Widget >>%1<< in parseWidget":"うNえXpえc7えD WいDgえ7 >>%1<< いn pあrSえWいDgえ7","You have unsaved changes. Do you want to save those changes? If you click 'OK', all edit changes will be lost. Click 'Cancel' if you want to save changes before navigating away from this page.":"yおう hあvえ うnSあVえD ChあnGえS. dお Yおう WあN7 7お SあVえ 7HおSえ cHあNgえs? いf yおう cLいCk 'おk', あLl えDい7 ChあnGえS WいLl 8え LおS7. ClいcK 'cあnCえL' いF Yおう WあN7 7お SあVえ cHあNgえs 8えfおrえ NあVいGあ7いNg あWあY Frおm 7HいS PあGえ.","Show full name for '%1'. Click to edit.":"sHおW FうLl nあmえ FおR '%1'. ClいcK 7お えDい7.","Numbering":"nうm8えRいNg","Display a list of the most recently changed pages in a workspace that have a specific tag. By default only the page title is displayed. Use this form to edit the list properties.":"dいsPlあy あ lいs7 おf 7Hえ mおs7 RえCえN7Ly cHあNgえd pあgえs いN あ WおRkSpあcえ 7hあ7 hあvえ あ Spえcいfいc 7あg. 8y dえfあうL7 おNlY 7hえ PあGえ 7い7Lえ いS DいSpLあYえD. うSえ 7HいS FおRm 7お えdい7 7Hえ lいs7 Prおpえr7いえs.","Click \\\"Browse\\\" to find the file you want to upload. When you click \\\"Add another file,\\\" these files will be added to the list of attachments for this page, and uploaded when you save the page.":"cLいCk \\\"8RおWsえ\\\" 7お fいnD 7hえ FいLえ yおう wあn7 7お うPlおあD. wHえN Yおう ClいcK \\\"あdD あnお7HえR FいLえ,\\\" 7hえsえ FいLえS WいLl 8え あdDえD 7お 7Hえ lいs7 おf あ77あcHmえn7s fおr 7HいS PあGえ, あnD うpLおあdえd wHえN Yおう SあVえ 7Hえ pあgえ.","Heading 2":"hえあDいNg 2","Weblog name:":"wえ8LおG NあMえ:","There are no optional properties for a Yahoo! link.":"7HえRえ あRえ nお おp7いおnあl pRおPえR7いえS FおR あ YあHおお! lいnK.","Search type:":"sえあRcH 7yPえ:","Plese click \\\"Browse\\\" and select a file to upload.":"pLえSえ cLいCk \\\"8RおWsえ\\\" あnD SえLえC7 あ fいlえ 7お うPlおあD.","You must check at least one page in order to create a PDF.":"yおう mうs7 ChえcK あ7 lえあS7 おNえ pあgえ いn おRdえr 7お Crえあ7え あ pDf.","Skype name:":"sKyPえ nあmえ:","Select a form and generates a new form page.":"sえlえc7 あ FおRm あNd gえnえrあ7えs あ nえw fおrM PあGえ.","Include an Image":"いNcLうDえ あN いmあgえ","Create Link":"cRえあ7え LいNk","Optional parameters include specifying which workspace to use and whether to display page titles or whole pages.":"おP7いおNあL PあRあMえ7えRs いNcLうDえ sPえCいFyいnG WhいcH WおRkSpあcえ 7お うSえ あNd wHえ7hえr 7お DいSpLあY PあGえ 7い7LえS おr wHおLえ pあgえs.","Insert Socialtext link":"いNsえr7 SおCいあl7えX7 lいnK","Numbered List":"nうm8えRえD LいS7","Instant message to '%1' using Yahoo! Click to edit.":"いNs7あN7 mえsSあGえ 7お '%1' うSいNg yあhおお! ClいcK 7お えDい7.","Google Search":"gおおGlえ SえあrCh","Attached to:":"あ77あcHえD 7お:","unformatted: %1":"うNfおrMあ77えd: %1","toc: %1":"7おc: %1","Display a link to a Convoq name. Clicking the link will start a Convoq call with the person if your Convoq client is properly configured. Use this form to edit the properties of the Convoq link.":"dいsPlあy あ lいnK 7お あ cおnVおQ NあMえ. ClいcKいNg 7Hえ lいnK WいLl s7あR7 あ cおnVおQ CあLl wい7H 7hえ PえRsおn いF Yおうr cおnVおQ ClいえN7 いS PrおpえrLy cおnFいGうRえD. うSえ 7HいS FおRm 7お えdい7 7Hえ pRおPえR7いえS おf 7Hえ cおnVおQ LいNk.","Convoq name:":"cおnVおQ NあMえ:","recent changes: %1":"rえcえn7 ChあnGえS: %1","Page title:":"pあgえ 7い7lえ:","Display a link to a weblog. Use this form to edit the properties of the link.":"dいsPlあy あ lいnK 7お あ wえ8LおG. うSえ 7HいS FおRm 7お えdい7 7Hえ pRおPえR7いえS おf 7Hえ lいnK.","Error":"えRrおr","There are no optional properties for a user name.":"7HえRえ あRえ nお おp7いおnあl pRおPえR7いえS FおR あ うsえr nあmえ.","user: %1":"うSえR: %1","File attached to:":"fいlえ あ77あChえd 7お:","Remove %1 from the queue":"rえmおvえ %1 fRおM 7hえ Qうえうえ","Please enter the number of table columns:":"pLえあsえ えn7えR 7hえ NうM8えr おF 7あ8lえ CおLうMnS:","Display a link to a Yahoo! instant message ID. The icon will show whether the person is online. Clicking the link will start an IM conversation with the person if your IM client is properly configured. Use this form to edit the properties of the link.":"dいsPlあy あ lいnK 7お あ yあhおお! いnS7あn7 MえSsあgえ いd. 7hえ いcおn wいlL Shおw wHえ7hえr 7Hえ pえrSおN いs おNlいnえ. cLいCkいnG 7hえ LいNk wいlL S7あr7 あn いM CおNvえrSあ7いおn wい7H 7hえ PえRsおn いF Yおうr いM ClいえN7 いS PrおpえrLy cおnFいGうRえD. うSえ 7HいS FおRm 7お えdい7 7Hえ pRおPえR7いえS おf 7Hえ lいnK.","include: %1":"いNcLうDえ: %1","Include unformatted text in the page. This text will not be treated as wiki text. Use this form to edit the text.":"いNcLうDえ うNfおrMあ77えd 7えx7 いn 7Hえ pあgえ. 7HいS 7えX7 wいlL Nお7 8え 7Rえあ7えd あS WいKい 7えx7. うSえ 7HいS FおRm 7お えdい7 7Hえ 7えx7.","feed: %1":"fええD: %1","Attachment Link":"あ77あcHmえn7 LいNk","Use this form to edit the properties of the link to a page section.":"うSえ 7HいS FおRm 7お えdい7 7Hえ pRおPえR7いえS おf 7Hえ lいnK 7お あ pあgえ SえC7いおN.","Convoq: %1":"cおnVおQ: %1","Bullets":"8うlLえ7s","Display '%1' in reader's time zone. Click to edit.":"dいsPlあy '%1' いn rえあDえR'S 7いMえ zおnえ. cLいCk 7お えdい7.","Attachments":"あ77あcHmえn7s","Display a list of the most recent entries from a weblog in a workspace. By default only the weblog entry names are displayed. Use this form to edit the list properties.":"dいsPlあy あ lいs7 おf 7Hえ mおs7 RえCえN7 えN7Rいえs fRおM あ Wえ8lおg いN あ WおRkSpあcえ. 8Y DえFあうl7 おnLy 7Hえ wえ8LおG えn7rY NあMえS あrえ DいSpLあYえD. うSえ 7HいS FおRm 7お えdい7 7Hえ lいs7 Prおpえr7いえs.","You have unsaved changes. Are you sure you want to navigate away from this page? If you click 'OK', all edit changes will be lost. Click 'Cancel' if you want to save changes and stay on the current page.":"yおう hあvえ うnSあVえD ChあnGえS. あRえ yおう sうrえ Yおう WあN7 7お NあVいGあ7え あWあY Frおm 7HいS PあGえ? いf yおう cLいCk 'おk', あLl えDい7 ChあnGえS WいLl 8え LおS7. ClいcK 'cあnCえL' いF Yおう WあN7 7お SあVえ cHあNgえs あNd s7あY おn 7Hえ cうrRえN7 pあgえ.","Link to weblog '%1'. Click to edit.":"lいnK 7お wえ8LおG '%1'. ClいcK 7お えDい7.","Google: %1":"gおおGlえ: %1","Table & Advanced Editing":"7あ8Lえ & あDvあnCえD えdい7いnG","Link to a Section":"lいnK 7お あ sえc7いおn","Page Include":"pあgえ いnClうdえ","Search for:":"sえあRcH FおR:","Search:":"sえあRcH:","Inter-workspace link":"いN7えr-wおrKsPあCえ lいnK","Link text:":"lいnK 7えX7:","Workspace:":"wおrKsPあCえ:","Page in:":"pあgえ いn:","Are you sure you want to delete this page?":"あRえ yおう sうrえ Yおう WあN7 7お DえLえ7え 7HいS PあGえ?","Heading 6":"hえあDいNg 6","Optional properties include link text, and the name of a different workspace for the tags.":"おP7いおNあL Prおpえr7いえs いNcLうDえ lいnK 7えX7, あnD 7hえ NあMえ おF あ DいFfえrえn7 WおRkSpあcえ FおR 7hえ 7あGs.","weblog: %1":"wえ8LおG: %1","Attached Image":"あ77あcHえD いmあgえ","Watch this page":"wあ7Ch 7HいS PあGえ","Display the weblog '%1'. Click to edit.":"dいsPlあy 7Hえ wえ8LおG '%1'. ClいcK 7お えDい7.","section: %1":"sえc7いおn: %1","Page Title required if Workspace Id specified":"pあgえ 7い7lえ RえQういrえd いF WおRkSpあcえ いd sPえCいFいえd","Display the content of an RSS feed. Use this form to edit the properties of the inline RSS feed.":"dいsPlあy 7Hえ cおn7えN7 おF あn rSs fええD. うSえ 7HいS FおRm 7お えdい7 7Hえ pRおPえR7いえS おf 7Hえ いNlいnえ RsS Fええd.","What's new in the '%1' workspace. Click to edit.":"wHあ7'S NえW いn 7Hえ '%1' WおRkSpあcえ. cLいCk 7お えdい7.","Add links to these attachments at the top of the page? Images will appear in the page.":"あDd lいnKs 7お 7hえsえ あ77あChMえN7S あ7 7Hえ 7おp おF 7hえ PあGえ? いmあgえs wいlL あpPえあr いN 7hえ PあGえ.","There are no optional properties for an Atom feed.":"7HえRえ あRえ nお おp7いおnあl pRおPえR7いえS FおR あn あ7おM Fええd.","date: %1":"dあ7え: %1","New Form Page":"nえw fおrM PあGえ","AIM Link":"あいm lいnK","Use Advanced Mode for %1":"うSえ あDvあnCえD MおDえ fおr %1","Enter a tag and click \\\"Add another tag\\\". The tag will be saved when you save the page.":"えN7えr あ 7あg あNd cLいCk \\\"あDd あNお7hえr 7あg\\\". 7hえ 7あG WいLl 8え SあVえD Whえn yおう sあvえ 7hえ PあGえ.","Convoq Link":"cおnVおQ LいNk","Display result for searching '%1'. Click to edit.":"dいsPlあy rえsうl7 FおR SえあrChいnG '%1'. ClいcK 7お えDい7.","Pages tagged with":"pあgえs 7あgGえD Wい7h","Cancel":"cあnCえL","Display the content of an Atom feed. Use this form to edit the properties of the inline Atom feed.":"dいsPlあy 7Hえ cおn7えN7 おF あn あ7おM Fええd. うsえ 7hいs fおrM 7お えDい7 7hえ Prおpえr7いえs おF 7hえ いnLいNえ あ7おM Fええd.","Requires one of: %1":"rえqういRえS おnえ おf: %1","Optionally, specify that the page contents should be displayed.":"おP7いおNあLlY, sPえCいFy 7Hあ7 7hえ PあGえ cおn7えN7S ShおうLd 8え DいSpLあYえD.","Display a link to a list of pages with a specific tag. Use this form to edit the properties of the link.":"dいsPlあy あ lいnK 7お あ lいs7 おf pあgえs wい7H あ Spえcいfいc 7あg. うsえ 7hいs fおrM 7お えDい7 7hえ Prおpえr7いえs おF 7hえ LいNk.","wiki text":"wいkい 7えX7","Table Edit Tip":"7あ8Lえ えDい7 7いP","Pages in:":"pあgえs いN:","file: %1":"fいlえ: %1","Unformatted Content":"うNfおrMあ77えd cおn7えN7","You must specify a page name":"yおう mうs7 SpえcいfY あ PあGえ nあmえ","Optional properties include the name of the workspace to search, whether to search in the page title, text or tags, and whether to display full results or just page titles.":"おP7いおNあL Prおpえr7いえs いNcLうDえ 7Hえ nあmえ おf 7Hえ wおrKsPあCえ 7お SえあrCh, Whえ7HえR 7お sえあRcH いn 7Hえ pあgえ 7い7lえ, 7えx7 おr 7あgS, あNd wHえ7hえr 7お DいSpLあY FうLl rえsうl7s おR JうS7 pあgえ 7い7lえs.","Add file":"あDd fいlえ","Include the weblog '%1'. Click to edit.":"いNcLうDえ 7Hえ wえ8LおG '%1'. ClいcK 7お えDい7.","Preview":"pRえVいえw","Expand zip archives and attach individual files to the page?":"えXpあnD ZいP あrChいvえs あNd あ77あcH いnDいVいDうあl fいlえs 7お 7hえ PあGえ?","Include the page '%1'. Click to edit.":"いNcLうDえ 7Hえ pあgえ '%1'. ClいcK 7お えDい7.","Heading 5":"hえあDいNg 5","Optional properties include specifying a different page for the attachment, and link text.":"おP7いおNあL Prおpえr7いえs いNcLうDえ sPえCいFyいnG あ DいFfえrえn7 PあGえ fおr 7Hえ あ77あcHmえn7, あNd lいnK 7えX7.","Display the results from a Google search. Use this form to edit the properties for the search.":"dいsPlあy 7Hえ rえsうl7s fRおM あ GおおgLえ sえあRcH. うSえ 7HいS FおRm 7お えdい7 7Hえ pRおPえR7いえS FおR 7hえ SえあrCh.","Skype Link":"sKyPえ lいnK","There are no optional properties for unformatted text.":"7HえRえ あRえ nお おp7いおnあl pRおPえR7いえS FおR うnFおRmあ77えD 7えX7.","Optional properties include the title of another page to which the image is attached, and link text. If link text is specified then a link to the image is displayed instead of the image.":"おP7いおNあL Prおpえr7いえs いNcLうDえ 7Hえ 7い7Lえ おF あnお7HえR PあGえ 7お WhいcH 7hえ いmあgえ いs あ77あcHえD, あNd lいnK 7えX7. いf lいnK 7えX7 いS SpえcいfいえD 7hえn あ lいnK 7お 7Hえ いMあGえ いS DいSpLあYえD いnS7えあD おf 7Hえ いMあGえ.","Unformatted":"うNfおrMあ77えd","Could not add page to watchlist":"cおうLd nお7 あDd pあgえ 7お wあ7ChLいS7","Optional properties include the text to display for the link, and a target section within the linked page.":"おP7いおNあL Prおpえr7いえs いNcLうDえ 7Hえ 7えx7 7お dいsPlあy fおr 7Hえ lいnK, あNd あ 7あrGえ7 SえC7いおN Wい7hいn 7Hえ lいnKえD PあGえ.","Add another tag":"あDd あNお7hえr 7あg","Link to '%1'. Click to edit.":"lいnK 7お '%1'. cLいCk 7お えdい7.","Add another file":"あDd あNお7hえr fいlえ","selection_start: %1":"sえlえc7いおn_s7あR7: %1","Text":"7えx7","Section name:":"sえc7いおn nあmえ:","Headers and<br/>sections in:":"hえあDえRs あNd<8R/>sえc7いおnS いn:","Unformatted content:":"うNfおrMあ77えd cおn7えN7:","Italic":"い7あLいC","Save":"sあvえ","AIM: %1":"あいm: %1","Yahoo! IM: %1":"yあhおお! いm: %1","the workspace named":"7Hえ wおrKsPあCえ nあmえd","You must check at least one page in order to create a Word document.":"yおう mうs7 ChえcK あ7 lえあS7 おNえ pあgえ いn おRdえr 7お Crえあ7え あ wおrD DおCうMえN7.","'%1' is a required field":"'%1' いs あ rえqういRえD FいえlD","Instant message to '%1' using AIM. Click to edit.":"いNs7あN7 mえsSあGえ 7お '%1' うSいNg あいm. ClいcK 7お えDい7.","Insert...":"いNsえr7...","toc":"7おc","Display what's new in the '%1' workspace. Click to edit.":"dいsPlあy wHあ7'S NえW いn 7Hえ '%1' WおRkSpあcえ. cLいCk 7お えdい7.","error -> \\\"%1\\\" is not a valid email address":"えRrおr -> \\\"%1\\\" いS Nお7 あ VあLいD えmあいL あdDrえsS","Yahoo! IM Link":"yあhおお! いm lいnK","weblog list: %1":"wえ8LおG LいS7: %1","Insert attachment":"いNsえr7 あ77あChMえN7","This is not an editable widget. Please edit it in advanced mode.":"7HいS いs nお7 あN えdい7あ8Lえ wいdGえ7. pLえあsえ えdい7 い7 いn あDvあnCえD MおDえ.","Skype: %1":"sKyPえ: %1","There are no optional properties for an AIM link.":"7HえRえ あRえ nお おp7いおnあl pRおPえR7いえS FおR あn あいm lいnK.","Untitled Page":"うN7い7LえD PあGえ","Display a list of pages recently changed in a workspace. By default only the page titles are displayed. Use this form to edit the list properties.":"dいsPlあy あ lいs7 おf pあgえs rえcえn7lY ChあnGえD いn あ wおrKsPあCえ. 8y dえfあうL7 おNlY 7hえ PあGえ 7い7LえS あrえ DいSpLあYえD. うSえ 7HいS FおRm 7お えdい7 7Hえ lいs7 Prおpえr7いえs.","Horizontal Rule":"hおrいzおn7あL RうLえ","Click \\\"Browse\\\" to find the file you want to upload. When you click \\\"Add file,\\\" this file will be added to the list of attachments for this page, and uploaded when you save the page.":"cLいCk \\\"8RおWsえ\\\" 7お fいnD 7hえ FいLえ yおう wあn7 7お うPlおあD. wHえN Yおう ClいcK \\\"あdD FいLえ,\\\" 7hいs fいlえ WいLl 8え あdDえD 7お 7Hえ lいs7 おf あ77あcHmえn7s fおr 7HいS PあGえ, あnD うpLおあdえd wHえN Yおう SあVえ 7Hえ pあgえ.","Fewer options":"fえwえr おP7いおNs","type link text here":"7Ypえ LいNk 7えx7 HえRえ","Use %1 to generate a form. Click to edit.":"うSえ %1 7お gえnえrあ7え あ FおRm. ClいcK 7お えDい7.","tag: %1":"7あg: %1","Bold":"8おlD","Files To upload:":"fいlえs 7お うpLおあd:","\\\",\\\"":"\\\",\\\"","tag list: %1":"7あg lいs7: %1","Add a link to this attachment at the top of the page? Images will appear in the page.":"あDd あ lいnK 7お 7HいS あ77あChMえN7 あ7 7hえ 7おP おf 7Hえ pあgえ? いMあGえS WいLl あPpえあR いn 7Hえ pあgえ.","Please select the text you would like to turn into a link.":"pLえあsえ SえLえC7 7Hえ 7えx7 Yおう WおうlD LいKえ 7お 7うRn いN7お あ LいNk.","Display the full name for the given email address or user name. Use this form to edit the properties of the user name.":"dいsPlあy 7Hえ fうlL NあMえ fおr 7Hえ gいvえn えMあいl あDdRえSs おR うsえr nあmえ. うSえ 7HいS FおRm 7お えdい7 7Hえ pRおPえR7いえS おf 7Hえ うSえR NあMえ.","the page titled":"7Hえ pあgえ 7い7lえd","More options":"mおrえ おp7いおnS","More Indented":"mおrえ いnDえN7えd","Display the results for a Technorati search. Use this form to edit the properties for the search.":"dいsPlあy 7Hえ rえsうl7s fおr あ 7えcHnおrあ7い SえあrCh. うsえ 7hいs fおrM 7お えDい7 7hえ Prおpえr7いえs fおr 7Hえ sえあRcH.","Preformatted":"pRえFおRmあ77えD","Full results:":"fうlL RえSうL7S:","Call '%1' using Convoq. Click to edit.":"cあlL '%1' うSいNg cおnVおQ. cLいCk 7お えdい7.","Heading 4":"hえあDいNg 4","Images":"いMあGえS","Optionally, specify which page's headers and sections to use for the table of contents.":"おP7いおNあLlY, sPえCいFy wHいCh pあgえ'S HえあdえrS あnD SえC7いおNs 7お うsえ FおR 7hえ 7あ8lえ おf cおn7えN7S.","You must select one of the options or click cancel":"yおう mうs7 SえLえC7 おNえ おF 7hえ おp7いおnS おr cLいCk cあnCえL","form: %1":"fおrM: %1","About Wikiwyg":"あ8おう7 wいkいwYg","Table of contents for '%1'. Click to edit.":"7あ8Lえ おF CおN7えn7s fおr '%1'. cLいCk 7お えdい7.","Section marker '%1'. Click to edit.":"sえc7いおn mあrKえR '%1'. ClいcK 7お えDい7.","Yahoo! ID:":"yあhおお! いd:","Section Marker":"sえc7いおn mあrKえR","That doesn't appear to be a valid number.":"7Hあ7 DおえsN'7 あpPえあr 7お 8え あ vあlいd nうm8えR.","There are no optional properties for a section marker.":"7HえRえ あRえ nお おp7いおnあl pRおPえR7いえS FおR あ SえC7いおN MあRkえr.","There are no optional properties for a new form page.":"7HえRえ あRえ nお おp7いおnあl pRおPえR7いえS FおR あ NえW FおRm pあgえ.","image: %1":"いMあGえ: %1","Include the '%1' Atom feed. Click to edit.":"いNcLうDえ 7Hえ '%1' あ7おm fええD. cLいCk 7お えdい7.","Display the given date and time in the individually-set time zone for each reader. Use this form to edit the date and time to be displayed":"dいsPlあy 7Hえ gいvえn dあ7え あnD 7いMえ いN 7hえ いnDいVいDうあlLy-sえ7 7いmえ ZおNえ fおr えあcH Rえあdえr. うsえ 7hいs fおrM 7お えDい7 7hえ Dあ7え あNd 7いmえ 7お 8え DいSpLあYえD","Replace this text with your own.":"rえpLあCえ 7HいS 7えX7 wい7H Yおうr おWn.","There are no optional properties for a date display.":"7HえRえ あRえ nお おp7いおnあl pRおPえR7いえS FおR あ Dあ7え dいsPlあy.","the current workspace":"7Hえ cうrRえN7 wおrKsPあCえ","Decrease Indent":"dえcRえあsえ いnDえN7","Tag name:":"7あg nあmえ:","New search":"nえw sえあRcH","Use this form to edit the properties of the link.":"うSえ 7HいS FおRm 7お えdい7 7Hえ pRおPえR7いえS おf 7Hえ lいnK.","\\\"%1\\\" is a reserved page name. Please use a different name":"\\\"%1\\\" いs あ rえsえrVえD PあGえ nあmえ. pLえあsえ うsえ あ DいFfえrえn7 NあMえ","Call '%1' using Skype. Click to edit.":"cあlL '%1' うSいNg sKyPえ. ClいcK 7お えDい7.","Advanced Mode":"あDvあnCえD MおDえ","Optional properties include the text to display for the link, and the title of a different page.":"おP7いおNあL Prおpえr7いえs いNcLうDえ 7Hえ 7えx7 7お dいsPlあy fおr 7Hえ lいnK, あNd 7Hえ 7い7Lえ おF あ DいFfえrえn7 PあGえ.","Strike Through":"s7rいkえ 7hRおうgH","or":"おR","If you click 'OK', all edit changes will be lost!":"いF Yおう ClいcK 'おK', あlL えdい7 cHあNgえs wいlL 8え lおs7!","Search Results":"sえあRcH RえSうL7S","Insert web link":"いNsえr7 Wえ8 LいNk","Add a section marker at the current cursor location. You can link to a section marker using a \\\"Section Link\\\". Use this form to edit the properties for the section marker.":"あDd あ sえc7いおn mあrKえR あ7 7Hえ cうrRえN7 cうrSおR LおCあ7いおn. Yおう CあN LいNk 7お あ SえC7いおN MあRkえr うSいNg あ \\\"sえc7いおn lいnK\\\". うSえ 7HいS FおRm 7お えdい7 7Hえ pRおPえR7いえS FおR 7hえ SえC7いおN MあRkえr.","link: %1 (%2 )":"lいnK: %1 (%2 )","link: %1":"lいnK: %1","Less Indented":"lえsS いnDえN7えd","There are no optional properties for an RSS feed.":"7HえRえ あRえ nお おp7いおnあl pRおPえR7いえS FおR あn rSs fええD.","search: %1":"sえあRcH: %1","Display image '%1'. Click to edit.":"dいsPlあy いMあGえ '%1'. cLいCk 7お えdい7.","Pages with the '%1' tag. Click to edit.":"pあgえs wい7H 7hえ '%1' 7あg. ClいcK 7お えDい7.","Other page in:":"お7hえr pあgえ いn:","Insert image":"いNsえr7 いmあgえ","YYYY-MM-DD&nbsp;HH:MM:SS:":"yYyY-Mm-dD&N8Sp;hH:Mm:sS:","No matches":"nお Mあ7cHえS","Safari does not support simple mode editing":"sあfあrい Dおえs nお7 sうpPおR7 sいmPlえ MおDえ えDい7いNg","Search Google for '%1'. Click to edit.":"sえあRcH GおおgLえ fおr '%1'. cLいCk 7お えdい7.","Expand zip archive and attach individual files to the page?":"えXpあnD ZいP あrChいvえ あnD あ77あCh いNdいvいdうあL FいLえS 7お 7Hえ pあgえ?","Add tag":"あDd 7あg","There are no optional properties for a Technorati search.":"7HえRえ あRえ nお おp7いおnあl pRおPえR7いえS FおR あ 7えChNおRあ7い sえあRcH.","AIM screen name:":"あいm sCrええN NあMえ:","Technorati Search":"7えcHnおrあ7い SえあrCh","What's New":"wHあ7'S NえW","There are no optional properties for a Skype link.":"7HえRえ あRえ nお おp7いおnあl pRおPえR7いえS FおR あ SkYpえ LいNk.","Inline Atom":"いNlいnえ あ7おm","Optional properties include link text, and the name of a different workspace for the weblog.":"おP7いおNあL Prおpえr7いえs いNcLうDえ lいnK 7えX7, あnD 7hえ NあMえ おF あ DいFfえrえn7 WおRkSpあcえ FおR 7hえ Wえ8lおg.","Watching this page":"wあ7ChいnG 7hいs pあgえ","Normal Text":"nおrMあL 7えX7","Saving...":"sあvいnG...","Weblog List":"wえ8LおG LいS7","Include the '%1' RSS feed. Click to edit.":"いNcLうDえ 7Hえ '%1' RsS Fええd. ClいcK 7お えDい7.","Form name:":"fおrM NあMえ:"},"zz":{"Could not retrieve the latest revision of the page":"c0uLd n07 r37Ri3v3 7h3 L473S7 r3vIsI0N 0f 7H3 p4g3","Link to tag '%1'. Click to edit.":"lInK 70 74g '%1'. cLiCk 70 3dI7.","Display the search results for the given phrase within a workspace. Use this form to edit the properties for the search.":"dIsPl4y 7H3 s34RcH R3SuL7S F0R 7h3 GiV3N PhR4S3 wI7HiN 4 W0RkSp4c3. uS3 7HiS F0Rm 70 3dI7 7H3 pR0P3R7I3S F0R 7h3 S34rCh.","Attachment filename:":"4774cHm3n7 FiL3N4M3:","Search Technorati for '%1'. Click to edit.":"s34RcH 73ChN0R47i f0r '%1'. cLiCk 70 3dI7.","Switch to %1 to use this feature.":"sWi7cH 70 %1 70 uS3 7HiS F347Ur3.","Page title is too long after URL encoding":"p4g3 7i7l3 Is 700 l0nG 4f73R UrL 3nC0DiNg","Search for '%1'. Click to edit.":"s34RcH F0R '%1'. ClIcK 70 3Di7.","User Name":"uS3R N4M3","Create Table":"cR3473 748l3","Link to Attachment":"lInK 70 4774cHm3n7","Can't have a 0 for a size.":"c4n'7 h4v3 4 0 F0R 4 SiZ3.","You have unsaved changes. Are you sure you want to navigate away from this page? If you click 'OK', all edit changes will be lost. Click 'Cancel' if you want to stay on the current page.":"y0u h4v3 UnS4V3D Ch4nG3S. 4R3 y0u sUr3 Y0U W4N7 70 N4ViG473 4W4Y Fr0m 7HiS P4G3? If y0u cLiCk '0k', 4Ll 3Di7 Ch4nG3S WiLl 83 L0S7. ClIcK 'c4nC3L' iF Y0U W4N7 70 S74y 0N 7h3 CuRr3n7 P4G3.","There are no optional properties for a Convoq Link.":"7H3R3 4R3 n0 0p7i0n4l pR0P3R7I3S F0R 4 C0Nv0q lInK.","Display a link to a file attached to a page. Use this form to edit the properities of the link.":"dIsPl4y 4 lInK 70 4 fIl3 4774Ch3d 70 4 P4G3. Us3 7hIs f0rM 70 3Di7 7h3 Pr0p3rI7I3S 0f 7H3 lInK.","Loading...":"l04DiNg...","Edit More":"3Di7 M0R3","'%1' has an invalid value":"'%1' H4S 4n iNv4lId v4lU3","recent changes":"r3c3n7 Ch4nG3S","You cannot compare a revision to itself.":"y0u c4nN07 C0Mp4r3 4 R3ViSi0n 70 I7S3Lf.","Inline RSS":"iNlIn3 RsS","In:":"iN:","Display a table of contents for a page. Each header or section on the page is listed as a link in the table of contents. Click \\\"Save\\\" now, or click \\\"More options\\\" to edit the properties for the table of contents.":"dIsPl4y 4 748L3 0F C0N73n7s f0r 4 p4g3. 34cH H34d3r 0R S3C7I0N 0n 7H3 p4g3 Is lIs73D 4s 4 lInK In 7H3 748L3 0F C0N73n7s. ClIcK \\\"S4V3\\\" n0w, 0r cLiCk \\\"m0r3 0p7i0nS\\\" 70 3Di7 7h3 Pr0p3r7i3s f0r 7H3 748L3 0F C0N73n7s.","Table of Contents":"748L3 0F C0N73n7s","Enter a tag and click \\\"Add tag\\\". The tag will be saved when you save the page.":"3N73r 4 74g 4Nd cLiCk \\\"4Dd 74g\\\". 7h3 74G WiLl 83 S4V3D Wh3n y0u s4v3 7h3 P4G3.","Optional properties include specifying which workspace to use and whether to display page titles or whole pages.":"0P7I0N4L Pr0p3r7i3s iNcLuD3 sP3CiFyInG WhIcH W0RkSp4c3 70 uS3 4Nd wH37h3r 70 DiSpL4Y P4G3 7I7L3S 0r wH0L3 p4g3s.","RSS feed URL:":"rSs f33D UrL:","No tag entered":"n0 74G 3n73R3D","error -> To send email, you must specify a recipient":"3Rr0r -> 70 s3nD 3m4iL, y0u mUs7 Sp3cIfY 4 R3CiPi3n7","Advanced content is shown inside a grey border. Switch to %1 to edit areas inside a grey border.":"4Dv4nC3D C0N73n7 Is sH0Wn iNsId3 4 Gr3y 80rD3R. sWi7cH 70 %1 70 3Di7 4r34S InSiD3 4 gR3Y 80Rd3r.","Could not remove page from watchlist":"c0uLd n07 r3m0v3 P4G3 fR0M W47cHlIs7","Display the contents of another page within the current page. Use this form to edit the properties for the page include.":"dIsPl4y 7H3 c0n73N7S 0f 4N07h3r p4g3 Wi7hIn 7H3 cUrR3N7 p4g3. uS3 7HiS F0Rm 70 3dI7 7H3 pR0P3R7I3S F0R 7h3 P4G3 iNcLuD3.","Unlink":"uNlInK","Heading 1":"h34DiNg 1","Search term:":"s34RcH 73Rm:","Atom feed URL:":"470M F33d uRl:","Link to '%1' in '%2'. Click to edit.":"lInK 70 '%1' In '%2'. cLiCk 70 3dI7.","There are no optional properties for page include.":"7H3R3 4R3 n0 0p7i0n4l pR0P3R7I3S F0R P4G3 iNcLuD3.","Insert table":"iNs3r7 748l3","Link to file '%1'. Click to edit.":"lInK 70 fIl3 '%1'. ClIcK 70 3Di7.","page does not exist":"p4g3 D03s n07 3XiS7","Display a link to an AIM screen name. The icon will show whether the person is online. Clicking the link will start an IM conversation with the person if your IM client is properly configured. Use this form to edit the properties of the link.":"dIsPl4y 4 lInK 70 4N 4iM ScR33n n4m3. 7H3 iC0N WiLl sH0W Wh37H3R 7h3 P3Rs0n iS 0nLiN3. ClIcKiNg 7H3 lInK WiLl s74R7 4N Im c0nV3Rs47I0N Wi7h 7H3 p3rS0N If y0uR Im cLi3n7 Is pR0P3RlY C0NfIgUr3d. Us3 7hIs f0rM 70 3Di7 7h3 Pr0p3r7i3s 0F 7h3 LiNk.","There are no optional properties for an Google search.":"7H3R3 4R3 n0 0p7i0n4l pR0P3R7I3S F0R 4n g00Gl3 S34rCh.","Underline":"uNd3rLiN3","Technorati: %1":"73cHn0r47I: %1","Bulleted List":"8UlL373D LiS7","Weblog Link":"w38L0G LiNk","Date in Local Time":"d473 In l0c4l 7Im3","Tag":"74g","Display an image on this page. The image must be already uploaded as an attachment to this page or another page. Use this form to edit the properties of the displayed image.":"dIsPl4y 4N Im4g3 0n 7HiS P4G3. 7h3 Im4g3 MuS7 83 4lR34dY UpL04d3d 4S 4n 4774cHm3n7 70 7HiS P4G3 0R 4n07H3R P4G3. Us3 7hIs f0rM 70 3Di7 7h3 Pr0p3r7i3s 0F 7h3 DiSpL4Y3D Im4g3.","You must select two revisions to compare.":"y0u mUs7 S3L3C7 7W0 r3vIsI0Ns 70 C0Mp4r3.","User's email:":"uS3R'S 3m4iL:","Enter your destination url here:":"3N73r y0uR D3S7In47I0N UrL H3R3:","Weblog on:":"w38L0G 0n:","External Link":"3X73rN4L LiNk","Use %1 to change the number of rows and columns in a table.":"uS3 %1 70 cH4Ng3 7h3 NuM83r 0F R0Ws 4Nd c0lUmNs iN 4 748l3.","in:":"iN:","Display a link to a Skype name. Clicking the link will start a Skype call with the person if your Skype client is properly configured. Use this form to edit the properties of the link.":"dIsPl4y 4 lInK 70 4 sKyP3 n4m3. cLiCkInG 7h3 LiNk wIlL S74r7 4 SkYp3 C4Ll wI7H 7h3 P3Rs0n iF Y0Ur sKyP3 cLi3n7 Is pR0P3RlY C0NfIgUr3d. Us3 7hIs f0rM 70 3Di7 7h3 Pr0p3r7i3s 0F 7h3 LiNk.","Title":"7I7L3","Tag List":"74g lIs7","Other workspace:":"07h3r w0rKsP4C3:","That seems like a bit too large for a table.":"7H47 S33mS LiK3 4 8I7 700 l4rG3 f0r 4 748L3.","the current page":"7H3 cUrR3N7 p4g3","Tag Link":"74g lInK","Increase Indent":"iNcR34s3 InD3N7","%asis_content":"%4sIs_c0n73N7","Advanced Content in Grey Border":"4Dv4nC3D C0N73n7 In gR3Y 80Rd3r","[Style]":"[S7Yl3]","Display pages with the '%1' tag. Click to edit.":"dIsPl4y p4g3s wI7H 7h3 '%1' 74g. ClIcK 70 3Di7.","Heading 3":"h34DiNg 3","Please enter the number of table rows:":"pL34s3 3n73R 7h3 NuM83r 0F 748l3 R0Ws:","Strikethrough":"s7rIk37Hr0uGh","Unexpected Widget >>%1<< in parseWidget":"uN3Xp3c73D WiDg37 >>%1<< In p4rS3WiDg37","You have unsaved changes. Do you want to save those changes? If you click 'OK', all edit changes will be lost. Click 'Cancel' if you want to save changes before navigating away from this page.":"y0u h4v3 UnS4V3D Ch4nG3S. d0 Y0U W4N7 70 S4V3 7H0S3 cH4Ng3s? If y0u cLiCk '0k', 4Ll 3Di7 Ch4nG3S WiLl 83 L0S7. ClIcK 'c4nC3L' iF Y0U W4N7 70 S4V3 cH4Ng3s 83f0r3 N4ViG47iNg 4W4Y Fr0m 7HiS P4G3.","Show full name for '%1'. Click to edit.":"sH0W FuLl n4m3 F0R '%1'. ClIcK 70 3Di7.","Numbering":"nUm83RiNg","Display a list of the most recently changed pages in a workspace that have a specific tag. By default only the page title is displayed. Use this form to edit the list properties.":"dIsPl4y 4 lIs7 0f 7H3 m0s7 R3C3N7Ly cH4Ng3d p4g3s iN 4 W0RkSp4c3 7h47 h4v3 4 Sp3cIfIc 74g. 8y d3f4uL7 0NlY 7h3 P4G3 7I7L3 iS DiSpL4Y3D. uS3 7HiS F0Rm 70 3dI7 7H3 lIs7 Pr0p3r7i3s.","Click \\\"Browse\\\" to find the file you want to upload. When you click \\\"Add another file,\\\" these files will be added to the list of attachments for this page, and uploaded when you save the page.":"cLiCk \\\"8R0Ws3\\\" 70 fInD 7h3 FiL3 y0u w4n7 70 uPl04D. wH3N Y0U ClIcK \\\"4dD 4n07H3R FiL3,\\\" 7h3s3 FiL3S WiLl 83 4dD3D 70 7H3 lIs7 0f 4774cHm3n7s f0r 7HiS P4G3, 4nD UpL04d3d wH3N Y0U S4V3 7H3 p4g3.","Heading 2":"h34DiNg 2","Weblog name:":"w38L0G N4M3:","There are no optional properties for a Yahoo! link.":"7H3R3 4R3 n0 0p7i0n4l pR0P3R7I3S F0R 4 Y4H00! lInK.","Search type:":"s34RcH 7yP3:","Plese click \\\"Browse\\\" and select a file to upload.":"pL3S3 cLiCk \\\"8R0Ws3\\\" 4nD S3L3C7 4 fIl3 70 uPl04D.","You must check at least one page in order to create a PDF.":"y0u mUs7 Ch3cK 47 l34S7 0N3 p4g3 In 0Rd3r 70 Cr3473 4 pDf.","Skype name:":"sKyP3 n4m3:","Select a form and generates a new form page.":"s3l3c7 4 F0Rm 4Nd g3n3r473s 4 n3w f0rM P4G3.","Include an Image":"iNcLuD3 4N Im4g3","Create Link":"cR3473 LiNk","Optional parameters include specifying which workspace to use and whether to display page titles or whole pages.":"0P7I0N4L P4R4M373Rs iNcLuD3 sP3CiFyInG WhIcH W0RkSp4c3 70 uS3 4Nd wH37h3r 70 DiSpL4Y P4G3 7I7L3S 0r wH0L3 p4g3s.","Insert Socialtext link":"iNs3r7 S0Ci4l73X7 lInK","Numbered List":"nUm83R3D LiS7","Instant message to '%1' using Yahoo! Click to edit.":"iNs74N7 m3sS4G3 70 '%1' uSiNg y4h00! ClIcK 70 3Di7.","Google Search":"g00Gl3 S34rCh","Attached to:":"4774cH3D 70:","unformatted: %1":"uNf0rM4773d: %1","toc: %1":"70c: %1","Display a link to a Convoq name. Clicking the link will start a Convoq call with the person if your Convoq client is properly configured. Use this form to edit the properties of the Convoq link.":"dIsPl4y 4 lInK 70 4 c0nV0Q N4M3. ClIcKiNg 7H3 lInK WiLl s74R7 4 c0nV0Q C4Ll wI7H 7h3 P3Rs0n iF Y0Ur c0nV0Q ClI3N7 iS Pr0p3rLy c0nFiGuR3D. uS3 7HiS F0Rm 70 3dI7 7H3 pR0P3R7I3S 0f 7H3 c0nV0Q LiNk.","Convoq name:":"c0nV0Q N4M3:","recent changes: %1":"r3c3n7 Ch4nG3S: %1","Page title:":"p4g3 7i7l3:","Display a link to a weblog. Use this form to edit the properties of the link.":"dIsPl4y 4 lInK 70 4 w38L0G. uS3 7HiS F0Rm 70 3dI7 7H3 pR0P3R7I3S 0f 7H3 lInK.","Error":"3Rr0r","There are no optional properties for a user name.":"7H3R3 4R3 n0 0p7i0n4l pR0P3R7I3S F0R 4 Us3r n4m3.","user: %1":"uS3R: %1","File attached to:":"fIl3 4774Ch3d 70:","Remove %1 from the queue":"r3m0v3 %1 fR0M 7h3 Qu3u3","Please enter the number of table columns:":"pL34s3 3n73R 7h3 NuM83r 0F 748l3 C0LuMnS:","Display a link to a Yahoo! instant message ID. The icon will show whether the person is online. Clicking the link will start an IM conversation with the person if your IM client is properly configured. Use this form to edit the properties of the link.":"dIsPl4y 4 lInK 70 4 y4h00! InS74n7 M3Ss4g3 Id. 7h3 Ic0n wIlL Sh0w wH37h3r 7H3 p3rS0N Is 0NlIn3. cLiCkInG 7h3 LiNk wIlL S74r7 4n iM C0Nv3rS47i0n wI7H 7h3 P3Rs0n iF Y0Ur iM ClI3N7 iS Pr0p3rLy c0nFiGuR3D. uS3 7HiS F0Rm 70 3dI7 7H3 pR0P3R7I3S 0f 7H3 lInK.","include: %1":"iNcLuD3: %1","Include unformatted text in the page. This text will not be treated as wiki text. Use this form to edit the text.":"iNcLuD3 uNf0rM4773d 73x7 In 7H3 p4g3. 7HiS 73X7 wIlL N07 83 7R3473d 4S WiKi 73x7. uS3 7HiS F0Rm 70 3dI7 7H3 73x7.","feed: %1":"f33D: %1","Attachment Link":"4774cHm3n7 LiNk","Use this form to edit the properties of the link to a page section.":"uS3 7HiS F0Rm 70 3dI7 7H3 pR0P3R7I3S 0f 7H3 lInK 70 4 p4g3 S3C7I0N.","Convoq: %1":"c0nV0Q: %1","Bullets":"8UlL37s","Display '%1' in reader's time zone. Click to edit.":"dIsPl4y '%1' In r34D3R'S 7iM3 z0n3. cLiCk 70 3dI7.","Attachments":"4774cHm3n7s","Display a list of the most recent entries from a weblog in a workspace. By default only the weblog entry names are displayed. Use this form to edit the list properties.":"dIsPl4y 4 lIs7 0f 7H3 m0s7 R3C3N7 3N7Ri3s fR0M 4 W38l0g iN 4 W0RkSp4c3. 8Y D3F4Ul7 0nLy 7H3 w38L0G 3n7rY N4M3S 4r3 DiSpL4Y3D. uS3 7HiS F0Rm 70 3dI7 7H3 lIs7 Pr0p3r7i3s.","You have unsaved changes. Are you sure you want to navigate away from this page? If you click 'OK', all edit changes will be lost. Click 'Cancel' if you want to save changes and stay on the current page.":"y0u h4v3 UnS4V3D Ch4nG3S. 4R3 y0u sUr3 Y0U W4N7 70 N4ViG473 4W4Y Fr0m 7HiS P4G3? If y0u cLiCk '0k', 4Ll 3Di7 Ch4nG3S WiLl 83 L0S7. ClIcK 'c4nC3L' iF Y0U W4N7 70 S4V3 cH4Ng3s 4Nd s74Y 0n 7H3 cUrR3N7 p4g3.","Link to weblog '%1'. Click to edit.":"lInK 70 w38L0G '%1'. ClIcK 70 3Di7.","Google: %1":"g00Gl3: %1","Table & Advanced Editing":"748L3 & 4Dv4nC3D 3dI7InG","Link to a Section":"lInK 70 4 s3c7i0n","Page Include":"p4g3 InClUd3","Search for:":"s34RcH F0R:","Search:":"s34RcH:","Inter-workspace link":"iN73r-w0rKsP4C3 lInK","Link text:":"lInK 73X7:","Workspace:":"w0rKsP4C3:","Page in:":"p4g3 In:","Are you sure you want to delete this page?":"4R3 y0u sUr3 Y0U W4N7 70 D3L373 7HiS P4G3?","Heading 6":"h34DiNg 6","Optional properties include link text, and the name of a different workspace for the tags.":"0P7I0N4L Pr0p3r7i3s iNcLuD3 lInK 73X7, 4nD 7h3 N4M3 0F 4 DiFf3r3n7 W0RkSp4c3 F0R 7h3 74Gs.","weblog: %1":"w38L0G: %1","Attached Image":"4774cH3D Im4g3","Watch this page":"w47Ch 7HiS P4G3","Display the weblog '%1'. Click to edit.":"dIsPl4y 7H3 w38L0G '%1'. ClIcK 70 3Di7.","section: %1":"s3c7i0n: %1","Page Title required if Workspace Id specified":"p4g3 7i7l3 R3QuIr3d iF W0RkSp4c3 Id sP3CiFi3d","Display the content of an RSS feed. Use this form to edit the properties of the inline RSS feed.":"dIsPl4y 7H3 c0n73N7 0F 4n rSs f33D. uS3 7HiS F0Rm 70 3dI7 7H3 pR0P3R7I3S 0f 7H3 iNlIn3 RsS F33d.","What's new in the '%1' workspace. Click to edit.":"wH47'S N3W In 7H3 '%1' W0RkSp4c3. cLiCk 70 3dI7.","Add links to these attachments at the top of the page? Images will appear in the page.":"4Dd lInKs 70 7h3s3 4774ChM3N7S 47 7H3 70p 0F 7h3 P4G3? Im4g3s wIlL 4pP34r iN 7h3 P4G3.","There are no optional properties for an Atom feed.":"7H3R3 4R3 n0 0p7i0n4l pR0P3R7I3S F0R 4n 470M F33d.","date: %1":"d473: %1","New Form Page":"n3w f0rM P4G3","AIM Link":"4Im lInK","Use Advanced Mode for %1":"uS3 4Dv4nC3D M0D3 f0r %1","Enter a tag and click \\\"Add another tag\\\". The tag will be saved when you save the page.":"3N73r 4 74g 4Nd cLiCk \\\"4Dd 4N07h3r 74g\\\". 7h3 74G WiLl 83 S4V3D Wh3n y0u s4v3 7h3 P4G3.","Convoq Link":"c0nV0Q LiNk","Display result for searching '%1'. Click to edit.":"dIsPl4y r3sUl7 F0R S34rChInG '%1'. ClIcK 70 3Di7.","Pages tagged with":"p4g3s 74gG3D Wi7h","Cancel":"c4nC3L","Display the content of an Atom feed. Use this form to edit the properties of the inline Atom feed.":"dIsPl4y 7H3 c0n73N7 0F 4n 470M F33d. Us3 7hIs f0rM 70 3Di7 7h3 Pr0p3r7i3s 0F 7h3 InLiN3 470M F33d.","Requires one of: %1":"r3qUiR3S 0n3 0f: %1","Optionally, specify that the page contents should be displayed.":"0P7I0N4LlY, sP3CiFy 7H47 7h3 P4G3 c0n73N7S Sh0uLd 83 DiSpL4Y3D.","Display a link to a list of pages with a specific tag. Use this form to edit the properties of the link.":"dIsPl4y 4 lInK 70 4 lIs7 0f p4g3s wI7H 4 Sp3cIfIc 74g. Us3 7hIs f0rM 70 3Di7 7h3 Pr0p3r7i3s 0F 7h3 LiNk.","wiki text":"wIkI 73X7","Table Edit Tip":"748L3 3Di7 7iP","Pages in:":"p4g3s iN:","file: %1":"fIl3: %1","Unformatted Content":"uNf0rM4773d c0n73N7","You must specify a page name":"y0u mUs7 Sp3cIfY 4 P4G3 n4m3","Optional properties include the name of the workspace to search, whether to search in the page title, text or tags, and whether to display full results or just page titles.":"0P7I0N4L Pr0p3r7i3s iNcLuD3 7H3 n4m3 0f 7H3 w0rKsP4C3 70 S34rCh, Wh37H3R 70 s34RcH In 7H3 p4g3 7i7l3, 73x7 0r 74gS, 4Nd wH37h3r 70 DiSpL4Y FuLl r3sUl7s 0R JuS7 p4g3 7i7l3s.","Add file":"4Dd fIl3","Include the weblog '%1'. Click to edit.":"iNcLuD3 7H3 w38L0G '%1'. ClIcK 70 3Di7.","Preview":"pR3Vi3w","Expand zip archives and attach individual files to the page?":"3Xp4nD ZiP 4rChIv3s 4Nd 4774cH InDiViDu4l fIl3s 70 7h3 P4G3?","Include the page '%1'. Click to edit.":"iNcLuD3 7H3 p4g3 '%1'. ClIcK 70 3Di7.","Heading 5":"h34DiNg 5","Optional properties include specifying a different page for the attachment, and link text.":"0P7I0N4L Pr0p3r7i3s iNcLuD3 sP3CiFyInG 4 DiFf3r3n7 P4G3 f0r 7H3 4774cHm3n7, 4Nd lInK 73X7.","Display the results from a Google search. Use this form to edit the properties for the search.":"dIsPl4y 7H3 r3sUl7s fR0M 4 G00gL3 s34RcH. uS3 7HiS F0Rm 70 3dI7 7H3 pR0P3R7I3S F0R 7h3 S34rCh.","Skype Link":"sKyP3 lInK","There are no optional properties for unformatted text.":"7H3R3 4R3 n0 0p7i0n4l pR0P3R7I3S F0R UnF0Rm4773D 73X7.","Optional properties include the title of another page to which the image is attached, and link text. If link text is specified then a link to the image is displayed instead of the image.":"0P7I0N4L Pr0p3r7i3s iNcLuD3 7H3 7I7L3 0F 4n07H3R P4G3 70 WhIcH 7h3 Im4g3 Is 4774cH3D, 4Nd lInK 73X7. If lInK 73X7 iS Sp3cIfI3D 7h3n 4 lInK 70 7H3 iM4G3 iS DiSpL4Y3D InS734D 0f 7H3 iM4G3.","Unformatted":"uNf0rM4773d","Could not add page to watchlist":"c0uLd n07 4Dd p4g3 70 w47ChLiS7","Optional properties include the text to display for the link, and a target section within the linked page.":"0P7I0N4L Pr0p3r7i3s iNcLuD3 7H3 73x7 70 dIsPl4y f0r 7H3 lInK, 4Nd 4 74rG37 S3C7I0N Wi7hIn 7H3 lInK3D P4G3.","Add another tag":"4Dd 4N07h3r 74g","Link to '%1'. Click to edit.":"lInK 70 '%1'. cLiCk 70 3dI7.","Add another file":"4Dd 4N07h3r fIl3","selection_start: %1":"s3l3c7i0n_s74R7: %1","Text":"73x7","Section name:":"s3c7i0n n4m3:","Headers and<br/>sections in:":"h34D3Rs 4Nd<8R/>s3c7i0nS In:","Unformatted content:":"uNf0rM4773d c0n73N7:","Italic":"i74LiC","Save":"s4v3","AIM: %1":"4Im: %1","Yahoo! IM: %1":"y4h00! Im: %1","the workspace named":"7H3 w0rKsP4C3 n4m3d","You must check at least one page in order to create a Word document.":"y0u mUs7 Ch3cK 47 l34S7 0N3 p4g3 In 0Rd3r 70 Cr3473 4 w0rD D0CuM3N7.","'%1' is a required field":"'%1' Is 4 r3qUiR3D Fi3lD","Instant message to '%1' using AIM. Click to edit.":"iNs74N7 m3sS4G3 70 '%1' uSiNg 4Im. ClIcK 70 3Di7.","Insert...":"iNs3r7...","toc":"70c","Display what's new in the '%1' workspace. Click to edit.":"dIsPl4y wH47'S N3W In 7H3 '%1' W0RkSp4c3. cLiCk 70 3dI7.","error -> \\\"%1\\\" is not a valid email address":"3Rr0r -> \\\"%1\\\" iS N07 4 V4LiD 3m4iL 4dDr3sS","Yahoo! IM Link":"y4h00! Im lInK","weblog list: %1":"w38L0G LiS7: %1","Insert attachment":"iNs3r7 4774ChM3N7","This is not an editable widget. Please edit it in advanced mode.":"7HiS Is n07 4N 3dI748L3 wIdG37. pL34s3 3dI7 i7 In 4Dv4nC3D M0D3.","Skype: %1":"sKyP3: %1","There are no optional properties for an AIM link.":"7H3R3 4R3 n0 0p7i0n4l pR0P3R7I3S F0R 4n 4Im lInK.","Untitled Page":"uN7I7L3D P4G3","Display a list of pages recently changed in a workspace. By default only the page titles are displayed. Use this form to edit the list properties.":"dIsPl4y 4 lIs7 0f p4g3s r3c3n7lY Ch4nG3D In 4 w0rKsP4C3. 8y d3f4uL7 0NlY 7h3 P4G3 7I7L3S 4r3 DiSpL4Y3D. uS3 7HiS F0Rm 70 3dI7 7H3 lIs7 Pr0p3r7i3s.","Horizontal Rule":"h0rIz0n74L RuL3","Click \\\"Browse\\\" to find the file you want to upload. When you click \\\"Add file,\\\" this file will be added to the list of attachments for this page, and uploaded when you save the page.":"cLiCk \\\"8R0Ws3\\\" 70 fInD 7h3 FiL3 y0u w4n7 70 uPl04D. wH3N Y0U ClIcK \\\"4dD FiL3,\\\" 7hIs fIl3 WiLl 83 4dD3D 70 7H3 lIs7 0f 4774cHm3n7s f0r 7HiS P4G3, 4nD UpL04d3d wH3N Y0U S4V3 7H3 p4g3.","Fewer options":"f3w3r 0P7I0Ns","type link text here":"7Yp3 LiNk 73x7 H3R3","Use %1 to generate a form. Click to edit.":"uS3 %1 70 g3n3r473 4 F0Rm. ClIcK 70 3Di7.","tag: %1":"74g: %1","Bold":"80lD","Files To upload:":"fIl3s 70 UpL04d:","\\\",\\\"":"\\\",\\\"","tag list: %1":"74g lIs7: %1","Add a link to this attachment at the top of the page? Images will appear in the page.":"4Dd 4 lInK 70 7HiS 4774ChM3N7 47 7h3 70P 0f 7H3 p4g3? iM4G3S WiLl 4Pp34R In 7H3 p4g3.","Please select the text you would like to turn into a link.":"pL34s3 S3L3C7 7H3 73x7 Y0U W0UlD LiK3 70 7uRn iN70 4 LiNk.","Display the full name for the given email address or user name. Use this form to edit the properties of the user name.":"dIsPl4y 7H3 fUlL N4M3 f0r 7H3 gIv3n 3M4Il 4DdR3Ss 0R Us3r n4m3. uS3 7HiS F0Rm 70 3dI7 7H3 pR0P3R7I3S 0f 7H3 uS3R N4M3.","the page titled":"7H3 p4g3 7i7l3d","More options":"m0r3 0p7i0nS","More Indented":"m0r3 InD3N73d","Display the results for a Technorati search. Use this form to edit the properties for the search.":"dIsPl4y 7H3 r3sUl7s f0r 4 73cHn0r47I S34rCh. Us3 7hIs f0rM 70 3Di7 7h3 Pr0p3r7i3s f0r 7H3 s34RcH.","Preformatted":"pR3F0Rm4773D","Full results:":"fUlL R3SuL7S:","Call '%1' using Convoq. Click to edit.":"c4lL '%1' uSiNg c0nV0Q. cLiCk 70 3dI7.","Heading 4":"h34DiNg 4","Images":"iM4G3S","Optionally, specify which page's headers and sections to use for the table of contents.":"0P7I0N4LlY, sP3CiFy wHiCh p4g3'S H34d3rS 4nD S3C7I0Ns 70 Us3 F0R 7h3 748l3 0f c0n73N7S.","You must select one of the options or click cancel":"y0u mUs7 S3L3C7 0N3 0F 7h3 0p7i0nS 0r cLiCk c4nC3L","form: %1":"f0rM: %1","About Wikiwyg":"480U7 wIkIwYg","Table of contents for '%1'. Click to edit.":"748L3 0F C0N73n7s f0r '%1'. cLiCk 70 3dI7.","Section marker '%1'. Click to edit.":"s3c7i0n m4rK3R '%1'. ClIcK 70 3Di7.","Yahoo! ID:":"y4h00! Id:","Section Marker":"s3c7i0n m4rK3R","That doesn't appear to be a valid number.":"7H47 D03sN'7 4pP34r 70 83 4 v4lId nUm83R.","There are no optional properties for a section marker.":"7H3R3 4R3 n0 0p7i0n4l pR0P3R7I3S F0R 4 S3C7I0N M4Rk3r.","There are no optional properties for a new form page.":"7H3R3 4R3 n0 0p7i0n4l pR0P3R7I3S F0R 4 N3W F0Rm p4g3.","image: %1":"iM4G3: %1","Include the '%1' Atom feed. Click to edit.":"iNcLuD3 7H3 '%1' 470m f33D. cLiCk 70 3dI7.","Display the given date and time in the individually-set time zone for each reader. Use this form to edit the date and time to be displayed":"dIsPl4y 7H3 gIv3n d473 4nD 7iM3 iN 7h3 InDiViDu4lLy-s37 7Im3 Z0N3 f0r 34cH R34d3r. Us3 7hIs f0rM 70 3Di7 7h3 D473 4Nd 7Im3 70 83 DiSpL4Y3D","Replace this text with your own.":"r3pL4C3 7HiS 73X7 wI7H Y0Ur 0Wn.","There are no optional properties for a date display.":"7H3R3 4R3 n0 0p7i0n4l pR0P3R7I3S F0R 4 D473 dIsPl4y.","the current workspace":"7H3 cUrR3N7 w0rKsP4C3","Decrease Indent":"d3cR34s3 InD3N7","Tag name:":"74g n4m3:","New search":"n3w s34RcH","Use this form to edit the properties of the link.":"uS3 7HiS F0Rm 70 3dI7 7H3 pR0P3R7I3S 0f 7H3 lInK.","\\\"%1\\\" is a reserved page name. Please use a different name":"\\\"%1\\\" Is 4 r3s3rV3D P4G3 n4m3. pL34s3 Us3 4 DiFf3r3n7 N4M3","Call '%1' using Skype. Click to edit.":"c4lL '%1' uSiNg sKyP3. ClIcK 70 3Di7.","Advanced Mode":"4Dv4nC3D M0D3","Optional properties include the text to display for the link, and the title of a different page.":"0P7I0N4L Pr0p3r7i3s iNcLuD3 7H3 73x7 70 dIsPl4y f0r 7H3 lInK, 4Nd 7H3 7I7L3 0F 4 DiFf3r3n7 P4G3.","Strike Through":"s7rIk3 7hR0UgH","or":"0R","If you click 'OK', all edit changes will be lost!":"iF Y0U ClIcK '0K', 4lL 3dI7 cH4Ng3s wIlL 83 l0s7!","Search Results":"s34RcH R3SuL7S","Insert web link":"iNs3r7 W38 LiNk","Add a section marker at the current cursor location. You can link to a section marker using a \\\"Section Link\\\". Use this form to edit the properties for the section marker.":"4Dd 4 s3c7i0n m4rK3R 47 7H3 cUrR3N7 cUrS0R L0C47i0n. Y0U C4N LiNk 70 4 S3C7I0N M4Rk3r uSiNg 4 \\\"s3c7i0n lInK\\\". uS3 7HiS F0Rm 70 3dI7 7H3 pR0P3R7I3S F0R 7h3 S3C7I0N M4Rk3r.","link: %1 (%2 )":"lInK: %1 (%2 )","link: %1":"lInK: %1","Less Indented":"l3sS InD3N73d","There are no optional properties for an RSS feed.":"7H3R3 4R3 n0 0p7i0n4l pR0P3R7I3S F0R 4n rSs f33D.","search: %1":"s34RcH: %1","Display image '%1'. Click to edit.":"dIsPl4y iM4G3 '%1'. cLiCk 70 3dI7.","Pages with the '%1' tag. Click to edit.":"p4g3s wI7H 7h3 '%1' 74g. ClIcK 70 3Di7.","Other page in:":"07h3r p4g3 In:","Insert image":"iNs3r7 Im4g3","YYYY-MM-DD&nbsp;HH:MM:SS:":"yYyY-Mm-dD&N8Sp;hH:Mm:sS:","No matches":"n0 M47cH3S","Safari does not support simple mode editing":"s4f4rI D03s n07 sUpP0R7 sImPl3 M0D3 3Di7iNg","Search Google for '%1'. Click to edit.":"s34RcH G00gL3 f0r '%1'. cLiCk 70 3dI7.","Expand zip archive and attach individual files to the page?":"3Xp4nD ZiP 4rChIv3 4nD 4774Ch iNdIvIdU4L FiL3S 70 7H3 p4g3?","Add tag":"4Dd 74g","There are no optional properties for a Technorati search.":"7H3R3 4R3 n0 0p7i0n4l pR0P3R7I3S F0R 4 73ChN0R47i s34RcH.","AIM screen name:":"4Im sCr33N N4M3:","Technorati Search":"73cHn0r47I S34rCh","What's New":"wH47'S N3W","There are no optional properties for a Skype link.":"7H3R3 4R3 n0 0p7i0n4l pR0P3R7I3S F0R 4 SkYp3 LiNk.","Inline Atom":"iNlIn3 470m","Optional properties include link text, and the name of a different workspace for the weblog.":"0P7I0N4L Pr0p3r7i3s iNcLuD3 lInK 73X7, 4nD 7h3 N4M3 0F 4 DiFf3r3n7 W0RkSp4c3 F0R 7h3 W38l0g.","Watching this page":"w47ChInG 7hIs p4g3","Normal Text":"n0rM4L 73X7","Saving...":"s4vInG...","Weblog List":"w38L0G LiS7","Include the '%1' RSS feed. Click to edit.":"iNcLuD3 7H3 '%1' RsS F33d. ClIcK 70 3Di7.","Form name:":"f0rM N4M3:"}};

function loc() {
    var locale = Socialtext.loc_lang;
    var dict = LocalizedStrings[locale] || new Array;
    var str = arguments[0] || "";
    var l10n = dict[str];
    var nstr = "";

    if (!l10n) {
        /* If the hash-lookup failed, convert " into \\\" and try again. */
        nstr = str.replace(/\"/g, "\\\"");
        l10n = dict[nstr];
        if (!l10n) {
            /* If the hash-lookup failed, convert [_1] into %1 and try again. */
            nstr = nstr.replace(/\[_(\d+)\]/g, "%$1");
            l10n = dict[nstr] || str;
        }
    }

    l10n = l10n.replace(/\\\"/g, "\"");

    /* Convert both %1 and [_1] style vars into the given arguments */
    for (var i = 1; i < arguments.length; i++) {
        var rx = new RegExp("\\[_" + i + "\\]", "g");
        var rx2 = new RegExp("%" + i + "", "g");
        l10n = l10n.replace(rx, arguments[i]);
        l10n = l10n.replace(rx2, arguments[i]);
    }

    return l10n;
}

// BEGIN ../../../js-modules/Wikiwyg-copy/lib/Wikiwyg/Debug.js
/*==============================================================================
This Wikiwyg mode supports a textarea editor with toolbar buttons.

COPYRIGHT:

    Copyright (c) 2005 Socialtext Corporation 
    655 High Street
    Palo Alto, CA 94301 U.S.A.
    All rights reserved.

Wikiwyg is free software. 

This library is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or (at
your option) any later version.

This library 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 Lesser
General Public License for more details.

    http://www.gnu.org/copyleft/lesser.txt

 =============================================================================*/

// Like alert but uses confirm and throw in case you are looped
function XXX(msg) {
    if (! confirm(msg))
        throw("terminated...");
    return msg;
}

// A JSON dumper that uses XXX
function JJJ(obj) {
    XXX(JSON.stringify(obj));
    return obj;
}


// A few handy debugging functions
(function() {

var klass = Debug = function() {};

klass.sort_object_keys = function(o) {
    var a = [];
    for (p in o) a.push(p);
    return a.sort();
}

klass.dump_keys = function(o) {
    var a = klass.sort_object_keys(o);
    var str='';
    for (p in a)
        str += a[p] + "\t";
    XXX(str);
}

klass.dump_object_into_screen = function(o) {
    var a = klass.sort_object_keys(o);
    var str='';
    for (p in a) {
        var i = a[p];
        try {
            str += a[p] + ': ' + o[i] + '\n';
        } catch(e) {
            // alert('Died on key "' + i + '":\n' + e.message);
        }
    }
    document.write('<xmp>' + str + '</xmp>');
}

})();

// BEGIN main.js
/* 
COPYRIGHT NOTICE:
    Copyright (c) 2004-2005 Socialtext Corporation 
    235 Churchill Ave 
    Palo Alto, CA 94301 U.S.A.
    All rights reserved.
*/

function foreach(list, func) {
    for (var ii = 0; ii < list.length; ii++)
        func(list[ii]);
}

function elem(id) {
    return document.getElementById(id);
}

function exists(object, key) {
    return (typeof object[key] != 'undefined') ;
}

function assertEquals(a, b, desc) {
    // TODO figure out what the calling line was, or else just start using
    // easily-greppable "desc"s
    if (typeof(a) != typeof(b)) {
        alert(
             desc + " failed:\n"
             + 'typeof('+a+') != typeof('+b+')\n'
             + '('+typeof(a)+' vs. '+typeof(b)+')'
        );
    }
    if (a+'' != b+'')
        alert(desc + " failed: '" + a + "' != '" + b + "'");
}

// TODO Replace this stuff with AddEvent
// var onload_functions = new Array()
var onload_functions = [];
function push_onload_function(func) {
    onload_functions.push(func);
}

function call_onload_functions() {
    while (func = onload_functions.shift()) {
        func();
    }
}

function html_escape(string) {
    string = string.toString();
    string = string.replace(/&/g, '&amp;');
    string = string.replace(/</g, '&lt;');
    string = string.replace(/>/g, '&gt;');
    return string;
}

function escape_plus(string) {
    return encodeURIComponent(string);
}

// http://daniel.glazman.free.fr/weblog/newarchive/2003_06_01_glazblogarc.html#s95320189
document.getDivsByClassName = function(needle) {
    var my_array = document.getElementsByTagName('div');
    var retvalue = new Array();
    var i;
    var j;

    for (i = 0, j = 0; i < my_array.length; i++) {
        var c = " " + my_array[i].className + " ";
        if (c.indexOf(" " + needle + " ") != -1)
             retvalue[j++] = my_array[i];
    }
    return retvalue;
}

// -- Less generic stuff below... ---

// TODO - Class.NLW
function toolbar_warning(element, warning) {
    var old_html = element.innerHTML;
    element.innerHTML = warning;
    element.style.color = 'red';
    return old_html;
}

function set_main_frame_margin() {
    var spacer = document.getElementById('page-container-top-control');
    var fixed_bar = document.getElementById('fixed-bar');

    if (fixed_bar) {
        var new_top_margin = fixed_bar.offsetHeight;
        if (Browser.isIE)
            new_top_margin += 2;

        spacer.style.display = 'block';
        spacer.style.height = new_top_margin + 'px';
    }
}
push_onload_function(set_main_frame_margin);
window.onresize = set_main_frame_margin;

function nlw_name_to_id(name) {
    if (name == '')
        return '';
    return encodeURI(
        name.replace(/[^A-Za-z0-9_+\u00C0-\u00FF]/g, '_')
            .replace(/_+/g, '_')
            .replace(/^_*(.*?)_*$/g, '$1')
            .replace(/^0$/, '_')
            .replace(/^$/, '_')
            .toLocaleLowerCase()
    );
}

function check_revisions(form) {
    var r1;
    var r2;
    
    var old_id = form.old_revision_id;
    if (old_id) {
        for (var i = 0; i < old_id.length; i++) {
            if (old_id[i].checked) {
                 r1 = old_id[i].value;
            }
        }
    }
    else {
        r1 = -1;
    }

    var new_id = form.new_revision_id;
    if (new_id) {
        for (var i = 0; i < new_id.length; i++) {
            if (new_id[i].checked) {
                r2 = new_id[i].value;
            }
        }
    }
    else {
        r2 = -1;
    }

    if ((! r1) || (! r2)) {
        alert(loc('You must select two revisions to compare.'));
        return false;
    }

    if (r1 == r2) {
        alert(loc('You cannot compare a revision to itself.'));
        return false;
    }

    return true;
}

// Dummy JSAN.use since we preload classes
JSAN = {};
JSAN.use = function() {};

if (typeof(Socialtext) == 'undefined') {
    Socialtext = {};
}

Socialtext.clear_untitled = function(input) {
    if (input.value == loc('Untitled Page'))
        input.value = '';
}
// BEGIN ../../../js-modules/prototype/dist/prototype.js
/*  Prototype JavaScript framework, version 1.4.0
 *  (c) 2005 Sam Stephenson <sam@conio.net>
 *
 *  Prototype is freely distributable under the terms of an MIT-style license.
 *  For details, see the Prototype web site: http://prototype.conio.net/
 *
/*--------------------------------------------------------------------------*/

var Prototype = {
  Version: '1.4.0',
  ScriptFragment: '(?:<script.*?>)((\n|\r|.)*?)(?:<\/script>)',

  emptyFunction: function() {},
  K: function(x) {return x}
}

var Class = {
  create: function() {
    return function() {
      this.initialize.apply(this, arguments);
    }
  }
}

var Abstract = new Object();

Object.extend = function(destination, source) {
  for (property in source) {
    destination[property] = source[property];
  }
  return destination;
}

Object.inspect = function(object) {
  try {
    if (object == undefined) return 'undefined';
    if (object == null) return 'null';
    return object.inspect ? object.inspect() : object.toString();
  } catch (e) {
    if (e instanceof RangeError) return '...';
    throw e;
  }
}

Function.prototype.bind = function() {
  var __method = this, args = $A(arguments), object = args.shift();
  return function() {
    return __method.apply(object, args.concat($A(arguments)));
  }
}

Function.prototype.bindAsEventListener = function(object) {
  var __method = this;
  return function(event) {
    return __method.call(object, event || window.event);
  }
}

Object.extend(Number.prototype, {
  toColorPart: function() {
    var digits = this.toString(16);
    if (this < 16) return '0' + digits;
    return digits;
  },

  succ: function() {
    return this + 1;
  },

  times: function(iterator) {
    $R(0, this, true).each(iterator);
    return this;
  }
});

var Try = {
  these: function() {
    var returnValue;

    for (var i = 0; i < arguments.length; i++) {
      var lambda = arguments[i];
      try {
        returnValue = lambda();
        break;
      } catch (e) {}
    }

    return returnValue;
  }
}

/*--------------------------------------------------------------------------*/

var PeriodicalExecuter = Class.create();
PeriodicalExecuter.prototype = {
  initialize: function(callback, frequency) {
    this.callback = callback;
    this.frequency = frequency;
    this.currentlyExecuting = false;

    this.registerCallback();
  },

  registerCallback: function() {
    setInterval(this.onTimerEvent.bind(this), this.frequency * 1000);
  },

  onTimerEvent: function() {
    if (!this.currentlyExecuting) {
      try {
        this.currentlyExecuting = true;
        this.callback();
      } finally {
        this.currentlyExecuting = false;
      }
    }
  }
}

/*--------------------------------------------------------------------------*/

function $() {
  var elements = new Array();

  for (var i = 0; i < arguments.length; i++) {
    var element = arguments[i];
    if (typeof element == 'string')
      element = document.getElementById(element);

    if (arguments.length == 1)
      return element;

    elements.push(element);
  }

  return elements;
}
Object.extend(String.prototype, {
  stripTags: function() {
    return this.replace(/<\/?[^>]+>/gi, '');
  },

  stripScripts: function() {
    return this.replace(new RegExp(Prototype.ScriptFragment, 'img'), '');
  },

  extractScripts: function() {
    var matchAll = new RegExp(Prototype.ScriptFragment, 'img');
    var matchOne = new RegExp(Prototype.ScriptFragment, 'im');
    return (this.match(matchAll) || []).map(function(scriptTag) {
      return (scriptTag.match(matchOne) || ['', ''])[1];
    });
  },

  evalScripts: function() {
    return this.extractScripts().map(eval);
  },

  escapeHTML: function() {
    var div = document.createElement('div');
    var text = document.createTextNode(this);
    div.appendChild(text);
    return div.innerHTML;
  },

  unescapeHTML: function() {
    var div = document.createElement('div');
    div.innerHTML = this.stripTags();
    return div.childNodes[0] ? div.childNodes[0].nodeValue : '';
  },

  toQueryParams: function() {
    var pairs = this.match(/^\??(.*)$/)[1].split('&');
    return pairs.inject({}, function(params, pairString) {
      var pair = pairString.split('=');
      params[pair[0]] = pair[1];
      return params;
    });
  },

  toArray: function() {
    return this.split('');
  },

  camelize: function() {
    var oStringList = this.split('-');
    if (oStringList.length == 1) return oStringList[0];

    var camelizedString = this.indexOf('-') == 0
      ? oStringList[0].charAt(0).toUpperCase() + oStringList[0].substring(1)
      : oStringList[0];

    for (var i = 1, len = oStringList.length; i < len; i++) {
      var s = oStringList[i];
      camelizedString += s.charAt(0).toUpperCase() + s.substring(1);
    }

    return camelizedString;
  },

  inspect: function() {
    return "'" + this.replace('\\', '\\\\').replace("'", '\\\'') + "'";
  }
});

String.prototype.parseQuery = String.prototype.toQueryParams;

var $break    = new Object();
var $continue = new Object();

var Enumerable = {
  each: function(iterator) {
    var index = 0;
    try {
      this._each(function(value) {
        try {
          iterator(value, index++);
        } catch (e) {
          if (e != $continue) throw e;
        }
      });
    } catch (e) {
      if (e != $break) throw e;
    }
  },

  all: function(iterator) {
    var result = true;
    this.each(function(value, index) {
      result = result && !!(iterator || Prototype.K)(value, index);
      if (!result) throw $break;
    });
    return result;
  },

  any: function(iterator) {
    var result = true;
    this.each(function(value, index) {
      if (result = !!(iterator || Prototype.K)(value, index))
        throw $break;
    });
    return result;
  },

  collect: function(iterator) {
    var results = [];
    this.each(function(value, index) {
      results.push(iterator(value, index));
    });
    return results;
  },

  detect: function (iterator) {
    var result;
    this.each(function(value, index) {
      if (iterator(value, index)) {
        result = value;
        throw $break;
      }
    });
    return result;
  },

  findAll: function(iterator) {
    var results = [];
    this.each(function(value, index) {
      if (iterator(value, index))
        results.push(value);
    });
    return results;
  },

  grep: function(pattern, iterator) {
    var results = [];
    this.each(function(value, index) {
      var stringValue = value.toString();
      if (stringValue.match(pattern))
        results.push((iterator || Prototype.K)(value, index));
    })
    return results;
  },

  include: function(object) {
    var found = false;
    this.each(function(value) {
      if (value == object) {
        found = true;
        throw $break;
      }
    });
    return found;
  },

  inject: function(memo, iterator) {
    this.each(function(value, index) {
      memo = iterator(memo, value, index);
    });
    return memo;
  },

  invoke: function(method) {
    var args = $A(arguments).slice(1);
    return this.collect(function(value) {
      return value[method].apply(value, args);
    });
  },

  max: function(iterator) {
    var result;
    this.each(function(value, index) {
      value = (iterator || Prototype.K)(value, index);
      if (value >= (result || value))
        result = value;
    });
    return result;
  },

  min: function(iterator) {
    var result;
    this.each(function(value, index) {
      value = (iterator || Prototype.K)(value, index);
      if (value <= (result || value))
        result = value;
    });
    return result;
  },

  partition: function(iterator) {
    var trues = [], falses = [];
    this.each(function(value, index) {
      ((iterator || Prototype.K)(value, index) ?
        trues : falses).push(value);
    });
    return [trues, falses];
  },

  pluck: function(property) {
    var results = [];
    this.each(function(value, index) {
      results.push(value[property]);
    });
    return results;
  },

  reject: function(iterator) {
    var results = [];
    this.each(function(value, index) {
      if (!iterator(value, index))
        results.push(value);
    });
    return results;
  },

  sortBy: function(iterator) {
    return this.collect(function(value, index) {
      return {value: value, criteria: iterator(value, index)};
    }).sort(function(left, right) {
      var a = left.criteria, b = right.criteria;
      return a < b ? -1 : a > b ? 1 : 0;
    }).pluck('value');
  },

  toArray: function() {
    return this.collect(Prototype.K);
  },

  zip: function() {
    var iterator = Prototype.K, args = $A(arguments);
    if (typeof args.last() == 'function')
      iterator = args.pop();

    var collections = [this].concat(args).map($A);
    return this.map(function(value, index) {
      iterator(value = collections.pluck(index));
      return value;
    });
  },

  inspect: function() {
    return '#<Enumerable:' + this.toArray().inspect() + '>';
  }
}

Object.extend(Enumerable, {
  map:     Enumerable.collect,
  find:    Enumerable.detect,
  select:  Enumerable.findAll,
  member:  Enumerable.include,
  entries: Enumerable.toArray
});
var $A = Array.from = function(iterable) {
  if (!iterable) return [];
  if (iterable.toArray) {
    return iterable.toArray();
  } else {
    var results = [];
    for (var i = 0; i < iterable.length; i++)
      results.push(iterable[i]);
    return results;
  }
}

Object.extend(Array.prototype, Enumerable);

Array.prototype._reverse = Array.prototype.reverse;

Object.extend(Array.prototype, {
  _each: function(iterator) {
    for (var i = 0; i < this.length; i++)
      iterator(this[i]);
  },

  clear: function() {
    this.length = 0;
    return this;
  },

  first: function() {
    return this[0];
  },

  last: function() {
    return this[this.length - 1];
  },

  compact: function() {
    return this.select(function(value) {
      return value != undefined || value != null;
    });
  },

  flatten: function() {
    return this.inject([], function(array, value) {
      return array.concat(value.constructor == Array ?
        value.flatten() : [value]);
    });
  },

  without: function() {
    var values = $A(arguments);
    return this.select(function(value) {
      return !values.include(value);
    });
  },

  indexOf: function(object) {
    for (var i = 0; i < this.length; i++)
      if (this[i] == object) return i;
    return -1;
  },

  reverse: function(inline) {
    return (inline !== false ? this : this.toArray())._reverse();
  },

  /* ingy says no
  shift: function() {
    var result = this[0];
    for (var i = 0; i < this.length - 1; i++)
      this[i] = this[i + 1];
    this.length--;
    return result;
  },
  */

  inspect: function() {
    return '[' + this.map(Object.inspect).join(', ') + ']';
  }
});
var Hash = {
  _each: function(iterator) {
    for (key in this) {
      var value = this[key];
      if (typeof value == 'function') continue;

      var pair = [key, value];
      pair.key = key;
      pair.value = value;
      iterator(pair);
    }
  },

  keys: function() {
    return this.pluck('key');
  },

  values: function() {
    return this.pluck('value');
  },

  merge: function(hash) {
    return $H(hash).inject($H(this), function(mergedHash, pair) {
      mergedHash[pair.key] = pair.value;
      return mergedHash;
    });
  },

  toQueryString: function() {
    return this.map(function(pair) {
      return pair.map(encodeURIComponent).join('=');
    }).join('&');
  },

  inspect: function() {
    return '#<Hash:{' + this.map(function(pair) {
      return pair.map(Object.inspect).join(': ');
    }).join(', ') + '}>';
  }
}

function $H(object) {
  var hash = Object.extend({}, object || {});
  Object.extend(hash, Enumerable);
  Object.extend(hash, Hash);
  return hash;
}
ObjectRange = Class.create();
Object.extend(ObjectRange.prototype, Enumerable);
Object.extend(ObjectRange.prototype, {
  initialize: function(start, end, exclusive) {
    this.start = start;
    this.end = end;
    this.exclusive = exclusive;
  },

  _each: function(iterator) {
    var value = this.start;
    do {
      iterator(value);
      value = value.succ();
    } while (this.include(value));
  },

  include: function(value) {
    if (value < this.start)
      return false;
    if (this.exclusive)
      return value < this.end;
    return value <= this.end;
  }
});

var $R = function(start, end, exclusive) {
  return new ObjectRange(start, end, exclusive);
}

var Ajax = {
  getTransport: function() {
    return Try.these(
      function() {return new ActiveXObject('Msxml2.XMLHTTP')},
      function() {return new ActiveXObject('Microsoft.XMLHTTP')},
      function() {return new XMLHttpRequest()}
    ) || false;
  },

  activeRequestCount: 0
}

Ajax.Responders = {
  responders: [],

  _each: function(iterator) {
    this.responders._each(iterator);
  },

  register: function(responderToAdd) {
    if (!this.include(responderToAdd))
      this.responders.push(responderToAdd);
  },

  unregister: function(responderToRemove) {
    this.responders = this.responders.without(responderToRemove);
  },

  dispatch: function(callback, request, transport, json) {
    this.each(function(responder) {
      if (responder[callback] && typeof responder[callback] == 'function') {
        try {
          responder[callback].apply(responder, [request, transport, json]);
        } catch (e) {}
      }
    });
  }
};

Object.extend(Ajax.Responders, Enumerable);

Ajax.Responders.register({
  onCreate: function() {
    Ajax.activeRequestCount++;
  },

  onComplete: function() {
    Ajax.activeRequestCount--;
  }
});

Ajax.Base = function() {};
Ajax.Base.prototype = {
  setOptions: function(options) {
    this.options = {
      method:       'post',
      asynchronous: true,
      parameters:   ''
    }
    Object.extend(this.options, options || {});
  },

  responseIsSuccess: function() {
    return this.transport.status == undefined
        || this.transport.status == 0
        || (this.transport.status >= 200 && this.transport.status < 300);
  },

  responseIsFailure: function() {
    return !this.responseIsSuccess();
  }
}

Ajax.Request = Class.create();
Ajax.Request.Events =
  ['Uninitialized', 'Loading', 'Loaded', 'Interactive', 'Complete'];

Ajax.Request.prototype = Object.extend(new Ajax.Base(), {
  initialize: function(url, options) {
    this.transport = Ajax.getTransport();
    this.setOptions(options);
    this.request(url);
  },

  request: function(url) {
    var parameters = this.options.parameters || '';
    if (parameters.length > 0) parameters += '&_=';

    try {
      this.url = url;
      if (this.options.method == 'get' && parameters.length > 0)
        this.url += (this.url.match(/\?/) ? '&' : '?') + parameters;

      Ajax.Responders.dispatch('onCreate', this, this.transport);

      this.transport.open(this.options.method, this.url,
        this.options.asynchronous);

      if (this.options.asynchronous) {
        this.transport.onreadystatechange = this.onStateChange.bind(this);
        setTimeout((function() {this.respondToReadyState(1)}).bind(this), 10);
      }

      this.setRequestHeaders();

      var body = this.options.postBody ? this.options.postBody : parameters;
      this.transport.send(this.options.method == 'post' ? body : null);

    } catch (e) {
      this.dispatchException(e);
    }
  },

  setRequestHeaders: function() {
    var requestHeaders =
      ['X-Requested-With', 'XMLHttpRequest',
       'X-Prototype-Version', Prototype.Version];

    if (this.options.method == 'post') {
      requestHeaders.push('Content-type',
        'application/x-www-form-urlencoded');

      /* Force "Connection: close" for Mozilla browsers to work around
       * a bug where XMLHttpReqeuest sends an incorrect Content-length
       * header. See Mozilla Bugzilla #246651.
       */
      if (this.transport.overrideMimeType)
        requestHeaders.push('Connection', 'close');
    }

    if (this.options.requestHeaders)
      requestHeaders.push.apply(requestHeaders, this.options.requestHeaders);

    for (var i = 0; i < requestHeaders.length; i += 2)
      this.transport.setRequestHeader(requestHeaders[i], requestHeaders[i+1]);
  },

  onStateChange: function() {
    var readyState = this.transport.readyState;
    if (readyState != 1)
      this.respondToReadyState(this.transport.readyState);
  },

  header: function(name) {
    try {
      return this.transport.getResponseHeader(name);
    } catch (e) {}
  },

  evalJSON: function() {
    try {
      return eval(this.header('X-JSON'));
    } catch (e) {}
  },

  evalResponse: function() {
    try {
      return eval(this.transport.responseText);
    } catch (e) {
      this.dispatchException(e);
    }
  },

  respondToReadyState: function(readyState) {
    var event = Ajax.Request.Events[readyState];
    var transport = this.transport, json = this.evalJSON();

    if (event == 'Complete') {
      try {
        (this.options['on' + this.transport.status]
         || this.options['on' + (this.responseIsSuccess() ? 'Success' : 'Failure')]
         || Prototype.emptyFunction)(transport, json);
      } catch (e) {
        this.dispatchException(e);
      }

      if ((this.header('Content-type') || '').match(/^text\/javascript/i))
        this.evalResponse();
    }

    try {
      (this.options['on' + event] || Prototype.emptyFunction)(transport, json);
      Ajax.Responders.dispatch('on' + event, this, transport, json);
    } catch (e) {
      this.dispatchException(e);
    }

    /* Avoid memory leak in MSIE: clean up the oncomplete event handler */
    if (event == 'Complete')
      this.transport.onreadystatechange = Prototype.emptyFunction;
  },

  dispatchException: function(exception) {
    (this.options.onException || Prototype.emptyFunction)(this, exception);
    Ajax.Responders.dispatch('onException', this, exception);
  }
});

Ajax.Updater = Class.create();

Object.extend(Object.extend(Ajax.Updater.prototype, Ajax.Request.prototype), {
  initialize: function(container, url, options) {
    this.containers = {
      success: container.success ? $(container.success) : $(container),
      failure: container.failure ? $(container.failure) :
        (container.success ? null : $(container))
    }

    this.transport = Ajax.getTransport();
    this.setOptions(options);

    var onComplete = this.options.onComplete || Prototype.emptyFunction;
    this.options.onComplete = (function(transport, object) {
      this.updateContent();
      onComplete(transport, object);
    }).bind(this);

    this.request(url);
  },

  updateContent: function() {
    var receiver = this.responseIsSuccess() ?
      this.containers.success : this.containers.failure;
    var response = this.transport.responseText;

    if (!this.options.evalScripts)
      response = response.stripScripts();

    if (receiver) {
      if (this.options.insertion) {
        new this.options.insertion(receiver, response);
      } else {
        Element.update(receiver, response);
      }
    }

    if (this.responseIsSuccess()) {
      if (this.onComplete)
        setTimeout(this.onComplete.bind(this), 10);
    }
  }
});

Ajax.PeriodicalUpdater = Class.create();
Ajax.PeriodicalUpdater.prototype = Object.extend(new Ajax.Base(), {
  initialize: function(container, url, options) {
    this.setOptions(options);
    this.onComplete = this.options.onComplete;

    this.frequency = (this.options.frequency || 2);
    this.decay = (this.options.decay || 1);

    this.updater = {};
    this.container = container;
    this.url = url;

    this.start();
  },

  start: function() {
    this.options.onComplete = this.updateComplete.bind(this);
    this.onTimerEvent();
  },

  stop: function() {
    this.updater.onComplete = undefined;
    clearTimeout(this.timer);
    (this.onComplete || Prototype.emptyFunction).apply(this, arguments);
  },

  updateComplete: function(request) {
    if (this.options.decay) {
      this.decay = (request.responseText == this.lastText ?
        this.decay * this.options.decay : 1);

      this.lastText = request.responseText;
    }
    this.timer = setTimeout(this.onTimerEvent.bind(this),
      this.decay * this.frequency * 1000);
  },

  onTimerEvent: function() {
    this.updater = new Ajax.Updater(this.container, this.url, this.options);
  }
});
document.getElementsByClassName = function(className, parentElement) {
  var children = ($(parentElement) || document.body).getElementsByTagName('*');
  return $A(children).inject([], function(elements, child) {
    if (child.className.match(new RegExp("(^|\\s)" + className + "(\\s|$)")))
      elements.push(child);
    return elements;
  });
}

/*--------------------------------------------------------------------------*/

if (!window.Element) {
  var Element = new Object();
}

Object.extend(Element, {
  visible: function(element) {
    return $(element).style.display != 'none';
  },

  toggle: function() {
    for (var i = 0; i < arguments.length; i++) {
      var element = $(arguments[i]);
      Element[Element.visible(element) ? 'hide' : 'show'](element);
    }
  },

  hide: function() {
    for (var i = 0; i < arguments.length; i++) {
      var element = $(arguments[i]);
      element.style.display = 'none';
    }
  },

  show: function() {
    for (var i = 0; i < arguments.length; i++) {
      var element = $(arguments[i]);
      element.style.display = '';
    }
  },

  remove: function(element) {
    element = $(element);
    element.parentNode.removeChild(element);
  },

  update: function(element, html) {
    $(element).innerHTML = html.stripScripts();
    setTimeout(function() {html.evalScripts()}, 10);
  },

  getHeight: function(element) {
    element = $(element);
    return element.offsetHeight;
  },

  classNames: function(element) {
    return new Element.ClassNames(element);
  },

  hasClassName: function(element, className) {
    if (!(element = $(element))) return;
    return Element.classNames(element).include(className);
  },

  addClassName: function(element, className) {
    if (!(element = $(element))) return;
    return Element.classNames(element).add(className);
  },

  removeClassName: function(element, className) {
    if (!(element = $(element))) return;
    return Element.classNames(element).remove(className);
  },

  // removes whitespace-only text node children
  cleanWhitespace: function(element) {
    element = $(element);
    for (var i = 0; i < element.childNodes.length; i++) {
      var node = element.childNodes[i];
      if (node.nodeType == 3 && !/\S/.test(node.nodeValue))
        Element.remove(node);
    }
  },

  empty: function(element) {
    return $(element).innerHTML.match(/^\s*$/);
  },

  scrollTo: function(element) {
    element = $(element);
    var x = element.x ? element.x : element.offsetLeft,
        y = element.y ? element.y : element.offsetTop;
    window.scrollTo(x, y);
  },

  getStyle: function(element, style) {
    element = $(element);
    var value = element.style[style.camelize()];
    if (!value) {
      if (document.defaultView && document.defaultView.getComputedStyle) {
        var css = document.defaultView.getComputedStyle(element, null);
        value = css ? css.getPropertyValue(style) : null;
      } else if (element.currentStyle) {
        value = element.currentStyle[style.camelize()];
      }
    }

    if (window.opera && ['left', 'top', 'right', 'bottom'].include(style))
      if (Element.getStyle(element, 'position') == 'static') value = 'auto';

    return value == 'auto' ? null : value;
  },

  setStyle: function(element, style) {
    element = $(element);
    for (name in style)
      element.style[name.camelize()] = style[name];
  },

  getDimensions: function(element) {
    element = $(element);
    if (Element.getStyle(element, 'display') != 'none')
      return {width: element.offsetWidth, height: element.offsetHeight};

    // All *Width and *Height properties give 0 on elements with display none,
    // so enable the element temporarily
    var els = element.style;
    var originalVisibility = els.visibility;
    var originalPosition = els.position;
    els.visibility = 'hidden';
    els.position = 'absolute';
    els.display = '';
    var originalWidth = element.clientWidth;
    var originalHeight = element.clientHeight;
    els.display = 'none';
    els.position = originalPosition;
    els.visibility = originalVisibility;
    return {width: originalWidth, height: originalHeight};
  },

  makePositioned: function(element) {
    element = $(element);
    var pos = Element.getStyle(element, 'position');
    if (pos == 'static' || !pos) {
      element._madePositioned = true;
      element.style.position = 'relative';
      // Opera returns the offset relative to the positioning context, when an
      // element is position relative but top and left have not been defined
      if (window.opera) {
        element.style.top = 0;
        element.style.left = 0;
      }
    }
  },

  undoPositioned: function(element) {
    element = $(element);
    if (element._madePositioned) {
      element._madePositioned = undefined;
      element.style.position =
        element.style.top =
        element.style.left =
        element.style.bottom =
        element.style.right = '';
    }
  },

  makeClipping: function(element) {
    element = $(element);
    if (element._overflow) return;
    element._overflow = element.style.overflow;
    if ((Element.getStyle(element, 'overflow') || 'visible') != 'hidden')
      element.style.overflow = 'hidden';
  },

  undoClipping: function(element) {
    element = $(element);
    if (element._overflow) return;
    element.style.overflow = element._overflow;
    element._overflow = undefined;
  }
});

var Toggle = new Object();
Toggle.display = Element.toggle;

/*--------------------------------------------------------------------------*/

Abstract.Insertion = function(adjacency) {
  this.adjacency = adjacency;
}

Abstract.Insertion.prototype = {
  initialize: function(element, content) {
    this.element = $(element);
    this.content = content.stripScripts();

    if (this.adjacency && this.element.insertAdjacentHTML) {
      try {
        this.element.insertAdjacentHTML(this.adjacency, this.content);
      } catch (e) {
        if (this.element.tagName.toLowerCase() == 'tbody') {
          this.insertContent(this.contentFromAnonymousTable());
        } else {
          throw e;
        }
      }
    } else {
      this.range = this.element.ownerDocument.createRange();
      if (this.initializeRange) this.initializeRange();
      this.insertContent([this.range.createContextualFragment(this.content)]);
    }

    setTimeout(function() {content.evalScripts()}, 10);
  },

  contentFromAnonymousTable: function() {
    var div = document.createElement('div');
    div.innerHTML = '<table><tbody>' + this.content + '</tbody></table>';
    return $A(div.childNodes[0].childNodes[0].childNodes);
  }
}

var Insertion = new Object();

Insertion.Before = Class.create();
Insertion.Before.prototype = Object.extend(new Abstract.Insertion('beforeBegin'), {
  initializeRange: function() {
    this.range.setStartBefore(this.element);
  },

  insertContent: function(fragments) {
    fragments.each((function(fragment) {
      this.element.parentNode.insertBefore(fragment, this.element);
    }).bind(this));
  }
});

Insertion.Top = Class.create();
Insertion.Top.prototype = Object.extend(new Abstract.Insertion('afterBegin'), {
  initializeRange: function() {
    this.range.selectNodeContents(this.element);
    this.range.collapse(true);
  },

  insertContent: function(fragments) {
    fragments.reverse(false).each((function(fragment) {
      this.element.insertBefore(fragment, this.element.firstChild);
    }).bind(this));
  }
});

Insertion.Bottom = Class.create();
Insertion.Bottom.prototype = Object.extend(new Abstract.Insertion('beforeEnd'), {
  initializeRange: function() {
    this.range.selectNodeContents(this.element);
    this.range.collapse(this.element);
  },

  insertContent: function(fragments) {
    fragments.each((function(fragment) {
      this.element.appendChild(fragment);
    }).bind(this));
  }
});

Insertion.After = Class.create();
Insertion.After.prototype = Object.extend(new Abstract.Insertion('afterEnd'), {
  initializeRange: function() {
    this.range.setStartAfter(this.element);
  },

  insertContent: function(fragments) {
    fragments.each((function(fragment) {
      this.element.parentNode.insertBefore(fragment,
        this.element.nextSibling);
    }).bind(this));
  }
});

/*--------------------------------------------------------------------------*/

Element.ClassNames = Class.create();
Element.ClassNames.prototype = {
  initialize: function(element) {
    this.element = $(element);
  },

  _each: function(iterator) {
    this.element.className.split(/\s+/).select(function(name) {
      return name.length > 0;
    })._each(iterator);
  },

  set: function(className) {
    this.element.className = className;
  },

  add: function(classNameToAdd) {
    if (this.include(classNameToAdd)) return;
    this.set(this.toArray().concat(classNameToAdd).join(' '));
  },

  remove: function(classNameToRemove) {
    if (!this.include(classNameToRemove)) return;
    this.set(this.select(function(className) {
      return className != classNameToRemove;
    }).join(' '));
  },

  toString: function() {
    return this.toArray().join(' ');
  }
}

Object.extend(Element.ClassNames.prototype, Enumerable);
var Field = {
  clear: function() {
    for (var i = 0; i < arguments.length; i++)
      $(arguments[i]).value = '';
  },

  focus: function(element) {
    $(element).focus();
  },

  present: function() {
    for (var i = 0; i < arguments.length; i++)
      if ($(arguments[i]).value == '') return false;
    return true;
  },

  select: function(element) {
    $(element).select();
  },

  activate: function(element) {
    element = $(element);
    element.focus();
    if (element.select)
      element.select();
  }
}

/*--------------------------------------------------------------------------*/

var Form = {
  serialize: function(form) {
    var elements = Form.getElements($(form));
    var queryComponents = new Array();

    for (var i = 0; i < elements.length; i++) {
      var queryComponent = Form.Element.serialize(elements[i]);
      if (queryComponent)
        queryComponents.push(queryComponent);
    }

    return queryComponents.join('&');
  },

  getElements: function(form) {
    form = $(form);
    var elements = new Array();

    for (tagName in Form.Element.Serializers) {
      var tagElements = form.getElementsByTagName(tagName);
      for (var j = 0; j < tagElements.length; j++)
        elements.push(tagElements[j]);
    }
    return elements;
  },

  getInputs: function(form, typeName, name) {
    form = $(form);
    var inputs = form.getElementsByTagName('input');

    if (!typeName && !name)
      return inputs;

    var matchingInputs = new Array();
    for (var i = 0; i < inputs.length; i++) {
      var input = inputs[i];
      if ((typeName && input.type != typeName) ||
          (name && input.name != name))
        continue;
      matchingInputs.push(input);
    }

    return matchingInputs;
  },

  disable: function(form) {
    var elements = Form.getElements(form);
    for (var i = 0; i < elements.length; i++) {
      var element = elements[i];
      element.blur();
      element.disabled = 'true';
    }
  },

  enable: function(form) {
    var elements = Form.getElements(form);
    for (var i = 0; i < elements.length; i++) {
      var element = elements[i];
      element.disabled = '';
    }
  },

  findFirstElement: function(form) {
    return Form.getElements(form).find(function(element) {
      return element.type != 'hidden' && !element.disabled &&
        ['input', 'select', 'textarea'].include(element.tagName.toLowerCase());
    });
  },

  focusFirstElement: function(form) {
    Field.activate(Form.findFirstElement(form));
  },

  reset: function(form) {
    $(form).reset();
  }
}

Form.Element = {
  serialize: function(element) {
    element = $(element);
    var method = element.tagName.toLowerCase();
    var parameter = Form.Element.Serializers[method](element);

    if (parameter) {
      var key = encodeURIComponent(parameter[0]);
      if (key.length == 0) return;

      if (parameter[1].constructor != Array)
        parameter[1] = [parameter[1]];

      return parameter[1].map(function(value) {
        return key + '=' + encodeURIComponent(value);
      }).join('&');
    }
  },

  getValue: function(element) {
    element = $(element);
    var method = element.tagName.toLowerCase();
    var parameter = Form.Element.Serializers[method](element);

    if (parameter)
      return parameter[1];
  }
}

Form.Element.Serializers = {
  input: function(element) {
    switch (element.type.toLowerCase()) {
      case 'submit':
      case 'hidden':
      case 'password':
      case 'text':
        return Form.Element.Serializers.textarea(element);
      case 'checkbox':
      case 'radio':
        return Form.Element.Serializers.inputSelector(element);
    }
    return false;
  },

  inputSelector: function(element) {
    if (element.checked)
      return [element.name, element.value];
  },

  textarea: function(element) {
    return [element.name, element.value];
  },

  select: function(element) {
    return Form.Element.Serializers[element.type == 'select-one' ?
      'selectOne' : 'selectMany'](element);
  },

  selectOne: function(element) {
    var value = '', opt, index = element.selectedIndex;
    if (index >= 0) {
      opt = element.options[index];
      value = opt.value;
      if (!value && !('value' in opt))
        value = opt.text;
    }
    return [element.name, value];
  },

  selectMany: function(element) {
    var value = new Array();
    for (var i = 0; i < element.length; i++) {
      var opt = element.options[i];
      if (opt.selected) {
        var optValue = opt.value;
        if (!optValue && !('value' in opt))
          optValue = opt.text;
        value.push(optValue);
      }
    }
    return [element.name, value];
  }
}

/*--------------------------------------------------------------------------*/

var $F = Form.Element.getValue;

/*--------------------------------------------------------------------------*/

Abstract.TimedObserver = function() {}
Abstract.TimedObserver.prototype = {
  initialize: function(element, frequency, callback) {
    this.frequency = frequency;
    this.element   = $(element);
    this.callback  = callback;

    this.lastValue = this.getValue();
    this.registerCallback();
  },

  registerCallback: function() {
    setInterval(this.onTimerEvent.bind(this), this.frequency * 1000);
  },

  onTimerEvent: function() {
    var value = this.getValue();
    if (this.lastValue != value) {
      this.callback(this.element, value);
      this.lastValue = value;
    }
  }
}

Form.Element.Observer = Class.create();
Form.Element.Observer.prototype = Object.extend(new Abstract.TimedObserver(), {
  getValue: function() {
    return Form.Element.getValue(this.element);
  }
});

Form.Observer = Class.create();
Form.Observer.prototype = Object.extend(new Abstract.TimedObserver(), {
  getValue: function() {
    return Form.serialize(this.element);
  }
});

/*--------------------------------------------------------------------------*/

Abstract.EventObserver = function() {}
Abstract.EventObserver.prototype = {
  initialize: function(element, callback) {
    this.element  = $(element);
    this.callback = callback;

    this.lastValue = this.getValue();
    if (this.element.tagName.toLowerCase() == 'form')
      this.registerFormCallbacks();
    else
      this.registerCallback(this.element);
  },

  onElementEvent: function() {
    var value = this.getValue();
    if (this.lastValue != value) {
      this.callback(this.element, value);
      this.lastValue = value;
    }
  },

  registerFormCallbacks: function() {
    var elements = Form.getElements(this.element);
    for (var i = 0; i < elements.length; i++)
      this.registerCallback(elements[i]);
  },

  registerCallback: function(element) {
    if (element.type) {
      switch (element.type.toLowerCase()) {
        case 'checkbox':
        case 'radio':
          Event.observe(element, 'click', this.onElementEvent.bind(this));
          break;
        case 'password':
        case 'text':
        case 'textarea':
        case 'select-one':
        case 'select-multiple':
          Event.observe(element, 'change', this.onElementEvent.bind(this));
          break;
      }
    }
  }
}

Form.Element.EventObserver = Class.create();
Form.Element.EventObserver.prototype = Object.extend(new Abstract.EventObserver(), {
  getValue: function() {
    return Form.Element.getValue(this.element);
  }
});

Form.EventObserver = Class.create();
Form.EventObserver.prototype = Object.extend(new Abstract.EventObserver(), {
  getValue: function() {
    return Form.serialize(this.element);
  }
});
if (!window.Event) {
  var Event = new Object();
}

Object.extend(Event, {
  KEY_BACKSPACE: 8,
  KEY_TAB:       9,
  KEY_RETURN:   13,
  KEY_ESC:      27,
  KEY_LEFT:     37,
  KEY_UP:       38,
  KEY_RIGHT:    39,
  KEY_DOWN:     40,
  KEY_DELETE:   46,

  element: function(event) {
    return event.target || event.srcElement;
  },

  isLeftClick: function(event) {
    return (((event.which) && (event.which == 1)) ||
            ((event.button) && (event.button == 1)));
  },

  pointerX: function(event) {
    return event.pageX || (event.clientX +
      (document.documentElement.scrollLeft || document.body.scrollLeft));
  },

  pointerY: function(event) {
    return event.pageY || (event.clientY +
      (document.documentElement.scrollTop || document.body.scrollTop));
  },

  stop: function(event) {
    if (event.preventDefault) {
      event.preventDefault();
      event.stopPropagation();
    } else {
      event.returnValue = false;
      event.cancelBubble = true;
    }
  },

  // find the first node with the given tagName, starting from the
  // node the event was triggered on; traverses the DOM upwards
  findElement: function(event, tagName) {
    var element = Event.element(event);
    while (element.parentNode && (!element.tagName ||
        (element.tagName.toUpperCase() != tagName.toUpperCase())))
      element = element.parentNode;
    return element;
  },

  observers: false,

  _observeAndCache: function(element, name, observer, useCapture) {
    if (!this.observers) this.observers = [];
    if (element.addEventListener) {
      this.observers.push([element, name, observer, useCapture]);
      element.addEventListener(name, observer, useCapture);
    } else if (element.attachEvent) {
      this.observers.push([element, name, observer, useCapture]);
      element.attachEvent('on' + name, observer);
    }
  },

  unloadCache: function() {
    if (!Event.observers) return;
    for (var i = 0; i < Event.observers.length; i++) {
      Event.stopObserving.apply(this, Event.observers[i]);
      Event.observers[i][0] = null;
    }
    Event.observers = false;
  },

  observe: function(element, name, observer, useCapture) {
    var element = $(element);
    useCapture = useCapture || false;

    if (name == 'keypress' &&
        (navigator.appVersion.match(/Konqueror|Safari|KHTML/)
        || element.attachEvent))
      name = 'keydown';

    this._observeAndCache(element, name, observer, useCapture);
  },

  stopObserving: function(element, name, observer, useCapture) {
    var element = $(element);
    useCapture = useCapture || false;

    if (name == 'keypress' &&
        (navigator.appVersion.match(/Konqueror|Safari|KHTML/)
        || element.detachEvent))
      name = 'keydown';

    if (element.removeEventListener) {
      element.removeEventListener(name, observer, useCapture);
    } else if (element.detachEvent) {
      element.detachEvent('on' + name, observer);
    }
  }
});

/* prevent memory leaks in IE */
Event.observe(window, 'unload', Event.unloadCache, false);
var Position = {
  // set to true if needed, warning: firefox performance problems
  // NOT neeeded for page scrolling, only if draggable contained in
  // scrollable elements
  includeScrollOffsets: false,

  // must be called before calling withinIncludingScrolloffset, every time the
  // page is scrolled
  prepare: function() {
    this.deltaX =  window.pageXOffset
                || document.documentElement.scrollLeft
                || document.body.scrollLeft
                || 0;
    this.deltaY =  window.pageYOffset
                || document.documentElement.scrollTop
                || document.body.scrollTop
                || 0;
  },

  realOffset: function(element) {
    var valueT = 0, valueL = 0;
    do {
      valueT += element.scrollTop  || 0;
      valueL += element.scrollLeft || 0;
      element = element.parentNode;
    } while (element);
    return [valueL, valueT];
  },

  cumulativeOffset: function(element) {
    var valueT = 0, valueL = 0;
    do {
      valueT += element.offsetTop  || 0;
      valueL += element.offsetLeft || 0;
      element = element.offsetParent;
    } while (element);
    return [valueL, valueT];
  },

  positionedOffset: function(element) {
    var valueT = 0, valueL = 0;
    do {
      valueT += element.offsetTop  || 0;
      valueL += element.offsetLeft || 0;
      element = element.offsetParent;
      if (element) {
        p = Element.getStyle(element, 'position');
        if (p == 'relative' || p == 'absolute') break;
      }
    } while (element);
    return [valueL, valueT];
  },

  offsetParent: function(element) {
    if (element.offsetParent) return element.offsetParent;
    if (element == document.body) return element;

    while ((element = element.parentNode) && element != document.body)
      if (Element.getStyle(element, 'position') != 'static')
        return element;

    return document.body;
  },

  // caches x/y coordinate pair to use with overlap
  within: function(element, x, y) {
    if (this.includeScrollOffsets)
      return this.withinIncludingScrolloffsets(element, x, y);
    this.xcomp = x;
    this.ycomp = y;
    this.offset = this.cumulativeOffset(element);

    return (y >= this.offset[1] &&
            y <  this.offset[1] + element.offsetHeight &&
            x >= this.offset[0] &&
            x <  this.offset[0] + element.offsetWidth);
  },

  withinIncludingScrolloffsets: function(element, x, y) {
    var offsetcache = this.realOffset(element);

    this.xcomp = x + offsetcache[0] - this.deltaX;
    this.ycomp = y + offsetcache[1] - this.deltaY;
    this.offset = this.cumulativeOffset(element);

    return (this.ycomp >= this.offset[1] &&
            this.ycomp <  this.offset[1] + element.offsetHeight &&
            this.xcomp >= this.offset[0] &&
            this.xcomp <  this.offset[0] + element.offsetWidth);
  },

  // within must be called directly before
  overlap: function(mode, element) {
    if (!mode) return 0;
    if (mode == 'vertical')
      return ((this.offset[1] + element.offsetHeight) - this.ycomp) /
        element.offsetHeight;
    if (mode == 'horizontal')
      return ((this.offset[0] + element.offsetWidth) - this.xcomp) /
        element.offsetWidth;
  },

  clone: function(source, target) {
    source = $(source);
    target = $(target);
    target.style.position = 'absolute';
    var offsets = this.cumulativeOffset(source);
    target.style.top    = offsets[1] + 'px';
    target.style.left   = offsets[0] + 'px';
    target.style.width  = source.offsetWidth + 'px';
    target.style.height = source.offsetHeight + 'px';
  },

  page: function(forElement) {
    var valueT = 0, valueL = 0;

    var element = forElement;
    do {
      valueT += element.offsetTop  || 0;
      valueL += element.offsetLeft || 0;

      // Safari fix
      if (element.offsetParent==document.body)
        if (Element.getStyle(element,'position')=='absolute') break;

    } while (element = element.offsetParent);

    element = forElement;
    do {
      valueT -= element.scrollTop  || 0;
      valueL -= element.scrollLeft || 0;
    } while (element = element.parentNode);

    return [valueL, valueT];
  },

  clone: function(source, target) {
    var options = Object.extend({
      setLeft:    true,
      setTop:     true,
      setWidth:   true,
      setHeight:  true,
      offsetTop:  0,
      offsetLeft: 0
    }, arguments[2] || {})

    // find page position of source
    source = $(source);
    var p = Position.page(source);

    // find coordinate system to use
    target = $(target);
    var delta = [0, 0];
    var parent = null;
    // delta [0,0] will do fine with position: fixed elements,
    // position:absolute needs offsetParent deltas
    if (Element.getStyle(target,'position') == 'absolute') {
      parent = Position.offsetParent(target);
      delta = Position.page(parent);
    }

    // correct by body offsets (fixes Safari)
    if (parent == document.body) {
      delta[0] -= document.body.offsetLeft;
      delta[1] -= document.body.offsetTop;
    }

    // set position
    if(options.setLeft)   target.style.left  = (p[0] - delta[0] + options.offsetLeft) + 'px';
    if(options.setTop)    target.style.top   = (p[1] - delta[1] + options.offsetTop) + 'px';
    if(options.setWidth)  target.style.width = source.offsetWidth + 'px';
    if(options.setHeight) target.style.height = source.offsetHeight + 'px';
  },

  absolutize: function(element) {
    element = $(element);
    if (element.style.position == 'absolute') return;
    Position.prepare();

    var offsets = Position.positionedOffset(element);
    var top     = offsets[1];
    var left    = offsets[0];
    var width   = element.clientWidth;
    var height  = element.clientHeight;

    element._originalLeft   = left - parseFloat(element.style.left  || 0);
    element._originalTop    = top  - parseFloat(element.style.top || 0);
    element._originalWidth  = element.style.width;
    element._originalHeight = element.style.height;

    element.style.position = 'absolute';
    element.style.top    = top + 'px';;
    element.style.left   = left + 'px';;
    element.style.width  = width + 'px';;
    element.style.height = height + 'px';;
  },

  relativize: function(element) {
    element = $(element);
    if (element.style.position == 'relative') return;
    Position.prepare();

    element.style.position = 'relative';
    var top  = parseFloat(element.style.top  || 0) - (element._originalTop || 0);
    var left = parseFloat(element.style.left || 0) - (element._originalLeft || 0);

    element.style.top    = top + 'px';
    element.style.left   = left + 'px';
    element.style.height = element._originalHeight;
    element.style.width  = element._originalWidth;
  }
}

// Safari returns margins on body which is incorrect if the child is absolutely
// positioned.  For performance reasons, redefine Position.cumulativeOffset for
// KHTML/WebKit only.
if (/Konqueror|Safari|KHTML/.test(navigator.userAgent)) {
  Position.cumulativeOffset = function(element) {
    var valueT = 0, valueL = 0;
    do {
      valueT += element.offsetTop  || 0;
      valueL += element.offsetLeft || 0;
      if (element.offsetParent == document.body)
        if (Element.getStyle(element, 'position') == 'absolute') break;

      element = element.offsetParent;
    } while (element);

    return [valueL, valueT];
  }
}// BEGIN ../../../js-modules/Ajax/lib/Ajax.js
/*==============================================================================
Ajax - Simple Ajax Support Library

DESCRIPTION:

This library defines simple cross-browser functions for rudimentary Ajax
support.

AUTHORS:

    Ingy döt Net <ingy@cpan.org>
    Kang-min Liu <gugod@gugod.org>
    Chris Dent <cdent@burningchrome.com>

COPYRIGHT:

Copyright Ingy döt Net 2006. All rights reserved.

Ajax.js is free software. 

This library is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or (at
your option) any later version.

This library 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 Lesser
General Public License for more details.

    http://www.gnu.org/copyleft/lesser.txt

 =============================================================================*/

/* NOTE: This code has been made to coexist with prototype.js which is
 * notorious for NOT PLAYING WELL WITH OTHERS! However, this library must be
 * imported *after* prototype.js, or it will be clobbered. :\
 */

if (! this.Ajax) Ajax = {};

Ajax.VERSION = '0.10';

// The simple user interface function to GET/PUT/POST. If no callback is
// used, the function is synchronous.

Ajax.get = function(url, callback, params) {
    if (! params) params = {};
    params.url = url;
    params.onComplete = callback;
    return (new Ajax.Req()).get(params);
}

Ajax.put = function(url, data, callback, params) {
    if (! params) params = {};
    params.url = url;
    params.data = data;
    params.onComplete = callback;
    return (new Ajax.Req()).put(params);
}

Ajax.post = function(url, data, callback, params) {
    if (! params) params = {};
    params.url = url;
    params.data = data;
    params.onComplete = callback;
    if (! params.contentType)
        params.contentType = 'application/x-www-form-urlencoded';
    return (new Ajax.Req()).post(params);
}

if (this.Ajax.Req)
    throw("Oh no, somebody else is using the Ajax.Req namespace!");

Ajax.Req = function () {};
proto = Ajax.Req.prototype;

// Allows one to override with something more drastic.
// Can even be done "on the fly" using a bookmarklet.
// As an example, the test suite overrides this to test error conditions.
proto.die = function(e) { throw(e) };

// Object interface
proto.get = function(params) {
    return this._send(params, 'GET', 'Accept');
}

proto.put = function(params) {
    return this._send(params, 'PUT', 'Content-Type');
}

proto.post = function(params) {
    return this._send(params, 'POST', 'Content-Type');
}

// Set up the Ajax object with a working XHR object.
proto._init_object = function(params) {
    for (key in params) {
        if (! key.match(/^url|data|onComplete|contentType$/))
            throw("Invalid Ajax parameter: " + key);
        this[key] = params[key];
    }

    if (! this.contentType)
        this.contentType = 'application/json';

    if (! this.url)
        throw("'url' required for Ajax get/post method");

    if (this.request)
        throw("Don't yet support multiple requests on the same Ajax object");

    this.request = new XMLHttpRequest();

    if (! this.request)
        return this.die("Your browser doesn't do Ajax");
    if (this.request.readyState != 0)
        return this.die("Ajax readyState should be 0");

    return this;
}

proto._send = function(params, request_type, header) {
    this._init_object(params);
    this.request.open(request_type, this.url, Boolean(this.onComplete));
    this.request.setRequestHeader(header, this.contentType);

    var self = this;
    if (this.onComplete) {
        this.request.onreadystatechange = function() {
            self._check_asynchronous();
        };
    }
    this.request.send(this.data);
    return Boolean(this.onComplete)
        ? this
        : this._check_synchronous();
}

// TODO Allow handlers for various readyStates and statusCodes.
// Make these be the default handlers.
proto._check_status = function() {
    var status = String(this.request.status);
    if (!status.match('^20[0-9]')) {
        return this.die(
            'Ajax request for "' + this.url +
            '" failed with status: ' + status
        );
    }
}

proto._check_synchronous = function() {
    this._check_status();
    return this.request.responseText;
}

proto._check_asynchronous = function() {
    if (this.request.readyState != 4) return;
    this._check_status();
    this.onComplete(this.request.responseText);
}

// IE support
if (window.ActiveXObject && !window.XMLHttpRequest) {
    window.XMLHttpRequest = function() {
        var name = (navigator.userAgent.toLowerCase().indexOf('msie 5') != -1)
            ? 'Microsoft.XMLHTTP' : 'Msxml2.XMLHTTP';
        return new ActiveXObject(name);
    }
}
// BEGIN ../../../js-modules/template.js
/**
 * TrimPath Template. Release 1.0.38.
 * Copyright (C) 2004, 2005 Metaha.
 * 
 * TrimPath Template is licensed under the GNU General Public License
 * and the Apache License, Version 2.0, as follows:
 *
 * This program 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.
 * 
 * This program is distributed 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 this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 * http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
var TrimPath;

// TODO: Debugging mode vs stop-on-error mode - runtime flag.
// TODO: Handle || (or) characters and backslashes.
// TODO: Add more modifiers.

(function() {               // Using a closure to keep global namespace clean.
    if (TrimPath == null)
        TrimPath = new Object();
    if (TrimPath.evalEx == null)
        TrimPath.evalEx = function(src) { return eval(src); };

    var UNDEFINED;
    if (Array.prototype.pop == null)  // IE 5.x fix from Igor Poteryaev.
        Array.prototype.pop = function() {
            if (this.length === 0) {return UNDEFINED;}
            return this[--this.length];
        };
    if (Array.prototype.push == null) // IE 5.x fix from Igor Poteryaev.
        Array.prototype.push = function() {
            for (var i = 0; i < arguments.length; ++i) {this[this.length] = arguments[i];}
            return this.length;
        };

    TrimPath.parseTemplate = function(tmplContent, optTmplName, optEtc) {
        if (optEtc == null)
            optEtc = TrimPath.parseTemplate_etc;
        var funcSrc = parse(tmplContent, optTmplName, optEtc);
        var func = TrimPath.evalEx(funcSrc, optTmplName, 1);
        if (func != null)
            return new optEtc.Template(optTmplName, tmplContent, funcSrc, func, optEtc);
        return null;
    }
    
    try {
        String.prototype.process = function(context, optFlags) {
            var template = TrimPath.parseTemplate(this, null);
            if (template != null)
                return template.process(context, optFlags);
            return this;
        }
    } catch (e) { // Swallow exception, such as when String.prototype is sealed.
    }
    
    TrimPath.parseTemplate_etc = {};            // Exposed for extensibility.
    TrimPath.parseTemplate_etc.statementTag = "forelse|for|if|elseif|else|var|macro";
    TrimPath.parseTemplate_etc.statementDef = { // Lookup table for statement tags.
        "if"     : { delta:  1, prefix: "if (", suffix: ") {", paramMin: 1 },
        "else"   : { delta:  0, prefix: "} else {" },
        "elseif" : { delta:  0, prefix: "} else if (", suffix: ") {", paramDefault: "true" },
        "/if"    : { delta: -1, prefix: "}" },
        "for"    : { delta:  1, paramMin: 3, 
                     prefixFunc : function(stmtParts, state, tmplName, etc) {
                        if (stmtParts[2] != "in")
                            throw new etc.ParseError(tmplName, state.line, "bad for loop statement: " + stmtParts.join(' '));
                        var iterVar = stmtParts[1];
                        var listVar = "__LIST__" + iterVar;
                        return [ "var ", listVar, " = ", stmtParts[3], ";",
                             // Fix from Ross Shaull for hash looping, make sure that we have an array of loop lengths to treat like a stack.
                             "var __LENGTH_STACK__;",
                             "if (typeof(__LENGTH_STACK__) == 'undefined' || !__LENGTH_STACK__.length) __LENGTH_STACK__ = new Array();", 
                             "__LENGTH_STACK__[__LENGTH_STACK__.length] = 0;", // Push a new for-loop onto the stack of loop lengths.
                             "if ((", listVar, ") != null) { ",
                             "var ", iterVar, "_ct = 0;",       // iterVar_ct variable, added by B. Bittman     
                             "for (var ", iterVar, "_index in ", listVar, ") { ",
                             iterVar, "_ct++;",
                             "if (typeof(", listVar, "[", iterVar, "_index]) == 'function') {continue;}", // IE 5.x fix from Igor Poteryaev.
                             "__LENGTH_STACK__[__LENGTH_STACK__.length - 1]++;",
                             "var ", iterVar, " = ", listVar, "[", iterVar, "_index];" ].join("");
                     } },
        "forelse" : { delta:  0, prefix: "} } if (__LENGTH_STACK__[__LENGTH_STACK__.length - 1] == 0) { if (", suffix: ") {", paramDefault: "true" },
        "/for"    : { delta: -1, prefix: "} }; delete __LENGTH_STACK__[__LENGTH_STACK__.length - 1];" }, // Remove the just-finished for-loop from the stack of loop lengths.
        "var"     : { delta:  0, prefix: "var ", suffix: ";" },
        "macro"   : { delta:  1, 
                      prefixFunc : function(stmtParts, state, tmplName, etc) {
                          var macroName = stmtParts[1].split('(')[0];
                          return [ "var ", macroName, " = function", 
                                   stmtParts.slice(1).join(' ').substring(macroName.length),
                                   "{ var _OUT_arr = []; var _OUT = { write: function(m) { if (m) _OUT_arr.push(m); } }; " ].join('');
                     } }, 
        "/macro"  : { delta: -1, prefix: " return _OUT_arr.join(''); };" }
    }
    TrimPath.parseTemplate_etc.modifierDef = {
        "eat"        : function(v)    { return ""; },
        "escape"     : function(s)    { return String(s).replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;"); },
        "capitalize" : function(s)    { return String(s).toUpperCase(); },
        "default"    : function(s, d) { return s != null ? s : d; }
    }
    TrimPath.parseTemplate_etc.modifierDef.h = TrimPath.parseTemplate_etc.modifierDef.escape;

    TrimPath.parseTemplate_etc.Template = function(tmplName, tmplContent, funcSrc, func, etc) {
        this.process = function(context, flags) {
            if (context == null)
                context = {};
            if (context._MODIFIERS == null)
                context._MODIFIERS = {};
            if (context.defined == null)
                context.defined = function(str) { return (context[str] != undefined); };
            for (var k in etc.modifierDef) {
                if (context._MODIFIERS[k] == null)
                    context._MODIFIERS[k] = etc.modifierDef[k];
            }
            if (flags == null)
                flags = {};
            var resultArr = [];
            var resultOut = { write: function(m) { resultArr.push(m); } };
            try {
                func(resultOut, context, flags);
            } catch (e) {
                if (flags.throwExceptions == true)
                    throw e;
                var result = new String(resultArr.join("") + "[ERROR: " + e.toString() + (e.message ? '; ' + e.message : '') + "]");
                result["exception"] = e;
                return result;
            }
            return resultArr.join("");
        }
        this.name       = tmplName;
        this.source     = tmplContent; 
        this.sourceFunc = funcSrc;
        this.toString   = function() { return "TrimPath.Template [" + tmplName + "]"; }
    }
    TrimPath.parseTemplate_etc.ParseError = function(name, line, message) {
        this.name    = name;
        this.line    = line;
        this.message = message;
    }
    TrimPath.parseTemplate_etc.ParseError.prototype.toString = function() { 
        return ("TrimPath template ParseError in " + this.name + ": line " + this.line + ", " + this.message);
    }
    
    var parse = function(body, tmplName, etc) {
        body = cleanWhiteSpace(body);
        var funcText = [ "var TrimPath_Template_TEMP = function(_OUT, _CONTEXT, _FLAGS) { with (_CONTEXT) {" ];
        var state    = { stack: [], line: 1 };                              // TODO: Fix line number counting.
        var endStmtPrev = -1;
        while (endStmtPrev + 1 < body.length) {
            var begStmt = endStmtPrev;
            // Scan until we find some statement markup.
            begStmt = body.indexOf("{", begStmt + 1);
            while (begStmt >= 0) {
                var endStmt = body.indexOf('}', begStmt + 1);
                var stmt = body.substring(begStmt, endStmt);
                var blockrx = stmt.match(/^\{(cdata|minify|eval)/); // From B. Bittman, minify/eval/cdata implementation.
                if (blockrx) {
                    var blockType = blockrx[1]; 
                    var blockMarkerBeg = begStmt + blockType.length + 1;
                    var blockMarkerEnd = body.indexOf('}', blockMarkerBeg);
                    if (blockMarkerEnd >= 0) {
                        var blockMarker;
                        if( blockMarkerEnd - blockMarkerBeg <= 0 ) {
                            blockMarker = "{/" + blockType + "}";
                        } else {
                            blockMarker = body.substring(blockMarkerBeg + 1, blockMarkerEnd);
                        }                        
                        
                        var blockEnd = body.indexOf(blockMarker, blockMarkerEnd + 1);
                        if (blockEnd >= 0) {                            
                            emitSectionText(body.substring(endStmtPrev + 1, begStmt), funcText);
                            
                            var blockText = body.substring(blockMarkerEnd + 1, blockEnd);
                            if (blockType == 'cdata') {
                                emitText(blockText, funcText);
                            } else if (blockType == 'minify') {
                                emitText(scrubWhiteSpace(blockText), funcText);
                            } else if (blockType == 'eval') {
                                if (blockText != null && blockText.length > 0) // From B. Bittman, eval should not execute until process().
                                    funcText.push('_OUT.write( (function() { ' + blockText + ' })() );');
                            }
                            begStmt = endStmtPrev = blockEnd + blockMarker.length - 1;
                        }
                    }                        
                } else if (body.charAt(begStmt - 1) != '$' &&               // Not an expression or backslashed,
                           body.charAt(begStmt - 1) != '\\') {              // so check if it is a statement tag.
                    var offset = (body.charAt(begStmt + 1) == '/' ? 2 : 1); // Close tags offset of 2 skips '/'.
                                                                            // 10 is larger than maximum statement tag length.
                    if (body.substring(begStmt + offset, begStmt + 10 + offset).search(TrimPath.parseTemplate_etc.statementTag) == 0) 
                        break;                                              // Found a match.
                }
                begStmt = body.indexOf("{", begStmt + 1);
            }
            if (begStmt < 0)                              // In "a{for}c", begStmt will be 1.
                break;
            var endStmt = body.indexOf("}", begStmt + 1); // In "a{for}c", endStmt will be 5.
            if (endStmt < 0)
                break;
            emitSectionText(body.substring(endStmtPrev + 1, begStmt), funcText);
            emitStatement(body.substring(begStmt, endStmt + 1), state, funcText, tmplName, etc);
            endStmtPrev = endStmt;
        }
        emitSectionText(body.substring(endStmtPrev + 1), funcText);
        if (state.stack.length != 0)
            throw new etc.ParseError(tmplName, state.line, "unclosed, unmatched statement(s): " + state.stack.join(","));
        funcText.push("}}; TrimPath_Template_TEMP");
        return funcText.join("");
    }
    
    var emitStatement = function(stmtStr, state, funcText, tmplName, etc) {
        var parts = stmtStr.slice(1, -1).split(' ');
        var stmt = etc.statementDef[parts[0]]; // Here, parts[0] == for/if/else/...
        if (stmt == null) {                    // Not a real statement.
            emitSectionText(stmtStr, funcText);
            return;
        }
        if (stmt.delta < 0) {
            if (state.stack.length <= 0)
                throw new etc.ParseError(tmplName, state.line, "close tag does not match any previous statement: " + stmtStr);
            state.stack.pop();
        } 
        if (stmt.delta > 0)
            state.stack.push(stmtStr);

        if (stmt.paramMin != null &&
            stmt.paramMin >= parts.length)
            throw new etc.ParseError(tmplName, state.line, "statement needs more parameters: " + stmtStr);
        if (stmt.prefixFunc != null)
            funcText.push(stmt.prefixFunc(parts, state, tmplName, etc));
        else 
            funcText.push(stmt.prefix);
        if (stmt.suffix != null) {
            if (parts.length <= 1) {
                if (stmt.paramDefault != null)
                    funcText.push(stmt.paramDefault);
            } else {
                for (var i = 1; i < parts.length; i++) {
                    if (i > 1)
                        funcText.push(' ');
                    funcText.push(parts[i]);
                }
            }
            funcText.push(stmt.suffix);
        }
    }

    var emitSectionText = function(text, funcText) {
        if (text.length <= 0)
            return;
        var nlPrefix = 0;               // Index to first non-newline in prefix.
        var nlSuffix = text.length - 1; // Index to first non-space/tab in suffix.
        while (nlPrefix < text.length && (text.charAt(nlPrefix) == '\n'))
            nlPrefix++;
        while (nlSuffix >= 0 && (text.charAt(nlSuffix) == ' ' || text.charAt(nlSuffix) == '\t'))
            nlSuffix--;
        if (nlSuffix < nlPrefix)
            nlSuffix = nlPrefix;
        if (nlPrefix > 0) {
            funcText.push('if (_FLAGS.keepWhitespace == true) _OUT.write("');
            var s = text.substring(0, nlPrefix).replace('\n', '\\n'); // A macro IE fix from BJessen.
            if (s.charAt(s.length - 1) == '\n')
            	s = s.substring(0, s.length - 1);
            funcText.push(s);
            funcText.push('");');
        }
        var lines = text.substring(nlPrefix, nlSuffix + 1).split('\n');
        for (var i = 0; i < lines.length; i++) {
            emitSectionTextLine(lines[i], funcText);
            if (i < lines.length - 1)
                funcText.push('_OUT.write("\\n");\n');
        }
        if (nlSuffix + 1 < text.length) {
            funcText.push('if (_FLAGS.keepWhitespace == true) _OUT.write("');
            var s = text.substring(nlSuffix + 1).replace('\n', '\\n');
            if (s.charAt(s.length - 1) == '\n')
            	s = s.substring(0, s.length - 1);
            funcText.push(s);
            funcText.push('");');
        }
    }
    
    var emitSectionTextLine = function(line, funcText) {
        var endMarkPrev = '}';
        var endExprPrev = -1;
        while (endExprPrev + endMarkPrev.length < line.length) {
            var begMark = "${", endMark = "}";
            var begExpr = line.indexOf(begMark, endExprPrev + endMarkPrev.length); // In "a${b}c", begExpr == 1
            if (begExpr < 0)
                break;
            if (line.charAt(begExpr + 2) == '%') {
                begMark = "${%";
                endMark = "%}";
            }
            var endExpr = line.indexOf(endMark, begExpr + begMark.length);         // In "a${b}c", endExpr == 4;
            if (endExpr < 0)
                break;
            emitText(line.substring(endExprPrev + endMarkPrev.length, begExpr), funcText);                
            // Example: exprs == 'firstName|default:"John Doe"|capitalize'.split('|')
            var exprArr = line.substring(begExpr + begMark.length, endExpr).replace(/\|\|/g, "#@@#").split('|');
            for (var k in exprArr) {
                if (exprArr[k].replace) // IE 5.x fix from Igor Poteryaev.
                    exprArr[k] = exprArr[k].replace(/#@@#/g, '||');
            }
            funcText.push('_OUT.write(');
            emitExpression(exprArr, exprArr.length - 1, funcText); 
            funcText.push(');');
            endExprPrev = endExpr;
            endMarkPrev = endMark;
        }
        emitText(line.substring(endExprPrev + endMarkPrev.length), funcText); 
    }
    
    var emitText = function(text, funcText) {
        if (text == null ||
            text.length <= 0)
            return;
        text = text.replace(/\\/g, '\\\\');
        text = text.replace(/\n/g, '\\n');
        text = text.replace(/"/g,  '\\"');
        funcText.push('_OUT.write("');
        funcText.push(text);
        funcText.push('");');
    }
    
    var emitExpression = function(exprArr, index, funcText) {
        // Ex: foo|a:x|b:y1,y2|c:z1,z2 is emitted as c(b(a(foo,x),y1,y2),z1,z2)
        var expr = exprArr[index]; // Ex: exprArr == [firstName,capitalize,default:"John Doe"]
        if (index <= 0) {          // Ex: expr    == 'default:"John Doe"'
            funcText.push(expr);
            return;
        }
        var parts = expr.split(':');
        funcText.push('_MODIFIERS["');
        funcText.push(parts[0]); // The parts[0] is a modifier function name, like capitalize.
        funcText.push('"](');
        emitExpression(exprArr, index - 1, funcText);
        if (parts.length > 1) {
            funcText.push(',');
            funcText.push(parts[1]);
        }
        funcText.push(')');
    }

    var cleanWhiteSpace = function(result) {
        result = result.replace(/\t/g,   "    ");
        result = result.replace(/\r\n/g, "\n");
        result = result.replace(/\r/g,   "\n");
        result = result.replace(/^(\s*\S*(\s+\S+)*)\s*$/, '$1'); // Right trim by Igor Poteryaev.
        return result;
    }

    var scrubWhiteSpace = function(result) {
        result = result.replace(/^\s+/g,   "");
        result = result.replace(/\s+$/g,   "");
        result = result.replace(/\s+/g,   " ");
        result = result.replace(/^(\s*\S*(\s+\S+)*)\s*$/, '$1'); // Right trim by Igor Poteryaev.
        return result;
    }

    // The DOM helper functions depend on DOM/DHTML, so they only work in a browser.
    // However, these are not considered core to the engine.
    //
    TrimPath.parseDOMTemplate = function(elementId, optDocument, optEtc) {
        if (optDocument == null)
            optDocument = document;
        var element = optDocument.getElementById(elementId);
        var content = element.value;     // Like textarea.value.
        if (content == null)
            content = element.innerHTML; // Like textarea.innerHTML.
        content = content.replace(/&lt;/g, "<").replace(/&gt;/g, ">");
        return TrimPath.parseTemplate(content, elementId, optEtc);
    }

    TrimPath.processDOMTemplate = function(elementId, context, optFlags, optDocument, optEtc) {
        return TrimPath.parseDOMTemplate(elementId, optDocument, optEtc).process(context, optFlags);
    }
}) ();
// BEGIN ../../../js-modules/DOM-Ready/lib/DOM/Ready.js
if ( typeof DOM == "undefined" ) DOM = {};

DOM.Ready = {};

DOM.Ready.VERSION = '0.14';

DOM.Ready.finalTimeout = 15;
DOM.Ready.timerInterval = 50;

/* This works for Mozilla */
if ( document.addEventListener ) {
    document.addEventListener
        ( "DOMContentLoaded", function () { DOM.Ready._isDone = 1; }, false );
}

DOM.Ready._checkDOMReady = function () {
    if ( DOM.Ready._isReady ) return DOM.Ready._isReady;

    if (    typeof document.getElementsByTagName != 'undefined'
         && typeof document.getElementById != 'undefined' 
         && ( document.getElementsByTagName('body')[0] != null
              || document.body != null ) ) {

        DOM.Ready._isReady = 1;
    }

    return DOM.Ready._isReady;

};

DOM.Ready._checkDOMDone = function () {
    /* IE (and Opera?) only */
    if ( document.readyState
         && ( document.readyState == "interactive"
              || document.readyState == "complete" ) ) {
        return 1;
    }

    return DOM.Ready._isDone;
};

DOM.Ready.onDOMReady = function (callback) {
    if ( DOM.Ready._checkDOMReady() ) {
        callback();
    }
    else {
        DOM.Ready._onDOMReadyCallbacks.push(callback);
    }
}

DOM.Ready.onDOMDone = function (callback) {
    if ( DOM.Ready._checkDOMDone() ) {
        callback();
    }
    else {
        DOM.Ready._onDOMDoneCallbacks.push(callback);
    }
}

DOM.Ready.onIdReady = function ( id, callback ) {
    if ( DOM.Ready._checkDOMReady() ) {
        var elt = document.getElementById(id);
        if (elt) {
            callback(elt);
            return;
        }
    }

    var callback_array = DOM.Ready._onIdReadyCallbacks[id];
    if ( ! callback_array ) {
        callback_array = [];
    }
    callback_array.push(callback);

    DOM.Ready._onIdReadyCallbacks[id] = callback_array;
}

DOM.Ready._runDOMReadyCallbacks = function () {
    for ( var i = 0; i < DOM.Ready._onDOMReadyCallbacks.length; i++ ) {
        DOM.Ready._onDOMReadyCallbacks[i]();
    }

    DOM.Ready._onDOMReadyCallbacks = [];
}

DOM.Ready._runDOMDoneCallbacks = function () {
    for ( var i = 0; i < DOM.Ready._onDOMDoneCallbacks.length; i++ ) {
        DOM.Ready._onDOMDoneCallbacks[i]();
    }

    DOM.Ready._onDOMDoneCallbacks = [];
}

DOM.Ready._runIdCallbacks = function () {
    for ( var id in DOM.Ready._onIdReadyCallbacks ) {
        // protect against changes to Object (ala prototype's extend)
        if ( ! DOM.Ready._onIdReadyCallbacks.hasOwnProperty(id) ) {
            continue;
        }

        var elt = document.getElementById(id);

        if (elt) {
            for ( var i = 0; i < DOM.Ready._onIdReadyCallbacks[id].length; i++) {
                DOM.Ready._onIdReadyCallbacks[id][i](elt);
            }

            delete DOM.Ready._onIdReadyCallbacks[id];
        }
    }
}

DOM.Ready._runReadyCallbacks = function () {
    if ( DOM.Ready._inRunReadyCallbacks ) return;

    DOM.Ready._inRunReadyCallbacks = 1;

    if ( DOM.Ready._checkDOMReady() ) {
        DOM.Ready._runDOMReadyCallbacks();

        DOM.Ready._runIdCallbacks();
    }

    if ( DOM.Ready._checkDOMDone() ) {
        DOM.Ready._runDOMDoneCallbacks();
    }

    DOM.Ready._timePassed += DOM.Ready._lastTimerInterval;

    if ( ( DOM.Ready._timePassed / 1000 ) >= DOM.Ready.finalTimeout ) {
        DOM.Ready._stopTimer();
    }

    DOM.Ready._inRunReadyCallbacks = 0;
}

DOM.Ready._startTimer = function () {
    DOM.Ready._lastTimerInterval = DOM.Ready.timerInterval;
    DOM.Ready._intervalId = setInterval( DOM.Ready._runReadyCallbacks, DOM.Ready.timerInterval );
};

DOM.Ready._stopTimer = function () {
    clearInterval( DOM.Ready._intervalId );
    DOM.Ready._intervalId = null;
}

DOM.Ready._resetClass = function () {
    DOM.Ready._stopTimer();

    DOM.Ready._timePassed = 0;

    DOM.Ready._isReady = 0;
    DOM.Ready._isDone = 0;

    DOM.Ready._onDOMReadyCallbacks = [];
    DOM.Ready._onDOMDoneCallbacks = [];
    DOM.Ready._onIdReadyCallbacks = {};

    DOM.Ready._startTimer();
}

DOM.Ready._resetClass();

DOM.Ready.runCallbacks = function () { DOM.Ready._runReadyCallbacks() };


/*

*/
// BEGIN ../../../js-modules/DOM-Events/lib/DOM/Events.js
/**

=head1 NAME

DOM.Events - Event registration abstraction layer

=head1 SYNOPSIS

  JSAN.use("DOM.Events");

  function handleClick(e) {
      e.currentTarget.style.backgroundColor = "#68b";
  }

  DOM.Events.addListener(window, "load", function () {
      alert("The page is loaded.");
  });

  DOM.Events.addListener(window, "load", function () {
      // this listener won't interfere with the first one
      var divs = document.getElementsByTagName("div");
      for(var i=0; i<divs.length; i++) {
          DOM.Events.addListener(divs[i], "click", handleClick);
      }
  });

=head1 DESCRIPTION

This library lets you use a single interface to listen for and handle all DOM events
to reduce browser-specific code branching.  It also helps in dealing with Internet
Explorer's memory leak problem by automatically unsetting all event listeners when
the page is unloaded (for IE only).

=cut

*/

(function () {
	if(typeof DOM == "undefined") DOM = {};
	DOM.Events = {};
	
    DOM.Events.VERSION = "0.02";
	DOM.Events.EXPORT = [];
	DOM.Events.EXPORT_OK = ["addListener", "removeListener"];
	DOM.Events.EXPORT_TAGS = {
		":common": DOM.Events.EXPORT,
		":all": [].concat(DOM.Events.EXPORT, DOM.Events.EXPORT_OK)
	};
	
	// list of event listeners set by addListener
	// offset 0 is null to prevent 0 from being used as a listener identifier
	var listenerList = [null];
	
/**

=head2 Functions

All functions are kept inside the namespace C<DOM.Events> and aren't exported
automatically.

=head3 addListener( S<I<HTMLElement> element,> S<I<string> eventType,>
S<I<Function> handler> S<[, I<boolean> makeCompatible = true] )>

Registers an event listener/handler on an element.  The C<eventType> string should
I<not> be prefixed with "on" (e.g. "mouseover" not "onmouseover"). If C<makeCompatible>
is C<true> (the default), the handler is put inside a wrapper that lets you handle the
events using parts of the DOM Level 2 Events model, even in Internet Explorer (and
behave-alikes). Specifically:

=over

=item *

The event object is passed as the first argument to the event handler, so you don't
have to access it through C<window.event>.

=item *

The event object has the properties C<target>, C<currentTarget>, and C<relatedTarget>
and the methods C<preventDefault()> and C<stopPropagation()> that behave as described
in the DOM Level 2 Events specification (for the most part).

=item *

If possible, the event object for mouse events will have the properties C<pageX> and
C<pageY> that contain the mouse's position relative to the document at the time the
event occurred.

=item *

If you attempt to set a duplicate event handler on an element, the duplicate will
still be added (this is different from the DOM2 Events model, where duplicates are
discarded).

=back

If C<makeCompatible> is C<false>, the arguments are simply passed to the browser's
native event registering facilities, which means you'll have to deal with event
incompatibilities yourself. However, if you don't need to access the event information,
doing it this way can be slightly faster and it gives you the option of unsetting the
handler with a different syntax (see below).

The return value is a positive integer identifier for the listener that can be used to
unregister it later on in your script.

=cut

*/
    
	DOM.Events.addListener = function(elt, ev, func, makeCompatible) {
		var usedFunc = func;
        var id = listenerList.length;
		if(makeCompatible == true || makeCompatible == undefined) {
			usedFunc = makeCompatibilityWrapper(elt, ev, func);
		}
		if(elt.addEventListener) {
			elt.addEventListener(ev, usedFunc, false);
			listenerList[id] = [elt, ev, usedFunc];
			return id;
		}
		else if(elt.attachEvent) {
			elt.attachEvent("on" + ev, usedFunc);
			listenerList[id] = [elt, ev, usedFunc];
			return id;
		}
		else return false;
	};
	
/**

=head3 removeListener( S<I<integer> identifier> )

Unregisters the event listener associated with the given identifier so that it will
no longer be called when the event fires.

  var listener = DOM.Events.addListener(myElement, "mousedown", myHandler);
  // later on ...
  DOM.Events.removeListener(listener);

=head3 removeListener( S<I<HTMLElement> element,> S<I<string> eventType,> S<I<Function> handler )>

This alternative syntax can be also be used to unset an event listener, but it can only
be used if C<makeCompatible> was C<false> when it was set.

=cut

*/

	DOM.Events.removeListener = function() {
		var elt, ev, func;
		if(arguments.length == 1 && listenerList[arguments[0]]) {
			elt  = listenerList[arguments[0]][0];
			ev   = listenerList[arguments[0]][1];
			func = listenerList[arguments[0]][2];
			delete listenerList[arguments[0]];
		}
		else if(arguments.length == 3) {
			elt  = arguments[0];
			ev   = arguments[1];
			func = arguments[2];
		}
		else return;
		
		if(elt.removeEventListener) {
			elt.removeEventListener(ev, func, false);
		}
		else if(elt.detachEvent) {
			elt.detachEvent("on" + ev, func);
		}
	};
	
    var rval;
    
    function makeCompatibilityWrapper(elt, ev, func) {
        return function (e) {
            rval = true;
            if(e == undefined && window.event != undefined)
                e = window.event;
            if(e.target == undefined && e.srcElement != undefined)
                e.target = e.srcElement;
            if(e.currentTarget == undefined)
                e.currentTarget = elt;
            if(e.relatedTarget == undefined) {
                if(ev == "mouseover" && e.fromElement != undefined)
                    e.relatedTarget = e.fromElement;
                else if(ev == "mouseout" && e.toElement != undefined)
                    e.relatedTarget = e.toElement;
            }
            if(e.pageX == undefined) {
                if(document.body.scrollTop != undefined) {
                    e.pageX = e.clientX + document.body.scrollLeft;
                    e.pageY = e.clientY + document.body.scrollTop;
                }
                if(document.documentElement != undefined
                && document.documentElement.scrollTop != undefined) {
                    if(document.documentElement.scrollTop > 0
                    || document.documentElement.scrollLeft > 0) {
                        e.pageX = e.clientX + document.documentElement.scrollLeft;
                        e.pageY = e.clientY + document.documentElement.scrollTop;
                    }
                }
            }
            if(e.stopPropagation == undefined)
                e.stopPropagation = IEStopPropagation;
            if(e.preventDefault == undefined)
                e.preventDefault = IEPreventDefault;
            if(e.cancelable == undefined) e.cancelable = true;
            func(e);
            return rval;
        };
    }
    
    function IEStopPropagation() {
        if(window.event) window.event.cancelBubble = true;
    }
    
    function IEPreventDefault() {
        rval = false;
    }

	function cleanUpIE () {
		for(var i=0; i<listenerList.length; i++) {
			var listener = listenerList[i];
			if(listener) {
				var elt = listener[0];
                var ev = listener[1];
                var func = listener[2];
				elt.detachEvent("on" + ev, func);
			}
		}
        listenerList = null;
	}

	if(!window.addEventListener && window.attachEvent) {
		window.attachEvent("onunload", cleanUpIE);
	}

})();

/**

=head1 SEE ALSO

DOM Level 2 Events Specification,
L<http://www.w3.org/TR/DOM-Level-2-Events/>

Understanding and Solving Internet Explorer Leak Patterns,
L<http://msdn.microsoft.com/library/default.asp?url=/library/en-us/IETechCol/dnwebgen/ie_leak_patterns.asp>

=head1 AUTHOR

Justin Constantino, <F<goflyapig@gmail.com>>.

=head1 COPYRIGHT

  Copyright (c) 2005 Justin Constantino.  All rights reserved.
  This module is free software; you can redistribute it and/or modify it
  under the terms of the GNU Lesser General Public Licence.

=cut

*/// BEGIN ../../../js-modules/Widget-SortableTable/lib/Widget/SortableTable.js
JSAN.use("DOM.Ready");
JSAN.use("DOM.Events");

if ( typeof Widget == "undefined" ) Widget = {};

Widget.SortableTable = function (params) {
    this._initialize(params);
};

Widget.SortableTable.VERSION = "0.21";

Widget.SortableTable.prototype._initialize = function (params) {
    if ( ! params ) {
        throw new Error("Cannot create a new Widget.SortableTable without parameters");
    }

    if ( ! params.tableId ) {
        throw new Error("Widget.SortableTable requires a tableId parameter");
    }

    this._initialSortColumn = params.initialSortColumn;
    if ( ! this._initialSortColumn ) {
        this._initialSortColumn = 0;
    }
    this._col_specs = [];
    if ( params.columnSpecs ) {
        for ( var i = 0; i < params.columnSpecs.length; i++ ) {
            if ( params.columnSpecs[i] ) {
                this._col_specs[i] = params.columnSpecs[i];
            }
        }
    }

    this._noInitialSort = params.noInitialSort;

    this._onSortRowCallback = params.onSortRowCallback;

    if ( ! params.secondarySortColumn ) {
        this._secondarySortColumn = 0;
    }
    else {
        this._secondarySortColumn = params.secondarySortColumn;
    }

    var self = this;
    DOM.Ready.onIdReady( params.tableId,
                         function (elt) { self._instrumentTable(elt) }
                       );
};

Widget.SortableTable._seenId = {};

Widget.SortableTable.prototype._instrumentTable = function (table) {
    this._table = table;

    var head = table.rows[0];

    if ( ! head ) {
        return;
    }

    for ( var i = 0; i < head.cells.length; i++ ) {
        if ( this._col_specs[i] && this._col_specs[i].skip ) {
            continue;
        }

        if ( ! Widget.SortableTable._seenId[ table.id ] ) {
            this._makeColumnSortable( head.cells[i], i );
        }

        this._removeCSSClass( head.cells[i], "w-st-desc-column-header" );
        this._removeCSSClass( head.cells[i], "w-st-asc-column-header" );
        this._addCSSClass( head.cells[i], "w-st-unsorted-column-header" );
    }

    if ( this._noInitialSort ) {
        this._setRowCSS();
    }
    else {
        this.sortOnColumn( this._initialSortColumn );
    }

    Widget.SortableTable._seenId[ table.id ] = true;
};

Widget.SortableTable.prototype._makeColumnSortable = function (cell, idx) {
    var href = document.createElement("a");
    href.setAttribute( "href", "#" );
    href.setAttribute( "onClick", "return false;" );
    href.className = "w-st-resort-column";

    this._moveChildTree( cell, href );
    cell.appendChild(href);

    var self = this;
    DOM.Events.addListener( href,
                            "click",
                            function () { self.sortOnColumn(idx); return false; }
                          );
};

Widget.SortableTable.prototype._moveChildTree = function (from, to) {
    if ( document.implementation.hasFeature( "Range", "2.0" ) ) {
        var range = document.createRange();
        range.selectNodeContents(from);

        to.appendChild( range.extractContents() );
    }
    else {
        /* XXX - this is gross but seems to work */
        to.innerHTML = from.innerHTML;
        from.innerHTML = "";
    }
};

Widget.SortableTable.prototype.sortOnColumn = function (idx) {
    if (! this._table ) {
        return;
    }

    if ( this._table.rows.length == 1 ) {
        return;
    }

    var cell_data = [];
    var rows = [];
    /* start at 1 to ignore the header row when sorting */
    for ( var i = 1; i < this._table.rows.length; i++ ) {
        var text = this._getAllText( this._table.rows[i].cells[idx] );
        var cell_info = { "primaryText": text, "rowNumber": i - 1 };
        if ( idx != this._secondarySortColumn ) {
            cell_info.secondaryText =
                this._getAllText( this._table.rows[i].cells[ this._secondarySortColumn ] );
        }

        cell_data.push(cell_info);
        rows.push( this._table.rows[i] );
    }

    var sort_info = this._sortFor( idx, cell_data[0].primaryText );
    if ( idx != this._secondarySortColumn ) {
        var sec_sort_info = this._sortFor( this._secondarySortColumn, cell_data[0].secondaryText );
        sort_info.secondaryFunc = sec_sort_info.func;
    }

    cell_data.sort( Widget.SortableTable._makeCellDataSorter
                        ( sort_info.func, sort_info.secondaryFunc ) );

    if ( sort_info.dir == "desc" ) {
        cell_data.reverse();
    }

    this._resortTable( cell_data, rows );

    this._updateCSSClasses( idx, sort_info.dir );

    this._lastSort = { "index": idx,
                       "dir":   sort_info.dir };
}

/* More or less copied from
 * http://www.kryogenix.org/code/browser/sorttable/sorttable.js
 */
Widget.SortableTable.prototype._getAllText = function (elt) {
    if ( typeof elt == "string") {
        return elt;
    }
    if ( typeof elt == "undefined") {
        return "";
    }

    var text = "";
	
    var children = elt.childNodes;
    for ( var i = 0; i < children.length; i++ ) {
        switch ( children[i].nodeType) {
        case 1: /* ELEMENT_NODE */
            text += this._getAllText( children[i] );
            break;
        case 3:	/* TEXT_NODE */
            text += children[i].nodeValue;
            break;
        }
    }

    return text;
};

Widget.SortableTable.prototype._sortFor = function (idx, content) {
    var func;
    var type; if ( this._col_specs[idx] && this._col_specs[idx].sort ) {
        if ( typeof this._col_specs[idx].sort == "function" ) {
            func = this._col_specs[idx].sort;
        }
        else {
            var sort_name = this._col_specs[idx].sort;
            type = sort_name;
            func = Widget.SortableTable._sortFunctionsByType[sort_name];
        }
    }

    if ( ! func ) {
        if ( content.match( /^\s*[\$\u20AC]\s*\d+(?:\.\d+)?\s*$/ ) ) {
            type = "currency";
            func = Widget.SortableTable._sortFunctionsByType.currency;
        }
        else if ( content.match( /^\s*\d+(?:\.\d+)?\s*$/ ) ) {
            type = "number";
            func = Widget.SortableTable._sortFunctionsByType.number;
        }
        else if ( content.match( /^\s*\d\d\d\d[^\d]+\d\d[^\d]+\d\d\s*$/ ) ) {
            type = "date";
            func = Widget.SortableTable._sortFunctionsByType.date;
        }
        else {
            type = "text";
            func = Widget.SortableTable._sortFunctionsByType.text;
        }
    }

    var dir;
    if ( this._col_specs[idx] && this._col_specs[idx].defaultDir ) {
        dir = this._col_specs[idx].defaultDir;
    }
    else if (type)  {
        dir = Widget.SortableTable._defaultDirByType[type];
    }
    else {
        dir = "asc";
    }

    if ( this._lastSort
         && this._lastSort.index == idx
         && this._lastSort.dir   == dir ) {
        dir = dir == "asc" ? "desc" : "asc";
    }

    return { "func": func,
             "dir":  dir };
};

Widget.SortableTable._sortCurrency = function (a, b) {
    var a_num = parseFloat( a.replace( /[^\d\.]/g, "" ) )
    var b_num = parseFloat( b.replace( /[^\d\.]/g, "" ) )

    return Widget.SortableTable._sortNumberOrNaN(a_num, b_num);
};

Widget.SortableTable._sortNumber = function (a, b) {
    var a_num = parseFloat(a);
    var b_num = parseFloat(b);

    return Widget.SortableTable._sortNumberOrNaN(a_num, b_num);
};

Widget.SortableTable._sortNumberOrNaN = function (a, b) {
    if ( isNaN(a) && isNaN(b) ) {
        return 0;
    }
    else if ( isNaN(a) ) {
        return -1;
    }
    else if ( isNaN(b) ) {
        return 1;
    }
    else if ( a < b ) {
        return -1;
    }
    else if ( a > b ) {
        return 1;
    }
    else {
        return 0;
    }
};

Widget.SortableTable._sortDate = function (a, b) {
    var a_match = a.match( /(\d\d\d\d)[^\d]+(\d\d)[^\d]+(\d\d)/ );
    var b_match = b.match( /(\d\d\d\d)[^\d]+(\d\d)[^\d]+(\d\d)/ );

    if ( ! a_match ) {
        a_match = [ "", -9999, 1, 1 ];
    }

    if ( ! b_match ) {
        b_match = [ "", -9999, 1, 1 ];
    }

    var a_date = new Date( a_match[1], a_match[2], a_match[3] );
    var b_date = new Date( b_match[1], b_match[2], b_match[3] );

    if ( a_date < b_date ) {
        return -1;
    }
    else if ( a_date > b_date ) {
        return 1;
    }
    else {
        return 0;
    }
};

Widget.SortableTable._sortText = function (a, b) {
    var a_text = a.toLowerCase();
    var b_text = b.toLowerCase();

    if ( a_text < b_text ) {
        return -1;
    }
    else if ( a_text > b_text ) {
        return 1;
    }
    else {
        return 0;
    }
};

Widget.SortableTable._sortFunctionsByType = {
    "currency": Widget.SortableTable._sortCurrency,
    "number":   Widget.SortableTable._sortNumber,
    "date":     Widget.SortableTable._sortDate,
    "text":     Widget.SortableTable._sortText
};

Widget.SortableTable._defaultDirByType = {
    "currency": "asc",
    "number":   "asc",
    "date":     "desc",
    "text":     "asc"
};

Widget.SortableTable._makeCellDataSorter = function ( real_func, secondary_func ) {
    return function(a, b) {
        var sort = real_func( a.primaryText, b.primaryText );
        if ( sort == 0 && secondary_func ) {
            return secondary_func( a.secondaryText, b.secondaryText );
        }
        return sort;
    };
};

Widget.SortableTable.prototype._resortTable = function (cell_data, rows) {
    for ( var i = 0; i < cell_data.length; i++ ) {
        var row = rows[ cell_data[i].rowNumber ];
        if ( i % 2 ) {
            this._removeCSSClass( row, "w-st-even-row" );
            this._addCSSClass( row, "w-st-odd-row" );
        }
        else {
            this._removeCSSClass( row, "w-st-odd-row" );
            this._addCSSClass( row, "w-st-even-row" );
        }

        if ( this._onSortRowCallback ) {
            this._onSortRowCallback( row, i + 1 );
        }

        this._table.tBodies[0].appendChild(row);
    }
};

Widget.SortableTable.prototype._setRowCSS = function () {
    for ( var i = 0; i < this._table.rows.length; i++ ) {
        if ( i % 2 ) {
            this._addCSSClass( this._table.rows[i], "w-st-even-row" );
            this._removeCSSClass( this._table.rows[i], "w-st-odd-row" );
        }
        else {
            this._addCSSClass( this._table.rows[i], "w-st-odd-row" );
            this._removeCSSClass( this._table.rows[i], "w-st-even-row" );
        }
    }
};

Widget.SortableTable.prototype._updateCSSClasses = function (idx, dir) {
    if ( ( ! this._lastSort )
         ||
         ( this._lastSort && this._lastSort.index != idx ) ) {

        for ( var i = 0; i < this._table.rows.length; i++ ) {
            this._addCSSClass( this._table.rows[i].cells[idx], "w-st-current-sorted-column" );
            if ( this._lastSort ) {
                old_idx = this._lastSort.index;
                this._removeCSSClass( this._table.rows[i].cells[old_idx], "w-st-current-sorted-column" );
            }
        }
    }

    if ( this._lastSort ) {
        var old_header_cell = this._table.rows[0].cells[ this._lastSort.index ];
        this._removeCSSClass(
            old_header_cell,
            this._lastSort.dir == "asc" ? "w-st-asc-column-header" : "w-st-desc-column-header" );
        this._addCSSClass( old_header_cell, "w-st-unsorted-column-header" );
    }

    var header_cell = this._table.rows[0].cells[idx];
    if ( this._lastSort && this._lastSort.index == idx ) {
        var old_dir = this._lastSort.dir;
        this._removeCSSClass( header_cell,
                              "w-st-" + old_dir + "-column-header" );
    }
    else {
        this._removeCSSClass( header_cell, "w-st-unsorted-column-header" );
    }
    this._addCSSClass( header_cell, "w-st-" + dir + "-column-header" );
};

Widget.SortableTable.prototype._addCSSClass = function (elt, add_class) {
    var class_regex = new RegExp(add_class);
    if ( ! elt.className.match(class_regex) ) {
        elt.className = elt.className + (elt.className.length ? " " : "" ) + add_class;
    }
};

Widget.SortableTable.prototype._removeCSSClass = function (elt, remove_class) {
    var class_regex = new RegExp( "\\s*" + remove_class );
    elt.className = elt.className.replace( class_regex, "" );
}


/*

*/
// BEGIN ../../../js-modules/Widget-Lightbox/lib/Widget/Lightbox.js
JSAN.use("DOM.Events");

if ( typeof Widget == "undefined" )
    Widget = {};

Widget.Lightbox = function(param) {
    this.win = window;
    this.doc = window.document;
    this.contentHTML = "";
    this.config = {
        clickBackgroundToHide: true
    };
    if ( param ) {
        if (param.divs ) {
            this.divs = {};
            for(var i in param.divs) {
                this.divs[i] = param.divs[i]
            }
            this.div = this.divs.wrapper;
            this.div.style.display="none";
        }
        if ( param.effects ) {
            this._effects = [];
            for (var i=0; i<param.effects.length; i++) {
                this._effects.push(param.effects[i]);
            }
        }
        if (param.wrapperClassName) {
            this.wrapperClassName = param.wrapperClassName;
        }
        else
            this.wrapperClassName = '';

        if (param.contentClassName) {
            this.contentClassName = param.contentClassName;
        }
        else
            this.contentClassName = '';
    }
    return this;
}

Widget.Lightbox.VERSION = '0.06';
Widget.Lightbox.EXPORT = [];
Widget.Lightbox.EXPORT_OK = [];
Widget.Lightbox.EXPORT_TAGS = {};

Widget.Lightbox.is_ie = function() {
    ua = navigator.userAgent.toLowerCase();
    is_ie = (
        ua.indexOf("msie") != -1 &&
        ua.indexOf("opera") == -1 &&
        ua.indexOf("webtv") == -1
    );
    return is_ie;
}();

Widget.Lightbox.show = function(param) {
    if ( typeof param == 'string' ) {
        var box = new Widget.Lightbox;
        box.content(param);
        box.show();
        return box;
    }
    else {
        var box = new Widget.Lightbox(param);
        box.show();
        return box;
    }
}

Widget.Lightbox.prototype.show = function(callback) {
    this.scrollable = "no";
    var div = this.create();
    if ( this.div.style.display== "none" )
        this.div.style.display="block";
    this.applyStyle();
    this.applyHandlers();
    this.applyEffects();

    if ( typeof callback == 'function') {
        callback(div);
    }
}

Widget.Lightbox.prototype.hide = function() {
    if (this.div.parentNode) {
        this.div.style.display="none";
        if (Widget.Lightbox.is_ie) {
            document.body.scroll = this.scrollable = "yes";
        }
    }
}

Widget.Lightbox.prototype.content = function(content) {
    if ( typeof content != 'undefined' ) {
        this._content = content;
    }
    return this._content;
}

Widget.Lightbox.prototype.create = function() {
    if (typeof this.div != 'undefined') {
        return this.div;
    }

    var wrapperDiv = this.doc.createElement("div");
    wrapperDiv.className = "jsan-widget-lightbox";

    var contentDiv = this.doc.createElement("div");

    if (this.contentClassName) {
        contentDiv.className = this.contentClassName;
    }
    else {
        contentDiv.className = "jsan-widget-lightbox-content";
    }

    if ( typeof this._content == 'object' ) {
        if ( this._content.nodeType && this._content.nodeType == 1 ) {
            contentDiv.appendChild( this._content );
        }
    }
    else {
        contentDiv.innerHTML = this._content;
    }

    var contentWrapperDiv = this.doc.createElement("div");
    if (this.wrapperClassName) {
        contentWrapperDiv.className = this.wrapperClassName;
    }
    else {
        contentWrapperDiv.className = "jsan-widget-lightbox-content-wrapper";
    }

    var bgDiv = this.doc.createElement("div");
    bgDiv.className = "jsan-widget-lightbox-background";

    contentWrapperDiv.appendChild(contentDiv);

    wrapperDiv.appendChild(bgDiv);
    wrapperDiv.appendChild(contentWrapperDiv);

    this.div = wrapperDiv;
    this.divs = {
        wrapper: wrapperDiv,
        background: bgDiv,
        content: contentDiv,
        contentWrapper: contentWrapperDiv
    };
    wrapperDiv.style.display = "none";
    this.doc.body.appendChild(this.div);
    return this.div;
}


Widget.Lightbox.prototype.applyStyle = function() {
    var divs = this.divs;
    with(divs.wrapper.style) {
        position= Widget.Lightbox.is_ie ? 'absolute': 'fixed';
        top=0;
        left=0;
        width='100%';
        height='100%';
        padding=0;
        margin=0;
    }
    with(divs.background.style) {
        position= Widget.Lightbox.is_ie ? 'absolute': 'fixed';
        background="#000";
        opacity="0.5";
        filter = "alpha(opacity=50)";
        top=0;
        left=0;
        width="100%";
        height="100%";
        zIndex=2000;
        padding=0;
        margin=0;
    }

    divs.contentWrapper.style.position = Widget.Lightbox.is_ie ? 'absolute': 'fixed';

    if (this.wrapperClassName) {
        divs.contentWrapper.className = this.wrapperClassName;
    }
    else {
        with(divs.contentWrapper.style) {
            zIndex=2001;
            padding=0;
            background='#fff';
            width='520px';
            margin='100px auto';
            border="1px outset #555";
        }
    }

    with(divs.content.style) {
        margin='5px';
    }

    var win_height = document.body.clientHeight;
    var win_width = document.body.clientWidth;
    var my_width = divs.content.offsetWidth;
    var my_left = (win_width - my_width) /2;
    my_left = (my_left < 0)? 0 : my_left + "px";
    divs.contentWrapper.style.left = my_left;

    if ( Widget.Lightbox.is_ie ) {
        document.body.scroll = this.scrollable;
        divs.background.style.height = win_height;
    }
}

Widget.Lightbox.prototype.applyHandlers = function(){
    if(!this.div)
        return;

    var self = this;

    if ( this.config.clickBackgroundToHide == true ) {
        DOM.Events.addListener(this.divs.background, "click", function () {
            self.hide();
        });
    }
    if (Widget.Lightbox.is_ie) {
        DOM.Events.addListener(window, "resize", function () {
            self.applyStyle();
        });
    }
}

Widget.Lightbox.prototype.effects = function() {
    if ( arguments.length > 0 ) {
        this._effects = [];
        for (var i=0; i<arguments.length; i++) {
            this._effects.push(arguments[i]);
        }
    }
    return this._effects;
}

Widget.Lightbox.prototype.applyEffects = function() {
    if (!this._effects)
        return;
    for (var i=0;i<this._effects.length;i++) {
        this.applyEffect(this._effects[i]);
    }
}

Widget.Lightbox.prototype.applyEffect = function(effect) {
    var func_name = "applyEffect" + effect;
    if ( typeof this[func_name] == 'function') {
        this[func_name]();
    }
}

// Require Effect.RoundedCorners
Widget.Lightbox.prototype.applyEffectRoundedCorners = function() {
    divs = this.divs
    if ( ! divs ) { return; }
    if ( typeof Effect.RoundedCorners == 'undefined' ) { return; }
    divs.contentWrapper.style.border="none";
    var bs = divs.contentWrapper.getElementsByTagName("b");
    for (var i = 0; i < bs.length; i++) {
        if(bs[i].className.match(/rounded-corners-/)) {
            return;
        }
    }
    for (var i=1; i< 5; i++) {
        Effect.RoundedCorners._Styles.push(
            [ ".rounded-corners-" + i,
              "opacity: 0.4",
              "filter: alpha(opacity=40)"
             ]
        );
    }

    Effect.RoundedCorners._addStyles();
    Effect.RoundedCorners._roundCorners(
        divs.contentWrapper,
        {   'top': true,
            'bottom':true,
            'color':'black'
            }
        );
}

// A Generator function for scriptaculous effects.
;(function () {
    var effects = ['Appear', 'Grow', 'BlindDown', 'Shake'];
    for (var i=0; i<effects.length; i++) {
        var name = "applyEffect" + effects[i];
        Widget.Lightbox.prototype[name] = function(effect) {
            return function() {
                if ( ! this.divs ) { return; }
                if ( typeof Effect[effect] == 'undefined' ) { return; }
                if (effect != 'Shake')
                    this.divs.contentWrapper.style.display="none";
                Effect[effect](this.divs.contentWrapper, { duration: 2.0 });
            }
        }(effects[i]);
    }
})();



/**

*/
// BEGIN ../../../js-modules/Widget-Lightbox/tests/lib/Effect/RoundedCorners.js
JSAN.use("DOM.Ready");

if ( typeof Effect == "undefined" ) Effect = {};

Effect.RoundedCorners = {};

Effect.RoundedCorners.VERSION = "0.12";

Effect.RoundedCorners.roundCorners = function (params) {
    if ( typeof params == "string" ) {
        params = { "elementId": params };
    }

    if ( ! params["elementId"] ) {
        throw new Error("Effect.RoundedCorners requires an elementId parameter");
    }

    Effect.RoundedCorners._addStyles();

    if ( ! params.hasOwnProperty("top") ) {
        params["top"] = true;
    }

    if ( ! params.hasOwnProperty("bottom") ) {
        params["bottom"] = true;
    }

    var callback = function () {
        var elt = document.getElementById( params.elementId );
        if ( ! elt ) { return }
        Effect.RoundedCorners._roundCorners( elt, params );
    };
    DOM.Ready.onDOMDone(callback);
}

Effect.RoundedCorners._roundCorners = function (elt, params) {
    var color = params["color"];
    if ( ! color ) {
        var current_elt = elt.parentNode;
        while ( current_elt && ( ! color || color == "transparent" ) ) {
            try {
                color = window.getComputedStyle( current_elt, null ).backgroundColor;
            }
            /* at least on Firefox calling getComputedStyle on the
             * root HTML node seems to produce an error */
            catch (e) {}
            current_elt = current_elt.parentNode;
        }

        if ( color == undefined || color == "transparent" ) {
            color = "white";
        }
    }

    if ( params["top"] ) {
        Effect.RoundedCorners._roundUpperCorners( elt, color );
    }

    if ( params["bottom"] ) {
        Effect.RoundedCorners._roundBottomCorners( elt, color );
    }

}

Effect.RoundedCorners._roundUpperCorners = function (elt, color) {
    var container =
       Effect.RoundedCorners._makeElements( color, [ "1", "2", "3", "4" ] );

    elt.insertBefore( container, elt.firstChild );
}

Effect.RoundedCorners._roundBottomCorners = function (elt, color) {
    var container =
       Effect.RoundedCorners._makeElements( color, [ "4", "3", "2", "1" ] );

    elt.appendChild(container);
}

var foo = 1;
Effect.RoundedCorners._makeElements = function (color, order) {
    var container = document.createElement("b");
    container.className = "rounded-corners-container";

    while ( order.length ) {
        var b_tag = document.createElement("b");
        b_tag.className = "rounded-corners-" + order.shift();
        b_tag.style.backgroundColor = "transparent";
        b_tag.style.borderColor = color;

        container.appendChild(b_tag);
    }

    return container;
}

Effect.RoundedCorners._Styles = [
    [ ".rounded-corners-container",
      "display: block",
      "background-color: transparent" ],

    [ ".rounded-corners-container *",
      "display: block",
      "height: 1px",
      "overflow: hidden",
      "font-size: 1px",
      "border-style: solid",
      "border-width: 0px 1px"
    ],

    [ ".rounded-corners-1",
      "border-left-width: 5px",
      "border-right-width: 5px"
    ],

    [ ".rounded-corners-2",
      "border-left-width: 3px",
      "border-right-width: 3px"
    ],

    [ ".rounded-corners-3",
      "border-left-width: 2px",
      "border-right-width: 2px"
    ],

    [ ".rounded-corners-4",
      "height: 2px"
    ]
];

Effect.RoundedCorners._StylesAdded = 0;
Effect.RoundedCorners._addStyles = function () {
    if (Effect.RoundedCorners._StylesAdded) {
        return;
    }

    var styles = Effect.RoundedCorners._Styles;
    var style_string = "";

    for ( var i = 0; i < styles.length; i++ ) {
        var style = styles[i];

        style_string =
            style_string
            + style.shift()
            + " {\n  "
            + style.join(";\n  ")
            + ";\n}\n\n";
    }

    var style_elt = document.createElement("style");
    style_elt.setAttribute("type", "text/css");

    if ( style_elt.styleSheet ) { /* IE */
        style_elt.styleSheet.cssText = style_string;
    }
    else { /* w3c */
        var style_text = document.createTextNode(style_string);
        style_elt.appendChild(style_text);
    }

    var head = document.getElementsByTagName("head")[0];
    head.appendChild(style_elt);
    
    Effect.RoundedCorners._StylesAdded = 1;
}

/*

*/
// BEGIN hacks.js

/* 
COPYRIGHT NOTICE:
    Copyright (c) 2004-2005 Socialtext Corporation 
    235 Churchill Ave 
    Palo Alto, CA 94301 U.S.A.
    All rights reserved.
*/

/*
 * A collection of external code overrides.
 * /

/* prototype does not deal with the broken handling of HTTP 204 done by
   IE 6.x. transport.status is seen as 1223 rather than 204 as expected.
 */

Ajax.Base.prototype.responseIsSuccess = function() {
    return this.transport.status == undefined
        || this.transport.status == 0
        || this.transport.status == 1223 /* we love you IE! */
        || (this.transport.status >= 200 && this.transport.status < 300);
}
// BEGIN md5.js
/**
*
*  MD5 (Message-Digest Algorithm)
*  http://www.webtoolkit.info/
*
**/

var MD5 = function (string) {

    function RotateLeft(lValue, iShiftBits) {
        return (lValue<<iShiftBits) | (lValue>>>(32-iShiftBits));
    }

    function AddUnsigned(lX,lY) {
        var lX4,lY4,lX8,lY8,lResult;
        lX8 = (lX & 0x80000000);
        lY8 = (lY & 0x80000000);
        lX4 = (lX & 0x40000000);
        lY4 = (lY & 0x40000000);
        lResult = (lX & 0x3FFFFFFF)+(lY & 0x3FFFFFFF);
        if (lX4 & lY4) {
            return (lResult ^ 0x80000000 ^ lX8 ^ lY8);
        }
        if (lX4 | lY4) {
            if (lResult & 0x40000000) {
                return (lResult ^ 0xC0000000 ^ lX8 ^ lY8);
            } else {
                return (lResult ^ 0x40000000 ^ lX8 ^ lY8);
            }
        } else {
            return (lResult ^ lX8 ^ lY8);
        }
    }

    function F(x,y,z) { return (x & y) | ((~x) & z); }
    function G(x,y,z) { return (x & z) | (y & (~z)); }
    function H(x,y,z) { return (x ^ y ^ z); }
    function I(x,y,z) { return (y ^ (x | (~z))); }

    function FF(a,b,c,d,x,s,ac) {
        a = AddUnsigned(a, AddUnsigned(AddUnsigned(F(b, c, d), x), ac));
        return AddUnsigned(RotateLeft(a, s), b);
    };

    function GG(a,b,c,d,x,s,ac) {
        a = AddUnsigned(a, AddUnsigned(AddUnsigned(G(b, c, d), x), ac));
        return AddUnsigned(RotateLeft(a, s), b);
    };

    function HH(a,b,c,d,x,s,ac) {
        a = AddUnsigned(a, AddUnsigned(AddUnsigned(H(b, c, d), x), ac));
        return AddUnsigned(RotateLeft(a, s), b);
    };

    function II(a,b,c,d,x,s,ac) {
        a = AddUnsigned(a, AddUnsigned(AddUnsigned(I(b, c, d), x), ac));
        return AddUnsigned(RotateLeft(a, s), b);
    };

    function ConvertToWordArray(string) {
        var lWordCount;
        var lMessageLength = string.length;
        var lNumberOfWords_temp1=lMessageLength + 8;
        var lNumberOfWords_temp2=(lNumberOfWords_temp1-(lNumberOfWords_temp1 % 64))/64;
        var lNumberOfWords = (lNumberOfWords_temp2+1)*16;
        var lWordArray=Array(lNumberOfWords-1);
        var lBytePosition = 0;
        var lByteCount = 0;
        while ( lByteCount < lMessageLength ) {
            lWordCount = (lByteCount-(lByteCount % 4))/4;
            lBytePosition = (lByteCount % 4)*8;
            lWordArray[lWordCount] = (lWordArray[lWordCount] | (string.charCodeAt(lByteCount)<<lBytePosition));
            lByteCount++;
        }
        lWordCount = (lByteCount-(lByteCount % 4))/4;
        lBytePosition = (lByteCount % 4)*8;
        lWordArray[lWordCount] = lWordArray[lWordCount] | (0x80<<lBytePosition);
        lWordArray[lNumberOfWords-2] = lMessageLength<<3;
        lWordArray[lNumberOfWords-1] = lMessageLength>>>29;
        return lWordArray;
    };

    function WordToHex(lValue) {
        var WordToHexValue="",WordToHexValue_temp="",lByte,lCount;
        for (lCount = 0;lCount<=3;lCount++) {
            lByte = (lValue>>>(lCount*8)) & 255;
            WordToHexValue_temp = "0" + lByte.toString(16);
            WordToHexValue = WordToHexValue + WordToHexValue_temp.substr(WordToHexValue_temp.length-2,2);
        }
        return WordToHexValue;
    };

    function Utf8Encode(string) {
        string = string.replace(/\r\n/g,"\n");
        var utftext = "";

        for (var n = 0; n < string.length; n++) {

            var c = string.charCodeAt(n);

            if (c < 128) {
                utftext += String.fromCharCode(c);
            }
            else if((c > 127) && (c < 2048)) {
                utftext += String.fromCharCode((c >> 6) | 192);
                utftext += String.fromCharCode((c & 63) | 128);
            }
            else {
                utftext += String.fromCharCode((c >> 12) | 224);
                utftext += String.fromCharCode(((c >> 6) & 63) | 128);
                utftext += String.fromCharCode((c & 63) | 128);
            }

        }

        return utftext;
    };

    var x=Array();
    var k,AA,BB,CC,DD,a,b,c,d;
    var S11=7, S12=12, S13=17, S14=22;
    var S21=5, S22=9 , S23=14, S24=20;
    var S31=4, S32=11, S33=16, S34=23;
    var S41=6, S42=10, S43=15, S44=21;

    string = Utf8Encode(string);

    x = ConvertToWordArray(string);

    a = 0x67452301; b = 0xEFCDAB89; c = 0x98BADCFE; d = 0x10325476;

    for (k=0;k<x.length;k+=16) {
        AA=a; BB=b; CC=c; DD=d;
        a=FF(a,b,c,d,x[k+0], S11,0xD76AA478);
        d=FF(d,a,b,c,x[k+1], S12,0xE8C7B756);
        c=FF(c,d,a,b,x[k+2], S13,0x242070DB);
        b=FF(b,c,d,a,x[k+3], S14,0xC1BDCEEE);
        a=FF(a,b,c,d,x[k+4], S11,0xF57C0FAF);
        d=FF(d,a,b,c,x[k+5], S12,0x4787C62A);
        c=FF(c,d,a,b,x[k+6], S13,0xA8304613);
        b=FF(b,c,d,a,x[k+7], S14,0xFD469501);
        a=FF(a,b,c,d,x[k+8], S11,0x698098D8);
        d=FF(d,a,b,c,x[k+9], S12,0x8B44F7AF);
        c=FF(c,d,a,b,x[k+10],S13,0xFFFF5BB1);
        b=FF(b,c,d,a,x[k+11],S14,0x895CD7BE);
        a=FF(a,b,c,d,x[k+12],S11,0x6B901122);
        d=FF(d,a,b,c,x[k+13],S12,0xFD987193);
        c=FF(c,d,a,b,x[k+14],S13,0xA679438E);
        b=FF(b,c,d,a,x[k+15],S14,0x49B40821);
        a=GG(a,b,c,d,x[k+1], S21,0xF61E2562);
        d=GG(d,a,b,c,x[k+6], S22,0xC040B340);
        c=GG(c,d,a,b,x[k+11],S23,0x265E5A51);
        b=GG(b,c,d,a,x[k+0], S24,0xE9B6C7AA);
        a=GG(a,b,c,d,x[k+5], S21,0xD62F105D);
        d=GG(d,a,b,c,x[k+10],S22,0x2441453);
        c=GG(c,d,a,b,x[k+15],S23,0xD8A1E681);
        b=GG(b,c,d,a,x[k+4], S24,0xE7D3FBC8);
        a=GG(a,b,c,d,x[k+9], S21,0x21E1CDE6);
        d=GG(d,a,b,c,x[k+14],S22,0xC33707D6);
        c=GG(c,d,a,b,x[k+3], S23,0xF4D50D87);
        b=GG(b,c,d,a,x[k+8], S24,0x455A14ED);
        a=GG(a,b,c,d,x[k+13],S21,0xA9E3E905);
        d=GG(d,a,b,c,x[k+2], S22,0xFCEFA3F8);
        c=GG(c,d,a,b,x[k+7], S23,0x676F02D9);
        b=GG(b,c,d,a,x[k+12],S24,0x8D2A4C8A);
        a=HH(a,b,c,d,x[k+5], S31,0xFFFA3942);
        d=HH(d,a,b,c,x[k+8], S32,0x8771F681);
        c=HH(c,d,a,b,x[k+11],S33,0x6D9D6122);
        b=HH(b,c,d,a,x[k+14],S34,0xFDE5380C);
        a=HH(a,b,c,d,x[k+1], S31,0xA4BEEA44);
        d=HH(d,a,b,c,x[k+4], S32,0x4BDECFA9);
        c=HH(c,d,a,b,x[k+7], S33,0xF6BB4B60);
        b=HH(b,c,d,a,x[k+10],S34,0xBEBFBC70);
        a=HH(a,b,c,d,x[k+13],S31,0x289B7EC6);
        d=HH(d,a,b,c,x[k+0], S32,0xEAA127FA);
        c=HH(c,d,a,b,x[k+3], S33,0xD4EF3085);
        b=HH(b,c,d,a,x[k+6], S34,0x4881D05);
        a=HH(a,b,c,d,x[k+9], S31,0xD9D4D039);
        d=HH(d,a,b,c,x[k+12],S32,0xE6DB99E5);
        c=HH(c,d,a,b,x[k+15],S33,0x1FA27CF8);
        b=HH(b,c,d,a,x[k+2], S34,0xC4AC5665);
        a=II(a,b,c,d,x[k+0], S41,0xF4292244);
        d=II(d,a,b,c,x[k+7], S42,0x432AFF97);
        c=II(c,d,a,b,x[k+14],S43,0xAB9423A7);
        b=II(b,c,d,a,x[k+5], S44,0xFC93A039);
        a=II(a,b,c,d,x[k+12],S41,0x655B59C3);
        d=II(d,a,b,c,x[k+3], S42,0x8F0CCC92);
        c=II(c,d,a,b,x[k+10],S43,0xFFEFF47D);
        b=II(b,c,d,a,x[k+1], S44,0x85845DD1);
        a=II(a,b,c,d,x[k+8], S41,0x6FA87E4F);
        d=II(d,a,b,c,x[k+15],S42,0xFE2CE6E0);
        c=II(c,d,a,b,x[k+6], S43,0xA3014314);
        b=II(b,c,d,a,x[k+13],S44,0x4E0811A1);
        a=II(a,b,c,d,x[k+4], S41,0xF7537E82);
        d=II(d,a,b,c,x[k+11],S42,0xBD3AF235);
        c=II(c,d,a,b,x[k+2], S43,0x2AD7D2BB);
        b=II(b,c,d,a,x[k+9], S44,0xEB86D391);
        a=AddUnsigned(a,AA);
        b=AddUnsigned(b,BB);
        c=AddUnsigned(c,CC);
        d=AddUnsigned(d,DD);
    }

    var temp = WordToHex(a)+WordToHex(b)+WordToHex(c)+WordToHex(d);

    return temp.toLowerCase();
}
// BEGIN Cookie.js
// Cookie handling functions

Cookie = {};

Cookie.get = function(name) {
    var cookieStart = document.cookie.indexOf(name + "=");
    if (cookieStart == -1) return null;
    var valueStart = document.cookie.indexOf('=', cookieStart) + 1;
    var valueEnd = document.cookie.indexOf(';', valueStart);
    if (valueEnd == -1) valueEnd = document.cookie.length;
    var val = document.cookie.substring(valueStart, valueEnd);
    return val == null
        ? null
        : unescape(document.cookie.substring(valueStart, valueEnd));
}

Cookie.set = function(name, val, expiration) {
    // Default to 25 year expiry if not specified by the caller.
    if (typeof(expiration) == 'undefined') {
        expiration = new Date(
            new Date().getTime() + 25 * 365 * 24 * 60 * 60 * 1000
        )
    }
    var str = name + '=' + escape(val) +
        '; expires=' + expiration.toGMTString();
    document.cookie = str;
}

Cookie['delete'] = function(name) {
    Cookie.set(name, '', new Date(new Date().getTime() - 1));
}

// BEGIN ArrayUtils.js
/*
  Extensions to the JavaScript Array object.
  Author: Sean M. Burke
  Codeblt'd from: http://interglacial.com/hoj/hoj.html

  map, grep, and foreach are added to the Array object

  Examples:

    Get a copy of words with every item uppercase:
        var loudwords = words.map( function(_){ return _.toUpperCase(); } );

    Find all the uppercased words in words:
        function isUpperCase (_) { return _ == _.toUpperCase(); }
        var already_loud = words.grep( isUpperCase);

    Change words in-place:
        words.foreach( function(item, arr, i){arr[i] = item.toUpperCase();} );
*/

Array.prototype.map = function(f) {
    if(!f.apply) {
        var propname = f;
        f = function(_) {
            return _[propname]
        }
    }

    var out = [];
    for(var i = 0; i < this.length; i++) {
        out.push( f( this[i], this, i) );
    }

    return out;
};

Array.prototype.mapc = function(f) {
    if (!f.apply) {
        var propname = f;
        f = function(_) {
            return _[propname]
        }
    }

    var out = [];
    var gotten;
    for (var i = 0; i < this.length; i++) {
        gotten = f( this[i], this, i);
        if ( gotten != undefined )
            out = out.concat( gotten );
    }
    return out;
};


Array.prototype.grep = function(f) {
    if (!f.apply) {
        var propname = f;
        f = function(_) {
            return _[propname]
        }
    }
    var out = [];
    for(var i = 0; i < this.length; i++) {
        if ( f( this[i], this, i) )
            out.push(this[i]);
    }
    return out;
};

Array.prototype.foreach = function(f) {
    if(!f.apply) {
        var propname = f;
        f = function(_,x,i) { x[i] = _[propname] }
    }

    for(var i = 0; i < this.length; i++) {
        f( this[i], this, i );
    }

    return;
};

Array.prototype.deleteElement = function(toDelete) {
    var i;
    for (i=0; i < this.length; i++)
        if (this[i] == toDelete) {
            this.splice(i,1);
            return;
        }
}

Array.prototype.deleteElementIgnoreCase = function(toDelete) {
    var i;
    var lcToDelete = toDelete.toLowerCase();
    for (i=0; i < this.length; i++)
        if (this[i].toLowerCase() == lcToDelete) {
            this.splice(i,1);
            return;
        }
}// BEGIN stlibrary.js
// namespace placeholder
if (typeof ST == 'undefined') {
    ST = {};
}

ST.isRelative = function(node) {
    return node.style.position == 'relative' || node.style.position == 'absolute' || node.style.position == 'fixed';
}

ST.getRadioValue = function(name) {
    var nodes = document.getElementsByName(name);
    for (var i=0; i < nodes.length; i++)
        if (nodes[i].checked)
            return nodes[i].value;
    return '';
}

ST.setRadioValue = function(name, value) {
    var nodes = document.getElementsByName(name);
    for (var i=0; i < nodes.length; i++) {
        if (nodes[i].value == value) {
            nodes[i].checked = true;
            return;
        }
    }
}

// Function from Javascript: The Definitive Guide
ST.getDocumentX = function(e, is_relative) {
    var x = 0;
    while (e) {
        x+= e.offsetLeft;
        e = e.offsetParent;
        if (e && is_relative && ST.isRelative(e))
            e = null;
    }
    return x;
}

ST.getDocumentY = function(e, is_relative) {
    var y = 0;
    while (e) {
        y += e.offsetTop;
        e = e.offsetParent;
        if (e && is_relative && ST.isRelative(e))
            e = null;
    }
    return y;
}

/**
 * A function used to extend one class with another
 *
 * @author Kevin Lindsey
 * @version 1.0
 *
 * copyright 2006, Kevin Lindsey
 *
 *
 * @param {Object} subClass
 * 		The inheriting class, or subclass
 * @param {Object} baseClass
 * 		The class from which to inherit
 */
ST.extend = function(subClass, baseClass) {
   function inheritance() {}
   inheritance.prototype = baseClass.prototype;

   subClass.prototype = new inheritance();
   subClass.prototype.constructor = subClass;
   subClass.baseConstructor = baseClass;
   subClass.superClass = baseClass.prototype;
}


// Pop up a new HTML window
function query_popup(url, width, height, left, top) {
    if (!width) width = 400;
    if (!height) height = 287;
    if (!left) left = 400-width/2;
    if (!top) top = 280-height/2;
    window.open(url, '_blank', 'toolbar=no, location=no, directories=no, status=no, menubar=no, titlebar=no, scrollbars=yes, resizable=yes, width=' + width + ', height=' + height + ', left=' + left + ', top=' + top);
}

function help_popup(url, width, height, left, top) {
    if (!width) width = 520;
    if (!height) height = 300;
    if (!left) left = 400-width/2;
    if (!top) top = 280-height/2;
    window.open(url, '_blank', 'toolbar=no, location=no, directories=no, status=no, menubar=no, titlebar=no, scrollbars=yes, resizable=yes, width=' + width + ', height=' + height + ', left=' + left + ', top=' + top);
}

function trim(value) {
    var ltrim = /\s*((\s*\S+)*)/;
    var rtrim = /((\s*\S+)*)\s*/;
    return value.replace(rtrim, "$1").replace(ltrim, "$1");
};

function is_reserved_pagename(pagename) {
    if (pagename && pagename.length > 0) {
        var name = trim(pagename.toLowerCase());
        var untitled = loc('Untitled Page').toLowerCase();
        return name == untitled;
    }
    else {
        return false;
    }
}

function confirm_delete(pageid) {
    if (confirm(loc('Are you sure you want to delete this page?'))) {
        location = 'index.cgi?action=delete_page;page_name=' + pageid;
    }
}
// BEGIN Jemplate.js
/*------------------------------------------------------------------------------
Jemplate - Template Toolkit for JavaScript

DESCRIPTION - This module provides the runtime JavaScript support for
compiled Jemplate templates.

AUTHOR - Ingy döt Net <ingy@cpan.org>

Copyright 2006 Ingy döt Net. All Rights Reserved.

This module is free software; you can redistribute it and/or
modify it under the same terms as Perl itself.
------------------------------------------------------------------------------*/

//------------------------------------------------------------------------------
// Main Jemplate class
//------------------------------------------------------------------------------

if (typeof Jemplate == 'undefined') {
    Jemplate = function() {
        this.init.apply(this, arguments);
    };
}

if (! Jemplate.templateMap)
    Jemplate.templateMap = {};

Jemplate.process = function() {
    var jemplate = new Jemplate();
    return jemplate.process.apply(jemplate, arguments);
}

proto = Jemplate.prototype;

proto.init = function(config) {
    this.config = config ||
    {
        AUTO_RESET: true,
        BLOCKS: {},
        CONTEXT: null,
        DEBUG_UNDEF: false,
        DEFAULT: null,
        ERROR: null,
        EVAL_JAVASCRIPT: false,
        FILTERS: {},
        INCLUDE_PATH: [''],
        INTERPOLATE: false,
        OUTPUT: null,
        PLUGINS: {},
        POST_PROCESS: [],
        PRE_PROCESS: [],
        PROCESS: null,
        RECURSION: false,
        STASH: null,
        TOLERANT: null,
        VARIABLES: {},
        WRAPPER: []
    };
}

proto.process = function(template, data, output) {
    var context = this.config.CONTEXT || new Jemplate.Context();
    context.config = this.config;

    context.stash = this.config.STASH || new Jemplate.Stash();
    context.stash.__config__ = this.config;

    context.__filter__ = new Jemplate.Filter();
    context.__filter__.config = this.config;

    var result;

    var proc = function(input) {
        try {
            result = context.process(template, input);
        }
        catch(e) {
            if (! String(e).match(/Jemplate\.STOP\n/))
                throw(e);
            result = e.toString().replace(/Jemplate\.STOP\n/, '');
        }

        if (typeof output == 'undefined')
            return result;
        if (typeof output == 'function') {
            output(result);
            return;
        }
        if (typeof(output) == 'string' || output instanceof String) {
            if (output.match(/^#[\w\-]+$/)) {
                var id = output.replace(/^#/, '');
                var element = document.getElementById(id);
                if (typeof element == 'undefined')
                    throw('No element found with id="' + id + '"');
                element.innerHTML = result;
                return;
            }
        }
        else {
            output.innerHTML = result;
            return;
        }

        throw("Invalid arguments in call to Jemplate.process");

        return 1;
    }

    if (typeof data == 'function')
        data = data();
    else if (typeof data == 'string') {
        Ajax.get(data, function(r) { proc(JSON.parse(r)) });
        return;
    }

    return proc(data);
}

//------------------------------------------------------------------------------
// Jemplate.Context class
//------------------------------------------------------------------------------
if (typeof Jemplate.Context == 'undefined')
    Jemplate.Context = function() {};

proto = Jemplate.Context.prototype;

proto.include = function(template, args) {
    return this.process(template, args, true);
}

proto.process = function(template, args, localise) {
    if (localise)
        this.stash.clone(args);
    else
        this.stash.update(args);
    var func = Jemplate.templateMap[template];
    if (typeof func == 'undefined')
        throw('No Jemplate template named "' + template + '" available');
    var output = func(this);
    if (localise)
        this.stash.declone();
    return output;
}

proto.set_error = function(error, output) {
    this._error = [error, output];
    return error;
}

proto.filter = function(text, name, args) {
    if (name == 'null')
        name = "null_filter";
    if (typeof this.__filter__.filters[name] == "function")
        return this.__filter__.filters[name](text, args, this);
    else
        throw "Unknown filter name ':" + name + "'";
}

//------------------------------------------------------------------------------
// Jemplate.Filter class
//------------------------------------------------------------------------------
if (typeof Jemplate.Filter == 'undefined') {
    Jemplate.Filter = function() { };
}

proto = Jemplate.Filter.prototype;

proto.filters = {};

proto.filters.null_filter = function(text) {
    return '';
}

proto.filters.upper = function(text) {
    return text.toUpperCase();
}

proto.filters.lower = function(text) {
    return text.toLowerCase();
}

proto.filters.ucfirst = function(text) {
    var first = text.charAt(0);
    var rest = text.substr(1);
    return first.toUpperCase() + rest;
}

proto.filters.lcfirst = function(text) {
    var first = text.charAt(0);
    var rest = text.substr(1);
    return first.toLowerCase() + rest;
}

proto.filters.trim = function(text) {
    return text.replace( /^\s+/g, "" ).replace( /\s+$/g, "" );
}

proto.filters.collapse = function(text) {
    return text.replace( /^\s+/g, "" ).replace( /\s+$/g, "" ).replace(/\s+/, " ");
}

proto.filters.html = function(text) {
    text = text.replace(/&/g, '&amp;');
    text = text.replace(/</g, '&lt;');
    text = text.replace(/>/g, '&gt;');
    text = text.replace(/"/g, '&quot;'); // " end quote for emacs
    return text;
}

proto.filters.html_para = function(text) {
    var lines = text.split(/(?:\r?\n){2,}/);
    return "<p>\n" + lines.join("\n</p>\n\n<p>\n") + "</p>\n";
}

proto.filters.html_break = function(text) {
    return text.replace(/(\r?\n){2,}/g, "$1<br />$1<br />$1");
}

proto.filters.html_line_break = function(text) {
    return text.replace(/(\r?\n)/g, "$1<br />$1");
}

proto.filters.uri = function(text) {
    return encodeURI(text);
}

proto.filters.indent = function(text, args) {
    var pad = args[0];
    if (! text) return;
    if (typeof pad == 'undefined')
        pad = 4;

    var finalpad = '';
    if (typeof pad == 'number' || String(pad).match(/^\d$/)) {
        for (var i = 0; i < pad; i++) {
            finalpad += ' ';
        }
    } else {
        finalpad = pad;
    }
    var output = text.replace(/^/gm, finalpad);
    return output;
}

proto.filters.truncate = function(text, args) {
    var len = args[0];
    if (! text) return;
    if (! len)
        len = 32;
    // This should probably be <=, but TT just uses <
    if (text.length < len)
        return text;
    var newlen = len - 3;
    return text.substr(0,newlen) + '...';
}

proto.filters.repeat = function(text, iter) {
    if (! text) return;
    if (! iter || iter == 0)
        iter = 1;
    if (iter == 1) return text

    var output = text;
    for (var i = 1; i < iter; i++) {
        output += text;
    }
    return output;
}

proto.filters.replace = function(text, args) {
    if (! text) return;
    var re_search = args[0];
    var text_replace = args[1];
    if (! re_search)
        re_search = '';
    if (! text_replace)
        text_replace = '';
    var re = new RegExp(re_search, 'g');
    return text.replace(re, text_replace);
}

//------------------------------------------------------------------------------
// Jemplate.Stash class
//------------------------------------------------------------------------------
if (typeof Jemplate.Stash == 'undefined') {
    Jemplate.Stash = function() {
        this.data = {};
    };
}

proto = Jemplate.Stash.prototype;

proto.clone = function(args) {
    var data = this.data;
    this.data = {};
    this.update(data);
    this.update(args);
    this.data._PARENT = data;
}

proto.declone = function(args) {
    this.data = this.data._PARENT || this.data;
}

proto.update = function(args) {
    if (typeof args == 'undefined') return;
    for (var key in args) {
        var value = args[key];
        this.set(key, value);
    }
}

proto.get = function(key) {
    var root = this.data;
    if (key instanceof Array) {
        for (var i = 0; i < key.length; i += 2) {
            var args = key.slice(i, i+2);
            args.unshift(root);
            value = this._dotop.apply(this, args);
            if (typeof value == 'undefined')
                break;
            root = value;
        }
    }
    else {
        value = this._dotop(root, key);
    }

    if (typeof value == 'undefined') {
        if (this.__config__.DEBUG_UNDEF)
            throw("undefined value found while using DEGUG_UNDEF");
        value = '';
    }

    return value;
}

proto.set = function(key, value, set_default) {
    if (key instanceof Array) {
        var data = this.get(key[0]) || {};
        key = key[2];
    }
    else {
        data = this.data;
    }
    if (! (set_default && (typeof data[key] != 'undefined')))
        data[key] = value;
}

proto._dotop = function(root, item, args) {
    if (typeof item == 'undefined' ||
        typeof item == 'string' && item.match(/^[\._]/)) {
        return undefined;
    }

    if ((! args) &&
        (typeof root == 'object') &&
        (!(root instanceof Array) || (typeof item == 'number')) &&
        (typeof root[item] != 'undefined')) {
        var value = root[item];
        if (typeof value == 'function')
            value = value();
        return value;
    }

    if (typeof root == 'string' && this.string_functions[item])
        return this.string_functions[item](root, args);
    if (root instanceof Array && this.list_functions[item])
        return this.list_functions[item](root, args);
    if (typeof root == 'object' && this.hash_functions[item])
        return this.hash_functions[item](root, args);
    if (typeof root[item] == 'function')
        return root[item].apply(root, args);

    return undefined;
}

proto.string_functions = {};

// chunk(size)     negative size chunks from end
proto.string_functions.chunk = function(string, args) {
    var size = args[0];
    var list = new Array();
    if (! size)
        size = 1;
    if (size < 0) {
        size = 0 - size;
        for (i = string.length - size; i >= 0; i = i - size)
            list.unshift(string.substr(i, size));
        if (string.length % size)
            list.unshift(string.substr(0, string.length % size));
    }
    else
        for (i = 0; i < string.length; i = i + size)
            list.push(string.substr(i, size));
    return list;
}

// defined         is value defined?
proto.string_functions.defined = function(string) {
    return 1;
}

// hash            treat as single-element hash with key value
proto.string_functions.hash = function(string) {
    return { 'value': string };
}

// length          length of string representation
proto.string_functions.length = function(string) {
    return string.length;
}

// list            treat as single-item list
proto.string_functions.list = function(string) {
    return [ string ];
}

// match(re)       get list of matches
proto.string_functions.match = function(string, args) {
    var regexp = new RegExp(args[0], 'gm');
    var list = string.match(regexp);
    return list;
}

// repeat(n)       repeated n times
proto.string_functions.repeat = function(string, args) {
    var n = args[0] || 1;
    var output = '';
    for (var i = 0; i < n; i++) {
        output += string;
    }
    return output;
}

// replace(re, sub)    replace instances of re with sub
proto.string_functions.replace = function(string, args) {
    var regexp = new RegExp(args[0], 'gm');
    var sub = args[1];
    if (! sub)
        sub  = '';
    var output = string.replace(regexp, sub);
    return output;
}

// search(re)      true if value matches re
proto.string_functions.search = function(string, args) {
    var regexp = new RegExp(args[0]);
    return (string.search(regexp) >= 0) ? 1 : 0;
}

// size            returns 1, as if a single-item list
proto.string_functions.size = function(string) {
    return 1;
}

// split(re)       split string on re
proto.string_functions.split = function(string, args) {
    var regexp = new RegExp(args[0]);
    var list = string.split(regexp);
    return list;
}



proto.list_functions = {};

proto.list_functions.join = function(list, args) {
    return list.join(args[0]);
};

proto.list_functions.sort = function(list,key) {
    if( typeof(key) != 'undefined' && key != "" ) {
        // we probably have a list of hashes
        // and need to sort based on hash key
        return list.sort(
            function(a,b) {
                if( a[key] == b[key] ) {
                    return 0;
                }
                else if( a[key] > b[key] ) {
                    return 1;
                }
                else {
                    return -1;
                }
            }
        );
    }
    return list.sort();
}

proto.list_functions.nsort = function(list) {
    return list.sort(function(a, b) { return (a-b) });
}

proto.list_functions.grep = function(list, args) {
    var regexp = new RegExp(args[0]);
    var result = [];
    for (var i = 0; i < list.length; i++) {
        if (list[i].match(regexp))
            result.push(list[i]);
    }
    return result;
}

proto.list_functions.unique = function(list) {
    var result = [];
    var seen = {};
    for (var i = 0; i < list.length; i++) {
        var elem = list[i];
        if (! seen[elem])
            result.push(elem);
        seen[elem] = true;
    }
    return result;
}

proto.list_functions.reverse = function(list) {
    var result = [];
    for (var i = list.length - 1; i >= 0; i--) {
        result.push(list[i]);
    }
    return result;
}

proto.list_functions.merge = function(list, args) {
    var result = [];
    var push_all = function(elem) {
        if (elem instanceof Array) {
            for (var j = 0; j < elem.length; j++) {
                result.push(elem[j]);
            }
        }
        else {
            result.push(elem);
        }
    }
    push_all(list);
    for (var i = 0; i < args.length; i++) {
        push_all(args[i]);
    }
    return result;
}

proto.list_functions.slice = function(list, args) {
    return list.slice(args[0], args[1]);
}

proto.list_functions.splice = function(list, args) {
    if (args.length == 1)
        return list.splice(args[0]);
    if (args.length == 2)
        return list.splice(args[0], args[1]);
    if (args.length == 3)
        return list.splice(args[0], args[1], args[2]);
}

proto.list_functions.push = function(list, args) {
    list.push(args[0]);
    return list;
}

proto.list_functions.pop = function(list) {
    return list.pop();
}

proto.list_functions.unshift = function(list, args) {
    list.unshift(args[0]);
    return list;
}

proto.list_functions.shift = function(list) {
    return list.shift();
}

proto.list_functions.first = function(list) {
    return list[0];
}

proto.list_functions.size = function(list) {
    return list.length;
}

proto.list_functions.max = function(list) {
    return list.length - 1;
}

proto.list_functions.last = function(list) {
    return list.slice(-1);
}

proto.hash_functions = {};


// each            list of alternating keys/values
proto.hash_functions.each = function(hash) {
    var list = new Array();
    for ( var key in hash )
        list.push(key, hash[key]);
    return list;
}

// exists(key)     does key exist?
proto.hash_functions.exists = function(hash, args) {
    return ( typeof( hash[args[0]] ) == "undefined" ) ? 0 : 1;
}

// FIXME proto.hash_functions.import blows everything up
//
// import(hash2)   import contents of hash2
// import          import into current namespace hash
//proto.hash_functions.import = function(hash, args) {
//    var hash2 = args[0];
//    for ( var key in hash2 )
//        hash[key] = hash2[key];
//    return '';
//}

// keys            list of keys
proto.hash_functions.keys = function(hash) {
    var list = new Array();
    for ( var key in hash )
        list.push(key);
    return list;
}

// list            returns alternating key, value
proto.hash_functions.list = function(hash, args) {
    var what = '';
    if ( args )
        var what = args[0];

    var list = new Array();
    if (what == 'keys')
        for ( var key in hash )
            list.push(key);
    else if (what == 'values')
        for ( var key in hash )
            list.push(hash[key]);
    else if (what == 'each')
        for ( var key in hash )
            list.push(key, hash[key]);
    else
        for ( var key in hash )
            list.push({ 'key': key, 'value': hash[key] });

    return list;
}

// nsort           keys sorted numerically
proto.hash_functions.nsort = function(hash) {
    var list = new Array();
    for (var key in hash)
        list.push(key);
    return list.sort(function(a, b) { return (a-b) });
}

// size            number of pairs
proto.hash_functions.size = function(hash) {
    var size = 0;
    for (var key in hash)
        size++;
    return size;
}


// sort            keys sorted alphabetically
proto.hash_functions.sort = function(hash) {
    var list = new Array();
    for (var key in hash)
        list.push(key);
    return list.sort();
}

// values          list of values
proto.hash_functions.values = function(hash) {
    var list = new Array();
    for ( var key in hash )
        list.push(hash[key]);
    return list;
}



//------------------------------------------------------------------------------
// Jemplate.Iterator class
//------------------------------------------------------------------------------
if (typeof Jemplate.Iterator == 'undefined') {
    Jemplate.Iterator = function(object) {
        if( object instanceof Array ) {
            this.object = object;
            this.size = object.length;
            this.max  = this.size -1;
        }
        else if ( object instanceof Object ) {
            this.object = object;
            var object_keys = new Array;
            for( var key in object ) {
                object_keys[object_keys.length] = key;
            }
            this.object_keys = object_keys.sort();
            this.size = object_keys.length;
            this.max  = this.size -1;
        }
    }
}

proto = Jemplate.Iterator.prototype;

proto.get_first = function() {
    this.index = 0;
    this.first = 1;
    this.last  = 0;
    this.count = 1;
    return this.get_next(1);
}

proto.get_next = function(should_init) {
    var object = this.object;
    var index;
    if( typeof(should_init) != 'undefined' && should_init ) {
        index = this.index;
    } else {
        index = ++this.index;
        this.first = 0;
        this.count = this.index + 1;
        if( this.index == this.size -1 ) {
            this.last = 1;
        }
    }
    if (typeof object == 'undefined')
        throw('No object to iterate');
    if( this.object_keys ) {
        if (index < this.object_keys.length) {
            this.prev = index > 0 ? this.object_keys[index - 1] : "";
            this.next = index < this.max ? this.object_keys[index + 1] : "";
            return [this.object_keys[index], false];
        }
    } else {
        if (index < object.length) {
            this.prev = index > 0 ? object[index - 1] : "";
            this.next = index < this.max ? object[index +1] : "";
            return [object[index], false];
        }
    }
    return [null, true];
}

//------------------------------------------------------------------------------
// Debugging Support
//------------------------------------------------------------------------------

function XXX(msg) {
    if (! confirm(msg))
        throw("terminated...");
    return msg;
}

function JJJ(obj) {
    return XXX(JSON.stringify(obj));
}

//------------------------------------------------------------------------------
// Ajax support
//------------------------------------------------------------------------------
if (! this.Ajax) Ajax = {};

Ajax.get = function(url, callback) {
    var req = new XMLHttpRequest();
    req.open('GET', url, Boolean(callback));
    return Ajax._send(req, null, callback);
}

Ajax.post = function(url, data, callback) {
    var req = new XMLHttpRequest();
    req.open('POST', url, Boolean(callback));
    req.setRequestHeader(
        'Content-Type',
        'application/x-www-form-urlencoded'
    );
    return Ajax._send(req, data, callback);
}

Ajax._send = function(req, data, callback) {
    if (callback) {
        req.onreadystatechange = function() {
            if (req.readyState == 4) {
                if(req.status == 200)
                    callback(req.responseText);
            }
        };
    }
    req.send(data);
    if (!callback) {
        if (req.status != 200)
            throw('Request for "' + url +
                  '" failed with status: ' + req.status);
        return req.responseText;
    }
}

//------------------------------------------------------------------------------
// Cross-Browser XMLHttpRequest v1.1
//------------------------------------------------------------------------------
/*
Emulate Gecko 'XMLHttpRequest()' functionality in IE and Opera. Opera requires
the Sun Java Runtime Environment <http://www.java.com/>.

by Andrew Gregory
http://www.scss.com.au/family/andrew/webdesign/xmlhttprequest/

This work is licensed under the Creative Commons Attribution License. To view a
copy of this license, visit http://creativecommons.org/licenses/by/1.0/ or send
a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305,
USA.
*/

// IE support
if (window.ActiveXObject && !window.XMLHttpRequest) {
  window.XMLHttpRequest = function() {
    return new ActiveXObject((navigator.userAgent.toLowerCase().indexOf('msie 5') != -1) ? 'Microsoft.XMLHTTP' : 'Msxml2.XMLHTTP');
  };
}

// Opera support
if (window.opera && !window.XMLHttpRequest) {
  window.XMLHttpRequest = function() {
    this.readyState = 0; // 0=uninitialized,1=loading,2=loaded,3=interactive,4=complete
    this.status = 0; // HTTP status codes
    this.statusText = '';
    this._headers = [];
    this._aborted = false;
    this._async = true;
    this.abort = function() {
      this._aborted = true;
    };
    this.getAllResponseHeaders = function() {
      return this.getAllResponseHeader('*');
    };
    this.getAllResponseHeader = function(header) {
      var ret = '';
      for (var i = 0; i < this._headers.length; i++) {
        if (header == '*' || this._headers[i].h == header) {
          ret += this._headers[i].h + ': ' + this._headers[i].v + '\n';
        }
      }
      return ret;
    };
    this.setRequestHeader = function(header, value) {
      this._headers[this._headers.length] = {h:header, v:value};
    };
    this.open = function(method, url, async, user, password) {
      this.method = method;
      this.url = url;
      this._async = true;
      this._aborted = false;
      if (arguments.length >= 3) {
        this._async = async;
      }
      if (arguments.length > 3) {
        // user/password support requires a custom Authenticator class
        opera.postError('XMLHttpRequest.open() - user/password not supported');
      }
      this._headers = [];
      this.readyState = 1;
      if (this.onreadystatechange) {
        this.onreadystatechange();
      }
    };
    this.send = function(data) {
      if (!navigator.javaEnabled()) {
        alert("XMLHttpRequest.send() - Java must be installed and enabled.");
        return;
      }
      if (this._async) {
        setTimeout(this._sendasync, 0, this, data);
        // this is not really asynchronous and won't execute until the current
        // execution context ends
      } else {
        this._sendsync(data);
      }
    }
    this._sendasync = function(req, data) {
      if (!req._aborted) {
        req._sendsync(data);
      }
    };
    this._sendsync = function(data) {
      this.readyState = 2;
      if (this.onreadystatechange) {
        this.onreadystatechange();
      }
      // open connection
      var url = new java.net.URL(new java.net.URL(window.location.href), this.url);
      var conn = url.openConnection();
      for (var i = 0; i < this._headers.length; i++) {
        conn.setRequestProperty(this._headers[i].h, this._headers[i].v);
      }
      this._headers = [];
      if (this.method == 'POST') {
        // POST data
        conn.setDoOutput(true);
        var wr = new java.io.OutputStreamWriter(conn.getOutputStream());
        wr.write(data);
        wr.flush();
        wr.close();
      }
      // read response headers
      // NOTE: the getHeaderField() methods always return nulls for me :(
      var gotContentEncoding = false;
      var gotContentLength = false;
      var gotContentType = false;
      var gotDate = false;
      var gotExpiration = false;
      var gotLastModified = false;
      for (var i = 0; ; i++) {
        var hdrName = conn.getHeaderFieldKey(i);
        var hdrValue = conn.getHeaderField(i);
        if (hdrName == null && hdrValue == null) {
          break;
        }
        if (hdrName != null) {
          this._headers[this._headers.length] = {h:hdrName, v:hdrValue};
          switch (hdrName.toLowerCase()) {
            case 'content-encoding': gotContentEncoding = true; break;
            case 'content-length'  : gotContentLength   = true; break;
            case 'content-type'    : gotContentType     = true; break;
            case 'date'            : gotDate            = true; break;
            case 'expires'         : gotExpiration      = true; break;
            case 'last-modified'   : gotLastModified    = true; break;
          }
        }
      }
      // try to fill in any missing header information
      var val;
      val = conn.getContentEncoding();
      if (val != null && !gotContentEncoding) this._headers[this._headers.length] = {h:'Content-encoding', v:val};
      val = conn.getContentLength();
      if (val != -1 && !gotContentLength) this._headers[this._headers.length] = {h:'Content-length', v:val};
      val = conn.getContentType();
      if (val != null && !gotContentType) this._headers[this._headers.length] = {h:'Content-type', v:val};
      val = conn.getDate();
      if (val != 0 && !gotDate) this._headers[this._headers.length] = {h:'Date', v:(new Date(val)).toUTCString()};
      val = conn.getExpiration();
      if (val != 0 && !gotExpiration) this._headers[this._headers.length] = {h:'Expires', v:(new Date(val)).toUTCString()};
      val = conn.getLastModified();
      if (val != 0 && !gotLastModified) this._headers[this._headers.length] = {h:'Last-modified', v:(new Date(val)).toUTCString()};
      // read response data
      var reqdata = '';
      var stream = conn.getInputStream();
      if (stream) {
        var reader = new java.io.BufferedReader(new java.io.InputStreamReader(stream));
        var line;
        while ((line = reader.readLine()) != null) {
          if (this.readyState == 2) {
            this.readyState = 3;
            if (this.onreadystatechange) {
              this.onreadystatechange();
            }
          }
          reqdata += line + '\n';
        }
        reader.close();
        this.status = 200;
        this.statusText = 'OK';
        this.responseText = reqdata;
        this.readyState = 4;
        if (this.onreadystatechange) {
          this.onreadystatechange();
        }
        if (this.onload) {
          this.onload();
        }
      } else {
        // error
        this.status = 404;
        this.statusText = 'Not Found';
        this.responseText = '';
        this.readyState = 4;
        if (this.onreadystatechange) {
          this.onreadystatechange();
        }
        if (this.onerror) {
          this.onerror();
        }
      }
    };
  };
}
// ActiveXObject emulation
if (!window.ActiveXObject && window.XMLHttpRequest) {
  window.ActiveXObject = function(type) {
    switch (type.toLowerCase()) {
      case 'microsoft.xmlhttp':
      case 'msxml2.xmlhttp':
        return new XMLHttpRequest();
    }
    return null;
  };
}


//------------------------------------------------------------------------------
// JSON Support
//------------------------------------------------------------------------------

/*
Copyright (c) 2005 JSON.org
*/
var JSON = function () {
    var m = {
            '\b': '\\b',
            '\t': '\\t',
            '\n': '\\n',
            '\f': '\\f',
            '\r': '\\r',
            '"' : '\\"',
            '\\': '\\\\'
        },
        s = {
            'boolean': function (x) {
                return String(x);
            },
            number: function (x) {
                return isFinite(x) ? String(x) : 'null';
            },
            string: function (x) {
                if (/["\\\x00-\x1f]/.test(x)) {
                    x = x.replace(/([\x00-\x1f\\"])/g, function(a, b) {
                        var c = m[b];
                        if (c) {
                            return c;
                        }
                        c = b.charCodeAt();
                        return '\\u00' +
                            Math.floor(c / 16).toString(16) +
                            (c % 16).toString(16);
                    });
                }
                return '"' + x + '"';
            },
            object: function (x) {
                if (x) {
                    var a = [], b, f, i, l, v;
                    if (x instanceof Array) {
                        a[0] = '[';
                        l = x.length;
                        for (i = 0; i < l; i += 1) {
                            v = x[i];
                            f = s[typeof v];
                            if (f) {
                                v = f(v);
                                if (typeof v == 'string') {
                                    if (b) {
                                        a[a.length] = ',';
                                    }
                                    a[a.length] = v;
                                    b = true;
                                }
                            }
                        }
                        a[a.length] = ']';
                    } else if (x instanceof Object) {
                        a[0] = '{';
                        for (i in x) {
                            v = x[i];
                            f = s[typeof v];
                            if (f) {
                                v = f(v);
                                if (typeof v == 'string') {
                                    if (b) {
                                        a[a.length] = ',';
                                    }
                                    a.push(s.string(i), ':', v);
                                    b = true;
                                }
                            }
                        }
                        a[a.length] = '}';
                    } else {
                        return;
                    }
                    return a.join('');
                }
                return 'null';
            }
        };
    return {
        copyright: '(c)2005 JSON.org',
        license: 'http://www.crockford.com/JSON/license.html',
        stringify: function (v) {
            var f = s[typeof v];
            if (f) {
                v = f(v);
                if (typeof v == 'string') {
                    return v;
                }
            }
            return null;
        },
        parse: function (text) {
            try {
                return !(/[^,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]/.test(
                        text.replace(/"(\\.|[^"\\])*"/g, ''))) &&
                    eval('(' + text + ')');
            } catch (e) {
                return false;
            }
        }
    };
}();
// BEGIN JSON.js
//------------------------------------------------------------------------------
// JSON Support
//------------------------------------------------------------------------------

/*
Copyright (c) 2005 JSON.org
*/
var JSON = function () {
    var m = {
            '\b': '\\b',
            '\t': '\\t',
            '\n': '\\n',
            '\f': '\\f',
            '\r': '\\r',
            '"' : '\\"',
            '\\': '\\\\'
        },
        s = {
            'boolean': function (x) {
                return String(x);
            },
            number: function (x) {
                return isFinite(x) ? String(x) : 'null';
            },
            string: function (x) {
                if (/["\\\x00-\x1f]/.test(x)) {
                    x = x.replace(/([\x00-\x1f\\"])/g, function(a, b) {
                        var c = m[b];
                        if (c) {
                            return c;
                        }
                        c = b.charCodeAt();
                        return '\\u00' +
                            Math.floor(c / 16).toString(16) +
                            (c % 16).toString(16);
                    });
                }
                return '"' + x + '"';
            },
            object: function (x) {
                if (x) {
                    var a = [], b, f, i, l, v;
                    if (x instanceof Array) {
                        a[0] = '[';
                        l = x.length;
                        for (i = 0; i < l; i += 1) {
                            v = x[i];
                            f = s[typeof v];
                            if (f) {
                                v = f(v);
                                if (typeof v == 'string') {
                                    if (b) {
                                        a[a.length] = ',';
                                    }
                                    a[a.length] = v;
                                    b = true;
                                }
                            }
                        }
                        a[a.length] = ']';
                    } else if (x instanceof Object) {
                        a[0] = '{';
                        for (i in x) {
                            v = x[i];
                            f = s[typeof v];
                            if (f) {
                                v = f(v);
                                if (typeof v == 'string') {
                                    if (b) {
                                        a[a.length] = ',';
                                    }
                                    a.push(s.string(i), ':', v);
                                    b = true;
                                }
                            }
                        }
                        a[a.length] = '}';
                    } else {
                        return;
                    }
                    return a.join('');
                }
                return 'null';
            }
        };
    return {
        copyright: '(c)2005 JSON.org',
        license: 'http://www.crockford.com/JSON/license.html',
        stringify: function (v) {
            var f = s[typeof v];
            if (f) {
                v = f(v);
                if (typeof v == 'string') {
                    return v;
                }
            }
            return null;
        },
        parse: function (text) {
            try {
                if (text.length > 5 * 1024) {
                    return eval('(' + text + ')');
                }
                return !(/[^,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]/.test(
                        text.replace(/"(\\.|[^"\\])*"/g, ''))) &&
                    eval('(' + text + ')');
            } catch (e) {
                return false;
            }
        }
    };
}();
// BEGIN Wikiwyg/Jemplate.js
/*
   This JavaScript code was generated by Jemplate, the JavaScript
   Template Toolkit. Any changes made to this file will be lost the next
   time the templates are compiled.

   Copyright 2006 - Ingy döt Net - All rights reserved.
*/

if (typeof(Jemplate) == 'undefined')
    throw('Jemplate.js must be loaded before any Jemplate template files');

Jemplate.templateMap['save-cancel.html'] = function(context) {
    if (! context) throw('Jemplate function called without context\n');
    var stash = context.stash;
    var output = '';

    try {
output += '<div class="st-widget-buttons">';
//line 3 "save-cancel.html"
stash.set("save_cancel_button_st_widget_save_button",loc('Save'));
//line 4 "save-cancel.html"
stash.set("save_cancel_button_st_widget_cancel_button",loc('Cancel'));
output += '    <span class="st-widget-savebutton"><input type="submit" value=';
//line 5 "save-cancel.html"
output += stash.get('save_cancel_button_st_widget_save_button');
output += ' /></span>\n    <span class="st-widget-cancelbutton"><input type="reset" value=';
//line 6 "save-cancel.html"
output += stash.get('save_cancel_button_st_widget_cancel_button');
output += ' /></span>\n</div>\n';
    }
    catch(e) {
        var error = context.set_error(e, output);
        throw(error);
    }

    return output;
}

Jemplate.templateMap['widget_aim_edit.html'] = function(context) {
    if (! context) throw('Jemplate function called without context\n');
    var stash = context.stash;
    var output = '';

    try {
output += '<span class="st-widget-dialog-title">';
//line 1 "widget_aim_edit.html"
stash.set("aim_st_widget_dialog_title", loc('AIM Link'));
//line 1 "widget_aim_edit.html"
output += stash.get('aim_st_widget_dialog_title');
output += '</span>\n<form>\n<div class="st-widget-dialog">\n<p class="st-widget-description">';
//line 4 "widget_aim_edit.html"
 stash.set("aim_st_widget_description", loc('Display a link to an AIM screen name. The icon will show whether the person is online. Clicking the link will start an IM conversation with the person if your IM client is properly configured. Use this form to edit the properties of the link.')); 
//line 4 "widget_aim_edit.html"
output += stash.get('aim_st_widget_description');
output += '</p>\n<div id="st-widgets-standardoptionspanel">\n<table class="st-widgets-optionstable">\n<tr>';
//line 9 "widget_aim_edit.html"
stash.set("aim_st_widget_dialog_editlabel_field",loc('AIM screen name:'));
output += '<td class="st-widget-dialog-editlabel">';
//line 10 "widget_aim_edit.html"
output += stash.get('aim_st_widget_dialog_editlabel_field');
output += '</td>\n  <td class="st-widget-dialog-editfield">\n    <input size="40" type="text" id="st-widget-aim_id" name="aim_id" value="';
//line 12 "widget_aim_edit.html"

// FILTER
output += (function() {
    var output = '';

output += stash.get('aim_id');

    return context.filter(output, 'html', []);
})();

output += '"/>\n  </td>\n</tr>\n</table>\n</div>\n<div id="aim_widget_edit_error_msg" class="widget_edit_error_msg"></div>\n<div class="st-widgets-options">\n    <img id="st-widgets-optionsicon" src="/static/2.9.3.0/images/st/show_more.gif">\n    <a id="st-widgets-moreoptions" href="#">';
//line 20 "widget_aim_edit.html"
 stash.set('aim_st_widgets_moreoptions', loc('More options')); 
//line 20 "widget_aim_edit.html"
output += stash.get('aim_st_widgets_moreoptions');
output += '</a>\n</div>\n<div id="st-widgets-moreoptionspanel">\n<p class="st-widget-description">';
//line 23 "widget_aim_edit.html"
stash.set("aim_st_widgets_moreoptionspanel",loc('There are no optional properties for an AIM link.'));
//line 23 "widget_aim_edit.html"
output += stash.get('aim_st_widgets_moreoptionspanel');
output += '</p>\n<table class="st-widgets-moreoptionstable">\n\n\n\n\n</table>\n<div class="st-widgetdialog-wikitext">\n    <span class="label">';
//line 31 "widget_aim_edit.html"
stash.set("aim_st_widgetdialog_wikitext",loc('wiki text'));
//line 31 "widget_aim_edit.html"
output += stash.get('aim_st_widgetdialog_wikitext');
output += '\n</span>\n    <span class="wikitext" id="aim_wafl_text">&nbsp;</span>\n</div>\n</div>\n</div>\n';
//line 37 "widget_aim_edit.html"
output += context.process('save-cancel.html');
output += '\n</form>\n\n\n';
    }
    catch(e) {
        var error = context.set_error(e, output);
        throw(error);
    }

    return output;
}

Jemplate.templateMap['widget_asap_edit.html'] = function(context) {
    if (! context) throw('Jemplate function called without context\n');
    var stash = context.stash;
    var output = '';

    try {
output += '<span class="st-widget-dialog-title">';
//line 1 "widget_asap_edit.html"
stash.set("asap_st_widget_dialog_title", loc('Convoq Link'));
//line 1 "widget_asap_edit.html"
output += stash.get('asap_st_widget_dialog_title');
output += '</span>\n<form>\n<div class="st-widget-dialog">\n<p class="st-widget-description">';
//line 4 "widget_asap_edit.html"
 stash.set("asap_st_widget_description", loc('Display a link to a Convoq name. Clicking the link will start a Convoq call with the person if your Convoq client is properly configured. Use this form to edit the properties of the Convoq link.')); 
//line 4 "widget_asap_edit.html"
output += stash.get('asap_st_widget_description');
output += '</p>\n<div id="st-widgets-standardoptionspanel">\n<table class="st-widgets-optionstable">\n<tr>';
//line 9 "widget_asap_edit.html"
stash.set("asap_st_widget_dialog_editlabel_field",loc('Convoq name:'));
output += '<td class="st-widget-dialog-editlabel">';
//line 10 "widget_asap_edit.html"
output += stash.get('asap_st_widget_dialog_editlabel_field');
output += '</td>\n  <td class="st-widget-dialog-editfield">\n    <input size="40" type="text" id="st-widget-asap_id" name="asap_id" value="';
//line 12 "widget_asap_edit.html"

// FILTER
output += (function() {
    var output = '';

output += stash.get('asap_id');

    return context.filter(output, 'html', []);
})();

output += '"/>\n  </td>\n</tr>\n</table>\n</div>\n<div id="asap_widget_edit_error_msg" class="widget_edit_error_msg"></div>\n<div class="st-widgets-options">\n    <img id="st-widgets-optionsicon" src="/static/2.9.3.0/images/st/show_more.gif">\n    <a id="st-widgets-moreoptions" href="#">';
//line 20 "widget_asap_edit.html"
 stash.set('asap_st_widgets_moreoptions', loc('More options')); 
//line 20 "widget_asap_edit.html"
output += stash.get('asap_st_widgets_moreoptions');
output += '</a>\n</div>\n<div id="st-widgets-moreoptionspanel">\n<p class="st-widget-description">';
//line 23 "widget_asap_edit.html"
stash.set("asap_st_widgets_moreoptionspanel",loc('There are no optional properties for a Convoq Link.'));
//line 23 "widget_asap_edit.html"
output += stash.get('asap_st_widgets_moreoptionspanel');
output += '</p>\n<table class="st-widgets-moreoptionstable">\n\n\n\n\n</table>\n<div class="st-widgetdialog-wikitext">\n    <span class="label">';
//line 31 "widget_asap_edit.html"
stash.set("asap_st_widgetdialog_wikitext",loc('wiki text'));
//line 31 "widget_asap_edit.html"
output += stash.get('asap_st_widgetdialog_wikitext');
output += '\n</span>\n    <span class="wikitext" id="asap_wafl_text">&nbsp;</span>\n</div>\n</div>\n</div>\n';
//line 37 "widget_asap_edit.html"
output += context.process('save-cancel.html');
output += '\n</form>\n\n\n';
    }
    catch(e) {
        var error = context.set_error(e, output);
        throw(error);
    }

    return output;
}

Jemplate.templateMap['widget_asis_edit.html'] = function(context) {
    if (! context) throw('Jemplate function called without context\n');
    var stash = context.stash;
    var output = '';

    try {
output += '<span class="st-widget-dialog-title">';
//line 1 "widget_asis_edit.html"
stash.set("asis_st_widget_dialog_title", loc('Unformatted'));
//line 1 "widget_asis_edit.html"
output += stash.get('asis_st_widget_dialog_title');
output += '</span>\n<form>\n<div class="st-widget-dialog">\n<p class="st-widget-description">';
//line 4 "widget_asis_edit.html"
 stash.set("asis_st_widget_description", loc('Include unformatted text in the page. This text will not be treated as wiki text. Use this form to edit the text.')); 
//line 4 "widget_asis_edit.html"
output += stash.get('asis_st_widget_description');
output += '</p>\n<div id="st-widgets-standardoptionspanel">\n<table class="st-widgets-optionstable">\n<tr>';
//line 9 "widget_asis_edit.html"
stash.set("asis_st_widget_dialog_editlabel_field",loc('Unformatted content:'));
output += '<td class="st-widget-dialog-editlabel">';
//line 10 "widget_asis_edit.html"
output += stash.get('asis_st_widget_dialog_editlabel_field');
output += '</td>\n  <td class="st-widget-dialog-editfield">\n    <input size="40" type="text" id="st-widget-asis_content" name="asis_content" value="';
//line 12 "widget_asis_edit.html"

// FILTER
output += (function() {
    var output = '';

output += stash.get('asis_content');

    return context.filter(output, 'html', []);
})();

output += '"/>\n  </td>\n</tr>\n</table>\n</div>\n<div id="asis_widget_edit_error_msg" class="widget_edit_error_msg"></div>\n<div class="st-widgets-options">\n    <img id="st-widgets-optionsicon" src="/static/2.9.3.0/images/st/show_more.gif">\n    <a id="st-widgets-moreoptions" href="#">';
//line 20 "widget_asis_edit.html"
 stash.set('asis_st_widgets_moreoptions', loc('More options')); 
//line 20 "widget_asis_edit.html"
output += stash.get('asis_st_widgets_moreoptions');
output += '</a>\n</div>\n<div id="st-widgets-moreoptionspanel">\n<p class="st-widget-description">';
//line 23 "widget_asis_edit.html"
stash.set("asis_st_widgets_moreoptionspanel",loc('There are no optional properties for unformatted text.'));
//line 23 "widget_asis_edit.html"
output += stash.get('asis_st_widgets_moreoptionspanel');
output += '</p>\n<table class="st-widgets-moreoptionstable">\n\n\n\n\n</table>\n<div class="st-widgetdialog-wikitext">\n    <span class="label">';
//line 31 "widget_asis_edit.html"
stash.set("asis_st_widgetdialog_wikitext",loc('wiki text'));
//line 31 "widget_asis_edit.html"
output += stash.get('asis_st_widgetdialog_wikitext');
output += '\n</span>\n    <span class="wikitext" id="asis_wafl_text">&nbsp;</span>\n</div>\n</div>\n</div>\n';
//line 37 "widget_asis_edit.html"
output += context.process('save-cancel.html');
output += '\n</form>\n\n\n';
    }
    catch(e) {
        var error = context.set_error(e, output);
        throw(error);
    }

    return output;
}

Jemplate.templateMap['widget_date_edit.html'] = function(context) {
    if (! context) throw('Jemplate function called without context\n');
    var stash = context.stash;
    var output = '';

    try {
output += '<span class="st-widget-dialog-title">';
//line 1 "widget_date_edit.html"
stash.set("date_st_widget_dialog_title", loc('Date in Local Time'));
//line 1 "widget_date_edit.html"
output += stash.get('date_st_widget_dialog_title');
output += '</span>\n<form>\n<div class="st-widget-dialog">\n<p class="st-widget-description">';
//line 4 "widget_date_edit.html"
 stash.set("date_st_widget_description", loc('Display the given date and time in the individually-set time zone for each reader. Use this form to edit the date and time to be displayed')); 
//line 4 "widget_date_edit.html"
output += stash.get('date_st_widget_description');
output += '</p>\n<div id="st-widgets-standardoptionspanel">\n<table class="st-widgets-optionstable">\n<tr>';
//line 9 "widget_date_edit.html"
stash.set("date_st_widget_dialog_editlabel_field",loc('YYYY-MM-DD&nbsp;HH:MM:SS:'));
output += '<td class="st-widget-dialog-editlabel">';
//line 10 "widget_date_edit.html"
output += stash.get('date_st_widget_dialog_editlabel_field');
output += '</td>\n  <td class="st-widget-dialog-editfield">\n    <input size="40" type="text" id="st-widget-date_string" name="date_string" value="';
//line 12 "widget_date_edit.html"

// FILTER
output += (function() {
    var output = '';

output += stash.get('date_string');

    return context.filter(output, 'html', []);
})();

output += '"/>\n  </td>\n</tr>\n</table>\n</div>\n<div id="date_widget_edit_error_msg" class="widget_edit_error_msg"></div>\n<div class="st-widgets-options">\n    <img id="st-widgets-optionsicon" src="/static/2.9.3.0/images/st/show_more.gif">\n    <a id="st-widgets-moreoptions" href="#">';
//line 20 "widget_date_edit.html"
 stash.set('date_st_widgets_moreoptions', loc('More options')); 
//line 20 "widget_date_edit.html"
output += stash.get('date_st_widgets_moreoptions');
output += '</a>\n</div>\n<div id="st-widgets-moreoptionspanel">\n<p class="st-widget-description">';
//line 23 "widget_date_edit.html"
stash.set("date_st_widgets_moreoptionspanel",loc('There are no optional properties for a date display.'));
//line 23 "widget_date_edit.html"
output += stash.get('date_st_widgets_moreoptionspanel');
output += '</p>\n<table class="st-widgets-moreoptionstable">\n\n\n\n\n</table>\n<div class="st-widgetdialog-wikitext">\n    <span class="label">';
//line 31 "widget_date_edit.html"
stash.set("date_st_widgetdialog_wikitext",loc('wiki text'));
//line 31 "widget_date_edit.html"
output += stash.get('date_st_widgetdialog_wikitext');
output += '\n</span>\n    <span class="wikitext" id="date_wafl_text">&nbsp;</span>\n</div>\n</div>\n</div>\n';
//line 37 "widget_date_edit.html"
output += context.process('save-cancel.html');
output += '\n</form>\n\n\n';
    }
    catch(e) {
        var error = context.set_error(e, output);
        throw(error);
    }

    return output;
}

Jemplate.templateMap['widget_fetchatom_edit.html'] = function(context) {
    if (! context) throw('Jemplate function called without context\n');
    var stash = context.stash;
    var output = '';

    try {
output += '<span class="st-widget-dialog-title">';
//line 1 "widget_fetchatom_edit.html"
stash.set("fetchatom_st_widget_dialog_title", loc('Inline Atom'));
//line 1 "widget_fetchatom_edit.html"
output += stash.get('fetchatom_st_widget_dialog_title');
output += '</span>\n<form>\n<div class="st-widget-dialog">\n<p class="st-widget-description">';
//line 4 "widget_fetchatom_edit.html"
 stash.set("fetchatom_st_widget_description", loc('Display the content of an Atom feed. Use this form to edit the properties of the inline Atom feed.')); 
//line 4 "widget_fetchatom_edit.html"
output += stash.get('fetchatom_st_widget_description');
output += '</p>\n<div id="st-widgets-standardoptionspanel">\n<table class="st-widgets-optionstable">\n<tr>';
//line 9 "widget_fetchatom_edit.html"
stash.set("fetchatom_st_widget_dialog_editlabel_field",loc('Atom feed URL:'));
output += '<td class="st-widget-dialog-editlabel">';
//line 10 "widget_fetchatom_edit.html"
output += stash.get('fetchatom_st_widget_dialog_editlabel_field');
output += '</td>\n  <td class="st-widget-dialog-editfield">\n    <input size="40" type="text" id="st-widget-atom_url" name="atom_url" value="';
//line 12 "widget_fetchatom_edit.html"

// FILTER
output += (function() {
    var output = '';

output += stash.get('atom_url');

    return context.filter(output, 'html', []);
})();

output += '"/>\n  </td>\n</tr>\n</table>\n</div>\n<div id="fetchatom_widget_edit_error_msg" class="widget_edit_error_msg"></div>\n<div class="st-widgets-options">\n    <img id="st-widgets-optionsicon" src="/static/2.9.3.0/images/st/show_more.gif">\n    <a id="st-widgets-moreoptions" href="#">';
//line 20 "widget_fetchatom_edit.html"
 stash.set('fetchatom_st_widgets_moreoptions', loc('More options')); 
//line 20 "widget_fetchatom_edit.html"
output += stash.get('fetchatom_st_widgets_moreoptions');
output += '</a>\n</div>\n<div id="st-widgets-moreoptionspanel">\n<p class="st-widget-description">';
//line 23 "widget_fetchatom_edit.html"
stash.set("fetchatom_st_widgets_moreoptionspanel",loc('There are no optional properties for an Atom feed.'));
//line 23 "widget_fetchatom_edit.html"
output += stash.get('fetchatom_st_widgets_moreoptionspanel');
output += '</p>\n<table class="st-widgets-moreoptionstable">\n\n\n\n\n</table>\n<div class="st-widgetdialog-wikitext">\n    <span class="label">';
//line 31 "widget_fetchatom_edit.html"
stash.set("fetchatom_st_widgetdialog_wikitext",loc('wiki text'));
//line 31 "widget_fetchatom_edit.html"
output += stash.get('fetchatom_st_widgetdialog_wikitext');
output += '\n</span>\n    <span class="wikitext" id="fetchatom_wafl_text">&nbsp;</span>\n</div>\n</div>\n</div>\n';
//line 37 "widget_fetchatom_edit.html"
output += context.process('save-cancel.html');
output += '\n</form>\n\n\n';
    }
    catch(e) {
        var error = context.set_error(e, output);
        throw(error);
    }

    return output;
}

Jemplate.templateMap['widget_fetchrss_edit.html'] = function(context) {
    if (! context) throw('Jemplate function called without context\n');
    var stash = context.stash;
    var output = '';

    try {
output += '<span class="st-widget-dialog-title">';
//line 1 "widget_fetchrss_edit.html"
stash.set("fetchrss_st_widget_dialog_title", loc('Inline RSS'));
//line 1 "widget_fetchrss_edit.html"
output += stash.get('fetchrss_st_widget_dialog_title');
output += '</span>\n<form>\n<div class="st-widget-dialog">\n<p class="st-widget-description">';
//line 4 "widget_fetchrss_edit.html"
 stash.set("fetchrss_st_widget_description", loc('Display the content of an RSS feed. Use this form to edit the properties of the inline RSS feed.')); 
//line 4 "widget_fetchrss_edit.html"
output += stash.get('fetchrss_st_widget_description');
output += '</p>\n<div id="st-widgets-standardoptionspanel">\n<table class="st-widgets-optionstable">\n<tr>';
//line 9 "widget_fetchrss_edit.html"
stash.set("fetchrss_st_widget_dialog_editlabel_field",loc('RSS feed URL:'));
output += '<td class="st-widget-dialog-editlabel">';
//line 10 "widget_fetchrss_edit.html"
output += stash.get('fetchrss_st_widget_dialog_editlabel_field');
output += '</td>\n  <td class="st-widget-dialog-editfield">\n    <input size="40" type="text" id="st-widget-rss_url" name="rss_url" value="';
//line 12 "widget_fetchrss_edit.html"

// FILTER
output += (function() {
    var output = '';

output += stash.get('rss_url');

    return context.filter(output, 'html', []);
})();

output += '"/>\n  </td>\n</tr>\n</table>\n</div>\n<div id="fetchrss_widget_edit_error_msg" class="widget_edit_error_msg"></div>\n<div class="st-widgets-options">\n    <img id="st-widgets-optionsicon" src="/static/2.9.3.0/images/st/show_more.gif">\n    <a id="st-widgets-moreoptions" href="#">';
//line 20 "widget_fetchrss_edit.html"
 stash.set('fetchrss_st_widgets_moreoptions', loc('More options')); 
//line 20 "widget_fetchrss_edit.html"
output += stash.get('fetchrss_st_widgets_moreoptions');
output += '</a>\n</div>\n<div id="st-widgets-moreoptionspanel">\n<p class="st-widget-description">';
//line 23 "widget_fetchrss_edit.html"
stash.set("fetchrss_st_widgets_moreoptionspanel",loc('There are no optional properties for an RSS feed.'));
//line 23 "widget_fetchrss_edit.html"
output += stash.get('fetchrss_st_widgets_moreoptionspanel');
output += '</p>\n<table class="st-widgets-moreoptionstable">\n\n\n\n\n</table>\n<div class="st-widgetdialog-wikitext">\n    <span class="label">';
//line 31 "widget_fetchrss_edit.html"
stash.set("fetchrss_st_widgetdialog_wikitext",loc('wiki text'));
//line 31 "widget_fetchrss_edit.html"
output += stash.get('fetchrss_st_widgetdialog_wikitext');
output += '\n</span>\n    <span class="wikitext" id="fetchrss_wafl_text">&nbsp;</span>\n</div>\n</div>\n</div>\n';
//line 37 "widget_fetchrss_edit.html"
output += context.process('save-cancel.html');
output += '\n</form>\n\n\n';
    }
    catch(e) {
        var error = context.set_error(e, output);
        throw(error);
    }

    return output;
}

Jemplate.templateMap['widget_file_edit.html'] = function(context) {
    if (! context) throw('Jemplate function called without context\n');
    var stash = context.stash;
    var output = '';

    try {
output += '<span class="st-widget-dialog-title">';
//line 1 "widget_file_edit.html"
stash.set("file_st_widget_dialog_title", loc('Attachment Link'));
//line 1 "widget_file_edit.html"
output += stash.get('file_st_widget_dialog_title');
output += '</span>\n<form>\n<div class="st-widget-dialog">\n<p class="st-widget-description">';
//line 4 "widget_file_edit.html"
 stash.set("file_st_widget_description", loc('Display a link to a file attached to a page. Use this form to edit the properities of the link.')); 
//line 4 "widget_file_edit.html"
output += stash.get('file_st_widget_description');
output += '</p>\n<div id="st-widgets-standardoptionspanel">\n<table class="st-widgets-optionstable">\n<tr>';
//line 9 "widget_file_edit.html"
stash.set("file_st_widget_dialog_editlabel_field",loc('Attachment filename:'));
output += '<td class="st-widget-dialog-editlabel">';
//line 10 "widget_file_edit.html"
output += stash.get('file_st_widget_dialog_editlabel_field');
output += '</td>\n  <td class="st-widget-dialog-editfield">\n    <input size="40" type="text" id="st-widget-file_name" name="file_name" value="';
//line 12 "widget_file_edit.html"

// FILTER
output += (function() {
    var output = '';

output += stash.get('file_name');

    return context.filter(output, 'html', []);
})();

output += '"/>\n  </td>\n</tr>\n</table>\n</div>\n<div id="file_widget_edit_error_msg" class="widget_edit_error_msg"></div>\n<div class="st-widgets-options">\n    <img id="st-widgets-optionsicon" src="/static/2.9.3.0/images/st/show_more.gif">\n    <a id="st-widgets-moreoptions" href="#">';
//line 20 "widget_file_edit.html"
 stash.set('file_st_widgets_moreoptions', loc('More options')); 
//line 20 "widget_file_edit.html"
output += stash.get('file_st_widgets_moreoptions');
output += '</a>\n</div>\n<div id="st-widgets-moreoptionspanel">\n<p class="st-widget-description">';
//line 23 "widget_file_edit.html"
stash.set("file_st_widgets_moreoptionspanel",loc('Optional properties include specifying a different page for the attachment, and link text.'));
//line 23 "widget_file_edit.html"
output += stash.get('file_st_widgets_moreoptionspanel');
output += '</p>\n<table class="st-widgets-moreoptionstable">\n<tr>';
//line 27 "widget_file_edit.html"
stash.set("file_st_widget_dialog_editlabel_field_radio",loc('Page in:'));
output += '  <td class="st-widget-dialog-editlabel">';
//line 28 "widget_file_edit.html"
output += stash.get('file_st_widget_dialog_editlabel_field_radio');
output += '</td>\n  <td class="st-widget-dialog-editfield">\n    <p class="st-widget-dialog-defaultradio"><input type="radio" name="st-widget-workspace_id-rb" value="current" checked>';
//line 32 "widget_file_edit.html"
stash.set("file_st_widget_dialog_defaultradio_current",loc('the current workspace'));
//line 33 "widget_file_edit.html"
output += stash.get('file_st_widget_dialog_defaultradio_current');
//line 33 "widget_file_edit.html"
stash.set("file_st_widget_workspace_id_rb_or",loc('or'));
output += '<i>&nbsp;&nbsp;';
//line 34 "widget_file_edit.html"
output += stash.get('file_st_widget_workspace_id_rb_or');
output += '</i></p>\n<p class="st-widget-dialog-choiceradio">\n  <input type="radio" name="st-widget-workspace_id-rb" value="other">';
//line 38 "widget_file_edit.html"
stash.set("file_st_widget_workspace_id_rb",loc('the workspace named'));
//line 39 "widget_file_edit.html"
output += stash.get('file_st_widget_workspace_id_rb');
output += '&nbsp;\n<input size="25" type="text" id="st-widget-workspace_id" name="workspace_id" value="';
//line 41 "widget_file_edit.html"

// FILTER
output += (function() {
    var output = '';

output += stash.get('workspace_id');

    return context.filter(output, 'html', []);
})();

output += '"/>\n</p>\n</td>\n</tr>\n<tr>';
//line 47 "widget_file_edit.html"
stash.set("file_st_widget_dialog_editlabel_field_radio",loc('File attached to:'));
output += '  <td class="st-widget-dialog-editlabel">';
//line 48 "widget_file_edit.html"
output += stash.get('file_st_widget_dialog_editlabel_field_radio');
output += '</td>\n  <td class="st-widget-dialog-editfield">\n    <p class="st-widget-dialog-defaultradio"><input type="radio" name="st-widget-page_title-rb" value="current" checked>';
//line 52 "widget_file_edit.html"
stash.set("file_st_widget_dialog_defaultradio_current",loc('the current page'));
//line 53 "widget_file_edit.html"
output += stash.get('file_st_widget_dialog_defaultradio_current');
//line 53 "widget_file_edit.html"
stash.set("file_st_widget_page_title_rb_or",loc('or'));
output += '<i>&nbsp;&nbsp;';
//line 54 "widget_file_edit.html"
output += stash.get('file_st_widget_page_title_rb_or');
output += '</i></p>\n<p class="st-widget-dialog-choiceradio">\n  <input type="radio" name="st-widget-page_title-rb" value="other">';
//line 58 "widget_file_edit.html"
stash.set("file_st_widget_page_title_rb",loc('the page titled'));
//line 59 "widget_file_edit.html"
output += stash.get('file_st_widget_page_title_rb');
output += '&nbsp;\n<input size="25" type="text" id="st-widget-page_title" name="page_title" value="';
//line 61 "widget_file_edit.html"

// FILTER
output += (function() {
    var output = '';

output += stash.get('page_title');

    return context.filter(output, 'html', []);
})();

output += '"/>\n</p>\n</td>\n</tr>\n<tr>';
//line 67 "widget_file_edit.html"
stash.set("file_st_widget_dialog_editlabel_field",loc('Link text:'));
output += '<td class="st-widget-dialog-editlabel">';
//line 68 "widget_file_edit.html"
output += stash.get('file_st_widget_dialog_editlabel_field');
output += '</td>\n  <td class="st-widget-dialog-editfield">\n    <input size="40" type="text" id="st-widget-label" name="label" value="';
//line 70 "widget_file_edit.html"

// FILTER
output += (function() {
    var output = '';

output += stash.get('label');

    return context.filter(output, 'html', []);
})();

output += '"/>\n  </td>\n</tr>\n\n\n\n\n</table>\n<div class="st-widgetdialog-wikitext">\n    <span class="label">';
//line 79 "widget_file_edit.html"
stash.set("file_st_widgetdialog_wikitext",loc('wiki text'));
//line 79 "widget_file_edit.html"
output += stash.get('file_st_widgetdialog_wikitext');
output += '\n</span>\n    <span class="wikitext" id="file_wafl_text">&nbsp;</span>\n</div>\n</div>\n</div>\n';
//line 85 "widget_file_edit.html"
output += context.process('save-cancel.html');
output += '\n</form>\n\n\n';
    }
    catch(e) {
        var error = context.set_error(e, output);
        throw(error);
    }

    return output;
}

Jemplate.templateMap['widget_googlesoap_edit.html'] = function(context) {
    if (! context) throw('Jemplate function called without context\n');
    var stash = context.stash;
    var output = '';

    try {
output += '<span class="st-widget-dialog-title">';
//line 1 "widget_googlesoap_edit.html"
stash.set("googlesoap_st_widget_dialog_title", loc('Google Search'));
//line 1 "widget_googlesoap_edit.html"
output += stash.get('googlesoap_st_widget_dialog_title');
output += '</span>\n<form>\n<div class="st-widget-dialog">\n<p class="st-widget-description">';
//line 4 "widget_googlesoap_edit.html"
 stash.set("googlesoap_st_widget_description", loc('Display the results from a Google search. Use this form to edit the properties for the search.')); 
//line 4 "widget_googlesoap_edit.html"
output += stash.get('googlesoap_st_widget_description');
output += '</p>\n<div id="st-widgets-standardoptionspanel">\n<table class="st-widgets-optionstable">\n<tr>';
//line 9 "widget_googlesoap_edit.html"
stash.set("googlesoap_st_widget_dialog_editlabel_field",loc('Search for:'));
output += '<td class="st-widget-dialog-editlabel">';
//line 10 "widget_googlesoap_edit.html"
output += stash.get('googlesoap_st_widget_dialog_editlabel_field');
output += '</td>\n  <td class="st-widget-dialog-editfield">\n    <input size="40" type="text" id="st-widget-search_term" name="search_term" value="';
//line 12 "widget_googlesoap_edit.html"

// FILTER
output += (function() {
    var output = '';

output += stash.get('search_term');

    return context.filter(output, 'html', []);
})();

output += '"/>\n  </td>\n</tr>\n</table>\n</div>\n<div id="googlesoap_widget_edit_error_msg" class="widget_edit_error_msg"></div>\n<div class="st-widgets-options">\n    <img id="st-widgets-optionsicon" src="/static/2.9.3.0/images/st/show_more.gif">\n    <a id="st-widgets-moreoptions" href="#">';
//line 20 "widget_googlesoap_edit.html"
 stash.set('googlesoap_st_widgets_moreoptions', loc('More options')); 
//line 20 "widget_googlesoap_edit.html"
output += stash.get('googlesoap_st_widgets_moreoptions');
output += '</a>\n</div>\n<div id="st-widgets-moreoptionspanel">\n<p class="st-widget-description">';
//line 23 "widget_googlesoap_edit.html"
stash.set("googlesoap_st_widgets_moreoptionspanel",loc('There are no optional properties for an Google search.'));
//line 23 "widget_googlesoap_edit.html"
output += stash.get('googlesoap_st_widgets_moreoptionspanel');
output += '</p>\n<table class="st-widgets-moreoptionstable">\n\n\n\n\n</table>\n<div class="st-widgetdialog-wikitext">\n    <span class="label">';
//line 31 "widget_googlesoap_edit.html"
stash.set("googlesoap_st_widgetdialog_wikitext",loc('wiki text'));
//line 31 "widget_googlesoap_edit.html"
output += stash.get('googlesoap_st_widgetdialog_wikitext');
output += '\n</span>\n    <span class="wikitext" id="googlesoap_wafl_text">&nbsp;</span>\n</div>\n</div>\n</div>\n';
//line 37 "widget_googlesoap_edit.html"
output += context.process('save-cancel.html');
output += '\n</form>\n\n\n';
    }
    catch(e) {
        var error = context.set_error(e, output);
        throw(error);
    }

    return output;
}

Jemplate.templateMap['widget_image_edit.html'] = function(context) {
    if (! context) throw('Jemplate function called without context\n');
    var stash = context.stash;
    var output = '';

    try {
output += '<span class="st-widget-dialog-title">';
//line 1 "widget_image_edit.html"
stash.set("image_st_widget_dialog_title", loc('Attached Image'));
//line 1 "widget_image_edit.html"
output += stash.get('image_st_widget_dialog_title');
output += '</span>\n<form>\n<div class="st-widget-dialog">\n<p class="st-widget-description">';
//line 4 "widget_image_edit.html"
 stash.set("image_st_widget_description", loc('Display an image on this page. The image must be already uploaded as an attachment to this page or another page. Use this form to edit the properties of the displayed image.')); 
//line 4 "widget_image_edit.html"
output += stash.get('image_st_widget_description');
output += '</p>\n<div id="st-widgets-standardoptionspanel">\n<table class="st-widgets-optionstable">\n<tr>';
//line 9 "widget_image_edit.html"
stash.set("image_st_widget_dialog_editlabel_field",loc('Attachment filename:'));
output += '<td class="st-widget-dialog-editlabel">';
//line 10 "widget_image_edit.html"
output += stash.get('image_st_widget_dialog_editlabel_field');
output += '</td>\n  <td class="st-widget-dialog-editfield">\n    <input size="40" type="text" id="st-widget-image_name" name="image_name" value="';
//line 12 "widget_image_edit.html"

// FILTER
output += (function() {
    var output = '';

output += stash.get('image_name');

    return context.filter(output, 'html', []);
})();

output += '"/>\n  </td>\n</tr>\n</table>\n</div>\n<div id="image_widget_edit_error_msg" class="widget_edit_error_msg"></div>\n<div class="st-widgets-options">\n    <img id="st-widgets-optionsicon" src="/static/2.9.3.0/images/st/show_more.gif">\n    <a id="st-widgets-moreoptions" href="#">';
//line 20 "widget_image_edit.html"
 stash.set('image_st_widgets_moreoptions', loc('More options')); 
//line 20 "widget_image_edit.html"
output += stash.get('image_st_widgets_moreoptions');
output += '</a>\n</div>\n<div id="st-widgets-moreoptionspanel">\n<p class="st-widget-description">';
//line 23 "widget_image_edit.html"
stash.set("image_st_widgets_moreoptionspanel",loc('Optional properties include the title of another page to which the image is attached, and link text. If link text is specified then a link to the image is displayed instead of the image.'));
//line 23 "widget_image_edit.html"
output += stash.get('image_st_widgets_moreoptionspanel');
output += '</p>\n<table class="st-widgets-moreoptionstable">\n<tr>';
//line 27 "widget_image_edit.html"
stash.set("image_st_widget_dialog_editlabel_field_radio",loc('Page in:'));
output += '  <td class="st-widget-dialog-editlabel">';
//line 28 "widget_image_edit.html"
output += stash.get('image_st_widget_dialog_editlabel_field_radio');
output += '</td>\n  <td class="st-widget-dialog-editfield">\n    <p class="st-widget-dialog-defaultradio"><input type="radio" name="st-widget-workspace_id-rb" value="current" checked>';
//line 32 "widget_image_edit.html"
stash.set("image_st_widget_dialog_defaultradio_current",loc('the current workspace'));
//line 33 "widget_image_edit.html"
output += stash.get('image_st_widget_dialog_defaultradio_current');
//line 33 "widget_image_edit.html"
stash.set("image_st_widget_workspace_id_rb_or",loc('or'));
output += '<i>&nbsp;&nbsp;';
//line 34 "widget_image_edit.html"
output += stash.get('image_st_widget_workspace_id_rb_or');
output += '</i></p>\n<p class="st-widget-dialog-choiceradio">\n  <input type="radio" name="st-widget-workspace_id-rb" value="other">';
//line 38 "widget_image_edit.html"
stash.set("image_st_widget_workspace_id_rb",loc('the workspace named'));
//line 39 "widget_image_edit.html"
output += stash.get('image_st_widget_workspace_id_rb');
output += '&nbsp;\n<input size="25" type="text" id="st-widget-workspace_id" name="workspace_id" value="';
//line 41 "widget_image_edit.html"

// FILTER
output += (function() {
    var output = '';

output += stash.get('workspace_id');

    return context.filter(output, 'html', []);
})();

output += '"/>\n</p>\n</td>\n</tr>\n<tr>';
//line 47 "widget_image_edit.html"
stash.set("image_st_widget_dialog_editlabel_field_radio",loc('Attached to:'));
output += '  <td class="st-widget-dialog-editlabel">';
//line 48 "widget_image_edit.html"
output += stash.get('image_st_widget_dialog_editlabel_field_radio');
output += '</td>\n  <td class="st-widget-dialog-editfield">\n    <p class="st-widget-dialog-defaultradio"><input type="radio" name="st-widget-page_title-rb" value="current" checked>';
//line 52 "widget_image_edit.html"
stash.set("image_st_widget_dialog_defaultradio_current",loc('the current page'));
//line 53 "widget_image_edit.html"
output += stash.get('image_st_widget_dialog_defaultradio_current');
//line 53 "widget_image_edit.html"
stash.set("image_st_widget_page_title_rb_or",loc('or'));
output += '<i>&nbsp;&nbsp;';
//line 54 "widget_image_edit.html"
output += stash.get('image_st_widget_page_title_rb_or');
output += '</i></p>\n<p class="st-widget-dialog-choiceradio">\n  <input type="radio" name="st-widget-page_title-rb" value="other">';
//line 58 "widget_image_edit.html"
stash.set("image_st_widget_page_title_rb",loc('the page titled'));
//line 59 "widget_image_edit.html"
output += stash.get('image_st_widget_page_title_rb');
output += '&nbsp;\n<input size="25" type="text" id="st-widget-page_title" name="page_title" value="';
//line 61 "widget_image_edit.html"

// FILTER
output += (function() {
    var output = '';

output += stash.get('page_title');

    return context.filter(output, 'html', []);
})();

output += '"/>\n</p>\n</td>\n</tr>\n<tr>';
//line 67 "widget_image_edit.html"
stash.set("image_st_widget_dialog_editlabel_field",loc('Link text:'));
output += '<td class="st-widget-dialog-editlabel">';
//line 68 "widget_image_edit.html"
output += stash.get('image_st_widget_dialog_editlabel_field');
output += '</td>\n  <td class="st-widget-dialog-editfield">\n    <input size="40" type="text" id="st-widget-label" name="label" value="';
//line 70 "widget_image_edit.html"

// FILTER
output += (function() {
    var output = '';

output += stash.get('label');

    return context.filter(output, 'html', []);
})();

output += '"/>\n  </td>\n</tr>\n\n\n\n\n</table>\n<div class="st-widgetdialog-wikitext">\n    <span class="label">';
//line 79 "widget_image_edit.html"
stash.set("image_st_widgetdialog_wikitext",loc('wiki text'));
//line 79 "widget_image_edit.html"
output += stash.get('image_st_widgetdialog_wikitext');
output += '\n</span>\n    <span class="wikitext" id="image_wafl_text">&nbsp;</span>\n</div>\n</div>\n</div>\n';
//line 85 "widget_image_edit.html"
output += context.process('save-cancel.html');
output += '\n</form>\n\n\n';
    }
    catch(e) {
        var error = context.set_error(e, output);
        throw(error);
    }

    return output;
}

Jemplate.templateMap['widget_include_edit.html'] = function(context) {
    if (! context) throw('Jemplate function called without context\n');
    var stash = context.stash;
    var output = '';

    try {
output += '<span class="st-widget-dialog-title">';
//line 1 "widget_include_edit.html"
stash.set("include_st_widget_dialog_title", loc('Page Include'));
//line 1 "widget_include_edit.html"
output += stash.get('include_st_widget_dialog_title');
output += '</span>\n<form>\n<div class="st-widget-dialog">\n<p class="st-widget-description">';
//line 4 "widget_include_edit.html"
 stash.set("include_st_widget_description", loc('Display the contents of another page within the current page. Use this form to edit the properties for the page include.')); 
//line 4 "widget_include_edit.html"
output += stash.get('include_st_widget_description');
output += '</p>\n<div id="st-widgets-standardoptionspanel">\n<table class="st-widgets-optionstable">\n<tr>';
//line 9 "widget_include_edit.html"
stash.set("include_st_widget_dialog_editlabel_field_radio",loc('Other page in:'));
output += '  <td class="st-widget-dialog-editlabel">';
//line 10 "widget_include_edit.html"
output += stash.get('include_st_widget_dialog_editlabel_field_radio');
output += '</td>\n  <td class="st-widget-dialog-editfield">\n    <p class="st-widget-dialog-defaultradio"><input type="radio" name="st-widget-workspace_id-rb" value="current" checked>';
//line 14 "widget_include_edit.html"
stash.set("include_st_widget_dialog_defaultradio_current",loc('the current workspace'));
//line 15 "widget_include_edit.html"
output += stash.get('include_st_widget_dialog_defaultradio_current');
//line 15 "widget_include_edit.html"
stash.set("include_st_widget_workspace_id_rb_or",loc('or'));
output += '<i>&nbsp;&nbsp;';
//line 16 "widget_include_edit.html"
output += stash.get('include_st_widget_workspace_id_rb_or');
output += '</i></p>\n<p class="st-widget-dialog-choiceradio">\n  <input type="radio" name="st-widget-workspace_id-rb" value="other">';
//line 20 "widget_include_edit.html"
stash.set("include_st_widget_workspace_id_rb",loc('the workspace named'));
//line 21 "widget_include_edit.html"
output += stash.get('include_st_widget_workspace_id_rb');
output += '&nbsp;\n<input size="25" type="text" id="st-widget-workspace_id" name="workspace_id" value="';
//line 23 "widget_include_edit.html"

// FILTER
output += (function() {
    var output = '';

output += stash.get('workspace_id');

    return context.filter(output, 'html', []);
})();

output += '"/>\n</p>\n</td>\n</tr>\n<tr>';
//line 29 "widget_include_edit.html"
stash.set("include_st_widget_dialog_editlabel_field",loc('Page title:'));
output += '<td class="st-widget-dialog-editlabel">';
//line 30 "widget_include_edit.html"
output += stash.get('include_st_widget_dialog_editlabel_field');
output += '</td>\n  <td class="st-widget-dialog-editfield">\n    <input size="40" type="text" id="st-widget-page_title" name="page_title" value="';
//line 32 "widget_include_edit.html"

// FILTER
output += (function() {
    var output = '';

output += stash.get('page_title');

    return context.filter(output, 'html', []);
})();

output += '"/>\n  </td>\n</tr>\n</table>\n</div>\n<div id="include_widget_edit_error_msg" class="widget_edit_error_msg"></div>\n<div class="st-widgets-options">\n    <img id="st-widgets-optionsicon" src="/static/2.9.3.0/images/st/show_more.gif">\n    <a id="st-widgets-moreoptions" href="#">';
//line 40 "widget_include_edit.html"
 stash.set('include_st_widgets_moreoptions', loc('More options')); 
//line 40 "widget_include_edit.html"
output += stash.get('include_st_widgets_moreoptions');
output += '</a>\n</div>\n<div id="st-widgets-moreoptionspanel">\n<p class="st-widget-description">';
//line 43 "widget_include_edit.html"
stash.set("include_st_widgets_moreoptionspanel",loc('There are no optional properties for page include.'));
//line 43 "widget_include_edit.html"
output += stash.get('include_st_widgets_moreoptionspanel');
output += '</p>\n<table class="st-widgets-moreoptionstable">\n\n\n\n\n</table>\n<div class="st-widgetdialog-wikitext">\n    <span class="label">';
//line 51 "widget_include_edit.html"
stash.set("include_st_widgetdialog_wikitext",loc('wiki text'));
//line 51 "widget_include_edit.html"
output += stash.get('include_st_widgetdialog_wikitext');
output += '\n</span>\n    <span class="wikitext" id="include_wafl_text">&nbsp;</span>\n</div>\n</div>\n</div>\n';
//line 57 "widget_include_edit.html"
output += context.process('save-cancel.html');
output += '\n</form>\n\n\n';
    }
    catch(e) {
        var error = context.set_error(e, output);
        throw(error);
    }

    return output;
}

Jemplate.templateMap['widget_link1_edit.html'] = function(context) {
    if (! context) throw('Jemplate function called without context\n');
    var stash = context.stash;
    var output = '';

    try {
output += '<span class="st-widget-dialog-title">';
//line 1 "widget_link1_edit.html"
stash.set("link1_st_widget_dialog_title", loc('Inter-workspace link'));
//line 1 "widget_link1_edit.html"
output += stash.get('link1_st_widget_dialog_title');
output += '</span>\n<form>\n<div class="st-widget-dialog">\n<p class="st-widget-description">';
//line 4 "widget_link1_edit.html"
 stash.set("link1_st_widget_description", loc('Use this form to edit the properties of the link.')); 
//line 4 "widget_link1_edit.html"
output += stash.get('link1_st_widget_description');
output += '</p>\n<div id="st-widgets-standardoptionspanel">\n<table class="st-widgets-optionstable">\n<tr>';
//line 9 "widget_link1_edit.html"
stash.set("link1_st_widget_dialog_editlabel_field",loc('Other workspace:'));
output += '<td class="st-widget-dialog-editlabel">';
//line 10 "widget_link1_edit.html"
output += stash.get('link1_st_widget_dialog_editlabel_field');
output += '</td>\n  <td class="st-widget-dialog-editfield">\n    <input size="40" type="text" id="st-widget-workspace_id" name="workspace_id" value="';
//line 12 "widget_link1_edit.html"

// FILTER
output += (function() {
    var output = '';

output += stash.get('workspace_id');

    return context.filter(output, 'html', []);
})();

output += '"/>\n  </td>\n</tr>\n<tr>';
//line 17 "widget_link1_edit.html"
stash.set("link1_st_widget_dialog_editlabel_field",loc('Page title:'));
output += '<td class="st-widget-dialog-editlabel">';
//line 18 "widget_link1_edit.html"
output += stash.get('link1_st_widget_dialog_editlabel_field');
output += '</td>\n  <td class="st-widget-dialog-editfield">\n    <input size="40" type="text" id="st-widget-page_title" name="page_title" value="';
//line 20 "widget_link1_edit.html"

// FILTER
output += (function() {
    var output = '';

output += stash.get('page_title');

    return context.filter(output, 'html', []);
})();

output += '"/>\n  </td>\n</tr>\n</table>\n</div>\n<div id="link1_widget_edit_error_msg" class="widget_edit_error_msg"></div>\n<div class="st-widgets-options">\n    <img id="st-widgets-optionsicon" src="/static/2.9.3.0/images/st/show_more.gif">\n    <a id="st-widgets-moreoptions" href="#">';
//line 28 "widget_link1_edit.html"
 stash.set('link1_st_widgets_moreoptions', loc('More options')); 
//line 28 "widget_link1_edit.html"
output += stash.get('link1_st_widgets_moreoptions');
output += '</a>\n</div>\n<div id="st-widgets-moreoptionspanel">\n<p class="st-widget-description">';
//line 31 "widget_link1_edit.html"
stash.set("link1_st_widgets_moreoptionspanel",loc('Optional properties include the text to display for the link, and a target section within the linked page.'));
//line 31 "widget_link1_edit.html"
output += stash.get('link1_st_widgets_moreoptionspanel');
output += '</p>\n<table class="st-widgets-moreoptionstable">\n<tr>';
//line 35 "widget_link1_edit.html"
stash.set("link1_st_widget_dialog_editlabel_field",loc('Link text:'));
output += '<td class="st-widget-dialog-editlabel">';
//line 36 "widget_link1_edit.html"
output += stash.get('link1_st_widget_dialog_editlabel_field');
output += '</td>\n  <td class="st-widget-dialog-editfield">\n    <input size="40" type="text" id="st-widget-label" name="label" value="';
//line 38 "widget_link1_edit.html"

// FILTER
output += (function() {
    var output = '';

output += stash.get('label');

    return context.filter(output, 'html', []);
})();

output += '"/>\n  </td>\n</tr>\n<tr>';
//line 43 "widget_link1_edit.html"
stash.set("link1_st_widget_dialog_editlabel_field",loc('Section name:'));
output += '<td class="st-widget-dialog-editlabel">';
//line 44 "widget_link1_edit.html"
output += stash.get('link1_st_widget_dialog_editlabel_field');
output += '</td>\n  <td class="st-widget-dialog-editfield">\n    <input size="40" type="text" id="st-widget-section_name" name="section_name" value="';
//line 46 "widget_link1_edit.html"

// FILTER
output += (function() {
    var output = '';

output += stash.get('section_name');

    return context.filter(output, 'html', []);
})();

output += '"/>\n  </td>\n</tr>\n\n\n\n\n</table>\n<div class="st-widgetdialog-wikitext">\n    <span class="label">';
//line 55 "widget_link1_edit.html"
stash.set("link1_st_widgetdialog_wikitext",loc('wiki text'));
//line 55 "widget_link1_edit.html"
output += stash.get('link1_st_widgetdialog_wikitext');
output += '\n</span>\n    <span class="wikitext" id="link1_wafl_text">&nbsp;</span>\n</div>\n</div>\n</div>\n';
//line 61 "widget_link1_edit.html"
output += context.process('save-cancel.html');
output += '\n</form>\n\n\n';
    }
    catch(e) {
        var error = context.set_error(e, output);
        throw(error);
    }

    return output;
}

Jemplate.templateMap['widget_link2_edit.html'] = function(context) {
    if (! context) throw('Jemplate function called without context\n');
    var stash = context.stash;
    var output = '';

    try {
output += '<span class="st-widget-dialog-title">';
//line 1 "widget_link2_edit.html"
stash.set("link2_st_widget_dialog_title", loc('Link to a Section'));
//line 1 "widget_link2_edit.html"
output += stash.get('link2_st_widget_dialog_title');
output += '</span>\n<form>\n<div class="st-widget-dialog">\n<p class="st-widget-description">';
//line 4 "widget_link2_edit.html"
 stash.set("link2_st_widget_description", loc('Use this form to edit the properties of the link to a page section.')); 
//line 4 "widget_link2_edit.html"
output += stash.get('link2_st_widget_description');
output += '</p>\n<div id="st-widgets-standardoptionspanel">\n<table class="st-widgets-optionstable">\n<tr>';
//line 9 "widget_link2_edit.html"
stash.set("link2_st_widget_dialog_editlabel_field",loc('Section name:'));
output += '<td class="st-widget-dialog-editlabel">';
//line 10 "widget_link2_edit.html"
output += stash.get('link2_st_widget_dialog_editlabel_field');
output += '</td>\n  <td class="st-widget-dialog-editfield">\n    <input size="40" type="text" id="st-widget-section_name" name="section_name" value="';
//line 12 "widget_link2_edit.html"

// FILTER
output += (function() {
    var output = '';

output += stash.get('section_name');

    return context.filter(output, 'html', []);
})();

output += '"/>\n  </td>\n</tr>\n</table>\n</div>\n<div id="link2_widget_edit_error_msg" class="widget_edit_error_msg"></div>\n<div class="st-widgets-options">\n    <img id="st-widgets-optionsicon" src="/static/2.9.3.0/images/st/show_more.gif">\n    <a id="st-widgets-moreoptions" href="#">';
//line 20 "widget_link2_edit.html"
 stash.set('link2_st_widgets_moreoptions', loc('More options')); 
//line 20 "widget_link2_edit.html"
output += stash.get('link2_st_widgets_moreoptions');
output += '</a>\n</div>\n<div id="st-widgets-moreoptionspanel">\n<p class="st-widget-description">';
//line 23 "widget_link2_edit.html"
stash.set("link2_st_widgets_moreoptionspanel",loc('Optional properties include the text to display for the link, and the title of a different page.'));
//line 23 "widget_link2_edit.html"
output += stash.get('link2_st_widgets_moreoptionspanel');
output += '</p>\n<table class="st-widgets-moreoptionstable">\n<tr>';
//line 27 "widget_link2_edit.html"
stash.set("link2_st_widget_dialog_editlabel_field",loc('Link text:'));
output += '<td class="st-widget-dialog-editlabel">';
//line 28 "widget_link2_edit.html"
output += stash.get('link2_st_widget_dialog_editlabel_field');
output += '</td>\n  <td class="st-widget-dialog-editfield">\n    <input size="40" type="text" id="st-widget-label" name="label" value="';
//line 30 "widget_link2_edit.html"

// FILTER
output += (function() {
    var output = '';

output += stash.get('label');

    return context.filter(output, 'html', []);
})();

output += '"/>\n  </td>\n</tr>\n<tr>';
//line 35 "widget_link2_edit.html"
stash.set("link2_st_widget_dialog_editlabel_field_radio",loc('Workspace:'));
output += '  <td class="st-widget-dialog-editlabel">';
//line 36 "widget_link2_edit.html"
output += stash.get('link2_st_widget_dialog_editlabel_field_radio');
output += '</td>\n  <td class="st-widget-dialog-editfield">\n    <p class="st-widget-dialog-defaultradio"><input type="radio" name="st-widget-workspace_id-rb" value="current" checked>';
//line 40 "widget_link2_edit.html"
stash.set("link2_st_widget_dialog_defaultradio_current",loc('the current workspace'));
//line 41 "widget_link2_edit.html"
output += stash.get('link2_st_widget_dialog_defaultradio_current');
//line 41 "widget_link2_edit.html"
stash.set("link2_st_widget_workspace_id_rb_or",loc('or'));
output += '<i>&nbsp;&nbsp;';
//line 42 "widget_link2_edit.html"
output += stash.get('link2_st_widget_workspace_id_rb_or');
output += '</i></p>\n<p class="st-widget-dialog-choiceradio">\n  <input type="radio" name="st-widget-workspace_id-rb" value="other">';
//line 46 "widget_link2_edit.html"
stash.set("link2_st_widget_workspace_id_rb",loc('the workspace named'));
//line 47 "widget_link2_edit.html"
output += stash.get('link2_st_widget_workspace_id_rb');
output += '&nbsp;\n<input size="25" type="text" id="st-widget-workspace_id" name="workspace_id" value="';
//line 49 "widget_link2_edit.html"

// FILTER
output += (function() {
    var output = '';

output += stash.get('workspace_id');

    return context.filter(output, 'html', []);
})();

output += '"/>\n</p>\n</td>\n</tr>\n<tr>';
//line 55 "widget_link2_edit.html"
stash.set("link2_st_widget_dialog_editlabel_field_radio",loc('Page title:'));
output += '  <td class="st-widget-dialog-editlabel">';
//line 56 "widget_link2_edit.html"
output += stash.get('link2_st_widget_dialog_editlabel_field_radio');
output += '</td>\n  <td class="st-widget-dialog-editfield">\n    <p class="st-widget-dialog-defaultradio"><input type="radio" name="st-widget-page_title-rb" value="current" checked>';
//line 60 "widget_link2_edit.html"
stash.set("link2_st_widget_dialog_defaultradio_current",loc('the current page'));
//line 61 "widget_link2_edit.html"
output += stash.get('link2_st_widget_dialog_defaultradio_current');
//line 61 "widget_link2_edit.html"
stash.set("link2_st_widget_page_title_rb_or",loc('or'));
output += '<i>&nbsp;&nbsp;';
//line 62 "widget_link2_edit.html"
output += stash.get('link2_st_widget_page_title_rb_or');
output += '</i></p>\n<p class="st-widget-dialog-choiceradio">\n  <input type="radio" name="st-widget-page_title-rb" value="other">';
//line 66 "widget_link2_edit.html"
stash.set("link2_st_widget_page_title_rb",loc('the page titled'));
//line 67 "widget_link2_edit.html"
output += stash.get('link2_st_widget_page_title_rb');
output += '&nbsp;\n<input size="25" type="text" id="st-widget-page_title" name="page_title" value="';
//line 69 "widget_link2_edit.html"

// FILTER
output += (function() {
    var output = '';

output += stash.get('page_title');

    return context.filter(output, 'html', []);
})();

output += '"/>\n</p>\n</td>\n</tr>\n\n\n\n\n</table>\n<div class="st-widgetdialog-wikitext">\n    <span class="label">';
//line 79 "widget_link2_edit.html"
stash.set("link2_st_widgetdialog_wikitext",loc('wiki text'));
//line 79 "widget_link2_edit.html"
output += stash.get('link2_st_widgetdialog_wikitext');
output += '\n</span>\n    <span class="wikitext" id="link2_wafl_text">&nbsp;</span>\n</div>\n</div>\n</div>\n';
//line 85 "widget_link2_edit.html"
output += context.process('save-cancel.html');
output += '\n</form>\n\n\n';
    }
    catch(e) {
        var error = context.set_error(e, output);
        throw(error);
    }

    return output;
}

Jemplate.templateMap['widget_new_form_page_edit.html'] = function(context) {
    if (! context) throw('Jemplate function called without context\n');
    var stash = context.stash;
    var output = '';

    try {
output += '<span class="st-widget-dialog-title">';
//line 1 "widget_new_form_page_edit.html"
stash.set("new_form_page_st_widget_dialog_title", loc('New Form Page'));
//line 1 "widget_new_form_page_edit.html"
output += stash.get('new_form_page_st_widget_dialog_title');
output += '</span>\n<form>\n<div class="st-widget-dialog">\n<p class="st-widget-description">';
//line 4 "widget_new_form_page_edit.html"
 stash.set("new_form_page_st_widget_description", loc('Select a form and generates a new form page.')); 
//line 4 "widget_new_form_page_edit.html"
output += stash.get('new_form_page_st_widget_description');
output += '</p>\n<div id="st-widgets-standardoptionspanel">\n<table class="st-widgets-optionstable">\n<tr>';
//line 9 "widget_new_form_page_edit.html"
stash.set("new_form_page_st_widget_dialog_editlabel_field",loc('Form name:'));
output += '<td class="st-widget-dialog-editlabel">';
//line 10 "widget_new_form_page_edit.html"
output += stash.get('new_form_page_st_widget_dialog_editlabel_field');
output += '</td>\n  <td class="st-widget-dialog-editfield">\n    <input size="40" type="text" id="st-widget-form_name" name="form_name" value="';
//line 12 "widget_new_form_page_edit.html"

// FILTER
output += (function() {
    var output = '';

output += stash.get('form_name');

    return context.filter(output, 'html', []);
})();

output += '"/>\n  </td>\n</tr>\n<tr>';
//line 17 "widget_new_form_page_edit.html"
stash.set("new_form_page_st_widget_dialog_editlabel_field",loc('Link text:'));
output += '<td class="st-widget-dialog-editlabel">';
//line 18 "widget_new_form_page_edit.html"
output += stash.get('new_form_page_st_widget_dialog_editlabel_field');
output += '</td>\n  <td class="st-widget-dialog-editfield">\n    <input size="40" type="text" id="st-widget-form_text" name="form_text" value="';
//line 20 "widget_new_form_page_edit.html"

// FILTER
output += (function() {
    var output = '';

output += stash.get('form_text');

    return context.filter(output, 'html', []);
})();

output += '"/>\n  </td>\n</tr>\n</table>\n</div>\n<div id="new_form_page_widget_edit_error_msg" class="widget_edit_error_msg"></div>\n<div class="st-widgets-options">\n    <img id="st-widgets-optionsicon" src="/static/2.9.3.0/images/st/show_more.gif">\n    <a id="st-widgets-moreoptions" href="#">';
//line 28 "widget_new_form_page_edit.html"
 stash.set('new_form_page_st_widgets_moreoptions', loc('More options')); 
//line 28 "widget_new_form_page_edit.html"
output += stash.get('new_form_page_st_widgets_moreoptions');
output += '</a>\n</div>\n<div id="st-widgets-moreoptionspanel">\n<p class="st-widget-description">';
//line 31 "widget_new_form_page_edit.html"
stash.set("new_form_page_st_widgets_moreoptionspanel",loc('There are no optional properties for a new form page.'));
//line 31 "widget_new_form_page_edit.html"
output += stash.get('new_form_page_st_widgets_moreoptionspanel');
output += '</p>\n<table class="st-widgets-moreoptionstable">\n\n\n\n\n</table>\n<div class="st-widgetdialog-wikitext">\n    <span class="label">';
//line 39 "widget_new_form_page_edit.html"
stash.set("new_form_page_st_widgetdialog_wikitext",loc('wiki text'));
//line 39 "widget_new_form_page_edit.html"
output += stash.get('new_form_page_st_widgetdialog_wikitext');
output += '\n</span>\n    <span class="wikitext" id="new_form_page_wafl_text">&nbsp;</span>\n</div>\n</div>\n</div>\n';
//line 45 "widget_new_form_page_edit.html"
output += context.process('save-cancel.html');
output += '\n</form>\n\n\n';
    }
    catch(e) {
        var error = context.set_error(e, output);
        throw(error);
    }

    return output;
}

Jemplate.templateMap['widget_recent_changes_edit.html'] = function(context) {
    if (! context) throw('Jemplate function called without context\n');
    var stash = context.stash;
    var output = '';

    try {
output += '<span class="st-widget-dialog-title">';
//line 1 "widget_recent_changes_edit.html"
stash.set("recent_changes_st_widget_dialog_title", loc('What\'s New'));
//line 1 "widget_recent_changes_edit.html"
output += stash.get('recent_changes_st_widget_dialog_title');
output += '</span>\n<form>\n<div class="st-widget-dialog">\n<p class="st-widget-description">';
//line 4 "widget_recent_changes_edit.html"
 stash.set("recent_changes_st_widget_description", loc('Display a list of pages recently changed in a workspace. By default only the page titles are displayed. Use this form to edit the list properties.')); 
//line 4 "widget_recent_changes_edit.html"
output += stash.get('recent_changes_st_widget_description');
output += '</p>\n<div id="st-widgets-standardoptionspanel">\n<table class="st-widgets-optionstable">\n<tr>';
//line 9 "widget_recent_changes_edit.html"
stash.set("recent_changes_st_widget_dialog_editlabel_field_radio",loc('Workspace:'));
output += '  <td class="st-widget-dialog-editlabel">';
//line 10 "widget_recent_changes_edit.html"
output += stash.get('recent_changes_st_widget_dialog_editlabel_field_radio');
output += '</td>\n  <td class="st-widget-dialog-editfield">\n    <p class="st-widget-dialog-defaultradio"><input type="radio" name="st-widget-workspace_id-rb" value="current" checked>';
//line 14 "widget_recent_changes_edit.html"
stash.set("recent_changes_st_widget_dialog_defaultradio_current",loc('the current workspace'));
//line 15 "widget_recent_changes_edit.html"
output += stash.get('recent_changes_st_widget_dialog_defaultradio_current');
//line 15 "widget_recent_changes_edit.html"
stash.set("recent_changes_st_widget_workspace_id_rb_or",loc('or'));
output += '<i>&nbsp;&nbsp;';
//line 16 "widget_recent_changes_edit.html"
output += stash.get('recent_changes_st_widget_workspace_id_rb_or');
output += '</i></p>\n<p class="st-widget-dialog-choiceradio">\n  <input type="radio" name="st-widget-workspace_id-rb" value="other">';
//line 20 "widget_recent_changes_edit.html"
stash.set("recent_changes_st_widget_workspace_id_rb",loc('the workspace named'));
//line 21 "widget_recent_changes_edit.html"
output += stash.get('recent_changes_st_widget_workspace_id_rb');
output += '&nbsp;\n<input size="25" type="text" id="st-widget-workspace_id" name="workspace_id" value="';
//line 23 "widget_recent_changes_edit.html"

// FILTER
output += (function() {
    var output = '';

output += stash.get('workspace_id');

    return context.filter(output, 'html', []);
})();

output += '"/>\n</p>\n</td>\n</tr>\n</table>\n</div>\n<div id="recent_changes_widget_edit_error_msg" class="widget_edit_error_msg"></div>\n<div class="st-widgets-options">\n    <img id="st-widgets-optionsicon" src="/static/2.9.3.0/images/st/show_more.gif">\n    <a id="st-widgets-moreoptions" href="#">';
//line 32 "widget_recent_changes_edit.html"
 stash.set('recent_changes_st_widgets_moreoptions', loc('More options')); 
//line 32 "widget_recent_changes_edit.html"
output += stash.get('recent_changes_st_widgets_moreoptions');
output += '</a>\n</div>\n<div id="st-widgets-moreoptionspanel">\n<p class="st-widget-description">';
//line 35 "widget_recent_changes_edit.html"
stash.set("recent_changes_st_widgets_moreoptionspanel",loc('Optionally, specify that the page contents should be displayed.'));
//line 35 "widget_recent_changes_edit.html"
output += stash.get('recent_changes_st_widgets_moreoptionspanel');
output += '</p>\n<table class="st-widgets-moreoptionstable">\n\n\n\n\n<tr>\n<td class="st-widget-dialog-editlabel">';
//line 44 "widget_recent_changes_edit.html"
stash.set("recent_changes_st_widget_dialog_editlable_results",loc('Full results:'));
//line 44 "widget_recent_changes_edit.html"
output += stash.get('recent_changes_st_widget_dialog_editlable_results');
output += '\n</td>\n<td class="st-widget-dialog-editfield">\n<input type="checkbox" name="full"';
//line 47 "widget_recent_changes_edit.html"
if (stash.get('full')) {
output += ' checked="checked"';
}

output += ' />\n</td>\n</tr>\n\n</table>\n<div class="st-widgetdialog-wikitext">\n    <span class="label">';
//line 53 "widget_recent_changes_edit.html"
stash.set("recent_changes_st_widgetdialog_wikitext",loc('wiki text'));
//line 53 "widget_recent_changes_edit.html"
output += stash.get('recent_changes_st_widgetdialog_wikitext');
output += '\n</span>\n    <span class="wikitext" id="recent_changes_wafl_text">&nbsp;</span>\n</div>\n</div>\n</div>\n';
//line 59 "widget_recent_changes_edit.html"
output += context.process('save-cancel.html');
output += '\n</form>\n\n\n';
    }
    catch(e) {
        var error = context.set_error(e, output);
        throw(error);
    }

    return output;
}

Jemplate.templateMap['widget_search_edit.html'] = function(context) {
    if (! context) throw('Jemplate function called without context\n');
    var stash = context.stash;
    var output = '';

    try {
output += '<span class="st-widget-dialog-title">';
//line 1 "widget_search_edit.html"
stash.set("search_st_widget_dialog_title", loc('Search Results'));
//line 1 "widget_search_edit.html"
output += stash.get('search_st_widget_dialog_title');
output += '</span>\n<form>\n<div class="st-widget-dialog">\n<p class="st-widget-description">';
//line 4 "widget_search_edit.html"
 stash.set("search_st_widget_description", loc('Display the search results for the given phrase within a workspace. Use this form to edit the properties for the search.')); 
//line 4 "widget_search_edit.html"
output += stash.get('search_st_widget_description');
output += '</p>\n<div id="st-widgets-standardoptionspanel">\n<table class="st-widgets-optionstable">\n<tr>';
//line 9 "widget_search_edit.html"
stash.set("search_st_widget_dialog_editlabel_field",loc('Search term:'));
output += '<td class="st-widget-dialog-editlabel">';
//line 10 "widget_search_edit.html"
output += stash.get('search_st_widget_dialog_editlabel_field');
output += '</td>\n  <td class="st-widget-dialog-editfield">\n    <input size="40" type="text" id="st-widget-search_term" name="search_term" value="';
//line 12 "widget_search_edit.html"

// FILTER
output += (function() {
    var output = '';

output += stash.get('search_term');

    return context.filter(output, 'html', []);
})();

output += '"/>\n  </td>\n</tr>\n</table>\n</div>\n<div id="search_widget_edit_error_msg" class="widget_edit_error_msg"></div>\n<div class="st-widgets-options">\n    <img id="st-widgets-optionsicon" src="/static/2.9.3.0/images/st/show_more.gif">\n    <a id="st-widgets-moreoptions" href="#">';
//line 20 "widget_search_edit.html"
 stash.set('search_st_widgets_moreoptions', loc('More options')); 
//line 20 "widget_search_edit.html"
output += stash.get('search_st_widgets_moreoptions');
output += '</a>\n</div>\n<div id="st-widgets-moreoptionspanel">\n<p class="st-widget-description">';
//line 23 "widget_search_edit.html"
stash.set("search_st_widgets_moreoptionspanel",loc('Optional properties include the name of the workspace to search, whether to search in the page title, text or tags, and whether to display full results or just page titles.'));
//line 23 "widget_search_edit.html"
output += stash.get('search_st_widgets_moreoptionspanel');
output += '</p>\n<table class="st-widgets-moreoptionstable">\n<tr>';
//line 27 "widget_search_edit.html"
stash.set("search_st_widget_dialog_editlabel_field_radio",loc('In:'));
output += '  <td class="st-widget-dialog-editlabel">';
//line 28 "widget_search_edit.html"
output += stash.get('search_st_widget_dialog_editlabel_field_radio');
output += '</td>\n  <td class="st-widget-dialog-editfield">\n    <p class="st-widget-dialog-defaultradio"><input type="radio" name="st-widget-workspace_id-rb" value="current" checked>';
//line 32 "widget_search_edit.html"
stash.set("search_st_widget_dialog_defaultradio_current",loc('the current workspace'));
//line 33 "widget_search_edit.html"
output += stash.get('search_st_widget_dialog_defaultradio_current');
//line 33 "widget_search_edit.html"
stash.set("search_st_widget_workspace_id_rb_or",loc('or'));
output += '<i>&nbsp;&nbsp;';
//line 34 "widget_search_edit.html"
output += stash.get('search_st_widget_workspace_id_rb_or');
output += '</i></p>\n<p class="st-widget-dialog-choiceradio">\n  <input type="radio" name="st-widget-workspace_id-rb" value="other">';
//line 38 "widget_search_edit.html"
stash.set("search_st_widget_workspace_id_rb",loc('the workspace named'));
//line 39 "widget_search_edit.html"
output += stash.get('search_st_widget_workspace_id_rb');
output += '&nbsp;\n<input size="25" type="text" id="st-widget-workspace_id" name="workspace_id" value="';
//line 41 "widget_search_edit.html"

// FILTER
output += (function() {
    var output = '';

output += stash.get('workspace_id');

    return context.filter(output, 'html', []);
})();

output += '"/>\n</p>\n</td>\n</tr>\n\n\n<tr>\n<td class="st-widget-dialog-editlabel">';
//line 50 "widget_search_edit.html"
stash.set("search_st_widget_dialog_editlabel_search_type",loc('Search type:'));
//line 50 "widget_search_edit.html"
output += stash.get('search_st_widget_dialog_editlabel_search_type');
output += '\n</td>\n<td class="st-widget-dialog-editfield">\n<input type="radio" name="search_type" value="text"\n';
//line 54 "widget_search_edit.html"
if (stash.get('search_type') == 'text' || stash.get('search_type') == '') {
output += 'checked="checked"';
}

output += '\n/> ';
//line 55 "widget_search_edit.html"
stash.set("search_st_widget_dialog_editfieled_search_type",loc('Text'));
//line 55 "widget_search_edit.html"
output += stash.get('search_st_widget_dialog_editfieled_search_type');
output += '\n<input type="radio" name="search_type" value="category"\n';
//line 57 "widget_search_edit.html"
if (stash.get('search_type') == 'category') {
output += 'checked="checked"';
}

output += '\n/>';
//line 58 "widget_search_edit.html"
stash.set("search_st_widget_dialog_editfieled_search_type",loc('Tag'));
//line 58 "widget_search_edit.html"
output += stash.get('search_st_widget_dialog_editfieled_search_type');
output += '\n<input type="radio" name="search_type" value="title"\n';
//line 60 "widget_search_edit.html"
if (stash.get('search_type') == 'title') {
output += 'checked="checked"';
}

output += '\n/>';
//line 61 "widget_search_edit.html"
stash.set("search_st_widget_dialog_editfieled_search_type",loc('Title'));
//line 61 "widget_search_edit.html"
output += stash.get('search_st_widget_dialog_editfieled_search_type');
output += '\n</td>\n</tr>\n\n\n\n<tr>\n<td class="st-widget-dialog-editlabel">';
//line 70 "widget_search_edit.html"
stash.set("search_st_widget_dialog_editlable_results",loc('Full results:'));
//line 70 "widget_search_edit.html"
output += stash.get('search_st_widget_dialog_editlable_results');
output += '\n</td>\n<td class="st-widget-dialog-editfield">\n<input type="checkbox" name="full"';
//line 73 "widget_search_edit.html"
if (stash.get('full')) {
output += ' checked="checked"';
}

output += ' />\n</td>\n</tr>\n\n</table>\n<div class="st-widgetdialog-wikitext">\n    <span class="label">';
//line 79 "widget_search_edit.html"
stash.set("search_st_widgetdialog_wikitext",loc('wiki text'));
//line 79 "widget_search_edit.html"
output += stash.get('search_st_widgetdialog_wikitext');
output += '\n</span>\n    <span class="wikitext" id="search_wafl_text">&nbsp;</span>\n</div>\n</div>\n</div>\n';
//line 85 "widget_search_edit.html"
output += context.process('save-cancel.html');
output += '\n</form>\n\n\n';
    }
    catch(e) {
        var error = context.set_error(e, output);
        throw(error);
    }

    return output;
}

Jemplate.templateMap['widget_section_edit.html'] = function(context) {
    if (! context) throw('Jemplate function called without context\n');
    var stash = context.stash;
    var output = '';

    try {
output += '<span class="st-widget-dialog-title">';
//line 1 "widget_section_edit.html"
stash.set("section_st_widget_dialog_title", loc('Section Marker'));
//line 1 "widget_section_edit.html"
output += stash.get('section_st_widget_dialog_title');
output += '</span>\n<form>\n<div class="st-widget-dialog">\n<p class="st-widget-description">';
//line 4 "widget_section_edit.html"
 stash.set("section_st_widget_description", loc('Add a section marker at the current cursor location. You can link to a section marker using a "Section Link". Use this form to edit the properties for the section marker.')); 
//line 4 "widget_section_edit.html"
output += stash.get('section_st_widget_description');
output += '</p>\n<div id="st-widgets-standardoptionspanel">\n<table class="st-widgets-optionstable">\n<tr>';
//line 9 "widget_section_edit.html"
stash.set("section_st_widget_dialog_editlabel_field",loc('Section name:'));
output += '<td class="st-widget-dialog-editlabel">';
//line 10 "widget_section_edit.html"
output += stash.get('section_st_widget_dialog_editlabel_field');
output += '</td>\n  <td class="st-widget-dialog-editfield">\n    <input size="40" type="text" id="st-widget-section_name" name="section_name" value="';
//line 12 "widget_section_edit.html"

// FILTER
output += (function() {
    var output = '';

output += stash.get('section_name');

    return context.filter(output, 'html', []);
})();

output += '"/>\n  </td>\n</tr>\n</table>\n</div>\n<div id="section_widget_edit_error_msg" class="widget_edit_error_msg"></div>\n<div class="st-widgets-options">\n    <img id="st-widgets-optionsicon" src="/static/2.9.3.0/images/st/show_more.gif">\n    <a id="st-widgets-moreoptions" href="#">';
//line 20 "widget_section_edit.html"
 stash.set('section_st_widgets_moreoptions', loc('More options')); 
//line 20 "widget_section_edit.html"
output += stash.get('section_st_widgets_moreoptions');
output += '</a>\n</div>\n<div id="st-widgets-moreoptionspanel">\n<p class="st-widget-description">';
//line 23 "widget_section_edit.html"
stash.set("section_st_widgets_moreoptionspanel",loc('There are no optional properties for a section marker.'));
//line 23 "widget_section_edit.html"
output += stash.get('section_st_widgets_moreoptionspanel');
output += '</p>\n<table class="st-widgets-moreoptionstable">\n\n\n\n\n</table>\n<div class="st-widgetdialog-wikitext">\n    <span class="label">';
//line 31 "widget_section_edit.html"
stash.set("section_st_widgetdialog_wikitext",loc('wiki text'));
//line 31 "widget_section_edit.html"
output += stash.get('section_st_widgetdialog_wikitext');
output += '\n</span>\n    <span class="wikitext" id="section_wafl_text">&nbsp;</span>\n</div>\n</div>\n</div>\n';
//line 37 "widget_section_edit.html"
output += context.process('save-cancel.html');
output += '\n</form>\n\n\n';
    }
    catch(e) {
        var error = context.set_error(e, output);
        throw(error);
    }

    return output;
}

Jemplate.templateMap['widget_skype_edit.html'] = function(context) {
    if (! context) throw('Jemplate function called without context\n');
    var stash = context.stash;
    var output = '';

    try {
output += '<span class="st-widget-dialog-title">';
//line 1 "widget_skype_edit.html"
stash.set("skype_st_widget_dialog_title", loc('Skype Link'));
//line 1 "widget_skype_edit.html"
output += stash.get('skype_st_widget_dialog_title');
output += '</span>\n<form>\n<div class="st-widget-dialog">\n<p class="st-widget-description">';
//line 4 "widget_skype_edit.html"
 stash.set("skype_st_widget_description", loc('Display a link to a Skype name. Clicking the link will start a Skype call with the person if your Skype client is properly configured. Use this form to edit the properties of the link.')); 
//line 4 "widget_skype_edit.html"
output += stash.get('skype_st_widget_description');
output += '</p>\n<div id="st-widgets-standardoptionspanel">\n<table class="st-widgets-optionstable">\n<tr>';
//line 9 "widget_skype_edit.html"
stash.set("skype_st_widget_dialog_editlabel_field",loc('Skype name:'));
output += '<td class="st-widget-dialog-editlabel">';
//line 10 "widget_skype_edit.html"
output += stash.get('skype_st_widget_dialog_editlabel_field');
output += '</td>\n  <td class="st-widget-dialog-editfield">\n    <input size="40" type="text" id="st-widget-skype_id" name="skype_id" value="';
//line 12 "widget_skype_edit.html"

// FILTER
output += (function() {
    var output = '';

output += stash.get('skype_id');

    return context.filter(output, 'html', []);
})();

output += '"/>\n  </td>\n</tr>\n</table>\n</div>\n<div id="skype_widget_edit_error_msg" class="widget_edit_error_msg"></div>\n<div class="st-widgets-options">\n    <img id="st-widgets-optionsicon" src="/static/2.9.3.0/images/st/show_more.gif">\n    <a id="st-widgets-moreoptions" href="#">';
//line 20 "widget_skype_edit.html"
 stash.set('skype_st_widgets_moreoptions', loc('More options')); 
//line 20 "widget_skype_edit.html"
output += stash.get('skype_st_widgets_moreoptions');
output += '</a>\n</div>\n<div id="st-widgets-moreoptionspanel">\n<p class="st-widget-description">';
//line 23 "widget_skype_edit.html"
stash.set("skype_st_widgets_moreoptionspanel",loc('There are no optional properties for a Skype link.'));
//line 23 "widget_skype_edit.html"
output += stash.get('skype_st_widgets_moreoptionspanel');
output += '</p>\n<table class="st-widgets-moreoptionstable">\n\n\n\n\n</table>\n<div class="st-widgetdialog-wikitext">\n    <span class="label">';
//line 31 "widget_skype_edit.html"
stash.set("skype_st_widgetdialog_wikitext",loc('wiki text'));
//line 31 "widget_skype_edit.html"
output += stash.get('skype_st_widgetdialog_wikitext');
output += '\n</span>\n    <span class="wikitext" id="skype_wafl_text">&nbsp;</span>\n</div>\n</div>\n</div>\n';
//line 37 "widget_skype_edit.html"
output += context.process('save-cancel.html');
output += '\n</form>\n\n\n';
    }
    catch(e) {
        var error = context.set_error(e, output);
        throw(error);
    }

    return output;
}

Jemplate.templateMap['widget_tag_edit.html'] = function(context) {
    if (! context) throw('Jemplate function called without context\n');
    var stash = context.stash;
    var output = '';

    try {
output += '<span class="st-widget-dialog-title">';
//line 1 "widget_tag_edit.html"
stash.set("tag_st_widget_dialog_title", loc('Tag Link'));
//line 1 "widget_tag_edit.html"
output += stash.get('tag_st_widget_dialog_title');
output += '</span>\n<form>\n<div class="st-widget-dialog">\n<p class="st-widget-description">';
//line 4 "widget_tag_edit.html"
 stash.set("tag_st_widget_description", loc('Display a link to a list of pages with a specific tag. Use this form to edit the properties of the link.')); 
//line 4 "widget_tag_edit.html"
output += stash.get('tag_st_widget_description');
output += '</p>\n<div id="st-widgets-standardoptionspanel">\n<table class="st-widgets-optionstable">\n<tr>';
//line 9 "widget_tag_edit.html"
stash.set("tag_st_widget_dialog_editlabel_field",loc('Tag name:'));
output += '<td class="st-widget-dialog-editlabel">';
//line 10 "widget_tag_edit.html"
output += stash.get('tag_st_widget_dialog_editlabel_field');
output += '</td>\n  <td class="st-widget-dialog-editfield">\n    <input size="40" type="text" id="st-widget-tag_name" name="tag_name" value="';
//line 12 "widget_tag_edit.html"

// FILTER
output += (function() {
    var output = '';

output += stash.get('tag_name');

    return context.filter(output, 'html', []);
})();

output += '"/>\n  </td>\n</tr>\n</table>\n</div>\n<div id="tag_widget_edit_error_msg" class="widget_edit_error_msg"></div>\n<div class="st-widgets-options">\n    <img id="st-widgets-optionsicon" src="/static/2.9.3.0/images/st/show_more.gif">\n    <a id="st-widgets-moreoptions" href="#">';
//line 20 "widget_tag_edit.html"
 stash.set('tag_st_widgets_moreoptions', loc('More options')); 
//line 20 "widget_tag_edit.html"
output += stash.get('tag_st_widgets_moreoptions');
output += '</a>\n</div>\n<div id="st-widgets-moreoptionspanel">\n<p class="st-widget-description">';
//line 23 "widget_tag_edit.html"
stash.set("tag_st_widgets_moreoptionspanel",loc('Optional properties include link text, and the name of a different workspace for the tags.'));
//line 23 "widget_tag_edit.html"
output += stash.get('tag_st_widgets_moreoptionspanel');
output += '</p>\n<table class="st-widgets-moreoptionstable">\n<tr>';
//line 27 "widget_tag_edit.html"
stash.set("tag_st_widget_dialog_editlabel_field",loc('Link text:'));
output += '<td class="st-widget-dialog-editlabel">';
//line 28 "widget_tag_edit.html"
output += stash.get('tag_st_widget_dialog_editlabel_field');
output += '</td>\n  <td class="st-widget-dialog-editfield">\n    <input size="40" type="text" id="st-widget-label" name="label" value="';
//line 30 "widget_tag_edit.html"

// FILTER
output += (function() {
    var output = '';

output += stash.get('label');

    return context.filter(output, 'html', []);
})();

output += '"/>\n  </td>\n</tr>\n<tr>';
//line 35 "widget_tag_edit.html"
stash.set("tag_st_widget_dialog_editlabel_field_radio",loc('Search:'));
output += '  <td class="st-widget-dialog-editlabel">';
//line 36 "widget_tag_edit.html"
output += stash.get('tag_st_widget_dialog_editlabel_field_radio');
output += '</td>\n  <td class="st-widget-dialog-editfield">\n    <p class="st-widget-dialog-defaultradio"><input type="radio" name="st-widget-workspace_id-rb" value="current" checked>';
//line 40 "widget_tag_edit.html"
stash.set("tag_st_widget_dialog_defaultradio_current",loc('the current workspace'));
//line 41 "widget_tag_edit.html"
output += stash.get('tag_st_widget_dialog_defaultradio_current');
//line 41 "widget_tag_edit.html"
stash.set("tag_st_widget_workspace_id_rb_or",loc('or'));
output += '<i>&nbsp;&nbsp;';
//line 42 "widget_tag_edit.html"
output += stash.get('tag_st_widget_workspace_id_rb_or');
output += '</i></p>\n<p class="st-widget-dialog-choiceradio">\n  <input type="radio" name="st-widget-workspace_id-rb" value="other">';
//line 46 "widget_tag_edit.html"
stash.set("tag_st_widget_workspace_id_rb",loc('the workspace named'));
//line 47 "widget_tag_edit.html"
output += stash.get('tag_st_widget_workspace_id_rb');
output += '&nbsp;\n<input size="25" type="text" id="st-widget-workspace_id" name="workspace_id" value="';
//line 49 "widget_tag_edit.html"

// FILTER
output += (function() {
    var output = '';

output += stash.get('workspace_id');

    return context.filter(output, 'html', []);
})();

output += '"/>\n</p>\n</td>\n</tr>\n\n\n\n\n</table>\n<div class="st-widgetdialog-wikitext">\n    <span class="label">';
//line 59 "widget_tag_edit.html"
stash.set("tag_st_widgetdialog_wikitext",loc('wiki text'));
//line 59 "widget_tag_edit.html"
output += stash.get('tag_st_widgetdialog_wikitext');
output += '\n</span>\n    <span class="wikitext" id="tag_wafl_text">&nbsp;</span>\n</div>\n</div>\n</div>\n';
//line 65 "widget_tag_edit.html"
output += context.process('save-cancel.html');
output += '\n</form>\n\n\n';
    }
    catch(e) {
        var error = context.set_error(e, output);
        throw(error);
    }

    return output;
}

Jemplate.templateMap['widget_tag_list_edit.html'] = function(context) {
    if (! context) throw('Jemplate function called without context\n');
    var stash = context.stash;
    var output = '';

    try {
output += '<span class="st-widget-dialog-title">';
//line 1 "widget_tag_list_edit.html"
stash.set("tag_list_st_widget_dialog_title", loc('Tag List'));
//line 1 "widget_tag_list_edit.html"
output += stash.get('tag_list_st_widget_dialog_title');
output += '</span>\n<form>\n<div class="st-widget-dialog">\n<p class="st-widget-description">';
//line 4 "widget_tag_list_edit.html"
 stash.set("tag_list_st_widget_description", loc('Display a list of the most recently changed pages in a workspace that have a specific tag. By default only the page title is displayed. Use this form to edit the list properties.')); 
//line 4 "widget_tag_list_edit.html"
output += stash.get('tag_list_st_widget_description');
output += '</p>\n<div id="st-widgets-standardoptionspanel">\n<table class="st-widgets-optionstable">\n<tr>';
//line 9 "widget_tag_list_edit.html"
stash.set("tag_list_st_widget_dialog_editlabel_field",loc('Tag name:'));
output += '<td class="st-widget-dialog-editlabel">';
//line 10 "widget_tag_list_edit.html"
output += stash.get('tag_list_st_widget_dialog_editlabel_field');
output += '</td>\n  <td class="st-widget-dialog-editfield">\n    <input size="40" type="text" id="st-widget-tag_name" name="tag_name" value="';
//line 12 "widget_tag_list_edit.html"

// FILTER
output += (function() {
    var output = '';

output += stash.get('tag_name');

    return context.filter(output, 'html', []);
})();

output += '"/>\n  </td>\n</tr>\n</table>\n</div>\n<div id="tag_list_widget_edit_error_msg" class="widget_edit_error_msg"></div>\n<div class="st-widgets-options">\n    <img id="st-widgets-optionsicon" src="/static/2.9.3.0/images/st/show_more.gif">\n    <a id="st-widgets-moreoptions" href="#">';
//line 20 "widget_tag_list_edit.html"
 stash.set('tag_list_st_widgets_moreoptions', loc('More options')); 
//line 20 "widget_tag_list_edit.html"
output += stash.get('tag_list_st_widgets_moreoptions');
output += '</a>\n</div>\n<div id="st-widgets-moreoptionspanel">\n<p class="st-widget-description">';
//line 23 "widget_tag_list_edit.html"
stash.set("tag_list_st_widgets_moreoptionspanel",loc('Optional properties include specifying which workspace to use and whether to display page titles or whole pages.'));
//line 23 "widget_tag_list_edit.html"
output += stash.get('tag_list_st_widgets_moreoptionspanel');
output += '</p>\n<table class="st-widgets-moreoptionstable">\n<tr>';
//line 27 "widget_tag_list_edit.html"
stash.set("tag_list_st_widget_dialog_editlabel_field_radio",loc('Pages in:'));
output += '  <td class="st-widget-dialog-editlabel">';
//line 28 "widget_tag_list_edit.html"
output += stash.get('tag_list_st_widget_dialog_editlabel_field_radio');
output += '</td>\n  <td class="st-widget-dialog-editfield">\n    <p class="st-widget-dialog-defaultradio"><input type="radio" name="st-widget-workspace_id-rb" value="current" checked>';
//line 32 "widget_tag_list_edit.html"
stash.set("tag_list_st_widget_dialog_defaultradio_current",loc('the current workspace'));
//line 33 "widget_tag_list_edit.html"
output += stash.get('tag_list_st_widget_dialog_defaultradio_current');
//line 33 "widget_tag_list_edit.html"
stash.set("tag_list_st_widget_workspace_id_rb_or",loc('or'));
output += '<i>&nbsp;&nbsp;';
//line 34 "widget_tag_list_edit.html"
output += stash.get('tag_list_st_widget_workspace_id_rb_or');
output += '</i></p>\n<p class="st-widget-dialog-choiceradio">\n  <input type="radio" name="st-widget-workspace_id-rb" value="other">';
//line 38 "widget_tag_list_edit.html"
stash.set("tag_list_st_widget_workspace_id_rb",loc('the workspace named'));
//line 39 "widget_tag_list_edit.html"
output += stash.get('tag_list_st_widget_workspace_id_rb');
output += '&nbsp;\n<input size="25" type="text" id="st-widget-workspace_id" name="workspace_id" value="';
//line 41 "widget_tag_list_edit.html"

// FILTER
output += (function() {
    var output = '';

output += stash.get('workspace_id');

    return context.filter(output, 'html', []);
})();

output += '"/>\n</p>\n</td>\n</tr>\n\n\n\n\n<tr>\n<td class="st-widget-dialog-editlabel">';
//line 52 "widget_tag_list_edit.html"
stash.set("tag_list_st_widget_dialog_editlable_results",loc('Full results:'));
//line 52 "widget_tag_list_edit.html"
output += stash.get('tag_list_st_widget_dialog_editlable_results');
output += '\n</td>\n<td class="st-widget-dialog-editfield">\n<input type="checkbox" name="full"';
//line 55 "widget_tag_list_edit.html"
if (stash.get('full')) {
output += ' checked="checked"';
}

output += ' />\n</td>\n</tr>\n\n</table>\n<div class="st-widgetdialog-wikitext">\n    <span class="label">';
//line 61 "widget_tag_list_edit.html"
stash.set("tag_list_st_widgetdialog_wikitext",loc('wiki text'));
//line 61 "widget_tag_list_edit.html"
output += stash.get('tag_list_st_widgetdialog_wikitext');
output += '\n</span>\n    <span class="wikitext" id="tag_list_wafl_text">&nbsp;</span>\n</div>\n</div>\n</div>\n';
//line 67 "widget_tag_list_edit.html"
output += context.process('save-cancel.html');
output += '\n</form>\n\n\n';
    }
    catch(e) {
        var error = context.set_error(e, output);
        throw(error);
    }

    return output;
}

Jemplate.templateMap['widget_technorati_edit.html'] = function(context) {
    if (! context) throw('Jemplate function called without context\n');
    var stash = context.stash;
    var output = '';

    try {
output += '<span class="st-widget-dialog-title">';
//line 1 "widget_technorati_edit.html"
stash.set("technorati_st_widget_dialog_title", loc('Technorati Search'));
//line 1 "widget_technorati_edit.html"
output += stash.get('technorati_st_widget_dialog_title');
output += '</span>\n<form>\n<div class="st-widget-dialog">\n<p class="st-widget-description">';
//line 4 "widget_technorati_edit.html"
 stash.set("technorati_st_widget_description", loc('Display the results for a Technorati search. Use this form to edit the properties for the search.')); 
//line 4 "widget_technorati_edit.html"
output += stash.get('technorati_st_widget_description');
output += '</p>\n<div id="st-widgets-standardoptionspanel">\n<table class="st-widgets-optionstable">\n<tr>';
//line 9 "widget_technorati_edit.html"
stash.set("technorati_st_widget_dialog_editlabel_field",loc('Search for:'));
output += '<td class="st-widget-dialog-editlabel">';
//line 10 "widget_technorati_edit.html"
output += stash.get('technorati_st_widget_dialog_editlabel_field');
output += '</td>\n  <td class="st-widget-dialog-editfield">\n    <input size="40" type="text" id="st-widget-search_term" name="search_term" value="';
//line 12 "widget_technorati_edit.html"

// FILTER
output += (function() {
    var output = '';

output += stash.get('search_term');

    return context.filter(output, 'html', []);
})();

output += '"/>\n  </td>\n</tr>\n</table>\n</div>\n<div id="technorati_widget_edit_error_msg" class="widget_edit_error_msg"></div>\n<div class="st-widgets-options">\n    <img id="st-widgets-optionsicon" src="/static/2.9.3.0/images/st/show_more.gif">\n    <a id="st-widgets-moreoptions" href="#">';
//line 20 "widget_technorati_edit.html"
 stash.set('technorati_st_widgets_moreoptions', loc('More options')); 
//line 20 "widget_technorati_edit.html"
output += stash.get('technorati_st_widgets_moreoptions');
output += '</a>\n</div>\n<div id="st-widgets-moreoptionspanel">\n<p class="st-widget-description">';
//line 23 "widget_technorati_edit.html"
stash.set("technorati_st_widgets_moreoptionspanel",loc('There are no optional properties for a Technorati search.'));
//line 23 "widget_technorati_edit.html"
output += stash.get('technorati_st_widgets_moreoptionspanel');
output += '</p>\n<table class="st-widgets-moreoptionstable">\n\n\n\n\n</table>\n<div class="st-widgetdialog-wikitext">\n    <span class="label">';
//line 31 "widget_technorati_edit.html"
stash.set("technorati_st_widgetdialog_wikitext",loc('wiki text'));
//line 31 "widget_technorati_edit.html"
output += stash.get('technorati_st_widgetdialog_wikitext');
output += '\n</span>\n    <span class="wikitext" id="technorati_wafl_text">&nbsp;</span>\n</div>\n</div>\n</div>\n';
//line 37 "widget_technorati_edit.html"
output += context.process('save-cancel.html');
output += '\n</form>\n\n\n';
    }
    catch(e) {
        var error = context.set_error(e, output);
        throw(error);
    }

    return output;
}

Jemplate.templateMap['widget_toc_edit.html'] = function(context) {
    if (! context) throw('Jemplate function called without context\n');
    var stash = context.stash;
    var output = '';

    try {
output += '<span class="st-widget-dialog-title">';
//line 1 "widget_toc_edit.html"
stash.set("toc_st_widget_dialog_title", loc('Table of Contents'));
//line 1 "widget_toc_edit.html"
output += stash.get('toc_st_widget_dialog_title');
output += '</span>\n<form>\n<div class="st-widget-dialog">\n<p class="st-widget-description">';
//line 4 "widget_toc_edit.html"
 stash.set("toc_st_widget_description", loc('Display a table of contents for a page. Each header or section on the page is listed as a link in the table of contents. Click "Save" now, or click "More options" to edit the properties for the table of contents.')); 
//line 4 "widget_toc_edit.html"
output += stash.get('toc_st_widget_description');
output += '</p>\n<div id="st-widgets-standardoptionspanel">\n<table class="st-widgets-optionstable">\n</table>\n</div>\n<div id="toc_widget_edit_error_msg" class="widget_edit_error_msg"></div>\n<div class="st-widgets-options">\n    <img id="st-widgets-optionsicon" src="/static/2.9.3.0/images/st/show_more.gif">\n    <a id="st-widgets-moreoptions" href="#">';
//line 12 "widget_toc_edit.html"
 stash.set('toc_st_widgets_moreoptions', loc('More options')); 
//line 12 "widget_toc_edit.html"
output += stash.get('toc_st_widgets_moreoptions');
output += '</a>\n</div>\n<div id="st-widgets-moreoptionspanel">\n<p class="st-widget-description">';
//line 15 "widget_toc_edit.html"
stash.set("toc_st_widgets_moreoptionspanel",loc('Optionally, specify which page\'s headers and sections to use for the table of contents.'));
//line 15 "widget_toc_edit.html"
output += stash.get('toc_st_widgets_moreoptionspanel');
output += '</p>\n<table class="st-widgets-moreoptionstable">\n<tr>';
//line 19 "widget_toc_edit.html"
stash.set("toc_st_widget_dialog_editlabel_field_radio",loc('Page in:'));
output += '  <td class="st-widget-dialog-editlabel">';
//line 20 "widget_toc_edit.html"
output += stash.get('toc_st_widget_dialog_editlabel_field_radio');
output += '</td>\n  <td class="st-widget-dialog-editfield">\n    <p class="st-widget-dialog-defaultradio"><input type="radio" name="st-widget-workspace_id-rb" value="current" checked>';
//line 24 "widget_toc_edit.html"
stash.set("toc_st_widget_dialog_defaultradio_current",loc('the current workspace'));
//line 25 "widget_toc_edit.html"
output += stash.get('toc_st_widget_dialog_defaultradio_current');
//line 25 "widget_toc_edit.html"
stash.set("toc_st_widget_workspace_id_rb_or",loc('or'));
output += '<i>&nbsp;&nbsp;';
//line 26 "widget_toc_edit.html"
output += stash.get('toc_st_widget_workspace_id_rb_or');
output += '</i></p>\n<p class="st-widget-dialog-choiceradio">\n  <input type="radio" name="st-widget-workspace_id-rb" value="other">';
//line 30 "widget_toc_edit.html"
stash.set("toc_st_widget_workspace_id_rb",loc('the workspace named'));
//line 31 "widget_toc_edit.html"
output += stash.get('toc_st_widget_workspace_id_rb');
output += '&nbsp;\n<input size="25" type="text" id="st-widget-workspace_id" name="workspace_id" value="';
//line 33 "widget_toc_edit.html"

// FILTER
output += (function() {
    var output = '';

output += stash.get('workspace_id');

    return context.filter(output, 'html', []);
})();

output += '"/>\n</p>\n</td>\n</tr>\n<tr>';
//line 39 "widget_toc_edit.html"
stash.set("toc_st_widget_dialog_editlabel_field_radio",loc('Headers and<br/>sections in:'));
output += '  <td class="st-widget-dialog-editlabel">';
//line 40 "widget_toc_edit.html"
output += stash.get('toc_st_widget_dialog_editlabel_field_radio');
output += '</td>\n  <td class="st-widget-dialog-editfield">\n    <p class="st-widget-dialog-defaultradio"><input type="radio" name="st-widget-page_title-rb" value="current" checked>';
//line 44 "widget_toc_edit.html"
stash.set("toc_st_widget_dialog_defaultradio_current",loc('the current page'));
//line 45 "widget_toc_edit.html"
output += stash.get('toc_st_widget_dialog_defaultradio_current');
//line 45 "widget_toc_edit.html"
stash.set("toc_st_widget_page_title_rb_or",loc('or'));
output += '<i>&nbsp;&nbsp;';
//line 46 "widget_toc_edit.html"
output += stash.get('toc_st_widget_page_title_rb_or');
output += '</i></p>\n<p class="st-widget-dialog-choiceradio">\n  <input type="radio" name="st-widget-page_title-rb" value="other">';
//line 50 "widget_toc_edit.html"
stash.set("toc_st_widget_page_title_rb",loc('the page titled'));
//line 51 "widget_toc_edit.html"
output += stash.get('toc_st_widget_page_title_rb');
output += '&nbsp;\n<input size="25" type="text" id="st-widget-page_title" name="page_title" value="';
//line 53 "widget_toc_edit.html"

// FILTER
output += (function() {
    var output = '';

output += stash.get('page_title');

    return context.filter(output, 'html', []);
})();

output += '"/>\n</p>\n</td>\n</tr>\n\n\n\n\n</table>\n<div class="st-widgetdialog-wikitext">\n    <span class="label">';
//line 63 "widget_toc_edit.html"
stash.set("toc_st_widgetdialog_wikitext",loc('wiki text'));
//line 63 "widget_toc_edit.html"
output += stash.get('toc_st_widgetdialog_wikitext');
output += '\n</span>\n    <span class="wikitext" id="toc_wafl_text">&nbsp;</span>\n</div>\n</div>\n</div>\n';
//line 69 "widget_toc_edit.html"
output += context.process('save-cancel.html');
output += '\n</form>\n\n\n';
    }
    catch(e) {
        var error = context.set_error(e, output);
        throw(error);
    }

    return output;
}

Jemplate.templateMap['widget_user_edit.html'] = function(context) {
    if (! context) throw('Jemplate function called without context\n');
    var stash = context.stash;
    var output = '';

    try {
output += '<span class="st-widget-dialog-title">';
//line 1 "widget_user_edit.html"
stash.set("user_st_widget_dialog_title", loc('User Name'));
//line 1 "widget_user_edit.html"
output += stash.get('user_st_widget_dialog_title');
output += '</span>\n<form>\n<div class="st-widget-dialog">\n<p class="st-widget-description">';
//line 4 "widget_user_edit.html"
 stash.set("user_st_widget_description", loc('Display the full name for the given email address or user name. Use this form to edit the properties of the user name.')); 
//line 4 "widget_user_edit.html"
output += stash.get('user_st_widget_description');
output += '</p>\n<div id="st-widgets-standardoptionspanel">\n<table class="st-widgets-optionstable">\n<tr>';
//line 9 "widget_user_edit.html"
stash.set("user_st_widget_dialog_editlabel_field",loc('User\'s email:'));
output += '<td class="st-widget-dialog-editlabel">';
//line 10 "widget_user_edit.html"
output += stash.get('user_st_widget_dialog_editlabel_field');
output += '</td>\n  <td class="st-widget-dialog-editfield">\n    <input size="40" type="text" id="st-widget-user_email" name="user_email" value="';
//line 12 "widget_user_edit.html"

// FILTER
output += (function() {
    var output = '';

output += stash.get('user_email');

    return context.filter(output, 'html', []);
})();

output += '"/>\n  </td>\n</tr>\n</table>\n</div>\n<div id="user_widget_edit_error_msg" class="widget_edit_error_msg"></div>\n<div class="st-widgets-options">\n    <img id="st-widgets-optionsicon" src="/static/2.9.3.0/images/st/show_more.gif">\n    <a id="st-widgets-moreoptions" href="#">';
//line 20 "widget_user_edit.html"
 stash.set('user_st_widgets_moreoptions', loc('More options')); 
//line 20 "widget_user_edit.html"
output += stash.get('user_st_widgets_moreoptions');
output += '</a>\n</div>\n<div id="st-widgets-moreoptionspanel">\n<p class="st-widget-description">';
//line 23 "widget_user_edit.html"
stash.set("user_st_widgets_moreoptionspanel",loc('There are no optional properties for a user name.'));
//line 23 "widget_user_edit.html"
output += stash.get('user_st_widgets_moreoptionspanel');
output += '</p>\n<table class="st-widgets-moreoptionstable">\n\n\n\n\n</table>\n<div class="st-widgetdialog-wikitext">\n    <span class="label">';
//line 31 "widget_user_edit.html"
stash.set("user_st_widgetdialog_wikitext",loc('wiki text'));
//line 31 "widget_user_edit.html"
output += stash.get('user_st_widgetdialog_wikitext');
output += '\n</span>\n    <span class="wikitext" id="user_wafl_text">&nbsp;</span>\n</div>\n</div>\n</div>\n';
//line 37 "widget_user_edit.html"
output += context.process('save-cancel.html');
output += '\n</form>\n\n\n';
    }
    catch(e) {
        var error = context.set_error(e, output);
        throw(error);
    }

    return output;
}

Jemplate.templateMap['widget_weblog_edit.html'] = function(context) {
    if (! context) throw('Jemplate function called without context\n');
    var stash = context.stash;
    var output = '';

    try {
output += '<span class="st-widget-dialog-title">';
//line 1 "widget_weblog_edit.html"
stash.set("weblog_st_widget_dialog_title", loc('Weblog Link'));
//line 1 "widget_weblog_edit.html"
output += stash.get('weblog_st_widget_dialog_title');
output += '</span>\n<form>\n<div class="st-widget-dialog">\n<p class="st-widget-description">';
//line 4 "widget_weblog_edit.html"
 stash.set("weblog_st_widget_description", loc('Display a link to a weblog. Use this form to edit the properties of the link.')); 
//line 4 "widget_weblog_edit.html"
output += stash.get('weblog_st_widget_description');
output += '</p>\n<div id="st-widgets-standardoptionspanel">\n<table class="st-widgets-optionstable">\n<tr>';
//line 9 "widget_weblog_edit.html"
stash.set("weblog_st_widget_dialog_editlabel_field",loc('Weblog name:'));
output += '<td class="st-widget-dialog-editlabel">';
//line 10 "widget_weblog_edit.html"
output += stash.get('weblog_st_widget_dialog_editlabel_field');
output += '</td>\n  <td class="st-widget-dialog-editfield">\n    <input size="40" type="text" id="st-widget-weblog_name" name="weblog_name" value="';
//line 12 "widget_weblog_edit.html"

// FILTER
output += (function() {
    var output = '';

output += stash.get('weblog_name');

    return context.filter(output, 'html', []);
})();

output += '"/>\n  </td>\n</tr>\n</table>\n</div>\n<div id="weblog_widget_edit_error_msg" class="widget_edit_error_msg"></div>\n<div class="st-widgets-options">\n    <img id="st-widgets-optionsicon" src="/static/2.9.3.0/images/st/show_more.gif">\n    <a id="st-widgets-moreoptions" href="#">';
//line 20 "widget_weblog_edit.html"
 stash.set('weblog_st_widgets_moreoptions', loc('More options')); 
//line 20 "widget_weblog_edit.html"
output += stash.get('weblog_st_widgets_moreoptions');
output += '</a>\n</div>\n<div id="st-widgets-moreoptionspanel">\n<p class="st-widget-description">';
//line 23 "widget_weblog_edit.html"
stash.set("weblog_st_widgets_moreoptionspanel",loc('Optional properties include link text, and the name of a different workspace for the weblog.'));
//line 23 "widget_weblog_edit.html"
output += stash.get('weblog_st_widgets_moreoptionspanel');
output += '</p>\n<table class="st-widgets-moreoptionstable">\n<tr>';
//line 27 "widget_weblog_edit.html"
stash.set("weblog_st_widget_dialog_editlabel_field",loc('Link text:'));
output += '<td class="st-widget-dialog-editlabel">';
//line 28 "widget_weblog_edit.html"
output += stash.get('weblog_st_widget_dialog_editlabel_field');
output += '</td>\n  <td class="st-widget-dialog-editfield">\n    <input size="40" type="text" id="st-widget-label" name="label" value="';
//line 30 "widget_weblog_edit.html"

// FILTER
output += (function() {
    var output = '';

output += stash.get('label');

    return context.filter(output, 'html', []);
})();

output += '"/>\n  </td>\n</tr>\n<tr>';
//line 35 "widget_weblog_edit.html"
stash.set("weblog_st_widget_dialog_editlabel_field_radio",loc('Weblog on:'));
output += '  <td class="st-widget-dialog-editlabel">';
//line 36 "widget_weblog_edit.html"
output += stash.get('weblog_st_widget_dialog_editlabel_field_radio');
output += '</td>\n  <td class="st-widget-dialog-editfield">\n    <p class="st-widget-dialog-defaultradio"><input type="radio" name="st-widget-workspace_id-rb" value="current" checked>';
//line 40 "widget_weblog_edit.html"
stash.set("weblog_st_widget_dialog_defaultradio_current",loc('the current workspace'));
//line 41 "widget_weblog_edit.html"
output += stash.get('weblog_st_widget_dialog_defaultradio_current');
//line 41 "widget_weblog_edit.html"
stash.set("weblog_st_widget_workspace_id_rb_or",loc('or'));
output += '<i>&nbsp;&nbsp;';
//line 42 "widget_weblog_edit.html"
output += stash.get('weblog_st_widget_workspace_id_rb_or');
output += '</i></p>\n<p class="st-widget-dialog-choiceradio">\n  <input type="radio" name="st-widget-workspace_id-rb" value="other">';
//line 46 "widget_weblog_edit.html"
stash.set("weblog_st_widget_workspace_id_rb",loc('the workspace named'));
//line 47 "widget_weblog_edit.html"
output += stash.get('weblog_st_widget_workspace_id_rb');
output += '&nbsp;\n<input size="25" type="text" id="st-widget-workspace_id" name="workspace_id" value="';
//line 49 "widget_weblog_edit.html"

// FILTER
output += (function() {
    var output = '';

output += stash.get('workspace_id');

    return context.filter(output, 'html', []);
})();

output += '"/>\n</p>\n</td>\n</tr>\n\n\n\n\n</table>\n<div class="st-widgetdialog-wikitext">\n    <span class="label">';
//line 59 "widget_weblog_edit.html"
stash.set("weblog_st_widgetdialog_wikitext",loc('wiki text'));
//line 59 "widget_weblog_edit.html"
output += stash.get('weblog_st_widgetdialog_wikitext');
output += '\n</span>\n    <span class="wikitext" id="weblog_wafl_text">&nbsp;</span>\n</div>\n</div>\n</div>\n';
//line 65 "widget_weblog_edit.html"
output += context.process('save-cancel.html');
output += '\n</form>\n\n\n';
    }
    catch(e) {
        var error = context.set_error(e, output);
        throw(error);
    }

    return output;
}

Jemplate.templateMap['widget_weblog_list_edit.html'] = function(context) {
    if (! context) throw('Jemplate function called without context\n');
    var stash = context.stash;
    var output = '';

    try {
output += '<span class="st-widget-dialog-title">';
//line 1 "widget_weblog_list_edit.html"
stash.set("weblog_list_st_widget_dialog_title", loc('Weblog List'));
//line 1 "widget_weblog_list_edit.html"
output += stash.get('weblog_list_st_widget_dialog_title');
output += '</span>\n<form>\n<div class="st-widget-dialog">\n<p class="st-widget-description">';
//line 4 "widget_weblog_list_edit.html"
 stash.set("weblog_list_st_widget_description", loc('Display a list of the most recent entries from a weblog in a workspace. By default only the weblog entry names are displayed. Use this form to edit the list properties.')); 
//line 4 "widget_weblog_list_edit.html"
output += stash.get('weblog_list_st_widget_description');
output += '</p>\n<div id="st-widgets-standardoptionspanel">\n<table class="st-widgets-optionstable">\n<tr>';
//line 9 "widget_weblog_list_edit.html"
stash.set("weblog_list_st_widget_dialog_editlabel_field",loc('Weblog name:'));
output += '<td class="st-widget-dialog-editlabel">';
//line 10 "widget_weblog_list_edit.html"
output += stash.get('weblog_list_st_widget_dialog_editlabel_field');
output += '</td>\n  <td class="st-widget-dialog-editfield">\n    <input size="40" type="text" id="st-widget-weblog_name" name="weblog_name" value="';
//line 12 "widget_weblog_list_edit.html"

// FILTER
output += (function() {
    var output = '';

output += stash.get('weblog_name');

    return context.filter(output, 'html', []);
})();

output += '"/>\n  </td>\n</tr>\n</table>\n</div>\n<div id="weblog_list_widget_edit_error_msg" class="widget_edit_error_msg"></div>\n<div class="st-widgets-options">\n    <img id="st-widgets-optionsicon" src="/static/2.9.3.0/images/st/show_more.gif">\n    <a id="st-widgets-moreoptions" href="#">';
//line 20 "widget_weblog_list_edit.html"
 stash.set('weblog_list_st_widgets_moreoptions', loc('More options')); 
//line 20 "widget_weblog_list_edit.html"
output += stash.get('weblog_list_st_widgets_moreoptions');
output += '</a>\n</div>\n<div id="st-widgets-moreoptionspanel">\n<p class="st-widget-description">';
//line 23 "widget_weblog_list_edit.html"
stash.set("weblog_list_st_widgets_moreoptionspanel",loc('Optional parameters include specifying which workspace to use and whether to display page titles or whole pages.'));
//line 23 "widget_weblog_list_edit.html"
output += stash.get('weblog_list_st_widgets_moreoptionspanel');
output += '</p>\n<table class="st-widgets-moreoptionstable">\n<tr>';
//line 27 "widget_weblog_list_edit.html"
stash.set("weblog_list_st_widget_dialog_editlabel_field_radio",loc('in:'));
output += '  <td class="st-widget-dialog-editlabel">';
//line 28 "widget_weblog_list_edit.html"
output += stash.get('weblog_list_st_widget_dialog_editlabel_field_radio');
output += '</td>\n  <td class="st-widget-dialog-editfield">\n    <p class="st-widget-dialog-defaultradio"><input type="radio" name="st-widget-workspace_id-rb" value="current" checked>';
//line 32 "widget_weblog_list_edit.html"
stash.set("weblog_list_st_widget_dialog_defaultradio_current",loc('the current workspace'));
//line 33 "widget_weblog_list_edit.html"
output += stash.get('weblog_list_st_widget_dialog_defaultradio_current');
//line 33 "widget_weblog_list_edit.html"
stash.set("weblog_list_st_widget_workspace_id_rb_or",loc('or'));
output += '<i>&nbsp;&nbsp;';
//line 34 "widget_weblog_list_edit.html"
output += stash.get('weblog_list_st_widget_workspace_id_rb_or');
output += '</i></p>\n<p class="st-widget-dialog-choiceradio">\n  <input type="radio" name="st-widget-workspace_id-rb" value="other">';
//line 38 "widget_weblog_list_edit.html"
stash.set("weblog_list_st_widget_workspace_id_rb",loc('the workspace named'));
//line 39 "widget_weblog_list_edit.html"
output += stash.get('weblog_list_st_widget_workspace_id_rb');
output += '&nbsp;\n<input size="25" type="text" id="st-widget-workspace_id" name="workspace_id" value="';
//line 41 "widget_weblog_list_edit.html"

// FILTER
output += (function() {
    var output = '';

output += stash.get('workspace_id');

    return context.filter(output, 'html', []);
})();

output += '"/>\n</p>\n</td>\n</tr>\n\n\n\n\n<tr>\n<td class="st-widget-dialog-editlabel">';
//line 52 "widget_weblog_list_edit.html"
stash.set("weblog_list_st_widget_dialog_editlable_results",loc('Full results:'));
//line 52 "widget_weblog_list_edit.html"
output += stash.get('weblog_list_st_widget_dialog_editlable_results');
output += '\n</td>\n<td class="st-widget-dialog-editfield">\n<input type="checkbox" name="full"';
//line 55 "widget_weblog_list_edit.html"
if (stash.get('full')) {
output += ' checked="checked"';
}

output += ' />\n</td>\n</tr>\n\n</table>\n<div class="st-widgetdialog-wikitext">\n    <span class="label">';
//line 61 "widget_weblog_list_edit.html"
stash.set("weblog_list_st_widgetdialog_wikitext",loc('wiki text'));
//line 61 "widget_weblog_list_edit.html"
output += stash.get('weblog_list_st_widgetdialog_wikitext');
output += '\n</span>\n    <span class="wikitext" id="weblog_list_wafl_text">&nbsp;</span>\n</div>\n</div>\n</div>\n';
//line 67 "widget_weblog_list_edit.html"
output += context.process('save-cancel.html');
output += '\n</form>\n\n\n';
    }
    catch(e) {
        var error = context.set_error(e, output);
        throw(error);
    }

    return output;
}

Jemplate.templateMap['widget_yahoo_edit.html'] = function(context) {
    if (! context) throw('Jemplate function called without context\n');
    var stash = context.stash;
    var output = '';

    try {
output += '<span class="st-widget-dialog-title">';
//line 1 "widget_yahoo_edit.html"
stash.set("yahoo_st_widget_dialog_title", loc('Yahoo! IM Link'));
//line 1 "widget_yahoo_edit.html"
output += stash.get('yahoo_st_widget_dialog_title');
output += '</span>\n<form>\n<div class="st-widget-dialog">\n<p class="st-widget-description">';
//line 4 "widget_yahoo_edit.html"
 stash.set("yahoo_st_widget_description", loc('Display a link to a Yahoo! instant message ID. The icon will show whether the person is online. Clicking the link will start an IM conversation with the person if your IM client is properly configured. Use this form to edit the properties of the link.')); 
//line 4 "widget_yahoo_edit.html"
output += stash.get('yahoo_st_widget_description');
output += '</p>\n<div id="st-widgets-standardoptionspanel">\n<table class="st-widgets-optionstable">\n<tr>';
//line 9 "widget_yahoo_edit.html"
stash.set("yahoo_st_widget_dialog_editlabel_field",loc('Yahoo! ID:'));
output += '<td class="st-widget-dialog-editlabel">';
//line 10 "widget_yahoo_edit.html"
output += stash.get('yahoo_st_widget_dialog_editlabel_field');
output += '</td>\n  <td class="st-widget-dialog-editfield">\n    <input size="40" type="text" id="st-widget-yahoo_id" name="yahoo_id" value="';
//line 12 "widget_yahoo_edit.html"

// FILTER
output += (function() {
    var output = '';

output += stash.get('yahoo_id');

    return context.filter(output, 'html', []);
})();

output += '"/>\n  </td>\n</tr>\n</table>\n</div>\n<div id="yahoo_widget_edit_error_msg" class="widget_edit_error_msg"></div>\n<div class="st-widgets-options">\n    <img id="st-widgets-optionsicon" src="/static/2.9.3.0/images/st/show_more.gif">\n    <a id="st-widgets-moreoptions" href="#">';
//line 20 "widget_yahoo_edit.html"
 stash.set('yahoo_st_widgets_moreoptions', loc('More options')); 
//line 20 "widget_yahoo_edit.html"
output += stash.get('yahoo_st_widgets_moreoptions');
output += '</a>\n</div>\n<div id="st-widgets-moreoptionspanel">\n<p class="st-widget-description">';
//line 23 "widget_yahoo_edit.html"
stash.set("yahoo_st_widgets_moreoptionspanel",loc('There are no optional properties for a Yahoo! link.'));
//line 23 "widget_yahoo_edit.html"
output += stash.get('yahoo_st_widgets_moreoptionspanel');
output += '</p>\n<table class="st-widgets-moreoptionstable">\n\n\n\n\n</table>\n<div class="st-widgetdialog-wikitext">\n    <span class="label">';
//line 31 "widget_yahoo_edit.html"
stash.set("yahoo_st_widgetdialog_wikitext",loc('wiki text'));
//line 31 "widget_yahoo_edit.html"
output += stash.get('yahoo_st_widgetdialog_wikitext');
output += '\n</span>\n    <span class="wikitext" id="yahoo_wafl_text">&nbsp;</span>\n</div>\n</div>\n</div>\n';
//line 37 "widget_yahoo_edit.html"
output += context.process('save-cancel.html');
output += '\n</form>\n\n\n';
    }
    catch(e) {
        var error = context.set_error(e, output);
        throw(error);
    }

    return output;
}

// BEGIN pagetags.js
if (typeof ST == 'undefined') {
    ST = {};
}

// St.Tags Class

ST.Tags = function (args) {
    $H(args).each(this._applyArgument.bind(this));

    Event.observe(window, 'load', this._loadInterface.bind(this));
};


ST.Tags.prototype = {
    showTagField: false,
    workspaceTags: {},
    initialTags: {},
    suggestionRE: '',
    _deleted_tags: [],
    socialtextModifiers: {
        uri_escape: function (str) {
            return encodeURIComponent(str);
        },
        escapespecial : function(str) {
            var escapes = [
                { regex: /'/g, sub: "\\'" },
                { regex: /\n/g, sub: "\\n" },
                { regex: /\r/g, sub: "\\r" },
                { regex: /\t/g, sub: "\\t" }
            ];
            for (var i=0; i < escapes.length; i++)
                str = str.replace(escapes[i].regex, escapes[i].sub);
            return str;
        },
        quoter: function (str) {
            return str.replace(/"/g, '&quot;');
        },
        tagescapespecial : function(t) {
            var escapes = [
                { regex: /'/g, sub: "\\'" },
                { regex: /\n/g, sub: "\\n" },
                { regex: /\r/g, sub: "\\r" },
                { regex: /\t/g, sub: "\\t" }
            ];
            s = t.name;
            for (var i=0; i < escapes.length; i++)
                s = s.replace(escapes[i].regex, escapes[i].sub);
            return s;
        }
    },

    element: {
        workspaceTags: 'st-tags-workspace',
        tagName: 'st-tags-tagtemplate',
        tagSuggestion: 'st-tags-suggestiontemplate',
        addButton: 'st-tags-addbutton',
        displayAdd: 'st-tags-addlink',
        initialTags: 'st-tags-initial',
        tagField: 'st-tags-field',
        addInput: 'st-tags-addinput',
        addBlock: 'st-tags-addblock',
        message: 'st-tags-message',
        tagSuggestionList: 'st-tags-suggestionlist',
        suggestions: 'st-tags-suggestion',
        deleteTagsMessage: 'st-tags-deletemessage',
        noTagsPlaceholder: 'st-no-tags-placeholder'
    },

    jst: {
        name: '', // WAS TaglineTemplate
        suggestion: '' // WAS SuggestionFormat
    },

    displayListOfTags: function (tagfield_should_focus) {
        this.tagCollection.maxCount = this.workspaceTags.maxCount;
        var tagList = this.tagCollection;
        if (tagList.tags && tagList.tags.length > 0) {
            tagList._MODIFIERS = this.socialtextModifiers;
            this.tagCollection = tagList;

            // Tags might have raw html.
            for (var ii = 0; ii < tagList.tags.length ; ii++)
               tagList.tags[ii].name = html_escape( tagList.tags[ii].name );

            this.computeTagLevels();
            this.jst.name.update(tagList);
        } else {
            this.jst.name.clear();
        }
        if (this.showTagField) {
            Element.setStyle('st-tags-addinput', {display: 'block'});
            if (tagfield_should_focus) {
                tagField = $(this.element.tagField).focus();
            }
        }
        if ($('st-tags-message')) {
            Element.hide('st-tags-message');
        }
    },

    _copy_page_tags_to_master_list: function () {
        for (var i=0; i < this.tagCollection.tags.length; i++) {
            found = false;
            var tag = this.tagCollection.tags[i];
            var lctag = tag.name.toLowerCase();
            for (var j=0; j < this.workspaceTags.tags.length; j++) {
                if (this.workspaceTags.tags[j].name.toLowerCase() == lctag) {
                    found = true;
                    break;
                }
            }
            if (!found) {
                this.workspaceTags.tags.push(tag);
            }
        }
    },

    decodeTagNames: function () {
        var tagList = this.tagCollection;
        for (i=0; i < tagList.tags.length; i++)
            tagList.tags[i].name = decodeURIComponent(tagList.tags[i].name);
    },

    computeTagLevels: function () {
        var tagList = this.tagCollection;
        var i=0;
        var maxWeight = tagList.maxCount;

        if (maxWeight < 10) {
            for (i=0; i < tagList.tags.length; i++)
                tagList.tags[i].level = 'st-tags-level2';
        }
        else {
            for (i=0; i < tagList.tags.length; i++) {
                var tagWeight = tagList.tags[i].page_count / maxWeight;
                if (tagWeight > 0.8)
                    tagList.tags[i].level = 'st-tags-level5';
                else if (tagWeight > 0.6)
                    tagList.tags[i].level = 'st-tags-level4';
                else if (tagWeight > 0.4)
                    tagList.tags[i].level = 'st-tags-level3';
                else if (tagWeight > 0.2)
                    tagList.tags[i].level = 'st-tags-level2';
                else
                    tagList.tags[i].level = 'st-tags-level1';
            }
        }
        this.tagCollection = tagList;
    },

    addTag: function (tagToAdd) {
        Element.hide(this.element.suggestions);
        tagToAdd = this._trim(tagToAdd);
        var tagField = $(this.element.tagField);
        if (tagToAdd.length == 0) {
            return;
        }
        this.showTagMessage('Adding tag ' + html_escape(tagToAdd));
        var uri = Page.APIUriPageTag(tagToAdd);
        new Ajax.Request (
            uri,
            {
                method: 'post',
                requestHeaders: ['X-Http-Method','PUT'],
                onComplete: (function (req) {
                    this._remove_from_deleted_list(tagToAdd);
                    this.fetchTags();
                    Page.refresh_page_content();
                }).bind(this),
                onFailure: (function(req, jsonHeader) {
                    this.resetDisplayOnError();
                }).bind(this)
            }
        );
        tagField.value = '';
    },

    addTagFromField: function () {
        this.addTag($(this.element.tagField).value);
    },

    displayAddTag: function () {
        this.showTagField = true;
        Element.setStyle(this.element.addInput, {display: 'block'});
        $(this.element.tagField).focus();
        Element.hide(this.element.addBlock);
    },

    _remove_from_deleted_list: function (tagToRemove) {
        this._deleted_tags.deleteElementIgnoreCase(tagToRemove);
        this._update_delete_list();
    },

    showTagMessage: function (msg) {
        Element.hide(this.element.addInput);
        Element.setStyle(this.element.message, {display: 'block'});
        Element.update(this.element.message, msg);
    },

    resetDisplayOnError: function() {
        if (this.showTagField) {
            Element.setStyle(this.element.addInput, {display: 'block'});
        }
        Element.hide(this.element.message);
        Element.update(this.element.message, '');
    },

    findSuggestions: function () {
        var field = $(this.element.tagField);

        if (field.value.length == 0) {
            Element.hide(this.element.suggestions);
        } else {
            if (this.workspaceTags.tags) {
                var expression = field.value;
                if (field.value.search(/ /) == -1) {
                    expression = '\\b'+expression;
                }
                this.suggestionRE = new RegExp(expression,'i');
                var suggestions = {
                    matches : this.workspaceTags.tags.grep(this.matchTag.bind(this))
                };
                Element.setStyle(this.element.suggestions, {display: 'block'});
                if (suggestions.matches.length > 0) {
                    suggestions._MODIFIERS = this.socialtextModifiers;
                    this.jst.suggestion.update(suggestions);
                } else {
                    var help = '<span class="st-tags-nomatch">No matches</span>';
                    this.jst.suggestion.set_text(help);
                }
            }
        }
    },

    matchTag: function (tag) {
        if (typeof tag.name == 'number') {
            var s = tag.name.toString();
            return s.search(this.suggestionRE) != -1;
        } else {
            return tag.name.search(this.suggestionRE) != -1;
        }
    },

    tagFieldKeyHandler: function (event) {
        var key;
        if (window.event) {
            key = event.keyCode;
        } else if (event.which) {
            key = event.which;
        }

        if (key == Event.KEY_RETURN) {
            this.addTagFromField();
            return false;
        } else if (key == Event.KEY_TAB) {
            return this.setFirstMatchingSuggestion();
        }
    },

    setFirstMatchingSuggestion: function () {
        var field = $(this.element.tagField);

        if (field.value.length > 0) {
            var suggestions = this.workspaceTags.tags.grep(this.matchTag.bind(this));
            if ((suggestions.length >= 1) && (field.value != suggestions[0].name)) {
                field.value = suggestions[0].name;
                return false;
            }
        }
        return true;
    },

    fetchTags: function () {
        var uri = Page.APIUriPageTags();
        var date = new Date();
        uri += '?iecacheworkaround=' + date.toLocaleTimeString();
        var ar = new Ajax.Request (
            uri,
            {
                method: 'get',
                requestHeaders: ['Accept','application/json'],
                onComplete: (function (req) {
                    this.tagCollection.tags = JSON.parse(req.responseText);
                    if (this.tagCollection.tags.length == 0) {
                        Element.show(this.element.noTagsPlaceholder);
                    } else {
                        Element.hide(this.element.noTagsPlaceholder);
                    }
                    this.decodeTagNames(); /* Thanks, IE */
                    this.displayListOfTags(false);
                    $(this.element.tagField).focus();
                }).bind(this),
                onFailure: (function(req, jsonHeader) {
                    this._deleted_tags.pop();
                    alert('Could not remove tag');
                    this.resetDisplayOnError();
                }).bind(this)
            }
        );
    },

    deleteTag: function (tagToDelete) {
        this.showTagMessage('Removing tag ' + tagToDelete);
        this._deleted_tags.push(tagToDelete);

        var uri = Page.UriPageTagDelete(tagToDelete);
        var ar = new Ajax.Request (
            uri,
            {
                method: 'post',
                requestHeaders: ['X-Http-Method','DELETE'],
                onComplete: (function (req) {
                    this._update_delete_list();
                    this.fetchTags();
                }).bind(this),
                onFailure: (function(req, jsonHeader) {
                    this._deleted_tags.pop();
                    alert('Could not remove tag');
                    this.resetDisplayOnError();
                }).bind(this)
            }
        );
    },

    _update_delete_list: function () {
        if (this._deleted_tags.length > 0) {
            Element.update(this.element.deleteTagsMessage, 'These tags have been removed: ' + this._deleted_tags.join(', '));
            $(this.element.deleteTagsMessage).style.display = 'block';
        }
        else {
            Element.update(this.element.deleteTagsMessage, '');
            $(this.element.deleteTagsMessage).style.display = 'none';
        }
    },

    _applyArgument: function (arg) {
        if (typeof this[arg.key] != 'undefined') {
            this[arg.key] = arg.value;
        }
    },

    _trim: function (value) {
        // XXX Belongs in Scalar Utils?
        var ltrim = /\s*((\s*\S+)*)/;
        var rtrim = /((\s*\S+)*)\s*/;
        return value.replace(rtrim, "$1").replace(ltrim, "$1");
    },

    _loadInterface: function () {
        this.jst.name = new ST.TemplateField(this.element.tagName, 'st-tags-listing');
        this.jst.suggestion = new ST.TemplateField(this.element.tagSuggestion, this.element.tagSuggestionList);

        this.workspaceTags  = JSON.parse($(this.element.workspaceTags).value);
        this.tagCollection = JSON.parse($(this.element.initialTags).value);

        if ($(this.element.addButton)) {
            Event.observe(this.element.addButton,  'click', this.addTagFromField.bind(this));
        }
        if ($(this.element.displayAdd)) {
            Event.observe(this.element.displayAdd, 'click', this.displayAddTag.bind(this));
        }
        if ($(this.element.tagField)) {
            Event.observe(this.element.tagField, 'keyup', this.findSuggestions.bind(this));
            Event.observe(this.element.tagField, 'keydown', this.tagFieldKeyHandler.bind(this));
        }

        this.displayListOfTags(false);
    }

};
// BEGIN pageattachments.js
if (typeof ST == 'undefined') {
    ST = {};
}

// ST.Attachments class
ST.Attachments = function (args) {
    this._uploaded_list = [];
    $H(args).each(this._applyArgument.bind(this));

    Event.observe(window, 'load', this._loadInterface.bind(this));
};

function sort_filesize(a,b) {
    var aunit = a.charAt(a.length-1);
    var bunit = b.charAt(b.length-1);
    if (aunit != bunit) {
        if (aunit < bunit) {
            return -1;
        } else if ( aunit > bunit ) {
            return 1;
        } else {
            return 0;
        }
    } else {
        var asize = parseFloat(a.slice(0,-1));
        var bsize = parseFloat(b.slice(0,-1));
        if (asize < bsize) {
            return -1;
        } else if ( asize > bsize ) {
            return 1;
        } else {
            return 0;
        }
    }
};

ST.Attachments.prototype = {
    attachments: null,
    _uploaded_list: [],
    _attachWaiter: '',
    _table_sorter: null,

    element: {
        attachmentInterface:   'st-attachments-attachinterface',
        manageInterface:       'st-attachments-manageinterface',

        listTemplate:          'st-attachments-listtemplate',
        manageTableTemplate:   'st-attachments-managetable',

        uploadButton:          'st-attachments-uploadbutton',
        manageButton:          'st-attachments-managebutton',

        attachForm:            'st-attachments-attach-form',
        attachSubmit:          'st-attachments-attach-submit',
        attachUnpackCheckbox:  'st-attachments-attach-unpackcheckbox',
        attachEmbedCheckbox:   'st-attachments-attach-embedcheckbox',
        attachUnpack:          'st-attachments-attach-unpackfield',
        attachEmbed:           'st-attachments-attach-embedfield',
        attachUnpackLabel:     'st-attachments-attach-unpacklabel',
        attachCloseButton:     'st-attachments-attach-closebutton',
        attachFilename:        'st-attachments-attach-filename',
        attachFileError:       'st-attachments-attach-error',
        attachFileList:        'st-attachments-attach-list',
        attachMessage:         'st-attachments-attach-message',
        attachUploadMessage:   'st-attachments-attach-uploadmessage',

        manageTableRows:       'st-attachments-manage-body',
        manageCloseButton:     'st-attachments-manage-closebutton',
        manageDeleteButton:    'st-attachments-manage-deletebutton',
        manageDeleteMessage:   'st-attachments-manage-deletemessage',
        manageSelectAll:       'st-attachments-manage-selectall',
        manageTable:           'st-attachments-manage-filelisting'
    },

    jst: {
        list: '',
        manageTable: ''
    },

    _applyArgument: function (arg) {
        if (typeof this[arg.key] != 'undefined') {
            this[arg.key] = arg.value;
        }
    },

    _attach_status_check: function () {
        var doc = null;
        Try.these(
            function () { doc = $('st-attachments-attach-formtarget').contentWindow.document; },
            function () { doc = $('st-attachments-attach-formtarget').contentDocument; }
        );
        if (!doc) return;
        if (!doc.getElementById('attachment_upload')) return;
        clearInterval(this._attach_waiter);
        $(this.element.attachUploadMessage).style.display = 'none';
        Element.update(this.element.attachUploadMessage, '');
        $(this.element.attachSubmit).disabled = false;
        $(this.element.attachUnpackCheckbox).disabled = false;
        $(this.element.attachEmbedCheckbox).disabled = false;
        $(this.element.attachCloseButton).style.display = 'block';

        Element.update(this.element.attachMessage, 'Click "Browse" to find the file you want to upload. When you click "Upload another file" your file will be uploaded and added to the list of attachments for this page.');
        $(this.element.attachSubmit).value = 'Upload another file';
        var err = doc.getElementById('error');
        if (err) {
            var msg = err.innerHTML;
            this._show_attach_error(msg);
        }
        else {
            this._update_uploaded_list($(this.element.attachFilename).value);
            this._pullAttachmentList();
            Page.refresh_page_content(true);
        }

        doc.location = '/static/html/blank.html';

        Try.these(
            (function() {
                $(this.element.attachFilename).value = '';
                if ($(this.element.attachFilename).value) {
                    throw new Error ("Failed to clear value");
                }
            }).bind(this),
            (function() {
                var input = document.createElement('input');
                var old   = $(this.element.attachFilename);
                input.type = old.type;
                input.name = old.name;
                input.size = old.size;
                old.parentNode.replaceChild(input, old);
                input.id = this.element.attachFilename;
                this._hook_filename_field();
            }).bind(this)
        );
        $(this.element.attachFilename).focus();
        setTimeout(this._hide_attach_error.bind(this), 5 * 1000);
    },

    _attach_file_form_submit: function () {
        var filenameField = $(this.element.attachFilename);
        if (! filenameField.value) {
            this._show_attach_error("Please click browse and select a file to upload.");
            return false;
        }

        this._update_ui_for_upload(filenameField.value);
        $(this.element.attachCloseButton).style.display = 'none';

        this._attach_waiter = setInterval(this._attach_status_check.bind(this), 3 * 1000);
        return true;
    },

    _update_ui_for_upload: function (filename) {
        Element.update(this.element.attachUploadMessage, 'Uploading ' + filename + '...');
        $(this.element.attachSubmit).disabled = true;

        var cb = $(this.element.attachUnpackCheckbox);
        $(this.element.attachUnpack).value = (cb.checked) ? '1' : '0';
        cb.disabled = true;

        var cb = $(this.element.attachEmbedCheckbox);
        $(this.element.attachEmbed).value = (cb.checked) ? '1' : '0';
        cb.disabled = true;

        $(this.element.attachUploadMessage).style.display = 'block';

        this._hide_attach_error();
    },

    _check_for_zip_file: function () {
        var filename = $(this.element.attachFilename).value;

        if (filename.match(/\.zip$/, 'i')) {
            this._enable_unpack();
        } else {
            this._disable_unpack();
        }
    },

    _clear_uploaded_list: function () {
        this._uploaded_list = [];
        this._refresh_uploaded_list();
    },

    _delete_selected_attachments: function () {
        var to_delete = [];
        $A($(this.element.manageTableRows).getElementsByTagName('tr')).each(function (node) {
            if (node.getElementsByTagName('input')[0].checked) {
                Element.hide(node);
                to_delete.push(node.getElementsByTagName('input')[0].value);
            }
        });
        if (to_delete.length == 0)
            return false;

        var j = 0;
        var i = 0;
        for (i = 0; i < to_delete.length; i++) {
//            var attachmentId = to_delete[i].match(/\,(.+)\,/)[1];
//            var uri = Wikiwyg.is_safari
//                ? Page.UriPageAttachmentDelete(attachmentId)
//                : Page.APIUriAttachmentDelete(attachmentId);

            var ar = new Ajax.Request (
                to_delete[i],
                {
                    method: 'post',
                    requestHeaders: ['X-Http-Method','DELETE'],
                    onComplete: function(xhr) {
                        if( Wikiwyg.is_safari) {
                            j++;
                            return;
                        }
                    }.bind(this)
                }
            );
        }

        //if ( Wikiwyg.is_safari ) {
        //    var intervalID = window.setInterval(
        //        function() {
        //            if ( j < to_delete.length ) {
        //                return;
        //            }
        //            var ar = new Ajax.Request(
        //                Page.APIUriPageAttachment(),
        //                {
        //                    method: 'get',
        //                    asynchronous: false,
        //                    requestHeaders: ['Accept', 'text/javascript']
        //                }
        //            );
        //            this.attachments = JSON.parse(ar.transport.responseText);
        //            this._refresh_attachment_list();
        //            clearInterval( intervalID );
        //        }.bind(this)
        //        , 5
        //    );
        //}

// TODO - Update message setTimeout(function () {Element.update(this.element.manageDeleteMessage, '')}, 2000);
//        this._pullAttachmentList();
//        Page.refresh_page_content();
        return false;
    },

    _disable_unpack: function () {
        var unpackCheckbox = $(this.element.attachUnpackCheckbox);
        unpackCheckbox.disabled = true;
        unpackCheckbox.checked = false;
        unpackCheckbox.style.display = 'none';

        var label = $(this.element.attachUnpackLabel);
        label.style.color = '#aaa';
        label.style.display = 'none';
    },

    _display_attach_interface: function () {
        field = $(this.element.attachFilename);
        Try.these(function () {
            field.value = '';
        });

        $(this.element.attachmentInterface).style.display = 'block';
        this._disable_scrollbar();

        $(this.element.attachSubmit).value = 'Upload file';
        Element.update(this.element.attachMessage, 'Click "Browse" to find the file you want to upload. When you click "Upload file" your file will be uploaded and added to the list of attachments for this page.');

        var overlayElement = $('st-attachments-attach-attachinterface-overlay');
        var element = $('st-attachments-attach-interface');
        this._center_lightbox(overlayElement, element, this.element.attachmentInterface);
        this._disable_unpack();
        this._check_for_zip_file();
        field.focus();
        return false;
    },

    _center_lightbox: function (overlayElement, element, parentElement) {
        var divs = {
            wrapper: $(parentElement),
            background: overlayElement,
            content: element,
            contentWrapper: element.parentNode
        };
        Widget.Lightbox.show({'divs':divs});

    },

    _display_manage_interface: function () {
        $(this.element.manageSelectAll).checked = false;
        this._refresh_manage_table();
        $(this.element.manageInterface).style.display = 'block';
        this._disable_scrollbar();
        var overlayElement = $('st-attachments-manage-manageinterface-overlay');
        var element = $('st-attachments-manage-interface');
        this._center_lightbox(overlayElement, element, this.element.manageInterface);

        this._table_sorter = new Widget.SortableTable( {
            "tableId": this.element.manageTable,
            "initialSortColumn": 1,
            "columnSpecs": [
              { skip: true },
              { sort: "text" },
              { sort: "text" },
              { sort: "date" },
              { sort: sort_filesize}
            ]
          } );
        return false;
    },

    _enable_scrollbar: function(){
        this._disable_scrollbar('auto','auto');
    },

    // This method has parameters because it could
    // be used to both enable and disable scrollbar. Caller
    // shouldn't give any arguments when calling it.
    _disable_scrollbar: function(height, overflow){
        if ( !height ) height = '100%';
        if ( !overflow ) overflow = 'hidden';

        var bod = document.getElementsByTagName('body')[0];
        bod.style.height = height;
        bod.style.overflow = overflow;

        var htm = document.getElementsByTagName('html')[0];
        htm.style.height = height;
        htm.style.overflow = overflow;
    },

    _enable_unpack: function () {
        var unpackCheckbox = $(this.element.attachUnpackCheckbox);
        unpackCheckbox.disabled = false;
        unpackCheckbox.checked = false;
        unpackCheckbox.style.display = '';

        var label = $(this.element.attachUnpackLabel);
        label.style.color = 'black';
        label.style.display = '';
    },

    _hide_attach_error: function () {
        $(this.element.attachFileError).style.display = 'none';
    },

    _hide_attach_file_interface: function () {
        if (!this._is_uploading_file()) {
            $(this.element.attachmentInterface).style.display = 'none';
            $(this.element.attachSubmit).value = 'Upload file';
            this._enable_scrollbar();
            this._clear_uploaded_list();
        }
        return false;
    },

    _hide_manage_file_interface: function () {
        this._pullAttachmentList();
        Page.refresh_page_content(true);

        $(this.element.manageInterface).style.display = 'none';
        this._enable_scrollbar();
        return false;
    },

    _hook_filename_field: function() {
        if (! $(this.element.attachFilename)) return;
        Event.observe(this.element.attachFilename,     'blur',   this._check_for_zip_file.bind(this));
        Event.observe(this.element.attachFilename,     'keyup',  this._check_for_zip_file.bind(this));
        Event.observe(this.element.attachFilename,     'change', this._check_for_zip_file.bind(this));
    },

    _is_uploading_file: function() {
        return $(this.element.attachSubmit).disabled;
    },

    _pullAttachmentList: function () {
        var ar = new Ajax.Request(
            Page.AttachmentListUri(),
            {
                method: 'get',
                requestHeaders: ['Accept', 'application/json'],
                onComplete: (function (req) {
                    this.attachments = JSON.parse(req.responseText);
                    this._refresh_attachment_list();
                }).bind(this)
            }
        );
    },

    _refresh_attachment_list: function () {
        if (this.attachments && this.attachments.length > 0) {
            var data = {};
            data.attachments = this.attachments;
            this.jst.list.update(data);
        } else {
            this.jst.list.clear();
        }
        return false;
    },

    _refresh_manage_table: function () {
        if (this.attachments && this.attachments.length > 0) {
            var data = {};
            data.attachments = this.attachments;
            var i;
            for (i=0; i< data.attachments.length; i++) {
                var filesize = data.attachments[i]['content-length'];
                var n = 0;
                var unit = '';
                if (filesize < 1024) {
                    unit = 'B';
                    n = filesize;
                } else if (filesize < 1024*1024) {
                    unit = 'K';
                    n = filesize/1024;
                    if (n < 10)
                        n = n.toPrecision(2);
                    else
                        n = n.toPrecision(3);
                } else {
                    unit = 'M';
                    n = filesize/(1024*1024);
                    if (n < 10) {
                        n = n.toPrecision(2);
                    } else if ( n < 1000) {
                        n = n.toPrecision(3);
                    } else {
                        n = n.toFixed(0);
                    }
                }
                data.attachments[i].displaylength = n + unit;
            }
            data.page_name = Page.page_id;
            data.workspace = Page.wiki_id;
            Try.these(
                (function () {
                    this.jst.manageTable.update(data);
                }).bind(this),
                (function () { /* http://www.ericvasilik.com/2006/07/code-karma.html */
                    var temp = document.createElement('div');
                    temp.innerHTML = '<table><tbody id="' + this.element.manageTableRows + '-temp">' +
                                     this.jst.manageTable.html(data) + '</tbody></table>';
                    $(this.element.manageTableRows).parentNode.replaceChild(
                        temp.childNodes[0].childNodes[0],
                        $(this.element.manageTableRows)
                    );
                    $(this.element.manageTableRows + '-temp').id = this.element.manageTableRows;
                }).bind(this)
            );
        } else {
            Try.these(
                (function () {
                    this.jst.manageTable.clear();
                }).bind(this),
                (function () { /* http://www.ericvasilik.com/2006/07/code-karma.html */
                    var temp = document.createElement('div');
                    temp.innerHTML = '<table><tbody id="' + this.element.manageTableRows + '-temp"></tbody></table>';
                    $(this.element.manageTableRows).parentNode.replaceChild(
                        temp.childNodes[0].childNodes[0],
                        $(this.element.manageTableRows)
                    );
                    $(this.element.manageTableRows + '-temp').id = this.element.manageTableRows;
                }).bind(this)
            );
        }
        return false;
    },

    _refresh_uploaded_list: function () {
        if (this._uploaded_list.length > 0) {
            Element.update(this.element.attachFileList, '<span class="st-attachments-attach-listlabel">Uploaded files: </span>' + this._uploaded_list.join(', '));
            $(this.element.attachFileList).style.display = 'block';
        }
        else {
            $(this.element.attachFileList).style.display = 'none';
            Element.update(this.element.attachFileList, '');
        }
    },

    _show_attach_error: function (msg) {
        if (!msg)
            msg = '&nbsp;';
        Element.update(this.element.attachFileError, msg);
        $(this.element.attachFileError).style.display = 'block';
    },

    _toggle_all_attachments: function () {
        var checkbox = $(this.element.manageSelectAll);

        $A($(this.element.manageTableRows).getElementsByTagName('tr')).each(
            function (node) {
                node.getElementsByTagName('input')[0].checked = checkbox.checked;
            }
        );
    },

    _update_uploaded_list: function (filename) {
        var match = filename.match(/^.+[\\\/]([^\\\/]+)$/);
        this._uploaded_list.push(match == null ? filename : match[1]);
        this._refresh_uploaded_list();
    },

    _loadInterface: function () {
        this.jst.list = new ST.TemplateField(this.element.listTemplate, 'st-attachments-listing');
        this.jst.manageTable = new ST.TemplateField(this.element.manageTableTemplate, this.element.manageTableRows);

       this._disable_unpack();

        if ($(this.element.uploadButton)) {
            Event.observe(this.element.uploadButton,       'click',  this._display_attach_interface.bind(this));
        }
        if ($(this.element.manageButton)) {
            Event.observe(this.element.manageButton,       'click',  this._display_manage_interface.bind(this));
        }
        if ($(this.element.manageCloseButton)) {
            Event.observe(this.element.manageCloseButton,  'click',  this._hide_manage_file_interface.bind(this));
        }
        if ($(this.element.manageDeleteButton)) {
            Event.observe(this.element.manageDeleteButton, 'click',  this._delete_selected_attachments.bind(this));
        }
        if ($(this.element.manageSelectAll)) {
            Event.observe(this.element.manageSelectAll,    'click',  this._toggle_all_attachments.bind(this));
        }
        if ($(this.element.attachCloseButton)) {
            Event.observe(this.element.attachCloseButton,  'click',  this._hide_attach_file_interface.bind(this));
        }
        if ($(this.element.attachForm)) {
            Event.observe(this.element.attachForm,         'submit', this._attach_file_form_submit.bind(this));
        }

        this._hook_filename_field();

        this._pullAttachmentList();
    }
};
// BEGIN pageview.js
if (typeof ST == 'undefined') {
    ST = {};
}

// ST.Page calls
ST.Page = function (args) {
    $H(args).each(this._applyArgument.bind(this));
    Event.observe(window, 'load', this._loadInterface.bind(this));
};

ST.Page.prototype = {
    page_id: null,
    wiki_id: null,
    wiki_title: null,
    page_title: null,
    revision_id: null,
    comment_form_window_height: null,
    element: {
        toggleLink: 'st-page-boxes-toggle-link',
        accessories: 'st-page-boxes',
        underlay: 'st-page-boxes-underlay',
        pageEditing: 'st-page-editing',
        content: 'st-content-page-display'
    },
    hideAttributes: {
        onclick: 'showAccessories',
        text: '&gt;'
    },
    showAttributes: {
        onclick: 'hideAccessories',
        text: 'V'
    },

    restApiUri: function () {
        return '/data/workspaces/' + this.wiki_id + '/pages/' + this.page_id;
    },

    APIUri: function () {
        return '/page/' + this.wiki_id + '/' + this.page_id;
    },

    APIUriPageTag: function (tag) {
        return this.restApiUri() + '/tags/' + encodeURIComponent(tag);
    },

    APIUriPageTags: function () {
        return this.restApiUri() + '/tags';
    },

    UriPageTagDelete: function (id) {
        return this.APIUriPageTag(id);
    },

    UriPageAttachmentDelete: function (id) {
        return this. APIUriPageAttachment(id);
    },

    APIUriPageAttachment: function (id) {
        return this.AttachmentListUri + '/' + id;
    },

    AttachmentListUri: function () {
        return this.restApiUri() + '/attachments' + '?' + this.ieCacheFix();
    },

    ieCacheFix: function () {
        var date = new Date();
        return 'iecacheworkaround=' + date.toLocaleTimeString();
    },

    ContentUri: function () {
        return '/' + this.wiki_id + '/index.cgi';
    },

    active_page_exists: function (page_name) {
        page_name = trim(page_name);
        var uri = this.ContentUri();
        uri = uri + '?action=page_info;page_name=' + encodeURIComponent(page_name);
        var ar = new Ajax.Request (
            uri,
            {
                method: 'get',
                asynchronous: false,
                requestHeaders: ['Accept','text/javascript'],
                onFailure: (function(req, jsonHeader) {
                    alert(loc('Could not retrieve the latest revision of the page'));
                }).bind(this)
            }
        );
        var page_info = JSON.parse(ar.transport.responseText);
        return page_info.is_active;
    },

    refresh_page_content: function (force_update) {
        var uri = Page.restApiUri();
        uri = uri + '?verbose=1;link_dictionary=s2';
        uri = uri + ';' + this.ieCacheFix();
        var request = new Ajax.Request (
            uri,
            {
                method: 'get',
                asynchronous: false,
                requestHeaders: ['Accept','application/json'],
                onFailure: (function(req, jsonHeader) {
                    alert(loc('Could not retrieve the latest revision of the page'));
                }).bind(this)
            }
        );

        if (request.transport.status == 403) {
            window.location = "/challenge";
            return;
        }

        if (request.transport.status == 200) {
            var page_info = JSON.parse(request.transport.responseText);
            if (page_info) {
                if ((Page.revision_id < page_info.revision_id) || force_update) {
                    $('st-page-content').innerHTML = page_info.html;
                    $('st-page-editing-revisionid').value = page_info.revision_id;
                    Page.revision_id = page_info.revision_id;
                    if ($('st-raw-wikitext-textarea')) {
                        $('st-raw-wikitext-textarea').value = Wikiwyg.is_safari
                            ? Wikiwyg.htmlUnescape(page_info.wikitext)
                            : page_info.wikitext;
                    }
                    var revisionNode = $('st-rewind-revision-count');
                    if (revisionNode) {
                        Element.update('st-rewind-revision-count', '&nbsp;&nbsp;' + page_info.revision_count);
                        Element.update('st-page-stats-revisions', page_info.revision_count + ' revisions');
                    }
                }
            }
        }
    },

    hideAccessories: function () {
        Cookie.set('st-page-accessories', 'hide');
        Element.hide(this.element.accessories);
        Element.update(this.element.toggleLink, this.hideAttributes.text);
        $(this.element.toggleLink).onclick = this[this.hideAttributes.onclick].bind(this);
        Element.setStyle('st-page-maincontent', {marginRight: '0px'});
    },

    showAccessories: function (leaveMarginAlone) {
        Cookie.set('st-page-accessories', 'show');
        Element.show(this.element.accessories);
        Element.update(this.element.toggleLink, this.showAttributes.text);
        $(this.element.toggleLink).onclick = this[this.showAttributes.onclick].bind(this);
        if (! Element.visible('st-pagetools')) {
            Element.setStyle('st-page-maincontent', {marginRight: '240px'});
        }
    },

    orientAccessories: function () {
        var s_height = $(this.element.accessories).offsetHeight;
        var s_width = $(this.element.accessories).offsetWidth;
        Element.setStyle(this.element.underlay, {height: s_height + 'px'});
        Element.setStyle(this.element.underlay, {width: s_width + 'px'});

        if (document.all) {
            var c_height = (
                 $(this.element.accessories).offsetHeight + (
                       $(this.element.accessories).offsetTop
                     - $(this.element.content).offsetTop
                 )
            );
            if ($(this.element.content).offsetHeight < c_height) {
                if (c_height > 0) {
                    $(this.element.content).style.height = c_height + 'px';
                }
            }
        }
    },

    installUnderlayOrienter: function () {
        /* We want to call it for the first time ASAP since it may
         * change the existing page layout */
        this.orientAccessories();
        setInterval(this.orientAccessories.bind(this), 1000);
    },

    _applyArgument: function (arg) {
        if (typeof this[arg.key] != 'undefined') {
            this[arg.key] = arg.value;
        }
    },

    _loadInterface: function () {
        if (typeof Test != 'undefined') return;
        var m = Cookie.get('st-page-accessories');
        if (m == null || m == 'show') {
            this.showAccessories();
        } else {
            this.hideAccessories();
        }
        this.installUnderlayOrienter();
    }
};

// ST.Page calls
ST.NavBar = function (args) {
    $H(args).each(this._applyArgument.bind(this));
    Event.observe(window, 'load', this._loadInterface.bind(this));
};

ST.NavBar.prototype = {
    element: {
        searchForm: 'st-search-form',
        searchButton: 'st-search-submit',
        searchField: 'st-search-term'
    },

    submit_search: function (arg) {
        $(this.element.searchForm).submit();
    },

    clear_search: function(arg) {
        var new_search = loc("New search").replace("\s", '\s*');
        var reg = new RegExp(new_search, 'i');
        if( $(this.element.searchField).value.match(reg) ) {
            $(this.element.searchField).value = "";
        }
    },

    _applyArgument: function (arg) {
        if (typeof this[arg.key] != 'undefined') {
            this[arg.key] = arg.value;
        }
    },

    _loadInterface: function () {
        var element = $(this.element.searchButton);
        if (! element) return;
        Event.observe(element, 'click', this.submit_search.bind(this));
        if (! $(this.element.searchField) ) return;
        Event.observe(this.element.searchField, 'click', this.clear_search.bind(this));
        Event.observe(this.element.searchField, 'focus', this.clear_search.bind(this));
    }
};
// BEGIN attachqueue.js
if (typeof ST == 'undefined') {
    ST = {};
}

// ST.Attachments class
ST.AttachmentQueue = function (args) {
    $H(args).each(this._applyArgument.bind(this));

    Event.observe(window, 'load', this._loadInterface.bind(this));
};


ST.AttachmentQueue.prototype = {
    _queued_files: [],
    _sequence: 0,

    element: {
        queueInterface:   'st-attachmentsqueue-interface',

        listTemplate:     'st-attachmentsqueue-listtemplate',
        editUploadButton: 'st-edit-mode-uploadbutton',

        inputContainer:   'st-attachmentsqueue-fileprompt',
        holder:           'st-attachmentsqueue-holder',

        submitButton:     'st-attachmentsqueue-submitbutton',
        unpackCheckbox:   'st-attachmentsqueue-unpackcheckbox',
        unpackMessage:    'st-attachmentsqueue-unpackmessage',
        embedCheckbox:    'st-attachmentsqueue-embedcheckbox',
        embedMessage:     'st-attachmentsqueue-embedmessage',
        unpack:           'st-attachmentsqueue-unpackfield',
        embed:            'st-attachmentsqueue-embedfield',
        unpackLabel:      'st-attachmentsqueue-unpacklabel',
        closeButton:      'st-attachmentsqueue-closebutton',
        filename:         'st-attachmentsqueue-filename',
        fileError:        'st-attachmentsqueue-error',
        fileList:         'st-attachmentsqueue-list',
        message:          'st-attachmentsqueue-message',
        uploadMessage:    'st-attachmentsqueue-uploadmessage'
    },

    jst: {
        list: ''
    },

    _add_new_input: function () {
        var new_input = document.createElement( 'input' );
        new_input.type = 'file';
        new_input.name = 'file';
        new_input.id = 'st-attachmentsqueue-filename';
        new_input.size = 60;
        var container = $(this.element.inputContainer);
        container.appendChild(new_input);
        this._set_handlers_for_input();
    },

    _applyArgument: function (arg) {
        if (typeof this[arg.key] != 'undefined') {
            this[arg.key] = arg.value;
        }
    },

    _check_for_zip_file: function () {
        var filename = $(this.element.filename).value;

        var has_zip = false;
        if (filename.match(/\.zip$/, 'i')) {
            has_zip = true;
        } else {
            has_zip = this._has_zip_file();
        }

        if (has_zip) {
            this._enable_unpack();
        }
        else {
            this._disable_unpack();
        }
    },

    clear_list: function () {
        this._queued_files = [];
        this._refresh_queue_list();
    },

    _disable_unpack: function () {
        var unpackCheckbox = $(this.element.unpackCheckbox);
//        unpackCheckbox.checked = false;
        unpackCheckbox.disabled = true;
        unpackCheckbox.style.display = 'none';

        var label = $(this.element.unpackLabel);
        label.style.color = '#aaa';
        label.style.display = 'none';
    },

    _display_interface: function () {
        field = $(this.element.filename);
        Try.these(function () {
            field.value = '';
        });

        $(this.element.queueInterface).style.display = 'block';
        this._center_lightbox(this.element.queueInterface);
        this._refresh_queue_list();
        field.focus();
        return false;
    },

    _center_lightbox: function (parentElement) {
        var overlayElement = $('st-attachmentsqueue-overlay');
        var element = $('st-attachmentsqueue-dialog');
        parentElement = $(parentElement);
        var divs = {
            wrapper: parentElement,
            background: overlayElement,
            content: element,
            contentWrapper: element.parentNode
        }
        Widget.Lightbox.show({'divs':divs, 'effects':['RoundedCorners']});
    },

    count: function () {
        return this._queued_files.length;
    },

    _enable_unpack: function () {
        var unpackCheckbox = $(this.element.unpackCheckbox);
        unpackCheckbox.disabled = false;
        unpackCheckbox.style.display = '';

        var label = $(this.element.unpackLabel);
        label.style.color = 'black';
        label.style.display = '';
    },

    file: function (index) {
        return this._queued_files[index];
    },

    _has_zip_file: function() {
        for (var i=0; i < this._queued_files.length; i++)
            if (this._queued_files[i].filename.match(/\.zip$/,'i'))
                return true;

        return false;
    },

    _hide_error: function () {
        $(this.element.fileError).style.display = 'none';
    },

    _hide_interface: function () {
        $(this.element.queueInterface).style.display = 'none';
        return false;
    },

    is_embed_checked: function() {
        return $(this.element.embedCheckbox).checked;
    },

    is_unpack_checked: function() {
        if (this._has_zip_file()) {
            return $(this.element.unpackCheckbox).checked;
        }
        else {
            return false;
        }
    },

    _queue_file: function () {
        var filenameField = $(this.element.filename);
        if (! filenameField.value) {
            this._show_error(loc('Plese click "Browse" and select a file to upload.'));
            return false;
        }

        var unpackCheckbox = $(this.element.unpackCheckbox);
        var embedCheckbox = $(this.element.embedCheckbox);
        var entry = {
            filename: filenameField.value,
            embed: embedCheckbox.checked,
            unpack: unpackCheckbox.checked,
            field: filenameField
        };

        this._queued_files.push(entry);
        filenameField.id = filenameField.id + '-' + this._sequence;
        this._sequence = this._sequence + 1;

        this._add_new_input();

        var holder = $(this.element.holder);
        holder.appendChild(filenameField);
        this._refresh_queue_list();
        return false;
    },

    _refresh_queue_list: function () {
        if (this._queued_files.length > 0) {
            var data = { queue: [] };
            for (var i=0; i < this._queued_files.length; i++)
                data.queue.push(this._queued_files[i].filename);
            this.jst.list.update(data);
            this.jst.list.show();
            Element.update(this.element.submitButton, loc('Add another file'));
            Element.update(this.element.embedMessage, loc('Add links to these attachments at the top of the page? Images will appear in the page.'));
            Element.update(this.element.unpackMessage, loc('Expand zip archives and attach individual files to the page?'));
            Element.update(this.element.message, loc('Click "Browse" to find the file you want to upload. When you click "Add another file," these files will be added to the list of attachments for this page, and uploaded when you save the page.'));
        }
        else {
            this.jst.list.clear();
            this.jst.list.hide();
            Element.update(this.element.submitButton, loc('Add file'));
            Element.update(this.element.embedMessage, loc('Add a link to this attachment at the top of the page? Images will appear in the page.'));
            Element.update(this.element.unpackMessage, loc('Expand zip archive and attach individual files to the page?'));
            Element.update(this.element.message, loc('Click "Browse" to find the file you want to upload. When you click "Add file," this file will be added to the list of attachments for this page, and uploaded when you save the page.'));
        }
        this._check_for_zip_file();
        return false;
    },

    remove_index: function (index) {
        this._queued_files.splice(index,1);
        this._refresh_queue_list();
    },

    reset_dialog: function () {
        this.clear_list();
        var embedCheckbox = $(this.element.embedCheckbox);
        embedCheckbox.checked = true;

    },

    _set_handlers_for_input: function () {
        if (! $(this.element.filename)) return;
        Event.observe(this.element.filename, 'blur',   this._check_for_zip_file.bind(this));
        Event.observe(this.element.filename, 'keyup',  this._check_for_zip_file.bind(this));
        Event.observe(this.element.filename, 'change', this._check_for_zip_file.bind(this));
    },

    _show_error: function (msg) {
        if (!msg)
            msg = '&nbsp;';
        Element.update(this.element.fileError, msg);
        $(this.element.fileError).style.display = 'block';
    },

    _update_uploaded_list: function (filename) {
        filename = filename.match(/^.+[\\\/]([^\\\/]+)$/)[1];
        this._uploaded_list.push(filename);
    },

    _loadInterface: function () {
        this.jst.list = new ST.TemplateField(this.element.listTemplate, this.element.fileList);

        if ($(this.element.editUploadButton)) {
            Event.observe(this.element.editUploadButton, 'click',  this._display_interface.bind(this));
        }
        if ($(this.element.closeButton)) {
            Event.observe(this.element.closeButton,      'click',  this._hide_interface.bind(this));
        }
        if ($(this.element.submitButton)) {
            Event.observe(this.element.submitButton,     'click',  this._queue_file.bind(this));
        }

        this._set_handlers_for_input();

        this._refresh_queue_list();
    }
};

// main
if (Socialtext.box_javascript) {
    window.EditQueue = new ST.AttachmentQueue ();
}
// BEGIN StTemplateField.js
/*
 * ST.TemplateField class
 *
 * This class wraps two DOM nodes. One node is a display node -- its content
 * is updated by the class. The other node contains the template (Trimpath)
 * used to generate the content for the display node.
 */
ST.TemplateField = function (template, target) {
    this._template_tag = template;
    this._update_tag = target;
    this._template_jst = this._JST(template);
};


ST.TemplateField.prototype = {
    _template_tag: '',
    _update_tag: '',
    _template_jst: '',

    clear: function () {
        Element.update(this._update_tag, '');
    },

    hide: function () {
        $(this._update_tag).style.display = 'none';
    },

    html: function (data) {
        return this._template_jst.process(data);
    },

    set_text: function (html) {
        Element.update(this._update_tag, html);
    },

    show: function () {
        $(this._update_tag).style.display = 'block';
    },

    update: function (data) {
        Element.update(this._update_tag, this.html(data));
    },

    _JST: function (elem) {
        return TrimPath.parseDOMTemplate(elem);
    }
};
// BEGIN tagqueue.js
if (typeof ST == 'undefined') {
    ST = {};
}

// ST.Attachments class
ST.TagQueue = function (args) {
    $H(args).each(this._applyArgument.bind(this));

    Event.observe(window, 'load', this._loadInterface.bind(this));
};


ST.TagQueue.prototype = {
    _queued_tags: [],
    suggestionRE: '',
    workspaceTags: [],

    element: {
        workspaceTags:      'st-tags-workspace',
        queueInterface:     'st-tagqueue-interface',

        editTagButton:      'st-edit-mode-tagbutton',
        submitButton:       'st-tagqueue-submitbutton',
        closeButton:        'st-tagqueue-closebutton',

        tagList:            'st-tagqueue-list',
        listTemplate:       'st-tagqueue-listtemplate',

        suggestions:        'st-tagqueue-suggestion',
        suggestionList:     'st-tagqueue-suggestionlist',
        suggestionTemplate: 'st-tagqueue-suggestiontemplate',

        holder:             'st-tagqueue-holder',

        tagField:           'st-tagqueue-field',
        message:            'st-tagqueue-message',
        error:              'st-tagqueue-error'
    },

    socialtextModifiers: {
        escapespecial : function(str) {
            var escapes = [
                { regex: /'/g, sub: "\\'" },
                { regex: /\n/g, sub: "\\n" },
                { regex: /\r/g, sub: "\\r" },
                { regex: /\t/g, sub: "\\t" }
            ];
            for (var i=0; i < escapes.length; i++)
                str = str.replace(escapes[i].regex, escapes[i].sub);
            return str;
        },
        quoter: function (str) {
            return str.replace(/"/g, '&quot;');
        },
        tagescapespecial : function(t) {
            var escapes = [
                { regex: /'/g, sub: "\\'" },
                { regex: /\n/g, sub: "\\n" },
                { regex: /\r/g, sub: "\\r" },
                { regex: /\t/g, sub: "\\t" }
            ];
            s = t.name;
            for (var i=0; i < escapes.length; i++)
                s = s.replace(escapes[i].regex, escapes[i].sub);
            return s;
        }
    },

    jst: {
        list: '',
        suggestion: ''
    },

    _applyArgument: function (arg) {
        if (typeof this[arg.key] != 'undefined') {
            this[arg.key] = arg.value;
        }
    },

    _hide_error: function () {
        Element.update(this.element.error, '&nbsp;');
        Element.hide(this.element.error);
    },

    clear_list: function () {
        this._queued_tags = [];
        this._refresh_queue_list();
    },

    _display_interface: function () {
        field = $(this.element.tagField);
        Try.these(function () {
            field.value = '';
        });

        this.workspaceTags  = JSON.parse($(this.element.workspaceTags).value);

        $(this.element.queueInterface).style.display = 'block';
        this._center_lightbox(this.element.queueInterface);
        this._refresh_queue_list();
        field.focus();
        return false;
    },

    _center_lightbox: function (parentElement) {
        var overlayElement = $('st-tagqueue-overlay');
        var element = $('st-tagqueue-dialog');
        Widget.Lightbox.show({
            divs: {
                wrapper: $(parentElement),
                background: overlayElement,
                contentWrapper: element.parentNode,
                content: element
            },
            effects: ['RoundedCorners']
        });
    },

    count: function () {
        return this._queued_tags.length;
    },

    tag: function (index) {
        return this._queued_tags[index];
    },

    _find_suggestions: function () {
        var field = $(this.element.tagField);

        if (field.value.length == 0) {
            Element.hide(this.element.suggestions);
        } else {
            if (this.workspaceTags.tags) {
                var expression = field.value;
                if (field.value.search(/ /) == -1) {
                    expression = '\\b'+expression;
                }
                this.suggestionRE = new RegExp(expression,'i');
                var suggestions = {
                    matches : this.workspaceTags.tags.grep(this.matchTag.bind(this))
                };
                Element.setStyle(this.element.suggestions, {display: 'block'});
                if (suggestions.matches.length > 0) {
                    suggestions._MODIFIERS = this.socialtextModifiers;
                    this.jst.suggestion.update(suggestions);
                } else {
                    var help = '<span class="st-tagqueue-nomatch">' + loc("No matches") + '</span>';
                    this.jst.suggestion.set_text(help);
                }
            }
        }
    },

    _hide_interface: function () {
        $(this.element.queueInterface).style.display = 'none';
        return false;
    },

    _clear_field: function () {
        var tag_field = $(this.element.tagField);
        tag_field.value = '';
        this._refresh_queue_list();
        Element.hide(this.element.suggestions);
        tag_field.focus();
        return false;
    },

    queue_tag: function (tag) {
        if (! tag) {
            this._show_error(loc('No tag entered'));
            return false;
        }
        this._queued_tags.push(tag);

        return this._clear_field();
    },

    _queue_tag: function () {
        var tag_field = $(this.element.tagField);
        return this.queue_tag(tag_field.value);
    },

    _refresh_queue_list: function () {
        if (this._queued_tags.length > 0) {
            var data = { queue: [] };
            for (var i=0; i < this._queued_tags.length; i++)
                data.queue.push(this._queued_tags[i]);
            this.jst.list.update(data);
            this.jst.list.show();
            Element.update(this.element.submitButton, loc('Add another tag'));
            Element.update(this.element.message, loc('Enter a tag and click "Add another tag". The tag will be saved when you save the page.'));
        }
        else {
            this.jst.list.clear();
            this.jst.list.hide();
            Element.update(this.element.submitButton, loc('Add tag'));
            Element.update(this.element.message, loc('Enter a tag and click "Add tag". The tag will be saved when you save the page.'));
        }
        this._hide_error();
        return false;
    },

    remove_index: function (index) {
        this._queued_tags.splice(index,1);
        this._refresh_queue_list();
    },

    reset_dialog: function () {
        this.clear_list();
    },

    matchTag: function (tag) {
        if (typeof tag.name == 'number') {
            var s = tag.name.toString();
            return s.search(this.suggestionRE) != -1;
        } else {
            return tag.name.search(this.suggestionRE) != -1;
        }
    },

    _set_first_matching_suggestion: function () {
        var field = $(this.element.tagField);

        if (field.value.length > 0) {
            var suggestions = this.workspaceTags.tags.grep(this.matchTag.bind(this));
            if ((suggestions.length >= 1) && (field.value != suggestions[0].name)) {
                field.value = suggestions[0].name;
                return false;
            }
        }
        return true;
    },

    tagFieldKeyHandler: function (event) {
        var e = event || window.event;
        var key = e.charCode || e.keyCode;

        if (key == Event.KEY_RETURN) {
            this._queue_tag();
            return false;
        }
        else if (key == Event.KEY_TAB) {
            var ret = this._set_first_matching_suggestion();
            try {
                event.preventDefault();
            }
            catch(e) {
            }
            try {
                event.stopPropagation();
            }
            catch(e) {
            }
            return ret;
        }
    },

    _show_error: function (msg) {
        if (!msg)
            msg = '&nbsp;';
        Element.update(this.element.error, msg);
        $(this.element.error).style.display = 'block';
    },

    _loadInterface: function () {
        this.jst.list = new ST.TemplateField(this.element.listTemplate, this.element.tagList);
        this.jst.suggestion = new ST.TemplateField(this.element.suggestionTemplate, this.element.suggestionList);

        if ($(this.element.editTagButton)) {
            Event.observe(this.element.editTagButton, 'click', this._display_interface.bind(this));
        }
        if ($(this.element.closeButton)) {
            Event.observe(this.element.closeButton, 'click', this._hide_interface.bind(this));
        }
        if ($(this.element.submitButton)) {
            Event.observe(this.element.submitButton, 'click', this._queue_tag.bind(this));
        }

        if ($(this.element.tagField)) {
            Event.observe(this.element.tagField, 'keyup', this._find_suggestions.bind(this));
            Event.observe(this.element.tagField, 'keydown', this.tagFieldKeyHandler.bind(this));
        }

        this._refresh_queue_list();
   }

};
// BEGIN Watchlist.js
// Watchlist
if (typeof ST == 'undefined') {
    ST = {};
}

ST.Watchlist = function() {};

ST.Watchlist.prototype = {
    isBeingWatched: false,
    image: null,

    button_activate: function () {
        if (!this.isBeingWatched) {
            var text = document.getElementById('st-watchlist-text');
            if (text) {
                text.className = 'on';
            }
            this.image.src = this._image_src('hover');
        }
        return false;
    },

    button_default: function () {
        var text = document.getElementById('st-watchlist-text');
        if (this.isBeingWatched) {
            if (text) {
                text.innerHTML = loc("Watching this page");
                text.className = 'on';
            }
            this.image.src = this._image_src('on');
        }
        else {
            if (text) {
                text.innerHTML = loc("Watch this page");
                text.className = 'off';
            }
            this.image.src = this._image_src('off');
        }
        return false;
    },

    _image_src: function(type) {
        var star = '';
        if (Socialtext.loc_lang != 'en') {
            star = 'star-';
        }
        return nlw_make_static_path(
            '/images/st/pagetools/watch-' + star + type + '.gif'
        );
    },

    _toggle_watch_state: function () {
        var wiki_id = Socialtext.wiki_id || Page.wiki_id;
        var action = (this.isBeingWatched) ? 'remove_from' : 'add_to';
        var page_id = this.page_id || Page.page_id;
        var uri = '/' + wiki_id + '/index.cgi' +
                  '?action=' + action + '_watchlist;page=' + page_id;

        var ar = new Ajax.Request (
            uri,
            {
                method: 'get',
                onComplete: (function (req) {
                    if (req.responseText == '1' || req.responseText == '0') {
                        this.isBeingWatched = ! this.isBeingWatched;
                        this.button_default();
                    } else {
                        this._display_toggle_error();
                    }
                }).bind(this),
                onFailure: (function(req, jsonHeader) {
                    this._display_toggle_error();
                }).bind(this)
            }
        );
    },

    _display_toggle_error: function () {
        if (this.isBeingWatched) {
            alert(loc('Could not remove page from watchlist'));
        }
        else {
            alert(loc('Could not add page to watchlist'));
        }
    },

    _applyArgument: function (arg) {
        if (typeof this[arg.key] != 'undefined') {
            this[arg.key] = arg.value;
        }
    },

    _loadInterface: function (indicator) {
        this.image = $(indicator);
        if (this.image) {
            if (Socialtext.loc_lang != 'en') {
                if (this.image.src.match(/watch-star-on/)) {
                    this.isBeingWatched = true;
                }
                else {
                    this.isBeingWatched = false;
                }
            }
            else {
                if (this.image.src.match(/watch-on/)) {
                    this.isBeingWatched = true;
                }
                else {
                    this.isBeingWatched = false;
                }
            }

            Event.observe(this.image.parentNode,  'click', this._toggle_watch_state.bind(this));
            Event.observe(this.image.parentNode,  'mouseover', this.button_activate.bind(this));
            Event.observe(this.image.parentNode,  'mouseout', this.button_default.bind(this));

            this.button_default();
        }
    }
};
// BEGIN comment.js
if (typeof ST == 'undefined') {
    ST = {};
}

ST.Comment = function () {
    Event.observe(window, 'load', function () {
        var comment_button = $('st-comment-button-link');
        if (comment_button) {
            if (! comment_button.href.match(/#$/)) {
                return;
            }

            Event.observe('st-comment-button-link', 'click', function () {
                ST.Comment.launchCommentInterface({
                    page_name: Page.page_id,
                    action: 'display',
                    height: Page.comment_form_window_height
                });
                return false;
            });
            var below_fold_comment_link = $('st-edit-actions-below-fold-comment');
            if (below_fold_comment_link) {
                if (! below_fold_comment_link.href.match(/#$/)) {
                    return;
                }

                Event.observe('st-edit-actions-below-fold-comment', 'click', function () {
                    ST.Comment.launchCommentInterface({
                        page_name: Page.page_id,
                        action: 'display',
                        height: Page.comment_form_window_height
                    });
                    return false;
                });
            }
        }
    });
};

ST.Comment.launchCommentInterface = function (args) {
    var display_width = (window.offsetWidth || document.body.clientWidth || 600);
    var page_name     = args.page_name;
    var action        = args.action;
    var height        = args.height;
    var comment_window = window.open(
        'index.cgi?action=enter_comment;page_name=' + page_name + ';caller_action=' + action,
        '_blank',
        'toolbar=no, location=no, directories=no, status=no, menubar=no, titlebar=no, scrollbars=yes, resizable=yes, width=' + display_width + ', height=' + height + ', left=' + 50 + ', top=' + 200
    );

    if ( navigator.userAgent.toLowerCase().indexOf("safari") != -1 ) {
        window.location.reload();
    }

    return false;
};

Comment = new ST.Comment ();
// BEGIN revisions.js
function check_revisions(form) {
    var r1;
    var r2;

    var old_id = form.old_revision_id;
    if (old_id) {
        for (var i = 0; i < old_id.length; i++) {
            if (old_id[i].checked) {
               r1 = old_id[i].value;
            }
        }
    } else {
        r1 = -1;
    }

    var new_id = form.new_revision_id;
    if (new_id) {
        for (var i = 0; i < new_id.length; i++) {
            if (new_id[i].checked) {
               r2 = new_id[i].value;
            }
        }
    } else {
        r2 = -1;
    }

    if ((! r1) || (! r2)) {
        alert(loc('You must select two revisions to compare.'));
        return false;
    }

    if (r1 == r2) {
        alert(loc('You cannot compare a revision to itself.'));
        return false;
    }

    return true;
}
// BEGIN listview.js
/**
 * This class handles the JS needs for the page list view
 */

if (typeof ST == 'undefined') {
    ST = {};
}

ST.ListView = function (args) {
    $H(args).each(this._applyArgument.bind(this));

    Event.observe(window, 'load', this._loadInterface.bind(this));
};


ST.ListView.prototype = {
    unselectMessage : 'Unselect all pages',
    selectMessage : 'Select all pages',
    checkboxes : null,
    element: {
        selectToggle:   'st-listview-allpagescb',
        pdfExport:      'st-listview-submit-pdfexport',
        rtfExport:      'st-listview-submit-rtfexport',
        submitAction:   'st-listview-action',
        submitFilename: 'st-listview-filename',
        form:           'st-listview-form'
    },

    _stateOfAllPagesIs: function (STATE) {
        for (var i=0; i < this.checkboxes.length; i++)
            if (this.checkboxes[i].checked != STATE)
                return false;
        return true;
    },
    
    _atLeastOnePageSelected: function () {
        for (var i=0; i < this.checkboxes.length; i++)
            if (this.checkboxes[i].checked)
                return true;
        return false;
    },
    
    _getPdf: function () {
        if (!this._atLeastOnePageSelected()) {
            alert(loc("You must check at least one page in order to create a PDF."));
        }
        else {
            $(this.element.submitAction).value = 'pdf_export';
            $(this.element.submitFilename).value = Socialtext.wiki_id + ".pdf";
            $(this.element.form).submit();
        }
    },

    _getRtf: function () {
        if (!this._atLeastOnePageSelected()) {
            alert(loc("You must check at least one page in order to create a Word document."));
        }
        else {
            $(this.element.submitAction).value = 'rtf_export';
            $(this.element.submitFilename).value = Socialtext.wiki_id + ".rtf";
            $(this.element.form).submit();
        }
    },

    _toggleSelect: function () {
        var allToggle = $(this.element.selectToggle);

        this.checkboxes.each(
            function (checkbox) {
                checkbox.checked = allToggle.checked;
            }
        );
        allToggle.title = (allToggle.checked) ? this.unselectMessage : this.selectMessage;
    },

    _applyArgument: function (arg) {
        if (typeof this[arg.key] != 'undefined') {
            this[arg.key] = arg.value;
        }
    },

    _syncCheckAllCb: function() {
        var allToggle = $(this.element.selectToggle);

        var allSelected = this._stateOfAllPagesIs(true);

        allToggle.checked = allSelected;
        allToggle.title = allToggle.checked ? this.unselectMessage : this.selectMessage;
    },

    _loadInterface: function () {
        if ($(this.element.selectToggle)) {
            Event.observe(this.element.selectToggle, 'click', this._toggleSelect.bind(this));
        }
        if ($(this.element.pdfExport)) {
            Event.observe(this.element.pdfExport, 'click', this._getPdf.bind(this));
        }
        if ($(this.element.rtfExport)) {
            Event.observe(this.element.rtfExport, 'click', this._getRtf.bind(this));
        }

        this.checkboxes = document.getElementsByClassName('st-listview-selectpage-checkbox');
        for (var i=0; i < this.checkboxes.length; i++)
            Event.observe(this.checkboxes[i], 'click', this._syncCheckAllCb.bind(this));
   }
};

window.ListView = new ST.ListView ();
// BEGIN LookaheadWidget.js
/*
 * Abstract class for a lookahead widget. A lookahead widget watches an &lt;input&gt; field
 * and presents the user with a list of suggested possible matches. Suggestion list is retrieved
 * using AJAX and the REST API.
 *
 * AJAX calls are asyncronous so as to not lock the browser and prevent the user from typing.
 * I could not determine a way to cancel an existing AJAX call so the class tracks which
 * AJAX call is the <i>active</i>. The class makes sure the suggestion list only contains
 * suggestions from the active AJAX call.
 */


/**
 * Constructor
 *
 * @param dialog_window lightbox dialog window
 * @param api API call to populate lookup window
 * @param edit_field_id CSS id for the workspace edit field
 * @param window_class CSS class for the drop down windod which contains the
 * suggestion list
 * @param suggestion_block_class CSS class for the suggestion block
 * @param suggestion_class CSS class for each suggestion
 * @param variable_name JS variable associated with the object
 */
LookaheadWidget = function(dialog_window, api, edit_field_id, window_class, suggestion_block_class, suggestion_class, variable_name) {
    this.apiCall = api;
    this.editFieldId = edit_field_id;
    this.editField = $(edit_field_id);

    this.variableName = variable_name;
    this.activeTransport = null;
    this.suggestions = [];
    this.hasFocus = false;
    this.mouseInSuggestion = false;
    this.suggestionYOffset = 2;

    this.suggestionWindowClass = window_class;
    this.suggestionClass = suggestion_class;
    this.suggestionBlockClass = suggestion_block_class;

    this.suggestionWindow = null;
    this.suggestionBlock = null;
    this.dialogWindow = dialog_window;
    this.previousText = '';

    // We have our own auto-complete, disable the browser's version
    this.editField.setAttribute('autocomplete', 'off');

    this._hookInterface();
}

/**
 * Update the edit field with the suggestion selected by the user
 */
LookaheadWidget.prototype.acceptSuggestion = function(suggestion) {
    this.activeTransport = null;
    this._hideSuggestionBlock();
    this.editField.value = suggestion;
    this.previousText = suggestion;
    return false;
}

/**
 * Build the URI for the API call to retrieve the suggestion list
 * @return URI string
 */
LookaheadWidget.prototype._apiURI = function () {
    var uri = this.apiCall;
    var connector = '?';
    var parameters = [this._getOrder(), this._getFilter()];
    for (i=0; i < parameters.length; i++) {
        if (parameters[i] != '') {
            uri += connector + parameters[i];
            connector = ';';
        }
    }

    return uri;
}

/**
 * Create the suggestion window and populate it with the suggestions from the API call
 */
LookaheadWidget.prototype._createSuggestionBlock = function () {
    if (this.suggestionWindow)
        return;

    this.suggestionWindow = document.createElement('div');
    this.suggestionWindow.id = 'st-widget-lookahead-window';

    this.suggestionWindow.className = this.suggestionWindowClass;
    this.suggestionWindow.style.height = "0px";
    this.suggestionWindow.style.overflow = "hidden";
    this.suggestionWindow.style.display = 'none';

    this.suggestionBlock = document.createElement('div');
    this.suggestionBlock.id = 'st-widget-lookahead-suggestionblock';
    this.suggestionBlock.className = this.suggestionBlockClass;
    this.suggestionWindow.appendChild(this.suggestionBlock);

    this.dialogWindow.appendChild(this.suggestionWindow);

    Event.observe(this.suggestionWindow, 'mouseover', this._mouseInSuggestion.bind(this), false);
    Event.observe(this.suggestionWindow, 'mouseout', this._mouseLeavingSuggestion.bind(this), false);
}

/**
 * Delete the suggestion window
 */
LookaheadWidget.prototype._deleteSuggestionWindow = function () {
    if (!this.suggestionWindow)
        return;

    this.suggestionWindow.removeChild(this.suggestionBlock);
    this.suggestionWindow.parentNode.removeChild(this.suggestionWindow);
    this.suggestionBlock = null;
    this.suggestionWindow = null;
}

/**
 * Escape the suggestion text so it works with HTML
 * @return Escaped suggestion text
 */
LookaheadWidget.prototype._escapedSuggestion = function (suggestion) {
    var escapes = [
        { regex: /'/g, sub: "\\'" },
        { regex: /\n/g, sub: "\\n" },
        { regex: /\r/g, sub: "\\r" },
        { regex: /\t/g, sub: "\\t" }
    ];
    for (var i=0; i < escapes.length; i++)
        suggestion = suggestion.replace(escapes[i].regex, escapes[i].sub);
    return suggestion.replace(/"/g, '&quot;');
}

LookaheadWidget.prototype._editIsEmpty = function () {
    this.activeTransport = null;
    this.suggestions = [];
    this._hideSuggestionBlock();
}

/**
 * Call the API and fetch the suggestion list
 */
LookaheadWidget.prototype._findSuggestions = function () {
    if (this.editField.value.length == 0) {
        this._editIsEmpty();
    }
    else {
        if (this.previousText != this.editField.value) {
            this.previousText = this.editField.value;
            try {
                var uri = this._apiURI();
                var id = this.activeId;
                var aj = new Ajax.Request();
                var request = new Ajax.Request (
                    uri,
                    {
                        method: 'get',
                        requestHeaders: ['Accept','text/plain'],
                        onComplete: (function (req) {
                            this.populateSuggestion(req);
                        }).bind(this),
                        onFailure: (function(req, jsonHeader) {
                        }).bind(this)
                    }
                );
                this.activeTransport = request.transport;
            }
            catch(e) {
                // XXX Ignore any error?
            }
        }
    }
}

/**
 * Called when the edit control gains focus.
 */
LookaheadWidget.prototype._gainFocus = function () {
    if (!this.hasFocus) {
        this.hasFocus = true;
        this.activeTransport = null;
        this._createSuggestionBlock();
        this._findSuggestions();
    }
},

/**
 * Build the filter criteria for the API call
 * @return Filter criteria string for the API URI
 */
LookaheadWidget.prototype._getFilter = function () {
    var filter = this.editField.value;
    filter = filter.replace(/^\s+/,'');
    filter = filter.replace(/ /g, '.*');
    return 'filter=\\b'+this.editField.value;
}

/**
 * Get the order clause for the API call. Default order is alpha
 * @return Order criteria string for the API URI
 */
LookaheadWidget.prototype._getOrder = function () {
    return 'order=alpha';
}

/**
 * Hide the suggestion window
 */
LookaheadWidget.prototype._hideSuggestionBlock = function () {
    this.suggestionBlock.innerHTML = '';
    this.suggestionWindow.style.overflow = 'hidden';
    this.suggestionWindow.style.display = 'none';
    this.editField.focus();
}

/**
 * Add the JS event observers for the &lt;input&gt; field
 */
LookaheadWidget.prototype._hookInterface = function () {
    if ($(this.editFieldId)) {
        Event.observe(this.editFieldId, 'keyup', this._findSuggestions.bind(this));
        Event.observe(this.editFieldId, 'keydown', this._keyHandler.bind(this));
        Event.observe(this.editFieldId, 'blur', this._loseFocus.bind(this));
        Event.observe(this.editFieldId, 'focus', this._gainFocus.bind(this));
    }
}

/**
 * Called when a key is pressed when the edit field has the focus
 * @param event JS event object
 */
LookaheadWidget.prototype._keyHandler = function (event) {
    var e = event || window.event;
    var key = e.charCode || e.keyCode;

    if (key == Event.KEY_TAB && this._suggestionsDisplayed()) {
        this._hideSuggestionBlock();
        var ret = this._setFirstMatchingSuggestion();
    }
}

/**
 * Called when the input field loses focus. Default action is to hide the suggestion window
 */
LookaheadWidget.prototype._loseFocus = function() {
    if (this.hasFocus && !this.mouseInSuggestion) {
        this.hasFocus = false;
        this._deleteSuggestionWindow();
        this.activeTransport = null;
    }
}

/**
 * Called when the mouse enters the suggestion window.
 *
 * We need to track if the mouse is in the suggestion window to handle focus change. If
 * the mouse is in the suggestion window we don't want to hide the window from the user.
 */
LookaheadWidget.prototype._mouseInSuggestion = function() {
    this.mouseInSuggestion = true;
}

/**
 * Called when the mouse leaves the suggestion window.
 *
 * We need to track if the mouse is in the suggestion window to handle focus change. If
 * the mouse is in the suggestion window we don't want to hide the window from the user.
 */
LookaheadWidget.prototype._mouseLeavingSuggestion = function() {
    this.mouseInSuggestion = false;
}

/**
 * Parse the API return and build the suggestion list
 *
 * The suggestion list is cleared if it only contains one suggestion which matches
 * the contents of the edit field. No use showing the user what they have already typed.
 */
LookaheadWidget.prototype._parseSuggestionList = function(suggestions_text) {
    var text = trim(suggestions_text);
    if (text.length == 0)
        this.suggestions = [];
    else {
        this.suggestions = text.split("\n");
        while (this.suggestions[this.suggestions.length -1] == '')
            this.suggestions.pop();
    }
    if (this.suggestions.length == 1 && this.suggestions[0] == this.editField.value)
        this.suggestions.pop();
}

LookaheadWidget.prototype.isValidTransport = function(request) {
    if ((this.activeTransport != null && request != this.activeTransport) || !this.hasFocus)
        return false;
    else
        return true;
}

/**
 * Build the suggestion window and populate it with the suggestions from the API call
 */
LookaheadWidget.prototype.populateSuggestion = function(request) {

    if (!this.isValidTransport(request))
        return;

    if (request.status != 200) {
        if (request.status == 404) {
            this.suggestionBlock.innerHTML = this._error404Message();
        }
        else {
            this.suggestionBlock.innerHTML = this._apiErrorMessage();
        }
        this._showSuggestionBlock();
        return;
    }

    this._parseSuggestionList(request.responseText);

    if (this.suggestions.length == 0) {
        this.suggestionBlock.innerHTML = '';
        this._hideSuggestionBlock();
        return;
    }

    var suggestions_text = '';
    for (var i=0; i < this.suggestions.length; i++) {
        suggestions_text +=
            '<span class="' +
            this.suggestionClass +
            '"><a href="#" onclick="return ' + this.variableName + '.acceptSuggestion(\'' +
            this._escapedSuggestion(this.suggestions[i]) +
            '\')">' +
            this.suggestions[i] +
            '</a>';
        if (i != this.suggestions.length - 1)
            suggestions_text += ',';
        suggestions_text += '</span> ';
    }
    this.suggestionBlock.innerHTML = suggestions_text;
    this._showSuggestionBlock();
}

/**
 * Select the first suggestion and update the edit field. This method is called if the user
 * presses tab while the suggestion window is displayed
 */
LookaheadWidget.prototype._setFirstMatchingSuggestion = function () {
    if (this.editField.value.length > 0 && this.suggestions.length > 0) {
        this.editField.value = this.suggestions[0];
        this._hideSuggestionBlock();
    }
    return true;
}

/**
 * Size, position, and display the suggestion window
 */
LookaheadWidget.prototype._showSuggestionBlock = function () {
    this.suggestionWindow.style.display = 'block';
    this.suggestionWindow.height = '1px';
    this.suggestionWindow.style.overflow = 'hidden';
    this.suggestionWindow.style.position = 'absolute';

    this.suggestionWindow.style.left = ST.getDocumentX(this.editField,true) + "px";
    this.suggestionWindow.style.top =
        ST.getDocumentY(this.editField,true) +
        this.editField.offsetHeight +
        this.suggestionYOffset + "px";
    this.suggestionWindow.style.width = this.editField.offsetWidth + "px";
    if (this.suggestionBlock.offsetHeight > 200) {
        this.suggestionWindow.style.height = "200px";
    }
    else {
        this.suggestionWindow.style.height = this.suggestionBlock.offsetHeight + 2 + "px";
    }
    this.suggestionWindow.style.overflow = "auto";
}

/**
 * Determine if the suggestion window is being displayed
 *
 * @return bool
 */
LookaheadWidget.prototype._suggestionsDisplayed = function (message) {
    return this.suggestionWindow.offsetHeight != 0;
}

/**
 * Replace tokens in the API URI with the appropriate values
 *
 * @return modified API URI
 */
LookaheadWidget.prototype._tokenReplace = function(command, token, value) {
    if (!this.workspace)
        throw URIError('No workspace to query');

    var re = new RegExp(token);
    if (command.match(re))
        command = command.replace(re, value);

    return command;
}
// BEGIN WorkspaceSupportLookahead.js
/**
 * Abstract class for lookahead widgets whose suggestions are workspace specific (such as page name).
 *
 * @see LookaheadWidget
 * @see ST.extend
 */


/**
 * Constructor
 *
 * @param dialog_window lightbox dialog window
 * @param api API call to retrieve suggestion list
 * @param edit_field_id CSS id for the workspace edit field
 * @param window_class CSS class for the drop down windod which contains the suggestion list
 * @param suggestion_block_class CSS class for the suggestion block
 * @param suggestion_class CSS class for each suggestion
 * @param variable_name JS variable associated with the object
 * @param widget Wikiwyg widget
 */
WorkspaceSupportLookahead = function(dialog_window, api, edit_field_id, window_class, suggestion_block_class, suggestion_class, variable_name, widget) {
	WorkspaceSupportLookahead.baseConstructor.call(
        this,
        dialog_window,
        api,
        edit_field_id,
		window_class,
		suggestion_block_class,
		suggestion_class,
        variable_name
    );
    this.workspace = '';
    this.workspaceWidget = widget;
    this.defaultWorkspace = '';
};

ST.extend(WorkspaceSupportLookahead, LookaheadWidget);

WorkspaceSupportLookahead.prototype.currentWorkspaceSelected = function () {
    var nodes = document.getElementsByName('st-rb-workspace_id');
    for (var i = 0; i < nodes.length; i++)
        if (nodes[i].checked)
            return nodes[i].value == 'current';
    return false;
}

/**
 * Get latest workspace data when control gains focus
 */
WorkspaceSupportLookahead.prototype._gainFocus = function() {
    this.workspace = this.defaultWorkspace;
    if (!this.currentWorkspaceSelected())
        if (this.workspaceWidget && this.workspaceWidget.title_and_id.workspace_id.id)
            this.workspace = this.workspaceWidget.title_and_id.workspace_id.id;

    WorkspaceSupportLookahead.superClass._gainFocus.call(this)
},

/**
 * Message to return when a 404 status code is returned by the API
 * @return Error message in HTML format
 */
WorkspaceSupportLookahead.prototype._error404Message = function() {
    return '<span class="st-suggestion-warning">Workspace "' + this.workspace + '" does not exist on wiki</span>';
}

/**
 * Build the URI for the API call
 * @return URI for API call
 */
WorkspaceSupportLookahead.prototype._apiURI = function() {
    var uri = WorkspaceSupportLookahead.superClass._apiURI.call(this)
    return this._tokenReplace(uri, ':ws', this.workspace);
}
// BEGIN WorkspaceLookahead.js
/**
 * This class implements a workspace lookahead widget.
 *
 * @see LookaheadWidget
 * @see ST.Extend
 */

/**
 * Constructor
 *
 * @param dialog_window lightbox dialog window
 * @param edit_field_id CSS id for the workspace edit field
 * @param window_class CSS class for the drop down windod which contains the
 * suggestion list
 * @param suggestion_block_class CSS class for the suggestion block
 * @param suggestion_class CSS class for each suggestion
 * @param variable_name JS variable associated with the object
 * @param widget Wikiwyg widget
 */
WorkspaceLookahead = function(dialog_window, edit_field_id, window_class, suggestion_block_class, suggestion_class, variable_name, widget) {
    WorkspaceLookahead.baseConstructor.call(
        this,
        dialog_window,
        '/data/workspaces',
        edit_field_id,
        window_class,
        suggestion_block_class,
        suggestion_class,
        variable_name
    );
    this.widget = widget;
    this.setTitleFromId();
    this.perfectMatch = false;
};

ST.extend(WorkspaceLookahead, LookaheadWidget);

/**
 * Update the wikiwyg widget and the workspace edit field with the user selection
 */
WorkspaceLookahead.prototype.acceptSuggestion = function(suggestion) {
    this.activeTransport = null;
    this._hideSuggestionBlock();
    this.widget.title_and_id.workspace_id.id = suggestion;
    this.widget.title_and_id.workspace_id.title = this.getTitleFromName(suggestion);
    this.editField.value = this.widget.title_and_id.workspace_id.title;
    this.previousText = this.widget.title_and_id.workspace_id.title;
    return false;
}

/**
 * Retrieves the title for a workspace name from the suggestion list returned
 * by the API.
 *
 * @param name workspace name
 * @return workspace title
 */
WorkspaceLookahead.prototype.getTitleFromName = function(name) {
    var title = '';
    for (var i=0; i < this.suggestions.length; i++) {
        if (this.suggestions[i].name == name) {
            title = this.suggestions[i].title;
            break;
        }
    }

    return title;
}

/**
 * Message to display when an API error occurs
 * @return Error message in HTML format
 */
WorkspaceLookahead.prototype._apiErrorMessage = function() {
    return '<span class="st-suggestion-warning">Could not retrieve workspace list from wiki</span>';
}

/**
 * Message to return when a 404 status code is returned by the API
 * @return Error message in HTML format
 */
WorkspaceLookahead.prototype._error404Message = function() {
    return this._apiErrorMessage();
}

/**
 * If the user cleared the workspace edit field reset the value to default
 * @return Nothing
 */
WorkspaceLookahead.prototype._editIsEmpty = function () {
    this.widget.title_and_id.workspace_id.id = '';
    this.widget.title_and_id.workspace_id.title = '';
    WorkspaceLookahead.superClass._editIsEmpty.call(this);
}

/**
 * Fetch the list of workspaces that match the user's string
 */
WorkspaceLookahead.prototype._findSuggestions = function () {
    if (this.editField.value.length == 0) {
        this._editIsEmpty();
    }
    else {
        if (this.previousText != this.editField.value) {
            this.previousText = this.editField.value;
            var uri = this._apiURI();
            var id = this.activeId;
            var aj = new Ajax.Request();
            var request = new Ajax.Request (
                uri,
                {
                    method: 'get',
                    requestHeaders: ['Accept','application/json'],
                    onComplete: (function (req) {
                        this.populateSuggestion(req);
                    }).bind(this),
                    onFailure: (function(req, jsonHeader) {
                        // XXX Need an error messaage
                    }).bind(this)
                }
            );
            this.activeTransport = request.transport;
        }
    }
}

/**
 * Since only the id for the workspace is saved with the widget
 * we need to pull the name of the workspace to display to the
 * end user
 * @return Nothing
 */
WorkspaceLookahead.prototype.setTitleFromId = function () {
    var radioName = this.editFieldId + '-rb';
    if (!this.widget.title_and_id.workspace_id.id) {
        ST.setRadioValue(radioName, 'current');
    }
    else {
        ST.setRadioValue(radioName, 'other');
        this.editField.value = this.widget.title_and_id.workspace_id.title;
    }
}

/**
 * Build the title filter for the workspace API call
 * @return Filter clause of the API call
 */
WorkspaceLookahead.prototype._getFilter = function () {
    var filter = this.editField.value;
    filter = filter.replace(/^\s+/,'');
    filter = filter.replace(/ /g, '.*');
    return 'title_filter=\\b'+this.editField.value;
}

/**
 * Parse the API return and build out the suggestion list. The suggestion
 * list is cleared if only one suggestion is returned and it matches what the
 * user has entered. This prevents the lookahead component from displaying the
 * single suggestion in the dropdown list.
 */
WorkspaceLookahead.prototype._parseSuggestionList = function(suggestions_text) {
    this.suggestions = [];
    var text = trim(suggestions_text);
    if (text.length != 0)
        this.suggestions = JSON.parse(text);

    var re = new RegExp('^'+this.editField.value+'$', 'i');
    if (this.suggestions.length == 1 && this.suggestions[0].title.match(re)) {
        this.widget.title_and_id.workspace_id.id = this.suggestions[0].name;
        this.suggestions.pop();
        this.perfectMatch = true;
    }
    else
        this.perfectMatch = false;
}

/**
 * Called by the AJAX request. Parse the return from the AJAX call and display
 * the suggestion window if required.
 */
WorkspaceLookahead.prototype.populateSuggestion = function(request) {
    if (!this.isValidTransport(request))
        return;

    if (request.status != 200) {
        if (request.status == 404) {
            this.suggestionBlock.innerHTML = this._error404Message();
        }
        else {
            this.suggestionBlock.innerHTML = this._apiErrorMessage();
        }
        this._showSuggestionBlock();
        return;
    }

    this._parseSuggestionList(request.responseText);
    if (!this.hasFocus) {
        this.activeTransport = null;
        return;
    }

    if (this.suggestions.length == 0) {
        if (!this.perfectMatch) {
            this.widget.title_and_id.workspace_id.id = this.editField.value;
            this.widget.title_and_id.workspace_id.title = this.editField.value;
        }
        this.suggestionBlock.innerHTML = '';
        this._hideSuggestionBlock();
        return;
    }

    var suggestions_text = '';
    for (var i=0; i < this.suggestions.length; i++) {
        suggestions_text +=
            '<span class="' +
            this.suggestionClass +
            '"><a href="#" onclick="return ' + this.variableName + '.acceptSuggestion(\'' +
            this._escapedSuggestion(this.suggestions[i].name) +
            '\')">' +
            this.suggestions[i].title + ' (' + this.suggestions[i].name + ')' +
            '</a>';
        if (i != this.suggestions.length - 1)
            suggestions_text += ',';
        suggestions_text += '</span> ';
    }

    if (this.suggestionBlock == null)
        this._createSuggestionBlock();

    this.suggestionBlock.innerHTML = suggestions_text;

    this._showSuggestionBlock();
}

/**
 * If the user types in the workspace field then we automatically select the 'custom' radio button
 */
WorkspaceLookahead.prototype._keyHandler = function (event) {
    var radioName = this.editFieldId + '-rb';
    ST.setRadioValue(radioName, 'other');
    WorkspaceLookahead.superClass._keyHandler.call(this, event);
}

/**
 * Selects the first available suggestion. Called when the user presses tab and
 * the suggestion window is visible.
 * @return true
 */
WorkspaceLookahead.prototype._setFirstMatchingSuggestion = function () {
    if (this.editField.value.length > 0 && this.suggestions.length > 0) {
        this.acceptSuggestion(this.suggestions[0].name);
    }
    return true;
}

WorkspaceLookahead.prototype.isValidTransport = function(request) {
    if ((this.activeTransport != null && request != this.activeTransport))
        return false;
    else
        return true;
}

/**
 * We need to override the default handling to capture the last call so we can update
 * the ID if appropriate
 */
WorkspaceLookahead.prototype._loseFocus = function() {
    if (this.hasFocus && !this.mouseInSuggestion) {
        this.hasFocus = false;
        this._deleteSuggestionWindow();
//        this.activeTransport = null;
    }
}
// BEGIN PageNameLookahead.js
/**
 * This class handles look ahead for page names. The class supports specifying a workspace
 * will pull page names from that workspace.
 */

// namespace placeholder
if (typeof ST == 'undefined') {
    ST = {};
}

ST.lookaheadCache = { workspacePageCount: {} };

/**
 * Constructor
 *
 * @param dialog_window lightbox dialog window
 * @param edit_field_id CSS id for the input tag
 * @param window_class CSS class to apply to the div for the suggestion window
 * @param suggestion_block_class CSS class for the div that holds the suggestion list
 * @param suggestion_class CSS class for a suggestion
 * @param variable_name name of JS variable that holds the object
 * @param workspace_id CSS id for the workspace input tag
 */
PageNameLookahead = function(dialog_window, edit_field_id, window_class, suggestion_block_class, suggestion_class, variable_name, workspace_id) {
    PageNameLookahead.baseConstructor.call(
        this,
        dialog_window,
        '/data/workspaces/:ws/pages',
        edit_field_id,
        window_class,
        suggestion_block_class,
        suggestion_class,
        variable_name,
        workspace_id
    );

    this.lastEditLength = 0;
    this.minEditLengthForLookup = 1;
    var radioName = this.editFieldId + '-rb';
    this.setMinEditLengthForLookup();

    if (this.editField.value.length == 0)
        ST.setRadioValue(radioName, 'current');
    else
        ST.setRadioValue(radioName, 'other');
};

ST.extend(PageNameLookahead, WorkspaceSupportLookahead);

/**
 * Override the _get_order method to return an empty string; the sections API call returns
 * items in page order by default.
 *
 * @return blank string
 */
PageNameLookahead.prototype._apiErrorMessage = function() {
    return '<span class="st-suggestion-warning">Could not retrieve page list from wiki</span>';
}

PageNameLookahead.prototype.getPageCountForWorkspace = function() {
    if (this.workspace == '')
        return 1;
    if (this.workspace in ST.lookaheadCache.workspacePageCount)
        return ST.lookaheadCache.workspacePageCount[this.workspace];

    var uri = '/data/workspaces/'+this.workspace+'/tags/recent changes';

    var request = new Ajax.Request (
        uri,
        {
            method: 'get',
            asynchronous: false,
            requestHeaders: ['Accept','application/json']
        }
    );

    if (request.transport.status == 200) {
        var details = JSON.parse(request.transport.responseText);
        ST.lookaheadCache.workspacePageCount[this.workspace] = details.page_count;
        return details.page_count;
    }

    return 0;
}

PageNameLookahead.prototype.setMinEditLengthForLookup = function() {
    var pageCount = this.getPageCountForWorkspace();
    if (pageCount < 5000)
        this.minEditLengthForLookup = 1;
    else if (pageCount < 10000)
        this.minEditLengthForLookup = 2;
    else
        this.minEditLengthForLookup = 3;
}

/**
 * We auto-select the current page radio button when the user clears the page title field
 */
PageNameLookahead.prototype._editIsEmpty = function () {
    PageNameLookahead.superClass._editIsEmpty.call(this);
}

/**
 * If the user types in the page title field then we automatically select the 'custom' radio button
 */
PageNameLookahead.prototype._keyHandler = function (event) {
    var radioName = this.editFieldId + '-rb';
    ST.setRadioValue(radioName, 'other');
    PageNameLookahead.superClass._keyHandler.call(this, event);
}

/**
 * We only want to handle a lookahead if the user has typed a minimum number of characters
 */
PageNameLookahead.prototype._findSuggestions = function () {
    if (this.editField.value.length == 0 || this.editField.value.length >= this.minEditLengthForLookup) {
        if (this.lastEditLength > 0 && this.lastEditLength < this.minEditLengthForLookup)
            this.suggestionBlock.innerHTML = '<span class="st-lookahead-info">Searching for matching pages...</span>';
        PageNameLookahead.superClass._findSuggestions.call(this);
    }
    else {
        this.suggestionBlock.innerHTML = '<span class="st-lookahead-info">Page title lookahead requires at least ' + this.minEditLengthForLookup + ' characters</span>';
        this._showSuggestionBlock();
    }
    this.lastEditLength = this.editField.value.length;
}

/**
 * Get latest workspace data when control gains focus
 */
PageNameLookahead.prototype._gainFocus = function() {
    PageNameLookahead.superClass._gainFocus.call(this)
    this.setMinEditLengthForLookup();
}
// BEGIN TagLookahead.js
/**
 * Class to implement a tag name lookahead widget
 *
 * @see WorkspaceSupportLookahead
 * @see ST.extend
 */


/**
 * Constructor
 *
 * @param dialog_window lightbox dialog window
 * @param edit_field_id CSS id for the input tag
 * @param window_class CSS class to apply to the div for the suggestion window
 * @param suggestion_block_class CSS class for the div that holds the suggestion list
 * @param suggestion_class CSS class for a suggestion
 * @param variable_name name of JS variable that holds the object
 * @param workspace_id CSS id for the workspace edit field
 *
 */
TagLookahead = function(dialog_window, edit_field_id, window_class, suggestion_block_class, suggestion_class, variable_name, workspace_id) {
	TagLookahead.baseConstructor.call(
        this,
        dialog_window,
        '/data/workspaces/:ws/tags',
        edit_field_id,
		window_class,
		suggestion_block_class,
		suggestion_class,
		variable_name,
        workspace_id
    );
};

ST.extend(TagLookahead, WorkspaceSupportLookahead);

/**
 * Message to display when an API error occurs
 * @return Error message in HTML format
 */
TagLookahead.prototype._apiErrorMessage = function() {
    return '<span class="st-suggestion-warning">Could not retrieve tag list from wiki</span>';
}

/**
 * Get the sort order for the suggestions
 * @return sort order parameter string for the API call
 */
TagLookahead.prototype._getOrder = function () {
    return 'order=weighted';
}
// BEGIN WeblogLookahead.js
/**
 * This class handles look ahead for Weblog name fields. This is a tag look ahead with a
 * different filter (tags must end with blog
 *
 * @see TagLookahead
 * @see ST.extend
 */

/**
 * Constructor
 *
 * @param dialog_window lightbox dialog window
 * @param edit_field_id CSS id for the input tag
 * @param window_class CSS class to apply to the div for the suggestion window
 * @param suggestion_block_class CSS class for the div that holds the suggestion list
 * @param suggestion_class CSS class for a suggestion
 * @param variable_name name of JS variable that holds the object
 * @param workspace_id CSS id for the workspace edit field
 *
 */
WeblogLookahead = function(dialog_window, edit_field_id, window_class, suggestion_block_class, suggestion_class, variable_name, workspace_id) {
	WeblogLookahead.baseConstructor.call(
        this,
        dialog_window,
        edit_field_id,
		window_class,
		suggestion_block_class,
		suggestion_class,
		variable_name,
        workspace_id
    );
};

ST.extend(WeblogLookahead, TagLookahead);

/**
 * Constructs the regex used to filter the tag list
 *
 * @return filter criteria string
 */
WeblogLookahead.prototype._getFilter = function () {
    return 'filter=\\b'+this.editField.value+'.*(We)?blog$';
}

/**
 * Messge to display in case of an API error
 *
 * @return html string
 */
WeblogLookahead.prototype._apiErrorMessage = function() {
    return '<span class="st-suggestion-warning">Could not retrieve weblog list from wiki</span>';
}
// BEGIN PageNameSupportLookahead.js
/**
 * This class is a base class for all look ahead widgets that pull suggestions from a specific
 * wiki page. The class supports specifying workspace and page name input fields and will use
 * that information when pulling suggestions.
 *
 * You can set the default workspace id using the workspace data member
 *
 * You can set the default page name using the pagename data member
 *
 * @see LookaheadWidget
 * @see ST.extend
 */

/**
 * Constructor
 *
 * @param dialog_window lightbox dialog window
 * @param edit_field_id CSS id for the input tag
 * @param window_class CSS class to apply to the div for the suggestion window
 * @param suggestion_block_class CSS class for the div that holds the suggestion list
 * @param suggestion_class CSS class for a suggestion
 * @param variable_name name of JS variable that holds the object
 * @param workspace_widget Wikiwyg Workspace widget object
 * @param pagename_id CSS id for the page name input tag
 */
PageNameSupportLookahead = function(dialog_window, api, edit_field_id, window_class, suggestion_block_class, suggestion_class, variable_name, workspace_widget, pagename_id) {
	PageNameSupportLookahead.baseConstructor.call(
        this,
        dialog_window,
        api,
        edit_field_id,
        window_class,
        suggestion_block_class,
        suggestion_class,
        variable_name
    );
    this.workspace = '';
    this.workspaceWidget = workspace_widget;
    this.defaultWorkspace = '';

    this.pagename = '';
    this.pagenameId = pagename_id;
    this.defaultPagename = '';
};

ST.extend(PageNameSupportLookahead, LookaheadWidget);

PageNameSupportLookahead.prototype.currentWorkspaceSelected = function () {
    var nodes = document.getElementsByName('st-rb-workspace_id');
    for (var i = 0; i < nodes.length; i++)
        if (nodes[i].checked)
            return nodes[i].value == 'current';
    return false;
}

PageNameSupportLookahead.prototype.currentPageSelected = function () {
    var nodes = document.getElementsByName('st-rb-page_title');
    for (var i = 0; i < nodes.length; i++)
        if (nodes[i].checked)
            return nodes[i].value == 'current';
    return false;
}

/**
 * When the edit field gains focus update the workspace and page name fields
 * from the values in the form
 */
PageNameSupportLookahead.prototype._gainFocus = function() {
	try {
		this.workspace = this.defaultWorkspace;
	    if (!this.currentWorkspaceSelected())
	        if (this.workspaceWidget && this.workspaceWidget.title_and_id.workspace_id.id)
	            this.workspace = this.workspaceWidget.title_and_id.workspace_id.id;

		this.pagename = this.defaultPagename;
	    if (!this.currentPageSelected())
			if (this.pagenameId && trim($(this.pagenameId).value))
				this.pagename = trim($(this.pagenameId).value);
	}
	catch(e) {
		this.pagename = '';
		this.workspace = '';
	}
    PageNameSupportLookahead.superClass._gainFocus.call(this)
},

/**
 * Get the error message to display when the API returns a 404 error
 * @return error message in HTML format
 */
PageNameSupportLookahead.prototype._error404Message = function() {
    return '<span class="st-suggestion-warning">Workspace "' + this.workspace + '" or page"' + this.pagename + '" does not exist on wiki</span>';
}

/**
 * Build the URI for the API call
 * @return URI
 */
PageNameSupportLookahead.prototype._apiURI = function() {
    var uri = PageNameSupportLookahead.superClass._apiURI.call(this)
    uri = this._tokenReplace(uri, ':ws', this.workspace);
    return this._tokenReplace(uri, ':pname', this.pagename);
}
// BEGIN PageSectionLookahead.js
/**
 * This class handles look ahead for page sections. The class supports specifying workspace
 * and page edit fields and will use those values when pulling page sections.
 *
 * @see PageNameSupportLookahead
 * @see ST.extend
 */

/**
 * Constructor
 *
 * @param dialog_window lightbox dialog window
 * @param edit_field_id CSS id for the input tag
 * @param window_class CSS class to apply to the div for the suggestion window
 * @param suggestion_block_class CSS class for the div that holds the suggestion list
 * @param suggestion_class CSS class for a suggestion
 * @param variable_name name of JS variable that holds the object
 * @param workspace_id CSS id for the workspace input tag
 * @param pagename_id CSS id for the page name input tag
 */
PageSectionLookahead = function(dialog_window, edit_field_id, window_class, suggestion_block_class, suggestion_class, variable_name, workspace_id, pagename_id) {
	PageSectionLookahead.baseConstructor.call(
        this,
        dialog_window,
        '/data/workspaces/:ws/pages/:pname/sections',
        edit_field_id,
		window_class,
		suggestion_block_class,
		suggestion_class,
        variable_name,
        workspace_id,
        pagename_id
    );
};

ST.extend(PageSectionLookahead, PageNameSupportLookahead);

/**
 * Messge to display in case of an API error
 *
 * @return html string
 */
PageSectionLookahead.prototype._apiErrorMessage = function() {
    return '<span class="st-suggestion-warning">Could not retrieve section list from wiki</span>';
}

/**
 * Override the _getOrder method to return an empty string; the sections API call returns
 * items in page order by default.
 *
 * @return blank string
 */
PageSectionLookahead.prototype._getOrder = function () {
    return '';
}
// BEGIN PageAttachmentLookahead.js
/**
 * This class handles look ahead for page attachments. The class supports specifying workspace
 * and page edit fields and will use those values when pulling attachments.
 *
 * @see PageNameSupportLookahead
 * @see ST.extend
 */

/**
 * Constructor
 *
 * @param dialog_window lightbox dialog window
 * @param edit_field_id CSS id for the input tag
 * @param window_class CSS class to apply to the div for the suggestion window
 * @param suggestion_block_class CSS class for the div that holds the suggestion list
 * @param suggestion_class CSS class for a suggestion
 * @param variable_name name of JS variable that holds the object
 * @param workspace_id CSS id for the workspace input tag
 * @param pagename_id CSS id for the page name input tag
 */
PageAttachmentLookahead = function(dialog_window, edit_field_id, window_class, suggestion_block_class, suggestion_class, variable_name, workspace_id, pagename_id) {
	PageAttachmentLookahead.baseConstructor.call(
        this,
        dialog_window,
        '/data/workspaces/:ws/pages/:pname/attachments',
        edit_field_id,
		window_class,
		suggestion_block_class,
		suggestion_class,
        variable_name,
        workspace_id,
        pagename_id
    );
};

ST.extend(PageAttachmentLookahead, PageNameSupportLookahead);

/**
 * Messge to display in case of an API error
 *
 * @return html string
 */
PageAttachmentLookahead.prototype._apiErrorMessage = function() {
    return '<span class="st-suggestion-warning">Could not retrieve attachment list from wiki</span>';
}
// BEGIN startup.js

if (Socialtext.box_javascript) {
    createPageObject();
    window.Attachments = new ST.Attachments ();
    window.Tags = new ST.Tags ();
    window.TagQueue = new ST.TagQueue ();
    window.Watchlist = new ST.Watchlist();
    Event.observe(window, 'load',
        function() {
            window.Watchlist._loadInterface('st-watchlist-indicator');
        }
    );
}

window.NavBar = new ST.NavBar ();

Event.observe(window, 'load', function() {
    var toggles = document.getElementsByClassName('watchlist-list-toggle');
    for (var ii = 0; ii < toggles.length; ii++) {
        var toggle = toggles[ii];
        var page_id = toggle.getAttribute('alt');
        var wl = new ST.Watchlist();
        wl.page_id = page_id;
        wl._loadInterface(toggle);
    }
});
// BEGIN ../../../js-modules/Wikiwyg-copy/lib/Wikiwyg.js
/*==============================================================================
Wikiwyg - Turn any HTML div into a wikitext /and/ wysiwyg edit area.

DESCRIPTION:

Wikiwyg is a Javascript library that can be easily integrated into any
wiki or blog software. It offers the user multiple ways to edit/view a
piece of content: Wysiwyg, Wikitext, Raw-HTML and Preview.

The library is easy to use, completely object oriented, configurable and
extendable.

See the Wikiwyg documentation for details.

AUTHORS:

    Ingy döt Net <ingy@cpan.org>
    Casey West <casey@geeknest.com>
    Chris Dent <cdent@burningchrome.com>
    Matt Liggett <mml@pobox.com>
    Ryan King <rking@panoptic.com>
    Dave Rolsky <autarch@urth.org>
    Kang-min Liu <gugod@gugod.org>

COPYRIGHT:

    Copyright (c) 2005 Socialtext Corporation 
    655 High Street
    Palo Alto, CA 94301 U.S.A.
    All rights reserved.

Wikiwyg is free software. 

This library is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or (at
your option) any later version.

This library 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 Lesser
General Public License for more details.

    http://www.gnu.org/copyleft/lesser.txt

 =============================================================================*/

/*==============================================================================
Subclass - this can be used to create new classes
 =============================================================================*/
Subclass = function(class_name, base_class_name) {
    if (!class_name) throw("Can't create a subclass without a name");

    var parts = class_name.split('.');
    var subclass = window;
    for (var i = 0; i < parts.length; i++) {
        if (! subclass[parts[i]])
            subclass[parts[i]] = function() {};
        subclass = subclass[parts[i]];
    }

    if (base_class_name) {
        var baseclass = eval('new ' + base_class_name + '()');
        subclass.prototype = baseclass;
        subclass.prototype.baseclass = baseclass;
    }

    subclass.prototype.classname = class_name;
    return subclass.prototype;
}

/*==============================================================================
Wikiwyg - Primary Wikiwyg base class
 =============================================================================*/

// Constructor and class methods
proto = new Subclass('Wikiwyg');

Wikiwyg.VERSION = '0.13';

// Browser support properties
Wikiwyg.ua = navigator.userAgent.toLowerCase();
Wikiwyg.is_ie = (
    Wikiwyg.ua.indexOf("msie") != -1 &&
    Wikiwyg.ua.indexOf("opera") == -1 && 
    Wikiwyg.ua.indexOf("webtv") == -1
);
Wikiwyg.is_gecko = (
    Wikiwyg.ua.indexOf('gecko') != -1 &&
    Wikiwyg.ua.indexOf('safari') == -1 &&
    Wikiwyg.ua.indexOf('konqueror') == -1
);
Wikiwyg.is_safari = (
    Wikiwyg.ua.indexOf('safari') != -1
);
Wikiwyg.is_opera = (
    Wikiwyg.ua.indexOf('opera') != -1
);
Wikiwyg.is_konqueror = (
    Wikiwyg.ua.indexOf("konqueror") != -1
)
Wikiwyg.browserIsSupported = (
    Wikiwyg.is_gecko ||
    Wikiwyg.is_ie
);

// Wikiwyg environment setup public methods
proto.createWikiwygArea = function(div, config) {
    this.set_config(config);
    this.initializeObject(div, config);
};

proto.default_config = {
    javascriptLocation: 'lib/',
    doubleClickToEdit: false,
    toolbarClass: 'Wikiwyg.Toolbar',
    firstMode: null,
    modeClasses: [
        'Wikiwyg.Wysiwyg',
        'Wikiwyg.Wikitext',
        'Wikiwyg.Preview'
    ]
};

proto.initializeObject = function(div, config) {
    if (! Wikiwyg.browserIsSupported) return;
    if (this.enabled) return;
    this.enabled = true;
    this.div = div;
    this.divHeight = this.div.offsetHeight;
    if (!config) config = {};

    this.set_config(config);

    this.mode_objects = {};
    for (var i = 0; i < this.config.modeClasses.length; i++) {
        var class_name = this.config.modeClasses[i];
        var mode_object = eval('new ' + class_name + '()');
        mode_object.wikiwyg = this;
        mode_object.set_config(config[mode_object.classtype]);
        mode_object.initializeObject();
        this.mode_objects[class_name] = mode_object;
    }
    var firstMode = this.config.firstMode
        ? this.config.firstMode
        : this.config.modeClasses[0];
    this.setFirstModeByName(firstMode);

    if (this.config.toolbarClass) {
        var class_name = this.config.toolbarClass;
        this.toolbarObject = eval('new ' + class_name + '()');
        this.toolbarObject.wikiwyg = this;
        this.toolbarObject.set_config(config.toolbar);
        this.toolbarObject.initializeObject();
        this.placeToolbar(this.toolbarObject.div);
    }

    // These objects must be _created_ before the toolbar is created
    // but _inserted_ after.
    for (var i = 0; i < this.config.modeClasses.length; i++) {
        var mode_class = this.config.modeClasses[i];
        var mode_object = this.modeByName(mode_class);
        this.insert_div_before(mode_object.div);
    }

    if (this.config.doubleClickToEdit) {
        var self = this;
        this.div.ondblclick = function() { self.editMode() }; 
    }
}

// Wikiwyg environment setup private methods
proto.set_config = function(user_config) {
    var new_config = {};
    var keys = [];
    for (var key in this.default_config) {
        keys.push(key);
    }
    if (user_config != null) {
        for (var key in user_config) {
            keys.push(key);
        }
    }
    for (var ii = 0; ii < keys.length; ii++) {
        var key = keys[ii];
        if (user_config != null && user_config[key] != null) {
            new_config[key] = user_config[key];
        } else if (this.default_config[key] != null) {
            new_config[key] = this.default_config[key];
        } else if (this[key] != null) {
            new_config[key] = this[key];
        }
    }
    this.config = new_config;
}

proto.insert_div_before = function(div) {
    div.style.display = 'none';
    if (! div.iframe_hack) {
        this.div.parentNode.insertBefore(div, this.div);
    }
}

// Wikiwyg actions - public methods
proto.saveChanges = function() {
    alert('Wikiwyg.prototype.saveChanges not subclassed');
}

proto.editMode = function() { // See IE, below
    this.current_mode = this.first_mode;
    this.current_mode.fromHtml(this.div.innerHTML);
    this.toolbarObject.resetModeSelector();
    this.current_mode.enableThis();
}

proto.displayMode = function() {
    for (var i = 0; i < this.config.modeClasses.length; i++) {
        var mode_class = this.config.modeClasses[i];
        var mode_object = this.modeByName(mode_class);
        mode_object.disableThis();
    }
    this.toolbarObject.disableThis();
    this.div.style.display = 'block';
    this.divHeight = this.div.offsetHeight;
}

proto.switchMode = function(new_mode_key) {
    var new_mode = this.modeByName(new_mode_key);
    var old_mode = this.current_mode;
    var self = this;
    new_mode.enableStarted();
    old_mode.disableStarted();
    old_mode.toHtml(
        function(html) {
            self.previous_mode = old_mode;
            new_mode.fromHtml(html);
            old_mode.disableThis();
            new_mode.enableThis();
            new_mode.enableFinished();
            old_mode.disableFinished();
            self.current_mode = new_mode;
        }
    );
}

proto.modeByName = function(mode_name) {
    return this.mode_objects[mode_name]
}

proto.cancelEdit = function() {
    this.displayMode();
}

proto.fromHtml = function(html) {
    this.div.innerHTML = html;
}

proto.placeToolbar = function(div) {
    this.insert_div_before(div);
}

proto.setFirstModeByName = function(mode_name) {
    if (!this.modeByName(mode_name))
        die('No mode named ' + mode_name);
    this.first_mode = this.modeByName(mode_name);
}

// Class level helper methods
Wikiwyg.unique_id_base = 0;
Wikiwyg.createUniqueId = function() {
    return 'wikiwyg_' + Wikiwyg.unique_id_base++;
}

// This method is deprecated. Use Ajax.get and Ajax.post.
Wikiwyg.liveUpdate = function(method, url, query, callback) {
    if (method == 'GET') {
        return Ajax.get(
            url + '?' + query,
            callback
        );
    }
    if (method == 'POST') {
        return Ajax.post(
            url,
            query,
            callback
        );
    }
    throw("Bad method: " + method + " passed to Wikiwyg.liveUpdate");
}

Wikiwyg.htmlUnescape = function(escaped) {
    // thanks to Randal Schwartz for the correct solution to this one
    // (from CGI.pm, CGI::unescapeHTML())
    return escaped.replace(
        /&(.*?);/g,
        function(dummy,s) {
            return s.match(/^amp$/i) ? '&' :
                s.match(/^quot$/i) ? '"' :
                s.match(/^gt$/i) ? '>' :
                s.match(/^lt$/i) ? '<' :
                s.match(/^#(\d+)$/) ?
                    String.fromCharCode(s.replace(/#/,'')) :
                s.match(/^#x([0-9a-f]+)$/i) ?
                    String.fromCharCode(s.replace(/#/,'0')) :
                s
        }
    );
}

Wikiwyg.showById = function(id) {
    document.getElementById(id).style.visibility = 'inherit';
}

Wikiwyg.hideById = function(id) {
    document.getElementById(id).style.visibility = 'hidden';
}


Wikiwyg.changeLinksMatching = function(attribute, pattern, func) {
    var links = document.getElementsByTagName('a');
    for (var i = 0; i < links.length; i++) {
        var link = links[i];
        var my_attribute = link.getAttribute(attribute);
        if (my_attribute && my_attribute.match(pattern)) {
            link.setAttribute('href', '#');
            link.onclick = func;
        }
    }
}

Wikiwyg.createElementWithAttrs = function(element, attrs, doc) {
    if (doc == null)
        doc = document;
    return Wikiwyg.create_element_with_attrs(element, attrs, doc);
}

Wikiwyg.create_element_with_attrs = function(element, attrs, doc) {
    var elem = doc.createElement(element);
    for (name in attrs)
        elem.setAttribute(name, attrs[name]);
    return elem;
}

die = function(e) { // See IE, below
    throw(e);
}

String.prototype.times = function(n) {
    return n ? this + this.times(n-1) : "";
}

String.prototype.ucFirst = function () {
    return this.substr(0,1).toUpperCase() + this.substr(1,this.length);
}

/*==============================================================================
Base class for Wikiwyg classes
 =============================================================================*/
proto = new Subclass('Wikiwyg.Base');

proto.set_config = function(user_config) {
    if (Wikiwyg.Widgets && this.setup_widgets)
        this.setup_widgets();

    for (var key in this.config) {
        if (user_config != null && user_config[key] != null)
            this.merge_config(key, user_config[key]);
        else if (this[key] != null)
            this.merge_config(key, this[key]);
        else if (this.wikiwyg.config[key] != null)
            this.merge_config(key, this.wikiwyg.config[key]);
    }
}

proto.merge_config = function(key, value) {
    if (value instanceof Array) {
        this.config[key] = value;
    }
    // cross-browser RegExp object check
    else if (typeof value.test == 'function') {
        this.config[key] = value;
    }
    else if (value instanceof Object) {
        if (!this.config[key])
            this.config[key] = {};
        for (var subkey in value) {
            this.config[key][subkey] = value[subkey];
        }
    }
    else {
        this.config[key] = value;
    }
}

/*==============================================================================
Base class for Wikiwyg Mode classes
 =============================================================================*/
proto = new Subclass('Wikiwyg.Mode', 'Wikiwyg.Base');

proto.enableThis = function() {
    this.div.style.display = 'block';
    this.display_unsupported_toolbar_buttons('none');
    this.wikiwyg.toolbarObject.enableThis();
    this.wikiwyg.div.style.display = 'none';
}

proto.display_unsupported_toolbar_buttons = function(display) {
    if (!this.config) return;
    var disabled = this.config.disabledToolbarButtons;
    if (!disabled || disabled.length < 1) return;

    var toolbar_div = this.wikiwyg.toolbarObject.div;
    var toolbar_buttons = toolbar_div.childNodes;
    for (var i in disabled) {
        var action = disabled[i];

        for (var i in toolbar_buttons) {
            var button = toolbar_buttons[i];
            var src = button.src;
            if (!src) continue;

            if (src.match(action)) {
                button.style.display = display;
                break;
            }
        }
    }
}

proto.enableStarted = function() {}
proto.enableFinished = function() {}
proto.disableStarted = function() {}
proto.disableFinished = function() {}

proto.disableThis = function() {
    this.display_unsupported_toolbar_buttons('inline');
    this.div.style.display = 'none';
}

proto.process_command = function(command) {
    if (this['do_' + command])
        this['do_' + command](command);
}

proto.enable_keybindings = function() { // See IE
    if (!this.key_press_function) {
        this.key_press_function = this.get_key_press_function();
        this.get_keybinding_area().addEventListener(
            'keypress', this.key_press_function, true
        );
    }
}

proto.get_key_press_function = function() {
    var self = this;
    return function(e) {
        if (! e.ctrlKey) return;
        var key = String.fromCharCode(e.charCode).toLowerCase();
        var command = '';
        switch (key) {
            case 'b': command = 'bold'; break;
            case 'i': command = 'italic'; break;
            case 'u': command = 'underline'; break;
            case 'd': command = 'strike'; break;
            case 'l': command = 'link'; break;
        };

        if (command) {
            e.preventDefault();
            e.stopPropagation();
            self.process_command(command);
        }
    };
}

proto.get_edit_height = function() {
    var height = parseInt(
        this.wikiwyg.divHeight *
        this.config.editHeightAdjustment
    );
    var min = this.config.editHeightMinimum;
    return height < min
        ? min
        : height;
}

proto.setHeightOf = function(elem) {
    elem.height = this.get_edit_height() + 'px';
}

proto.sanitize_dom = function(dom) { // See IE, below
    this.element_transforms(dom, {
        del: {
            name: 'strike',
            attr: { }
        },
        strong: {
            name: 'span',
            attr: { style: 'font-weight: bold;' }
        },
        em: {
            name: 'span',
            attr: { style: 'font-style: italic;' }
        }
    });
}

proto.element_transforms = function(dom, el_transforms) {
    for (var orig in el_transforms) {
        var elems = dom.getElementsByTagName(orig);
        var elems_arr = [];
        for (var ii = 0; ii < elems.length; ii++) {
            elems_arr.push(elems[ii])
        }

        while ( elems_arr.length > 0 ) {
            var elem = elems_arr.shift();
            var replace = el_transforms[orig];
            var new_el =
              Wikiwyg.createElementWithAttrs(replace.name, replace.attr);
            new_el.innerHTML = elem.innerHTML;
            elem.parentNode.replaceChild(new_el, elem);
        }
    }
}

/*==============================================================================
Support for Internet Explorer in Wikiwyg
 =============================================================================*/
if (Wikiwyg.is_ie) {

die = function(e) {
    alert(e);
    throw(e);
}

proto = Wikiwyg.Mode.prototype;

proto.enable_keybindings = function() {}

proto.sanitize_dom = function(dom) {
    this.element_transforms(dom, {
        del: {
            name: 'strike',
            attr: { }
        }
    });
}

} // end of global if statement for IE overrides
// BEGIN ../../../js-modules/Wikiwyg-copy/lib/Wikiwyg/Toolbar.js
/*==============================================================================
This Wikiwyg class provides toolbar support

COPYRIGHT:

    Copyright (c) 2005 Socialtext Corporation 
    655 High Street
    Palo Alto, CA 94301 U.S.A.
    All rights reserved.

Wikiwyg is free software. 

This library is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or (at
your option) any later version.

This library 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 Lesser
General Public License for more details.

    http://www.gnu.org/copyleft/lesser.txt

 =============================================================================*/

proto = new Subclass('Wikiwyg.Toolbar', 'Wikiwyg.Base');
proto.classtype = 'toolbar';

proto.config = {
    divId: null,
    imagesLocation: 'images/',
    imagesExtension: '.gif',
    selectorWidth: '100px',
    controlLayout: [
        'save', 'cancel', 'mode_selector', '/',
        // 'selector',
        'h1', 'h2', 'h3', 'h4', 'p', 'pre', '|',
        'bold', 'italic', 'underline', 'strike', '|',
        'link', 'hr', '|',
        'ordered', 'unordered', '|',
        'indent', 'outdent', '|',
        'table', '|',
        'help'
    ],
    styleSelector: [
        'label', 'p', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'pre'
    ],
    controlLabels: {
        save: 'Save',
        cancel: 'Cancel',
        bold: 'Bold (Ctrl+b)',
        italic: 'Italic (Ctrl+i)',
        underline: 'Underline (Ctrl+u)',
        strike: 'Strike Through (Ctrl+d)',
        hr: 'Horizontal Rule',
        ordered: 'Numbered List',
        unordered: 'Bulleted List',
        indent: 'More Indented',
        outdent: 'Less Indented',
        help: 'About Wikiwyg',
        label: '[Style]',
        p: 'Normal Text',
        pre: 'Preformatted',
        h1: 'Heading 1',
        h2: 'Heading 2',
        h3: 'Heading 3',
        h4: 'Heading 4',
        h5: 'Heading 5',
        h6: 'Heading 6',
        link: 'Create Link',
        unlink: 'Remove Linkedness',
        table: 'Create Table'
    }
};

proto.initializeObject = function() {
    if (this.config.divId) {
        this.div = document.getElementById(this.config.divId);
    }
    else {
        this.div = Wikiwyg.createElementWithAttrs(
            'div', {
                'class': 'wikiwyg_toolbar',
                id: 'wikiwyg_toolbar'
            }
        );
    }

    var config = this.config;
    for (var i = 0; i < config.controlLayout.length; i++) {
        var action = config.controlLayout[i];
        var label = config.controlLabels[action];
        if (action == 'save')
            this.addControlItem(label, 'saveChanges');
        else if (action == 'cancel')
            this.addControlItem(label, 'cancelEdit');
        else if (action == 'mode_selector')
            this.addModeSelector();
        else if (action == 'selector')
            this.add_styles();
        else if (action == 'help')
            this.add_help_button(action, label);
        else if (action == '|')
            this.add_separator();
        else if (action == '/')
            this.add_break();
        else
            this.add_button(action, label);
    }
}

proto.enableThis = function() {
    this.div.style.display = 'block';
}

proto.disableThis = function() {
    this.div.style.display = 'none';
}

proto.setup_widgets_pulldown = function(title) {
    var widgets_list = Wikiwyg.Widgets.widgets;
    var widget_data = Wikiwyg.Widgets.widget;

    var tb = eval(this.classname).prototype;

    tb.styleSelector = [ 'label' ];
    for (var i = 0; i < widgets_list.length; i++) {
        var widget = widgets_list[i];
        tb.styleSelector.push('widget_' + widget);
    }
    tb.controlLayout.push('selector');

    tb.controlLabels.label = title;
    for (var i = 0; i < widgets_list.length; i++) {
        var widget = widgets_list[i];
        tb.controlLabels['widget_' + widget] = widget_data[widget].label;
    }
}

proto.make_button = function(type, label) {
    var base = this.config.imagesLocation;
    var ext = this.config.imagesExtension;
    return Wikiwyg.createElementWithAttrs(
        'img', {
            'class': 'wikiwyg_button',
            onmouseup: "this.style.border='1px outset';",
            onmouseover: "this.style.border='1px outset';",
            onmouseout:
                "this.style.borderColor=this.style.backgroundColor;" +
                "this.style.borderStyle='solid';",
            onmousedown:     "this.style.border='1px inset';",
            alt: label,
            title: label,
            src: base + type + ext
        }
    );
}

proto.add_button = function(type, label) {
    var img = this.make_button(type, label);
    var self = this;
    img.onclick = function() {
        self.wikiwyg.current_mode.process_command(type);
    };
    this.div.appendChild(img);
}

proto.add_help_button = function(type, label) {
    var img = this.make_button(type, label);
    var a = Wikiwyg.createElementWithAttrs(
        'a', {
            target: 'wikiwyg_button',
            href: 'http://www.wikiwyg.net/about/'
        }
    );
    a.appendChild(img);
    this.div.appendChild(a);
}

proto.add_separator = function() {
    var base = this.config.imagesLocation;
    var ext = this.config.imagesExtension;
    this.div.appendChild(
        Wikiwyg.createElementWithAttrs(
            'img', {
                'class': 'wikiwyg_separator',
                alt: ' | ',
                title: '',
                src: base + 'separator' + ext
            }
        )
    );
}

proto.addControlItem = function(text, method) {
    var span = Wikiwyg.createElementWithAttrs(
        'span', { 'class': 'wikiwyg_control_link' }
    );

    var link = Wikiwyg.createElementWithAttrs(
        'a', { href: '#' }
    );
    link.appendChild(document.createTextNode(text));
    span.appendChild(link);
    
    var self = this;
    link.onclick = function() { eval('self.wikiwyg.' + method + '()'); return false };

    this.div.appendChild(span);
}

proto.resetModeSelector = function() {
    if (this.firstModeRadio) {
        var temp = this.firstModeRadio.onclick;
        this.firstModeRadio.onclick = null;
        this.firstModeRadio.click();
        this.firstModeRadio.onclick = temp;
    }
}

proto.addModeSelector = function() {
    var span = document.createElement('span');

    var radio_name = Wikiwyg.createUniqueId();
    for (var i = 0; i < this.wikiwyg.config.modeClasses.length; i++) {
        var class_name = this.wikiwyg.config.modeClasses[i];
        var mode_object = this.wikiwyg.mode_objects[class_name];
 
        var radio_id = Wikiwyg.createUniqueId();
 
        var checked = i == 0 ? 'checked' : '';
        var radio = Wikiwyg.createElementWithAttrs(
            'input', {
                type: 'radio',
                name: radio_name,
                id: radio_id,
                value: mode_object.classname,
                'checked': checked
            }
        );
        if (!this.firstModeRadio)
            this.firstModeRadio = radio;
 
        var self = this;
        radio.onclick = function() { 
            self.wikiwyg.switchMode(this.value);
        };
 
        var label = Wikiwyg.createElementWithAttrs(
            'label', { 'for': radio_id }
        );
        label.appendChild(document.createTextNode(mode_object.modeDescription));

        span.appendChild(radio);
        span.appendChild(label);
    }
    this.div.appendChild(span);
}

proto.add_break = function() {
    this.div.appendChild(document.createElement('br'));
}

proto.add_styles = function() {
    var options = this.config.styleSelector;
    var labels = this.config.controlLabels;

    this.styleSelect = document.createElement('select');
    this.styleSelect.className = 'wikiwyg_selector';
    if (this.config.selectorWidth)
        this.styleSelect.style.width = this.config.selectorWidth;

    for (var i = 0; i < options.length; i++) {
        value = options[i];
        var option = Wikiwyg.createElementWithAttrs(
            'option', { 'value': value }
        );
        option.appendChild(document.createTextNode(labels[value] || value));
        this.styleSelect.appendChild(option);
    }
    var self = this;
    this.styleSelect.onchange = function() { 
        self.set_style(this.value) 
    };
    this.div.appendChild(this.styleSelect);
}

proto.set_style = function(style_name) {
    var idx = this.styleSelect.selectedIndex;
    // First one is always a label
    if (idx != 0)
        this.wikiwyg.current_mode.process_command(style_name);
    this.styleSelect.selectedIndex = 0;
}
// BEGIN ../../../js-modules/Wikiwyg-copy/lib/Wikiwyg/Preview.js
/*==============================================================================
This Wikiwyg mode supports a preview of current changes

COPYRIGHT:

    Copyright (c) 2005 Socialtext Corporation 
    655 High Street
    Palo Alto, CA 94301 U.S.A.
    All rights reserved.

Wikiwyg is free software. 

This library is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or (at
your option) any later version.

This library 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 Lesser
General Public License for more details.

    http://www.gnu.org/copyleft/lesser.txt

 =============================================================================*/

proto = new Subclass('Wikiwyg.Preview', 'Wikiwyg.Mode');

proto.classtype = 'preview';
proto.modeDescription = 'Preview';

proto.config = {
    divId: null
}

proto.initializeObject = function() {
    if (this.config.divId)
        this.div = document.getElementById(this.config.divId);
    else
        this.div = document.createElement('div');
    // XXX Make this a config option.
    this.div.style.backgroundColor = 'lightyellow';
}

proto.fromHtml = function(html) {
    this.div.innerHTML = html;
}

proto.toHtml = function(func) {
    func(this.div.innerHTML);
}

proto.disableStarted = function() {
    this.wikiwyg.divHeight = this.div.offsetHeight;
}
// BEGIN ../../../js-modules/Wikiwyg-copy/lib/Wikiwyg/Wikitext.js
/*==============================================================================
This Wikiwyg mode supports a textarea editor with toolbar buttons.

COPYRIGHT:

    Copyright (c) 2005 Socialtext Corporation
    655 High Street
    Palo Alto, CA 94301 U.S.A.
    All rights reserved.

Wikiwyg is free software.

This library is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or (at
your option) any later version.

This library 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 Lesser
General Public License for more details.

    http://www.gnu.org/copyleft/lesser.txt

 =============================================================================*/

proto = new Subclass('Wikiwyg.Wikitext', 'Wikiwyg.Mode');
klass = Wikiwyg.Wikitext;

proto.classtype = 'wikitext';
proto.modeDescription = 'Wikitext';

proto.config = {
    textareaId: null,
    supportCamelCaseLinks: false,
    javascriptLocation: null,
    clearRegex: null,
    editHeightMinimum: 10,
    editHeightAdjustment: 1.3,
    markupRules: {
        link: ['bound_phrase', '[', ']'],
        bold: ['bound_phrase', '*', '*'],
        code: ['bound_phrase', '`', '`'],
        italic: ['bound_phrase', '/', '/'],
        underline: ['bound_phrase', '_', '_'],
        strike: ['bound_phrase', '-', '-'],
        p: ['start_lines', ''],
        pre: ['start_lines', '    '],
        h1: ['start_line', '= '],
        h2: ['start_line', '== '],
        h3: ['start_line', '=== '],
        h4: ['start_line', '==== '],
        h5: ['start_line', '===== '],
        h6: ['start_line', '====== '],
        ordered: ['start_lines', '#'],
        unordered: ['start_lines', '*'],
        indent: ['start_lines', '>'],
        hr: ['line_alone', '----'],
        table: ['line_alone', '| A | B | C |\n|   |   |   |\n|   |   |   |'],
        www: ['bound_phrase', '[', ']']
    }
}

proto.initializeObject = function() { // See IE
    this.initialize_object();
}

proto.initialize_object = function() {
    this.div = document.createElement('div');
    this.div.style.position = 'relative';
    if (this.config.textareaId)
        this.textarea = document.getElementById(this.config.textareaId);
    else
        this.textarea = document.createElement('textarea');
    this.textarea.setAttribute('id', 'wikiwyg_wikitext_textarea');
    this.div.appendChild(this.textarea);
    this.area = this.textarea;
    this.clear_inner_text();
}

proto.clear_inner_text = function() {
    if ( Wikiwyg.is_safari ) return;
    var self = this;
    this.area.onclick = function() {
        var inner_text = self.area.value;
        var clear = self.config.clearRegex;
        if (clear && inner_text.match(clear))
            self.area.value = '';
    }
}

proto.enableThis = function() {
    Wikiwyg.Mode.prototype.enableThis.call(this);
    this.textarea.style.width = '99%';
    this.setHeightOfEditor();
    this.enable_keybindings();
}

proto.setHeightOfEditor = function() {
    var config = this.config;
    var adjust = config.editHeightAdjustment;
    var area   = this.textarea;

    if ( Wikiwyg.is_safari) return area.setAttribute('rows', 25);

    var text   = this.getTextArea() ;
    var rows   = text.split(/\n/).length;

    var height = parseInt(rows * adjust);
    if (height < config.editHeightMinimum)
        height = config.editHeightMinimum;

    area.setAttribute('rows', height);
}

proto.toWikitext = function() {
    return this.getTextArea();
}

proto.toHtml = function(func) {
    var wikitext = this.canonicalText();
    this.convertWikitextToHtml(wikitext, func);
}

proto.canonicalText = function() {
    var wikitext = this.getTextArea();
    if (wikitext[wikitext.length - 1] != '\n')
        wikitext += '\n';
    return wikitext;
}

proto.fromHtml = function(html) {
    this.setTextArea('Loading...');
    var self = this;
    this.convertHtmlToWikitext(
        html,
        function(value) { self.setTextArea(value) }
    );
}

proto.getTextArea = function() {
    return this.textarea.value;
}

proto.setTextArea = function(text) {
    this.textarea.value = text;
}

proto.convertWikitextToHtml = function(wikitext, func) {
    alert('Wikitext changes cannot be converted to HTML\nWikiwyg.Wikitext.convertWikitextToHtml is not implemented here');
    func(this.copyhtml);
}

proto.convertHtmlToWikitext = function(html, func) {
    func(this.convert_html_to_wikitext(html));
}

proto.get_keybinding_area = function() {
    return this.textarea;
}

/*==============================================================================
Code to markup wikitext
 =============================================================================*/
Wikiwyg.Wikitext.phrase_end_re = /[\s\.\:\;\,\!\?\(\)\"]/;

proto.find_left = function(t, selection_start, matcher) {
    var substring = t.substr(selection_start - 1, 1);
    var nextstring = t.substr(selection_start - 2, 1);
    if (selection_start == 0)
        return selection_start;
    if (substring.match(matcher)) {
        // special case for word.word
        if ((substring != '.') || (nextstring.match(/\s/)))
            return selection_start;
    }
    return this.find_left(t, selection_start - 1, matcher);
}

proto.find_right = function(t, selection_end, matcher) {
    var substring = t.substr(selection_end, 1);
    var nextstring = t.substr(selection_end + 1, 1);
    if (selection_end >= t.length)
        return selection_end;
    if (substring.match(matcher)) {
        // special case for word.word
        if ((substring != '.') || (nextstring.match(/\s/)))
            return selection_end;
    }
    return this.find_right(t, selection_end + 1, matcher);
}

proto.get_lines = function() {
    var t = this.area;
    var selection_start = t.selectionStart;
    var selection_end = t.selectionEnd;

    if (selection_start == null) {
        selection_start = selection_end;
        if (selection_start == null) {
            return false
        }
        selection_start = selection_end =
            t.value.substr(0, selection_start).replace(/\r/g, '').length;
    }

    var our_text = t.value.replace(/\r/g, '');
    selection = our_text.substr(selection_start,
        selection_end - selection_start);

    selection_start = this.find_right(our_text, selection_start, /[^\r\n]/);
    selection_end = this.find_left(our_text, selection_end, /[^\r\n]/);

    this.selection_start = this.find_left(our_text, selection_start, /[\r\n]/);
    this.selection_end = this.find_right(our_text, selection_end, /[\r\n]/);
    t.setSelectionRange(selection_start, selection_end);
    t.focus();

    this.start = our_text.substr(0,this.selection_start);
    this.sel = our_text.substr(this.selection_start, this.selection_end -
        this.selection_start);
    this.finish = our_text.substr(this.selection_end, our_text.length);

    return true;
}

proto.alarm_on = function() {
    var area = this.area;
    var background = area.style.background;
    area.style.background = '#f88';

    function alarm_off() {
        area.style.background = background;
    }

    window.setTimeout(alarm_off, 250);
    area.focus()
}

proto.get_words = function() {
    function is_insane(selection) {
        return selection.match(/\r?\n(\r?\n|\*+ |\#+ |\=+ )/);
    }

    t = this.area; // XXX needs "var"?
    var selection_start = t.selectionStart;
    var selection_end = t.selectionEnd;

    if (selection_start == null) {
        selection_start = selection_end;
        if (selection_start == null) {
            return false
        }
        selection_start = selection_end =
            t.value.substr(0, selection_start).replace(/\r/g, '').length;
    }

    var our_text = t.value.replace(/\r/g, '');
    selection = our_text.substr(selection_start,
        selection_end - selection_start);

    selection_start = this.find_right(our_text, selection_start, /(\S|\r?\n)/);
    if (selection_start > selection_end)
        selection_start = selection_end;
    selection_end = this.find_left(our_text, selection_end, /(\S|\r?\n)/);
    if (selection_end < selection_start)
        selection_end = selection_start;

    if (is_insane(selection)) {
        this.alarm_on();
        return false;
    }

    this.selection_start =
        this.find_left(our_text, selection_start, Wikiwyg.Wikitext.phrase_end_re);
    this.selection_end =
        this.find_right(our_text, selection_end, Wikiwyg.Wikitext.phrase_end_re);

    t.setSelectionRange(this.selection_start, this.selection_end);
    t.focus();

    this.start = our_text.substr(0,this.selection_start);
    this.sel = our_text.substr(this.selection_start, this.selection_end -
        this.selection_start);
    this.finish = our_text.substr(this.selection_end, our_text.length);

    return true;
}

proto.markup_is_on = function(start, finish) {
    return (this.sel.match(start) && this.sel.match(finish));
}

proto.clean_selection = function(start, finish) {
    this.sel = this.sel.replace(start, '');
    this.sel = this.sel.replace(finish, '');
}

proto.toggle_same_format = function(start, finish) {
    start = this.clean_regexp(start);
    finish = this.clean_regexp(finish);
    var start_re = new RegExp('^' + start);
    var finish_re = new RegExp(finish + '$');
    if (this.markup_is_on(start_re, finish_re)) {
        this.clean_selection(start_re, finish_re);
        return true;
    }
    return false;
}

proto.clean_regexp = function(string) {
    string = string.replace(/([\^\$\*\+\.\?\[\]\{\}])/g, '\\$1');
    return string;
}

proto.insert_text_at_cursor = function(text) {
    var t = this.area;

    var selection_start = t.selectionStart;
    var selection_end = t.selectionEnd;

    if (selection_start == null) {
        selection_start = selection_end;
        if (selection_start == null) {
            return false
        }
    }

    var before = t.value.substr(0, selection_start);
    var after = t.value.substr(selection_end, t.value.length);
    t.value = before + text + after;
}

proto.set_text_and_selection = function(text, start, end) {
    this.area.value = text;
    this.area.setSelectionRange(start, end);
}

proto.add_markup_words = function(markup_start, markup_finish, example) {
    if (this.toggle_same_format(markup_start, markup_finish)) {
        this.selection_end = this.selection_end -
            (markup_start.length + markup_finish.length);
        markup_start = '';
        markup_finish = '';
    }
    if (this.sel.length == 0) {
        if (example)
            this.sel = example;
        var text = this.start + markup_start + this.sel +
            markup_finish + this.finish;
        var start = this.selection_start + markup_start.length;
        var end = this.selection_end + markup_start.length + this.sel.length;
        this.set_text_and_selection(text, start, end);
    } else {
        var text = this.start + markup_start + this.sel +
            markup_finish + this.finish;
        var start = this.selection_start;
        var end = this.selection_end + markup_start.length +
            markup_finish.length;
        this.set_text_and_selection(text, start, end);
    }
    this.area.focus();
}

// XXX - A lot of this is hardcoded.
proto.add_markup_lines = function(markup_start) {
    var already_set_re = new RegExp( '^' + this.clean_regexp(markup_start), 'gm');
    var other_markup_re = /^(\^+|\=+|\*+|#+|>+|    )/gm;

    var match;
    // if paragraph, reduce everything.
    if (! markup_start.length) {
        this.sel = this.sel.replace(other_markup_re, '');
        this.sel = this.sel.replace(/^\ +/gm, '');
    }
    // if pre and not all indented, indent
    else if ((markup_start == '    ') && this.sel.match(/^\S/m))
        this.sel = this.sel.replace(/^/gm, markup_start);
    // if not requesting heading and already this style, kill this style
    else if (
        (! markup_start.match(/[\=\^]/)) &&
        this.sel.match(already_set_re)
    ) {
        this.sel = this.sel.replace(already_set_re, '');
        if (markup_start != '    ')
            this.sel = this.sel.replace(/^ */gm, '');
    }
    // if some other style, switch to new style
    else if (match = this.sel.match(other_markup_re))
        // if pre, just indent
        if (markup_start == '    ')
            this.sel = this.sel.replace(/^/gm, markup_start);
        // if heading, just change it
        else if (markup_start.match(/[\=\^]/))
            this.sel = this.sel.replace(other_markup_re, markup_start);
        // else try to change based on level
        else
            this.sel = this.sel.replace(
                other_markup_re,
                function(match) {
                    return markup_start.times(match.length);
                }
            );
    // if something selected, use this style
    else if (this.sel.length > 0)
        this.sel = this.sel.replace(/^(.*\S+)/gm, markup_start + ' $1');
    // just add the markup
    else
        this.sel = markup_start + ' ';

    var text = this.start + this.sel + this.finish;
    var start = this.selection_start;
    var end = this.selection_start + this.sel.length;
    this.set_text_and_selection(text, start, end);
    this.area.focus();
}

// XXX - A lot of this is hardcoded.
proto.bound_markup_lines = function(markup_array) {
    var markup_start = markup_array[1];
    var markup_finish = markup_array[2];
    var already_start = new RegExp('^' + this.clean_regexp(markup_start), 'gm');
    var already_finish = new RegExp(this.clean_regexp(markup_finish) + '$', 'gm');
    var other_start = /^(\^+|\=+|\*+|#+|>+) */gm;
    var other_finish = /( +(\^+|\=+))?$/gm;

    var match;
    if (this.sel.match(already_start)) {
        this.sel = this.sel.replace(already_start, '');
        this.sel = this.sel.replace(already_finish, '');
    }
    else if (match = this.sel.match(other_start)) {
        this.sel = this.sel.replace(other_start, markup_start);
        this.sel = this.sel.replace(other_finish, markup_finish);
    }
    // if something selected, use this style
    else if (this.sel.length > 0) {
        this.sel = this.sel.replace(
            /^(.*\S+)/gm,
            markup_start + '$1' + markup_finish
        );
    }
    // just add the markup
    else
        this.sel = markup_start + markup_finish;

    var text = this.start + this.sel + this.finish;
    var start = this.selection_start;
    var end = this.selection_start + this.sel.length;
    this.set_text_and_selection(text, start, end);
    this.area.focus();
}

proto.markup_bound_line = function(markup_array) {
    var scroll_top = this.area.scrollTop;
    if (this.get_lines())
        this.bound_markup_lines(markup_array);
    this.area.scrollTop = scroll_top;
}

proto.markup_start_line = function(markup_array) {
    var markup_start = markup_array[1];
    markup_start = markup_start.replace(/ +/, '');
    var scroll_top = this.area.scrollTop;
    if (this.get_lines())
        this.add_markup_lines(markup_start);
    this.area.scrollTop = scroll_top;
}

proto.markup_start_lines = function(markup_array) {
    var markup_start = markup_array[1];
    var scroll_top = this.area.scrollTop;
    if (this.get_lines())
        this.add_markup_lines(markup_start);
    this.area.scrollTop = scroll_top;
}

proto.markup_bound_phrase = function(markup_array) {
    var markup_start = markup_array[1];
    var markup_finish = markup_array[2];
    var scroll_top = this.area.scrollTop;
    if (markup_finish == 'undefined')
        markup_finish = markup_start;
    if (this.get_words())
        this.add_markup_words(markup_start, markup_finish, null);
    this.area.scrollTop = scroll_top;
}

klass.make_do = function(style) {
    return function() {
        var markup = this.config.markupRules[style];
        var handler = markup[0];
        if (! this['markup_' + handler])
            die('No handler for markup: "' + handler + '"');
        this['markup_' + handler](markup);
    }
}

proto.do_link = klass.make_do('link');
proto.do_bold = klass.make_do('bold');
proto.do_code = klass.make_do('code');
proto.do_italic = klass.make_do('italic');
proto.do_underline = klass.make_do('underline');
proto.do_strike = klass.make_do('strike');
proto.do_p = klass.make_do('p');
proto.do_pre = klass.make_do('pre');
proto.do_h1 = klass.make_do('h1');
proto.do_h2 = klass.make_do('h2');
proto.do_h3 = klass.make_do('h3');
proto.do_h4 = klass.make_do('h4');
proto.do_h5 = klass.make_do('h5');
proto.do_h6 = klass.make_do('h6');
proto.do_ordered = klass.make_do('ordered');
proto.do_unordered = klass.make_do('unordered');
proto.do_hr = klass.make_do('hr');
proto.do_table = klass.make_do('table');

proto.do_www = function() {
    var  url =  prompt("Please enter a link", "Type in your link here");
	var old = this.config.markupRules.www[1];
	this.config.markupRules.www[1] += url + " ";

	// do the transformation
	var markup = this.config.markupRules['www'];
    var handler = markup[0];
     if (! this['markup_' + handler])
    	die('No handler for markup: "' + handler + '"');
    this['markup_' + handler](markup);

	// reset
	this.config.markupRules.www[1] = old;
}

proto.selection_mangle = function(method) {
    var scroll_top = this.area.scrollTop;
    if (! this.get_lines()) {
        this.area.scrollTop = scroll_top;
        return;
    }

    if (method(this)) {
        var text = this.start + this.sel + this.finish;
        var start = this.selection_start;
        var end = this.selection_start + this.sel.length;
        this.set_text_and_selection(text, start, end);
    }
    this.area.focus();
}

proto.do_indent = function() {
    this.selection_mangle(
        function(that) {
            if (that.sel == '') return false;
            that.sel = that.sel.replace(/^(([\*\-\#])+(?=\s))/gm, '$2$1');
            that.sel = that.sel.replace(/^([\>\=])/gm, '$1$1');
            that.sel = that.sel.replace(/^([^\>\*\-\#\=\r\n])/gm, '> $1');
            that.sel = that.sel.replace(/^\={7,}/gm, '======');
            return true;
        }
    )
}

proto.do_outdent = function() {
    this.selection_mangle(
        function(that) {
            if (that.sel == '') return false;
            that.sel = that.sel.replace(/^([\>\*\-\#\=] ?)/gm, '');
            return true;
        }
    )
}

proto.do_unlink = function() {
    this.selection_mangle(
        function(that) {
            that.sel = that.kill_linkedness(that.sel);
            return true;
        }
    );
}

// TODO - generalize this to allow Wikitext dialects that don't use "[foo]"
proto.kill_linkedness = function(str) {
    while (str.match(/\[.*\]/))
        str = str.replace(/\[(.*?)\]/, '$1');
    str = str.replace(/^(.*)\]/, '] $1');
    str = str.replace(/\[(.*)$/, '$1 [');
    return str;
}

proto.markup_line_alone = function(markup_array) {
    var t = this.area;
    var scroll_top = t.scrollTop;
    var selection_start = t.selectionStart;
    var selection_end = t.selectionEnd;
    if (selection_start == null) {
        selection_start = selection_end;
    }

    var text = t.value;
    this.selection_start = this.find_right(text, selection_start, /\r?\n/);
    this.selection_end = this.selection_start;
    t.setSelectionRange(this.selection_start, this.selection_start);
    t.focus();

    var markup = markup_array[1];
    this.start = t.value.substr(0, this.selection_start);
    this.finish = t.value.substr(this.selection_end, t.value.length);
    var text = this.start + '\n' + markup + this.finish;
    var start = this.selection_start + markup.length + 1;
    var end = this.selection_end + markup.length + 1;
    this.set_text_and_selection(text, start, end);
    t.scrollTop = scroll_top;
}


/*==============================================================================
Code to convert from html to wikitext.
 =============================================================================*/
proto.convert_html_to_wikitext = function(html) {
    this.copyhtml = html;
    var dom = document.createElement('div');
    dom.innerHTML = this.strip_msword_gunk(html);
    this.output = [];
    this.list_type = [];
    this.indent_level = 0;
    this.no_collapse_text = false;

    this.normalizeDomWhitespace(dom);
    this.normalizeDomStructure(dom);

    this.walk(dom);

    // add final whitespace
    this.assert_new_line();

    return this.join_output(this.output);
}

// Adapted from http://tim.mackey.ie/CleanWordHTMLUsingRegularExpressions.aspx
proto.strip_msword_gunk = function(html) {
    return html.
        replace(
            /<(span|\w:\w+)[^>]*>(\s*&nbsp;\s*)+<\/\1>/gi,
            function(m) {
                return m.match(/ugly-ie-css-hack/) ? m : '';
            }
        ).
        replace(/<\/?(font|xml|st\d+:\w+|[ovwxp]:\w+)[^>]*>/gi, '');
}

proto.normalizeDomStructure = function(dom) {
    this.normalize_styled_blocks(dom, 'p');
    this.normalize_styled_lists(dom, 'ol');
    this.normalize_styled_lists(dom, 'ul');
    this.normalize_styled_blocks(dom, 'li');
    this.normalize_span_whitespace(dom, 'span');
}

proto.normalize_span_whitespace = function(dom,tag ) {
    var grep = function(element) {
        return Boolean(element.getAttribute('style'));
    }

    var elements = this.array_elements_by_tag_name(dom, tag, grep);
    for (var i = 0; i < elements.length; i++) {
        var element = elements[i];
        var node = element.firstChild;
        while (node) {
            if (node.nodeType == 3) {
                node.nodeValue = node.nodeValue.replace(/^\n+/,"");
                break;
            }
            node = node.nextSibling;
        }
        var node = element.lastChild;
        while (node) {
            if (node.nodeType == 3) {
                node.nodeValue = node.nodeValue.replace(/\n+$/,"");
                break;
            }
            node = node.previousSibling;
        }
    }
}

proto.normalize_styled_blocks = function(dom, tag) {
    var elements = this.array_elements_by_tag_name(dom, tag);
    for (var i = 0; i < elements.length; i++) {
        var element = elements[i];
        var style = element.getAttribute('style');
        if (!style || this.style_is_bogus(style)) continue;
        