﻿$(document).ready(function() {

	$(".noscript").removeClass("noscript");

	$(".quicklinks .reiter").tabs();
	$(".reitercontent .reiter").tabs();
	$(".termin .tt").tipsy({opacity: 0.9});
	
	if ( $(".teaserbox h1 a").length > 0 ) {
		$(".teaserbox .t_img_text .text").hover(
			function(){ $(this).addClass("text_hover"); },
			function(){ $(this).removeClass("text_hover"); }
		);
		$(".teaserbox .t_img_text .text").click(function(){
			var mylink = $(this).children("h1").find("a");
			if ( $(mylink).attr("target") == "_blank" ){ window.open( $(mylink).attr("href") ); }
			else { document.location = $(mylink).attr("href"); }
			return false;
		});
	}

	$(".teasernews .news").hover(
		function(){ if ( $(this).find("h2 a").length > 0 ) $(this).addClass("news_hover"); },
		function(){ $(this).removeClass("news_hover"); }
	);
	$(".teasernews .news_kurz").hover(
		function(){ if ( $(this).find("h3 a").length > 0 ) $(this).addClass("news_hover"); },
		function(){ $(this).removeClass("news_hover"); }
	);
	
	$(".teasernews .news").click(function(){
		if ( $(this).children(".news_head").children("h2").find("a").length > 0 ) {
			var mylink = $(this).children(".news_head").children("h2").find("a");
			if ( $(mylink).attr("target") == "_blank" ){ window.open( $(mylink).attr("href") ); }
			else { document.location = $(mylink).attr("href"); }
			return false;
		}
	});
	$(".teasernews .news_kurz").click(function(){
		if ( $(this).children("h3").find("a").length > 0 ) {
			var mylink = $(this).children("h3").find("a");
			if ( $(mylink).attr("target") == "_blank" ){ window.open( $(mylink).attr("href") ); }
			else { document.location = $(mylink).attr("href"); }
			return false;
		}
	});

});
