/* $Id: subscription.js 29 2008-02-25 09:56:45Z klemen.nagode $ */
var Subscription = {

	run: function()
	{
		Subscription.other_address();
	},

	other_address: function()
	{
		var other_address_checkbox = $('order_form_other_address_0');
		var other_address_fieldset = $('order_form_fieldset_other_fieldset');

		if (other_address_checkbox && other_address_fieldset) {
			other_address_checkbox._fieldset = other_address_fieldset;
			Subscription.other_address_checkbox_click(other_address_checkbox);
			other_address_checkbox.observe('click', Subscription.other_address_checkbox_click_event.bindAsEventListener(other_address_checkbox));
		}
	},
	other_address_checkbox_click_event: function(event)
	{
		Subscription.other_address_checkbox_click(this);
	},
	other_address_checkbox_click: function(checkbox)
	{
		if (checkbox.checked) {
			checkbox._fieldset.show();
		} else {
			checkbox._fieldset.hide();
		}
	}

}

new StartUp(Subscription);
