* replaced some javascript functions with jQuery functions