//GlobalSetting $(function () { $.ajaxSetup({ timeout: 2e4, error: function (a, b, c) { this._error(a, b, c) }, _error: function (a, b, c) { var d = a.responseText; if (d) { if (d.substring(0, 1) === "{") { var e = $.parseJSON(d); JMessageManager.error(e.Error) } else { JMessageManager.error(d) } } else { JMessageManager.error(c) } } }) }); $.cq = { global: { WIDGET_JS_LOAD_MODE: "JQUERY", GENERAL_SYSTEM_ERROR_MSG: "Technical error has occurred.
Please contact system administrator.", ENABLE_TAB_SAVING: false, SESSION_CHECKING_INTERVAL: 6e4, SESSSION_TIMEOUT_NOTIFICATION_MS: 3e5, ORDERSTATUS_TABID: 43, TRADING_WID: 74, FID: { COUNTER: 1, REMARK: 2, SYMBOL: 3, DAY_HIGH: 7, DAY_LOW: 8, LAST: 9, CHANGE: 11, UP_DOWN: 14, CHANGE_PCT: 17, REMARK: 48 }, CHART_FID: { AVG_TRADE_SIZE: 1, WEIGHTED_AVG_PRICE: 2, LAST_DONE: 3, SPREAD_PRICE_RATIO: 4, NET_CHANGE: 6, PRICE: 7, TOTAL_VOLUME: 9, COUNTER: 13, CODES: 14, BUY_UP: 15, SELL_DOWN: 16, MARRIED: 17, ROW_COUNT: 20, INTRADAY_CHART_DATA: 25, TOTAL_VALUE: 55, INTRADAY_CHART_PAGE: 62, VOLUME_CHART_DATA: 97, UPDATE_TIME: 999, TOTAL_PAGE: 9990 }, PLACEHOLDER: null } } ; //JMessageManager var JMessageManager = function () { function f(b, f, g) { if (c === true) { d.push({ iserror: true, msg: b, title: f, callback: g }); return } c = true; j(); a.removeClass("msg-success").addClass("msg-error"); if (f) { a.html($.format('

{1}

{0}

', b, f ? f : e.OperationFail)) } else { a.html(b.replace("div-margin-default div-msg msg-error", "")) } a.css("left", ($(document).width() - a.width()) / 2).show("blind", null, 200, function () { i() }); if (g) { g() } } function g(b, f, g) { if (c === true) { d.push({ iserror: false, msg: b, title: f, callback: g }); return } c = true; j(); a.removeClass("msg-error").addClass("msg-success").html($.format('

{1}

{0}

', b, f ? f : e.OperationSuccess)); a.css("left", ($(document).width() - a.width()) / 2).show("blind", null, 200, function () { i() }); if (g) { g() } } function h() { clearTimeout(b) } function i() { b = setTimeout(function () { if (a.css("display") !== "none") { a.hide("blind", null, 200) } h(); c = false; if (d.length > 0) { var b = d.pop(); if (b.iserror === true) { f(b.msg, b.title, b.callback) } else { g(b.msg, b.title, b.callback) } } }, 2e3) } function j() { var b = $(window).scrollTop(); var c = 0; var d = b + c; if (d < 0) { d = Math.ceil(d) } else { d = Math.floor(d); var e = d + "px"; a.css("top", e) } } function k(a) { var b = 0, c = 1e3, d = 2e4; maxRunTime = d / c, totalRun = 0; a.children().css("visibility", "hidden"); a.$loadingBar = $("
" + e.LoadingBarText + "
"); a.prepend(a.$loadingBar); setTimeout(function () { l(a) }, d) } function l(a) { if (!a || !a.$loadingBar) { return } a.$loadingBar.progressbar({ value: 100 }); a.$loadingBar.fadeOut("fast", function () { a.children().css("visibility", "visible") }); if (a.$loadingBar) { a.$loadingBar.remove() } if (a.inter) { clearInterval(a.inter) } } var a, b, c = false, d = [], e = { OperationFail: "Operation Fail", OperationSuccess: "Operation Success", LoadingBarText: "Loading... ..." }; $(function () { a = $('
').appendTo("body").hide(); a.hover(function () { clearTimeout(b) }, function () { i() }); a.bind("click", function () { a.hide("blind", null, 200); h() }); $(window).scroll(function () { if (a.css("display") === "none") { return } j() }) }); return { error: f, show: g, resettimeout: h, showloading: k, hideloading: l} } () ; //JResourceManager var JResourceManager = function () { function e(a, b) { if (typeof a !== "object") { return } var c = 0, d = 0; for (var e in a.files) { if (a.files.hasOwnProperty(e)) { c++ } } for (var e in a.files) { if (a.files.hasOwnProperty(e)) { f(e, a.files[e], a.reload, function () { d++; if (d == c && b) { b() } }) } } } function f(c, d, e, f) { var g = $.inArray(c, b); if (g < 0 || e === true) { if (e === true) { b.splice(g, 1) } if (a.jsLoadMode === "APPEND") { var h = $("head")[0]; var i = document.createElement("script"); i.type = "text/javascript"; i.src = d; i.name = c; h.appendChild(i); b.push(c); setTimeout(f, 1500) } else if (a.jsLoadMode === "JQUERY") { $.getScript(d).done(function (a, d) { b.push(c); setTimeout(f, 1) }).fail(function (a, b, e) { throw $.format("ajax loading for js resource failed for [{0}: {1}]. It may caused by file path not exist or the resource file contain invalid javascript syntax", c, d) }) } else { throw $.format("[{0}] is invalid resource file load mode", a.jsLoadMode) } } else { if (a.jsLoadMode === "APPEND") { setTimeout(f, 1500) } else if (a.jsLoadMode === "JQUERY") { setTimeout(f, 1) } } } function g(a, b, c, e, f, g, h, i) { var j = "" + ' ' + ' ' + ' ' + ' '; if (c) { j += ' ' } var k = j += d.SlingshotServerDeadOrJavaDisabled + " "; return j } var a = { jsLoadMode: $.cq.global.WIDGET_JS_LOAD_MODE || "JQUERY" }; var b = [], c = 0, d = { SlingshotServerDeadOrJavaDisabled: "Slingshot Server dead or Java not enabled" }; $(function () { }); return { load: e, applet: g} } () ;