Datepicker with seperate fields for day/month/year

Ok so the design is to have 3 fields, 1 each for day, month, year and a datepicker button which populates these fields. ‘Im using jQuery UI here and then a little change in the configuration which I found on StackOverflow (man I love that site!)
Heres the javascript:

And the html to go with it. The #datepicker input is hidden but the image still shows up for bringing up the calendar so its ok.