﻿(function ($) { // encapsulated $
    $(function () { // Dom Ready Shortcut
        $(document).ready(function () {


            $("#btnSubmitNewsletter").click(function () {
                if ($("#pf_Name").val().length < 1) {
                    alert("You must enter a name to complete your newsletter signup.");
                    return false;
                }
                if ($("#pf_Mail").val().length < 1) {
                    alert("You must enter your email address to complete your newsletter signup.");
                    return false;
                }
            });

            $("#lnkNewsletter").click(function () {
                $("#newsletter").dialog({
                    bgiframe: true,
                    autoOpen: false,
                    position: [650, 100],
                    height: 300,
                    width: 300,
                    modal: true,
                    resizable: false,
                    overlay: { opacity: 0.5, background: 'black' }
                });
                $('#newsletter').dialog('open');
                return false;
            });

        });
    });
})(jQuery);       
