<!--
var OptInput= Class.create({
	initialize:function(_select){
		var a=$A(this.initialize.arguments);
		this.imagesSel=new Array();
		this.values=new Array();
		if(a.length>1){
			for(var i=1; i<a.length;i=i+2){
				this.imagesSel.push(a[i]);
				this.values.push(a[i+1]);
			}
		}
		this.select = $(_select);
		this.selectcont = $('optgraph'+_select);
		
		for(var i=0; i<this.imagesSel.length;i++){
				this.build(i,this.values[i],this.imagesSel[i]);
		}
		this.clear();
		
		this.set(this.select.selectedIndex);
	},
	build:function(num,value,image){
		var img = new Element('img',{id:'optimg'+num,src:image});
		img.setStyle({margin:'5px'});
		img.writeAttribute('valor',value);
		
		img.pater=this;
		img.numb =num; 
		Element.observe(img,'click',function(){
			this.pater.set(this.numb)});
		
		this.selectcont.insert(img);	
			
	},
	set:function(nel){
		this.clear();
		var ch = $A(this.selectcont.childNodes);
		$(ch[nel]).setStyle({border:"2px #c00 solid"});
		this.select.value=$(ch[nel]).readAttribute('valor');
		
	},
	clear:function(){
		var ch = $A(this.selectcont.childNodes);
		ch.each(function(el){el.setStyle({border:"0px",cursor:'pointer'})});
	}

});

-->
