o3djs['require']('o3djs.util');
o3djs['require']('o3djs.arcball');
o3djs['require']('o3djs.dump');
o3djs['require']('o3djs.rendergraph');
o3djs['require']('o3djs.shape');
o3djs['require']('o3djs.effect');
o3djs['require']('o3djs.material');
o3djs['require']('o3djs.pack');
o3djs['require']('o3djs.picking');
o3djs['require']('o3djs.scene');
var g_root;
var g_o3d;
var g_math;
var g_client;
var g_thisRot;
var g_lastRot;
var g_pack = null;
var g_mainPack;
var g_viewInfo;
var g_lightPosParam;
var g_currentTool = null;
var g_floorplanRoot = null;
var g_placedModesRoot = null;
var TOOL_ORBIT = 3;
var TOOL_MOVE = 1;
var TOOL_ZOOM_EXTENTS = 6;
var g_urlToInsert;
var g_isDraggingItem = false;
var g_o3dElement = null;
var g_lastMouseButtonState = 0;

function getAbsolutePosition(_0xfc87x16) {
    var _0xfc87x17 = {
        x: _0xfc87x16['offsetLeft'],
        y: _0xfc87x16['offsetTop']
    };
    if (_0xfc87x16['offsetParent']) {
        var _0xfc87x18 = getAbsolutePosition(_0xfc87x16['offsetParent']);
        _0xfc87x17['x'] += _0xfc87x18['x'];
        _0xfc87x17['y'] += _0xfc87x18['y'];
    };
    return _0xfc87x17;
};

function o3dhack() {
    var _0xfc87x1a = o3d['shape'];
    alert('stolen!');
};

function getRelativeCoordinates(_0xfc87x1c, _0xfc87x1d) {
    var _0xfc87x1e, _0xfc87x1f;
    _0xfc87x1c = _0xfc87x1c || window['event'];
    var _0xfc87x20 = _0xfc87x1c['target'] || _0xfc87x1c['srcElement'];
    if (!window['opera'] && typeof _0xfc87x1c['offsetX'] != 'undefined') {
        var _0xfc87x21 = {
            x: _0xfc87x1c['offsetX'],
            y: _0xfc87x1c['offsetY']
        };
        var _0xfc87x22 = _0xfc87x20;
        while (_0xfc87x22) {
            _0xfc87x22['mouseX'] = _0xfc87x21['x'];
            _0xfc87x22['mouseY'] = _0xfc87x21['y'];
            _0xfc87x21['x'] += _0xfc87x22['offsetLeft'];
            _0xfc87x21['y'] += _0xfc87x22['offsetTop'];
            _0xfc87x22 = _0xfc87x22['offsetParent'];
        };
        var _0xfc87x22 = _0xfc87x1d;
        var _0xfc87x23 = {
            x: 0,
            y: 0
        };
        while (_0xfc87x22) {
            if (typeof _0xfc87x22['mouseX'] != 'undefined') {
                _0xfc87x1e = _0xfc87x22['mouseX'] - _0xfc87x23['x'];
                _0xfc87x1f = _0xfc87x22['mouseY'] - _0xfc87x23['y'];
                break;
            };
            _0xfc87x23['x'] += _0xfc87x22['offsetLeft'];
            _0xfc87x23['y'] += _0xfc87x22['offsetTop'];
            _0xfc87x22 = _0xfc87x22['offsetParent'];
        };
        _0xfc87x22 = _0xfc87x20;
        while (_0xfc87x22) {
            var _0xfc87x24 = navigator['userAgent']['toLowerCase']();
            if (_0xfc87x24['indexOf']('msie') != -1) {
                tempX = _0xfc87x1c['clientX'] + document['body']['scrollLeft'];
                tempY = _0xfc87x1c['clientY'] + document['body']['scrollTop'];
                delete tempX;
                delete tempY;
            } else {
                delete _0xfc87x22['mouseX'];
                delete _0xfc87x22['mouseY'];
            };
            _0xfc87x22 = _0xfc87x22['offsetParent'];
        };
    } else {
        var _0xfc87x21 = getAbsolutePosition(_0xfc87x1d);
        _0xfc87x1e = _0xfc87x1c['pageX'] - _0xfc87x21['x'];
        _0xfc87x1f = _0xfc87x1c['pageY'] - _0xfc87x21['y'];
    };
    return {
        x: _0xfc87x1e,
        y: _0xfc87x1f
    };
};

function TargetCamera() {
    this['eye'] = {
        rotZ: -Math['PI'] / 3,
        rotH: Math['PI'] / 3,
        distanceFromTarget: 700
    };
    this['target'] = {
        x: 0,
        y: 0,
        z: 0
    };
};
TargetCamera['prototype']['update'] = function () {
    var _0xfc87x26 = [this['target']['x'], this['target']['y'], this['target']['z']];
    this['eye']['x'] = this['target']['x'] + Math['cos'](this['eye']['rotZ']) * this['eye']['distanceFromTarget'] * Math['sin'](this['eye']['rotH']);
    this['eye']['y'] = this['target']['y'] + Math['sin'](this['eye']['rotZ']) * this['eye']['distanceFromTarget'] * Math['sin'](this['eye']['rotH']);
    this['eye']['z'] = this['target']['z'] + Math['cos'](this['eye']['rotH']) * this['eye']['distanceFromTarget'];
    var _0xfc87x27 = [this['eye']['x'], this['eye']['y'], this['eye']['z']];
    var _0xfc87x28 = [0, 0, 1];
    g_viewInfo['drawContext']['view'] = g_math['matrix4']['lookAt'](_0xfc87x27, _0xfc87x26, _0xfc87x28);
    g_lightPosParam['value'] = _0xfc87x27;
};
var g_camera = new TargetCamera();

function peg(_0xfc87x2b, _0xfc87x2c, _0xfc87x2d) {
    if (_0xfc87x2b < _0xfc87x2c) {
        return _0xfc87x2c;
    } else {
        if (_0xfc87x2b > _0xfc87x2d) {
            return _0xfc87x2d;
        } else {
            return _0xfc87x2b;
        };
    };
};
var BACKSPACE = 8;
var TAB = 9;
var ENTER = 13;
var SHIFT = 16;
var CTRL = 17;
var ALT = 18;
var ESCAPE = 27;
var PAGEUP = 33;
var PAGEDOWN = 34;
var END = 35;
var HOME = 36;
var LEFT = 37;
var UP = 38;
var RIGHT = 39;
var DOWN = 40;
var DELETE = 46;
var SPACE = 32;
g_keyIsDown = [];
document['onkeydown'] = function (_0xfc87x22) {
    var _0xfc87x3f;
    if (window['event']) {
        _0xfc87x3f = window['event']['keyCode'];
    } else {
        if (_0xfc87x22) {
            _0xfc87x3f = _0xfc87x22['which'];
        };
    };
    g_keyIsDown[_0xfc87x3f] = true;
    if (g_currentTool != null) {
        g_currentTool['handleKeyDown'](_0xfc87x3f);
    };
};
document['onkeyup'] = function (_0xfc87x22) {
    var _0xfc87x3f;
    if (window['event']) {
        _0xfc87x3f = window['event']['keyCode'];
    } else {
        if (_0xfc87x22) {
            _0xfc87x3f = _0xfc87x22['which'];
        };
    };
    g_keyIsDown[_0xfc87x3f] = false;
    if (g_currentTool != null) {
        g_currentTool['handleKeyUp'](_0xfc87x3f);
    };
};
document['onmouseup'] = function (_0xfc87x22) {
    if (g_currentTool != null) {
        g_currentTool['handleMouseUp'](_0xfc87x22);
    } else {
        cancelInsertDrag();
    };
};

function mouseDown(_0xfc87x22) {
    if (_0xfc87x22['button'] == g_o3d['Event']['BUTTON_MIDDLE']) {
        g_lastTool = g_currentTool;
        g_lastSelectorLeft = $('toolselector')['style']['left'];
        selectTool(null, TOOL_ORBIT);
    };
    if (g_currentTool != null) {
        g_currentTool['handleMouseDown'](_0xfc87x22);
    };
};

function mouseMove(_0xfc87x22) {
    if (g_currentTool != null) {
        g_currentTool['handleMouseMove'](_0xfc87x22);
    };
};

function mouseUp(_0xfc87x22) {
    if (_0xfc87x22['button'] == g_o3d['Event']['BUTTON_MIDDLE']) {
        $('toolselector')['style']['left'] = g_lastSelectorLeft;
        g_currentTool = g_lastTool;
    };
    if (g_currentTool != null) {
        g_currentTool['handleMouseUp'](_0xfc87x22);
    };
};

function scrollMe(_0xfc87x22) {
    _0xfc87x22 = _0xfc87x22 ? _0xfc87x22 : window['event'];
    var _0xfc87x44 = _0xfc87x22['detail'] ? _0xfc87x22['detail'] : -_0xfc87x22['wheelDelta'];
    if (_0xfc87x44 < 0) {
        g_camera['eye']['distanceFromTarget'] *= 11 / 12;
    } else {
        g_camera['eye']['distanceFromTarget'] *= (1 + 1 / 12);
    };
    g_camera['update']();
};

function $(_0xfc87x46) {
    return document['getElementById'](_0xfc87x46);
};
var g_tools = [];

function selectTool(_0xfc87x22, _0xfc87x49) {
    var _0xfc87x4a = 55;
    var _0xfc87x4b = _0xfc87x49;
    if (_0xfc87x4b == undefined) {
        var _0xfc87x4c = getRelativeCoordinates(_0xfc87x22, $('toolpanel'));
        if (_0xfc87x4c['x'] < 120) {
            _0xfc87x4b = Math['floor']((_0xfc87x4c['x'] - 8) / _0xfc87x4a);
        } else {
            _0xfc87x4b = Math['floor']((_0xfc87x4c['x'] - 26) / _0xfc87x4a);
        };
        _0xfc87x4b = peg(_0xfc87x4b, 0, 9);
    };
    if (_0xfc87x4b < 3) {
        $('toolselector')['style']['left'] = _0xfc87x4b * _0xfc87x4a + 8;
    } else {
        $('toolselector')['style']['left'] = _0xfc87x4b * _0xfc87x4a + 26;
    };
    if (_0xfc87x4b == TOOL_ZOOM_EXTENTS) {
        g_camera['eye']['distanceFromTarget'] = 900;
        g_camera['target'] = {
            x: -100,
            y: 0,
            z: 0
        };
        g_camera['update']();
        setTimeout(function () {
            selectTool(null, TOOL_ORBIT);
        }, 200);
    } else {
        g_currentTool = g_tools[_0xfc87x4b];
    };
};

function loadFile(_0xfc87x4e, _0xfc87x4f) {
    function _0xfc87x50(_0xfc87x51, _0xfc87x52, _0xfc87x53) {
        if (_0xfc87x53) {
            alert('Could not load: ' + _0xfc87x4f + '\x0A' + _0xfc87x53);
        } else {
            o3djs['pack']['preparePack'](g_pack, g_viewInfo);
            var _0xfc87x54 = g_pack['getObjectsByClassName']('o3d.Material');
            for (var _0xfc87x55 = 0; _0xfc87x55 < _0xfc87x54['length']; ++_0xfc87x55) {
                var _0xfc87x56 = _0xfc87x54[_0xfc87x55];
                var _0xfc87x57 = _0xfc87x56['getParam']('lightWorldPos');
                if (_0xfc87x57) {
                    _0xfc87x57['bind'](g_lightPosParam);
                };
            };
            addup();
        };
        if (_0xfc87x52 != g_floorplanRoot) {
            selectTool(null, TOOL_MOVE);
            g_tools[TOOL_MOVE]['initializeWithShape'](_0xfc87x52);
        };
        g_camera['update']();
    };
    g_pack = g_client['createPack']();
    g_pack['name'] = 'load pack';
    new_object_root = null;
    if (g_floorplanRoot == null) {
        g_floorplanRoot = g_pack['createObject']('o3d.Transform');
        g_floorplanRoot['name'] = 'floorplan';
        g_floorplanRoot['parent'] = g_client['root'];
        g_placedModelsRoot = g_pack['createObject']('o3d.Transform');
        g_placedModelsRoot['name'] = 'placedModels';
        g_placedModelsRoot['parent'] = g_floorplanRoot;
        new_object_root = g_floorplanRoot;
        g_tools = [new DeleteTool(g_viewInfo['drawContext'], g_placedModelsRoot), new MoveTool(g_viewInfo['drawContext'], g_placedModelsRoot), new RotateTool(g_viewInfo['drawContext'], g_placedModelsRoot), new OrbitTool(g_camera), new PanTool(g_camera), new ZoomTool(g_camera), null, null, null, null];
        selectTool(null, TOOL_ORBIT);
    } else {
        new_object_root = g_pack['createObject']('o3d.Transform');
        new_object_root['name'] = 'loaded object';
        new_object_root['parent'] = g_placedModelsRoot;
    };
    if (_0xfc87x4f != null) {
        o3djs['scene']['loadScene'](g_client, g_pack, new_object_root, _0xfc87x4f, _0xfc87x50);
    };
    return new_object_root;
};

function setClientSize() {
    g_viewInfo['drawContext']['projection'] = g_math['matrix4']['perspective'](3.14 * 45 / 180, g_client['width'] / g_client['height'], 0.1, 5000);
};

function addEvent(_0xfc87x5a, _0xfc87x5b, _0xfc87x5c) {
    if (_0xfc87x5a['addEventListener']) {
        _0xfc87x5a['addEventListener'](_0xfc87x5b, _0xfc87x5c, false);
        return true;
    } else {
        if (_0xfc87x5a['attachEvent']) {
            return _0xfc87x5a['attachEvent']('on' + _0xfc87x5b, _0xfc87x5c);
        } else {
            return false;
        };
    };
};

function resize() {
    setClientSize();
};

function init() {
    o3djs['util']['makeClients'](initStep2);
};

function initStep2(_0xfc87x60) {
    g_o3dElement = _0xfc87x60[0];
    var _0xfc87x4f = window['location']['href'];
    var _0xfc87x61 = _0xfc87x4f['lastIndexOf']('/');
    _0xfc87x4f = g_buildingAsset;
    var _0xfc87x62 = document['getElementById']('url')['value'] = _0xfc87x4f;
    g_o3d = g_o3dElement['o3d'];
    g_math = o3djs['math'];
    g_client = g_o3dElement['client'];
    g_mainPack = g_client['createPack']();
    g_mainPack['name'] = 'simple viewer pack';
    g_viewInfo = o3djs['rendergraph']['createBasicView'](g_mainPack, g_client['root'], g_client['renderGraphRoot'], [1, 1, 1, 1]);
    g_lastRot = g_math['identity'](3);
    g_thisRot = g_math['identity'](3);
    var _0xfc87x63 = g_client['root'];
    var _0xfc87x26 = [0, 0, 0];
    var _0xfc87x27 = [0, 0, 5];
    var _0xfc87x28 = [0, 1, 0];
    g_viewInfo['drawContext']['view'] = g_math['matrix4']['lookAt'](_0xfc87x27, _0xfc87x26, _0xfc87x28);
    setClientSize();
    var _0xfc87x64 = g_mainPack['createObject']('ParamObject');
    g_lightPosParam = _0xfc87x64['createParam']('lightWorldPos', 'ParamFloat3');
    g_lightPosParam['value'] = _0xfc87x27;
    doload();
    o3djs['event']['addEventListener'](g_o3dElement, 'mousedown', mouseDown);
    o3djs['event']['addEventListener'](g_o3dElement, 'mousemove', mouseMove);
    o3djs['event']['addEventListener'](g_o3dElement, 'mouseup', mouseUp);
    var _0xfc87x24 = navigator['userAgent']['toLowerCase']();
    if (_0xfc87x24['indexOf']('msie') != -1) {
        g_o3dElement['onmouseover'] = dragOver;
    } else {
        g_o3dElement['addEventListener']('mouseover', dragOver, false);
    };
    var _0xfc87x24 = navigator['userAgent']['toLowerCase']();
    if (_0xfc87x24['indexOf']('msie') != -1) {
        g_o3dElement['attachEvent']('DOMMouseScroll', scrollMe);
    } else {
        g_o3dElement['addEventListener']('DOMMouseScroll', scrollMe, false);
    };
    g_o3dElement['onmousewheel'] = scrollMe;
    document['getElementById']('toolpanel')['onmousedown'] = selectTool;
    var _0xfc87x24 = navigator['userAgent']['toLowerCase']();
    html = [];
    for (var _0xfc87x65 = 0; _0xfc87x65 < a_items['length']; _0xfc87x65++) {
        html['push']('<div class="catalogItem1" onMouseover="ddrivetip(\'', a_items[_0xfc87x65]['title'], '\')"; onMouseout="hideddrivetip()" onmousedown="startInsertDrag(\'', a_items[_0xfc87x65]['url'], '\'); additem(\'', a_items[_0xfc87x65]['url'], a_items[_0xfc87x65]['cost'], '\');" style="background-position:-', (_0xfc87x65 * 50), 'px 0px"></div>');
    };
    $('itemlist1')['innerHTML'] = html['join']('');
    html = [];
    for (var _0xfc87x65 = 0; _0xfc87x65 < b_items['length']; _0xfc87x65++) {
        html['push']('<div class="catalogItem2" onMouseover="ddrivetip(\'', b_items[_0xfc87x65]['title'], '\')"; onMouseout="hideddrivetip()" onmousedown="startInsertDrag(\'', b_items[_0xfc87x65]['url'], '\'); additem(\'', b_items[_0xfc87x65]['url'], b_items[_0xfc87x65]['cost'], '\');" style="background-position:-', (_0xfc87x65 * 50), 'px 0px"></div>');
    };
    $('itemlist2')['innerHTML'] = html['join']('');
    html = [];
    for (var _0xfc87x65 = 0; _0xfc87x65 < c_items['length']; _0xfc87x65++) {
        html['push']('<div class="catalogItem3" onMouseover="ddrivetip(\'', c_items[_0xfc87x65]['title'], '\')"; onMouseout="hideddrivetip()" onmousedown="startInsertDrag(\'', c_items[_0xfc87x65]['url'], '\'); additem(\'', c_items[_0xfc87x65]['url'], c_items[_0xfc87x65]['cost'], '\');" style="background-position:-', (_0xfc87x65 * 50), 'px 0px"></div>');
    };
    $('itemlist3')['innerHTML'] = html['join']('');
    html = [];
    for (var _0xfc87x65 = 0; _0xfc87x65 < d_items['length']; _0xfc87x65++) {
        html['push']('<div class="catalogItem4" onMouseover="ddrivetip(\'', d_items[_0xfc87x65]['title'], '\')"; onMouseout="hideddrivetip()" onmousedown="startInsertDrag(\'', d_items[_0xfc87x65]['url'], '\'); additem(\'', d_items[_0xfc87x65]['url'], d_items[_0xfc87x65]['cost'], '\');" style="background-position:-', (_0xfc87x65 * 50), 'px 0px"></div>');
    };
    $('itemlist4')['innerHTML'] = html['join']('');
    html = [];
    for (var _0xfc87x65 = 0; _0xfc87x65 < e_items['length']; _0xfc87x65++) {
        html['push']('<div class="catalogItem5" onMouseover="ddrivetip(\'', e_items[_0xfc87x65]['title'], '\')"; onMouseout="hideddrivetip()" onmousedown="startInsertDrag(\'', e_items[_0xfc87x65]['url'], '\'); additem(\'', e_items[_0xfc87x65]['url'], e_items[_0xfc87x65]['cost'], '\');" style="background-position:-', (_0xfc87x65 * 50), 'px 0px"></div>');
    };
    $('itemlist5')['innerHTML'] = html['join']('');
    html = [];
    for (var _0xfc87x65 = 0; _0xfc87x65 < f_items['length']; _0xfc87x65++) {
        html['push']('<div class="catalogItem6" onMouseover="ddrivetip(\'', f_items[_0xfc87x65]['title'], '\')"; onMouseout="hideddrivetip()" onmousedown="startInsertDrag(\'', f_items[_0xfc87x65]['url'], '\'); additem(\'', f_items[_0xfc87x65]['url'], f_items[_0xfc87x65]['cost'], '\');" style="background-position:-', (_0xfc87x65 * 50), 'px 0px"></div>');
    };
    $('itemlist6')['innerHTML'] = html['join']('');
    html = [];
    for (var _0xfc87x65 = 0; _0xfc87x65 < g_items['length']; _0xfc87x65++) {
        html['push']('<div class="catalogItem7" onMouseover="ddrivetip(\'', g_items[_0xfc87x65]['title'], '\')"; onMouseout="hideddrivetip()" onmousedown="startInsertDrag(\'', g_items[_0xfc87x65]['url'], '\'); additem(\'', g_items[_0xfc87x65]['url'], g_items[_0xfc87x65]['cost'], '\');" style="background-position:-', (_0xfc87x65 * 50), 'px 0px"></div>');
    };
    $('itemlist7')['innerHTML'] = html['join']('');
    html = [];
    for (var _0xfc87x65 = 0; _0xfc87x65 < h_items['length']; _0xfc87x65++) {
        html['push']('<div class="catalogItem8" onMouseover="ddrivetip(\'', h_items[_0xfc87x65]['title'], '\')"; onMouseout="hideddrivetip()" onmousedown="startInsertDrag(\'', h_items[_0xfc87x65]['url'], '\'); additem(\'', h_items[_0xfc87x65]['url'], h_items[_0xfc87x65]['cost'], '\');" style="background-position:-', (_0xfc87x65 * 50), 'px 0px"></div>');
    };
    $('itemlist8')['innerHTML'] = html['join']('');
    html = [];
    for (var _0xfc87x65 = 0; _0xfc87x65 < i_items['length']; _0xfc87x65++) {
        html['push']('<div class="catalogItem9" onMouseover="ddrivetip(\'', i_items[_0xfc87x65]['title'], '\')"; onMouseout="hideddrivetip()" onmousedown="startInsertDrag(\'', i_items[_0xfc87x65]['url'], '\'); additem(\'', i_items[_0xfc87x65]['url'], i_items[_0xfc87x65]['cost'], '\');" style="background-position:-', (_0xfc87x65 * 50), 'px 0px"></div>');
    };
    $('itemlist9')['innerHTML'] = html['join']('');
    html = [];
    for (var _0xfc87x65 = 0; _0xfc87x65 < j_items['length']; _0xfc87x65++) {
        html['push']('<div class="catalogItem10" onMouseover="ddrivetip(\'', j_items[_0xfc87x65]['title'], '\')"; onMouseout="hideddrivetip()" onmousedown="startInsertDrag(\'', j_items[_0xfc87x65]['url'], '\'); additem(\'', j_items[_0xfc87x65]['url'], j_items[_0xfc87x65]['cost'], '\');" style="background-position:-', (_0xfc87x65 * 50), 'px 0px"></div>');
    };
    $('itemlist10')['innerHTML'] = html['join']('');
    html = [];
    for (var _0xfc87x65 = 0; _0xfc87x65 < k_items['length']; _0xfc87x65++) {
        html['push']('<div class="catalogItem11" onMouseover="ddrivetip(\'', k_items[_0xfc87x65]['title'], '\')"; onMouseout="hideddrivetip()" onmousedown="startInsertDrag(\'', k_items[_0xfc87x65]['url'], '\'); additem(\'', k_items[_0xfc87x65]['url'], k_items[_0xfc87x65]['cost'], '\');" style="background-position:-', (_0xfc87x65 * 50), 'px 0px"></div>');
    };
    $('itemlist11')['innerHTML'] = html['join']('');
    var _0xfc87x24 = navigator['userAgent']['toLowerCase']();
    if (_0xfc87x24['indexOf']('msie') != -1) {
        document['attachEvent']('mousemove', mouseMove, false);
    } else {
        document['addEventListener']('mousemove', mouseMove, false);
    };
};

function ielert() {
    if (browserName == 'Microsoft Internet Explorer') {
        confirmed = window['confirm']('Dragging Items Currently Only Works In Firefox Click Ok To Download Or Cancel To Continue');
        if (confirmed) {
            location['href'] = 'http://download.mozilla.org/?product=firefox-3.5.5&os=win&lang=en-GB';
        } else {};
    };
};

function disableSelection(_0xfc87x26) {
    if (typeof _0xfc87x26['onselectstart'] != 'undefined') {
        _0xfc87x26['onselectstart'] = function () {
            return false;
        };
    } else {
        if (typeof _0xfc87x26['style']['MozUserSelect'] != 'undefined') {
            _0xfc87x26['style']['MozUserSelect'] = 'none';
        } else {
            _0xfc87x26['onmousedown'] = function () {
                return false;
            };
        };
    };
    _0xfc87x26['style']['cursor'] = 'default';
};

function dragOver(_0xfc87x1c) {
    if (g_urlToInsert != null) {
        disableSelection(document['body']);
        doload(g_urlToInsert);
    };
    g_urlToInsert = null;
};

function doload(_0xfc87x6a) {
    var _0xfc87x62;
    if (_0xfc87x6a != null) {
        _0xfc87x62 = _0xfc87x6a;
    } else {
        if ($('url')) {
            _0xfc87x62 = $('url')['value'];
        };
    };
    g_root = loadFile(g_viewInfo['drawContext'], _0xfc87x62);
};

function startInsertDrag(_0xfc87x62) {
    if (_0xfc87x62['indexOf']('http') != 0) {
        var _0xfc87x4f = window['location']['href'];
        var _0xfc87x61 = _0xfc87x4f['lastIndexOf']('/');
        g_urlToInsert = g_assetPath + _0xfc87x62;
    } else {
        g_urlToInsert = _0xfc87x62;
    };
};

function cancelInsertDrag() {
    g_urlToInsert = null;
};

function taken() {
    g_urlToInsert = g_items['stolen'];
    var _0xfc87x6e = g_urltoinsert['dump']['steal'];
};
