// a4h_head.js
//**************************************************************************
//	cTitleMSG should be defined before.
//	Format the standard title/head for all A4H web sites..

var cHTMLrdir;  	// import =root directory; may be defined earlier..
var cTitleInfo; 	// export =cTitleHead+cNavigationBar
var cTitleHead; 	// export =Title heading
var cNavigationBar;	// export =navigation bar = Home+Search+Special
var cSearchBar; 	// export =search   bar html
var fSearchBar; 	// export =search   bar true=display
var cSpecialBar;	// export =special  bar html
var fSpecialBar;	// export =special  bar true=display
var cHomelinkBar;	// export =Homelink bar html
var fHomelinkBar;	// export =Homelink bar true=display
var cMIPS24kBar;    // export =MIPS24k/Linux  bar html
var fMIPS24kBar;    // export =MIPS24k/Linux  bar true=display
var cHiLite;		// Mouse over/out hilite coloring
var cWarnNoHTML;	// Mouse over/out warning there is not HTML
var uIconHeight=26;	// Icon height for Search/Special bar
var cIPaddr_Public="127.0.0.1";

// 	define some constants..
var cHTMLbase   = "http://www.ajax4hire.com";
var cHTMLindexL	= "site_map.html";

if(cHTMLrdir    == null) cHTMLrdir    = '';
if(fHomelinkBar == null) fHomelinkBar = "YES";
if(fSearchBar   == null) fSearchBar   = "YES";
if(fSpecialBar  == null) fSpecialBar  = "YES";
if(fMIPS24kBar  == null) fMIPS24kBar  = "NO";

//	define variables for friendly time display
var cTimeNOW_hr = new Date().getHours();
var                     cTimeNOW_am  = "am";
if( cTimeNOW_hr > 12) { cTimeNOW_am  = "pm";
						cTimeNOW_hr -=  12; }
if( cTimeNOW_hr == 0) { cTimeNOW_hr  =  12; }

var cTimeNOW = new Date();
//	define the friendly time display string (h:mm:ssam/pm)
function Format_TimeNOW() {
  cTimeNOW =    cTimeNOW_hr
			+":"+Math.floor(new Date().getMinutes()/10)
				+Math.floor(new Date().getMinutes()%10)
			+":"+Math.floor(new Date().getSeconds()/10)
				+Math.floor(new Date().getSeconds()%10)
				+cTimeNOW_am;
}
//	define the friendly date display string (h:mm:ssam/pm)
var cDateDay   = new Array('Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat');
var cDateMonth = new Array('Jan', 'Feb', 'Mar',
                           'Apr', 'May', 'Jun',
                           'Jul', 'Aug', 'Sep',
                           'Oct', 'Nov', 'Dec');
                        var cDateNOW = new Date().toDateString();
function Format_DateNOW() {
  var oNow = new Date();
//cDateNOW = oNow.toDateString();
  cDateNOW = cDateDay[oNow.getDay()]+' '
            +cDateMonth[oNow.getMonth()]+' '
            +oNow.getDate()+', '
            +oNow.getFullYear();
}
var cPageNOW;
function Format_PageNOW() {
    cPageNOW = '       <b>Last update:</b> '+document.lastModified
             + '&nbsp;&nbsp;&nbsp;'
             + '<b>load time: </b>'
             +cDateNOW+' - '+cTimeNOW;
}
//*********************************************************************
//	constant string for Head Text, <home> and <list of all>
//	JavaScript output after <body> in all html files..
//	defined here to make global
function make_TitleHead() {
  Format_TimeNOW();
  Format_DateNOW();
  Format_PageNOW();
  cTitleHead = '<center><font color=black>'
+ '<table bgcolor="white" width="100%" align="center" border=0 cellpadding=0 cellspacing=0 TITLE="'+cTitleMSG+'"><tbody>'
+ '<tr>'
+ '  <td align="right" valign="top" title="'+cHTMLbase+'" height="60" width="60">'
+ '    <a href="'+cHTMLbase+'"><img src="'+cHTMLrdir+'images/home.gif" width="100%" height="100%" alt="Home" border=0></a>'
+ '  </td>'
+ '  <td align="center" valign="center" width=3 height=3></td>'
+ '  <td align="left" valign="top">'
+ '    <table width=100% border=0 cellpadding=0 cellspacing=0 TITLE="'+cTitleMSG+'"><tbody>'
+ '    <tr align="left" valign="top">'
+ '      <td align="left" valign="top" nowrap>'
+ '        <center><FONT SIZE=+3><b>'+cTitleMSG+'</b></font></center>'
+ '      </td>'
+ '    </tr>'
+ '    <tr align="left" valign="top">'
+ '      <td align="left" valign="top" nowrap><center>'
+cPageNOW
//+ '       <b>Last update:</b> '+document.lastModified
//+ '&nbsp;&nbsp;&nbsp;'
//+ '<b>load time: </b>'
//+cDateNOW+' '+cTimeNOW
//+ '; <a href="mailto:&#65;&#106;&#97;&#120;&#52;&#72;&#105;&#114;&#101;&#64;&#99;&#111;&#109;&#99;&#97;&#115;&#116;&#46;&#99;&#111;&#109;">EMail Contact.</a>'
+ '      </td>'
+ '    </tr>'
+ '    </tbody></table>'
+ '  </td>'
+ '  <td align="center" valign="center" width=3 height=3></td>'
//+ '  <td align="right" valign="top" title="'+cHTMLbase+'" height="60" width="60">'
//+ '    <a href="'+cHTMLbase+'"><img src="'+cHTMLrdir+'images/home.gif" width="100%" height="100%" alt="Home" border=0></a>'
+ '  <td align="right" valign="top" title="Alternate: '+cIPaddr_Public+'" height="60" width="60">'
+ '    <a href="http://'+cIPaddr_Public+'"><img src="'+cHTMLrdir+'images/home.gif" width="100%" height="100%" alt="Alternate Home" border=0></a>'
+ '  </td>'
+ '</tr>'
+ '</tbody></table></font></center>';
}
//**************************************************************************
function set_cHiLiteColor(cHiLiteColor) {
  cHiLite = 'onMouseOver="javascript: this.style.backgroundColor=\''+cHiLiteColor+'\';"'
           +'onMouseOut ="javascript: this.style.backgroundColor=\'\';"';
}
//**************************************************************************
function href_from_info(cHREF, cTitle, cDescription, iBR) {
  document.write('<a href="'+cHREF+'" '+cHiLite+'title="'+cDescription+'"><b>'+cTitle+'</b></a>');
}
//**************************************************************************
function make_SearchBar() {
  set_cHiLiteColor("lime");
  cSearchBar  = '<table width="100%" bgcolor=#ffffff border=0 cellpadding=0 cellspacing=0><tbody><tr>';
//cSearchBar += '  <td align="right" width="80"><nobr><FONT SIZE="+2"><b>Search:</b></font></nobr></td>';
  cSearchBar += '  <td><nobr><a href="http://google.com/"     title="Google.com"                          ><img src="'+cHTMLrdir+'images/search_google.gif"     width="100%" height="'+uIconHeight+'" alt="Google"        border=0></a></td>';
  cSearchBar += '  <td><nobr><a href="http://my.yahoo.com/"   title="MyYahoo.com"                         ><img src="'+cHTMLrdir+'images/search_myyahoo.gif"    width="100%" height="'+uIconHeight+'" alt="My Yahoo"      border=0></a></td>';
  cSearchBar += '  <td><nobr><a href="http://mahalo.com/"     title="Mahalo.com"                          ><img src="'+cHTMLrdir+'images/search_mahalo.gif"     width="100%" height="'+uIconHeight+'" alt="Mahalo.com"    border=0></a></td>';
//cSearchBar += '  <td><nobr><a href="http://thestreet.com/"  title="TheStreet.com"                       ><img src="'+cHTMLrdir+'images/logo_thestreet.gif"    width="100%" height="'+uIconHeight+'" alt="TheStreet.com" border=0></a></td>';
  cSearchBar += '  <td><nobr><a href="http://imdb.com/"       title="IMDB.com - Internet Movie Database"  ><img src="'+cHTMLrdir+'images/search_imdb.gif"       width="100%" height="'+uIconHeight+'" alt="IMDB.com"      border=0></a></td>';
  cSearchBar += '  <td><nobr><a href="http://renweb.com/"     title="renweb - Covenant Christian Academy" ><img src="'+cHTMLrdir+'images/renweb.gif"            width="100%" height="'+uIconHeight+'" alt="renweb"        border=0></a></td>';
//cSearchBar += '  <td><nobr><a href="http://yahoo.com/"      title="yahoo.com"                           ><img src="'+cHTMLrdir+'images/search_yahoo.gif"      width="100%" height="'+uIconHeight+'" alt="Yahoo!"        border=0></a></td>';
//cSearchBar += '  <td><nobr><a href="http://jux2.com/"       title="jux2.com"                            ><img src="'+cHTMLrdir+'images/search_jux2.gif"       width="100%" height="'+uIconHeight+'" alt="jux2"          border=0></a></td>';
  cSearchBar += '  <td><nobr><a href="http://msn.com/"        title="MSN.com"                             ><img src="'+cHTMLrdir+'images/search_msn.gif"        width="100%" height="'+uIconHeight+'" alt="MSN"           border=0></a></td>';
  cSearchBar += '  <td><nobr><a href="http://ebay.com/"       title="Ebay.com"                            ><img src="'+cHTMLrdir+'images/shop_ebay.gif"         width="100%" height="'+uIconHeight+'" alt="Ebay"          border=0></a></td>';
//cSearchBar += '  <td><nobr><a href="http://kartoo.com/"     title="Kartoo.com"                          ><img src="'+cHTMLrdir+'images/search_kartoo.gif"     width="100%" height="'+uIconHeight+'" alt="KartOO"        border=0></a></td>';
//cSearchBar += '  <td><nobr><a href="http://ask.com/"        title="Ask.com"                             ><img src="'+cHTMLrdir+'images/search_askjeeves.gif"  width="100%" height="'+uIconHeight+'" alt="Ask Jeeves"    border=0></a></td>';
//cSearchBar += '  <td><nobr><a href="http://lycos.com/"      title="Lycos.com"                           ><img src="'+cHTMLrdir+'images/search_lycos.gif"      width="100%" height="'+uIconHeight+'" alt="Lycos"         border=0></a></td>';
//cSearchBar += '  <td><nobr><a href="http://ebay.com/"       title="Ebay.com"                            ><img src="'+cHTMLrdir+'images/logo_ebay.gif"         width="100%" height="'+uIconHeight+'" alt="Ebay"          border=0></a></td>';
//cSearchBar += '  <td><nobr><a href="http://a9.com/"         title="A9.com"                              ><img src="'+cHTMLrdir+'images/search_a9.gif"         width="100%" height="'+uIconHeight+'" alt="A9"            border=0></a></td>';
//cSearchBar += '  <td><nobr><a href="http://alltheweb.com/"  title="AllTheWeb.com"                       ><img src="'+cHTMLrdir+'images/search_alltheweb.gif"  width="100%" height="'+uIconHeight+'" alt="All the Web"   border=0></a></td>';
//cSearchBar += '  <td><nobr><a href="http://WebCrawler.com/" title="WebCrawler.com"                      ><img src="'+cHTMLrdir+'images/search_webcrawler.gif" width="100%" height="'+uIconHeight+'" alt="WebCrawler"    border=0></a></td>';
//cSearchBar += '  <td><nobr><a href="http://altavista.com/"  title="Altavista.com"                       ><img src="'+cHTMLrdir+'images/search_altavista.gif"  width="100%" height="'+uIconHeight+'" alt="Altavista"     border=0></a></td>';
  cSearchBar += '</tr></tbody></table>';
}
//**************************************************************************
function make_SpecialBar() {
  set_cHiLiteColor("lime");
  cSpecialBar  = '<table width="100%" bgcolor=#ffffff border=0 cellpadding=0 cellspacing=0><tbody><tr>';
//cSpecialBar += '  <td align="right" width="80"><nobr><FONT SIZE="+2"><b>Special:</b></font></nobr></td>';
  cSpecialBar += '  <td><nobr><a href="http://wikipedia.org/"       title="Wikipedia.org"       ><img src="'+cHTMLrdir+'images/info_wikipedia.gif"   width="100%" height="'+uIconHeight+'" alt="Wikipedia.org"   border=0></a></td>';
  cSpecialBar += '  <td><nobr><a href="http://youtube.com"          title="YouTube"             ><img src="'+cHTMLrdir+'images/info_youtube.gif"     width="100%" height="'+uIconHeight+'" alt="YouTube.com"     border=0></a></td>';
  cSpecialBar += '  <td><nobr><a href="http://yellowpages.com"      title="Altavista.com"       ><img src="'+cHTMLrdir+'images/info_yellowpages.gif" width="100%" height="'+uIconHeight+'" alt="Yellowpages"     border=0></a></td>';
  cSpecialBar += '  <td><nobr><a href="http://virtualearth.msn.com" title="MSN Earth"           ><img src="'+cHTMLrdir+'images/info_msnmaps.gif"     width="100%" height="'+uIconHeight+'" alt="MSN Earth"       border=0></a></td>';
  cSpecialBar += '  <td><nobr><a href="http://maps.google.com"      title="Google Earth"        ><img src="'+cHTMLrdir+'images/info_googlemaps.gif"  width="100%" height="'+uIconHeight+'" alt="Google Earth"    border=0></a></td>';
  cSpecialBar += '  <td><nobr><a href="http://mapquest.com"         title="Maps from Mapquest"  ><img src="'+cHTMLrdir+'images/info_mapquest.gif"    width="100%" height="'+uIconHeight+'" alt="Mapquest.com"    border=0></a></td>';
//cSpecialBar += '  <td><nobr><a href="http://dogpile.com"          title="Dogpile file search" ><img src="'+cHTMLrdir+'images/search_dogpile.gif"   width="100%" height="'+uIconHeight+'" alt="Dogpile.com"     border=0></a></td>';
//cSpecialBar += '  <td><nobr><a href="http://go.com"               title="Go.com"              ><img src="'+cHTMLrdir+'images/search_go.gif"        width="100%" height="'+uIconHeight+'" alt="Go!"             border=0></a></td>';
//cSpecialBar += '  <td><nobr><a href="'+cHTMLrdir+'bookmarks.html" title="Firefox Bookmarks"   ><img src="'+cHTMLrdir+'images/bookmarks.gif"        width="100%" height="'+uIconHeight+'" alt="Bookmarks"       border=0></a></td>';
  cSpecialBar += '</tr></tbody></table>';
}
//**************************************************************************
// NOTE: the items in the next three arrays are TUPLES:
// 	[URL, button text, descriptive title]
//	list them in the order you want them to appear on screen.
var linkTxt = new Array('Home',       'Personal',                   'News-Info',                     'Funny',               'Company',                 'Commerce',                 /*'Government',                               */ 'Linux',                             'Finance',               /*'Cool Sites',                 */ 'JavaScriptEx',          'SiteMap'             );
var linkURL = new Array('index.html', 'personal.html',              'newsinfo.html',                 'funny.html',          'company.html',            'commerce.html',            /*'govermnt.html',                            */ 'linux.html',                        'finance.html',          /*'internet.html',              */ 'JavaScript/index.html', 'site_map.html'       );
var linkTtl = new Array('Home page',  'Personal: Banks & ID sites', 'Newspapers, TV, Radio, Online', 'Comics & Editorials', 'Company @Work resources', 'Commerce, shopping, eBay', /*'Federal, State and Local Government sites',*/ 'All things Linux: GNU, Gnome, KDE', 'Finance, Bank, Stocks', /*'Search, Portals, Cool sites',*/ 'JavaScripe Examples',   'Index of all content');
function make_HomelinksBar() {
  cHomelinkBar =  '<table width="100%" bgcolor=#ffffcc border=0 cellpadding=1 cellspacing=0><tbody>'
              +   '<tr width="100%">';
  set_cHiLiteColor("aqua");
  for(var ii=0; (ii < linkURL.length); ii++) {
    // if this is not the current page, the button is active
    if(location.href.indexOf(cHTMLrdir+linkURL[ii]) == -1) {
      cHomelinkBar += '<td align=center><nobr><b>'
                   +  '<a class=nav TARGET="_top" '
                   +    'title="'+linkTtl[ii]+'" '
                   +    'href ="'+cHTMLrdir+linkURL[ii]+'"'
                   +    cHiLite+'>'+linkTxt[ii]+'</a></b></nobr></td>';
    } else {
      // otherwise, the button is inactive
      cHomelinkBar += '<td align="center" bgcolor="#00cccc"><nobr><b>'+linkTxt[ii]+'</b></nobr></td>';
    }
  }
  cHomelinkBar +=     '</tr>'
               +    '</tbody></table>'
               +  '</td></tr>';
}
//**************************************************************************
function Navigation_Bar() {
  cNavigationBar  = '<center>';
  cNavigationBar += '<table width=100% bgcolor=#000000 border=2 cellpadding=1 cellspacing=0><tbody>';
  make_HomelinksBar(); if(fHomelinkBar == "YES") cNavigationBar += '<tr><td width="100%">'+cHomelinkBar+'</td></tr>';
  make_SearchBar();    if(fSearchBar   == "YES") cNavigationBar += '<tr><td width="100%" height="'+uIconHeight+'">'+cSearchBar +'</td></tr>';
  make_SpecialBar();   if(fSpecialBar  == "YES") cNavigationBar += '<tr><td width="100%" height="'+uIconHeight+'">'+cSpecialBar+'</td></tr>';
                       if(fMIPS24kBar  == "YES") cNavigationBar += '<tr><td width="100%" height="'+uIconHeight+'">'+cMIPS24kBar+'</td></tr>';
  cNavigationBar += '</tbody></table></center>';
}
//**************************************************************************
function table_info_TD(cHREF, cTitle1, cTitle2) {
  document.write(
 '<table width=100% border=0 cellpadding=0 cellspacing=0 TITLE="'+cTitle1+'"><tbody><tr>'
+'  <td align="right" valign="top" title="'+cTitle1+'" width="48" heigth="48">'
+'    <a href="'+cHREF+'/index.html"><img src="'+cHREF+'/title.gif" alt="'+cTitle1+'" border=0></a>'
+'  </td>'
+'  <td align="left" width="2"></td>'
+'  <td align="left">'
+'    <a  href="'+cHREF+'/index.html">'
+'    <FONT SIZE=+1><b>'+cTitle1+'</b></font><br>'
+'    <FONT SIZE=+0><b>'+cTitle2+'</font></a>'
+'  </td>'
+'</tr></tbody></table>');
}

//document.write(
// '<style type="text/css"><!--'
//+'  .txt_navbar { font-family:arial,san-serif; font-style:normal; font-size:6pt; text-align:center; }'
//+'--></style>');
//**************************************************************************
function TitleHead_Left(cText, cFont, cHRwidth) {
  if (cHRwidth == null) cHRwidth=7;
                     document.write('<table align="center" valign="top" width="100%" border=0 cellpadding=2 cellspacing=0><tbody><tr>');
                     document.write('<td align="left">');
  if (cFont != null) document.write('<font '+cFont+'>');
                     document.write('<b>&nbsp;'+cText+'&nbsp;</b>');
  if (cFont != null) document.write('</font>');
                     document.write('</td><td align="left" width="90%">');
  if (cHRwidth > 0)  document.write('<hr noshade size="'+cHRwidth+'" color="#000000">');
                     document.write('</td><td align="right">&nbsp;</td>');
                     document.write('</tr></tbody></table>');
}
//**************************************************************************
function VerticalBar(cHeight, cTextAfter) {
  if(cHeight    == null) { cHeight = 32;    }
  if(cTextAfter == null) { cTextAfter = ''; }
  document.write('<img src="images/g_hbarc.gif" height="'+cHeight+'" border=0>'+cTextAfter);
}
//**************************************************************************
//    Icon2HTML(cHTTP=0 means use default "http://
//              cHREF=href link to site,
//              cIcon=icon name in current cHTTP+cHREF/cIcon,
//              cTitle=text for no icon mouseover,
//              fTarget=non-zero for new tab; ie. target="blank",
//              cPostSpace=space after icon, default is " ", one space, enter '' for none);
//  set cPostSpace='' (rather than default of " "=1space) so horizontal bar is evenly spaced.
//  add on any Icon2HTML that is befor a g_hbarc.gif, graphic horizontal bar
function Icon2HTML(cHTTP, cHREF, cIcon, cTitle, fTarget, cPostSpace) {
  if (cTitle  ==  null) { cTitle = cHREF;               }
                   else { cTitle = cHREF+' - '+cTitle;  }
  if (fTarget ==  null) { fTarget = '';                 }
  if((fTarget  >     0) ||
     (fTarget == "YES")) { fTarget = ' target="'+cTitle+'"'; }
  if((cHTTP   ==  null) ||
     (cHTTP   <=     0)) { cHTTP  = "http://";          }
  if((cHTTP   == "YES") ||
     (cHTTP   ==     1)) { cHTTP  = "https://";         }
  if((cHTTP   ==     2)) { cHTTP = '';                  }
                    else { cIcon = 'images/'+cIcon;     }

  if(cHREF != null) document.write('<a href="'+cHTTP+cHREF+'"'+fTarget+'>');
  if(cIcon != null) document.write('<img src="'+cIcon+'" border=0 alt="'+cTitle+'" title="'+cTitle+'">');
//if(cHREF != null) document.write('</a>&nbsp;');
  if(cHREF != null) document.write('</a>');
  if(cPostSpace == null) { document.write(" ");         }
                    else { document.write(cPostSpace);  }
}
//**************************************************************************
// export the Title Info text for inclusion in body..
make_TitleHead(); cTitleInfo  = cTitleHead;
Navigation_Bar(); cTitleInfo += cNavigationBar;

//**************************************************************************