f/* any JavaScript syntax error and the thing seems to crash with no error message in FireFox */
/* Internet Explorer gives an error message but it appears to be always the same - that it was
   expecting an object */
   
/* if you use an undefined variable in a document.write() statement it appears to ignore it */
//________________________________________________________________________________________________
function PrintPageFooter(domain_name_, subdomain_, page_path_, xhtml_version_, not_original_  )
{

   //document.write("print page footer<br/>");
   //document.write("domain_name_ = " + domain_name_ + "<br/>"); // e.g. xyz.org
   //document.write("subdomain_ = " + subdomain_ + "<br/>");     // e.g. peakoil  or "www" if none
   //document.write("page_path_ = " + page_path_ + "<br/>");     // e.g. /my_page.php or /DDA/DDA_Article_1.php
   //document.write("xhtml_version_ = " + xhtml_version_ + "<br/>");  // e.g. ""

   for (i = 0; i < 1; i = i + 1)
   {
      document.write("<br/>");
   }
   //document.write("gonna write the page footer...");
   if ( subdomain_ != "www" )
   {
       document.write( "<hr/><a href=\"mailto:webmaster@" + subdomain_ + "." + domain_name_ + "\">");
       document.write( "webmaster@" + subdomain_ + "." + domain_name_ + "</a><br />");	   
   }
   else
   {
       document.write( "<hr/><a href=\"mailto:webmaster@" + domain_name_ + "\">"); 
	   document.write( "webmaster@" + domain_name_ + "</a><br />");
   }

   PrintPageFooterLinks(domain_name_, subdomain_, page_path_);
    PrintPageFooterIcons(xhtml_version_,page_path_);
   //document.write("will check to write last modified date");
   if ( StringEndsWith(page_path_,".php") )
   {
      //document.write("php page - will write last modified in php code");
      // will write the modified date in php code
   }
   else
   {
      document.write( GetLastModifiedInfo() );
   }
   PrintGooglePlusOneButton();
   if ( not_original_ == "" )
   {
        document.write("<p>");
        document.write("&copy; " + domain_name_)
        document.write("</p>");
   }
   else
   {
        document.write("<br/>");
   }
}
//________________________________________________________________________________________________
function PrintGooglePlusOneButton()
{
   document.write("<!-- Place this tag where you want the +1 button to render -->");
   document.write('<g:plusone annotation="inline"></g:plusone>');
   document.write('<!-- Place this render call where appropriate -->');
   document.write('<script type="text/javascript">');
   document.write('(function() {');
   document.write(" var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;");
   document.write(" po.src = 'https://apis.google.com/js/plusone.js';");
   document.write(" var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);");
   document.write("})();");
   document.write("</script>");
}
//________________________________________________________________________________________________
function PrintPageFooterLinks(domain_name_, subdomain_, page_path_)
{
   //document.write("gonna write page footer links...");
   //document.write("<hr />");
   var strXhtml_validation_link = "<a href=\"http://validator.w3.org/check?uri=";
   var strPage_url = "http%3A%2F%2F";
   
   strPage_url += subdomain_ + "." + domain_name_;

   if ( page_path_ != "" )
   {
      strPage_url +=  page_path_;	   
   }
   

   strXhtml_validation_link += strPage_url;
   strXhtml_validation_link += "\">Validate Page</a><br/>";
   //document.write(strXhtml_validation_link);
   
   var strCss_validation_link = "<a href=\"http://jigsaw.w3.org/css-validator/validator?uri=";
   strCss_validation_link += strPage_url;
   strCss_validation_link += "\">Validate CSS</a> ";
   //document.write(strCss_validation_link);	

   strLink_validation_link = "<a href=\"http://validator.w3.org/checklink?url=";
   strLink_validation_link += strPage_url;
   strLink_validation_link += "\">Check Links</a><br/>";
   document.write(strLink_validation_link);


}
//________________________________________________________________________________________________
function PrintPageFooterIcons(xhtml_version_, page_path_)
{
   // full path gets rid of the need for this - just trying some JavaScript techniques
   var iLevel = 0;
   for (var i = 0; i < page_path_.length; i++)
   {
       if ( page_path_.charAt(i) == "/" )
       {
	   iLevel = iLevel + 1;
       }
   } 

   var strDir_prepend = ""
   if (iLevel == 2)
   {
       strDir_prepend = "../";
   }
   //document.write("gonna write page footer icons...");
   /* these are gifs ( is gif default extension?? )
     from http://jigsaw.w3.org/css-validator/images/ */
   var strCss_yellow_icon = strDir_prepend + "images/vcss.gif"; 
   var strCss_blue_icon   = strDir_prepend + "images/vcss-blue.gif";  

      /* from http://www.w3.org/Icons */
   if ( xhtml_version_ == null || xhtml_version_ == "" )
   {
      //document.write("xhtml_version_ was null");

      var strXhtml_yellow_icon = strDir_prepend + "images/valid-xhtml11.png";
      var strXhtml_blue_icon   = strDir_prepend + "images/valid-xhtml11-blue.png";
   }
   else
   {
      //document.write("xhtml_version = " + xhtml_version_);
      var strXhtml_yellow_icon = strDir_prepend + "images/valid-xhtml10.png";
      var strXhtml_blue_icon   = strDir_prepend + "images/valid-xhtml10-blue.png";    
   }
   document.write("<hr /><p>");
   var strXhtml_validation_icon =  "<a href=\"http://validator.w3.org/check?uri=referer\">";
   strXhtml_validation_icon += "<img src=\"" + strXhtml_blue_icon + "\"";
   strXhtml_validation_icon += "alt=\"Valid XHTML 1.0 Strict\" height=\"31\" width=\"88\" /></a>";
   document.write(strXhtml_validation_icon);
   var strCss_validation_icon =  "<a href=\"http://jigsaw.w3.org/css-validator/check/referer\">";
   strCss_validation_icon += "<img style=\"border:0;width:88px;height:31px\"";
   strCss_validation_icon += "src=\"" + strCss_blue_icon + "\"";
   strCss_validation_icon += "alt=\"Valid CSS!\" /></a>";
   document.write(strCss_validation_icon);
   document.write("</p>") ;
}
//________________________________________________________________________________________________
function PrintPageFooterTest()
{ 
   document.write("looks like PrintPageFooterTest() got executed<br/>");
}
//________________________________________________________________________________________________
function PrintPageHeader(domain_, subdomain_, page_, logo_)
{
  
   if ( subdomain_ == "49ers" )
   {
      document.write('<a href="/" title="Santa Clara\'s Panning for Fool\'s Gold homepage"> ');       
      document.write("<img src=\"/images/SC_SF_49ers_stadium_cooper_40.png\"  alt=\"Santa Clara San Francisco 49ers stadium\" /></a>");
      //document.write('<a href="/taxes.php" title="Santa Clara\'s Gift to an Ohio Billionaire"> ');	
      //document.write('<img src="/images/panning_for_fg_goldenrod_40.png" alt="Santa Clara's Fool's Gold logo"' ); 

      //document.write('<img src="/images/protecting_ohio_billionaire.png" alt="Shielding an Ohio Billionaire from Santa Clara Property Taxes"');
      //document.write('title="Shielding an Ohio Billionaire from Santa Clara Property Taxes"');
      //document.write('width="860px" height="75px"');
   }
   else
   {
      //document.write("gonna write a page header...");
      document.write('<a href="/" title="SaveSantaClara.org homepage"> ');
      document.write('<img src="/images/white_on_green_logo.png" alt="SaveSantaClara.org logo"');
   }
   //document.write(" onmouseover=\"this.src='/images/logoMouseOver.png';\" ");
   //document.write(" onmouseout=\"this.src='/images/green_on_white_logo.png';\"
   document.write("/> </a>");
}

