 
var clickOnNewProblem = "Click on \"new problem\" to get started!";
var pracParticularProbType = "Want to practice a particular problem type?";


var probInstructionsTypeInAns = "To get a randomly-generated practice problem,<br/>";
probInstructionsTypeInAns += "click the \"new problem\" button above.<br />";
probInstructionsTypeInAns += "Type your answer in the box below,<br />";
probInstructionsTypeInAns += "and then press \"Enter\".";

var probInstructionsRadioButton = "To get a randomly-generated practice problem,<br/>";
probInstructionsRadioButton += "click the \"new problem\" button above.<br />";
probInstructionsRadioButton += "Select the correct radio button below,<br />";
probInstructionsRadioButton += "and then press \"Enter\".";


var probInstructionsUntimed = "To get a randomly-generated practice problem,<br/>";
probInstructionsUntimed += "click the \"new problem\" button above.<br />";
probInstructionsUntimed += "Think about your answer,<br />";
probInstructionsUntimed += "and then press \"Enter\".";


var typeInAnsInstructions = "Type your answer here, and then press \"Enter\":";

var timingButtonInstructions1 = "Want to time yourself?";
var timingButtonInstructions2 = "When you \"End Timing\" you'll get a summary sheet of your results. Good luck!";
var worksheetInstructions = "";


var typeDesiredNumWkshtProblems = "Type the desired number of worksheet problems here:";
var typeExtraSpaceWkshtProblems = "Want some extra work-space for each problem?<br />Type the desired amount here (units are pixels):";

/* Carol: take out this imbedded style AFTER entire site is updated! */


function table_structure(text1,text2,text3,text4,text5) { // for header
var string;
string =  "<table id='pageHeader' style='background-image: url(http://www.onemathematicalcat.org/css/parchment_background.gif)'><tr>";
string += "<td id='pgHdrCol1' width='20%' style='border:1px solid black;' align='center'>" + text1 + "</td>";
string += "<td id='pgHdrCol2' width='20%' style='border:1px solid black;' align='center'>" + text2 + "</td>";
string += "<td id='pgHdrCol3' width='20%' style='border:1px solid black;' align='center'>" + text3 + "</td>";
string += "<td id='pgHdrCol4' width='20%' style='border:1px solid black;' align='center'>" + text4 + "</td>";
string += "<td id='pgHdrCol5' width='20%' align='center'>" + text5 + "</td></tr></table>";
return string;
}

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;
}

function myHeader() {
var text = table_structure(seekJob(),KarlSite(),guestBook2(),rentalHome(),website_search());
return text;
}

function seekJob() {
var string = "<a href='http://www.onemathematicalcat.org/carol_vita_web.htm' style='color:green;'>Web site creator seeks<br />math-on-the-web job</a></a>";
return string;
}

function videos() {
var string = "<a href='http://www.onemathematicalcat.org/movies/movies_toc.htm'>Videos:<br />How to use this website</a>";
return string;
}

function KarlSite() {
var string;
string =  "My <a href='http://www.onemathematicalcat.org/husbandnot.htm'>husbandnot</a> leads<br />";
string += "<a href='http://www.fingerfolk.com/'>trips around the world</a>";
return string;
}

function guestBook() {
var string;
string =  "Please<br /><a href=\"http://www.onemathematicalcat.org/guestbook.htm\">Sign my Guestbook</a>";
return string;
}

function guestBook2() { // has videos incorporated in it
var string;
string =  "<a href=\"http://www.onemathematicalcat.org/guestbook.htm\">Sign my Guestbook</a><br /><br />";
string += "<a href='http://www.onemathematicalcat.org/movies/movies_toc.htm'>videos:<br />How to use this website</a>";
return string;
}


function rentalHome() {
var string;
string = "Enjoy our &ldquo;Hill Cottage&rdquo;<br /><a href=\"http://www.onemathematicalcat.org/MHome2/RentHome.htm\">Vacation Rental Home</a><br />";
string += "<span style='color:green;'>(and get free math tutoring!)</span>";
//string += "Last-minute cancellation!<br />House is available right now!";
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 linksBelowHomepageLink() { // links from Algebra I curriculum
var str;
str = "<a href='table_of_contents.htm'>Table of Contents for Algebra I course: One Mathematical Cat, Please!</a>";
return str;
}

function table_structure2(text1,text2,text3) { // for footer
var string;
string = "<table style=\"width:100%; background-image: url(http://www.onemathematicalcat.org/css/parchment_background.gif); background-color:#CCCC99; padding-left:0px; padding-right:0px; margin-top:50px; \">";
string += "<tr>";
string += "<td style=\"vertical-align:top;    width:33%; text-align:left;\"   >" + text1 + "</td>";
string += "<td style=\"vertical-align:middle; width:34%; text-align:center;\" >" + text2 + "</td>";
string += "<td style=\"vertical-align:top;    width:33%; text-align:right;\"  >" + text3 + "</td></tr></table>";
return string;
}

function table_structure3(text1,text2,text3) { // for footer with both MathJax and JSXGraph notices
var string;
string = "<table style=\"width:100%; background-image: url(http://www.onemathematicalcat.org/css/parchment_background.gif); background-color:#CCCC99; padding-left:0px; padding-right:0px; margin-top:50px; \">";
string += "<tr>";
string += "<td style=\"vertical-align:top;    width:25%; text-align:left;\"   >" + text1 + "</td>";
string += "<td style=\"vertical-align:middle; width:50%; text-align:center;\" >" + text2 + "</td>";
string += "<td style=\"vertical-align:top;    width:25%; text-align:right;\"  >" + text3 + "</td></tr></table>";
return string;
}

function MathJaxNotice() {
var string;
string = "<center>This page has been updated to use <a href=\"http://www.mathjax.org/\">MathJax</a>,<br />";
string += "so you should see beautiful mathematics on all major platforms and browsers.<br />";
string += "Please let me know if you experience any problems:<br />";
string += "<img style='vertical-align: bottom;' src='../../graphics/email_greenbg_medium.png' title='an image, to prevent email spidering'></center>";
return string;
}

function MathJaxAndJSXGraphNotice() {
var string;
string = "<center>This page has been updated to use <a href=\"http://www.mathjax.org/\">MathJax</a>";
string += " and <a href=\"http://www.jsxgraph.org/\">JSXGraph</a>,<br />";
string += "so you should see beautiful mathematics and graphics on all major platforms and browsers.<br />";
string += "Please let me know if you experience any problems:<br />";
string += "<img style='vertical-align: bottom;' src='../../graphics/email_greenbg_medium.png' title='an image, to prevent email spidering'></center>";
return string;
}

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

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


function myFooterMathJaxAndJSXGraph() { // use in Algebra I course
var text;
text = table_structure3(foot1(),foot2MathJaxAndJSXGraph(),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 myFooterGlobalMathJax() { // can be used anywhere; uses absolute (not relative) URLs
var text;
text = table_structure2(foot1(),foot2MathJax(),foot3Global());
return text;
}

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


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 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;
}

// from Algebra I curriculum
function foot2MathJax() {
var str;
str = "<a href=\"http://www.mathjax.org/\" style=\"text-align:center; vertical-align:middle;\"><img src='http://onemathematicalcat.org/graphics/MathJaxBadge.gif' border=\"0\" alt='Powered by MathJax' title='Powered by MathJax' /></a>";
return str;
}

function foot2MathJaxAndJSXGraph() {
var str;
str = "<table style=\"margin-left:auto; margin-right:auto;\"><tr><td style='text-align:center; padding-right:40px;'><a href=\"http://www.jsxgraph.org\">JSXGraph:<br />Dynamic Mathematics with JavaScript</a></td>";
str += "<td><a href=\"http://www.mathjax.org/\" style=\" align:center; vertical-align:middle;\"><img src=\"http://onemathematicalcat.org/graphics/MathJaxBadge.gif\" border=\"0\" alt=\"Powered by MathJax\" title=\"Powered by MathJax\" /></a></td>";
str += "</tr></table>";
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 changeFocus(dvIdName) {
// dvIDName:  STRING,  the  id  of the element that is to gain focus
document.getElementById(dvIdName).focus();
document.getElementById(dvIdName).select();
// must include this line in form element:
// onkeydown="if ((event.keyCode!==13)&&(event.keyCode!==9)) { ; } else { changeFocus('2_1'); return false; }"
// Note: the "return false" "flushes" things; otherwise doesn't work in Safari
}



/* Comment out unused functions, for faster loading


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 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 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;
}

*/


