// JavaScript Document
$(document).ready(function (){

	
	$("#info_para").hide();
	$("#tab_news").hide();
	$("#news_des").hide();
	
	$("#news").addClass("active");
	$("#info").click(function(){
		$("#tab_news").hide();
		$("#news_des").hide();
		$("#tab_info").fadeIn();
		$("#info").addClass("active");
		$("#news").removeClass("active");
		
	});
	$("#news").click(function(){
		$("#tab_info").hide();
		$("#news_des").hide();
		$("#tab_news").fadeIn();
		$("#news").addClass("active");
		$("#info").removeClass("active");
		
	}).click();
	$("#open_para").mouseover(function(){
		$("#info_para").show("slow");
		setTimeout('$("#info_para").hide("slow")',10000);
	});
	$("#info_para").click(function(){
		$("#info_para").hide("slow");
	});
	$(".clickable_news").click(function(){
		val = "news"+$(this).attr("id").substr(4,1);
		$.ajax({
		   type: "GET",
		   url: "infonews/getajax.php",
		   data: "filename="+val,
		   success: function(response){
			 res = response.split(":::");  
			 html = '<br><span class="redheadline"><br>';  
			 html += res[0]; 
			 html += "</span><br/>"; 
			 html += res[1]; 
			 html += "<br/><br/><a href='javascript:;' class='backtonews' >zurück</a>"; 
			 
			 
			 $("#tab_news").hide();
		     $("#tab_info").hide();
	
			 $("#news_des").fadeIn("1000");
			 $("#news_des").html(html);
			 
			 $('.backtonews').click(function(){
				$("#news_des").hide();		
				$("#tab_news").fadeIn();
			 });

		   }
	 });

	});
	$(".clickable_infos").click(function(){
		val = "info"+$(this).attr("id").substr(4,1);
		$.ajax({
		   type: "GET",
		   url: "infonews/getajax.php",
		   data: "filename="+val,
		   success: function(response){
			 res = response.split(":::");  
			 html = '<br><span class="redheadline"><br>';  
			 html += res[0]; 
			 html += "</span><br/>"; 
			 html += res[1]; 
			 html += "<br/><br/><a href='javascript:;' class='backtoinfos' >zurück</a>"; 
			 
			 
			 $("#tab_news").hide();
		     $("#tab_info").hide();
	
			 $("#news_des").fadeIn("1000");
			 $("#news_des").html(html);
			 
			 $('.backtoinfos').click(function(){
				$("#news_des").hide();		
				$("#tab_info").fadeIn();
			 });

		   }
	 });

	});
	
	
	

	
	

});

	


