// JavaScript Document

var dymek, IE=document.all?true:false;
if(!IE) { document.captureEvents(Event.MOUSEMOVE);	document.onmousemove=mousePos;	var netX, netY; }

function init() {	if(IE) dymek=document.all.dymek; else dymek=document.getElementById("dymek");	b=document.body;}
function mousePos(e) { netX=e.pageX;	netY=e.pageY; }
function dymekmove(ix, iy)
{
 init();
 if(dymek.style.visibility!='visible') return;
 if(IE) {msx=event.clientX; msy=event.clientY;}
 else {msx=netX-b.scrollLeft; msy=netY-b.scrollTop;}

 temix=msx+ix;
 if(temix<0) temix=0;
 tmp=b.clientWidth-msx-ix-dymek.offsetWidth-20;
 if(tmp<0) {temix+=tmp; if(temix<0) temix=0;}
 dymek.style.left=b.scrollLeft+temix+"px";

 temiy=msy+iy;
 if(temiy<0) temiy=0;
 tmp=b.clientHeight-msy-iy-dymek.offsetHeight-15;
 if(tmp<0)
 {
	tmp=msy-15-dymek.offsetHeight;
	if(tmp>=0) temiy=tmp;
 }
 dymek.style.top=b.scrollTop+temiy+"px";
}

function dymekshow(ix, iy, src) { init(); dymek.style.visibility='visible'; dymek.innerHTML=src; dymekmove(ix,iy); }
function dymekclose() {init();	dymek.style.visibility='hidden';	dymek.innerHTML=''; dymek.style.left=0;	dymek.style.top=0;}
function dymekmsg(tmsg) { text=tmsg; dymekshow(5,20,text); }
function dymekimg(tmsg) { text='<img src=/gfx/'+tmsg+' />'; dymekshow(5,20,text); }
function dymeklmove() { dymekmove(5,20); }




function Ob(id)
{
 return document.getElementById(id);
}

function Pokaz(lejer)
{
 info = Ob(lejer);
 info.style.display = (info.style.display == 'none') ? info.style.display = 'block' : info.style.display = 'none';
}



function Podmiana(plik, id)
{
 document[id].src='/gfx/produkty/'+plik+'.jpg';
}






function show(strng,x,y)
{
 var param;
 var htm;

 param='toolbar=no,scrollbars=no,width=' + x + ',height=' + y;
 nw=window.open(strng,'nw',param);
}



function show2(strng,x,y)
{
 var param;
 var htm;
 var bar;
 bar = 'no';
 if (x > screen.availwidth - 40 )
  {(x = screen.availwidth - 35), (bar = 'yes');}
 else
  {(x = x + 40);}
 if (y > screen.availheight - 40)
  {(y = screen.availheight - 35), (bar = 'yes');}
 else
  {(y = y + 40);}
 param='toolbar=no,scrollbars=' + bar + ',width=' + x + ',height=' + y;
 nw=window.open(strng,'nw',param);
};

