
// COLORBOX
jQuery(document).ready(function(){jQuery(".rzcolorbox").colorbox({current:"Bild {current} von {total}",opacity:"0.85",transition:"fade",speed:"350",slideshowSpeed:"2500",previous:"",next:"",close:""});});

// PAGETEASER
$(function() {
      $('ul.pt_a li:odd').addClass('odd');
      $('ul.pt_a li:even').addClass('even');
      $('ul.pt_b li:odd').addClass('odd');
      $('ul.pt_b li:even').addClass('even');
      $("ul.pt_c li:nth-child(1),ul.pt_c li:nth-child(4),ul.pt_c li:nth-child(7),ul.pt_c li:nth-child(10),ul.pt_c li:nth-child(13),ul.pt_c li:nth-child(16)").addClass('alpha');
      $("ul.pt_c li:nth-child(3),ul.pt_c li:nth-child(6),ul.pt_c li:nth-child(9),ul.pt_c li:nth-child(12),ul.pt_c li:nth-child(15),ul.pt_c li:nth-child(18)").addClass('omega');
});


// SITEMAP
jQuery(function($) {			
  // Einstellungen
  var container = ".csc-sitemap";
  var toggleAll = "#sitemap-toggleAll";
  
  //Unterpunkte verstecken
  $(container+" ul li>ul").css({display:"none"});
  
  //Alle auf und zu klappen
  $(toggleAll).show().find("span.close").hide().end().click(function() {
  	if($(this).is(".open")) {
  		$(container+" ul li a.folder").removeClass("closed").addClass("opend")
  		$(container+" ul li ul").show();
  		$(this).removeClass("open").addClass("close").attr("rel", "close").find("span.open").hide().end().find("span.close").show();
  	}
  	else {
  		$(container+" ul li a.folder").removeClass("opend").addClass("closed");
  		$(container+" ul li ul").hide();
  		$(this).removeClass("close").addClass("open").attr("rel", "open").find("span.close").hide().end().find("span.open").show();
  	}
  	return false;
  });
  
  //Link zum Auf- und Zuklappen hinzufuegen - einzelne "Ordner"
  $(container+" ul li").each(function() {
  		if($("ul", this).length > 0) {
  			$(this).prepend("<a href='#' class='folder closed'>auf</a>").find(".folder").click(function() {
  				if($(this).is(".closed")) {
  					//Submenu aufklappen
  					$(this).text("zu ").removeClass("closed").addClass("opend").parents("li").find(">ul").slideDown();
  				}
  				else {
  					//Submenu zuklappen
  					$(this).text("auf").removeClass("opend").addClass("closed").parent("li").find(">ul").slideUp();
  				}
  				return false;
  			});
  		}
  		else {
  			$(this).prepend("<a href='#' class='page'>seite</a>").find(".page").click(function() {
  				window.location = $(this).next().attr("href");
  			});
  		}
  	});
});
