
/* Merged Plone Javascript file
 * This file is dynamically assembled from separate parts.
 * Some of these parts have 3rd party licenses or copyright information attached
 * Such information is valid for that section,
 * not for the entire composite file
 * originating files are separated by - filename.js -
 */

/* XXX ERROR -- could not find '++resource++collective.flowplayer/flashembed.min.js'*/

/* - @@collective.flowplayer.js - */
(function($) {
        $(function() { 
            $('.autoFlowPlayer').each(function() {
                var config = {
    "controlsOverVideo": "ease", 
    "controlBarBackgroundColor": -1, 
    "showVolumeSlider": false, 
    "controlBarGloss": "low", 
    "useNativeFullScreen": true, 
    "autoBuffering": false, 
    "player": "++resource++collective.flowplayer/FlowPlayerDark.swf", 
    "initialScale": "fit", 
    "usePlayOverlay": true, 
    "autoPlay": false
};
                var $self = $(this);
                if ($self.is('.minimal')) { 
                    config.plugins.controls = null; 
                };
                var audio = $self.is('.audio');
                if (audio && !$self.is('.minimal')) {
                    if ($self.is('.image-left') || $self.is('.image-right'))
                        $self.width(230)
                    else
                        $self.width(500);
                    config.plugins.controls.all = false;
                    config.plugins.controls.play = true;
                    config.plugins.controls.scrubber = true;
                    config.plugins.controls.mute = true;
                    config.plugins.controls.volume = true;
                    config.plugins.controls.time = true;
                }
                if ($self.is('div')) {
                    // comming from Kupu, there are relative urls
                    config.clip.baseUrl = $('base').attr('href');
                    config.clip.url = $self.find('a').attr('href');
                    if (audio) {
                      // force .mp3 extension
                      config.clip.url = config.clip.url + '?e=.mp3';
                    };
                    // Ignore global autoplay settings
                    if ($self.find('img').length == 0) {
                        // no image. Don't autoplay, remove all elements inside the div to show player directly.
                        config.clip.autoPlay = false;
                        $self.empty();
                    } else {
                        // Clip is probably linked as image, so autoplay the clip after image is clicked
                        config.clip.autoPlay = true;
                    }
                }
                flowplayer(this, {}, config).onLoad( function() { this.setVolume(50); });
                $('.flowPlayerMessage').remove();
            });
            $('.playListFlowPlayer').each(function() {
                var config = {
    "controlsOverVideo": "ease", 
    "controlBarBackgroundColor": -1, 
    "showVolumeSlider": false, 
    "controlBarGloss": "low", 
    "useNativeFullScreen": true, 
    "autoBuffering": false, 
    "player": "++resource++collective.flowplayer/FlowPlayerDark.swf", 
    "initialScale": "fit", 
    "usePlayOverlay": true, 
    "autoPlay": false
};
                var $self = $(this);
                var audio = $self.is('.audio');
                if (audio) { config.plugins.controls.fullscreen = false; }
                if ($self.is('.minimal')) { config.plugins.controls = null; }
                if ($self.find('img').length > 0) { 
                    // has splash
                    config.clip.autoPlay = true;
                }
                portlet_parents = $self.parents('.portlet');
                var playlist_selector = 'div#flowPlaylist';
                if (portlet_parents.length > 0) {
                    var portlet = true;
                    // playlist has to be bound to unique item
                    playlist_selector_id = portlet_parents.parent().attr('id')+'-playlist';
                    $self.parent().find('.flowPlaylist-portlet-marker').attr('id', playlist_selector_id);
                    playlist_selector = '#'+playlist_selector_id;
                    if (audio && !$self.is('.minimal')) {
                        config.plugins.controls.all = false;
                        config.plugins.controls.play = true;
                        config.plugins.controls.scrubber = true;
                        config.plugins.controls.mute = true;
                        config.plugins.controls.volume = false;
                    }
                } else {
                    var portlet = false;
                }
                if (!portlet) {
                    $("#pl").scrollable({items:playlist_selector, size:4, clickable:false});
                }
                // manual = playlist is setup using HTML tags, not using playlist array in config
                flowplayer(this, {}, config).playlist(playlist_selector, {loop: true, manual: true}).onLoad( function() { this.setVolume(50); });
                $self.show();
                $('.flowPlayerMessage').remove();

            });
        });
})(jQuery);


/* - ++resource++acrysoftoric.theme.javascripts/font-sizer.js - */
function setFullBodyFontSize($fullbodyfontsize, $reset) {
    /* use: '', largeText, largerText */
    var $body = jq('div.fullBody');
    if ($reset) { 
        $body.removeClass('largeText').removeClass('largerText');
        createCookie("fullbodyfontsize", $fullbodyfontsize, 365);        
    } 
    $body.addClass($fullbodyfontsize);
};

jq(function() {
    var $fullbodyfontsize = readCookie("fullbodyfontsize");
    if ($fullbodyfontsize) setFullBodyFontSize($fullbodyfontsize, 0);
});



