function ActivateSWFInto(url, width, height, targetEl, scaleMode, wmode)
{
    var newHTML;
    
    if(targetEl)
    {
        if(width.substring(width.length-1, width.length) != "%" && width.toLowerCase() != "auto")
        {
            width += "px";
        }
        if(height.substring(height.length-1, height.length) != "%" && height.toLowerCase() != "auto")
        {
            height += "px";
        }
        newHTML = "<object type=\"application/x-shockwave-flash\"";
        if(document.all)
        {
            //most likely IE
            newHTML += " classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#4,0,0,0\"";
        }
        else
        {
            newHTML += " data=\"" + url + "\"";
        }
        newHTML += " width=\" " + width + "\" height=\" " + height + "\">";
        newHTML += "<param name=\"movie\" value=\"" + url + "\" />";
        newHTML += "<param name=\"wmode\" value=\"" + (wmode ? wmode : "opaque") + "\" />";
        newHTML += "<param name=\"scale\" value=\"" + (scaleMode && scaleMode != "" ? scaleMode : "exactfit") + "\" />";
        newHTML += "</object>";
        
        targetEl.innerHTML = newHTML;
    }
}

function ActivateSWF(url, width, height, targetID, scaleMode, wmode)
{
    var targetEl = document.getElementById(targetID);
    
    ActivateSWFInto(url, width, height, targetEl, scaleMode, wmode);
}
