nav = new Menus(new Menu('solutions-menu'),
                new Menu('login-menu'));
nav.name = 'nav';
flyout = new Menus(new Menu('newvision-topics'));
flyout.name = 'flyout';

validator = new Validator('xas');

function showFlashPresentation() {
   // detect flash version
   var requiredMajorVersion = 8;
   var requiredMinorVersion = 0;
   var requiredRevision = 0;
   var hasProductInstall = DetectFlashVer(6, 0, 65);
   var hasRequestedVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);
   var obj1 = document.getElementById('flashPresentation');
   var obj2 = document.getElementById('flashBody');
   var obj3 = document.getElementById('flashError');
   if (obj1 && obj2 && obj3) {
      var size = getBrowserSize();
      var scroll = getScrollXY();
      var x = (size[0]-750)/2;
      var y = (size[1]-450)/2+scroll[1];
      obj1.style.left = x + 'px';
      obj1.style.top = y + 'px';
      obj1.style.visibility = 'visible';
      if (hasProductInstall && !hasRequestedVersion ) {
         var MMPlayerType = (isIE == true) ? "ActiveX" : "PlugIn";
         var MMredirectURL = window.location;
         document.title = document.title.slice(0, 47) + " - Flash Player Installation";
         var MMdoctitle = document.title;
         obj2.innerHTML = AC_FL_GetContent(
            "src", "playerProductInstall",
            "FlashVars", "MMredirectURL="+MMredirectURL+'&MMplayerType='+MMPlayerType+'&MMdoctitle='+MMdoctitle+"",
            "width", "550",
            "height", "300",
            "align", "middle",
            "id", "detectionExample",
            "quality", "high",
            "bgcolor", "#3A6EA5",
            "name", "detectionExample",
            "allowScriptAccess","sameDomain",
            "type", "application/x-shockwave-flash",
            "pluginspage", "http://www.adobe.com/go/getflashplayer"
         );
      }
      else if (hasRequestedVersion) {
         obj2.innerHTML =  '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="750" height="420" id="flashPresentationPlayer" align="middle"><param name="allowScriptAccess" value="sameDomain" /><param name="movie" value="/preloader.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" /><embed src="/preloader.swf" quality="high" bgcolor="#ffffff" width="750" height="420" name="flashPresentationPlayer" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>';
      }
      else {
         obj2.innerHTML = obj3.innerHTML;
      }
   }
}

function hideFlashPresentation() {
   var obj1 = getFlashMovieObject('flashPresentationPlayer');
   if (obj1) {
      obj1.StopPlay();
   }
   var obj2 = document.getElementById('flashPresentation');
   if (obj2) {
      obj2.style.visibility = 'hidden';
   }
}

function replayFlashPresentation() {
   var obj1 = getFlashMovieObject('flashPresentationPlayer');
   if (obj1) {
      obj1.Rewind();
      obj1.Play();
   }
}

function getFlashMovieObject(movieName) {
   if (window.document[movieName]) {
      return window.document[movieName];
   }
   if (navigator.appName.indexOf("Microsoft Internet")==-1) {
      if (document.embeds && document.embeds[movieName])
         return document.embeds[movieName]; 
   }
   else {
      return document.getElementById(movieName);
   }
}

function getBrowserSize() {
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
  return [ myWidth, myHeight ];
}

function getScrollXY() {
  var scrOfX = 0, scrOfY = 0;
  if( typeof( window.pageYOffset ) == 'number' ) {
    //Netscape compliant
    scrOfY = window.pageYOffset;
    scrOfX = window.pageXOffset;
  } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
    //DOM compliant
    scrOfY = document.body.scrollTop;
    scrOfX = document.body.scrollLeft;
  } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
    //IE6 standards compliant mode
    scrOfY = document.documentElement.scrollTop;
    scrOfX = document.documentElement.scrollLeft;
  }
  return [ scrOfX, scrOfY ];
}

function toggleSlide (s1, s2, s3, s4) {
   var o1 = document.getElementById(s1);
   var o2 = document.getElementById(s2);
   var o3 = document.getElementById(s3);
   var o4 = document.getElementById(s4);
   if (o1 && o2 && o3 && o4) {
      o1.style.display = 'none';
      o2.style.display = 'block';
      o3.style.display = 'block';
      o4.style.display = 'block';
   }
}
