Index: trunk/Vanilla/plugins/Vanilla/config.yaml
===================================================================
--- trunk/Vanilla/plugins/Vanilla/config.yaml (revision 1218)
+++ trunk/Vanilla/plugins/Vanilla/config.yaml (revision 1218)
@@ -0,0 +1,374 @@
+name:           Vanilla Template Sets
+id:             vanilla-template-sets
+key:            vanilla-template-sets
+description:    The simplest Movable Type templates in HTML 1.0
+version:        1.0
+author_name:    Beau Smith
+author_link:    http://www.beausmith.com/mt/
+plugin_link:    http://www.beausmith.com/mt/plugins/vanilla
+
+template_sets:
+    vanilla:
+        label: Vanilla
+        base_path: templates/vanilla
+        order: 501
+        notes: 
+            - Lastn entries on Homepage
+            - Entry Detail
+        templates:
+            index:
+                home:
+                    label: Homepage
+                    outfile: index.html
+                    rebuild_me: 1
+            individual:
+                entry: 
+                    label: Entry
+                    mappings:
+                        entry_archive:
+                            archive_type: Individual
+            module:
+                wrapper:
+                    label: Wrapper
+    vanilla_archives:
+        label: Vanilla + Archives
+        base_path: templates/vanilla+archives
+        notes:
+            - Base homepage & entries
+            - Archive Index
+            - Archives: Monthly, Author, Category and Category-Monthly
+            - Navigation w/ Category-Monthly links on Category Archives
+        order: 502
+        templates:
+            index:
+                home:
+                    label: Homepage
+                    outfile: index.html
+                    rebuild_me: 1
+                archives:
+                    label: Archives
+                    outfile: archives.html
+                    rebuild_me: 1
+            individual:
+                entry: 
+                    label: Entry
+                    mappings:
+                        entry_archive:
+                            archive_type: Individual
+            archive:
+                entry_listing: 
+                    label: Entry Listing
+                    mappings:
+                        monthly:
+                            archive_type: Monthly
+                        category:
+                            archive_type: Category
+                        category-monthly:
+                            archive_type: Category-Monthly
+                        author:
+                            archive_type: Author
+            module:
+                wrapper:
+                    label: Wrapper
+    vanilla_pages:
+        label: Vanilla + Pages
+        base_path: templates/vanilla+pages
+        notes:
+            - Base homepage & entries
+            - Pages
+            - Navigation including Pages
+        order: 503
+        templates:
+            index:
+                home:
+                    label: Homepage
+                    outfile: index.html
+                    rebuild_me: 1
+            individual:
+                entry: 
+                    label: Entry
+                    mappings:
+                        entry_archive:
+                            archive_type: Individual
+            page:
+                page: 
+                    label: Page
+                    mappings:
+                        page_archive:
+                            archive_type: Page
+            module:
+                wrapper:
+                    label: Wrapper
+    vanilla_authentication:
+        label: Vanilla + Authentication & Userpics
+        base_path: templates/vanilla+authentication
+        notes: 
+            - En/disable userpics in javascript
+            - Use of community "edit profile" script is necessary to add userpics. The "edit profile" page assumes that you are using profiles and thus links to "view profile" screen. If using profiles is not desired, the "view profile" link can be removed from the "Profile Edit" Global System Template.
+        order: 504
+        templates:
+            index:
+                home:
+                    label: Homepage
+                    outfile: index.html
+                    rebuild_me: 1
+                javascript:
+                    label: JavaScript
+                    outfile: mt.js
+                    rebuild_me: 1
+            module:
+                wrapper:
+                    label: Wrapper
+    vanilla_comments:
+        label: Vanilla + Comments
+        base_path: templates/vanilla+comments
+        notes:
+            - Authentication
+            - Comments
+            - Comment reply links
+            - Comment Preview
+            - Comment Response
+        order: 505
+        templates:
+            index:
+                home:
+                    label: Homepage
+                    outfile: index.html
+                    rebuild_me: 1
+                javascript:
+                    label: JavaScript
+                    outfile: mt.js
+                    rebuild_me: 1
+            individual:
+                entry: 
+                    label: Entry
+                    mappings:
+                        entry_archive:
+                            archive_type: Individual
+            module:
+                wrapper:
+                    label: Wrapper
+            system:
+                comment_preview:
+                    label: Comment Preview
+                comment_response:
+                    label: Comment Response
+    vanilla_comments_userpics:
+        label: Vanilla + Comments w/ Userpics
+        base_path: templates/vanilla+authentication+comments+userpics
+        notes:
+            - Authentication w/ userpic
+            - Comments w/ userpics
+            - Comment reply links
+            - Comment Preview
+            - Comment Response
+            - En/disable userpics in javascript
+            - Use of community "edit profile" script is necessary to add userpics. The "edit profile" page assumes that you are using profiles and thus links to "view profile" screen. If using profiles is not desired, the "view profile" link can be removed from the "Profile Edit" Global System Template.
+        order: 506
+        templates:
+            index:
+                home:
+                    label: Homepage
+                    outfile: index.html
+                    rebuild_me: 1
+                javascript:
+                    label: JavaScript
+                    outfile: mt.js
+                    rebuild_me: 1
+            individual:
+                entry: 
+                    label: Entry
+                    mappings:
+                        entry_archive:
+                            archive_type: Individual
+            module:
+                wrapper:
+                    label: Wrapper
+            system:
+                comment_preview:
+                    label: Comment Preview
+                comment_response:
+                    label: Comment Response
+    vanilla_create_entry:
+        label: Vanilla + Create Entry
+        base_path: templates/vanilla+create-entry
+        notes: 
+            - Authentication
+            - Create Entry
+            - Entry Response
+        order: 507
+        templates:
+            index:
+                home:
+                    label: Homepage
+                    outfile: index.html
+                    rebuild_me: 1
+                create-entry:
+                    label: Create Entry
+                    outfile: create-entry.html
+                    rebuild_me: 1
+                javascript:
+                    label: JavaScript
+                    outfile: mt.js
+                    rebuild_me: 1
+            individual:
+                entry: 
+                    label: Entry
+                    mappings:
+                        entry_archive:
+                            archive_type: Individual
+            module:
+                wrapper:
+                    label: Wrapper
+            system:
+                entry_response:
+                    label: Entry Response
+    vanilla_search_tags:
+        label: Vanilla + Search & Tags
+        base_path: templates/vanilla+search+tags
+        order: 508
+        notes: 
+            - Tag Cloud and Search Form on Homepage
+            - Entry Detail
+            - Page Detail
+            - Search Results Template
+        templates:
+            index:
+                home:
+                    label: Homepage
+                    outfile: index.html
+                    rebuild_me: 1
+                javascript:
+                    label: Javascript
+                    outfile: mt.js
+                    rebuild_me: 1
+            individual:
+                entry: 
+                    label: Entry
+                    mappings:
+                        entry_archive:
+                            archive_type: Individual
+            page:
+                page: 
+                    label: Page
+                    mappings:
+                        page_archive:
+                            archive_type: Page
+            module:
+                wrapper:
+                    label: Wrapper
+            system:
+                search_results:
+                    label: Search Results
+    vanilla_assets:
+        label: Vanilla + Assets
+        base_path: templates/vanilla+assets
+        order: 509
+        notes: 
+            - Recent assets on Homepage in various sizes and formats
+            - lastn entries on Homepage with the first asset added to each as 70 pixel square
+            - Entry Detail with assets in entries
+        templates:
+            index:
+                home:
+                    label: Homepage
+                    outfile: index.html
+                    rebuild_me: 1
+            individual:
+                entry: 
+                    label: Entry
+                    mappings:
+                        entry_archive:
+                            archive_type: Individual
+            module:
+                wrapper:
+                    label: Wrapper
+    vanilla_widgets:
+        label: Vanilla + Widgets
+        base_path: templates/vanilla+widgets
+        order: 510
+        notes: 
+            Homepage with one widget set and individually included widget:
+                - Search
+                - Tag Cloud
+                - Monthly Archives
+                - Recent Entries
+                - Page Listing
+                - About Site
+            Entry Detail with a second widget set and individually included widget:
+                - Search
+                - Tag Cloud
+                - Monthly Archives
+                - About Site
+        templates:
+            index:
+                home:
+                    label: Homepage
+                    outfile: index.html
+                    rebuild_me: 1
+            individual:
+                entry: 
+                    label: Entry
+                    mappings:
+                        entry_archive:
+                            archive_type: Individual
+            archive:
+                entry_listing: 
+                    label: Entry Listing
+                    mappings:
+                        monthly:
+                            archive_type: Monthly
+            module:
+                wrapper:
+                    label: Wrapper
+            widget:
+                search:
+                    label: Search
+                tag_cloud_widget:
+                    label: Tag Cloud
+                monthly_archives_widget:
+                    label: Monthly Archives
+                recent_entries_widget:
+                    label: Recent Entries
+                recent_assets_widget:
+                    label: Recent Assets
+                recent_comments_widget:
+                    label: Recent Comments
+                pages_widget:
+                    label: Pages
+            widgetset:
+                blog_activity:
+                    order: 1000
+                    label: Recent Activity
+                    widgets:
+                        - Recent Entries
+                        - Recent Comments
+                        - Recent Assets
+                blog_archives:
+                    order: 1000
+                    label: Blog Archives
+                    widgets:
+                        - Search
+                        - Tag Cloud
+                        - Pages
+                        - Monthly Archives
+
+
+# - Rating
+#     * 1
+#     * 5 Star
+#     * -1, 0, 1
+#     https://intranet.sixapart.com/wiki/index.php/MovableType:Rating_Framework
+#     https://intranet.sixapart.com/wiki/index.php/Movable_Type:Athena/Rating_Framework
+#     https://intranet.sixapart.com/wiki/index.php/Movable_Type:MT4_Requirements:_Rating_framework
+# - Profiles + Userpics + Friending
+#     * Userpics
+#     * Profiles
+#     * Friending
+# - Custom Fields
+# ----
+# - Logic
+#   - if/else
+#   - unless
+#   - var w/ op attributes
+# - YUI Template
Index: trunk/Vanilla/plugins/Vanilla/templates/vanilla+comments+userpics/home.mtml
===================================================================
--- trunk/Vanilla/plugins/Vanilla/templates/vanilla+comments+userpics/home.mtml (revision 922)
+++ trunk/Vanilla/plugins/Vanilla/templates/vanilla+comments+userpics/home.mtml (revision 922)
@@ -0,0 +1,14 @@
+<mt:IncludeBlock module="Wrapper">
+
+    <mt:Entries>
+        <h2><a href="<$mt:EntryPermalink$>"><$mt:EntryTitle$></a></h2>
+        <p><__trans phrase="By [_1] on [_2]" params="<$mt:EntryAuthorLink$>%%<$mt:EntryDate format="%x %X"$>"></p>
+        <mt:If tag="EntryBody">
+            <$mt:EntryBody$>
+        </mt:If>
+        <mt:If tag="EntryMore" convert_breaks="0">
+            <em><__trans phrase="Continue reading <a href="[_1]">[_2]</a>." params="<$mt:EntryPermalink$>%%<$mt:EntryTitle$>"></em>
+        </mt:If>
+    </mt:Entries>
+
+</mt:IncludeBlock>
Index: trunk/Vanilla/plugins/Vanilla/templates/vanilla+comments+userpics/comment_response.mtml
===================================================================
--- trunk/Vanilla/plugins/Vanilla/templates/vanilla+comments+userpics/comment_response.mtml (revision 987)
+++ trunk/Vanilla/plugins/Vanilla/templates/vanilla+comments+userpics/comment_response.mtml (revision 987)
@@ -0,0 +1,25 @@
+<mt:IncludeBlock module="Wrapper">
+
+    <mt:setvarblock name="html_head" append="1">
+        <script type="text/javascript">
+        /* <![CDATA[ */
+        var user = <$mt:UserSessionState$>;
+        var is_preview = true;
+        /* ]]> */
+        </script>
+    </mt:SetVarBlock>
+
+    <mt:If name="comment_confirmation">
+        <h1><__trans phrase="Confirmation..."></h1>
+        <p><__trans phrase="Your comment has been submitted!"></p>
+    <mt:Else name="comment_pending">
+        <h1><__trans phrase="Thank you for commenting."></h1>
+        <p><__trans phrase="Your comment has been received and held for approval by the blog owner."></p>
+    <mt:Else name="comment_error">
+        <h1><__trans phrase="Comment Submission Error">"</h1>
+        <p><__trans phrase="Your comment submission failed for the following reasons: [_1]" params="<$mt:ErrorMessage$>"></p>
+    </mt:If>
+
+    <p><__trans phrase="Return to the <a href="[_1]">original entry</a>." params="<mt:If name="comment_error">javascript:history.back()<mt:Else><$mt:EntryLink$></mt:If>"></p>
+
+</mt:IncludeBlock>
Index: trunk/Vanilla/plugins/Vanilla/templates/vanilla+comments+userpics/wrapper.mtml
===================================================================
--- trunk/Vanilla/plugins/Vanilla/templates/vanilla+comments+userpics/wrapper.mtml (revision 922)
+++ trunk/Vanilla/plugins/Vanilla/templates/vanilla+comments+userpics/wrapper.mtml (revision 922)
@@ -0,0 +1,34 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" id="sixapart-standard">
+<head>
+    <title><$mt:BlogName encode_html="1"$></title>
+    <meta http-equiv="Content-Type" content="text/html; charset=<$mt:PublishCharset$>" />
+    <$mt:Var name="html_head"$>
+    <script type="text/javascript" src="<$mt:Link template="JavaScript"$>"></script>
+</head>
+<body>
+
+    <h1><a href="<$mt:BlogURL$>"><$mt:BlogName encode_html="1"$></a> <__trans phrase="(Vanilla + Comments w/ Userpics)"></h1>
+
+    <div id="signin-content"><a href="javascript:void(0)" onclick="return mtSignInOnClick('signin-content')"><__trans phrase="Sign In"></a></div>
+
+<!-- end header --><hr />
+
+
+    <$mt:Var name="contents"$>
+
+
+<!-- start footer --><hr />
+
+    <p><__trans phrase="_POWERED_BY"> and the Vanilla template set</p>
+
+<script type="text/javascript">
+/* <![CDATA[ */
+mtAttachEvent('usersignin', mtUpdateSignInWidget);
+mtUpdateSignInWidget();
+/* ]]> */
+</script>
+
+</body>
+</html>
Index: trunk/Vanilla/plugins/Vanilla/templates/vanilla+comments+userpics/entry.mtml
===================================================================
--- trunk/Vanilla/plugins/Vanilla/templates/vanilla+comments+userpics/entry.mtml (revision 922)
+++ trunk/Vanilla/plugins/Vanilla/templates/vanilla+comments+userpics/entry.mtml (revision 922)
@@ -0,0 +1,118 @@
+<mt:IncludeBlock module="Wrapper">
+    
+    <mt:setvarblock name="html_head" append="1">
+        <style type="text/css" media="screen">
+            form {
+                width: 50%;
+            }
+        </style>
+    </mt:setvarblock>
+
+    <h1><$mt:EntryTitle$></h1>
+    <p><__trans phrase="By [_1] on [_2]" params="<$mt:EntryAuthorLink$>%%<$mt:EntryDate format="%x %X"$>"></p>
+    <mt:If tag="EntryBody">
+        <$mt:EntryBody$>
+    </mt:If>
+    <mt:If tag="EntryMore" convert_breaks="0">
+        <$mt:EntryMore$>
+    </mt:If>
+
+
+    <mt:IfCommentsActive>
+    <div id="comments">
+
+
+        <mt:Comments>
+            <mt:CommentsHeader>
+        <h2 class="comments-header"><__trans phrase="Comments"></h2>
+        <ol class="comments-content">
+            </mt:CommentsHeader>
+            <li id="comment-<$mt:CommentID$>">
+                <div class="comment-header">
+                    <mt:Ignore>Use "mt:CommenterURL" if user has an ID in MT, otherwise use "mt:CommentURL" (url submitted with comment) if anonymous commenter</mt:Ignore>
+                    <a href="<mt:If tag="CommenterID"><$mt:CommenterURL$><mt:Else><$mt:CommentURL$></mt:If>">
+                        <img src="<mt:If tag="CommenterUserpic"><$mt:CommenterUserpicURL$><mt:Else><$mt:StaticWebPath$>images/default-userpic-90.jpg</mt:If>" width="36" height="36" alt="user-pic" />
+                    </a>
+                    <$mt:CommentAuthorIdentity$>
+                    <mt:IfCommentParent>
+                        <__trans phrase="[_1] replied to [_2]<a href="[_3]">comment from [_4]</a>[_5]" params="<$mt:CommentAuthorLink$>%%<mt:CommentParent>%%<$mt:CommentLink$>%%<$mt:CommentAuthor$>%%</mt:CommentParent>">
+                    <mt:Else>
+                        <$mt:CommentAuthorLink$>
+                    </mt:IfCommentParent>
+                    | <a href="<$mt:CommentLink$>"><abbr class="published" title="<$mt:CommentDate format_name="iso8601"$>"><$mt:CommentDate$></abbr></a>
+                    <mt:IfCommentsAccepted>
+                    | <$mt:CommentReplyToLink$>
+                    </mt:IfCommentsAccepted>
+                </div>
+                <div class="comment-body">
+                    <$mt:CommentBody$>
+                </div>
+            </li>
+            <mt:CommentsFooter>
+        </ol>
+            </mt:CommentsFooter>
+        </mt:Comments>
+
+
+        <mt:IfCommentsAccepted>
+        <div id="comments-open">
+            <h2 class="comments-open-header"><__trans phrase="Leave a comment"></h2>
+            <div class="comments-open-content">
+                <div id="comment-greeting"></div>
+                <form method="post" action="<$mt:CGIPath$><$mt:CommentScript$>" name="comments_form" id="comments-form" onsubmit="return mtCommentOnSubmit(this)">
+                    <input type="hidden" name="static" value="1" />
+                    <input type="hidden" name="entry_id" value="<$mt:EntryID$>" />
+                    <input type="hidden" name="__lang" value="<$mt:BlogLanguage$>" />
+                    <input type="hidden" name="parent_id" value="<$mt:CommentParentID$>" id="comment-parent-id" />
+                    <input type="hidden" name="armor" value="1" />
+                    <input type="hidden" name="preview" value="" />
+                    <input type="hidden" name="sid" value="" />
+                    <div id="comments-open-data">
+                        <div>
+                            <label for="comment-author"><__trans phrase="Name"></label>
+                            <input id="comment-author" name="author" size="30" value="" onfocus="mtCommentFormOnFocus()" />
+                        </div>
+                        <div>
+                            <label for="comment-email"><__trans phrase="Email Address"></label>
+                            <input id="comment-email" name="email" size="30" value="" onfocus="mtCommentFormOnFocus()" />
+                        </div>
+                        <div>
+                            <label for="comment-url"><__trans phrase="URL"></label>
+                            <input id="comment-url" name="url" size="30" value="" onfocus="mtCommentFormOnFocus()" />
+                        </div>
+                        <div>
+                            <input type="checkbox" id="comment-bake-cookie" name="bakecookie" onclick="mtRememberMeOnClick(this)" value="1" accesskey="r" />
+                            <label for="comment-bake-cookie"><__trans phrase="Remember personal info?"></label>
+                        </div>
+                    </div>
+                    <div id="comment-form-reply" style="display:none">
+                        <input type="checkbox" id="comment-reply" name="comment_reply" value="<$mt:CommentParentID$>" onclick="mtSetCommentParentID()" />
+                        <label for="comment-reply" id="comment-reply-label"></label>
+                    </div>
+                    <div id="comments-open-text">
+                        <label for="comment-text"><__trans phrase="Comments">
+                        <mt:IfAllowCommentHTML><__trans phrase="(You may use HTML tags for style)"></mt:IfAllowCommentHTML></label>
+                        <textarea id="comment-text" name="text" rows="15" cols="50" onfocus="mtCommentFormOnFocus()"></textarea>
+                    </div>
+                    <div id="comments-open-captcha"></div>
+                    <div id="comments-open-footer">
+                        <input type="submit" accesskey="v" name="preview_button" id="comment-preview" value="<__trans phrase="Preview">" onclick="this.form.preview.value='1';" />
+                        <input type="submit" accesskey="s" name="post" id="comment-submit" value="<__trans phrase="Submit">" />
+                    </div>
+                </form>
+            </div>
+        </div>
+        <script type="text/javascript">
+        <!--
+        mtAttachEvent("load", mtEntryOnLoad);
+        mtAttachEvent("unload", mtEntryOnUnload);
+        //-->
+        </script>
+        </mt:IfCommentsAccepted>
+
+
+    </div>
+    </mt:IfCommentsActive>
+
+
+</mt:IncludeBlock>
Index: trunk/Vanilla/plugins/Vanilla/templates/vanilla+comments+userpics/comment_preview.mtml
===================================================================
--- trunk/Vanilla/plugins/Vanilla/templates/vanilla+comments+userpics/comment_preview.mtml (revision 987)
+++ trunk/Vanilla/plugins/Vanilla/templates/vanilla+comments+userpics/comment_preview.mtml (revision 987)
@@ -0,0 +1,120 @@
+<mt:IncludeBlock module="Wrapper">
+    
+    <mt:setvarblock name="html_head" append="1">
+        <style type="text/css" media="screen">
+            form {
+                width: 50%;
+            }
+        </style>
+        <script type="text/javascript">
+        /* <![CDATA[ */
+        var user = <$mt:UserSessionState$>;
+        var is_preview = true;
+        /* ]]> */
+        </script>
+    </mt:SetVarBlock>
+
+    <h1><__trans phrase="Previewing your Comment"></h1>
+
+    <div id="comments">
+        
+        <ol class="comments-content">
+            <li>
+                <div class="comment-header">
+                    <$mt:CommentAuthorIdentity$>
+                    <mt:IfCommentParent>
+                        <__trans phrase="[_1] replied to [_2]<a href="[_3]">comment from [_4]</a>[_5]" params="<$mt:CommentAuthorLink$>%%<mt:CommentParent>%%<$mt:CommentLink$>%%<$mt:CommentAuthor$>%%</mt:CommentParent>">
+                    <mt:Else>
+                        <$mt:CommentAuthorLink$>
+                    </mt:IfCommentParent>
+                    | <a href="<$mt:CommentLink$>"><abbr class="published" title="<$mt:CommentDate format_name="iso8601"$>"><$mt:CommentDate$></abbr></a>
+                </div>
+                <div class="comment-body">
+                    <$mt:CommentBody$>
+                </div>
+            </li>
+        </ol>
+
+        <mt:IfCommentsAccepted>
+        <div id="comments-open">
+            <h2 class="comments-open-header"><__trans phrase="Leave a comment"></h2>
+            <div class="comments-open-content">
+                <div id="comment-greeting"></div>
+                <form method="post" action="<$mt:CGIPath$><$mt:CommentScript$>" name="comments_form" id="comments-form" onsubmit="return mtCommentOnSubmit(this)">
+                    <input type="hidden" name="static" value="1" />
+                    <input type="hidden" name="entry_id" value="<$mt:EntryID$>" />
+                    <input type="hidden" name="__lang" value="<$mt:BlogLanguage$>" />
+                    <input type="hidden" name="parent_id" value="<$mt:CommentParentID$>" id="comment-parent-id" />
+                    <input type="hidden" name="armor" value="1" />
+                    <input type="hidden" name="preview" value="" />
+                    <input type="hidden" name="sid" value="" />
+                    <div id="comments-open-data">
+                        <div>
+                            <label for="comment-author"><__trans phrase="Name"></label>
+                            <input id="comment-author" name="author" size="30" value="" onfocus="mtCommentFormOnFocus()" />
+                        </div>
+                        <div>
+                            <label for="comment-email"><__trans phrase="Email Address"></label>
+                            <input id="comment-email" name="email" size="30" value="" onfocus="mtCommentFormOnFocus()" />
+                        </div>
+                        <div>
+                            <label for="comment-url"><__trans phrase="URL"></label>
+                            <input id="comment-url" name="url" size="30" value="" onfocus="mtCommentFormOnFocus()" />
+                        </div>
+                    </div>
+                    <div id="comment-form-reply"<mt:IfCommentParent><mt:Else> style="display:none"</mt:IfCommentParent>>
+                        <input type="checkbox" id="comment-reply" name="comment_reply" value="<$mt:CommentParentID$>"<mt:IfCommentParent> checked="checked"</mt:IfCommentParent> onclick="mtSetCommentParentID()" />
+                        <label for="comment-reply" id="comment-reply-label"><mt:IfCommentParent><__trans phrase="Replying to comment from [_1]" params="<mt:CommentParent><$mt:CommentAuthor$></mt:CommentParent>"></mt:IfCommentParent></label>
+                    </div>
+                    <div id="comments-open-text">
+                        <label for="comment-text"><__trans phrase="Comments">
+                        <mt:IfAllowCommentHTML><__trans phrase="(You may use HTML tags for style)"></mt:IfAllowCommentHTML></label>
+                        <textarea id="comment-text" name="text" rows="15" cols="50" onfocus="mtCommentFormOnFocus()"><$mt:CommentBody autolink="0" sanitize="0" convert_breaks="0" encode_html="1"$></textarea>
+                    </div>
+                    <div id="comments-open-captcha"></div>
+                    <div id="comments-open-footer">
+                        <input type="submit" accesskey="v" name="preview_button" id="comment-preview" value="<__trans phrase="Preview">" onclick="this.form.preview.value='1';" />
+                        <input type="submit" accesskey="s" name="post" id="comment-submit" value="<__trans phrase="Submit">" />
+                        <input type="button" name="cancel" id="comment-cancel" value="<__trans phrase="Cancel">" onclick="window.location='<$mt:EntryPermalink$>'" />
+                    </div>
+                </form>
+            </div>
+        </div>
+        <script type="text/javascript">
+        <!--
+        mtAttachEvent("load", mtEntryOnLoad);
+        mtAttachEvent("unload", mtEntryOnUnload);
+        //-->
+        </script>
+        </mt:IfCommentsAccepted>
+
+        <mt:Comments>
+            <mt:CommentsHeader>
+        <h2 class="comments-header"><__trans phrase="Comments"></h2>
+        <ol class="comments-content">
+            </mt:CommentsHeader>
+            <li id="comment-<$mt:CommentID$>">
+                <div class="comment-header">
+                    <$mt:CommentAuthorIdentity$>
+                    <mt:IfCommentParent>
+                        <__trans phrase="[_1] replied to [_2]<a href="[_3]">comment from [_4]</a>[_5]" params="<$mt:CommentAuthorLink$>%%<mt:CommentParent>%%<$mt:CommentLink$>%%<$mt:CommentAuthor$>%%</mt:CommentParent>">
+                    <mt:Else>
+                        <$mt:CommentAuthorLink$>
+                    </mt:IfCommentParent>
+                    | <a href="<$mt:CommentLink$>"><abbr class="published" title="<$mt:CommentDate format_name="iso8601"$>"><$mt:CommentDate$></abbr></a>
+                    <mt:IfCommentsAccepted>
+                    | <$mt:CommentReplyToLink$>
+                    </mt:IfCommentsAccepted>
+                </div>
+                <div class="comment-body">
+                    <$mt:CommentBody$>
+                </div>
+            </li>
+            <mt:CommentsFooter>
+        </ol>
+            </mt:CommentsFooter>
+        </mt:Comments>
+
+    </div>
+
+</mt:IncludeBlock>
Index: trunk/Vanilla/plugins/Vanilla/templates/vanilla+comments+userpics/javascript.mtml
===================================================================
--- trunk/Vanilla/plugins/Vanilla/templates/vanilla+comments+userpics/javascript.mtml (revision 919)
+++ trunk/Vanilla/plugins/Vanilla/templates/vanilla+comments+userpics/javascript.mtml (revision 919)
@@ -0,0 +1,897 @@
+<$mt:var name="user-auth" value="signin-content"$>
+<mt:Ignore>
+    Set show_userpic to 1 to enable userpics in the signin line
+    - Requires Community Solution
+    - Note: This will update username to link to Community Solution "edit profile" script. This script assumes that you are using profiles and thus links to "view profile" screen. If the template set is not using profiles then the Community Solution "Profile Edit" Global System Template should be updated.
+</mt:Ignore>
+<$mt:var name="show_userpic" value="1"$>
+
+/* section *****************************************************************/
+
+// The cookie name to use for storing the blog-side comment session cookie.
+var mtCookieName = "<$mt:UserSessionCookieName$>";
+var mtCookieDomain = "<$mt:UserSessionCookieDomain$>";
+var mtCookiePath = "<$mt:UserSessionCookiePath$>";
+var mtCookieTimeout = <$mt:UserSessionCookieTimeout$>;
+var is_preview;
+var user;
+
+/* Login Functions *****************************************************************/
+
+<mt:Ignore>
+/***
+ * Issues a request to the MT comment script to retrieve the currently
+ * logged-in user (if any).
+ */
+</mt:Ignore>
+var mtFetchedUser = false;
+<mt:IfBlog>
+function mtFetchUser(cb) {
+    if (!cb) cb = 'mtSetUser';
+    if ( ( cb == 'mtSetUser' ) && mtGetUser() ) {
+        var url = document.URL;
+        url = url.replace(/#.+$/, '');
+        url += '#comments-open';
+        location.href = url;
+    } else {
+        // we aren't using AJAX for this, since we may have to request
+        // from a different domain. JSONP to the rescue.
+        mtFetchedUser = true;
+        var script = document.createElement('script');
+        var ts = new Date().getTime();
+        script.src = '<$mt:CGIPath$><$mt:CommentScript$>?__mode=session_js&blog_id=<$mt:BlogID$>&jsonp=' + cb + '&ts=' + ts;
+        (document.getElementsByTagName('head'))[0].appendChild(script);
+    }
+}
+</mt:IfBlog>
+
+<mt:Ignore>
+/***
+ * A routine that displays various phrases based upon users authenticated status
+ */
+</mt:Ignore>
+
+// <a href="#">Signin</a>
+// You are signed in as <a href="#">UserName</a> (<a href="#">Sign out</a>)
+// You do not have permission to sign in to this blog
+
+function mtUpdateSignInWidget(u) {
+    var el = document.getElementById('<$mt:var name="user-auth"$>');
+    var content = '';
+    var doit = 1;
+    if (!el) return;
+    if (u) {
+        if (u && u.is_authenticated) {
+            user = u;
+            mtSaveUser();
+        } else {
+            // user really isn't logged in; so let's do this!
+            return mtSignIn();
+        }
+    } else {
+        u = mtGetUser();
+    }
+    if (u && u.name) {
+<mt:If name="show_userpic">
+        if (u.userpic)
+            content += '<img src="' + u.userpic + '" width="50" height="50" />';
+</mt:If>
+        var url;
+        if (u.is_authenticated) {
+            if (u.is_author) {
+<mt:If name="show_userpic">
+                url = '<$mt:CGIPath$><$mt:CommunityScript$>?__mode=edit&blog_id=<$mt:BlogID$>';
+                url += '&return_to=' + encodeURIComponent(document.URL);
+<mt:Else>
+                url = '<$mt:CGIPath$><$mt:CommentScript$>?__mode=edit_profile&blog_id=<$mt:BlogID$>';
+                url += '&static=' + encodeURIComponent( location.href );
+</mt:If>
+            } else {
+                url = u.url;
+            }
+        } else if (u.url) {
+            url = u.url;
+        } else {
+            url = null;
+        }
+        content += '<__trans phrase="You are signed in as " escape="js">';
+        if (url)
+            content += '<a href="' + url + '">' + u.name + '</a>';
+        else
+            content += u.name;
+        content += '.  (<a href="javascript:void(0)" onclick="return mtSignOutOnClick()"><__trans phrase="sign out" escape="js"></a>)';
+    } else if (u && u.is_banned) {
+        content = '<__trans phrase="You do not have permission to sign in to this blog." escape="js">';
+    } else {
+    //    content = '<a href="javascript:void(0)" onclick="return mtSignInOnClick(\'<$mt:var name="user-auth"$>\')"><__trans phrase="Sign In" escape="js"></a>';
+        doit = 0;
+    }
+    if (doit) {
+        el.innerHTML = content;
+    }
+}
+
+<mt:IfBlog>
+<mt:IfRegistrationAllowed>
+/***
+ * If request contains a '#_login' or '#_logout' hash, use this to
+ * also delete the blog-side user cookie, since we're coming back from
+ * a login, logout or edit profile operation.
+ */
+var clearCookie = ( window.location.hash && window.location.hash.match( /^#_log(in|out)/ ) ) ? true : false;
+if (clearCookie) {
+    // clear any logged in state
+    mtClearUser();
+    if (RegExp.$1 == 'in')
+        mtFetchUser();
+} else {
+    <mt:Ignore>
+    /***
+     * Uncondition this call to fetch the current user state (if available)
+     * from MT upon page load if no user cookie is already present.
+     * This is okay if you have a private install, such as an Intranet;
+     * not recommended for public web sites!
+     */
+    </mt:Ignore>
+    if ( is_preview && !user )
+        mtFetchUser();
+}
+</mt:IfRegistrationAllowed>
+</mt:IfBlog>
+
+<mt:Ignore>
+/***
+ * Retrieves an object of the currently logged in user's state.
+ * If no user is logged in or cookied, this will return null.
+ */
+</mt:Ignore>
+function mtGetUser() {
+    if (!user) {
+        var cookie = mtGetCookie(mtCookieName);
+        if (!cookie) return;
+        user = mtUnbakeUserCookie(cookie);
+        if (! user) {
+            user = {};
+            user.is_anonymous = true;
+            user.can_post = false;
+            user.is_author = false;
+            user.is_banned = false;
+            user.is_trusted = false;
+        }
+    }
+    return user;
+}
+
+<mt:Ignore>
+/***
+ * Assigns a user object as the actively logged in user; also saves the
+ * user information in a browser cookie.
+ */
+</mt:Ignore>
+function mtSetUser(u) {
+    if (u) {
+        // persist this
+        user = u;
+        mtSaveUser();
+        // sync up user greeting
+        mtFireEvent('usersignin');
+    }
+}
+
+<mt:Ignore>
+/***
+ * Handles the action of the "Sign in" link. First clears any existing
+ * user cookie, then directs to the MT comment script to sign the user in.
+ */
+</mt:Ignore>
+function mtSignIn() {
+    var doc_url = document.URL;
+    doc_url = doc_url.replace(/#.+/, '');
+    var url = '<$mt:SignInLink$>';
+    if (is_preview) {
+        if ( document['comments_form'] ) {
+            var entry_id = document['comments_form'].entry_id.value;
+            url += '&entry_id=' + entry_id;
+        } else {
+            url += '&return_url=<$mt:BlogURL encode_url="1"$>';
+        }
+    } else {
+        url += '&return_url=' + encodeURIComponent(doc_url);
+    }
+    mtClearUser();
+    location.href = url;
+}
+
+function mtSignInOnClick(sign_in_element) {
+    var el;
+    if (sign_in_element) {
+        // display throbber
+        el = document.getElementById(sign_in_element);
+        if (!el)  // legacy MT 4.x element id
+            el = document.getElementById('comment-form-external-auth');
+    }
+    if (el)
+        el.innerHTML = '<__trans phrase="Signing in..." escape="js"> <span class="status-indicator">&nbsp;</span>';
+
+    mtClearUser(); // clear any 'anonymous' user cookie to allow sign in
+    mtFetchUser('mtSetUserOrLogin');
+    return false;
+}
+
+function mtSetUserOrLogin(u) {
+    if (u && u.is_authenticated) {
+        mtSetUser(u);
+    } else {
+        // user really isn't logged in; so let's do this!
+        mtSignIn();
+    }
+}
+
+<mt:Ignore>
+/***
+ * Handles sign out from the web site.
+ * First clears any existing user cookie, then direts to the MT comment
+ * script to sign the user out.
+ */
+</mt:Ignore>
+function mtSignOut(entry_id) {
+    mtClearUser();
+    var doc_url = document.URL;
+    doc_url = doc_url.replace(/#.+/, '');
+    var url = '<$mt:SignOutLink$>';
+    if (is_preview) {
+        if ( document['comments_form'] ) {
+            var entry_id = document['comments_form'].entry_id.value;
+            url += '&entry_id=' + entry_id;
+        } else {
+            url += '&return_url=<$mt:BlogURL encode_url="1"$>';
+        }
+    } else {
+        url += '&return_url=' + encodeURIComponent(doc_url);
+    }
+    location.href = url;
+}
+
+<mt:Ignore>
+/***
+ * Handles the action of the "Sign out" link.
+ */
+</mt:Ignore>
+function mtSignOutOnClick() {
+    mtSignOut();
+    return false;
+}
+
+
+
+/* Cookie *****************************************************************/
+
+<mt:Ignore>
+/***
+ * Persists a copy of the current user cookie into the browser cookie stash.
+ */
+</mt:Ignore>
+function mtSaveUser(f) {
+    // We can't reliably store the user cookie during a preview.
+    if (is_preview) return;
+
+    var u = mtGetUser();
+
+    if (f && (!u || u.is_anonymous)) {
+        if ( !u ) {
+            u = {};
+            u.is_authenticated = false;
+            u.can_comment = true;
+            u.is_author = false;
+            u.is_banned = false;
+            u.is_anonymous = true;
+            u.is_trusted = false;
+        }
+        if (f.author != undefined) u.name = f.author.value;
+        if (f.email != undefined) u.email = f.email.value;
+        if (f.url != undefined) u.url = f.url.value;
+    }
+
+    if (!u) return;
+
+    var cache_period = mtCookieTimeout * 1000;
+
+    // cache anonymous user info for a long period if the
+    // user has requested to be remembered
+    if (u.is_anonymous && f && f.bakecookie && f.bakecookie.checked)
+        cache_period = 365 * 24 * 60 * 60 * 1000;
+
+    var now = new Date();
+    mtFixDate(now);
+    now.setTime(now.getTime() + cache_period);
+
+    var cmtcookie = mtBakeUserCookie(u);
+    mtSetCookie(mtCookieName, cmtcookie, now, mtCookiePath, mtCookieDomain,
+        location.protocol == 'https:');
+}
+
+<mt:Ignore>
+/***
+ * Clears the blog-side user cookie.
+ */
+</mt:Ignore>
+function mtClearUser() {
+    user = null;
+    mtDeleteCookie(mtCookieName, mtCookiePath, mtCookieDomain,
+        location.protocol == 'https:');
+}
+
+<mt:Ignore>
+/***
+ * Sets a browser cookie.
+ */
+</mt:Ignore>
+function mtSetCookie(name, value, expires, path, domain, secure) {
+    if (domain && domain.match(/^\.?localhost$/))
+        domain = null;
+    var curCookie = name + "=" + escape(value) +
+        (expires ? "; expires=" + expires.toGMTString() : "") +
+        (path ? "; path=" + path : "") +
+        (domain ? "; domain=" + domain : "") +
+        (secure ? "; secure" : "");
+    document.cookie = curCookie;
+}
+
+<mt:Ignore>
+/***
+ * Retrieves a browser cookie.
+ */
+</mt:Ignore>
+function mtGetCookie(name) {
+    var prefix = name + '=';
+    var c = document.cookie;
+    var cookieStartIndex = c.indexOf(prefix);
+    if (cookieStartIndex == -1)
+        return '';
+    var cookieEndIndex = c.indexOf(";", cookieStartIndex + prefix.length);
+    if (cookieEndIndex == -1)
+        cookieEndIndex = c.length;
+    return unescape(c.substring(cookieStartIndex + prefix.length, cookieEndIndex));
+}
+
+<mt:Ignore>
+/***
+ * Deletes a browser cookie.
+ */
+</mt:Ignore>
+function mtDeleteCookie(name, path, domain, secure) {
+    if (mtGetCookie(name)) {
+        if (domain && domain.match(/^\.?localhost$/))
+            domain = null;
+        document.cookie = name + "=" +
+            (path ? "; path=" + path : "") +
+            (domain ? "; domain=" + domain : "") +
+            (secure ? "; secure" : "") +
+            "; expires=Thu, 01-Jan-70 00:00:01 GMT";
+    }
+}
+
+<mt:Ignore>
+/***
+ * Serializes a user object into a string, suitable for storing as a cookie.
+ */
+</mt:Ignore>
+function mtBakeUserCookie(u) {
+    var str = "";
+    if (u.name) str += "name:'" + mtEscapeJS(u.name) + "';";
+    if (u.url) str += "url:'" + mtEscapeJS(u.url) + "';";
+    if (u.email) str += "email:'" + mtEscapeJS(u.email) + "';";
+    if (u.auth_type) str += "auth_type:'" + u.auth_type + "';";
+    if (u.is_authenticated) str += "is_authenticated:'1';";
+    if (u.profile) str += "profile:'" + mtEscapeJS(u.profile) + "';";
+    if (u.userpic) str += "userpic:'" + mtEscapeJS(u.userpic) + "';";
+    if (u.sid) str += "sid:'" + mtEscapeJS(u.sid) + "';";
+    str += "is_trusted:'" + (u.is_trusted ? "1" : "0") + "';";
+    str += "is_author:'" + (u.is_author ? "1" : "0") + "';";
+    str += "is_banned:'" + (u.is_banned ? "1" : "0") + "';";
+    str += "can_post:'" + (u.can_post ? "1" : "0") + "';";
+    str += "can_comment:'" + (u.can_comment ? "1" : "0") + "';";
+    str = str.replace(/;$/, '');
+    return str;
+}
+
+<mt:Ignore>
+/***
+ * Unserializes a user cookie and returns a user object with the restored
+ * state.
+ */
+</mt:Ignore>
+function mtUnbakeUserCookie(s) {
+    if (!s) return;
+
+    var u = {};
+    var m;
+    while (m = s.match(/^((name|url|email|auth_type|is_authenticated|profile|userpic|sid|is_trusted|is_author|is_banned|can_post|can_comment):'([^']+?)';?)/)) {
+        s = s.substring(m[1].length);
+        if (m[2].match(/^(is|can)_/)) // boolean fields
+            u[m[2]] = m[3] == '1' ? true : false;
+        else
+            u[m[2]] = mtUnescapeJS(m[3]);
+    }
+    if (u.is_authenticated) {
+        u.is_anonymous = false;
+    } else {
+        u.is_anonymous = true;
+        u.can_post = false;
+        u.is_author = false;
+        u.is_banned = false;
+        u.is_trusted = false;
+    }
+    return u;
+}
+
+/* Comment Messaging *****************************************************************/
+
+<mt:Ignore>
+/***
+ * Called when an entry archive page is loaded.
+ * This routine controls which elements of the comment form are shown
+ * or hidden, depending on commenter type and blog configuration.
+ */
+</mt:Ignore>
+<mt:IfBlog>
+function mtEntryOnLoad() {
+    <mt:Unless tag="IfPingsAccepted">mtHide('trackbacks-info');</mt:Unless>
+    <mt:Unless tag="IfCommentsAccepted">mtHide('comments-open');</mt:Unless>
+    mtFireEvent('usersignin');
+}
+
+function mtEntryOnUnload() {
+    if (mtRequestSubmitted) {
+        var cf = document['comments_form'];
+        if (cf) {
+            if (cf.post && cf.post.disabled)
+                cf.post.disabled = false;
+            if (cf.preview_button && cf.preview_button.disabled)
+                cf.preview_button.disabled = false;
+        }
+        mtRequestSubmitted = false;
+    }
+    return true;
+}
+
+mtAttachEvent('usersignin', mtUserOnLoad);
+</mt:IfBlog>
+
+<mt:Ignore>
+/***
+ * Handles the display of the greeting message, depending on what kind of
+ * user is logged in and blog comment policy.
+ */
+</mt:Ignore>
+<mt:IfBlog>
+function mtShowGreeting() {
+<mt:IfRegistrationAllowed>
+    var reg_reqd = <mt:IfRegistrationRequired>true<mt:Else>false</mt:IfRegistrationRequired>;
+
+    var cf = document['comments_form'];
+    if (!cf) return;
+
+    var el = document.getElementById('comment-greeting');
+    if (!el)  // legacy MT 4.x element id
+        el = document.getElementById('comment-form-external-auth');
+    if (!el) return;
+
+    var eid = cf.entry_id;
+    var entry_id;
+    if (eid) entry_id = eid.value;
+
+    var phrase;
+    var u = mtGetUser();
+
+    if ( u && u.is_authenticated ) {
+        if ( u.is_banned ) {
+            phrase = '<__trans phrase="You do not have permission to comment on this blog. ([_1]sign out[_2])" params="<a href="javascript:void(0);" onclick="return mtSignOutOnClick();">%%</a>" escape="js">';
+        } else {
+            var user_link;
+            if ( u.is_author ) {
+                user_link = '<a href="<$mt:CGIPath$><$mt:CommentScript$>?__mode=edit_profile&return_url=' + encodeURIComponent( location.href );
+                user_link += '">' + u.name + '</a>';
+            } else {
+                // registered user, but not a user with posting rights
+                if (u.url)
+                    user_link = '<a href="' + u.url + '">' + u.name + '</a>';
+                else
+                    user_link = u.name;
+            }
+            // TBD: supplement phrase with userpic if one is available.
+            phrase = '<__trans phrase="Thanks for signing in, __NAME__. ([_1]sign out[_2])" params="<a href="javascript:void(0)" onclick="return mtSignOutOnClick();">%%</a>" escape="js">';
+            phrase = phrase.replace(/__NAME__/, user_link);
+        }
+    } else {
+        if (reg_reqd) {
+            phrase = '<__trans phrase="[_1]Sign in[_2] to comment." params="<a href="javascript:void(0)" onclick="return mtSignInOnClick('comment-greeting')">%%</a>" escape="js">';
+        } else {
+            phrase = '<__trans phrase="[_1]Sign in[_2] to comment, or comment anonymously." params="<a href="javascript:void(0)" onclick="return mtSignInOnClick('comment-greeting')">%%</a>" escape="js">';
+        }
+    }
+    el.innerHTML = phrase;
+<mt:Else>
+    mtShowCaptcha();
+</mt:IfRegistrationAllowed>
+}
+</mt:IfBlog>
+
+<mt:Ignore>
+/***
+ * Function to hide/show/prepopulate fields based upon type of user that has authenticated
+ */
+</mt:Ignore>
+<mt:IfBlog>
+function mtUserOnLoad() {
+    var u = mtGetUser();
+
+    // if the user is authenticated, hide the 'anonymous' fields
+    // and any captcha input if already shown
+    if ( document.getElementById('comments-form')) {
+        if ( u && u.is_authenticated ) {
+            mtShow('comments-form');
+            mtHide('comments-open-data');
+            if (mtCaptchaVisible)
+                mtHide('comments-open-captcha');
+        } else {
+<mt:IfRegistrationRequired>
+            mtHide('comments-form');
+</mt:IfRegistrationRequired>
+        }
+        if ( u && u.is_banned )
+            mtHide('comments-form');
+
+        // if we're previewing a comment, make sure the captcha
+        // field is visible
+        if (is_preview)
+            mtShowCaptcha();
+        else
+            mtShowGreeting();
+
+        // populate anonymous comment fields if user is cookied as anonymous
+        var cf = document['comments_form'];
+        if (cf) {
+            if (u && u.is_anonymous) {
+                if (u.email) cf.email.value = u.email;
+                if (u.name) cf.author.value = u.name;
+                if (u.url) cf.url.value = u.url;
+                if (cf.bakecookie)
+                    cf.bakecookie.checked = u.name || u.email;
+            } else {
+                if (u && u.sid && cf.sid)
+                    cf.sid.value = u.sid;
+            }
+            if (cf.post.disabled)
+                cf.post.disabled = false;
+            if (cf.preview_button.disabled)
+                cf.preview_button.disabled = false;
+            mtRequestSubmitted = false;
+        }
+    }
+}
+</mt:IfBlog>
+
+
+/* Comment Remember Me *****************************************************************/
+
+<mt:Ignore>
+/***
+ * Called when the 'Remember me' checkbox is changed. If the checkbox
+ * is cleared, the cached user cookie is immediately cleared.
+ */
+</mt:Ignore>
+function mtRememberMeOnClick(b) {
+    if (!b.checked)
+        mtClearUser(b.form);
+    return true;
+}
+
+/* Comment Parent *****************************************************************/
+
+<mt:Ignore>
+/***
+ * Handles the action of the 'Reply' links.
+ */
+</mt:Ignore>
+function mtReplyCommentOnClick(parent_id, author) {
+    mtShow('comment-form-reply');
+
+    var checkbox = document.getElementById('comment-reply');
+    var label = document.getElementById('comment-reply-label');
+    var text = document.getElementById('comment-text');
+
+    // Populate label with new values
+    var reply_text = '<__trans phrase="Replying to <a href="[_1]" onclick="[_2]">comment from [_3]</a>" params="#comment-__PARENT__%%location.href=this.href; return false%%__AUTHOR__" escape="js">';
+    reply_text = reply_text.replace(/__PARENT__/, parent_id);
+    reply_text = reply_text.replace(/__AUTHOR__/, author);
+    label.innerHTML = reply_text;
+
+    checkbox.value = parent_id; 
+    checkbox.checked = true;
+    try {
+        // text field may be hidden
+        text.focus();
+    } catch(e) {
+    }
+
+    mtSetCommentParentID();
+}
+
+<mt:Ignore>
+/***
+ * Sets the parent comment ID when replying to a comment.
+ */
+</mt:Ignore>
+function mtSetCommentParentID() {
+    var checkbox = document.getElementById('comment-reply');
+    var parent_id_field = document.getElementById('comment-parent-id');
+    if (!checkbox || !parent_id_field) return;
+
+    var pid = 0;
+    if (checkbox.checked == true)
+        pid = checkbox.value;
+    parent_id_field.value = pid;
+}
+
+/* CAPTCHA *****************************************************************/
+
+<mt:Ignore>
+/***
+ * Called when an input field on the comment form receives focus.
+ */
+</mt:Ignore>
+function mtCommentFormOnFocus() {
+    // if CAPTCHA is enabled, this causes the captcha image to be
+    // displayed if it hasn't been already.
+    mtShowCaptcha();
+}
+
+<mt:Ignore>
+/***
+ * Displays a captcha field for anonymous commenters.
+ */
+</mt:Ignore>
+var mtCaptchaVisible = false;
+function mtShowCaptcha() {
+    var u = mtGetUser();
+    if ( u && u.is_authenticated ) return;
+    if (mtCaptchaVisible) return;
+    var div = document.getElementById('comments-open-captcha');
+    if (div) {
+        div.innerHTML = '<$mt:CaptchaFields$>';
+        mtCaptchaVisible = true;
+    }
+}
+
+/* Comment Submit *****************************************************************/
+
+<mt:Ignore>
+/***
+ * Called when comment form is sent.
+ * Required parameter: Form DOM object of comment form.
+ * If form has a 'bakecookie' member, it will be used to signal
+ * storing the anonymous commenter information to a cookie.
+ * If form has a 'armor' member, it will be used to store
+ * a token that is checked by the comment script.
+ */
+</mt:Ignore>
+<mt:IfBlog>
+var mtRequestSubmitted = false;
+function mtCommentOnSubmit(f) {
+    if (!mtRequestSubmitted) {
+        mtRequestSubmitted = true;
+
+        if (f.armor)
+            f.armor.value = '<$mt:BlogSitePath encode_sha1="1"$>';
+        if (f.bakecookie && f.bakecookie.checked)
+            mtSaveUser(f);
+
+        // disable submit buttons
+        if (f.preview_button) f.preview_button.disabled = true;
+        if (f.post) f.post.disabled = true;
+
+        var u = mtGetUser();
+        if ( !is_preview && ( u && u.is_authenticated ) ) {
+            // validate session; then submit
+            mtFetchedUser = false;
+            mtFetchUser('mtCommentSessionVerify');
+            return false;
+        }
+
+        return true;
+    }
+    return false;
+}
+
+function mtCommentSessionVerify(app_user) {
+    var u = mtGetUser();
+    var f = document['comments_form'];
+    if ( u && app_user && app_user.sid && ( u.sid == app_user.sid ) ) {
+        f.submit();
+    } else {
+        alert('<__trans phrase="Your session has expired. Please sign in again to comment." escape="js">');
+        mtClearUser();
+        mtFireEvent('usersignin');
+<mt:IfRegistrationRequired>
+        mtShow('comments-form');
+        mtHide('comments-open-footer');
+</mt:IfRegistrationRequired>
+    }
+}
+</mt:IfBlog>
+
+/* Utility Functions *****************************************************************/
+
+<mt:Ignore>
+/***
+ * Simple routine for showing a DOM element (applying a CSS display
+ * attribute of 'none').
+ */
+</mt:Ignore>
+function mtHide(id) {
+    var el = (typeof id == "string") ? document.getElementById(id) : id;
+    if (el) el.style.display = 'none';
+}
+
+<mt:Ignore>
+/***
+ * Simple routine for showing a DOM element (applying a CSS display
+ * attribute of 'block').
+ */
+</mt:Ignore>
+function mtShow(id) {
+    var el = (typeof id == "string") ? document.getElementById(id) : id;
+    if (el) el.style.display = 'block';
+}
+
+<mt:Ignore>
+/***
+ * Calls the event named, if there are handlers for it.
+ */
+</mt:Ignore>
+function mtFireEvent(eventName,param) {
+    var fn = window['on' + eventName];
+    if (typeof fn == 'function') return fn(param);
+    return;
+}
+
+function mtFixDate(date) {
+    var skew = (new Date(0)).getTime();
+    if (skew > 0)
+        date.setTime(date.getTime() - skew);
+}
+
+<mt:Ignore>
+/***
+ * Simple function that escapes single quote characters for storing
+ * in a cookie.
+ */
+</mt:Ignore>
+function mtEscapeJS(s) {
+    s = s.replace(/'/g, "&apos;");
+    return s;
+}
+
+<mt:Ignore>
+/***
+ * Simple function that unescapes single quote characters that were
+ * stored in a cookie.
+ */
+</mt:Ignore>
+function mtUnescapeJS(s) {
+    s = s.replace(/&apos;/g, "'");
+    return s;
+}
+
+<mt:Ignore>
+/***
+ * A utility function for assigning/adding handlers to window events.
+ */
+</mt:Ignore>
+function mtAttachEvent(eventName,func) {
+    var onEventName = 'on' + eventName;
+    var old = window[onEventName];
+    if( typeof old != 'function' )
+        window[onEventName] = func;
+    else {
+        window[onEventName] = function( evt ) {
+            old( evt );
+            return func( evt );
+        };
+    }
+}
+
+/* Ajax Requests *****************************************************************/
+
+<mt:Ignore>
+/***
+ * Returns a XMLHttpRequest object (for Ajax operations).
+ */
+</mt:Ignore>
+function mtGetXmlHttp() {
+    if ( !window.XMLHttpRequest ) {
+        window.XMLHttpRequest = function() {
+            var types = [
+                "Microsoft.XMLHTTP",
+                "MSXML2.XMLHTTP.5.0",
+                "MSXML2.XMLHTTP.4.0",
+                "MSXML2.XMLHTTP.3.0",
+                "MSXML2.XMLHTTP"
+            ];
+
+            for ( var i = 0; i < types.length; i++ ) {
+                try {
+                    return new ActiveXObject( types[ i ] );
+                } catch( e ) {}
+            }
+
+            return undefined;
+        };
+    }
+    if ( window.XMLHttpRequest )
+        return new XMLHttpRequest();
+}
+
+/* Section *****************************************************************/
+
+<mt:Ignore>
+/***
+ * Initialize
+ */
+</mt:Ignore>
+// BEGIN: fast browser onload init
+// Modifications by David Davis, DWD
+// Dean Edwards/Matthias Miller/John Resig
+// http://dean.edwards.name/weblog/2006/06/again/?full#comment5338
+
+function mtInit() {
+    // quit if this function has already been called
+    if (arguments.callee.done) return;
+
+    // flag this function so we don't do the same thing twice
+    arguments.callee.done = true;
+
+    // kill the timer
+    // DWD - check against window
+    if ( window._timer ) clearInterval(window._timer);
+
+    // DWD - fire the window onload now, and replace it
+    if ( window.onload && ( window.onload !== window.mtInit ) ) {
+        window.onload();
+        window.onload = function() {};
+    }
+}
+
+/* for Mozilla/Opera9 */
+if (document.addEventListener) {
+    document.addEventListener("DOMContentLoaded", mtInit, false);
+}
+
+/* for Internet Explorer */
+/*@cc_on @*/
+/*@if (@_win32)
+document.write("<script id=__ie_onload defer src=javascript:void(0)><\/script>");
+var script = document.getElementById("__ie_onload");
+script.onreadystatechange = function() {
+    if (this.readyState == "complete") {
+        mtInit(); // call the onload handler
+    }
+};
+/*@end @*/
+
+/* for Safari */
+if (/WebKit/i.test(navigator.userAgent)) { // sniff
+    _timer = setInterval(function() {
+        if (/loaded|complete/.test(document.readyState)) {
+            mtInit(); // call the onload handler
+        }
+    }, 10);
+}
+
+/* for other browsers */
+window.onload = mtInit;
+
+// END: fast browser onload init
+
+/* END Movable Type Javascript *****************************************************************/
Index: trunk/Vanilla/plugins/Vanilla/templates/vanilla+authentication/home.mtml
===================================================================
--- trunk/Vanilla/plugins/Vanilla/templates/vanilla+authentication/home.mtml (revision 922)
+++ trunk/Vanilla/plugins/Vanilla/templates/vanilla+authentication/home.mtml (revision 922)
@@ -0,0 +1,5 @@
+<mt:IncludeBlock module="Wrapper">
+
+    <p><em><__trans phrase="No entries. Authentication example only"></em></p>
+
+</mt:IncludeBlock>
Index: trunk/Vanilla/plugins/Vanilla/templates/vanilla+authentication/wrapper.mtml
===================================================================
--- trunk/Vanilla/plugins/Vanilla/templates/vanilla+authentication/wrapper.mtml (revision 922)
+++ trunk/Vanilla/plugins/Vanilla/templates/vanilla+authentication/wrapper.mtml (revision 922)
@@ -0,0 +1,35 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" id="sixapart-standard">
+<head>
+    <title><$mt:BlogName encode_html="1"$></title>
+    <meta http-equiv="Content-Type" content="text/html; charset=<$mt:PublishCharset$>" />
+    <script type="text/javascript" src="<$mt:Link template="JavaScript"$>"></script>
+</head>
+<body>
+
+    <h1><a href="<$mt:BlogURL$>"><$mt:BlogName encode_html="1"$></a> <__trans phrase="(Vanilla + Authentication)"></h1>
+
+    <div id="signin-content">
+        <a href="javascript:void(0)" onclick="return mtSignInOnClick('signin-content')"><__trans phrase="Sign In"></a>
+    </div>
+
+<!-- end header --><hr />
+
+
+    <$mt:Var name="contents"$>
+
+
+<!-- start footer --><hr />
+
+    <p><__trans phrase="_POWERED_BY"> and the Vanilla template set</p>
+
+<script type="text/javascript">
+/* <![CDATA[ */
+mtAttachEvent('usersignin', mtUpdateSignInWidget);
+mtUpdateSignInWidget();
+/* ]]> */
+</script>
+
+</body>
+</html>
Index: trunk/Vanilla/plugins/Vanilla/templates/vanilla+authentication/javascript.mtml
===================================================================
--- trunk/Vanilla/plugins/Vanilla/templates/vanilla+authentication/javascript.mtml (revision 919)
+++ trunk/Vanilla/plugins/Vanilla/templates/vanilla+authentication/javascript.mtml (revision 919)
@@ -0,0 +1,487 @@
+<$mt:var name="user-auth" value="signin-content"$>
+<mt:Ignore>
+    Set show_userpic to 1 to enable userpics in the signin line
+    - Requires Community Solution
+    - Note: This will update username to link to Community Solution "edit profile" script. This script assumes that you are using profiles and thus links to "view profile" screen. If the template set is not using profiles then the Community Solution "Profile Edit" Global System Template should be updated.
+</mt:Ignore>
+<$mt:var name="show_userpic" value="1"$>
+
+/* Section *****************************************************************/
+
+// The cookie name to use for storing the blog-side comment session cookie.
+var mtCookieName = "<$mt:UserSessionCookieName$>";
+var mtCookieDomain = "<$mt:UserSessionCookieDomain$>";
+var mtCookiePath = "<$mt:UserSessionCookiePath$>";
+var mtCookieTimeout = <$mt:UserSessionCookieTimeout$>;
+var is_preview;
+var user;
+
+/* Login Functions *****************************************************************/
+
+<mt:Ignore>
+/***
+ * Issues a request to the MT comment script to retrieve the currently
+ * logged-in user (if any).
+ */
+</mt:Ignore>
+var mtFetchedUser = false;
+<mt:IfBlog>
+function mtFetchUser(cb) {
+    if (!cb) cb = 'mtSetUser';
+    if ( ( cb == 'mtSetUser' ) && mtGetUser() ) {
+        var url = document.URL;
+        url = url.replace(/#.+$/, '');
+        url += '#comments-open';
+        location.href = url;
+    } else {
+        // we aren't using AJAX for this, since we may have to request
+        // from a different domain. JSONP to the rescue.
+        mtFetchedUser = true;
+        var script = document.createElement('script');
+        var ts = new Date().getTime();
+        script.src = '<$mt:CGIPath$><$mt:CommentScript$>?__mode=session_js&blog_id=<$mt:BlogID$>&jsonp=' + cb + '&ts=' + ts;
+        (document.getElementsByTagName('head'))[0].appendChild(script);
+    }
+}
+</mt:IfBlog>
+
+<mt:Ignore>
+/***
+ * A routine that displays various phrases based upon users authenticated status
+ */
+</mt:Ignore>
+
+// <a href="#">Signin</a>
+// You are signed in as <a href="#">UserName</a> (<a href="#">Sign out</a>)
+// You do not have permission to sign in to this blog
+
+function mtUpdateSignInWidget(u) {
+    var el = document.getElementById('<$mt:var name="user-auth"$>');
+    var content = '';
+    var doit = 1;
+    if (!el) return;
+    if (u) {
+        if (u && u.is_authenticated) {
+            user = u;
+            mtSaveUser();
+        } else {
+            // user really isn't logged in; so let's do this!
+            return mtSignIn();
+        }
+    } else {
+        u = mtGetUser();
+    }
+    if (u && u.name) {
+<mt:If name="show_userpic">
+        if (u.userpic)
+            content += '<img src="' + u.userpic + '" width="50" height="50" />';
+</mt:If>
+        var url;
+        if (u.is_authenticated) {
+            if (u.is_author) {
+<mt:If name="show_userpic">
+                url = '<$mt:CGIPath$><$mt:CommunityScript$>?__mode=edit&blog_id=<$mt:BlogID$>';
+                url += '&return_to=' + encodeURIComponent(document.URL);
+<mt:Else>
+                url = '<$mt:CGIPath$><$mt:CommentScript$>?__mode=edit_profile&blog_id=<$mt:BlogID$>';
+                url += '&static=' + encodeURIComponent( location.href );
+</mt:If>
+            } else {
+                url = u.url;
+            }
+        } else if (u.url) {
+            url = u.url;
+        } else {
+            url = null;
+        }
+        content += '<__trans phrase="You are signed in as " escape="js">';
+        if (url)
+            content += '<a href="' + url + '">' + u.name + '</a>';
+        else
+            content += u.name;
+        content += '.  (<a href="javascript:void(0)" onclick="return mtSignOutOnClick()"><__trans phrase="sign out" escape="js"></a>)';
+    } else if (u && u.is_banned) {
+        content = '<__trans phrase="You do not have permission to sign in to this blog." escape="js">';
+    } else {
+    //    content = '<a href="javascript:void(0)" onclick="return mtSignInOnClick(\'<$mt:var name="user-auth"$>\')"><__trans phrase="Sign In" escape="js"></a>';
+        doit = 0;
+    }
+    if (doit) {
+        el.innerHTML = content;
+    }
+}
+
+<mt:IfBlog>
+<mt:IfRegistrationAllowed>
+/***
+ * If request contains a '#_login' or '#_logout' hash, use this to
+ * also delete the blog-side user cookie, since we're coming back from
+ * a login, logout or edit profile operation.
+ */
+var clearCookie = ( window.location.hash && window.location.hash.match( /^#_log(in|out)/ ) ) ? true : false;
+if (clearCookie) {
+    // clear any logged in state
+    mtClearUser();
+    if (RegExp.$1 == 'in')
+        mtFetchUser();
+} else {
+    <mt:Ignore>
+    /***
+     * Uncondition this call to fetch the current user state (if available)
+     * from MT upon page load if no user cookie is already present.
+     * This is okay if you have a private install, such as an Intranet;
+     * not recommended for public web sites!
+     */
+    </mt:Ignore>
+    if ( is_preview && !user )
+        mtFetchUser();
+}
+</mt:IfRegistrationAllowed>
+</mt:IfBlog>
+
+<mt:Ignore>
+/***
+ * Retrieves an object of the currently logged in user's state.
+ * If no user is logged in or cookied, this will return null.
+ */
+</mt:Ignore>
+function mtGetUser() {
+    if (!user) {
+        var cookie = mtGetCookie(mtCookieName);
+        if (!cookie) return;
+        user = mtUnbakeUserCookie(cookie);
+        if (! user) {
+            user = {};
+            user.is_anonymous = true;
+            user.can_post = false;
+            user.is_author = false;
+            user.is_banned = false;
+            user.is_trusted = false;
+        }
+    }
+    return user;
+}
+
+<mt:Ignore>
+/***
+ * Assigns a user object as the actively logged in user; also saves the
+ * user information in a browser cookie.
+ */
+</mt:Ignore>
+function mtSetUser(u) {
+    if (u) {
+        // persist this
+        user = u;
+        mtSaveUser();
+        // sync up user greeting
+        mtFireEvent('usersignin');
+    }
+}
+
+<mt:Ignore>
+/***
+ * Handles the action of the "Sign in" link. First clears any existing
+ * user cookie, then directs to the MT comment script to sign the user in.
+ */
+</mt:Ignore>
+function mtSignIn() {
+    var doc_url = document.URL;
+    doc_url = doc_url.replace(/#.+/, '');
+    var url = '<$mt:SignInLink$>';
+    if (is_preview) {
+        if ( document['comments_form'] ) {
+            var entry_id = document['comments_form'].entry_id.value;
+            url += '&entry_id=' + entry_id;
+        } else {
+            url += '&return_url=<$mt:BlogURL encode_url="1"$>';
+        }
+    } else {
+        url += '&return_url=' + encodeURIComponent(doc_url);
+    }
+    mtClearUser();
+    location.href = url;
+}
+
+function mtSignInOnClick(sign_in_element) {
+    var el;
+    if (sign_in_element) {
+        // display throbber
+        el = document.getElementById(sign_in_element);
+        if (!el)  // legacy MT 4.x element id
+            el = document.getElementById('comment-form-external-auth');
+    }
+    if (el)
+        el.innerHTML = '<__trans phrase="Signing in..." escape="js"> <span class="status-indicator">&nbsp;</span>';
+
+    mtClearUser(); // clear any 'anonymous' user cookie to allow sign in
+    mtFetchUser('mtSetUserOrLogin');
+    return false;
+}
+
+function mtSetUserOrLogin(u) {
+    if (u && u.is_authenticated) {
+        mtSetUser(u);
+    } else {
+        // user really isn't logged in; so let's do this!
+        mtSignIn();
+    }
+}
+
+<mt:Ignore>
+/***
+ * Handles sign out from the web site.
+ * First clears any existing user cookie, then direts to the MT comment
+ * script to sign the user out.
+ */
+</mt:Ignore>
+function mtSignOut(entry_id) {
+    mtClearUser();
+    var doc_url = document.URL;
+    doc_url = doc_url.replace(/#.+/, '');
+    var url = '<$mt:SignOutLink$>';
+    if (is_preview) {
+        if ( document['comments_form'] ) {
+            var entry_id = document['comments_form'].entry_id.value;
+            url += '&entry_id=' + entry_id;
+        } else {
+            url += '&return_url=<$mt:BlogURL encode_url="1"$>';
+        }
+    } else {
+        url += '&return_url=' + encodeURIComponent(doc_url);
+    }
+    location.href = url;
+}
+
+<mt:Ignore>
+/***
+ * Handles the action of the "Sign out" link.
+ */
+</mt:Ignore>
+function mtSignOutOnClick() {
+    mtSignOut();
+    return false;
+}
+
+
+
+/* Cookie *****************************************************************/
+
+<mt:Ignore>
+/***
+ * Persists a copy of the current user cookie into the browser cookie stash.
+ */
+</mt:Ignore>
+function mtSaveUser(f) {
+    // We can't reliably store the user cookie during a preview.
+    if (is_preview) return;
+
+    var u = mtGetUser();
+
+    if (f && (!u || u.is_anonymous)) {
+        if ( !u ) {
+            u = {};
+            u.is_authenticated = false;
+            u.can_comment = true;
+            u.is_author = false;
+            u.is_banned = false;
+            u.is_anonymous = true;
+            u.is_trusted = false;
+        }
+        if (f.author != undefined) u.name = f.author.value;
+        if (f.email != undefined) u.email = f.email.value;
+        if (f.url != undefined) u.url = f.url.value;
+    }
+
+    if (!u) return;
+
+    var cache_period = mtCookieTimeout * 1000;
+
+    // cache anonymous user info for a long period if the
+    // user has requested to be remembered
+    if (u.is_anonymous && f && f.bakecookie && f.bakecookie.checked)
+        cache_period = 365 * 24 * 60 * 60 * 1000;
+
+    var now = new Date();
+    mtFixDate(now);
+    now.setTime(now.getTime() + cache_period);
+
+    var cmtcookie = mtBakeUserCookie(u);
+    mtSetCookie(mtCookieName, cmtcookie, now, mtCookiePath, mtCookieDomain,
+        location.protocol == 'https:');
+}
+
+<mt:Ignore>
+/***
+ * Clears the blog-side user cookie.
+ */
+</mt:Ignore>
+function mtClearUser() {
+    user = null;
+    mtDeleteCookie(mtCookieName, mtCookiePath, mtCookieDomain,
+        location.protocol == 'https:');
+}
+
+<mt:Ignore>
+/***
+ * Sets a browser cookie.
+ */
+</mt:Ignore>
+function mtSetCookie(name, value, expires, path, domain, secure) {
+    if (domain && domain.match(/^\.?localhost$/))
+        domain = null;
+    var curCookie = name + "=" + escape(value) +
+        (expires ? "; expires=" + expires.toGMTString() : "") +
+        (path ? "; path=" + path : "") +
+        (domain ? "; domain=" + domain : "") +
+        (secure ? "; secure" : "");
+    document.cookie = curCookie;
+}
+
+<mt:Ignore>
+/***
+ * Retrieves a browser cookie.
+ */
+</mt:Ignore>
+function mtGetCookie(name) {
+    var prefix = name + '=';
+    var c = document.cookie;
+    var cookieStartIndex = c.indexOf(prefix);
+    if (cookieStartIndex == -1)
+        return '';
+    var cookieEndIndex = c.indexOf(";", cookieStartIndex + prefix.length);
+    if (cookieEndIndex == -1)
+        cookieEndIndex = c.length;
+    return unescape(c.substring(cookieStartIndex + prefix.length, cookieEndIndex));
+}
+
+<mt:Ignore>
+/***
+ * Deletes a browser cookie.
+ */
+</mt:Ignore>
+function mtDeleteCookie(name, path, domain, secure) {
+    if (mtGetCookie(name)) {
+        if (domain && domain.match(/^\.?localhost$/))
+            domain = null;
+        document.cookie = name + "=" +
+            (path ? "; path=" + path : "") +
+            (domain ? "; domain=" + domain : "") +
+            (secure ? "; secure" : "") +
+            "; expires=Thu, 01-Jan-70 00:00:01 GMT";
+    }
+}
+
+<mt:Ignore>
+/***
+ * Serializes a user object into a string, suitable for storing as a cookie.
+ */
+</mt:Ignore>
+function mtBakeUserCookie(u) {
+    var str = "";
+    if (u.name) str += "name:'" + mtEscapeJS(u.name) + "';";
+    if (u.url) str += "url:'" + mtEscapeJS(u.url) + "';";
+    if (u.email) str += "email:'" + mtEscapeJS(u.email) + "';";
+    if (u.auth_type) str += "auth_type:'" + u.auth_type + "';";
+    if (u.is_authenticated) str += "is_authenticated:'1';";
+    if (u.profile) str += "profile:'" + mtEscapeJS(u.profile) + "';";
+    if (u.userpic) str += "userpic:'" + mtEscapeJS(u.userpic) + "';";
+    if (u.sid) str += "sid:'" + mtEscapeJS(u.sid) + "';";
+    str += "is_trusted:'" + (u.is_trusted ? "1" : "0") + "';";
+    str += "is_author:'" + (u.is_author ? "1" : "0") + "';";
+    str += "is_banned:'" + (u.is_banned ? "1" : "0") + "';";
+    str += "can_post:'" + (u.can_post ? "1" : "0") + "';";
+    str += "can_comment:'" + (u.can_comment ? "1" : "0") + "';";
+    str = str.replace(/;$/, '');
+    return str;
+}
+
+<mt:Ignore>
+/***
+ * Unserializes a user cookie and returns a user object with the restored
+ * state.
+ */
+</mt:Ignore>
+function mtUnbakeUserCookie(s) {
+    if (!s) return;
+
+    var u = {};
+    var m;
+    while (m = s.match(/^((name|url|email|auth_type|is_authenticated|profile|userpic|sid|is_trusted|is_author|is_banned|can_post|can_comment):'([^']+?)';?)/)) {
+        s = s.substring(m[1].length);
+        if (m[2].match(/^(is|can)_/)) // boolean fields
+            u[m[2]] = m[3] == '1' ? true : false;
+        else
+            u[m[2]] = mtUnescapeJS(m[3]);
+    }
+    if (u.is_authenticated) {
+        u.is_anonymous = false;
+    } else {
+        u.is_anonymous = true;
+        u.can_post = false;
+        u.is_author = false;
+        u.is_banned = false;
+        u.is_trusted = false;
+    }
+    return u;
+}
+
+/* Utility Functions *****************************************************************/
+
+<mt:Ignore>
+/***
+ * Calls the event named, if there are handlers for it.
+ */
+</mt:Ignore>
+function mtFireEvent(eventName,param) {
+    var fn = window['on' + eventName];
+    if (typeof fn == 'function') return fn(param);
+    return;
+}
+
+function mtFixDate(date) {
+    var skew = (new Date(0)).getTime();
+    if (skew > 0)
+        date.setTime(date.getTime() - skew);
+}
+
+<mt:Ignore>
+/***
+ * Simple function that escapes single quote characters for storing
+ * in a cookie.
+ */
+</mt:Ignore>
+function mtEscapeJS(s) {
+    s = s.replace(/'/g, "&apos;");
+    return s;
+}
+
+<mt:Ignore>
+/***
+ * Simple function that unescapes single quote characters that were
+ * stored in a cookie.
+ */
+</mt:Ignore>
+function mtUnescapeJS(s) {
+    s = s.replace(/&apos;/g, "'");
+    return s;
+}
+
+<mt:Ignore>
+/***
+ * A utility function for assigning/adding handlers to window events.
+ */
+</mt:Ignore>
+function mtAttachEvent(eventName,func) {
+    var onEventName = 'on' + eventName;
+    var old = window[onEventName];
+    if( typeof old != 'function' )
+        window[onEventName] = func;
+    else {
+        window[onEventName] = function( evt ) {
+            old( evt );
+            return func( evt );
+        };
+    }
+}
+
+/* section *****************************************************************/
Index: trunk/Vanilla/plugins/Vanilla/templates/vanilla+pages/home.mtml
===================================================================
--- trunk/Vanilla/plugins/Vanilla/templates/vanilla+pages/home.mtml (revision 922)
+++ trunk/Vanilla/plugins/Vanilla/templates/vanilla+pages/home.mtml (revision 922)
@@ -0,0 +1,14 @@
+<mt:IncludeBlock module="Wrapper">
+
+    <mt:Entries>
+        <h2><a href="<$mt:EntryPermalink$>"><$mt:EntryTitle$></a></h2>
+        <p><__trans phrase="By [_1] on [_2]" params="<$mt:EntryAuthorLink$>%%<$mt:EntryDate format="%x %X"$>"></p>
+        <mt:If tag="EntryBody">
+            <$mt:EntryBody$>
+        </mt:If>
+        <mt:If tag="EntryMore" convert_breaks="0">
+            <em><__trans phrase="Continue reading <a href="[_1]">[_2]</a>." params="<$mt:EntryPermalink$>%%<$mt:EntryTitle$>"></em>
+        </mt:If>
+    </mt:Entries>
+
+</mt:IncludeBlock>
Index: trunk/Vanilla/plugins/Vanilla/templates/vanilla+pages/page.mtml
===================================================================
--- trunk/Vanilla/plugins/Vanilla/templates/vanilla+pages/page.mtml (revision 922)
+++ trunk/Vanilla/plugins/Vanilla/templates/vanilla+pages/page.mtml (revision 922)
@@ -0,0 +1,12 @@
+<mt:IncludeBlock module="Wrapper">
+
+    <h1><$mt:PageTitle$></h1>
+    <p><__trans phrase="By [_1] on [_2]" params="<$mt:PageAuthorLink$>%%<$mt:PageDate format="%x %X"$>"></p>
+    <mt:If tag="PageBody">
+        <$mt:PageBody$>
+    </mt:If>
+    <mt:If tag="PageMore" convert_breaks="0">
+        <$mt:PageMore$>
+    </mt:If>
+
+</mt:IncludeBlock>
Index: trunk/Vanilla/plugins/Vanilla/templates/vanilla+pages/wrapper.mtml
===================================================================
--- trunk/Vanilla/plugins/Vanilla/templates/vanilla+pages/wrapper.mtml (revision 922)
+++ trunk/Vanilla/plugins/Vanilla/templates/vanilla+pages/wrapper.mtml (revision 922)
@@ -0,0 +1,31 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" id="sixapart-standard">
+<head>
+    <title><$mt:BlogName encode_html="1"$></title>
+    <meta http-equiv="Content-Type" content="text/html; charset=<$mt:PublishCharset$>" />
+</head>
+<body>
+
+    <h1><a href="<$mt:BlogURL$>"><$mt:BlogName encode_html="1"$></a> <__trans phrase="(Vanilla + Pages)"></h1>
+
+    <h3><__trans phrase="Navigation"></h3>
+    <ul>
+        <li><a href="<$mt:Link template="home"$>"><__trans phrase="Home"></a></li>
+        <mt:Pages>
+            <li><a href="<$mt:PagePermalink$>"><$mt:PageTitle$></a></li>
+        </mt:Pages>
+    </ul>
+
+<!-- end header --><hr />
+
+
+    <$mt:Var name="contents"$>
+
+
+<!-- start footer --><hr />
+
+    <p><__trans phrase="_POWERED_BY"> and the Vanilla template set</p>
+
+</body>
+</html>
Index: trunk/Vanilla/plugins/Vanilla/templates/vanilla+pages/entry.mtml
===================================================================
--- trunk/Vanilla/plugins/Vanilla/templates/vanilla+pages/entry.mtml (revision 922)
+++ trunk/Vanilla/plugins/Vanilla/templates/vanilla+pages/entry.mtml (revision 922)
@@ -0,0 +1,12 @@
+<mt:IncludeBlock module="Wrapper">
+
+    <h1><$mt:EntryTitle$></h1>
+    <p><__trans phrase="By [_1] on [_2]" params="<$mt:EntryAuthorLink$>%%<$mt:EntryDate format="%x %X"$>"></p>
+    <mt:If tag="EntryBody">
+        <$mt:EntryBody$>
+    </mt:If>
+    <mt:If tag="EntryMore" convert_breaks="0">
+        <$mt:EntryMore$>
+    </mt:If>
+
+</mt:IncludeBlock>
Index: trunk/Vanilla/plugins/Vanilla/templates/vanilla+search+tags/home.mtml
===================================================================
--- trunk/Vanilla/plugins/Vanilla/templates/vanilla+search+tags/home.mtml (revision 924)
+++ trunk/Vanilla/plugins/Vanilla/templates/vanilla+search+tags/home.mtml (revision 924)
@@ -0,0 +1,37 @@
+<mt:IncludeBlock module="Wrapper">
+    
+    <mt:setvarblock name="html_head" append="1">
+        <style type="text/css" media="screen">
+            .tagcloud {
+/*                float: right;*/
+/*                width: 30%;*/
+                list-style: none;
+            }
+            .tagcloud .tag {
+                display: inline;
+            }
+            .tag-1 { font-size: 26px;}
+            .tag-2 { font-size: 24px;}
+            .tag-3 { font-size: 22px;}
+            .tag-4 { font-size: 20px;}
+            .tag-5 { font-size: 18px;}
+            .tag-6 { font-size: 16px;}
+        </style>
+    </mt:setvarblock>
+    
+    <h3><__trans phrase="Tag Cloud"></h3>
+    <ul class="tagcloud">
+        <mt:Tags>
+            <li class="tag tag-<$mt:TagRank$>"><a href="<$mt:TagSearchLink$>"><$mt:TagName$> (<$mt:TagCount$>)</a></li>
+        </mt:Tags>
+    </ul>
+
+    <h3><__trans phrase="Search"></h3>
+    <form method="get" action="<$mt:CGIPath$><$mt:SearchScript$>">
+        <input type="text" name="search" value="<$mt:SearchString$>" />
+        <input type="hidden" name="IncludeBlogs" value="<$mt:BlogID$>" />
+        <input type="hidden" name="limit" value="<$mt:SearchMaxResults$>" />
+        <input type="submit" value="<__trans phrase="Search">" />
+    </form>
+
+</mt:IncludeBlock>
Index: trunk/Vanilla/plugins/Vanilla/templates/vanilla+search+tags/page.mtml
===================================================================
--- trunk/Vanilla/plugins/Vanilla/templates/vanilla+search+tags/page.mtml (revision 924)
+++ trunk/Vanilla/plugins/Vanilla/templates/vanilla+search+tags/page.mtml (revision 924)
@@ -0,0 +1,12 @@
+<mt:IncludeBlock module="Wrapper">
+
+    <h1><$mt:PageTitle$></h1>
+    <p><__trans phrase="By [_1] on [_2]" params="<$mt:PageAuthorLink$>%%<$mt:PageDate format="%x %X"$>"></p>
+    <mt:If tag="PageBody">
+        <$mt:PageBody$>
+    </mt:If>
+    <mt:If tag="PageMore" convert_breaks="0">
+        <$mt:PageMore$>
+    </mt:If>
+
+</mt:IncludeBlock>
Index: trunk/Vanilla/plugins/Vanilla/templates/vanilla+search+tags/wrapper.mtml
===================================================================
--- trunk/Vanilla/plugins/Vanilla/templates/vanilla+search+tags/wrapper.mtml (revision 924)
+++ trunk/Vanilla/plugins/Vanilla/templates/vanilla+search+tags/wrapper.mtml (revision 924)
@@ -0,0 +1,25 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" id="sixapart-standard">
+<head>
+    <title><$mt:BlogName encode_html="1"$></title>
+    <meta http-equiv="Content-Type" content="text/html; charset=<$mt:PublishCharset$>" />
+    <$mt:Var name="html_head"$>
+    <script type="text/javascript" src="<$mt:Link template="JavaScript"$>"></script>
+</head>
+<body>
+
+    <h1><a href="<$mt:BlogURL$>"><$mt:BlogName encode_html="1"$></a> <__trans phrase="(Vanilla + Tags)"></h1>
+
+<!-- end header --><hr />
+
+
+    <$mt:Var name="contents"$>
+
+
+<!-- start footer --><hr />
+
+    <p><__trans phrase="_POWERED_BY"> and the Vanilla template set</p>
+
+</body>
+</html>
Index: trunk/Vanilla/plugins/Vanilla/templates/vanilla+search+tags/entry.mtml
===================================================================
--- trunk/Vanilla/plugins/Vanilla/templates/vanilla+search+tags/entry.mtml (revision 929)
+++ trunk/Vanilla/plugins/Vanilla/templates/vanilla+search+tags/entry.mtml (revision 929)
@@ -0,0 +1,22 @@
+<mt:IncludeBlock module="Wrapper">
+
+    <h1><$mt:EntryTitle$></h1>
+    <p><__trans phrase="By [_1] on [_2]" params="<$mt:EntryAuthorLink$>%%<$mt:EntryDate format="%x %X"$>"></p>
+    <mt:If tag="EntryBody">
+        <$mt:EntryBody$>
+    </mt:If>
+    <mt:If tag="EntryMore" convert_breaks="0">
+        <$mt:EntryMore$>
+    </mt:If>
+    <mt:EntryTags glue=", "><$mt:TagLabel$></mt:EntryTags>
+
+    <mt:If tag="EntryTags">
+        <h3>Tags</h3>
+        <ul>
+        <mt:EntryTags>
+            <li><a href="<$MTTagSearchLink$>&amp;IncludeBlogs=<$MTBlogID$>" rel="tag nofollow"><$MTTagName$></a></li>
+        </mt:EntryTags>
+        </ul>
+    </mt:If>
+
+</mt:IncludeBlock>
Index: trunk/Vanilla/plugins/Vanilla/templates/vanilla+search+tags/javascript.mtml
===================================================================
--- trunk/Vanilla/plugins/Vanilla/templates/vanilla+search+tags/javascript.mtml (revision 924)
+++ trunk/Vanilla/plugins/Vanilla/templates/vanilla+search+tags/javascript.mtml (revision 924)
@@ -0,0 +1,518 @@
+<$mt:var name="user-auth" value="signin-content"$>
+<mt:Ignore>
+    Set show_userpic to 1 to enable userpics in the signin line
+    - Requires Community Solution
+    - Note: This will update username to link to Community Solution "edit profile" script. This script assumes that you are using profiles and thus links to "view profile" screen. If the template set is not using profiles then the Community Solution "Profile Edit" Global System Template should be updated.
+</mt:Ignore>
+<$mt:var name="show_userpic" value="1"$>
+
+/* Section *****************************************************************/
+
+// The cookie name to use for storing the blog-side comment session cookie.
+var mtCookieName = "<$mt:UserSessionCookieName$>";
+var mtCookieDomain = "<$mt:UserSessionCookieDomain$>";
+var mtCookiePath = "<$mt:UserSessionCookiePath$>";
+var mtCookieTimeout = <$mt:UserSessionCookieTimeout$>;
+var is_preview;
+var user;
+
+/* Login Functions *****************************************************************/
+
+<mt:Ignore>
+/***
+ * Issues a request to the MT comment script to retrieve the currently
+ * logged-in user (if any).
+ */
+</mt:Ignore>
+var mtFetchedUser = false;
+<mt:IfBlog>
+function mtFetchUser(cb) {
+    if (!cb) cb = 'mtSetUser';
+    if ( ( cb == 'mtSetUser' ) && mtGetUser() ) {
+        var url = document.URL;
+        url = url.replace(/#.+$/, '');
+        url += '#comments-open';
+        location.href = url;
+    } else {
+        // we aren't using AJAX for this, since we may have to request
+        // from a different domain. JSONP to the rescue.
+        mtFetchedUser = true;
+        var script = document.createElement('script');
+        var ts = new Date().getTime();
+        script.src = '<$mt:CGIPath$><$mt:CommentScript$>?__mode=session_js&blog_id=<$mt:BlogID$>&jsonp=' + cb + '&ts=' + ts;
+        (document.getElementsByTagName('head'))[0].appendChild(script);
+    }
+}
+</mt:IfBlog>
+
+<mt:Ignore>
+/***
+ * A routine that displays various phrases based upon users authenticated status
+ */
+</mt:Ignore>
+
+// <a href="#">Signin</a>
+// You are signed in as <a href="#">UserName</a> (<a href="#">Sign out</a>)
+// You do not have permission to sign in to this blog
+
+function mtUpdateSignInWidget(u) {
+    var el = document.getElementById('<$mt:var name="user-auth"$>');
+    var content = '';
+    var doit = 1;
+    if (!el) return;
+    if (u) {
+        if (u && u.is_authenticated) {
+            user = u;
+            mtSaveUser();
+        } else {
+            // user really isn't logged in; so let's do this!
+            return mtSignIn();
+        }
+    } else {
+        u = mtGetUser();
+    }
+    if (u && u.name) {
+<mt:If name="show_userpic">
+        if (u.userpic)
+            content += '<img src="' + u.userpic + '" width="50" height="50" />';
+</mt:If>
+        var url;
+        if (u.is_authenticated) {
+            if (u.is_author) {
+<mt:If name="show_userpic">
+                url = '<$mt:CGIPath$><$mt:CommunityScript$>?__mode=edit&blog_id=<$mt:BlogID$>';
+                url += '&return_to=' + encodeURIComponent(document.URL);
+<mt:Else>
+                url = '<$mt:CGIPath$><$mt:CommentScript$>?__mode=edit_profile&blog_id=<$mt:BlogID$>';
+                url += '&static=' + encodeURIComponent( location.href );
+</mt:If>
+            } else {
+                url = u.url;
+            }
+        } else if (u.url) {
+            url = u.url;
+        } else {
+            url = null;
+        }
+        content += '<__trans phrase="You are signed in as " escape="js">';
+        if (url)
+            content += '<a href="' + url + '">' + u.name + '</a>';
+        else
+            content += u.name;
+        content += '.  (<a href="javascript:void(0)" onclick="return mtSignOutOnClick()"><__trans phrase="sign out" escape="js"></a>)';
+    } else if (u && u.is_banned) {
+        content = '<__trans phrase="You do not have permission to sign in to this blog." escape="js">';
+    } else {
+    //    content = '<a href="javascript:void(0)" onclick="return mtSignInOnClick(\'<$mt:var name="user-auth"$>\')"><__trans phrase="Sign In" escape="js"></a>';
+        doit = 0;
+    }
+    if (doit) {
+        el.innerHTML = content;
+    }
+}
+
+<mt:IfBlog>
+<mt:IfRegistrationAllowed>
+/***
+ * If request contains a '#_login' or '#_logout' hash, use this to
+ * also delete the blog-side user cookie, since we're coming back from
+ * a login, logout or edit profile operation.
+ */
+var clearCookie = ( window.location.hash && window.location.hash.match( /^#_log(in|out)/ ) ) ? true : false;
+if (clearCookie) {
+    // clear any logged in state
+    mtClearUser();
+    if (RegExp.$1 == 'in')
+        mtFetchUser();
+} else {
+    <mt:Ignore>
+    /***
+     * Uncondition this call to fetch the current user state (if available)
+     * from MT upon page load if no user cookie is already present.
+     * This is okay if you have a private install, such as an Intranet;
+     * not recommended for public web sites!
+     */
+    </mt:Ignore>
+    if ( is_preview && !user )
+        mtFetchUser();
+}
+</mt:IfRegistrationAllowed>
+</mt:IfBlog>
+
+<mt:Ignore>
+/***
+ * Retrieves an object of the currently logged in user's state.
+ * If no user is logged in or cookied, this will return null.
+ */
+</mt:Ignore>
+function mtGetUser() {
+    if (!user) {
+        var cookie = mtGetCookie(mtCookieName);
+        if (!cookie) return;
+        user = mtUnbakeUserCookie(cookie);
+        if (! user) {
+            user = {};
+            user.is_anonymous = true;
+            user.can_post = false;
+            user.is_author = false;
+            user.is_banned = false;
+            user.is_trusted = false;
+        }
+    }
+    return user;
+}
+
+<mt:Ignore>
+/***
+ * Assigns a user object as the actively logged in user; also saves the
+ * user information in a browser cookie.
+ */
+</mt:Ignore>
+function mtSetUser(u) {
+    if (u) {
+        // persist this
+        user = u;
+        mtSaveUser();
+        // sync up user greeting
+        mtFireEvent('usersignin');
+    }
+}
+
+<mt:Ignore>
+/***
+ * Handles the action of the "Sign in" link. First clears any existing
+ * user cookie, then directs to the MT comment script to sign the user in.
+ */
+</mt:Ignore>
+function mtSignIn() {
+    var doc_url = document.URL;
+    doc_url = doc_url.replace(/#.+/, '');
+    var url = '<$mt:SignInLink$>';
+    if (is_preview) {
+        if ( document['comments_form'] ) {
+            var entry_id = document['comments_form'].entry_id.value;
+            url += '&entry_id=' + entry_id;
+        } else {
+            url += '&return_url=<$mt:BlogURL encode_url="1"$>';
+        }
+    } else {
+        url += '&return_url=' + encodeURIComponent(doc_url);
+    }
+    mtClearUser();
+    location.href = url;
+}
+
+function mtSignInOnClick(sign_in_element) {
+    var el;
+    if (sign_in_element) {
+        // display throbber
+        el = document.getElementById(sign_in_element);
+        if (!el)  // legacy MT 4.x element id
+            el = document.getElementById('comment-form-external-auth');
+    }
+    if (el)
+        el.innerHTML = '<__trans phrase="Signing in..." escape="js"> <span class="status-indicator">&nbsp;</span>';
+
+    mtClearUser(); // clear any 'anonymous' user cookie to allow sign in
+    mtFetchUser('mtSetUserOrLogin');
+    return false;
+}
+
+function mtSetUserOrLogin(u) {
+    if (u && u.is_authenticated) {
+        mtSetUser(u);
+    } else {
+        // user really isn't logged in; so let's do this!
+        mtSignIn();
+    }
+}
+
+<mt:Ignore>
+/***
+ * Handles sign out from the web site.
+ * First clears any existing user cookie, then direts to the MT comment
+ * script to sign the user out.
+ */
+</mt:Ignore>
+function mtSignOut(entry_id) {
+    mtClearUser();
+    var doc_url = document.URL;
+    doc_url = doc_url.replace(/#.+/, '');
+    var url = '<$mt:SignOutLink$>';
+    if (is_preview) {
+        if ( document['comments_form'] ) {
+            var entry_id = document['comments_form'].entry_id.value;
+            url += '&entry_id=' + entry_id;
+        } else {
+            url += '&return_url=<$mt:BlogURL encode_url="1"$>';
+        }
+    } else {
+        url += '&return_url=' + encodeURIComponent(doc_url);
+    }
+    location.href = url;
+}
+
+<mt:Ignore>
+/***
+ * Handles the action of the "Sign out" link.
+ */
+</mt:Ignore>
+function mtSignOutOnClick() {
+    mtSignOut();
+    return false;
+}
+
+
+
+/* Cookie *****************************************************************/
+
+<mt:Ignore>
+/***
+ * Persists a copy of the current user cookie into the browser cookie stash.
+ */
+</mt:Ignore>
+function mtSaveUser(f) {
+    // We can't reliably store the user cookie during a preview.
+    if (is_preview) return;
+
+    var u = mtGetUser();
+
+    if (f && (!u || u.is_anonymous)) {
+        if ( !u ) {
+            u = {};
+            u.is_authenticated = false;
+            u.can_comment = true;
+            u.is_author = false;
+            u.is_banned = false;
+            u.is_anonymous = true;
+            u.is_trusted = false;
+        }
+        if (f.author != undefined) u.name = f.author.value;
+        if (f.email != undefined) u.email = f.email.value;
+        if (f.url != undefined) u.url = f.url.value;
+    }
+
+    if (!u) return;
+
+    var cache_period = mtCookieTimeout * 1000;
+
+    // cache anonymous user info for a long period if the
+    // user has requested to be remembered
+    if (u.is_anonymous && f && f.bakecookie && f.bakecookie.checked)
+        cache_period = 365 * 24 * 60 * 60 * 1000;
+
+    var now = new Date();
+    mtFixDate(now);
+    now.setTime(now.getTime() + cache_period);
+
+    var cmtcookie = mtBakeUserCookie(u);
+    mtSetCookie(mtCookieName, cmtcookie, now, mtCookiePath, mtCookieDomain,
+        location.protocol == 'https:');
+}
+
+<mt:Ignore>
+/***
+ * Clears the blog-side user cookie.
+ */
+</mt:Ignore>
+function mtClearUser() {
+    user = null;
+    mtDeleteCookie(mtCookieName, mtCookiePath, mtCookieDomain,
+        location.protocol == 'https:');
+}
+
+<mt:Ignore>
+/***
+ * Sets a browser cookie.
+ */
+</mt:Ignore>
+function mtSetCookie(name, value, expires, path, domain, secure) {
+    if (domain && domain.match(/^\.?localhost$/))
+        domain = null;
+    var curCookie = name + "=" + escape(value) +
+        (expires ? "; expires=" + expires.toGMTString() : "") +
+        (path ? "; path=" + path : "") +
+        (domain ? "; domain=" + domain : "") +
+        (secure ? "; secure" : "");
+    document.cookie = curCookie;
+}
+
+<mt:Ignore>
+/***
+ * Retrieves a browser cookie.
+ */
+</mt:Ignore>
+function mtGetCookie(name) {
+    var prefix = name + '=';
+    var c = document.cookie;
+    var cookieStartIndex = c.indexOf(prefix);
+    if (cookieStartIndex == -1)
+        return '';
+    var cookieEndIndex = c.indexOf(";", cookieStartIndex + prefix.length);
+    if (cookieEndIndex == -1)
+        cookieEndIndex = c.length;
+    return unescape(c.substring(cookieStartIndex + prefix.length, cookieEndIndex));
+}
+
+<mt:Ignore>
+/***
+ * Deletes a browser cookie.
+ */
+</mt:Ignore>
+function mtDeleteCookie(name, path, domain, secure) {
+    if (mtGetCookie(name)) {
+        if (domain && domain.match(/^\.?localhost$/))
+            domain = null;
+        document.cookie = name + "=" +
+            (path ? "; path=" + path : "") +
+            (domain ? "; domain=" + domain : "") +
+            (secure ? "; secure" : "") +
+            "; expires=Thu, 01-Jan-70 00:00:01 GMT";
+    }
+}
+
+<mt:Ignore>
+/***
+ * Serializes a user object into a string, suitable for storing as a cookie.
+ */
+</mt:Ignore>
+function mtBakeUserCookie(u) {
+    var str = "";
+    if (u.name) str += "name:'" + mtEscapeJS(u.name) + "';";
+    if (u.url) str += "url:'" + mtEscapeJS(u.url) + "';";
+    if (u.email) str += "email:'" + mtEscapeJS(u.email) + "';";
+    if (u.auth_type) str += "auth_type:'" + u.auth_type + "';";
+    if (u.is_authenticated) str += "is_authenticated:'1';";
+    if (u.profile) str += "profile:'" + mtEscapeJS(u.profile) + "';";
+    if (u.userpic) str += "userpic:'" + mtEscapeJS(u.userpic) + "';";
+    if (u.sid) str += "sid:'" + mtEscapeJS(u.sid) + "';";
+    str += "is_trusted:'" + (u.is_trusted ? "1" : "0") + "';";
+    str += "is_author:'" + (u.is_author ? "1" : "0") + "';";
+    str += "is_banned:'" + (u.is_banned ? "1" : "0") + "';";
+    str += "can_post:'" + (u.can_post ? "1" : "0") + "';";
+    str += "can_comment:'" + (u.can_comment ? "1" : "0") + "';";
+    str = str.replace(/;$/, '');
+    return str;
+}
+
+<mt:Ignore>
+/***
+ * Unserializes a user cookie and returns a user object with the restored
+ * state.
+ */
+</mt:Ignore>
+function mtUnbakeUserCookie(s) {
+    if (!s) return;
+
+    var u = {};
+    var m;
+    while (m = s.match(/^((name|url|email|auth_type|is_authenticated|profile|userpic|sid|is_trusted|is_author|is_banned|can_post|can_comment):'([^']+?)';?)/)) {
+        s = s.substring(m[1].length);
+        if (m[2].match(/^(is|can)_/)) // boolean fields
+            u[m[2]] = m[3] == '1' ? true : false;
+        else
+            u[m[2]] = mtUnescapeJS(m[3]);
+    }
+    if (u.is_authenticated) {
+        u.is_anonymous = false;
+    } else {
+        u.is_anonymous = true;
+        u.can_post = false;
+        u.is_author = false;
+        u.is_banned = false;
+        u.is_trusted = false;
+    }
+    return u;
+}
+
+/* Utility Functions *****************************************************************/
+
+<mt:Ignore>
+/***
+ * Calls the event named, if there are handlers for it.
+ */
+</mt:Ignore>
+function mtFireEvent(eventName,param) {
+    var fn = window['on' + eventName];
+    if (typeof fn == 'function') return fn(param);
+    return;
+}
+
+function mtFixDate(date) {
+    var skew = (new Date(0)).getTime();
+    if (skew > 0)
+        date.setTime(date.getTime() - skew);
+}
+
+<mt:Ignore>
+/***
+ * Simple function that escapes single quote characters for storing
+ * in a cookie.
+ */
+</mt:Ignore>
+function mtEscapeJS(s) {
+    s = s.replace(/'/g, "&apos;");
+    return s;
+}
+
+<mt:Ignore>
+/***
+ * Simple function that unescapes single quote characters that were
+ * stored in a cookie.
+ */
+</mt:Ignore>
+function mtUnescapeJS(s) {
+    s = s.replace(/&apos;/g, "'");
+    return s;
+}
+
+<mt:Ignore>
+/***
+ * A utility function for assigning/adding handlers to window events.
+ */
+</mt:Ignore>
+function mtAttachEvent(eventName,func) {
+    var onEventName = 'on' + eventName;
+    var old = window[onEventName];
+    if( typeof old != 'function' )
+        window[onEventName] = func;
+    else {
+        window[onEventName] = function( evt ) {
+            old( evt );
+            return func( evt );
+        };
+    }
+}
+
+/* section *****************************************************************/
+
+/* Ajax Requests *****************************************************************/
+
+<mt:Ignore>
+/***
+ * Returns a XMLHttpRequest object (for Ajax operations).
+ */
+</mt:Ignore>
+function mtGetXmlHttp() {
+    if ( !window.XMLHttpRequest ) {
+        window.XMLHttpRequest = function() {
+            var types = [
+                "Microsoft.XMLHTTP",
+                "MSXML2.XMLHTTP.5.0",
+                "MSXML2.XMLHTTP.4.0",
+                "MSXML2.XMLHTTP.3.0",
+                "MSXML2.XMLHTTP"
+            ];
+
+            for ( var i = 0; i < types.length; i++ ) {
+                try {
+                    return new ActiveXObject( types[ i ] );
+                } catch( e ) {}
+            }
+
+            return undefined;
+        };
+    }
+    if ( window.XMLHttpRequest )
+        return new XMLHttpRequest();
+}
Index: trunk/Vanilla/plugins/Vanilla/templates/vanilla+search+tags/search_results.mtml
===================================================================
--- trunk/Vanilla/plugins/Vanilla/templates/vanilla+search+tags/search_results.mtml (revision 924)
+++ trunk/Vanilla/plugins/Vanilla/templates/vanilla+search+tags/search_results.mtml (revision 924)
@@ -0,0 +1,143 @@
+<mt:IncludeBlock module="Wrapper">
+
+<mt:Ignore><!-- Below Javascript adds ajax search capability --></mt:Ignore>
+<mt:SetVarBlock name="html_head" append="1">
+<script type="text/javascript">
+/* <![CDATA[ */
+var user = <$mt:UserSessionState$>;
+<mt:IfMoreResults>
+function getResults(page) {
+    page = parseInt(page);
+    if (timer) window.clearTimeout(timer);
+    var xh = mtGetXmlHttp();
+    if (!xh) return false;
+    var res = results[page];
+    if (!res) return;
+    var url = res['next_url'];
+    if (!url) return;
+
+    xh.open('GET', url + '&format=js', true);
+    xh.onreadystatechange = function() {
+        if ( xh.readyState == 4 ) {
+            if ( xh.status && ( xh.status != 200 ) ) {
+                // error - ignore
+            } else {
+                try {
+                    var page_results = eval("(" + xh.responseText + ")");
+                    if ( page_results['error'] == null )
+                        results[page + 1] = page_results['result'];
+                } catch (e) {
+                }
+            }
+        }
+    };
+    xh.send(null);
+}
+
+function swapContent(direction) {
+    if ( direction == undefined ) direction = 1;
+    var page_span = document.getElementById('current-page');
+    if (!page_span) return true;
+    var next_page = direction + parseInt(page_span.innerHTML);
+    var res = results[next_page];
+    if (!res) return true;
+    var content = res['content'];
+    if (!content) return true;
+    var div = document.getElementById('search-results');
+    if (!div) return true;
+    div.innerHTML = content;
+    timer = window.setTimeout("getResults(" + next_page + ")", 1*1000);
+    window.scroll(0, 0);
+    return false;
+}
+<mt:Else>
+    <mt:IfPreviousResults>
+function swapContent(direction) {
+	return true;
+}
+    </mt:IfPreviousResults>
+</mt:IfMoreResults>
+/* ]]> */
+</script>
+</mt:SetVarBlock>
+
+<mt:SetVarTemplate id="search_results" name="search_results">  
+    <mt:SearchResults>
+        <mt:SearchResultsHeader>
+<div id="search-results">
+    <h1 id="page-title" class="search-results-header">
+        <mt:IfStraightSearch>
+        <__trans phrase="Results matching &ldquo;[_1]&rdquo;" params="<$mt:SearchString$>">
+        </mt:IfStraightSearch>
+        <mt:IfTagSearch>
+        <__trans phrase="Results tagged &ldquo;[_1]&rdquo;" params="<$mt:SearchString$>">
+        </mt:IfTagSearch>
+    </h1>
+    <div class="content-nav">
+        <span class="results-previous-link"><mt:IfPreviousResults><a href="<$mt:PreviousLink$>" rel="prev" onclick="return swapContent(-1);">&laquo; <__trans phrase="Previous"></a><mt:else>&laquo; <__trans phrase="Previous"></mt:IfPreviousResults></span>&nbsp;&nbsp;<mt:PagerBlock><mt:IfCurrentPage><strong class="results-current-page"><$mt:Var name="__value__"$></strong><mt:Else><a href="<$mt:PagerLink$>"><$mt:Var name="__value__"$></a></mt:IfCurrentPage><mt:Unless name="__last__">&nbsp;</mt:Unless></mt:PagerBlock>&nbsp;&nbsp;<span class="results-previous-link"><mt:IfMoreResults><a href="<$mt:NextLink$>" rel="next" onclick="return swapContent();"><__trans phrase="Next"> &raquo;</a><mt:else><__trans phrase="Next"> &raquo;</mt:IfMoreResults></span>
+    </div>
+    <div class="search-results-container autopagerize_page_element">
+        </mt:SearchResultsHeader>
+        <h2><a href="<$mt:EntryPermalink$>"><$mt:EntryTitle$></a></h2>
+        <p><__trans phrase="By [_1] on [_2]" params="<$mt:EntryAuthorLink$>%%<$mt:EntryDate format="%x %X"$>"></p>
+        <mt:If tag="EntryBody">
+            <$mt:EntryBody$>
+        </mt:If>
+        <mt:If tag="EntryMore" convert_breaks="0">
+            <em><__trans phrase="Continue reading <a href="[_1]">[_2]</a>." params="<$mt:EntryPermalink$>%%<$mt:EntryTitle$>"></em>
+        </mt:If>
+        <mt:SearchResultsFooter>
+    </div>
+    <mt:Ignore>autopagerize_insert_before - Used with the ajax search capability of the new search class</mt:Ignore>
+    <div class="autopagerize_insert_before"></div>
+    <div class="content-nav">
+        <span class="results-previous-link"><mt:IfPreviousResults><a href="<$mt:PreviousLink$>" rel="prev" onclick="return swapContent(-1);">&laquo; <__trans phrase="Previous"></a><mt:else>&laquo; <__trans phrase="Previous"></mt:IfPreviousResults></span>&nbsp;&nbsp;<mt:PagerBlock><mt:IfCurrentPage><strong class="results-current-page"><$mt:Var name="__value__"$></strong><mt:Else><a href="<$mt:PagerLink$>"><$mt:Var name="__value__"$></a></mt:IfCurrentPage><mt:Unless name="__last__">&nbsp;</mt:Unless></mt:PagerBlock>&nbsp;&nbsp;<span class="results-previous-link"><mt:IfMoreResults><a href="<$mt:NextLink$>" rel="next" onclick="return swapContent();"><__trans phrase="Next"> &raquo;</a><mt:else><__trans phrase="Next"> &raquo;</mt:IfMoreResults></span>
+    </div>
+</div>
+        </mt:SearchResultsFooter>
+    </mt:SearchResults>
+</mt:SetVarTemplate>
+<$mt:Var name="search_results"$>
+
+<mt:NoSearchResults>
+<h1 id="page-title" class="search-results-header">
+    <mt:IfStraightSearch>
+    <__trans phrase="Results matching &ldquo;[_1]&rdquo;" params="<$mt:SearchString$>">
+    </mt:IfStraightSearch>
+    <mt:IfTagSearch>
+    <__trans phrase="Results tagged &ldquo;[_1]&rdquo;" params="<$mt:SearchString$>">
+    </mt:IfTagSearch>
+</h1>
+<p><__trans phrase="No results found for &ldquo;[_1]&rdquo;." params="<$mt:SearchString$>"></p>
+</mt:NoSearchResults>
+
+<mt:NoSearch>
+<h1 id="page-title" class="search-results-header"><__trans phrase="Instructions"></h1>
+<p><__trans phrase="By default, this search engine looks for all words in any order. To search for an exact phrase, enclose the phrase in quotes:"></p>
+<blockquote>
+    <p><code>"<__trans phrase="movable type">"</code></p>
+</blockquote>
+<p><__trans phrase="The search engine also supports AND, OR, and NOT keywords to specify boolean expressions:"></p>
+<blockquote>
+    <p><code><__trans phrase="personal OR publishing"></code></p>
+    <p><code><__trans phrase="publishing NOT personal"></code></p>
+</blockquote>
+</mt:NoSearch>
+
+<mt:Ignore>Used with the ajax search capability of the new search class</mt:Ignore>
+<mt:IfMoreResults>
+<script type="text/javascript">
+<!--
+var div = document.getElementById('search-results');
+var results = {
+    '<$mt:CurrentPage$>': {
+        'content': div.innerHTML,
+        'next_url': '<$mt:NextLink$>'
+    }
+};
+var timer = window.setTimeout("getResults(" + <$mt:CurrentPage$> + ")", 1*1000);
+//-->
+</script>
+</mt:IfMoreResults>
+
+</mt:IncludeBlock>
Index: trunk/Vanilla/plugins/Vanilla/templates/vanilla+assets/home.mtml
===================================================================
--- trunk/Vanilla/plugins/Vanilla/templates/vanilla+assets/home.mtml (revision 929)
+++ trunk/Vanilla/plugins/Vanilla/templates/vanilla+assets/home.mtml (revision 929)
@@ -0,0 +1,40 @@
+<mt:IncludeBlock module="Wrapper">
+    
+    <mt:setvarblock name="html_head" append="1">
+        <style type="text/css" media="screen">            
+            .entry-thumbmail-image {
+                float: right;
+            }
+        </style>
+    </mt:setvarblock>
+
+    <mt:If tag="AssetCount">
+        <h3><__trans phrase="Recent Assets: 100 pixel height"></h3>
+        <mt:Assets type="image" lastn="10">
+        <a href="<$mt:AssetURL$>"><img src="<$mt:AssetThumbnailURL height="100"$>" alt="<$mt:AssetLabel$>" /></a>
+        </mt:Assets>
+
+        <h3><__trans phrase="Recent Assets: 50 pixel width"></h3>
+        <mt:Assets type="image" lastn="10">
+        <a href="<$mt:AssetURL$>"><img src="<$mt:AssetThumbnailURL width="50"$>" alt="<$mt:AssetLabel$>" /></a>
+        </mt:Assets>
+
+        <h3><__trans phrase="Recent Assets: 50 pixel square"></h3>
+        <mt:Assets type="image" lastn="10">
+        <a href="<$mt:AssetURL$>"><img src="<$mt:AssetThumbnailURL width="20" square="1"$>" alt="<$mt:AssetLabel$>" /></a>
+        </mt:Assets>
+    </mt:If>
+    
+
+    <h3><__trans phrase="Recent Entries (with the first asset added to each as 70 pixel square)"></h3>
+    <mt:Entries>
+        <h2><a href="<$mt:EntryPermalink$>"><$mt:EntryTitle$></a></h2>
+        <p><__trans phrase="By [_1] on [_2]" params="<$mt:EntryAuthorLink$>%%<$mt:EntryDate format="%x %X"$>"></p>
+        <mt:EntryAssets type="image" lastn="1" sort_order="ascend">
+        <a href="<$mt:EntryPermalink$>" class="entry-thumbmail-image"><img src="<$mt:AssetThumbnailURL width="70" square="1"$>" alt="<$mt:AssetLabel$>" /></a>
+        </mt:EntryAssets>
+        <p><$mt:EntryExcerpt$></p>
+        <p><em><__trans phrase="Read  <a href="[_1]">[_2]</a>" params="<$mt:EntryPermalink$>%%<$mt:EntryTitle$>"></em></p>
+    </mt:Entries>
+
+</mt:IncludeBlock>
Index: trunk/Vanilla/plugins/Vanilla/templates/vanilla+assets/wrapper.mtml
===================================================================
--- trunk/Vanilla/plugins/Vanilla/templates/vanilla+assets/wrapper.mtml (revision 929)
+++ trunk/Vanilla/plugins/Vanilla/templates/vanilla+assets/wrapper.mtml (revision 929)
@@ -0,0 +1,24 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" id="sixapart-standard">
+<head>
+    <title><$mt:BlogName encode_html="1"$></title>
+    <meta http-equiv="Content-Type" content="text/html; charset=<$mt:PublishCharset$>" />
+    <$mt:Var name="html_head"$>
+</head>
+<body>
+
+    <h1><a href="<$mt:BlogURL$>"><$mt:BlogName encode_html="1"$></a> + <__trans phrase="Assets"></h1>
+
+<!-- end header --><hr />
+
+
+    <$mt:Var name="contents"$>
+
+
+<!-- start footer --><hr />
+
+    <p><__trans phrase="_POWERED_BY"> and the Vanilla template set</p>
+
+</body>
+</html>
Index: trunk/Vanilla/plugins/Vanilla/templates/vanilla+assets/entry.mtml
===================================================================
--- trunk/Vanilla/plugins/Vanilla/templates/vanilla+assets/entry.mtml (revision 929)
+++ trunk/Vanilla/plugins/Vanilla/templates/vanilla+assets/entry.mtml (revision 929)
@@ -0,0 +1,12 @@
+<mt:IncludeBlock module="Wrapper">
+
+    <h1><$mt:EntryTitle$></h1>
+    <p><__trans phrase="By [_1] on [_2]" params="<$mt:EntryAuthorLink$>%%<$mt:EntryDate format="%x %X"$>"></p>
+    <mt:If tag="EntryBody">
+        <$mt:EntryBody$>
+    </mt:If>
+    <mt:If tag="EntryMore" convert_breaks="0">
+        <$mt:EntryMore$>
+    </mt:If>
+
+</mt:IncludeBlock>
Index: trunk/Vanilla/plugins/Vanilla/templates/vanilla+create-entry/home.mtml
===================================================================
--- trunk/Vanilla/plugins/Vanilla/templates/vanilla+create-entry/home.mtml (revision 922)
+++ trunk/Vanilla/plugins/Vanilla/templates/vanilla+create-entry/home.mtml (revision 922)
@@ -0,0 +1,14 @@
+<mt:IncludeBlock module="Wrapper">
+
+    <mt:Entries lastn="10">
+        <h2><a href="<$mt:EntryPermalink$>"><$mt:EntryTitle$></a></h2>
+        <p><__trans phrase="By [_1] on [_2]" params="<$mt:EntryAuthorLink$>%%<$mt:EntryDate format="%x %X"$>"></p>
+        <mt:If tag="EntryBody">
+            <$mt:EntryBody$>
+        </mt:If>
+        <mt:If tag="EntryMore" convert_breaks="0">
+            <em><__trans phrase="Continue reading <a href="[_1]">[_2]</a>." params="<$mt:EntryPermalink$>%%<$mt:EntryTitle$>"></em>
+        </mt:If>
+    </mt:Entries>
+
+</mt:IncludeBlock>
Index: trunk/Vanilla/plugins/Vanilla/templates/vanilla+create-entry/entry_response.mtml
===================================================================
--- trunk/Vanilla/plugins/Vanilla/templates/vanilla+create-entry/entry_response.mtml (revision 922)
+++ trunk/Vanilla/plugins/Vanilla/templates/vanilla+create-entry/entry_response.mtml (revision 922)
@@ -0,0 +1,15 @@
+<mt:IncludeBlock module="Wrapper">
+
+    <h1><__trans phrase="Thank you for posting an entry."></h1>
+
+    <mt:If name="entry_status" eq="1">
+        <p><__trans phrase="Your entry has been received and held for approval by the blog owner."></p>
+    <mt:Else name="entry_status" eq="2">
+        <p><__trans phrase="Your entry has been posted."></p>
+    <mt:Else>
+        <p><__trans phrase="Your entry has been received."></p>
+    </mt:If>
+
+    <p><__trans phrase="Return to the <a href="[_1]">blog's main index</a>." params="<$mt:BlogURL$>"></p>
+
+</mt:IncludeBlock>
Index: trunk/Vanilla/plugins/Vanilla/templates/vanilla+create-entry/wrapper.mtml
===================================================================
--- trunk/Vanilla/plugins/Vanilla/templates/vanilla+create-entry/wrapper.mtml (revision 922)
+++ trunk/Vanilla/plugins/Vanilla/templates/vanilla+create-entry/wrapper.mtml (revision 922)
@@ -0,0 +1,42 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" id="sixapart-standard">
+<head>
+    <title><$mt:BlogName encode_html="1"$></title>
+    <meta http-equiv="Content-Type" content="text/html; charset=<$mt:PublishCharset$>" />
+    <$mt:Var name="html_head"$>
+    <script type="text/javascript" src="<$mt:Link template="JavaScript"$>"></script>
+</head>
+<body>
+
+    <h1><a href="<$mt:BlogURL$>"><$mt:BlogName encode_html="1"$></a> <__trans phrase="(Vanilla + Create Entry)"></h1>
+
+    <div id="signin-content">
+        <a href="javascript:void(0)" onclick="return mtSignInOnClick('signin-content')"><__trans phrase="Sign In"></a>
+    </div>
+
+    <h3><__trans phrase="Navigation"></h3>
+    <ul>
+        <li><a href="<$mt:Link template="Homepage"$>"><__trans phrase="Home"></a></li>
+        <li><a href="<$mt:Link template="Create Entry"$>"><__trans phrase="Create Entry"></a></li>
+    </ul>
+
+<!-- end header --><hr />
+
+
+    <$mt:Var name="contents"$>
+
+
+<!-- start footer --><hr />
+
+    <p><__trans phrase="_POWERED_BY"> and the Vanilla template set</p>
+
+<script type="text/javascript">
+/* <![CDATA[ */
+mtAttachEvent('usersignin', mtUpdateSignInWidget);
+mtUpdateSignInWidget();
+/* ]]> */
+</script>
+
+</body>
+</html>
Index: trunk/Vanilla/plugins/Vanilla/templates/vanilla+create-entry/entry.mtml
===================================================================
--- trunk/Vanilla/plugins/Vanilla/templates/vanilla+create-entry/entry.mtml (revision 922)
+++ trunk/Vanilla/plugins/Vanilla/templates/vanilla+create-entry/entry.mtml (revision 922)
@@ -0,0 +1,12 @@
+<mt:IncludeBlock module="Wrapper">
+
+    <h1><$mt:EntryTitle$></h1>
+    <p><__trans phrase="By [_1] on [_2]" params="<$mt:EntryAuthorLink$>%%<$mt:EntryDate format="%x %X"$>"></p>
+    <mt:If tag="EntryBody">
+        <$mt:EntryBody$>
+    </mt:If>
+    <mt:If tag="EntryMore" convert_breaks="0">
+        <$mt:EntryMore$>
+    </mt:If>
+
+</mt:IncludeBlock>
Index: trunk/Vanilla/plugins/Vanilla/templates/vanilla+create-entry/create-entry.mtml
===================================================================
--- trunk/Vanilla/plugins/Vanilla/templates/vanilla+create-entry/create-entry.mtml (revision 922)
+++ trunk/Vanilla/plugins/Vanilla/templates/vanilla+create-entry/create-entry.mtml (revision 922)
@@ -0,0 +1,56 @@
+<mt:IncludeBlock module="Wrapper">
+
+    <mt:SetVarBlock name="html_head">
+    <script type="text/javascript">
+    <!-- 
+    function entry_create_loggedin() {
+        var u = mtGetUser();
+        var loggedin = u && u.is_authenticated && u.is_author ? true : false;
+        var eid = 'logged_in';
+        conditional_block(loggedin, eid);
+        if (!loggedin) {
+            var p = document.getElementById('login_message');
+            if (!p) return;
+            if (u && !u.is_author) 
+                p.innerHTML = "<__trans phrase="In order to create an entry on this blog you must first register.">";
+            else
+                if (u && !u.can_post)
+                    p.innerHTML = "<__trans phrase="You do not have permission to post.">";
+                else
+                    p.innerHTML = '<a href="javascript:void(0)" onclick="return mtSignInOnClick(\'login_message\')"><__trans phrase="Sign in to create an entry." escape="js"></a>';
+        } else {
+            var mt = document.getElementById('magic_token');
+            if (mt) mt.value = u.sid;
+        }
+    }
+    //-->
+    </script>
+    </mt:SetVarBlock>
+
+    <h1><__trans phrase="Create Entry"></h1>
+
+    <mt:IfLoggedIn script="entry_create_loggedin" class="foo">
+        <form method="post" action="<$mt:CGIPath$><$mt:CommunityScript$>" name="entry_form" id="create-entry-form" enctype="multipart/form-data">
+            <input type="hidden" name="__mode" value="post" />
+            <input type="hidden" name="blog_id" value="<$mt:BlogID$>" />
+            <input type="hidden" id="magic_token" name="magic_token" value="" />
+            <div>
+                <label for="entry-title"><__trans phrase="Title"></label>
+                <input id="entry-title" class="ti" name="title" />
+            </div>
+            <div>
+                <label for="entry-title"><__trans phrase="Body"></label>
+                <textarea id="entry-body" class="ta" name="text" rows="15" cols="50"></textarea>
+            </div>
+            <input type="submit" accesskey="s" name="post" id="entry-submit" value="<__trans phrase="Submit">" />
+        </form>
+    <mt:Else>
+        <p id="login_message"></p>
+    </mt:IfLoggedIn>
+    <script type="text/javascript">
+    <!--
+    mtAttachEvent('usersignin', entry_create_loggedin);
+    //-->
+    </script>
+
+</mt:IncludeBlock>
Index: trunk/Vanilla/plugins/Vanilla/templates/vanilla+create-entry/javascript.mtml
===================================================================
--- trunk/Vanilla/plugins/Vanilla/templates/vanilla+create-entry/javascript.mtml (revision 919)
+++ trunk/Vanilla/plugins/Vanilla/templates/vanilla+create-entry/javascript.mtml (revision 919)
@@ -0,0 +1,659 @@
+<$mt:var name="user-auth" value="signin-content"$>
+<mt:Ignore>
+    Set show_userpic to 1 to enable userpics in the signin line
+    - Requires Community Solution
+    - Note: This will update username to link to Community Solution "edit profile" script. This script assumes that you are using profiles and thus links to "view profile" screen. If the template set is not using profiles then the Community Solution "Profile Edit" Global System Template should be updated.
+</mt:Ignore>
+<$mt:var name="show_userpic" value="0"$>
+
+/* Section *****************************************************************/
+
+// The cookie name to use for storing the blog-side comment session cookie.
+var mtCookieName = "<$mt:UserSessionCookieName$>";
+var mtCookieDomain = "<$mt:UserSessionCookieDomain$>";
+var mtCookiePath = "<$mt:UserSessionCookiePath$>";
+var mtCookieTimeout = <$mt:UserSessionCookieTimeout$>;
+var is_preview;
+var user;
+
+/* Login Functions *****************************************************************/
+
+<mt:Ignore>
+/***
+ * Issues a request to the MT comment script to retrieve the currently
+ * logged-in user (if any).
+ */
+</mt:Ignore>
+var mtFetchedUser = false;
+<mt:IfBlog>
+function mtFetchUser(cb) {
+    if (!cb) cb = 'mtSetUser';
+    if ( ( cb == 'mtSetUser' ) && mtGetUser() ) {
+        var url = document.URL;
+        url = url.replace(/#.+$/, '');
+        url += '#comments-open';
+        location.href = url;
+    } else {
+        // we aren't using AJAX for this, since we may have to request
+        // from a different domain. JSONP to the rescue.
+        mtFetchedUser = true;
+        var script = document.createElement('script');
+        var ts = new Date().getTime();
+        script.src = '<$mt:CGIPath$><$mt:CommentScript$>?__mode=session_js&blog_id=<$mt:BlogID$>&jsonp=' + cb + '&ts=' + ts;
+        (document.getElementsByTagName('head'))[0].appendChild(script);
+    }
+}
+</mt:IfBlog>
+
+<mt:Ignore>
+/***
+ * A routine that displays various phrases based upon users authenticated status
+ */
+</mt:Ignore>
+
+// <a href="#">Signin</a>
+// You are signed in as <a href="#">UserName</a> (<a href="#">Sign out</a>)
+// You do not have permission to sign in to this blog
+
+function mtUpdateSignInWidget(u) {
+    var el = document.getElementById('<$mt:var name="user-auth"$>');
+    var content = '';
+    var doit = 1;
+    if (!el) return;
+    if (u) {
+        if (u && u.is_authenticated) {
+            user = u;
+            mtSaveUser();
+        } else {
+            // user really isn't logged in; so let's do this!
+            return mtSignIn();
+        }
+    } else {
+        u = mtGetUser();
+    }
+    if (u && u.name) {
+<mt:If name="show_userpic">
+        if (u.userpic)
+            content += '<img src="' + u.userpic + '" width="50" height="50" />';
+</mt:If>
+        var url;
+        if (u.is_authenticated) {
+            if (u.is_author) {
+<mt:If name="show_userpic">
+                url = '<$mt:CGIPath$><$mt:CommunityScript$>?__mode=edit&blog_id=<$mt:BlogID$>';
+                url += '&return_to=' + encodeURIComponent(document.URL);
+<mt:Else>
+                url = '<$mt:CGIPath$><$mt:CommentScript$>?__mode=edit_profile&blog_id=<$mt:BlogID$>';
+                url += '&static=' + encodeURIComponent( location.href );
+</mt:If>
+            } else {
+                url = u.url;
+            }
+        } else if (u.url) {
+            url = u.url;
+        } else {
+            url = null;
+        }
+        content += '<__trans phrase="You are signed in as " escape="js">';
+        if (url)
+            content += '<a href="' + url + '">' + u.name + '</a>';
+        else
+            content += u.name;
+        content += '.  (<a href="javascript:void(0)" onclick="return mtSignOutOnClick()"><__trans phrase="sign out" escape="js"></a>)';
+    } else if (u && u.is_banned) {
+        content = '<__trans phrase="You do not have permission to sign in to this blog." escape="js">';
+    } else {
+    //    content = '<a href="javascript:void(0)" onclick="return mtSignInOnClick(\'<$mt:var name="user-auth"$>\')"><__trans phrase="Sign In" escape="js"></a>';
+        doit = 0;
+    }
+    if (doit) {
+        el.innerHTML = content;
+    }
+}
+
+<mt:IfBlog>
+<mt:IfRegistrationAllowed>
+/***
+ * If request contains a '#_login' or '#_logout' hash, use this to
+ * also delete the blog-side user cookie, since we're coming back from
+ * a login, logout or edit profile operation.
+ */
+var clearCookie = ( window.location.hash && window.location.hash.match( /^#_log(in|out)/ ) ) ? true : false;
+if (clearCookie) {
+    // clear any logged in state
+    mtClearUser();
+    if (RegExp.$1 == 'in')
+        mtFetchUser();
+} else {
+    <mt:Ignore>
+    /***
+     * Uncondition this call to fetch the current user state (if available)
+     * from MT upon page load if no user cookie is already present.
+     * This is okay if you have a private install, such as an Intranet;
+     * not recommended for public web sites!
+     */
+    </mt:Ignore>
+    if ( is_preview && !user )
+        mtFetchUser();
+}
+</mt:IfRegistrationAllowed>
+</mt:IfBlog>
+
+<mt:Ignore>
+/***
+ * Retrieves an object of the currently logged in user's state.
+ * If no user is logged in or cookied, this will return null.
+ */
+</mt:Ignore>
+function mtGetUser() {
+    if (!user) {
+        var cookie = mtGetCookie(mtCookieName);
+        if (!cookie) return;
+        user = mtUnbakeUserCookie(cookie);
+        if (! user) {
+            user = {};
+            user.is_anonymous = true;
+            user.can_post = false;
+            user.is_author = false;
+            user.is_banned = false;
+            user.is_trusted = false;
+        }
+    }
+    return user;
+}
+
+<mt:Ignore>
+/***
+ * Assigns a user object as the actively logged in user; also saves the
+ * user information in a browser cookie.
+ */
+</mt:Ignore>
+function mtSetUser(u) {
+    if (u) {
+        // persist this
+        user = u;
+        mtSaveUser();
+        // sync up user greeting
+        mtFireEvent('usersignin');
+    }
+}
+
+<mt:Ignore>
+/***
+ * Handles the action of the "Sign in" link. First clears any existing
+ * user cookie, then directs to the MT comment script to sign the user in.
+ */
+</mt:Ignore>
+function mtSignIn() {
+    var doc_url = document.URL;
+    doc_url = doc_url.replace(/#.+/, '');
+    var url = '<$mt:SignInLink$>';
+    if (is_preview) {
+        if ( document['comments_form'] ) {
+            var entry_id = document['comments_form'].entry_id.value;
+            url += '&entry_id=' + entry_id;
+        } else {
+            url += '&return_url=<$mt:BlogURL encode_url="1"$>';
+        }
+    } else {
+        url += '&return_url=' + encodeURIComponent(doc_url);
+    }
+    mtClearUser();
+    location.href = url;
+}
+
+function mtSignInOnClick(sign_in_element) {
+    var el;
+    if (sign_in_element) {
+        // display throbber
+        el = document.getElementById(sign_in_element);
+        if (!el)  // legacy MT 4.x element id
+            el = document.getElementById('comment-form-external-auth');
+    }
+    if (el)
+        el.innerHTML = '<__trans phrase="Signing in..." escape="js"> <span class="status-indicator">&nbsp;</span>';
+
+    mtClearUser(); // clear any 'anonymous' user cookie to allow sign in
+    mtFetchUser('mtSetUserOrLogin');
+    return false;
+}
+
+function mtSetUserOrLogin(u) {
+    if (u && u.is_authenticated) {
+        mtSetUser(u);
+    } else {
+        // user really isn't logged in; so let's do this!
+        mtSignIn();
+    }
+}
+
+<mt:Ignore>
+/***
+ * Handles sign out from the web site.
+ * First clears any existing user cookie, then direts to the MT comment
+ * script to sign the user out.
+ */
+</mt:Ignore>
+function mtSignOut(entry_id) {
+    mtClearUser();
+    var doc_url = document.URL;
+    doc_url = doc_url.replace(/#.+/, '');
+    var url = '<$mt:SignOutLink$>';
+    if (is_preview) {
+        if ( document['comments_form'] ) {
+            var entry_id = document['comments_form'].entry_id.value;
+            url += '&entry_id=' + entry_id;
+        } else {
+            url += '&return_url=<$mt:BlogURL encode_url="1"$>';
+        }
+    } else {
+        url += '&return_url=' + encodeURIComponent(doc_url);
+    }
+    location.href = url;
+}
+
+<mt:Ignore>
+/***
+ * Handles the action of the "Sign out" link.
+ */
+</mt:Ignore>
+function mtSignOutOnClick() {
+    mtSignOut();
+    return false;
+}
+
+
+
+/* Cookie *****************************************************************/
+
+<mt:Ignore>
+/***
+ * Persists a copy of the current user cookie into the browser cookie stash.
+ */
+</mt:Ignore>
+function mtSaveUser(f) {
+    // We can't reliably store the user cookie during a preview.
+    if (is_preview) return;
+
+    var u = mtGetUser();
+
+    if (f && (!u || u.is_anonymous)) {
+        if ( !u ) {
+            u = {};
+            u.is_authenticated = false;
+            u.can_comment = true;
+            u.is_author = false;
+            u.is_banned = false;
+            u.is_anonymous = true;
+            u.is_trusted = false;
+        }
+        if (f.author != undefined) u.name = f.author.value;
+        if (f.email != undefined) u.email = f.email.value;
+        if (f.url != undefined) u.url = f.url.value;
+    }
+
+    if (!u) return;
+
+    var cache_period = mtCookieTimeout * 1000;
+
+    // cache anonymous user info for a long period if the
+    // user has requested to be remembered
+    if (u.is_anonymous && f && f.bakecookie && f.bakecookie.checked)
+        cache_period = 365 * 24 * 60 * 60 * 1000;
+
+    var now = new Date();
+    mtFixDate(now);
+    now.setTime(now.getTime() + cache_period);
+
+    var cmtcookie = mtBakeUserCookie(u);
+    mtSetCookie(mtCookieName, cmtcookie, now, mtCookiePath, mtCookieDomain,
+        location.protocol == 'https:');
+}
+
+<mt:Ignore>
+/***
+ * Clears the blog-side user cookie.
+ */
+</mt:Ignore>
+function mtClearUser() {
+    user = null;
+    mtDeleteCookie(mtCookieName, mtCookiePath, mtCookieDomain,
+        location.protocol == 'https:');
+}
+
+<mt:Ignore>
+/***
+ * Sets a browser cookie.
+ */
+</mt:Ignore>
+function mtSetCookie(name, value, expires, path, domain, secure) {
+    if (domain && domain.match(/^\.?localhost$/))
+        domain = null;
+    var curCookie = name + "=" + escape(value) +
+        (expires ? "; expires=" + expires.toGMTString() : "") +
+        (path ? "; path=" + path : "") +
+        (domain ? "; domain=" + domain : "") +
+        (secure ? "; secure" : "");
+    document.cookie = curCookie;
+}
+
+<mt:Ignore>
+/***
+ * Retrieves a browser cookie.
+ */
+</mt:Ignore>
+function mtGetCookie(name) {
+    var prefix = name + '=';
+    var c = document.cookie;
+    var cookieStartIndex = c.indexOf(prefix);
+    if (cookieStartIndex == -1)
+        return '';
+    var cookieEndIndex = c.indexOf(";", cookieStartIndex + prefix.length);
+    if (cookieEndIndex == -1)
+        cookieEndIndex = c.length;
+    return unescape(c.substring(cookieStartIndex + prefix.length, cookieEndIndex));
+}
+
+<mt:Ignore>
+/***
+ * Deletes a browser cookie.
+ */
+</mt:Ignore>
+function mtDeleteCookie(name, path, domain, secure) {
+    if (mtGetCookie(name)) {
+        if (domain && domain.match(/^\.?localhost$/))
+            domain = null;
+        document.cookie = name + "=" +
+            (path ? "; path=" + path : "") +
+            (domain ? "; domain=" + domain : "") +
+            (secure ? "; secure" : "") +
+            "; expires=Thu, 01-Jan-70 00:00:01 GMT";
+    }
+}
+
+<mt:Ignore>
+/***
+ * Serializes a user object into a string, suitable for storing as a cookie.
+ */
+</mt:Ignore>
+function mtBakeUserCookie(u) {
+    var str = "";
+    if (u.name) str += "name:'" + mtEscapeJS(u.name) + "';";
+    if (u.url) str += "url:'" + mtEscapeJS(u.url) + "';";
+    if (u.email) str += "email:'" + mtEscapeJS(u.email) + "';";
+    if (u.auth_type) str += "auth_type:'" + u.auth_type + "';";
+    if (u.is_authenticated) str += "is_authenticated:'1';";
+    if (u.profile) str += "profile:'" + mtEscapeJS(u.profile) + "';";
+    if (u.userpic) str += "userpic:'" + mtEscapeJS(u.userpic) + "';";
+    if (u.sid) str += "sid:'" + mtEscapeJS(u.sid) + "';";
+    str += "is_trusted:'" + (u.is_trusted ? "1" : "0") + "';";
+    str += "is_author:'" + (u.is_author ? "1" : "0") + "';";
+    str += "is_banned:'" + (u.is_banned ? "1" : "0") + "';";
+    str += "can_post:'" + (u.can_post ? "1" : "0") + "';";
+    str += "can_comment:'" + (u.can_comment ? "1" : "0") + "';";
+    str = str.replace(/;$/, '');
+    return str;
+}
+
+<mt:Ignore>
+/***
+ * Unserializes a user cookie and returns a user object with the restored
+ * state.
+ */
+</mt:Ignore>
+function mtUnbakeUserCookie(s) {
+    if (!s) return;
+
+    var u = {};
+    var m;
+    while (m = s.match(/^((name|url|email|auth_type|is_authenticated|profile|userpic|sid|is_trusted|is_author|is_banned|can_post|can_comment):'([^']+?)';?)/)) {
+        s = s.substring(m[1].length);
+        if (m[2].match(/^(is|can)_/)) // boolean fields
+            u[m[2]] = m[3] == '1' ? true : false;
+        else
+            u[m[2]] = mtUnescapeJS(m[3]);
+    }
+    if (u.is_authenticated) {
+        u.is_anonymous = false;
+    } else {
+        u.is_anonymous = true;
+        u.can_post = false;
+        u.is_author = false;
+        u.is_banned = false;
+        u.is_trusted = false;
+    }
+    return u;
+}
+
+/* Utility Functions *****************************************************************/
+
+<mt:Ignore>
+/***
+ * Calls the event named, if there are handlers for it.
+ */
+</mt:Ignore>
+function mtFireEvent(eventName,param) {
+    var fn = window['on' + eventName];
+    if (typeof fn == 'function') return fn(param);
+    return;
+}
+
+function mtFixDate(date) {
+    var skew = (new Date(0)).getTime();
+    if (skew > 0)
+        date.setTime(date.getTime() - skew);
+}
+
+<mt:Ignore>
+/***
+ * Simple function that escapes single quote characters for storing
+ * in a cookie.
+ */
+</mt:Ignore>
+function mtEscapeJS(s) {
+    s = s.replace(/'/g, "&apos;");
+    return s;
+}
+
+<mt:Ignore>
+/***
+ * Simple function that unescapes single quote characters that were
+ * stored in a cookie.
+ */
+</mt:Ignore>
+function mtUnescapeJS(s) {
+    s = s.replace(/&apos;/g, "'");
+    return s;
+}
+
+<mt:Ignore>
+/***
+ * A utility function for assigning/adding handlers to window events.
+ */
+</mt:Ignore>
+function mtAttachEvent(eventName,func) {
+    var onEventName = 'on' + eventName;
+    var old = window[onEventName];
+    if( typeof old != 'function' )
+        window[onEventName] = func;
+    else {
+        window[onEventName] = function( evt ) {
+            old( evt );
+            return func( evt );
+        };
+    }
+}
+
+/* Create Entry *****************************************************************/
+
+<mt:Ignore>
+/***
+ * Conditional block functionality for IfLoggedIn tag
+ */
+</mt:Ignore>
+
+function conditional_block(cond, id) {
+    var true_block = document.getElementById(id);
+    var false_block = document.getElementById(id + '_else');
+    if (cond) {
+        if (true_block) {
+            var display = true_block.getAttribute('mt:display_style');
+            if (!display && false_block)
+                display = false_block.getAttribute('mt:display_style');
+            if (!display) display = '';
+            true_block.style.display = display;
+            DOM.removeClassName(true_block, 'hidden');
+        }
+        if (false_block) {
+            false_block.style.display = 'none';
+            DOM.addClassName(false_block, 'hidden');
+        }
+    }
+    else {
+        if (true_block) {
+            true_block.style.display = 'none';
+            DOM.addClassName(true_block, 'hidden');
+        }
+        if (false_block) {
+            var display = false_block.getAttribute('mt:display_style');
+            if (!display && true_block)
+                display = false_block.getAttribute('mt:display_style');
+            if (!display) display = '';
+            false_block.style.display = display;
+            DOM.removeClassName(false_block, 'hidden');
+        }
+    }
+}
+
+/* section *****************************************************************/
+
+defined = function( x ) { return x !== undefined; };
+
+if ( !window.Event )
+    try { window.Event = {} } catch(e) { };
+
+Event.prep = function( ev ) {
+        ev = ev || window.event;
+        if( !defined( ev.stop ) )
+            ev.stop = this.stop;
+        if( !defined( ev.target ) )
+            ev.target = ev.srcElement;
+        if( !defined( ev.relatedTarget ) ) {
+            ev.relatedTarget = (event.type == "mouseover" || event.type == "mouseenter")
+                ? ev.fromElement
+                : ev.toElement;
+        }
+        return ev;
+    };
+
+if ( !window.DOM )
+    DOM = {
+
+        getElement: function( e ) {
+            return (typeof e == "string" || typeof e == "number") ? document.getElementById( e ) : e;
+        },
+    
+    
+        addEventListener: function( e, en, f, uc ) {
+            try {
+                if( e.addEventListener )
+                    e.addEventListener( en, f, uc );
+                else if( e.attachEvent )
+                    e.attachEvent( "on" + en, f );
+                else
+                    e[ "on" + en ] = f;
+            } catch( e ) {}
+        },
+
+    
+        getClassNames: function( e ) {
+            if( !e || !e.className )
+                return [];
+            return e.className.split( /\s+/g );
+        },
+    
+    
+        hasClassName: function( e, cn ) {
+            e = DOM.getElement( e );
+            if( !e || !e.className )
+                return false;
+            var cs = DOM.getClassNames( e );
+            for( var i = 0; i < cs.length; i++ ) {
+                if( cs[ i ] == cn )
+                    return true;
+            }
+            return false;
+        },
+    
+    
+        addClassName: function( e, cn ) {
+            e = DOM.getElement( e );
+            if( !e || !cn )
+                return false;
+            var cs = DOM.getClassNames( e );
+            for( var i = 0; i < cs.length; i++ ) {
+                if( cs[ i ] == cn )
+                    return true;
+            }
+            cs.push( cn );
+            e.className = cs.join( " " );
+            return false;
+        },
+    
+    
+        removeClassName: function( e, cn ) {
+            var r = false;
+            e = DOM.getElement( e );
+            if( !e || !e.className || !cn )
+                return r;
+            var cs = (e.className && e.className.length)
+                ? e.className.split( /\s+/g )
+                : [];
+            var ncs = [];
+            /* support regex */
+            if( cn instanceof RegExp ) {
+                for( var i = 0; i < cs.length; i++ ) {
+                    if ( cn.test( cs[ i ] ) ) {
+                        r = true;
+                        continue;
+                    }
+                    ncs.push( cs[ i ] );
+                }
+            } else {
+                for( var i = 0; i < cs.length; i++ ) {
+                    if( cs[ i ] == cn ) {
+                        r = true;
+                        continue;
+                    }
+                    ncs.push( cs[ i ] );
+                }
+            }
+            if( r )
+                e.className = ncs.join( " " );
+            return r;
+        },
+
+
+        getElementsByTagAndClassName: function( tagName, className, root ) {
+            root = DOM.getElement( root );
+            if( !root )
+                root = document;
+            var allElements = root.getElementsByTagName( tagName );
+            var elements = [];
+            for( var i = 0; i < allElements.length; i++ ) {
+                var element = allElements[ i ];
+                if( !element )
+                    continue;
+                if( DOM.hasClassName( element, className ) )
+                    elements[ elements.length ] = element;
+            }
+            return elements;
+        },
+
+
+        getElementsByClassName: function( className, root ) {
+            return DOM.getElementsByTagAndClassName( "*", className, root );
+        }
+
+
+    };
Index: trunk/Vanilla/plugins/Vanilla/templates/vanilla/home.mtml
===================================================================
--- trunk/Vanilla/plugins/Vanilla/templates/vanilla/home.mtml (revision 922)
+++ trunk/Vanilla/plugins/Vanilla/templates/vanilla/home.mtml (revision 922)
@@ -0,0 +1,14 @@
+<mt:IncludeBlock module="Wrapper">
+
+    <mt:Entries lastn="10">
+        <h2><a href="<$mt:EntryPermalink$>"><$mt:EntryTitle$></a></h2>
+        <p><__trans phrase="By [_1] on [_2]" params="<$mt:EntryAuthorLink$>%%<$mt:EntryDate format="%x %X"$>"></p>
+        <mt:If tag="EntryBody">
+            <$mt:EntryBody$>
+        </mt:If>
+        <mt:If tag="EntryMore" convert_breaks="0">
+            <em><__trans phrase="Continue reading <a href="[_1]">[_2]</a>." params="<$mt:EntryPermalink$>%%<$mt:EntryTitle$>"></em>
+        </mt:If>
+    </mt:Entries>
+
+</mt:IncludeBlock>
Index: trunk/Vanilla/plugins/Vanilla/templates/vanilla/wrapper.mtml
===================================================================
--- trunk/Vanilla/plugins/Vanilla/templates/vanilla/wrapper.mtml (revision 891)
+++ trunk/Vanilla/plugins/Vanilla/templates/vanilla/wrapper.mtml (revision 891)
@@ -0,0 +1,23 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" id="sixapart-standard">
+<head>
+    <title><$mt:BlogName encode_html="1"$></title>
+    <meta http-equiv="Content-Type" content="text/html; charset=<$mt:PublishCharset$>" />
+</head>
+<body>
+
+    <h1><a href="<$mt:BlogURL$>"><$mt:BlogName encode_html="1"$></a> + <__trans phrase="Homepage + Entry Archives"></h1>
+
+<!-- end header --><hr />
+
+
+    <$mt:Var name="contents"$>
+
+
+<!-- start footer --><hr />
+
+    <p><__trans phrase="_POWERED_BY"> and the Vanilla template set</p>
+
+</body>
+</html>
Index: trunk/Vanilla/plugins/Vanilla/templates/vanilla/entry.mtml
===================================================================
--- trunk/Vanilla/plugins/Vanilla/templates/vanilla/entry.mtml (revision 922)
+++ trunk/Vanilla/plugins/Vanilla/templates/vanilla/entry.mtml (revision 922)
@@ -0,0 +1,12 @@
+<mt:IncludeBlock module="Wrapper">
+
+    <h1><$mt:EntryTitle$></h1>
+    <p><__trans phrase="By [_1] on [_2]" params="<$mt:EntryAuthorLink$>%%<$mt:EntryDate format="%x %X"$>"></p>
+    <mt:If tag="EntryBody">
+        <$mt:EntryBody$>
+    </mt:If>
+    <mt:If tag="EntryMore" convert_breaks="0">
+        <$mt:EntryMore$>
+    </mt:If>
+
+</mt:IncludeBlock>
Index: trunk/Vanilla/plugins/Vanilla/templates/vanilla+archives/home.mtml
===================================================================
--- trunk/Vanilla/plugins/Vanilla/templates/vanilla+archives/home.mtml (revision 922)
+++ trunk/Vanilla/plugins/Vanilla/templates/vanilla+archives/home.mtml (revision 922)
@@ -0,0 +1,14 @@
+<mt:IncludeBlock module="Wrapper">
+
+    <mt:Entries lastn="10">
+        <h2><a href="<$mt:EntryPermalink$>"><$mt:EntryTitle$></a></h2>
+        <p><__trans phrase="By [_1] on [_2]" params="<$mt:EntryAuthorLink$>%%<$mt:EntryDate format="%x %X"$>"></p>
+        <mt:If tag="EntryBody">
+            <$mt:EntryBody$>
+        </mt:If>
+        <mt:If tag="EntryMore" convert_breaks="0">
+            <em><__trans phrase="Continue reading <a href="[_1]">[_2]</a>." params="<$mt:EntryPermalink$>%%<$mt:EntryTitle$>"></em>
+        </mt:If>
+    </mt:Entries>
+
+</mt:IncludeBlock>
Index: trunk/Vanilla/plugins/Vanilla/templates/vanilla+archives/entry_listing.mtml
===================================================================
--- trunk/Vanilla/plugins/Vanilla/templates/vanilla+archives/entry_listing.mtml (revision 929)
+++ trunk/Vanilla/plugins/Vanilla/templates/vanilla+archives/entry_listing.mtml (revision 929)
@@ -0,0 +1,25 @@
+<mt:IncludeBlock module="wrapper">
+
+    <h1><__trans phrase="[_1] Archives" params="<$mt:ArchiveTitle$>"></h1>
+    
+    <mt:Entries>
+        <h2><a href="<$mt:EntryPermalink$>"><$mt:EntryTitle$></a></h2>
+        <p><__trans phrase="By [_1] on [_2]" params="<$mt:EntryAuthorLink$>%%<$mt:EntryDate format="%x %X"$>"></p>
+        <mt:If tag="EntryBody">
+            <$mt:EntryBody$>
+        </mt:If>
+        <mt:If tag="EntryMore" convert_breaks="0">
+            <em><__trans phrase="Continue reading <a href="[_1]">[_2]</a>." params="<$mt:EntryPermalink$>%%<$mt:EntryTitle$>"></em>
+        </mt:If>
+    </mt:Entries>
+    
+    <mt:If name="category_archive">
+        <h3><__trans phrase="[_1] Category-Monthly Archives" params="<$mt:ArchiveTitle$>"></h3>
+        <ul>
+        <mt:ArchiveList archive_type="Category-Monthly">
+            <li><a href="<$mt:ArchiveLink$>"><$mt:ArchiveTitle$></a></li>
+        </mt:ArchiveList>
+        </ul>
+    </mt:If>
+
+</mt:IncludeBlock>
Index: trunk/Vanilla/plugins/Vanilla/templates/vanilla+archives/wrapper.mtml
===================================================================
--- trunk/Vanilla/plugins/Vanilla/templates/vanilla+archives/wrapper.mtml (revision 922)
+++ trunk/Vanilla/plugins/Vanilla/templates/vanilla+archives/wrapper.mtml (revision 922)
@@ -0,0 +1,29 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" id="sixapart-standard">
+<head>
+    <title><$mt:BlogName encode_html="1"$></title>
+    <meta http-equiv="Content-Type" content="text/html; charset=<$mt:PublishCharset$>" />
+</head>
+<body>
+
+    <h1><a href="<$mt:BlogURL$>"><$mt:BlogName encode_html="1"$></a> <__trans phrase="(Vanilla + Monthly, Category, and Author Archives)"></h1>
+    
+    <h3><__trans phrase="Navigation"></h3>
+    <ul>
+        <li><a href="<$mt:Link template="home"$>"><__trans phrase="Home"></a></li>
+        <li><a href="<$mt:Link template="archives"$>"><__trans phrase="Archives"></a></li>
+    </ul>
+
+<!-- end header --><hr />
+
+
+    <$mt:Var name="contents"$>
+
+
+<!-- start footer --><hr />
+
+    <p><__trans phrase="_POWERED_BY"> and the Vanilla template set</p>
+
+</body>
+</html>
Index: trunk/Vanilla/plugins/Vanilla/templates/vanilla+archives/entry.mtml
===================================================================
--- trunk/Vanilla/plugins/Vanilla/templates/vanilla+archives/entry.mtml (revision 922)
+++ trunk/Vanilla/plugins/Vanilla/templates/vanilla+archives/entry.mtml (revision 922)
@@ -0,0 +1,12 @@
+<mt:IncludeBlock module="Wrapper">
+
+    <h1><$mt:EntryTitle$></h1>
+    <p><__trans phrase="By [_1] on [_2]" params="<$mt:EntryAuthorLink$>%%<$mt:EntryDate format="%x %X"$>"></p>
+    <mt:If tag="EntryBody">
+        <$mt:EntryBody$>
+    </mt:If>
+    <mt:If tag="EntryMore" convert_breaks="0">
+        <$mt:EntryMore$>
+    </mt:If>
+
+</mt:IncludeBlock>
Index: trunk/Vanilla/plugins/Vanilla/templates/vanilla+archives/archives.mtml
===================================================================
--- trunk/Vanilla/plugins/Vanilla/templates/vanilla+archives/archives.mtml (revision 922)
+++ trunk/Vanilla/plugins/Vanilla/templates/vanilla+archives/archives.mtml (revision 922)
@@ -0,0 +1,55 @@
+<mt:IncludeBlock module="Wrapper">
+
+    <h1><__trans phrase="Archives"></h1>
+
+<!--
+    Available Archive Types
+    
+    * Daily
+    * Weekly
+    * Monthly           shown below
+    * Yearly
+    * Category          shown below
+    * Category-Daily
+    * Category-Weekly
+    * Category-Monthly
+    * Category-Yearly
+    * Author            shown below
+    * Author-Daily
+    * Author-Weekly
+    * Author-Monthly
+    * Author-Yearly
+
+-->
+
+    <h2><__trans phrase="Category Archives"></h2>
+    <ul>
+    <mt:ArchiveList archive_type="Category">
+        <li><a href="<$mt:ArchiveLink$>"><$mt:ArchiveTitle$></a></li>
+    </mt:ArchiveList>
+    </ul>
+
+<!--
+    <h2><__trans phrase="Category-Monthly Archives"></h2>
+    <ul>
+    <mt:ArchiveList archive_type="Category-Monthly">
+        <li><a href="<$mt:ArchiveLink$>"><$mt:ArchiveTitle$></a></li>
+    </mt:ArchiveList>
+    </ul>
+-->
+
+    <h2><__trans phrase="Monthly Archives"></h2>
+    <ul>
+    <mt:ArchiveList archive_type="Monthly">
+        <li><a href="<$mt:ArchiveLink$>"><$mt:ArchiveTitle$></a></li>
+    </mt:ArchiveList>
+    </ul>
+
+    <h2><__trans phrase="Author Archives"></h2>
+    <ul>
+    <mt:ArchiveList archive_type="Author">
+        <li><a href="<$mt:ArchiveLink$>"><$mt:ArchiveTitle$></a></li>
+    </mt:ArchiveList>
+    </ul>
+
+</mt:IncludeBlock>
Index: trunk/Vanilla/plugins/Vanilla/templates/vanilla+comments/home.mtml
===================================================================
--- trunk/Vanilla/plugins/Vanilla/templates/vanilla+comments/home.mtml (revision 922)
+++ trunk/Vanilla/plugins/Vanilla/templates/vanilla+comments/home.mtml (revision 922)
@@ -0,0 +1,14 @@
+<mt:IncludeBlock module="Wrapper">
+
+    <mt:Entries>
+        <h2><a href="<$mt:EntryPermalink$>"><$mt:EntryTitle$></a></h2>
+        <p><__trans phrase="By [_1] on [_2]" params="<$mt:EntryAuthorLink$>%%<$mt:EntryDate format="%x %X"$>"></p>
+        <mt:If tag="EntryBody">
+            <$mt:EntryBody$>
+        </mt:If>
+        <mt:If tag="EntryMore" convert_breaks="0">
+            <em><__trans phrase="Continue reading <a href="[_1]">[_2]</a>." params="<$mt:EntryPermalink$>%%<$mt:EntryTitle$>"></em>
+        </mt:If>
+    </mt:Entries>
+
+</mt:IncludeBlock>
Index: trunk/Vanilla/plugins/Vanilla/templates/vanilla+comments/comment_response.mtml
===================================================================
--- trunk/Vanilla/plugins/Vanilla/templates/vanilla+comments/comment_response.mtml (revision 986)
+++ trunk/Vanilla/plugins/Vanilla/templates/vanilla+comments/comment_response.mtml (revision 986)
@@ -0,0 +1,25 @@
+<mt:IncludeBlock module="Wrapper">
+
+    <mt:setvarblock name="html_head" append="1">
+        <script type="text/javascript">
+        /* <![CDATA[ */
+        var user = <$mt:UserSessionState$>;
+        var is_preview = true;
+        /* ]]> */
+        </script>
+    </mt:SetVarBlock>
+
+    <mt:If name="comment_confirmation">
+        <h1><__trans phrase="Confirmation..."></h1>
+        <p><__trans phrase="Your comment has been submitted!"></p>
+    <mt:Else name="comment_pending">
+        <h1><__trans phrase="Thank you for commenting."></h1>
+        <p><__trans phrase="Your comment has been received and held for approval by the blog owner."></p>
+    <mt:Else name="comment_error">
+        <h1><__trans phrase="Comment Submission Error">"</h1>
+        <p><__trans phrase="Your comment submission failed for the following reasons: [_1]" params="<$mt:ErrorMessage$>"></p>
+    </mt:If>
+
+    <p><__trans phrase="Return to the <a href="[_1]">original entry</a>." params="<mt:If name="comment_error">javascript:history.back()<mt:Else><$mt:EntryLink$></mt:If>"></p>
+
+</mt:IncludeBlock>
Index: trunk/Vanilla/plugins/Vanilla/templates/vanilla+comments/wrapper.mtml
===================================================================
--- trunk/Vanilla/plugins/Vanilla/templates/vanilla+comments/wrapper.mtml (revision 922)
+++ trunk/Vanilla/plugins/Vanilla/templates/vanilla+comments/wrapper.mtml (revision 922)
@@ -0,0 +1,34 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" id="sixapart-standard">
+<head>
+    <title><$mt:BlogName encode_html="1"$></title>
+    <meta http-equiv="Content-Type" content="text/html; charset=<$mt:PublishCharset$>" />
+    <$mt:Var name="html_head"$>
+    <script type="text/javascript" src="<$mt:Link template="JavaScript"$>"></script>
+</head>
+<body>
+
+    <h1><a href="<$mt:BlogURL$>"><$mt:BlogName encode_html="1"$></a> <__trans phrase="(Vanilla + Comments)"></h1>
+
+    <div id="signin-content"><a href="javascript:void(0)" onclick="return mtSignInOnClick('signin-content')"><__trans phrase="Sign In"></a></div>
+
+<!-- end header --><hr />
+
+
+    <$mt:Var name="contents"$>
+
+
+<!-- start footer --><hr />
+
+    <p><__trans phrase="_POWERED_BY"> and the Vanilla template set</p>
+
+<script type="text/javascript">
+/* <![CDATA[ */
+mtAttachEvent('usersignin', mtUpdateSignInWidget);
+mtUpdateSignInWidget();
+/* ]]> */
+</script>
+
+</body>
+</html>
Index: trunk/Vanilla/plugins/Vanilla/templates/vanilla+comments/entry.mtml
===================================================================
--- trunk/Vanilla/plugins/Vanilla/templates/vanilla+comments/entry.mtml (revision 922)
+++ trunk/Vanilla/plugins/Vanilla/templates/vanilla+comments/entry.mtml (revision 922)
@@ -0,0 +1,114 @@
+<mt:IncludeBlock module="Wrapper">
+    
+    <mt:setvarblock name="html_head" append="1">
+        <style type="text/css" media="screen">
+            form {
+                width: 50%;
+            }
+        </style>
+    </mt:setvarblock>
+
+    <h1><$mt:EntryTitle$></h1>
+    <p><__trans phrase="By [_1] on [_2]" params="<$mt:EntryAuthorLink$>%%<$mt:EntryDate format="%x %X"$>"></p>
+    <mt:If tag="EntryBody">
+        <$mt:EntryBody$>
+    </mt:If>
+    <mt:If tag="EntryMore" convert_breaks="0">
+        <$mt:EntryMore$>
+    </mt:If>
+
+
+    <mt:IfCommentsActive>
+    <div id="comments">
+
+
+        <mt:Comments>
+            <mt:CommentsHeader>
+        <h2 class="comments-header"><__trans phrase="Comments"></h2>
+        <ol class="comments-content">
+            </mt:CommentsHeader>
+            <li id="comment-<$mt:CommentID$>">
+                <div class="comment-header">
+                    <$mt:CommentAuthorIdentity$>
+                    <mt:IfCommentParent>
+                        <__trans phrase="[_1] replied to [_2]<a href="[_3]">comment from [_4]</a>[_5]" params="<$mt:CommentAuthorLink$>%%<mt:CommentParent>%%<$mt:CommentLink$>%%<$mt:CommentAuthor$>%%</mt:CommentParent>">
+                    <mt:Else>
+                        <$mt:CommentAuthorLink$>
+                    </mt:IfCommentParent>
+                    | <a href="<$mt:CommentLink$>"><abbr class="published" title="<$mt:CommentDate format_name="iso8601"$>"><$mt:CommentDate$></abbr></a>
+                    <mt:IfCommentsAccepted>
+                    | <$mt:CommentReplyToLink$>
+                    </mt:IfCommentsAccepted>
+                </div>
+                <div class="comment-body">
+                    <$mt:CommentBody$>
+                </div>
+            </li>
+            <mt:CommentsFooter>
+        </ol>
+            </mt:CommentsFooter>
+        </mt:Comments>
+
+
+        <mt:IfCommentsAccepted>
+        <div id="comments-open">
+            <h2 class="comments-open-header"><__trans phrase="Leave a comment"></h2>
+            <div class="comments-open-content">
+                <div id="comment-greeting"></div>
+                <form method="post" action="<$mt:CGIPath$><$mt:CommentScript$>" name="comments_form" id="comments-form" onsubmit="return mtCommentOnSubmit(this)">
+                    <input type="hidden" name="static" value="1" />
+                    <input type="hidden" name="entry_id" value="<$mt:EntryID$>" />
+                    <input type="hidden" name="__lang" value="<$mt:BlogLanguage$>" />
+                    <input type="hidden" name="parent_id" value="<$mt:CommentParentID$>" id="comment-parent-id" />
+                    <input type="hidden" name="armor" value="1" />
+                    <input type="hidden" name="preview" value="" />
+                    <input type="hidden" name="sid" value="" />
+                    <div id="comments-open-data">
+                        <div>
+                            <label for="comment-author"><__trans phrase="Name"></label>
+                            <input id="comment-author" name="author" size="30" value="" onfocus="mtCommentFormOnFocus()" />
+                        </div>
+                        <div>
+                            <label for="comment-email"><__trans phrase="Email Address"></label>
+                            <input id="comment-email" name="email" size="30" value="" onfocus="mtCommentFormOnFocus()" />
+                        </div>
+                        <div>
+                            <label for="comment-url"><__trans phrase="URL"></label>
+                            <input id="comment-url" name="url" size="30" value="" onfocus="mtCommentFormOnFocus()" />
+                        </div>
+                        <div>
+                            <input type="checkbox" id="comment-bake-cookie" name="bakecookie" onclick="mtRememberMeOnClick(this)" value="1" accesskey="r" />
+                            <label for="comment-bake-cookie"><__trans phrase="Remember personal info?"></label>
+                        </div>
+                    </div>
+                    <div id="comment-form-reply" style="display:none">
+                        <input type="checkbox" id="comment-reply" name="comment_reply" value="<$mt:CommentParentID$>" onclick="mtSetCommentParentID()" />
+                        <label for="comment-reply" id="comment-reply-label"></label>
+                    </div>
+                    <div id="comments-open-text">
+                        <label for="comment-text"><__trans phrase="Comments">
+                        <mt:IfAllowCommentHTML><__trans phrase="(You may use HTML tags for style)"></mt:IfAllowCommentHTML></label>
+                        <textarea id="comment-text" name="text" rows="15" cols="50" onfocus="mtCommentFormOnFocus()"></textarea>
+                    </div>
+                    <div id="comments-open-captcha"></div>
+                    <div id="comments-open-footer">
+                        <input type="submit" accesskey="v" name="preview_button" id="comment-preview" value="<__trans phrase="Preview">" onclick="this.form.preview.value='1';" />
+                        <input type="submit" accesskey="s" name="post" id="comment-submit" value="<__trans phrase="Submit">" />
+                    </div>
+                </form>
+            </div>
+        </div>
+        <script type="text/javascript">
+        <!--
+        mtAttachEvent("load", mtEntryOnLoad);
+        mtAttachEvent("unload", mtEntryOnUnload);
+        //-->
+        </script>
+        </mt:IfCommentsAccepted>
+
+
+    </div>
+    </mt:IfCommentsActive>
+
+
+</mt:IncludeBlock>
Index: trunk/Vanilla/plugins/Vanilla/templates/vanilla+comments/comment_preview.mtml
===================================================================
--- trunk/Vanilla/plugins/Vanilla/templates/vanilla+comments/comment_preview.mtml (revision 986)
+++ trunk/Vanilla/plugins/Vanilla/templates/vanilla+comments/comment_preview.mtml (revision 986)
@@ -0,0 +1,120 @@
+<mt:IncludeBlock module="Wrapper">
+    
+    <mt:setvarblock name="html_head" append="1">
+        <style type="text/css" media="screen">
+            form {
+                width: 50%;
+            }
+        </style>
+        <script type="text/javascript">
+        /* <![CDATA[ */
+        var user = <$mt:UserSessionState$>;
+        var is_preview = true;
+        /* ]]> */
+        </script>
+    </mt:SetVarBlock>
+
+    <h1><__trans phrase="Previewing your Comment"></h1>
+
+    <div id="comments">
+        
+        <ol class="comments-content">
+            <li>
+                <div class="comment-header">
+                    <$mt:CommentAuthorIdentity$>
+                    <mt:IfCommentParent>
+                        <__trans phrase="[_1] replied to [_2]<a href="[_3]">comment from [_4]</a>[_5]" params="<$mt:CommentAuthorLink$>%%<mt:CommentParent>%%<$mt:CommentLink$>%%<$mt:CommentAuthor$>%%</mt:CommentParent>">
+                    <mt:Else>
+                        <$mt:CommentAuthorLink$>
+                    </mt:IfCommentParent>
+                    | <a href="<$mt:CommentLink$>"><abbr class="published" title="<$mt:CommentDate format_name="iso8601"$>"><$mt:CommentDate$></abbr></a>
+                </div>
+                <div class="comment-body">
+                    <$mt:CommentBody$>
+                </div>
+            </li>
+        </ol>
+
+        <mt:IfCommentsAccepted>
+        <div id="comments-open">
+            <h2 class="comments-open-header"><__trans phrase="Leave a comment"></h2>
+            <div class="comments-open-content">
+                <div id="comment-greeting"></div>
+                <form method="post" action="<$mt:CGIPath$><$mt:CommentScript$>" name="comments_form" id="comments-form" onsubmit="return mtCommentOnSubmit(this)">
+                    <input type="hidden" name="static" value="1" />
+                    <input type="hidden" name="entry_id" value="<$mt:EntryID$>" />
+                    <input type="hidden" name="__lang" value="<$mt:BlogLanguage$>" />
+                    <input type="hidden" name="parent_id" value="<$mt:CommentParentID$>" id="comment-parent-id" />
+                    <input type="hidden" name="armor" value="1" />
+                    <input type="hidden" name="preview" value="" />
+                    <input type="hidden" name="sid" value="" />
+                    <div id="comments-open-data">
+                        <div>
+                            <label for="comment-author"><__trans phrase="Name"></label>
+                            <input id="comment-author" name="author" size="30" value="<$mt:CommentAuthor encode_html="1"$>" onfocus="mtCommentFormOnFocus()" />
+                        </div>
+                        <div>
+                            <label for="comment-email"><__trans phrase="Email Address"></label>
+                            <input id="comment-email" name="email" size="30" value="<$mt:CommentEmail encode_html="1"$>" onfocus="mtCommentFormOnFocus()" />
+                        </div>
+                        <div>
+                            <label for="comment-url"><__trans phrase="URL"></label>
+                            <input id="comment-url" name="url" size="30" value="<$mt:CommentURL encode_html="1"$>" onfocus="mtCommentFormOnFocus()" />
+                        </div>
+                    </div>
+                    <div id="comment-form-reply"<mt:IfCommentParent><mt:Else> style="display:none"</mt:IfCommentParent>>
+                        <input type="checkbox" id="comment-reply" name="comment_reply" value="<$mt:CommentParentID$>"<mt:IfCommentParent> checked="checked"</mt:IfCommentParent> onclick="mtSetCommentParentID()" />
+                        <label for="comment-reply" id="comment-reply-label"><mt:IfCommentParent><__trans phrase="Replying to comment from [_1]" params="<mt:CommentParent><$mt:CommentAuthor$></mt:CommentParent>"></mt:IfCommentParent></label>
+                    </div>
+                    <div id="comments-open-text">
+                        <label for="comment-text"><__trans phrase="Comments">
+                        <mt:IfAllowCommentHTML><__trans phrase="(You may use HTML tags for style)"></mt:IfAllowCommentHTML></label>
+                        <textarea id="comment-text" name="text" rows="15" cols="50" onfocus="mtCommentFormOnFocus()"><$mt:CommentBody autolink="0" sanitize="0" convert_breaks="0" encode_html="1"$></textarea>
+                    </div>
+                    <div id="comments-open-captcha"></div>
+                    <div id="comments-open-footer">
+                        <input type="submit" accesskey="v" name="preview_button" id="comment-preview" value="<__trans phrase="Preview">" onclick="this.form.preview.value='1';" />
+                        <input type="submit" accesskey="s" name="post" id="comment-submit" value="<__trans phrase="Submit">" />
+                        <input type="button" name="cancel" id="comment-cancel" value="<__trans phrase="Cancel">" onclick="window.location='<$mt:EntryPermalink$>'" />
+                    </div>
+                </form>
+            </div>
+        </div>
+        <script type="text/javascript">
+        <!--
+        mtAttachEvent("load", mtEntryOnLoad);
+        mtAttachEvent("unload", mtEntryOnUnload);
+        //-->
+        </script>
+        </mt:IfCommentsAccepted>
+
+        <mt:Comments>
+            <mt:CommentsHeader>
+        <h2 class="comments-header"><__trans phrase="Comments"></h2>
+        <ol class="comments-content">
+            </mt:CommentsHeader>
+            <li id="comment-<$mt:CommentID$>">
+                <div class="comment-header">
+                    <$mt:CommentAuthorIdentity$>
+                    <mt:IfCommentParent>
+                        <__trans phrase="[_1] replied to [_2]<a href="[_3]">comment from [_4]</a>[_5]" params="<$mt:CommentAuthorLink$>%%<mt:CommentParent>%%<$mt:CommentLink$>%%<$mt:CommentAuthor$>%%</mt:CommentParent>">
+                    <mt:Else>
+                        <$mt:CommentAuthorLink$>
+                    </mt:IfCommentParent>
+                    | <a href="<$mt:CommentLink$>"><abbr class="published" title="<$mt:CommentDate format_name="iso8601"$>"><$mt:CommentDate$></abbr></a>
+                    <mt:IfCommentsAccepted>
+                    | <$mt:CommentReplyToLink$>
+                    </mt:IfCommentsAccepted>
+                </div>
+                <div class="comment-body">
+                    <$mt:CommentBody$>
+                </div>
+            </li>
+            <mt:CommentsFooter>
+        </ol>
+            </mt:CommentsFooter>
+        </mt:Comments>
+
+    </div>
+
+</mt:IncludeBlock>
Index: trunk/Vanilla/plugins/Vanilla/templates/vanilla+comments/javascript.mtml
===================================================================
--- trunk/Vanilla/plugins/Vanilla/templates/vanilla+comments/javascript.mtml (revision 919)
+++ trunk/Vanilla/plugins/Vanilla/templates/vanilla+comments/javascript.mtml (revision 919)
@@ -0,0 +1,897 @@
+<$mt:var name="user-auth" value="signin-content"$>
+<mt:Ignore>
+    Set show_userpic to 1 to enable userpics in the signin line
+    - Requires Community Solution
+    - Note: This will update username to link to Community Solution "edit profile" script. This script assumes that you are using profiles and thus links to "view profile" screen. If the template set is not using profiles then the Community Solution "Profile Edit" Global System Template should be updated.
+</mt:Ignore>
+<$mt:var name="show_userpic" value="0"$>
+
+/* section *****************************************************************/
+
+// The cookie name to use for storing the blog-side comment session cookie.
+var mtCookieName = "<$mt:UserSessionCookieName$>";
+var mtCookieDomain = "<$mt:UserSessionCookieDomain$>";
+var mtCookiePath = "<$mt:UserSessionCookiePath$>";
+var mtCookieTimeout = <$mt:UserSessionCookieTimeout$>;
+var is_preview;
+var user;
+
+/* Login Functions *****************************************************************/
+
+<mt:Ignore>
+/***
+ * Issues a request to the MT comment script to retrieve the currently
+ * logged-in user (if any).
+ */
+</mt:Ignore>
+var mtFetchedUser = false;
+<mt:IfBlog>
+function mtFetchUser(cb) {
+    if (!cb) cb = 'mtSetUser';
+    if ( ( cb == 'mtSetUser' ) && mtGetUser() ) {
+        var url = document.URL;
+        url = url.replace(/#.+$/, '');
+        url += '#comments-open';
+        location.href = url;
+    } else {
+        // we aren't using AJAX for this, since we may have to request
+        // from a different domain. JSONP to the rescue.
+        mtFetchedUser = true;
+        var script = document.createElement('script');
+        var ts = new Date().getTime();
+        script.src = '<$mt:CGIPath$><$mt:CommentScript$>?__mode=session_js&blog_id=<$mt:BlogID$>&jsonp=' + cb + '&ts=' + ts;
+        (document.getElementsByTagName('head'))[0].appendChild(script);
+    }
+}
+</mt:IfBlog>
+
+<mt:Ignore>
+/***
+ * A routine that displays various phrases based upon users authenticated status
+ */
+</mt:Ignore>
+
+// <a href="#">Signin</a>
+// You are signed in as <a href="#">UserName</a> (<a href="#">Sign out</a>)
+// You do not have permission to sign in to this blog
+
+function mtUpdateSignInWidget(u) {
+    var el = document.getElementById('<$mt:var name="user-auth"$>');
+    var content = '';
+    var doit = 1;
+    if (!el) return;
+    if (u) {
+        if (u && u.is_authenticated) {
+            user = u;
+            mtSaveUser();
+        } else {
+            // user really isn't logged in; so let's do this!
+            return mtSignIn();
+        }
+    } else {
+        u = mtGetUser();
+    }
+    if (u && u.name) {
+<mt:If name="show_userpic">
+        if (u.userpic)
+            content += '<img src="' + u.userpic + '" width="50" height="50" />';
+</mt:If>
+        var url;
+        if (u.is_authenticated) {
+            if (u.is_author) {
+<mt:If name="show_userpic">
+                url = '<$mt:CGIPath$><$mt:CommunityScript$>?__mode=edit&blog_id=<$mt:BlogID$>';
+                url += '&return_to=' + encodeURIComponent(document.URL);
+<mt:Else>
+                url = '<$mt:CGIPath$><$mt:CommentScript$>?__mode=edit_profile&blog_id=<$mt:BlogID$>';
+                url += '&static=' + encodeURIComponent( location.href );
+</mt:If>
+            } else {
+                url = u.url;
+            }
+        } else if (u.url) {
+            url = u.url;
+        } else {
+            url = null;
+        }
+        content += '<__trans phrase="You are signed in as " escape="js">';
+        if (url)
+            content += '<a href="' + url + '">' + u.name + '</a>';
+        else
+            content += u.name;
+        content += '.  (<a href="javascript:void(0)" onclick="return mtSignOutOnClick()"><__trans phrase="sign out" escape="js"></a>)';
+    } else if (u && u.is_banned) {
+        content = '<__trans phrase="You do not have permission to sign in to this blog." escape="js">';
+    } else {
+    //    content = '<a href="javascript:void(0)" onclick="return mtSignInOnClick(\'<$mt:var name="user-auth"$>\')"><__trans phrase="Sign In" escape="js"></a>';
+        doit = 0;
+    }
+    if (doit) {
+        el.innerHTML = content;
+    }
+}
+
+<mt:IfBlog>
+<mt:IfRegistrationAllowed>
+/***
+ * If request contains a '#_login' or '#_logout' hash, use this to
+ * also delete the blog-side user cookie, since we're coming back from
+ * a login, logout or edit profile operation.
+ */
+var clearCookie = ( window.location.hash && window.location.hash.match( /^#_log(in|out)/ ) ) ? true : false;
+if (clearCookie) {
+    // clear any logged in state
+    mtClearUser();
+    if (RegExp.$1 == 'in')
+        mtFetchUser();
+} else {
+    <mt:Ignore>
+    /***
+     * Uncondition this call to fetch the current user state (if available)
+     * from MT upon page load if no user cookie is already present.
+     * This is okay if you have a private install, such as an Intranet;
+     * not recommended for public web sites!
+     */
+    </mt:Ignore>
+    if ( is_preview && !user )
+        mtFetchUser();
+}
+</mt:IfRegistrationAllowed>
+</mt:IfBlog>
+
+<mt:Ignore>
+/***
+ * Retrieves an object of the currently logged in user's state.
+ * If no user is logged in or cookied, this will return null.
+ */
+</mt:Ignore>
+function mtGetUser() {
+    if (!user) {
+        var cookie = mtGetCookie(mtCookieName);
+        if (!cookie) return;
+        user = mtUnbakeUserCookie(cookie);
+        if (! user) {
+            user = {};
+            user.is_anonymous = true;
+            user.can_post = false;
+            user.is_author = false;
+            user.is_banned = false;
+            user.is_trusted = false;
+        }
+    }
+    return user;
+}
+
+<mt:Ignore>
+/***
+ * Assigns a user object as the actively logged in user; also saves the
+ * user information in a browser cookie.
+ */
+</mt:Ignore>
+function mtSetUser(u) {
+    if (u) {
+        // persist this
+        user = u;
+        mtSaveUser();
+        // sync up user greeting
+        mtFireEvent('usersignin');
+    }
+}
+
+<mt:Ignore>
+/***
+ * Handles the action of the "Sign in" link. First clears any existing
+ * user cookie, then directs to the MT comment script to sign the user in.
+ */
+</mt:Ignore>
+function mtSignIn() {
+    var doc_url = document.URL;
+    doc_url = doc_url.replace(/#.+/, '');
+    var url = '<$mt:SignInLink$>';
+    if (is_preview) {
+        if ( document['comments_form'] ) {
+            var entry_id = document['comments_form'].entry_id.value;
+            url += '&entry_id=' + entry_id;
+        } else {
+            url += '&return_url=<$mt:BlogURL encode_url="1"$>';
+        }
+    } else {
+        url += '&return_url=' + encodeURIComponent(doc_url);
+    }
+    mtClearUser();
+    location.href = url;
+}
+
+function mtSignInOnClick(sign_in_element) {
+    var el;
+    if (sign_in_element) {
+        // display throbber
+        el = document.getElementById(sign_in_element);
+        if (!el)  // legacy MT 4.x element id
+            el = document.getElementById('comment-form-external-auth');
+    }
+    if (el)
+        el.innerHTML = '<__trans phrase="Signing in..." escape="js"> <span class="status-indicator">&nbsp;</span>';
+
+    mtClearUser(); // clear any 'anonymous' user cookie to allow sign in
+    mtFetchUser('mtSetUserOrLogin');
+    return false;
+}
+
+function mtSetUserOrLogin(u) {
+    if (u && u.is_authenticated) {
+        mtSetUser(u);
+    } else {
+        // user really isn't logged in; so let's do this!
+        mtSignIn();
+    }
+}
+
+<mt:Ignore>
+/***
+ * Handles sign out from the web site.
+ * First clears any existing user cookie, then direts to the MT comment
+ * script to sign the user out.
+ */
+</mt:Ignore>
+function mtSignOut(entry_id) {
+    mtClearUser();
+    var doc_url = document.URL;
+    doc_url = doc_url.replace(/#.+/, '');
+    var url = '<$mt:SignOutLink$>';
+    if (is_preview) {
+        if ( document['comments_form'] ) {
+            var entry_id = document['comments_form'].entry_id.value;
+            url += '&entry_id=' + entry_id;
+        } else {
+            url += '&return_url=<$mt:BlogURL encode_url="1"$>';
+        }
+    } else {
+        url += '&return_url=' + encodeURIComponent(doc_url);
+    }
+    location.href = url;
+}
+
+<mt:Ignore>
+/***
+ * Handles the action of the "Sign out" link.
+ */
+</mt:Ignore>
+function mtSignOutOnClick() {
+    mtSignOut();
+    return false;
+}
+
+
+
+/* Cookie *****************************************************************/
+
+<mt:Ignore>
+/***
+ * Persists a copy of the current user cookie into the browser cookie stash.
+ */
+</mt:Ignore>
+function mtSaveUser(f) {
+    // We can't reliably store the user cookie during a preview.
+    if (is_preview) return;
+
+    var u = mtGetUser();
+
+    if (f && (!u || u.is_anonymous)) {
+        if ( !u ) {
+            u = {};
+            u.is_authenticated = false;
+            u.can_comment = true;
+            u.is_author = false;
+            u.is_banned = false;
+            u.is_anonymous = true;
+            u.is_trusted = false;
+        }
+        if (f.author != undefined) u.name = f.author.value;
+        if (f.email != undefined) u.email = f.email.value;
+        if (f.url != undefined) u.url = f.url.value;
+    }
+
+    if (!u) return;
+
+    var cache_period = mtCookieTimeout * 1000;
+
+    // cache anonymous user info for a long period if the
+    // user has requested to be remembered
+    if (u.is_anonymous && f && f.bakecookie && f.bakecookie.checked)
+        cache_period = 365 * 24 * 60 * 60 * 1000;
+
+    var now = new Date();
+    mtFixDate(now);
+    now.setTime(now.getTime() + cache_period);
+
+    var cmtcookie = mtBakeUserCookie(u);
+    mtSetCookie(mtCookieName, cmtcookie, now, mtCookiePath, mtCookieDomain,
+        location.protocol == 'https:');
+}
+
+<mt:Ignore>
+/***
+ * Clears the blog-side user cookie.
+ */
+</mt:Ignore>
+function mtClearUser() {
+    user = null;
+    mtDeleteCookie(mtCookieName, mtCookiePath, mtCookieDomain,
+        location.protocol == 'https:');
+}
+
+<mt:Ignore>
+/***
+ * Sets a browser cookie.
+ */
+</mt:Ignore>
+function mtSetCookie(name, value, expires, path, domain, secure) {
+    if (domain && domain.match(/^\.?localhost$/))
+        domain = null;
+    var curCookie = name + "=" + escape(value) +
+        (expires ? "; expires=" + expires.toGMTString() : "") +
+        (path ? "; path=" + path : "") +
+        (domain ? "; domain=" + domain : "") +
+        (secure ? "; secure" : "");
+    document.cookie = curCookie;
+}
+
+<mt:Ignore>
+/***
+ * Retrieves a browser cookie.
+ */
+</mt:Ignore>
+function mtGetCookie(name) {
+    var prefix = name + '=';
+    var c = document.cookie;
+    var cookieStartIndex = c.indexOf(prefix);
+    if (cookieStartIndex == -1)
+        return '';
+    var cookieEndIndex = c.indexOf(";", cookieStartIndex + prefix.length);
+    if (cookieEndIndex == -1)
+        cookieEndIndex = c.length;
+    return unescape(c.substring(cookieStartIndex + prefix.length, cookieEndIndex));
+}
+
+<mt:Ignore>
+/***
+ * Deletes a browser cookie.
+ */
+</mt:Ignore>
+function mtDeleteCookie(name, path, domain, secure) {
+    if (mtGetCookie(name)) {
+        if (domain && domain.match(/^\.?localhost$/))
+            domain = null;
+        document.cookie = name + "=" +
+            (path ? "; path=" + path : "") +
+            (domain ? "; domain=" + domain : "") +
+            (secure ? "; secure" : "") +
+            "; expires=Thu, 01-Jan-70 00:00:01 GMT";
+    }
+}
+
+<mt:Ignore>
+/***
+ * Serializes a user object into a string, suitable for storing as a cookie.
+ */
+</mt:Ignore>
+function mtBakeUserCookie(u) {
+    var str = "";
+    if (u.name) str += "name:'" + mtEscapeJS(u.name) + "';";
+    if (u.url) str += "url:'" + mtEscapeJS(u.url) + "';";
+    if (u.email) str += "email:'" + mtEscapeJS(u.email) + "';";
+    if (u.auth_type) str += "auth_type:'" + u.auth_type + "';";
+    if (u.is_authenticated) str += "is_authenticated:'1';";
+    if (u.profile) str += "profile:'" + mtEscapeJS(u.profile) + "';";
+    if (u.userpic) str += "userpic:'" + mtEscapeJS(u.userpic) + "';";
+    if (u.sid) str += "sid:'" + mtEscapeJS(u.sid) + "';";
+    str += "is_trusted:'" + (u.is_trusted ? "1" : "0") + "';";
+    str += "is_author:'" + (u.is_author ? "1" : "0") + "';";
+    str += "is_banned:'" + (u.is_banned ? "1" : "0") + "';";
+    str += "can_post:'" + (u.can_post ? "1" : "0") + "';";
+    str += "can_comment:'" + (u.can_comment ? "1" : "0") + "';";
+    str = str.replace(/;$/, '');
+    return str;
+}
+
+<mt:Ignore>
+/***
+ * Unserializes a user cookie and returns a user object with the restored
+ * state.
+ */
+</mt:Ignore>
+function mtUnbakeUserCookie(s) {
+    if (!s) return;
+
+    var u = {};
+    var m;
+    while (m = s.match(/^((name|url|email|auth_type|is_authenticated|profile|userpic|sid|is_trusted|is_author|is_banned|can_post|can_comment):'([^']+?)';?)/)) {
+        s = s.substring(m[1].length);
+        if (m[2].match(/^(is|can)_/)) // boolean fields
+            u[m[2]] = m[3] == '1' ? true : false;
+        else
+            u[m[2]] = mtUnescapeJS(m[3]);
+    }
+    if (u.is_authenticated) {
+        u.is_anonymous = false;
+    } else {
+        u.is_anonymous = true;
+        u.can_post = false;
+        u.is_author = false;
+        u.is_banned = false;
+        u.is_trusted = false;
+    }
+    return u;
+}
+
+/* Comment Messaging *****************************************************************/
+
+<mt:Ignore>
+/***
+ * Called when an entry archive page is loaded.
+ * This routine controls which elements of the comment form are shown
+ * or hidden, depending on commenter type and blog configuration.
+ */
+</mt:Ignore>
+<mt:IfBlog>
+function mtEntryOnLoad() {
+    <mt:Unless tag="IfPingsAccepted">mtHide('trackbacks-info');</mt:Unless>
+    <mt:Unless tag="IfCommentsAccepted">mtHide('comments-open');</mt:Unless>
+    mtFireEvent('usersignin');
+}
+
+function mtEntryOnUnload() {
+    if (mtRequestSubmitted) {
+        var cf = document['comments_form'];
+        if (cf) {
+            if (cf.post && cf.post.disabled)
+                cf.post.disabled = false;
+            if (cf.preview_button && cf.preview_button.disabled)
+                cf.preview_button.disabled = false;
+        }
+        mtRequestSubmitted = false;
+    }
+    return true;
+}
+
+mtAttachEvent('usersignin', mtUserOnLoad);
+</mt:IfBlog>
+
+<mt:Ignore>
+/***
+ * Handles the display of the greeting message, depending on what kind of
+ * user is logged in and blog comment policy.
+ */
+</mt:Ignore>
+<mt:IfBlog>
+function mtShowGreeting() {
+<mt:IfRegistrationAllowed>
+    var reg_reqd = <mt:IfRegistrationRequired>true<mt:Else>false</mt:IfRegistrationRequired>;
+
+    var cf = document['comments_form'];
+    if (!cf) return;
+
+    var el = document.getElementById('comment-greeting');
+    if (!el)  // legacy MT 4.x element id
+        el = document.getElementById('comment-form-external-auth');
+    if (!el) return;
+
+    var eid = cf.entry_id;
+    var entry_id;
+    if (eid) entry_id = eid.value;
+
+    var phrase;
+    var u = mtGetUser();
+
+    if ( u && u.is_authenticated ) {
+        if ( u.is_banned ) {
+            phrase = '<__trans phrase="You do not have permission to comment on this blog. ([_1]sign out[_2])" params="<a href="javascript:void(0);" onclick="return mtSignOutOnClick();">%%</a>" escape="js">';
+        } else {
+            var user_link;
+            if ( u.is_author ) {
+                user_link = '<a href="<$mt:CGIPath$><$mt:CommentScript$>?__mode=edit_profile&return_url=' + encodeURIComponent( location.href );
+                user_link += '">' + u.name + '</a>';
+            } else {
+                // registered user, but not a user with posting rights
+                if (u.url)
+                    user_link = '<a href="' + u.url + '">' + u.name + '</a>';
+                else
+                    user_link = u.name;
+            }
+            // TBD: supplement phrase with userpic if one is available.
+            phrase = '<__trans phrase="Thanks for signing in, __NAME__. ([_1]sign out[_2])" params="<a href="javascript:void(0)" onclick="return mtSignOutOnClick();">%%</a>" escape="js">';
+            phrase = phrase.replace(/__NAME__/, user_link);
+        }
+    } else {
+        if (reg_reqd) {
+            phrase = '<__trans phrase="[_1]Sign in[_2] to comment." params="<a href="javascript:void(0)" onclick="return mtSignInOnClick('comment-greeting')">%%</a>" escape="js">';
+        } else {
+            phrase = '<__trans phrase="[_1]Sign in[_2] to comment, or comment anonymously." params="<a href="javascript:void(0)" onclick="return mtSignInOnClick('comment-greeting')">%%</a>" escape="js">';
+        }
+    }
+    el.innerHTML = phrase;
+<mt:Else>
+    mtShowCaptcha();
+</mt:IfRegistrationAllowed>
+}
+</mt:IfBlog>
+
+<mt:Ignore>
+/***
+ * Function to hide/show/prepopulate fields based upon type of user that has authenticated
+ */
+</mt:Ignore>
+<mt:IfBlog>
+function mtUserOnLoad() {
+    var u = mtGetUser();
+
+    // if the user is authenticated, hide the 'anonymous' fields
+    // and any captcha input if already shown
+    if ( document.getElementById('comments-form')) {
+        if ( u && u.is_authenticated ) {
+            mtShow('comments-form');
+            mtHide('comments-open-data');
+            if (mtCaptchaVisible)
+                mtHide('comments-open-captcha');
+        } else {
+<mt:IfRegistrationRequired>
+            mtHide('comments-form');
+</mt:IfRegistrationRequired>
+        }
+        if ( u && u.is_banned )
+            mtHide('comments-form');
+
+        // if we're previewing a comment, make sure the captcha
+        // field is visible
+        if (is_preview)
+            mtShowCaptcha();
+        else
+            mtShowGreeting();
+
+        // populate anonymous comment fields if user is cookied as anonymous
+        var cf = document['comments_form'];
+        if (cf) {
+            if (u && u.is_anonymous) {
+                if (u.email) cf.email.value = u.email;
+                if (u.name) cf.author.value = u.name;
+                if (u.url) cf.url.value = u.url;
+                if (cf.bakecookie)
+                    cf.bakecookie.checked = u.name || u.email;
+            } else {
+                if (u && u.sid && cf.sid)
+                    cf.sid.value = u.sid;
+            }
+            if (cf.post.disabled)
+                cf.post.disabled = false;
+            if (cf.preview_button.disabled)
+                cf.preview_button.disabled = false;
+            mtRequestSubmitted = false;
+        }
+    }
+}
+</mt:IfBlog>
+
+
+/* Comment Remember Me *****************************************************************/
+
+<mt:Ignore>
+/***
+ * Called when the 'Remember me' checkbox is changed. If the checkbox
+ * is cleared, the cached user cookie is immediately cleared.
+ */
+</mt:Ignore>
+function mtRememberMeOnClick(b) {
+    if (!b.checked)
+        mtClearUser(b.form);
+    return true;
+}
+
+/* Comment Parent *****************************************************************/
+
+<mt:Ignore>
+/***
+ * Handles the action of the 'Reply' links.
+ */
+</mt:Ignore>
+function mtReplyCommentOnClick(parent_id, author) {
+    mtShow('comment-form-reply');
+
+    var checkbox = document.getElementById('comment-reply');
+    var label = document.getElementById('comment-reply-label');
+    var text = document.getElementById('comment-text');
+
+    // Populate label with new values
+    var reply_text = '<__trans phrase="Replying to <a href="[_1]" onclick="[_2]">comment from [_3]</a>" params="#comment-__PARENT__%%location.href=this.href; return false%%__AUTHOR__" escape="js">';
+    reply_text = reply_text.replace(/__PARENT__/, parent_id);
+    reply_text = reply_text.replace(/__AUTHOR__/, author);
+    label.innerHTML = reply_text;
+
+    checkbox.value = parent_id; 
+    checkbox.checked = true;
+    try {
+        // text field may be hidden
+        text.focus();
+    } catch(e) {
+    }
+
+    mtSetCommentParentID();
+}
+
+<mt:Ignore>
+/***
+ * Sets the parent comment ID when replying to a comment.
+ */
+</mt:Ignore>
+function mtSetCommentParentID() {
+    var checkbox = document.getElementById('comment-reply');
+    var parent_id_field = document.getElementById('comment-parent-id');
+    if (!checkbox || !parent_id_field) return;
+
+    var pid = 0;
+    if (checkbox.checked == true)
+        pid = checkbox.value;
+    parent_id_field.value = pid;
+}
+
+/* CAPTCHA *****************************************************************/
+
+<mt:Ignore>
+/***
+ * Called when an input field on the comment form receives focus.
+ */
+</mt:Ignore>
+function mtCommentFormOnFocus() {
+    // if CAPTCHA is enabled, this causes the captcha image to be
+    // displayed if it hasn't been already.
+    mtShowCaptcha();
+}
+
+<mt:Ignore>
+/***
+ * Displays a captcha field for anonymous commenters.
+ */
+</mt:Ignore>
+var mtCaptchaVisible = false;
+function mtShowCaptcha() {
+    var u = mtGetUser();
+    if ( u && u.is_authenticated ) return;
+    if (mtCaptchaVisible) return;
+    var div = document.getElementById('comments-open-captcha');
+    if (div) {
+        div.innerHTML = '<$mt:CaptchaFields$>';
+        mtCaptchaVisible = true;
+    }
+}
+
+/* Comment Submit *****************************************************************/
+
+<mt:Ignore>
+/***
+ * Called when comment form is sent.
+ * Required parameter: Form DOM object of comment form.
+ * If form has a 'bakecookie' member, it will be used to signal
+ * storing the anonymous commenter information to a cookie.
+ * If form has a 'armor' member, it will be used to store
+ * a token that is checked by the comment script.
+ */
+</mt:Ignore>
+<mt:IfBlog>
+var mtRequestSubmitted = false;
+function mtCommentOnSubmit(f) {
+    if (!mtRequestSubmitted) {
+        mtRequestSubmitted = true;
+
+        if (f.armor)
+            f.armor.value = '<$mt:BlogSitePath encode_sha1="1"$>';
+        if (f.bakecookie && f.bakecookie.checked)
+            mtSaveUser(f);
+
+        // disable submit buttons
+        if (f.preview_button) f.preview_button.disabled = true;
+        if (f.post) f.post.disabled = true;
+
+        var u = mtGetUser();
+        if ( !is_preview && ( u && u.is_authenticated ) ) {
+            // validate session; then submit
+            mtFetchedUser = false;
+            mtFetchUser('mtCommentSessionVerify');
+            return false;
+        }
+
+        return true;
+    }
+    return false;
+}
+
+function mtCommentSessionVerify(app_user) {
+    var u = mtGetUser();
+    var f = document['comments_form'];
+    if ( u && app_user && app_user.sid && ( u.sid == app_user.sid ) ) {
+        f.submit();
+    } else {
+        alert('<__trans phrase="Your session has expired. Please sign in again to comment." escape="js">');
+        mtClearUser();
+        mtFireEvent('usersignin');
+<mt:IfRegistrationRequired>
+        mtShow('comments-form');
+        mtHide('comments-open-footer');
+</mt:IfRegistrationRequired>
+    }
+}
+</mt:IfBlog>
+
+/* Utility Functions *****************************************************************/
+
+<mt:Ignore>
+/***
+ * Simple routine for showing a DOM element (applying a CSS display
+ * attribute of 'none').
+ */
+</mt:Ignore>
+function mtHide(id) {
+    var el = (typeof id == "string") ? document.getElementById(id) : id;
+    if (el) el.style.display = 'none';
+}
+
+<mt:Ignore>
+/***
+ * Simple routine for showing a DOM element (applying a CSS display
+ * attribute of 'block').
+ */
+</mt:Ignore>
+function mtShow(id) {
+    var el = (typeof id == "string") ? document.getElementById(id) : id;
+    if (el) el.style.display = 'block';
+}
+
+<mt:Ignore>
+/***
+ * Calls the event named, if there are handlers for it.
+ */
+</mt:Ignore>
+function mtFireEvent(eventName,param) {
+    var fn = window['on' + eventName];
+    if (typeof fn == 'function') return fn(param);
+    return;
+}
+
+function mtFixDate(date) {
+    var skew = (new Date(0)).getTime();
+    if (skew > 0)
+        date.setTime(date.getTime() - skew);
+}
+
+<mt:Ignore>
+/***
+ * Simple function that escapes single quote characters for storing
+ * in a cookie.
+ */
+</mt:Ignore>
+function mtEscapeJS(s) {
+    s = s.replace(/'/g, "&apos;");
+    return s;
+}
+
+<mt:Ignore>
+/***
+ * Simple function that unescapes single quote characters that were
+ * stored in a cookie.
+ */
+</mt:Ignore>
+function mtUnescapeJS(s) {
+    s = s.replace(/&apos;/g, "'");
+    return s;
+}
+
+<mt:Ignore>
+/***
+ * A utility function for assigning/adding handlers to window events.
+ */
+</mt:Ignore>
+function mtAttachEvent(eventName,func) {
+    var onEventName = 'on' + eventName;
+    var old = window[onEventName];
+    if( typeof old != 'function' )
+        window[onEventName] = func;
+    else {
+        window[onEventName] = function( evt ) {
+            old( evt );
+            return func( evt );
+        };
+    }
+}
+
+/* Ajax Requests *****************************************************************/
+
+<mt:Ignore>
+/***
+ * Returns a XMLHttpRequest object (for Ajax operations).
+ */
+</mt:Ignore>
+function mtGetXmlHttp() {
+    if ( !window.XMLHttpRequest ) {
+        window.XMLHttpRequest = function() {
+            var types = [
+                "Microsoft.XMLHTTP",
+                "MSXML2.XMLHTTP.5.0",
+                "MSXML2.XMLHTTP.4.0",
+                "MSXML2.XMLHTTP.3.0",
+                "MSXML2.XMLHTTP"
+            ];
+
+            for ( var i = 0; i < types.length; i++ ) {
+                try {
+                    return new ActiveXObject( types[ i ] );
+                } catch( e ) {}
+            }
+
+            return undefined;
+        };
+    }
+    if ( window.XMLHttpRequest )
+        return new XMLHttpRequest();
+}
+
+/* Section *****************************************************************/
+
+<mt:Ignore>
+/***
+ * Initialize
+ */
+</mt:Ignore>
+// BEGIN: fast browser onload init
+// Modifications by David Davis, DWD
+// Dean Edwards/Matthias Miller/John Resig
+// http://dean.edwards.name/weblog/2006/06/again/?full#comment5338
+
+function mtInit() {
+    // quit if this function has already been called
+    if (arguments.callee.done) return;
+
+    // flag this function so we don't do the same thing twice
+    arguments.callee.done = true;
+
+    // kill the timer
+    // DWD - check against window
+    if ( window._timer ) clearInterval(window._timer);
+
+    // DWD - fire the window onload now, and replace it
+    if ( window.onload && ( window.onload !== window.mtInit ) ) {
+        window.onload();
+        window.onload = function() {};
+    }
+}
+
+/* for Mozilla/Opera9 */
+if (document.addEventListener) {
+    document.addEventListener("DOMContentLoaded", mtInit, false);
+}
+
+/* for Internet Explorer */
+/*@cc_on @*/
+/*@if (@_win32)
+document.write("<script id=__ie_onload defer src=javascript:void(0)><\/script>");
+var script = document.getElementById("__ie_onload");
+script.onreadystatechange = function() {
+    if (this.readyState == "complete") {
+        mtInit(); // call the onload handler
+    }
+};
+/*@end @*/
+
+/* for Safari */
+if (/WebKit/i.test(navigator.userAgent)) { // sniff
+    _timer = setInterval(function() {
+        if (/loaded|complete/.test(document.readyState)) {
+            mtInit(); // call the onload handler
+        }
+    }, 10);
+}
+
+/* for other browsers */
+window.onload = mtInit;
+
+// END: fast browser onload init
+
+/* END Movable Type Javascript *****************************************************************/
Index: trunk/Vanilla/config.yaml
===================================================================
--- trunk/Vanilla/config.yaml (revision 962)
+++  (revision )
@@ -1,374 +1,0 @@
-name:           Vanilla Template Sets
-id:             vanilla-template-sets
-key:            vanilla-template-sets
-description:    The simplest Movable Type templates in HTML 1.0
-version:        1.0
-author_name:    Beau Smith
-author_link:    http://www.beausmith.com/mt/
-plugin_link:    http://www.beausmith.com/mt/plugins/vanilla
-
-template_sets:
-    vanilla:
-        label: Vanilla
-        base_path: templates/vanilla
-        order: 501
-        notes: 
-            - Lastn entries on Homepage
-            - Entry Detail
-        templates:
-            index:
-                home:
-                    label: Homepage
-                    outfile: index.html
-                    rebuild_me: 1
-            individual:
-                entry: 
-                    label: Entry
-                    mappings:
-                        entry_archive:
-                            archive_type: Individual
-            module:
-                wrapper:
-                    label: Wrapper
-    vanilla_archives:
-        label: Vanilla + Archives
-        base_path: templates/vanilla+archives
-        notes:
-            - Base homepage & entries
-            - Archive Index
-            - Archives: Monthly, Author, Category and Category-Monthly
-            - Navigation w/ Category-Monthly links on Category Archives
-        order: 502
-        templates:
-            index:
-                home:
-                    label: Homepage
-                    outfile: index.html
-                    rebuild_me: 1
-                archives:
-                    label: Archives
-                    outfile: archives.html
-                    rebuild_me: 1
-            individual:
-                entry: 
-                    label: Entry
-                    mappings:
-                        entry_archive:
-                            archive_type: Individual
-            archive:
-                entry_listing: 
-                    label: Entry Listing
-                    mappings:
-                        monthly:
-                            archive_type: Monthly
-                        category:
-                            archive_type: Category
-                        category-monthly:
-                            archive_type: Category-Monthly
-                        author:
-                            archive_type: Author
-            module:
-                wrapper:
-                    label: Wrapper
-    vanilla_pages:
-        label: Vanilla + Pages
-        base_path: templates/vanilla+pages
-        notes:
-            - Base homepage & entries
-            - Pages
-            - Navigation including Pages
-        order: 503
-        templates:
-            index:
-                home:
-                    label: Homepage
-                    outfile: index.html
-                    rebuild_me: 1
-            individual:
-                entry: 
-                    label: Entry
-                    mappings:
-                        entry_archive:
-                            archive_type: Individual
-            page:
-                page: 
-                    label: Page
-                    mappings:
-                        page_archive:
-                            archive_type: Page
-            module:
-                wrapper:
-                    label: Wrapper
-    vanilla_authentication:
-        label: Vanilla + Authentication & Userpics
-        base_path: templates/vanilla+authentication
-        notes: 
-            - En/disable userpics in javascript
-            - Use of community "edit profile" script is necessary to add userpics. The "edit profile" page assumes that you are using profiles and thus links to "view profile" screen. If using profiles is not desired, the "view profile" link can be removed from the "Profile Edit" Global System Template.
-        order: 504
-        templates:
-            index:
-                home:
-                    label: Homepage
-                    outfile: index.html
-                    rebuild_me: 1
-                javascript:
-                    label: JavaScript
-                    outfile: mt.js
-                    rebuild_me: 1
-            module:
-                wrapper:
-                    label: Wrapper
-    vanilla_comments:
-        label: Vanilla + Comments
-        base_path: templates/vanilla+comments
-        notes:
-            - Authentication
-            - Comments
-            - Comment reply links
-            - Comment Preview
-            - Comment Response
-        order: 505
-        templates:
-            index:
-                home:
-                    label: Homepage
-                    outfile: index.html
-                    rebuild_me: 1
-                javascript:
-                    label: JavaScript
-                    outfile: mt.js
-                    rebuild_me: 1
-            individual:
-                entry: 
-                    label: Entry
-                    mappings:
-                        entry_archive:
-                            archive_type: Individual
-            module:
-                wrapper:
-                    label: Wrapper
-            system:
-                comment_preview:
-                    label: Comment Preview
-                comment_response:
-                    label: Comment Response
-    vanilla_comments_userpics:
-        label: Vanilla + Comments w/ Userpics
-        base_path: templates/vanilla+authentication+comments+userpics
-        notes:
-            - Authentication w/ userpic
-            - Comments w/ userpics
-            - Comment reply links
-            - Comment Preview
-            - Comment Response
-            - En/disable userpics in javascript
-            - Use of community "edit profile" script is necessary to add userpics. The "edit profile" page assumes that you are using profiles and thus links to "view profile" screen. If using profiles is not desired, the "view profile" link can be removed from the "Profile Edit" Global System Template.
-        order: 506
-        templates:
-            index:
-                home:
-                    label: Homepage
-                    outfile: index.html
-                    rebuild_me: 1
-                javascript:
-                    label: JavaScript
-                    outfile: mt.js
-                    rebuild_me: 1
-            individual:
-                entry: 
-                    label: Entry
-                    mappings:
-                        entry_archive:
-                            archive_type: Individual
-            module:
-                wrapper:
-                    label: Wrapper
-            system:
-                comment_preview:
-                    label: Comment Preview
-                comment_response:
-                    label: Comment Response
-    vanilla_create_entry:
-        label: Vanilla + Create Entry
-        base_path: templates/vanilla+create-entry
-        notes: 
-            - Authentication
-            - Create Entry
-            - Entry Response
-        order: 507
-        templates:
-            index:
-                home:
-                    label: Homepage
-                    outfile: index.html
-                    rebuild_me: 1
-                create-entry:
-                    label: Create Entry
-                    outfile: create-entry.html
-                    rebuild_me: 1
-                javascript:
-                    label: JavaScript
-                    outfile: mt.js
-                    rebuild_me: 1
-            individual:
-                entry: 
-                    label: Entry
-                    mappings:
-                        entry_archive:
-                            archive_type: Individual
-            module:
-                wrapper:
-                    label: Wrapper
-            system:
-                entry_response:
-                    label: Entry Response
-    vanilla_search_tags:
-        label: Vanilla + Search & Tags
-        base_path: templates/vanilla+search+tags
-        order: 508
-        notes: 
-            - Tag Cloud and Search Form on Homepage
-            - Entry Detail
-            - Page Detail
-            - Search Results Template
-        templates:
-            index:
-                home:
-                    label: Homepage
-                    outfile: index.html
-                    rebuild_me: 1
-                javascript:
-                    label: Javascript
-                    outfile: mt.js
-                    rebuild_me: 1
-            individual:
-                entry: 
-                    label: Entry
-                    mappings:
-                        entry_archive:
-                            archive_type: Individual
-            page:
-                page: 
-                    label: Page
-                    mappings:
-                        page_archive:
-                            archive_type: Page
-            module:
-                wrapper:
-                    label: Wrapper
-            system:
-                search_results:
-                    label: Search Results
-    vanilla_assets:
-        label: Vanilla + Assets
-        base_path: templates/vanilla+assets
-        order: 509
-        notes: 
-            - Recent assets on Homepage in various sizes and formats
-            - lastn entries on Homepage with the first asset added to each as 70 pixel square
-            - Entry Detail with assets in entries
-        templates:
-            index:
-                home:
-                    label: Homepage
-                    outfile: index.html
-                    rebuild_me: 1
-            individual:
-                entry: 
-                    label: Entry
-                    mappings:
-                        entry_archive:
-                            archive_type: Individual
-            module:
-                wrapper:
-                    label: Wrapper
-    vanilla_widgets:
-        label: Vanilla + Widgets
-        base_path: templates/vanilla+widgets
-        order: 510
-        notes: 
-            Homepage with one widget set and individually included widget:
-                - Search
-                - Tag Cloud
-                - Monthly Archives
-                - Recent Entries
-                - Page Listing
-                - About Site
-            Entry Detail with a second widget set and individually included widget:
-                - Search
-                - Tag Cloud
-                - Monthly Archives
-                - About Site
-        templates:
-            index:
-                home:
-                    label: Homepage
-                    outfile: index.html
-                    rebuild_me: 1
-            individual:
-                entry: 
-                    label: Entry
-                    mappings:
-                        entry_archive:
-                            archive_type: Individual
-            archive:
-                entry_listing: 
-                    label: Entry Listing
-                    mappings:
-                        monthly:
-                            archive_type: Monthly
-            module:
-                wrapper:
-                    label: Wrapper
-            widget:
-                search:
-                    label: Search
-                tag_cloud_widget:
-                    label: Tag Cloud
-                monthly_archives_widget:
-                    label: Monthly Archives
-                recent_entries_widget:
-                    label: Recent Entries
-                recent_assets_widget:
-                    label: Recent Assets
-                recent_comments_widget:
-                    label: Recent Comments
-                pages_widget:
-                    label: Pages
-            widgetset:
-                blog_activity:
-                    order: 1000
-                    label: Recent Activity
-                    widgets:
-                        - Recent Entries
-                        - Recent Comments
-                        - Recent Assets
-                blog_archives:
-                    order: 1000
-                    label: Blog Archives
-                    widgets:
-                        - Search
-                        - Tag Cloud
-                        - Pages
-                        - Monthly Archives
-
-
-# - Rating
-#     * 1
-#     * 5 Star
-#     * -1, 0, 1
-#     https://intranet.sixapart.com/wiki/index.php/MovableType:Rating_Framework
-#     https://intranet.sixapart.com/wiki/index.php/Movable_Type:Athena/Rating_Framework
-#     https://intranet.sixapart.com/wiki/index.php/Movable_Type:MT4_Requirements:_Rating_framework
-# - Profiles + Userpics + Friending
-#     * Userpics
-#     * Profiles
-#     * Friending
-# - Custom Fields
-# ----
-# - Logic
-#   - if/else
-#   - unless
-#   - var w/ op attributes
-# - YUI Template
