var Account = Class.create({
	initialize: function() {
		// observe events
		Event.observe($('account_invoice'), 'change', this.showVatFields);
		Event.observe($('account_vat_type'), 'change', this.showVatFields);
	},
	showVatFields: function() {
		if ($('account_invoice').value == 'particulier') {
			new Effect.BlindUp('invoice_fields',{duration:0.2});
		} else {
			if ($('invoice_fields').style.display == 'none') new Effect.BlindDown('invoice_fields',{duration:0.3});
		}
		if ($('account_vat_type').value == 'vat') {
			Element.show('vat_number');
		} else {
			Element.hide('vat_number');
		}
	}
});