
var Reseptiarkisto = {
	currentlyOpenId : null,
	oha: null,
	ohb: [],
	f: [],
	d: [],

	initiallyOpen : function(whatId) {
		this.currentlyOpenId = whatId;
	},

	pushF: function (item) {
		this.f.push(item);
	},

	pushD: function (item) {
		this.d.push(item);
	},

	pushOhb: function (item) {
		this.ohb.push(item);
	},

	switchOn : function({id: whatId, oha: oha}) {
		// Close the category currently open
		if (this.currentlyOpenId != null) {
			document.getElementById('human_bs_for_' + this.currentlyOpenId).style.display = 'none';
			document.getElementById('rcpMainCategorySelector_' + this.currentlyOpenId).className = '';
		}
		// Open specified category
		document.getElementById('human_bs_for_' + whatId).style.display = 'block';
		document.getElementById('rcpMainCategorySelector_' + whatId).className = 'rcpMainCategoryActive';
		this.currentlyOpenId = whatId;

		jQuery('#human_bs_for_' + this.currentlyOpenId).empty().text('Ladataan, odota hetki..').load('/reseptit/ajax-human_b_and_c.mpl', {oha: oha, ohb: this.ohb, f: this.f, d: this.d, isAjax: 1});
	}

}
