var vyjizdece = new Array();

function Vyjizdec (_w, _t, _c, _t2, _ro) {
	/*if (SJEL.ie) {
		this.w = SJEL.$(_w);
		SJEL.RemoveClass(this.w, "nojs");
		var ms = new MenuSwitcher(_w, '', true);
		ms.AddPair(_t, _c);
		return;
	}*/
	this.w = SJEL.$(_w);
	this.t = SJEL.$(_t);
	this.c = SJEL.$(_c);
	this.t2 = null;
	if ((_t2 != undefined) && (_t2 != null))
		this.t2 = SJEL.$(_t2);

	if (!this.t || !this.c)
		return;

	this.rol = _ro||false;
	if (this.rol) {
		SJEL.SStyle(this.c, {display: "block"});
		this.cHe = parseInt(SJEL.GStyle(this.c, "height"));
		SJEL.SStyle(this.c, {display: "none"});
	}

	var cc = this.c;
    this.mo = new SJEL.Morph();
    this.ch = 0;
    this.o = false;  // otevreny

	if (this.w)
		SJEL.RemoveClass(this.w, "nojs");

	this.Close = function () {
		if (this.rol)
			this.mo.Init(this.c, {opacity: 0.0, height: "0px"}, 280);
		else
			this.mo.Init(this.c, {opacity: 0.0}, 280);

		this.mo.OnMorphFinished(function(){SJEL.SStyle(cc, {display: "none"});});
		this.mo.Morph();
		this.o = false;
	}

	this.t.ref = this;
	this.t.onclick = function () {
		if (!this.ref.o) {
			SJEL.AddClass(this, "arr");
			SJEL.RemoveClass(this, "arr2");
			SJEL.SStyle(this.ref.c, {display: "block", opacity: 0.0, overflow: "hidden"});
			if (this.ref.rol) {
				SJEL.SStyle(this.ref.c, {height: "0px"});
				this.ref.mo.Init(this.ref.c, {opacity: 1.0, height: this.ref.cHe + "px"}, 280);
			} else
				this.ref.mo.Init(this.ref.c, {opacity: 1.0}, 280);
			this.ref.mo.OnMorphFinished(function(){});
			this.ref.mo.Morph();
			this.ref.o = true;
		} else {
			SJEL.RemoveClass(this, "arr");
			SJEL.AddClass(this, "arr2");
			this.ref.Close();
		}
	}

	if (this.t2 != null) {
		this.t2.ref = this;
		this.t2.onclick = function () {
			if (this.ref.o)
				this.ref.Close();
		}
	}
}

/*function Posunovac(_wrap1, _wrap2, _classRemove) {
	this.w1 = SJEL.$(_wrap1);
	SJEL.SStyle(this.w1, {overflow: "hidden"});
	SJEL.RemoveClass(this.w1, _classRemove);
}*/
