some javascript funny stuff and deselect