move the javascript for homepage slider to separate file