function newImage(arg) {
  if (document.images) {
    rslt = new Image();
    rslt.src = arg;
    return rslt;
  }
}
function changeImages() {
  if (document.images && (preloadFlag == true)) {
    for (var i=0; i<changeImages.arguments.length; i+=2) {
      document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
    }
  }
}
imgWnd = null;
tid = 0;

function imgWindow(src)
{
  img = newImage(src+'.jpg');
  if(imgWnd != null) {imgWnd.close()}
  if (img.width>0 && img.height>0)
  {
  imgWnd = window.open('showpic.php?src='+src, 'image', 'toolbars=no, scrollbars=no, resizable=no, width='+(img.width)+', height='+(img.height)+', top=220, left='+(screen.width/2-250), winname='kk')
  }
  else
  {
  imgWnd = window.open('showpic.php?src='+src, 'image', 'toolbars=no, scrollbars=no, resizable=no, width=650, height=500, top=220, left='+(screen.width/2-250), winname='kk')
  } 
}

function imgWindow2(src)
{
  img = newImage(src+'.jpg');
  if(imgWnd != null) {imgWnd.close()}
  if (img.width>0 && img.height>0)
  {
  imgWnd = window.open('showpic.php?src='+src, 'image', 'toolbars=no, scrollbars=no, resizable=no, width='+(img.width)+', height='+(img.height)+', top=220, left='+(screen.width/2-250), winname='kk')
  }
  else
  {
  imgWnd = window.open('showpic.php?src='+src, 'image', 'toolbars=no, scrollbars=no, resizable=no, width=500, height=650, top=220, left='+(screen.width/2-250), winname='kk')
  } 
}

