Hsa.introduce_subscription = {
	_isShowing : null,
	_maxHeight : 0,
	_lookupTable : function (id) {
			var theTable = ['',
			'vaihtoehto_hs24',
			'vaihtoehto_7pv',
			'vaihtoehto_pelasu',
			'vaihtoehto_lasu',
			'vaihtoehto_su'
			];
			return theTable[id];
	},
	init: function (maxId) {
		for (var a=1; a<=maxId; a++) {
			var elem = document.getElementById('HsaIntroduce_' + a);
			if (elem.offsetHeight > this._maxHeight)
				this._maxHeight = elem.offsetHeight;
				elem.style.display = 'none';
			document.getElementById('HsaIntroduceButton_' + a).HsaIntroduceId = a;
		}
		this.show(1);
	},
		
	show: function (id) {
		if (id == this._isShowing)
			return;
		if (this._isShowing) {
			var hideMe = document.getElementById('HsaIntroduce_' + this._isShowing);
			hideMe.style.display = 'none';
		}

		var showMe = document.getElementById('HsaIntroduce_' + id);
		showMe.style.height = this._maxHeight + 'px';
		showMe.style.display = 'block';


		if (this._isShowing) {
			var uncheckMe = document.getElementById('HsaIntroduceButton_' + this._isShowing);
			uncheckMe.src = '/img/tilaus_' + this._lookupTable(uncheckMe.HsaIntroduceId) + '_unchecked.jpg';
		}

		var buttone = document.getElementById('HsaIntroduceButton_' + id);
		buttone.src = '/img/tilaus_' + this._lookupTable(buttone.HsaIntroduceId)  + '_checked.jpg';

		this._isShowing = id;
	},

	hover: function (id) {
		if (id == this._isShowing)
			return;
		var elem = document.getElementById('HsaIntroduceButton_' + id);
		elem.src = '/img/tilaus_' + this._lookupTable(elem.HsaIntroduceId) + '_hover.jpg';
	},

	mouseOut: function (id) {
		if (id == this._isShowing)
			return;
		var elem = document.getElementById('HsaIntroduceButton_' + id);
		elem.src = '/img/tilaus_' + this._lookupTable(elem.HsaIntroduceId) + '_unchecked.jpg';
	}

};


