//CVS:       $Id: dhtmlcheck.js,v 1.1 2007/02/07 22:42:18 cvsdevel Exp $
//Title:     dhtmlcheck.js
//Version:   1.00
//Copyright: Copyright (c) 2007
//Author:    REVIE
//Company:   Rhino Internet

/**
 * Utility library which checks to see if the DHTML nav going over flash
 * is supported by the browser.  Original browser list from
 * <a href="http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=tn_14201"
 *    rel="external">Adobe</a>.
 *
 * <p>
 * <b>Changelog:</b><pre>
 *  1.00  REVIE 2007/02/02  created.
 * </pre>
 *
 * @author  REVIE
 * @version 1.00
 */

// -----------------------------------------------
//
//  main methods
//

/**
 * Checks to see if the user's browser supports HTML over Flash.
 *
 * @return <code>TRUE</code> if the flash can be presented,
 *         <code>FALSE</code> otherwise.
 */
function htmlOverFlash() {
   var ver = navigator.appVersion;
   var agent = navigator.userAgent;
   var os = (agent.indexOf('(') < 0 ? 'Unknown' :
             agent.substring(agent.indexOf('(') + 1,
                             (agent.indexOf(')') > 0 ?
                              agent.indexOf(')') : agent.length)));

   if (os.indexOf('Win') >= 0) {
      // all windows browsers seem to be fine
      return true;
   } else if ((os.indexOf('Mac') >= 0 || os.indexOf('PPC') >= 0) &&
              (agent.indexOf('Firefox') >= 0 ||
               agent.indexOf('Opera') >= 0)) {
      // only Firefox on Macs seem to work
      return true;
   } else {
      // all others, probably won't work
      return false;
   }
} // htmlOverFlash
