// $(document).ready(function() {
//         $('.content img').each(function() {
//             $(this).hover(function() {
//                 $(this).stop().animate({ opacity: 0.5 }, 500);
//             },
//            function() {
//                $(this).stop().animate({ opacity: 1.0 }, 500);
//            });
//         });
//     });
// $(document).ready(function() {
// 	$('.backtotop').click(function(){
// 		$('html, body').animate({scrollTop}, 20000 );
// 	});
// });

//create onDomReady Event
      window.onDomReady = initReady;
 
      // Initialize event depending on browser
      function initReady(fn)
      {
      	//W3C-compliant browser
      	if(document.addEventListener) {
          document.addEventListener("DOMContentLoaded", fn, false);
        }
      	//IE
      	else {
          document.onreadystatechange = function(){readyState(fn)}
        }
      }
 
      //IE execute function
      function readyState(func)
      {
      	// DOM is ready
      	if(document.readyState == "interactive" || document.readyState == "complete")
      	{
      		func();
      	}
      }
      
      //execute as soon as DOM is loaded
window.onDomReady(onReady);
 
//do when DOM is ready
//Footer in der Höhe abgleichen (Safari/Chrome & Rest)
function onReady()
{
	if (navigator.userAgent.match(/AppleWebKit/) && ! navigator.userAgent.match(/Chromeo/)) {
	document.getElementById('register-1').style.height=document.getElementById("register-2").offsetHeight -2 +"px";
	document.getElementByClass('.slideshow').style.height=document.getElementByClass(".slideimg").offsetHeight +100 +"px";}
	else {
	document.getElementById('register-1').style.height=document.getElementById("register-2").offsetHeight +"px";
	document.getElementByClass('.slideshow').style.height=document.getElementByClass(".slideshow img").offsetHeight +"px";}
};

//Silbentrennung aktivieren
Hyphenator.setMinWordLength(4);
                Hyphenator.setDisplayToggleBox(false);
                Hyphenator.run();
                
//Elemente einblenden
$(document).ready(function() {
  $("img,h2,h3,h4,p").animate({
      opacity: "1.0"
  }, 1500 );
});

//Slideshow
$('#slideshow').cycle({ 
    fx: 'fade', 
    speed: 600, 
    next: '#next, #slideshow',
    prev: '#prev',
    timeout: 0,
    after: onAfter
});

//Slideshow Image Counter
function onAfter(curr,next,opts) {
	var caption = '<span class="nummer">Bild ' + (opts.currSlide + 1) + ' von ' + opts.slideCount + '</span>';
	$('#caption').html(caption);
}

//.content Element Mouse Over - Neues Hintergrundbild    
// $(document).ready(function() {
//     var colorOrig=$(".content").css('background-image');
//     $(".content").hover(
//     function() {
//         //mouse over
//         $(this).css('background-image', 'url(/wp-content/themes/zubizuri/images/bg.gif)')
//     }, function() {
//         //mouse out
//         $(this).css('background-image', colorOrig)
//     });
// });

//Animiertes Scrollen
$(document).ready(function() {
	$('a[href*=#]').bind("click", function(event) {
		event.preventDefault();
		var ziel = $(this).attr("href");

                if ($.browser.opera) {
                    var target = 'html';
                }else{
                    var target = 'html,body';
                }

		$(target).animate({
			scrollTop: $(ziel).offset().top
		}, 'slow' );
});
return false;
});

 $(document).ready(function() {
 $(".content").mouseover(function(){$(this).colorBlend(colorBlendOptions);});
  });
  
  var colorBlendOptions = [
 	{ param: "background-color", colorList:["#83DCAA", "#69C6D5", "#5381BC", "#CE6227", "#E19C3A"], duration: 10000, fps: 30 }
];
