pax.load.onloaded( function() {
	//	Setup a template for our form, notice the 'partial_stub'
	var myTemplate = "\
		<button id='example3_the_button'>Display notes field</button>\
		<br/>\
		<fieldset style='width:530px;'><legend>Customer details</legend>\
			<label for='name'>Name</label>\
				<input name='name' type='text' size='30' style='width:300px' value='[:= name :]'><br>\
			<label for='address'>Address</label>\
				<input name='address' type='text' size='80' style='width:300px' value='[:= add :]'><br>\
			<label for='phone'>Phone</label>\
				<input name='phone' type='text' size='10' style='width:300px' value='[:= ph :]'><br>\
			<label for='owing'>Owing</label>\
				<input name='owing' type='text' size='10' style='width:300px' value='[:= owe :]'><br>\
		[:p(partial_stub) \
			[: if( typeof(notes) != 'undefined' ) { :]\
			<label for='notes'>Notes</label><br/>\
				<textarea name='notes' style='width:300px' rows='6'>[:= notes :]</textarea>\
			[: }:]\
		p:] \
		</fieldset>\
	";

	//	Create some data
	var cust = { name: "Nick Hogan", add: "17/11 Lilyfield Rd, Hornsby NSW 2187", ph: "02 9555 1298", owe:  412.84	};
	
	//	Render the template and data
	pax.template.render( myTemplate, { value: cust, target: pax.$("example3_output") } );
	
	//	Bind function to the button
	pax.event.bind( pax.$('example3_the_button'), 'click', function() {
		//	Retreive the notes via ajax, and render the partial part of the template
		pax.get( '../examples/demo_template_example3_notes.txt', function( xml, txt, url ) {
			cust['notes'] = txt;
			pax.template.render( myTemplate, { value: cust, partial: 'partial_stub' } );
		} );
	} );
} );
