Not your fault, this is actually a known bug in Webkit browsers like Safari or Chrome with JavaScript code. It always happens on the first page load and goes away if reloading the page. It does not happen in Internet Explorer or Firefox.
Sorry, but sadly we have no solution for this as all code is actually correct. Even some tricks from the net like placing the code at the bottom of a page did not help.
If anyone hase we would be grateful as my main browser is also Safari and I am actually annoyed by this, too.
Update: Well, seems I am not right. This is related to javascript code not being escaped using CDDATA correctly. Probably we missed it somewhere.