// JavaScript Document

	var MultiControl = Class.create({
			
		initialize: function(element) {
				
			this.name	= element;
			this.el 	= $(element);
			
			this.elements = new Hash();
			
			this.el.childElements().each( function(item) {
				
				attrib = item.readAttribute('multiControl')
				
				if ( attrib != null) {
				
					this.elements.set(attrib, new ContentManager(item))
					
				}
												   
			}.bind(this));
			
			
		},
		open: function(name) {
			
			this.elements.get(name).show();
				
				
			
		},
		close: function(name) {
				
			this.elements.get(name).hide();
			
		},
		swap: function(name) {
				
			this.elements.each( function (item) {
			
				(item.key == name) ? item.value.show() : item.value.hide();
				
			}.bind(this));
			
		},
		toggle: function(name) {
				
			this.elements.get(name).toggle();
			
		},
		clearForm: function() {
				
			
		},
		positionSearch: function() {
			
			$(this.name + 'AutocompleteReturn').clonePosition($(this.name + 'Autocomplete'), { 
					
				setWidth: false, 
				setHeight: false, 
				offsetTop: $(this.name + 'Autocomplete').getHeight()
				
			});
				
			$(this.name + 'AutocompleteReturn').show();
			
		}
			
	});