I have 2 UDFs that need to be called sequentially.

Traditionally, Javascript will call function1() which once its commands are initiated, will then call function2(). Thing is, function1() has jQuery based animations, and I only want it to return and call function2() when it's done. Since UDF's don't seem to have jQuery's callbacks built into them, can anyone think of a way I can do this with my UDFs?