function Form(form) {
	var r = {def: /.+/};
	this.form = form;	
	this.el = [];
		
	var i = 0, e = this.form.elements;
	for(; i < e.length; i++) if(e[i].tagName == 'SELECT' || e[i].tagName == 'TEXTAREA' || e[i].getAttribute('type') == 'text' || e[i].getAttribute('type') == 'password' || e[i].getAttribute('type') == 'radio' || e[i].getAttribute('type') == 'checkbox' || e[i].getAttribute('type') == 'file' || e[i].getAttribute('type') == 'hidden') this.el.push(e[i]);
	

	this.t = function(check, notice_func, notice) {
		this.check = check;
		this.na = {};
		this.notice = notice;
		for(var i in this.check) {			
			var n = false, e = this.form.elements[i];
			if(e.tagName == 'SELECT' && e.value == this.check[i]) n = true;
			else if(e.type == 'radio' && !e.checked) n = true;
			else if(!e.tagName) {
				n = true;
				for(j = 0; j < e.length; j++) if(e[j].checked) n = false;
			}
			else if(e.type == 'checkbox' && !e.checked) n = true;
			else if(e.type == 'file' && e.value == '') n = true;
			else if((e.tagName == 'TEXTAREA' || e.type == 'text' || e.type == 'password' || e.type == 'hidden') && !r[this.check[i]].test(this.form.elements[i].value)) n = true;
			if(n) {
				if(!this.na.hasOwnProperty(i)) this.na[i] = true;
			}
			else if(this.na.hasOwnProperty(i)) delete this.na[i];
		}		
		if(notice_func) notice ? notice_func.call(this, notice) : notice_func.call(this);
		var c = 0;		
		for(var i in this.na) if(this.na.hasOwnProperty(i)) c++;		
		if(c == 0) return true;		
		return false;		
	}
	
	this.serialize = function() {
		var i, r, data = [];		
		for(i in this.el) {		
			var v = false;
			if(this.el[i].type == 'radio' && this.el[i].name != r) {
				r = this.el[i].name;
				var e = this.form.elements[r];
				for(var j = 0; j < e.length; j++) if(e[j].checked) v = e[j].value;
			}
			else if(this.el[i].type == 'checkbox' && this.el[i].checked) v = 'on';
			else if(this.el[i].tagName == 'TEXTAREA' || this.el[i].tagName == 'SELECT' || this.el[i].type == 'text' || this.el[i].type == 'password' || this.el[i].type == 'hidden') v = this.el[i].value;			
			if(v !== false) data.push(this.el[i].name+'='+encodeURIComponent(v));			
		}
		return data.join("&");		
	}			
}