$(function() {
    $("#rm li a").click(function() {
        
        // Figure out current list via CSS class
        var curList = $("#rm li a.current").attr("rel");
        
        // List moving to
        var $newList = $(this);
        
        // Remove highlighting - Add to just-clicked tab
        $("#rm li a").removeClass("current");
        $newList.addClass("current");
        
        // Figure out ID of new list
        var listID = $newList.attr("rel");
        
        if (listID != curList) {
            
            // Fade out current list
            $("#"+curList).fadeOut(80, function() {
                
                // Fade in new list on callback
if(window.attachEvent){
    $("#"+listID).fadeIn(120,function(){ this.style.removeAttribute("filter"); });
}
else if(window.addEventListener){
    $("#"+listID).fadeIn();
}
                
            });
            
        }        
        
        // Don't behave like a regular link
        return false;
    });

});

