function ptpWidget (label, name, type, note) {
	this.label = label.noSpaces();
	this.note = "";
	if(note) {
		this.note+='<div class="note">'+note+'</div>';
	}
	
	
	if (type == "textarea") {
		this.html = '<div id="'+this.label+'Container" class="ptpwidget"><strong>'+name+'</strong><br/><textarea name="'+this.label+'" id="'+this.label+'" style="width:300px; height:200px;"></textarea>'+this.note+'</div>';
	} else if (type == "input") {
		this.html = '<div id="'+this.label+'Container" class="ptpwidget"><strong>'+name+'</strong><br/><input name="'+this.label+'" id="'+this.label+'" type="text" style="width:300px;"/>'+this.note+'</div>';
	}
	
	
	return true;	
}

ptpWidget.prototype.validate = function(callback, errortype) {
	var testthing = this.label.toString();
	var errorContainer = '<span id="'+this.label+'Error_'+errortype+'" class="error"></span>'
	$("#"+this.label+'Container').append(errorContainer);
	$("#"+this.label).change(function() {
		callback(testthing, errortype);
		
	}).blur(function() {
		callback(testthing, errortype);
		
	});
	$("#emailForm").submit(function() {
		
		if (callback(testthing, errortype)) {
			return true;		
		} else {
			return false;
		}
		
	});
}
