// JS2Flash library v.1.3

// Random GET-variable generator
function AddVar(Chars) {
    return ("?v=" + String(Math.round(Math.random() * (Math.pow(10, Chars)))));
} // func

// Flash object
function FlashObject(URL, Width, Height, BgColor, Align, AllowCashe) {
    document.write("<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' width='" + Width + "' height='" + Height + "' id='flash' align='" + Align + "'>" + 
        "<param name='allowScriptAccess' value='sameDomain' />" + 
        "<param name='movie' value='" + URL + ((!AllowCashe) ? AddVar(10) : "") + "'/>" +
        "<param name='quality' value='high' />" +
        "<param name='bgcolor' value='" + BgColor + "' />" +
        "<embed src='" + URL + ((!AllowCashe) ? AddVar(10) : "") + "' quality='high' bgcolor='" + BgColor + "' width='" + Width + "' height='" + Height + "' name='flash' align='" + Align + "' allowScriptAccess='sameDomain' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />" +
        "</object>");
} // func

// Fullscreen Flash object
function FSFlashObject(URL, AllowCashe) {
    document.write("<embed width='100%' height='100%' fullscreen='yes' src='" + URL + ((!AllowCashe) ? AddVar(10) : "") + "'>");
} // func

// Internet Explorer update fix
var ObjectElements = document.getElementsByTagName("object"); 
for (var i = 0; i < ObjectElements.length; i++) { 
    ObjectElements[i].outerHTML = ObjectElements[i].outerHTML; 
} // for

