﻿function Sucesso() {
    document.location.reload();
}
function SetResult(data) {
    $(document).ready(function () {
        $("#status").addClass(data.Class).text(data.Mensagem);
    });
}

//function HideDiv() {
//    if ($("#status").is(':visible')) {
//        $("#status").hide();
//    }
//}
//setInterval(HideDiv, 15000);

function mycarousel_initCallback(carousel) {
            carousel.buttonNext.bind('click', function () {
                carousel.startAuto(0);
            });
            carousel.buttonPrev.bind('click', function () {
                carousel.startAuto(0);
            });
            carousel.clip.hover(function () {
                carousel.stopAuto();
            }, function () {
                carousel.startAuto();
            });
        };

$(document).ready(function () {

if ($('#s3slider').is(":visible")) {
    $('#s3slider').s3Slider({
        timeOut: 5000
    });
}
if ($('#mycarousel').is(":visible")) {
$('#mycarousel').jcarousel({
                auto: 4,
                wrap: 'last',
                initCallback: mycarousel_initCallback
            });
            }

if ($('ul.sf-menu').is(":visible")) {
            $('ul.sf-menu').superfish({
                delay: 200,
                speed: 'fast',
                dropShadows: false
            });
            }

$("#data").datepicker({
                dateFormat: 'dd/mm/yy',
                dayNames: ['Domingo', 'Segunda', 'Terça', 'Quarta', 'Quinta', 'Sexta', 'Sábado', 'Domingo'],
                dayNamesMin: ['D', 'S', 'T', 'Q', 'Q', 'S', 'S', 'D'],
                dayNamesShort: ['Dom', 'Seg', 'Ter', 'Qua', 'Qui', 'Sex', 'Sáb', 'Dom'],
                monthNames: ['Janeiro', 'Fevereiro', 'Março', 'Abril', 'Maio', 'Junho', 'Julho', 'Agosto', 'Setembro', 'Outubro', 'Novembro', 'Dezembro'],
                monthNamesShort: ['Jan', 'Fev', 'Mar', 'Abr', 'Mai', 'Jun', 'Jul', 'Ago', 'Set', 'Out', 'Nov', 'Dez'],
                nextText: 'Próximo',
                prevText: 'Anterior'
            });

        $("a[rel^='prettyPhoto']").prettyPhoto({
            			animation_speed: 'fast',
                        slideshow: false,
                        autoplay_slideshow: false,
                        opacity: 0.80,
                        show_title: false,
                        allow_resize: true,
                        default_width: 600,
                        default_height: 338,
                        theme: 'light_rounded', /* light_rounded / dark_rounded / light_square / dark_square / facebook */
                        hideflash: false,
                        wmode: 'opaque',
                        autoplay: false,
                        modal: true, /* If set to true, only the close button will close the window */
                        overlay_gallery: true, /* If set to true, a gallery will overlay the fullscreen image on mouse over */
                        keyboard_shortcuts: false, /* Set to false if you open forms inside prettyPhoto */
                        
		});


    $('.Ativar').click(function () {
        if (confirm($(this).attr('rel'))) {
            var $link = $(this);
            $.ajax({
                url: this.href,
                type: 'DELETE',
                success: function (result) {
                    location.reload();
                }
            });
        }
        return false;
    });

    $('.Deletar').click(function () {
        if (confirm($(this).attr('rel'))) {
            var $link = $(this);
            $.ajax({
                url: this.href,
                type: 'DELETE',
                success: function (result) {
                    location.reload();
                }
            });
        }
        return false;
    });

    $('.Resete').click(function () {
        if (confirm($(this).attr('rel'))) {
            var $link = $(this);
            $.ajax({
                url: this.href,
                type: 'DELETE',
                success: function (result) {
                    location.reload();
                }
            });
        }
        return false;
    });
});
