You can't really eliminate the flicker, but you can soften it, although it does add time to the transition.
// Put this in your navigation function
$("body").fadeOut(200,function(){window.location = filename);
// Make sure the body tag of the next page is hidden by default
<body style='display:none'>
// Then after loading the new page, fade it in
$(document).ready(function() {
$("body").fadeIn(200);
});
It gets rid of the flicker but in my opinion this is just as bad because it slows down the page load quite significantly and shows the user a white screen for much longer than a flicker would. You decide.