<!--
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 "726":
			addSubCats([{"optionValue":"0","optionText":"Select One"},{"optionValue":"872","optionText":"Appetizer"},{"optionValue":"873","optionText":"Beef"},{"optionValue":"874","optionText":"Chicken"},{"optionValue":"875","optionText":"Fish"},{"optionValue":"876","optionText":"Marinade/Sauce"},{"optionValue":"877","optionText":"Meatless"},{"optionValue":"878","optionText":"One Pot Meals"},{"optionValue":"879","optionText":"Pasta/Rice"},{"optionValue":"880","optionText":"Pork"},{"optionValue":"881","optionText":"Salad"},{"optionValue":"882","optionText":"Side Dish"},{"optionValue":"883","optionText":"Soup"}])
			break;
		case "727":
			addSubCats([{"optionValue":"0","optionText":"Select One"},{"optionValue":"866","optionText":"Beverage"},{"optionValue":"867","optionText":"Entrée"},{"optionValue":"868","optionText":"Main Meal Salad"},{"optionValue":"869","optionText":"Sandwich"},{"optionValue":"870","optionText":"Side Salad"},{"optionValue":"871","optionText":"Soup"}])
			break;
		case "724":
			addSubCats([{"optionValue":"0","optionText":"Select One"},{"optionValue":"861","optionText":"Beverage"},{"optionValue":"862","optionText":"Bread/Muffin"},{"optionValue":"863","optionText":"Cereal"},{"optionValue":"864","optionText":"Entrée"},{"optionValue":"865","optionText":"Jam/Jelly"}])
			break;
		case "725":
			addSubCats([{"optionValue":"0","optionText":"Select One"},{"optionValue":"892","optionText":"Cake"},{"optionValue":"893","optionText":"Cheesecakes"},{"optionValue":"894","optionText":"Cookie"},{"optionValue":"895","optionText":"Frozen"},{"optionValue":"896","optionText":"No-bake"},{"optionValue":"897","optionText":"Pie"},{"optionValue":"898","optionText":"Sauce"},{"optionValue":"899","optionText":"Square"}])
			break;
		case "728":
			addSubCats([{"optionValue":"0","optionText":"Select One"},{"optionValue":"884","optionText":"Cookies"},{"optionValue":"885","optionText":"Cracker Snacks"},{"optionValue":"886","optionText":"JELL-O Snacks"},{"optionValue":"887","optionText":"Muffins"},{"optionValue":"888","optionText":"Snack Mixes"},{"optionValue":"889","optionText":"Squares"}])
			break;
		case "723":
			addSubCats([{"optionValue":"0","optionText":"Select One"},{"optionValue":"890","optionText":"Cold"},{"optionValue":"891","optionText":"Hot"}])
			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')
        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')
        document.getElementById('idtext').value = document.getElementById('idtext').value + '|' + strValue
    }

}

window.addEvent('domready', init);
-->