var popupWin = '';function preview(imgStr, w, h){ var scroll='no';  var resize='no';  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></title></head><body leftmargin=0 topmargin=0 marginwidth=0 marginheight=0 bgcolor="#ffffff"><img src="'+imgStr+'"></body></html>');  //popupWin.document.close();  popupWin.moveTo(86,146);  popupWin.focus();}