// jquery functions


$(document).ready(function(){
	
	// set chat countdown
	//countdown();
	
	// Styleswitcher laden
	loadStyle();
		
		
	//SkipLinks + IE6
	
	BrowserDetect.init();
	

	if((BrowserDetect.browser == "Explorer") &&  (BrowserDetect.version == 6)) {	
		$(".skip").focus(function(){$(this).removeClass("skip").addClass("skip_focus");})
		$(".skip").blur(function(){$(this).removeClass("skip_focus").addClass("skip");})
	}

	
	// create PopUp
	
	$(".popup_link").click(function(){
		fenster = window.open(this.href, "popup", "width=550,height=500,status=no,scrollbars=yes,resizable=yes");
		fenster.focus();
		return false;
	});
	
	$("#popup").css("width", "auto");
	$("#popup").css("min-width", "50em");
	
	$("#popup_menu").html('<a href="javascript:window.close()" title="Fenster schlie&szlig;en">[x] Fenster schlie&szlig;en</a>');
	
	
	
	//Drop-Down for Rezepte (only hide - dropdown via expertenchat)
	
	$("#tx-guestbook-rezepte").parent().prev().wrapInner('<a href="javascript:empty();" class="dropdownlink_open" title="Formaular ein-/ausblenden"></a>');
	$("#tx-guestbook-rezepte").parent().prev().children("a").click(function () {		 
		$("#tx-guestbook-rezepte").slideToggle("fast");
				
		if( $(this).hasClass("dropdownlink_open") ) {
			$(this).removeClass("dropdownlink_open");
			$(this).addClass("dropdownlink");
		} else {
			$(this).removeClass("dropdownlink");
			$(this).addClass("dropdownlink_open");
		}					
   	});
	
	
	//Drop-Down for Expertenchat	
	
	//immer einblenden bis Chatinhalte angelegt wurden
	
	/*if($("#tx-guestbook-error").text() == ""){
		$("#tx-guestbook").hide();
		$("#tx-guestbook-error").hide();
	}
	*/
	//change class
	$("#tx-guestbook").parent().prev().wrapInner('<a href="javascript:empty();" class="dropdownlink_open" title="Formaular ein-/ausblenden"></a>');			
	$("#tx-guestbook").parent().prev().children("a").click(function () {		 
		$("#tx-guestbook").slideToggle("fast");
				
		if( $(this).hasClass("dropdownlink_open") ) {
			$(this).removeClass("dropdownlink_open");
			$(this).addClass("dropdownlink");
		} else {
			$(this).removeClass("dropdownlink");
			$(this).addClass("dropdownlink_open");
		}					
   	});
	
	
	$(".profilcontent").hide();
	$(".expertenchat-profil").find("h1").wrap('<a href="javascript:empty();" class="dropdownlink" title="Expertenprofil ein-/ausblenden"></a>');			
	$(".expertenchat-profil .dropdownlink").click(function () {		 
		$(".profilcontent").slideToggle("fast");
				
		if( $(this).hasClass("dropdownlink_open") ) {
			$(this).removeClass("dropdownlink_open");
			$(this).addClass("dropdownlink");
		} else {
			$(this).removeClass("dropdownlink");
			$(this).addClass("dropdownlink_open");
		}					
   	});
	
	
	// Termine - clear searchfield on click
	
	searchlabeltext2 = $("input#sk_searchword").val();
	
	$("input#sk_searchword").focus(function() {
	  if(this.value==searchlabeltext2) this.value='';
	});
    
	$("input#sk_searchword").blur(function() {
	  if(this.value=='') this.value=searchlabeltext2;
	});	
	
	
	//Drop-Down for Kontakte Details
   	
   	$(".tx-lumogooglemaps-pi1 .map_item .map_details").hide();
	$(".tx-lumogooglemaps-pi1 .map_item h3").wrap('<a href="javascript:empty();" class="dropdownlink" title="Details ein-/ausblenden"></a>');		
	$(".tx-lumogooglemaps-pi1 .map_item .dropdownlink").click(function () {		 
		$(this).parent().find(".map_details").slideToggle("fast");
				
		if( $(this).hasClass("dropdownlink_open") ) {
			$(this).removeClass("dropdownlink_open");
			$(this).addClass("dropdownlink");
		} else {
			$(this).removeClass("dropdownlink");
			$(this).addClass("dropdownlink_open");
		}					
   	});
	
	
	//Drop-Down for Kontakte
	
	
	//$(".tx-lumogooglemaps-pi1 #map_filter form").hide();
	$(".tx-lumogooglemaps-pi1 #map_filter h1").wrap('<a href="javascript:empty();" class="dropdownlink_open" title="Formaular ein-/ausblenden"></a>');			
	$(".tx-lumogooglemaps-pi1 #map_filter .dropdownlink_open").click(function () {		 
		$(".tx-lumogooglemaps-pi1 #map_filter form").slideToggle("fast");
				
		if( $(this).hasClass("dropdownlink_open") ) {
			$(this).removeClass("dropdownlink_open");
			$(this).addClass("dropdownlink");
		} else {
			$(this).removeClass("dropdownlink");
			$(this).addClass("dropdownlink_open");
		}					
   	});
	
	
	// Filter for Kontakte	
	
	$(".tx-lumogooglemaps-pi1 #map_filter #map_filter_button").hide();
	
	
	$(".tx-lumogooglemaps-pi1 #map_filter #check_all").click(function(){
				
		if($(this).is(":checked"))
		{			
			$(".tx-lumogooglemaps-pi1 #map_filter .formelement input").each(function() {
				$(this).attr("checked", "checked");
				$(".tx-lumogooglemaps-pi1 #map_list_list .map_item").show();
				$(".tx-lumogooglemaps-pi1 #map_list_list .error").remove();
			});			
		} else {			
			$(".tx-lumogooglemaps-pi1 #map_filter .formelement input").each(function() {
				$(this).attr("checked", "");
			});
			
			$(".tx-lumogooglemaps-pi1 #map_list_list .map_item").hide();
			$(".tx-lumogooglemaps-pi1 #map_list_list").prepend('<p class="error">Es wurden leider keine Eintr&auml;ge gefunden.</p>');
		}
	});
	
	
	$(".tx-lumogooglemaps-pi1 #map_filter .formelement input").click(function(){
		
		$(".tx-lumogooglemaps-pi1 #map_list_list .error").remove();
		
		if($(".tx-lumogooglemaps-pi1 #map_filter .formelement input:checked").length == 9){
			$(".tx-lumogooglemaps-pi1 #map_filter #check_all").attr("checked", "checked");
			$(".tx-lumogooglemaps-pi1 #map_list_list .map_item").show();
		} else {
			
			$(".tx-lumogooglemaps-pi1 #map_filter #check_all").attr("checked", "");
			
			count=9;

			$(".tx-lumogooglemaps-pi1 #map_filter .formelement input").each(function() {
				
				pfad= ".tx-lumogooglemaps-pi1 #map_list_list .mapjs_"+$(this).val();
						
				if($(this).is(":checked")) {
					$(pfad).show();
				} else {
					$(pfad).hide();
					count=count-1;
				}
			});
			
			if(count == 0){
				$(".tx-lumogooglemaps-pi1 #map_list_list").prepend('<p class="error">Es wurden leider keine Eintr&auml;ge gefunden.</p>');
			}
		}
	});
	
		
	//Drop-Down for Termine
	
	
	//$(".tx-skcalendar-pi1 .search form").hide();
	$(".tx-skcalendar-pi1 .search h2").wrap('<a href="javascript:empty();" class="dropdownlink_open" title="Formaular ein-/ausblenden"></a>');			
	$(".tx-skcalendar-pi1 .search .dropdownlink_open").click(function () {		 
		$(".tx-skcalendar-pi1 .search form").slideToggle("fast");
				
		if( $(this).hasClass("dropdownlink_open") ) {
			$(this).removeClass("dropdownlink_open");
			$(this).addClass("dropdownlink");
		} else {
			$(this).removeClass("dropdownlink");
			$(this).addClass("dropdownlink_open");
		}					
   	});
	
	
	//$(".tx-skcalendar-pi1 .filter form").hide();
	$(".tx-skcalendar-pi1 .filter h2").wrap('<a href="javascript:empty();" class="dropdownlink_open" title="Formaular ein-/ausblenden"></a>');			
	$(".tx-skcalendar-pi1 .filter .dropdownlink_open").click(function () {		 
		$(".tx-skcalendar-pi1 .filter form").slideToggle("fast");
				
		if( $(this).hasClass("dropdownlink_open") ) {
			$(this).removeClass("dropdownlink_open");
			$(this).addClass("dropdownlink");
		} else {
			$(this).removeClass("dropdownlink");
			$(this).addClass("dropdownlink_open");
		}					
   	});
	
	$(".tx-skcalendar-pi1 .listentry .entry_details").hide();
	$(".tx-skcalendar-pi1 .listentry h3").wrap('<a href="javascript:empty();" class="dropdownlink" title="Details ein-/ausblenden"></a>');			
	$(".tx-skcalendar-pi1 .listentry .dropdownlink").click(function () {		 
		$(this).parent().find(".entry_details").slideToggle("fast");
				
		if( $(this).hasClass("dropdownlink_open") ) {
			$(this).removeClass("dropdownlink_open");
			$(this).addClass("dropdownlink");
		} else {
			$(this).removeClass("dropdownlink");
			$(this).addClass("dropdownlink_open");
		}					
   	});
	
	
	// Ajax for Termine
	
	if(!((BrowserDetect.browser == "Explorer") && (BrowserDetect.version == 6))) {
		$(".tx-skcalendar-pi1 .filter #sk_filterbutton").hide();
	}
	
	$(".tx-skcalendar-pi1 .filter select").change(function(){
	if(!((BrowserDetect.browser == "Explorer") && (BrowserDetect.version == 6))) {		
		datastring = '';
		count = 0;
		
		$(".tx-skcalendar-pi1 .filter input").each(function() {			
		
				if(count != 0) {
					datastring = datastring + "&";
				}
				datastring = datastring  + $(this).attr("name") + "=" +  $(this).attr("value");
				//alert (datastring);
				count=1;
		});
		
		$(".tx-skcalendar-pi1 .filter select").each(function() {			
				if($(this).attr("value")) {
					datastring = datastring  + "&" + $(this).attr("name") + "=" +  $(this).attr("value");
				}
				//alert (datastring);
		});
		
		$(".tx-skcalendar-pi1 .listview").html('<p><img alt="Ladeanzeige" title="Ladeanzeige" width="20px" src="/fileadmin/css/darmkrebs/img/loading.gif" />&nbsp;&nbsp;Anzeige wird gefiltert ...</p>');	
			
		var ajaxManagerTermine = $.manageAjax({manageType: 'abortOld', maxReq: 0}); 
		ajaxManagerTermine.add({
			type: "POST",
			url: document.URL,
			data: datastring,
			success:  function(data){
				$(".tx-skcalendar-pi1 .listview").html( $(".tx-skcalendar-pi1 .listview", data).html() );
				
				$(".tx-skcalendar-pi1 .listentry .entry_details").hide();
				$(".tx-skcalendar-pi1 .listentry h3").wrap('<a href="javascript:empty();" class="dropdownlink" title="Details ein-/ausblenden"></a>');			
				$(".tx-skcalendar-pi1 .listentry .dropdownlink").click(function () {		 
					$(this).parent().find(".entry_details").slideToggle("fast");
							
					if( $(this).hasClass("dropdownlink_open") ) {
						$(this).removeClass("dropdownlink_open");
						$(this).addClass("dropdownlink");
					} else {
						$(this).removeClass("dropdownlink");
						$(this).addClass("dropdownlink_open");
					}					
				});	
			}
		});
		
		//return false;
	}
	});
	
	$(".tx-skcalendar-pi1 .link a").click(function(){
	if(!((BrowserDetect.browser == "Explorer") && (BrowserDetect.version == 6))) {
		
		$(".tx-skcalendar-pi1 .listview").html('<p><img alt="Ladeanzeige" title="Ladeanzeige" width="20px" src="/fileadmin/css/darmkrebs/img/loading.gif" />&nbsp;&nbsp;Alle Eintr&auml;ge werden geladen ...</p>');	
		
		
		datastring = '';
		
		$.ajax({
			type: "POST",
			url: document.URL,
			data: datastring,
			success:  function(data){
				$(".tx-skcalendar-pi1 .listview").html( $(".tx-skcalendar-pi1 .listview", data).html() );
				
				$(".tx-skcalendar-pi1 .listentry .entry_details").hide();
				$(".tx-skcalendar-pi1 .listentry h3").wrap('<a href="javascript:empty();" class="dropdownlink" title="Details ein-/ausblenden"></a>');			
				$(".tx-skcalendar-pi1 .listentry .dropdownlink").click(function () {		 
					$(this).parent().find(".entry_details").slideToggle("fast");
							
					if( $(this).hasClass("dropdownlink_open") ) {
						$(this).removeClass("dropdownlink_open");
						$(this).addClass("dropdownlink");
					} else {
						$(this).removeClass("dropdownlink");
						$(this).addClass("dropdownlink_open");
					}					
				});	
			}
		});


		document.getElementById('organizers').selectedIndex = 0;
		document.getElementById('categories').selectedIndex = 0;
		document.getElementById('monthlist').selectedIndex = 0;		
		
		return false;
	}
	});
	
	
	
	// Fontsize-Changer
	
	var clicked = 0;
	
	if(Stil == "groesser") {
		$("#fontsize .fontsize_big a").addClass("active");
		$("#fontsize .fontsize_big a").css("background-color", "#FFFFFF");
		$("#fontsize .fontsize_big a").children().css("color", "#96BB19");
	} else if (Stil == "standard") {
		$("#fontsize .fontsize_normal a").addClass("active");
		$("#fontsize .fontsize_normal a").css("background-color", "#FFFFFF");
		$("#fontsize .fontsize_normal a").children().css("color", "#96BB19");
	} else if (Stil == "kleiner") {
		$("#fontsize .fontsize_small a").addClass("active");
		$("#fontsize .fontsize_small a").css("background-color", "#FFFFFF");
		$("#fontsize .fontsize_small a").children().css("color", "#96BB19");
	}
	
	
	$("#fontsize a").focus(function() {
		$(this).css("background-color", "#FFFFFF");
		$(this).children().css("color", "#96BB19");
	});
	
	$("#fontsize a").click(function() {
		clicked = 1;
		$("#fontsize a").removeClass();
		$("#fontsize a").css("background-color", "#96BB19");
		$("#fontsize a").children().css("color", "#FFFFFF");
		$(this).addClass("active");
		$(this).css("background-color", "#FFFFFF");
		$(this).children().css("color", "#96BB19");
	});
	
	$("#fontsize a").blur(function() {
		if(clicked == 0 && !$(this).hasClass("active")) {
			$(this).css("background-color", "#96BB19");
			$(this).children().css("color", "#FFFFFF");
			$(this).removeClass("active")
		}
		clicked = 0;
	});
	
	$("#fontsize a").hover(
		function() {
			$(this).css("background-color", "#FFFFFF");
			$(this).children().css("color", "#96BB19");
		},
		function(){
			if(clicked == 0 && !$(this).hasClass("active")) {
				$(this).css("background-color", "#96BB19");
				$(this).children().css("color", "#FFFFFF");
				
			}
			clicked = 0;
		}
	);

	
	
	// Barrierefreie Navigation
	
	
	$("#nav_main ul li a").focus(function() {
		$(this).parent().children("ul").css({left: "auto", display:"block"});
		$(this).parent().children("a").addClass("active");
		$(this).parent().addClass("active");
	});
	
	$("#nav_main ul li a").blur(function() {
		$(this).parent().children("ul").css({left: "-5000px"});
		$(this).parent().removeClass("active");
		$(this).removeClass("active");
	});
	
	$("#nav_main ul li ul li a").focus(function() {
		$(this).parent().parent().parent().children("ul").css({left:"auto", display:"block"});
		$(this).parent().parent().parent().children("a").addClass("active");
		$(this).parent().parent().parent().addClass("active");
	});
	
	$("#nav_main ul li ul li a").blur(function() {
		$(this).parent().parent().parent().children("ul").css({left: "-5000px"});
		$(this).parent().parent().parent().children("a").removeClass("active");
		$(this).parent().parent().parent().removeClass("active");
	});
	
	
	$("#nav_main ul li").hover(
		function(){
		  	$(this).children("ul").css({left: "auto"});
		},
		function(){
			$(this).children("ul").css({left: "-5000px"});
			$(this).children("a").removeClass("active");
		    $(this).removeClass("active");  
		}
	);
	
	
	
	
	// clear searchfield on click
	
	searchlabeltext = $("input#searchinput").val();
	
	$("input#searchinput").focus(function() {
	  if(this.value==searchlabeltext) this.value='';
	});
    
	$("input#searchinput").blur(function() {
	  if(this.value=='') this.value=searchlabeltext;
	});	
	
	
	//Scroll to top
		

	$("#totop a").click(function() {
		$.scrollTo(0, 600);
	});
	
	$("#totop a").removeAttr("href");
	
	
	
	//Tooltips for all external Links
		
	$("a.externer_link").tooltip({delay: 0, bodyHandler: function() {
			var legalString = "<p>Dieser Link f&uuml;hrt zu Angeboten/Inhalten eines Dritten. www.darmkrebs.at hat keinen Einfluss auf die Gestaltung und Inhalte dieser Seite und &uuml;bernimmt daher keine Haftung f&uuml;r diese Angebote/Inhalte.</p>"
			var title = this.tooltipText;
			var output = legalString+"<h2>"+title+"</h2>";
			
			return output;
		}
	});
	
	$("a.verdino_link").tooltip({delay: 0, bodyHandler: function() {
			var legalString = "<p>Dieser Link f&uuml;hrt zu Angeboten/Inhalten eines Dritten. www.darmkrebs.at hat keinen Einfluss auf die Gestaltung und Inhalte dieser Seite und &uuml;bernimmt daher keine Haftung f&uuml;r diese Angebote/Inhalte.</p>"
			var title = this.tooltipText;
			var output = legalString+"<h2>"+title+"</h2>";
			
			return output;
		}
	});
	
	
	
	//Accordion for service-boxes
	
	
	if ($("#col2_content").html()) {
		$("#col2_content").Accordion({header: 'h2', alwaysOpen: true, animated: false});
		
		$("#col2_content h2").eq(0).parent().removeClass("service_content").addClass("service_content_active");
		$("#col2_content h2").eq(0).parent().prev().removeClass("service_top").addClass("service_top_active");
		$("#col2_content h2").eq(0).parent().next().removeClass("service_bottom").addClass("service_bottom_active");
		
		//Background Image austauschen
		$("#col2_content h2").click(function (){
			
			if (!$(this).hasClass('selected')) {
				clearAllServiceActives();
				$(this).parent().removeClass("service_content").addClass("service_content_active");
				$(this).parent().prev().removeClass("service_top").addClass("service_top_active");
				$(this).parent().next().removeClass("service_bottom").addClass("service_bottom_active");
			}
			else return false;
		});
	}
	
	function clearAllServiceActives () {
		$("#col2_content").find("div.service_content_active").removeClass("service_content_active").addClass("service_content");
		$("#col2_content").find("div.service_top_active").removeClass("service_top_active").addClass("service_top");
		$("#col2_content").find("div.service_bottom_active").removeClass("service_bottom_active").addClass("service_bottom");
	}
	
	$("#col2_content h2").wrapInner('<a href="javascript:empty();" class="servicelink" title="Servicebox einblenden"></a>');
	
	
	/*//Accordion for Glossarentrys
	if ($("#col3_content .tx-a21glossaryadvancedoutput-pi1").html()) {
		$("#col3_content .tx-a21glossaryadvancedoutput-pi1").Accordion({header: 'h2', alwaysOpen: true, animated: false});
	}
	$("#col3_content .tx-a21glossaryadvancedoutput-pi1 h2").wrapInner('<a href="javascript:empty()" title="Glossareintrag ein-/ausblenden" class="glossarylink"></a>');
	$("#col3_content .tx-a21glossaryadvancedoutput-pi1 h2 a").eq(0).removeClass("glossarylink").addClass("glossarylink_open");
	$("#col3_content .tx-a21glossaryadvancedoutput-pi1 h2 a").click(function (){			
			if (!$(this).hasClass("glossarylink_open")) {
				clearAllGlossaryActives ();
				$(this).removeClass("glossarylink");
				$(this).addClass("glossarylink_open");
			}
			else return false;
	});
	
	function clearAllGlossaryActives () {
		$("#col3_content .tx-a21glossaryadvancedoutput-pi1 h2").find("a.glossarylink_open").removeClass("glossarylink_open").addClass("glossarylink");
	}
	*/
	
	
	//Drop-Down forGlossary
	$(".tx-a21glossaryadvancedoutput-pi1 .glossarentry h2").wrap('<a href="javascript:empty();" class="dropdownlink" title="Glossareintrag ein-/ausblenden"></a>');		
	$(".tx-a21glossaryadvancedoutput-pi1 .glossarentry p").hide();
	
	$(".tx-a21glossaryadvancedoutput-pi1 .glossarentry").eq(0).find("p").show();
	$(".tx-a21glossaryadvancedoutput-pi1 .glossarentry").eq(0).find("a").removeClass("dropdownlink").addClass("dropdownlink_open");
		
	$(".tx-a21glossaryadvancedoutput-pi1 .glossarentry .dropdownlink").click(function () {
		$(this).parent().find("p").slideToggle("fast");
						
		if( $(this).hasClass("dropdownlink_open") ) {
			$(this).removeClass("dropdownlink_open");
			$(this).addClass("dropdownlink");
		} else {
			$(this).removeClass("dropdownlink");
			$(this).addClass("dropdownlink_open");
		}
   	});
	
	$(".tx-a21glossaryadvancedoutput-pi1 .glossarentry .dropdownlink_open").click(function () {
		$(this).parent().find("p").slideToggle("fast");
						
		if( $(this).hasClass("dropdownlink_open") ) {
			$(this).removeClass("dropdownlink_open");
			$(this).addClass("dropdownlink");
		} else {
			$(this).removeClass("dropdownlink");
			$(this).addClass("dropdownlink_open");
		}
   	});
	
	
	
	//Tip a Friend Rollover
	
	$("a#seiteversenden").hover(
		function(){
		  $("#pagefeatures_rollover").html("Seite weiterempfehlen");
		},
		function(){
		  $("#pagefeatures_rollover").empty();
		}
	);
	
	$("a#seiteversenden").focus(
		function(){
		  $("#pagefeatures_rollover").html("Seite weiterempfehlen");
		}
	);
	
	$("a#seiteversenden").blur(
		function(){
		  $("#pagefeatures_rollover").empty();
		}
	);
	
	
});




// additional JavaScript Functions


// Ajax for Map

function MapAjax() {
		datastring = '';
		count = 0;
		
		if($(".tx-lumogooglemaps-pi1 #map_filter #check_all").is(":checked")) {
			datastring = "tx-lumogooglemaps-pi1[all]=all";
		} else {
			$(".tx-lumogooglemaps-pi1 #map_filter .formelement input").each(function() {			
				if($(this).is(":checked")) {
					if(count != 0) {
						datastring = datastring + "&";
						
					}
					datastring = datastring  + $(this).attr("name") + "=" +  $(this).attr("value");
					//alert (datastring);
					count=1;
				}
			});
		}
		
		datastring = datastring  + "&tx-lumogooglemaps-pi1[recall]=yes";
		
		$(".tx-lumogooglemaps-pi1 #map_list_list").html('<p><img alt="Ladeanzeige" title="Ladeanzeige" width="20px" src="/fileadmin/css/darmkrebs/img/loading.gif" />&nbsp;&nbsp;Anzeige wird gefiltert</p>');

		var ajaxManagerMap = $.manageAjax({manageType: 'abortOld', maxReq: 0}); 
		ajaxManagerMap.add({
			type: "POST",
			url: document.URL,
			data: datastring,
			success:  function(data){
									
				$(".tx-lumogooglemaps-pi1 #map_list_list").html( $(".tx-lumogooglemaps-pi1 #map_list_list", data).html() );
					
				$(".tx-lumogooglemaps-pi1 .map_item .map_details").hide();
				$(".tx-lumogooglemaps-pi1 .map_item h3").wrap('<a href="javascript:empty();" class="dropdownlink" title="Details ein-/ausblenden"></a>');		
				$(".tx-lumogooglemaps-pi1 .map_item .dropdownlink").click(function () {		 
					$(this).parent().find(".map_details").slideToggle("fast");
							
					if( $(this).hasClass("dropdownlink_open") ) {
						$(this).removeClass("dropdownlink_open");
						$(this).addClass("dropdownlink");
					} else {
						$(this).removeClass("dropdownlink");
						$(this).addClass("dropdownlink_open");
					}					
			   	});				
			}
		});
}


// PageFeatures

function createPageFeatures () {
	
	// Print
	document.write("<a href='javascript:window.print();' id='print'><img src='fileadmin/css/darmkrebs/img/icon_seitedrucken.gif' alt='Seite drucken' title='Seite drucken' /></a>");
	

	//Rollover
	$("a#print").hover(
		function(){
		  $("#pagefeatures_rollover").html("Seite drucken");
		},
		function(){
		  $("#pagefeatures_rollover").empty();
		}
	);
	

	//Focus
	$("a#print").focus(
		function(){
		  $("#pagefeatures_rollover").html("Seite drucken");
		}
	);
	$("a#print").blur(
		function(){
		  $("#pagefeatures_rollover").empty();
		}
	);
}

// FontSize - changer

function createFontSize () {
	
	//Schriftgroessen einstellen
	
	document.write("<span class='text'>Schriftgr&ouml;&szlig;e &auml;ndern:</span>");
				   
		document.write("<span class='fontsize_big'><span class='wai'>&nbsp;&nbsp;gr&ouml;&szlig;er&nbsp;</span><a href='javascript:setStyle(\"groesser\");' id='groesser' title='Schrift vergr&ouml;&szlig;ern'><span class='fontsize_big_text'>A</span></a></span>");
	
		document.write("<span class='fontsize_normal'><span class='wai'>&nbsp;&nbsp;standard&nbsp;</span><a href='javascript:setStyle(\"standard\");' id='standard' title='Schrift zur&uuml;cksezten'><span class='fontsize_normal_text'>A</span></a></span>");
	
		document.write("<span class='fontsize_small'><span class='wai'>&nbsp;&nbsp;kleiner&nbsp;</span><a href='javascript:setStyle(\"kleiner\");' id='kleiner' title='Schrift verkleinern'><span class='fontsize_small_text'>A</span></a></span>");

		
		document.write("<br class='wai' /><br class='wai' />");
}


//empty href

function empty() {}


/*
	 ##########################################################################################################
	 #### BROWSER DETECTION ###################################################################################
	 ##########################################################################################################
	 */
	var BrowserDetect = {
		init: function(){
			this.browser = this.searchString(this.dataBrowser) || "An unknown browser";
			this.version = this.searchVersion(navigator.userAgent) ||
			this.searchVersion(navigator.appVersion) ||
			"an unknown version";
			this.OS = this.searchString(this.dataOS) || "an unknown OS";
		},
		searchString: function(data){
			for (var i = 0; i < data.length; i++) {
				var dataString = data[i].string;
				var dataProp = data[i].prop;
				this.versionSearchString = data[i].versionSearch || data[i].identity;
				if (dataString) {
					if (dataString.indexOf(data[i].subString) != -1) 
						return data[i].identity;
				}
				else 
					if (dataProp) 
						return data[i].identity;
			}
		},
		searchVersion: function(dataString){
			var index = dataString.indexOf(this.versionSearchString);
			if (index == -1) 
				return;
			return parseFloat(dataString.substring(index + this.versionSearchString.length + 1));
		},
		dataBrowser: [{
			string: navigator.userAgent,
			subString: "OmniWeb",
			versionSearch: "OmniWeb/",
			identity: "OmniWeb"
		}, {
			string: navigator.vendor,
			subString: "Apple",
			identity: "Safari"
		}, {
			prop: window.opera,
			identity: "Opera"
		}, {
			string: navigator.vendor,
			subString: "iCab",
			identity: "iCab"
		}, {
			string: navigator.vendor,
			subString: "KDE",
			identity: "Konqueror"
		}, {
			string: navigator.userAgent,
			subString: "Firefox",
			identity: "Firefox"
		}, {
			string: navigator.vendor,
			subString: "Camino",
			identity: "Camino"
		}, { // for newer Netscapes (6+)
			string: navigator.userAgent,
			subString: "Netscape",
			identity: "Netscape"
		}, {
			string: navigator.userAgent,
			subString: "MSIE",
			identity: "Explorer",
			versionSearch: "MSIE"
		}, {
			string: navigator.userAgent,
			subString: "Gecko",
			identity: "Mozilla",
			versionSearch: "rv"
		}, { // for older Netscapes (4-)
			string: navigator.userAgent,
			subString: "Mozilla",
			identity: "Netscape",
			versionSearch: "Mozilla"
		}],
		dataOS: [{
			string: navigator.platform,
			subString: "Win",
			identity: "Windows"
		}, {
			string: navigator.platform,
			subString: "Mac",
			identity: "Mac"
		}, {
			string: navigator.platform,
			subString: "Linux",
			identity: "Linux"
		}]
	
	};


// Countdown



// Ziel-Datum in MEZ
var jahr=2009, monat=6, tag=23, stunde=15, minute=0, sekunde=0;
var zielDatum=new Date(jahr,monat-1,tag,stunde,minute,sekunde);

function countdown() {
	if(document.getElementById('countdown')) {
        startDatum=new Date(); // Aktuelles Datum

        // Countdown berechnen und anzeigen, bis Ziel-Datum erreicht ist
        if(startDatum<zielDatum)  {

          var jahre=0, monate=0, tage=0, stunden=0, minuten=0, sekunden=0;

          // Jahre
          while(startDatum<zielDatum) {
            jahre++;
            startDatum.setFullYear(startDatum.getFullYear()+1);
          }
          startDatum.setFullYear(startDatum.getFullYear()-1);
          jahre--;

          // Monate
          while(startDatum<zielDatum) {
            monate++;
            startDatum.setMonth(startDatum.getMonth()+1);
          }
          startDatum.setMonth(startDatum.getMonth()-1);
          monate--;

          // Tage
          while(startDatum.getTime()+(24*60*60*1000)<zielDatum) {
            tage++;
            startDatum.setTime(startDatum.getTime()+(24*60*60*1000));
          }

          // Stunden
          stunden=Math.floor((zielDatum-startDatum)/(60*60*1000));
          startDatum.setTime(startDatum.getTime()+stunden*60*60*1000);

          // Minuten
          minuten=Math.floor((zielDatum-startDatum)/(60*1000));
          startDatum.setTime(startDatum.getTime()+minuten*60*1000);

          // Sekunden
          sekunden=Math.floor((zielDatum-startDatum)/1000);

          // Anzeige formatieren
          (jahre!=1)?jahre=jahre+" Noch:  ":jahre=jahre+" Jahr,  ";
          (monate!=1)?monate=monate+" Monate,  ":monate=monate+" Monat,  ";
          //(tage!=1)?tage=tage+" d  ":tage=tage+" d  ";
          (stunden!=1)?stunden=stunden+" h  ":stunden=stunden+" h  ";
          (minuten!=1)?minuten=minuten+" m  ":minuten=minuten+" m  ";
          if(sekunden<10) sekunden="0"+sekunden;
          (sekunden!=1)?sekunden=sekunden+" s":sekunden=sekunden+" s";
		  
		 if(tage == 1) {
		  	document.getElementById('countdown').innerHTML= 'ExpertInnen-Chat - morgen';          	
		  } else if(tage==0) {
			  document.getElementById('countdown').innerHTML= 'ExpertInnen-Chat - heute';
		  } else {
		  	document.getElementById('countdown').innerHTML= 'ExpertInnen-Chat - in '+tage+' Tagen';
		  }
		  
		  //document.getElementById('countdown').innerHTML= 'ExpertInnen-Chat - live';

          setTimeout('countdown()',200);
        }
        // Anderenfalls alles auf Null setzen
        else document.getElementById('countdown').innerHTML=
            "ExpertInnen-Chat - live";
	}
}