fixing js errors. Using YUI compressor to minify generated JS on average
by 25%