	$(document).ready(function(){
		
		// accordion mit jqueryui realisiert
		// http://jqueryui.com/demos/accordion/
		
		// Animation für Artikelbeschreibungen
		$( "#accordion" ).accordion({
			autoHeight: false,
			clearStyle: true
		});
		
		// Animation für Hauptnavigation
		$( "#navigation").accordion({
				// Zu Beginn alle Container schließen
				collapsible: true,
				// aktives Element festlegen
				active: '#navigation > li.active > a',
				// container auf Normalhöhe
				autoHeight: false,
				// animated options here - http://jqueryui.com/demos/effect/#easing
				animated: 'easeOutExpo'
		});
		
		$('.ie7 ul.tree').click(function(){
			$('.ie7 ul.tree li a').css('color','black');	
		});
		
		
		$( ".current").parent().parent().addClass('parent');		
		$( ".parent").parent().parent().addClass('parent');
		
		$ ("#navigation a[href='#']").click(function(event) {
			event.preventDefault();
		});
		
		// accordion mit jqueryui realisiert
		// http://jqueryui.com/demos/accordion/
		
		// Animation für Kategorie 10
		$( "#accordion_10" ).accordion({
				// container auf NormalhÃ¶he
				autoHeight: false
				// animated options here - http://jqueryui.com/demos/effect/#easing
				//animated: 'easeOutExpo'
		});		
		
		$cookie = $.cookie('ui-tabs-1');
		
		if($cookie != "" ){
		    $selected = $cookie;
		}
		else {
		    $selected = '-1';    
		}
		
		$( ".ui-tabs" ).tabs({
			selected: -1,
			collapsible: true,
			cookie: { expires: 30 },
		fx: { height: 'toggle', opacity: 'toggle' }
		});
		
		$("#navigation  ul ul ul li").accordion({
				collapsible: true,
				autoHeight: false,
				active: '#navigation ul ul ul li.parent strong',
				header: 'strong'
		})
		
		//$(".sortable").tablesorter();

	});

	//http://murphys-world.dyndns.org/pages/javascript-number-format.php
	function number_format(num,dig,dec,sep) {
		x=new Array();
		s=(num<0?"-":"");
		num=Math.abs(num).toFixed(dig).split(".");
		r=num[0].split("").reverse();
		for(var i=1;i<=r.length;i++){x.unshift(r[i-1]);if(i%3==0&&i!=r.length)x.unshift(sep);}
		return s+x.join("")+(num[1]?dec+num[1]:"");
	}
