/*
	Stempora Web Framework
	Copyright (c) 2002-2018 Stempora. 
	All rights reserved.
		web:  www.stempora.com
		mail: support@stempora.com				
*/

function newsletterResponse(form) {

	//check if captcha exists
	var captcha = form.find(".form-line-image_code"),
		email	= form.find(".form-line-email");

	if (!email.hasClass("error") && captcha.length && !captcha.hasClass("animated")){

		captcha.removeClass("d-none error").addClass("animated fadeInLeftBig");
		captcha.find(".form-line-error").remove();
		email.addClass("animated fadeOutRightBig");
	}

	setTimeout(function() {
		form.find(".form-line-error").addClass("animated fadeOutLeftBig");
	}, 20000);

}


function newsletterReset(form) {
	var captcha = form.find(".form-line-image_code"),
		email	= form.find(".form-line-email");

	if (captcha.length && email.length) {
		captcha.removeClass("animated fadeInLeftBig").addClass("d-none");
		email.removeClass("animated fadeOutRightBig");
	}
		
}