move javascript to document head