$(document).ready(function() {

    // add link to forum onto nav portlet. need to change this as I really should have a link type on the menu.
    $("#portlet-navigation-tree a.navRootItem").after("<a href=\"http:\/\/www.reefs.org\/phpBB2\" accesskey=\"n\" class=\"navItem navLevel1\" title=\"Reefs.org Bulletin Board\"><img alt=\"\" class=\"navIcon\" src=\"folder_icon.gif\" title=\"Folder\" height=\"16\" width=\"16\"><span class=\"navItemText\">&nbsp;Forums<\/span><\/a>");
    
    // news ticker
    $("#powerbuy").newsticker(); 
    
    // create tabs
    $('#portal-aaolm-maco').tabs({fxFade: true, fxSpeed: 'normal'});
    $('#tabbed-section-two').tabs({fxFade: true, fxSpeed: 'normal'});

    // round portlets (roundedcornr.com)
    $("div.portletBody div.even")
        .wrap("<div class=\"portletContent even\"><\/div>")
        .removeClass()
        .addClass("roundedcornr_content")
        .before("<div class=\"roundedcornr_top\"><div><\/div><\/div>")
        .after("<div class=\"roundedcornr_bottom\"><div><\/div><\/div>");


    // round odd items in folder_listing.pt
    $("#region-content dl .portletContent:even")
        .wrap("<div class=\"roundedcornr_box_blue\"><\/div>")
        .before("<div class=\"roundedcornr_top_blue\"><div><\/div><\/div>")
        .after("<div class=\"roundedcornr_bottom_blue\"><div><\/div><\/div>")
        .removeClass()
        .addClass("roundedcornr_content_blue"); 

    // round odd items in folder_listing.pt (only odd items are left!) 
    $("#region-content dl .portletContent")
        .wrap("<div class=\"roundedcornr_box_grey\"><\/div>")
        .before("<div class=\"roundedcornr_top_grey\"><div><\/div><\/div>")
        .after("<div class=\"roundedcornr_bottom_grey\"><div><\/div><\/div>")
        .removeClass()
        .addClass("roundedcornr_content_grey"); 

    // Add 'even' class to every other table row (Zebra Tables)
    $("#region-content tr:nth-child(odd)").addClass("even");

});
