
// dialogs.js
// Dialog content
// copyright xThink 2007
// This code is the property of xThink.


function createNegativeFeedbackMsg(lastrecognized) {
	var msg  = "xThink Online Calculator has recognized the following input:<br/>"
	msg += lastrecognized + "<br/>";
	msg += "<br/>";
	msg += "Please enter your expected result below:<br>";
	msg += "<form name='feedbackform' onsubmit='on_correctingFeedbackSubmit(this.mathFeedback.value); return false;'>";
	msg += "<input type='text' name='mathFeedback' class='mathFeedback'></input><br/>";
	msg += "<br/>";
	msg += "<input type='submit' value='Suggest' style='width:120px; margin-left: 40px'></input>";
	msg += "<input type='button' value='Cancel' style='width: 120px; margin-left: 40px' onclick='feedbackDialog.hide();'></input>";
	msg += "</form>";
	return msg;
}

function createTermsOfServiceMsg() {
	var html = "<h1>TERMS AND CONDITIONS OF SERVICE</h1>";
	html += "\"xThink\" refers to xThink, Inc., the operator of the xThink Online Calculator. Your acceptance of this statement and";
	html += " your use of the xThink Online Calculator constitute an agreement to be bound by the following Terms and Conditions:<br>";
	html += "<br>";
	html += "1. The xThink Online Calculator Limited License<br>";
	html += "Your use of the xThink Online Calculator and the web site that hosts this service is at your sole risk. The xThink Online";
	html += " Calculator is provided on an AS IS and AS AVAILABLE basis. xThink does not warrant that the xThink Online Calculator or";
	html += " the Web site will meet your specific requirements. xThink disclaims responsibility and liability for the security,";
	html += " availability, or dependability of the xThink Online Calculator. The xThink Online Calculator can be modified or";
	html += " discontinued by xThink at any time without any obligation by xThink to notify you and without any liability to you.<br>";
	html += "<br>";
	html += "By accepting these Terms and Conditions, you agree to hold harmless and indemnify xThink from any third party claim related";
	html += " to your use of the xThink Online Calculator. This agreement includes holding xThink harmless for any liability or expense";
	html += " arising from claims of every kind and nature.<br>";
	html += "<br>";
	html += "2. Using the xThink Online Calculator<br>";
	html += "By accepting these Terms and Conditions, you agree that you will abide by all applicable local, state, national, and";
	html += " international laws, rules and regulations in your use of xThink Online Calculator.<br>";
	html += "<br>";
	html += "By accepting these Terms and Conditions, you agree that the feedback that you voluntarily send to xThink while using";
	html += " the xThink Online Calculator is the sole property of xThink. In turn, xThink agrees to use the feedback solely for";
	html += " the purpose of improving handwriting recognition. See the Privacy Policy.<br>";
	html += "<br>";
	html += "3. Property Rights<br>";
	html += "By accepting these Terms and Conditions, you agree that xThink owns all intellectual property rights of the xThink";
	html += " Online Calculator. You must not hack, modify, adapt, or decompile the xThink Online Calculator. You must not create";
	html += " or modify another website so as to falsely imply that it is associated with the xThink Online Calculator. By accepting";
	html += " these Terms and Conditions, you agree not to reproduce, duplicate, copy, sell, resell or exploit any portion of the";
	html += " xThink Online Calculator, use the xThink Online Calculator, or access to the xThink Online Calculator without the";
	html += " express written permission by xThink. You further agree that xThink Online Calculator and all content on the Site,";
	html += " is the property of xThink and protected by United States and international copyright laws. Except as set out in these";
	html += " Terms, no reproduction of any xThink-originated content is permitted without written permission from xThink.<br>";
	html += "<br>";
	html += "xThink and the xThink logo are trademarks of xThink, and may not be used without express written permission from";
	html += " xThink, other than for attribution.<br>";
	html += "<br>";
	html += "6. Law and Jurisdiction.<br>";
	html += "These Terms and Conditions will be governed by and construed in accordance with the laws of the United States of America.<br>";
	html += "If any provisions of the Terms and Conditions are proven to be illegal or unenforceable, the remainder of the Terms and Conditions";
	html += " continue in full force, and the illegal or unenforceable provisions will be dropped from this agreement.<br>";
	html += "<br>";
	html += "If you do not agree to these Terms or to our Privacy Policy, please do not access the Site or use the xThink Online Calculator.";
	html += " xThink reserves the right to change these Terms at any time. xThink recommends that you periodically check this Site for changes.<br>";
	html += "<br>";
	html += "Privacy Policy<br>";
	html += "The xThink Online Calculator gives you the option to send feedback, including handwriting samples, to xThink. You invoke the feedback";
	html += " mechanism voluntarily, on a case by case basis. xThink reserves all rights to this information and pledges to use it solely for the";
	html += " purpose of improving the product, specifically improving handwriting recognition. xThink does not log personal data regarding users";
	html += " of the xThink Online Calculator. Likewise, xThink does not log personal data regarding visitors to the xThink Online Calculator web";
	html += " site other than the data collected from customers for product purchases through our secure online transaction process.<br>";
	html += "<br>";
	html += "<div style='text-align: center'>";
	html += "<input type='button' value='I agree' onclick='termsOfServiceDialog.hide()'>&nbsp;";
	html += "<input type='button' value='I do not agree' onclick='location.href=\"http://www.xthink.com\"'>";
	html += "</div>";

	return html;
}

function createHelpDialog() {
	var html = "";

	html += "<h1>Quick Start Guide for xThink Online Calculator</h1>";
	html += "";
	html += "This Help page presents the following topics:<br>";
	html += "<br>";
	html += "<ul>";
	html += "	<li>With xThink Online Calculator what you see is what you get. No guessing.</li>";
	html += "	<li>xThink Online Calculator, should be called, xThink Online Scientific Calculator</li>";
	html += "	<li>Is there a catch?</li>";
	html += "	<li>Does the calculator recognize YOUR input?</li>";
	html += "</ul>";
	html += "<br/>";
	html += "With xThink&reg; Online Calculator you start writing and solving problems immediately (no keyboard needed!). Here's how.<br/>";
	html += "<br/>";
	html += "<ol>";
	html += "	<li>Log on to http://www.xthink.net/calculator anytime, anywhere.</li>";
	html += "	<li>Use your digital pen (or mouse) to write a problem in the large workspace. For example, write 2+2.</li>";
	html += "	<li>Tap the Solve button.</li>";
	html += "	<li>View the solution in the smaller box below.</li>";
	html += "	<li>Tap the Clear button to clear the page and solve more problems.</li>";
	html += "</ol>";
	html += "<br/>";
	html += "<h2>With xThink Online Calculator what you see is what you get. No guessing.</h2>";
	html += "";
	html += "<table>";
	html += "	<tr>";
	html += "		<td width='66%'>";
	html += "			<strong>Math Tool:</strong>";
	html += "			When the Math tool is active, a red box surrounds the Math tool. You are ready to";
	html += "			write and solve problems. The Ink color is black.";
	html += "		</td>";
	html += "		<td><img src='img/mathtool.gif'></td>";
	html += "	</tr>";
	html += "";
	html += "	<tr>";
	html += "		<td>";
	html += "			<strong>Annotations tool:</strong>";
	html += "			When you select one of the colored Annotation tools, the red box moves and surrounds that tool. You are ready to <i>annotate</i> the";
	html += "			work space. The Math tool goes to inactive mode, as shown here.";
	html += "		</td>";
	html += "		<td><img src='img/mathtool_off.gif'></td>";
	html += "	</tr>";
	html += "";
	html += "	<tr>";
	html += "		<td colspan='2'>";
	html += "			<strong>Save your work:</strong>";
	html += "			Want to save a problem-solving session? Tap the <strong>Save</strong> tool with your digital pen. Your work goes into one of the";
	html += "			<strong>Archive</strong> boxes below the problem-solving workspace. Tap <strong>Restore</strong> in the <strong>Archive</strong> box";
	html += "			to restore the archived problem to the workspace.";
	html += "		</td>";
	html += "	</tr>";
	html += "</table>";
	html += "<br/>";
	html += "<h2>'xThink Online Calculator' should be called, 'xThink Online Scientific Calculator'</h2>";
	html += "";
	html += "<table>";
	html += "	<tr>";
	html += "		<td>Try the following series of scientific calculations, with this base problem:</td>";
	html += "		<td><img src='img/parens.gif'></td>";
	html += "	</tr>";
	html += "</table>";
	html += "	";
	html += "<ol>";
	html += "	<li>Write sin(3).</li>";
	html += "	<li>Before you tap the <strong>Solve</strong> tool, tap 5 in the Decimal Precision control.</li>";
	html += "	<li>Now solve. Your solution has five digits of precision.</li>";
	html += "	<li>For practice, tap the <strong>Rad</strong> button in the Angle Units control.</li>";
	html += "	<li>Solve again. The <strong>Rad</strong> setting causes the calculator to generate solutions in radians instead of degrees (Deg).";
	html += "		That's a key capability for trigonometry!</li>";
	html += "</ol>";
	html += "<br/>";
	html += "<h2>Is there a catch?</h2>";
	html += "Yes, but nothing too difficult: <strong><i>Write clearly to help the math recognizer.</i></strong> Follow these guidelines:<br>";
	html += "";
	html += "<table>";
	html += "";
	html += "	<tr>";
	html += "		<td>";
	html += "			<strong>Asterisk:</strong>";
	html += "			Use an asterisk (*) as the multiplication symbol (not an x or a dot).";
	html += "		</td>";
	html += "		<td rowspan='2'>";
	html += "			<img src='img/arithmetic.gif'>";
	html += "		</td>";
	html += "	</tr>";
	html += "	";
	html += "	<tr>";
	html += "		<td>";
	html += "			<strong>No equals sign:</strong>";
	html += "			Don't use an equals sign. The calculator always knows to generate the numeric solution that is <strong><i>equal to</i></strong> the problem that you write.";
	html += "		</td>";
	html += "	</tr>";
	html += "	";
	html += "	<tr>";
	html += "		<td>";
	html += "			<strong>Large symbols:</strong>";
	html += "			Don't make divisor lines or root symbols that are shorter than the numbers they go with.";
	html += "		</td>";
	html += "		<td rowspan='2'>";
	html += "			<img src='img/root.gif'>";
	html += "		</td>";
	html += "	</tr>";
	html += "	";
	html += "	<tr>";
	html += "		<td>";
	html += "			<strong>Spacing:</strong>";
	html += "			Leave clear spacing around exponents and parenthesis marks.";
	html += "		</td>";
	html += "	</tr>";
	html += "";
	html += "</table>";
	html += "<br/>";
	html += "<h2>Does the calculator recognize YOUR input?</h2>";
	html += "Maybe the recognizer needs to improve? Or are you happy with the recognition of your writing? If so, tap one of the following items at the right of the Solution box.";
	html += "";
	html += "<ul>";
	html += "	<li>Tap the 'Y' mark to tell xThink, 'Good job at recognizing my handwritten math problem.'</li>";
	html += "	<li>";
	html += "		Tap the 'N' mark to tell xThink, 'Please teach the recognizer to recognize the way I have written this type of problem.'<br>";
	html += "		<strong>Note:</strong> To confirm your intention, the calculator prompts to you type the <strong><i>keyboard version</i></strong>";
	html += "		of the problem you wrote. Just type the <strong><i>original problem</i></strong> that you intended to solve. <strong><i>Do not</i></strong>";
	html += "		bother to provide the <strong><i>solution</i></strong> that you expected.";
	html += "	</li>";
	html += "</ul>";
	html += "";
	html += "<br>";
	html += "Your input goes to xThink developers to help improve the product. Thanks in advance for your help!<br>";
	html += "<br>";
	html += "<strong>&copy; Copyright 2004 - 2007, xThink Corporation. All rights reserved.</strong>";
	html += "You may use this software and documentation as stipulated in the Software License Agreement. You may not copy this document without";
	html += "prior written permission of xThink. You may make hardcopy or other reproductions of this document for your own use, but the copy must";
	html += "include an xThink copyright statement: <strong>(c) Copyright 2004 - 2007, xThink Corporation</strong>. No other rights under copyright";
	html += "are granted. The document is furnished 'as is' without warranty.";
	html += "<br>";
	html += "<input type='button' value='Close' onclick='helpDialog.hide()'/>";
	
	return html; 

}
