// JavaScript Document



$j(document).ready(function(){

	
			//hide_all_produkts() ;
	$j('#branchen_bu').click(function(){
		
		$j('#alphabetisch_bu').parent().removeClass("aktive");
		$j('#branchen_bu').parent().addClass("aktive");
		$j('.branchen_nav').addClass("aktive");
		$j('.alphabetic_nav').removeClass("aktive");
		
		hide_all_produkts();
		
		show_subcat_cats();
		
	});
	
	
	$j('#alphabetisch_bu').click(function(){
		
		$j('#branchen_bu').parent().removeClass("aktive");
		$j('#alphabetisch_bu').parent().addClass("aktive");
		$j('.alphabetic_nav').addClass("aktive");
		$j('.branchen_nav').removeClass("aktive");
		
		hide_all_subprodukts();
		
		show_all_produkts();
		
	});
	
	
	
	
	
		
	
	$j('.produktcatlink').click(function(){
		
		hide_all_produkts();
		hide_all_subprodukts();
		
		$j('#alphabetisch_bu').parent().removeClass("aktive");
		$j('#branchen_bu').parent().addClass("aktive");
		$j('.branchen_nav').addClass("aktive");
		$j('.alphabetic_nav').removeClass("aktive");
		
		
		
		var show_ID  =  $j(this).attr("ID");
		show_ID  = show_ID.replace('produktcatlink-', '');
		subcat_produkts(show_ID);
		
	});
	
	
	
	
	//// //// //// //// //// /// //// //// //// //// /// //// //// //// //// /// //// //// //// //// /// //// //// //// //// 
	//alphabetic_menu

	$j('.alphabetic_menu li a').click(function(){
							//alert(1);
		hide_all_produkts() ;
		var show_ID  =  $j(this).attr("ref");
		showl_produkt(show_ID) ;
		$j(this).parent().addClass("current-cat");
	});
	
	
	
	function showl_produkt(ID) {
	 	 	$j('#'+ID).show(); 
			$j('#'+ID).addClass("pos_first_alphalist");
			
			
			
			
	}
	
	
	function hide_all_produkts() {
		
		$j('div.alphaprodukt').each(function() {
	 	 	$j(this).hide();
		})
		
		$j('.alphabetic_menu li a').each(function() {
			$j(this).parent().removeClass("current-cat");								  
		})		
		
		$j('div.alphaprodukt').each(function() {
	 	 	$j(this).removeClass("pos_first_alphalist");
		})
												  
	}
	
	
	function show_all_produkts() {
		
		$j('div.alphaprodukt').each(function() {
	 	 	$j(this).show();
			$j(this).removeClass("pos_first_alphalist");
			
			/*if ($j(this).hasClass('pos_6')) {
				$j(this).removeClass("pos_6");;
				$j(this).addClass("pos_6");;
			} else {
				$j(this).removeClass("pos_6");;				
			}*/
			
			
		})
		
											  
												  
	}
	
	
	
	
	
	
	
	
	
	//// //// //// //// //// /// //// //// //// //// /// //// //// //// //// /// //// //// //// //// /// //// //// //// //// 
	//branchen_menu
	
	$j('.branchen_menu li a').click(function(){
				
		var show_ID  =  $j(this).attr("ref");
		show_ID  = show_ID.replace('insubcat-', '');
		subcat_produkts(show_ID);
		
	});
											  
					
					
	
	
	
	$j('.subcatitem a').click(function(){
		
		var boxcont = $j(this).parent().parent();
		var show_ID  =  boxcont.attr("ID");
		show_ID  = show_ID.replace('subcatitem-', '');
		
		subcat_produkts(show_ID);
	
	});
	
	
	function subcat_produkts(ID) {
			
			hide_all_subprodukts();
	 	 	$j('.insubcat-'+ID).show();
			$j('.cat-item-'+ID).addClass("current-cat");
		
	}
	

	function hide_all_subprodukts() {
		
		$j('.branchen_menu li').each(function() {
	 	 	$j(this).removeClass("current-cat");
		})
		
		$j('.subcat_produkt').each(function() {
	 	 	$j(this).hide();
		})
		
		$j('.subcatitem').each(function() {
	 	 	$j(this).hide();
		})
		
		
	
	}
	
	
	function show_subcat_cats() {
		
		$j('.branchen_menu li').each(function() {
	 	 	$j(this).removeClass("current-cat");
		})
		
		$j('.subcat_produkt').each(function() {
	 	 	$j(this).hide();
		})
		
		$j('.subcatitem').each(function() {
	 	 	$j(this).show();
		})
	
	}
	
	
	
	
	
	

	
	
	
	
	
	
});
