function showSWF(div, file, swf_width, swf_height, width, height, url) {
    
    var object_width = 0
    if(width == 'a') object_width = document.getElementById(div).parentNode.offsetWidth
    else if(width > 0) object_width = width
    
    var object_height = 0
    if(height == 'w' && object_width > 0) object_height = object_width
    else if(height == 'a') object_height = document.getElementById(div).parentNode.offsetHeight
    else if(height > 0) object_height = height
    
    if(object_width > 0 && object_height == 0) object_height = Math.ceil(swf_height * object_width / swf_width)
    else if(object_width == 0 && object_height > 0) object_width = Math.ceil(swf_width * object_height / swf_height)
    
    var flashvars = false
    
    var params = {
        menu: 'false',
        wmode: 'transparent'
        }
        
    var attributes = {}
    
    if(url != '') {
        
        var layer = document.createElement('div')
        layer.style.position = 'absolute'
        layer.style.top = '0px'
        layer.style.left = '0px'
        layer.style.width = '100%'
        layer.style.height = '100%'
        document.getElementById(div).parentNode.appendChild(layer)
        
        var anchor = document.createElement('a')
        anchor.setAttribute('href', url)
        layer.appendChild(anchor)
        
        var image = document.createElement('img')
        image.setAttribute('src', '/img/blank.gif')
        image.style.width = layer.offsetWidth + 'px'
        image.style.height = layer.offsetHeight + 'px'
        anchor.appendChild(image)
        }
    
    return swfobject.embedSWF(file, div, object_width, object_height, '9.0.0', '', flashvars, params, attributes)
    }

function showMovie(div, file, width, height, show_menu, show_controlbar, autostart) {
    
    var object_width = 0
    if(width == 'a') object_width = document.getElementById(div).parentNode.offsetWidth
    else if(width > 0) object_width = width
    else object_width = 500
    
    var object_height = 0
    if(height == 'w') object_height = object_width
    else if(height == 'a') object_height = document.getElementById(div).parentNode.offsetHeight
    else if(height > 0) object_height = height
    else object_height = Math.ceil(object_width * 9 / 16)
    
    var flashvars = false
    
    if(show_menu) params_menu = 'true'
    else params_menu = 'false'
        
    var params_flashvars = 'file=' + file
    if(!show_controlbar) params_flashvars += '&controlbar=none'
    if(autostart) params_flashvars += '&autostart=true'
    params_flashvars += '&volume=50'
    
    var params = {
        menu: params_menu,
        wmode: 'transparent',
        allowfullscreen: 'true',
        allowscriptaccess: 'always',
        flashvars: params_flashvars
        }
    
    var attributes = {}
    
    return swfobject.embedSWF('/flash/player.swf', div, object_width, object_height, '9.0.0', '', flashvars, params, attributes)
    }
    
function showPlaylist(div, playlist, show_menu, show_playlist, autostart, shuffle) {
    
    var playlistsize = 100
    
    var object_width = document.getElementById(div).parentNode.offsetWidth
    
    var object_height = Math.ceil(object_width * 9 / 16)
    if(show_playlist) object_height += playlistsize
    
    var flashvars = false
    
    if(show_menu) params_menu = 'true'
    else params_menu = 'false'
    
    var params_flashvars = 'file=' + playlist
    if(autostart) params_flashvars += '&autostart=true'
    if(shuffle) params_flashvars += '&shuffle=true'
    else params_flashvars += '&shuffle=false'
    if(show_playlist) {
        params_flashvars += '&playlist=bottom'
        params_flashvars += '&playlistsize=' + playlistsize
        }
    params_flashvars += '&volume=50'
    
    var params = {
        menu: params_menu,
        wmode: 'transparent',
        allowfullscreen: 'true',
        allowscriptaccess: 'always',
        flashvars: params_flashvars
        }
    
    var attributes = {}
    
    return swfobject.embedSWF('/flash/player.swf', div, object_width, object_height, '9.0.0', '', flashvars, params, attributes)
    }
