var base_url = "https://quark.earthchaos.com/"; var language_values = { "request_err": "Uncompleted request error", "map_select_location": "Select your location", "err_email_jseval_1": "The Email is required", "err_email_jseval_2": "The Email format is invalid ( e.g.: yourname@yourdomain.com)", "invalid_accounttoken": "Invalid account token", "security_token_err_1": "The Security Token is required.", "security_token_err_2": "The Security Token should be exactly 32 characters long.", "security_word_err_1": "The Secret Word is required.", "security_word_err_2": "The Secret Word must be at least 10 characters long.", "setpassword_err_1": "The Password is required.", "setpassword_err_2": "The Password must be at least 6 characters long.", "register_err_agreement": "Please, read our policies and check the box" }; var forms_arr = ["handles_login", "handles_resetword", "handles_saveword", "handles_register", "handles_recoverypass", "handles_setpassword", "handles_prelogin", "checkEmail","handles_logrefresh"]; var volstatus = {"v":1,"m":0.6,"x":0.6}; var logged_list_exists = false; var effx = false; var rf = ""; var rf_params = ""; var rf_replace = ""; var sw_replace = ""; var cf = true; function general_jxs(response, form) { console.log("form " + form.attr("id")); f = form.attr("id"); var obj; try { obj = JSON.parse(response); } catch (exception) { obj = null; } console.log("rf (must)1: " + rf); if (obj) { console.log(obj); var sccmsg = form.find(".sccmsg"); if (obj.scrq) { console.log("obj.scrq " + form.attr("id")); sw_replace = f; if (obj.success) { setTimeout(function () { console.log("Call init_secretword"); init_secretword(); }, 3000); } else { init_secretword(); } } if (obj.token) { console.log("obj.token " + form.attr("id")); c = form.children(":nth-child(1)"); x = form.children("input[name='form_token']"); a = ""; if (!x.length) { c.before(a); } else { x.val(obj.token); } console.log("rf (must): " + rf); console.log(x); console.log(typeof (eval(rf))); console.log(typeof (eval(rf)) === 'function'); if (1 && typeof (eval(rf)) === 'function') { if ((rf !== "init_secretword")) { eval(rf)(rf_params); } if (rf !== "panel_getdata") { process_form(form); } } else { if (b(rf)) { console.log("Invalid function: " + rf); } } } obj_success(obj, form); obj_error(obj, form); } else { ref = form.attr("id"); if (b(ref)) { gjxs = String(ref) + "_jxs"; if (typeof (window[gjxs]) === 'function') { eval(gjxs)(response, form); } } } } function obj_success(obj, form) { console.log("obj.success " + form.attr("id")); if (obj.success) { console.log("rf"); console.log(rf); var fx = b(forms_arr.indexOf(rf) > -1); console.log("fx: " + fx); if (b(rf_params) && b(rf) && fx) { var sccmsg = form.find(".sccmsg");/* sccmsg.removeClass("errmsg").clearQueue().hide().html(function () { return obj.success; }).slideDown({duration: 500, complete: function () { $(this).delay(5000).slideUp({duration: 500, complete: function () { $(this).dequeue(); var fw = form.parents(".form_wrapper"); if (fw.length) { fw.slideUp({duration: 500, complete: function () { effx = false; general_jxsuccess(obj, form); } }); } else { effx = false; general_jxsuccess(obj, form); } } }); } }); */ sccmsg.removeClass("errmsg").stop().clearQueue().hide().html(function () { return obj.success; }).append("
").slideDown({duration: 500, complete: function () { $(this).find(".msdelay").hide("slide", {direction: "right"}, 2000, function () { sccmsg.slideUp({duration: 500, complete: function () { $(this).dequeue(); effx = false; var fw = form.parents(".form_wrapper"); if (fw.length) { fw.slideUp({duration: 500, complete: function () { effx = false; general_jxsuccess(obj, form); } }); } else { effx = false; general_jxsuccess(obj, form); } } }); $(this).remove(); }); } }); } $("input:hidden[name='form_token']").remove(); rf_params = ""; rf = ""; } } function obj_error(obj, form) { if (obj.error) { $.each(obj.error, function (index, value) { if (index === "account") { wrel(); } var elm = ".errmsg[itemscope='" + index + "']"; e = form.find(elm); if (e.length === 0) { e = form.find(".errmsg").last(); if (e.length === 0) { e = form.find(".sccmsg"); e.addClass("errmsg"); } } e.html(value); msg_eff(e); }); } } function general_jxe(form) { sc = form.find(".sccmsg"); sc.addClass("errmsg").html(language_values["request_err"]); msg_eff(sc); } function general_jxsuccess(obj, form) { console.log("F: general_jxsuccess"); ref = form.attr("id"); if (b(ref)) { rf_replace = ref; gjxs = String(ref) + "_jxs"; console.log("JXS: " + gjxs); if (typeof (window[gjxs]) === 'function') { eval(gjxs)(obj, form); } else { p = form.parents(".accWindow"); if (p.length) { panel_getdata(p); } } } } function toggle_form(form_id) { f = b(form_id) ? $("#" + form_id) : $("form"); th = f.parents("*[itemscope=thover]"); th.find(">.form_wrapper").unbind().hide(); th.find(">*:first-child:not(.form_wrapper)").unbind().each(function () { var fc = $(this); var frw = fc.parent().find(".form_wrapper:not(.hidden)"); if (frw.length) { fc.addClass("show_form").click(function () { console.log(fc); etgl(frw); fc.toggleClass("show_form"); }).mouseenter(function () { $(this).effect("highlight"); }); } }); $(".smallinfo").addClass("transition").unbind().click(function () { $(this).toggleClass("smclicked"); }); setTimeout(smclicked_out, 1500); } function smclicked_out() { $(".smallinfo").each(function () { var zoom = $(this).find("span.glyphicon-zoom-in"); if (!zoom.length) { var xh = $(this).html(); $(this).html(xh + ''); } }); } function etgl(frw) { frw.each(function () { var frwe = $(this); frwe.slideToggle({duration: 400, complete: function () { if (frwe.css("display") === "block") { var fchk = frwe.find("form").attr("id") + "_open"; console.log(fchk); if (typeof (window[fchk]) === 'function') { eval(fchk)(frwe.find("form")); } else { console.log("NO FNC: " + fchk); } } }}); }); } function screen_rez() { strx = $(window).width() + " / " + $(window).height(); $("#screen_rez").html(function () { return strx; }); benchmark_toggle(); } function wrel() { console.log("F: wrel"); window.location.reload(); } function goacc() { console.log("F: goacc"); window.location = "account"; } function gohome() { console.log("F: gohome"); window.location = base_url; } function benchmark_toggle() { $("#benchmark_toggle").click(function () { var bm = $("#benchmark"); if (bm.css("display") === "none") { bm.slideDown(300); } else if (bm.css("display") === "block") { bm.slideUp(300); } }); $("#benchmark").hide(); setTimeout(sescountdown, 1000); } function sescountdown() { s = parseInt($("#sesTime").html()); /* if (s < 60) { b = $("#benchmark"); if (b.css("display") === "none") { b.slideDown(300); } } */ $("#sesTime").html(s - 1); s = $("#stdTime").attr("title"); $("#stdTime").attr("title", parseInt(s) + 1); s = $("#stdTime").attr("title") * 1000; d = new Date(s); $("#stdTime").html(date2str(d, "yyyy-MM-dd hh:mm:ss") + " Europe/Bucharest"); setTimeout(sescountdown, 1000); } function date2str(x, y) { var z = { M: x.getMonth() + 1, d: x.getDate(), h: x.getHours(), m: x.getMinutes(), s: x.getSeconds() }; y = y.replace(/(M+|d+|h+|m+|s+)/g, function (v) { return ((v.length > 1 ? "0" : "") + eval('z.' + v.slice(-1))).slice(-2); }); return y.replace(/(y+)/g, function (v) { return x.getFullYear().toString().slice(-v.length); }); } var envsnd_timer; function play_env() { var sndpath_env = '/web_assets/sound/env.mp3'; var sndpath_eff = '/web_assets/sound/click.mp3#t=0.179'; var envsnd_embedTag = '