MaxletsOperatingSystemEnvironment.LifecycleManager.runOnload(function() {
	var form = document.getElementById('tools');
	function addFormModelValue(name, value) {
		var input = document.createElement('input');
		input.type = 'hidden';
		input.name = name;
		input.value = value;
		form.appendChild(input);
	}
	form.onsubmit = function() {
		(function(prefix, model) {
			addFormModelValue(prefix + '.type', model.type);
			model.id && addFormModelValue(prefix + '.id', model.id);
			for(var i=0; i<model.contents.length; i++) {
				arguments.callee(prefix + '.contents.' + i, model.contents[i]);
			}
		})('layout', MaxletsOperatingSystemEnvironment.NestManager.getModel());
	}
});

