// ======= BEGIN WIDGET API ======================================================================= // displays the widget and handles page parameters widgetShow = function() {widgetIFrames();} //adds a recipe to the widget user's recipe box widget_addToRecipeBox = function(id) {if(id) direct_widget('addRecipeBox=' + id);} //begins the process of adding a recipe to the widget user's planner widget_addToMealPlan = function(id) {if(id) direct_widget('addMealPlan=' + id);} // adds a recipe to the user's shopping list widget_addRecipeToShopList = function(id) {if(id) direct_widget('addRecShopList=' + id);} // adds an ingredient to the user's shopping list widget_addIngredientToShopList = function(id) {if(id) direct_widget('addIngredShopList=' + id);} //shows a recipe detail page in the widget widget_recipeDetail = function(id) {if(id) direct_widget('recipe=' + id);} // shows a recipe search page in the widget widget_recipeSearch = function(str) {if(str && str.length > 0) direct_widget('search=' + escapeURI(str));} // shows the promotions landing page in the widget widget_showCoupons = function() {direct_widget('show=coupons');} // shows a promotion detail page in the widget widget_couponDetail = function(id) {if(id) direct_widget('coupon=' + id);} // shows the results from recipe landing search in the widget widget_recipeLanding = function(name) {if(name) direct_widget('recipeGroup=' + name);} // shows results of recipes for a promotion in the widget widget_recipesForPromotion = function(id) {if(id) direct_widget('recipePromotion=' + id);} // adds a planner group to the widget widget_addPlannerGroup = function(id) {if(id) direct_widget('planner=' + id);} // ======= END WIDGET API ======================================================================= var _sessionId = '7EC4D3D8253D0453EACF4630D8260C78.lowesapp02east1b'; //this function will create an iframe with the widget using any "deep link" params on the current url. function widgetIFrames() { var url = ""; var urlPg = '' + document.location; var endFile = urlPg.indexOf("?"); var prms = 'widget.jsp;jsessionid=' + _sessionId + (endFile > 0? urlPg.substr(endFile) : ''); try {url = widget_url + '/' + prms;} catch(x) {} if(url) { var s = '