Calculating the font size to fit the width of a website
Use strict-mode

Start your code with "use strict";:
https://stackoverflow.com/questions/1335851/what-does-use-strict-do-in-javascript-and-what-is-the-reasoning-behind-it

Don't pollute the global namespace

When you don't use var x; to declare a variable, it is implicitly declared in the global namespace. If another script does the same, both scripts will be using the same variable.

It is not very easy for this to happen with an odd name like newWidthGhost, but fontHeight sounds like a better candidate for these surprises.

Run the code through JSLint

Run your code through JSlint, and try to understand the errors and suggestions it gives you.

That alone will greatly improve the quality of your code.