var ServiceTypeUpdater = new Class({

	initialize: function() {
		$each($$('input.service-type'), function(el) {
			el.onclick = this.updateServiceType.pass(el, this);
		}, this);
	},
	
	updateServiceType: function(el) {
		this.serviceType = el.className.replace(/service-type /,'');
		$each($$('label.service-type-label'), function(el) {
			if (el.className.match(this.serviceType)) {
				if (!(el.className.match('service-type-hilight'))) {
					el.className += " service-type-hilight";
				}
			} else {
				el.className = el.className.replace(/service-type-hilight/,'');
			}
			switch (this.serviceType) {
				case "on":
					newColor = "login-fields-on";
					break;
				case "transfer":
					newColor = "login-fields-transfer";
					break;
			}

			addrColor = $('login-fields');
			addrColor.className = newColor;			
			}, this);
	}

});