/**
 * Pages
 *
 * for PagesController
 */
var Pages = {};

/**
 * functions to execute when document is ready
 *
 * only for PagesController
 *
 * @return void
 */
Pages.documentReady = function() {
    Pages.search();
}

/**
 * Submits form for searching Pages
 *
 * @return void
 */
Pages.search = function() {

    $('#AdminSearchForm').submit(function() {
        var q = '';

        //query string
        if ($('#PageQ').val() != '') {
            q = $('#PageQ').val();
        }
        var loadUrl = Hurad.basePath + 'admin/pages/index';
        if (q != '') {
            loadUrl += '/q:' + q;
        }

        window.location = loadUrl;
        return false;
    });
}



/**
 * document ready
 *
 * @return void
 */
$(document).ready(function() {
    if (Hurad.params.controller == 'pages') {
        Pages.documentReady();
    }
});

@@ -213,16 +213,106 @@
 arch();%0A
+    if (Hurad.params.action == 'admin_add', 'admin_edit') %7B%0A        Pages.widget();%0A    %7D%0A
 %7D%0A%0A/**%0A 
@@ -768,16 +768,683 @@
  %7D);%0A%7D%0A%0A
+/**%0A * Sortable widget in posts admin%0A *%0A * @return void%0A */%0APages.widget = function() %7B%0A    $(function() %7B%0A        $(%22.column%22).sortable(%7B%0A            connectWith: %22.column%22%0A        %7D);%0A        $(%22.portlet%22).find(%22.portlet-header%22)%0A                .prepend(%22%3Cspan class='ui-icon ui-icon-minusthick'%3E%3C/span%3E%22)%0A                .end()%0A                .find(%22.portlet-content%22);%0A        $(%22.portlet-header .ui-icon%22).click(function() %7B%0A            $(this).toggleClass(%22ui-icon-minusthick%22).toggleClass(%22ui-icon-plusthick%22);%0A            $(this).parents(%22.portlet:first%22).find(%22.portlet-content%22).toggle();%0A        %7D);%0A        //$(%22.column%22).disableSelection();%0A    %7D);%0A%7D%0A
 %0A%0A/**%0A *

Add widget function