				YAHOO.namespace("example.calendar");

				function handleSelect(type,args,obj) {
					var dates = args[0]; 
					var date = dates[0];
					var year = date[0], month = date[1], day = date[2];

					var selMonth = document.getElementById("selMonth");
					var selDay = document.getElementById("selDay");
					var selYear = document.getElementById("selYear");
					
					selMonth.selectedIndex = month;
					selDay.selectedIndex = day;

					for (var y=0;y<selYear.options.length;y++) {
						if (selYear.options[y].text == year) {
							selYear.selectedIndex = y;
							break;
						}
					}
					YAHOO.example.calendar.cal1.hide();
				}

				function updateCal() {
					var selMonth = document.getElementById("selMonth");
					var selDay = document.getElementById("selDay");
					var selYear = document.getElementById("selYear");
					
					var month = parseInt(selMonth.options[selMonth.selectedIndex].text);
					var day = parseInt(selDay.options[selDay.selectedIndex].value);
					var year = parseInt(selYear.options[selYear.selectedIndex].value);
					
					if (! isNaN(month) && ! isNaN(day) && ! isNaN(year)) {
						var date = month + "/" + day + "/" + year;

						YAHOO.example.calendar.cal1.select(date);
						YAHOO.example.calendar.cal1.cfg.setProperty("pagedate", month + "/" + year);
						YAHOO.example.calendar.cal1.render();
					}
				}

				function init() {
									

				
				
					YAHOO.example.calendar.cal1 = new YAHOO.widget.CalendarGroup("cal1","cal1Container", { pages:2, title:"Please make a selection:", close:true } );
					YAHOO.example.calendar.cal1.render();

					// Listener to show the 3-up Calendar when the button is clicked
					YAHOO.util.Event.addListener("show3up", "click", YAHOO.example.calendar.cal1.show, YAHOO.example.calendar.cal1, true);


					YAHOO.example.calendar.cal1.selectEvent.subscribe(handleSelect, YAHOO.example.calendar.cal1, true);
					YAHOO.example.calendar.cal1.render();

					YAHOO.util.Event.addListener(["selMonth","selDay","selYear"], "change", updateCal);
					

					
				}

				YAHOO.util.Event.addListener(window, "load", init);
				

