/**
 * Hommel - JS: Animationen
 *
 *
 * @author Danny Otto | pixelbrand.net
 * @date   2010-05
 *
 * hacer con amor
 *
 */
$(document).ready(function() {
  //$('#page').mousemove(NavFadeIn);
  //$('#start').mousemove(NavFadeIn);
  //$('#page').ready(NavFadeIn);
  //$('#start').ready(NavFadeIn);
  
  setTimeout(NavFadeIn, 100);
  
  $('img.fadein').animate({opacity:1},{duration:1000});
  $('div#slideshow').after('<div id="slidenav"><a id="th-prev" href="#"><img src="/fileadmin/html/images/ico_al1.gif" alt="zurück" /></a> <span id="caption"></span> <a id="th-next" href="#"><img src="/fileadmin/html/images/ico_ar1.gif" alt="weiter" /></a></div>').cycle({ fx: 'fade', speed: 'slow', timeout: 0, next: '#th-next', prev: '#th-prev', after: SlideboxOnAfter });
  $('div#slideshow-v2').cycle({ fx: 'fade', speed: '1000' });
  setTimeout(function() { $('div#zitat').animate({opacity:0},{duration:2000}); }, 2000);
  
  $('#registration').css('display','none').prepend('<p class="r"><a id="registration-close" href="#">Schließen</a></p>');
  $('#registration form.error').parent('div#registration').show();
  $('.event').append('<a id="registration-open" href="#">Anmelden</a>');
  $('#registration-open').click( function() { $('#registration').show(); $('#registration-open').hide(); return false; });
  $('#registration-close').click( function() { $('#registration').hide('fast'); $('#registration-open').show(); return false; });
});
function NavFadeIn () { var time = 0; $('#navigations ul').each(function(i){ var nav = this; window.setTimeout(function(){ $(nav).animate({opacity:1},{duration:500}); }, time); time += 600; }); $('html').unbind('mousemove',NavFadeIn); }
function SlideboxOnAfter(curr,next,opts) { var caption = (opts.currSlide + 1) + ' / ' + opts.slideCount; $('#caption').html(caption); }
