﻿$(document).ready(function () {
    $("#logo").click(function () {
        window.location = "/";
    });
    //Crossbrowser
    if ((BrowserDetect.browser == "Explorer") && (BrowserDetect.version < 8)) {
        $("#data").css("padding-bottom", "0px");
        $("#macFita").css("margin-left", "-173px");
    }

    $(".evento").livequery('click', function () {

        var codEvento = $(this).attr("id");

        $.ajax({
            type: 'GET',
            cache: false,
            url: '/Eventos/SelecionaEvento/?codEvento=' + codEvento,
            success: function (evento) {
                $("#txtProximoEvento").empty().html(evento);
                $('#divProximoEvento').dialog('open');
            }
        });

    });


    $(".dica").livequery('click', function () {

        var codTexto = $(this).attr("id");

        $.ajax({
            type: 'GET',
            cache: false,
            url: '/Cuidados/SelecionaDica/?codTexto=' + codTexto,
            success: function (dica) {
                $("#txtDica").empty().html(dica);
                $('#divDica').dialog('open');
            }
        });
    });


    $('#divProximoEvento').dialog({
        autoOpen: false,
        bgiframe: true,
        resizable: false,
        height: 400,
        width: 500,
        modal: true,
        overlay: {
            backgroundColor: '#000',
            opacity: 1
        },
        buttons: {
            'OK': function () {
                $(this).dialog('close');
            }
        },
        close: function () { $("#txtProximoEvento").empty(); }
    });

    $('#divDica').dialog({
        autoOpen: false,
        bgiframe: true,
        resizable: false,
        height: 450,
        width: 600,
        modal: true,
        overlay: {
            backgroundColor: '#000',
            opacity: 1
        },
        buttons: {
            'OK': function () {
                $(this).dialog('close');
            }
        },
        close: function () { $("#txtDica").empty(); }
    });
});
