Yeah, in that file, find the lines below:
$buttonSize = $params->get('loginButtonSize');
echo $fbClient->getLoginButton($buttonSize); ?>
And replace with the lines in the Common Support Question for working in a popup.
You'll need to start your code off with a ?> to close the PHP block that the above code was originally in. When done, your code will look like:
?>
<input type="button" onclick="jfbc.login.login_custom();" value="Login With Facebook" />
It's getting higher on our list to overhaul the template file for the Login module as it's pretty ugly right now. Sorry about that.
Let us know if you need anything else or run into issues.
Alex