Fixed javascript ordering