
		function toggleSitemap(obj) {
			if (obj == "openAll") {
				$('#sitemap ul').slideDown();
				$('#sitemap li img').attr('src', $('#sitemap li img').attr('src').replace('plus', 'minus'));
			} else if (obj == "closeAll") {
				$('#sitemap ul ul').slideUp();
				$('#sitemap li img').attr('src', $('#sitemap li img').attr('src').replace('minus', 'plus'));
			} else if ($(obj).children('img').attr('src').indexOf('plus') != -1) {
				$(obj).next().slideToggle();
				$(obj).children('img').attr('src', $(obj).children('img').attr('src').replace('plus', 'minus'));
			} else {
				$(obj).next().slideToggle();
				$(obj).children('img').attr('src', $(obj).children('img').attr('src').replace('minus', 'plus'));
			}
		}

		function showFilter(filter) {
			mode = "hide";
			if (!$("#gg_filter_"+filter).hasClass("active"))
				mode = "show";

			$(".gg_filter_a").removeClass("active");
			//$(".filter_auswahl").css("display", "none");
			$(".filter_auswahl").slideUp();

			if (mode == "show" && !$("#gg_filter_"+filter).hasClass("inactive")) {
				$("#gg_filter_"+filter).addClass("active");
				//$("#filter"+filter).css("display", "block");
				$("#filter"+filter).slideToggle();
			}
		}

		function gg_suche_regionChange() {
			hrID = $("#gg_suche_region option:selected").val();

			data = "action=getUnterkategorieByHauptkategorie&hrID="+hrID+"&l="+jsLang;

			$.post("ajaxServer.php", data, function(response){
				if (response.length > 0)
					$("#gg_suche_gegend").html(response);
			});

			data2 = "action=getOrtByHauptkategorie&hrID="+hrID+"&l="+jsLang;
			$.post("ajaxServer.php", data2,
			function(response){
				if (response.length > 0)
					$("#gg_suche_ort").html(response);
			});

			$("#gg_suchbox_region_erweitert").css("display", "block");
			$("#gg_suchbox_results").css("display", "block");
			$("#gg_suchbox_anreise_erweitert").css("display", "block");
			$('#upper_AnzeigenButton').css("display", "none");
		}
		function gg_suche_gegendChange() {
			hrID = $("#gg_suche_region option:selected").val();
			urID = $("#gg_suche_gegend option:selected").val();

			data = "action=getOrtByUnterkategorie&hrID="+hrID+"&urID="+urID+"&l="+jsLang;

			$.post("ajaxServer.php", data,
			function(response){
				if (response.length > 0)
					$("#gg_suche_ort").html(response);
			});
		}
		function gg_suche_ortChange() {
			urID = $("#gg_suche_gegend option:selected").val();

			if (urID == "#") {	// Bei Gegend (Unterkategorie) wurde noch nichts ausgewählt deswegen müssen wir sie updaten
				ortID = $("#gg_suche_ort option:selected").val();

				if (ortID != "#") {
					data = "action=getUnterkategorieByOrt&ortID="+ortID+"&l="+jsLang;
					$.post("ajaxServer.php", data,
					function(response){
						if (response.length > 0) {

							$("#gg_suche_gegend").val(response);
							// Orteliste laut Unterregion updaten
							data2 = "action=getOrtByUnterkategorie&urID="+response+"&l="+jsLang;

							$.post("ajaxServer.php", data2,
							function(response){
								if (response.length > 0) {
									$("#gg_suche_ort").html(response);
									$("#gg_suche_ort").val(ortID);

								}
							});

						}
					});
				}
			}
		}

		function gg_suche_unterkunftChange() {
			unterkunft = $("#gg_suche_unterkunft option:selected").val();

			$("#gg_suchbox_unterkunft_erweitert").css("display","block");
			if (unterkunft == "zimmer") {
				$("#gg_suchbox_zimmer").css("display","block");
			}
			else {
				$("#gg_suchbox_zimmer").css("display","none");
			}

			$("#gg_suche_zimmer").val("#");
			$("#gg_suche_verpflegung").val("#");

			$("#gg_suchbox_results").css("display", "block");
			$("#gg_suchbox_anreise_erweitert").css("display", "block");
			$('#upper_AnzeigenButton').css("display", "none");
		}

		function gg_suche_filterDeaktivieren() {
			if ($(".filter_auswahl input[type='checkbox']:checked").size() > 0) {
				notDeact = "";
				$(".filter_auswahl input[type='checkbox']:checked").parents('.filter_auswahl').each(function(i) {
					notDeact += "#" + $(this).attr("id").replace("filter", "gg_filter_")+ ", ";
				});

				$('.gg_filter_a:not(' + notDeact + ' #gg_filter_Ausstattung)').addClass("inactive");
			}
		}

		function gg_suche_filterAktivieren() {
			$('.gg_filter_a').removeClass("inactive");
		}

		function gg_suche_getAjaxErgebnisse() {

			if ($("#alle_sportler:checked, #alle_entdecker:checked, #alle_gesundheit:checked, #alle_kinder:checked").size() > 0) {	// Ein Thema wurde gewählt, alle Untermerkfilter werden "unchecked" und deaktivert
				$(".filter_auswahl .filter_auswahl_spalte input[type='checkbox'] :not(#gg_filter_Ausstattung)").removeAttr("checked").attr("disabled", "disabled");
				$(".filter_auswahl .filter_auswahl_spalte input[type='checkbox'] :not(#gg_filter_Ausstattung)").next().addClass("inactive");
			}
			else {
				$(".filter_auswahl .filter_auswahl_spalte input[type='checkbox']").removeAttr("disabled");
				$(".filter_auswahl .filter_auswahl_spalte input[type='checkbox']").next().removeClass("inactive");
			}

			// ein Filter wurde gesetzt ... Button alle Anfragen deaktivieren
			if ($(".filter_auswahl input[type='checkbox']:checked").size() > 0) {
				$(".button_AlleAnfragen").hide();
				// alle anderen Filter deaktivieren
				gg_suche_filterDeaktivieren();
			}
			else {
				$(".button_AlleAnfragen").show();
				// alle anderen Filter aktivieren
				gg_suche_filterAktivieren();
			}


			data = "action=getSearchResults&l="+jsLang;
			$("#form_ggSuche select").each(function (i) {	// alle Selects
			 	data += "&"+$(this).attr("name") + "=" + $(this).val();
      		});
			$("#form_ggSuche input[type='checkbox']:checked, #form_ggSuche input[type='password'], #form_ggSuche input[type='text']").each(function (i) {	// alle Checkboxen
			 	data += "&"+$(this).attr("name") + "=" + $(this).val();
      		});

			$("#form_ggSuche input[type='hidden']").each(function (i) {	// Datum
			 	data += "&"+$(this).attr("name") + "=" + $(this).val();
      		});

			$.post("ajaxServer.php", data, function(response){
				if (response.length > 0) {
					$("#gg_suchbox_results .anzahl").html(response);
					$("#gg_suchbox_results").css("display", "block");
					gg_suche_changePadding();
				}
			});
		}
        
		function gg_suche_getAjaxErgebnisseEnHome() {
			
			elementID = $(this).attr("id");
			elementVal = $(this).val();
			
			// schauen ob wir in Schritt 3 sind und dann die Dropdowns anzeigen je nachdem was geklickt wurde
			if (elementID == "s3") {
				if (elementVal == "fewo") {
					$("#s4").val("#");
					$("#s4").hide();							
					$("#s5").show();
				}
				else if (elementVal == "zimmer") {
					$("#s4").show();
					$("#s5").val("#");
					$("#s5").hide();
				}
				else {
					$("#s4, #s5").val("#");
					$("#s4, #s5").hide();
				}
			}
			else if (elementID == "s4") {
				$("#s5").show();
			}
			
			data = "action=getSearchResults&l="+jsLang;
			data += ($("#s0").val() != "") ? "&s0=" + $("#s0").val() : "";
			data += ($("#s3").val() != "") ? "&s3=" + $("#s3").val() : "";
			data += ($("#s4").val() != "") ? "&s4=" + $("#s4").val() : "";
			data += ($("#s5").val() != "") ? "&s5=" + $("#s5").val() : "";
			
			if ($("#enBookingHome_schritt2Frei").attr("checked") == "checked" || $("#enBookingHome_schritt2Frei").attr("checked") == true || $("#schritt2Frei").val() == "1") {
				data += ($("#s6").val() != "") ? "&s6=" + $("#s6").val() : "";
				data += ($("#s7").val() != "") ? "&s7=" + $("#s7").val() : "";
			}
			
			$.post("ajaxServer.php", data, function(response){
				if (response.length > 0) {
					$("#enBookingAnzahl").html(response);
					
				}
			});
		}

		function gg_suche_changePadding() {
			if ($(".content_eineSpalte").size() > 0 && $("#ggSuchbox").size() > 0) {
				paddingJetzt = $(".content_eineSpalte").css("padding-top").replace(/px/g, "");
				suchboxHeight = $("#ggSuchbox").height();
				if (!isNaN(paddingJetzt) && !isNaN(suchboxHeight)) {
					paddingNew = paddingJetzt + suchboxHeight - 70;
					if (paddingNew > paddingJetzt && paddingNew < 1000) {
						$(".content_eineSpalte").css("padding-top", paddingNew + "px");
						if ($.browser.msie) { // zoom 1 für IE7 - bilder rutschen sonst nicht mit...
							$(".gastgeberTable").css("zoom", 1);
						}
					}
				}
			}
		}
		function showRegionOverlay() {
			if ($(".spRechts_region").hasClass("spRechts_region_active")) {
				$(".spRechts_region").removeClass("spRechts_region_active");
				$(".urOverlay").hide();
			}
			else {
				gesHeight = $(".contentMainRight").height();

				wetterHeight = bilderHeight = 0;
				wetterPaddingTop = wetterPaddingBottom = bilderPaddingTop = bilderPaddingBottom = 0;

				PaddingContentTop = 0;

				if ($(".content_eineSpalte").css("padding-top") != null)
					PaddingContentTop = $(".content_eineSpalte").css("padding-top").replace(/px/g, "");


				wetterHeight = $(".spRechts_wetter").height();
				bilderHeight = $(".spRechts_bilder").height();

				if ($(".spRechts_wetter").css("padding-top") != null)
					wetterPaddingTop = $(".spRechts_wetter").css("padding-top").replace(/px/g, "");
				if ($(".spRechts_wetter").css("padding-bottom") != null)
					wetterPaddingBottom = $(".spRechts_wetter").css("padding-bottom").replace(/px/g, "");
				if ($(".spRechts_bilder").css("padding-top") != null)
					bilderPaddingTop = $(".spRechts_bilder").css("padding-top").replace(/px/g, "");
				if ($(".spRechts_bilder").css("padding-bottom") != null)
					bilderPaddingBottom = $(".spRechts_bilder").css("padding-bottom").replace(/px/g, "");

				if (isNaN(PaddingContentTop) || PaddingContentTop == null) PaddingContentTop = 0;

				if (isNaN(wetterHeight) || wetterHeight == null) wetterHeight = 0;
				if (isNaN(bilderHeight) || bilderHeight == null) bilderHeight = 0;

				if (isNaN(wetterPaddingTop) || wetterPaddingTop == null) wetterPaddingTop = 0;
				if (isNaN(wetterPaddingBottom) || wetterPaddingBottom == null) wetterPaddingBottom = 0;
				if (isNaN(bilderPaddingTop) || bilderPaddingTop == null) bilderPaddingTop = 0;
				if (isNaN(bilderPaddingBottom) || bilderPaddingBottom == null) bilderPaddingBottom = 0;

				gesHeight = parseFloat(gesHeight);
				wetterHeight = parseFloat(wetterHeight);
				bilderHeight = parseFloat(bilderHeight);
				wetterPaddingTop = parseFloat(wetterPaddingTop);
				wetterPaddingBottom = parseFloat(wetterPaddingBottom);
				bilderPaddingTop = parseFloat(bilderPaddingTop);
				bilderPaddingBottom = parseFloat(bilderPaddingBottom);
				PaddingContentTop = parseFloat(PaddingContentTop);

				var top = parseFloat(gesHeight - wetterHeight - bilderHeight - wetterPaddingTop - wetterPaddingBottom - bilderPaddingTop - bilderPaddingBottom + PaddingContentTop - 1);
                                top=top-110;
                                        
				$(".urOverlay").css("top",top+"px").show();
				$(".spRechts_region").addClass("spRechts_region_active");
			}
		}

		function gallery_showLightbox(bild, width, height) {
			lbData = '<img src="'+bild+'" class="lb-close" style="cursor:pointer;"/>';
			lbData += '<br /><br /><img src="./images/gallery_schliessen.png" class="lb-close-button" style="cursor:pointer;" />';

			axmLb_show(lbData, width, height+40, '.lb-close, .lb-close-button');

			return false;
		}

		function iframe_showLightbox(src, width, height) {
			lbData = '<iframe name="lbIFame" src="' + src + '" frameborder="0" width="' + width + '" height="' + height + '"></iframe>';
			lbData += '<br /><br /><img src="./images/gallery_schliessen.png" class="lb-close-button" style="cursor:pointer;" />';

			axmLb_show(lbData, width, height+40, '.lb-close-button');

			return false;
		}

		function showSuchPage(seite) {
            if (seite==1) $("#formNorandom").val(1);
			$("#suchboxPage").val(seite);
			$("#form_ggSuche").submit();
		}

		function setFontSize(size) {
			if(size == null) {
				size = 11;
			}
			$('body').css('font-size', size + 'px');
			var date = new Date();
			date.setTime(date.getTime() + (365 * 24 * 60 * 60 * 1000));
			$.cookie('alpine-gastgeber_font_size', size, { path: '/', expires: date });
			gg_suche_changePadding();
		}

        function addFavourite(fav) {
            $.ajax({
                url: "http://alpinegastgeber.anfrageassistent.com/de/enquiryPool/",
                data: "action=add&snippet=1&acco="+fav,
                success: function(data) {
                    alert("Ihre Merkliste wurde upgedated!"+data);
                }
            });
        }
		
		function addAxmMerkliste(betriebID) {
			$.ajax({
				type: "POST",
				url: "ajaxServer.php",
				data: "action=addToMerkliste&betriebID="+betriebID,
				success: function(response){
					$("#merklisteCnt").addClass("zahl").html(response);
					$("#button_addMerkliste_"+betriebID).toggle();
					
				}
			});
		}
		function deleteAxmMerkliste(betriebID) {
			$('#iFrameContainer').html('<iframe width="1" border="0" height="1" src="http://alpinegastgeber.anfrageassistent.com/'+jsLang+'/enquiryPool/?action=remove&acco=' + betriebID + '" frameborder="0" framespacing="0" border="0"></iframe>');
			
			
			$.ajax({
				type: "POST",
				url: "ajaxServer.php",
				data: "action=deleteFromMerkliste&betriebID="+betriebID,
				success: function(response){					
					$("#merklisteCnt").addClass("zahl").html(response);					
				}
			});
			
			$("#merklisteEintrag_"+betriebID).toggle(500);
		}
	

        getFlickrImages = function (x) {
        	count=0;
        	$.getJSON("http://api.flickr.com/services/feeds/photos_public.gne?id="+x+"&lang=de-de&format=json&jsoncallback=?", function(data){
        		$.each(data.items, function(i,item){
        			if (count<5)
        				$("#flickr-results").append('<div><img src="'+item.media.m+'" width="170" height="120" alt="" /></div>');
        			//	$("<img/>").attr("src", item.media.m).attr("width", "170").attr("border", "0").appendTo("#flickr-results"); //.wrap("<a href='" + item.link + "'></a>");
        			count++;
        		});
        		$("#flickr-results").cycle();
        	});
        }



