Custom flash realization. js improvements