function setTab(sender, id) {
	var e = document.getElementById('tabs');
	if (e) {
		var tab = e.getElementsByTagName('div');
		for (var i = 0, j = tab.length; i < j; i++) {
			if (tab[i].className == 'tabs') {
				var lnk = tab[i].getElementsByTagName('a');
				for (var x = 0, y = lnk.length; x < y; x++) {
					lnk[x].className = '';
				}
			} else if (tab[i].className == 'content') {
				var con = tab[i].getElementsByTagName('div');
				for (var x = 0, y = con.length; x < y; x++) {
					if (con[x].id.substr(0, 3) == 'tab') {
						if (con[x].id == 'tab_' + id) {
							con[x].style.display = 'block';
						} else {
							con[x].style.display = 'none';
						}
					}					
				}
			}
		}		
		sender.className = 'active';
	}
}

function setFoto(box, foto) {
	var e = document.getElementById('itemImage_' + box);
	if (e) {
		e.style.backgroundImage = 'url(' + dirPath + 'foto/mini/' + foto + '.jpg)';
	}
}

function showFoto(id) {
	window.open(dirPath+'_foto_window.php?id='+id+'&sze='+screen.width+'&wys='+screen.height, 'Foto', 'menubar=no, toolbar=no, location=no, scrollbars=no, resizable=yes, status=no, width=800, height=60, left=100, top=50');
	return void(0);
}




function przewin()
{

  var pozycja = document.getElementById("tekst").style.marginLeft;
  var szerokosc=document.getElementById("tekst").offsetWidth;
  pozycja = pozycja.substr(0, pozycja.length-2);
  szerokosc=parseInt(szerokosc);
  pozycja=parseInt(pozycja);
  if(pozycja <= (0-szerokosc))
  {
    pozycja = 900;
  }
  else
  {
  pozycja = pozycja - 2;
  }
document.getElementById("tekst").style.marginLeft = pozycja+"px";
setTimeout("przewin()", 20);
}

var obiekt_zapytania=0;
function wyswietl_zapytaj(id)
{
  obiekt_zapytania=id;
  document.getElementById("przyciemniony").style.display="block";
}
function ukryj_zapytaj()
{
  document.getElementById("przyciemniony").style.display="none";
}
function wyswietl_zapytaj2(id)
{
  obiekt_zapytania=id;
  document.getElementById("przyciemniony2").style.display="block";
}
function ukryj_zapytaj2()
{
  document.getElementById("przyciemniony2").style.display="none";
}
function wyswietl_zapytaj3(id)
{
  obiekt_zapytania=id;
  document.getElementById("przyciemniony3").style.display="block";
}
function ukryj_zapytaj3()
{
  document.getElementById("przyciemniony3").style.display="none";
}


