// MVVM, 60.39.4-66.47.5, JS/AdjWidth.js------------------------------------>
// By means of this script pages with images (photos, paintings)
// can be given sufficient width to show the full-size image
// From 66.47.3 IE (8 and up) uses Netscape/Mozilla Firefox script

function adjWidthO(S1,N1,N2)
 {  // S1 suggested width, N1 max width, N2 (max height) not (yet) used
  var docS="document.getElementById('"; var stlS="').style.width=";
  var widS=S1; var widN=parseInt(S1);
  var alertS='Please, choose a width between 1 and '+N1;

  if ((widS=='') || (widS.charCodeAt(0)<48) || (widS.charCodeAt(0)>57))
   widN=0;
  if ((widN<1) || (widN>N1)) alert(alertS);
   else
    {
     widN=widN+60;
     if (widN<600) widS='"600px"';
      else widS='widN+"px"';
     if (VersDateS>"65345")  // for formats with MidPart and hearT value
       { if (hearT) eval(docS+'MidPart'+stlS+'"100%"');
          else eval(docS+'MidPart'+stlS+widS) }  // first MidPart table
      else eval(docS+'CenPart'+stlS+widS);  // for format F6 or before
     widN=widN-60;
     widS='widN+"px"';
     eval(docS+'PicTbl'+stlS+widS);  // then picture (table)
     eval(docS+'Pic'+stlS+widS);
   }
 }

function writeWidthTblO(N1,N2,N3)  // recommended & unreduced width & height
 {
  var widS="600";  // for format F6 and earlier
    if (VersDateS>"65345") widS="100%";  // for format F7 and later
  var adjWidthS='adjWidthO(document.WidthForm.Pic_width.value,'+N2+','+N3+')';
  var bkgroundS=MVVMPathS+"Graf/Bkgr/HalfTrsp.gif";

document.write('<br />');
document.write('<form name="WidthForm">');
document.write(' <table width="',widS,'" background="',bkgroundS,'" border="0" id="WidthTbl"><tr><td>');
document.write(' <table width="100%" cellpadding="0" cellspacing="0" border="1"><tr><td>');
document.write(' <table width="100%" cellpadding="0" cellspacing="0" border="0"><tr>');
document.write('  <td align="right" valign="middle"><font color="#202020">');
document.write('   Width image&nbsp;/ <i>breedte afbeelding</i>&nbsp;</font></td>');
document.write('    <td><input type="text" name="Pic_width" value="',N1,'"');
document.write('   size="3"></td>');
document.write('  <td align="center" valign="middle">');
document.write('   <table cellpadding="0" cellspacing="0" background="" border="2"><tr>');
document.write('    <td><input type="button" value="OK" ');
document.write('    onClick="',adjWidthS,'">');
document.write('   </td></tr></table>');
document.write('  <td align="left" valign="middle"><font color="#202020">');
document.write('   &nbsp;(1-',N2,'&nbsp;pixels/<i>piksels</i>)</font></td>');
document.write('  </tr></table>');
document.write('  </td></tr></table>');
document.write('  </td></tr></table>');
document.write('</form>');
 }

adjWidthT=true  // checks whether contents have been transferred
                // (on-line) and script (can be) executed

// Copyright 60-66 aSWW, M.Vincent van Mechelen, Amsterdam, NL
