<?php
////////////////////////////////////////////////////////////////////////
// Breeze Website Builder
// Copyright Silver Dolphin Solutions, LLC, Edward Lemmers, P.E.
// For licensing, see license.txt.
// Created: 9/25/2014	ELL
// Modified: 2/12/2015	ELL
// Added reCAPTCHA API v.2.
// Modified 5/24/2016 BAK
// Added image class for mollum
?>
<script language='javascript' type='text/javascript'>
	if ((document.getElementById('recaptcha_row') != null) && (document.getElementById('recaptcha_row') != "undefined") && (document.getElementById('captcha_type').value != 'recaptcha'))
		document.getElementById('recaptcha_row').style.display = 'none';
	if ((document.getElementById('recaptcha2_row') != null) && (document.getElementById('recaptcha2_row') != "undefined") && (document.getElementById('captcha_type').value != 'recaptcha2'))
		document.getElementById('recaptcha2_row').style.display = 'none';
	if ((document.getElementById('wscaptcha_row') != null) && (document.getElementById('wscaptcha_row') != "undefined") && (document.getElementById('captcha_type').value != 'wscaptcha'))
		document.getElementById('wscaptcha_row').style.display = 'none';
	if ((document.getElementById('mollomcaptcha_row') != null) && (document.getElementById('mollomcaptcha_row') != "undefined"))
	{
		if (document.getElementById('captcha_type').value != 'mollom')
			document.getElementById('mollomcaptcha_row').style.display = 'none';
		if (document.getElementById('captcha_type').value == 'mollom')
		{
			var captcha_html = "<img src='<?php echo $captcha['url']; ?>' alt='Type the characters you see in this picture.' class='mollom_image' />";
			var mollom_session = '<?php echo $captcha['session_id']; ?>';
			document.getElementById('mollom_captcha').innerHTML = captcha_html;
			document.getElementById('mollom_session').value = mollom_session;
		}
	}

	if ((document.getElementById('recaptcha_script') != null) && (document.getElementById('recaptcha_script') != "undefined"))
	{
		if ((document.getElementById("captcha_type").value == "recaptcha") && (document.getElementById("use_captcha").value == 1))
		{
			var captcha_challange_url = "http://www.google.com/recaptcha/api/challenge?k=" + recaptcha_public_key;
			document.getElementById("recaptcha_script").src = captcha_challange_url;
		}
	}
	
	if ((document.getElementById('recaptcha2_div') != null) && (document.getElementById('recaptcha2_div') != "undefined"))
	{
		if ((document.getElementById("captcha_type").value == "recaptcha2") && (document.getElementById("use_captcha").value == 1))
			document.getElementById("recaptcha2_div").setAttribute("data-sitekey", recaptcha_site_key);
		else if ((document.getElementById('recaptcha2_td') != null) && (document.getElementById('recaptcha2_td') != "undefined"))
			document.getElementById("recaptcha2_td").innerHTML = "";
	}
</script>