<div id="passwort-reset">
	<h1 class="breaking-headline">{txt key=TEXT_PASSWORD_RESET_PAGE}</h1>
	{$message}
	{if $captcha_show != 'false'}
	<div class="box">
		{form type=form name=login action='dynamic' link_params='page_action=password_reset' method=post conn=SSL role="form"}

		{if $captcha eq 'true'}
		{form type=hidden name=action value=check_captcha}
		{/if}

		{form type=hidden name=link_target value=index}

		{if $captcha eq 'true'}
			<p>{txt key=TEXT_PASSWORD_RESET}</p>
		{else}
			<p>{txt key=TEXT_PASSWORD_RESET_WITHOUT_CAPTCHA}</p>
		{/if}

		{if $captcha eq 'true'}

			{if $smarty.const._STORE_CAPTCHA == 'ReCaptcha'}
				{assign var='recaptcha' value=true}
			{else}
				{assign var='recaptcha' value=false}
			{/if}

            {if $recaptcha eq 'true' || $recaptcha==true}

                <div class="form-group">
                    <label>{txt key=text_captcha}</label>
                    <div class="recaptcha-wrapper"></div>
                </div>

            {else}
                <p id="captcha-img">
                    <img id="captchaImg"
                        src="data:image/gif;base64,R0lGODlhAQABAID/AP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw=="
                        alt="{txt key=TEXT_CAPTCHA}"
                        class="img-responsive img-thumbnail" />
                </p>

                <div class="form-group">
                    <label>{txt key=text_captcha}</label>
                    {form type=text name=captcha maxlength='30'}
                </div>
            {/if}
		{/if}

        <div class="form-group">
			<label>{txt key=text_email}</label>
			{form type=text name=email maxlength='50'}
        </div>

		<p class="right">
            <button type="submit" class="btn btn-primary">{txt key=BUTTON_NEXT}</button>
        </p>

		{form type=formend}
	</div><!-- .box -->
	{/if}
</div><!-- #passwort-reset -->

<script>
	document.addEventListener('DOMContentLoaded', function () {
		const captchaImg = document.getElementById('captchaImg');
		if(captchaImg) {	setTimeout(function(captchaImg){ captchaImg.src = '{$captcha_link}'; }, 500, captchaImg);	}
	});
</script>
