/**** Contentslider Funktion ****/
$(document).ready(function(){
	var fxSpeed = 250;
	var e 		= $.browser.opera ? 'html' : 'html,body';
	$('.navi a').click(function(){
		var target = $('.content');
		var source = $('.navi a');
		var tarSRC = $('.'+$(this).attr('id'));
		var souSRC = $(this);
		
		target.slideUp(fxSpeed);
		source.removeClass('selected');
		$(e).animate({scrollTop:$('.navi a').position().top},fxSpeed,function(){
			tarSRC.slideDown(fxSpeed);
			$(e).animate({scrollTop:tarSRC.position().top},fxSpeed);
			souSRC.addClass('selected');
		});
	
	
	
		//$(this).toggleClass('selected');
	});
	$('.navi_back').click(function(){
		var g	= $(this).attr('rel');
		$('.'+g).slideToggle(fxSpeed,function(){
			$(e).animate({scrollTop:$('.navi a').position().top},fxSpeed);	
		});
		$('#'+g).toggleClass('selected');
	});
});

/**** Logo Mousemove Funktion ****/
/*
$(document).ready(function(){
	var Fz_gHolder = $('#Fz_gHolder');
	var Fz_gContent= $('#Fz_gContent');
	$().mousemove(function(e){
		if(e.pageY >= Fz_gHolder.position().top && e.pageY <= (Fz_gHolder.position().top + Fz_gHolder.height())) {
			if(e.pageX >= Fz_gHolder.position().left && e.pageX <= (Fz_gHolder.position().left + Fz_gHolder.width())) { 
				Fz_gContent.css('margin-left',(-e.pageX + 30));
			}
		}
	});
});
*/
 $(document).ready(function() {
 	 $("#sendungcontent").load("index_sendeplan.php");
   var refreshId = setInterval(function() {
	  $("#sendungcontent").load('index_sendeplan.php?randval='+ Math.random());
   }, 300000);
});

 $(document).ready(function() {
 	 $("#newscontent").load("index_news.php");
});

 $(document).ready(function() {
 	 $("#sendeplan").load("sendeplan.php");
});

 $(document).ready(function() {
 	 $("#verlosung").load("verlosung/verlosung.php");
});

 $(document).ready(function() {
 	 $("#verein").load("/site/verein.php");
});

 $(document).ready(function() {
 	 $("#ueberuns").load("/site/ueberuns.php");
});


function impressum()
{
	impress=window.open('impressum.html','Impressum','height=300,width=450');
}



/**** Funktion Scrollen im Sendeplan ****/

	$(document).ready(function() {
		// Alle internen Links auswählen
		$('a[href*=#]').bind("click", function(event) {
			// Standard Verhalten unterdrücken
			event.preventDefault();
			// Linkziel in Variable schreiben
			var ziel = $(this).attr("href");
			//Scrollen der Seite animieren, body benötigt für Safari
                if ($.browser.opera) {
				//Debugging für Opera
                    var target = 'html';
                }else{
                    var target = 'html,body';
                }
				$(target).animate({
				//Zum Ziel scrollen (Variable)
				scrollTop: $(ziel).offset().top
			// Dauer der Animation und Callbackfunktion die nach der Animation aufgerufen wird, sie stellt das Standardverhalten wieder her und ergänzt die URL
			}, 2000 , function (){location.hash = ziel;});
	   });
	return false;
	});
