  $(document).ready(function() {  
    
    //Scroll the menu on mouse move above the #sidebar layer
    $('#popout-sidebar-2').mousemove(function(e) {
      
      //Sidebar Offset, Top value
      var s_top = parseInt($('#popout-sidebar-2').offset().top) + 20;       
      
      //Sidebar Offset, Bottom value
      var s_bottom = parseInt($('#popout-sidebar-2').height() + s_top);
      
      //Roughly calculate the height of the menu by multiply height of a single LI with the total of LIs
      var mheight = parseInt($('#popout-menu-2 li').height() * $('#popout-menu-2 li').length);
      
      //I used this coordinate and offset values for debuggin
      $('#debugging_mouse_axis').html("X Axis : " + e.pageX + " | Y Axis " + e.pageY);
      $('#debugging_status').html(Math.round(((s_top - e.pageY)/100) * mheight / 2));
      
      //Calculate the top value
      //This equation is not the perfect, but it 's very close    
      var top_value = Math.round(( (s_top - e.pageY) /160) * mheight / 2)
          
          //Animate the #menu by chaging the top value
          $('#popout-menu-2').animate({top: top_value}, { queue:false, duration:1});
    });
        
      
    //Scroll the menu on mouse move above the #sidebar layer
    $('#popout-sidebar-3').mousemove(function(e) {
      
      //Sidebar Offset, Top value
      var s_top = parseInt($('#popout-sidebar-3').offset().top) + 10;       
      
      //Sidebar Offset, Bottom value
      var s_bottom = parseInt($('#popout-sidebar-3').height() + s_top);
      
      //Roughly calculate the height of the menu by multiply height of a single LI with the total of LIs
      var mheight = parseInt($('#popout-menu-3 li').height() * $('#popout-menu-3 li').length);
      
      //I used this coordinate and offset values for debuggin
      $('#debugging_mouse_axis').html("X Axis : " + e.pageX + " | Y Axis " + e.pageY);
      $('#debugging_status').html(Math.round(((s_top - e.pageY)/100) * mheight / 2));
      
      //Calculate the top value
      //This equation is not the perfect, but it 's very close    
      var top_value = Math.round(( (s_top - e.pageY) /160) * mheight / 2)
          
          //Animate the #menu by chaging the top value
          $('#popout-menu-3').animate({top: top_value}, { queue:false, duration:1});
    });
        
    
  });

