//===========================================================================//
//
//  File:  $Workfile: flixpub_embed.js$
//         $Revision: 1$
//
//  Date:  $DateUTC: 2007-03-29 19:28:25Z$
//
//  Brief: Javascript helper for writing flix publisher plug-in object tags
//
//  Info:  http://www.on2.com/cms-data/pdf/publisher/
//
//===========================================================================//

// Detect browser / platform; warn unsupported browsers; construct
// suitable <object> tag for supported browsers (MSIE and Mozilla-compatible,
// on MS Windows only).

if (isMacSafari)
{
    var tags;
    if (fp_check_for_mac_safari_plugin()) {
    	tags = '<embed id="flixe" name="flixe" '
            + 'width=' + on2pub_plugin_width + ' '
           	+ 'height=' + on2pub_plugin_height + ' '
            + 'type="'
            + macsafari_mime_type
            + '" '
            + 'parentname="'
            + macsafari_iframe_name
            + '">'
            +'</embed>';        
        
    } else {
        tags = '<a href="'
            + macsafari_package_source
            + '">'
            + flixpub_macsafari_install_markup
            +'</a>';
    }
    document.write(tags);
}

// Warn if the user has an unsupported browser
else if(isOpera || !isWin)
{
    pub_alert("Unfortunately you are using an unsupported browser.  "
        + "Please check back with us.");
}
// Write an appropriate <object> tag for MS Internet Explorer on Windows
else if (isIE && isWin )
{
    var tags = '<object id="flixe" '
        + 'codebase="'
        + cab_source 
        + '#version='
        + cab_version 
        + '" '
        + 'name="flixe" '
        + 'classid="'
        + ie_class_id
        + '" '
        + 'width=' + on2pub_plugin_width + ' '
        + 'height=' + on2pub_plugin_height + ' '
        + '> '
        +'</object>';
    document.write(tags);          
}
else if (isWin)
{
    // Write an <object> tag for Firefox and compatibles on Windows
    if (!firefox_needs_update) {
        if (fp_check_for_netscape_plugin() == true)
        {
            var tags = '<object id="flixe" '
                + 'name="flixe" '
                + 'type="'
                + np_mime_type
                + '" '
                + 'width=' + on2pub_plugin_width + ' '
                + 'height=' + on2pub_plugin_height + ' '
                + '> '
                +'</object>';
            document.write(tags);
        } 
    } else {
        var isFlock = (navigator.userAgent.toLowerCase().indexOf("flock") != -1) ? true : false;
        var tags = '';
        
        if (isFlock) {
            tags = '<p style="margin-bottom: 2em;">'
                + 'The On2 Publisher requires a more recent version of Flock. Please click on the image to upgrade.<br>'
                + '<a href="http://spread.flock.com/buttons/?user=&amp;ref=Be-a-Flockstar.png">'
                + '<img style="border: none;" src="http://spread.flock.com/buttons/Be-a-Flockstar.png" '
                + '  alt="Be a Flockstar" title="Be a Flockstar"/></a>'
                + '</p>';
        } else {
            tags = '<p style="margin-bottom: 2em;">'
                + 'The On2 Publisher requires Firefox 1.5 or above. Please click on the image to upgrade.'
                + '<a href="http://www.mozilla.com/firefox/">'
                + '<img border="0" alt="Upgrade to Firefox 1.5!" title="Upgrade to Firefox 1.5!" '
                + '  src="http://sfx-images.mozilla.org/affiliates/products/firefox/upgrade_1_5_300x250b.jpg"/></a>'
                + '</p>';
        }
        document.write(tags);
    }
}

