function generateImageTable(productType, cols, buyFlag)
{
   var cleanProductType = productType.replace(/[ &,+'"]/g, "");
   var images = eval(cleanProductType + "Images");
   var desc = eval(cleanProductType + "Desc");
   var subTitle = eval(cleanProductType + "SubTitle");
   var rent = eval(cleanProductType + "Rent");
   var oneRentPrice = new Boolean(true);

   if(images.length != desc.length ||
      images.length != subTitle.length ||
      images.length != rent.length)
   {
      alert("Product '" +  cleanProductType + "' data arrays are not the same size!");
   }
   var tableTitle = productType + "<br>Price per Day! $" + rent[0];

      // Check to see if all the rental prices are the same, and if so put the price
      // in the title box not in each product box.
   for(var rentCnt = 1; rentCnt < rent.length; rentCnt++)
   {
      if(rent[rentCnt] != rent[0])
      {
         oneRentPrice = false;
         tableTitle = productType;
         break;
      }
   }
      // Create iFrame to display large images in.
   var imageFrame = cleanProductType + "Frame";
   document.write('<iframe  id="', imageFrame, '"  name="', imageFrame, '" frameborder="0"  vspace="0"  ');
   document.write('hspace="0"  marginwidth="0" marginheight="0" width="400" scrolling=no  height="400" ');
   document.write('style="BORDER-RIGHT: black 1px solid; BORDER-TOP: black 1px solid; Z-INDEX: 999; ');
   document.write('LEFT: 1px; BORDER-LEFT: black 1px solid; BORDER-BOTTOM: black 1px solid; POSITION: ');
   document.writeln('absolute; TOP: 40px; visibility:hidden;"></iframe>');

   document.writeln('<a name="', cleanProductType, '"></a>');
   document.writeln('<table border=2>');
   document.writeln('<tr><td align="center" colspan="100%"><h1>', tableTitle, '</h1></td></tr>');
   var imageCnt = 0;
   for(var rowCnt = 0; imageCnt < images.length; rowCnt++)
   {
      document.writeln('<tr valign="bottom">');
      for(var colCnt = 0; colCnt < cols && imageCnt < images.length; colCnt++, imageCnt++)
      {
         var anchorId = "anchor" + cleanProductType + rowCnt + "_" + colCnt;
         var imageName = "images/" + images[imageCnt];
         var quotedDesc = desc[imageCnt].replace(/'/g, "&rsquo;");
         quotedDesc = quotedDesc.replace(/\n/gm, "<br>");
         var quotedSubTitle = subTitle[imageCnt].replace(/'/g, "&rsquo;");
         quotedSubTitle = quotedSubTitle.replace(/\n/gm, "<br>");
         var quotedRent = rent[imageCnt].replace(/'/g, "&rsquo;");
         quotedRent = quotedRent.replace(/\n/gm, "<br>");
         document.writeln('<td>');
         document.writeln('  <table border=1>');
         document.writeln('    <tr><td align="center">');
         document.writeln('        <a id="', anchorId, '" name="', anchorId, '"> </a>');
         document.write('        <img height="100" src="', imageName, '" alt="', desc[imageCnt], '"');
         document.write(' title="Click to Enlarge" onclick=\'return imageOnClick("', anchorId, '", "');
         document.writeln(imageFrame, '", "', imageName,'", "', quotedDesc, '")\' style="cursor: url(images/mag.cur)">');
         document.write('    </td></tr><tr><td align="center">');
         document.writeln(quotedDesc, '<br>');
         document.writeln(quotedSubTitle, '<br>');
         if(! oneRentPrice)
         {
            document.writeln('$', quotedRent, ' Per day!<br>');
         }
         document.write('<a class="rentme" href="appointments.html?PROD=', quotedDesc, '"> <font color="#FF0000">');
         var rentText = "Rent";
         if(buyFlag)
         {
            rentText = "Buy";
         }
         document.writeln(rentText, ' Me Now!</font> </a>');
         document.writeln('</td></tr>');
         document.writeln('  </table>');
         document.writeln('</td>');
      }
      document.writeln('</tr>');
   }
   document.writeln('</table>');
}

function generateProdOptions()
{
   var prod = document.URL;
   prod = prod.replace(/.*\?PROD=/, "");
   prod = decodeURI(prod);
   document.writeln('<select name="productpr">');
   document.writeln('<option>Choose Your Product</option>');
   document.writeln('<option></option>');

   for(var prodCatCnt = 0; prodCatCnt < productCategories.length; prodCatCnt++)
   {
      var cleanProductCategory = productCategories[prodCatCnt].replace(/[ &,+'"]/g, "");
      var desc = eval(cleanProductCategory + "Desc");
      var rent = eval(cleanProductCategory + "Rent");

      if(prodCnt > 0)
      {
         document.writeln('<option></option>');
      }
      document.writeln('<option>', productCategories[prodCatCnt].toUpperCase(), ':</option>');
      document.writeln('<option></option>');
      for(var prodCnt = 0; prodCnt < desc.length; prodCnt++)
      {
         var selected = "";
         if(desc[prodCnt] == prod)
         {
            selected = 'selected="yes"';
         }
         document.writeln('<option ', selected, ' value="', desc[prodCnt], ' on-: ', rent[prodCnt],'">', desc[prodCnt], '</option>');
      }
   }
   document.writeln('</select>');
}

function generateVoucherMsg(fontSize)
{
   document.write('<p align="center"><font color="#008080" size="', fontSize, '">$', voucherAmount, ' Coupon for a limited time only !!! -&nbsp;');
   document.writeln('Call now for additional specials !!!</font></p>');
   document.write('<p align="center"><font size="', fontSize, '"><font color="#008080">Please put this code: ');
   document.writeln('</font><b><font color="#0066FF">', voucherNum, '</font></b>');
   document.write('<font color="#008080"><br>in the voucher box of the shopping cart to receive your $', voucherAmount);
   document.writeln(' coupon for orders of greater then $', voucherMinToGet, '!</font><br></font></p>');
}

function generateHeliumTable()
{
   var productType = "Helium Tanks";
   var cols = 1;
   var cleanProductType = productType.replace(/[ &,+'"]/g, "");
   var images = eval(cleanProductType + "Images");
   var desc = eval(cleanProductType + "Desc");
   var subTitle = eval(cleanProductType + "SubTitle");
   var rent = eval(cleanProductType + "Rent");
   var oneRentPrice = new Boolean(true);

   if(images.length != desc.length ||
      images.length != subTitle.length ||
      images.length != rent.length)
   {
      alert("Product '" +  cleanProductType + "' data arrays are not the same size!");
   }
   var tableTitle = productType + "<br>Price per Day! $" + rent[0];

      // Check to see if all the rental prices are the same, and if so put the price
      // in the title box not in each product box.
   for(var rentCnt = 1; rentCnt < rent.length; rentCnt++)
   {
      if(rent[rentCnt] != rent[0])
      {
         oneRentPrice = false;
         tableTitle = productType;
         break;
      }
   }
      // Create iFrame to display large images in.
   var imageFrame = cleanProductType + "Frame";
   document.write('<iframe  id="', imageFrame, '"  name="', imageFrame, '" frameborder="0"  vspace="0"  ');
   document.write('hspace="0"  marginwidth="0" marginheight="0" width="400" scrolling=no  height="400" ');
   document.write('style="BORDER-RIGHT: black 1px solid; BORDER-TOP: black 1px solid; Z-INDEX: 999; ');
   document.write('LEFT: 1px; BORDER-LEFT: black 1px solid; BORDER-BOTTOM: black 1px solid; POSITION: ');
   document.writeln('absolute; TOP: 40px; visibility:hidden;"></iframe>');

   document.writeln('<a name="', cleanProductType, '"></a>');
   document.writeln('<table border=2>');
   document.writeln('<tr><td align="center" colspan="100%"><h1>', tableTitle, '</h1></td></tr>');
   var imageCnt = 0;
   for(var rowCnt = 0; imageCnt < images.length; rowCnt++)
   {
      document.writeln('<tr valign="bottom">');
      for(var colCnt = 0; colCnt < cols && imageCnt < images.length; colCnt++, imageCnt++)
      {
         var anchorId = "anchor" + cleanProductType + rowCnt + "_" + colCnt;
         var imageName = "images/" + images[imageCnt];
         var quotedDesc = desc[imageCnt].replace(/'/g, "&rsquo;");
         quotedDesc = quotedDesc.replace(/\n/gm, "<br>");
         var quotedSubTitle = subTitle[imageCnt].replace(/'/g, "&rsquo;");
         quotedSubTitle = quotedSubTitle.replace(/\n/gm, "<br>");
         var quotedRent = rent[imageCnt].replace(/'/g, "&rsquo;");
         quotedRent = quotedRent.replace(/\n/gm, "<br>");
         document.writeln('<td>');
         document.writeln('  <table border=1>');
         document.writeln('    <tr><td align="center">');
         document.writeln('        <a id="', anchorId, '" name="', anchorId, '"> </a>');
         document.write('        <img height="100" src="', imageName, '" alt="', desc[imageCnt], '"');
         document.write(' title="Click to Enlarge" onclick=\'return imageOnClick("', anchorId, '", "');
         document.writeln(imageFrame, '", "', imageName,'", "', quotedDesc, '")\' style="cursor: url(images/mag.cur)">');
         document.write('    </td></tr><tr><td align="center">');
         document.writeln(quotedDesc, '<br>');
         document.writeln(quotedSubTitle, '<br>');
         if(! oneRentPrice)
         {
            document.writeln('$', quotedRent, ' Per day!<br>');
         }
         document.writeln('<a class="rentme" href="appointments.html?PROD=', quotedDesc, '"> <font color="#FF0000">Rent Me Now!</font> </a>');
         document.writeln('</td></tr>');
         document.writeln('  </table>');
         document.writeln('</td>');
      }
      document.writeln('</tr>');
   }
   document.writeln('</table>');
}
