﻿
if (typeof (GMI.BAH) == 'undefined') {
    GMI.BAH = {};
}

if (typeof (GMI.BAH.Tracking) == 'undefined') {
    GMI.BAH.Tracking = {};
}

//click to search for recipes on plan calendar page - cell context menu option
GMI.BAH.Tracking.MyPlanSearchForRecipes = 
    { TrackingURL: "/MyPlan/SearchForRecipes",
      TrackingTitle: "MyPlan_SearchForRecipes"
    };

 //click to add note on plan calendar page  - cell context menu option
GMI.BAH.Tracking.MyPlanAddNote =
    { TrackingURL: "/MyPlan/AddNote",
      TrackingTitle: "MyPlan_AddNote"
    };

//user selects to "select own recipes" in the build plan wizard
GMI.BAH.Tracking.BuildPlanSelectOwn =
    { TrackingURL: "/MyPlan/BuildMealPlan/SelectOwnRecipes",
      TrackingTitle: "MyPlan_Build_SelectOwnRecipes"
  };
    
//user selcts to "choose recipes for you" in the build plan wizard
GMI.BAH.Tracking.BuildPlanChooseForYou =
    { TrackingURL: "/MyPlan/BuildMealPlan/ChooseForYou",
      TrackingTitle: "MyPlan_Build_ChooseForYou"
  };

//print the plan from the week view
GMI.BAH.Tracking.PrintPlanWeek =
    { TrackingURL: "/Print/MyPlan/Week",
      TrackingTitle: "Print_MyPlan_Week"
  };

//print the plan from the day view
GMI.BAH.Tracking.PrintPlanDay =
    { TrackingURL: "/Print/MyPlan/Day",
      TrackingTitle: "Print_MyPlan_Day"
    };

//print all plan recipes from the plan week view
GMI.BAH.Tracking.PrintPlanWeekRecipes =
    { TrackingURL: "/Print/MyPlan/Week/Recipes",
      TrackingTitle: "Print_MyPlan_Week_Recipes"
    };

//print all plan recipes from the plan day view
GMI.BAH.Tracking.PrintPlanDayRecipes =
    { TrackingURL: "/Print/MyPlan/Day/Recipes",
        TrackingTitle: "Print_MyPlan_Day_Recipes"
    };

//print recipe from the plan page - select print on the recipe context menu
GMI.BAH.Tracking.PrintPlanRecipe =
    { TrackingURL: "/Print/MyPlan/Recipe",
      TrackingTitle: "Print_MyPlan_Recipe"
    };

//print recipe from the recipe details page
GMI.BAH.Tracking.PrintRecipeDetail =
    { TrackingURL: "/Print/Recipes/RecipeView",
      TrackingTitle: "Print_Recipe_Detail"
  };


//print shopping list by category view
GMI.BAH.Tracking.PrintShoppingListByCategory =
    { TrackingURL: "/Print/ShoppingList/ByCategory",
    TrackingTitle: "Print_ShoppingList_ByCategory"
};

//print shopping list by recipe view
GMI.BAH.Tracking.PrintShoppingListByRecipe =
    { TrackingURL: "/Print/ShoppingList/ByRecipe",
      TrackingTitle: "Print_ShoppingList_ByRecipe"
    };
    
//click to view recipe details from recipe box page - recipes are in the recipe box 
GMI.BAH.Tracking.RecipeViewFromRecipeBox =
    { TrackingURL: "/RecipeBox/RecipeDetailView",
      TrackingTitle: "RecipeBox_RecipeDetailView"
  };

//click to view recipe details from search results
GMI.BAH.Tracking.RecipeViewFromSearchResults =
    { TrackingURL: "/SearchResults/RecipeDetailView",
      TrackingTitle: "SearchResults_RecipeDetailView"
    };

//click to view recipe details from my plan page (week or day view) 
GMI.BAH.Tracking.RecipeViewFromMyPlan =
    { TrackingURL: "/MyPlan/RecipeDetailView",
      TrackingTitle: "MyPlan_RecipeDetailView"
  };

//click to view recipe details from quick search - typing search at top of all pages
GMI.BAH.Tracking.RecipeViewFromQuickSearch =
    { TrackingURL: "/QuickSearch/RecipeDetailView",
        TrackingTitle: "QuickSearch_RecipeDetailView"
    };

//click to view recipe details from top recipes on browse recipes page
GMI.BAH.Tracking.RecipeViewFromTopRecipes =
    { TrackingURL: "/TopRecipes/RecipeDetailView",
        TrackingTitle: "TopRecipes_RecipeDetailView"
    };

//click to view recipe details from featured recipes on browse recipes page
GMI.BAH.Tracking.RecipeViewFromFeaturedRecipes =
    { TrackingURL: "/FeaturedRecipes/RecipeDetailView",
        TrackingTitle: "FeaturedRecipes_RecipeDetailView"
    };

//click the thumbs up on a recipe anywhere in the site
GMI.BAH.Tracking.RecipeThumbsUp =
    { TrackingURL: "/Recipe/ThumbsUp",
        TrackingTitle: "Recipe_ThumbsUp"
  };

//click the thumbs up on a recipe anywhere in the site
GMI.BAH.Tracking.RecipeThumbsDown =
    { TrackingURL: "/Recipe/ThumbsDown",
      TrackingTitle: "Recipe_ThumbsDown"
  };

//hit (page load) on the home page as an anonymous
GMI.BAH.Tracking.HomePageAnonymous =
{ TrackingURL: "/HomePage/Anonymous",
    TrackingTitle: "HomePage_Anonymous"
};

//hit (page load) on the home page as a logged in user
GMI.BAH.Tracking.HomePageRegistered =
{ TrackingURL: "/HomePage/Registered",
    TrackingTitle: "HomePage_Registered"
};   
    
function trackAction(actionObject) {
    if (typeof (actionObject) != 'undefined') {
        if (typeof (actionObject.TrackingURL) != 'undefined') {
            dcsMultiTrack('DCS.dcsuri', actionObject.TrackingURL, 'WT.ti', actionObject.TrackingTitle);
        }
    }      
}
