var popupWin = '';

function popup(imgStr, w, h)
{ var scroll='no';
  var resize='yes';
  var screenW = (screen.availWidth-25);
  var screenH = (screen.availHeight-50);

  if((w > screenW)&&(h > screenH))
  { scroll='yes';
    resize='yes';
    w = screenW;
    h = screenH;
  } else
  { if(w > screenW)
    { scroll='yes';
      resize='yes';
      w = screenW;
      h = h+20;
    }
    if(h > screenH)
    { scroll='yes';
      resize='yes';
      w = w+20;
      h = screenH;
    }
  }

  if((! popupWin.closed)&&(popupWin != '')) popupWin.close();
  popupWin = window.open('', 'thumbWin', 'toolbar=no,scrollbars='+scroll+',resizable='+resize+',width='+w+',height='+h);
  popupWin.document.write('<html><head><title>JC Engineering - The Mezzanine Specialists</title></head><body leftmargin=0 topmargin=0 marginwidth=0 marginheight=0 bgcolor="#ffffff"><img src="'+imgStr+'"></body></html>');
  popupWin.document.close();
  popupWin.moveTo(5,5);
  popupWin.focus();
}

