jQuery(document).ready(function($) {   

  if(pagehandle.ahswitch =='0')
    { 
              $('#sidebar-nav').addClass('show-nav'); 
    }


  //Triggering Navigation as Sticky when scrolled to second section:
        $('#'+ pagehandle.pageid).waypoint(function (event, direction) {
            if (direction === 'down') 
            {
              $('#sidebar-nav').addClass('show-nav');
            } 
            else{
               if(pagehandle.ahswitch =='1')
                { 
                  $('#sidebar-nav').removeClass('show-nav'); 
                }
            }
        }, { offset: 0 });


 });   