
function zmien(id, newClass) {
	identity=document.getElementById(id);
	identity.className=newClass; 
}

function showpodmenu(p) {
	document.getElementById("pm" + p).style.display = "";
}

function hidepodmenu(p) {
	document.getElementById("pm" + p).style.display = "none";
}

function dzial(p) {

	for (i=1; i<=ile; i++) {

		if(i==p) {
			showpodmenu(i);
				zmien("dz" + i, "onH");
				document.getElementById("dz" + p).style.backgroundPosition = "0 -39px";
		} else {
			hidepodmenu(i);
				zmien("dz" + i, "onL");
				document.getElementById("dz" + i).style.backgroundPosition = "0 0px";
		}
	}
}

function domyslnie(p) {
	if(p !== akt) {
		start();
		hidepodmenu(p);
		zmien("dz" + p, "onL");
	}
}

function start() {
	showpodmenu(akt);
	zmien("dz" + akt, "on");
	document.getElementById("dz" + akt).style.backgroundPosition = "0 -39px";
}


