$.fn.fastSerialize = function() {
    var a = [];

    $('input,textarea,select,button', this).each(function() {
        var n = this.name;
        var t = this.type;

        if ( !n || this.disabled || t == 'reset' ||
            (t == 'checkbox' || t == 'radio') && !this.checked ||
            (t == 'submit' || t == 'image' || t == 'button') && this.form.clicked != this ||
            this.tagName.toLowerCase() == 'select' && this.selectedIndex == -1)
            return;

        if (t == 'image' && this.form.clicked_x)
            return a.push(
                {name: n+'_x', value: this.form.clicked_x},
                {name: n+'_y', value: this.form.clicked_y}
            );

        if (t == 'select-multiple') {
            $('option:selected', this).each( function() {
                a.push({name: n, value: this.value});
            });
            return;
        }

        a.push({name: n, value: this.value});
    });

    return a;
};

$.fn.PopUpWindow = function(config){
        return this.each(function(){
                // configuration
                this.myConfig =
                {
                    // valid address you want to open
                        address: config && config.address ? config.address : null,
                        // name for the new window. Used when refering to the new windows later
                        name: config && config.name ? config.name : "PopUpWindow",
                        // width of the window
                        width: config && config.width ? Number(config.width) : 100,
                        // height of the window
                        height: config && config.height ? Number(config.height) : 100,
                        // additional parameters for the window configuration like showing the toolbar or scrollbars
                        params: config && config.params ? config.params : null
                }
                // for "A" tags. if they didn't provide an address for us, then we will
                // try to grab the link for the tag and use that
                if(this.nodeName.toLowerCase() == "a")
                {
                  // see if they gave us an address
                  if(!this.myConfig.address)
                  {
                    // try to grab the href link and use that
            this.myConfig.address = $(this).href();
                  }
                  // disable the hrefs on a tag
                    $(this).href("#");
                }
                // add the popup code to the tag's click event
                $(this).click(function()
                {
                        // build parameters
                        var params = "width=" + this.myConfig.width + ",height=" + this.myConfig.height;
                        if(this.myConfig.params != null)
                        {
                                params += "," + this.myConfig.params;
                        }
                        window.open(this.myConfig.address, this.myConfig.name, params).focus();;
                });
        });
}