My guess is
- function ShowHide(){
- $("#news1").animate({"height": "toggle"}, { duration: 250 },function () {
- if ( !($(this).height()) )
- // set cookie - height is zero
- });
- }
which uses a callback function when the animation is complete.
There is a jQuery plug-in for cookies, or you could use a couple of JavaScript functions.