﻿
Sys.Application.add_load(ApplicationLoadHandler)
function ApplicationLoadHandler(sender, args) 
{
    //debugger;
    //attach event handlers
    for (n = 1; n <= 10; n++) {

        Sys.UI.DomEvent.addHandler($get('cntr_recipe_' + n), "mouseover", PairingClick);
    }

    SetOnStates('1'); 
}

function PairingClick(evt) {
    var param = evt.target.id.substring(12);
    SetOnStates(param);
	var txt;

	switch (param)
	{
	    case '1': txt = "<a href=\"/Recipes/Main-Dishes/Sesame-Root-Beer-Braised-Short-Ribs-with-Sweet-Potatoes.aspx\">Sesame Root Beer Braised Short Ribs and Sweet Potatoes</a><br /><br /><a href=\"/Recipes/Desserts/Toasted-Sesame-Root-Beer-Cake.aspx\" class=\"txt_linked\">Toasted Sesame Root Beer Cake</a>";
		break;
case '2': txt = "<a href=\"/Recipes/Main-Dishes/Spicy-Pulled-Pork-in-Tart-Cherry-Sauce-with-Vanilla-Slaw.aspx\">Spicy Pulled Pork in Tart Cherry Sauce<br />with Vanilla Slaw</a><br /><br /><a href=\"/Recipes/Desserts/Tart-Cherry-and-Pistachio-Fudge.aspx\" class=\"txt_linked\">Tart Cherry and Pistachio Fudge</a><br /><br /><a href=\"/Recipes/Breads-Muffins/Cayenne-Cherry-Studded-Corn-Muffins.aspx\" class=\"txt_linked\">Cayenne Cherry-Studded Corn Muffins</a><br /><br /><a href=\"/Recipes/Sides/Cayenne-Cherry-Spoon-Bread.aspx\" class=\"txt_linked\">Cayenne Cherry Spoon Bread</a>";
		break;
case '3': txt = "<a href=\"/Recipes/Appetizers-Snacks/Goat-Cheese-Beet-Ravioli-with-Tarragon-Orange-Sauce.aspx\">Goat Cheese Beet &quot;Ravioli&quot;<br />with Tarragon-Orange Sauce</a><br /><br /><a href=\"/Recipes/Salads/Roasted-Beet-and-Fennel-Salad-with-Vanilla-Tarragon-Vinaigrette.aspx\" class=\"txt_linked\">Roasted Beet &amp; Fennel Salad<br />with Vanilla Tarragon Vinaigrette</a>";
		break;
case '4': txt = "<a href=\"/Recipes/Main-Dishes/Peppercorn-Melange-Chicken-and-Udon-Noodles-in-Lemon-Grass-Sake-Broth.aspx\">Peppercorn M&eacute;lange Chicken and Udon<br />Noodles in Lemon Grass&ndash;Sake Broth</a><br /><br /><a href=\"/Recipes/Main-Dishes/Sake-Miso-Marinated-Steak-with-Peppercorn-Dipping-Sauce.aspx\" class=\"txt_linked\">Sake Miso Marinated Steak<br />with Peppercorn Dipping Sauce</a><br /><br /><a href=\"/Recipes/Beverages/Sake-Green-Tea-Martini-with-Crushed-Peppercorns.aspx\" class=\"txt_linked\">Sake Green Tea Martini<br />with Crushed Peppercorns</a>";
		break;
case '5': txt = "<a href=\"/Recipes/Salads/Mixed-Greens-with-Five-Spiced-Bacon-and-Poached-Egg.aspx\">Mixed Green Salad with Five-Spiced Bacon<br />and Poached Egg</a><br /><br /><a href=\"/Recipes/Vegetables/Sichuan-Green-Beans-with-Five-Spice-and-Pancetta.aspx\" class=\"txt_linked\">Sichuan&ndash;Style Green Beans with Five Spice<br />and Pancetta</a>";
		break;
case '6': txt = "<a href=\"/Recipes/Main-Dishes/Grilled-Scallops-and-Persimmon-with-Dill-Infused-Avocado-Oil.aspx\">Grilled Scallops and Persimmon<br />with Dill&ndash;Infused Avocado Oil</a><br /><br /><a href=\"/Recipes/Vegetables/Butternut-Squash-with-Dill-and-Avocado-Oil.aspx\" class=\"txt_linked\">Butternut Squash with Dill and Avocado Oil</a><br /><br /><a href=\"/Recipes/Main-Dishes/Dill-Infused-Shrimp-Scampi.aspx\" class=\"txt_linked\">Dill&ndash;Infused Shrimp Scampi</a>";
		break;
case '7': txt = "<a href=\"/Recipes/Desserts/Warm-Rosemary-Brie-Cake-with-Peach-Preserves.aspx\">Warm Rosemary Brie Cake<br />with Peach Preserves</a><br /><br /><a href=\"/Recipes/Desserts/Rosemary-Macaroon-Thumbprints.aspx\" class=\"txt_linked\">Rosemary Macaroon Thumbprints</a><br /><br /><a href=\"/Recipes/Main-Dishes/Rosemary-Fig-Glazed-Cornish-Hens.aspx\" class=\"txt_linked\">Rosemary Fig&ndash;Glazed Cornish Hens</a><br /><br /><a href=\"/Recipes/Desserts/Dark-Chocolate-Cupcakes-with-Blackberry-Filling-and-Chocolate-Ganache.aspx\" class=\"txt_linked\">Dark Chocolate Cupcakes with Blackberry Filling<br />and Chocolate Ganache</a>";
		break;
case '8': txt = "<a href=\"/Recipes/Main-Dishes/Pepita-Crusted-Halibut-with-Blood-Orange-Jicama-Chutney.aspx\">Pepita-Crusted Halibut<br />with Blood Orange Jicama Chutney</a><br /><br /><a href=\"/Recipes/Breads-Muffins/Pepita-Pumpkin-Bread.aspx\" class=\"txt_linked\">Pepita Pumpkin Bread</a><br /><br /><a href=\"/Recipes/Appetizers-Snacks/Indian-Spiced-Pepita-Snack-Mix.aspx\" class=\"txt_linked\">Indian&ndash;Spiced Pepita Snack Mix</a><br /><br /><a href=\"/Recipes/Gravy-Sauce-Condiment/Pepita-Pesto.aspx\" class=\"txt_linked\">Pepita Pesto</a><br /><br /><a href=\"/Recipes/Gravy-Sauce-Condiment/Pepita-Pesto.aspx\" class=\"txt_linked\">Pepita Pesto Pasta Salad</a>";
		break;
case '9': txt = "<a href=\"/Recipes/Main-Dishes/Rack-of-Lamb-with-Quinoa-Hazelnut-Crust-and-Mint-Pesto.aspx\">Rack of Lamb with Quinoa-Hazelnut Crust<br />and Mint Pesto</a><br /><br /><a href=\"/Recipes/Appetizers-Snacks/Smoked-Salmon-Blini-with-Mint-Creme-Fraiche.aspx\" class=\"txt_linked\">Smoked Salmon Blini with Mint Cr&egrave;me Fra&icirc;che</a><br /><br /><a href=\"/Recipes/Salads/Quinoa-Salad-with-Agave-Mint-Dressing.aspx\" class=\"txt_linked\">Quinoa Salad with Agave&ndash;Mint Dressing</a>";
		break;
case '10': txt = "<a href=\"/Recipes/Appetizers-Snacks/Smoked-Paprika-Shrimp-with-Poblano-Polenta-and-Red-Pepper-Agave-Sauce.aspx\">Smoked Paprika Shrimp with Poblano Polenta<br />and Red Pepper-Agave Sauce</a><br /><br /><a href=\"/Recipes/Appetizers-Snacks/Grilled-Fruit-Salsa-with-Lime-Tequila-and-Smoked-Paprika.aspx\" class=\"txt_linked\">Grilled Fruit Salsa with Lime, Tequila and Smoked</a><br /><br /><a href=\"/Recipes/Beverages/Smoky-Margarita.aspx\" class=\"txt_linked\">Smoky Margarita</a>";
		break;
	}

	var obj1 = $get("img_flavors");
	obj1.src = "/Gourmet/images/FlavorForecast/" + param + ".jpg";

	var obj2 = $get("img_pairing_1");
	//if (param != '6' && param != '9')
	    obj2.style.background = "url(/Gourmet/images/pairing_" + param + ".jpg)"
	
	var obj3 = $get("img_txt_lead");
	obj3.style.background = "url(/Gourmet/images/lead_" + param + ".gif)"
	
	if (param == '6')
	    obj3.style.height = "76px";
	else if (param == '8')
	    obj3.style.height = "140px";
	else
	    obj3.style.height = "132px";
	
	var obj4 = $get("txt_linked");
	obj4.innerHTML = txt;
}

function SetOnStates(param) 
{
    //debugger;
    for (n = 1; n <= 10; n++)
    {
        var anchor = document.getElementById('cntr_recipe_' + n);
        anchor.style.backgroundPosition = 'top';        
    }
    
    var anchor = document.getElementById('cntr_recipe_' + param);
    anchor.style.backgroundPosition = 'bottom';     

}



if (typeof (Sys) !== "undefined") Sys.Application.notifyScriptLoaded();