$(document).ready(function() {
    
    $.blockUI.defaults.overlayCSS = { backgroundColor: '#000', opacity: '0.7' };
    $('a.media').mediabox( {autoplay:1, caption:0} );
    
    
    // categoria flash //
    $('.categoria_flash').flash(
        { 
            src: 'images/swf/categoria_flash.swf', 
            flashvars: { 
                css: [
                    '* { color: #666666; }',
                    'a { color: #0099CC; text-decoration: none; }',
                    'a:hover { text-decoration: underline; }'
                ].join(' ')
            }
        },
        { version: 8 },
        function(htmlOptions) {
            var $this = $(this);
            var params = this.innerHTML.split('|');
            htmlOptions.flashvars.txt = params[0];
            htmlOptions.flashvars.lnk = params[1];
            htmlOptions.flashvars.pic = params[2];
            this.innerHTML = '<div>'+this.innerHTML+'</div>';
            var $alt = $(this.firstChild);
            htmlOptions.height = 96;
            htmlOptions.width = 102;
            $alt.addClass('alt');
            $(this)
                .addClass('flash-replaced')
                .prepend($.fn.flash.transform(htmlOptions));						
        }
    );

   // sottocategoria //
   $('.sottocategoria_flash').flash(
        { 
            src: 'images/swf/sottocategoria_flash.swf', 
            flashvars: { 
                css: [
                    '* { color: #666666; }',
                    'a { color: #0099CC; text-decoration: none; }',
                    'a:hover { text-decoration: underline; }'
                ].join(' ')
            }
        },
        { version: 8 },
        function(htmlOptions) {
            var $this = $(this);
            var params = this.innerHTML.split('|');
            htmlOptions.flashvars.txt = params[0];
            htmlOptions.flashvars.lnk = params[1];
            this.innerHTML = '<div>'+this.innerHTML+'</div>';
            var $alt = $(this.firstChild);
            htmlOptions.height = 96;
            htmlOptions.width = 102;
            $alt.addClass('alt');
            $(this)
                .addClass('flash-replaced')
                .prepend($.fn.flash.transform(htmlOptions));						
        }
    );

 


});