
function myHeader() {
var chs,text,seltext;
chs = Math.random();
/*
Google Ads "pop out" of table in Internet Explorer;
so I'll just advertise for my own books!
if (chs < 0.5) {
  seltext = sell_books(); }
else { seltext = GoogleAd(); }
*/
text = table_structure(newWeb1(),newWeb2(),videos(),website_search());
return text;
}

function newWeb1() {
var str;
str = "<table cellpadding=7 height=\"100%\" width=\"100%\" style=\"border-style: groove; border-color: green; border-width: thin;\"><tr>";
str = str + "<td align=center>Check out my newest (incomplete) web exercise:<br />";
str = str + "<a href=\"http://www.onemathematicalcat.org/NewMathExercises/work_guided_practice.htm\">Work Problems</a><br />It's a totally new style!";
str = str + "</td></tr></table>";
return str;
}

function newWeb2() {
var str;
str = "<table cellpadding=7 height=\"100%\" width=\"100%\" style=\"border-style: groove; border-color: green; border-width: thin;\"><tr>";
str = str + "<td align=center><a href=\"http://www.onemathematicalcat.org/NewMathExercises/work_guided_practice.htm\">Work Problems</a> uses JSMath,<br />";
str = str + "and should work<br />in all major browsers.<br />";
str = str + "I'd appreciate your feedback!";
str = str + "</td></tr></table>";
return str;
}

function myFooter() { // use in Algebra I course
var text;
text = table_structure2(foot1(),foot2(),foot3());
return text;
}

function myFooterGlobal() { // can be used anywhere; uses absolute (not relative) URLs
var text;
text = table_structure2(foot1(),foot2Global(),foot3Global());
return text;
}

function table_structure(text1,text2,text3,text4) { // for header
var string;
string = "<table background=\"http://www.onemathematicalcat.org/parchment_background.gif\" border=0  height=\"100px\" width=\"100%\" cellpadding=5 bgcolor=\"#CCCC99\"><tr><td valign=\"top\" width=\"23%\" align=\"center\">";
string = string + text1;
string = string + "</td>";
string = string + "<td valign=\"top\" width=\"23%\" align=\"center\">" + text2 + "</td>";
string = string + "<td valign=\"top\" width=\"23%\" align=\"center\">" + text3 + "</td>";
string = string + "<td valign=\"top\" width=\"31%\" align=\"center\">" + text4 + "</td></tr></table>";
return string;
}


function table_structure2(text1,text2,text3) { // for footer
var string;
string = "<table background=\"http://www.onemathematicalcat.org/parchment_background.gif\" border=0 width=\"100%\" cellpadding=10 bgcolor=\"#CCCC99\"><tr><td valign=\"top\" width=\"33%\" align=\"left\">";
string = string + text1;
string = string + "</td>";
string = string + "<td valign=\"middle\" width=\"34%\" align=\"center\">" + text2 + "</td>";
string = string + "<td valign=\"top\" width=\"33%\" align=\"right\">" + text3 + "</td></tr></table>";
return string;
}


function newWebExer() {
var str;
str = "<table cellpadding=7 cellspacing=0 width=\"100%\" style=\"border-style: groove; border-color: green; border-width: thick;\"><tr>";
str = str + "<td align=center><small>Check out my newest web exercise:</small><br /><a href=\"http://www.onemathematicalcat.org/algebra_book/online_problems/mental_math.htm\"><font color=green><b>Mental Math: Addition</b></font></a><br />";
str = str + "</td></tr></table>";
return str;
}


function guestBook() {
var str;
str = "<table cellpadding=7 height=\"100%\" width=\"100%\" style=\"border-style: groove; border-color: green; border-width: thin;\"><tr>";
str = str + "<td align=center><a href=\"http://www.onemathematicalcat.org/guestbook.htm\">Please sign my Guestbook!</a>";
str = str + "</td></tr></table>";
return str;
}


function online_tutoring() {
var string;
string = "<table bgcolor=\"#999999\" border=1 cellpadding=5 width=\"100%\"><tr><td align=\"center\">";
string = string + "<big><a href=\"http://www.onemathematicalcat.org/chat_room.htm\" title=\"opens in a new window\" target=\"_blank\">";
string = string + "Dr. Fisher's<br />Ask-A-Question</a></big><br /></td></tr></table>";
return string;
}


function videos() {
var string;
string = "<table height=\"100%\" cellpadding=\"5\" width=\"100%\" style=\"border-style: groove; border-color: green; border-width: thin;\"><tr><td><center><big>";
string = string + "<a href=\"http://www.onemathematicalcat.org/movies/movies_toc.htm\">Videos:<br />How to use this website</a></big><br />";
string = string + "</center></td></tr></table>";
return string;
}


function website_search() {
var str;
str = "<!-- SiteSearch Google --><form method=\"get\" action=\"http://www.google.com/custom\" target=\"_top\">";
str = str + "<table border=\"0\" bgcolor=\"#cccccc\"><tr><td nowrap=\"nowrap\" valign=\"top\" align=\"left\" height=\"32\">";
str = str + "<a href=\"http://www.google.com/\"><img src=\"http://www.google.com/logos/Logo_25gry.gif\" border=\"0\" alt=\"Google\"></img>";
str = str + "</a></td><td nowrap=\"nowrap\"><input type=\"hidden\" name=\"domains\" value=\"www.onemathematicalcat.org\"></input>";
str = str + "<input type=\"text\" name=\"q\" size=\"31\" maxlength=\"255\" value=\"Search my web site!\"></input>";
str = str + "<input type=\"submit\" name=\"sa\" value=\"Search\"></input></td></tr><tr><td>&nbsp;</td><td nowrap=\"nowrap\">";
str = str + "<table><tr><td><input type=\"radio\" name=\"sitesearch\" value=\"\"></input>";
str = str + "<font size=\"-1\" color=\"#000000\">Web</font></td><td><input type=\"radio\" name=\"sitesearch\"";
str = str + "value=\"www.onemathematicalcat.org\"  checked=\"checked\"></input><font size=\"-1\" color=\"#000000\">";
str = str + "www.onemathematicalcat.org</font></td></tr></table><input type=\"hidden\" name=\"client\" value=\"pub-9842842191946147\"></input>";
str = str + "<input type=\"hidden\" name=\"forid\" value=\"1\"></input><input type=\"hidden\" name=\"ie\" value=\"ISO-8859-1\"></input>";
str = str + "<input type=\"hidden\" name=\"oe\" value=\"ISO-8859-1\"></input><input type=\"hidden\" name=\"cof\" value=\"GALT:#008000;GL:1;DIV:#336699;";
str = str + "VLC:663399;AH:center;BGC:FFFFFF;LBGC:336699;ALC:0000FF;LC:0000FF;T:000000;GFNT:0000FF;GIMP:0000FF;FORID:1;\"></input>";
str = str + "<input type=\"hidden\" name=\"hl\" value=\"en\"></input></td></tr></table></form><!-- SiteSearch Google -->";
return str;
}


function sell_books() {
var str;
str = "<table height=\"100%\" cellpadding=\"5\" width=\"100%\" style=\"border-style: groove; border-color: green; border-width: thin;\"><tr>";
str = str + "<td align=right><a href=\"http://www.onemathematicalcat.org/sell_books.htm\">";
str = str + "<img src=\"http://www.onemathematicalcat.org/graphics/cat_book_purple_for_small_ad.png\">";
str = str + "</a></td><td align=\"center\"><a href=\"http://www.onemathematicalcat.org/sell_books.htm\">";
str = str + "<small>s'tI a kciuq .daer<br />oD !tI</small></a></td>";
str = str + "<td align=left><a href=\"http://www.onemathematicalcat.org/sell_books.htm\">";
str = str + "<img src=\"http://www.onemathematicalcat.org/graphics/cat_book_big_for_small_ad.png\"></a>";
str = str + "</td></tr></table>";
return str;
}

function GoogleAd() {
var str;
str = "<table><tr><td>";
str = str + "<script type=\"text/javascript\">google_ad_client = \"pub-9842842191946147\";";
str = str + "google_ad_slot = \"9090067188\";";
str = str + "google_ad_width = 234;";
str = str + "google_ad_height = 60;</script>";
str = str + "<script type=\"text/javascript\" src=\"http://pagead2.googlesyndication.com/pagead/show_ads.js\"></script>";
str = str + "</td></tr></table>";
return str;
}


// The $3 Solution.  Get Affordable Math Help.
// Dr. Fisher is IN.  Get Math Help. Fast.
function threeDolSoln() {
var str;
str = "<table cellpadding=7 cellspacing=0 width=\"100%\" style=\"border-style: groove; border-color: green; border-width: thick;\"><tr>";
str = str + "<td align=center><a href=\"http://www.onemathematicalcat.org/threeDollarSolution.htm\"><font color=green><b>The $3 Math Solution<br />";
str = str + "Get Help from Dr. Fisher</b></font></a></td>";
str = str + "</td></tr></table>";
return str;
}

function mathOnWebSoln() {
var str;
str = "<table cellpadding=7 cellspacing=0 height=\"100%\" width=\"100%\" style=\"border-style: groove; border-color: green; border-width: thin;\"><tr>";
str = str + "<td align=center><font color=green>Dr. Fisher's<br /><a href=\"http://www.onemathematicalcat.org/chat_room.htm\">ONLINE TUTORING</a> and<br /><a href=\"http://www.onemathematicalcat.org/math_solutions.htm\">";
str = str + "Math-on-the-Web Solutions</b></font></a>";
str = str + "</td></tr></table>";
return str;
}

function testimonials() {
var str;
str = "<table cellpadding=7 cellspacing=0 width=\"100%\" style=\"border-style: groove; border-color: green; border-width: thick;\"><tr>";
str = str + "<td align=center><a href=\"http://www.onemathematicalcat.org/testimonials.htm\"><font color=green><b>TESTIMONIALS for<br />";
str = str + "this web site</b></font></a></td>";
str = str + "</td></tr></table>";
return str;
}


function foot1() {
var str;
str = "<small><script>document.write(\"last modified \" + document.lastModified)</script><br>";
str = str + "copyright 2004&#150;2010 Carol J.V. Fisher</small><br>";
str = str + "<!--WEBBOT bot=\"HTMLMarkup\" startspan ALT=\"Site Meter\" -->";
str = str + "<script type=\"text/javascript\" language=\"JavaScript\">var site=\"sm9CarolFisher\"</script>";
str = str + "<script type=\"text/javascript\" language=\"JavaScript1.2\" src=\"http://sm9.sitemeter.com/js/counter.js?site=sm9CarolFisher\">";
str = str + "</script><noscript><a href=\"http://sm9.sitemeter.com/stats.asp?site=sm9CarolFisher\" target=\"_top\">";
str = str + "<img src=\"http://sm9.sitemeter.com/meter.asp?site=sm9CarolFisher\" alt=\"Site Meter\" border=0></a></noscript>";
str = str + "<!-- Copyright (c)2000 Site Meter -->";
str = str + "<!--WEBBOT bot=\"HTMLMarkup\" Endspan -->";
return str;
}

function foot2() {
var str;
str = "<a href=\"../../index.htm\" align=\"center\" valign=\"middle\">Dr. Carol J.V. Fisher's Homepage</a>";
return str;
}

function foot2Global() { // absolute address, can be used from ANY page
var str;
str = "<a href=\"http://www.onemathematicalcat.org/index.htm\" align=\"center\" valign=\"middle\">Dr. Carol J.V. Fisher's Homepage</a>";
return str;
}

function foot3() {
var str;
str = "<!-- Creative Commons License -->";
str = str + "<a rel=\"license\" href=\"http://creativecommons.org/licenses/by-nc/2.5/\">";
str = str + "<img alt=\"Creative Commons License\" border=\"0\" src=\"../../graphics/cc_somerights.gif\" /></a><br />";
str = str + "Please read my<br/><a href=\"terms_of_use.htm\">TERMS OF USE</a>";
str = str + "<!-- /Creative Commons License -->";
str = str + "<!-- <rdf:RDF xmlns=\"http://web.resource.org/cc/\"";
str = str + "xmlns:dc=\"http://purl.org/dc/elements/1.1/\"";
str = str + "xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">";
str = str + "<Work rdf:about=\"\"><license rdf:resource=\"http://creativecommons.org/licenses/by-nc/2.5/\" />";
str = str + "</Work><License rdf:about=\"http://creativecommons.org/licenses/by-nc/2.5/\">";
str = str + "<permits rdf:resource=\"http://web.resource.org/cc/Reproduction\" />";
str = str + "<permits rdf:resource=\"http://web.resource.org/cc/Distribution\" />";
str = str + "<requires rdf:resource=\"http://web.resource.org/cc/Notice\" />";
str = str + "<requires rdf:resource=\"http://web.resource.org/cc/Attribution\" />";
str = str + "<prohibits rdf:resource=\"http://web.resource.org/cc/CommercialUse\" />";
str = str + "<permits rdf:resource=\"http://web.resource.org/cc/DerivativeWorks\" /></License>";
str = str + "</rdf:RDF> -->";
return str;
}

function foot3Global() { // absolute addresses; can be used from ANY page
var str;
str = "<!-- Creative Commons License -->";
str = str + "<a rel=\"license\" href=\"http://creativecommons.org/licenses/by-nc/2.5/\">";
str = str + "<img alt=\"Creative Commons License\" border=\"0\" src=\"http://www.onemathematicalcat.org/graphics/cc_somerights.gif\" /></a><br />";
str = str + "Please read my<br/><a href=\"http://www.onemathematicalcat.org/algebra_book/online_problems/terms_of_use.htm\">TERMS OF USE</a>";
str = str + "<!-- /Creative Commons License -->";
str = str + "<!-- <rdf:RDF xmlns=\"http://web.resource.org/cc/\"";
str = str + "xmlns:dc=\"http://purl.org/dc/elements/1.1/\"";
str = str + "xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">";
str = str + "<Work rdf:about=\"\"><license rdf:resource=\"http://creativecommons.org/licenses/by-nc/2.5/\" />";
str = str + "</Work><License rdf:about=\"http://creativecommons.org/licenses/by-nc/2.5/\">";
str = str + "<permits rdf:resource=\"http://web.resource.org/cc/Reproduction\" />";
str = str + "<permits rdf:resource=\"http://web.resource.org/cc/Distribution\" />";
str = str + "<requires rdf:resource=\"http://web.resource.org/cc/Notice\" />";
str = str + "<requires rdf:resource=\"http://web.resource.org/cc/Attribution\" />";
str = str + "<prohibits rdf:resource=\"http://web.resource.org/cc/CommercialUse\" />";
str = str + "<permits rdf:resource=\"http://web.resource.org/cc/DerivativeWorks\" /></License>";
str = str + "</rdf:RDF> -->";
return str;
}

function detectBrowser() {
  var browser=navigator.appName;
  var b_version=navigator.appVersion;
  var version=parseFloat(b_version);
string = "Sorry, people.\nThis page has special requirements due to its math content.\n\n";
string = string + "With your viewing scenario, you may see some garbage, and/or things may not work correctly.\n\n";
string = string + "Please watch the short \"Welcome\" video from my homepage.\n";
string = string + "Everything is free and easy.\n";
string = string + "It only takes a few minutes to set things up...\n";
string = string + "...so you can use my HUNDREDS of web exercises.\n\n";
string = string + "Hope to see you back here soon!";
  if (browser != "Microsoft Internet Explorer") {
     alert(string);
     return;
  }
  else if (!isMPInstalled()) { // if in IE, but MathPlayer isn't installed...
  string = "This web exercise requires MathPlayer. Without it, you'll see garbage instead of beautiful mathematics.";
  string = string + " Please read \"Will this website work on your computer?\" from my homepage.";
  alert(string);
  return;
  }
}
// returns True if MathPlayer is installed
function isMPInstalled()
{
  try {
    var oMP = new ActiveXObject("MathPlayer.Factory.1");
    return true;
  }
  catch(e) {
    return false;
  }
}

function linksBelowHomepageLink() { // links from Algebra I curriculum
var str;
str = "<a href=\"table_of_contents.htm\">Table of Contents for the Algebra I course \"One Mathematical Cat, Please!\"</a><br />";
return str;
}

function linksBelowHomepageLinkGeom() { // links from Geometry curriculum
var str;
str = "<a href=\"table_of_contents_geom.htm\">Table of Contents for the Geometry course \"One Mathematical Cat, Please!\"</a><br />";
return str;
}

function linksBelowHomepageLinkAlgII() { // links from Geometry curriculum
var str;
str = "<a href=\"table_of_contents.htm\">Table of Contents for the Algebra II course \"One Mathematical Cat, Please!\"</a><br />";
return str;
}


function twitter() {
var str;
str = "<table bgcolor=\"#999999\" border=1 cellpadding=5 width=\"100%\"><tr><td align=\"center\">";
str = str + "<big><a href=\"http://www.onemathematicalcat.org/twitter_test.htm\">TWITTER</a></big><br />";
str = str + "</td></tr></table>";
return str;
}