// source --> https://www.deinestadtklebt.de/wp-content/plugins/magic-tooltips-for-contact-form-7-pro/assets/js/custom.js?ver=1.0.64.098 
(function($, window, document) {

	var qtipEvents = {
		hide: function(event, api) {
			// prevent auto hide for youtube video
			// if(event.type == 'mouseout' && event.originalEvent && event.originalEvent.target && event.originalEvent.target.tagName == 'IFRAME') {
			// 	event.preventDefault();
			// }
			// else if(event.type == 'blur' && event.originalEvent && event.originalEvent.target && event.originalEvent.target.activeElement && event.originalEvent.target.activeElement.tagName == 'IFRAME') {
			// 	event.preventDefault();
			// }
			var mmtcc = $(event.currentTarget).closest('.mm-tooltip-cf7-container');
			if(mmtcc && mmtcc.hasClass && mmtcc.hasClass('mm-tooltip-pin-enabled')) {
				event.preventDefault();
			}
			// console.log('mmtcc', mmtcc, $(event.currentTarget), event);
		},
	};

	function mtfcf7p_get_tooltip_content(jqTip) {

		var html = jqTip.attr('id') ? $('#'+jqTip.attr('id')+'_content').html() : jqTip.html();
		if(jqTip && jqTip.attr('title')) {
			html = '<h6 class="mm-tooltip-title">'+ jqTip.attr('title')+'</h6><div class="mm-tooltip-content">'+html+'</div>';
			//<a class="close">×</a>
		} else {
			html = '<div class="mm-tooltip-content mm-no-title">'+html+'</div>';
		}
		html = html + '<div class="mm-tooltip-pin"><i class="fa fa-thumb-tack"></i><div>';
		return html;

	}

	function mtfcf7_init_close_button() {
		$(document).on('click', '.mm-tooltip-title .close', function(){
			$(this).closest('.qtip').hide();
		});
	}

	function mtfcf7_is_submit_button($that) {
		// console.log($that.closest('.mm-tooltip-cf7-li').length);
		// console.log($that.closest('.mm-tooltip-cf7-li').find('input[type="submit"]'))
		return $that.parent().find('input[type="submit"]').length > 0;
	}

	$(document).on('click', '.mm-tooltip-pin', function(){
		$(this).closest('.mm-tooltip-cf7-container').toggleClass('mm-tooltip-pin-enabled');
		// console.log($(this));
	});

	$(document).ready(function() {
		if(!window.mtfcf7p) return;
		var mobileDetect = {};
		!function(a){var b=/iPhone/i,c=/iPod/i,d=/iPad/i,e=/(?=.*\bAndroid\b)(?=.*\bMobile\b)/i,f=/Android/i,g=/(?=.*\bAndroid\b)(?=.*\bSD4930UR\b)/i,h=/(?=.*\bAndroid\b)(?=.*\b(?:KFOT|KFTT|KFJWI|KFJWA|KFSOWI|KFTHWI|KFTHWA|KFAPWI|KFAPWA|KFARWI|KFASWI|KFSAWI|KFSAWA)\b)/i,i=/Windows Phone/i,j=/(?=.*\bWindows\b)(?=.*\bARM\b)/i,k=/BlackBerry/i,l=/BB10/i,m=/Opera Mini/i,n=/(CriOS|Chrome)(?=.*\bMobile\b)/i,o=/(?=.*\bFirefox\b)(?=.*\bMobile\b)/i,p=new RegExp("(?:Nexus 7|BNTV250|Kindle Fire|Silk|GT-P1000)","i"),q=function(a,b){return a.test(b)},r=function(a){var r=a||navigator.userAgent,s=r.split("[FBAN");if("undefined"!=typeof s[1]&&(r=s[0]),s=r.split("Twitter"),"undefined"!=typeof s[1]&&(r=s[0]),this.apple={phone:q(b,r),ipod:q(c,r),tablet:!q(b,r)&&q(d,r),device:q(b,r)||q(c,r)||q(d,r)},this.amazon={phone:q(g,r),tablet:!q(g,r)&&q(h,r),device:q(g,r)||q(h,r)},this.android={phone:q(g,r)||q(e,r),tablet:!q(g,r)&&!q(e,r)&&(q(h,r)||q(f,r)),device:q(g,r)||q(h,r)||q(e,r)||q(f,r)},this.windows={phone:q(i,r),tablet:q(j,r),device:q(i,r)||q(j,r)},this.other={blackberry:q(k,r),blackberry10:q(l,r),opera:q(m,r),firefox:q(o,r),chrome:q(n,r),device:q(k,r)||q(l,r)||q(m,r)||q(o,r)||q(n,r)},this.seven_inch=q(p,r),this.any=this.apple.device||this.android.device||this.windows.device||this.other.device||this.seven_inch,this.phone=this.apple.phone||this.android.phone||this.windows.phone,this.tablet=this.apple.tablet||this.android.tablet||this.windows.tablet,"undefined"==typeof window)return this},s=function(){var a=new r;return a.Class=r,a};"undefined"!=typeof module&&module.exports&&"undefined"==typeof window?module.exports=r:"undefined"!=typeof module&&module.exports&&"undefined"!=typeof window?module.exports=s():"function"==typeof define&&define.amd?define("isMobile",[],a.isMobile=s()):a.isMobile=s()}(mobileDetect);
		
		var mtfcf7p_js_code = {};
		var mtfcf7p_css_code = '';

		if(mobileDetect.isMobile.phone) {
			if(mtfcf7p_settings.disable_on_mobile == '1') {
        return;
      }
			mtfcf7p_js_code = mtfcf7p.js_code_phone ? mtfcf7p.js_code_phone : mtfcf7p.js_code;
			mtfcf7p_css_code = mtfcf7p.css_code_phone ? mtfcf7p.css_code_phone : mtfcf7p.css_code;
		}
		else if(mobileDetect.isMobile.tablet) {
			if(mtfcf7p_settings.disable_on_tablet == '1') {
        return;
      }
			mtfcf7p_js_code = mtfcf7p.js_code_pad ? mtfcf7p.js_code_pad : mtfcf7p.js_code;
			mtfcf7p_css_code = mtfcf7p.css_code_pad ? mtfcf7p.css_code_pad : mtfcf7p.css_code;
		}
		else {
			if(mtfcf7p_settings.disable_on_pc == '1') {
        return;
      }
			mtfcf7p_js_code = mtfcf7p.js_code;
			mtfcf7p_css_code = mtfcf7p.css_code;
		}
		eval('var tooltip_code = ' + mtfcf7p_js_code);

		var $container = $('<style id="mtfcf7p-tooltip-css" type="text/css"></style>').appendTo("body");
	  $container.text(mtfcf7p_css_code+mtfcf7p_settings.custom_css);

	  

		window.mtfcf7_reinit_tooltip = function(){

			if(typeof(mtfcf7p_settings.is_valid_license_key)=='undefined') {
				// console.log('not mtfcf7p_settings found ');
				return;
			}
			// console.log('mtfcf7p_settings', mtfcf7p_settings);
			if(!(parseInt(mtfcf7p_settings.is_valid_license_key) == 1)) {
				return;
			}

			$('.wpcf7 tip').each(function(index) {
			  	$that = $(this);
			  	// console.log('mtfcf7p_settings', mtfcf7p_settings);
				$desc = mtfcf7p_get_tooltip_content($that);
				var extraHTML = '';
				var qm = mtfcf7p_settings.default_icon ? ' <i class="'+mtfcf7p_settings.default_icon+'"></i>' : ' <i class="fa fa-question-circle"></i>';
				var is_submit_button = mtfcf7_is_submit_button($that);
				var submit_button_mode = parseInt($that.attr('mode') || 1);
				// console.log('submit_button_mode', submit_button_mode);
				if((mtfcf7p_settings && mtfcf7p_settings.add_icon && submit_button_mode != 2) || (is_submit_button && submit_button_mode == 1) ){
					  extraHTML = qm;
					//   console.log('extraHTML', extraHTML);
			  	}
			  	// $parentHTML = $that.parent().html();
			  	// console.log('parentHTML', $parentHTML+"");
			  	// $parentHTML = $parentHTML.replace(/<br\s*\/?>\s*<tip>/gi,'<tip>');
			  	
				// $parentHTML = $parentHTML.replace('<tip>',extraHTML+'</label-magic>'+'<tip>');

				

				
				
				$parent = $that.parent();
				// console.log('.wpcf7 tip', $that, $desc, $parent);
				
				// console.log('desc', $desc, $that);
				if($desc.length > 0){
					// if($that.prev().is("label-magic")) return;
					if(!$parent.is("form") && $parent.find('label-magic').length > 0) return;
					// console.log('desc2', $desc, $that);
					if(mtfcf7p_settings && mtfcf7p_settings.mouse_over && !$parent.is("form")) {
						$parentHTML = $that.parent().html().replace('<tip',extraHTML+'</label-magic>'+'<tip');
						// console.log('$parentHTML', $parentHTML);
						$parent.html('<label-magic>'+$parentHTML);
						// console.log('$parent', $parent, $parent.parent());
						$that2 = $parent.find('label-magic');
					} else {
						$that2 = $('<label-magic>'+extraHTML+'</label-magic>').insertBefore($that);
					}
					
					// $parent.html('<label-magic>'+$parentHTML);
					
					// console.log('label-magic', $that2);
					if($that2.hasClass('mm-tooltip-cf7') || $that2.parent().hasClass('mm-tooltip-cf7-li')) {
						return;
					}
					// console.log('label-magic2', $that2, $that2.parent(), $that2.parent().prev(), $that2.parent().parent(), $that2.parent().parent().hasClass('first'));

					// if($that2.parent().parent().hasClass('first')) {
					// 	$that2.parent().remove();
					// }
					
					// console.log('label-magic', $that2);
					if(mtfcf7p_settings && !$parent.is("form") && (mtfcf7p_settings.mouse_over ||  mtfcf7p_settings.hover_input ||  mtfcf7p_settings.focus_input)) {
						$that2.parent().addClass('mm-tooltip-cf7-li');
					}
					

					if((mtfcf7p_settings && mtfcf7p_settings.mouse_over && submit_button_mode != 2) || (is_submit_button && submit_button_mode == 1)) {
						$that2.addClass('mm-tooltip-cf7');
					}

					if(mtfcf7p_settings && mtfcf7p_settings.add_underline && submit_button_mode != 2) {
						$that2.addClass('mm-tooltip-cf7-title-underline');
					}
				  	
					// console.log('is_submit_button', $that2, submit_button_mode, is_submit_button);
					if(is_submit_button && submit_button_mode == 2) { //.find('input[type="submit"]')
						$submit = $that2.closest('form').find('input[type="submit"]');
						$submit.addClass('mm-tooltip-submit');
						$submit.qtip($.extend({}, tooltip_code, {
							content: {
								text: $desc
							},
							show: 'hover',
							hide: {
								fixed: true,
								delay: 300
							},
							events: qtipEvents
						}));
						// console.log('$that2', $that2, $desc);

						// console.log('propertychange');
						// $(document).on('propertychange', '.mm-tooltip-cf7-li input[type="submit"]', function(e) {
						// 	console.log('propertychange', e);
						// 	// alert($(this).val());
						// });

						$(document).on('change', '.wpcf7-form-control input[name="your-consent"], .wpcf7-acceptance input', function(e) {
							if(!$that2.parent().find('input[type="submit"]').is( ':disabled' )) {
								// console.log('propertychange', 'enabled');
								$that2.parent().addClass('mm-tooltip-cf7-submit-enabled');
							} else {
								$that2.parent().removeClass('mm-tooltip-cf7-submit-enabled');
							}
							// console.log('propertychange', e);
							// alert($(this).val());
						});
						// $that2.parent().find('input[type="submit"]').bind("propertychange", function(e) {
						// 	console.log('propertychange', e);
						// 	// alert($(this).val());
						// });
					}
				  	// $that.html('<div class="'+ extraClass + '">' + $that.html()+'</div> <i class="fa fa-question-circle"></i>');
				}
			});
			
			// $('.gform_body .gfield').each(function(index) {
			// 	$that = $(this);
			//   	$that.find('input, select, textarea, .mtfcf7p_help').tooltipster({
	  //           	content: $that.find('.gfield_description').html()
	  //       	});
			// });
			//console.log('mtfcf7p',mtfcf7p);
			
			// if(mtfcf7p_settings && mtfcf7p_settings.mouse_over) {
				// console.log('.mm-tooltip-cf7');
				$('.mm-tooltip-cf7').each(function() { // Notice the .each() loop, discussed below
					// console.log('.mm-tooltip-cf7', $(this));
					$that = $(this);
					var tipHTML = mtfcf7p_get_tooltip_content($that.next());
					// console.log('tipHTML', $that.next(), tipHTML);
					$that.qtip($.extend({}, tooltip_code, {
						content: {
							text: tipHTML //.html() // Use the "div" element next to this for the content
						},
						show: 'hover',
						hide: {
							fixed: true,
							delay: 300
						},
						events: qtipEvents
					}));
				});
			// }



			if(mtfcf7p_settings && mtfcf7p_settings.focus_input ){
				$('.mm-tooltip-cf7-li input, .mm-tooltip-cf7-li textarea').each(function() { // Notice the .each() loop, discussed below
					$(this).qtip($.extend({}, tooltip_code, {
						content: {
							text: mtfcf7p_get_tooltip_content($(this).parents('.mm-tooltip-cf7-li').find('tip')) // Use the "div" element next to this for the content
						},
						show: 'focus',
						hide: 'unfocus',
						events: qtipEvents
					}));
					$(this).on('focus', function(){
						$(this).closest('.mm-tooltip-cf7-li').addClass('mm-tooltip-cf7-li-focus');
					}).on('blur', function(){
						$(this).closest('.mm-tooltip-cf7-li').removeClass('mm-tooltip-cf7-li-focus');
					});
				});
			}

			$('.wpcf7 input, .wpcf7 textarea').each(function(index) {
				$that = $(this);
				var placeholder = $that.attr('placeholder');
				// console.log('mcfcf711-placeholder', placeholder);
				if(placeholder && placeholder.indexOf('<tip>') >= 0) {
					var tooltipHTML2 = false;
					placeholder2 = placeholder.replace(/<tip>(.+?)<\/tip>/g, function(match, contents, offset, input_string)
					{
						tooltipHTML2 = contents; 
						// console.log('mcfcf711-tooltipHTML', tooltipHTML2);
						return " ";
					});

					if(tooltipHTML2) {
						$that.addClass('mtfcf7Input').attr('placeholder', placeholder2);
						$that.qtip($.extend({}, tooltip_code, {
							content: {
								text: tooltipHTML2 // Use the "div" element next to this for the content
							},
							show: 'hover',
							hide: {
								fixed: true,
								delay: 300
							},
							events: qtipEvents
						}));
					}
				}
			});

			if(typeof(wpcf7cf_forms)!=='undefined' && wpcf7cf_forms.length > 0) {
				for(var i=0; i < wpcf7cf_forms.length; i+=1) {
					if(typeof(wpcf7cf_forms[i].updateEventListeners) === 'function') {
						wpcf7cf_forms[i].updateEventListeners();
					}
				}
			}
		}

		mtfcf7_reinit_tooltip();
		mtfcf7_init_close_button();
	});

})(jQuery, window, document);
// source --> https://www.deinestadtklebt.de/wp-content/plugins/download-manager/assets/js/wpdm.min.js?ver=281e317e9c3b72f31aba7df9e0fc60ec 
(function($){$.fn.modal=function(option){var modal=this;var modalId=modal.attr("id");var $backdrop=null;if(option==="hide"){modal.removeClass("in show");$backdrop=$('.wpdm-modal-backdrop[data-modal="'+modalId+'"]');$backdrop.removeClass("in");setTimeout(function(){modal.css("display","none");$backdrop.remove();$("body").removeClass("modal-open").css("overflow","");modal.trigger("hidden.bs.modal")},250);$(document).off("keydown.wpdmModal");return modal}if(option==="show"||option===undefined){$("body").addClass("modal-open").css("overflow","hidden");$backdrop=$('<div class="modal-backdrop fade wpdm-modal-backdrop" data-modal="'+modalId+'"></div>');$("body").append($backdrop);modal.css({display:"block","z-index":1050});modal[0].offsetHeight;setTimeout(function(){$backdrop.addClass("in");modal.addClass("in show");modal.trigger("shown.bs.modal")},10);modal.find('[data-dismiss="modal"]').off("click.wpdmModal").on("click.wpdmModal",function(e){e.preventDefault();modal.modal("hide")});$backdrop.on("click",function(){if(!modal.data("backdrop")||modal.data("backdrop")!=="static"){modal.modal("hide")}});$(document).off("keydown.wpdmModal").on("keydown.wpdmModal",function(e){if(e.key==="Escape"&&modal.hasClass("in")){if(!modal.data("keyboard")||modal.data("keyboard")!==false){modal.modal("hide")}}})}if(option==="toggle"){if(modal.hasClass("in")){modal.modal("hide")}else{modal.modal("show")}}return modal};$.fn.tooltip=function(options){var settings=$.extend({background:"#333",color:"#fff",padding:"5px 10px",borderRadius:"4px",fontSize:"12px"},options);var $tooltip=$("<div class='simple-tooltip'></div>").css({position:"absolute",maxWidth:"200px",display:"none",zIndex:9999,background:settings.background,color:settings.color,padding:settings.padding,borderRadius:settings.borderRadius,fontSize:settings.fontSize,pointerEvents:"none"}).appendTo("body");return this.each(function(){var $elem=$(this);var title=$elem.attr("title");$elem.on("mouseenter",function(e){if(!title)return;$elem.data("tip-title",title).removeAttr("title");$tooltip.text(title).fadeIn(150);$tooltip.css({top:e.pageY+10,left:e.pageX+10})}).on("mousemove",function(e){$tooltip.css({top:e.pageY+10,left:e.pageX+10})}).on("mouseleave",function(){$tooltip.hide();$elem.attr("title",$elem.data("tip-title"))})})}})(jQuery);jQuery(function($){var $body=$("body");$body.on("click",'.w3eden [data-toggle="collapse"]',function(e){e.preventDefault();var target=$(this).attr("href")||$(this).data("target");$(target).slideToggle(200)});$body.on("click",'.w3eden [data-toggle="modal"], .w3eden[data-toggle="modal"]',function(e){e.preventDefault();var target=$(this).data("target");$(target).modal("show")});$body.on("click",'.w3eden [data-toggle="tab"]',function(e){e.preventDefault();var $this=$(this);var $container=$this.closest(".nav-tabs, .nav-pills");var target=$this.attr("href");$container.find('[data-toggle="tab"]').each(function(){var $tab=$(this);$tab.removeClass("active");$tab.parent("li").removeClass("active");var pane=$tab.attr("href");if(pane){$(pane).removeClass("active in")}});$this.addClass("active");$this.parent("li").addClass("active");if(target){$(target).addClass("active in")}$this.trigger("shown.bs.tab")});$body.on("click",'.w3eden [data-toggle="dropdown"]',function(e){e.preventDefault();e.stopPropagation();var $dropdown=$(this).closest(".dropdown, .btn-group");var isOpen=$dropdown.hasClass("open");$(".w3eden .dropdown, .w3eden .btn-group").removeClass("open");if(!isOpen){$dropdown.addClass("open")}});$(document).on("click",function(e){if(!$(e.target).closest(".dropdown, .btn-group").length){$(".w3eden .dropdown, .w3eden .btn-group").removeClass("open")}})});