Straightened some things out in the javascript. Still not working with Safari though.