' ); } else { ajaxElement.prepend('
' + '

' ); } }, 900); }}function stopLoading() { clearTimeout(loadingTimeout); loadingTimeout = undefined; $(".loading_js").remove();}$(document).ready(function(){$(document).on("iwc-start-loading", function(){console.log("start Loading");loadingCounter = loadingCounter + 1;startLoading( );});$(document).on("iwc-stop-loading", function(){console.log("stop Loading");loadingCounter = loadingCounter - 1;console.log(loadingCounter);if (loadingCounter <= 0){stopLoading( );loadingCounter = 0;}});});/* Document Ready - Event */$(document).ready(function(){ $(document).trigger("iwc-page-loaded"); document.dispatchEvent(new Event('iwc-page-loaded'));});/* loadAjaxContent */function loadAjaxContent() { $(".js-iwc-ajax-content").each(function () { var url = $(this).attr("data-src") || ""; if( url != "" ){ startLoading($(this)); var data = "ajax=X"; var object = $(this).closest(".js-ajax-templ-container"); if (object.length == 0){ object = $(this); } $.ajax({ type: "GET", data: data, url: url }).done(function (html) { object.replaceWith(html); }); } });}window.loadAjaxContent = loadAjaxContent;$(document).ready(function () { loadAjaxContent();});