
/**
 * Searcher
 *
 * @category	
 * @package		
 * @version		1.0.1
 * @author		Javier Seixas
 * @copyright	
 * @license		
 */
 
var RoomsSelector = new Class({
	
	getOptions: function() {
		return {
			deleting_controller: '/uploader/index/delete_process/'
		};
	},
	
	initialize: function(options) {
		
		this.setOptions(this.getOptions(), options);
		
		$('rooms').addEvent('change', function () {
			this.roomsToShow = $('rooms').value;
			this.showSelectors();
		}.bind(this));
				
	},
	
	
	showSelectors: function() {
		
		var rows;
		
		for (i=1;i<=3;i++) {
			
			rows = $A($$('.options_room_'+i));
			
			rows.each(function(item,index) {
				if (this.roomsToShow < i)
					item.style.display = 'none';
				else
					item.style.display = '';
							   
			}.bind(this));
			
		}
		
		return false;
		
	}
	
		
});


// Without this the object does not execute
RoomsSelector.implement(new Options);
RoomsSelector.implement(new Events);
