  var Nav = {
    loadBlueprint : function ( type, id) {  
      
      destination = '';
      
      switch(type) {
        case 'comingsoon':
          Nav.loadComingSoon();
          return
          break;
        case 'return':
          //if (id == 'comingsoon') return;
          //destination = "index.php/ajax/" + id;
          return;
          break;
        
        case 'menu':
          destination = '/menus/view/' + id;
          break;
          
        default:
          destination   = '/ajax/' + type + '/' + id;    
          //location.hash = destination;        
          break;
          
      } // switch

      $.ajax({
        url: destination,
        success: function(html){ 
          $.modal(html, {close:false}); 
          $(document).bind('keydown', 'esc', Nav.close);
          $("#simplemodal-overlay").bind("click", function(){ Nav.close(); } );                  
        }
      }); 
    
    },
    
    loadSubNavigation : function (menu, menu_section, page) {
      page          = (page)? page : 1;
      menu_section  = (menu_section)? menu_section : 1;
      location.hash = '/menus/view/' + menu + '/' + menu_section + '/' + page;
      $.ajax({
        url: "/menus/view/" + menu + '/' + menu_section + '/' + page,
        success: function(html){ $('.simplemodal-data').html(html); }
      });     
    },
    
    loadSubPhotos : function( category, page ) {
      category = (category)? category : 1;
      page     = (page)? page : 1;
      
      location.hash = 'Photos/' + category  + '/' + page;

      $.ajax({
        url: "/ajax/Photos/" + category + '/' + page,
        success: function(html){ $('.simplemodal-data').html(html); }
      }); 
    },  
    
    loadPhotos : function( category, page ) {
      category = (category)? category : 1;
      page     = (page)? page : 1;
      
      location.hash = 'Photos/' + category  + '/' + page;

      $.ajax({
        url: "index.php/ajax/Photos/" + category + '/' + page,
        success: function(html){ 
          $.modal(html, {close:false}); 
          $(document).bind('keydown', 'esc', Nav.close);
          $("#simplemodal-overlay").bind("click", function(){ Nav.close(); } );                  
        }
      }); 
    },    
    
    loadPress : function() {
      location.hash = 'press'; 
      $.ajax({
        url: "index.php/ajax/press",
        success: function(html){ 
          $.modal(html, {close:false}); 
          $(document).bind('keydown', 'esc', Nav.close);
          $("#simplemodal-overlay").bind("click", function(){ Nav.close(); } );                  
        }
      });     
    },
    
    loadComingSoon : function() {
      
      location.hash = '#comingsoon';
      $.ajax({
        url: "index.php/ajax/comingsoon",
        success: function(html) { 
          $.modal(html, {close:false, containerId:'comingsoon-container'}); 
          $(document).bind('keydown', 'esc', Nav.close);
          $("#simplemodal-overlay").bind("click", function(){ Nav.close(); } ); 
        }
      });     
    },
    
    close : function() {
      location.hash = '';
      $(document).unbind( 'keydown', 'esc', Nav.close);
      $("#simplemodal-overlay").unbind("click", function(){ Nav.close(); } ); 
      $.modal.close();
    }
    
  };
  
  function submitReservationForm() {
    var data = $('#reservation-form').formSerialize(); 
    $.post("index.php/ajax/reservations", data, function(html) {
      $('.simplemodal-data').html(html); 
    });
  }  
  

