//<!-- Begin
var ImgNum = 0;
var NewImg=Imgs[0];
var ImgLength = NewImg.length - 3;

//Time delay between Slides in milliseconds
var delay = 3000;

var lock = false;
var run;


function setBackgroundImage (id, imageURL) {
 
  if (document.layers)
    document[id].background.src = imageURL == 'none' ? null : imageURL;
  else if (document.all)
    document.all[id].style.backgroundImage = imageURL == 'none' ? 'none' 
: 'url(' + imageURL + ')';
  else if (document.getElementById)
    document.getElementById(id).style.backgroundImage = imageURL == 
'none' ? 'none' : 'url(' + imageURL + ')';
}


function chgImg(direction) 
{

 if (document.images) 
 {
  ImgNum = ImgNum + direction;
  if (ImgNum > ImgLength) 
  {
   ImgNum = 0;
  }
  if (ImgNum < 0) 
  {
   ImgNum = ImgLength;
  }

  setBackgroundImage('Image',NewImg[ImgNum]);
  //document.slideshow.src = NewImg[ImgNum];
 }
}

function DisplayImage(picURL,picTitle,picWidth,picHeight){

pic=new Image()
pic.src=picURL
newWindow=window.open("",'newWin','toolbar=no,width='+picWidth+',height='+picHeight);
newWindow.document.write('<html><head><title>'+picTitle+'</title></head><body onclick="javascript:window.close()" background="'+picURL+'">&nbsp;</body></html>');
newWindow.document.close();
newWindow.resizeBy(picWidth-newWindow.document.body.clientWidth,picHeight-newWindow.document.body.clientHeight);
newWindow.moveTo(20,0);
newWindow.focus();
}


function zoom()
{
  if(screen.width>1024) {w=1050;}
  else {w=1010;}
  if(screen.height>768) {h=800;}
  else {h=705;}
  
  if (document.images) 
  {
    img=NewImg[ImgNum];
    path=img.substring(0,img.indexOf('/small/'));
    img=img.substring(img.indexOf('/small/')+6,img.length);
  DisplayImage(path+img,"Info-Met Metaloplastyka, Kowalstwo Artystyczne",NewImg[ImgNum+1],NewImg[ImgNum+2]);

  }
 
}
function auto() {
if (lock == true) {
lock = false;
window.clearInterval(run);
}
else if (lock == false) {
lock = true;
run = setInterval("chgImg(1)", delay);
   }
}

function ChgGroup(num)
{
 NewImg=Imgs[num];
 ImgNum=0;
 chgImg(0);
 ImgLength = NewImg.length-3;
}

chgImg(0);
//  End -->


