// Mailmask
jQuery.fn.noSpam = function() {
	at = '@';
	return this.each(function(){
		e = null;
		jQuery(this).find('span').replaceWith(at);
		e = jQuery(this).text();
		jQuery(this).attr('href', 'mailto:' + e);
	});
};

jQuery(function(){
	 jQuery('a.escape').noSpam();
    jQuery('a[href*=#]').click(function() {
    if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') 
        && location.hostname == this.hostname) {
            var $target = jQuery(this.hash);
            $target = $target.length && $target || jQuery('[name=' + this.hash.slice(1) +']');
            if ($target.length) {
                var targetOffset = $target.offset().top;
                jQuery('html,body').animate({scrollTop: targetOffset}, 1000);
                return false;
            }
        }
    });
	jQuery("a[rel='lightbox']").colorbox({maxHeight:"90%"});
});

