move_element function

javascript function for moving element