
          PageIsLoaded = false
   
          browserName = navigator.appName;
          browserVer = parseInt(navigator.appVersion);

          Allstarted = 0;

          isNavigator = false;

          m1umove = false;
          m2umove = false;

          centerX = 0;

        if (browserVer < 4) {
        document.write('<FRAMESET ROWS = "100%, *" FRAMEBORDER = NO BORDER = 0>' +
                       '<FRAME NAME = "real" SRC = "invalidbrowser.html" SCROLLING = AUTO MARGINHEIGHT = 2 MARGINWIDTH = 2>' +
                       '</FRAMESET>');
        }


                  currentlyActive = 0;
                  currentMovienum = 0;
                  
                   var layerRef="null", styleSwitch="null";
                 
                   if (browserName == "Netscape") {
                     layerRef="document.layers";
                     styleSwitch="";
                     mouseX = "event.pageX";
                     mouseY = "event.pageY";
                     isNavigator = true;
                   }else{
                     layerRef="document.all";
                     styleSwitch=".style";
                     mouseX = "document.body.scrollLeft + window.event.clientX";
                     mouseY = "document.body.scrollTop + window.event.clientY";
                   }

                   // moves all the layers as browser window resizes
                   function movelayers()
                   {
                      // find new the LEFT coordinate of the right bar
//                      alert(eval(layerRef+'["page1"]'+styleSwitch+'.left'));
                      if (browserName == "Netscape")
                      {          
                        innerW = window.innerWidth;
                        if (innerW<634) innerW = 634;
                        newleft = (innerW/2+152)-8;
                        centerX = innerW/2-8;
              
                      }
                      else
                      {
                        clientW = document.body.clientWidth;
                        if (clientW<619) clientW = 619;
                        centerX = clientW/2;
                        newleft = (clientW/2+152);
                      }
                                          // set ne coordinate
                  
                    
                  }

                  version = "n2";
                  if (browserName == "Netscape") {
                       if (browserVer == 3) version ="n3";
                       if (browserVer > 3) version ="n4";
                  } else
                       if (browserVer > 3) version = "e4";

                  if (version == "n3" || version == "e4" || version == "n4") 
                  {
                   title1on = new Image(172, 11);
                   title1on.src = "buttons/main2.gif";
                   title1off = new Image(172, 11);
                   title1off.src = "buttons/main1.gif";
                 
                   title2on = new Image(172, 11);
                   title2on.src = "buttons/registr2.gif";
                   title2off = new Image(172, 11);
                   title2off.src = "buttons/registr1.gif";

                   title3on = new Image(172, 11);
                   title3on.src = "buttons/uchast2.gif";
                   title3off = new Image(172, 11);
                   title3off.src = "buttons/uchast1.gif";

                   title4on = new Image(172, 11);
                   title4on.src = "buttons/news2.gif";
                   title4off = new Image(172, 11);
                   title4off.src = "buttons/news1.gif";

                   title5on = new Image(172, 11);
                   title5on.src = "buttons/confer2.gif";
                   title5off = new Image(172, 11);
                   title5off.src = "buttons/confer1.gif";

		   title6on = new Image(172, 11);
                   title6on.src = "buttons/humor2.gif";
                   title6off = new Image(172, 11);
                   title6off.src = "buttons/humor1.gif";

                   title7on = new Image(172, 90);
                   title7on.src = "buttons/sites2.gif";
                   title7off = new Image(172, 90);
                   title7off.src = "buttons/sites1.gif";

                   title8on = new Image(172, 90);
                   title8on.src = "buttons/contact2.gif";
                   title8off = new Image(172, 90);
                   title8off.src = "buttons/contact1.gif";

                   title9on = new Image(172, 90);
                   title9on.src = "buttons/discuss2.gif";
                   title9off = new Image(172, 90);
                   title9off.src = "buttons/discuss1.gif";

                   title10on = new Image(172, 90);
                   title10on.src = "buttons/russ2.gif";
                   title10off = new Image(172, 90);
                   title10off.src = "buttons/russ1.gif";

                   title11on = new Image(172, 90);
                   title11on.src = "buttons/eng2.gif";
                   title11off = new Image(172, 90);
                   title11off.src = "buttons/eng1.gif";

                   title12on = new Image(172, 90);
                   title12on.src = "buttons/public2.gif";
                   title12off = new Image(172, 90);
                   title12off.src = "buttons/public1.gif";

                   title13on = new Image(172, 90);
                   title13on.src = "buttons/useful2.gif";
                   title13off = new Image(172, 90);
                   title13off.src = "buttons/useful1.gif";

                   title14on = new Image(172, 90);
                   title14on.src = "buttons/comput2.gif";
                   title14off = new Image(172, 90);
                   title14off.src = "buttons/comput1.gif";

                   title15on = new Image(172, 90);
                   title15on.src = "buttons/mois2.gif";
                   title15off = new Image(172, 90);
                   title15off.src = "buttons/mois1.gif";

                   title16on = new Image(172, 90);
                   title16on.src = "buttons/about2.gif";
                   title16off = new Image(172, 90);
                   title16off.src = "buttons/about1.gif";


                   title101on = new Image(172, 11);
                   title101on.src = "buttons/main_e2.gif";
                   title101off = new Image(172, 11);
                   title101off.src = "buttons/main_e1.gif";
                 
                   title102on = new Image(172, 11);
                   title102on.src = "buttons/registr_e2.gif";
                   title102off = new Image(172, 11);
                   title102off.src = "buttons/registr_e1.gif";

                   title103on = new Image(172, 11);
                   title103on.src = "buttons/uchast_e2.gif";
                   title103off = new Image(172, 11);
                   title103off.src = "buttons/uchast_e1.gif";

                   title104on = new Image(172, 11);
                   title104on.src = "buttons/news_e2.gif";
                   title104off = new Image(172, 11);
                   title104off.src = "buttons/news_e1.gif";

                   title105on = new Image(172, 11);
                   title105on.src = "buttons/confer_e2.gif";
                   title105off = new Image(172, 11);
                   title105off.src = "buttons/confer_e1.gif";

		   title106on = new Image(172, 11);
                   title106on.src = "buttons/humor_e2.gif";
                   title106off = new Image(172, 11);
                   title106off.src = "buttons/humor_e1.gif";

                   title107on = new Image(172, 90);
                   title107on.src = "buttons/sites_e2.gif";
                   title107off = new Image(172, 90);
                   title107off.src = "buttons/sites_e1.gif";

                   title108on = new Image(172, 90);
                   title108on.src = "buttons/contact_e2.gif";
                   title108off = new Image(172, 90);
                   title108off.src = "buttons/contact_e1.gif";

                   title109on = new Image(172, 90);
                   title109on.src = "buttons/discuss_e2.gif";
                   title109off = new Image(172, 90);
                   title109off.src = "buttons/discuss_e1.gif";

                   title1010on = new Image(172, 90);
                   title1010on.src = "buttons/russ_e2.gif";
                   title1010off = new Image(172, 90);
                   title1010off.src = "buttons/russ_e1.gif";

                   title1011on = new Image(172, 90);
                   title1011on.src = "buttons/eng_e2.gif";
                   title1011off = new Image(172, 90);
                   title1011off.src = "buttons/eng_e1.gif";

                   title1012on = new Image(172, 90);
                   title1012on.src = "buttons/public_e2.gif";
                   title1012off = new Image(172, 90);
                   title1012off.src = "buttons/public_e1.gif";

                   title1013on = new Image(172, 90);
                   title1013on.src = "buttons/useful_e2.gif";
                   title1013off = new Image(172, 90);
                   title1013off.src = "buttons/useful_e1.gif";

                   title1014on = new Image(172, 90);
                   title1014on.src = "buttons/comput_e2.gif";
                   title1014off = new Image(172, 90);
                   title1014off.src = "buttons/comput_e1.gif";

                   title1015on = new Image(172, 90);
                   title1015on.src = "buttons/mois_e2.gif";
                   title1015off = new Image(172, 90);
                   title1015off.src = "buttons/mois_e1.gif";

                   title1016on = new Image(172, 90);
                   title1016on.src = "buttons/about_e2.gif";
                   title1016off = new Image(172, 90);
                   title1016off.src = "buttons/about_e1.gif";
                   title17on = new Image(172, 90);                   title17on.src = "buttons/educ2.gif";                   title17off = new Image(172, 90);                   title17off.src = "buttons/educ1.gif";                   title1017on = new Image(172, 90);                   title1017on.src = "buttons/educ_e2.gif";                   title1017off = new Image(172, 90);                   title1017off.src = "buttons/educ_e1.gif";
                  }

          function img_act(name) {
                  if (version == "n3") {
                           imgOn = eval(name + "on.src");
                           document [name].src = imgOn;
                  }
                  if (version == "e4" || version == "n4")
                  {
                           imgOn = eval(name + "on.src");
                           tname = eval("document."+name);
                           tname.src = imgOn;
                  }
          }

          function img_act2(name1,name2) {
                     img_act( name1 );
                         img_act( name2 );
          }
                  
          function img_inact(name) {
                  if (version == "n3") {
                          imgOn = eval(name + "off.src");
                          document [name].src = imgOn;
                  }
                  if (version == "e4" || version == "n4")
                  {
                          imgOn = eval(name + "off.src");
                          tname = eval("document."+name);
                          tname.src = imgOn;
                  }
                 window.status = "";
          }

          function img_inact2(name1,name2) {
                     img_inact( name1 );
                         img_inact( name2 );
          }
                  
            function ShowLayer( name )
                        {
                           if (PageIsLoaded)
                           {
                             eval(layerRef+'["'+name+'"]'+styleSwitch+'.visibility="visible"');
<!--                         if (name !="crazy") eval(layerRef+'["crazy"]'+styleSwitch+'.visibility="hidden"');-->
                           }
                        }

           
                        
                        function ActivateTitle( num, movienum )
                        {
//                         if (movienum != currentMovienum)
//                         {
//                            if (currentMovienum != 0)
//                                 img_inact( "movie"+movienum );
//                                currentMovienum = movienum;
//                                img_act( "movie"+movienum );
//                         }
                           if (num != currentlyActive)
                           {
                              if (currentlyActive != 0)
                               img_inact( "title"+currentlyActive );
                                  currentlyActive = num;
                              img_act( "title"+currentlyActive );
                           }
                           else
                           {
                              currentlyActive = num;
                              img_act( "title"+currentlyActive );
                           }
                        }

   function mousemovef(e)
   {
     if (Allstarted != 1) return;
     if (!isNavigator)
     {
       X = eval(mouseX);
       Y = eval(mouseY);
     } else
     {
       X = e.pageX;
       Y = e.pageY;
     }
     // process first moving image -
     // if mouse is moving in the region for the "school" then
     // we turn it on else we turn it off
     if ((X-centerX)>=-145 && (X-centerX)<=154 && Y>=112 && Y<=346) 
     {
       if (m1umove != true)
       {
         img_act("movie1"); 
         m1umove = true;
       }
     } else
     if (m1umove)
     {
       img_inact("movie1");
       m1umove = false;
     }

     // process second moving image -
     // if mouse is moving in the region for the "prof. education" then
     // we turn it on else we turn it off
     if ((X-centerX)>=-145 && (X-centerX)<=154 && Y>=347 && Y<=601) 
     {
       if (m2umove != true)
       {
         img_act("movie2"); 
         m2umove = true;
       }
     } else
     if (m2umove)
     {
       img_inact("movie2");
       m2umove = false;
     }

    }

   window.onresize = movelayers;
//   document.captureEvents(Event.MOUSEMOVE);
//   document.onmousemove = mousemovef;

   function newPos(e)
   {
     alert("hh");
   }
   
   if(document.layers)
   document.captureEvents(Event.MOUSEMOVE)
   document.onmousemove=mousemovef

// There are some problems with Navigator, how it works with images
// in layers, so we must create new functions for operating images
// contained in layers, anyway we MUST create these functions
// for more convenience...
   function z(pic, source) {
           pic.src=source;
   }
   
   function simg_inact( imgObj, num )
   {
     imgOn = eval("s" + num + "off.src");
     CurPic = imgObj;
     z( CurPic, imgOn );
   }   
   
   function simg_act( imgObj, num )
   {
     imgOn = eval("s" + num + "on.src");
     CurPic = imgObj;
     z( CurPic, imgOn );
   }   

   function InActAllTitles()
   {
     if (currentlyActive != 0)   
     {
       img_inact( "title"+currentlyActive );
       currentlyActive = 0;
     }
   }
   
