// ///////////////////
// general code block
// ///////////////////



 var webBase  = 'www.chrisryall.net/';
 var homeBase = 'file:///C:/cavendish/';
 var cjrBase  = 'www.chrisryallnet/';
 var lmdd = new Date(document.lastModified);
 var lmd = lmdd.toLocaleString();
 var pathAndFileName;
 var online;
 var css;

// string object for manipulation
 var url  = new String (document.URL);

// standardise URL for local or Web version. Change "\" to "/"

 while( url.indexOf("\\") > -1 ) { url = url.replace("\\","/") };

// detect whether on-line (URL="www.") and trim url to "path/file.htm#anchor" 

 if(url.indexOf("www.") > -1) 
    { // web address  - trim "..uk/"
      url = url.substr(url.indexOf(".uk/")+4, url.length );
      online = true
    }
  else
    // local address - trim base path
    { url = url.substr(url.indexOf("C:/cavendish/")+13, url.length);
      online = false
    };


// trim any #anchor trailer

 if( url.indexOf("#") > -1 ) 
   { url = url.substr(0, url.indexOf("#")) };

 pathAndFileName= url;

// finally trim index.htm = default on demon server

  if( url.indexOf("index.htm") > -1 ) 
   { url = url.substr(0, url.indexOf("index.htm")) };

// URL now in standard form  // End of general code block //


// ///////////////////////////
// banner and text generators
// //////////////////////////
function NSwarn() 
{ if (navigator.appName=="Netscape")
    { document.write (" Netscape/Gecko v7 doesn't implement all W3W-DOM " );
      document.write (' features and layout might be affected <br clear="all">' );
    } 
 }; // end NSwarn

function baseit() // write the local, or web folder path to file
{  if(online)
     {document.write("http://", webBase)}
   else
     { document.write(homeBase) }
  }; // end baseit

function refer(whatto) // the local or web folder name
{ document.write( '<div class=ref> http://', webBase );
  document.write( pathAndFileName, '#', whatto, '</div>' );
  }; // end refer




function bridgeBanner(path) {
document.write( ' <table cellpadding="5" summary="links table"><tbody><tr><td>' );
document.write( ' <big>Links</big> to<br><a title="to top" href="#top">the top</a></td>' );
document.write( ' <td><a title="Link to ParadoX" href="../paradox.htm"><img hspace="0"' );
document.write( '  vspace="0" src="', path, 'img/pdxicon.gif" border="0" alt="Link: ParadoX"></a>' );
document.write( ' </td><td style="text-align: justify;">Look into  useful<br>' );
document.write( '    <a title="Link: ParadoX" href="', path, 'paradox.htm">Paradox</a>' );
document.write( '    advances for <br>responsive bidding</td>' );
document.write( ' <td width="100" align="center" valign="middle">' );
document.write( '  <a title="Link: Weak Twos" href="', path, 'weak.two/index.htm">' );
document.write( '  <img src="', path, 'weak.two/w2icon.gif" border="0" width="90" height="47" ' );
document.write( '   hspace="0" vspace="0" alt="Link: Weak Twos"> </a></td>' );
document.write( ' <td align="left" valign="middle">Try the popular Cavendish<br>' );
document.write( '  <a title="Link: Weak Twos" href="', path, 'weak.two/index.htm">Archive' );
document.write( '  of Weak Two styles</a><br> drawn from across the World </td></tr> ' );
document.write( ' <tr><td colspan="6" align="left">' );
document.write( ' My own <a title="Link: Bridge page" href="', path, 'index.htm">Bridge Homepage</a> and ' );
document.write( '  <a title="Link: Birkenhead and family history" href="', path, '../index.htm">Cavendish</a>' );
document.write( '  page (family &amp; Birkenhead history)</td></tr></tbody></table>' );
 }; // end bridgeBanner

function w2banner() {
document.write( ' <table summary="links within site" border=0 cellpadding=3>' );
document.write( ' <tr><td><big>Links</big> to<br><a href="#top">the top</a></td>' );
document.write( ' <td width=53 align=center><a href="../paradox.htm">' );
document.write( '     <img src="../img/pdxicon.gif" border=0 ' );
document.write( '      hspace=0 vspace=0 height=44 width=51 alt="paradox"> </a></td>' );
document.write( ' <td style="text-align:justify">Look into useful' );
document.write( '    <br><a href="../paradox.htm">Paradox</a> advances<br>in responsive bidding</td>' );
document.write( ' <td width=82 align=center valign=middle> ' );
document.write( '    <a href="index.htm"> <img src="w2icon.gif"  border=0 width=76 height=40' );
document.write( '     hspace=0 vspace=0 alt="Weak Two"> </a></td>' );
document.write( ' <td align=left valign=middle>If you enjoyed the Weak Two Archive' );
document.write( '   <br> I have some <a href="link.htm">paste-in HTML code</a> to' );
document.write( '   <br> install a link icon on your own Bridge site</td></tr> ' );
document.write( ' <tr> <td colspan=5 align=left>' );
document.write( ' or visit my own <a href="../index.htm">Bridge Homepage</a> and ' );
document.write( '  <a href="../../index.htm">Cavendish</a> page (family and Birkenhead history)' );
document.write( ' </tr></table>' );
  }; // end w2banner


function footer(dat){
// add CSS icon, URL, copyright {with dat(e)}, mailto-link and Web counter
document.write( '<a name="ftr"/>');  

document.write( '<br clear="all"><table cellpadding="0" cellspacing="0" border="0" style="margin-top:1em"><tr>' );
document.write( '<td align="center" valign="middle"  width="76" rowspan="2">' );
document.write( '<a title="link: Cavendish site has validated HTML and CSS2 - visit www.w3.org for more info" ');  
document.write( ' href="http://www.w3.org"><img src="');  
 baseit();
document.write( 'icn/validhtml.gif" align="left" ' ); 
document.write( ' alt="link: Cavendish site uses validated HTML-4.01 and CSS-2 - visit www.w3.org for more info" ' );
document.write( ' height="25" width="68" vspace="0" hspace="5"  border="0"></a></td>' );
document.write( '<td align="left"><div class="tinyb"><i>' ); // URL
document.write(  webBase ,url,'</i></div></td>' );
// counter
document.write( '<td valign=bottom align=right width=96 rowspan=2>' );
if(online) // different base here
 { document.write( '<img src="/cgi-bin/count?dd=B&ft=0"' ); 
   document.write( ' height="23" width="90" vspace="1" hspace="3" alt="counter" border="0">' )
 }
 else
 { document.write( '<img src="file:///C:/cavendish/img/count.gif" align="right"' ); 
   document.write( ' height="20" width="90" vspace="1" hspace="3" alt="counter" border="0">' )
  };
// move to next row
document.write( '</td></tr><tr><td align=right>' );//copyright
document.write( '<span class="tinyb"><span style=font-size:90%>&copy;</span>&nbsp;' );
document.write('<a href="#ftr" title=" Last modified ', lmdd, '">');

document.write('<i>Chris&nbsp;Ryall&nbsp;', dat,'</i></a>&nbsp;|' );
document.write( '&nbsp;<a title="Click to email" href="' );  
 baseit();
document.write( 'mailer.htm">Email&nbsp;link</a>' ); // email link
// counter label
document.write( '&nbsp;|&nbsp;Cavendish&nbsp;visitors&nbsp;since&nbsp;1997:&nbsp;</span>');
document.write( '</td></tr></table>' );  // close table ..
 }; // end footer and Javascript file - (c) CJ Ryall Jan 2004

