/* Author: Andreas Walter */
/* Company: Euroweb Internet GmbH */
/* Copyright: 2010 - Andreas Walter & Euroweb Internet GmbH */

/* ///////////////////////////////////////////////////////////
	=> mailmask 
/////////////////////////////////////////////////////////// */

function noSpam() {
	jQuery('a.escape').each(function() {
		jQuery(this).find('span').first().html('@');
		var text = jQuery(this).text();
		jQuery(this).find('span').remove();
		jQuery(this).attr('href', 'mailto:' +text).text(text);
	});
};

/* ///////////////////////////////////////////////////////////
	=> smoothScroll 
/////////////////////////////////////////////////////////// */

function smoothScroll() {
    $('a[href*=#header]').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}, 500);
                return false;
            }
        }
    });
}

/* ///////////////////////////////////////////////////////////
	=> on load 
/////////////////////////////////////////////////////////// */

Cufon.replace(['#content-main h2','#content-main h3','#content-main h4','.word-cloud','.beratertage','#footer p']);

$(function(){	   
	noSpam();
	smoothScroll();
});
