wrap javascript in jQuery(document).ready() call. Clean up code.
Merge branch 'master' into topic/solgs_integration_2