Username or email address fields

I am maintaining the server implementation of a website. The site allows usernames and email address as username.

This is how the login screen looks where the user is asked to select if the user is typing in a username or an email address.

enter image description here

I think this is useless as I can very easily determine (javascript or java code on server)if the user is typing in an email address.

One train of thought makes this login appear alright.

Another makes it appear silly.

What would be the best way to implement a login screen where the user could either select a username or an email address ?