var Routes = (function() {
  var _ = {};
  
  var route = function(segments, keys) {
    return function() {
      // build params object from arguments
      var params = {};
      var n = arguments.length;
      if (typeof arguments[n-1] == 'object') {
        var kwargs = arguments[n-1];
        for (var k in kwargs) {
          if (kwargs.hasOwnProperty(k)) {
            params[k] = kwargs[k];
          }
        }
        n--;
      }
      for (var i = 0; i < n; i++) {
        params[keys[i]] = arguments[i];
      }
      
      var path = [];
      
      // build path component of URI from route segments
      var pi = 0;
      for (var i = 0; i < segments.length; i++) {
        if (segments[i] == _) {
          var k = keys[pi++];
          path.push(encodeURIComponent(params[k]));
          delete params[k];
        } else {
          path.push(segments[i]);
        }
      }
      
      // add the format, if provided
      if (params.format) {
        path.push('.');
        path.push(params.format);
        delete params.format;
      }
      
      // put any extra params in the query string
      var separator = '?';
      for (var k in params) {
        if (params.hasOwnProperty(k)) {
          path.push(separator);
          path.push(k);
          path.push('=');
          path.push(encodeURIComponent(params[k]));
          separator = '&';
        }
      }
      
      return path.join('');
    };
  };
  
  return {
    
    "actionItemPath": route(["/", "action_items", "/", _], ["id"])  
    ,"actionItemsPath": route(["/", "action_items"], [])  
    ,"adminAwardPath": route(["/", "admin", "/", "awards", "/", _], ["id"])  
    ,"adminAwardsPath": route(["/", "admin", "/", "awards"], [])  
    ,"adminTurkerPath": route(["/", "admin", "/", "turkers", "/", _], ["id"])  
    ,"adminTurkersPath": route(["/", "admin", "/", "turkers"], [])  
    ,"amazonFinishPageCampaignPath": route(["/", "pages", "/", _, "/", "campaigns", "/", _, "/", "amazon_finish"], ["page_id", "id"])  
    ,"amazonSetupPageCampaignPath": route(["/", "pages", "/", _, "/", "campaigns", "/", _, "/", "amazon_setup"], ["page_id", "id"])  
    ,"attachPagePhotoPath": route(["/", "pages", "/", _, "/", "photos", "/", _, "/", "attach"], ["page_id", "id"])  
    ,"awardsPagePath": route(["/", "pages", "/", _, "/", "awards"], ["id"])  
    ,"checkerPath": route(["/", "docs", "/", "checker"], [])  
    ,"codesPath": route(["/", "codes"], [])  
    ,"commentPath": route(["/", "comments", "/", _], ["id"])  
    ,"commentSessionsPath": route(["/", "sessions", "/", "comment"], [])  
    ,"commentsPath": route(["/", "comments"], [])  
    ,"contactedSessionsPath": route(["/", "sessions", "/", "contacted"], [])  
    ,"controlAdminsPath": route(["/", "admins", "/", "control"], [])  
    ,"dealPath": route(["/", "deals", "/", _], ["id"])  
    ,"dealActivitySessionsPath": route(["/", "sessions", "/", "deal_activity"], [])  
    ,"dealDataSessionsPath": route(["/", "sessions", "/", "deal_data"], [])  
    ,"deletePagePhotoPath": route(["/", "pages", "/", _, "/", "photos", "/", _, "/", "delete"], ["page_id", "id"])  
    ,"detachPagePhotoPath": route(["/", "pages", "/", _, "/", "photos", "/", _, "/", "detach"], ["page_id", "id"])  
    ,"doneBookmarkSessionsPath": route(["/", "sessions", "/", "done_bookmark"], [])  
    ,"editAdminAwardPath": route(["/", "admin", "/", "awards", "/", _, "/", "edit"], ["id"])  
    ,"editAdminTurkerPath": route(["/", "admin", "/", "turkers", "/", _, "/", "edit"], ["id"])  
    ,"editCommentPath": route(["/", "comments", "/", _, "/", "edit"], ["id"])  
    ,"editFavoritePath": route(["/", "favorites", "/", _, "/", "edit"], ["id"])  
    ,"editFriendPath": route(["/", "friends", "/", _, "/", "edit"], ["id"])  
    ,"editMarkPath": route(["/", "marks", "/", _, "/", "edit"], ["id"])  
    ,"editPageCampaignPath": route(["/", "pages", "/", _, "/", "campaigns", "/", _, "/", "edit"], ["page_id", "id"])  
    ,"editTurkerPath": route(["/", "turkers", "/", _, "/", "edit"], ["id"])  
    ,"editUserPath": route(["/", "users", "/", _, "/", "edit"], ["id"])  
    ,"emailSessionsPath": route(["/", "sessions", "/", "email"], [])  
    ,"emailUsersPath": route(["/", "users", "/", "email"], [])  
    ,"fanPagesAdminsPath": route(["/", "admins", "/", "fan_pages"], [])  
    ,"favoritePath": route(["/", "favorites", "/", _], ["id"])  
    ,"favoritesPath": route(["/", "favorites"], [])  
    ,"feedbacksPath": route(["/", "feedbacks"], [])  
    ,"finishPageDetailPath": route(["/", "pages", "/", _, "/", "details", "/", _, "/", "finish"], ["page_id", "id"])  
    ,"finishedPageCampaignPath": route(["/", "pages", "/", _, "/", "campaigns", "/", _, "/", "finished"], ["page_id", "id"])  
    ,"finishedPageDetailPath": route(["/", "pages", "/", _, "/", "details", "/", _, "/", "finished"], ["page_id", "id"])  
    ,"friendPath": route(["/", "friends", "/", _], ["id"])  
    ,"friendsPath": route(["/", "friends"], [])  
    ,"getJobTurkersPath": route(["/", "turkers", "/", "get_job"], [])  
    ,"guestListPath": route(["/", "guest_lists", "/", _], ["id"])  
    ,"incompleteLikesSessionsPath": route(["/", "sessions", "/", "incomplete_likes"], [])  
    ,"inviteCompleteFriendsPath": route(["/", "friends", "/", "invite_complete"], [])  
    ,"ipnHandlerPath": route(["/", "ipn_handler"], [])  
    ,"jammitPath": route(["/", "static", "/", _, ".", _], ["package", "extension"])  
    ,"likersPagePath": route(["/", "pages", "/", _, "/", "likers"], ["id"])  
    ,"logoutPath": route(["/", "logout"], [])  
    ,"makePageCampaignsPath": route(["/", "pages", "/", _, "/", "campaigns", "/", "make"], ["page_id"])  
    ,"makePrimaryPagePhotoPath": route(["/", "pages", "/", _, "/", "photos", "/", _, "/", "make_primary"], ["page_id", "id"])  
    ,"markPath": route(["/", "marks", "/", _], ["id"])  
    ,"marksPath": route(["/", "marks"], [])  
    ,"moveCampaignsPagePath": route(["/", "pages", "/", _, "/", "move_campaigns"], ["id"])  
    ,"moveFavoritesPath": route(["/", "favorites", "/", "move"], [])  
    ,"newAdminAwardPath": route(["/", "admin", "/", "awards", "/", "new"], [])  
    ,"newAdminTurkerPath": route(["/", "admin", "/", "turkers", "/", "new"], [])  
    ,"newCommentPath": route(["/", "comments", "/", "new"], [])  
    ,"newFavoritePath": route(["/", "favorites", "/", "new"], [])  
    ,"newFeedbackPath": route(["/", "feedbacks", "/", "new"], [])  
    ,"newFriendPath": route(["/", "friends", "/", "new"], [])  
    ,"newItemsSessionsPath": route(["/", "sessions", "/", "new_items"], [])  
    ,"newMarkPath": route(["/", "marks", "/", "new"], [])  
    ,"newPageCampaignPath": route(["/", "pages", "/", _, "/", "campaigns", "/", "new"], ["page_id"])  
    ,"newPageDetailSharePath": route(["/", "pages", "/", _, "/", "details", "/", _, "/", "shares", "/", "new"], ["page_id", "detail_id"])  
    ,"newPageVotePath": route(["/", "pages", "/", _, "/", "votes", "/", "new"], ["page_id"])  
    ,"newTurkVotePath": route(["/", "turk_votes", "/", "new"], [])  
    ,"newTurkerPath": route(["/", "turkers", "/", "new"], [])  
    ,"newUserPath": route(["/", "users", "/", "new"], [])  
    ,"nothingPath": route(["/", "docs", "/", "nothing"], [])  
    ,"offlineAccessAdminsPath": route(["/", "admins", "/", "offline_access"], [])  
    ,"orderPath": route(["/", "orders", "/", _], ["id"])  
    ,"ordersPath": route(["/", "orders"], [])  
    ,"pageCampaignPath": route(["/", "pages", "/", _, "/", "campaigns", "/", _], ["page_id", "id"])  
    ,"pageCampaignsPath": route(["/", "pages", "/", _, "/", "campaigns"], ["page_id"])  
    ,"pageDetailPath": route(["/", "pages", "/", _, "/", "details", "/", _], ["page_id", "id"])  
    ,"pageDetailSharesPath": route(["/", "pages", "/", _, "/", "details", "/", _, "/", "shares"], ["page_id", "detail_id"])  
    ,"pageFansSessionsPath": route(["/", "sessions", "/", "page_fans"], [])  
    ,"pageIdsUserPath": route(["/", "users", "/", _, "/", "page_ids"], ["id"])  
    ,"pageSalePath": route(["/", "pages", "/", _, "/", "sales", "/", _], ["page_id", "id"])  
    ,"pageSalesPath": route(["/", "pages", "/", _, "/", "sales"], ["page_id"])  
    ,"pageVotesPath": route(["/", "pages", "/", _, "/", "votes"], ["page_id"])  
    ,"pagesPath": route(["/", "pages"], [])  
    ,"postAsFanPath": route(["/", "docs", "/", "post_as_fan"], [])  
    ,"postJobTurkersPath": route(["/", "turkers", "/", "post_job"], [])  
    ,"previewPageCampaignPath": route(["/", "pages", "/", _, "/", "campaigns", "/", _, "/", "preview"], ["page_id", "id"])  
    ,"privacyPolicyPath": route(["/", "privacy-policy"], [])  
    ,"receivePaymentsPageCampaignPath": route(["/", "pages", "/", _, "/", "campaigns", "/", _, "/", "receive_payments"], ["page_id", "id"])  
    ,"requestsSessionsPath": route(["/", "sessions", "/", "requests"], [])  
    ,"rootPath": route([], [])  
    ,"selectPhotosPageCampaignPath": route(["/", "pages", "/", _, "/", "campaigns", "/", _, "/", "select_photos"], ["page_id", "id"])  
    ,"sellerTermsPath": route(["/", "seller_terms"], [])  
    ,"sessionPath": route(["/", "sessions", "/", _], ["id"])  
    ,"sessionsPath": route(["/", "sessions"], [])  
    ,"setPhotosPageCampaignPath": route(["/", "pages", "/", _, "/", "campaigns", "/", _, "/", "set_photos"], ["page_id", "id"])  
    ,"statsAdminsPath": route(["/", "admins", "/", "stats"], [])  
    ,"status404Path": route(["/", "docs", "/", "status404"], [])  
    ,"status500Path": route(["/", "docs", "/", "status500"], [])  
    ,"stepSessionsPath": route(["/", "sessions", "/", "step"], [])  
    ,"suggestVotesSessionsPath": route(["/", "sessions", "/", "suggest_votes"], [])  
    ,"termsPath": route(["/", "terms"], [])  
    ,"testMethodNotAllowedPath": route(["/", "docs", "/", "test_method_not_allowed"], [])  
    ,"testNotallsavedPath": route(["/", "docs", "/", "test_notallsaved"], [])  
    ,"testRecordnotfoundPath": route(["/", "docs", "/", "test_recordnotfound"], [])  
    ,"testRuntimePath": route(["/", "docs", "/", "test_runtime"], [])  
    ,"turkVotesPath": route(["/", "turk_votes"], [])  
    ,"turkerPath": route(["/", "turkers", "/", _], ["id"])  
    ,"turkersPath": route(["/", "turkers"], [])  
    ,"uploadPagePhotosPath": route(["/", "pages", "/", _, "/", "photos", "/", "upload"], ["page_id"])  
    ,"userPath": route(["/", "users", "/", _], ["id"])  
    ,"usersPath": route(["/", "users"], [])  
  };
}());
