moved javascripts to top of layout application page because if they are at bottom then page looks bad cause it loads for split second with no javascript