$(function(){
    var location = window.location.pathname;
    var createMenu;
    
    createMenu = function ( ) {
        
        // Hold the menu sidebar
        var menu = $("#sidebar .side-menu ul");
        var id;
        
        // For each soup then append it to the menu
        $(".instruction .soup").each( function ( index, element) { 

            id = "soup_"+ index;
            
            menu.append( "<li><a href='#"+ id +" '> "+ $(this).text() +"</a></li>" );
            
            $( element ).prepend( " <a name='"+ id +"'></a> ");
        } );

    }

    console.log( "Location = " + location );
    if( location == "/" || location == ""  || location == "/home") {
        slider(); 
    }
    else if ( location == "/instructions" ) {

        createMenu ( );
    }
    
   


});


