$(document).ready(function(){
    /**
     * Funções que inserem os arquivos SWF ( Flash ) em cada container especificado
     * @author Carlos Alberto Tristacci
     */
    if(navigator.plugins["Shockwave Flash"] || navigator.plugins["Shockwave Flash 2.0"]){
        $('.flash_oculto').css('display', 'none');
        if(document.getElementById('secoes')){
            $('#secoes').flash(
            {
                src: './swf/menu_com_freire.swf',
                width: 820,
                height: 180,
                wmode: 'transparent'
            },
            {
                version: 9
            });
        }
    }

    if(document.getElementById('chat')){
        $('#chat').flash(
        {
            src: './swf/ChatClient.swf',
            width: "100%",
            height: 500,
            allowFullScreen: true,
            flashvars: {
                roomID: $.jqURL.get('sala'),
                userID: $.jqURL.get('usuario'),
                userPassword: $.jqURL.get('rand'),
                guestUser: $.jqURL.get('convidado')
            }
        },
        {
            version: 9
        });
    }
    // Player de video
    if(document.getElementById('video_player')){
        $('#video_player').flash(
        {
            src: 'video_player.swf',
            width: '100%',
            height: '100%',
            allowFullScreen: true,
            flashvars: {
                video: $.jqURL.get('video'),
                play: true
            }
        },
        {
            version: 9
        });
    }

    //player de vídeo do fórum
    if(document.getElementById('video_forum')){
        $('#video_forum').flash(
        {
            src: './swf/video_player.swf',
            width: 400,
            height: 300,
            allowFullScreen: true,
            flashvars: {
                video:$('#video_forum').attr('rel'),
                titulo: $('#video_forum').attr('title'),
                autor: $('#video_forum').attr('autor'),
                play: false
            }
        },
        {
            version: 9
        });
    }

    //animacao do fórum
    if(document.getElementById('anima_forum')){
        $('#anima_forum').flash(
        {
            src: $('#anima_forum').attr('rel'),
            width: 400,
            height: 300
        },
        {
            version: 9
        });
    }

    // player de audio
    $('.audio').each(function(){
        $(this).flash(
        {
            src: './swf/preview.swf',
            width: 300,
            height: 100,
            wmode: 'transparent',
            flashvars: {
                songURL: $(this).attr('rel'),
                songName: $(this).attr('name'),
                artistName: $(this).attr('author')
            }
        },
        {
            version: 9
        });
    });
    if(document.getElementById('mapa')){
        $('#mapa').flash(
        {
            src: './swf/mapa_v2.swf',
            width: 297,
            height: 305,
            wmode: 'transparent',
            flashvars: {
                categoria: $.jqURL.get('categoria'),
                host: $.jqURL.strip().toString()
            }
        },
        {
            version: 8
        });
    }
});

