/**
 * Use this script to set the target attribute for external links
 * per JavaScript.
 * uses JQuery >1.1.3.1
 *
 * @author Mario Volke <mario.volke@webholics.de>
 * @copyright 2007 Mario Volke
 */
 
$(document).ready(
    function() {
        $('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');
                }
            }
        );
    }
);

