[Annex]update Annex(tizen_2.1)
authorgs86.lee <gs86.lee@samsung.com>
Fri, 12 Apr 2013 06:29:04 +0000 (15:29 +0900)
committergs86.lee <gs86.lee@samsung.com>
Fri, 12 Apr 2013 06:38:38 +0000 (15:38 +0900)
Change-Id: I103389cee5a33df4ca21a5da0afcdfc5bcda6e87

LICENSE.Apache-2.0 [new file with mode: 0755]
NOTICE [new file with mode: 0755]
README.txt
_locales/en/messages.json
_locales/zh_CN/messages.json
config.xml
css/annex.css
css/i18n.css [new file with mode: 0755]
index.html
js/annex.js

diff --git a/LICENSE.Apache-2.0 b/LICENSE.Apache-2.0
new file mode 100755 (executable)
index 0000000..c720c61
--- /dev/null
@@ -0,0 +1,202 @@
+Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!) The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
diff --git a/NOTICE b/NOTICE
new file mode 100755 (executable)
index 0000000..79aca6c
--- /dev/null
+++ b/NOTICE
@@ -0,0 +1,4 @@
+Copyright (c) 2012, Intel Corporation.
+
+This program is licensed under the terms and conditions of the Apache License, version 2.0.
+The full text of the Apache License is at http://www.apache.org/licenses/LICENSE-2.0
index 0d2fbae..da6c20e 100755 (executable)
@@ -43,11 +43,3 @@ License: http://creativecommons.org/licenses/by/3.0/
 SettingsClick.ogg
 Origin: http://www.freesound.org/people/junggle/sounds/29301/
 License: http://creativecommons.org/licenses/by/3.0/
-
-LIBRARIES
------------------------------------------------------------------------------
-
-jQuery JavaScript Library v1.6.2
-Copyright 2011, John Resig
-Dual licensed under the MIT or GPL Version 2 licenses.
-http://jquery.org/license
index 66c0f80..0dc6879 100755 (executable)
@@ -3,6 +3,7 @@
         "message": "ABCDEFGHIJKLMNOPQRSTUVWXYZ",
         "description": "Single concatination of all alphabet characters, no spaces"
     },
+    "locale": {"message": "en"},
     "name": {"message": "Annex"},
     "description": {"message": "A Reversi/Othello game"},
        "license": {"message": "License"},
index 5dedf4c..a0b1c61 100755 (executable)
@@ -3,6 +3,7 @@
         "message": "ABCDEFGHIJKLMNOPQRSTUVWXYZ",
         "description": "除去空格之外的所有字符集合"
     },
+    "locale": {"message": "zh_CN"},
     "name": {"message": "Annex黑白棋"},
     "description": {"message": "一个黑白棋游戏"},
        "license": {"message": "授权"},
index 8e6dd64..09cbd40 100755 (executable)
@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets" id="https://github.com/01org/webapps-annex" version="1.0.0" viewmodes="fullscreen">
-       <icon src="annex-icon.png"/>
-       <content src="index.html"/>
-       <name>Annex</name>
-       <tizen:application id="33CFo0eFJe" required_version="1.0"/>
-       <tizen:setting screen-orientation="landscape" contextmenu="enable" />
+<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets" id="http://yourdomain/Annex" version="1.0.0" viewmodes="fullscreen">
+    <tizen:application id="33CFo0eFJe.Annex" package="33CFo0eFJe" required_version="2.1"/>
+    <content src="index.html"/>
+    <icon src="annex-icon.png"/>
+    <name>Annex</name>
+    <tizen:setting screen-orientation="landscape" context-menu="disable" background-support="enable" encryption="disable" install-location="auto"/>
 </widget>
index 983cc31..9a6ab82 100755 (executable)
 
 .open_title{
        position:absolute;
-       top:91px;
+       top:60px;
        left:157px;
 }
 
 .open_text{
        position:absolute;
-       bottom:95px;
+       bottom:70px;
        left:390px;
-       line-height:120%;
+       line-height:160%;
        font-family:default_font;
        font-size:32pt;
 }
 
 @font-face{
        font-family: default_font;
-       src: url('../fonts/JimNightshade-Regular.ttf'),
-            url('../fonts/wqy-microhei.ttc');
+       src: url('../fonts/JimNightshade-Regular.ttf');
 }
 
 .world {
@@ -473,6 +472,82 @@ body {
        -webkit-transform: translate(-50%, -50%);
 }
 
+#licensebtnl {
+    position: absolute;
+    width: 20px;
+    height: 20px;
+    text-align: center;
+    font: 16px standard;
+    line-height: 20px;
+    cursor: pointer;
+    -webkit-border-radius: 20px;
+    border: solid 1px #000000;
+    opacity: 0.3;
+    color: black;
+}
+
+#licensebtnl:hover {
+    opacity: 1.0;
+}
+
+#licensepage {
+    position: absolute;
+    width: 100%;
+    height: 100%;
+    background: -webkit-gradient(linear, left top, right top, from(#237745), to(#105a2d));
+}
+
+#licensetext {
+    width: 99%;
+    height: 88%;
+    background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #FFFFFF), color-stop(1, #b06228));
+    -webkit-border-radius: 12px;
+    border-radius: 12px;
+    box-shadow: inset 1px 1px 2px 1px black;
+    padding-left: 10px;
+    padding-bottom: 10px;
+    margin-bottom: 2px;
+    overflow: hidden;
+    cursor: move;
+}
+
+.licensebtn {
+    position: absolute;
+    color: #d7d7d7;
+    border: solid 1px #333;
+    text-align: center;
+    text-decoration: none;
+    font: 30px/100% Arial, Helvetica, sans-serif;
+    text-shadow: 0 1px 1px rgba(0,0,0,.3);
+    -webkit-border-radius: 12px;
+    border-radius: 12px;
+    background: -webkit-gradient(linear, left top, left bottom, from(#666), to(#000));
+    height: 52px;
+    line-height: 48px;
+    cursor: pointer;
+    box-shadow: 2px 2px 14px #000;
+}
+
+#licensescroll {
+    position: relative;
+    font: 25px/100% Arial, Helvetica, sans-serif;
+    text-align: center;
+}
+
+.licensebtn:hover {
+    background: -webkit-gradient(linear, left top, left bottom, from(#444), to(#000));
+}
+
+.licensebtn:active {
+    color: #666;
+    background: -webkit-gradient(linear, left top, left bottom, from(#000), to(#444));
+}
+
+#licensebtnq {
+    left: 412px;
+    width: 200px;
+}
+
 /* 800 x 480 */
 @media (orientation: landscape) {
   body { top: 50%; left: 50%; -webkit-transform: translate(-50%, -50%) scale(0.78125, 0.8); }
diff --git a/css/i18n.css b/css/i18n.css
new file mode 100755 (executable)
index 0000000..51f02b1
--- /dev/null
@@ -0,0 +1,5 @@
+@font-face{
+       font-family: default_font;
+       src: url('../fonts/JimNightshade-Regular.ttf'),
+            url('../fonts/wqy-microhei.ttc');
+}
\ No newline at end of file
index 0a1662b..a5b9904 100755 (executable)
     </script>
     <meta name="author" content="Xinchao He">
     <link rel="stylesheet" href="css/annex.css"/>
-    <link rel="stylesheet" type="text/css" href="css/license.css"></link>
-      <script src="js/license.js"></script>
-       <script type="text/javascript" src="lib/jquery-1.6.2.min.js"></script>
-       <script type="text/javascript" src="js/annex.js"></script>
 </head>
 <body onselectstart="return false" ondragstart="return false" style="overflow:hidden;">
-        <div id="licensepage" style="display: none">
-          <div id="licensetext"><div id="licensescroll"></div></div>
-          <div id="licensebtnq" class="licensebtn">Back</div>
-        </div>
+    <div id="licensepage" style="display: none">
+    </div>
        <div id="open" class="open" >
          <img class="open_title" src="images/opening_002_title.png" />
          <img id="open_text_bg_1" class="open_text_bg open_text_bg1 display_none" src="images/opening_003_rollover.png" />
           <div id="licensebtnl" style="top: 520px; left: 984px;"> i </div>
        </div>
        <div id="view" class="world display_none">
-         <div class="play1_lable"></div>
-         <div class="play1_score" id="black_result" align="center">0</div>
-         <div class="play1_pieces_lable"></div>
-         <div class="play2_lable"></div>
-         <div class="play2_score" id="white_result" align="center">0</div>
-         <div class="play2_pieces_lable"></div>
-         <div class="stone_selected"><img id="message" /><span id="turn"></span></div>
-         <div class="left_pieces" id="left_pieces"></div>
-         <div class="right_pieces" id="right_pieces"></div>
-         <a onClick="javascript:World.configure();" class="configure"><img src="images/game_006_settingsbtn.png" /></a>
-         <div class="configure_panel display_none">
-               <div class="configure_panel_func">
-                 <div class="configure_panel_startover">
-                       <div class="configure_panel_text"></div>
-                 </div>
-                 <div class="configure_panel_newgame">
-                       <div class="configure_panel_text"></div>
-                 </div>
-                 <div class="configure_panel_help">
-                       <div class="configure_panel_text"></div>
-                 </div>
-                 <div class="configure_panel_exit">
-                       <div class="configure_panel_text"></div>
-                 </div>
-               </div>
-               <img class="configure_panel_arrow" src="images/game_013_settingsarrow.png" />
-         </div>
-         <div id="board"></div>
-         <div id="result" class="result result_wood display_none">
-               <div class="result_win_text" align="center"></div>
-               <img class="result_new_p1_rollover display_none" src="images/winner_004_rollover.png" />
-               <img class="result_new_p2_rollover display_none" src="images/winner_004_rollover.png" />
-               <img class="result_exit_rollover display_none" src="images/winner_005_exitrollover.png" />
-               <a onClick="javascript:World.playSound('snd_navclick');World.init(1);"
-                  onMouseOver="$('img.result_new_p1_rollover').removeClass('display_none');World.playSound('snd_navmove');"
-                  onMouseOut="$('img.result_new_p1_rollover').addClass('display_none')"
-                  class="result_new_p1"></a>
-               <a onClick="javascript:World.playSound('snd_navclick');World.init(2);"
-                  onMouseOver="$('img.result_new_p2_rollover').removeClass('display_none');World.playSound('snd_navmove');"
-                  onMouseOut="$('img.result_new_p2_rollover').addClass('display_none')"
-                  class="result_new_p2"></a>
-               <a onClick="javascript:window.close();"
-                  onMouseOver="$('img.result_exit_rollover').removeClass('display_none');World.playSound('snd_navmove');"
-                  onMouseOut="$('img.result_exit_rollover').addClass('display_none')"
-                  class="result_exit"></a>
-               <div class="result_quit" onClick="javascript:World.closeResult();"></div>
-         </div>
        </div>
        <div id="help" class="help display_none">
-         <div class="help_text"  align="center">
-               <div class="help_title"></div>
-               <div class="help_contain"></div>
-         </div>
-         <img class="help_exit_img display_none" src="images/rules_002_rollover.png" />
-         <a onClick="javascript:World.exitHelp();"
-                onMouseOver="$('img.help_exit_img').removeClass('display_none');World.playSound('snd_navmove');"
-                onMouseOut="$('img.help_exit_img').addClass('display_none')"
-                class="help_exit"></a>
        </div>
-       <audio preload="auto" id="snd_hint">
-         <source src="sounds/Hint.ogg" />
-       </audio>
-       <audio preload="auto" id="snd_navclick">
-         <source src="sounds/NavClick.ogg" />
-       </audio>
-       <audio preload="auto" id="snd_navmove">
-         <source src="sounds/NavMove.ogg" />
-       </audio>
-       <audio preload="auto" id="snd_settingsclick">
-         <source src="sounds/SettingsClick.ogg" />
-       </audio>
-       <audio preload="auto" id="snd_theme">
-         <source src="sounds/Theme.ogg" />
-       </audio>
-       <audio preload="auto" id="snd_tileflip">
-         <source src="sounds/TileFlip.ogg" />
-       </audio>
-       <audio preload="auto" id="snd_tileplace">
-         <source src="sounds/TilePlace.ogg" />
-       </audio>
-       <audio preload="auto" id="snd_victoryhorns">
-         <source src="sounds/VictoryHorns.ogg" />
-       </audio>
+       <script type="text/javascript" src="js/annex.js"></script>
 </body>
 </html>
index 05dbd82..5d8aa36 100755 (executable)
  *
  */
 
+function queryObj(obj) {
+    this.q = obj;
+    this.isNull = this.q?false:true;
+    this.self = this;
+    this.html = function (val) {
+        this.q.innerHTML = val;
+        return this;
+    }
+
+    this.hasClass = function (c_name) {
+        if (this.isNull)
+            return false;
+        return this.q.classList.contains(c_name);
+    }
+
+    this.addClass = function (c_name) {
+        if (this.isNull)
+            return this;
+        var list = this.q.classList;
+        list.add (c_name);
+        return this;
+    }
+
+    this.removeClass = function (c_name) {
+        if (this.isNull)
+            return this;
+        var list = this.q.classList;
+        list.remove (c_name);
+        return this;
+    }
+
+    this.css = function (item, style) {
+        if (item == 'background-color')
+            item = 'backgroundColor';
+        if (this.isNull)
+            return this;
+        this.q.style[item] = style;
+        return this;
+    }
+
+    this.click = function (fun) {
+        if (this.isNull)
+            return this;
+        this.q.onclick = fun;
+        return this;
+    }
+
+    this.find = function (selector) {
+        if (this.isNull)
+            return this;
+        var obj = this.q.querySelector(selector);
+        return new queryObj(obj);
+    }
+
+    this.hover = function (onmouseover, onmouseout) {
+        if (this.isNull)
+            return this;
+        this.q.onmouseover = onmouseover;
+        this.q.onmouseout = onmouseout;
+        return this;
+    }
+
+    this.attr = function (attr, val) {
+        if (this.isNull)
+            return this;
+        this.q.setAttribute(attr, val);
+        return this;
+    }
+}
+
+function $(selector) {
+    var res;
+    if (typeof selector == "string") {
+        res = document.querySelector(selector);
+    } else {
+        res = selector;
+    }
+    return new queryObj(res);
+}
+
+$.merge = function (a, b) {
+    return a.concat(b);
+}
+
 var World = (function(){
-       var w = {
-               boardTexture:{board: 'images/game_014_board.png', black: 'images/game_002_blackpc.png', white: 'images/game_003_whitepc.png', leftPieces: 'images/game_004_pcleftside.png', rightPieces: 'images/game_005_pcrightside.png', hidePieces: 'images/game_015_pcside.png', p1Image: 'images/game_011_settings1p.png', p2Image: 'images/game_010_settings2p.png',},
-               board: [[],[],[],[],[],[],[],[],],
-               bounder: 8,
-               boardview: 'board',
-               blackResultView: 'black_result',
-               whiteResultView: 'white_result',
-               leftPiecesView: 'left_pieces',
-               rightPiecesView: 'right_pieces',
-               messageview: 'message',
-               result: 'result',
-               isEnd: false,
-               endMessage: '',
-               isUserTurn: true,
-               isDrawing: false,
-               isLock: false,
-               isInit: false,
-               isConfigure: false,
-               isResult: false,
-               level: 3,
-               playerNum: 1,
-               currentColor: 'black',
-               step: 4,
-               point: [],
-               directs: [[1,0],[1,1],[1,-1],[0,1],[0,-1],[-1,0],[-1,1],[-1,-1]],
-               heap: {'nextLevel':{}},
-               soundSource: {
-                       'snd_hint':{'src':'sounds/Hint.ogg'},
-                       'snd_navclick':{'src':'sounds/NavClick.ogg'},
-                       'snd_navmove':{ 'src':'sounds/NavMove.ogg'},
-                       'snd_settingsclick':{ 'src':'sounds/SettingsClick.ogg'},
-                       'snd_theme':{ 'src':'sounds/Theme.ogg'},
-                       'snd_tileflip':{ 'src':'sounds/TileFlip.ogg'},
-                       'snd_tileplace':{ 'src':'sounds/TilePlace.ogg'},
-                       'snd_victoryhorns':{ 'src':'sounds/VictoryHorns.ogg'},
-               },
-               init: function(play){
-                       this.playerNum = play || 1;
-                       for (var i in this.board){
-                               for (var j=0; j<this.bounder; j++){
-                                       this.board[i][j] =  'board';
-                               }
-                       }
-                       this.board[3][3] = 'black';
-                       this.board[4][4] = 'black';
-                       this.board[3][4] = 'white';
-                       this.board[4][3] = 'white';
-
-                       this.isUserTurn = true;
-                       this.isLock = false;
-                       this.isConfigure = false;
-                       this.isResult = false;
-                       this.currentColor = 'white';
-                       this.step = 4;
-                       this.level = 3;
-                       this.poing = [];
-                       this.heap = {'nextLevel':{}};
-                       var strLeft = '';
-                       var strRight = '';
-                       for (var i=0; i<32; i++) {
-                               strLeft += '<img src="'+this.boardTexture['leftPieces']+'" class="pieces" id="pc0'+i+'" />';
-                               strRight += '<img src="'+this.boardTexture['rightPieces']+'" class="pieces" id="pc1'+i+'" />';
-                       }
-                       $('#'+this.leftPiecesView).html(strLeft);
-                       $('#'+this.rightPiecesView).html(strRight);
-                       $('#pc00').attr('src', this.boardTexture['hidePieces']);
-                       $('#pc01').attr('src', this.boardTexture['hidePieces']);
-                       $('#pc10').attr('src', this.boardTexture['hidePieces']);
-                       $('#pc11').attr('src', this.boardTexture['hidePieces']);
-                       $('#'+this.result).addClass('display_none');
-                       $('div.configure_panel').addClass('display_none');
-                       var n = (this.playerNum == 1)?2:1;
-                       $('.configure_panel_newgame').removeClass('configure_panel_new'+this.playerNum+'game')
-                               .addClass('configure_panel_new'+n+'game').find('.configure_panel_text')
-                               .html(getMessage(n+'PlayerGame',n+' Player Game'));
-
-                       $('.play1_lable').html(getMessage('player', 'player')+'<span style="font-size:48pt;">1</span>');
-                       if (this.playerNum == 2) {
-                               $('.play2_lable').html(getMessage('player', 'player')+'<span style="font-size:48pt;">2</span>');
-                       } else {
-                               $('.play2_lable').html(getMessage('computer', 'comp.'));
-                       }
-                       this.isInit = true;
-                       $('#open').addClass('display_none');
-                       $('#view').removeClass('display_none');
-                       this.endConfigure();
-                       this.drawBoard();
-               },
-               configure: function(){
-                       if (!this.isLock || (this.isEnd && this.isLock && !this.isResult)) {
-                               this.playSound('snd_settingsclick');
-                               if (!this.isConfigure) {
-                                       this.isConfigure = true;
-                                       $('a.configure img').attr('src', 'images/game_007_settingsbtnrollover.png');
-                                       $('div.configure_panel').removeClass('display_none');
-                               } else {
-                                       this.endConfigure();
-                               }
-                       }
-               },
-               endConfigure: function(){
-                       this.isConfigure = false;
-                       $('div.configure_panel').addClass('display_none');
-                       $('a.configure img').attr('src', 'images/game_006_settingsbtn.png');
-               },
-               startOver: function(){
-                       this.playSound('snd_navclick');
-                       this.init(this.playerNum);
-                       this.endConfigure();
-               },
-               showHelp: function(){
-                       this.playSound('snd_navclick');
-                       this.endConfigure();
-                       $('#help').removeClass('display_none');
-               },
-               exitHelp: function(){
-                       this.playSound('snd_navclick');
-                       $('#help').addClass('display_none');
-               },
-               getSoundSource: function(snd){
-                       var ret;
-                       if (typeof this.soundSource[snd] != 'undefined' && typeof this.soundSource[snd]['audio'] != 'undefined') {
-                               var source = this.soundSource[snd];
-                               var p = parseInt(source['point']);
-                               var step = parseInt(source['audio'].length);
-                               ret = source['audio'][p];
-                               this.soundSource[snd]['point'] = (p+1)%step;
-                       } else {
-                               var src = this.soundSource[snd]['src'];
-                               ret = document.getElementById(snd);
-                               this.soundSource[snd]['audio'] = [ret, new Audio(src)];
-                               this.soundSource[snd]['point'] = 0;
-                       }
-                       return ret;
-               },
-               playSound: function(snd){
-                       var audio = this.getSoundSource(snd);
-                       if (audio.paused == false) {
-                               audio.pause();
-                               //audio.currentTime = 0;
-                       }
-                       audio.play();
-               },
-               actionAtPoint: function(place, color){
-                       var path = [];
-                       this.heap = this.heap['nextLevel'][String(place[0])+String(place[1])] || {};
-                       if (typeof this.heap['value'] != 'undefined' && this.heap['color'] == color){
-                               path = this.heap['path'];
-                       } else {
-                               var act = this.getRevertPath(place, color);
-                               path = act['path'];
-                               this.heap = {'color':color, 'path':path, 'place':place, 'nextLevel':{}};
-                       }
-                       this.clearTips();
-                       $('#pc'+this.step%2+Math.floor(this.step/2)).attr('src', this.boardTexture['hidePieces']);
-                       this.step += 1;
-                       if (this.step >= 50)
-                               this.level += 1;
-                       else if (this.setp >= 53)
-                               this.level += 1;
-                       else if (this.step >= 55)
-                               this.level += 2;
-                       this.playSound('snd_tileplace');
-                       this.setPoint(place, color);
-                       this.setBorder(place);
-                       this.drawPath(path, color);
-               },
-               setPoint: function(place, color){
-                       this.board[place[0]][place[1]] = color;
-                       this.drawPoint(place, color);
-               },
-               drawPoint: function(place, color){
-                       $('img#a'+place[0]+place[1]).attr('src', this.boardTexture[color]).removeClass('tip');
-                       $('a#l'+place[0]+place[1]).attr('onMouseOver','').attr('onMouseOut','');
-               },
-               drawPath: function(path, color){
-                       this.isDrawing = true;
-                       for (var n=0; n < path.length; n++){
-                               this.board[path[n][0]][path[n][1]] = color;
-                               var str = 'World.drawPoint(['+path[n][0]+','+path[n][1]+'],\''+color+'\')';
-                               setTimeout(str, 100*(n+1));
-                       }
-                       setTimeout('World.drawMessage()', 100*(path.length+1));
-               },
-               setBorder: function(place){
-                       if (this.point.length > 0){
-                               $('img#a'+this.point[0]+this.point[1]).removeClass('img_board_select');
-                               $('img#a'+this.point[0]+this.point[1]).addClass('img_board');
-                       }
-                       $('img#a'+place[0]+place[1]).removeClass('img_board');
-                       $('img#a'+place[0]+place[1]).addClass('img_board_select');
-                       this.point = place;
-               },
-               drawMessage: function(){
-                       var bc = 0;
-                       var wc = 0;
-                       if (typeof this.heap['value'] != 'undefined'){
-                               bc = parseInt(this.heap['black']);
-                               wc = parseInt(this.heap['white']);
-                       } else {
-                               var count = {black:0, white:0};
-                               for (var i=0; i<this.bounder; i++){
-                           for (var j=0; j<this.bounder; j++){
-                                               count[this.board[i][j]] += parseInt(1);
-                           }
-                       }
-                       bc = count['black'];
-                       wc = count['white'];
-               }
+    var w = {
+        boardTexture:{board: 'images/game_014_board.png', black: 'images/game_002_blackpc.png', white: 'images/game_003_whitepc.png', leftPieces: 'images/game_004_pcleftside.png', rightPieces: 'images/game_005_pcrightside.png', hidePieces: 'images/game_015_pcside.png', p1Image: 'images/game_011_settings1p.png', p2Image: 'images/game_010_settings2p.png',},
+        board: [[],[],[],[],[],[],[],[],],
+        bounder: 8,
+        boardview: 'board',
+        blackResultView: 'black_result',
+        whiteResultView: 'white_result',
+        leftPiecesView: 'left_pieces',
+        rightPiecesView: 'right_pieces',
+        messageview: 'message',
+        result: 'result',
+        isEnd: false,
+        endMessage: '',
+        isUserTurn: true,
+        isDrawing: false,
+        isLock: false,
+        isInit: false,
+        isConfigure: false,
+        isResult: false,
+        level: 3,
+        hasHelp: false,
+        hasInit: false,
+        hasLicense: false,
+        playerNum: 1,
+        currentColor: 'black',
+        step: 4,
+        point: [],
+        directs: [[1,0],[1,1],[1,-1],[0,1],[0,-1],[-1,0],[-1,1],[-1,-1]],
+        heap: {'nextLevel':{}},
+        soundSource: {
+            'snd_hint':{'src':'sounds/Hint.ogg'},
+            'snd_navclick':{'src':'sounds/NavClick.ogg'},
+            'snd_navmove':{ 'src':'sounds/NavMove.ogg'},
+            'snd_settingsclick':{ 'src':'sounds/SettingsClick.ogg'},
+            'snd_theme':{ 'src':'sounds/Theme.ogg'},
+            'snd_tileflip':{ 'src':'sounds/TileFlip.ogg'},
+            'snd_tileplace':{ 'src':'sounds/TilePlace.ogg'},
+            'snd_victoryhorns':{ 'src':'sounds/VictoryHorns.ogg'},
+        },
+        showWorld: function() {
+            if (!this.hasInit) {
+                $('#view').html('<div class="play1_lable"></div><div class="play1_score" id="black_result" align="center">0</div> <div class="play1_pieces_lable"></div> <div class="play2_lable"></div> <div class="play2_score" id="white_result" align="center">0</div> <div class="play2_pieces_lable"></div> <div class="stone_selected"><img id="message" /><span id="turn"></span></div> <div class="left_pieces" id="left_pieces"></div> <div class="right_pieces" id="right_pieces"></div> <a onClick="javascript:World.configure();" class="configure"><img src="images/game_006_settingsbtn.png" /></a> <div class="configure_panel display_none"> <div class="configure_panel_func"> <div class="configure_panel_startover"> <div class="configure_panel_text"></div> </div> <div class="configure_panel_newgame"> <div class="configure_panel_text"></div> </div> <div class="configure_panel_help"> <div class="configure_panel_text"></div> </div> <div class="configure_panel_exit"> <div class="configure_panel_text"></div> </div> </div> <img class="configure_panel_arrow" src="images/game_013_settingsarrow.png" /> </div> <div id="board"></div> <div id="result" class="result result_wood display_none"> <div class="result_win_text" align="center"></div> <img class="result_new_p1_rollover display_none" src="images/winner_004_rollover.png" /> <img class="result_new_p2_rollover display_none" src="images/winner_004_rollover.png" /> <img class="result_exit_rollover display_none" src="images/winner_005_exitrollover.png" /> <a onClick="javascript:World.playSound('+"'snd_navclick');World.init(1);"+'" onMouseOver="$('+"'img.result_new_p1_rollover').removeClass('display_none');World.playSound('snd_navmove');"+'" onMouseOut="$('+"'img.result_new_p1_rollover').addClass('display_none')"+'" class="result_new_p1"></a> <a onClick="javascript:World.playSound('+"'snd_navclick');World.init(2);"+'" onMouseOver="$('+"'img.result_new_p2_rollover').removeClass('display_none');World.playSound('snd_navmove');"+'" onMouseOut="$('+"'img.result_new_p2_rollover').addClass('display_none')"+'" class="result_new_p2"></a> <a onClick="javascript:window.close();" onMouseOver="$('+"'img.result_exit_rollover').removeClass('display_none');World.playSound('snd_navmove');"+'" onMouseOut="$('+"'img.result_exit_rollover').addClass('display_none')"+'" class="result_exit"></a> <div class="result_quit" onClick="javascript:World.closeResult();"></div> </div>');
+                $('.play1_pieces_lable').html(getMessage('pieces', 'pieces'));
+                $('.play2_pieces_lable').html(getMessage('pieces', 'pieces'));
+                $('#turn').html(getMessage('turn', "'s Turn"));
+                $('.result_new_p1').html(getMessage('newOneGame', 'New 1P Game'));
+                $('.result_new_p2').html(getMessage('newTwoGame', 'New 2P Game'));
+                $('.result_exit').html(getMessage('exit', 'Exit'));
+                //$('#license').html(getMessage('license', 'License'));
+                //$('#readme').html(getMessage('readme', 'Readme'));
+                $('.configure_panel_startover').click(function(){
+                    World.startOver();
+                }).hover(function(){
+                    $(this).css('background-color','#222222');
+                    World.playSound('snd_navmove');
+                },function(){
+                    $(this).css('background-color','#000000');
+                }).find('.configure_panel_text').html(getMessage('startover','Start over'));
+
+                $('.configure_panel_newgame').hover(function(evt){
+                    $(this).css('background-color','#222222');
+                    World.playSound('snd_navmove');
+                },function(evt){
+                    $(this).css('background-color','#000000');
+                }).click(function(){
+                    var n = 1;
+                    if ($(this).hasClass('configure_panel_new2game')){
+                        n = 2;
+                    }
+                    World.playSound('snd_navclick');
+                    World.init(n);
+                });
+
+                $('.configure_panel_help').click(function(){
+                    World.showHelp();
+                }).hover(function(){
+                    $(this).css('background-color','#222222');
+                    World.playSound('snd_navmove');
+                },function(){
+                    $(this).css('background-color','#000000');
+                }).find('.configure_panel_text').html(getMessage('rules','Rules'));
+
+                $('.configure_panel_exit').click(function(){
+                    window.close();
+                }).hover(function(){
+                    $(this).css('background-color','#222222');
+                    World.playSound('snd_navmove');
+                },function(){
+                    $(this).css('background-color','#000000');
+                }).find('.configure_panel_text').html(getMessage('exit','Exit'));
+                this.hasInit = true;
+            }
+        },
+        init: function(play){
+            this.showWorld();
+            this.playerNum = play || 1;
+            for (var i in this.board){
+                for (var j=0; j<this.bounder; j++){
+                    this.board[i][j] =  'board';
+                }
+            }
+            this.board[3][3] = 'black';
+            this.board[4][4] = 'black';
+            this.board[3][4] = 'white';
+            this.board[4][3] = 'white';
+
+            this.isUserTurn = true;
+            this.isLock = false;
+            this.isConfigure = false;
+            this.isResult = false;
+            this.currentColor = 'white';
+            this.step = 4;
+            this.level = 3;
+            this.poing = [];
+            this.heap = {'nextLevel':{}};
+            var strLeft = '';
+            var strRight = '';
+            for (var i=0; i<32; i++) {
+                strLeft += '<img src="'+this.boardTexture['leftPieces']+'" class="pieces" id="pc0'+i+'" />';
+                strRight += '<img src="'+this.boardTexture['rightPieces']+'" class="pieces" id="pc1'+i+'" />';
+            }
+            $('#'+this.leftPiecesView).html(strLeft);
+            $('#'+this.rightPiecesView).html(strRight);
+            $('#pc00').attr('src', this.boardTexture['hidePieces']);
+            $('#pc01').attr('src', this.boardTexture['hidePieces']);
+            $('#pc10').attr('src', this.boardTexture['hidePieces']);
+            $('#pc11').attr('src', this.boardTexture['hidePieces']);
+            $('#'+this.result).addClass('display_none');
+            $('div.configure_panel').addClass('display_none');
+            var n = (this.playerNum == 1)?2:1;
+            $('.configure_panel_newgame').removeClass('configure_panel_new'+this.playerNum+'game')
+                .addClass('configure_panel_new'+n+'game').find('.configure_panel_text')
+                .html(getMessage(n+'PlayerGame',n+' Player Game'));
+
+            $('.play1_lable').html(getMessage('player', 'player')+'<span style="font-size:48pt;">1</span>');
+            if (this.playerNum == 2) {
+                $('.play2_lable').html(getMessage('player', 'player')+'<span style="font-size:48pt;">2</span>');
+            } else {
+                $('.play2_lable').html(getMessage('computer', 'comp.'));
+            }
+            this.isInit = true;
+
+            document.getElementById('open').style.display="none";
+            document.getElementById('view').style.display="block";
+
+            this.endConfigure();
+            this.drawBoard();
+        },
+        configure: function(){
+            if (!this.isLock || (this.isEnd && this.isLock && !this.isResult)) {
+                this.playSound('snd_settingsclick');
+                if (!this.isConfigure) {
+                    this.isConfigure = true;
+                    $('a.configure img').attr('src', 'images/game_007_settingsbtnrollover.png');
+                    $('div.configure_panel').removeClass('display_none');
+                } else {
+                    this.endConfigure();
+                }
+            }
+        },
+        endConfigure: function(){
+            this.isConfigure = false;
+            $('div.configure_panel').addClass('display_none');
+            $('a.configure img').attr('src', 'images/game_006_settingsbtn.png');
+        },
+        startOver: function(){
+            this.playSound('snd_navclick');
+            this.init(this.playerNum);
+            this.endConfigure();
+        },
+        showHelp: function(){
+            this.playSound('snd_navclick');
+            this.endConfigure();
+            if (!this.hasHelp) {
+                this.hasHelp = true;
+                $('#help').html('<div class="help_text"  align="center"> <div class="help_title"></div> <div class="help_contain"></div> </div> <img class="help_exit_img display_none" src="images/rules_002_rollover.png" /> <a onClick="javascript:World.exitHelp();" onMouseOver="$('+"'img.help_exit_img').removeClass('display_none');World.playSound('snd_navmove');"+'" onMouseOut="$('+"'img.help_exit_img').addClass('display_none')"+'" class="help_exit"></a>');
+                $('.help_title').html(getMessage('howtoPlay', 'How to Play'));
+                $('.help_contain').html(getMessage('help', "Play a piece on the board so that one or more of your opponent’s pieces are between two of your pieces. All of the opponent’s pieces between your own turn over and become your color.<br>The player with the most pieces on the board at the end of the game wins!"));
+                $('.help_exit').html(getMessage('goBack', 'Go Back'));
+            }
+            $('#help').removeClass('display_none');
+        },
+        exitHelp: function(){
+            this.playSound('snd_navclick');
+            $('#help').addClass('display_none');
+        },
+        getSoundSource: function(snd){
+            var ret;
+            if (typeof this.soundSource[snd] != 'undefined' && typeof this.soundSource[snd]['audio'] != 'undefined') {
+                var source = this.soundSource[snd];
+                ret = source['audio'];
+            } else {
+                var src = this.soundSource[snd]['src'];
+                ret = new Audio(src);
+                this.soundSource[snd]['audio'] = ret;
+            }
+            return ret;
+        },
+        playSound: function(snd){
+            var audio = this.getSoundSource(snd);
+            if (audio.paused == false) {
+                audio.pause();
+                //audio.currentTime = 0;
+            }
+            audio.play();
+        },
+        actionAtPoint: function(place, color){
+            var path = [];
+            this.heap = this.heap['nextLevel'][String(place[0])+String(place[1])] || {};
+            if (typeof this.heap['value'] != 'undefined' && this.heap['color'] == color){
+                path = this.heap['path'];
+            } else {
+                var act = this.getRevertPath(place, color);
+                path = act['path'];
+                this.heap = {'color':color, 'path':path, 'place':place, 'nextLevel':{}};
+            }
+            this.clearTips();
+            $('#pc'+this.step%2+Math.floor(this.step/2)).attr('src', this.boardTexture['hidePieces']);
+            this.step += 1;
+            if (this.step >= 50)
+                this.level += 1;
+            else if (this.setp >= 53)
+                this.level += 1;
+            else if (this.step >= 55)
+                this.level += 2;
+            this.playSound('snd_tileplace');
+            this.setPoint(place, color);
+            this.setBorder(place);
+            this.drawPath(path, color);
+        },
+        setPoint: function(place, color){
+            this.board[place[0]][place[1]] = color;
+            this.drawPoint(place, color);
+        },
+        drawPoint: function(place, color){
+            $('img#a'+place[0]+place[1]).attr('src', this.boardTexture[color]).removeClass('tip');
+            $('a#l'+place[0]+place[1]).attr('onMouseOver','').attr('onMouseOut','');
+        },
+        drawPath: function(path, color){
+            this.isDrawing = true;
+            for (var n=0; n < path.length; n++){
+                this.board[path[n][0]][path[n][1]] = color;
+                var str = 'World.drawPoint(['+path[n][0]+','+path[n][1]+'],\''+color+'\')';
+                setTimeout(str, 100*(n+1));
+            }
+            setTimeout('World.drawMessage()', 100*(path.length+1));
+        },
+        setBorder: function(place){
+            if (this.point.length > 0){
+                $('img#a'+this.point[0]+this.point[1]).removeClass('img_board_select');
+                $('img#a'+this.point[0]+this.point[1]).addClass('img_board');
+            }
+            $('img#a'+place[0]+place[1]).removeClass('img_board');
+            $('img#a'+place[0]+place[1]).addClass('img_board_select');
+            this.point = place;
+        },
+        drawMessage: function(){
+            var bc = 0;
+            var wc = 0;
+            if (typeof this.heap['value'] != 'undefined'){
+                bc = parseInt(this.heap['black']);
+                wc = parseInt(this.heap['white']);
+            } else {
+                var count = {black:0, white:0};
+                for (var i=0; i<this.bounder; i++){
+                    for (var j=0; j<this.bounder; j++){
+                        count[this.board[i][j]] += parseInt(1);
+                    }
+                }
+                bc = count['black'];
+                wc = count['white'];
+            }
             $('#'+this.blackResultView).html(bc);
-                       $('#'+this.whiteResultView).html(wc);
-
-                       var bpossible;
-                       var wpossible;
-
-                       if (typeof this.heap['value'] != 'undefined' && this.heap['color'] == this.currentColor){
-                               if (this.heap['color'] == 'white') {
-                                       bpossible = this.heap['upossible'];
-                                       wpossible = this.heap['cpossible'];
-                               } else {
-                                       wpossible = this.heap['upossible'];
-                                       bpossible = this.heap['cpossible'];
-                               }
-                       } else {
-                               wpossible = this.possiblePlace('white');
-                               bpossible = this.possiblePlace('black');
-                       }
-                       this.isEnd = ((bpossible.length == 0 && wpossible.length == 0) || (this.step == 64));
-               if (!this.isEnd) {
-                               var tpossible = bpossible;
-                               if (this.currentColor == 'black') {
-                                       if (wpossible.length > 0) {
-                                               this.currentColor = 'white';
-                                               tpossible = wpossible;
-                                       }
-                               } else {
-                                       if (bpossible.length > 0) {
-                                               this.currentColor = 'black';
-                                       } else {
-                                               tpossilbe = wpossible;
-                                       }
-                               }
+            $('#'+this.whiteResultView).html(wc);
+
+            var bpossible;
+            var wpossible;
+
+            if (typeof this.heap['value'] != 'undefined' && this.heap['color'] == this.currentColor){
+                if (this.heap['color'] == 'white') {
+                    bpossible = this.heap['upossible'];
+                    wpossible = this.heap['cpossible'];
+                } else {
+                    wpossible = this.heap['upossible'];
+                    bpossible = this.heap['cpossible'];
+                }
+            } else {
+                wpossible = this.possiblePlace('white');
+                bpossible = this.possiblePlace('black');
+            }
+            this.isEnd = ((bpossible.length == 0 && wpossible.length == 0) || (this.step == 64));
+            if (!this.isEnd) {
+                var tpossible = bpossible;
+                if (this.currentColor == 'black') {
+                    if (wpossible.length > 0) {
+                        this.currentColor = 'white';
+                        tpossible = wpossible;
+                    }
+                } else {
+                    if (bpossible.length > 0) {
+                        this.currentColor = 'black';
+                    } else {
+                        tpossilbe = wpossible;
+                    }
+                }
                 $('#'+this.messageview).attr('src', this.boardTexture[this.currentColor]);
-                               this.possible = tpossible;
-                               this.setTips(this.currentColor);
-                               if (this.playerNum == 1 && this.currentColor == 'white') {
-                                       this.isUserTurn = false;
-                                       this.computerTurn();
-                               } else {
-                                       this.isUserTurn = true;
-                               }
-               } else {
-                               var p = getMessage('player', 'player');
-                               var w = getMessage('win', 'Wins');
-                               if (bc > wc) {
-                                       $('.result_win_text').html(p+' 1 '+w+'!');
-                               } else if (bc == wc) {
-                                       $('.result_win_text').html(getMessage('winDraw', 'Draw!'));
-                               } else {
-                                       if (this.playerNum == 2) {
-                                               $('.result_win_text').html(p+' 2 '+w+'!');
-                                       } else {
-                                               $('.result_win_text').html(getMessage('winComputer', 'Computer Wins!'));
-                                       }
-                               }
-                               this.playSound('snd_victoryhorns');
-                               $('#'+this.result).removeClass('display_none');
-                               this.isLock = true;
-                               this.isResult = true;
-               }
+                this.possible = tpossible;
+                this.setTips(this.currentColor);
+                if (this.playerNum == 1 && this.currentColor == 'white') {
+                    this.isUserTurn = false;
+                    this.computerTurn();
+                } else {
+                    this.isUserTurn = true;
+                }
+            } else {
+                var p = getMessage('player', 'player');
+                var w = getMessage('win', 'Wins');
+                if (bc > wc) {
+                    $('.result_win_text').html(p+' 1 '+w+'!');
+                } else if (bc == wc) {
+                    $('.result_win_text').html(getMessage('winDraw', 'Draw!'));
+                } else {
+                    if (this.playerNum == 2) {
+                        $('.result_win_text').html(p+' 2 '+w+'!');
+                    } else {
+                        $('.result_win_text').html(getMessage('winComputer', 'Computer Wins!'));
+                    }
+                }
+                this.playSound('snd_victoryhorns');
+                $('#'+this.result).removeClass('display_none');
+                this.isLock = true;
+                this.isResult = true;
+            }
             this.isDrawing = false;
-               },
-               closeResult: function() {
-                       $('#'+this.result).addClass('display_none');
-                       this.isResult = false;
-               },
-               setTips: function(color) {
-                       var stone = this.boardTexture[color];
-                       var spare = this.boardTexture['board'];
-                       for (var n in this.possible) {
-                               var p = this.possible[n];
-                               if (this.board[p[0]][p[1]] == 'board') {
-                                       var id = 'l'+p[0]+p[1];
-                                       $('#'+id).attr('onMouseOver',"$('#"+id+" img').attr('src','"+stone+"').addClass('tip');")
-                                               .attr('onMouseOut',"$('#"+id+" img').attr('src','"+spare+"').removeClass('tip');");
-                               }
-                       }
-               },
-               clearTips: function() {
-                       var possible = this.possible;
-                       for (var n in possible) {
-                               var p = possible[n];
-                               var spare = this.boardTexture[this.board[p[0]][p[1]]];
-                               var id = 'l'+p[0]+p[1];
-                               $('#'+id).attr('onMouseOver','').attr('onMouseOut','').find('img').attr('src', spare).removeClass('tip');
-                       }
-               },
-               drawBoard: function(){
-
-                       var str = '';
-                       for (var i=0; i<this.bounder; i++){
-                               str += '<div>';
-                   for (var j=0; j<this.bounder; j++){
-                                       str += '<span><a onClick="javascript:World.click('+i+','+j+');" id="l'+i+j+'" class="img_style" onMouseOver="" onMouseOut="" ><img src="'+this.boardTexture[this.board[i][j]]+'" id="a'+i+j+'" class="img_board" /></a></span>';
-                   }
-                               str += '</div>';
-               }
-                       $('#'+this.boardview).html(str);
-                       this.drawMessage();
-               },
-
-               click: function(i, j){
-                       if (this.board[i][j] === 'board' && !this.isEnd && this.isUserTurn && !this.isDrawing && !this.isLock && !this.isConfigure) {
-                               if (this.canRevert([i, j], this.currentColor)){
-                                       this.actionAtPoint([i,j], this.currentColor);
-                                       if (this.playerNum == 1) this.isUserTurn = false;
-                               } else {
-                                       this.playSound('snd_hint');
-                               }
-                       } else if ((this.isConfigure && !this.isEnd && !this.isDrawing && !this.isLock)
-                                          || (this.isConfigure && this.isEnd && !this.isDrawing && this.isLock && !this.isResult)) {
-                               this.endConfigure();
-                       }
-               },
-               computerTurn: function(){
-                       if (this.isDrawing) {
-                               setTimeout('World.computerTurn()', 500);
-                               return;
-                       }
-                       var possible;
-
-                       if (typeof this.heap['value'] != 'undefined'){
-                               if (this.heap['color'] == 'white') {
-                                       possible = this.heap['cpossible'];
-                               } else {
-                                       possible = this.heap['upossible'];
-                               }
-                       } else {
-                               possible = this.possiblePlace('white');
-                       }
-                       var place = this.bestPlace(possible);
-                       if (possible.length > 0 && place.length > 0) {
-                               this.actionAtPoint(place, 'white');
-                       }
-               },
-
-               isContain: function(place, _array) {
-                       var heat = _array || [];
-                       for (var i in heat){
-                               if (heat[i][0] == place[0] && heat[i][1] == place[1]) {
-                                       return true;
-                               }
-                       }
-                       return false;
-
-               },
-               possiblePlace: function(color, _board){
-                       var ret = [];
-                       var tmp = {};
-                       var revColor = ((color == 'white')?'black':'white');
-                       var board = _board || this.board;
-                       for (var i=0; i<this.bounder; i++){
+        },
+        closeResult: function() {
+            $('#'+this.result).addClass('display_none');
+            this.isResult = false;
+        },
+        setTips: function(color) {
+            var stone = this.boardTexture[color];
+            var spare = this.boardTexture['board'];
+            for (var n in this.possible) {
+                var p = this.possible[n];
+                if (this.board[p[0]][p[1]] == 'board') {
+                    var id = 'l'+p[0]+p[1];
+                    $('#'+id).attr('onMouseOver',"$('#"+id+" img').attr('src','"+stone+"').addClass('tip');")
+                        .attr('onMouseOut',"$('#"+id+" img').attr('src','"+spare+"').removeClass('tip');");
+                }
+            }
+        },
+        clearTips: function() {
+            var possible = this.possible;
+            for (var n in possible) {
+                var p = possible[n];
+                var spare = this.boardTexture[this.board[p[0]][p[1]]];
+                var id = 'l'+p[0]+p[1];
+                $('#'+id).attr('onMouseOver','').attr('onMouseOut','').find('img').attr('src', spare).removeClass('tip');
+            }
+        },
+        drawBoard: function(){
+
+            var str = '';
+            for (var i=0; i<this.bounder; i++){
+                str += '<div>';
+                for (var j=0; j<this.bounder; j++){
+                    str += '<span><a onClick="javascript:World.click('+i+','+j+');" id="l'+i+j+'" class="img_style" onMouseOver="" onMouseOut="" ><img src="'+this.boardTexture[this.board[i][j]]+'" id="a'+i+j+'" class="img_board" /></a></span>';
+                }
+                str += '</div>';
+            }
+            $('#'+this.boardview).html(str);
+            this.drawMessage();
+        },
+
+        click: function(i, j){
+            if (this.board[i][j] === 'board' && !this.isEnd && this.isUserTurn && !this.isDrawing && !this.isLock && !this.isConfigure) {
+                if (this.canRevert([i, j], this.currentColor)){
+                    this.actionAtPoint([i,j], this.currentColor);
+                    if (this.playerNum == 1) this.isUserTurn = false;
+                } else {
+                    this.playSound('snd_hint');
+                }
+            } else if ((this.isConfigure && !this.isEnd && !this.isDrawing && !this.isLock)
+                       || (this.isConfigure && this.isEnd && !this.isDrawing && this.isLock && !this.isResult)) {
+                this.endConfigure();
+            }
+        },
+        computerTurn: function(){
+            if (this.isDrawing) {
+                setTimeout('World.computerTurn()', 500);
+                return;
+            }
+            var possible;
+
+            if (typeof this.heap['value'] != 'undefined'){
+                if (this.heap['color'] == 'white') {
+                    possible = this.heap['cpossible'];
+                } else {
+                    possible = this.heap['upossible'];
+                }
+            } else {
+                possible = this.possiblePlace('white');
+            }
+            var place = this.bestPlace(possible);
+            if (possible.length > 0 && place.length > 0) {
+                this.actionAtPoint(place, 'white');
+            }
+        },
+
+        isContain: function(place, _array) {
+            var heat = _array || [];
+            for (var i in heat){
+                if (heat[i][0] == place[0] && heat[i][1] == place[1]) {
+                    return true;
+                }
+            }
+            return false;
+
+        },
+        possiblePlace: function(color, _board){
+            var ret = [];
+            var tmp = {};
+            var revColor = ((color == 'white')?'black':'white');
+            var board = _board || this.board;
+            for (var i=0; i<this.bounder; i++){
                 for (var j=0; j<this.bounder; j++){
                     if (board[i][j] === revColor) {
-                                               for (var n in this.directs) {
-                                                       var ni = i+parseInt(this.directs[n][0]);
-                                                       var nj = j+parseInt(this.directs[n][1]);
-                                                       if (ni >= 0 && ni < this.bounder && nj >= 0 && nj < this.bounder && board[ni][nj] === 'board'){
-                                                               if (this.canRevert([ni, nj], color, board) && !this.isContain([ni, nj], ret)){
-                                                                       ret.push([parseInt(ni), parseInt(nj)]);
-                                                               }
-                                                       }
-                                               }
-                                       }
+                        for (var n in this.directs) {
+                            var ni = i+parseInt(this.directs[n][0]);
+                            var nj = j+parseInt(this.directs[n][1]);
+                            if (ni >= 0 && ni < this.bounder && nj >= 0 && nj < this.bounder && board[ni][nj] === 'board'){
+                                if (this.canRevert([ni, nj], color, board) && !this.isContain([ni, nj], ret)){
+                                    ret.push([parseInt(ni), parseInt(nj)]);
+                                }
+                            }
+                        }
+                    }
                 }
             }
 
-                       return ret;
-               },
-               canRevert: function(place, color, _board){
-                       var i = parseInt(place[0]);
-                       var j = parseInt(place[1]);
-                       var revColor = ((color == 'white')?'black':'white');
-                       var board = _board || this.board;
-                       for (var n in this.directs) {
-                               var di = parseInt(this.directs[n][0]);
-                               var dj = parseInt(this.directs[n][1]);
+            return ret;
+        },
+        canRevert: function(place, color, _board){
+            var i = parseInt(place[0]);
+            var j = parseInt(place[1]);
+            var revColor = ((color == 'white')?'black':'white');
+            var board = _board || this.board;
+            for (var n in this.directs) {
+                var di = parseInt(this.directs[n][0]);
+                var dj = parseInt(this.directs[n][1]);
                 var ni = i+di;
                 var nj = j+dj;
                 while (ni >= 0 && ni < this.bounder && nj >= 0 && nj < this.bounder && board[ni][nj] === revColor){
-                                       ni += di;
-                                       nj += dj;
-                                       if (ni >= 0 && ni < this.bounder && nj >= 0 && nj < this.bounder && board[ni][nj] === color) {
-                                               return true;
-                                       }
+                    ni += di;
+                    nj += dj;
+                    if (ni >= 0 && ni < this.bounder && nj >= 0 && nj < this.bounder && board[ni][nj] === color) {
+                        return true;
+                    }
+                }
+            }
+            return false;
+        },
+        getClone: function(obj){
+            var ret = [[],[],[],[],[],[],[],[]];
+
+            for(var i = 0; i < this.bounder; i++) {
+                for(var j = 0; j < this.bounder; j++) {
+                    ret[i][j] = obj[i][j];
                 }
             }
-                       return false;
-               },
-               getClone: function(obj){
-                       var ret = [[],[],[],[],[],[],[],[]];
-
-                       for(var i = 0; i < this.bounder; i++) {
-                               for(var j = 0; j < this.bounder; j++) {
-                                       ret[i][j] = obj[i][j];
-                               }
-                       }
-                       return ret;
-               },
-
-               getRevertPath: function(place, color, _board){
-                       var i = parseInt(place[0]);
+            return ret;
+        },
+
+        getRevertPath: function(place, color, _board){
+            var i = parseInt(place[0]);
             var j = parseInt(place[1]);
             var revColor = ((color == 'white')?'black':'white');
             var board = _board || this.board;
             var path = [];
-                       for (var n in this.directs) {
+            for (var n in this.directs) {
                 var ni = i+parseInt(this.directs[n][0]);
                 var nj = j+parseInt(this.directs[n][1]);
                 var tpath = [];
                 while (ni >= 0 && ni < this.bounder && nj >= 0 && nj < this.bounder && board[ni][nj] === revColor){
-                                       tpath.push([ni, nj]);
+                    tpath.push([ni, nj]);
                     ni += parseInt(this.directs[n][0]);
                     nj += parseInt(this.directs[n][1]);
                     if (ni >= 0 && ni < this.bounder && nj >= 0 && nj < this.bounder && board[ni][nj] === color) {
-                                               path = $.merge(path, tpath);
+                        path = $.merge(path, tpath);
                     }
                 }
             }
             return {place: place, path: path, color: color,};
-               },
+        },
 
-               doRevert: function(action, _board){
-                       var color = action['color'];
+        doRevert: function(action, _board){
+            var color = action['color'];
             var board = _board || this.board;
-                       var path = action['path'];
-                       for (var p in path){
-                               board[path[p][0]][path[p][1]] = color;
-                       }
+            var path = action['path'];
+            for (var p in path){
+                board[path[p][0]][path[p][1]] = color;
+            }
             return board;
-               },
-               getValue: function(place, _board){
-                       var ret = 0;
+        },
+        getValue: function(place, _board){
+            var ret = 0;
             var board = _board || this.board;
             var i = parseInt(place[0]);
             var j = parseInt(place[1]);
             var mtable = {
-                   0:{ 0:100, 1:-50, 2:40, 3:30, 4:30, 5:40, 6:-50, 7:100,},
-                   1:{ 0:-50, 1:-30, 2:5,  3:1,  4:1,  5:5,  6:-30, 7:-50,},
-                   2:{ 0:40,  1:5,   2:20, 3:10, 4:10, 5:20, 6:5,   7:40,},
-                   3:{ 0:30,  1:1,   2:10, 3:0,  4:0,  5:10, 6:1,   7:30,},
-                   4:{ 0:30,  1:1,   2:10, 3:0,  4:0,  5:10, 6:1,   7:30,},
-                   5:{ 0:40,  1:5,   2:20, 3:10, 4:10, 5:20, 6:5,   7:40,},
-                   6:{ 0:-50, 1:-30, 2:5,  3:1,  4:1,  5:5,  6:-30, 7:-50,},
-                   7:{ 0:100, 1:-50, 2:40, 3:30, 4:30, 5:40, 6:-50, 7:100,},
+            0:{ 0:100, 1:-50, 2:40, 3:30, 4:30, 5:40, 6:-50, 7:100,},
+            1:{ 0:-50, 1:-30, 2:5,  3:1,  4:1,  5:5,  6:-30, 7:-50,},
+            2:{ 0:40,  1:5,   2:20, 3:10, 4:10, 5:20, 6:5,   7:40,},
+            3:{ 0:30,  1:1,   2:10, 3:0,  4:0,  5:10, 6:1,   7:30,},
+            4:{ 0:30,  1:1,   2:10, 3:0,  4:0,  5:10, 6:1,   7:30,},
+            5:{ 0:40,  1:5,   2:20, 3:10, 4:10, 5:20, 6:5,   7:40,},
+            6:{ 0:-50, 1:-30, 2:5,  3:1,  4:1,  5:5,  6:-30, 7:-50,},
+            7:{ 0:100, 1:-50, 2:40, 3:30, 4:30, 5:40, 6:-50, 7:100,},
             };
-                       return parseInt(mtable[i][j]);
-               },
-               evaluate: function(place, _color, _board, _level, _heap){
-                       var ret = -100000;
-                       var level = _level || this.level;
-                       var heap = _heap || this.heap;
-                       if (typeof heap['nextLevel'][String(place[0])+String(place[1])] == 'undefined'){
-                               heap['nextLevel'][String(place[0])+String(place[1])] = {};
-                       }
-                       heap = heap['nextLevel'][String(place[0])+String(place[1])];
-                       level = parseInt(level);
-                       var toEndLevel = 64-parseInt(this.step);
-                       level = (level>toEndLevel?toEndLevel:level);
-                       var nextValue = 0;
+            return parseInt(mtable[i][j]);
+        },
+        evaluate: function(place, _color, _board, _level, _heap){
+            var ret = -100000;
+            var level = _level || this.level;
+            var heap = _heap || this.heap;
+            if (typeof heap['nextLevel'][String(place[0])+String(place[1])] == 'undefined'){
+                heap['nextLevel'][String(place[0])+String(place[1])] = {};
+            }
+            heap = heap['nextLevel'][String(place[0])+String(place[1])];
+            level = parseInt(level);
+            var toEndLevel = 64-parseInt(this.step);
+            level = (level>toEndLevel?toEndLevel:level);
+            var nextValue = 0;
 /*
-                       var i = parseInt(place[0]);
+            var i = parseInt(place[0]);
             var j = parseInt(place[1]);*/
 
             var color = _color || 'white';
@@ -494,189 +641,248 @@ var World = (function(){
             var cp;
             var up;
             if (typeof heap['value'] != 'undefined'){
-                   path = heap['path'];
-                   ret = heap['value'];
-                   cp = heap['cpossible'];
-                   up = heap['upossible'];
-                   board = this.doRevert(heap, board);
+            path = heap['path'];
+            ret = heap['value'];
+            cp = heap['cpossible'];
+            up = heap['upossible'];
+            board = this.doRevert(heap, board);
             } else {
-                   var act = this.getRevertPath(place, color, board);
-                   heap['path'] = act['path'];
-                   heap['color'] = color;
-                   heap['place'] = place;
-                   board = this.doRevert(heap, board);
-                   cp = this.possiblePlace(color, board);
-                   up = this.possiblePlace(revColor, board);
-
-                   var cv = 0;
-                   var uv = 0;
-                   var cc = 0;
-                   var uc = 0;
-
-                   for (var i=0; i<this.bounder; i++){
-                       for (var j=0; j<this.bounder; j++){
-                           if (board[i][j] === color) {
-                                                       cv += this.getValue([i, j], board);
-                                                       cc++;
-                                               } else if (board[i][j] === revColor){
-                                                       uv += this.getValue([i, j], board);
-                                                       uc++;
-                                               }
-                       }
-                   }
-
-                               ret = (cp.length-up.length)*10;
-                               ret += (cv-uv)*2;
-                               if (up.length == 0 && cp.length > 0) ret = 100000;
-                   heap['value'] = ret;
-                   heap['nextLevel'] = {};
-                   heap['cpossible'] = cp;
-                   heap['upossible'] = up;
-                   heap[color] = cc;
-                   heap[revColor] = uc;
+            var act = this.getRevertPath(place, color, board);
+                heap['path'] = act['path'];
+                heap['color'] = color;
+                heap['place'] = place;
+            board = this.doRevert(heap, board);
+                cp = this.possiblePlace(color, board);
+                up = this.possiblePlace(revColor, board);
+
+                var cv = 0;
+                var uv = 0;
+                var cc = 0;
+                var uc = 0;
+
+                for (var i=0; i<this.bounder; i++){
+                    for (var j=0; j<this.bounder; j++){
+                        if (board[i][j] === color) {
+                            cv += this.getValue([i, j], board);
+                            cc++;
+                        } else if (board[i][j] === revColor){
+                            uv += this.getValue([i, j], board);
+                            uc++;
+                        }
+                    }
+                }
+
+                ret = (cp.length-up.length)*10;
+                ret += (cv-uv)*2;
+                if (up.length == 0 && cp.length > 0) ret = 100000;
+                heap['value'] = ret;
+                heap['nextLevel'] = {};
+                heap['cpossible'] = cp;
+                heap['upossible'] = up;
+                heap[color] = cc;
+                heap[revColor] = uc;
             }
 
             if (level > 1 && (up.length > 0 || cp.length > 0)){
-                   if (up.length == 0){
-                           up = cp;
-                           revColor = color;
-                   }
-                   up = this.getBestPlaceSet(up);
-                   for (var p in up) {
-                           nextValue += this.evaluate(up[p], revColor, board, level-1, heap);
-                   }
-                   if (up.length > 0){
-                           nextValue = nextValue/up.length;
-                           ret = Math.round(ret*0.5+nextValue*0.5);
-                   }
-            }
-
-                       return ret*sym;
-               },
-               getBestPlaceSet: function(possible){
-                       var best = [];
-                       var middle = [];
-                       var ret = [];
-                       for (var i in possible){
-                               var t = this.getValue(possible[i]);
-                               if (t == 100) {
-                                       best.push(possible[i]);
-                               } else if (t >= 0) {
-                                       middle.push(possible[i]);
-                               }
-                       }
-
-                       if (best.length > 0){
-                               ret = best;
-                       } else if (middle.length > 0){
-                               ret = middle;
-                       } else {
-                               ret = possible;
-                       }
-                       return ret;
-               },
-               bestPlace: function(possible){
-                       if (possible.length == 0)
-                               console.log('Error: No possible places?!!!');
-                       possible = this.getBestPlaceSet(possible);
-
-                       var ret = [];
-                       if (possible.length > 0) {
-                               ret = possible[0];
-                               var value = this.evaluate(ret);
-                               for (var p=1; p<possible.length; p++) {
-                                       var v = this.evaluate(possible[p]);
-                                       if (v > value){
-                                               value = v;
-                                               ret = possible[p];
-                                       }
-                               }
-                       } else {
-                               console.log('Error: No Setting place for Computer');
-                       }
-                       return ret;
-               },
-       };
-       return w;
+            if (up.length == 0){
+                up = cp;
+                revColor = color;
+            }
+            up = this.getBestPlaceSet(up);
+            for (var p in up) {
+                nextValue += this.evaluate(up[p], revColor, board, level-1, heap);
+            }
+            if (up.length > 0){
+                nextValue = nextValue/up.length;
+                ret = Math.round(ret*0.5+nextValue*0.5);
+            }
+            }
+
+            return ret*sym;
+        },
+        getBestPlaceSet: function(possible){
+            var best = [];
+            var middle = [];
+            var ret = [];
+            for (var i in possible){
+                var t = this.getValue(possible[i]);
+                if (t == 100) {
+                    best.push(possible[i]);
+                } else if (t >= 0) {
+                    middle.push(possible[i]);
+                }
+            }
+
+            if (best.length > 0){
+                ret = best;
+            } else if (middle.length > 0){
+                ret = middle;
+            } else {
+                ret = possible;
+            }
+            return ret;
+        },
+        bestPlace: function(possible){
+            if (possible.length == 0)
+                console.log('Error: No possible places?!!!');
+            possible = this.getBestPlaceSet(possible);
+
+            var ret = [];
+            if (possible.length > 0) {
+                ret = possible[0];
+                var value = this.evaluate(ret);
+                for (var p=1; p<possible.length; p++) {
+                    var v = this.evaluate(possible[p]);
+                    if (v > value){
+                        value = v;
+                        ret = possible[p];
+                    }
+                }
+            } else {
+                console.log('Error: No Setting place for Computer');
+            }
+            return ret;
+        },
+        showLicense: function(id, hpageid) {
+            var lbtn = document.getElementById(id+"btnl");
+
+            var lpage = document.getElementById(id+"page");
+            var hpage = document.getElementById(hpageid);
+            var ltext;
+            var lscroll;
+            var timer;
+
+            if (!this.hasLicense) {
+                $('#licensepage').html('<div id="licensetext"><div id="licensescroll"></div></div> <div id="licensebtnq" class="licensebtn">Back</div>');
+                lscroll = document.getElementById(id+"scroll");
+                var request = new XMLHttpRequest();
+                request.open("GET", "README.txt", false);
+                request.onload = function(e) {
+                    var text = this.responseText;
+                    text = text.replace("<","&lt;");
+                    text = text.replace(">","&gt;");
+                    var lines = text.split("\n");
+                    lines[0] = "<br><br>"+lines[0];
+                    for(var i in lines)
+                    {
+                        if(lines[i].match(/--------------------/))
+                        {
+                            lines[i] = "";
+                        }
+                        else
+                        {
+                            lines[i] += "<br>";
+                        }
+                    }
+                    lscroll.innerHTML = lines.join("\n");
+                }
+                request.send();
+                this.hasLicense = true;
+            }
+
+            var btnq = document.getElementById(id+"btnq");
+            lscroll = document.getElementById(id+"scroll");
+            ltext = document.getElementById(id+"text");
+            /* initialize scroll rate */
+            var dY = 2;
+            var t0 = 0;
+            var delay = 1000;
+
+            /* set the scroller to the top position */
+            lscroll.style.top = "0px";
+
+            /* display the license page, hide its parent */
+            hpage.style.display="none";
+            lpage.style.display="block";
+
+            /* calculate the scroll length when the window is shown */
+            var maxY = lscroll.clientHeight - ltext.clientHeight;
+
+            /* start the autoscroll interval */
+            timer = setInterval(function() {
+                /* get the actual interval, in case performance slows us down */
+                var t1 = (new Date()).getTime();
+                var dT = (t0 == 0)?20:(t1-t0);
+                t0 = t1;
+
+                /* delay specific number of milliseconds */
+                delay -= dT;
+                if(delay > 0)
+                    return;
+
+                /* calculate the new top position using dY and dT */
+                var newY = Math.abs(parseInt(lscroll.style.top)) + ((dT/40)*dY);
+                if(newY > 0)
+                    lscroll.style.top = (-1 * newY) + "px";
+                else
+                    lscroll.style.top = "0px";
+
+                /* if the lscroll has hit the limit, delay and swing */
+                /* the other way */
+                if(newY >= maxY)
+                {
+                    delay = 5000;
+                    dY = -20;
+                }
+                else if(newY <= 0)
+                {
+                    delay = 5000;
+                    dY = 2;
+                }
+            }, 40);
+
+        btnq.onclick = function() {
+            hpage.style.display="block";
+            lpage.style.display="none";
+            clearInterval(timer);
+        }
+      },
+    };
+    return w;
 })();
 
+
 function getMessage(key, alter) {
-       var ret = alter || '';
-       if (window.chrome && window.chrome.i18n && window.chrome.i18n.getMessage) {
-               ret = chrome.i18n.getMessage(key);
-       } else {
-               if (typeof this.messages == 'undefined') {
-                       $.getJSON("_locales/en/messages.json", function(data){
-                               this.messages = data;
-                       }).error(function(){
-                                       return ret;
-                       });
-               }
+    var ret = alter || '';
+    if (window.chrome && window.chrome.i18n && window.chrome.i18n.getMessage) {
+        ret = chrome.i18n.getMessage(key);
+    } else {
+        if (typeof this.messages == 'undefined') {
+            try {
+                var request = new XMLHttpRequest();
+                request.open("GET", "_locales/en/messages.json", false);
+                request.send();
+                var res = request.responseText;
+                this.messages = window.eval(res);
+            } catch (err) {
+                return ret;
+            }
+        }
         if (this.messages && (this.messages.hasOwnProperty(key)) && (this.messages[key].hasOwnProperty('message'))) {
-                       ret = this.messages[key].message;
-               }
-       }
-       return ret;
+            ret = this.messages[key].message;
+        }
+    }
+    return ret;
 }
 
-$(document).ready(function(){
-        license_init("license", "open");
-       $('title').html(getMessage('name', 'Annex'));
-       $('#open1').html(getMessage('1PlayerGame', '1 Player Game'));
-       $('#open2').html(getMessage('2PlayerGame', '2 Player Game'))
-       $('#open_help').html(getMessage('howtoPlay', 'How to Play'));
-       $('#open_exit').html(getMessage('exit', 'Exit'));
-       $('.play1_pieces_lable').html(getMessage('pieces', 'pieces'));
-       $('.play2_pieces_lable').html(getMessage('pieces', 'pieces'));
-       $('#turn').html(getMessage('turn', "'s Turn"));
-       $('.result_new_p1').html(getMessage('newOneGame', 'New 1P Game'));
-       $('.result_new_p2').html(getMessage('newTwoGame', 'New 2P Game'));
-       $('.result_exit').html(getMessage('exit', 'Exit'));
-       $('.help_title').html(getMessage('howtoPlay', 'How to Play'));
-       $('.help_contain').html(getMessage('help', "Play a piece on the board so that one or more of your opponent’s pieces are between two of your pieces. All of the opponent’s pieces between your own turn over and become your color.<br>The player with the most pieces on the board at the end of the game wins!"));
-       $('.help_exit').html(getMessage('goBack', 'Go Back'));
-       $('#license').html(getMessage('license', 'License'));
-       $('#readme').html(getMessage('readme', 'Readme'));
-       $('.configure_panel_startover').click(function(){
-               World.startOver();
-       }).hover(function(){
-               $(this).css('background-color','#222222');
-               World.playSound('snd_navmove');
-       },function(){
-               $(this).css('background-color','#000000');
-       }).find('.configure_panel_text').html(getMessage('startover','Start over'));
-
-       $('.configure_panel_newgame').hover(function(evt){
-               $(this).css('background-color','#222222');
-               World.playSound('snd_navmove');
-       },function(evt){
-               $(this).css('background-color','#000000');
-       }).click(function(){
-               var n = 1;
-               if ($(this).hasClass('configure_panel_new2game')){
-                       n = 2;
-               }
-               World.playSound('snd_navclick');
-               World.init(n);
-       });
-
-       $('.configure_panel_help').click(function(){
-               World.showHelp();
-       }).hover(function(){
-               $(this).css('background-color','#222222');
-               World.playSound('snd_navmove');
-       },function(){
-               $(this).css('background-color','#000000');
-       }).find('.configure_panel_text').html(getMessage('rules','Rules'));
-
-       $('.configure_panel_exit').click(function(){
-               window.close();
-       }).hover(function(){
-               $(this).css('background-color','#222222');
-               World.playSound('snd_navmove');
-       },function(){
-               $(this).css('background-color','#000000');
-       }).find('.configure_panel_text').html(getMessage('exit','Exit'));
-
-       World.playSound('snd_theme');
-});
+window.onload = function(){
+    var locale = getMessage('locale', 'en');
+    if (locale != 'en') {
+        var head  = $('head').q;
+        var link  = document.createElement('link');
+        link.rel  = 'stylesheet';
+        link.type = 'text/css';
+        link.href = 'css/i18n.css';
+        head.appendChild(link);
+    }
+    $('title').html(getMessage('name', 'Annex'));
+    $('#open1').html(getMessage('1PlayerGame', '1 Player Game'));
+    $('#open2').html(getMessage('2PlayerGame', '2 Player Game'))
+    $('#open_help').html(getMessage('howtoPlay', 'How to Play'));
+    $('#open_exit').html(getMessage('exit', 'Exit'));
+    $('#licensebtnl').click(function(){
+        World.showLicense("license", "open");
+    });
+
+    World.playSound('snd_theme');
+}