

/** First write the HTML fallback to the page, so it'll be there even for devices that have poor JS support. **/
document.write("<div class='botrplayer ltas-ad' id='botr_ERLTt4Ia_0_qHyAMOl5_div'><a href=\"http://bitcast-b.bitgravity.com/botr/SCetvpu7/videos/ERLTt4Ia-33303.mp4?e=1265730542&amp;h=8e8581069fdf9214484898c26626dc62\" title=\"Dare_DV_Final.11.9.09.dv\" style='display:block; width:546px; height:305px; background: #ffffff url(http://content.bitsontherun.com/thumbs/ERLTt4Ia-640.jpg) no-repeat center center;'><img src='http://content.bitsontherun.com/staticfiles/play.png' alt='Click to play video' style='display: block; padding: 122px 243px;' /></a></div>");




/** Now define the BotR initialization class **/
if (typeof(BotR) == 'undefined') { var BotR = new Object(); }
BotR.swf = function (src,id,width,height,bgcolor) {
    if (!document.getElementById) { return; }
    this.source = src;
    this.id = id;
    this.width = width;
    this.height = height;
    this.params = {
        'bgcolor':bgcolor,
        'allowfullscreen': 'true',
        'allowscriptaccess': 'always',
        'wmode': 'opaque'
    };
    this.flashvars = new Object();
    this.version = this.getVersion();
    if (!window.opera && document.all && parseInt(this.version.split(',')[0]) > 7 && !BotR.unloadSet) {
        // fixes bug in some fp9 versions see http://blog.deconcept.com/2006/07/28/swfobject-143-released/
        BotR.cleanupSWFs = function() {
        var objects = document.getElementsByTagName("OBJECT");
            for (var i=objects.length - 1; i >= 0; i--) {
                objects[i].style.display = 'none';
                for (var x in objects[i]) {
                    if(typeof objects[i][x] == 'function') {
                        objects[i][x] = function(){};
                    }
                }
            }
        };
        BotR.prepUnload = function() {
            __flash_unloadHandler = function(){};
            __flash_savedUnloadHandler = function(){};
            window.attachEvent("onunload", BotR.cleanupSWFs);
        };
        window.attachEvent("onbeforeunload", BotR.prepUnload);
        BotR.unloadSet = true;
    }
};
BotR.swf.prototype = {
    /** Overwrite the div contents with the player, if the right Flash version is there.  **/
    loadSWF: function () {
        var major = parseInt(this.version.split(',')[0]);
        var minor = parseInt(this.version.split(',')[2]);
        if(major > 9 || (major == 9 && minor > 97)) {
            document.getElementById(this.id+'_div').innerHTML = this.swfHtml();
        }
    },
    /** Return the Flash plugin version to javascript. **/
    getVersion: function () {
        try {
            try {
                var axo = new ActiveXObject('ShockwaveFlash.ShockwaveFlash.6');
                try { axo.AllowScriptAccess = 'always'; }
                catch(e) { return '6,0,0'; }
            } catch(e) {}
            return new ActiveXObject('ShockwaveFlash.ShockwaveFlash').GetVariable('$version').replace(/\D+/g, ',').match(/^,?(.+),?$/)[1];
        } catch(e) {
            try {
                if(navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin){
                    return (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]).description.replace(/\D+/g, ",").match(/^,?(.+),?$/)[1];
                }
            } catch(e) {}
        }
        return '0,0,0';
    },
    /** Create the HTML string needed for the flash embed. **/
    swfHtml:function() {
        var html = "";
        var fv = this.getFlashvars();
        if (navigator.plugins && navigator.mimeTypes && navigator.mimeTypes.length) {
            html = '<embed type="application/x-shockwave-flash" src="'+ this.source +'" width="'+ this.width +'" height="'+ this.height +'"';
            html += ' id="'+ this.id +'_swf" name="'+ this.id +'_swf" ';
            for(var key in this.params) { 
                html += [key] +'="'+ this.params[key] +'" ';
            }
            html += 'flashvars="'+ fv +'" />';
        } else {
            html = '<object id="'+ this.id +'_swf" name="'+ this.id +'_swf" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+ this.width +'" height="'+ this.height +'">';
            html += '<param name="movie" value="'+ this.source +'" />';
            for(var key in this.params) { 
                html += '<param name="'+ key +'" value="'+ this.params[key] +'" />';
            }
            html += '<param name="flashvars" value="'+ fv +'" />';
            html += "</object>";
        }
        return html;
    },
    /** Add a flashvar to the list. **/
    setFlashvar: function(name,value) {
        this.flashvars[name] = encodeURIComponent(decodeURIComponent(value));
    },
    /** Return a concatenated string of flashvars. **/
    getFlashvars: function () {
        var pairs = new Array();
        for(var key in this.flashvars) {
            pairs[pairs.length] = key+"="+this.flashvars[key];
        }
        return pairs.join('&');
    }
};


/** Now the class has been set up, initialize the player, inject all flashvars and start. **/
var botr_ERLTt4Ia_0_qHyAMOl5 = new BotR.swf("http://content.bitsontherun.com/staticfiles/videoplayer.swf","botr_ERLTt4Ia_0_qHyAMOl5","546","305","#ffffff");

botr_ERLTt4Ia_0_qHyAMOl5.setFlashvar("playlist","none");
botr_ERLTt4Ia_0_qHyAMOl5.setFlashvar("repeat","none");
botr_ERLTt4Ia_0_qHyAMOl5.setFlashvar("autostart","false");
botr_ERLTt4Ia_0_qHyAMOl5.setFlashvar("dock","true");
botr_ERLTt4Ia_0_qHyAMOl5.setFlashvar("frontcolor","000000");
botr_ERLTt4Ia_0_qHyAMOl5.setFlashvar("title","Dare_DV_Final.11.9.09.dv");
botr_ERLTt4Ia_0_qHyAMOl5.setFlashvar("image","http://content.bitsontherun.com/thumbs/ERLTt4Ia-640.jpg");
botr_ERLTt4Ia_0_qHyAMOl5.setFlashvar("stretching","uniform");
botr_ERLTt4Ia_0_qHyAMOl5.setFlashvar("ping.script","http://content.bitsontherun.com/pings/");
botr_ERLTt4Ia_0_qHyAMOl5.setFlashvar("height","305");
botr_ERLTt4Ia_0_qHyAMOl5.setFlashvar("width","546");
botr_ERLTt4Ia_0_qHyAMOl5.setFlashvar("lightcolor","000000");
botr_ERLTt4Ia_0_qHyAMOl5.setFlashvar("controlbar","over");
botr_ERLTt4Ia_0_qHyAMOl5.setFlashvar("displayclick","play");
botr_ERLTt4Ia_0_qHyAMOl5.setFlashvar("backcolor","ffffff");
botr_ERLTt4Ia_0_qHyAMOl5.setFlashvar("skin","http://content.bitsontherun.com/skins/7Kj2bDcO.swf");
botr_ERLTt4Ia_0_qHyAMOl5.setFlashvar("playlistsize","200");
botr_ERLTt4Ia_0_qHyAMOl5.setFlashvar("plugins","http://content.bitsontherun.com/staticfiles/sharing.swf");
botr_ERLTt4Ia_0_qHyAMOl5.setFlashvar("file","http://content.bitsontherun.com/jwp/ERLTt4Ia.xml");
botr_ERLTt4Ia_0_qHyAMOl5.setFlashvar("sharing.code","<embed src='http://content.bitsontherun.com/players/ERLTt4Ia-uLmpWA74.swf' width='584' height='320' allowfullscreen='true' allowscriptaccess='always'/>");
botr_ERLTt4Ia_0_qHyAMOl5.setFlashvar("id","botr_ERLTt4Ia_0_qHyAMOl5_swf");
botr_ERLTt4Ia_0_qHyAMOl5.loadSWF();
