// Version of DGN.Lightbox specific to offerte button on search results page
// (added by CAW)
//
OfferteLightbox = Class.create(DGN.Lightbox, {
    initialize: function($super) {
        $super();
        this.relValue = 'offerteLightbox';
    },

    sendAjaxRequest: function($super, ps_url, po_options) {
        if (po_options === undefined) {
            po_options = { };
        }
        if (po_options.parameters === undefined) {
            po_options.parameters = { };
        }

        $super(ps_url, po_options);
    }, // end function sendAjaxRequest,

    afterLoad: function($super, transport) {
        $super(transport);

        var handler;

        // Initialize sliders:
        //
        var hypotheekslider;
        if (hypotheekslider = $('slider_koopsom_hypotheek')) {
            var hypotheek = $('hypotheek-input');
            DGN.EuroSlider.createSliderObject(hypotheekslider);
            handler = function() {
                if (this.checked) {
                    $('koopsom_hypotheek-label').show();
                    $('koopsom_hypotheek-element').show();
                } else {
                    $('koopsom_hypotheek-label').hide();
                    $('koopsom_hypotheek-element').hide();
                }
            };
            hypotheek.observe('click', handler);
            handler.bind(hypotheek)();
        }
        var leveringslider;
        if (leveringslider = $('slider_koopsom_levering')) {
            var levering = $('levering-input');
            DGN.EuroSlider.createSliderObject(leveringslider);
            handler = function() {
                if (this.checked) {
                    $('koopsom_levering-label').show();
                    $('koopsom_levering-element').show();
                } else {
                    $('koopsom_levering-label').hide();
                    $('koopsom_levering-element').hide();
                }
            };
            levering.observe('click', handler);
            handler.bind(levering)();
        }

        var testament;
        if (testament = $('testament-input')) {
            handler = function() {
                $('num_testamenten-element').setStyle({ visibility: this.checked ? 'visible' : 'hidden' });
                };
            testament.observe('click', handler);
            handler.bind(testament)();
        }

        // Initialize date-picker elements:
        //
        var options = new Object;
        options.minyear = 1930;
        $$('div#lightboxImage input.dgn.date').each(function(el) { new DGN.DatePicker(el, options); });
    } // end function afterLoad

});

