/*
 *   Coding Domain scripting functions: Popup Windows
 *
 *   Copyright (c) 2001 Diederik van der Boor - All Rights Reserved
 *   http://www.codingdomain.com
 *   webmaster@codingdomain.com
 */


// ----------------------------------------------------------------------
// Download Information

function DL(n,v,s,d){this.name=n;this.version=v;this.size=Math.round(s/1024);this.date=d}
function DG(n,x){this.name=n;this.downloads=x}

var A  = 0;           // Don't change!
var B  = 0;           // Don't change!
var DA = new Array(); // The download array
var GA = new Array()  // Download group array




// ============================================================\\
// ============================================================\\
GA[A++]=new DG(    'winapisamples',            14              );
GA[A++]=new DG(    'vbdlls',                   6               );
GA[A++]=new DG(    'vbdllsamples',             7               );
GA[A++]=new DG(    'perlsamples',              3               );
GA[A++]=new DG(    'cgiperldownloads',         3               );
// ============================================================\\
// ============================================================\\

DA[B++]=new DL(    'carrier-setup-full',      '1.00', 1462200, "2001 October 18");
DA[B++]=new DL(    'carrier-setup-less',      '1.00', 295651,  "2001 October 18");
DA[B++]=new DL(    'carrier-source',          '1.00', 41786,   "2001 October 18");
DA[B++]=new DL(    'dll-gdi',                 '1.01', 191521,  "2001 October 20");
DA[B++]=new DL(    'dll-imagelist',           '1.00', 33214,   "2001 October 18");
DA[B++]=new DL(    'dll-menus',               '1.00', 85721,   "2001 October 18");
DA[B++]=new DL(    'ocx-coolbar',             '1.00', 208492,  "2001 October 18");
DA[B++]=new DL(    'ocx-hooking',             '1.00', 27482,   "2001 October 18");
DA[B++]=new DL(    'ocx-subcls',              '1.00', 18472,   "2001 October 18");
DA[B++]=new DL(    'vbdllsample-gdiclipping', '1.00', 20190,   "2001 October 18");
DA[B++]=new DL(    'vbdllsample-gdidrawing',  '1.00', 14490,   "2001 October 18");
DA[B++]=new DL(    'vbdllsample-menuedit',    '1.00', 100086,  "2001 October 18");
DA[B++]=new DL(    'vbdllsample-winshape',    '1.00', 24990,   "2001 October 18");
DA[B++]=new DL(    'vbocxsample-coolbar',     '1.00', 40165,   "2001 October 18");
DA[B++]=new DL(    'vbocxsample-hooking',     '1.00', 21510,   "2001 October 18");
DA[B++]=new DL(    'vbocxsample-subcls',      '1.00', 27638,   "2001 October 18");
DA[B++]=new DL(    'vbsample-autocomplete',   '1.00', 31198,   "2001 October 18");
DA[B++]=new DL(    'vbsample-cdplayer',       '1.00', 48265,   "2001 October 18");
DA[B++]=new DL(    'vbsample-dispres',        '1.00', 22373,   "2001 October 18");
DA[B++]=new DL(    'vbsample-filemisc',       '1.00', 35047,   "2001 October 18");
DA[B++]=new DL(    'vbsample-findfiles',      '1.00', 34674,   "2001 October 18");
DA[B++]=new DL(    'vbsample-fontenum',       '1.00', 22346,   "2001 October 18");
DA[B++]=new DL(    'vbsample-getapis',        '1.00', 27043,   "2001 October 18");
DA[B++]=new DL(    'vbsample-keylight',       '1.00', 20725,   "2001 October 18");
DA[B++]=new DL(    'vbsample-mousetrap',      '1.01', 30246,   "2001 November 23");
DA[B++]=new DL(    'vbsample-sysinfo',        '1.01', 51361,   "2001 November 23");
DA[B++]=new DL(    'vbsample-systray',        '1.02', 35605,   "2001 December 2");
DA[B++]=new DL(    'vbsample-winenum',        '1.02', 31420,   "2001 December 2");
DA[B++]=new DL(    'vbsample-winprop',        '1.01', 34852,   "2001 December 22");
DA[B++]=new DL(    'vbsample-winstyles',      '1.01', 17569,   "2001 December 22");
DA[B++]=new DL(    'xf-lang_dutch',           '1.06', 33174,   "2002 April 12");
DA[B++]=new DL(    'xf-lang_english',         '1.06', 32799,   "2002 April 12");
DA[B++]=new DL(    'xforum',                  '1.06', 424847,  "2002 April 12");
DA[B++]=new DL(    'xmailform',               '1.01', 5222,    "2001 November 24");
DA[B++]=new DL(    'xmodules',                '1.02', 23497,   "2002 January 24");
// ============================================================\\
// ============================================================\\





// ----------------------------------------------------------------------
// Extraction functions to use in the HTML pages.

function DV(n)
{
  var download = GetDownload(n);
  var display  = "";
  if(download == null) { display = "(? kB) [js-error]" }
  else                 { display = download.version    }
  display = '<NOBR>' + display + '</NOBR>';
  document.write(display);
}

function DS(n)
{
  var download = GetDownload(n);
  var display  = "";
  if(download == null) { display = "(? kB) [js-error]" }
  else                 { display = "(" + download.size + " kB)" }
  display = ' <FONT size="1"><NOBR>' + display + '</NOBR></FONT>';
  document.write(display);
}

function DD(n)
{
  var download = GetDownload(n);
  var display  = "";
  if(download == null) { display = "? [js-error]" }
  else                 { display = download.date  }
  document.write(display);
}


function GL(n)
{
  var group = GetGroup(n);
  var display = "";
  if(group == null) { display = "(? listed) [js-error]"    }
  else              { display = "(" + group.downloads + " listed)"  }
  display = ' <FONT size="1"><NOBR>' + display + '</NOBR></FONT>';
  document.write(display);
}


var ERROR=0;
function GetDownload(name)
{
  for(var i = 0; i < DA.length; i++)
  {
    if(DA[i].name == name)
    {
      return DA[i];
    }
  }
  return null;
}

function GetGroup(name)
{
  for(var i = 0; i < GA.length; i++)
  {
    if(GA[i].name == name)
    {
      return GA[i];
    }
  }
  return null;
}
