mshtml: Moved getting form's elements by index to separated function.