menuOpen=[false,false,false,false,false];
    menuDelay=[0,0,0,0,0];
    menuLeft=[0,0,0,0,0];
    menuTop=[-100,-100,-100,-100,-100];
    menuOffset=[0,0,0,0,0];
    menuMaximum=[120,120,120,120,120];
    titleOffset=[20,20,20,20,20];
    titleMaximum=[98,98,98,98,98];
    menuSpeed=[0,0,0,0,0];
	 function Menu_Init(param1) {
    		window.setInterval('scrollMenus()',50);
		menuOffset[param1]=120;
		 document.getElementById('menu0a').onmouseover=function() {openMenu(0)};
	   document.getElementById('menu0a').onmouseout=function(){closeMenu(0)};
		 document.getElementById('menu1a').onmouseover=function() {openMenu(1)};
	   document.getElementById('menu1a').onmouseout=function(){closeMenu(1)};
		 document.getElementById('menu2a').onmouseover=function() {openMenu(2)};
	   document.getElementById('menu2a').onmouseout=function(){closeMenu(2)};
		 document.getElementById('menu3a').onmouseover=function() {openMenu(3)};
	   document.getElementById('menu3a').onmouseout=function(){closeMenu(3)};
		 document.getElementById('menu4a').onmouseover=function() {openMenu(4)};
	   document.getElementById('menu4a').onmouseout=function(){closeMenu(4)};
    	scrollMenus();
	 }
    function openMenu(menu){
      menuOpen[menu]=true;
    }
    function closeMenu(menu){
      menuOpen[menu]=false;
      menuDelay[menu]=4;
    }
    function scrollMenus(){
      // The next few lines avoid bugs in browsers with a faulty onLoad()
      var okay=true;
      if (!okay) return;
      var width=800;
      if (self.innerWidth){
        width=self.innerWidth;
      }else if (document.documentElement
             && document.documentElement.clientWidth){
        width=document.documentElement.clientWidth;
      }else if (document.body){
        width=document.body.clientWidth;
      }
//      var offset=(width-800)/2;
      var offset=0;
      for (var i=0;i<menuOpen.length;i++){
        var leftOffset=offset+menuLeft[i];
        document.getElementById('menu'+i+'body').style.left=leftOffset+'px';
        if (menuOpen[i] || menuDelay[i]>0 ){
          menuDelay[i]--;
          if (menuSpeed[i]<0){
            menuSpeed[i]++;
          }else{
            var stoppingDistance=menuSpeed[i]*(menuSpeed[i]+1)/2;
            if (menuMaximum[i]-menuOffset[i]<stoppingDistance) menuSpeed[i]--;
            if (menuMaximum[i]-menuOffset[i]>stoppingDistance+menuSpeed[i]+1){
              menuSpeed[i]++;
            }
          }
        }else{
          if (menuSpeed[i]>0){
            menuSpeed[i]--;
          }else{
            var stoppingDistance=menuSpeed[i]*(menuSpeed[i]-1)/2;
            if (menuOffset[i]<stoppingDistance) menuSpeed[i]++;
            if (menuOffset[i]>stoppingDistance-menuSpeed[i]+1){
              menuSpeed[i]--;
            }
          }
        }
        menuOffset[i]+=menuSpeed[i];
        document.getElementById('menu'+i+'body').style.top=
            menuTop[i]+menuOffset[i]+'px';
        document.getElementById('menu'+i+'bg').style.top=
            (menuTop[i]+menuOffset[i]-20)+'px';
        document.getElementById('menu'+i+'bg').style.opacity=(menuOffset[i] / (2*menuMaximum[i]))
        document.getElementById('menu'+i+'bg').style.MozOpacity=(menuOffset[i] / (2*menuMaximum[i]))
        document.getElementById('menu'+i+'bg').style.filter="alpha(opacity="+(100*(menuOffset[i] / (2*menuMaximum[i])))+")";
			document.getElementById('square'+i+'title').style.width=(titleOffset[i] + menuOffset[i] * titleMaximum[i] / menuMaximum[i]) + 'px';
      }
    }
