load proper javascript files in main template