$(function() {
	$("input.DateSelectYear").datepicker({
		showOn: "button",
		buttonImage: iconPath + "/calendar_16.png",
		buttonImageOnly: true,
		dateFormat: "yy",
		onSelect: function(dateText, inst)
		{
			var name = this.id.substr(0, this.id.length - 4);
			$("#" + name + "Month").val(inst.selectedMonth + 1);
			$("#" + name + "Day").val(inst.selectedDay);
		},
		beforeShow: function(input, inst)
		{
			var name = this.id.substr(0, this.id.length - 4);
			var year = this.value;
			var month = $("#" + name + "Month").val();
			var day = $("#" + name + "Day").val();
			
			var now = new Date();
			
			if(year.length != 4)
			{
				year = now.getFullYear();
			}
			
			if(month.length != 2)
			{
				month = now.getMonth() + 1;
			}
			
			if(day.length != 2)
			{
				day = now.getDate();
			}
			
			return {
				defaultDate: new Date(year, month - 1, day)
			};
		}
	});
});
