$(document).ready(function(){
  /* Accordion generell --------------------------------------------------------------------- */

  
//Set default open/close settings
$('.accordion_container').hide(); //Hide/close all containers
$('.accordion_trigger:first').addClass('active').next().show(); //Add "active" class to first trigger, then show/open the immediate next container

//On Click
$('.accordion_trigger').click(function(){
  if( $(this).next().is(':hidden') ) { //If immediate next container is closed...
    $('.accordion_trigger').removeClass('active').next().slideUp(); //Remove all .acc_trigger classes and slide up the immediate next container
    $(this).toggleClass('active').next().slideDown(); //Add .acc_trigger class to clicked trigger and slide down the immediate next container
  }
  return false; //Prevent the browser jump to the link anchor
});




/* Accordion Mandantenzeitung --------------------------------------------------------------------- */

  
//Set default open/close settings
$('.accordion_container_mandantenzeitung').hide(); //Hide/close all containers
//$('.accordion_trigger_mandantenzeitung:first').addClass('active_mandantenzeitung').next().show(); //Add "active" class to first trigger, then show/open the immediate next container

//On Click
$('.accordion_trigger_mandantenzeitung').click(function(){
  if( $(this).next().is(':hidden') ) { //If immediate next container is closed...
    $('.accordion_trigger_mandantenzeitung').removeClass('active_mandantenzeitung').next().slideUp(); //Remove all .acc_trigger classes and slide up the immediate next container

    $(this).toggleClass('active_mandantenzeitung').next().slideDown(); //Add .acc_trigger class to clicked trigger and slide down the immediate next container
  }
  return false; //Prevent the browser jump to the link anchor
});




/* Accordion Seminare --------------------------------------------------------------------- */

  
//Set default open/close settings
$('.accordion_container_seminare').hide(); //Hide/close all containers
//$('.accordion_trigger_seminare:first').addClass('active_seminare').next().show(); //Add "active" class to first trigger, then show/open the immediate next container

//On Click
$('.accordion_trigger_seminare').click(function(){
  if( $(this).next().is(':hidden') ) { //If immediate next container is closed...
    $('.accordion_trigger_seminare').removeClass('active_seminare').next().slideUp(); //Remove all .acc_trigger classes and slide up the immediate next container

    $(this).toggleClass('active_seminare').next().slideDown(); //Add .acc_trigger class to clicked trigger and slide down the immediate next container
  }
  return false; //Prevent the browser jump to the link anchor
});



/* focus empty --------------------------------------------------------------------- */

    
    
    aFocusEmpty = Array();
    
    $('input.focusEmpty').each(
      function()
      {
        aFocusEmpty[$(this).attr('name')] = $(this).val();
      }
    );
    
    
    $('input.focusEmpty').focus(
      function()
      {
        if ($(this).val() == aFocusEmpty[$(this).attr('name')]) {
          $(this).val('');
        }
      }
    ).blur(
      function()
      {
        if ($(this).val() == '') {
          $(this).val(aFocusEmpty[$(this).attr('name')]);
        }
      }
    );



/* Shadowbox --------------------------------------------------------------------- */
Shadowbox.init();


    

/* Registrierung Log In --------------------------------------------------------------------- */

var arrA = $("a[rel='toggle']").each(function(intIndex){
    // ID des zugehörigen Toggle-Elements ermitteln
    var linkID = String($(this).attr('href')).substr(1, $(this).attr('href').length);
    // Element verstecken
    if(linkID){
      $('#'+linkID).hide();
    }
 
    // Togglefunktion an Link binden
    $(this).toggle(

      function(){

        $('#'+linkID).show('fast'); // Einblenden
      },
      function(){
        $('#'+linkID).hide('fast'); // Ausblenden
      }
    );
  });
                  
                  
                  
                  
                  
    
    });

