
// dav1d.com
// (c) 2004,2005,2006 CANADA
// 2005-09-09  dg
// Created: <20100628011925UTC>
//

/////#####
function rhc_Selector() {              // *R*ight *H*and *C*olumn
// Input: rhccount shows the number of right-hand boxes to be displayed on a given page

   rhccount = 1       // number of RHC boxes to display if another number is not specified
   if ( page == "home" )          { rhccount = 2;   }
   if ( page == "index" )         { rhccount = 2;   }
   if ( page == "stories" )       { rhccount = 2;   }
   if ( page == "pictures" )      { rhccount = 2;   }
   if ( page == "cyqrcyhz1" )     { rhccount = 9;   }
   if ( page == "cyqrcyhz2" )     { rhccount = 9;   }
   if ( page == "cyqrcyhz3" )     { rhccount = 9;   }
   if ( page == "cyqrcyhz4" )     { rhccount = 9;   }
   if ( page == "cyqrcyhz5" )     { rhccount = 9;   }
   if ( page == "cyqrcyhz6" )     { rhccount = 9;   }
   if ( page == "a320sim1" )      { rhccount = 9;   }
   if ( page == "a320sim2" )      { rhccount = 9;   }
   if ( page == "viewvanc1" )     { rhccount = 9;   }
   if ( page == "viewvanc2" )     { rhccount = 9;   }
   if ( page == "ye20020608_1" )  { rhccount = 9;   }   
   if ( page == "ye20020608_2" )  { rhccount = 9;   }
   if ( page == "rssreader" )     { rhccount = 9;   }
   if ( page == "login" )         { rhccount = 2;   }
   if ( page == "links" )         { rhccount = 6;   }
   if ( page == "contact" )       { rhccount = 2;   }
   if ( page == "sitemap" )       { rhccount = 2;   }
   if ( page == "notfound" )      { rhccount = 0;   }




   var rhcsubs = 5;                        // number of available subroutines
   var rhcsub = new Array() ;
   rhcsub[0] = "rhc_Toys();" ;
   rhcsub[1] = "rhc_Stories();" ;
   rhcsub[2] = "rhc_News();" ;
   rhcsub[3] = "rhc_MedsViaCanada();" ; 
   rhcsub[4] = "rhc_Zipedia();" ; 
//   rhcsub[0] = "rhc_Weather();" ;




   var ptr=0;                     // temporary pointer
   var tmp="";                    // temporary storage
   for ( i=0; i < rhcsubs ; i++ ) {
      ptr = get_rand(0,rhcsubs-1);
      tmp = rhcsub[i] ;
      rhcsub[i] = rhcsub[ptr] ;
      rhcsub[ptr] = tmp ;
   }

   if ( rhccount > rhcsubs )   { rhccount = rhcsubs; }       // no need to go beyond the maximum

   var callrhcs = "rhc_Divider();";
   for (i=0; i < rhccount ; i++ ) {
      callrhcs = callrhcs + rhcsub[i] + "rhc_Divider();" ;
   }

   // Here's where the subroutines get executed, after being selected and shuffled
   eval(callrhcs);

}


/////#####
function rhc_Divider() {
   document.write("<hr width=100% color=black>");
}


/////#####
function rhc_Toys() {

   //Get the toys into an array manually or through an external file or database
   var turl = new Array(6) ;
    var tnam = new Array(6) ;
     var ttxt = new Array(6) ;

   turl[0] = "http://www.masseclub.net/" ;
    tnam[0] = "Java Billiards" ;
     ttxt[0] = "Excellent eye-brain co-ordination exercise!" ;

   turl[1] = "http://www.shockwave.com/sw/content/bookworm" ;
    tnam[1] = "Bookworm Game" ;
     ttxt[1] = "Fantastic fast-paced word game." ;

   turl[2] = "http://micro.magnet.fsu.edu/primer/java/scienceopticsu/powersof10/index.html" ;
    tnam[2] = "Powers of 10" ;
     ttxt[2] = "Pictures from Outer Space to Quarks" ;


   var tptr = get_rand(1,3);

   // top of mini-table
   t = "" ;
   t += "  <!-- Start of TOYS --> ";
   t += "   <table bgcolor=silver cellpadding=3 cellspacing=0 border=01 width=100%>" ;
   t += "    <tr>" ;
   t += "     <td colspan=2 bgcolor=lime width=100% align=center>" ;
   t += "       <b>TOYS</b> ";
   t += "        <BR><em>-Will open in new window-</em>";
   t += "     </td>" ;
   t += "    </tr>" ;

   for ( ti = 0 ; ti < 3 ; ti++ ) {
      t += "    <tr>" ;
      t += "     <td colspan=2 align=center>" ;
      t += "      &nbsp;<a target=_blank href=" + turl[ti] + ">" + tnam[ti] + "</a><BR>" ;
      t += "      " + ttxt[ti]  ;
      t += "     </td>" ;
      t += "    </tr>" ;

   }


   // end of mini-table
   t += "    <tr>" ;
   t += "     <td colspan=2 bgcolor=white align=center>" ;
   t += "      <nobr>&nbsp;<a href=fun.html>More TOYS ...</a></nobr>" ;
   t += "     </td>" ;
   t += "    </tr>" ;
   t += "  </table>" ;

   t += "  <!-- End of News -->" ;


   document.write(t);
   
}

/////#####
function rhc_Stories() {

   t  = "" ;
   t += "  <!-- Start of Stories -->";
   t += "   <table bgcolor=silver cellpadding=3 cellspacing=0 border=01 width=100%>";
   t += "    <tr>";
   t += "     <td bgcolor=navy width=100% align=center>";
   t += "       <font color=white><b>STORIES</b></font>";
   t += "     </td>";
   t += "    </tr>";

   // t += "    <tr>";
   // t += "     <td>";
   // t += "      <nobr>&nbsp;<a href=europe.htm>The Party and Pastry Tour.</a><BR>";
   // t += "      &nbsp;Aug-1991&nbsp;</nobr>";
   // t += "     </td>";
   // t += "    </tr>";

   t += "    <tr>";
   t += "     <td>";
   t += "      <nobr>&nbsp;<a href=viewvanc1.html>View from Vancouver</a><BR>";
   t += "      &nbsp;Oct-1994&nbsp;</nobr>";
   t += "     </td>";
   t += "    </tr>";

   t += "    <tr>";
   t += "     <td>";
   t += "      <nobr>&nbsp;<a href=a320sim1.html>A320 Simulator</a><BR>";
   t += "      &nbsp;Sep-1996&nbsp;</nobr>";
   t += "     </td>";
   t += "    </tr>";

   t += "    <tr>";
   t += "     <td>";
   t += "      <nobr>&nbsp;<a href=pdvanc1.html>Phil&Dav1d @ CYVR</a><BR>";
   t += "      &nbsp;Jan-1998&nbsp;</nobr>";
   t += "     </td>";
   t += "    </tr>";

   t += "    <tr>";
   t += "     <td>";
   t += "      <nobr>&nbsp;<a href=cyqrcyhz1.html>Regina to Halifax Trip</a><BR>";
   t += "      &nbsp;Mar-1998&nbsp;</nobr>";
   t += "     </td>";
   t += "    </tr>";

   
   t += "    <tr>";
   t += "     <td>";
   t += "      <nobr>&nbsp;<a href=ye20020608_1.html>Young Eagles 2002</a><BR>";
   t += "      &nbsp;Jun-2002&nbsp;</nobr>";
   t += "     </td>";
   t += "    </tr>";

   t += "    <tr>";
   t += "     <td bgcolor=white>";
   t += "      <nobr>&nbsp;<a href=stories.html>More STORIES ...</a></nobr>";
   t += "     </td>";
   t += "    </tr>";
   t += "  </table>";

   t += "  <!-- End of Stories  -->";

   document.write(t);
}


/////#####
function rhc_News() {

   t  = "" ;
   t += "  <!-- Start of NEWS -->";

   t += "   <table bgcolor=silver cellpadding=3 cellspacing=0 border=01 width=100%>";
   t += "    <tr>";
   t += "     <td bgcolor=navy width=100% align=center>";
   t += "       <font color=white><b>NEWS</b></font>     </td>";
   t += "    </tr>";

   t += "    <tr>";
   t += "     <td>";
   t += "      <nobr>&nbsp;<a href=javascript:not_ready();>New Page Layout!</a><BR>";
   t += "      &nbsp;May-2005&nbsp;</nobr>";
   t += "     </td>";
   t += "    </tr>";


   t += "    <tr>";
   t += "     <td>";
   t += "      <nobr>&nbsp;<a href=javascript:bio_meter();>New Bio-Meter Online!</a><BR>";
   t += "      &nbsp;Jan-2005&nbsp;</nobr>";
   t += "     </td>";
   t += "    </tr>";

   t += "    <tr>";
   t += "     <td bgcolor=white>";
   t += "      <nobr>&nbsp;<a href=javascript:not_ready();>More NEWS ...</a></nobr>";
   t += "     </td>";
   t += "    </tr>";
   t += "  </table>";

   t += "  <!-- End of News -->";

   document.write(t);

}

/////#####
function rhc_MedsViaCanada() {

   t  = "" ;
   t += "<!-- Start of mini_Ads -->" ;
   t += "<table bgcolor='silver' cellpadding='3' cellspacing='0' border='01' width=100%>" ;
   t += " <tr>" ;
   t += "  <td bgcolor='navy' width='100%' align='center'>" ;
   t += "    <font color='white'><b>Advertisement</b></font>" ;
   t += "  </td>" ;
   t += " </tr>" ;

   t += " <tr><td align='center' bgcolor='white'>" ;
   t += "    <a href='http://medsviacanada.com'>" ;
   t += "    Americans can<BR>save up to<BR><img src='../homepage/EightyPercent_WOW.gif' border='0'><BR>" ;
   t += "    on prescription medications!<br><br>" ;
   t += "    MedsViaCanada.com</a>" ;
   t += " </td></tr>" ;
   t += "</table>" ;
   t += "<!-- End of mini_Ads --> ";

 document.write(t);

}

/////#####
function rhc_Zipedia() {

   t  = "" ;
   t += "<!-- Start of mini_Ads -->" ;
   t += "<table bgcolor='silver' cellpadding='3' cellspacing='0' border='01' width=100%>" ;
   t += " <tr><td bgcolor='white'>" ;
   t += "    <p><a target='_blank' href='http://zipedia.com'><u>Zipedia.com</u></a><BR>" ;
   t += "    Your personal online encyclopedia. Store your favorite <b>links online</b>," ;
   t += "    and access them from ANYWHERE on the Internet.  <a target='_blank' href='http://zipedia.com'>More...</a>" ;
   t += "    </p>" ;
   t += " </td></tr>" ;
   t += "</table>" ;
   t += "<!-- End of mini_Ads --> ";

 document.write(t);

}


/////#####
function rhc_Weather() {


var weatherrand=get_rand(1,8);

  if (weatherrand == 1 ) { weather="CABC0308"; tz="PST";  };
  if (weatherrand == 2 ) { weather="CASK0148"; tz="MST";  }; 
  if (weatherrand == 3 ) { weather="CAMB0244"; tz="CST";  }; 
  if (weatherrand == 4 ) { weather="CAON0696"; tz="EST";  }; 
  if (weatherrand == 5 ) { weather="USCA0638"; tz="PST";  }; 
  if (weatherrand == 6 ) { weather="USCO0105"; tz="MST";  }; 
  if (weatherrand == 7 ) { weather="USWI0524"; tz="CST";  }; 
  if (weatherrand == 8 ) { weather="USFL0316"; tz="EST";  }; 



  // use document.write(weather); to make this work

   t  = "" ;
   t += "   <table bgcolor=silver cellpadding=3 cellspacing=0 border=05 width=100%>";
   t += "    <tr>";
   t += "     <td>";
   t += "      weather should be here!<BR>";
   t += "  <!-- Start of WEATHER -->";
   document.write(t);                // have to do this here to be inside the table!
   document.write('before');
  weather =  "<script language=javascript>var LocationID = '" + weather + "';</script>" ;
  weather += "<script language=javascript src='http://www.theweathernetwork.com/weatherbutton/wxbutton.js'></script>" ;
  weather += "<script language=javascript src='http://www.theweathernetwork.com/inter/weathercentre/weatherbutton/validate.js'></script>" ;
   document.write(weather);
   document.write('after');
   t   = "" ;
                  // t += "      <BR><center><font color=Gray>Dav1d's Weather Page</font></center>":
   t += "  <!-- End of WEATHER -->";
   t += "     </td>";
   t += "    </tr>";
   t += "   </table>";

   document.write(t);

}



/////#####
/////#####  Create all of the links (which will be used on the links page and certain Right-Hand-Comun stuff


var links = new Array();                    // Primary array; holds data; totally global (public)
var lcols = 5 ;                             // columns; totally global (public)
var lrows = 0 ;                             // rows (which is total entries divided by columns) is filled later


function load_Links () {

   lrows = load_Links.arguments.length / lcols ;

   for (i=0; i< lrows; i++) {
      links[i] = new Array();
      for (j=0; j< lcols; j++) {
         links[i][j] = load_Links.arguments[i*lcols+j];
      }
   }
}


///////// links contain these fields
 //     url
  //      name
   //       drate
    //        date
     //         desc


load_Links(
   
      'http://bathursted.ccnb.nb.ca/vatcan/fir/moncton/WeeklyTopics/WeeklyTopicIntro.html',
       'Aviation Stuff from ATC Controller', 
        'Very informative - great reading',
         '2006-03-28',
          'Blog written by an ATC controller with lots of good information to impart to other controllers and pilots.',

      'http://exrocketry.net/mailman/listinfo/arocket',
       'A-Rocket Forum (Amateur Rocketry)', 
        'Lots of good information',
         '2006-03-28',
          'This is the famous "A-Rocket aerospace discussion list", with actual rocketry information. Many prominent rocketry people post to this blog. A must read for all rocket scientists.',

      'http://micro.magnet.fsu.edu/primer/java/scienceopticsu/powersof10/index.html',
       'Science Exploration, Power of 10', 
        'Really explains relative sizes',
         '2006-03-28',
          'See things from outer space scale, right down to subatomic particles, presented as a slide-show. You can even set the timing of the slides.',

      'http://www.shockwave.com/sw/content/bookworm',
       'Bookworm Game', 
        'A single-player Boggle(TM)-like game',
         '2006-03-28',
          'If you are a wordsmith, this game can be very addictive.  You need to connect letters into words, like Boggle(tm), with a few other surprises.',

      'http://www.masseclub.net/',
       'Tabletop Billiards Game', 
        'Practice eye-brain co-ordination ',
         '2006-03-28',
          'You can play this java billiard game in practice mode (alone), on online with other players. Uses real physics to calculate trajectories and bounces.',

      'http://www.tekzoned.com/games/miniputt/miniputt.swf',
       'Mini-Golf Game', 
        'Game takes about 10 minutes...    ',
         '2006-03-28',
          'This Java mini-putt game allows you to keep score and compare to par.  Lots of fun.',

      'http://www.sodaplay.com/constructor/index.htm',
       'Soda Constructor', 
        'Wow! Uses gravity, bounce, and other physics!',
         '2006-03-28',
          'Soda Constructor is an interactive wire-frame toy that allows you to define the rules of the environment, including gravity, bouyancy, bounce, and more.',

      'http://www.neopets.com',
       'NeoPets - Virtual World', 
        'Artificial world. Wow!',
         '2006-03-28',
          'Virtual world with millions of pets.  This site works like a simulation, but the other participants are real people.',

      'http://www.chessclub.com',
       'Internet Chess Club', 
        'The best plaace for online chess',
         '2006-03-28',
          '***May not be active anymore (??)',

      'http://www.slashdot.org',
       'News for Nerds. Stuff that Matters.', 
        'Required Daily Reading',
         '2006-03-28',
          'Very interesting reading about a variety of topics, including politics, science, technology.',

      'http://www.robotwisdom.com',
       'Weblog by jorn barger', 
        'Good reading',
         '2006-03-28',
          'desc',

      'http://www.salon.com',
       'News Magazine', 
        'Good reading',
         '2006-03-28',
          'desc',

      'http://www.theregister.co.uk',
       'Biting the hand that feeds IT', 
        'Good reading.',
         '2006-03-28',
          'desc',

      'http://www.hackernews.com',
       'Daily Hacker and Computer Security News', 
        'Good reading',
         '2006-03-28',
          'desc',

      'http://www.2600.com',
       'Journal of the hacking community since 1984', 
        'Great Stuff!',
         '2006-03-28',
          'desc',

      'http://www.hotmail.com',
       'FREE Web-based E-Mail', 
        'The original!',
         '2006-03-28',
          'desc',

      'http://www.usatoday.com',
       'The Nations Newspaper - Online...    ', 
        'Daily News - short and sweet.',
         '2006-03-28',
          'desc',

      'http://www.darwinawards.com',
       'Darwin Awards',
        '...idiotic/fatal misadventures...[human] gene pool...', 
         '2006-03-28',
          'desc',

      'http://www.ebay.com',
       'Online Auction Site', 
        'Buy or sell ANYTHING',
         '2006-03-28',
          'desc',

      'http://www.terraserver.com',
       'Satellite Photos', 
        'Amazing ... when it works at all',
         '2006-03-28',
          'desc',

      'http://intellicast.com',
       'Weather: Images, Satellite, IR, etc.', 
        'Fabulous and informative',
         '2006-03-28',
          'desc'

 
);               // remember, no comma on the the very last one



