move javascript to external file