/* Author: 

*/


$(document).ready(function () {
  $('.picture a').hover(function () {
    $(this).find('strong').stop().fadeTo('normal', 1);
  }, function () {
    $(this).find('strong').stop().fadeTo('normal', 0);
  });

  $('.picture2 a').hover(function () {
    $(this).find('strong').stop().fadeTo('normal', 1);
  }, function () {
    $(this).find('strong').stop().fadeTo('normal', 0);
  });

  $(function() {          
          $("img").lazyload({
             placeholder : "img/grey.gif",
             effect      : "fadeIn"
          });
      });

$('#servicescontent').masonry({
  itemSelector: '.serviceitem'
}); 


	$('#headnavi li a').click(function(){
		$('#main').hide('slow');
		$('#load').fadeIn('normal'); 
	
	});






/** the Toggle **/
var showText='Details zeigen';
var hideText='schliessen';
// initialise the visibility check
var is_visible = false;
// append show/hide links to the element directly preceding the element with a class of "toggle"
$('.toggle').prev().append(' <a href="#" class="toggleLink">'+showText+'</a>');
// hide all of the elements with a class of 'toggle'
$('.toggle').hide();
// capture clicks on the toggle links
$('a.toggleLink').click(function() {
// switch visibility
is_visible = !is_visible;
// change the link depending on whether the element is shown or hidden
$(this).html( (!is_visible) ? showText : hideText);
// toggle the display - uncomment the next line for a basic "accordion" style
//$('.toggle').hide();$('a.toggleLink').html(showText);
$(this).parent().next('.toggle').toggle('slow');
// return false so any link destination is not followed
return false;
});






});


jQuery(".scroll").click(function(event){  
        event.preventDefault();  
        var full_url = this.href;  
        var parts = full_url.split("#");   
        var trgt = parts[1];   
        var target_offset = jQuery("#"+trgt).offset();   
        var target_top = target_offset.top;  
        jQuery('html, body').animate({  
            scrollTop:target_top  
        }, 1000);  
});  


$(function() {
// OPACITY OF BUTTON SET TO 50%
$(".navlink").css("opacity","0.5");
$(".topbutton").css("opacity","0.5");
 
// ON MOUSE OVER
$(".navlink").hover(function () {
 
// SET OPACITY TO 100%
$(this).stop().animate({
opacity: 1.0
}, "slow");
},
 
// ON MOUSE OUT
function () {
 
// SET OPACITY BACK TO 50%
$(this).stop().animate({
opacity: 0.5
}, "slow");
});

// ON MOUSE OVER
$(".topbutton").hover(function () {
 
// SET OPACITY TO 100%
$(this).stop().animate({
opacity: 1.0
}, "slow");
},
 
// ON MOUSE OUT
function () {
 
// SET OPACITY BACK TO 50%
$(this).stop().animate({
opacity: 0.5
}, "slow");
});

});




















