(function($){
	
	// valArray
	// example: $('[name=target]:checkbox:checked').valArray() 
	$.fn.valArray = function() {
		var vals = [];
		this.each(function() { 
			if (typeof this.value == 'string') vals.push(this.value); 
		});
		return vals;
	}
	// idValArray
	// example: $('[name=target]').idValArray() 
	$.fn.idValArray = function(trim) {
		var vals = [];
		this.each(function() { 
			if (typeof this.id == 'string' && typeof this.value == 'string') {
				var id = this.id;
				var val = this.value;
				if (trim) {
					var name = this.name;
					id = id.replace(name,'');
				}
				vals[id] = val; 
			}
		});
		return vals;
	}
	// checkedValArray
	// example: $('[name=target]:checkbox').checkedValArray() 
	$.fn.checkedValArray = function() {
		var vals = [];
		this.each(function() { 
			if (this.checked) vals.push(this.value); 
		});
		return vals;
	}
	// anyChecked
	// example: $('[name=target]:checkbox').anyChecked() 
	$.fn.anyChecked = function() {
		var found = false;
		this.each(function() { 
			if (this.checked) { found = true; }
		});
		return found;
	}
	// nameValObject
	// example: $('div#saveform input').nameValObject() 
	$.fn.nameValObject = function() {
		var vals = {};
		this.each(function() { 
			if (!this.name) return;
			if (typeof this.value == 'string') vals[this.name]=this.value; 
		});
		return vals;
	}
	// idValObject
	// example: $('div#saveform input').idValObject() 
	$.fn.idValObject = function() {
		var vals = {};
		this.each(function() { 
			if (!this.id) return;
			if (typeof this.value == 'string') vals[this.id]=this.value; 
		});
		return vals;
	}
	
	
})(jQuery);