function zwinRozwin(idCat) {
	var trs = document.getElementsByTagName("TR");
	for(var i = 0; i < trs.length; i++) {
		var trId = trs[i].id.substr(5);
		if(parseInt(trId))
			if(trId == idCat)
				if(trs[i].style.display == "") trs[i].style.display = "none";
				else trs[i].style.display = "";
				
	}
	/*if(idCat != currentCat) {
		var trs = document.getElementsByTagName("TR");
		for(var i = 0; i < trs.length; i++) {
			var trId = trs[i].id.substr(5);
			if(trId == idCat) trs[i].style.display = "";
			if(currentCat)
				if(trId == currentCat) trs[i].style.display = "none";	
		}
		currentCat = idCat;
	}*/
}

function polec_strone(){
  window.location = "mailto:"+"?subject=Czesc, obejrzyj sobie strone BOK`u, moze Cie zainteresowac." + "&body="+window.location.href;
  }

var new_window = null
function openNdWindow(photo,end,page_title,wh,w,h) {
	if (end == 1) {
		end = "jpg";
	} else
	if (end == 2) {
		end = "gif";
	} else
	if (end == 3) {
		end = "png"
	}
	new_window = window.open('show_item_nd.php?photo='+photo+'.'+end+'&page_title='+page_title+'&which='+wh,'newWindow'+wh,'width='+w+',height='+h+',left='+((screen.width)/2 - (+w/2))+',top='+((screen.height)/2 - (+h/2))+',toolbar=no','directories=no','menubar=no','status=no','scrollbars=auto','resizable=no');
}

var new_window = null
function openWindow(photo,end,page_title,w,h) {
	if (end == 1) {
		end = "jpg";
	} else
	if (end == 2) {
		end = "gif";
	} else
	if (end == 3) {
		end = "png"
	}
	new_window = window.open('show_item.php?photo='+photo+'.'+end+'&page_title='+page_title,'newWindow'+page_title,'width='+w+',height='+h+',left='+((screen.width)/2 - (+w/2))+',top='+((screen.height)/2 - (+h/2))+',toolbar=no','directories=no','menubar=no','status=no','scrollbars=auto','resizable=no');
}

var new_window = null
function openPage(page,end,w,h,scrollbar) {
	w = w + 37;
	if (end == 1) {
		end = "html";
	} else 
	if (end == 2) {
		end = "php";
	}
	if (scrollbar == 1) {
		scrollbar = "yes";
	} else 
	if (scrollbar != 1) {
		scrollbar = "no";
	}
	new_window = window.open(page+'.'+end,'window_name'+page,'width='+w+',height='+h+',left='+((screen.width)/2 - (+w/2))+',top='+((screen.height)/2 - (+h/2))+',toolbars=no,resizeble="no",scrollbars='+scrollbar);
}

