Some canges in the tutorial section
diff --git a/public/js/tutorialCookie.js b/public/js/tutorialCookie.js
new file mode 100644
index 0000000..0ae1b1d
--- /dev/null
+++ b/public/js/tutorialCookie.js
@@ -0,0 +1,46 @@
+function setTutorialPage(obj) {
+ var page = obj;
+ if (typeof page != 'string') {
+ page = window.location.pathname + window.location.search;
+ for (i = 1; i < 5; i++) {
+ if (obj.nodeName === 'SECTION') {
+ if (obj.hasAttribute('id'))
+ page += '#' + obj.getAttribute('id');
+ break;
+ }
+ else if (obj.nodeName === 'PRE' && obj.hasAttribute('id')) {
+ page += '#' + obj.getAttribute('id');
+ break;
+ }
+ else {
+ obj = obj.parentNode;
+ };
+ };
+ };
+ document.cookie = 'tutorial_page=' + page + '; path=/';
+};
+
+function getTutorialPage() {
+ var pc = 'tutorial_page';
+ var c_value = document.cookie;
+ console.log("Found cookie " + c_value);
+
+ var c_start = c_value.indexOf(" " + pc + "=");
+ if (c_start == -1)
+ c_start = c_value.indexOf(pc + "=");
+
+ if (c_start == -1) {
+ c_value = '/tutorial?embedded=1';
+ }
+ else {
+ c_start = c_value.indexOf("=", c_start) + 1;
+ var c_end = c_value.indexOf(";", c_start);
+
+ if (c_end == -1)
+ c_end = c_value.length;
+
+ c_value = unescape(c_value.substring(c_start,c_end));
+ };
+console.log("got tutpage " + c_value);
+ return c_value;
+};