Moved javascript to separate source file