var STATE_IDLE = 0; var STATE_SAVING = 1; var STATE_SAVING_AS = 2; var STATE_VIEWER = 3; var state = STATE_IDLE; var product_data = ""; var screenshot_name = ""; var save_data = ""; var load_name = ""; var load_data = ''; var load_data_pos = 0; var load_read_only = false; var isReady = false; var sessionID = "45uvj8ik9s0isrnr7onj7lp013"; var logo_uuid = "4921d6cfcafae9.51174424"; var floor_width = 0; var floor_depth = 0; function redirect(mx) { this.location = "http://" + mx + ".3d-standards.com/application/index.php?login=true"; } function getSetup() { document.threedstandards.send('setupData', 'http://abex.3d-standards.com#/tools/getproductxml.php?uuid=|/tools/getimage.php?uuid=|/files/w3fs/#48231835284052.47401109#45uvj8ik9s0isrnr7onj7lp013#49c00648181357.66653957#'); } function init() { document.getElementById("content-main").className = ""; setCompanyLogo('4921d6cfcafae9.51174424', 'Abex Exhibit Systems'); setLinks(); } function showMessage() { var e = document.getElementById("message"); if(e != null) { e.style.display = ""; e = document.getElementById("content-header"); if(e != null) { e.style.height = "200px"; } e = document.getElementById("content-top"); if(e != null) { e.style.height = "220px"; } e = document.getElementById("content-main"); if(e != null) { e.style.top = "220px"; } e = document.getElementById("content-border"); if(e != null) { e.style.top = "206px"; } contentPositionTop = 220; } } function hideMessage() { var e = document.getElementById("message"); if(e != null) { e.style.display = "none"; e = document.getElementById("content-header"); if(e != null) { e.style.height = "80px"; } e = document.getElementById("content-top"); if(e != null) { e.style.height = "100px"; } e = document.getElementById("content-main"); if(e != null) { e.style.top = "100px"; } e = document.getElementById("content-border"); if(e != null) { e.style.top = "86px"; } contentPositionTop = 100; } } function ready() { refreshCategories(); if(sessionID != null) { document.threedstandards.send('sessionID', sessionID); sessionID = null; } isReady = true; } function appLogin(id) { if(isReady) { document.threedstandards.send('sessionID', id); } else { sessionID = id; } } function help() { window.open("../../files/languages/en/help/index.php", "_blank", "width=900,height=700,directories=no,location=no,menubar=no,resizable=no,scrollbars=yes,status=no,toolbar=no"); } function feedback() { window.open('./email-form.php?recipient=feedback&button=28&response=19&header=20', '_blank', 'width=800,height=400,directories=no,location=no,menubar=no,resizable=no,scrollbars=no,status=no,toolbar=no'); } function support() { window.open('./email-form.php?recipient=support&button=27&response=21&header=8', '_blank', 'width=800,height=400,directories=no,location=no,menubar=no,resizable=no,scrollbars=no,status=no,toolbar=no'); } function refreshCategories() { document.getElementById("categories").src = "./content/categories.php"; } function updateProducts(category_uuid, manufacturer_uuid) { if(menu_type == 0) { if(document.getElementById("menu") != null) { document.getElementById("menu").src = "./content/menu.php?category=" + category_uuid + "&manufacturer=" + manufacturer_uuid; } } else if(menu_type == 1) { if(document.getElementById("menu_m") != null) { document.getElementById("menu_m").src = "./content/swatches/menu.php?category=" + category_uuid + "&uuids=" + swatch_uuids + "&manufacturer=" + manufacturer_uuid; } } } function reloadApplication() { window.location = "../../application/index.php"; } function chooseRegion() { window.location = "../../application/index.php?change_region=yes";} function chooseLanguage() { window.location = "../../application/index.php?change_language=yes";} function login() { window.location = "../../application/index.php?login=true";} function logout() { if(confirm("Any unsaved data will be lost, are you sure you want to log out?")) { openPopup("./content/logout.php"); hideMessage(); resetLogo(); } } function signup() { openPopup("./content/signup.php"); } function freeAccountMessage() { openPopup("./content/free_account_message.php"); } function resetLogo() { setCompanyLogo('4921d6cfcafae9.51174424', 'Abex Exhibit Systems');} function admin() { openPopup("./content/admin.php"); } function openLoad() { openPopup("./content/data.php"); } function openPopup(url) { if(setPopupFrame("popup_frame", url)) { resetPopupSize("content-popup"); showPopup(); } } function openPopupID(id, frameID, url) { if(setPopupFrame(frameID, url)) { resetPopupSize(id); showPopupID(id); } } function popupClosed(id, cancelProcess) { if( (id == "popup_frame") && cancelProcess ) { document.threedstandards.send('cancelProcess', ''); } document.getElementById(id).src = "./content/blank.html"; } function setLinks() { document.getElementById("user_links").src = "./content/links.php"; } function addProduct(uuid) { document.threedstandards.send('productsToLoad', uuid); } function resetFlooring() { document.threedstandards.send('resetFloorTexture', ''); document.threedstandards.send('cancelProcess', ''); setFileUpload("-1"); } function addFlooring(uuid) { parent.document.threedstandards.send('loadingMessage', 11); var e = document.getElementById("fileupload"); if(e != null) { e.src = "./content/fileupload.php?product=grounds&material=" + uuid + "&width=" + floor_width + "&depth=" + floor_depth; } } function floorWidth(width) { floor_width = width; } function floorDepth(depth) { floor_depth = depth; } function setPopupFrame(id, url) { if( (document.getElementById(id) != null) && (document.getElementById(id).src != "http://abex.3d-standards.com/application/" + url) ) { document.getElementById(id).src = url; return true; } return false; } function setFileUpload(data) { data = ""+data; var e = document.getElementById("fileupload"); if(e != null) { if(data == "-1") { e.src = "./content/templates.php"; } else { e.src = "./content/fileupload.php?" + data; } } if(data == "-1") { showProductMenus(); } } function reapplyFileUpload(data) { var e = document.getElementById("fileupload"); if(e != null) { e.src = "./content/fileupload.php?" + data; } } function confirmReset() { if(confirm("You will lose any unsaved work. Are you sure you want to create a new scene?")) { document.threedstandards.send("reset", "confirmed"); resetData(); } } function confirmDelete() { if(confirm("Delete this product? You will not be able to undo any changes.")) { document.threedstandards.send("delete", "confirmed"); } } function resetData() { save_data = ""; load_name = ""; load_data = ''; load_data_pos = 0; load_read_only = false; } function setCompanyLogo(uuid, name) { if(uuid == "-1") { document.getElementById("content-header-company-logo").innerHTML = ""; } else { document.getElementById("content-header-company-logo").innerHTML = ""+name+" Logo"; } logo_uuid = uuid; } function loadData() { if(load_data_pos >= load_data.length) { document.threedstandards.send('load_segment', null); if(load_read_only) { resetData(); } else { load_data = ''; } } else if(load_data.length >= 100) { document.threedstandards.send('load_segment', load_data.substring(load_data_pos, load_data_pos + 100)); load_data_pos += 100; } else { document.threedstandards.send('load_segment', load_data); load_data_pos = load_data.length; } } function saveData(data) { if(data != null) { save_data += data; document.threedstandards.send("dataReceived", ""); } else { openPopup("./content/saving/save-data.php?method=save"); } state = STATE_SAVING; } function saveAsData(data) { if(data != null) { save_data += data; document.threedstandards.send("dataReceived", ""); } else { openPopup("./content/saving/save-data.php?method=saveas"); } state = STATE_SAVING_AS; } function viewerData(data) { if(data != null) { save_data += data; document.threedstandards.send("dataReceived", ""); } else { openPopup("./content/saving/snapshot-data.php"); } state = STATE_VIEWER; } function screenshotStart() { openPopup("./content/saving/screenshot-name.php"); } function screenshotName(name) { screenshot_name = name; document.threedstandards.send("screenshotName", screenshot_name); } function productData(_data) { if(_data == null) { openPopup("./content/saving/screenshot-create.php?logo=" + logo_uuid); } else { product_data += _data; document.threedstandards.send('dataReceived', ''); } } function exportItem(data) { data = ""+data; var str = data.split(","); openPopup("./content/single-item-viewer.php?data=" + data); } function setWorkerSource(url) { document.getElementById("worker").src = url; } var categories_height = 50; var products_height = 399; var row_height = 25; var rows = 0; var swatch_uuids = ""; var menu_type = -1; function setRows() { var size = categories_height + (rows * row_height); document.getElementById("categories_row").style.height = size + "px"; document.getElementById("products_row").style.height = (products_height - size) + "px"; document.getElementById("menu").height = (products_height - size) + "px"; if(frames["menu"].document.getElementById("products") != null) { frames["menu"].document.getElementById("products").style.height = (products_height - size) + "px"; } } function showProductMenus() { document.getElementById("product_categories").className = ""; document.getElementById("product_menu").className = ""; menu_type = 0; swatch_uuids = ""; setRows(); }