$(document).ready(function() {
  $('.slideshow').cycle({ 
      fx:     'fade', 
      speed:  'fast', 
      timeout: 8000,
      pager: '.slideshow-pager',
      activePagerClass: 'active'
      
  });

  $('.hlink').hover(
    function() { 
      $(this).addClass('hover');
      $('ul', this).css('display', 'block'); 
    },
    function() { 
      $(this).removeClass('hover');
      $('ul', this).css('display', 'none'); 
    }
  );
  
  /*special for IE6*/
  if ($.browser.msie = true){
    if ($.browser.version = '6.0') {
      $('.cr').after('<div class="clr"></div>');
    }
  }


  
  $('.post').find('iframe, object, img').parents('.post').removeClass('noImg');
  
  $('#profile a').height($(document).height());
    
  var $container = $('#newsContainer');
  $container.imagesLoaded(function(){
    $container.masonry({
    itemSelector : '.post',
    gutterWidth: 20,
    isAnimated: true
    });
  });

  $("a[rel=gallery]").fancybox({
    'transitionIn'    : 'elastic',
    'transitionOut'    : 'elastic',
    'titlePosition'     : 'over',
    'centerOnScroll':'centerOnScroll',
    'overlayColor' : '#fff',
    'titleFormat'    : function(title, currentArray, currentIndex, currentOpts) {
      return '<span id="fancybox-title-over">Bild ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>';
    }
  });
});
Cufon.replace('h1, h2, .pushframe .header, .newsarchive .title');
