// Provide a function to dynamically replace an <object> element with a
// link to download Flash if the installed version is not sufficient

// Depends on: jquery.js, detect_flash.js

function requireFlashForObject(obj, major, minor, revision) {
    var isSufficient = DetectFlashVer(major, minor, revision);
    if(!isSufficient) {
        var p = $(document.createElement('p'));
        p.addClass('flash-required');
        p.text("A newer version of Flash is required. ");
        var a = $(document.createElement('a'));
        a.attr('href', 'http://get.adobe.com/flashplayer/');
        a.text("Download Flash from the Adobe web site.");
        p.append(a);
        obj.replaceWith(p);
    }
}
