var RADIOGROUP = new Class({
	initialize: function(name, options) {
		var _self = this;
		
		this.options = {
			activeSrc: './images/content/radio-on.png',
			inactiveSrc: './images/content/radio-off.png',
			name: name
		};
		for(attribute in options) this.options[attribute] = options[attribute];
		
		this.elements = {
			radios: new Array()
		};
		
		this.fx = {
			
		};
		
		this.labels = {
			
		};
		
		this.value = false;

		this.elements.radios = $$(document.getElementsByName(name));
		for(var i = 0; i < this.elements.radios.length; i++) {
			this.elements.radios[i].checked = (this.elements.radios[i].src.match(/radio-on/g) ? true : false);
			if(this.elements.radios[i].checked) this.value = this.elements.radios[i].title;
			this.elements.radios[i].addEvent('click', function() {
				_self.setRadiosInactive();
				_self.value = this.title;
				this.checked = true;
				this.set({'src':_self.options.activeSrc});
			});
		}
	},
	
	setRadiosInactive: function() {
		for(var i = 0; i < this.elements.radios.length; i++) {
			this.elements.radios.set({'src':this.options.inactiveSrc});
			this.elements.radios.checked = false;
		}
	},
	
	getName: function() {
		return this.options.name;
	},
	
	getValue: function() {
		return this.value;
	}
});