// funkcja rozqijq drzewo kategorii
function menu_click(el) 
{
	var styl;
	try {
		styl = document.getElementById("menu_"+el).style.display;
		
		if (styl=="none") {
		
			document.getElementById("menu_images_"+el).src = "images/menu/minus.gif";
			document.getElementById("menu_"+el).style.display = "block";
				
		} else {
		
			document.getElementById("menu_images_"+el).src = "images/menu/plus.gif";
			document.getElementById("menu_"+el).style.display = "none";		
		
		};
		
	} catch (e) { var eee =0;}
	
}


function showImage(src, width, height) {
       
      
       //w = width + 40;
       //h = height + 50;
		
		w = width + 40;
		h = height + 70;
		
		
        var Win = window.open('image.php?src='+src+"&width="+width+"&height="+height, "displayWindow",'width=' + w + ',height=' + h + ',resizable=0,scrollbars=yes,menubar=no' );
}


function oferta(numer_oferty, width, height) {
       
       w=0;
       h=0;
       w = width;
       h = height;
		
        var Win = window.open('kontakt.php?numer_oferty='+numer_oferty, "displayWindow",'width=' + w + ',height=' + h + ',resizable=0,scrollbars=yes,menubar=no' );
}

function drukuj(kid, id) {
       
     	w = 650;
		h = 400;
        
        var Win = window.open('index.php?kid='+kid+"_"+id+"&drukuj=1", "displayWindow",'width=' + w + ',height=' + h + ',resizable=0,scrollbars=yes,menubar=no' );
}

function drukujOferty(kid) {
       
     	w = 650;
		h = 400;
        
        var Win = window.open('index.php?kid='+kid+"&drukuj=2", "displayWindow",'width=' + w + ',height=' + h + ',resizable=0,scrollbars=yes,menubar=no' );
}
/* slideshow */
var next=0;
var last=1;
var delay=10000;
var play=1;
var pid=0;


function sNext() {
	showNext();
}

function showNext()
{
	s = document.getElementById("slideshow");
	
//	a = document.getElementById("active");
	//a.innerHTML = next+1;
	
	for(j=0; j<=last; j++)
	{
		document.getElementById('slide_' + j ).style.display = 'none';
	}

	document.getElementById('slide_' + next ).style.display = '';
	
	next++;
	if (next>last) next=0;
	if (play==1) pid=setTimeout('showNext()',delay);
}

function sPrev()
{
	next--;
	if (next==-1) next=last;
	next--;
	if (next==-1) next=last;
	showNext();
} 
