Switching postion with Object by clicking it

Please use code-tags when posting code.

Thanks!