// JavaScript Document

$(document).ready(  function(){ 
							
	/*
	$("#content-middle dd").click(function () {
		$("h1").css("font-family", $(this).text() + ',sans-serif');
		$("h2").css("font-family", $(this).text() + ',sans-serif');
		$("h3").css("font-family", $(this).text() + ',sans-serif');
		$("#topmenu a").css("font-family", $(this).text() + ',sans-serif');
	});
	*/
	
	
	// Bildslider
	var zufallsRotation = $('#rotation-container').hasClass('random');
	$('#rotation-container').cycle({
		fx:     'fade', 
		speed:  4000,
		containerResize: 0,   // resize container to fit largest slide 
		//prev:   '#kopfbilder-prev',
		//next:   '#kopfbilder-next',
		pager: '#kopfbilder-nav',
		random: 	zufallsRotation,
		slideExpr: '.cycle-item',
		pagerAnchorBuilder: function(idx) { 
        	return '<a href="#"></a>'; 
    	} 
	});	
	
	// die ganze link-box anklickbar machen:
	// zuerst a disablen damit nicht doppelt gemoppelt wird:
	$('DIV.linked DIV.cycle-item a').click(function(event) {
		event.preventDefault();
	});
	$('DIV.linked DIV.cycle-item').click(function() {
			  var linkziel = $(this).find('a:first');
			  var linkhref = $(this).find('a:first').attr('href');
			  var target = $(linkziel).attr('target');
			  if(target == "_blank") {
				window.open(document.location.protocol + "//" + document.location.host +"/" + linkhref); 
			  } else if (linkhref != undefined && target != "_blank") {
				  // fix wegen coolURI...
				document.location.href = document.location.protocol + "//" + document.location.host +"/" + linkhref;
			  }
			  
	});
	$('DIV.linked DIV.cycle-item').hover(function() {
		$(this).addClass('hover');
	}, function() {
		$(this).removeClass('hover');
	});	

	
	
	
			
			
// ende Document ready	
});
