
function handleAddChildren (evt) {
	evt.stop();
	var container = $('QuoteWizard');
	var form = container.getElements('form');
	var numChildren = $$('.child').length;
	$('numChildren').setProperty('value',numChildren+1);
	container.get('load', {
		async: false,
		url: form.getProperty('action'),
		useWaiter: true,
		waiterOptions: {
			baseHref: '/admin/images/icons/',
			img: { src: 'loader.gif' },
			msg:'one moment please . . .',
			containerPosition: {
				position: 'centerTop',
				offset: { x: -120, y: 50 }
			}
		},
		onSuccess: function(tree,elems,html,js){
			this.innerHTML = html;
			$('addChildren').addEvent('click', handleAddChildren);
		}
	}).post('?addChild='+(numChildren+1));
}
window.addEvent('domready',function(){
	if ($('addChildren')!=null) $('addChildren').addEvent('click', handleAddChildren);
});


