Write datepicker function in javascript to allow for IE use