function generateSecretSantaModal(){
        activateSecretSanta.onclick = function() {
            if (secretSantaNameBool && secretSantaIntBool) {
                secretSantaBtn.onclick = function () {
                    secretSantaBtn.innerHTML = "Click On Me To Deactivate Secret Santa";
                    removeSecretSantaNames();
                    updateAllUsersToDBSantaNames();
                    alert("The Secret Santa Has Been Deactivated!");
                    removeSecretSantaNums();
                    updateAllUsersToDBSantaNums();
                    secretSantaNameBool = false;
                    secretSantaModal.style.display = "none";
                    currentModalOpen = "";
                    generateSecretSantaModal();
                };

                secretSantaShuffle.onclick = function () {
                    initializeSecretSantaArrs();
                    removeSecretSantaNames();
                    createSecretSantaNames();
                    secretSantaNameBool = true;
                    alert("The Secret Santa has been shuffled!");
                };

                secretSantaBtn.innerHTML = "Click On Me To Deactivate Secret Santa";
                secretSantaShuffle.innerHTML = "Click Me To Shuffle Secret Santa Names!";

            } else if (secretSantaIntBool) {
                secretSantaBtn.onclick = function () {
                    secretSantaBtn.innerHTML = "Click On Me To Activate Secret Santa";
                    createSecretSantaNames();
                    alert("Secret Santa System Has Been Initialized. Enjoy!");
                    secretSantaNameBool = true;
                    secretSantaModal.style.display = "none";
                    currentModalOpen = "";
                    generateSecretSantaModal();
                };

                secretSantaShuffle.onclick = function(){
                    alert("Shuffle Button Not Available Until Secret Santa Is Active");
                };

                secretSantaBtn.innerHTML = "Click On Me To Activate Secret Santa";
                secretSantaShuffle.innerHTML = "Shuffle Button Not Available!";

            } else {
                secretSantaBtn.onclick = function () {
                    alert("Secret Santa Button Is Not Available Until 3 Or More Users Have Signed Up");
                };

                secretSantaShuffle.onclick = function(){
                    alert("Shuffle Button Not Available Until Secret Santa Is Active");
                };

                secretSantaBtn.innerHTML = "Secret Santa Not Available! Click Me For More Info!";
                secretSantaShuffle.innerHTML = "Shuffle Button Not Available!";
            }

            santaModalSpan.onclick = function(){
                secretSantaModal.style.display = "none";
                currentModalOpen = "";
            };

            window.onclick = function(event) {
                if (event.target == secretSantaModal) {
                    secretSantaModal.style.display = "none";
                    currentModalOpen = "";
                }
            };

            secretSantaModal.style.display = "block";
            currentModalOpen = "secretSantaModal";
        };

        activateSecretSanta.innerHTML = "Secret Santa";
    }
//This function initializes and generates a Secret Santa shuffle/activate modal
This function initializes and generates a Secret Santa shuffle/activate modal
This function initializes and generates a Secret Santa shuffle / activate modal
function generateSecretSantaModal(){
        activateSecretSanta.onclick = function() {
            if (secretSantaNameBool && secretSantaIntBool) {
                secretSantaBtn.onclick = function () {
                    secretSantaBtn.innerHTML = "Click On Me To Deactivate Secret Santa";
                    removeSecretSantaNames();
                    updateAllUsersToDBSantaNames();
                    alert("The Secret Santa Has Been Deactivated!");
                    removeSecretSantaNums();
                    updateAllUsersToDBSantaNums();
                    secretSantaNameBool = false;
                    secretSantaModal.style.display = "none";
                    currentModalOpen = "";
                    generateSecretSantaModal();
                };
                secretSantaShuffle.onclick = function () {
                    initializeSecretSantaArrs();
                    removeSecretSantaNames();
                    createSecretSantaNames();
                    secretSantaNameBool = true;
                    alert("The Secret Santa has been shuffled!");
                };
                secretSantaBtn.innerHTML = "Click On Me To Deactivate Secret Santa";
                secretSantaShuffle.innerHTML = "Click Me To Shuffle Secret Santa Names!";
            } else if (secretSantaIntBool) {
                secretSantaBtn.onclick = function () {
                    secretSantaBtn.innerHTML = "Click On Me To Activate Secret Santa";
                    createSecretSantaNames();
                    alert("Secret Santa System Has Been Initialized. Enjoy!");
                    secretSantaNameBool = true;
                    secretSantaModal.style.display = "none";
                    currentModalOpen = "";
                    generateSecretSantaModal();
                };
                secretSantaShuffle.onclick = function(){
                    alert("Shuffle Button Not Available Until Secret Santa Is Active");
                };
                secretSantaBtn.innerHTML = "Click On Me To Activate Secret Santa";
                secretSantaShuffle.innerHTML = "Shuffle Button Not Available!";
            } else {
                secretSantaBtn.onclick = function () {
                    alert("Secret Santa Button Is Not Available Until 3 Or More Users Have Signed Up");
                };
                secretSantaShuffle.onclick = function(){
                    alert("Shuffle Button Not Available Until Secret Santa Is Active");
                };
                secretSantaBtn.innerHTML = "Secret Santa Not Available! Click Me For More Info!";
                secretSantaShuffle.innerHTML = "Shuffle Button Not Available!";
            }
            santaModalSpan.onclick = function(){
                secretSantaModal.style.display = "none";
                currentModalOpen = "";
            };
            window.onclick = function(event) {
                if (event.target == secretSantaModal) {
                    secretSantaModal.style.display = "none";
                    currentModalOpen = "";
                }
            };
            secretSantaModal.style.display = "block";
            currentModalOpen = "secretSantaModal";
        };
        activateSecretSanta.innerHTML = "Secret Santa";
    }
function generateSecretSantaModal ( ) { activateSecretSanta . onclick = function ( ) { if ( secretSantaNameBool && secretSantaIntBool ) { secretSantaBtn . onclick = function ( ) { secretSantaBtn . innerHTML = "Click On Me To Deactivate Secret Santa" ; removeSecretSantaNames ( ) ; updateAllUsersToDBSantaNames ( ) ; alert ( "The Secret Santa Has Been Deactivated!" ) ; removeSecretSantaNums ( ) ; updateAllUsersToDBSantaNums ( ) ; secretSantaNameBool = false ; secretSantaModal . style . display = "none" ; currentModalOpen = "" ; generateSecretSantaModal ( ) ; } ; secretSantaShuffle . onclick = function ( ) { initializeSecretSantaArrs ( ) ; removeSecretSantaNames ( ) ; createSecretSantaNames ( ) ; secretSantaNameBool = true ; alert ( "The Secret Santa has been shuffled!" ) ; } ; secretSantaBtn . innerHTML = "Click On Me To Deactivate Secret Santa" ; secretSantaShuffle . innerHTML = "Click Me To Shuffle Secret Santa Names!" ; } else if ( secretSantaIntBool ) { secretSantaBtn . onclick = function ( ) { secretSantaBtn . innerHTML = "Click On Me To Activate Secret Santa" ; createSecretSantaNames ( ) ; alert ( "Secret Santa System Has Been Initialized. Enjoy!" ) ; secretSantaNameBool = true ; secretSantaModal . style . display = "none" ; currentModalOpen = "" ; generateSecretSantaModal ( ) ; } ; secretSantaShuffle . onclick = function ( ) { alert ( "Shuffle Button Not Available Until Secret Santa Is Active" ) ; } ; secretSantaBtn . innerHTML = "Click On Me To Activate Secret Santa" ; secretSantaShuffle . innerHTML = "Shuffle Button Not Available!" ; } else { secretSantaBtn . onclick = function ( ) { alert ( "Secret Santa Button Is Not Available Until 3 Or More Users Have Signed Up" ) ; } ; secretSantaShuffle . onclick = function ( ) { alert ( "Shuffle Button Not Available Until Secret Santa Is Active" ) ; } ; secretSantaBtn . innerHTML = "Secret Santa Not Available! Click Me For More Info!" ; secretSantaShuffle . innerHTML = "Shuffle Button Not Available!" ; } santaModalSpan . onclick = function ( ) { secretSantaModal . style . display = "none" ; currentModalOpen = "" ; } ; window . onclick = function ( event ) { if ( event . target == secretSantaModal ) { secretSantaModal . style . display = "none" ; currentModalOpen = "" ; } } ; secretSantaModal . style . display = "block" ; currentModalOpen = "secretSantaModal" ; } ; activateSecretSanta . innerHTML = "Secret Santa" ; }
This function initializes and generates a Secret Santa shuffle/activate modal
This function initializes and generates a Secret Santa shuffle / activate modal