function showSWF(div, file, swf_width, swf_height, width, height, url) {
    
    object_width = object_height = 0
    
    if(swf_width === 0 && width > 0) object_width = width
    else if(swf_width === 0 && width === 'a') object_width = document.getElementById(div).parentNode.offsetWidth
    else if(swf_width > 0 && width === 'a') {
        object_width = document.getElementById(div).parentNode.offsetWidth
        object_height = Math.ceil(swf_height * object_width / swf_width)
        }
    else if(swf_width > 0 && width > 0) {
        object_width = width
        object_height = Math.ceil(swf_height * object_width / swf_width)
        }
    
    if(swf_height === 0 && height > 0) object_height = height
    else if(swf_height === 0 && height === 'a') object_height = document.getElementById(div).parentNode.offsetHeight
    else if(swf_height > 0 && height === 'a') {
        object_height = document.getElementById(div).parentNode.offsetHeight
        object_width = Math.ceil(swf_width * object_height / swf_height)
        }
    else if(swf_height > 0 && height > 0) {
        object_height = height
        object_width = Math.ceil(swf_width * object_height / swf_height)
        }
        
    if(swf_width === 0 && width === 0 && swf_height === 0 && height === 0) object_width = object_height = document.getElementById(div).parentNode.offsetWidth
    else if(swf_width > 0 && width === 'a' && swf_height > 0 && height === 'a') {
        object_width = document.getElementById(div).parentNode.offsetWidth
        object_height = Math.ceil(swf_height * object_width / swf_width)
        
        if(object_height > document.getElementById(div).parentNode.offsetHeight) {
            object_height = document.getElementById(div).parentNode.offsetHeight
            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 = 'auto'
        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.offsetWidth + 'px'
        anchor.appendChild(image)
        }
    
    return swfobject.embedSWF(file, div, object_width, object_height, '9.0.0', '', flashvars, params, attributes)
    }

function showMovie(div, file, width, show_menu, show_controlbar, autostart) {
    
    object_width = object_height = 0
    
    if(width == 'a') object_width = object_height = document.getElementById(div).parentNode.offsetWidth
    else if(width > 0) {
        object_width = width
        object_height = Math.ceil(object_width * 9 / 16)
        }
    else {
        object_width = 500
        if(object_width > document.getElementById(div).parentNode.offsetWidth) object_width = document.getElementById(div).parentNode.offsetWidth
        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'
    params_flashvars += '&skin=/flash/struna.swf'
    //params_flashvars += '&plugins=/flash/hd.swf'
    
    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 = 107
    
    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'
    params_flashvars += '&skin=/flash/struna.swf'
    //params_flashvars += '&plugins=/flash/hd.swf'
    
    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)
    }