$(document).ready(function() {

    if($('.captcha-holder').length > 0) {

        $('.captcha-holder').iconCaptcha({
            captchaTheme: ["light", "dark"], // Select the theme(s) of the Captcha(s). Available: light, dark
            captchaFontFamily: '', // Change the font family of the captcha. Leaving it blank will add the default font to the end of the <body> tag.
            captchaClickDelay: 500, // The delay during which the user can't select an image.
            captchaHoverDetection: true, // Enable or disable the cursor hover detection.
            enableLoadingAnimation: true, // Enable of disable the fake loading animation. Doesn't actually do anything other than look nice.
            loadingAnimationDelay: 1500, // How long the fake loading animation should play.
            showCredits: 'show', // Show, hide or disable the credits element. Valid values: 'show', 'hide', 'disabled' (please leave it enabled).
            requestIconsDelay: 1500, // How long should the script wait before requesting the hashes and icons? (to prevent a high(er) CPU usage during a DDoS attack)
            captchaAjaxFile: '/iconcaptcha/validateiconcaptcha', // The path to the Captcha validation file.
            captchaMessages: { // You can put whatever message you want in the captcha.
                header: "Sélectionnez l'image qui est différente des autres",
                correct: {
                    top: "Ok!",
                    bottom: "Vous n'êtes pas un robot"
                },
                incorrect: {
                    top: "Oops!",
                    bottom: "Vous avez sélectionné la mauvaise image."
                }
            }
        })
    }
});
