//=====================================================================
// Lotto    : Program Generates Florida Lotto Numbers, (c) 1997
// Author   : Chris Strickland
// Company  : New Horizons Software
//          : Links to the WEB page are welcomed 
//          : Any copying of the code on this page will be under the
//          : standard shareware license agreement.  Donations of $10
//          : are appreciated and will encourage future development of
//          : shareware WEB products by New Horizons Sofware.  
//          : Send checks to:
//          : Chris Strickland
//          : 1738 Ayshire Dr
//          : Titusville FL, 32796
//          : Donations will include 90 days of free email support
//          : and six months of free upgrades.
// Developed: Feb 26, 97 
//
// Bugs     : 
//===================================================================
//


<!-- Hide Code
// Lotto Picks
//
var TRUE=0;
var FALSE=1;

function createArray(n, init)
{
   this.size = n  
   for (i = 1 ; i <= n ; i++)
         this[i] = init      //Initialize all elements
   return this               //Return the array object 
}

//---------------------------------------------------------
// Create and initialize string arrays
//---------------------------------------------------------
function initStringArray(m)
{
   var i;
   this.size = m;
   for (i = 0 ; i <= m ; i++)
         this[i] = "" //Initialize all of the left hand elements
   return this;         //Return the  array object to the caller
}

function lotto(n,high,Text)
{
   var v;
   var i;

   v = new createArray(n,0);
   tabletxt='<TR><TH>'+Text+'</TH>'
   document.write(tabletxt);
   for (i=0; i<=n; i++) {
      WriteIt=FALSE
      a=Math.random();
      v[i]=Math.ceil(a*high);
      for (j=0; j < i; j++) {
         if (v[i] == v[j]) {
            i--;
            WriteIt=TRUE
            break;
         }
      }

   if (WriteIt)
      if (Text.length == 12 && i == n) {
         document.write("<TH><font color=red>",v[i],"</font></TH>");
      }
      else {
         document.write("<TH><font color=black>",v[i],"</font></TH>");
      }
   }
   document.write("<TR>");
}

//-->
