// Galerie Slideshow
var images = new Array ('http://www.rockmartin.de/wp-content/themes/rockmartin/pixlie/statue.jpg', 'http://www.rockmartin.de/wp-content/themes/rockmartin/pixlie/schildi.jpg', 'http://www.rockmartin.de/wp-content/themes/rockmartin/pixlie/danmark.jpg');
var index = 1;
 
function rotateImage()
{
  $('#myImage').fadeOut('slow', function()
  {
    $(this).attr('src', images[index]);
 
    $(this).fadeIn('slow', function()
    {
      if (index == images.length-1)
      {
        index = 0;
      }
      else
      {
        index++;
      }
    });
  });
}
 
$(document).ready(function()
{
  setInterval (rotateImage, 5500);
});

// Suchfunktion
$(document).ready(function(){

	/* Converting the #box div into a bounceBox: */
	$('#box').bounceBox();

	/* Listening for the click event and toggling the box: */
	$('a.btn_smallblack_s').click(function(e){

		/*
			UPDATE:
			You can now pass an object with an autohide property
			to both bounceBoxToggle() and bounceBoxShow(). The box will
			hide automatically after the period you've specified.
			
			If you don't want autohide, just skip the parameter.
		*/

		$('#box').bounceBoxToggle({autohide:600000});
		e.preventDefault();
		
	});
	
});

// Smooth Scroll to Top
jQuery(document).ready(function ($) {
    $('a[href*=#]').click(function() {
    if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'')
        && location.hostname == this.hostname) {
            var $target = $(this.hash);
            $target = $target.length && $target || $('[name=' + this.hash.slice(1) +']');
            if ($target.length) {
                var targetOffset = $target.offset().top;
                $('html,body').animate({scrollTop: targetOffset}, 700);
                return false;
            }
        }
    });
});

