Updated script.js

Fix should work on all modern browsers (chrome, safari, opera, ff and ie)