/*--- cufon ------------------------------------*/
	Cufon.replace('h2,h3,h4,#navi-add3', { fontFamily: 'Californian FB' });
/*--- to encrypt e-mail address ------------------------------------*/
	
function noSpam() {
    if (document.getElementById) {
		var at = "@";
	  	var links = document.getElementsByTagName('a');
	  
	  	for (var i = 0; i < links.length; i++) {
		  	var linkElem = links[i];
			
		  	if (linkElem.className == 'email') {
		  		var mail = linkElem.firstChild; var domain = linkElem.lastChild;
		  		mail.nextSibling.firstChild.innerHTML = at;
		  		linkElem.href = "mailto:" + mail.data + at + domain.data;
		  	}
			
	  	} 
	  
    } 
}

/*--- to start functions ------------------------------------*/
	 
$(function(){ 
	noSpam();
});

/*--- smooth scroll ------------------------------------*/
	 
$(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}, 800);
                return false;
            }
	        }
});
});

/*--- fancybox ------------------------------------*/
		jQuery(document).ready(function() {
			jQuery("a[class=zoom]").fancybox({
				'transitionIn'		: 'none',
				'transitionOut'		: 'none',
				'titlePosition' 	: 'over',
				'overlayOpacity'	:	0.5,
				'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
					return '<span id="fancybox-title-over">Bild ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>';
				}
			});
			
			jQuery("a.iframe").fancybox({
				'easingIn, easingOut': true,
				'frameWidth':610,
				'frameHeight':700,
				'overlayOpacity'	:	0.3,
				'overlayColor'		:	'#cccccc'
			});
		});
