As far as determining if it\'s a leapyear, you can use the if-then-else operator // For example: if (4 // %year) return $true
The // operator determines if $v2 is a multiple of $v1. Also I think there would be a more efficient way of displaying the buttons for the days of different months, Such as creating 31 buttons and having them all hidden, then using a drop menu to select a month and then unhiding the correct number of buttons. This would save alot of code in the dialog.