/**
 * _w - wrap
 * _t - title
 * _c - content 
 */ 
function Vyjizdec (_w, _t, _c, _t2) {
	/*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)
		this.t2 = SJEL.$(_t2);
	if (!this.w || !this.t || !this.c)
		return;
	
	var cc = this.c;
    this.mo = new SJEL.Morph();
    this.ch = 0;
    this.o = false;  // otevreny
    
	SJEL.RemoveClass(this.w, "nojs");
	
	this.Close = function () {
		this.mo.Init(this.c, {opacity: 0.0}, 180);
		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, "shiton");
			SJEL.RemoveClass(this, "shiton2");
			SJEL.SStyle(this.ref.c, {display: "block", opacity: 0.0, overflow: "hidden"});
			this.ref.mo.Init(this.ref.c, {opacity: 1.0}, 180);
			this.ref.mo.OnMorphFinished(function(){});
			this.ref.mo.Morph();
			this.ref.o = true;
		} else {
			SJEL.RemoveClass(this, "shiton");
			SJEL.AddClass(this, "shiton2");
			this.ref.Close();
		}
	}
	
	if (this.t2 != null) {
		this.t2.ref = this;
		this.t2.onclick = function () {
			if (this.ref.o)
				this.ref.Close();
		}
	}
}