Hi. I have a database application which allows people to book a cinema. They select the date by using a Javascript controlled drop down menu.

Code:
<SCRIPT LANGUAGE="Javascript">
today = new Date();
thismonth = today.getMonth()+1;
thisyear = today.getYear();
thisday = today.getDate();
montharray=new Array(31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
maxdays=montharray[thismonth-1];
if (thismonth==2) {
if ((thisyear/4)!=parseInt(thisyear/4)) maxdays=28;
else maxdays=29;
}
thismonth = "" + thismonth
if (thismonth.length == 1) {
thismonth = "0" + thismonth;
}
document.write("<form>");
document.write("<select name=dates value=thedate size=1>");
for (var theday = 1; theday <= maxdays; theday++) {
var theday = "" + theday;
if (theday.length == 1) {
theday = "0" + theday;
}
document.write("<option");
if (theday == thisday) document.write(" selected");
document.write(">");
document.write( thisyear + "-" + thismonth + "-" + theday );
}
document.write("</select>");
document.write("<INPUT TYPE='submit' VALUE='go'>");

</SCRIPT>
It is good because it puts the current date on the top, however, it will only show up until the end of the month, and then on the new month it flicks over, which isn't much good for people wanting to book in advance. It only needs to show say 2 weeks in advance, but I would appreciate some helping fixing it.

Or alternatively if someone can find/write a better/new script, that would be awesome. Cheers.