working js on dealing page