/**
 * Uses JQuery, scrollTo Plugin and Easing Plugin
 * Only tested with 
 * JQuery 1.2.3, 
 * scrollTo Plugin 1.3.3 and
 * Easing Plugin 1.3
 *
 * @author Mario Volke <mario.volke@webholics.de>
 * @copyright 2008 Mario Volke
 */

$(document).ready(
    function() {        
        // smooth anchor scrolling
        $('a[@href^="#"]').click(
            function() {
                var splits = this.href.split('#');
                var target = '#' + splits[1];
                $.scrollTo(target, 600, {easing:'easeInSine'});
                return false;
            }
        );
        
        // set external links with rel="external"
        $('a[@rel]').each(
            function() {
                var rel = $(this).attr('rel');
                var parts = rel.split(' ');
                var found = false;
                
                for(var i in parts) {
                    if(parts[i] == 'external') {
                        found = true;
                    }
                }

                if(found) {
                    $(this).addClass('external').attr('target', '_blank');
                }
            }
        );
    }
);
