I do not have a javascript, but pure ASP will do the job. If you name your images 1.gif, 2.gif, 3.gif, ... , 31.gif then you may use this:
<%
pic=Day(now()) & ".gif"
%>
<img src='<%=pic%>' border=0>
Of course, this assumes that all your images have the same extension, ie .gif.
Ojf