<!--
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 "51":
			addSubCats([{"optionValue":"0","optionText":"Selecciona una"},{"optionValue":"265","optionText":"Salsas frías"},{"optionValue":"266","optionText":"Salsas calientes"},{"optionValue":"267","optionText":"Antojitos fríos"},{"optionValue":"268","optionText":"Antojitos calientes"},{"optionValue":"270","optionText":"Cremas para untar y bolas de queso"},{"optionValue":"271","optionText":"Bocaditos y surtido de nueces"},{"optionValue":"272","optionText":"Galletas con cubiertas"},{"optionValue":"274","optionText":"Tapas"}])
			break;
		case "61":
			addSubCats([{"optionValue":"0","optionText":"Selecciona una"},{"optionValue":"336","optionText":"Sopa, chili y guisados (estofados)"},{"optionValue":"339","optionText":"Ensaladas de pasta y de arroz"},{"optionValue":"340","optionText":"Ensaladas de vegetales"},{"optionValue":"341","optionText":"Ensaladas de lechuga variada"},{"optionValue":"342","optionText":"Ensaladas como plato principal"},{"optionValue":"573","optionText":"Ensaladas de frutas"},{"optionValue":"569","optionText":"Ensaladas de papas"},{"optionValue":"571","optionText":"Ensaladas de atún y de pollo"}])
			break;
		case "60":
			addSubCats([{"optionValue":"0","optionText":"Selecciona una"},{"optionValue":"329","optionText":"Pastas"},{"optionValue":"330","optionText":"Papas y rellenos"},{"optionValue":"331","optionText":"Arroces y granos"},{"optionValue":"332","optionText":"Vegetales"},{"optionValue":"335","optionText":"Frijoles (granos)"}])
			break;
		case "57":
			addSubCats([{"optionValue":"0","optionText":"Selecciona una"},{"optionValue":"304","optionText":"Aves"},{"optionValue":"306","optionText":"Carne de res, molida"},{"optionValue":"307","optionText":"Carne de res"},{"optionValue":"308","optionText":"Carne de puerco y cordero"},{"optionValue":"309","optionText":"Pescados y marisco"},{"optionValue":"310","optionText":"Pasta"},{"optionValue":"311","optionText":"Pizza"},{"optionValue":"312","optionText":"Ensaladas como plato principal"},{"optionValue":"313","optionText":"Platos sin carne"},{"optionValue":"314","optionText":"Marinados y salsas"}])
			break;
		case "55":
			addSubCats([{"optionValue":"0","optionText":"Selecciona una"},{"optionValue":"289","optionText":"Bizcochos y galleticas"},{"optionValue":"290","optionText":"Galletas con goticas o formas"},{"optionValue":"291","optionText":"Dulces"},{"optionValue":"292","optionText":"Postres con frutas"},{"optionValue":"294","optionText":"Pies (tartas)"},{"optionValue":"295","optionText":"Postres de pudín"},{"optionValue":"296","optionText":"Postres de gelatina y moldes"},{"optionValue":"297","optionText":"Cheesecakes"},{"optionValue":"299","optionText":"Pasteles y pastelitos (cupcakes)"},{"optionValue":"301","optionText":"Postres congelados"},{"optionValue":"302","optionText":"Salsas dulces y saladas"}])
			break;
		case "52":
			addSubCats([{"optionValue":"0","optionText":"Selecciona una"},{"optionValue":"275","optionText":"Bebidas calientes"},{"optionValue":"278","optionText":"Bebidas frías"},{"optionValue":"279","optionText":"Batidos y licuados"},{"optionValue":"781","optionText":"Ponches"}])
			break;		
		case "59":
			addSubCats([{"optionValue":"0","optionText":"Selecciona una"},{"optionValue":"322","optionText":"Sándwiches fríos"},{"optionValue":"323","optionText":"Sándwiches calientes"},{"optionValue":"326","optionText":"Perros calientes (hot dogs)"}])
			break;		
		case "54":
			addSubCats([{"optionValue":"0","optionText":"Selecciona una"},{"optionValue":"285","optionText":"Platos principales"},{"optionValue":"286","optionText":"Sándwiches"},{"optionValue":"287","optionText":"Panqueques y waffles"}])
			break;		
		case "53":
			addSubCats([{"optionValue":"0","optionText":"Selecciona una"},{"optionValue":"280","optionText":"Pasteles para el desayuno y panes rápidos de preparar"},{"optionValue":"282","optionText":"Panes para acompañar la comida y palitos de pan"},{"optionValue":"253","optionText":"Panecillos dulces y panecillos"},{"optionValue":"255","optionText":"Pan de levadura"}])
			break;		
		case "56":
			addSubCats([{"optionValue":"0","optionText":"Selecciona una"},{"optionValue":"350","optionText":"Platos principales"},{"optionValue":"351","optionText":"Postres"},{"optionValue":"352","optionText":"Bocaditos"},{"optionValue":"561","optionText":"Bebidas"}])
			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);
-->