
////////////////// Accordion //////////////////

$(function(){
	
	
	$('.box_head').click(function(){
		idelem = $(this).attr('id');
		idelemdiv = idelem.replace('boxhead_', 'box_');
		$('#'+idelemdiv).slideToggle("slow");
		$('#'+idelem).toggleClass("open");

	});

	$('.box_head').hover(
		function() { $(this).css('cursor', 'pointer'); },
		function() { $(this).css('cursor', 'default'); }
	);
});


			   
			   
////////////////// Fenster zentrieren //////////////////		
/*


$(document).ready(function(){
	
	swapValue = [];
$(".text_box").each(function(i){
   swapValue[i] = $(this).val();
   $(this).focus(function(){
      if ($(this).val() == swapValue[i]) {
         $(this).val("");
      }
      $(this).addClass("focus");
   }).blur(function(){
      if ($.trim($(this).val()) == "") {
         $(this).val(swapValue[i]);
	 $(this).removeClass("focus");
      }
   });
});


	ausrichten()
	setInterval("ausrichten()", 100);
	
	 
	  
               });	   
function ausrichten() {
	footerheight = $("#footer").height(); 
	divheight = $("#content").height(); 
	winheight = $(window).height();
	
      if(divheight < (winheight-footerheight-20)){
		  
		   if ($("#content").hasClass("default")) {
                 	$("#content").removeClass("default");
                        }
		  
		  
		    $("#content").addClass("centered");
            $("#content").css('margin-top', "-"+(( divheight/2 )+( footerheight/2 ))+"px");
		
						
		  }
		else{
			 if ($("#content").hasClass("centered")) {
                 	$("#content").removeClass("centered");
					$('#content').attr('style','');
                        }
		$("#content").addClass("default");	
		
		}
		}*/


////////////////// Navigation Tween und Aktivzustände //////////////////
$(function(){	


$(document).ready(function()
{
	
	$('.currentsubsub').parent().parent().next().addClass("currentsub");
   	$('.currentsub').parent().parent().next().addClass("current");
	
	
   
});//END Doc ready	
			
	$('#navigation > li').css( {backgroundPosition: "right 50px"} )
	
		
		.mouseenter(function(){
			$('.sub1', this).slideDown('fast', function() {});
		if(!$('.current',this).hasClass("current")){	
			$('.current').stop().animate({backgroundPosition:"right 50px"}, {duration:500})
			$('.current').addClass("temp-deactivate");
			$('a', this).stop().animate({backgroundPosition:"right -45px"}, {duration:100})

  			if(!$('.sub1',this).hasClass("test")){
			
				$('.temp-current').removeClass("temp-current");
  				
				$('.sub1').removeClass("test");
			}
		}})
		.mouseleave(function(){
			$('.sub1', this).slideUp('fast', function() {});
			if(!$('.current',this).hasClass("current")){	
			if(!$('.test').hasClass("test")){
				//alert("test");
				
				$('.current').removeClass("temp-deactivate");
				$('.current').stop().animate({backgroundPosition:"right -45px"}, {duration:100})
			
			}
			
			$('a', this).stop().animate({backgroundPosition:"right 50px"}, {duration:500})
			
			
		
			
	
	
			
			}})
			
			  });	
			  


