function resizeClip(n,t,i,r,u){n.style.clip="rect("+t+" "+i+" "+r+" "+u+")"}function resizeIframe(n,t,i){document.getElementById(n).width=t;document.getElementById(n).height=i}function contractBanner(n,t,i,r,u,f){n.style.top="auto";n.style.left="auto";resizeIframe(t,parseInt(r.replace("px",""),10)-parseInt(f.replace("px",""),10)+"px",parseInt(u.replace("px",""),10)-parseInt(i.replace("px",""),10)+"px");resizeClip(n,i,r,u,f)}function bannerRePosition(n){n&&$(n).length>0&&$(n).attr("style","overflow:hidden;display:block")}function SetLTP(n){$.cookie("AALTP","1",{path:"/",domain:n})}function SetMigrationCookies2(n,t,i){var r=$.cookie("AAWS2"),f="",o=new Date,e=new Date,u;if(e.setTime(e.getTime()+31536e6),r!=null)for(r=r.split("&"),u=0;u<r.length;u++)r[u].split("=")[0]!=n&&(f+="&"+r[u]);f=n+"="+t+"|"+o.getTime()+f;$.cookie("AAWS2",f,{path:"/",domain:i})}function SetMigrationCookies(n,t,i){var r=$.cookie("AAWS"),f="",o=new Date,e=new Date,u;if(e.setTime(e.getTime()+31536e6),r!=null)for(r=r.split("&"),u=0;u<r.length;u++)r[u].split("=")[0]!=n&&(f+="&"+r[u]);f=n+"="+t+"|"+o.getTime()+f;$.cookie("AAWS",f,{expires:e,path:"/",domain:i})}function SetWebSettingCookies(n,t,i){var r=$.cookie("AAWS"),f="",o=new Date,e=new Date,u;if(e.setTime(e.getTime()+31536e6),r!=null)for(r=r.split("&"),u=0;u<r.length;u++)r[u].split("=")[0]!=n&&(f+="&"+r[u]);f=n+"="+t+f;$.cookie("AAWS",f,{expires:e,path:"/",domain:i})}function DeleteMigrationCookies(n,t){var i=$.cookie("AAWS"),u="",e=new Date,f=new Date,r;if(f.setTime(f.getTime()+31536e6),i!=null)for(i=i.split("&"),r=0;r<i.length;r++)i[r].split("=")[0]!=n&&(u+=u==""?i[r]:"&"+i[r]);$.cookie("AAWS",u,{expires:f,path:"/",domain:t})}function GetMigrationCookies2(n){var t=$.cookie("AAWS2"),i;if(t!=null)for(t=t.split("&"),i=0;i<t.length;i++)if(t[i].split("=")[0]==n)return{value:t[i].split("=")[1].split("|")[0],exp:t[i].split("=")[1].split("|")[1]};return{value:"",exp:null}}function DeleteMigrationCookies2(n,t){var i=$.cookie("AAWS2"),u="",e=new Date,f=new Date,r;if(f.setTime(f.getTime()+31536e6),i!=null)for(i=i.split("&"),r=0;r<i.length;r++)i[r].split("=")[0]!=n&&(u+=u==""?i[r]:"&"+i[r]);$.cookie("AAWS2",u,{expires:f,path:"/",domain:t})}function SetFooterCookies(n,t){var e="FB",i=$.cookie("AAWS"),u="",o=new Date,f=new Date,r;if(f.setTime(f.getTime()+31536e6),i!=null)for(i=i.split("&"),r=0;r<i.length;r++)i[r].split("=")[0]!=e&&(u+="&"+i[r]);u=e+"="+n+u;$.cookie("AAWS",u,{expires:f,path:"/",domain:t})}function GetFooterCookies(){var n=$.cookie("AAWS"),t;if(n!=null)for(n=n.split("&"),t=0;t<n.length;t++)if(n[t].split("=")[0]=="FB")return{value:n[t].split("=")[1]};return{value:"0"}}function GetWebSettingCookies(n){var t=$.cookie("AAWS"),i;if(t!=null)for(t=t.split("&"),i=0;i<t.length;i++)if(t[i].split("=")[0]==n)return{value:t[i].split("=")[1]};return{value:"0"}}function SetHKMasterSymbolCookies(n,t){var i=new Date;i.setTime(i.getTime()+31536e6);$.cookie("MasterSymbol",n,{expires:i,path:"/",domain:t})}function SetSHMasterSymbolCookies(n,t){var i=new Date;i.setTime(i.getTime()+31536e6);$.cookie("SHMasterSymbol",n,{expires:i,path:"/",domain:t})}function AddHKSymbol(n,t){var e=new Date,o,i;e.setTime(e.getTime()+31536e6);var r=$.cookie("LatestRTQuotedStocks"),f="",u=[];if(r!=null)for(r=r.split("%3B"),i=0;i<r.length;i++)r[i]!=n&&u.push(r[i]);for(u.push(n),o=0,i=u.length-1;i>=0;i--){if(o>=20)break;f=f==""?u[i]:u[i]+"%3B"+f;o++}$.cookie("LatestRTQuotedStocks",f,{expires:e,path:"/",domain:t})}function AddSHSymbol(n,t){var f,u,h,i;n.indexOf(".SH")==-1&&(n=n+".SH");f=new Date;f.setTime(f.getTime()+31536e6);var r=$.cookie("CNHK"),c="",e="",o=[],s=[];if(r!=null)for(r=r.split("&"),i=0;i<r.length;i++)if(r[i].split("=")[0]!="BrowserHistory")c+="&"+r[i];else for(o=r[i].split("=")[1].split(","),u=0;u<o.length;u++)o[u]!=n&&s.push(o[u]);for(s.unshift(n),h=0,i=0;i<s.length;i++){if(h>=20)break;e!=""&&(e+=",");e+=s[i];h++}$.cookie("CNHK","BrowserHistory="+e+c,{expires:f,path:"/",domain:t})}function GetNewsFont(){var n=$.cookie("NewsZoomLevel");return n==null||n<0||n>5?(n=3,SetNewsFont(n)):n=parseInt(n),n}function SetNewsFont(n){if(n>=0&&n<=5){var t=new Date;$.cookie("NewsZoomLevel",n,{path:"/",expires:new Date(t.getFullYear()+1,1,1),domain:".aastocks.com"})}}function SaveNewsZoom(n){var t=GetNewsFont();t=n=="+"?++t:--t;t>=5?t=5:t<0&&(t=1);SetNewsFont(t)}function adjNewsFontFromCookie(n,t,i){var r=$("#"+n),e=GetNewsFont()-1,u=i+e*2,f;return r.length==0&&(r=$("."+n)),u<i-2&&(u=minFont),f="font-size",t=="2"&&(f="line-Height"),r.length!=0&&r.css(f,u+"px"),u}function SetDefaultQuoteSetting(n){if(n=="QQ"||n=="DQ"){var t=new Date;t.setTime(t.getTime()+31536e6);$.cookie("CNHKDefQuotePage",n,{expires:t,path:"/",domain:fullCookiesDomain})}}function GetDefaultQuoteSetting(){var n=$.cookie("CNHKDefQuotePage");return n=="QQ"||n=="DQ"?n:"DQ"}function GetSHMasterSymbol(){var n=$.cookie("SHMasterSymbol");return n!=null?n:"600000"}function GetHKMasterSymbol(){var n=$.cookie("MasterSymbol");return n!=null?n:"00001"}function FormatSymbol(n){if(n=n.toString().replace(".SH","").replace(".HK","").replace(".SZ",""),n.length==6)return n;var t="00000"+n;return t.substr(t.length-5)}function FormatSymbolWithMarket(n){if(n=n.toString().replace(".SH","").replace(".HK","").replace(".SZ",""),n.length==6&&n[0]=="6")return{symbol:n,market:"SH"};if(n.length==6)return{symbol:n,market:"SZ"};var t="00000"+n;return{symbol:t.substr(t.length-5),market:"HK"}}function selectBtn(){var s,f="",r="",e="",u,o="",t={},n={};for(s=document.cookie,t=s.split(";"),i=0;i<t.length;i++)if(t[i].substr(0,8).indexOf("Login=")!=-1){if(u=t[i].substring(t[i].substr(0,8).indexOf("Login=")+6),u.indexOf("mbr%5Fid")!=-1||u.indexOf("mbr_id")!=-1)for(n=u.split("&"),j=0;j<n.length;j++)n[j].indexOf("broker")!=-1&&(f=n[j].substring(7).toUpperCase()),n[j].indexOf("ucalc")!=-1&&(r=n[j].substring(6)),n[j].indexOf("service%5Ftype")!=-1?e=n[j].substring(15):n[j].indexOf("service_type")!=-1&&(e=n[j].substring(13)),n[j].indexOf("mbr%5Fid")!=-1?o=n[j].substring(9):n[j].indexOf("mbr_id")!=-1&&(o=n[j].substring(7));break}var c='<a class="text_link2 jshoverwithimage" href=\''+lnklib.AnaLogin.url+"'>&nbsp;&nbsp;"+lnklib.AnaLogin.text+"<\/a>",h='<a class="text_link2 jshoverwithimage" href=\''+lnklib.logout.url+"'><img alt=\""+lnklib.logout.text+'" title="'+lnklib.logout.text+'" src="'+lnklib.logout.img+'" align="absmiddle" />'+lnklib.logout.text+"<\/a>",l='<a class="text_link2 jshoverwithimage" href=\''+lnklib.login.url+"'><img alt=\""+lnklib.login.text+'" title="'+lnklib.login.text+'" src="'+lnklib.login.img+'" align="absmiddle" />'+lnklib.login.text+"<\/a>",a='<a class="text_link2 jshoverwithimage" href=\''+lnklib.signup.url+"'><img alt=\""+lnklib.signup.text+'" title="'+lnklib.signup.text+'" src="'+lnklib.signup.img+'" align="absmiddle" />'+lnklib.signup.text+"<\/a>";o!==""?r=="3"||r=="2"||r=="0"&&e=="FW"||f=="AA5"||f=="AA6"?document.writeln(h+"|"+c):document.writeln(h):document.writeln(a+"|"+l)}function GetCookiesValue(n,t){var i=$.cookie(n),u,f,r;if(i){if(t=="")return i;for(i=i.split("&"),r=0;r<i.length;r++)if(u=i[r].split("=")[0],f=i[r].split("=")[1],u==t)return f}return null}function CheckSHHKSymbol(n){var t,i;return n==null||n==undefined||n==""?{valid:!1}:isNaN(n)?{valid:!1}:parseInt(n)<1?{valid:!1}:parseInt(n)<1e5?(t="00000"+n,t=t.substr(t.length-5),{valid:!0,market:"HK",symbol:t}):parseInt(n)>=1e5&&parseInt(n)<1e6?(i="000000"+n,i=i.substr(i.length-6),{valid:!0,market:"SH",symbol:i}):{valid:!1}}function CheckSHSZHKSymbol(n){var t,i;return n==null||n==undefined||n==""?{valid:!1}:(n=n.replace(/[^0-9]/g,""),isNaN(n)?{valid:!1}:n.length==6&&parseInt(n)<1e6?(t="000000"+n,t=t.substr(t.length-6),t[0]=="6"?{valid:!0,market:"SH",symbol:t}:{valid:!0,market:"SZ",symbol:t}):parseInt(n)>0&&parseInt(n)<1e5?(i="00000"+n,i=i.substr(i.length-5),{valid:!0,market:"HK",symbol:i}):{valid:!1})}function CheckSHSZHKUSSymbol(n){var t,i;return n==null||n==undefined||n==""?{valid:!1}:n.length==6&&parseInt(n)<1e6?(t="000000"+n,t=t.substr(t.length-6),t[0]=="6"?{valid:!0,market:"SH",symbol:t}:{valid:!0,market:"SZ",symbol:t}):parseInt(n)>0&&parseInt(n)<1e5?(i="00000"+n,i=i.substr(i.length-5),{valid:!0,market:"HK",symbol:i}):{valid:!0,market:"US",symbol:n}}function CheckAllMarketSymbol(n){var t,r,u,i,f;return n==null||n==undefined||n==""?{valid:!1}:n.length==6&&parseInt(n)<1e6?(t="000000"+n,t=t.substr(t.length-6),t[0]=="6"?{valid:!0,market:"SH",symbol:t}:{valid:!0,market:"SZ",symbol:t}):n.length==6&&typeof FXSymbolNames!="undefined"?(r=FXSymbolNames[n.slice(0,3).toUpperCase()],u=FXSymbolNames[n.slice(3).toUpperCase()],r!=null&&u!=null&&r.length>0&&u.length>0?{valid:!0,market:"FX",symbol:n.toUpperCase()}:{valid:!0,market:"US",symbol:n}):parseInt(n)>0&&parseInt(n)<1e5?(i="00000"+n,i=i.substr(i.length-5),{valid:!0,market:"HK",symbol:i}):typeof CTSymbolNames!="undefined"?(f=CTSymbolNames[n.toUpperCase()],f!=null&&f.length>0?{valid:!0,market:"CT",symbol:n.toUpperCase()}:{valid:!0,market:"US",symbol:n}):{valid:!0,market:"US",symbol:n}}function GetExpiryDate(){var n=new Date;return n.setTime(n.getTime()+31536e6),n}function ConvertHighLowIndicator(n,t){var r="",i="";if((n=parseInt(n),isNaN(n))||n==0)return"";if(r=n>0?"highInd":"lowInd",n>=9999)i=t=="chi"?"歷史高":t=="chn"?"历史高":"Rec. Hi";else if(n>=1095)i=t=="chi"?"3年高":t=="chn"?"3年高":"3Y Hi";else if(n>=365)i=t=="chi"?"52週高":t=="chn"?"52周高":"52W Hi";else if(n>=183)i=t=="chi"?"6月高":t=="chn"?"6月高":"6M Hi";else if(n>=90)i=t=="chi"?"3月高":t=="chn"?"3月高":"3M Hi";else if(n>=30)i=t=="chi"?"1月高":t=="chn"?"1月高":"1M Hi";else if(n>=14)i=t=="chi"?"10日高":t=="chn"?"10日高":"10D Hi";else if(n>=7)i=t=="chi"?"5日高":t=="chn"?"5日高":"5D Hi";else if(n<=-9999)i=t=="chi"?"歷史低":t=="chn"?"历史低":"Rec. Lo";else if(n<=-1095)i=t=="chi"?"3年低":t=="chn"?"3年低":"3Y Lo";else if(n<=-365)i=t=="chi"?"52週低":t=="chn"?"52周低":"52W Lo";else if(n<=-183)i=t=="chi"?"6月低":t=="chn"?"6月低":"6M Lo";else if(n<=-90)i=t=="chi"?"3月低":t=="chn"?"3月低":"3M Lo";else if(n<=-30)i=t=="chi"?"1月低":t=="chn"?"1月低":"1M Lo";else if(n<=-14)i=t=="chi"?"10日低":t=="chn"?"10日低":"10D Lo";else if(n<=-7)i=t=="chi"?"5日低":t=="chn"?"5日低":"5D Lo";else return"";return"<div class='"+r+" float_l' style='margin-left:2px; padding:0px 2px;'>"+i+"<\/div>"}function ConvertCurrency(n,t){switch(n){case"RMB":case"CNY":return t=="chi"?"人民幣":t=="chn"?"人民币":"RMB";case"USD":return t=="chi"?"美元":t=="chn"?"美元":"USD";case"HKD":return t=="chi"?"港元":t=="chn"?"港元":"HKD";default:return n}}function AddBack2TopButton(n){function r(){var n=$("<div/>").addClass("AABack2Top");$("body").append(n);$(n).bind("click",function(){$("html, body").animate({scrollTop:0},500)});$("#"+t.PositionCheckerID).length>0&&(i(n),$(window).scroll(function(){i(n)}))}function i(n){var i=$("#"+t.PositionCheckerID).offset().top+$("#"+t.PositionCheckerID).outerHeight();$(document).scrollTop()>i?$(n).show():$(n).hide()}var u=this,t=$.extend({PositionCheckerID:"topPanel-banner"},n);r()}function DateDiffConv(n){var e=ServerDate.getTime(),o=n.getTime(),i=(e-o)/864e5,r=APP_LANG=="eng"?"s":"",t,u,f;return typeof TimeDiff_LABEL.dateDiff.hideSuffix!="undefined"&&TimeDiff_LABEL.dateDiff.hideSuffix&&(r=""),t=APP_LANG=="eng"?" ago":"",i<0?TimeDiff_LABEL.dateDiff.J:i<1?(u=parseInt((e-o)/36e5),f=parseInt((e-o)/6e4),u==0?f==0?TimeDiff_LABEL.dateDiff.J:f==1?f+TimeDiff_LABEL.dateDiff.Min+t:f+TimeDiff_LABEL.dateDiff.Min+r+t:u==1?u+TimeDiff_LABEL.dateDiff.H+t:u+TimeDiff_LABEL.dateDiff.H+r+t):i<2?parseInt(i)+TimeDiff_LABEL.dateDiff.D+t:i<7?parseInt(i)+TimeDiff_LABEL.dateDiff.D+r+t:i<14?"1"+TimeDiff_LABEL.dateDiff.W+t:i<21?"2"+TimeDiff_LABEL.dateDiff.W+r+t:i<30?"3"+TimeDiff_LABEL.dateDiff.W+r+t:i<60?"1"+TimeDiff_LABEL.dateDiff.M+t:i<90?"2"+TimeDiff_LABEL.dateDiff.M+r+t:i<120?"3"+TimeDiff_LABEL.dateDiff.M+r+t:i<150?"4"+TimeDiff_LABEL.dateDiff.M+r+t:i<180?"5"+TimeDiff_LABEL.dateDiff.M+r+t:i<210?"6"+TimeDiff_LABEL.dateDiff.M+r+t:i<240?"7"+TimeDiff_LABEL.dateDiff.M+r+t:i<270?"8"+TimeDiff_LABEL.dateDiff.M+r+t:i<300?"9"+TimeDiff_LABEL.dateDiff.M+r+t:i<330?"10"+TimeDiff_LABEL.dateDiff.M+r+t:i<365?"11"+TimeDiff_LABEL.dateDiff.M+r+t:i<730?"1"+TimeDiff_LABEL.dateDiff.Y+t:i<1095?"2"+TimeDiff_LABEL.dateDiff.Y+r+t:"3"+TimeDiff_LABEL.dateDiff.Y+r+t}function RemoveEmptyBanner(n,t){try{(typeof OA_output[n]=="undefined"||OA_output[n]==null||OA_output[n]=="")&&$("#"+t).remove()}catch(i){}}function CopyToClipboard(n){var t=document.createElement("textArea"),i,r,u;t.id="___tempClipboard";t.style.position="absolute";t.style.bottom="10px";t.style.left="10px";t.style.zIndex="-999";t.style.opacity=0;t.value=n;t.contentEditable=!0;t.readOnly=!0;$("body").append(t);navigator.userAgent.match(/ipad|ipod|iphone/i)?(i=document.createRange(),i.selectNodeContents(t),r=window.getSelection(),r.removeAllRanges(),r.addRange(i),t.setSelectionRange(0,999999),t.contentEditable=!1,t.readOnly=!0,t.blur()):t.select();try{document.execCommand("copy");u=!0}catch(f){u=!1}return $("body #___tempClipboard").remove(),u}var JSON;(function(n){typeof exports=="object"?n(require("jquery")):typeof define=="function"&&define.amd?define(["jquery"],n):n(jQuery)})(function(n){n.extend({bez:function(t,i){if(n.isArray(t)&&(i=t,t="bez_"+i.join("_").replace(/\./g,"p")),typeof n.easing[t]!="function"){var r=function(n,t){var u=[null,null],r=[null,null],i=[null,null],f=function(f,e){return i[e]=3*n[e],r[e]=3*(t[e]-n[e])-i[e],u[e]=1-i[e]-r[e],f*(i[e]+f*(r[e]+f*u[e]))},e=function(n){return i[0]+n*(2*r[0]+3*u[0]*n)},o=function(n){for(var t=n,r=0,i;++r<14;){if(i=f(t,0)-n,Math.abs(i)<.001)break;t-=i/e(t)}return t};return function(n){return f(o(n),1)}};n.easing[t]=function(n,t,u,f,e){return f*r([i[0],i[1]],[i[2],i[3]])(t/e)+u}}return t}})});JSON||(JSON={}),function(){"use strict";function i(n){return n<10?"0"+n:n}function f(n){return o.lastIndex=0,o.test(n)?'"'+n.replace(o,function(n){var t=s[n];return typeof t=="string"?t:"\\u"+("0000"+n.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+n+'"'}function r(i,e){var s,l,h,a,v=n,c,o=e[i];o&&typeof o=="object"&&typeof o.toJSON=="function"&&(o=o.toJSON(i));typeof t=="function"&&(o=t.call(e,i,o));switch(typeof o){case"string":return f(o);case"number":return isFinite(o)?String(o):"null";case"boolean":case"null":return String(o);case"object":if(!o)return"null";if(n+=u,c=[],Object.prototype.toString.apply(o)==="[object Array]"){for(a=o.length,s=0;s<a;s+=1)c[s]=r(s,o)||"null";return h=c.length===0?"[]":n?"[\n"+n+c.join(",\n"+n)+"\n"+v+"]":"["+c.join(",")+"]",n=v,h}if(t&&typeof t=="object")for(a=t.length,s=0;s<a;s+=1)typeof t[s]=="string"&&(l=t[s],h=r(l,o),h&&c.push(f(l)+(n?": ":":")+h));else for(l in o)Object.prototype.hasOwnProperty.call(o,l)&&(h=r(l,o),h&&c.push(f(l)+(n?": ":":")+h));return h=c.length===0?"{}":n?"{\n"+n+c.join(",\n"+n)+"\n"+v+"}":"{"+c.join(",")+"}",n=v,h}}typeof Date.prototype.toJSON!="function"&&(Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+i(this.getUTCMonth()+1)+"-"+i(this.getUTCDate())+"T"+i(this.getUTCHours())+":"+i(this.getUTCMinutes())+":"+i(this.getUTCSeconds())+"Z":null},String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(){return this.valueOf()});var e=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,o=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,n,u,s={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},t;typeof JSON.stringify!="function"&&(JSON.stringify=function(i,f,e){var o;if(n="",u="",typeof e=="number")for(o=0;o<e;o+=1)u+=" ";else typeof e=="string"&&(u=e);if(t=f,f&&typeof f!="function"&&(typeof f!="object"||typeof f.length!="number"))throw new Error("JSON.stringify");return r("",{"":i})});typeof JSON.parse!="function"&&(JSON.parse=function(n,t){function r(n,i){var f,e,u=n[i];if(u&&typeof u=="object")for(f in u)Object.prototype.hasOwnProperty.call(u,f)&&(e=r(u,f),e!==undefined?u[f]=e:delete u[f]);return t.call(n,i,u)}var i;if(n=String(n),e.lastIndex=0,e.test(n)&&(n=n.replace(e,function(n){return"\\u"+("0000"+n.charCodeAt(0).toString(16)).slice(-4)})),/^[\],:{}\s]*$/.test(n.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return i=eval("("+n+")"),typeof t=="function"?r({"":i},""):i;throw new SyntaxError("JSON.parse");})}();document.domain="aastocks.com";Array.prototype.indexOf||(Array.prototype.indexOf=function(n,t){for(var i=t||0,r=this.length;i<r;i++)if(this[i]===n)return i;return-1});Array.prototype.filter||(Array.prototype.filter=function(n){"use strict";var i,f,r,e,t,u;if(this===void 0||this===null)throw new TypeError;if(i=Object(this),f=i.length>>>0,typeof n!="function")throw new TypeError;for(r=[],e=arguments[1],t=0;t<f;t++)t in i&&(u=i[t],n.call(e,u,t,i)&&r.push(u));return r});typeof String.prototype.trim!="function"&&(String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")});Date.prototype.isTheSameDate||(Date.prototype.isTheSameDate=function(n){if(n instanceof Date)return this.getYear()==n.getYear()&&this.getMonth()==n.getMonth()&&this.getDate()==n.getDate();throw new Error("Invalid date format!");});var Base64={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encode:function(n){var f="",e,t,i,s,h,o,r,u=0;for(n=Base64._utf8_encode(n);u<n.length;)e=n.charCodeAt(u++),t=n.charCodeAt(u++),i=n.charCodeAt(u++),s=e>>2,h=(e&3)<<4|t>>4,o=(t&15)<<2|i>>6,r=i&63,isNaN(t)?o=r=64:isNaN(i)&&(r=64),f=f+this._keyStr.charAt(s)+this._keyStr.charAt(h)+this._keyStr.charAt(o)+this._keyStr.charAt(r);return f},decode:function(n){var t="",e,o,s,h,u,r,f,i=0;for(n=n.replace(/[^A-Za-z0-9\+\/\=]/g,"");i<n.length;)h=this._keyStr.indexOf(n.charAt(i++)),u=this._keyStr.indexOf(n.charAt(i++)),r=this._keyStr.indexOf(n.charAt(i++)),f=this._keyStr.indexOf(n.charAt(i++)),e=h<<2|u>>4,o=(u&15)<<4|r>>2,s=(r&3)<<6|f,t=t+String.fromCharCode(e),r!=64&&(t=t+String.fromCharCode(o)),f!=64&&(t=t+String.fromCharCode(s));return Base64._utf8_decode(t)},_utf8_encode:function(n){var i,r,t;for(n=n.replace(/\r\n/g,"\n"),i="",r=0;r<n.length;r++)t=n.charCodeAt(r),t<128?i+=String.fromCharCode(t):t>127&&t<2048?(i+=String.fromCharCode(t>>6|192),i+=String.fromCharCode(t&63|128)):(i+=String.fromCharCode(t>>12|224),i+=String.fromCharCode(t>>6&63|128),i+=String.fromCharCode(t&63|128));return i},_utf8_decode:function(n){for(var r="",t=0,i=c1=c2=0;t<n.length;)i=n.charCodeAt(t),i<128?(r+=String.fromCharCode(i),t++):i>191&&i<224?(c2=n.charCodeAt(t+1),r+=String.fromCharCode((i&31)<<6|c2&63),t+=2):(c2=n.charCodeAt(t+1),c3=n.charCodeAt(t+2),r+=String.fromCharCode((i&15)<<12|(c2&63)<<6|c3&63),t+=3);return r}},MD5=function(n){function a(n,t){return n<<t|n>>>32-t}function o(n,t){var f,e,r,u,i;return(r=n&2147483648,u=t&2147483648,f=n&1073741824,e=t&1073741824,i=(n&1073741823)+(t&1073741823),f&e)?i^2147483648^r^u:f|e?i&1073741824?i^3221225472^r^u:i^1073741824^r^u:i^r^u}function yt(n,t,i){return n&t|~n&i}function pt(n,t,i){return n&i|t&~i}function wt(n,t,i){return n^t^i}function bt(n,t,i){return t^(n|~i)}function s(n,t,i,r,u,f,e){return n=o(n,o(o(yt(t,i,r),u),e)),o(a(n,f),t)}function h(n,t,i,r,u,f,e){return n=o(n,o(o(pt(t,i,r),u),e)),o(a(n,f),t)}function c(n,t,i,r,u,f,e){return n=o(n,o(o(wt(t,i,r),u),e)),o(a(n,f),t)}function l(n,t,i,r,u,f,e){return n=o(n,o(o(bt(t,i,r),u),e)),o(a(n,f),t)}function kt(n){for(var r,u=n.length,o=u+8,s=(o-o%64)/64,e=(s+1)*16,i=Array(e-1),f=0,t=0;t<u;)r=(t-t%4)/4,f=t%4*8,i[r]=i[r]|n.charCodeAt(t)<<f,t++;return r=(t-t%4)/4,f=t%4*8,i[r]=i[r]|128<<f,i[e-2]=u<<3,i[e-1]=u>>>29,i}function v(n){for(var i="",r="",u,t=0;t<=3;t++)u=n>>>t*8&255,r="0"+u.toString(16),i=i+r.substr(r.length-2,2);return i}function dt(n){var i,r,t;for(n=n.replace(/\r\n/g,"\n"),i="",r=0;r<n.length;r++)t=n.charCodeAt(r),t<128?i+=String.fromCharCode(t):t>127&&t<2048?(i+=String.fromCharCode(t>>6|192),i+=String.fromCharCode(t&63|128)):(i+=String.fromCharCode(t>>12|224),i+=String.fromCharCode(t>>6&63|128),i+=String.fromCharCode(t&63|128));return i}var e=Array(),f,ht,ct,lt,at,t,i,r,u,y=7,p=12,w=17,b=22,k=5,d=9,g=14,nt=20,tt=4,it=11,rt=16,ut=23,ft=6,et=10,ot=15,st=21,vt;for(n=dt(n),e=kt(n),t=1732584193,i=4023233417,r=2562383102,u=271733878,f=0;f<e.length;f+=16)ht=t,ct=i,lt=r,at=u,t=s(t,i,r,u,e[f+0],y,3614090360),u=s(u,t,i,r,e[f+1],p,3905402710),r=s(r,u,t,i,e[f+2],w,606105819),i=s(i,r,u,t,e[f+3],b,3250441966),t=s(t,i,r,u,e[f+4],y,4118548399),u=s(u,t,i,r,e[f+5],p,1200080426),r=s(r,u,t,i,e[f+6],w,2821735955),i=s(i,r,u,t,e[f+7],b,4249261313),t=s(t,i,r,u,e[f+8],y,1770035416),u=s(u,t,i,r,e[f+9],p,2336552879),r=s(r,u,t,i,e[f+10],w,4294925233),i=s(i,r,u,t,e[f+11],b,2304563134),t=s(t,i,r,u,e[f+12],y,1804603682),u=s(u,t,i,r,e[f+13],p,4254626195),r=s(r,u,t,i,e[f+14],w,2792965006),i=s(i,r,u,t,e[f+15],b,1236535329),t=h(t,i,r,u,e[f+1],k,4129170786),u=h(u,t,i,r,e[f+6],d,3225465664),r=h(r,u,t,i,e[f+11],g,643717713),i=h(i,r,u,t,e[f+0],nt,3921069994),t=h(t,i,r,u,e[f+5],k,3593408605),u=h(u,t,i,r,e[f+10],d,38016083),r=h(r,u,t,i,e[f+15],g,3634488961),i=h(i,r,u,t,e[f+4],nt,3889429448),t=h(t,i,r,u,e[f+9],k,568446438),u=h(u,t,i,r,e[f+14],d,3275163606),r=h(r,u,t,i,e[f+3],g,4107603335),i=h(i,r,u,t,e[f+8],nt,1163531501),t=h(t,i,r,u,e[f+13],k,2850285829),u=h(u,t,i,r,e[f+2],d,4243563512),r=h(r,u,t,i,e[f+7],g,1735328473),i=h(i,r,u,t,e[f+12],nt,2368359562),t=c(t,i,r,u,e[f+5],tt,4294588738),u=c(u,t,i,r,e[f+8],it,2272392833),r=c(r,u,t,i,e[f+11],rt,1839030562),i=c(i,r,u,t,e[f+14],ut,4259657740),t=c(t,i,r,u,e[f+1],tt,2763975236),u=c(u,t,i,r,e[f+4],it,1272893353),r=c(r,u,t,i,e[f+7],rt,4139469664),i=c(i,r,u,t,e[f+10],ut,3200236656),t=c(t,i,r,u,e[f+13],tt,681279174),u=c(u,t,i,r,e[f+0],it,3936430074),r=c(r,u,t,i,e[f+3],rt,3572445317),i=c(i,r,u,t,e[f+6],ut,76029189),t=c(t,i,r,u,e[f+9],tt,3654602809),u=c(u,t,i,r,e[f+12],it,3873151461),r=c(r,u,t,i,e[f+15],rt,530742520),i=c(i,r,u,t,e[f+2],ut,3299628645),t=l(t,i,r,u,e[f+0],ft,4096336452),u=l(u,t,i,r,e[f+7],et,1126891415),r=l(r,u,t,i,e[f+14],ot,2878612391),i=l(i,r,u,t,e[f+5],st,4237533241),t=l(t,i,r,u,e[f+12],ft,1700485571),u=l(u,t,i,r,e[f+3],et,2399980690),r=l(r,u,t,i,e[f+10],ot,4293915773),i=l(i,r,u,t,e[f+1],st,2240044497),t=l(t,i,r,u,e[f+8],ft,1873313359),u=l(u,t,i,r,e[f+15],et,4264355552),r=l(r,u,t,i,e[f+6],ot,2734768916),i=l(i,r,u,t,e[f+13],st,1309151649),t=l(t,i,r,u,e[f+4],ft,4149444226),u=l(u,t,i,r,e[f+11],et,3174756917),r=l(r,u,t,i,e[f+2],ot,718787259),i=l(i,r,u,t,e[f+9],st,3951481745),t=o(t,ht),i=o(i,ct),r=o(r,lt),u=o(u,at);return vt=v(t)+v(i)+v(r)+v(u),vt.toLowerCase()},AAUtility={SetFundsCookie:function(n,t,r,u){var f=$.cookie("Funds"),o=[],s="",e,h;if(f!=null&&f!=undefined&&f.length!="")for(f=f.split("&"),i=0;i<f.length;i++)f[i].split("=")[0]==n?s=f[i].split("=")[1]:o.push(f[i]);u=n.toUpperCase()=="BROWSERHISTORY"?10:u;s=s.split(",");e=s.filter(function(n){return t!=n&&n!=""});e.splice(0,0,t);!isNaN(u)&&u>0&&e.length>u&&(e=e.splice(0,u));o.splice(0,0,n+"="+e.join(","));h=new Date;o=o.join("&");h.setTime(h.getTime()+31536e6);$.cookie("Funds",o,{expires:h,path:"/",domain:r})},SetUSCookie:function(n,t,r,u){var f=$.cookie("USStock"),o=[],s="",e,h;if(f!=null&&f!=undefined&&f.length!="")for(f=f.split("&"),i=0;i<f.length;i++)f[i].split("=")[0]==n?s=f[i].split("=")[1]:o.push(f[i]);u=n.toUpperCase()=="BROWSERHISTORY"?5:u;s=s.split(",");e=s.filter(function(n){return t!=n&&n!=""});e.splice(0,0,t);!isNaN(u)&&u>0&&e.length>u&&(e=e.splice(0,u));o.splice(0,0,n+"="+e.join(","));h=new Date;o=o.join("&");h.setTime(h.getTime()+31536e6);$.cookie("USStock",o,{expires:h,path:"/",domain:r})},SetMasterSymbol:function(n,t,i){if(n!=null&&n!=""&&!isNaN(n)){var r=new Date,u="MasterSymbol";r.setTime(r.getTime()+31536e6);switch(t.toUpperCase()){case"SZ":case"SH":u="SHMasterSymbol"}$.cookie(u,n,{expires:r,path:"/",domain:i})}},GetHKSymbolListCookie:function(){var n=$.cookie("LatestRTQuotedStocks"),i=[],t,r;if(n!=null)for(n=n.split("%3B"),t=n.length-1;t>=0;t--)n[t]!=""&&parseInt(n[t])>0&&(r=("00000"+n[t]).slice(-5),i.indexOf(r)<0&&i.push(r));return i},AddHKSymbol:function(n,t){var f,u;if(n!=null&&n!=""&&!isNaN(n)){f=new Date;f.setTime(f.getTime()+31536e6);var e="LatestRTQuotedStocks",i=$.cookie(e),r=[];if(n=("00000"+n).slice(-5),i!=null)for(i=i.split("%3B"),i=i.map(function(n){return("00000"+n).slice(-5)}).filter(function(t){return n!=t&&t!="00000"}),u=i.length-1;u>=0;u--)r.indexOf(i[u])<0&&r.unshift(i[u]);r.push(n);r.length>20&&(r=r.slice(r.length-20));$.cookie(e,r.join("%3B"),{expires:f,path:"/",domain:t})}},AddSHSymbol:function(n,t){var e,u,s;if(n!=null&&n!=""){n.indexOf(".SH")==-1&&(n=n+".SH");e=new Date;e.setTime(e.getTime()+31536e6);var r=$.cookie("CNHK"),o="BrowserHistory",f=[],i=[];if(r!=null)for(r=r.split("&"),u=0;u<r.length;u++)r[u].split("=")[0]!=o?f.push(r[u]):(i=r[u].split("=")[1].split(","),i=i.filter(function(t){return n!=t&&t!=""}));i.splice(0,0,n);i.length>20&&(i=i.splice(0,20));f.splice(0,0,o+"="+i.join(","));s=new Date;f=f.join("&");$.cookie("CNHK",f,{expires:e,path:"/",domain:t})}},AddSZSymbol:function(n,t){var e,u,s;if(n!=null&&n!=""){n.indexOf(".SZ")==-1&&(n=n+".SZ");e=new Date;e.setTime(e.getTime()+31536e6);var r=$.cookie("CNHK"),o="BrowserHistory",f=[],i=[];if(r!=null)for(r=r.split("&"),u=0;u<r.length;u++)r[u].split("=")[0]!=o?f.push(r[u]):(i=r[u].split("=")[1].split(","),i=i.filter(function(t){return n!=t&&t!=""}));i.splice(0,0,n);i.length>20&&(i=i.splice(0,20));f.splice(0,0,o+"="+i.join(","));s=new Date;f=f.join("&");$.cookie("CNHK",f,{expires:e,path:"/",domain:t})}},AddUSSymbol:function(n,t){var e,u,s;if(n!=null&&n!=""){e=new Date;e.setTime(e.getTime()+31536e6);var r=$.cookie("USStock"),o="BrowserHistory",f=[],i=[];if(r!=null)for(r=r.split("&"),u=0;u<r.length;u++)r[u].split("=")[0]!=o?f.push(r[u]):(i=r[u].split("=")[1].split(","),i=i.filter(function(t){return n.toUpperCase()!=t.toUpperCase()&&t!=""}));i.splice(0,0,n.toUpperCase());i.length>20&&(i=i.splice(0,20));f.splice(0,0,o+"="+i.join(","));s=new Date;f=f.join("&");$.cookie("USStock",f,{expires:e,path:"/",domain:t})}},EnableVideo:function(){return typeof document.createElement("video").canPlayType=="function"},EnableAALive:function(){var n=this.BrowserVersion();return!(n.browser.name=="IE"&&n.browser.version<=10)},IsVideoDefaultMuted:function(){var n=this.BrowserVersion();return n.browser.name=="Chrome"||n.browser.name=="Safari"},IsVideoNews:function(n){return n==null||n==""?!1:n.slice(0,5)=="AATV."},IsMobileBrowser:function(){return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(window.navigator.userAgent)},BrowserVersion:function(){var r={width:window.innerWidth?window.innerWidth:0,height:window.innerHeight?window.innerHeight:0,browser:{name:"-",version:0,major:0},isMobile:/Android|webOS|BlackBerry|IEMobile|Opera Mini|iP(ad|od|hone)/.test(window.navigator.userAgent),os:{name:"-",version:"-"}},o,c,s;try{var l=navigator.appVersion?navigator.appVersion:"",n=navigator.userAgent?navigator.userAgent:"",u=navigator.appName?navigator.appName:"",t=""+parseFloat(navigator.appVersion),e=parseInt(navigator.appVersion,10),h,i,f;(i=n.indexOf("Opera"))!=-1?(u="Opera",t=n.substring(i+6),(i=n.indexOf("Version"))!=-1&&(t=n.substring(i+8))):(i=n.indexOf("Edge"))!=-1?(u="Edge",t=n.substring(i+5)):(i=n.indexOf("MSIE"))!=-1?(u="IE",t=n.substring(i+5)):u=="Netscape"&&n.indexOf("Trident/")!=-1?(u="IE",t=n.substring(i+5),(i=n.indexOf("rv:"))!=-1&&(t=n.substring(i+3))):(i=n.indexOf("Chrome"))!=-1?(u="Chrome",t=n.substring(i+7)):(i=n.indexOf("Safari"))!=-1?(u="Safari",t=n.substring(i+7),(i=n.indexOf("Version"))!=-1&&(t=n.substring(i+8)),n.indexOf("CriOS")!=-1&&(u="Chrome")):(i=n.indexOf("Firefox"))!=-1?(u="Firefox",t=n.substring(i+8)):(h=n.lastIndexOf(" ")+1)<(i=n.lastIndexOf("/"))&&(u=n.substring(h,i),t=n.substring(i+1),u.toLowerCase()==u.toUpperCase()&&(u=navigator.appName));(f=t.indexOf(";"))!=-1&&(t=t.substring(0,f));(f=t.indexOf(" "))!=-1&&(t=t.substring(0,f));(f=t.indexOf(")"))!=-1&&(t=t.substring(0,f));e=parseInt(""+t,10);isNaN(e)&&(t=""+parseFloat(navigator.appVersion),e=parseInt(navigator.appVersion,10));r.browser.name=u;r.browser.version=e;r.browser.major=t;o=[{s:"Windows 10",r:/(Windows 10.0|Windows NT 10.0)/},{s:"Windows 8.1",r:/(Windows 8.1|Windows NT 6.3)/},{s:"Windows 8",r:/(Windows 8|Windows NT 6.2)/},{s:"Windows 7",r:/(Windows 7|Windows NT 6.1)/},{s:"Windows Vista",r:/Windows NT 6.0/},{s:"Windows Server 2003",r:/Windows NT 5.2/},{s:"Windows XP",r:/(Windows NT 5.1|Windows XP)/},{s:"Windows 2000",r:/(Windows NT 5.0|Windows 2000)/},{s:"Windows ME",r:/(Win 9x 4.90|Windows ME)/},{s:"Windows 98",r:/(Windows 98|Win98)/},{s:"Windows 95",r:/(Windows 95|Win95|Windows_95)/},{s:"Windows NT 4.0",r:/(Windows NT 4.0|WinNT4.0|WinNT|Windows NT)/},{s:"Windows CE",r:/Windows CE/},{s:"Windows 3.11",r:/Win16/},{s:"Android",r:/Android/},{s:"Open BSD",r:/OpenBSD/},{s:"Sun OS",r:/SunOS/},{s:"Linux",r:/(Linux|X11)/},{s:"iOS",r:/(iPhone|iPad|iPod)/},{s:"Mac OS X",r:/Mac OS X/},{s:"Mac OS",r:/(MacPPC|MacIntel|Mac_PowerPC|Macintosh)/},{s:"QNX",r:/QNX/},{s:"UNIX",r:/UNIX/},{s:"BeOS",r:/BeOS/},{s:"OS/2",r:/OS\/2/},{s:"Search Bot",r:/(nuhk|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask Jeeves\/Teoma|ia_archiver)/}];for(c in o)if(s=o[c],s.r.test(n)){r.os.name=s.s;break}/Windows/.test(r.os.name)&&(r.os.version=/Windows (.*)/.exec(r.os.name)[1],r.os.name="Windows");switch(r.os.name){case"Mac OS X":r.os.version=/Mac OS X (10[\.\_\d]+)/.exec(n)[1];break;case"Android":r.os.version=/Android ([\.\_\d]+)/.exec(n)[1];break;case"iOS":r.os.version=/OS (\d+)_(\d+)_?(\d+)?/.exec(l);r.os.version=r.os.version[1]+"."+r.os.version[2]+"."+(r.os.version[3]|0)}}catch(a){}return r},getLocalStorage:function(n,t){var i=null,r;try{if(i=window.localStorage.getItem(n),i!=null)return(r=JSON.parse(i),t==null)?r:r[t]}catch(u){}return null},setLocalStorage:function(n,t,i){var r={},u=null;try{u=window.localStorage.getItem(n);u!=null&&(r=JSON.parse(u));i==null?r=t:r[t]=i;window.localStorage.setItem(n,JSON.stringify(r))}catch(f){}},clearLocalStorage:function(n,t){var i=null,r;try{i=window.localStorage.getItem(n);i!=null&&(r=JSON.parse(i),r[t]=null,delete r[t],window.localStorage.setItem(n,JSON.stringify(r)))}catch(u){}},GetNewsVotingToken:function(n,t){var r="",i=new Date,u=i.getTime()+i.getTimezoneOffset()*6e4;return i=new Date(u+288e5),r+=i.getFullYear().toString(),r+=i.getMonth()+1<10?"0"+(i.getMonth()+1):i.getMonth()+1,r+=i.getDate()<10?"0"+i.getDate():i.getDate(),r+=i.getHours()<10?"0"+i.getHours():i.getHours(),r+=i.getMinutes()<10?"0"+i.getMinutes():i.getMinutes(),Base64.encode(n.toUpperCase()+","+r+","+t)},getExpiryDate:function(){var n=new Date;return n.setTime(n.getTime()+31536e6),n},exportToExcel:function(n,t,i,r){var h=new TableExport(r,{headers:!0,footers:!0,formats:["xlsx"],filename:n,bootstrap:!1,exportButtons:!1,position:"bottom",ignoreRows:null,ignoreCols:null,trimWhitespace:!0,RTL:!1,sheetname:t}),f,e;TableExport.prototype.typeConfig.number.assert=function(){return!1};TableExport.prototype.typeConfig.boolean.assert=function(){return!1};TableExport.prototype.typeConfig.date.assert=function(){return!1};var v=h.getExportData(),u=v[i].xlsx,o=[];$.each($(r).find("thead > tr"),function(n,t){var i=0;$.each($(t).find("th"),function(n,t){for(var n=0;n<(parseInt($(t).attr("colspan"))||1);n++)i<o.length?o[i]==""&&(o[i]=$(t).data("export-type")||""):o.push($(t).data("export-type")||""),i++})});var c=o.length,s=[],l=5,a=30;for(f=0;f<c;f++)s.push({wch:15});for(f=0;f<u.data.length;f++)for(e=0;e<u.data[f].length;e++)u.data[f][e]!=null&&(u.data[f][e].s={alignment:{horizontal:"center",vertical:"center",wrapText:1}},u.data[f].length<=c&&(s[e].wch<u.data[f][e].v.length+l&&(s[e].wch=u.data[f][e].v.length+l),s[e].wch>a&&(s[e].wch=a),f>0&&o[e]=="n"&&u.data[f][e].v.match(/\d+/g)&&(u.data[f][e].v=u.data[f][e].v.replace(/[^\d\.\-]/g,""),u.data[f][e].t="n")));h.export2file(u.data,u.mimeType,u.filename,u.fileExtension,u.merges,u.RTL,u.sheetname,s)},FormatPrice:function(n,t,i,r,u,f){function s(n){return!isNaN(parseFloat(n))&&isFinite(n)}function h(n){return n}var e,o;if(!s(n)||!s(t))return h(r);if(e=u?"#,##0":"###0",n==0&&(n=h(i),!s(n)))return n;if(t==-1)n<100?e=e+".000":n>=100&&n<1e3&&(e=e+".00");else for(e=e+".",o=0;o<t;o++)e=e+"0";return n.toString().format(e)+f},GetCurrentTimeStr:function(){var t=new Date,n=new Date(t.getTime()+t.getTimezoneOffset()*6e4+288e5);return n.getFullYear()+("0"+(n.getMonth()+1).toString()).slice(-2)+("0"+n.getDate().toString()).slice(-2)+("0"+n.getHours().toString()).slice(-2)+("0"+n.getMinutes().toString()).slice(-2)+("0"+n.getSeconds().toString()).slice(-2)}},AADataCenter={GetStockRecentNews:function(n,t){var i=n.recordCount||10,r=n.isDefault||"",u=n.showImage?"Y":"N",f=hostUrl;$.ajax({url:f+"resources/datafeed/getstockrecentnews.ashx",data:{rc:i,"default":r,img:u},async:!0,dataType:"json",error:function(){typeof t=="function"&&t({status:"E"})},success:function(n){typeof t=="function"&&(n=="1"||n==""?t({status:"N"}):t({status:"S",data:n}))}})},GetNews:function(n,t){var i=hostUrl;$.ajax({url:i+"resources/datafeed/getnews.ashx",data:n.param,async:!0,dataType:"json",error:function(n,i){typeof t=="function"&&t({status:"E",msg:i})},success:function(n){typeof t=="function"&&(n=="1"||n==""?t({status:"N"}):t({status:"S",data:n}))}})},GetActiveStock:function(n,t){var i=hostUrl;$.ajax({url:i+"resources/datafeed/gethkactivestock.ashx",data:n.param,async:!0,dataType:"json",error:function(n,i){typeof t=="function"&&t({status:"E",msg:i})},success:function(n){typeof t=="function"&&(n=="1"||n==""?t({status:"N"}):t({status:"S",data:n}))}})},GetActiveStockCNHK:function(n,t){var i=hostUrl;$.ajax({url:i+"resources/datafeed/getactivestock.ashx",data:n.param,async:!0,dataType:"json",error:function(n,i){typeof t=="function"&&t({status:"E",msg:i})},success:function(n){typeof t=="function"&&(n=="1"||n==""?t({status:"N"}):t({status:"S",data:n}))}})},GetLatestSearch:function(n,t){function u(n){var u=[],i,t,r,o;if(n=f(n),i=n.split(String.fromCharCode(28)),i!=null&&i.length>0&&(t=i[0].split(String.fromCharCode(29)),t!=null&&t.length>0))for(r=0;r<t.length;r++)o=t[r].split(String.fromCharCode(31)),u.push(e(o));return u}function f(n){return $("<div><\/div>").html(n).text()}function e(n){var r={},u=3,t;if(u=n[3]=="SHEx"?2:3,r={id:"",s:"",name:"",exchangeMarket:"",dp:function(){return this.exchangeMarket=="SHEx"?2:3},last_update:"",prev_close:"",last:"",highlow_Indicator:"",news_counter_chi:"",news_counter_chn:"",news_counter_eng:"",change:function(){var n=null,u=null,t="",i=this.getPrevClose(),r=this.last.replace(",","");return!isNaN(i)&&!isNaN(r)&&parseFloat(r)>0&&parseFloat(i)>0?(_chg=parseFloat(r)-parseFloat(i),_pctChg=_chg/parseFloat(i)*100,n=_chg.toFixed(this.dp()),u=Math.abs(_pctChg).toFixed(3)+"%",n>0?(t="+",n=t+n):t=n<0?"-":"=",{c:n,pc:u,cs:t,_c:_chg,_pc:_pctChg}):{c:"-",pc:"-",cs:"",_c:0,_pc:0}},exDate:"",isExDate:function(){return(new Date).toDateString()==new Date(this.exDate).toDateString()},weeklychg:"",weeklychange:function(){var t=null,n=null,i="",r=this.weeklychg.replace(",",""),u=this.last.replace(",","");return!isNaN(r)&&!isNaN(u)&&parseFloat(u)>0&&parseFloat(r)>0?(t=parseFloat(u)-parseFloat(r),n=t/parseFloat(r)*100,t=t.toFixed(this.dp()),n=Math.abs(n).toFixed(3)+"%",t>0?(i="+",n=i+n):t<0?(i="-",n=i+n):i="=",{c:t,pc:n,cs:i}):{c:"-",pc:"-",cs:""}},ipoOfferingPrice:"",listingDate:"",getPrevClose:function(){var n,i,t;return this.ipoOfferingPrice==""||this.listingDate==""?this.prev_close.replace(",",""):this.listingDate!=""&&((n=new Date(this.listingDate+"T00:00:00+08:00"),i=new Date,n.isTheSameDate(i))||n.getDay()==5&&(n.setDate(n.getDate()+3),t=new Date(n.getTime()),t.setHours(t.getHours()+6),t>i))?this.ipoOfferingPrice.replace(",",""):this.prev_close.replace(",","")}},n.length==18)for(t=0;t<n.length;t++)switch(t){case 0:r.id=n[t];break;case 1:r.s=n[t];break;case 2:r.name=n[t];break;case 3:r.exchangeMarket=n[t];break;case 4:r.weeklychg=n[t]=="N/A"?"-":i(n[t],u,"-","-",!0);break;case 5:r.exDate=n[t];break;case 6:r.ipoOfferingPrice=n[t];break;case 7:r.listingDate=n[t];break;case 8:r.last_update=n[t];break;case 9:r.prev_close=n[t];break;case 10:r.last=n[t]=="N/A"?"-":i(n[t],u,"-","-",!0);break;case 13:r.highlow_Indicator=n[t];break;case 14:r.news_counter_chi=n[t];break;case 15:r.news_counter_chn=n[t];break;case 16:r.news_counter_eng=n[t];break;case 17:r.highlow_Indicator=n[t]}return r}function i(n,t,i,r,u){if(!(!isNaN(parseFloat(n))&&isFinite(n)))return r;var f=u?"#,##0":"###0";return n==0&&(n=i,!(!isNaN(parseFloat(n))&&isFinite(n)))?n:(n<100?f=t==2?f+".00":f+".000":n>=100&&n<1e3&&(f=f+".00"),n.toString().format(f))}var r=n.url||hostUrl;$.ajax({url:r+"/g2ce/Quote/getQuote?format=text"+n.token,data:{grp0:n.symbol+"|"+n.group0},async:!0,dataType:"text",error:function(n,i){typeof t=="function"&&t({status:"E",msg:i})},success:function(n){var i=u(n);typeof t=="function"&&(n&&n.length!=0?t({status:"S",data:i}):t({status:"N"}))}})},GetMoreNews:function(n,t){var i=hostUrl;$.ajax({url:i+"resources/datafeed/getmorenews.ashx",data:n.param,async:!0,dataType:"json",error:function(n,i){typeof t=="function"&&t({status:"E",msg:i})},success:function(n){typeof t=="function"&&(n=="1"||n==""?t({status:"N"}):n=="2"?t({status:"E",msg:"Datafeed System Error"}):t({status:"S",data:n}))},complete:function(){typeof t=="function"&&t({status:"C"})}})},GetLiveVideoConfig:function(n,t){var i=hostUrl;$.ajax({url:i+"resources/datafeed/liveconfig.json?",async:!0,dataType:"json",error:function(n,i){typeof t=="function"&&t({status:"E",msg:i})},success:function(n){typeof t=="function"&&t({status:"S",data:n})}})},GetServerTime:function(n,t){function r(n){var t={};return t.clientTime=new Date,t.serverTime=u(n)||t.clientTime,t._clientTime=t.clientTime.getTime(),t._serverTime=t.serverTime.getTime(),t.timeDiff=t._serverTime-t._clientTime,t}function u(n){var i=null,t;return n!=null&&n.length>0&&(t=new Date(n),isNaN(t.getTime())||(i=t)),i}var i=hostUrl;$.ajax({url:i+"resources/datafeed/getservertime.ashx",timeout:3e3,async:!0,dataType:"text",error:function(n,i){typeof t=="function"&&t({status:"E",msg:i})},success:function(n){var i=r(n);typeof t=="function"&&(n&&n.length!=0?t({status:"S",data:i}):t({status:"N"}))}})},GetEconCalendar:function(n,t){var i=hostUrl;$.ajax({url:i+"resources/datafeed/geteconcalendar.ashx",data:n.param,timeout:3e3,async:!0,dataType:"json",error:function(n,i){typeof t=="function"&&t({status:"E",msg:i})},success:function(n){typeof t=="function"&&(n=="1"||n==""?t({status:"N"}):n=="2"||n=="0"?t({status:"E",msg:"Datafeed System Error"}):t({status:"S",data:n}))}})},GetProfileImage:function(n,t){var i=hostUrl;$.ajax({url:i+"resources/datafeed/getprofileimage.ashx",data:n.param,timeout:3e3,async:!0,dataType:"text",error:function(n,i){typeof t=="function"&&t({status:"E",msg:i})},success:function(n){typeof t=="function"&&(n=="1"||n==""?t({status:"N"}):n=="2"||n=="0"?t({status:"E",msg:"Datafeed System Error"}):t({status:"S",data:n}))}})}},AATVConfig={autoPlay:!0,volume:1,saveConfig:function(){var n="";n+="autoplay="+(this.autoPlay?"1":"0");n+="&vol="+this.volume;$.cookie("aatv_config",n,{expires:AAUtility.getExpiryDate(),path:"/",domain:fullCookiesDomain})},loadConfig:function(){var n=$.cookie("aatv_config"),t;if(n!=null)for(n=n.split("&"),t=0;t<n.length;t++)switch(n[t].split("=")[0]){case"autoplay":this.autoPlay=n[t].split("=")[1]=="1"?!0:!1;break;case"vol":this.volume=parseFloat(n[t].split("=")[1])||1}},init:function(){this.loadConfig()}};AATVConfig.init();var AAMemberHandler={getLoginMemberID:function(){return GetCookiesValue("Login","mbr_id")},getLoginUserName:function(){return GetCookiesValue("Login","uname")},isLoginUser:function(){return this.getLoginMemberID()!=null&&this.getLoginMemberID()!=""}},AAPageData={memberInfo:function(){function i(){AAUtility.setLocalStorage("AAMemberInfo",n)}function r(){var i=AAUtility.getLocalStorage("AAMemberInfo");i==null||$.isEmptyObject(i)?t=!1:(t=!0,n.m=i.m,n.p=i.p,n.t=i.t)}function u(){AAUtility.clearLocalStorage("AAMemberInfo","m");AAUtility.clearLocalStorage("AAMemberInfo","p");AAUtility.clearLocalStorage("AAMemberInfo","t")}var n={m:"",p:"",t:null},t=!1;return this.isStorageData=function(){return t},this.getMemberID=function(){return n.m},this.getProfileImage=function(){return n.p},this.getNextExpiry=function(){return new Date(n.t)},this.setMemberID=function(t){n.m=t},this.setProfileImage=function(t){n.p=t},this.setNextExpiry=function(t){var i=new Date;i.setMinutes(i.getMinutes()+t);n.t=i.getTime()},this.isExpired=function(){return n.t!=null&&n.t>0&&new Date<this.getNextExpiry()?!1:!0},this.save=function(){i()},this.load=function(){r()},this.clear=function(){u()},this},usEconCal:function(){function i(){AAUtility.setLocalStorage("AAEconCalendar",n)}function r(){var i=AAUtility.getLocalStorage("AAEconCalendar");i==null||$.isEmptyObject(i)?t=!1:(t=!0,n.c.d=i.c.d,n.p.t=i.p.t,n.p.d=i.p.d)}var n={c:{d:[]},p:{t:1,d:[]}},t=!1;return this.isStorageData=function(){return t},this.getCountry=function(t){switch(t){case"data":default:return n.c.d}},this.getPeriod=function(t){switch(t){case"type":return n.p.t;case"data":default:return n.p.d}},this.setCountry=function(t,i){switch(t){case"add":typeof i=="number"&&n.c.d.indexOf(i)<0&&n.c.d.push(i);break;case"set":typeof i=="object"&&(n.c.d=i);break;case"remove":typeof i=="number"&&n.c.d.indexOf(i)>=0&&n.c.d.splice(n.c.d.indexOf(i),1)}},this.setPeriod=function(t,i,r){switch(t){case"set":typeof i=="number"&&(n.p.t=i);typeof r=="object"&&(n.p.d=r)}},this.save=function(){i()},this.load=function(){r()},this},fxEconCal:function(){function i(){AAUtility.setLocalStorage("AAFXEconCalendar",n)}function r(){var i=AAUtility.getLocalStorage("AAFXEconCalendar");i==null||$.isEmptyObject(i)?t=!1:(t=!0,n.c.d=i.c.d,n.p.t=i.p.t,n.p.d=i.p.d)}var n={c:{d:[]},p:{t:1,d:[]}},t=!1;return this.isStorageData=function(){return t},this.getCountry=function(t){switch(t){case"data":default:return n.c.d}},this.getPeriod=function(t){switch(t){case"type":return n.p.t;case"data":default:return n.p.d}},this.setCountry=function(t,i){switch(t){case"add":typeof i=="number"&&n.c.d.indexOf(i)<0&&n.c.d.push(i);break;case"set":typeof i=="object"&&(n.c.d=i);break;case"remove":typeof i=="number"&&n.c.d.indexOf(i)>=0&&n.c.d.splice(n.c.d.indexOf(i),1)}},this.setPeriod=function(t,i,r){switch(t){case"set":typeof i=="number"&&(n.p.t=i);typeof r=="object"&&(n.p.d=r)}},this.save=function(){i()},this.load=function(){r()},this},fxTopIndex:function(){function i(){AAUtility.setLocalStorage("AAFXTopIndex",n)}function r(){var i=AAUtility.getLocalStorage("AAFXTopIndex");i==null||$.isEmptyObject(i)?t=!1:(t=!0,n.p=i.p,n.i=i.i)}var n={p:!0,i:0},t=!1;return this.isStorageData=function(){return t},this.isPlaying=function(){return n.p},this.getIndex=function(){return n.i},this.setPlaying=function(t){n.p=t},this.setIndex=function(t){n.i=t},this.save=function(){i()},this.load=function(){r()},this},fxHistory:function(){function r(){AAUtility.setLocalStorage("AAFXHistory",n)}function u(){var i=AAUtility.getLocalStorage("AAFXHistory");i==null||$.isEmptyObject(i)?t=!1:(t=!0,n.h=i.h)}var n={h:[]},i={s:"",t:""},t=!1;return this.isStorageData=function(){return t},this.getHistory=function(t){return typeof t!="undefined"&&t!=null&&t!=""?n.h.filter(function(n){return n.t==t}):n.h},this.getHistoryJSON=function(t,i){for(var o=[],u,f,e,r=0;r<n.h.length;r++)u="",n.h[r].t=="CT"?u=i[n.h[r].s]||"":n.h[r].s.length==6&&(f=t[n.h[r].s.slice(0,3)]||"",e=t[n.h[r].s.slice(3)]||"",f!=""&&e!=""&&(u=f+"/"+e)),u!=""&&o.push({symbol:n.h[r].s,desp:u,type:n.h[r].t});return o},this.getHistoryParamString=function(n){return this.getHistory(n).map(function(n){return n.s}).join(",")},this.getLatest=function(n){return this.getHistory(n).length>0?this.getHistory(n)[0]:""},this.setHistory=function(t){n.h=t},this.addHistory=function(t,r){this.removeHistory(r);var u=$.extend(!0,{},i);u.t=t;u.s=r;n.h.unshift(u)},this.removeHistory=function(t){var i=n.h.map(function(n){return n.s}).indexOf(t);i>=0&&n.h.splice(i,1)},this.clearHistory=function(t){n.h=typeof t!="undefined"&&t!=null&&t!=""?n.h.filter(function(n){return n.t!=t}):[]},this.save=function(){r()},this.load=function(){u()},this},hkTopIndex:function(){function i(){AAUtility.setLocalStorage("AAHKTopIndex",n)}function r(){var i=AAUtility.getLocalStorage("AAHKTopIndex");i==null||$.isEmptyObject(i)?t=!1:(t=!0,n.p=i.p,n.i=i.i)}var n={p:!0,i:0},t=!1;return this.isStorageData=function(){return t},this.isPlaying=function(){return n.p},this.getIndex=function(){return n.i},this.setPlaying=function(t){n.p=t},this.setIndex=function(t){n.i=t},this.save=function(){i()},this.load=function(){r()},this},hkMiniQuote:function(){function i(){AAUtility.setLocalStorage("AAHKMiniQuote",n)}function r(){var i=AAUtility.getLocalStorage("AAHKMiniQuote");i==null||$.isEmptyObject(i)?t=!1:(t=!0,n.c=i.c,n.i=i.i)}var n={c:15,i:["HSI","HSTECH","HSCEI"]},t=!1;return this.isStorageData=function(){return t},this.getCount=function(){return n.c},this.getIndexSel=function(){return n.i},this.setCount=function(t){n.c=t},this.setIndexSel=function(t){n.i=t},this.save=function(){i()},this.load=function(){r()},this}},AARedirect={usEconCal:function(n,t,i){function e(n){return typeof n!="undefined"&&n!=null&&!isNaN(n)?[parseInt(n)]:null}function o(n){var f,e;if(typeof n!="undefined"&&n!=null&&!isNaN(n)&&n.toString().length>=6){var r=parseInt(n.toString().substr(0,4)),u=parseInt(n.toString().substr(4,2)),i=new Date(r,u-1,1),t=new Date(r,u,1);return t.setDate(t.getDate()-1),f=i.getFullYear().toString()+("0"+(i.getMonth()+1).toString()).slice(-2)+("0"+i.getDate().toString()).slice(-2),e=t.getFullYear().toString()+("0"+(t.getMonth()+1).toString()).slice(-2)+("0"+t.getDate().toString()).slice(-2),[parseInt(f),parseInt(e)]}return null}var u=e(t),f=o(i),r;u!=null&&f!=null&&(r=new AAPageData.usEconCal,r.setCountry("set",u),r.setPeriod("set",3,f),r.save());window.location.href=n},fxEconCal:function(n,t,i){function e(n){return typeof n!="undefined"&&n!=null&&!isNaN(n)?[parseInt(n)]:null}function o(n){var f,e;if(typeof n!="undefined"&&n!=null&&!isNaN(n)&&n.toString().length>=6){var r=parseInt(n.toString().substr(0,4)),u=parseInt(n.toString().substr(4,2)),i=new Date(r,u-1,1),t=new Date(r,u,1);return t.setDate(t.getDate()-1),f=i.getFullYear().toString()+("0"+(i.getMonth()+1).toString()).slice(-2)+("0"+i.getDate().toString()).slice(-2),e=t.getFullYear().toString()+("0"+(t.getMonth()+1).toString()).slice(-2)+("0"+t.getDate().toString()).slice(-2),[parseInt(f),parseInt(e)]}return null}var r=e(t),u=o(i),f=new AAPageData.fxEconCal;r!=null&&f.setCountry("set",r);u!=null&&f.setPeriod("set",3,u);(r!=null||u!=null)&&f.save();window.location.href=n}}