var Podcast = {
    reloadFlashPlayer:function( vSource, vAuto ) {
	    // Reference:
	    // http://www.jeroenwijering.com/?item=Supported_Flashvars
	    var so = new SWFObject("/lib/mediaplayer.swf","mpl","225","20","8");
	    so.addParam("allowscriptaccess","always");
	    so.addParam("allowfullscreen","true");
	    so.addParam("bgcolor", "0x000000");
	    if(vAuto){
		    so.addVariable("autostart","true");
		    }
	    so.addVariable("showstop","true");
	    so.addVariable("height","20");
	    so.addVariable("width","225");
	    so.addVariable("file",vSource);
	    so.addVariable("backcolor","0x000000");
	    so.addVariable("frontcolor","0xFFFFFF");
	    so.addVariable("lightcolor","0xFF993A");
	    so.addVariable("screencolor","0x000000");
	    so.write("podPlayer");
	},
    podcastLoader:function( vSource, el, vAuto ) {
        var mdesc = $(el).parent().siblings('.teaser2').html();
        var ldesc = $(el).parent().siblings('.full-description').html();
        $('.cteaser').html(mdesc).parent().show();
        $('.cfull-description').html(ldesc).parent().hide();
        $('div.episode').show();
        $(el).parents('.episode').hide();
        Podcast.reloadFlashPlayer(vSource,vAuto);
	    $('.episode-name').text( $(el).text() );
	    $('#dlPodcast').attr('href',vSource).show();
    },
    expand:function( el ) {
        $(el).parents('.teaser').hide().siblings('.full-description').show();
    },
    contract:function( el ) {
        $(el).parents('.full-description').hide().siblings('.teaser').show();
    },
    popout:function() {
       	var goto = location.href+"?pop=yes";
        var args = "toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,width=330,height=450";
        window.open( goto, "Podcast_Player", args );
    }
};
