//String holding a phrase I may alert.
var sNotReady = "Coming Soon!";
//Array holding smart remarks for the page to display, used in callQuip().
var sComments = new Array( "No animals were harmed in the making of this website.",
                           "No appointment necessary!",
                           "We are now carding.",
                           //"Open Here",
                           "See details on back of website.",
                           //"The first hit is always free&trade;",
                           "This web page was manufactured from 100% recycled electrons (minimun 35% post-consumer content).",
                           "Under penalty of law, this HTML tag not to be removed.",
                           "Danger: Laser radiation.  Avoid direct eye exposure.",
                           "<a href='_images/handlecare.jpg' target='_blank'>Handle with care.</a>",
                           "Dry clean only",
                           "No preservatives or artificial flavors",
                           "Original recipe",
                           "Twice as strong as the leading website!",
                           "Not affiliated with the <a href='http://www.irish-national-stud.ie/' target='_blank'>Irish National Stud</a>.",
                           "All natural ingredients",
                           "Take a byte out of crime: don't open spam or viruses.",
                           //"Thank you for visiting, do come again.",
                           "All your base are belong to us... make your time.",
                           "Made in the U.S.A.",
                           "Website enlarged to show texture",
                           "Not under <a href='http://www.homestarrunner.com/underconstruction.html' target='_blank'>construction</a>.",
                           //"...",
                           "100% Genuine Website",
                           "Generic Homepage <img src='_images/barcode.gif' height='55' width='85'>",
                           //"<a href='http://www.homestarrunner.com/sadjournal/' target='_blank'>Why I do not have a BLog</a>",
                           //"<a href='http://www.homestarrunner.com/sbsite/' target='_blank'>Why I do not have more animation</a>",
                           //"Random Endorsement #1: <a href='http://www.homestarrunner.com' target='_blank'>H<font face='Wingdings'>&#171;</font>R</a>",
                           //"Random Endorsement #2: <a href='http://www.veggietales.com' target='_blank'>VeggieTales</a>",
                           "Random Endorsement #3: <a href='http://affiliates.powweb.com/cgi-bin/affiliate/clickme.cgi?exec=nbuzdor&site=site1' onMouseOver='javascript:window.status=\"http://www.powweb.com/\"; return true;' onMouseOut='javascript:window.status=\"\"; return true;' target='_blank'><img border=0 src='http://www.buzdor.com/_images/pwban3.gif'></a>",
                           "I am not an Heresiarch",
                           "<a href='http://www.homestarrunner.com/systemisdown.html' target='_blank'>404 Document Not Found</a>",
                           "From an old magazine... <a href='_images/cbbig.jpg' target='_blank'><img src='_images/cbsmall.jpg' border=0></a>",
                           "Buzdor.com will never ask you for your credit card information.",
                           "<a href='http://nathan.buzdor.com/toaster/' target='_blank'>Gas-Powered Toaster</a>",
                           "<a href='http://nathan.buzdor.com/burner/' target='_blank'>CD Burninator</a>",
                           "<a href='javascript:alert(sNotReady);'>Advertize here!</a>",
                           "Linking or viewing Buzdor.com does not create an attorney-client relationship.",
                           "<input type='checkbox' value='true' checked name='spamming' onclick='this.checked=true;' onkeyup='this.checked=true;'>Uncheck to stop receiving spam",
                           "<a href='http://www.30hourfamine.org/' target='_blank'>I Made My Mark</a>"
                           );

var sLogos = new Array( "L_amazon.gif",
                        "L_amex.gif",
                        "L_clock.gif",
                        "L_getaway.gif",
                        "L_guitar.gif",
                        "L_hr.gif",
                        "L_imdb.gif",
                        "L_javacup.gif",
                        "L_memory.gif",
                        "L_Palm.gif",
                        "L_paypal.gif",
                        "L_pen.gif",
                        "L_percy.gif",
                        "L_sbc.gif",
                        "L_scan.gif",
                        "L_screen.gif",
                        "L_sharpie.gif",
                        "L_sexton.gif",
                        "L_otto.gif",
                        "L_spartan.gif",
                        "L_caterpillar.gif",
                        "L_toledo.gif",
                        "L_lcc.gif",
                        "L_wormhole.gif"
                       );
var iChosen, bChosen = false;

function tdsel(numbie){
   //removes the bottom border on the selected tab on the top using the stylesheets.
   var oBody = document.getElementsByTagName("body").item(0);
   var oTopTab, oSpacer, oMenuCell, oSpacer2, oLinksDiv;
   //var oTopTable = document.getElementById("tabtable");
   oSpacer = document.getElementById("spacer");
   oSpacer2 = document.getElementById("spacer2");
   oMenuCell = document.getElementById("menu");
   //alert("tdsel");
   for (var i = 0; i < cellnumber; i++) {
      oTopTab = document.getElementById("content" + i);
      //alert(i);
      if (numbie == i) {
         if (i < 6){ //since 6 and 7 are not represented by tabs up top
            oTopTab.className = "yesselected";
         }
         oLinksDiv = document.getElementById("links" + i);
         //alert(oLinksDiv.style.display);
         oLinksDiv.style.display = 'block';
         //alert(oLinksDiv.style.display);
      } else {
         if (i < 6){ //since 6 and 7 are not represented by tabs up top
            oTopTab.className = "noselected";
         }
         oLinksDiv = document.getElementById("links" + i);
         oLinksDiv.style.display = 'none';
      }
   }
   //oTopTable.refresh();
   return;
}
         
function leftsel(numbie){
   //puts the red border around the selected item on the left using the stylesheets.
   var oBody = document.getElementsByTagName("body").item(0);
   //var oLeftTable; 
   var oLeftTab;
   for (var i = 0; i < leftnumber; i++) {
      oLeftTab = document.getElementById("left" + i)
      if (numbie == i) {
         oLeftTab.className = "leftselected";
         //oLeftTable = oLeftTab.parentElement.parentElement.parentElement;
      } else {
         oLeftTab.className = "leftbutton";
      }
   }
   //oLeftTable.refresh();
   return;
}

function callQuip(){
   //chooses one of the strings in the array and returns it (for display).
   var i = sComments.length;
   i = Math.floor(Math.random() * i);
   return sComments[i];
}

function initializer(strTitle, intTabNo, intLeftNo){
   //alert("initializer");
   //First, set the title
   document.title = "Nathan Buzdor - " + strTitle;
   //Now highlight the appropriate tab
   tdsel(intTabNo);
   //highlight the appropriate subcategory
   if (intLeftNo>-1){leftsel(intLeftNo);}
   return;
}

function logofy(){
   var i = sLogos.length;
   i = Math.floor(Math.random() * i);
   oLogo = document.getElementById("invis");
   iChosen = "_images/" + sLogos[i];
   oLogo.src = iChosen;
   bChosen = true;
   return;
}

function putlogo(){
   //alert ("putlogo " + iChosen);
   if (bChosen){
      oLogo = document.getElementById("logo");
      oLogo.src = iChosen;
      //oLogo.style.display = "none";
      //oLogo.style.display = "block";
   }
   return;
}

function SearchNav(sURL, sTerm){
   if (navigator.appName == "Microsoft Internet Explorer" && navigator.userAgent.indexOf('Opera') == -1){
      window.external.NavigateAndFind("http://www.buzdor.com/nathan/" + sURL, sTerm, "pagesf");
      }
   return;  
}

