		var popupCalendar = {};
			popupCalendar.cfDate = Class.create({
				initialize: function(a_year,a_month,a_date)
				{
					this._date = new Date(a_year,a_month-1,a_date);	
				},
				toJSDate: function()
				{
					return this._date;	
				}
			});
			popupCalendar.calendar = Class.create({
			
				initialize: function(a_positionId,a_inputId,a_selectPast)
				{
					this.calendar = null;
				
					this.overlayNode = $(a_positionId);
					this.inputNode = $(a_inputId);
					this.canSelectPast = (a_selectPast)?true:false;
					this.calendarNode = this.buildCalendar();
					
					return this;
				},
				buildCalendar: function()
				{
					var thisRef = this;
					this.calendar = new wcWidget.calendar(function(a){thisRef.selectDay(a);},this.canSelectPast);
					
					var calendarHolder = new wcWidget.tableLayout(1,{className:'popup'});
						calendarHolder.add(this.calendar.getNodes());
						calendarHolder.add(wcDOM.createFromObject({element:'a', text:'close', attributes:{href:'#', onclick:function(){thisRef.hide(); return false;}}}));
						calendarHolder.flush();
						
					return calendarHolder.getNodes();
				},
				setDefault: function(a_date)
				{
					this.calendar.setSelected(a_date);
					this.selectDay(a_date);
				},
				selectDay: function(a_date)
				{
					if(this.inputNode)
					{
						this.inputNode.value = (a_date.getMonth()+1) + '/' + a_date.getDate() + '/' +  a_date.getFullYear();
					}
					this.hide();
				},
				hide: function()
				{
					if(this.calendarNode.parentNode)this.calendarNode.parentNode.removeChild(this.calendarNode);
				},
				show: function()
				{
					if(this.overlayNode && this.inputNode)
					{
						var cnode = $(document.body.appendChild(this.calendarNode));
							cnode.clonePosition(this.overlayNode,{setLeft:true, setTop:true, setWidth:false, setHeight:false});
					}
					else throw new Error('The ID passed into popupCalendar.calendar is not valid.');
				}
			
			});