// Next comes the standard javascript detection that uses the 
// navigator.plugins array. We pack the detector into a function so that 
// it preloads before being run.

function redirFlash() { 
alert("Start main-redir.js useRedirect=" + useRedirect + " actualVersion=" + actualVersion + "  requiredVersion=" + requiredVersion); 
 if (actualVersion >= requiredVersion) {
   // ...then we'll redirect them to the flash page, unless we've
   // been told not to redirect.
	
   if (useRedirect) {
     // Need javascript1.1 to do location.replace
     if(jsVersion > 1.0) {
       // It's safe to use replace(). Good...we won't break the back button.
       window.location.replace(flashPage);  
     } else {
       // JavaScript version is too old, so use .location to load
       // the flash page.
       window.location = flashPage;
     }
   }
    
    // If we got here, we didn't redirect. So we make a note that we should
    // write out the object/embed tags later.
    hasRightVersion = true;                
 } else {  
    // The user doesn't have a new enough version.
    // If the redirection option is on, load the appropriate alternate page.
	
    if (useRedirect) {
      // Do the same .replace() call only if js1.1+ is available.
      if(jsVersion > 1.0) {
        window.location.replace((actualVersion >= 2) ? upgradePage : noFlashPage);
      } else {
        window.location = (actualVersion >= 2) ? upgradePage : noFlashPage;
      }
    }
  }
}
 
redirFlash();
