/**
 * @author jasse
 * 
 * TODO: Expose options to app.yml
 * 
 */
var detailsWin = null;

$(document).observe('dom:loaded', function() { 
    $$('a[rel=details]').each(function(link) {
    
        link.onclick = function() {
            if (!detailsWin) {
                detailsWin = new Window({
                    title:          name,
                    className:      PrototypeWindowSettings.theme,
                    effectOptions:  PrototypeWindowSettings.effectOptions,

                    width:          PrototypeWindowSettings.window.width,
                    height:         PrototypeWindowSettings.window.height,
                    resizable:      PrototypeWindowSettings.window.resizable,
                    draggable:      PrototypeWindowSettings.window.draggable,

                    showEffect:     PrototypeWindowSettings.window.showEffect,
                    hideEffect:     PrototypeWindowSettings.window.hideEffect,
                });
            }
            
            detailsWin.setAjaxContent(this.href, {}, true, true);
            return false;
        }.bind(link);
    });
});
