If you use our standard Add to Cart and View Cart code, that already applies the "lightbox" effect for our cart, so there's no need for you to reproduce that effect yourself. Just make sure every page that has any number of Add to Carts also has at least one block of our View Cart code, as the latter invokes our scripting that generates our standard overlay-style cart.
Once you replace your code with our standard button code, if you are still encountering that error, please reply to mention which browser on which platform you are using. You might also want to look for a text/character encoding setting in your browser's menus (typically the View menu), and make sure you don't have something strange selected in there; Automatic, Unicode UTF-8, ISO 8859-1 or Windows-1252 should all work fine.