/*
* jQuery Plugin Bumper 1.0
*
* http://docs.jquery.com/UI/Resizables
*
* Depends:
*	ui.core.js      - 
*   ui.dialog.js    - http://ui.jquery.com/demos/dialog#modal-message
*/
(function($) {
    $.fn.bumper = function(options) {

        //Set default values...all of which can be overriden by passing in the appropriate 
        options = $.extend({
            backlinkselector: '.backlink',
            continuelinkselector: '.continuelink',
            autoOpen: false,
            width: 352,
            height: 433,
            modal: true,
            resizable: false,
            open: function(event, ui) {$(".ui-dialog-titlebar").remove()}
        }, options);

        //Initialize the dialog...check is done already
        $(this).dialog({
            autoOpen: options.autoOpen,
            height: options.height,
            width: options.width,
            modal: options.modal,
            resizable: options.resizable,
            open: options.open
        });

        return this.each(function() {
            //set the continue link to the url passed in
            var dialogId = this.id;
            $(this).find(options.backlinkselector).click(function() { $("#" + dialogId).dialog('close'); return false; });
            $(this).find(options.continuelinkselector).attr("href", options.continuelink);
            $(this).dialog('open');
        });
    };
})(jQuery);