how to implement 3rd party javascript in egg?

I have found out photo uploader and viewer much better than tidypic but its a javascript can any1 give me guidelines to add js into elgg also wanted to register action like upload I know how to do it in php way just wanted the elgg way...