$(document).ready(
  function()
  {
    /* focusEmpty Elemente
    -  bei focus Feld leeren, sofern noch der Standardwert enthalten ist
    --------------------------------------------------------------------- */
    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')]);
        }
      }
    );
    
    $('.formItem input, .formItem textarea')
      .focus(
        function()
        {
          $(this).addClass('current');
        }
      )
      .blur(
        function()
        {
          $(this).removeClass('current');
        }
      );
    
    $('.lightbox').colorbox({scalePhotos:true,maxWidth:"80%",maxHeight:"80%",opacity:0.35,slideshow:false,transition:"elastic",slideshowSpeed:4000,slideshowStart:"Diashow starten",slideshowStop:"Diashow stoppen",current:"Bild {current} von {total}",previous:"zurück",next:"weiter",close:"schließen"});
    $('.lightbox-slideshow').colorbox({scalePhotos:true,maxWidth:"80%",maxHeight:"80%",opacity:0.35,slideshow:true,transition:"fade",slideshowSpeed:6000,slideshowStart:"Diashow starten",slideshowStop:"Diashow stoppen",current:"Bild {current} von {total}",previous:"zurück",next:"weiter",close:"schließen"});
    
    var iHeight = 0;
    $('div.box-teaser').each(
      function()
      {
        iFoo = parseInt($(this).outerHeight());
        if (iFoo > iHeight)
        {
          iHeight = iFoo;
        }
      }
    );

    $('div.box-teaser').each(
      function()
      {
        iFoo = parseInt($(this).outerHeight());
        iDiff = iHeight - iFoo;
        if (iDiff > 0)
        {
          iBar = parseInt($(this).children('.content').height());
          $(this).children('.content').height(iBar+iDiff);
        }
      }
    );
  }
);

