Always use selectionStart and selectionEnd to prevent IE11 erroring when trying to use document.selection

Internet explorer 11 no longer supports the selection object http://msdn.microsoft.com/en-us/library/ie/ms535869%28v=vs.85%29.aspx so always use selectionStart and selectionEnd if they are available