jQuery.fn.swap = function(b) {
    b = jQuery(b)[0];
    var a = this[0],
        a2 = a.cloneNode(true),
        b2 = b.cloneNode(true),
        stack = this;

    a.parentNode.replaceChild(b2, a);
    b.parentNode.replaceChild(a2, b);

    stack[0] = a2;
    return this.pushStack( stack );
};

$(document).ready(function() {
    if (document.location.pathname != "/") {
        $('body').scrollTo( "#skip_menu", 800 );
    };

    $(".portletItem").each(function() {
        children = $(this).children()
        var link = $(children[0]);
        var span = $(children[1]);
        link.swap(span);
    });
});
