function switchBlock()
{
    this.blockId = "";
    
    /* css class */
    this.offClass = "offImg";
    this.onClass = "onImg";
	this.stav = 1
	this.panelClass = ""
}

switchBlock.prototype =
{
    zmenStav : function(obj)
    {
	    //var obj = e.target

	    if(this.stav)
	    {
			this.off(obj)
	    }
	    else
			this.on(obj)

		createCookie(this.blockId, this.stav)
    },

	off : function(obj)
	{
		obj.className = this.offClass;
		document.getElementById(this.blockId).className = this.panelClass + " off"
		this.stav = 0
	},

	on : function(obj)
	{
		obj.className = this.onClass;
		document.getElementById(this.blockId).className = this.panelClass + " on"
		this.stav = 1
	},

	init : function()
	{
		if(readCookie(this.blockId) == 0)
			this.off(getE(this.blockId).previousSibling)
		else
			this.on(getE(this.blockId).previousSibling)
	}
}

function createCookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function eraseCookie(name) {
	createCookie(name,"",-1);
}