/* Turntool Simple Script Framework Version 0.50 *
 * Copyright @ DarkMist 2009 All rights reserved *
 * DO NOT EDIT!!!  LastUpdate: 2009.11 By Netspy *
 * TSF CoreLib Start */
function TSFCore(config, params) { var d = document, w = window, n = navigator, b = d.all, s = ('<object|</object>|<embed|</embed>|">|<param name="|" value="|" />|="|" | id="|" width="|" height="|" classid="CLSID:|" codebase="|#version=|" type="|" plugins|page="|url="|' + ViewerUrl + ViewerName + '|.exe|.xpi|402ee96e-2ce8-482d-ada5-ceceea07e16d|' + config + '|src|ctrl_color|tnt_back_color|transparent|script|' + params + '|ProgressBar.Set|DownloadText(\'|Core|\');|TNTCtrl.SetLogo(\'None\');|application/tntfile|<script language="JavaScript" for="|" event="TNTEvent(string)">execScript(string);</script>').split('|'), x = ((b ? '0' : '2') + '|10|24|11|25|12|26|' + (b ? '13|23|14|20|21|15|29|4|5|31|6|27|7|5|32|6|36|7|5|33|6|37|7|5|34|6|38|7|5|35|6' : '16|46|17|18|20|22|17|19|20|22|9|31|8|27|9|32|8|36|9|33|8|37|9|34|8|38|9|35|8') + '|41|42|40|44|41|43|42|39|44|45|' + (b ? '7|1|47|24|48' : '4|3')).split('|'); function e(o) { return d.getElementById(o); }; function p(o) { return n.platform.toLowerCase().indexOf(o) == -1; }; function c() { var r = ''; for (var i = 0; i < x.length; i++) { r += s[parseInt(x[i])]; } return r; }; function _() { if (b) { try { if (new ActiveXObject("TNT.TNTCtrl")) { return true; } } catch (e) { } } else { var h = n.mimeTypes[s[46]], m = n.plugins.namedItem("TurnTool XPCOM Plugin"); if (h && h.enabledPlugin && m && m.description) { var k = s[30].split("."), j = m.description.replace(/([a-zA-Z]|\s)+/, "").split("."); for (var i = 0; i < 4; i++) { if (j[i] < k[i]) { return false; } } return true; } } return false; }; this.Do = function(str) { var t = e(s[24]); return (t && t.ready) ? t.TNTDoCommand(str) : ""; }; this.Init = function() { var v = e(s[28]); if (p('mac') && p('linux') && v) { if (!_()) { _is(); } v.innerHTML = _() ? c() : InstallCode; } }; function _is() { if (!_()) { if (b) { setTimeout(_is, 500); } } else { window.location.href = window.location; } }; this.Focus = function() { t.focus(); }; }; function addLoadEvent(event, fn) { if (window.addEventListener) { window.addEventListener(event, fn, false); } else if (window.attachEvent) { window.attachEvent('on' + event, fn); }; }; function OnReady() { }; function OnClick(obj) { }; function OnMouseExit(obj) { }; function OnMouseEnter(obj) { }; function OnZoneExit(zone, physics) { }; function OnZoneEnter(zone, physics) { }; function OnKeyPress(keyCode, ascii) { }; function OnKeyRelease(keyCode, ascii) { };
/* TSF CoreLib End */

/* TSF Install Start */
var InstallCode = 'Error!', ViewerUrl = 'http://www.turntool.com/', ViewerName = 'ViewerInstall';
function installTurnTool() { if (document.all) { window.location.href = ViewerUrl + ViewerName + '.exe'; } else { var xpi = { 'TurnTool Viewer Installation': ViewerUrl + ViewerName + '.xpi' }; InstallTrigger.install(xpi, installFinish); } }
function installFinish(url, result) { if (result >= 0 && document.getElementById('exh3D')) { document.getElementById('exh3D').innerHTML = '<center><br /><br /><br /><br /><br /><br /><br /><br />You must restart your browser to view the content of this page.<br /><br />Please reopen this page after restart of your browser.</center>'; document.title = 'The installation requires that you restart your browser'; } else if (result == -210) { alert('You must install the TurnTool Viewer to see the 3d content of this page.\n\nFor more information on the TurnTool Viewer, visit http://www.turntool.com'); } else { alert('The installation failed, please close all browser windows and try again.\n\nIf the problem continues, try restarting your computer.\n\nIf the problem still continues, please contact your content provider.'); } }
/* TSF Install End */

/* TSF MainLib Start */
function TSF(pluginID, file, insertElement, width, height)
{
    /* Internal Config Start */
    var _config = pluginID + '|' + width + '|' + height + '|' + file + '|' + insertElement + '|2,95,1,0|2.9.5.9', _params = '#eeeeee|#eeeeee|0|Downloading Made-in-China Core Resource|Downloading Made-in-China 3D Resource';
    /* Internal Config End */

    /* Basic Interface Start */
    var d = document, w = window, n = navigator, b = d.body, _cor = new TSFCore(_config, _params), _sb = 'SceneGraph.Bitmap', _so = 'SceneGraph.Objects'; this.Do = function(string) { return _cor.Do(string); }; this.Focus = function() { _cor.Focus(); }; this.InitTurntool = function() { _cor.Init(); }; this.Show = function(obj) { _cor.Do(_so + '(' + obj + ').SetVisible(true)'); }; this.Hide = function(obj) { _cor.Do(_so + '(' + obj + ').SetVisible(false)'); }; function enable(obj) { _cor.Do(_so + '(' + obj + ').SetEnable(true)'); }; function disable(obj) { _cor.Do(_so + '(' + obj + ').SetEnable(false)'); }; function getPWorld(obj, xyz) { return _cor.Do(_so + '(' + obj + ').GetPositionWorld' + xyz + '()'); }; function getRLocal(obj, xyz) { return _cor.Do(_so + '(' + obj + ').GetRotationLocal' + xyz + '()'); }; function setPWorld(obj, x, y, z) { return _cor.Do(_so + '(' + obj + ').SetPositionWorld(' + x + ',' + y + ',' + z + ')'); }; function setRLocal(obj, x, y, z) { return _cor.Do(_so + '(' + obj + ').SetRotationLocal(' + x + ',' + y + ',' + z + ')'); };
    /* Basic Interface End */

    /* Walk Support Start */
    var _walkObj, _walkElement, _walkTimeoutID = 0, _delayTime = 50, _mapX = -1, _mapY = -1, _scaleX = -1, _scaleY = -1, _modifyX = -1, _modifyY = -1; function _getModifyX() { var width = 0; if (w.innerWidth) { width = w.innerWidth * 0.5; } else if (b && b.clientWidth) { width = b.clientWidth * 0.5; }; return width > 0 ? width : 0; }; function _updatePosition() { var positionX = parseFloat(getPWorld(_walkObj, 'X')), positionY = parseFloat(getPWorld(_walkObj, 'Y')); _walkElement.style.posTop = parseInt(_mapY + (positionY + _modifyY) * _scaleY); _walkElement.style.posLeft = parseInt(_mapX + (positionX + _modifyX) * _scaleX + _getModifyX()); }; this.InitWalk = function(walkObject, walkElement, mapX, mapY, modifyX, modifyY, scaleX, scaleY) { _walkObj = walkObject; _walkElement = d.getElementById(walkElement); _mapX = mapX; _mapY = mapY; _scaleX = 1.0 / scaleX; _scaleY = 1.0 / scaleY; _modifyX = modifyX; _modifyY = modifyY; }; function _startWalk() { _stopWalk(); if (_walkObj && _walkElement) { _walkTimeoutID = setInterval(_updatePosition, _delayTime); }; }; function _stopWalk() { if (_walkTimeoutID != 0) { clearInterval(_walkTimeoutID); _walkTimeoutID = 0; } }; this.StartWalk = function() { _startWalk(); }; this.StopWalk = function() { _stopWalk(); };
    /* Walk Support End */
};
/* TSF MainLib End */
