function MM_CheckFlashVersion(reqVerStr,msg){
  with(navigator){
    var isIE  = (appVersion.indexOf("MSIE") != -1 && userAgent.indexOf("Opera") == -1);
    var isWin = (appVersion.toLowerCase().indexOf("win") != -1);
    if (!isIE || !isWin){  
      var flashVer = -1;
      if (plugins && plugins.length > 0){
        var desc = plugins["Shockwave Flash"] ? plugins["Shockwave Flash"].description : "";
        desc = plugins["Shockwave Flash 2.0"] ? plugins["Shockwave Flash 2.0"].description : desc;
        if (desc == "") flashVer = -1;
        else{
          var descArr = desc.split(" ");
          var tempArrMajor = descArr[2].split(".");
          var verMajor = tempArrMajor[0];
          var tempArrMinor = (descArr[3] != "") ? descArr[3].split("r") : descArr[4].split("r");
          var verMinor = (tempArrMinor[1] > 0) ? tempArrMinor[1] : 0;
          flashVer =  parseFloat(verMajor + "." + verMinor);
        }
      }
      // WebTV has Flash Player 4 or lower -- too low for video
      else if (userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 4.0;

      var verArr = reqVerStr.split(",");
      var reqVer = parseFloat(verArr[0] + "." + verArr[2]);
  
      if (flashVer < reqVer){
        if (confirm(msg))
          window.location = "http://www.macromedia.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash";
      }
    }
  } 
}

/*
 * Text Scroller JavaScript
 *
 * @author  Chris Smith
 *          Jalakai Designs
 * 
 */


function scroller(e, speed) {
  this.node = e;
  this.scroller = null;
  this.content = null;
  this.position = 0;
  this.paused = true;
  this.halted = false;
  this.speed = speed || 50;
}

new scroller(null);

scroller.prototype.setup = function() {
  
  try {
    var descendants = this.node.getElementsByTagName('*');
    
    for (var i=0; i < descendants.length; i++) {
      if (!descendants[i].className) continue;
      
      if (descendants[i].className.match(/\bscroller\b/)) this.scroller = descendants[i];
      if (descendants[i].className.match(/\bscroll_content\b/)) this.content = descendants[i];
      
      if (this.scroller && this.content) break;
    }
    
    if (!this.scroller || !this.content) return;
    
    addListener(this.scroller, 'click', this, false);
    addListener(this.scroller, 'mouseover', this, false);
    addListener(this.scroller, 'mouseout', this, false);
    
    this.scroller.style.overflow = "hidden";
    this.scroller.style.visibility = "visible";
    this.scroller.style.position = "relative";
    
    this.content.style.position = "absolute";
    this.content.style.top = this.scroller.offsetHeight+"px";
    
    this.position = this.scroller.offsetHeight;
    this.start();
    
  } catch(err) {
    if (debug) alert('error: setup ['+err.message+']');
  }
}

scroller.prototype.start = function() {
  if (this.halted) return;
  if (this.paused) {
    this.scrollId = setInterval(dojo.hitch(this,"move"), this.speed);
    this.paused = false;
  }
}

scroller.prototype.pause = function() {
  if (!this.paused) {
    clearInterval(this.scrollId);
    this.paused = true;
  }
}

scroller.prototype.move = function() {
  try {
    this.position -= 1;
    if (this.position <= -1*(this.content.offsetHeight+10)) this.position = this.scroller.offsetHeight;
    
    this.content.style.top = this.position+"px";
    
  } catch(err) {
    clearInterval(this.scrollId);
    alert("error: move "+this.content.className);
  }
}

scroller.prototype.eventHandler = function(evt) {
  
  try {
    if (evt.srcElement) {
      if (!evt.target) evt.target = evt.srcElement;
      if (!evt.preventDefault) evt.preventDefault = function(){ window.event.returnValue = false; }
      if (!evt.stopPropagation) evt.stopPropagation = function() { window.event.cancelBubble = true; }
      
      if (!evt.relatedTarget) {    
        if (evt.type == 'mouseover')
          evt.relatedTarget = evt.fromElement;
        else if (evt.type == 'mouseout')
          evt.relatedTarget = evt.toElement;
      }
    }
    
    this[evt.type](evt);
  }
  catch (err) {
    if (debug) alert('error: eventhandler - '+evt.type);
  }
}

scroller.prototype.click = function(evt) {
  try {
    this.halted = !this.halted;
    if (!this.halted) 
      this.start();
    else
      this.pause();
  }
  catch(err) {
    alert("error: click");
  }
}

scroller.prototype.mouseover = function(evt) {

  try {
    if (!this.halted) this.pause();
  }
  catch(err) {
    if (debug) alert('error: mouseover');
  }
}

scroller.prototype.mouseout = function(evt) {
  try {
    if (!this.halted) this.start();
  }
  catch(err) {
    if (debug) alert('error: mouseout');
  }
}

/*
 * Crossbrowser addEvent function (modified)
 * Courtesy of http://www.soziologie.uni-halle.de/unger/scripts/workshop_internet/fr_js_322.html
 */
 function addListener(obj, eventType, oListener, isCapture) {
    // W3C DOM
    
    if (obj.addEventListener) {
       obj.addEventListener(eventType, function(evt) {oListener.eventHandler(evt)} , isCapture);
       return true;
    }
    // Internet Explorer
    else if (obj.attachEvent) {
       return obj.attachEvent("on"+eventType, function() {oListener.eventHandler(window.event)} );
    }

   return false;    
 }
 
/*  from Dojo */
dojo = new Object;
dojo.hitch = function(thisObject, method) {


  var fcn = thisObject[method];

  return function() {
    return fcn.apply(thisObject, arguments);
  }
}

// support graceful js degradation, this hides the scroller(s) from view before they are shown, 
// and gives the onload event time to change the display styles before making the scroller visible
// whilst still allowing non-js user to see the scroller content with scrollbars.
document.write('<style type="text/css"><!--/*--><![CDATA[/*><!--*/ .scroller { visibility: hidden; } /*]]>*/--></style>');

