var box = {};
window.addEvent('domready', function(){
    if (typeof multiBox === "undefined") {
        return;
    }
    box = new multiBox({
        mbClass: '.mb', //class you need to add links that you want to trigger multiBox with (remember and update CSS files)        
        container: $(document.body),//where to inject multiBox
        //descClassName: 'multiBoxDesc',//the class name of the description divs
        path: './Files/',//path to mp3 and flv players
        useOverlay: true,//use a semi-transparent background. default: false;
        //      maxSize: {w:600, h:400},//max dimensions (width,height) - set to null to disable resizing
        //      addDownload: true,//do you want the files to be downloadable?
        //      pathToDownloadScript: './Scripts/ForceDownload.asp',//if above is true, specify path to download script (classicASP and ASP.NET versions included)
        //      addRollover: true,//add rollover fade to each multibox link
        //      addOverlayIcon: true,//adds overlay icons to images within multibox links
        //      addChain: true,//cycle through all images fading them out then in
        recalcTop: true,//subtract the height of controls panel from top position
        addTips: true,//adds MooTools built in 'Tips' class to each element (see: http://mootools.net/docs/Plugins/Tips)
        onNavNext: function(multiBox){
            if (pageTracker && pageTracker._trackPageview) {
                pageTracker._trackPageview('/multibox/navigation/click/next');
            }
        },
        onNavPrev: function(multiBox){
            if (pageTracker && pageTracker._trackPageview) {
                pageTracker._trackPageview('/multibox/navigation/click/previous');
            }
        }
    });    
});

//delegate for flash multibox implementation
function multiboxDelegate(){
    box.open($('mb_delegate'));
}

// delegate for
function backstage_redirect() {
    window.location = "/about/backstage";
}

window.addEvent('domready', function(){
    $$('.nav-form').each(function(item, index, array){
        item.store('base_action', item.get('action'));
    })
    $$('.nav-form select').addEvent('change', function(e){
        var form = this.getParent('form');
        form.set('action', form.retrieve('base_action') + this.get('value'));
        form.submit();
    });
});

