var Tools = {
	Elements: {
		CheckBox: {
			getSelectedValues: function(name) {
				var options = $$('input[name="' + name + '"]');
				var length = options.length;
				var categories = new Array();
		
				for (var index=0; index < length; index++) {
					if (options[index].checked) {
						categories.push(options[index].value);
					}
				}
				return categories;
			},
	
			getSelectedOptions: function(name) {				
				return $$('input[name="' + name + '"]');
			},
					
			selectOptions: function(name, values) {
				var options = $$('input[name="' + name + '"]');
				var optionsSize = options.size();
				var valuesSize = options.size();
		
				for (var x=0; x < optionsSize; x++) {
					for (var y=0; y < valuesSize; y++) {							
						if (options[x].value == values[y]) {
							options[x].checked = true;
						}							
					}						
				}
			},
			
			deselectAllOptions: function(name) {
				var options = $$('input[name="' + name + '"]');
				var size = options.size();
		
				for (var index=0; index < size; index++) {
					options[index].checked = false;
				}
			}									
		}
	},
	
	String: {
		isEmpty: function(string) {
			return string.replace(/^\s+|\s+$/g,'') == '';
		}
	}		
}