var mozvs = parseInt(navigator.appVersion); // mozilla version
var OP = (navigator.userAgent.indexOf('Opera')!=-1);
var NS = ((navigator.userAgent.indexOf('Mozilla')!=-1)
          && (navigator.userAgent.indexOf('compatible')==-1)
          && !OP);
var NS4 = (NS && (mozvs==4));
var NS4minus = (NS && (mozvs<=4));
var NS6 = (NS && (mozvs==5)); // Netscape6Preview reports version 5. with love from directx...
var IE = (navigator.userAgent.indexOf('MSIE')!=-1);
var IE3 = (navigator.userAgent.indexOf('MSIE 3')!=-1)
          || (navigator.userAgent.indexOf('MSIE3')!=-1);
var IE4plus = (IE && (mozvs>=4));
var isMac = (navigator.userAgent.indexOf('Mac') != -1);
var isWin = (navigator.userAgent.indexOf('Windows') != -1);
var IE5mac = (isMac && (
  (navigator.userAgent.indexOf('MSIE5')!=-1)
   || (navigator.userAgent.indexOf('MSIE 5')!=-1))
   );
// hasReplace is true if the browser implements location.replace()
if ((navigator.userAgent.indexOf('MSIE3.02')!=-1)
  || (navigator.userAgent.indexOf('MSIE 3.02')!=-1)
  || (navigator.userAgent.indexOf('MSIE 4')!=-1)
  || (navigator.userAgent.indexOf('MSIE4')!=-1))
{ var hasReplace = true;}
else { hasReplace=(typeof(location.replace)!='undefined');}
if ((IE) && (mozvs<3)) {hasFuncFocus=false;} else hasFuncFocus=true;


/*
function imgoff() { // restore the off image
  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 imgon() { // load the on image and store the off image in the array
  var i,j=0,x,k=imgon.arguments;
        document.im_off=new Array;
        for(i=0;i<(k.length-2);i+=3)
    if ((x=MM_findObj(k[i]))!=null)
                {
                document.im_off[j++]=x;
                if(!x.oSrc) x.oSrc=x.src;
                x.src=a[i+2];
                }
}


function preloadimg() { // function to preload the images in the corresponding page.
  var d=document;
        if(d.images)
        {
        if(!d.myimlist) d.myimlist=new Array();
    var i,j=d.myimlist.length,k=PreloadImages.arguments;
        for(i=0; i<k.length; i++)
    if (a[i].indexOf("#")!=0)
                {
                d.myimlist[j]=new Image;
                d.myimlist[j++].src='../../graphics/'+k[i]+;
                }
        }
}
*/

function nav(lev2menu)
{
var lnk = '';
/*  WM_netscapeCssFixCheckIn();*/
  //
  // *****************************
  // is the (proper) frameset loaded?
  // *****************************
  //
  if ((typeof(top._menu)=='undefined')
  || (typeof(top._submenu)=='undefined')
  || (typeof(top._theme)=='undefined'))
  { // no, it isn't. so load it...
        lnk = location.pathname;
    top.location.href='../../index.html?'+lev2menu+lnk.substring(lnk.lastIndexOf('/'),lnk.length)+location.hash;
  }
  //else if ((NS6) && (top._text.location.href!=self.location.href)) // NS6 workaround
  //        { top._text.location.href=self.location.href; }
  else
  { // yes, it is. so check if frames are correct...
        //
        // *****************************
    // Is the proper menu loaded?
        // *****************************
        //
    lnk=top._menu.location.href;
    if (lnk.substring(lnk.length-14,lnk.length-10)!=lev2menu)
    { // nope
                 // alert("calling wrong menu! from:"+location.href);
                 // alert(lnk.substring(lnk.length-14,lnk.length-10));
         lnk = '../menu/'+lev2menu+'_menu.html';
      // alert("setting "+lnk+" for _menu");
     if (hasReplace)
     {top._menu.location.replace(lnk);}
     else {top._menu.location.href=lnk;}
        }
        //
        // *****************************
    // Is the proper submenu loaded?
        // *****************************
        //
    lnk=top._submenu.location.href;
    if (lnk.substring(lnk.lastIndexOf('/')-4,lnk.length)!=lev2menu+'/submenu.html')
    { // nope
                 // alert("wrong submenu!");
                 // alert(lnk.substring(lnk.lastIndexOf('/')-4,lnk.length));
         lnk = '../'+lev2menu+'/submenu.html';
          // alert("setting "+lnk+" for _submenu");
     if (hasReplace)
     {top._submenu.location.replace(lnk);}
     else {top._submenu.location.href=lnk;}
    }
        //
        // *****************************
    // Is the proper theme loaded?
        // *****************************
        //
    lnk=top._theme.location.href;
    if (lnk.substring(lnk.lastIndexOf('/')-4,lnk.length)!=lev2menu+'/theme.html')
    { // nope
                 // alert("wrong theme!");
                 // alert(lnk.substring(lnk.lastIndexOf('/')-4,lnk.length));
         lnk = '../'+lev2menu+'/theme.html';
         // alert("setting "+lnk+" for _theme");
     if (hasReplace)
     {top._theme.location.replace(lnk);}
     else {top._theme.location.href=lnk;}
    }
    //
    // *****************************
    // Which text is correct?
        // *****************************
        //
    lnk=top._text.location.href;
    if (lnk.substring(lnk.lastIndexOf('/')-4,lnk.lastIndexOf('/'))!=lev2menu)
    { // nope
                 // alert("wrong text!");
                 // alert(lnk.substring(lnk.lastIndexOf('/')-4,lnk.lastIndexOf('/')));
         lnk = '../'+lev2menu+'/index.html';
          // alert("setting "+lnk+" for _text");
     if (hasReplace)
     {top._text.location.replace(lnk);}
     else {top._text.location.href=lnk;}
    }
    if (hasFuncFocus) top._text.focus();
  }
}
