This is a simple loading script from nettuts and I tried to modify it to suit my needs. But I can't get function "res," which resizes loaded elements, to happen BEFORE function shownewcontent runs. Now it resizes after it is visible, which is very bad looking. But if I place call the function sooner, nothing happens, because the content is not yet loaded.
$(document).ready(function() { 
    var hash = window.location.hash.substr(1);  
    var href = $('#menu a').each(function(){  
        var href = $(this).attr('href');  
        if(hash==href.substr(0,href.length-4)){  
            var toLoad = hash+'.php #content';  
            $('#content').load(toLoad);
        }
    });  
    $('#menu a').click(function(){  
        var toLoad = $(this).attr('href')+' #content';  
        $('#content').hide('slow',loadContent);  
        window.location.hash = $(this).attr('href').substr(0,$(this).attr('href').length-4);
        function loadContent() {  
            $('#content').load(toLoad,'',showNewContent());
        }  
        function showNewContent() {
            $('#content').show("0", res)
        }
        return false;
    });
});
 
     
     
    