
$(document).ready(function() {

  // manage multipage
  $('div.page').each( function(i) { 

    // hide all but first
    if (i != 0 ) 
      $(this).hide(); 

    // add forward
    if (i < $('div.page').length - 1) 
      $(this).append('<p class="weiter"><a href="javascript:page(' + (i + 1) + ');">weiter&nbsp;&gt;</a></p>');

    // add back
    if (i > 0) 
      $(this).prepend('<p class="zurueck"><a href="javascript:page(' + (i - 1) + ');">&lt;&nbsp;zur&uuml;ck</a></p>');

  });

  // hover menu
  $("li.menu").hover(
      function () {
        $('ul', this).show();
      }, 
      function () {
        $('ul', this).hide();
      }
    );

  // gallery
  $("a[rel^='popup']").prettyPhoto({
    animationSpeed: 'normal', /* fast/slow/normal */
    padding: 30, /* padding for each side of the picture */
    opacity: 0.35, /* Value betwee 0 and 1 */
    showTitle: true, /* true/false */
    allowresize: true, /* true/false */
    counter_separator_label: ' von ', /* The separator for the gallery counter 1 "of" 2 */
    theme: 'light_square', /* light_rounded / dark_rounded / light_square / dark_square */
    callback: function(){} 
  });

});


function page (p) {
  $('div.page').each( function(i) { 
    if (i == p ) { $(this).show(); } else { $(this).hide();  }
  });
}



