function execute() {initViewArray(), updateDataView(), filterAvailability(), filterBauart(), searchKeyword(global_searched_schlagwort), global_leafs.length > 0 && global_leafs[0] != global_root_folder && $("#filter-reset-box").show(), uniqueDataView(), (void 0 == global_searched_schlagwort || "" == global_searched_schlagwort) && ("r" == global_type ? sortSyspk() : sortAlpha(!1)), void 0 !== global_searched_schlagwort && "" !== global_searched_schlagwort && void 0 != global_tracking_area && "" !== global_tracking_area && (emospro.search = [[global_tracking_area + global_searched_schlagwort, global_data_view.length]], emospro.rqtype = "hiddenpi", window.emosPropertiesEvent(window.emospro)), viewMenue(), viewProducts(), location.hash = buildUrlStr()} function getFromUrl(e) { e = void 0 === e ? "notExisting" : e; var l = !1, a = window.location.href; return "notExisting" !== e && (l = (new RegExp("[?|&]" + e + "=([^&;]+?)(&|#|;|$)").exec(a) || ["", ""])[1] || !1, l = l !== !1 ? (new RegExp(/^[\s\d0-9a-zA-ZöÖäÄüÜß&()+%/€é,.-]*$/).exec(l) || [!1])[0] || !1 : l, l !== !1 && (l = decodeURIComponent((l + "").replace(/\+/g, "%20"))), l = l.length > 50 ? l.substr(0, 49) : l), l } function getResultfile() { var e = $.ajax({ type: "POST", url: global_path_to_controller, data: "action=getEntire&type=" + global_type, dataType: "json", async: !1, success: function() {}, error: function() {} }).responseText; return "" !== e ? $.parseJSON(e) : "" } function initFolderArray() { global_folders_syspk = [], global_folders_view = [], global_open_folder = []; var e; void 0 !== global_folders && $.each(global_folders, function(l, a) {1 == a.level && global_folders_view.push(l), e = a.sys_pk, global_folders_syspk[e] = l, global_folders[l].checked = !1, global_folders[l].sys_pk_array = []}) } function resetBubbleArray() {void 0 != global_bubbles && $.each(global_bubbles, function(e, l) {void 0 != global_bubbles[e] && 0 != global_bubbles[e] && (l = global_bubbles[e], l.close(), global_bubbles[e] = 0)})} function initViewArray() {global_data_view = [], 0 != global_data && $.each(global_data, function(e) {global_data_view.push(e)}), setCount(), resetBubbleArray(), void 0 !== global_folders && $.each(global_folders, function(e) {global_folders[e].cnt = 0})} function setTopProductViewArray() { global_top_view = []; global_top_products.length > 0 && 0 != global_data && $.each(global_top_products, function(e, l) {$.each(global_data, function(e, a) {a.parent == l && global_top_view.push(e)})}) } function getLeafsFromUrl(e) { function l(e, l) {return e - l} global_leafs = []; var a, o, t, s, r, _, i = getFromUrl(GLOBAL_LINK_PARAM), n = {}; void 0 !== i && i.length > 0 && (n = i.split(GLOBAL_LINK_PARAM_DELIMITER), n.sort(l), void 0 !== e && e.length > 0 && (n = e), $.each(n, function(e, l) {if(l > global_root_folder && (a = global_folders_syspk[l], void 0 != a))for(o = global_folders[a], global_leafs.push(l), global_folders[a].checked = !0, r = o.parent; r > 0;)_ = r, r = 0, t = global_folders_syspk[_], s = global_folders[t], t > 0 && !s.checked && (global_folders[t].checked = !0, r = global_folders[t].parent)})), 0 == global_leafs.length && (global_leafs[0] = global_root_folder), global_open_folder = []; var g = getFromUrl(GLOBAL_OPEN_PARAM), c = {}; void 0 !== g && g.length > 0 && (c = g.split(GLOBAL_LINK_PARAM_DELIMITER)), void 0 !== c[0] && (global_open_folder[1] = c[0]), void 0 !== c[1] && (global_open_folder[2] = c[1]) } function getLeafsFromFolders(e) { var l, a, o = [], t = [], s = global_folders_syspk[e], r = global_folders[s]; return void 0 !== r.childs ? (l = r.childs, l.length > 0 ? (a = l.split(","), $.each(a, function(e, l) {t = getLeafsFromFolders(l), t.length > 0 && $.each(t, function(e, l) {o.push(l)})}), 0 == o.length && r.checked && o.push(e)) : r.checked && o.push(e)) : r.checked && o.push(e), o } function updateDataView() { global_data_view = []; var e = []; $.each(global_leafs, function(l, a) {e = getLeafData(a), e.length > 0 && $.each(e, function(e, l) {global_data_view.push(l)})}), setCount() } function getLeafData(e) { var l, a, o, t, s = [], r = []; return void 0 !== global_folders && (l = global_folders_syspk[e], a = global_folders[l], $.each(global_data, function(l, a) {a.parent == e && s.push(l)}), a.childs.length && void 0 !== a.childs && (o = a.childs, o.length > 0 && (t = o.split(","), $.each(t, function(e, l) {r = getLeafData(l), r.length > 0 && $.each(r, function(e, l) {s.push(l)})})))), s } function toggleFolder(e, l) { var a, o, t, s; return void 0 !== global_folders && (a = global_folders_syspk[e], o = global_folders[a], o.checked || l ? (global_folders[a].checked = !1, void 0 !== o.childs && (t = o.childs, t.length > 0 && (s = t.split(","), $.each(s, function(e, l) {toggleFolder(l, !0)})))) : global_folders[a].checked = !0), !0 } function changeOpenFolder(e) { var l, a, o, t, s = 0; return void 0 !== global_folders && (l = global_folders_syspk[e], a = global_folders[l], a.level < 3 && (o = a.level, global_open_folder[o] == l ? (s = l, global_open_folder[o] = "0") : (s = global_open_folder[o], global_open_folder[o] = l), 1 == o && (global_open_folder[2] = "0"))), t = getFolderSyspk(s) } function updateOpenFolder(e) { var l, a, o; void 0 !== global_folders && (l = global_folders_syspk[e], a = global_folders[l], a.level < 3 && (o = a.level, a.checked ? global_open_folder[o] = l : global_open_folder[o] == l && (global_open_folder[o] = "0"), 1 == o && (global_open_folder[2] = "0"))) } function getFolderSyspk(e) { var l, a = 0; return void 0 != e && e > 0 && (l = global_folders[e], a = l.sys_pk), a } function updateFoldersView() { function e(e, l) {return e - l} global_folders_view = []; var l, a, o, t, s; void 0 !== global_folders && ($.each(global_folders, function(e, r) {1 == r.checked && r.cnt_a > 0 ? (global_folders_view.push(e), l = r.level, e == global_open_folder[l] && void 0 !== r.childs && (o = r.childs, o.length > 0 && (t = o.split(","), $.each(t, function(e, l) {s = global_folders_syspk[l], a = global_folders[s], (a.checked !== !0 || 0 == a.cnt_a) && global_folders_view.push(s)})))) : 1 == r.level && r.cnt_a > 0 && global_folders_view.push(e)}), global_folders_view.sort(e)) } function updateFolders(e) { var l, a = $(e).attr("data-style-name"), o = a.split("_"); o[0] = "holder"; var t, s, r, _ = getFolderSyspk(global_open_folder[1]); toggleFolder(o[1], !1), updateOpenFolder(o[1]), updateFoldersView(), s = getFolderSyspk(global_open_folder[1]), global_leafs = getLeafsFromFolders(global_root_folder), 0 == global_leafs.length && (global_leafs[0] = global_root_folder), execute(), _ > 0 && _ != s ? (o[1] = _, r = $("#" + o.join("_")), r.attr("style", "display: block;"), r.slideUp(500, function() {execute(), s > 0 && (o[1] = s), t = $("#" + o.join("_")), l = t.height(), t.css("height", 0), t.animate({height: l}, function() {setTimeout(adapt, global_adapt_timeout)})})) : (execute(), s > 0 && _ != s && (o[1] = s), t = $("#" + o.join("_")), l = t.height(), t.css("height", 0), t.animate({height: l}, function() {setTimeout(adapt, global_adapt_timeout)})) } function filterBauart() { var e, l, a = []; global_data_view.length > 0 && (e = !1, a = [], $.each(global_bauart, function(o, t) {t && ($.each(global_data_view, function(e, t) {l = global_data[t], l.bauart == 5001 + o && a.push(t)}), e = !0)}), e && (global_data_view = a), setCount()) } function filterAvailability() { var e, l = []; "p" == global_type && 0 != global_availability && global_fachhandel != global_baumarkt && (1 == global_fachhandel ? $.each(global_data_view, function(a, o) {e = global_data[o], "t" == e.produkt_flag_fachhandel && l.push(o)}) : $.each(global_data_view, function(a, o) {e = global_data[o], "t" == e.produkt_flag_baumarkt && l.push(o)}), global_data_view = l, setCount()) } function searchKeyword(e) { var l = [], a = [], o = [], t = []; e = e.trim(), void 0 !== e && "" !== e && (o.push(e), l = doSearch(o, "text", !0), a = doSearch(o, "beschreibung", !0), a.length > 0 && $.each(a, function(e, a) {l.push(a)}), a = doSearch(o, "extra_infos", !0), a.length > 0 && $.each(a, function(e, a) {l.push(a)}), t = e.split(" "), t.length > 1 && (a = doSearch(t, "text", !0), a.length > 0 && $.each(a, function(e, a) {l.push(a)}), a = doSearch(t, "beschreibung", !0), a.length > 0 && $.each(a, function(e, a) {l.push(a)}), a = doSearch(t, "extra_infos", !0), a.length > 0 && $.each(a, function(e, a) {l.push(a)})), global_data_view = l, setCount()) } function doSearch(e, l, a) { var o, t, s, r, _ = [], i = []; return void 0 !== e && "" !== e && global_data_view.length > 0 && $.each(global_data_view, function(n, g) {g >= 0 && (s = global_data[g][l], void 0 !== s && "" !== s && (o = !0, s = s.toLowerCase(), $.each(e, function(e, l) {r = l.toLowerCase(), t = !1, -1 == s.indexOf(r) ? (i = getSynonyms(l), 0 != i && $.each(i, function(e, l) {-1 != s.indexOf(l) && (t = !0)})) : t = !0, t || (o = !1)}), o && (_.push(g), a && (global_data_view[n] = -1))))}), _ } function uniqueDataView() { var e, l, a, o, t = [], s = []; global_data_view.length > 0 && ($.each(global_data_view, function(r, _) { l = global_data[_], o = 0, o = isNaN(l.sys_pk) ? l.sys_pk.substr(2) : l.sys_pk, e = l.parent, a = global_folders_syspk[e], folder = global_folders[a], -1 == $.inArray(o, folder.sys_pk_array) && (folder.cnt += 1, folder.sys_pk_array.push(o)); for(var i = global_folders[a].parent; i > 0;)syspk2 = global_folders_syspk[i], folder2 = global_folders[syspk2], -1 == $.inArray(o, folder2.sys_pk_array) && (folder2.cnt += 1, folder2.sys_pk_array.push(o)), i = folder2.parent; void 0 == s[o] && (s[o] = _, t.push(_)) }), $.each(global_folders, function(e) {global_folders[e].sys_pk_array = []}), global_data_view = t), setCount() } function sortSyspk() { function e(e, l) { var a = global_data[e], o = a.sys_pk, t = global_data[l], s = t.sys_pk; return s - o } var l, a = [], o = []; global_data_view.length > 0 && ($.each(global_data_view, function(e, t) {l = global_data[t], "t" == l.highlight ? a.push(t) : o.push(t)}), a.length > 0 && a.sort(e), global_data_view = a, o.length > 0 && (o.sort(e), $.each(o, function(e, l) {global_data_view.push(l)}))), setCount() } function sortAlpha(e) { function l(e, l) { var a = global_data[e], o = a.text; void 0 !== global_sort_prefix && global_sort_prefix.length > 0 && 0 == o.indexOf(global_sort_prefix) && (o = o.substr(global_sort_prefix.length)); var t = global_data[l], s = t.text; return void 0 !== global_sort_prefix && global_sort_prefix.length > 0 && 0 == s.indexOf(global_sort_prefix) && (s = s.substr(global_sort_prefix.length)), o == s ? 0 : o > s ? 1 : -1 } var a, o = [], t = []; global_data_view.length > 0 && ($.each(global_data_view, function(e, l) {a = global_data[l], "t" == a.highlight ? o.push(l) : t.push(l)}), e && o.length > 0 && o.sort(l), global_data_view = o, t.length > 0 && (t.sort(l), $.each(t, function(e, l) {global_data_view.push(l)}))), setCount() } function fallbackSearch(e) {global_data_view = [], global_type = e, global_fallback_data[e] || (global_fallback_data[e] = getResultfile()), global_data = global_fallback_data[e].data, global_data_view = [], $.each(global_data, function(e) {global_data_view.push(e)}), searchKeyword(global_searched_schlagwort), global_data_view.length > 0 && (unique_sys_pks = [], local_data_views = [], $.each(global_data_view, function(e, l) {temp_syspk = global_data[l].sys_pk, -1 == $.inArray(temp_syspk, unique_sys_pks) && (unique_sys_pks.push(global_data[l].sys_pk), local_data_views.push(l))}), global_data_view = local_data_views)} function viewProducts() { MERKEN = getll("Memorise"); var e, l, a, o, t, s, r, _, i, n, g, c, d, b, p, h, u, f = 1, m = "", v = "", w = 0, y = global_data_view.length; setStats(y), 0 == y && (h = global_type, u = global_data, "p" != global_type || global_fixed_type ? "s" != global_type || global_fixed_type ? "r" == global_type ? (v = "

" + getll("No references found"), global_use_gsa_fallback ? (v += " " + getll("Use GSA Search") + "

", v += '' + getll("Button Label GSA Search") + "") : v += "

") : (v = "

" + getll("No results found"), global_use_gsa_fallback ? (v += " " + getll("Use GSA Search") + "

", v += '' + getll("Button Label GSA Search") + "") : v += "

") : (fallbackSearch("p"), global_data_view.length > 0 ? v = "

" + getll("No systems found but products") + "

" : (v = "

" + getll("No systems found"), global_use_gsa_fallback ? (v += " " + getll("Use GSA Search") + "

", v += '' + getll("Button Label GSA Search") + "") : v += "

")) : (fallbackSearch("s"), global_data_view.length > 0 ? v = "

" + getll("No products found but systems") + "

" : (v = "

" + getll("No products found"), global_use_gsa_fallback ? (v += " " + getll("Use GSA Search") + "

", v += '' + getll("Button Label GSA Search") + "") : v += "

"))), $("#results").html(v), $("#more_holder").html(""), "s" == global_type && (g = "sysgrp"), "map" == global_view_mode && y > 0 ? (global_center = new google.maps.LatLng(50.0989478, 8.6346041), e = new google.maps.LatLngBounds, void 0 === global_google_map && initMap(), removeMapMarkers(), showMap()) : hideMap(), $.each(global_data_view, function(_, d) { if(f > global_count)return !1; var h = global_data[d]; return a = h.link, global_merken && ("r" != global_fixed_type ? (c = h.sys_pk.substr(0, 2), b = h.sys_pk.substr(2), "p" == global_type && ("pr" == c ? g = "prod" : "gr" == c && (g = "prodgrp")), m = "" + MERKEN + "") : m = "" + MERKEN + ""), "kachel" == global_view_mode ? v = "
" + h.text + "
" + m : "list" == global_view_mode ? v = "

" + h.text + "

" + h.beschreibung + "

" + m + "
" : "map" == global_view_mode && (w++, p = 10 > w ? "0" + w : w, v = "
" + p + "
" + h.text.replace(/-/, " ") + "

" + h.introtext + "

", v += global_merken ? "" + MERKEN + " " : " ", v += "

", r = new google.maps.LatLng(parseFloat(h.latitude), parseFloat(h.longitude)), s = new google.maps.MarkerImage(global_gmaps_markers + "marker_" + p + ".png", new google.maps.Size(42, 66), new google.maps.Point(0, 0), new google.maps.Point(22, 59)), o = new google.maps.Marker({ icon: s, map: global_google_map, position: r }), e.extend(r), global_markers.push(o), google.maps.event.addListener(o, "click", function() {i = 90 / Math.pow(2, global_google_map.getZoom()), n = new google.maps.LatLng(parseFloat(h.latitude) + i, parseFloat(h.longitude)), global_google_map.panTo(n), l = createInfoBubble(h), l.open(global_google_map), t = parseInt(h.sys_pk), global_bubbles[t] = l, google.maps.event.addListener(l, "closeclick", function() {global_bubbles[t] = 0})})), $("#results").append(v), f++, !0 }), initMerkzettel(), f--, "map" == global_view_mode && y > 0 && (1 == f ? (global_google_map.setZoom(14), global_google_map.setCenter(r)) : global_google_map.fitBounds(e)), y > f && (d = y - f, _ = "
" + getll("Show more results") + " (" + d + ")
", $("#more_holder").html(_)), h && (global_type = h, global_data = u), setTimeout(adapt, global_adapt_timeout) } function viewMenue() { var e, l, a, o, t, s, r, _, i, n, g = 3, c = "", d = "", b = 1e7, p = [], h = [0, b, b]; $("#H_1_1").html(d), $.each(global_folders_view, function(d, u) {a = global_folders[u], t = a.sys_pk, "s" == global_type && void 0 !== global_cut_max_depth && t == global_cut_max_depth && (g = 2), l = a.cnt_a, r = a.level, l > 0 && g >= r && (_ = a.name, i = a.parent, s = t + "_2_" + r, o = "holder_" + i + "_2_" + (r - 1), n = "", e = "", a.cnt > 0 && (e = " (" + a.cnt + ")"), u > h[r] && (h[r] = b), 1 == r && (c = "filter_" + s), a.checked ? (u == global_open_folder[r] && (h[r] = u), u !== global_open_folder[r] && h[r - 1] < b && 2 == r && (c = "filter_" + s), u == global_open_folder[r] || h[r - 1] < b ? (n += "", n += "", "" !== a.childs && (n += u == global_open_folder[r] ? "" : "", n += "
", n += "
"), p.push("checkbox_" + s)) : (o = c, n = "
" + _ + e + "
")) : (n += "", n += "", p.push("checkbox_" + s)), r > 1 ? $("#" + o).append(n) : $("#H_1_1").append(n))}), $.each(p, function(e, l) {createStyledInputs("#" + l, e, "checkbox")}) } function setCount() { var e = global_data_view.length; global_count > e && (global_count = e), global_count < GLOBAL_COUNT_DEFAULT && (global_count = GLOBAL_COUNT_DEFAULT) } function setStats(e) { var l, a = getll("Search Result"); 1 == e ? ("r" == global_type && $("#result_stats").html(a + "
" + getll("1 reference was found") + ""), "p" == global_type && $("#result_stats").html(a + "
" + getll("1 product was found") + ""), "s" == global_type && $("#result_stats").html(a + "
" + getll("1 system was found") + "")) : ("r" == global_type && (found = getll("references were found")), "p" == global_type && (found = getll("products were found")), "s" == global_type && (found = getll("systems were found")), l = found.replace(/###CNT###/g, e), $("#result_stats").html(a + "
" + l + "")) } function buildUrlStr() { var e = "", l = [], a = "&cnt=" + global_count, o = "", t = "", s = "", r = "&view=" + global_view_mode; if(global_open_folder[1])var _ = "&open=" + global_open_folder[1] + GLOBAL_LINK_PARAM_DELIMITER + global_open_folder[2]; else var _ = "&open=0" + GLOBAL_LINK_PARAM_DELIMITER + "0"; return "r" == global_type && ($.each(global_bauart, function(e, a) {a && l.push(e)}), "" != l && (e = "&bauart=" + l.join(GLOBAL_LINK_PARAM_DELIMITER))), (0 == global_fixed_type || "p" == global_fixed_type) && ("p" == global_type ? (s = "&type=p", 1 == global_fachhandel && (o += "&fachhandel=1"), 1 == global_baumarkt && (o += "&baumarkt=1")) : s = "&type=s"), global_searched_schlagwort && (t = "&search=" + global_searched_schlagwort), "&" + GLOBAL_LINK_PARAM + "=" + global_leafs.join(GLOBAL_LINK_PARAM_DELIMITER) + _ + o + s + e + a + r + t } function setErhaeltlich(e, l) { var a; void 0 !== e && (a = $("#" + e), void 0 == l ? ("erhaeltlich_fachhandel" == e && (global_fachhandel = !global_fachhandel), "erhaeltlich_baumarkt" == e && (global_baumarkt = !global_baumarkt)) : l ? ($("[data-style-name='" + e + "']").addClass("checked"), a.attr("checked", !0)) : ($("[data-style-name='" + e + "']").removeClass("checked"), a.attr("checked", !1))) } function showSearchButton() {0 == $("#search_btn").length ? $("#output").append("") : $("#search_btn").is(":hidden") && $("#search_btn").show()} function hideSearchButton() {$("#search_btn").is(":visible") && $("#search_btn").hide()} function resetSchlagwort() {global_searched_schlagwort = "", $("#keywords").val(global_default_schlagwort_text)} function getAccordionSymbol(e, l) { var a, o = "s"; if(void 0 !== e) { if(a = e.split("_"), 1 == a[3] && (o = "b"), "down" == l)return getCMSImage("filter_down_" + o + ".png"); if("up" == l)return getCMSImage("filter_up_" + o + ".png") } return !1 } function checkDynamic() {return} function checkScreenView() { global_scroll_on++; var e = $("#content").offset().top, l = $(window).scrollTop(), a = 78, o = $(window).height(), t = $("#more_holder").height(), s = $("#map").height(), r = s + $("#results").height() + t, _ = $("#maincol").height(); setTimeout(function() { if(1 == global_scroll_on) { if(l > e + r - 200)if(l - e + r + t > _)var s = _ - r - t; else s = r > o ? l - e - (r - o - t) : l - e + a - t - t; else s = 0; $("#results").css("margin-top", s + "px") } global_scroll_on-- }, GLOBAL_SCROLL_DELAY) } function showMap() {$("#map").height(GLOBAL_DEFAULT_MAP_HEIGHT), $("#map").width($("#maincol").width() - 84), $("#map").show(), google.maps.event.trigger(global_google_map, "resize"), global_google_map.setCenter(global_center)} function hideMap() {$("#map").height(0), $("#map").hide()} function initMap() { var e, l; void 0 === global_google_map && (e = { zoom: 4, center: global_center, mapTypeId: google.maps.MapTypeId.ROADMAP, panControl: !1, zoomControl: !0, mapTypeControl: !0, scaleControl: !1, streetViewControl: !1, overviewMapControl: !0, rotateControl: !1 }, l = document.getElementById("map"), global_google_map = new google.maps.Map(l, e)) } function createInfoBubble(e) { var l, a, o, t, s, r, _, i, n; return void 0 !== e ? (n = e.text || "", i = e.street || "", l = e.house_number || "", _ = e.postal_code || "", t = e.location || "", r = new google.maps.LatLng(parseFloat(e.latitude), parseFloat(e.longitude)), o = e.link, s = '
' + n + '

' + _ + " " + t + "

" + i + " " + l + '

Zur Referenz

', a = new InfoBubble({ map: global_google_map, content: s, position: r, shadowStyle: 1, padding: 16, backgroundColor: "rgb(255,255,255)", borderRadius: 0, arrowSize: 10, borderWidth: 0, borderColor: "#ffffff", disableAutoPan: !0, hideCloseButton: !0, arrowPosition: 50, arrowStyle: 0, minWidth: 281, maxWidth: 281 }), a.showCloseButton(), a) : !1 } function removeMapMarkers() {global_markers.length > 0 && ($.each(global_markers, function(e, l) {l.setMap(null)}), global_markers = [])} function drawOptions() { var e, l, a, o, t = [], s = 0, r = "", _ = ""; $.each(global_options, function(e, l) {s++, o = l.sys_pk, a = l.name, _ += '
', t.push("bauart_" + o)}), $("#div_bauart").html(_), $.each(t, function(e, l) {createStyledInputs("#" + l, e, "checkbox")}), $.each(global_bauart, function(a, o) {o && (l = "bauart_500" + (a + 1), e = $("#" + l), $("[data-style-name='" + l + "']").addClass("checked"), e.attr("checked", !0))}) } function getll(e) { var l = global_language[e]; return "" != l && void 0 != l ? l : e } function getSynonyms(e) { var l, a, o = []; return void 0 != e && "" != e ? (l = e.toLowerCase(), void 0 != global_synonyms[l] ? (a = global_synonyms[l], o = a.split(","), o = $.map(o, function(e) {return e.toLowerCase().trim()})) : !1) : !1 } function getllObj() { var e = $.ajax({type: "POST", url: global_path_to_controller, data: "action=getllObj", dataType: "json", async: !1, success: function() {}, error: function() {}}).responseText; return "" !== e ? $.parseJSON(e) : "" } function readSynonyms() { var e = $.ajax({type: "POST", url: global_path_to_controller, data: "action=readSynonyms", dataType: "json", async: !1, success: function() {}, error: function() {}}).responseText; return "" !== e ? $.parseJSON(e.toLowerCase()) : "" } GLOBAL_LINK_PARAM = "leafs", GLOBAL_OPEN_PARAM = "open", GLOBAL_LINK_PARAM_DELIMITER = "-", GLOBAL_SCROLL_DELAY = 100, GLOBAL_WIDTH_THRESHOLD = 600, GLOBAL_COUNT_DEFAULT = 12, GLOBAL_DEFAULT_MAP_HEIGHT = 450; var global_language = getllObj(), global_type = "p", global_view_mode = "kachel", global_fachhandel = !1, global_baumarkt = !1, global_count, global_data = {}, global_data_view = [], global_top_view = [], global_folders = {}, global_folders_syspk = [], global_folders_view = [], global_open_folder = {}, global_root_folder, global_leafs = [], global_scroll_on = 0, global_searched_schlagwort = "", global_default_schlagwort_text = getll("keyword / buzzword"), global_center, global_google_map = void 0, global_markers = [], global_bubbles = [], global_bauart = [!1, !1, !1], global_synonyms = readSynonyms(), global_options = {}, global_fallback_data = []; $(function() { if(checkDynamic(), $(document).on("click", '[class^="accordionBtn"]', function() { var e, l = $(this).attr("id"), a = l.split("_"); a[0] = "holder"; var o, t, s = a[1], r = changeOpenFolder(a[1]); r > 0 ? (a[1] = r, t = $("#" + a.join("_")), t.attr("style", "display: block;"), t.slideUp(500, function() {updateFoldersView(), execute(), r != s ? (a[1] = s, o = $("#" + a.join("_")), e = o.height(), o.css("height", 0), o.animate({height: e}, function() {setTimeout(adapt, global_adapt_timeout)})) : setTimeout(adapt, global_adapt_timeout)})) : (updateFoldersView(), execute(), a[1] = s, o = $("#" + a.join("_")), e = o.height(), o.css("height", 0), o.animate({height: e}, function() {setTimeout(adapt, global_adapt_timeout)})) }), $(document).on("click", "label[data-style-name^='select_'],span[data-style-name^='select_']", function() { var e, l, a = []; "select_prod_syst0" == $(this).attr("data-style-input") ? l = "p" : "select_prod_syst1" == $(this).attr("data-style-input") && (l = "s"), global_type != l && (global_type = l, "p" == global_type ? $("#output1").attr("style", "display: block;") : $("#output1").attr("style", "display: none;"), e = getResultfile(), global_folders = e.folders, global_data = e.data, global_root_folder = global_folders[0].sys_pk, initFolderArray(), initViewArray(), setTopProductViewArray(), getLeafsFromUrl(a), updateFoldersView(), execute()) }), $(document).on("click", "[id^='sf_']", function() { var e = $(this).attr("id"), l = e.split("_"); toggleFolder(l[1], !1), updateFoldersView(), global_leafs = getLeafsFromFolders(global_root_folder), 0 == global_leafs.length && (global_leafs[0] = global_root_folder), execute() }), $(document).on("click", "label[data-style-name^='erhaeltlich_'],span[data-style-name^='erhaeltlich_']", function() { var e = $(this).attr("data-style-name"); setErhaeltlich(e), execute(), $("#filter-reset-box").show() }), $(document).on("click", "label[data-style-name^='bauart_'],span[data-style-name^='bauart_']", function() { var e = $(this).attr("data-style-name").split("_"), l = parseInt(e[1]) - 5001; global_bauart[l] = !global_bauart[l], execute(), $("#filter-reset-box").show() }), $(document).on("click", "#filter-reset", function() {return setErhaeltlich("erhaeltlich_fachhandel", global_fachhandel = !1), setErhaeltlich("erhaeltlich_baumarkt", global_baumarkt = !1), global_bauart = [!1, !1, !1], "r" == global_fixed_type && drawOptions(), $("#filter-reset-box").hide(), resetSchlagwort(), global_count = GLOBAL_COUNT_DEFAULT, initFolderArray(), initViewArray(), global_leafs = getLeafsFromFolders(global_root_folder), 0 == global_leafs.length && (global_leafs[0] = global_root_folder), execute(), location.hash = buildUrlStr(), !1}), $(document).on("click", "[id^='blase-']", function() { var e, l, a, o, t = this.id.split("-"), s = t[1]; $.each(global_data_view, function(t, r) {l = global_data[r], l.sys_pk == s && (a = 90 / Math.pow(2, global_google_map.getZoom()), o = new google.maps.LatLng(parseFloat(l.latitude) + a, parseFloat(l.longitude)), global_google_map.panTo(o), (void 0 == global_bubbles[s] || 0 == global_bubbles[s]) && ($("#filter-reset-box").show(), e = createInfoBubble(l), e.open(global_google_map), global_bubbles[s] = e, google.maps.event.addListener(e, "closeclick", function() {global_bubbles[s] = 0})), calculatedJump("#vpFinder"))}) }), $(document).on("click", "#more-button", function() { global_count += GLOBAL_COUNT_DEFAULT, setCount(), $("#filter-reset-box").show(), viewProducts(), location.hash = buildUrlStr()}), $(document).on("click", "#thumb-view", function() {"kachel" != global_view_mode && ("map" == global_view_mode && resetBubbleArray(), global_view_mode = "kachel", $("#list-view img").attr("src", getCMSImage("list_view.png")), $("#map-view img").attr("src", getCMSImage("map_view.png")), $("#thumb-view img").attr("src", getCMSImage("thumb_view_h.png")), viewProducts(), location.hash = buildUrlStr())}), $(document).on("click", "#list-view", function() {"list" != global_view_mode && ("map" == global_view_mode && resetBubbleArray(), global_view_mode = "list", $("#thumb-view img").attr("src", getCMSImage("thumb_view.png")), $("#map-view img").attr("src", getCMSImage("map_view.png")), $("#list-view img").attr("src", getCMSImage("list_view_h.png")), viewProducts(), location.hash = buildUrlStr())}), $(document).on("click", "#map-view", function() {"map" != global_view_mode && (global_view_mode = "map", $("#thumb-view img").attr("src", getCMSImage("thumb_view.png")), $("#list-view img").attr("src", getCMSImage("list_view.png")), $("#map-view img").attr("src", getCMSImage("map_view_h.png")), viewProducts(), location.hash = buildUrlStr())}), $("#keywords").keyup(function() { var e = $(this).val(); global_searched_schlagwort = e.trim(), execute(), $("#filter-reset-box").show() }), $("#keywords").focus(function() { var e = $(this).val(); e == global_default_schlagwort_text && $(this).val(""), $(this).blur(function() {"" == $(this).val() && resetSchlagwort()}) }), $(document).on("click", "#search_btn", function() {$("#img-swap").click()}), 0 == global_fixed_type) { var e = getFromUrl("type"); "s" !== e ? (global_type = "p", $("[data-style-input='select_prod_syst0']").addClass("checked"), $("[data-style-input='select_prod_syst1']").removeClass("checked")) : (global_type = "s", $("[data-style-input='select_prod_syst0']").removeClass("checked"), $("[data-style-input='select_prod_syst1']").addClass("checked")), e && e != global_type && $("#filter-reset-box").show() } else global_type = global_fixed_type; var l = getFromUrl("view"); if(l && ("kachel" == l || "list" == l || "map" == l && "r" == global_type) && (global_view_mode = l), "kachel" == global_view_mode ? ($("#thumb-view img").attr("src", getCMSImage("thumb_view_h.png")), $("#list-view img").attr("src", getCMSImage("list_view.png")), $("#map-view img").attr("src", getCMSImage("map_view.png"))) : "list" == global_view_mode ? ($("#thumb-view img").attr("src", getCMSImage("thumb_view.png")), $("#list-view img").attr("src", getCMSImage("list_view_h.png")), $("#map-view img").attr("src", getCMSImage("map_view.png"))) : ($("#thumb-view img").attr("src", getCMSImage("thumb_view.png")), $("#list-view img").attr("src", getCMSImage("list_view.png")), $("#map-view img").attr("src", getCMSImage("map_view_h.png"))), 0 != global_availability && "p" == global_type) { var a = $("#output1"); a.attr("style", ""), global_fachhandel = getFromUrl("fachhandel") ? !0 : !1, global_baumarkt = getFromUrl("baumarkt") ? !0 : !1, (global_fachhandel || global_baumarkt) && $("#filter-reset-box").show(), setErhaeltlich("erhaeltlich_fachhandel", global_fachhandel), setErhaeltlich("erhaeltlich_baumarkt", global_baumarkt) } if("r" == global_type) { var o, t, s = getFromUrl("bauart"); s && (o = s.split(GLOBAL_LINK_PARAM_DELIMITER), $.each(o, function(e, l) {t = parseInt(l), global_bauart[t] = !0}), $("#filter-reset-box").show()) } global_count = GLOBAL_COUNT_DEFAULT; var r = getFromUrl("cnt"); r && (global_count = parseInt(r)); var _ = getFromUrl("search"), i = getResultfile(); global_options = i.options, global_folders = i.folders, global_data = i.data, "r" == global_fixed_type && drawOptions(), global_root_folder = global_folders[0].sys_pk, initFolderArray(), initViewArray(), setTopProductViewArray(), getLeafsFromUrl(), updateFoldersView(), (global_leafs.length > 0 || global_count != GLOBAL_COUNT_DEFAULT) && $("#filter-reset-box").show(), 0 == global_leafs.length && (global_leafs[0] = global_root_folder), _ && "" == global_searched_schlagwort ? ($("#keywords").val(_), $("#keywords").focus(), $("#keywords").keyup()) : (resetSchlagwort(), execute()) });