moving flashing to a jquery plugin