
var kursor=false;
var stop=0;
var licznik =0;
var okladki = Array();

function pokaz(idtro,tro,url, wysw,idart) {
clearTimeout(stop);
//licznik++;	
var przegl = navigator.userAgent;

if(!kursor)
{
	pozycje = new Array(2);
	pozycje = findPos(getId(idtro));	
	szer = getId(idtro).width;	
	wys = getId(idtro).height;	
	x = pozycje[0] +(szer/2) -16;
	y = pozycje[1] +(wys/2)+10;
	//alert(x+'  '+y);
	if(url == 0 )
	{
	    if(przegl.indexOf("MSIE 6.0")>-1)
	    {
	    getId("maximage").innerHTML ='<div id="load" style=" z-index: 2; width: 32px; height: 32px;  position: absolute; left:'+x+'px; top:'+y+'px; background-image: url(imgap/ajaxload.gif);"><div id="tlo" style=" z-index: 3; width: 369px; height: 510px; position: absolute; left: -168px; top:-239px;" onmouseout="schowaj(1);"><div id="obraz" style="z-index: 4; left: 21px; top: 21px; position: absolute; width: 326px; height: 466px; border-style: solid; border-width: 1px;  background-image: url(art/fotoart/f'+ tro +'.jpg);" onmouseout="schowaj(1);"/>d1</div></div></div>';
	    }
	    else
	    {
	    getId("maximage").innerHTML ='<div id="load" style=" z-index: 2; width: 32px; height: 32px;  position: absolute; left:'+x+'px; top:'+y+'px; background-image: url(imgap/ajaxload.gif);"><div id="tlo" style=" z-index: 3; width: 369px; height: 510px; position: absolute; left: -168px; top:-239px; background-image: url(imgap/cien.png);" onmouseout="schowaj(1);"><div id="obraz" style="z-index: 4; left: 21px; top: 21px; position: absolute; width: 250px; height: 200px; border-style: solid; border-width: 1px;  background-image: url(art/mini/f'+ tro +'_t.jpg);" onmouseout="schowaj(1);"/>d2</div></div></div>';
	    }
	}
	else
	{
	    if(przegl.indexOf("MSIE 6.0")>-1)
	    {
	    getId("maximage").innerHTML = '<div id="load" style=" z-index: 2; width: 32px; height: 32px;  position: absolute; left:'+x+'px; top:'+y+'px; background-image: url(imgap/ajaxload.gif);"><div id="tlo" style="z-index: 3; width: 198px; height: 253px; position: absolute; cursor: pointer; left: -74px; top:-102px;"><div id="obraz" style="left: 8px; top: 8px; position: absolute; width: 181px; height: 236px;" onmouseout="schowaj(1);"/><a href="index.php?dzial=detal&action=show&dinart='+ idart +'"><img " src="art/fotoart/f'+ tro +'.jpg" width="150" height="150" border="0"></div></div></div>';
	    }
	    else
	    {
	    getId("maximage").innerHTML = '<div id="load" style=" z-index: 2; width: 32px; height: 32px;  position: absolute; left:'+x+'px; top:'+y+'px; background-image: url(imgap/ajaxload.gif);"><div id="tlo" style="z-index: 3; width: 166px; height: 166px; position: absolute; cursor: pointer; left: -74px; top:-102px; background-image: url(imgap/cien.png);"><div id="obraz" style="left: 8px; top: 8px; position: absolute; width: 150px; height: 150px;" onmouseout="schowaj(1);"/><a href="index.php?dzial=detal&action=show&dinart='+ idart +'"><img " src="art/mini/f'+ tro +'_t.jpg" width="150" height="150" border="0"></div></div></div>';
	    }
	}
	
}

	if(!wysw)
	{
	stop=setTimeout("pokaz('"+idtro+"','"+tro+"','"+url+"',1,'"+idart+"')",500);
	kursor=true;
	}
	else if(kursor = true)
		{
		kursor = false;
		getId("maximage").style.display="block";
	}



	
}

function schowaj(tak){
	if(kursor==true || tak == 1) {
		clearTimeout(stop);
		getId("maximage").style.display="none";
		}
	kursor = false;
}

function getId(id)
{
	return document.all ? document.all[id] : document.getElementById(id) ;
	
}

function findPos(obj) {
	var curleft = curtop = 0;
	if (obj.offsetParent) {
		do {
			curleft += obj.offsetLeft;
			curtop += obj.offsetTop;
		} while (obj = obj.offsetParent);
	}
	return [curleft,curtop];
}
