$(document).ready(function () {

    $(".mediaVideo").click(
        function (){
            $("#videoTitle").text(this.title);
            var mediahref = $(this).attr('href');
            flashembed("videoWrapper",{
                src:'/misc/flowplayer/FlowPlayerLight.swf',
                width:480,
                height:360
            },
            {
                config: {
                    videoFile:mediahref,
                    initialVolumePercentage:75,
                    autoPlay:false,
                    autoBuffering:true,
                    loop:false,
                    autoRewind:true,
                    initialScale:'orig',
                    useNativeFullScreen:true,
                    showFullScreenButton: true,
                    menuItems: [false, true, true, false, true, false, false]
                }
            });

            $("#videoWrapper").css({
                "padding-top":"0"
            });

        })

    $(".mediaAudio").click(
        function (){
            $("#videoTitle").text(this.title);
            var mediahref = $(this).attr('href');
            flashembed("videoWrapper",{
                src:'/misc/flowplayer/FlowPlayerLight.swf',
                width:480,
                height:28
            },
            {
                config: {
                    videoFile:mediahref,
                    initialVolumePercentage:75,
                    autoPlay:false,
                    autoBuffering:true,
                    loop:false,
                    autoRewind:true,
                    initialScale:'orig',
                    showFullScreenButton: false,
                    showMenu:false,
                    plugins: {
                        audio: {
                            url: '/misc/flowplayer/flowplayer.audio-3.0.4.swf'
                        }                        
                    }
                }
            });

            $("#videoWrapper").css({
                "background":"#FFFFFF url('/img/podcast_bigger.jpg') 0 0 no-repeat",
                "width":"480px",
                "height":"30px",
                "padding-top":"330px"
            });
        })
});
