formencuesta = function(){
	
	formencuesta.superclass.constructor.call(this, {
		autoCreate: true
	});
	
	var formulario = new Ext.form.Form({
		style: "align: left; margin-left:10px; margin-top:5px; margin-right:10px;",
		labelWidth: 60,
		waitTitle: "Espere por favor",
		method: "GET",
		disableCaching: false,
		errorReader: new Ext.data.JsonReader({
			root: "resultado", 
			successProperty: "exito"
		}, ["id", "msg"])
	});
	
	/*//formulario.add(
		new Ext.form.HtmlEditor(
			'<table><tbody><td>',
			'Arroz',
			'</td></tbody></table>',
		);
	//);*/
	
	formulario.container({hideLabels: true},
		new Ext.form.Radio({
			boxLabel: "Opción 1",
			id: "1",
			name: "choice",
			checked: true,
			width: 130
		}),
		new Ext.form.Radio({
			boxLabel: "Opción 2",
			id: "2",
			name: "choice",
			width: 130
		}),
		new Ext.form.Radio({
			boxLabel: "Opción 3",
			id: "3",
			name: "choice",
			width: 130
		})/*,
		new Ext.form.Radio({
			boxLabel: "Opción 4",
			id: "4",
			name: "choice",
			width: 90
		}),
		new Ext.form.Radio({
			boxLabel: "Opción 5",
			id: "5",
			name: "choice",
			width: 90
		})*/
	);

	formulario.addButton({
		text: "Votar", 
		handler: this.votar,
		scope: this
	});
	
	formulario.render(this.getEl());
	
	/*var diagrama = Ext.get('diag');
	var c = diagrama.createChild({
		tag:'center', 
		cn: {
			tag:'img',
			src: 'images/diagrama/lo1.png'
		}
	});
	
	this.diagrama = diagrama;

	var esquema = Ext.get('esqu');
	var c = esquema.createChild({
		tag:'center', 
		cn: {
			tag:'img',
			src: 'images/esquema/lo1.png'
	
		}
	});
	
	this.esquema = esquema;*/
	
	this.formulario = formulario;

};

Ext.extend(formencuesta, Ext.ContentPanel, {
	
	/*resetear: function(){
		
		var diag = this.diagrama.child("\img", true);
		diag.src = "images/diagrama/lo1.png";
		
		var esqu = this.esquema.child("\img", true);
		esqu.src = "images/esquema/lo1.png";
		
		this.formulario.reset();
	
	},
	
	votar: function(){
		
		var choice = parseInt(this.formulario.findField("choice").selectRadio().id);
		
		this.formulario.findField("r1").setValue(respuesta[0]);
		this.formulario.findField("r2").setValue(respuesta[1]);
		this.formulario.findField("c2").setValue(respuesta[2]);
		
		this.actualizarDiagrama(respuesta[3]);
		this.actualizarEsquema(respuesta[3]);
	
	}*//*,
	
	actualizarDiagrama: function(id){
	
		var img = this.diagrama.child("\img", true);
		img.src = "images/diagrama/" + id + ".png";
		
	},
	
	actualizarEsquema: function(id){
	
		var img = this.esquema.child("\img", true);
		img.src = "images/esquema/" + id + ".png";
		
	}*/
		   
});