// JavaScript Document

//Set Captcha values
	var RecaptchaOptions = {
	   theme: 'custom',
	   lang: 'en',
	   custom_theme_widget: 'recaptcha_widget'
	};


function EmptyField(getField, getMessage){
//Checks that field isn't empty
	Field = document.getElementById(getField);
	if(Field.value == ""){
		Field.style.backgroundColor = '#f6f290';
		Field.scrollIntoView();
		alert(getMessage)
		Field.focus()
		
		return false
	}else{
		return true	
	}
}

function CheckNewletterForm(){
//Checks from before submision
	if(!EmptyField('firstname', 'Enter your first name.')){return false};
	if(!EmptyField('lastname', 'Enter your last name.')){return false};
	if(!EmptyField('email', 'Enter your email address.')){return false};
	//if(!EmptyField('recaptcha_response_field', 'Please confirm your submission.')){return false};

	return true

}


function ShowHideInline(getElem){
//Displays the content select area.  Note: 'inline' setting
	var ElemArea = document.getElementById(getElem);
	if(ElemArea.style.display == "inline"){
	  ElemArea.style.display = "none"; 
	} else {
		ElemArea.style.display = "inline"
	} 
}

function CaptchaShowHide(){
	ShowHideInline('recaptcha_widget')
	ShowHideInline('recaptcha_image')
	ShowHideInline('captcha_text')
}