
<script src="assets/js/custom.js" async=""></script>
<script>
    $('.subbtn').on("click", function() {
            event.preventDefault();
            $(this).attr('disabled', 'true');

            var FinalUrl = 'leadshooter.html';
            var form = $(this).closest('form');
            $.ajax({
                url: FinalUrl,
                type: 'POST',
                data: form.serialize(),
                success: function(data) {
                    if (data == 1) {
                        alert('Please Enter a valid Email Address');
                        $('.subbtn').removeAttr("disabled");
                    } else if (data == 2) {
                        alert('Please enter valid phone number');
                        $('.subbtn').removeAttr("disabled");
                    }else if (data == 3) {
                        alert('Name is required');
                        $('.subbtn').removeAttr("disabled");
                    } else if (data == 4) {
                        alert('Please agree to the Terms & Conditions');
                        $('.subbtn').removeAttr("disabled");
                    } 
                    else {
                        window.location = (data);
                    }
                }
            });
    });

    $(".phone_new").keydown(function(e) {
        if ($.inArray(e.keyCode, [46, 8, 9, 27, 13, 110, 190]) !== -1 ||
            (e.keyCode === 65 && (e.ctrlKey === true || e.metaKey === true)) ||
            (e.keyCode >= 35 && e.keyCode <= 40)) {
            return;
        }
        if ((e.shiftKey || (e.keyCode < 48 || e.keyCode > 57)) && (e.keyCode < 96 || e.keyCode > 105)) {
            e.preventDefault();
        }
    });

    $(".nav-bar li.dropdown").append("<span class='label label-important'>"+'</span>');
    $(document).on("click", ".nav-bar li.dropdown span.label" ,function(e){
        e.preventDefault();jQuery(this).prev().slideToggle();
    });

  </script>
<script>
    window.onload = function() {
        document.getElementById("imagePopup").style.display = "flex";
    };
    function closePopup(event) {
        if (event.target.id === "imagePopup") {
            document.getElementById("imagePopup").style.display = "none";
        }
    }
</script>