<!-- Hide script from old browsers
var isIE = (document.all)?true:false;
var isN6 = (document.getElementById && !document.all)?true:false;
var isNN = (document.layers)?true:false;
/************************************************************************
 * For menu arrays the three strings are:
 * - unique id for this html file
 * - html link string
 * - text to be displayed in the menu
 ************************************************************************/
var menuProjects     = new Array(new Array('DivPrjOverview'      ,'Projects/index.htm'                                 ,'Overview'                   ),
                                 new Array('DivPrjStandards'     ,'Projects/standards.htm'                             ,'Standards work'             ),
                                 new Array('DivPrjPlayer'        ,'Projects/player.htm'                                ,'MPEG-4 Playback'            ),
                                 new Array('DivPrjAuthoring'     ,'Projects/authoring.htm'                             ,'MPEG-4 Authoring'           ),
                                 new Array('DivPrjEmb'           ,'Projects/emb.htm'                                   ,'Enterprise MPEG-4'          ),
                                 new Array('DivPrjJoint'         ,'Projects/jointActivities.htm'                       ,'Joint Activities'           )
                                );
var menuDemos        = new Array(new Array('DivDemOverview'      ,'Demos/index.htm'                                    ,'Overview'                          ),
                                 new Array('DivDemVA'            ,'Demos/DemoVideoAudio.htm'                           ,'MPEG-4 Video/Audio only'           ),
                                 new Array('DivDemSys'           ,'Demos/DemoSystems.htm'                              ,'MPEG-4 Dynamic, Interactive'       ),
                                 new Array('DivDemEMB'           ,'Demos/DemoEMB.htm'                                  ,'Personalizable MPEG-4 Web Services'),
                                 new Array('DivDemSCORM'         ,'Demos/DemoMPGUniv.htm'                              ,'Web Learning with SCORM'           )
                                );
var menuDownloads    = new Array(new Array('DivDwnDownload'      ,'Downloads/index.htm'                                ,'Downloads')
                                );
var menuPublications = new Array(new Array('DivPubStandards'     ,'Publications/standards.htm'                         ,'Standards'),
                                 new Array('DivPubBooks'         ,'Publications/books.htm'                             ,'Books'    ),
                                 new Array('DivPubMagazines'     ,'Publications/magazines.htm'                         ,'Magazines')
                                );
var menuContacts     = new Array(new Array('DivCntContact'       ,'Contacts/index.htm'                                 ,'Contacts')
                                );
var menuLinks        = new Array(new Array('DivLnkExternal'      ,'links.htm'                                          ,'Links')
                                );
var listOfMenuLists      = new Array(menuProjects, menuDemos, menuDownloads, menuPublications, menuContacts, menuLinks);
var popupMenuId          = new Array("popupLayerProjects", "popupLayerDemos", "popupLayerDownloads", "popupLayerPublications", "popupLayerContacts", "popupLayerLinks");
var imgMainTops          = new Array ( 50, 175, 350, 250, 425,   0);
var imgMainLefts         = new Array (  0, 275, 125, 600, 425, 575);
var imgMainWidths        = new Array (198, 198, 148, 173, 148, 148);
var imgMainHeights       = new Array (198, 198, 148, 173, 148, 148);
var imgMainNames         = new Array ("assets/MainButtonProjects.gif","assets/MainButtonDemos.gif","assets/MainButtonDownloads.gif","assets/MainButtonPublications.gif","assets/MainButtonContacts.gif","assets/MainButtonLinks.gif");
var imgTmplTops          = new Array ( 88,  88,  88,  88,  88,  88);
var imgTmplLefts         = new Array (137, 210, 273, 355, 453, 528);
var imgTmplWidths        = new Array ( 70,  60,  79,  95,  72,  52);
var imgTmplHeights       = new Array ( 22,  22,  22,  22,  22,  22);
var imgTmplNames         = new Array ("assets/ButtonProjects.gif","assets/ButtonDemos.gif","assets/ButtonDownload.gif","assets/ButtonPublications.gif","assets/ButtonContacts.gif","assets/ButtonLinks.gif");
var imgTmplRolloverNames = new Array ("assets/ButtonProjectsH.gif","assets/ButtonDemosH.gif","assets/ButtonDownloadH.gif","assets/ButtonPublicationsH.gif","assets/ButtonContactsH.gif","assets/ButtonLinksH.gif");
var imgIds               = new Array ("buttonImgProjects", "buttonImgDemos", "buttonImgDownloads", "buttonImgPublications", "buttonImgContacts", "buttonImgLinks");
var menuBackgroundColor  = "#ffdf40";
var menuHighlightColor   = "#ffffff";



/************************************************************************
 * method to construct the popup menu
 ************************************************************************/
function constructPopupMenu(menuList, rootPrefix, doc) {
   if ( !doc )
      doc=document;
   if ( !rootPrefix )
      rootPrefix="";

   doc.writeln(' <table border="0" cellspacing="0" cellpadding="2" class="mp4menuedge">');
   doc.writeln('  <tr>');
   doc.writeln('   <td>');
   doc.writeln('    <table border="0" cellspacing="0" cellpadding="2" bgColor="' + menuBackgroundColor + '">');

   for ( var i=0;i<menuList.length;i++ ) {
      doc.writeln("     <tr>");
      doc.write  ('      <td height="20"');
      if ( isIE || isN6 ) {
         doc.write  (" onclick=\"gotoUrl('"+rootPrefix+menuList[i][1]+"')\""+
                     " onmouseover=\"MM_changeProp('" + menuList[i][0] + "','','style.backgroundColor','" + menuHighlightColor  + "','DIV')\""+
                     " onmouseout=\"MM_changeProp('"  + menuList[i][0] + "','','style.backgroundColor','" + menuBackgroundColor + "','DIV')\"");
      }
      doc.writeln(">");

      if ( isNN ) {
         doc.writeln("       <ilayer id=\""+menuList[i][0]+ "\">");
         doc.writeln('        <layer'+" id=\"layer"+menuList[i][0]+ "\""+
                     " onmouseover=\"MM_changeProp('" + menuList[i][0] + "','','document.bgColor','" + menuHighlightColor  + "','ILAYER')\""+
                     " onmouseout=\"MM_changeProp('"  + menuList[i][0] + "','','document.bgColor','" + menuBackgroundColor + "','ILAYER')\">");
      } else {
         doc.writeln('       <div id="'+menuList[i][0]+ '">');
      }

      doc.writeln('         <A class="mp4menu" HREF="' + rootPrefix + menuList[i][1] + '"><nobr>' + menuList[i][2] + '</nobr></A>');

      if ( isNN ) {
         doc.writeln('        </layer>');
         doc.writeln("       </ilayer>");
      } else {
         doc.writeln("       </div>");
      }

      doc.writeln("      </td>");
      doc.writeln("     </tr>");
   }
   doc.writeln("    </table>");
   doc.writeln("   </td>");
   doc.writeln("  </tr>");
   doc.writeln(" </table>");

   // The following code resizes the menu layers items so that the highlighting extends all the way across the table.
   // The only problem is that at times this code takes forever to run (10 or 20 seconds).
   // The belief is that the searching through the list of layers takes a lot longer than necessary.
   // Thus when the search can be done faster then redo the resizing
//  if ( isNN ) {
//     var maxWidth = 0;
//     var divObjs = new Array;
//     for ( var i=0;i<menuList.length;i++ ) {
//        divObjs[i] = MM_findObj(menuList[i][0]);
//        if ( divObjs[i] && divObjs[i].clip && divObjs[i].clip.width ) {
//           var width = divObjs[i].clip.width
//           if ( maxWidth<width )
//              maxWidth = width;
//        }
//     }
//     for ( var i=0;i<divObjs.length;i++ ) {
//        if ( divObjs[i] && divObjs[i].clip && divObjs[i].clip.width ) {
//           divObjs[i].clip.width = maxWidth;
//        }
//        var divObj = MM_findObj("layer"+menuList[i][0]);
//        if ( divObj && divObj.clip && divObj.clip.width ) {
//           divObj.clip.width = maxWidth;
//        }
//     }
//  }

}

/************************************************************************
 * Support for a link from javascript.  Used in the div when clicking on
 * the empty area.
 *
 * Is not called from the layer in Netscape 4.x because the layer doesn't
 * support onClick or onMouseDown, documentation states it should be ther
 * for onMouseDown, but it doesn't work.  Similarily onMouse???  don't
 * work for iLayer as the documentation states they should.
 ************************************************************************/
function gotoUrl(url) {
   window.location.href=url;
}

/************************************************************************
 * method to construct icon and popup in the window
 ************************************************************************/
function constructMainWindowPopupMenus(index, doc) {
   if ( !doc )
      doc=document;

   constructPopupMenus(index, doc, imgMainLefts, imgMainTops, imgMainWidths, imgMainHeights, imgMainNames, 20);
}

/************************************************************************
 * method to construct icon and popup in the window
 ************************************************************************/
function constructTemplatePopupMenus(index, rootPrefix, doc) {
   if ( !doc )
      doc=document;

   constructPopupMenus(index, doc, imgTmplLefts, imgTmplTops, imgTmplWidths, imgTmplHeights, imgTmplNames, 20, rootPrefix, imgTmplRolloverNames, imgIds);
}

/************************************************************************
 * method to construct icon and popup in the window
 ************************************************************************/
function constructPopupMenus(index, doc, imgLefts, imgTops, imgWidths, imgHeights, imageNames, zOrderOffset, rootPrefix, imageRolloverNames, imageIds ) {
   if ( !doc )
      doc=document;
   if ( !rootPrefix )
      rootPrefix = "";

   var popTop  = imgTops[index]+imgHeights[index];

   var elementName = "";
   var imgStylePosition = "";
   var popStylePosition = "";
   if ( isNN ) {
      elementName = "layer";
      imgStylePosition = 'top="' + imgTops[index] + '" left="' + imgLefts[index] + '" z-index="' + (zOrderOffset+index)                + '" width="' + imgWidths[index] + '" height="' + imgHeights[index] + '"';
      popStylePosition = 'top="' + popTop         + '" left="' + imgLefts[index] + '" z-index="' + (zOrderOffset+index+imgTops.length) + '" VISIBILITY="hide"';
   } else {
      elementName = "div";
      imgStylePosition = 'style="position:absolute; top:' + imgTops[index] + 'px; left:' + imgLefts[index] + 'px; z-index:' + (zOrderOffset+index)                + '; width:' + imgWidths[index] + 'px; height:' + imgHeights[index] + 'px"';
      popStylePosition = 'style="position:absolute; top:' + popTop         + 'px; left:' + imgLefts[index] + 'px; z-index:' + (zOrderOffset+index+imgTops.length) + '; visibility:hidden"';
   }

   var mouseOverCmds = "showPopup(" + index + ")";
   var mouseOutCmds  = "delayHidePopup("+index+")";
   var mouseOver2 = 'onMouseOver="' + mouseOverCmds + '"';
   var mouseOut2  = 'onMouseOut="' + mouseOutCmds + '"';

   var imageId = "";
   if ( imageRolloverNames ) {
      MM_preloadImages(imageRolloverNames[index]);
      mouseOverCmds = mouseOverCmds + ";MM_swapImage('" + imageIds[index] + "','','" + rootPrefix + imageRolloverNames[index] + "',1)";
      mouseOutCmds  = mouseOutCmds + ";MM_swapImgRestore()";
      var imageId = ' name="'+imageIds[index]+'"';
   }

   var mouseOver = 'onMouseOver="' + mouseOverCmds + '"';
   var mouseOut  = 'onMouseOut="' + mouseOutCmds + '"';

   doc.writeln("<" + elementName + " id=\"imageLayer" + index + "\" " + imgStylePosition + " " + mouseOver + " " + mouseOut + ">");
   doc.writeln('  <img alt="" ' + imageId + ' src="'+ rootPrefix + imageNames[index] +'" width="' + (imgWidths[index]) + '" height="' + (imgHeights[index]) + '">');
   doc.writeln("</" + elementName + ">");


   doc.writeln("<" + elementName + " id=\"" + popupMenuId[index] + "\" " + popStylePosition + " " + mouseOver2 + " " + mouseOut2 + ">");
   constructPopupMenu(listOfMenuLists[index], rootPrefix, doc);
   doc.writeln("</" + elementName + ">");
}

/************************************************************************
 * for hiding and showing popups
 ************************************************************************/
var popupHidden = new Array(popupMenuId.length);
for ( var i=0;i<popupMenuId.length;i++ )
   popupHidden[i]=true;
var popupClosing = new Array(popupMenuId.length);

function showPopup(index) {
   clearTimeout(popupClosing[index]);
   for ( var i=0; i<popupHidden.length; i++ ) {
      if ( i != index ) {
         hidePopup(i);
      }
   }
   if ( isIE ) {
      eval(popupMenuId[index] + ".style.visibility = 'visible'");
   } else if ( isN6 ) {
      eval("document.getElementById('" + popupMenuId[index] + "').style.visibility = 'visible'");
   } else if ( isNN ) {
      eval("document." + popupMenuId[index] + ".visibility = 'show'");
   }
   popupHidden[index] = false;
}

function delayHidePopup(index) {
   clearTimeout(popupClosing[index]);
   popupClosing[index] = setTimeout('hidePopup(' + index + ')',200);
}

function hidePopup(index) {
   clearTimeout(popupClosing[index]);
   if ( isIE ) {
      eval(popupMenuId[index] + ".style.visibility = 'hidden'");
   } else if ( isN6 ) {
      eval("document.getElementById('" + popupMenuId[index] + "').style.visibility = 'hidden'");
   } else if ( isNN ) {
      eval("document." + popupMenuId[index] + ".visibility = 'hide'");
   }
   popupHidden[index] = true;
}

/************************************************************************
 * Generic routines for working with the dom
 ************************************************************************/
function MM_findObj(n, d) { //v4.0
   var p,i,x;
   if ( !d )
      d=document;
   if ( (p=n.indexOf("?"))>0&&parent.frames.length ) {
      d=parent.frames[n.substring(p+1)].document;
      n=n.substring(0,p);
   }
   if ( !(x=d[n])&&d.all )
      x=d.all[n];
   for ( var i=0;!x&&i<d.forms.length;i++ )
      x=d.forms[i][n];
   for ( var i=0;!x&&d.layers&&i<d.layers.length;i++ )
      x=MM_findObj(n,d.layers[i].document);
   if ( !x && document.getElementById )
      x=document.getElementById(n);
   return x;
}

function MM_changeProp(objName,x,theProp,theValue) { //v3.0
   var obj = MM_findObj(objName);
   if ( obj && (theProp.indexOf("style.")==-1 || obj.style) )
      eval("obj."+theProp+"='"+theValue+"'");
}

function MM_swapImgRestore() { //v3.0
   var i,x,a=document.MM_sr;
   for ( i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++ )
      x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
   var d=document;
   if ( d.images ) {
      if ( !d.MM_p )
         d.MM_p=new Array();
      var i,j=d.MM_p.length,a=MM_preloadImages.arguments;
      for ( i=0; i<a.length; i++ )
         if ( a[i].indexOf("#")!=0 ) {
            d.MM_p[j]=new Image;
            d.MM_p[j++].src=a[i];
         }
   }
}

function MM_swapImage() { //v3.0
   var i,j=0,x,a=MM_swapImage.arguments;
   document.MM_sr=new Array;
   for ( i=0;i<(a.length-2);i+=3 ) {
      x=MM_findObj(a[i]);
      if ( x!=null ) {
         document.MM_sr[j++]=x;
         if ( !x.oSrc )
            x.oSrc=x.src;
         x.src=a[i+2];
      }
   }
}
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
   if ( init==true ) with ( navigator ) {
         if ( (appName=="Netscape")&&(parseInt(appVersion)==4) ) {
            document.MM_pgW=innerWidth;
            document.MM_pgH=innerHeight;
            onresize=MM_reloadPage;
         }
      }
   else if ( innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH )
      location.reload();
}
//-->
