Added jquery.
Changed some javascript code to jquery