//debugger;
$(function() {
	$("#ctl00_uctlGlobalNavControl_txtSearch").mousedown(function() {
		
		$("#cntr_header_search").bind("mouseleave",function() {
			hideSearch();
		}).slideDown();
	});
	
	$(".link_poll_close").click(function() {
		$("#cntr_home_poll_close,#poll_view_results,#cntr_home_poll_select,#cntr_home_poll_results,#cntr_poll_view_results").hide();
		$("#cntr_home_poll_area").slideUp();
		$("#cntr_home_poll_notice").slideDown();
		$("#lnk_poll_vote").fadeIn();
		return false;
	});
	
	$("#lnk_poll_select").click(function() {
		$("#cntr_home_poll_notice").slideUp(function(){$("#cntr_home_poll_area").slideDown(function(){$("#cntr_home_poll_close,#cntr_poll_view_results,#cntr_home_poll_select,#cntr_poll_vote").fadeIn();});});
		return false;
	});
	
	$("#cntr_poll_view_results").click(function() {
		$("#cntr_home_poll_select,#cntr_poll_view_results,#cntr_poll_vote").fadeOut(function(){$("#cntr_home_poll_results").fadeIn();});
		return false;
	});
		
});

function hideSearch() {
	$("#cntr_header_search").slideUp();
}

function showResults() {
	setTimeout("showResultsUi()", 2000);
}


function showResultsUi() {
	$("#cntr_poll_view_results").hide();
	$("#lnk_poll_vote").hide(); 	
	$("#cntr_home_poll_select,#cntr_poll_view_results,#cntr_poll_vote").fadeOut(function(){$("#cntr_home_poll_results").fadeIn();});
	
	
	$("#lnk_poll_select").click(function() {
		$("#cntr_home_poll_notice").slideUp(function(){$("#cntr_home_poll_area").slideDown(function(){$("#cntr_home_poll_close,#cntr_poll_view_results,#cntr_home_poll_select,#cntr_poll_vote").fadeIn();});});
		return false;
	});
	
	$("#cntr_poll_view_results").click(function() {
		$("#cntr_home_poll_select,#cntr_poll_view_results,#cntr_poll_vote").fadeOut(function(){$("#cntr_home_poll_results").fadeIn();});
		return false;
	});
}




function getQueryStringValue(ji) 
{
    hu = window.location.search.substring(1);
    gy = hu.split("&");
    for (i=0;i<gy.length;i++) 
    {
        ft = gy[i].split("=");
        if (ft[0] == ji) 
        {
            return ft[1];
        }   
    }
}



/*
flavor forecast
*/

$(function() {
    flavor_forecast.init();
});

var flavor_forecast = {
    pairings: [
		{
		    description: "<b>Exciting layers of spicy and sour.</b> The combination of roasted ginger and rhubarb shakes up traditional barbecue sauces or chunky chutneys for roasted meats. Their tangy punch also accents grilled fish preparations and updated takes on favorite desserts.",
		    url: "/Recipes/Main-Dish/Hot-and-Sour-Tilapia-with-Gingered-Rhubarb-Sauce.aspx?icid=FF2010_Roasted-Ginger-and-Rhubarb_Hot-Sour-Tilapia-with-Gingered-Rhubarb-Sauce",
		    links: [
				{
				    text: "Roasted Ginger and Rhubarb Upside Down Cake",
				    url: "/Recipes/Desserts/Roasted-Ginger-and-Rhubarb-Upside-Down-Cake.aspx?icid=FF2010_Roasted-Ginger-and-Rhubarb_Roasted-Ginger-and-Rhubarb-Upside-Down-Cake"
				},
				{
				    text: "Hot &amp; Sour Tilapia with Gingered Rhubarb Sauce",
				    url: "/Recipes/Main-Dish/Hot-and-Sour-Tilapia-with-Gingered-Rhubarb-Sauce.aspx?icid=FF2010_Roasted-Ginger-and-Rhubarb_Hot-Sour-Tilapia-with-Gingered-Rhubarb-Sauce"
				}
			],
		    caption: "Hot &amp; Sour Tilapia with Gingered Rhubarb Sauce"
		},
		{
		    description: "<b>A sweet, refreshing balance.</b> A watermelon margarita spiked with Thai basil is a refreshing way to start a meal. Savor a cucumber, watermelon and Thai basil gazpacho or fresh salad, accented by salty feta cheese. Try intensifying the melon&rsquo;s sweetness even further by an unexpected quick trip to the grill, where watermelon accents light proteins like shrimp and fish.",
		    url: "/Recipes/Beverages/Thai-Basil-and-Watermelon-Slushie.aspx?icid=FF2010_Thai-Basil-and-Watermelons_Thai-Basil-and-Watermelon-Slushie",
		    links: [
				{
				    text: "Grilled Watermelon and Shrimp Skewers",
				    url: "/Recipes/Appetizers-Snacks/Grilled-Watermelon-and-Shrimp-Skewers.aspx?icid=FF2010_Thai-Basil-and-Watermelons_Grilled-Watermelon-and-Shrimp-Skewers"
				},
				{
				    text: "Thai Basil and Watermelon Slushie",
				    url: "/Recipes/Beverages/Thai-Basil-and-Watermelon-Slushie.aspx?icid=FF2010_Thai-Basil-and-Watermelons_Thai-Basil-and-Watermelon-Slushie"
				},
				{
				    text: "Watermelon Salad with Thai Basil and Feta",
				    url: "/Recipes/Salads/Watermelon-Salad-with-Thai-Basil-and-Feta.aspx?icid=FF2010_Thai-Basil-and-Watermelons_Watermelon-Salad-with-Thai-Basil-and-Feta"
				}				
			],
		    caption: ""
		},
		{
		    description: "<b>North meets South for a distinctive peppery bite.</b> Discover this combination in the company of grains or beans, in soups and stews, or in a brisket with caraway and horseradish. A quick saut&eacute; of just-wilted greens with garlic and olive oil makes a simple and satisfying side dish. Or, a peach and caraway-spiked dressing is a perfect match for a salad of grilled radicchio and endive.",
		    url: "/Recipes/Salads/Grilled-Bitter-Greens-with-Caraway-and-Peach.aspx?icid=FF2010_Caraway-and-Bitter-Greens_Grilled-Bitter-Greens-with-Caraway-Peach",
		    links: [
				{
				    text: "Arugula-Caraway Pesto Pasta",
				    url: "/Recipes/Main-Dish/Arugula-Caraway-Pesto-Pasta.aspx?icid=FF2010_Caraway-and-Bitter-Greens_Arugula-Caraway-Pesto-Pasta"
				},
				{
				    text: "Caraway Corn Risotto with Bitter Greens",
				    url: "/Recipes/Main-Dish/Caraway-Corn-Risotto-with-Bitter-Greens.aspx?icid=FF2010_Caraway-and-Bitter-Greens_Caraway-Corn-Risotto-with-Bitter-Greens"
				},
				{
				    text: "Grilled Bitter Greens with Caraway & Peach",
				    url: "/Recipes/Salads/Grilled-Bitter-Greens-with-Caraway-and-Peach.aspx?icid=FF2010_Caraway-and-Bitter-Greens_Grilled-Bitter-Greens-with-Caraway-Peach"
				}
			],
		    caption: "Grilled Bitter Greens with Caraway and Peach"
		},
		{
		    description: "<b>Slowly coaxed flavor worth the wait.</b> Perfect in a braised tagine or simple roast chicken, this duo is also beautiful with seafood, pasta and grains. Equally appealing in sweet applications, bay leaves are a subtle complement to preserved lemon gelato or rice pudding.",
		    url: "/Recipes/Main-Dish/Lemon-Bay-Tortellini-with-Spinach-and-Wild-Mushrooms.aspx?icid=FF2010_Bay-Leaf-and-Preserved-Lemon_Lemon-Bay-Tortellini-with-Spinach-Wild-Mushrooms",
		    links: [
				{
				    text: "Bay Leaf-Infused Preserved Lemons",
				    url: "/Recipes/Gravy-Sauce-Condiment/Bay-Leaf-Infused-Preserved-Lemons.aspx?icid=FF2010_Bay-Leaf-and-Preserved-Lemon_Bay-Leaf-Infused-Preserved-Lemons"
				},
				{
				    text: "Lemon Twist Rice Pudding",
				    url: "/Recipes/Desserts/Lemon-Twist-Rice-Pudding.aspx?icid=FF2010_Bay-Leaf-and-Preserved-Lemon_Lemon-Twist-Rice-Pudding"
				},
				{
				    text: "Simmered Moroccan Chicken with Preserved Lemon",
				    url: "/Recipes/Main-Dish/Simmered-Moroccan-Chicken-with-Preserved-Lemon.aspx?icid=FF2010_Bay-Leaf-and-Preserved-Lemon_Simmered-Moroccan-Chicken-with-Preserved-Lemon"
				},
				{
				    text: "Preserved Lemon Couscous",
				    url: "/Recipes/Side-Dish/Preserved-Lemon-Couscous.aspx?icid=FF2010_Bay-Leaf-and-Preserved-Lemon_Preserved-Lemon-Couscous"
				},
				{
				    text: "Roast Chicken with Preserved Lemon &amp; Bay Leaves",
				    url: "/Recipes/Main-Dish/Roast-Chicken-with-Preserved-Lemon-and-Bay-Leaves.aspx?icid=FF2010_Bay-Leaf-and-Preserved-Lemon_Roast-Chicken-with-Preserved-Lemon-Bay-Leaves"
				},
				{
				    text: "Lemon-Bay Tortellini with Spinach &amp; Wild Mushrooms",
				    url: "/Recipes/Main-Dish/Lemon-Bay-Tortellini-with-Spinach-and-Wild-Mushrooms.aspx?icid=FF2010_Bay-Leaf-and-Preserved-Lemon_Lemon-Bay-Tortellini-with-Spinach-Wild-Mushrooms"
				}
			],
		    caption: "Lemon-Bay Tortellini with Spinach &amp; Wild Mushrooms"
		},
		{
		    description: "<b>A congenial and cozy pair.</b> Blurring the lines between barroom and kitchen, the twosome works well together in any course &mdash; from cocktails and salads to meat entr&eacute;es and desserts. Chef-inspired interpretations include a gutsy marinade for pork and chicken, a lush twist for baked apples and even a grown-up almond-ale milkshake.",
		    url: "/Recipes/Main-Dish/Sloppy-Joe-Sliders.aspx?icid=FF2010_Almond-and-Ale_Sloppy-Joe-Sliders",
		    links: [
				{
				    text: "Almond-Ale Roasted Apples",
				    url: "/Recipes/Desserts/Ale-Almond-Roasted-Apples.aspx?icid=FF2010_Almond-and-Ale_Almond-Ale-Roasted-Apples"
				},
				{
				    text: "Almond-Ale Spritzer",
				    url: "/Recipes/Beverages/Almond-Ale-Spritzer.aspx?icid=FF2010_Almond-and-Ale_Almond-Ale-Spritzer"
				},
				{
				    text: "Sloppy Joe Sliders",
				    url: "/Recipes/Main-Dish/Sloppy-Joe-Sliders.aspx?icid=FF2010_Almond-and-Ale_Sloppy-Joe-Sliders"
				}
			],
		    caption: ""
		},
		{
		    description: "<b>A colorful, healthful blend that&rsquo;s always in season.</b> Incorporate this functional pairing in a turmeric-spiced grilled chicken topped with Indian-style tomato salsa, or make turmeric mayonnaise for a memorable BLT. Turmeric-tomato sauce adds a vibrant, nourishing layer on globally inspired flatbreads.",
		    url: "/Recipes/Main-Dish/Turmeric-Spiced-Chicken-with-Tomato-Avocado-Salsa.aspx?icid=FF2010_Turmeric-and-Vine-Ripened-Tomatoes_Turmeric-Spiced-Chicken-with-Tomato-Avocado-Salsa",
		    links: [
				{
				    text: "Grilled Indian-Spiced Flatbread",
				    url: "/Recipes/Main-Dish/Grilled-Indian-Spiced-Flatbread.aspx?icid=FF2010_Turmeric-and-Vine-Ripened-Tomatoes_Grilled-Indian-Spiced-Flatbread"
				},
				{
				    text: "Turmeric-Roasted Cauliflower and Tomatoes",
				    url: "/Recipes/Vegetables/Turmeric-Roasted-Cauliflower-and-Tomatoes.aspx?icid=FF2010_Turmeric-and-Vine-Ripened-Tomatoes_Turmeric-Roasted-Cauliflower-and-Tomatoes"
				},
				{
				    text: "Turmeric-Spiced Chicken with Tomato-Avocado Salsa",
				    url: "/Recipes/Main-Dish/Turmeric-Spiced-Chicken-with-Tomato-Avocado-Salsa.aspx?icid=FF2010_Turmeric-and-Vine-Ripened-Tomatoes_Turmeric-Spiced-Chicken-with-Tomato-Avocado-Salsa"
				}
			],
		    caption: "Turmeric-Spiced Chicken with Tomato-Avocado Salsa"
		},
		{
		    description: "<b>Comfortably exotic.</b> Chefs and home cooks like the duo&rsquo;s broad possibilities in a range of soups, sauces and sweets. On the grill, they&rsquo;re a full-bodied marinade for a Caribbean twist on chicken. For dessert, they offer a new take on mousse, cheesecake or bread pudding.",
		    url: "/Recipes/Desserts/Mix-and-Match-Spiced-Mousse-Minis.aspx?icid=FF2010_Pumpkin-Pie-Spice-and-Coconut-Milk_Mix-and-Match-Spiced-Mousse-Minis",
		    links: [
		        {
		            text: "Caribbean Chicken with Mango Coconut Sauce ",
		            url: "/Recipes/Main-Dish/Caribbean-Chicken-with-Mango-Coconut-Sauce.aspx?icid=FF2010_Pumpkin-Pie-Spice-and-Coconut-Milk_Caribbean-Chicken-with-Mango-Coconut-Sauce"
		        },
		         {
		             text: "Coconut Tres Leches Cake ",
		             url: "/Recipes/Desserts/Coconut-Tres-Leches-Cake.aspx?icid=FF2010_Pumpkin-Pie-Spice-and-Coconut-Milk_Coconut-Tres-Leches-Cake"
		         },
		          {
		              text: "Mix-and-Match Spiced Mousse Minis",
		              url: "/Recipes/Desserts/Mix-and-Match-Spiced-Mousse-Minis.aspx?icid=FF2010_Pumpkin-Pie-Spice-and-Coconut-Milk_Mix-and-Match-Spiced-Mousse-Minis"
		          },
		           {
		               text: "Spiced Hot Chocolate with Coconut Milk",
		               url: "/Recipes/Beverages/Spiced-Hot-Chocolate-with-Coconut-Milk.aspx?icid=FF2010_Pumpkin-Pie-Spice-and-Coconut-Milk_Spiced-Hot-Chocolate-with-Coconut-Milk"
		           },
		            {
		                text: "Warm Oatmeal with Pumpkin Pie Spice and Coconut Milk",
		                url: "/Recipes/Breakfast-Brunch/Warm-Oatmeal-with-Pumpkin-Pie-Spice-and-Coconut-Milk.aspx?icid=FF2010_Pumpkin-Pie-Spice-and-Coconut-Milk_Warm-Oatmeal-with-Pumpkin-Pie-Spice-and-Coconut-Milk"
		            },	
				{
				    text: "Pumpkin Pie Spiced Pina Colada ",
				    url: "/Recipes/Beverages/Pumpkin-Pie-Spiced-Pina-Colada.aspx?icid=FF2010_Pumpkin-Pie-Spice-and-Coconut-Milk_Pumpkin-Pie-Spiced-Pina-Colada"
				}
			],
		    caption: "Mix-and-Match Spiced Mousse Minis"
		},
		{
		    description: "<b>A warm and earthy Mediterranean duet.</b> Beyond playing an indispensible role in hummus and Indian curries, this globetrotting duo reinvents everything from French cassoulet to all-American pork and beans. Vegetarian dishes like a warm chickpea salad with roasted cumin vinaigrette or a cumin-spiked lentil and chickpea soup are a deeply satisfying main course.",
		    url: "/Recipes/Casseroles/Shepherds-Pie-with-Cumin-and-Smashed-Chickpeas.aspx?icid=FF2010_Roasted-Cumin-and-Chickpeas_Shepherds-Pie-with-Cumin-Smashed-Chickpeas",
		    links: [
				{
				    text: "Roasted Cumin and Chickpea Cassoulet",
				    url: "/Recipes/Main-Dish/Roasted-Cumin-and-Chickpea-Cassoulet.aspx?icid=FF2010_Roasted-Cumin-and-Chickpeas_Roasted-Cumin-and-Chickpea-Cassoulet"
				},
				{
				    text: "Warm Roasted Cumin &amp; Chickpea Salad",
				    url: "/Recipes/Salads/Warm-Roasted-Cumin-and-Chickpea-Salad.aspx?icid=FF2010_Roasted-Cumin-and-Chickpeas_Warm-Roasted-Cumin-Chickpea-Salad"
				},
				{
				    text: "Shepherd&rsquo;s Pie with Cumin &amp; Smashed Chickpeas",
				    url: "/Recipes/Casseroles/Shepherds-Pie-with-Cumin-and-Smashed-Chickpeas.aspx?icid=FF2010_Roasted-Cumin-and-Chickpeas_Shepherds-Pie-with-Cumin-Smashed-Chickpeas"
				}
			],
		    caption: "Shepherd&rsquo;s Pie with Cumin & Smashed Chickpeas"
		},
		{
		    description: "<b>Vibrant spirit of the Gulf Coast.</b> Swirling a bit of Creole mustard into batter for fried shellfish adds a welcome kick. Simply mixed with olive oil, lemon juice, honey and a few drops of hot sauce, a Creole mustard dressing is a knockout in a southern style ceviche. It also adds a zesty twist to reinterpretations of southern staples like fried green tomatoes.",
		    url: "/Recipes/Appetizers-Snacks/Fried-Green-Tomatoes-with-Crab-and-Creole-Mustard.aspx?icid=FF2010_Creole-Mustard-and-Shellfish_Fried-Green-Tomatoes-with-Crab-Creole-Mustard",
		    links: [
				{
				    text: "Shrimp with Remoulade Dipping Sauce",
				    url: "/Recipes/Appetizers-Snacks/Shrimp-with-Remoulade-Dipping-Sauce.aspx?icid=FF2010_Creole-Mustard-and-Shellfish_Shrimp-with-Remoulade-Dipping-Sauce"
				},
				{
				    text: "Big Easy Shrimp with Creamy Creole Mustard Sauce",
				    url: "/Recipes/Main-Dish/Big-Easy-Shrimp-with-Creamy-Creole-Mustard-Sauce.aspx?icid=FF2010_Creole-Mustard-and-Shellfish_Big-Easy-Shrimp-with-Creamy-Creole-Mustard-Sauce"
				},
				{
				    text: "Fried Green Tomatoes with Crab &amp; Creole Mustard",
				    url: "/Recipes/Appetizers-Snacks/Fried-Green-Tomatoes-with-Crab-and-Creole-Mustard.aspx?icid=FF2010_Creole-Mustard-and-Shellfish_Fried-Green-Tomatoes-with-Crab-Creole-Mustard"
				}
			],
		    caption: "Fried Green Tomatoes with Crab &amp; Creole Mustard"
		},
		{
		    description: "<b>Savory fusion of French and Asian cuisines.</b> Noodle bowls and marinades or dipping sauces for meat skewers are a natural choice to marry fish sauce and a liberal helping of chives. The pair also put a dynamic spin on red wine vinaigrette for fresh vegetable salads or drizzled on simply steamed fish.",
		    url: "/Recipes/Gravy-Sauce-Condiment/Thai-Style-Bolognese.aspx?icid=FF2010_Chives-and-Fish-Sauce_Thai-Style-Bolognese",
		    links: [
				{
				    text: "Asian Vegetables and Noodles with Peanut Sauce",
				    url: "/Recipes/Main-Dish/Asian-Vegetables-and-Noodles-with-Peanut-Sauce.aspx?icid=FF2010_Chives-and-Fish-Sauce_Asian-Vegetables-and-Noodles-with-Peanut-Sauce"
				},
				{
				    text: "Deconstructed Spring Roll Salad",
				    url: "/Recipes/Appetizers-Snacks/Deconstructed-Spring-Roll-Salad.aspx?icid=FF2010_Chives-and-Fish-Sauce_Deconstructed-Spring-Roll-Salad"
				},
				{
				    text: "Thai-Style &ldquo;Bolognese&rdquo;",
				    url: "/Recipes/Gravy-Sauce-Condiment/Thai-Style-Bolognese.aspx?icid=FF2010_Chives-and-Fish-Sauce_Thai-Style-Bolognese"
				}
			],
		    caption: ""
		}
	],
    init: function() {
        this.bind();
    },
    bind: function() {
        this.toggle();
    },
    toggle: function() {
        var obj = this;

        $("div#flavor_forecast div.left_ff ul a").mouseover(function() {
            var id = $(this).attr("id");
            id = id.split("pairing_item_");
            id = parseInt(id[1]) - 1;

            var links = "";

            for (var i = 0; obj.pairings[id].links[i]; i++)
                links += "<li><a href=\"" + obj.pairings[id].links[i].url + "\">" + obj.pairings[id].links[i].text + "</a></li>";

            $("#flavor_forecast .left_ff ul a").removeClass();
            $(this).addClass("active");

            $("div#flavor_forecast div#pairings").removeClass();
            $("div#flavor_forecast div#pairings").addClass("scheme_" + (id + 1)); //switch color scheme

            $("div#flavor_forecast div#pairings div#description div.top img").attr("src", "/MCC/images/flavor_forecast/title_" + (id + 1) + ".gif"); //switch title image
            $("div#flavor_forecast div#pairings div#description div.middle p").html(obj.pairings[id].description); //switch pairing description
            $("div#flavor_forecast div#pairings div#description div.bottom_ff ul").html(links); //switch pairing links

            $("div#flavor_forecast div#pairings div#image div.top a").attr("href", obj.pairings[id].url);           
            $("div#flavor_forecast div#pairings div#image div.top a img").attr("src", "/MCC/images/flavor_forecast/pairing_" + (id + 1) + ".jpg"); //switch recipe image
            $("div#flavor_forecast div#pairings div#image div.caption a").attr("href", obj.pairings[id].url);
            $("div#flavor_forecast div#pairings div#image div.caption a p").html(obj.pairings[id].caption) //switch recipe image caption
        });
    }
}
