put javascript at bottom of page and removed redundant type=javascript attribute