/*	This function is based on that from sIFR 2.0.1.
 *  Copyright 2004 - 2005 Mike Davidson, Shaun Inman, Tomas Jogin and Mark Wubben
 *  This software is licensed under the CC-GNU LGPL <http://creativecommons.org/licenses/LGPL/2.1/>
 */
var hasFlash=function() {
    var a=6;
    if(navigator.appVersion.indexOf("MSIE")!=-1&&navigator.appVersion.indexOf("Windows")>-1){
        document.write('<script language="VBScript"\> \non error resume next \nhasFlash = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & '+a+'))) \n</script\> \n');
        if(window.hasFlash!=null) return window.hasFlash
    }
    if(navigator.mimeTypes&&navigator.mimeTypes["application/x-shockwave-flash"]&&navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin){
        var b=(navigator.plugins["Shockwave Flash 2.0"]||navigator.plugins["Shockwave Flash"]).description;
        // Get the version number out of the version string (sifr does this badly)
        version_expr = /(\d+)\./
        version = parseInt(version_expr.exec(b)[1])
        return version>=a
    }
    return false
}();

/*
 * Check whether the browser has flash >= 6 enabled and if it does enable the
 * flash MP3 player.
 */
window.addEvent('domready', function(){ 
    if ($('audio_player') && hasFlash) {
        // Enable player
        $('audio_player').style.display = '';
    }
    if ($('movie_player') && hasFlash) {
        // Enable player
        $('movie_player').style.display = '';
    }
});
