try {
    if(!Lifetype) {
        Lifetype = function() {}
    }
} catch(e) {
    Lifetype = function() {}
}

Lifetype.Media = function() {}

/**
 * Returns the HTML code required to embed the Flash MP3 and video player, given
 * a URL to a playable media file.
 *
 * @param url
 * @return
 */
Lifetype.Media.getFlashPlayerHTML = function( url, height, width ) 
{
    //var playerUrl = plogBaseUrl + "/flash/mp3player/mp3player.swf";
	var playerUrl = Lifetype.Config.getValue( 'base_url' ) + "/flash/mp3player/mp3player.swf";
	
	var htmlCode = "<object data=\"" + playerUrl + "\" type=\"application/x-shockwave-flash\" width=\"" + width +"\" height=\"" + height + "\" class=\"ltPlayer\">"+
		"<param name=\"quality\" value=\"best\" />"+
		"<param name=\"bgcolor\" value=\"#FFFFFF\" />" +
        "<param name=\"movie\" value=\"" + playerUrl + "\" />" +
		"<param name=\"FlashVars\" value=\"&file="+ url + "&height=" + height + "&width=" + width + "\" />" +
    	"</object>";	

	return htmlCode;
}

Lifetype.Media.getAlbumMediaFlashHTML = function( url, width, height ) 
{
    /*  url
        ? ¡÷ %3F 
        = ¡÷ %3D 
        & ¡÷ %26 
    */
    var playerUrl = Lifetype.Config.getValue('base_url') + "/plugins/albummediaplayer/js/jw_media_player/mediaplayer.swf";
    url = url.replace(/\?/g,"%3F");
    url = url.replace(/\=/g,"%3D");
    url = url.replace(/\&amp;/g,"%26");
    url = url.replace(/\&/g,"%26");
    var html =  '<object data="'+playerUrl+'" type="application/x-shockwave-flash" width="320" height="330" class="ltAlbumMediaFlashPlayer">'+
                '<param name="movie" value="' + playerUrl + '" />' +
                '<param name="allowfullscreen" value="true" />' +
                '<param name="FlashVars" value="&amp;file=' + url + 
                                               '&amp;width=320' + 
                                               '&amp;height=330' + 
                                               '&amp;displaywidth=320' + 
                                               '&amp;displayheight=240' + 
                                               '&amp;allowfullscreen=true' + 
                                               '&amp;backcolor=0x000000' + 
                                               '&amp;frontcolor=0xCCCCCC' + 
                                               '&amp;lightcolor=0x996600' + 
                                               '&amp;rotatetime=5' + 
                                               '&amp;repeat=true' + 
                                               '&amp;shuffle=false" />' +
                '</object>';

    return( html );
}

