changed functions so that it can be used with jQuery 1.4

I'm sorry if I had some mistakes cuz of lack of experience.