Add javascript to ensure support of date inputs

Add a JS function named `checkDateInputs`. From the docstring:

> Check to see if the browser supports date inputs.
>
> Create a dummy element that will never be attached to the DOM tree and use it
> to probe the capabilities of the browser. If the browser does not provide a
> custom control for date inputs, find all date inputs and fiddle with their
> attributes.

Also clean up JavaScript with JSLint.