﻿
MAK.Category = function() {

    /* Private */

    /* Properties */

    var cmp = {};


    /* Methods */

    var init = function() {

        /* Constructor */

        // Create the search form
        MAK.searchForm = new TVI.Form({
            ID: 'searchForm',
            buttons: [{

                selector: '.searchButton A',
                handler: function() {

                    // Redirect to the seatch page on submit
                    MAK.searchForm.redirect({
                    
                        url: 'Category.aspx?search=true',
                        empty: true
                    
                    });
                }
                

            }]
            
        });
        
        // Fill the form from the querystring
        var args = TVI.Request.QueryString;
        
        //pound signs are corrupted in IE so get from .net
        TVI.apply(args, {
           priceRange : MAK.priceRange
        });
        
        MAK.searchForm.val(args);
        
    };


    TVI.ready(init);


    return cmp;


} ();
