﻿$(function () {
    $(".tx-busca").bind({
        focus: function () {
            if ($(this).val() == "Digite aqui o produto que desejado...") {
                $(this).val("")
            }
        },
        blur: function () {
            if ($(this).val() == "") {
                $(this).val("Digite aqui o produto que desejado...")
            }
        }
    });

    if ($('.pix_diapo > div').size() > 0) {
        $('.pix_diapo > div').css('display', 'none');
        $('.pix_diapo').diapo({
            thumbs: false,
            commands: false,
            loader: "none",
            navigation: false,
            pauseOnClick: false,
            time: 4000,
            fx: "blindCurtainTopLeft, blindCurtainTopRight, blindCurtainBottomLeft, blindCurtainBottomRight, blindCurtainSliceBottom, blindCurtainSliceTop",
            rows: 6,
            cols: 10,
            transPeriod: 1500
        });
    }
    (function ($) {
        $.fn.vAlign = function (altura) {
            return this.each(function (i) {
                var ah = $(this).height();
                var ph = altura;
                var mh = (ph - ah) / 2;
                if (ah >= ph) {
                    $(this).css('margin-top', 0);
                } else {
                    $(this).css('margin-top', mh);
                }
            });
        };
    })(jQuery);
});
function excluir(href, texto) {
    $("#dialog-message").attr("title", "Confirmação de exclusão");
    $("#dialog-message span").next().html(texto);
    $("#dialog-message").dialog({
        resizable: false,
        modal: true,
        buttons: {
            "Excluir": function () {
                $(this).dialog("close");
                location.href = href;
            },
            "Cancelar": function () {
                $(this).dialog("close");
            }
        },
        draggable: false
    });
}

function modal() {
    $("#dialog-message").dialog({
        modal: true,
        buttons: {
            Ok: function () {
                $(this).dialog("close");
            }
        },
        resizable: false,
        draggable: false
    });
}

