﻿$(document).ready(function() {
    $('.mdlTabelaNutricional').jqm();
    $('.lnkTabelaNutricional').click(function() {
        $('.mdlTabelaNutricional').jqmShow();
    });

    $('.mdlEnviaPergunta').jqm();
    $('.lnkEnviePergunta').click(function() {
        $('.mdlEnviaPergunta').jqmShow();
    });


});

function exibeReceita(id) {

    $("div#receitas").find("[id*=receita]").each(function() {
        $(this).hide();
    });
    $("div#receitas>#receita" + id).show();
}

function adicionarIngrediente() {

    var html = "<li>";
    html += "    <ul class=\"tresColunas\">";
    html += "                    <li>";
    
    html += "                        <input name=\"ingrediente_medida\" id=\"ingrediente_medida\" type=\"text\" class=\"tam84\" />";
    html += "                    </li>";
    html += "                    <li>";
    
    html += "                        <input name=\"ingrediente_nome\" id=\"ingrediente_nome\" type=\"text\" class=\"tam84\" />";
    html += "                    </li>";
    html += "                </ul>";
    html += "            </li>";
    
    $("ul#ingredientes").append(html);
}

function adicionarPasso() {
    var i = 1;
    $("li#li-passos").find("[name=passo]").each(function() {
        i++;
    });

    var html = "     <label for=\"passo\" class=\"destaqueTexto\">";
    html += "         Passo " + i + "</label>";
    html += "     <div class=\"cb\">";
    html += "     </div>";
    html += "     <textarea name=\"passo\"></textarea>";

    $("li#li-passos").append(html);
}


function mostraCadastro() {
    if (Page_ClientValidate('Cadastro')) {
        $("div#receita").show();
        $("div#cadastro").hide();
    }
}
