//##############################################################################
 var xvcg        = true;                // File Loaded Indicator
 var winup       = null;

 var lvno = new Array ();               //T his array is used to control the
     lvno [0]   = 'z';                  // display of the ladies.

//##############################################################################
 function pop_winscroll (URL, NAME, W, H)
    {
   if (winup != null && winup.closed != true)
      {
      winup.focus ();
      return;
      }                                 // It's already open... we're outta here!

    var lw = W;                         //
    var lh = H;                         //

    props = 'HEIGHT=' + lh + ',WIDTH=' + lw + ',scrollbars=1,toolbar=0,location=0,statusbar=0,menubar=0,resizable=0'
    winup = window.open (URL, NAME, props);
    }
//==============================================================================
 function pop_winadjust (URL, NAME, W, H, SCROLL)
    {                                   // Preferred values are multiples of 144,
    var lw = W + 20;                    // eg 288/432/576, but anything works.  As of
    var lh = H + 100;                   // now - FAQ=576,432 Story=720,640 Sizing=864,640
    var ls = 0;

    if (SCROLL != '')
       ls = 1;

    props = 'HEIGHT=' + lh + ',WIDTH=' + lw + ',scrollbars=' + ls + ',toolbar=0,location=0,statusbar=0,menubar=0,resizable=0'
    winup = window.open (URL, NAME, props);
    }
//##############################################################################
 function pop_password ()
    {
    var wrd  = 1;
    var buf  = prompt ('Please Enter Your Password:','************');
    if (buf == null)
       return 'guide.html#password';    // If somebody hits the Cancel button on
                                        // the Prompt, we don't want a browser
    var lcl  = buf.toLowerCase ();      // (ie IE) falling out of bed.  So we
                                        // short-circuit 'Cancels' with return;
    for (l   = 0; l < lcl.length; l++)
       wrd  *= (lcl.charCodeAt (l) - (l * lcl.length));

    if (wrd == 762636682080)            // <<-- Change password here <<-- 
       {
       var p = unescape ('%2576%2563%256d%2565%256d%2562%2565%2572%2573%252f%2569%256e%2564%2565%2578');
       return unescape (p) + '.html';
       }                                // ^^-- Change URL here --^^

    return 'guide.html#password';       //It no workee
    }
//##############################################################################
// Redirect 'Deep Links' to Members Only Area Index page.

 function exe_main (REF, URL)
    {
    var s = URL.indexOf ('vanityclub', 0);
    var r = REF.indexOf ('vanityclub', 0);

    window.status = REF + ' -- ' + URL.substring (s);
    return false;

    if (REF == 'http://www.vanityclub.com/guide.html' ||
        REF == 'http://216.103.133.172/guide.html'    ||
        REF == 'http://66.226.4.228/guide.html'       ||
        REF.substring (r) == 'vanityclub/guide.html'  ||
        REF == 'NULL' && URL.substring (s) == 'vanityclub/vcmembers/index.html' ||
        REF == 'NULL' && URL.substring (s) == 'vanityclub\\vcmembers\\index.html')
       return false;

    alert ('You must enter by using the password!\nRef: ' + REF);

    window.location.href = 'http://www.vanityclub.com/guide.html';
    return true;
    }
//##############################################################################
 function randomini ()                  // Get our ducks in a row after the Splash
    {                                   // has loaded.  We need to gather various
    if (document.layers)                // document attributes for later use.
       {
       document.nslo.visibility = 'show';
       document.nshi.visibility = 'show';
       }

    if (document.all || document.getElementById)
       {
       ielohtml = document.getElementById && !document.all ? document.getElementById ('ielo') : ielo;
       iehihtml = document.getElementById && !document.all ? document.getElementById ('iehi') : iehi;
       }

    totl = Math.floor (act_members ('F', 0, 0));
    midl = act_members ('H', totl, 0);

    for (r = 1; r < addrz.length; r++)
       {
       if ((addrz [r].substring (0, 1) != 'z'  && addrz [r].substring (0, 1) != 'd' && addrz [r].substring (0, 1) != 'h'))
          lvno [r] = 'z';

       }                                // Initialize the Diplayed Ladies Array

//    lvno [352] = 's';                 // klm 06/23/2006

    randomgen ();                       // OK, time to call the Generator.
    }
//------------------------------------------------------------------------------
 function randomgen ()                  // Generate the 'random' seed values for
    {                                   // 2 calls to the actual coding function.
    var unit = 45000;                   // Set a timer to call ourself, so the
    var vno  = 0;                       // display of the 2 members is refreshed.

    vno    = Math.max (Math.round (Math.random () * (midl + 1)), 1);
    randomgirls (vno, 'L');

    vno    = Math.min (Math.round (Math.random () * (addrz.length - midl) + midl), addrz.length - 1);
    randomgirls (vno, 'H');

    var td   = new Date ();             // How long do we wait between refreshes?
    var curr = td.getTime ();
    var frac = Math.floor (curr / unit);
    var dwel = unit - (curr - (frac * unit));
    if (dwel < Math.floor (unit / 20))
       dwel  = unit + dwel;

    setTimeout ('randomgen ()', dwel);
    }
//------------------------------------------------------------------------------
 function randomgirls (IDX, REQ)        // Caller supplies an 'addrz' array index
    {                                   // (IDX).  If IDX doesn't point to an
    var etc   = '';                     // active member the routine 'hunts' for
    var adj   = 0;                      // an active member.  'Hunting' involves
    var not   = 0;                      // ping-ponging an 'adjustment' variable
    var vno   = IDX;                    // till an active member AND previously
    var matchfound = false;             // undisplayed member is located.

    if ((lvno [vno] == 'z') &&  (lvno [vno] == 'd') &&  (lvno [vno] == 'h'))    
// klm 06/23/06 added ref to "(lvno [vno] == 'd' [deceased]"
// klm 11/28/07 added ref to "(lvno [vno] == 'h' [hidden]"

       {
       lvno [vno] = '!';                // We got an exact match and the VC number
       matchfound = true;               // wasn't used in previous iterations.
       }                                //

    while (matchfound == false)         // Care must be taken not to exceed the
       {                                // limits (both upper and lower) of...
       adj++;
       if (IDX - adj <= 0  || IDX + adj  >= addrz.length)
          {
          alert ('i: ' + IDX + '   a: ' + adj + '  n: ' + not + '  R: ' + REQ + '\n' + lvno );
          if (REQ == 'L')
             {
             IDX   = Math.round (Math.random () * midl);
             for (r = 1; r <= midl; r++)
                {
                if ((addrz [r].substring (0, 1) != 'z') && (addrz [r].substring (0, 1) != 'd') && (addrz [r].substring (0, 1) != 'h'))
	           lvno [r] = 'z';
                                        // ...'addrz'.  The caller has already
                }                       // limited the IDX passed so we don't
                                        // exceed from the get-go.  If we use
             }                          // all the girls in a given partition
                                        // of the 'addrz' array we reset that
          if (REQ == 'H')               // part of the Displayed Ladies array.
             {
             IDX   = Math.round (Math.random () * (addrz.length - midl) + midl);
             for (r = midl + 1; r < addrz.length; r++)
                {
                if ((addrz [r].substring (0, 1) != 'z') && (addrz [r].substring (0, 1) != 'd') && (addrz [r].substring (0, 1) != 'h'))                    lvno [r] = 'z';

                }                       //

             }

          adj      = 0;                 //
          }                             // End of If/Reset Ajustment & Seed Values

       for (i = 0; i < 2; i++)          // Here is the short-length 'ping-ponging'
          {                             // code.  Called twice to test for a
          if (i == 0)                   // valid member on either side of the
             vno = IDX + adj;           // calculated index/VC number value.
          else
             vno = IDX - adj;

          if ((lvno [vno] != 'z') && (lvno [vno] != 'd') && (lvno [vno] != 'h'))
             not++;
          else                          // Found someone, set the exit values so
             {                          // can get outta the loop.  Just for
             i = 3;                     // grins we'll see if we've gone out
             matchfound = true;         // range (Low/High) when we find our girl.
             lvno [vno] = 'y';          // Fill in the array of displayed ladies
             if (vno == midl)           // w/various discovery indicators.  They
                lvno [vno] = '=';       // are displayed on the Splash page.

             if (adj == 0)              // After a reset, did we get an immediate
                lvno [vno] = '*';       // hit?

             if (REQ == 'L' && vno > midl)
                lvno [vno] = '>';

             if (REQ == 'H' && vno < midl)
                lvno [vno] = '<';
                                        //
             }                          //

          }                             // End of For/Two Iterations or 1st Match

       }                                // End of While/No Matches Found

    if (lvno [vno] != 'y')
       etc = '<font size=-1><i>' + lvno [vno] + '</i></font>';
			 
//    etc       = etc + '<br><font size=-2>' + vno + ' - ' + IDX + ' = ' + (vno - IDX) + ' [' + not + ']</font>';
    var s1    = (addrz [vno].indexOf (':', 23));
    var lnam  = addrz [vno].substring (23, s1);

    if (vno < 10)                       // NOTE: 'etc' is generally used for
       var lno = '00' + vno;            // testing purposes.
     else                               //
        if (vno < 100)                  // Time to build a standard format VC
           var lno = '0' + vno;         // number.
        else                            //
           var lno = vno;               //

    var html = '<center><img SRC=\"pix/vc' + lno + '/yb2000.jpg\" ALT=\"' +
                             lnam + ' VC ' + lno + '\" BORDER=2 HEIGHT=240 WIDTH=240><br><b>' +
                        lnam + ' VC&nbsp;' + lno + '</b>' + etc + '</center>';

    if (REQ  == 'L')                    // Once the HTML code has been built, save
       {                                // in the appropriate variables, the VC
       if (document.layers)             // number for this member (so we don't...
          {
          document.nslo.document.nsul.document.write (html);
          document.nslo.document.nsul.document.close ();
          }

       if (document.all || document.getElementById)
          ielohtml.innerHTML = html;
                                        // ...display her twice in row).
       }                                //

    if (REQ  == 'H')                    // Next (here and above), we need to move
       {                                // the HTML into the appropriate spot in
       if (document.layers)             // the Splash page document.
          {
          document.nshi.document.nsuh.document.write (html);
          document.nshi.document.nsuh.document.close ();
          }

       if (document.all || document.getElementById)
          iehihtml.innerHTML = html;

       }

    }
//##############################################################################