$(document).ready(function(){ // convert all characters to lowercase to simplify testing var agt=navigator.userAgent.toLowerCase(); // *** BROWSER VERSION *** // Note: On IE5, these return 4, so use is_ie5up to detect IE5. var is_major = parseInt(navigator.appVersion); var is_minor = parseFloat(navigator.appVersion); // Note: Opera and WebTV spoof Navigator. We do strict client detection. // If you want to allow spoofing, take out the tests for opera and webtv. var is_nav = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1) && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1) && (agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1)); var is_nav2 = (is_nav && (is_major == 2)); var is_nav3 = (is_nav && (is_major == 3)); var is_nav4 = (is_nav && (is_major == 4)); var is_nav4up = (is_nav && (is_major >= 4)); var is_navonly = (is_nav && ((agt.indexOf(";nav") != -1) || (agt.indexOf("; nav") != -1)) ); var is_nav6 = (is_nav && (is_major == 5)); var is_nav6up = (is_nav && (is_major >= 5)); var is_gecko = (agt.indexOf('gecko') != -1); var is_ie = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1)); var is_ie6 = (is_ie && (is_major == 4) && (agt.indexOf("msie 6.")!=-1) ); if(is_ie6){ if($("#suche_aktiv").length > 0){ }else{ $.get('http://www.landkreis-ludwigsburg.de/?id=17533&ajax=getIE6SForm&no_cache=1', function(data){ $("#suche").html(data); }); } }else{ $.get('http://www.landkreis-ludwigsburg.de/?id=17533&ajax=getSForm&no_cache=1', function(data){ $("#suche").html(data); bindForm(); }); } }); function bindForm(){ $("#accordion").accordion({ autoHeight: false, active: 0 }); // Tab Was Start // image deletion function function addSelect($item) { $item.fadeOut(function() { $("#sel_all").remove(); $item.removeClass("noselect"); $item.appendTo("#rub-select").fadeIn(); var $org_value = $item.find("input").val(); var $new_value = $org_value * -1; $item.find("input").val($new_value); $item.addClass("select"); }); } // image recycle function function removeSelect($item) { $item.fadeOut(function() { $item.removeClass("select"); $item.appendTo("#rub-pool").show(); var $org_value = $item.find("input").val(); var $new_value = $org_value * -1; $item.find("input").val($new_value); $item.addClass("noselect"); var $rest = $("#rub-select").find("li").text(); // alert($rest); if($rest == '') { $("#rub-select").html('
  • Alle
  • '); } }); } $('div.rubrik ul > li').click(function(ev) { var $item = $(this); var $target = $(ev.target); if ($target.is('li.noselect')) { addSelect($item); } else if ($target.is('li.select')) { removeSelect($item); } return false; }); // Tab Was End // Tab Wann Start // $("#datefrom").datepicker(); $("#datefrom").datepicker({showOn: 'button', buttonImage: 'typo3conf/ext/ma_kvk/pi3/images/calendar.jpg', buttonImageOnly: true, minDate: -0, dateFormat: 'dd.mm.yy', onSelect: function() { $("#kvk_period li.active").removeClass(); } }); $("#dateto").datepicker({showOn: 'button', buttonImage: 'typo3conf/ext/ma_kvk/pi3/images/calendar.jpg', buttonImageOnly: true, minDate: -0, dateFormat: 'dd.mm.yy', onSelect: function() { $("#kvk_period li.active").removeClass(); } }); var today = "19.04.2018"; var week = "25.04.2018"; var twoweeks = "02.05.2018"; var month = "19.05.2018"; var year = "19.04.2019"; $("#btn_today").click(function(){ $("#kvk_period li.active").removeClass("active"); $("#datefrom").val(today); $("#dateto").val(''); $(this).addClass("active"); }); $("#btn_week").click(function(){ $("#kvk_period li.active").removeClass("active"); $("#datefrom").val(today); $("#dateto").val(week); $(this).addClass("active"); }); $("#btn_2weeks").click(function(){ $("#kvk_period li.active").removeClass("active"); $("#datefrom").val(today); $("#dateto").val(twoweeks); $(this).addClass("active"); }); $("#btn_month").click(function(){ $("#kvk_period li.active").removeClass("active"); $("#datefrom").val(today); $("#dateto").val(month); $(this).addClass("active"); }); $("#btn_year").click(function(){ $("#kvk_period li.active").removeClass("active"); $("#datefrom").val(today); $("#dateto").val(year); $(this).addClass("active"); }); $("#kvk_time li").click(function(){ $("#kvk_time li.active").find("input").val(""); $("#kvk_time li.active").removeClass("active"); var $this_value = $(this).text(); $(this).find("input").val($this_value); $(this).addClass("active"); }); // Tab Wann End // Tab Wo Start $('ul#loc1 > li').click(function() { $('ul#loc1 > li').removeClass("active"); var $value_ort = $(this).find("input").val(); $('#selected_ort').val($value_ort); $.get('http://www.landkreis-ludwigsburg.de/?id=17533&ajax=getOrt&ort='+$value_ort, function(data){ $("ul#loc2").html(data); bindLoc2nav(); }); $(this).addClass("active"); }); function bindLoc2nav() { $('ul#loc2 > li').click(function() { var $thisValue = $(this).find("input").val(); if($thisValue != '') { $(this).removeClass("active"); $(this).find("input").val(""); } else { var $new_value = $(this).text(); $(this).find("input").val($new_value); $(this).addClass("active"); } }); }; // Tab Wo End $("#kvk_suchwort").keypress(function (e) { if (e.which == 13 ) { suche(); } }); $("#such_feld").click(function () { suche(); }); function suche(){ $("#kvk_searchoutbox").html(' Bitte haben Sie noch einen Moment Geduld, die Suchergebnisse werden geladen.'); $("#accordion").accordion('activate', 3); var $kvkForm = $("#kvk_searchform").serialize(); $.get('http://www.landkreis-ludwigsburg.de/?id=17533&ajax=getSuche&'+$kvkForm, function(data){ $("#kvk_searchoutbox").html(data); }); return false; }; // BTN Suchen Start $("#btn_step1").click(function(){ $("#accordion").accordion('activate', 1); }); $("#btn_step2").click(function(){ $("#accordion").accordion('activate', 2); }); $(".btn_step3").click(function(){ suche(); }); // BTN Suchen End // BTN Details Start /// BTN Details End }; function toggledetails($eventid) { var $tr_id = "#details_id"+$eventid; var $btn_id = "#btn_detailsid"+$eventid; if($($btn_id).hasClass('myup')){ $($tr_id).hide(); } else{ $($tr_id).show(); } $($btn_id).toggleClass('myup'); var $org_src = $($btn_id).attr("src"); if($org_src == "/typo3conf/ext/ma_kvk/pi3/images/details_plus.png") { $($btn_id).attr("src", "/typo3conf/ext/ma_kvk/pi3/images/details_minus.png") } else { $($btn_id).attr("src", "/typo3conf/ext/ma_kvk/pi3/images/details_plus.png") }; }