<!--
function addSubCats (subCats) {
	var myEle;
	var cats = document.getElementById('ddlSubCategory');
	cats.options.length = 0;
	for (var subCat=0; subCat<subCats.length; subCat++) {
		myEle = document.createElement("option") ;
		myEle.setAttribute('value',subCats[subCat].optionValue);
		var txt = document.createTextNode(subCats[subCat].optionText);
		myEle.appendChild(txt);
		cats.appendChild(myEle);
	}
    cats.disabled=false;
}
function moochained(parentDDL) {
	var parentDDL = document.getElementById('ddlTypeOfMeal');
	Setidtext();
	switch(parentDDL.options[parentDDL.selectedIndex].value)
	{
		case "70":
			addSubCats([{"optionValue":"0","optionText":"Select One"},{"optionValue":"345","optionText":"Cold Dips"},{"optionValue":"346","optionText":"Hot Dips"},{"optionValue":"264","optionText":"Cold Appetizers"},{"optionValue":"263","optionText":"Hot Appetizers"},{"optionValue":"179","optionText":"Spreads & Cheeseballs"},{"optionValue":"260","optionText":"Snacks & Nut Mixes"},{"optionValue":"181","optionText":"Crackers with Toppings"},{"optionValue":"183","optionText":"Tapas"}])
			break;
		case "78":
			addSubCats([{"optionValue":"0","optionText":"Select One"},{"optionValue":"242","optionText":"Soup, Chili & Stews"},{"optionValue":"245","optionText":"Pasta & Rice Salads"},{"optionValue":"246","optionText":"Vegetable Salads"},{"optionValue":"247","optionText":"Tossed Green Salads"},{"optionValue":"248","optionText":"Main Dish Salads"},{"optionValue":"572","optionText":"Fruit Salads"},{"optionValue":"568","optionText":"Potato Salads"},{"optionValue":"570","optionText":"Tuna & Chicken Salads"}])
			break;
		case "80":
			addSubCats([{"optionValue":"0","optionText":"Select One"},{"optionValue":"235","optionText":"Pastas"},{"optionValue":"236","optionText":"Potatoes & Stuffings"},{"optionValue":"237","optionText":"Rice & Grains"},{"optionValue":"238","optionText":"Vegetables"},{"optionValue":"241","optionText":"Beans"}])
			break;
		case "76":
			addSubCats([{"optionValue":"0","optionText":"Select One"},{"optionValue":"211","optionText":"Poultry"},{"optionValue":"213","optionText":"Beef, Ground"},{"optionValue":"214","optionText":"Beef, Other"},{"optionValue":"215","optionText":"Pork & Lamb"},{"optionValue":"216","optionText":"Fish & Seafood"},{"optionValue":"217","optionText":"Pasta"},{"optionValue":"218","optionText":"Pizza"},{"optionValue":"219","optionText":"Main Dish Salads"},{"optionValue":"220","optionText":"Meatless"},{"optionValue":"221","optionText":"Marinades, Sauces & Salsas"}])
			break;
		case "74":
			addSubCats([{"optionValue":"0","optionText":"Select One"},{"optionValue":"197","optionText":"Bar Cookies & Brownies"},{"optionValue":"198","optionText":"Drop or Shaped Cookies"},{"optionValue":"199","optionText":"Candies"},{"optionValue":"262","optionText":"Fruit Desserts"},{"optionValue":"202","optionText":"Pies"},{"optionValue":"203","optionText":"Pudding Desserts"},{"optionValue":"204","optionText":"Gelatin Desserts & Molds"},{"optionValue":"205","optionText":"Cheesecakes"},{"optionValue":"207","optionText":"Cakes & Cupcakes"},{"optionValue":"209","optionText":"Frozen Desserts"},{"optionValue":"210","optionText":"Sweet Dips & Sauces"}])
			break;
		case "71":
			addSubCats([{"optionValue":"0","optionText":"Select One"},{"optionValue":"184","optionText":"Hot Beverages"},{"optionValue":"187","optionText":"Cold Beverages"},{"optionValue":"188","optionText":"Shakes & Smoothies"},{"optionValue":"780","optionText":"Punches"}])
			break;			
		case "79":
			addSubCats([{"optionValue":"0","optionText":"Select One"},{"optionValue":"228","optionText":"Cold Sandwiches"},{"optionValue":"229","optionText":"Hot Sandwiches"},{"optionValue":"232","optionText":"Hot Dogs"}])
			break;			
		case "73":
			addSubCats([{"optionValue":"0","optionText":"Select One"},{"optionValue":"193","optionText":"Entrees"},{"optionValue":"194","optionText":"Sandwiches"},{"optionValue":"195","optionText":"Pancakes & Waffles"}])
			break;			
		case "72":
			addSubCats([{"optionValue":"0","optionText":"Select One"},{"optionValue":"189","optionText":"Coffeecakes & Quick Breads"},{"optionValue":"191","optionText":"Dinner Breads & Breadsticks"},{"optionValue":"252","optionText":"Muffins & Biscuits"}])
			break;			
		case "75":
			addSubCats([{"optionValue":"0","optionText":"Select One"},{"optionValue":"347","optionText":"Entrees"},{"optionValue":"348","optionText":"Desserts"},{"optionValue":"349","optionText":"Snacks"},{"optionValue":"560","optionText":"Beverages"}])
			break;			

	}
}
function Setidtext()
{
    var strValue;
    strValue = ''

    document.getElementById('idtext').value = '';

    if (document.getElementById('ddlTypeOfMeal').value != 0)
    {
        strValue = document.getElementById('ddlTypeOfMeal').options[document.getElementById('ddlTypeOfMeal').selectedIndex].text;
        
        strValue = strValue.replace(/î/g, '&#238')
        strValue = strValue.replace(/é/g, '&#233')
        strValue = strValue.replace(/û/g, '&#251')
        strValue = strValue.replace(/â/g, '&#226')
        strValue = strValue.replace(/'/g, '&#39')

        strValue = strValue.replace(/á/g, '&#225')
        strValue = strValue.replace(/ñ/g, '&#241')
        strValue = strValue.replace(/ú/g, '&#250')

        document.getElementById('idtext').value = strValue

    }

    if (document.getElementById('ddlSubCategory').value != 0)
    {
        strValue = document.getElementById('ddlSubCategory').options[document.getElementById('ddlSubCategory').selectedIndex].text
        strValue = strValue.replace(/î/g, '&#238')
        strValue = strValue.replace(/é/g, '&#233')
        strValue = strValue.replace(/û/g, '&#251')
        strValue = strValue.replace(/â/g, '&#226')
        strValue = strValue.replace(/'/g, '&#39')

        strValue = strValue.replace(/á/g, '&#225')
        strValue = strValue.replace(/ñ/g, '&#241')
        strValue = strValue.replace(/ú/g, '&#250')

        document.getElementById('idtext').value = document.getElementById('idtext').value + '|' + strValue
    }

}

window.addEvent('domready', init);
-->