Event.observe(window, 'load', function() {

		/*
		$('design_positions').getElementsByClassName('field').each(function(f) {
			f.hide();
			f.appendChild( Builder.node('img', {className:'delpos', src:'/img/icons/delete.png'}) );
		});
		*/

		function FunctionEx1(objDate)
		{
			// objDate is a plain old Date object, with the getPHPDate() property added on.
			document.getElementById('QuoteDateby').value = objDate.getPHPDate('F jS, Y');
			return true;
		}

		var objEarlyDateEx3 = new Date();
		objEarlyDateEx3.setMonth(objEarlyDateEx3.getMonth());

		var ndExample4 = document.getElementById('QuoteDateby');
		ndExample4.DateChooser = new DateChooser();
		ndExample4.DateChooser.setEarliestDate(objEarlyDateEx3);
		ndExample4.DateChooser.setUpdateFunction(FunctionEx1);
		ndExample4.DateChooser.setIcon('/img/icons_gif/calendar.gif', 'QuoteDateby');

		// If they select "other" change focus to "other" input field
		$('QuoteTypeShirt').observe('change', function() {
			if(this.value == 'other') {
				$('QuoteOther').focus();
			}
		});

/*
		$('QuoteSelectPosition').observe('change', function() {
			if(this.value === '') { return; }

			// Show the field
			var field = $( "Quote" + ("-" + this.value.dasherize()).camelize() );
			field.up().show();
			field.activate();

			// Disable that option, change the selected index
			$(this).down("option[value="+this.value+"]").disabled = true;
			$(this).selectedIndex = 0;
		});

		$$("img.delpos").each(function(elem) {
			elem.observe('click', function(event) {
				// Fetch corresponding input field and its id
				var input = this.up().down('input');
				var value = String(input.id).substr(5).underscore(); // TODO Properly strip 'Quote'

				// Enable option in select, clear input and hide
				$('QuoteSelectPosition').down("option[value="+value+"]").disabled = false;
				input.clear();
				$(this).up().hide();
			});

		});
*/
});
