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]=="5"||n[0]=="6"||n[0]=="9"))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]=="5"||t[0]=="6"||t[0]=="9"?{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]=="5"||t[0]=="6"||t[0]=="9"?{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]=="5"||t[0]=="6"||t[0]=="9"?{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.toUpperCase()}):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.toUpperCase()}):{valid:!0,market:"US",symbol:n.toUpperCase()}}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 ConvertNewsCounter(n,t,i){return"<div class='ts2_icon_map ts2_icon_newscount txt_c pt cls float_l' market='"+i+"' symbol='"+encodeURIComponent(t)+"'>"+n+"<\/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}function GetNewsSourceLabel(n,t,i){if(typeof NewsSource_LABEL=="undefined"||APP_LANG=="eng"||typeof n=="undefined"||(t=typeof t=="undefined"?"":t.toUpperCase(),n!=""&&n.length>3&&n.toUpperCase().substring(0,3)==".HK"))return"";if(t=="AAFN"||t=="AA"||t=="HK6"||t=="DZH"||t=="ECON"||t=="ANUE"||t=="GLH"){if(i==3){var u=GetNewsSourceLabel(n,t,1),r=GetNewsSourceLabel(n,t,0);return"<div class=' newshead-Source' title='"+r+"'><span class='vw980'>"+u+"<\/span><span class='vw1200'>"+r+"<\/span><\/div><div class=' newshead-Source-sep'><\/div>"}return i==1?t=="ANUE"?NewsSource_LABEL.short.anue:t=="GLH"?NewsSource_LABEL.short.glh:NewsSource_LABEL.short.aa:t=="ANUE"?NewsSource_LABEL.full.anue:t=="GLH"?NewsSource_LABEL.full.glh:NewsSource_LABEL.full.aa}return""}(function(n,t){function tt(n){return i.isWindow(n)?n:n.nodeType===9?n.defaultView||n.parentWindow:!1}function yt(n){if(!at[n]){var r=i("<"+n+">").appendTo("body"),t=r.css("display");r.remove();(t==="none"||t==="")&&(t="block");at[n]=t}return at[n]}function o(n,t){var r={};return i.each(nr.concat.apply([],nr.slice(0,t)),function(){r[this]=n}),r}function ir(){try{return new n.ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}function pt(){try{return new n.XMLHttpRequest}catch(t){}}function rr(){i(n).unload(function(){for(var n in h)h[n](0,1)})}function ur(n,r){n.dataFilter&&(r=n.dataFilter(r,n.dataType));for(var v=n.dataTypes,s={},l,p=v.length,a,u=v[0],h,y,f,e,o,c=1;c<p;c++){if(c===1)for(l in n.converters)typeof l=="string"&&(s[l.toLowerCase()]=n.converters[l]);if(h=u,u=v[c],u==="*")u=h;else if(h!=="*"&&h!==u){if(y=h+" "+u,f=s[y]||s["* "+u],!f){o=t;for(e in s)if(a=e.split(" "),(a[0]===h||a[0]==="*")&&(o=s[a[1]+" "+u],o)){e=s[e];e===!0?f=o:o===!0&&(f=e);break}}f||o||i.error("No conversion from "+y.replace(" "," to "));f!==!0&&(r=f?f(r):o(e(r)))}}return r}function fr(n,i,r){var s=n.contents,f=n.dataTypes,c=n.responseFields,o,u,e,h;for(u in c)u in r&&(i[c[u]]=r[u]);while(f[0]==="*")f.shift(),o===t&&(o=n.mimeType||i.getResponseHeader("content-type"));if(o)for(u in s)if(s[u]&&s[u].test(o)){f.unshift(u);break}if(f[0]in r)e=f[0];else{for(u in r){if(!f[0]||n.converters[u+" "+f[0]]){e=u;break}h||(h=u)}e=e||h}if(e)return e!==f[0]&&f.unshift(e),r[e]}function it(n,t,r,u){if(i.isArray(t)&&t.length)i.each(t,function(t,f){r||wu.test(n)?u(n,f):it(n+"["+(typeof f=="object"||i.isArray(f)?t:"")+"]",f,r,u)});else if(r||t==null||typeof t!="object")u(n,t);else if(i.isArray(t)||i.isEmptyObject(t))u(n,"");else for(var f in t)it(n+"["+f+"]",t[f],r,u)}function p(n,i,r,u,f,e){f=f||i.dataTypes[0];e=e||{};e[f]=!0;for(var s=n[f],h=0,l=s?s.length:0,c=n===lt,o;h<l&&(c||!o);h++)o=s[h](i,r,u),typeof o=="string"&&(!c||e[o]?o=t:(i.dataTypes.unshift(o),o=p(n,i,r,u,o,e)));return!c&&o||e["*"]||(o=p(n,i,r,u,"*",e)),o}function wt(n){return function(t,r){if(typeof t!="string"&&(r=t,t="*"),i.isFunction(r))for(var o=t.toLowerCase().split(pi),f=0,h=o.length,u,s,e;f<h;f++)u=o[f],e=/^\+/.test(u),e&&(u=u.substr(1)||"*"),s=n[u]=n[u]||[],s[e?"unshift":"push"](r)}}function bt(n,t,r){var f=t==="width"?au:vu,u=t==="width"?n.offsetWidth:n.offsetHeight;return r==="border"?u:(i.each(f,function(){r||(u-=parseFloat(i.css(n,"padding"+this))||0);r==="margin"?u+=parseFloat(i.css(n,"margin"+this))||0:u-=parseFloat(i.css(n,"border"+this+"Width"))||0}),u)}function er(n,t){t.src?i.ajax({url:t.src,async:!1,dataType:"script"}):i.globalEval(t.text||t.textContent||t.innerHTML||"");t.parentNode&&t.parentNode.removeChild(t)}function w(n){return"getElementsByTagName"in n?n.getElementsByTagName("*"):"querySelectorAll"in n?n.querySelectorAll("*"):[]}function kt(n,t){if(t.nodeType===1){var r=t.nodeName.toLowerCase();t.clearAttributes();t.mergeAttributes(n);r==="object"?t.outerHTML=n.outerHTML:r!=="input"||n.type!=="checkbox"&&n.type!=="radio"?r==="option"?t.selected=n.defaultSelected:(r==="input"||r==="textarea")&&(t.defaultValue=n.defaultValue):(n.checked&&(t.defaultChecked=t.checked=n.checked),t.value!==n.value&&(t.value=n.value));t.removeAttribute(i.expando)}}function dt(n,t){var r,u,f,h;if(t.nodeType===1&&i.hasData(n)){var s=i.expando,e=i.data(n),o=i.data(t,e);if((e=e[s])&&(r=e.events,o=o[s]=i.extend({},e),r)){delete o.handle;o.events={};for(u in r)for(f=0,h=r[u].length;f<h;f++)i.event.add(t,u+(r[u][f].namespace?".":"")+r[u][f].namespace,r[u][f],r[u][f].data)}}}function or(n){return i.nodeName(n,"table")?n.getElementsByTagName("tbody")[0]||n.appendChild(n.ownerDocument.createElement("tbody")):n}function gt(n,t,r){if(i.isFunction(t))return i.grep(n,function(n,i){var u=!!t.call(n,i,n);return u===r});if(t.nodeType)return i.grep(n,function(n){return n===t===r});if(typeof t=="string"){var u=i.grep(n,function(n){return n.nodeType===1});if(nu.test(t))return i.filter(t,u,!r);t=i.filter(t,u)}return i.grep(n,function(n){return i.inArray(n,t)>=0===r})}function ni(n){return!n||!n.parentNode||n.parentNode.nodeType===11}function b(n,t){return(n&&n!=="*"?n+".":"")+t.replace(yr,"`").replace(pr,"&")}function sr(n){var w,c,s,t,r,l,u,f,h,o,a,v,y=[],b=[],p=i._data(this,"events"),e;if(n.liveFired!==this&&p&&p.live&&!n.target.disabled&&(!n.button||n.type!=="click")){for(n.namespace&&(a=new RegExp("(^|\\.)"+n.namespace.split(".").join("\\.(?:.*\\.)?")+"(\\.|$)")),n.liveFired=this,e=p.live.slice(0),u=0;u<e.length;u++)r=e[u],r.origType.replace(d,"")===n.type?b.push(r.selector):e.splice(u--,1);for(t=i(n.target).closest(b,n.currentTarget),f=0,h=t.length;f<h;f++)for(o=t[f],u=0;u<e.length;u++)r=e[u],o.selector!==r.selector||a&&!a.test(r.namespace)||o.elem.disabled||(l=o.elem,s=null,(r.preType==="mouseenter"||r.preType==="mouseleave")&&(n.type=r.preType,s=i(n.relatedTarget).closest(r.selector)[0]),s&&s===l||y.push({elem:l,handleObj:r,level:o.level}));for(f=0,h=y.length;f<h;f++){if(t=y[f],c&&t.level>c)break;if(n.currentTarget=t.elem,n.data=t.handleObj.data,n.handleObj=t.handleObj,v=t.handleObj.origHandler.apply(t.elem,arguments),(v===!1||n.isPropagationStopped())&&(c=t.level,v===!1&&(w=!1),n.isImmediatePropagationStopped()))break}return w}}function ti(n,r,u){var f=i.extend({},u[0]);f.type=n;f.originalEvent={};f.liveFired=t;i.event.handle.call(r,f);f.isDefaultPrevented()&&u[0].preventDefault()}function k(){return!0}function s(){return!1}function rt(n){for(var t in n)if(t!=="toJSON")return!1;return!0}function ii(n,r,u){if(u===t&&n.nodeType===1)if(u=n.getAttribute("data-"+r),typeof u=="string"){try{u=u==="true"?!0:u==="false"?!1:u==="null"?null:i.isNaN(u)?ri.test(u)?i.parseJSON(u):u:parseFloat(u)}catch(f){}i.data(n,r,u)}else u=t;return u}var r=n.document,i=function(){function l(){if(!i.isReady){try{r.documentElement.doScroll("left")}catch(n){setTimeout(l,1);return}i.ready()}}var i=function(n,t){return new i.fn.init(n,t,a)},g=n.jQuery,nt=n.$,a,tt=/^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]+)$)/,v=/\S/,y=/^\s+/,p=/\s+$/,it=/\d/,rt=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,ut=/^[\],:{}\s]*$/,ft=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,et=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,ot=/(?:^|:|,)(?:\s*\[)+/g,st=/(webkit)[ \/]([\w.]+)/,ht=/(opera)(?:.*version)?[ \/]([\w.]+)/,ct=/(msie) ([\w.]+)/,lt=/(mozilla)(?:.*? rv:([\w.]+))?/,at=navigator.userAgent,e,w=!1,o,s="then done fail isResolved isRejected promise".split(" "),u,vt=Object.prototype.toString,h=Object.prototype.hasOwnProperty,c=Array.prototype.push,f=Array.prototype.slice,b=String.prototype.trim,k=Array.prototype.indexOf,d={};return i.fn=i.prototype={constructor:i,init:function(n,u,f){var o,s,e,h;if(!n)return this;if(n.nodeType)return this.context=this[0]=n,this.length=1,this;if(n==="body"&&!u&&r.body)return this.context=r,this[0]=r.body,this.selector="body",this.length=1,this;if(typeof n=="string"){if(o=tt.exec(n),!o||!o[1]&&u)return!u||u.jquery?(u||f).find(n):this.constructor(u).find(n);if(o[1])return u=u instanceof i?u[0]:u,h=u?u.ownerDocument||u:r,e=rt.exec(n),e?i.isPlainObject(u)?(n=[r.createElement(e[1])],i.fn.attr.call(n,u,!0)):n=[h.createElement(e[1])]:(e=i.buildFragment([o[1]],[h]),n=(e.cacheable?i.clone(e.fragment):e.fragment).childNodes),i.merge(this,n);if(s=r.getElementById(o[2]),s&&s.parentNode){if(s.id!==o[2])return f.find(n);this.length=1;this[0]=s}return this.context=r,this.selector=n,this}return i.isFunction(n)?f.ready(n):(n.selector!==t&&(this.selector=n.selector,this.context=n.context),i.makeArray(n,this))},selector:"",jquery:"1.5.1",length:0,size:function(){return this.length},toArray:function(){return f.call(this,0)},get:function(n){return n==null?this.toArray():n<0?this[this.length+n]:this[n]},pushStack:function(n,t,r){var u=this.constructor();return i.isArray(n)?c.apply(u,n):i.merge(u,n),u.prevObject=this,u.context=this.context,t==="find"?u.selector=this.selector+(this.selector?" ":"")+r:t&&(u.selector=this.selector+"."+t+"("+r+")"),u},each:function(n,t){return i.each(this,n,t)},ready:function(n){return i.bindReady(),o.done(n),this},eq:function(n){return n===-1?this.slice(n):this.slice(n,+n+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(f.apply(this,arguments),"slice",f.call(arguments).join(","))},map:function(n){return this.pushStack(i.map(this,function(t,i){return n.call(t,i,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:c,sort:[].sort,splice:[].splice},i.fn.init.prototype=i.fn,i.extend=i.fn.extend=function(){var o,e,u,r,s,h,n=arguments[0]||{},f=1,l=arguments.length,c=!1;for(typeof n=="boolean"&&(c=n,n=arguments[1]||{},f=2),typeof n!="object"&&!i.isFunction(n)&&(n={}),l===f&&(n=this,--f);f<l;f++)if((o=arguments[f])!=null)for(e in o)(u=n[e],r=o[e],n!==r)&&(c&&r&&(i.isPlainObject(r)||(s=i.isArray(r)))?(s?(s=!1,h=u&&i.isArray(u)?u:[]):h=u&&i.isPlainObject(u)?u:{},n[e]=i.extend(c,h,r)):r!==t&&(n[e]=r));return n},i.extend({noConflict:function(t){return n.$=nt,t&&(n.jQuery=g),i},isReady:!1,readyWait:1,ready:function(n){if(n===!0&&i.readyWait--,!i.readyWait||n!==!0&&!i.isReady){if(!r.body)return setTimeout(i.ready,1);if(i.isReady=!0,n!==!0&&--i.readyWait>0)return;o.resolveWith(r,[i]);i.fn.trigger&&i(r).trigger("ready").unbind("ready")}},bindReady:function(){if(!w){if(w=!0,r.readyState==="complete")return setTimeout(i.ready,1);if(r.addEventListener)r.addEventListener("DOMContentLoaded",u,!1),n.addEventListener("load",i.ready,!1);else if(r.attachEvent){r.attachEvent("onreadystatechange",u);n.attachEvent("onload",i.ready);var t=!1;try{t=n.frameElement==null}catch(f){}r.documentElement.doScroll&&t&&l()}}},isFunction:function(n){return i.type(n)==="function"},isArray:Array.isArray||function(n){return i.type(n)==="array"},isWindow:function(n){return n&&typeof n=="object"&&"setInterval"in n},isNaN:function(n){return n==null||!it.test(n)||isNaN(n)},type:function(n){return n==null?String(n):d[vt.call(n)]||"object"},isPlainObject:function(n){if(!n||i.type(n)!=="object"||n.nodeType||i.isWindow(n)||n.constructor&&!h.call(n,"constructor")&&!h.call(n.constructor.prototype,"isPrototypeOf"))return!1;var r;for(r in n);return r===t||h.call(n,r)},isEmptyObject:function(n){for(var t in n)return!1;return!0},error:function(n){throw n;},parseJSON:function(t){if(typeof t!="string"||!t)return null;if(t=i.trim(t),ut.test(t.replace(ft,"@").replace(et,"]").replace(ot,"")))return n.JSON&&n.JSON.parse?n.JSON.parse(t):new Function("return "+t)();i.error("Invalid JSON: "+t)},parseXML:function(t,r,u){return n.DOMParser?(u=new DOMParser,r=u.parseFromString(t,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(t)),u=r.documentElement,(!u||!u.nodeName||u.nodeName==="parsererror")&&i.error("Invalid XML: "+t),r},noop:function(){},globalEval:function(n){if(n&&v.test(n)){var u=r.head||r.getElementsByTagName("head")[0]||r.documentElement,t=r.createElement("script");i.support.scriptEval()?t.appendChild(r.createTextNode(n)):t.text=n;u.insertBefore(t,u.firstChild);u.removeChild(t)}},nodeName:function(n,t){return n.nodeName&&n.nodeName.toUpperCase()===t.toUpperCase()},each:function(n,r,u){var f,e=0,s=n.length,h=s===t||i.isFunction(n),o;if(u){if(h){for(f in n)if(r.apply(n[f],u)===!1)break}else for(;e<s;)if(r.apply(n[e++],u)===!1)break}else if(h){for(f in n)if(r.call(n[f],f,n[f])===!1)break}else for(o=n[0];e<s&&r.call(o,e,o)!==!1;o=n[++e]);return n},trim:b?function(n){return n==null?"":b.call(n)}:function(n){return n==null?"":(n+"").replace(y,"").replace(p,"")},makeArray:function(n,t){var u=t||[],r;return n!=null&&(r=i.type(n),n.length==null||r==="string"||r==="function"||r==="regexp"||i.isWindow(n)?c.call(u,n):i.merge(u,n)),u},inArray:function(n,t){if(t.indexOf)return t.indexOf(n);for(var i=0,r=t.length;i<r;i++)if(t[i]===n)return i;return-1},merge:function(n,i){var u=n.length,r=0,f;if(typeof i.length=="number")for(f=i.length;r<f;r++)n[u++]=i[r];else while(i[r]!==t)n[u++]=i[r++];return n.length=u,n},grep:function(n,t,i){var u=[],f,r,e;for(i=!!i,r=0,e=n.length;r<e;r++)f=!!t(n[r],r),i!==f&&u.push(n[r]);return u},map:function(n,t,i){for(var u=[],f,r=0,e=n.length;r<e;r++)f=t(n[r],r,i),f!=null&&(u[u.length]=f);return u.concat.apply([],u)},guid:1,proxy:function(n,r,u){return arguments.length===2&&(typeof r=="string"?(u=n,n=u[r],r=t):r&&!i.isFunction(r)&&(u=r,r=t)),!r&&n&&(r=function(){return n.apply(u||this,arguments)}),n&&(r.guid=n.guid=n.guid||r.guid||i.guid++),r},access:function(n,r,u,f,e,o){var c=n.length,h,s;if(typeof r=="object"){for(h in r)i.access(n,h,r[h],f,e,u);return n}if(u!==t){for(f=!o&&f&&i.isFunction(u),s=0;s<c;s++)e(n[s],r,f?u.call(n[s],s,e(n[s],r)):u,o);return n}return c?e(n[0],r):t},now:function(){return(new Date).getTime()},_Deferred:function(){var r=[],n,u,f,t={done:function(){if(!f){var h=arguments,u,c,e,s,o;for(n&&(o=n,n=0),u=0,c=h.length;u<c;u++)e=h[u],s=i.type(e),s==="array"?t.done.apply(t,e):s==="function"&&r.push(e);o&&t.resolveWith(o[0],o[1])}return this},resolveWith:function(t,i){if(!f&&!n&&!u){u=1;try{while(r[0])r.shift().apply(t,i)}catch(e){throw e;}finally{n=[t,i];u=0}}return this},resolve:function(){return t.resolveWith(i.isFunction(this.promise)?this.promise():this,arguments),this},isResolved:function(){return u||n},cancel:function(){return f=1,r=[],this}};return t},Deferred:function(n){var t=i._Deferred(),r=i._Deferred(),u;return i.extend(t,{then:function(n,i){return t.done(n).fail(i),this},fail:r.done,rejectWith:r.resolveWith,reject:r.resolve,isRejected:r.isResolved,promise:function(n){if(n==null){if(u)return u;u=n={}}for(var i=s.length;i--;)n[s[i]]=t[s[i]];return n}}),t.done(r.cancel).fail(t.cancel),delete t.cancel,n&&n.call(t,t),t},when:function(n){var t=arguments.length,r=t<=1&&n&&i.isFunction(n.promise)?n:i.Deferred(),e=r.promise();if(t>1){for(var u=f.call(arguments,0),o=t,s=function(n){return function(t){u[n]=arguments.length>1?f.call(arguments,0):t;--o||r.resolveWith(e,u)}};t--;)n=u[t],n&&i.isFunction(n.promise)?n.promise().then(s(t),r.reject):--o;o||r.resolveWith(e,u)}else r!==n&&r.resolve(n);return e},uaMatch:function(n){n=n.toLowerCase();var t=st.exec(n)||ht.exec(n)||ct.exec(n)||n.indexOf("compatible")<0&&lt.exec(n)||[];return{browser:t[1]||"",version:t[2]||"0"}},sub:function(){function n(t,i){return new n.fn.init(t,i)}i.extend(!0,n,this);n.superclass=this;n.fn=n.prototype=this();n.fn.constructor=n;n.subclass=this.subclass;n.fn.init=function(r,u){return u&&u instanceof i&&!(u instanceof n)&&(u=n(u)),i.fn.init.call(this,r,u,t)};n.fn.init.prototype=n.fn;var t=n(r);return n},browser:{}}),o=i._Deferred(),i.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(n,t){d["[object "+t+"]"]=t.toLowerCase()}),e=i.uaMatch(at),e.browser&&(i.browser[e.browser]=!0,i.browser.version=e.version),i.browser.webkit&&(i.browser.safari=!0),k&&(i.inArray=function(n,t){return k.call(t,n)}),v.test(" ")&&(y=/^[\s\xA0]+/,p=/[\s\xA0]+$/),a=i(r),r.addEventListener?u=function(){r.removeEventListener("DOMContentLoaded",u,!1);i.ready()}:r.attachEvent&&(u=function(){r.readyState==="complete"&&(r.detachEvent("onreadystatechange",u),i.ready())}),i}(),ri,et,ot,c,st,l,ht,di,v,gi,h,y,tr,vt;(function(){var t,f,s,h;i.support={};t=r.createElement("div");t.style.display="none";t.innerHTML="   <link/><table><\/table><a href='/a' style='color:red;float:left;opacity:.55;'>a<\/a><input type='checkbox'/>";var e=t.getElementsByTagName("*"),u=t.getElementsByTagName("a")[0],c=r.createElement("select"),l=c.appendChild(r.createElement("option")),o=t.getElementsByTagName("input")[0];if(e&&e.length&&u){i.support={leadingWhitespace:t.firstChild.nodeType===3,tbody:!t.getElementsByTagName("tbody").length,htmlSerialize:!!t.getElementsByTagName("link").length,style:/red/.test(u.getAttribute("style")),hrefNormalized:u.getAttribute("href")==="/a",opacity:/^0.55$/.test(u.style.opacity),cssFloat:!!u.style.cssFloat,checkOn:o.value==="on",optSelected:l.selected,deleteExpando:!0,optDisabled:!1,checkClone:!1,noCloneEvent:!0,noCloneChecked:!0,boxModel:null,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableHiddenOffsets:!0};o.checked=!0;i.support.noCloneChecked=o.cloneNode(!0).checked;c.disabled=!0;i.support.optDisabled=!l.disabled;f=null;i.support.scriptEval=function(){if(f===null){var t=r.documentElement,u=r.createElement("script"),e="script"+i.now();try{u.appendChild(r.createTextNode("window."+e+"=1;"))}catch(o){}t.insertBefore(u,t.firstChild);n[e]?(f=!0,delete n[e]):f=!1;t.removeChild(u);t=u=e=null}return f};try{delete t.test}catch(v){i.support.deleteExpando=!1}!t.addEventListener&&t.attachEvent&&t.fireEvent&&(t.attachEvent("onclick",function a(){i.support.noCloneEvent=!1;t.detachEvent("onclick",a)}),t.cloneNode(!0).fireEvent("onclick"));t=r.createElement("div");t.innerHTML="<input type='radio' name='radiotest' checked='checked'/>";s=r.createDocumentFragment();s.appendChild(t.firstChild);i.support.checkClone=s.cloneNode(!0).cloneNode(!0).lastChild.checked;i(function(){var n=r.createElement("div"),u=r.getElementsByTagName("body")[0],t;u&&(n.style.width=n.style.paddingLeft="1px",u.appendChild(n),i.boxModel=i.support.boxModel=n.offsetWidth===2,"zoom"in n.style&&(n.style.display="inline",n.style.zoom=1,i.support.inlineBlockNeedsLayout=n.offsetWidth===2,n.style.display="",n.innerHTML="<div style='width:4px;'><\/div>",i.support.shrinkWrapBlocks=n.offsetWidth!==2),n.innerHTML="<table><tr><td style='padding:0;border:0;display:none'><\/td><td>t<\/td><\/tr><\/table>",t=n.getElementsByTagName("td"),i.support.reliableHiddenOffsets=t[0].offsetHeight===0,t[0].style.display="",t[1].style.display="none",i.support.reliableHiddenOffsets=i.support.reliableHiddenOffsets&&t[0].offsetHeight===0,n.innerHTML="",u.removeChild(n).style.display="none",n=t=null)});h=function(n){var t=r.createElement("div"),i;return(n="on"+n,!t.attachEvent)?!0:(i=n in t,i||(t.setAttribute(n,"return;"),i=typeof t[n]=="function"),t=null,i)};i.support.submitBubbles=h("submit");i.support.changeBubbles=h("change");t=e=u=null}})();ri=/^(?:\{.*\}|\[.*\])$/;i.extend({cache:{},uuid:0,expando:"jQuery"+(i.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(n){return n=n.nodeType?i.cache[n[i.expando]]:n[i.expando],!!n&&!rt(n)},data:function(n,r,u,f){if(i.acceptData(n)){var h=i.expando,l=typeof r=="string",o,c=n.nodeType,s=c?i.cache:n,e=c?n[i.expando]:n[i.expando]&&i.expando;return(!e||f&&e&&!s[e][h])&&l&&u===t?void 0:(e||(c?n[i.expando]=e=++i.uuid:e=i.expando),s[e]||(s[e]={},c||(s[e].toJSON=i.noop)),(typeof r=="object"||typeof r=="function")&&(f?s[e][h]=i.extend(s[e][h],r):s[e]=i.extend(s[e],r)),o=s[e],f&&(o[h]||(o[h]={}),o=o[h]),u!==t&&(o[r]=u),r==="events"&&!o[r])?o[h]&&o[h].events:l?o[r]:o}},removeData:function(t,r,u){var h,c;if(i.acceptData(t)){var o=i.expando,s=t.nodeType,f=s?i.cache:t,e=s?t[i.expando]:i.expando;if(!f[e])return;if(r&&(h=u?f[e][o]:f[e],h&&(delete h[r],!rt(h))))return;if(u&&(delete f[e][o],!rt(f[e])))return;c=f[e][o];i.support.deleteExpando||f!=n?delete f[e]:f[e]=null;c?(f[e]={},s||(f[e].toJSON=i.noop),f[e][o]=c):s&&(i.support.deleteExpando?delete t[i.expando]:t.removeAttribute?t.removeAttribute(i.expando):t[i.expando]=null)}},_data:function(n,t,r){return i.data(n,t,r,!0)},acceptData:function(n){if(n.nodeName){var t=i.noData[n.nodeName.toLowerCase()];if(t)return t!==!0&&n.getAttribute("classid")===t}return!0}});i.fn.extend({data:function(n,r){var f=null,s,e,o,h,u;if(typeof n=="undefined"){if(this.length&&(f=i.data(this[0]),this[0].nodeType===1))for(s=this[0].attributes,o=0,h=s.length;o<h;o++)e=s[o].name,e.indexOf("data-")===0&&(e=e.substr(5),ii(this[0],e,f[e]));return f}return typeof n=="object"?this.each(function(){i.data(this,n)}):(u=n.split("."),u[1]=u[1]?"."+u[1]:"",r===t)?(f=this.triggerHandler("getData"+u[1]+"!",[u[0]]),f===t&&this.length&&(f=i.data(this[0],n),f=ii(this[0],n,f)),f===t&&u[1]?this.data(u[0]):f):this.each(function(){var t=i(this),f=[u[0],r];t.triggerHandler("setData"+u[1]+"!",f);i.data(this,n,r);t.triggerHandler("changeData"+u[1]+"!",f)})},removeData:function(n){return this.each(function(){i.removeData(this,n)})}});i.extend({queue:function(n,t,r){if(n){t=(t||"fx")+"queue";var u=i._data(n,t);return r?(!u||i.isArray(r)?u=i._data(n,t,i.makeArray(r)):u.push(r),u):u||[]}},dequeue:function(n,t){t=t||"fx";var r=i.queue(n,t),u=r.shift();u==="inprogress"&&(u=r.shift());u&&(t==="fx"&&r.unshift("inprogress"),u.call(n,function(){i.dequeue(n,t)}));r.length||i.removeData(n,t+"queue",!0)}});i.fn.extend({queue:function(n,r){return(typeof n!="string"&&(r=n,n="fx"),r===t)?i.queue(this[0],n):this.each(function(){var t=i.queue(this,n,r);n==="fx"&&t[0]!=="inprogress"&&i.dequeue(this,n)})},dequeue:function(n){return this.each(function(){i.dequeue(this,n)})},delay:function(n,t){return n=i.fx?i.fx.speeds[n]||n:n,t=t||"fx",this.queue(t,function(){var r=this;setTimeout(function(){i.dequeue(r,t)},n)})},clearQueue:function(n){return this.queue(n||"fx",[])}});var ui=/[\n\t\r]/g,ut=/\s+/,hr=/\r/g,cr=/^(?:href|src|style)$/,lr=/^(?:button|input)$/i,ar=/^(?:button|input|object|select|textarea)$/i,vr=/^a(?:rea)?$/i,fi=/^(?:radio|checkbox)$/i;i.props={"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"};i.fn.extend({attr:function(n,t){return i.access(this,n,t,!0,i.attr)},removeAttr:function(n){return this.each(function(){i.attr(this,n,"");this.nodeType===1&&this.removeAttribute(n)})},addClass:function(n){var u,f,o,t,s,e,r,h;if(i.isFunction(n))return this.each(function(t){var r=i(this);r.addClass(n.call(this,t,r.attr("class")))});if(n&&typeof n=="string")for(u=(n||"").split(ut),f=0,o=this.length;f<o;f++)if(t=this[f],t.nodeType===1)if(t.className){for(s=" "+t.className+" ",e=t.className,r=0,h=u.length;r<h;r++)s.indexOf(" "+u[r]+" ")<0&&(e+=" "+u[r]);t.className=i.trim(e)}else t.className=n;return this},removeClass:function(n){var o,u,s,r,f,e,h;if(i.isFunction(n))return this.each(function(t){var r=i(this);r.removeClass(n.call(this,t,r.attr("class")))});if(n&&typeof n=="string"||n===t)for(o=(n||"").split(ut),u=0,s=this.length;u<s;u++)if(r=this[u],r.nodeType===1&&r.className)if(n){for(f=(" "+r.className+" ").replace(ui," "),e=0,h=o.length;e<h;e++)f=f.replace(" "+o[e]+" "," ");r.className=i.trim(f)}else r.className="";return this},toggleClass:function(n,t){var r=typeof n,u=typeof t=="boolean";return i.isFunction(n)?this.each(function(r){var u=i(this);u.toggleClass(n.call(this,r,u.attr("class"),t),t)}):this.each(function(){if(r==="string")for(var f,s=0,o=i(this),e=t,h=n.split(ut);f=h[s++];)e=u?e:!o.hasClass(f),o[e?"addClass":"removeClass"](f);else(r==="undefined"||r==="boolean")&&(this.className&&i._data(this,"__className__",this.className),this.className=this.className||n===!1?"":i._data(this,"__className__")||"")})},hasClass:function(n){for(var r=" "+n+" ",t=0,i=this.length;t<i;t++)if((" "+this[t].className+" ").replace(ui," ").indexOf(r)>-1)return!0;return!1},val:function(n){var r,h,s,l,u,a;if(!arguments.length){if(r=this[0],r){if(i.nodeName(r,"option"))return h=r.attributes.value,!h||h.specified?r.value:r.text;if(i.nodeName(r,"select")){var f=r.selectedIndex,c=[],e=r.options,o=r.type==="select-one";if(f<0)return null;for(s=o?f:0,l=o?f+1:e.length;s<l;s++)if(u=e[s],u.selected&&(i.support.optDisabled?!u.disabled:u.getAttribute("disabled")===null)&&(!u.parentNode.disabled||!i.nodeName(u.parentNode,"optgroup"))){if(n=i(u).val(),o)return n;c.push(n)}return o&&!c.length&&e.length?i(e[f]).val():c}return fi.test(r.type)&&!i.support.checkOn?r.getAttribute("value")===null?"on":r.value:(r.value||"").replace(hr,"")}return t}return a=i.isFunction(n),this.each(function(t){var f=i(this),r=n,u;this.nodeType===1&&(a&&(r=n.call(this,t,f.val())),r==null?r="":typeof r=="number"?r+="":i.isArray(r)&&(r=i.map(r,function(n){return n==null?"":n+""})),i.isArray(r)&&fi.test(this.type)?this.checked=i.inArray(f.val(),r)>=0:i.nodeName(this,"select")?(u=i.makeArray(r),i("option",this).each(function(){this.selected=i.inArray(i(this).val(),u)>=0}),u.length||(this.selectedIndex=-1)):this.value=r)})}});i.extend({attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(n,r,u,f){var e,o,c,s,h,l;return!n||n.nodeType===3||n.nodeType===8||n.nodeType===2?t:f&&r in i.attrFn?i(n)[r](u):(e=n.nodeType!==1||!i.isXMLDoc(n),o=u!==t,r=e&&i.props[r]||r,n.nodeType===1)?(c=cr.test(r),r!=="selected"||i.support.optSelected||(s=n.parentNode,s&&(s.selectedIndex,s.parentNode&&s.parentNode.selectedIndex)),(r in n||n[r]!==t)&&e&&!c)?(o&&(r==="type"&&lr.test(n.nodeName)&&n.parentNode&&i.error("type property can't be changed"),u===null?n.nodeType===1&&n.removeAttribute(r):n[r]=u),i.nodeName(n,"form")&&n.getAttributeNode(r))?n.getAttributeNode(r).nodeValue:r==="tabIndex"?(h=n.getAttributeNode("tabIndex"),h&&h.specified?h.value:ar.test(n.nodeName)||vr.test(n.nodeName)&&n.href?0:t):n[r]:!i.support.style&&e&&r==="style"?(o&&(n.style.cssText=""+u),n.style.cssText):(o&&n.setAttribute(r,""+u),!n.attributes[r]&&n.hasAttribute&&!n.hasAttribute(r))?t:(l=!i.support.hrefNormalized&&e&&c?n.getAttribute(r,2):n.getAttribute(r),l===null?t:l):(o&&(n[r]=u),n[r])}});var d=/\.(.*)$/,ft=/^(?:textarea|input|select)$/i,yr=/\./g,pr=/ /g,wr=/[^\w\s.|`]/g,br=function(n){return n.replace(wr,"\\$&")};i.event={add:function(r,u,f,e){var p,h,l,a,c,o,b,v,w,y;if(r.nodeType!==3&&r.nodeType!==8){try{i.isWindow(r)&&r!==n&&!r.frameElement&&(r=n)}catch(k){}if(f===!1)f=s;else if(!f)return;if(f.handler&&(p=f,f=p.handler),f.guid||(f.guid=i.guid++),l=i._data(r),!l)return;for(a=l.events,c=l.handle,a||(l.events=a={}),c||(l.handle=c=function(){return typeof i!="undefined"&&!i.event.triggered?i.event.handle.apply(c.elem,arguments):t}),c.elem=r,u=u.split(" "),b=0;o=u[b++];)h=p?i.extend({},p):{handler:f,data:e},o.indexOf(".")>-1?(v=o.split("."),o=v.shift(),h.namespace=v.slice(0).sort().join(".")):(v=[],h.namespace=""),h.type=o,h.guid||(h.guid=f.guid),w=a[o],y=i.event.special[o]||{},w||(w=a[o]=[],y.setup&&y.setup.call(r,e,v,c)!==!1||(r.addEventListener?r.addEventListener(o,c,!1):r.attachEvent&&r.attachEvent("on"+o,c))),y.add&&(y.add.call(r,h),h.handler.guid||(h.handler.guid=f.guid)),w.push(h),i.event.global[o]=!0;r=null}},global:{},remove:function(n,r,u,f){var b;if(n.nodeType!==3&&n.nodeType!==8){u===!1&&(u=s);var d,e,o,g=0,p,a,w,v,h,c,k,l=i.hasData(n)&&i._data(n),y=l&&l.events;if(!l||!y)return;if(r&&r.type&&(u=r.handler,r=r.type),!r||typeof r=="string"&&r.charAt(0)==="."){r=r||"";for(e in y)i.event.remove(n,e+r);return}for(r=r.split(" ");e=r[g++];)if(k=e,c=null,p=e.indexOf(".")<0,a=[],p||(a=e.split("."),e=a.shift(),w=new RegExp("(^|\\.)"+i.map(a.slice(0).sort(),br).join("\\.(?:.*\\.)?")+"(\\.|$)")),h=y[e],h){if(!u){for(o=0;o<h.length;o++)c=h[o],(p||w.test(c.namespace))&&(i.event.remove(n,k,c.handler,o),h.splice(o--,1));continue}for(v=i.event.special[e]||{},o=f||0;o<h.length;o++)if(c=h[o],u.guid===c.guid&&((p||w.test(c.namespace))&&(f==null&&h.splice(o--,1),v.remove&&v.remove.call(n,c)),f!=null))break;(h.length===0||f!=null&&h.length===1)&&(v.teardown&&v.teardown.call(n,a)!==!1||i.removeEvent(n,e,l.handle),d=null,delete y[e])}i.isEmptyObject(y)&&(b=l.handle,b&&(b.elem=null),delete l.events,delete l.handle,i.isEmptyObject(l)&&i.removeData(n,t,!0))}},trigger:function(n,r,u){var f=n.type||n,a=arguments[3],h,c;if(!a){if(n=typeof n=="object"?n[i.expando]?n:i.extend(i.Event(f),n):i.Event(f),f.indexOf("!")>=0&&(n.type=f=f.slice(0,-1),n.exclusive=!0),u||(n.stopPropagation(),i.event.global[f]&&i.each(i.cache,function(){var u=i.expando,t=this[u];t&&t.events&&t.events[f]&&i.event.trigger(n,r,t.handle.elem)})),!u||u.nodeType===3||u.nodeType===8)return t;n.result=t;n.target=u;r=i.makeArray(r);r.unshift(n)}n.currentTarget=u;h=i._data(u,"handle");h&&h.apply(u,r);c=u.parentNode||u.ownerDocument;try{u&&u.nodeName&&i.noData[u.nodeName.toLowerCase()]||u["on"+f]&&u["on"+f].apply(u,r)===!1&&(n.result=!1,n.preventDefault())}catch(y){}if(!n.isPropagationStopped()&&c)i.event.trigger(n,r,c,!0);else if(!n.isDefaultPrevented()){var s,e=n.target,o=f.replace(d,""),v=i.nodeName(e,"a")&&o==="click",l=i.event.special[o]||{};if((!l._default||l._default.call(u,n)===!1)&&!v&&!(e&&e.nodeName&&i.noData[e.nodeName.toLowerCase()])){try{e[o]&&(s=e["on"+o],s&&(e["on"+o]=null),i.event.triggered=!0,e[o]())}catch(p){}s&&(e["on"+o]=s);i.event.triggered=!1}}},handle:function(r){var s,u,h,a,c,l=[],v=i.makeArray(arguments),e,y,f,o;if(r=v[0]=i.event.fix(r||n.event),r.currentTarget=this,s=r.type.indexOf(".")<0&&!r.exclusive,s||(h=r.type.split("."),r.type=h.shift(),l=h.slice(0).sort(),a=new RegExp("(^|\\.)"+l.join("\\.(?:.*\\.)?")+"(\\.|$)")),r.namespace=r.namespace||l.join("."),c=i._data(this,"events"),u=(c||{})[r.type],c&&u)for(u=u.slice(0),e=0,y=u.length;e<y;e++)if(f=u[e],(s||a.test(f.namespace))&&(r.handler=f.handler,r.data=f.data,r.handleObj=f,o=f.handler.apply(this,v),o!==t&&(r.result=o,o===!1&&(r.preventDefault(),r.stopPropagation())),r.isImmediatePropagationStopped()))break;return r.result},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(n){var e,o,s,u,f;if(n[i.expando])return n;for(e=n,n=i.Event(e),o=this.props.length;o;)s=this.props[--o],n[s]=e[s];return n.target||(n.target=n.srcElement||r),n.target.nodeType===3&&(n.target=n.target.parentNode),!n.relatedTarget&&n.fromElement&&(n.relatedTarget=n.fromElement===n.target?n.toElement:n.fromElement),n.pageX==null&&n.clientX!=null&&(u=r.documentElement,f=r.body,n.pageX=n.clientX+(u&&u.scrollLeft||f&&f.scrollLeft||0)-(u&&u.clientLeft||f&&f.clientLeft||0),n.pageY=n.clientY+(u&&u.scrollTop||f&&f.scrollTop||0)-(u&&u.clientTop||f&&f.clientTop||0)),n.which==null&&(n.charCode!=null||n.keyCode!=null)&&(n.which=n.charCode!=null?n.charCode:n.keyCode),!n.metaKey&&n.ctrlKey&&(n.metaKey=n.ctrlKey),!n.which&&n.button!==t&&(n.which=n.button&1?1:n.button&2?3:n.button&4?2:0),n},guid:1e8,proxy:i.proxy,special:{ready:{setup:i.bindReady,teardown:i.noop},live:{add:function(n){i.event.add(this,b(n.origType,n.selector),i.extend({},n,{handler:sr,guid:n.handler.guid}))},remove:function(n){i.event.remove(this,b(n.origType,n.selector),n)}},beforeunload:{setup:function(n,t,r){i.isWindow(this)&&(this.onbeforeunload=r)},teardown:function(n,t){this.onbeforeunload===t&&(this.onbeforeunload=null)}}}};i.removeEvent=r.removeEventListener?function(n,t,i){n.removeEventListener&&n.removeEventListener(t,i,!1)}:function(n,t,i){n.detachEvent&&n.detachEvent("on"+t,i)};i.Event=function(n){if(!this.preventDefault)return new i.Event(n);n&&n.type?(this.originalEvent=n,this.type=n.type,this.isDefaultPrevented=n.defaultPrevented||n.returnValue===!1||n.getPreventDefault&&n.getPreventDefault()?k:s):this.type=n;this.timeStamp=i.now();this[i.expando]=!0};i.Event.prototype={preventDefault:function(){this.isDefaultPrevented=k;var n=this.originalEvent;n&&(n.preventDefault?n.preventDefault():n.returnValue=!1)},stopPropagation:function(){this.isPropagationStopped=k;var n=this.originalEvent;n&&(n.stopPropagation&&n.stopPropagation(),n.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=k;this.stopPropagation()},isDefaultPrevented:s,isPropagationStopped:s,isImmediatePropagationStopped:s};et=function(n){var t=n.relatedTarget;try{if(t!==r&&!t.parentNode)return;while(t&&t!==this)t=t.parentNode;t!==this&&(n.type=n.data,i.event.handle.apply(this,arguments))}catch(u){}};ot=function(n){n.type=n.data;i.event.handle.apply(this,arguments)};i.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(n,t){i.event.special[n]={setup:function(r){i.event.add(this,t,r&&r.selector?ot:et,n)},teardown:function(n){i.event.remove(this,t,n&&n.selector?ot:et)}}});i.support.submitBubbles||(i.event.special.submit={setup:function(){if(this.nodeName&&this.nodeName.toLowerCase()!=="form")i.event.add(this,"click.specialSubmit",function(n){var t=n.target,r=t.type;(r==="submit"||r==="image")&&i(t).closest("form").length&&ti("submit",this,arguments)}),i.event.add(this,"keypress.specialSubmit",function(n){var t=n.target,r=t.type;(r==="text"||r==="password")&&i(t).closest("form").length&&n.keyCode===13&&ti("submit",this,arguments)});else return!1},teardown:function(){i.event.remove(this,".specialSubmit")}});i.support.changeBubbles||(st=function(n){var r=n.type,t=n.value;return r==="radio"||r==="checkbox"?t=n.checked:r==="select-multiple"?t=n.selectedIndex>-1?i.map(n.options,function(n){return n.selected}).join("-"):"":n.nodeName.toLowerCase()==="select"&&(t=n.selectedIndex),t},l=function(n){var r=n.target,u,f;if(ft.test(r.nodeName)&&!r.readOnly){if(u=i._data(r,"_change_data"),f=st(r),(n.type!=="focusout"||r.type!=="radio")&&i._data(r,"_change_data",f),u===t||f===u)return;(u!=null||f)&&(n.type="change",n.liveFired=t,i.event.trigger(n,arguments[1],r))}},i.event.special.change={filters:{focusout:l,beforedeactivate:l,click:function(n){var t=n.target,i=t.type;(i==="radio"||i==="checkbox"||t.nodeName.toLowerCase()==="select")&&l.call(this,n)},keydown:function(n){var i=n.target,t=i.type;(n.keyCode===13&&i.nodeName.toLowerCase()!=="textarea"||n.keyCode===32&&(t==="checkbox"||t==="radio")||t==="select-multiple")&&l.call(this,n)},beforeactivate:function(n){var t=n.target;i._data(t,"_change_data",st(t))}},setup:function(){if(this.type==="file")return!1;for(var n in c)i.event.add(this,n+".specialChange",c[n]);return ft.test(this.nodeName)},teardown:function(){return i.event.remove(this,".specialChange"),ft.test(this.nodeName)}},c=i.event.special.change.filters,c.focus=c.beforeactivate);r.addEventListener&&i.each({focus:"focusin",blur:"focusout"},function(n,t){function r(n){return n=i.event.fix(n),n.type=t,i.event.handle.call(this,n)}i.event.special[t]={setup:function(){this.addEventListener(n,r,!0)},teardown:function(){this.removeEventListener(n,r,!0)}}});i.each(["bind","one"],function(n,r){i.fn[r]=function(n,u,f){var o,s,e,h;if(typeof n=="object"){for(o in n)this[r](o,u,n[o],f);return this}if((i.isFunction(u)||u===!1)&&(f=u,u=t),s=r==="one"?i.proxy(f,function(n){return i(this).unbind(n,s),f.apply(this,arguments)}):f,n==="unload"&&r!=="one")this.one(n,u,f);else for(e=0,h=this.length;e<h;e++)i.event.add(this[e],n,s,u);return this}});i.fn.extend({unbind:function(n,t){var r,f,u;if(typeof n!="object"||n.preventDefault)for(r=0,f=this.length;r<f;r++)i.event.remove(this[r],n,t);else for(u in n)this.unbind(u,n[u]);return this},delegate:function(n,t,i,r){return this.live(t,i,r,n)},undelegate:function(n,t,i){return arguments.length===0?this.unbind("live"):this.die(t,null,i,n)},trigger:function(n,t){return this.each(function(){i.event.trigger(n,t,this)})},triggerHandler:function(n,t){if(this[0]){var r=i.Event(n);return r.preventDefault(),r.stopPropagation(),i.event.trigger(r,t,this[0]),r.result}},toggle:function(n){for(var t=arguments,r=1;r<t.length;)i.proxy(n,t[r++]);return this.click(i.proxy(n,function(u){var f=(i._data(this,"lastToggle"+n.guid)||0)%r;return i._data(this,"lastToggle"+n.guid,f+1),u.preventDefault(),t[f].apply(this,arguments)||!1}))},hover:function(n,t){return this.mouseenter(n).mouseleave(t||n)}});ht={focus:"focusin",blur:"focusout",mouseenter:"mouseover",mouseleave:"mouseout"};i.each(["live","die"],function(n,r){i.fn[r]=function(n,u,f,e){var o,w=0,a,s,y,h=e||this.selector,c=e?this:i(this.context),v,l,p;if(typeof n=="object"&&!n.preventDefault){for(v in n)c[r](v,u,n[v],h);return this}for(i.isFunction(u)&&(f=u,u=t),n=(n||"").split(" ");(o=n[w++])!=null;){if(a=d.exec(o),s="",a&&(s=a[0],o=o.replace(d,"")),o==="hover"){n.push("mouseenter"+s,"mouseleave"+s);continue}if(y=o,o==="focus"||o==="blur"?(n.push(ht[o]+s),o=o+s):o=(ht[o]||o)+s,r==="live")for(l=0,p=c.length;l<p;l++)i.event.add(c[l],"live."+b(o,h),{data:u,selector:h,handler:f,origType:o,origHandler:f,preType:y});else c.unbind("live."+b(o,h),f)}return this}});i.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error".split(" "),function(n,t){i.fn[t]=function(n,i){return i==null&&(i=n,n=null),arguments.length>0?this.bind(t,n,i):this.trigger(t)};i.attrFn&&(i.attrFn[t]=!0)}),function(){function p(t,i,r,u,f,e){for(var o,h,s=0,c=u.length;s<c;s++)if(o=u[s],o){for(h=!1,o=o[t];o;){if(o.sizcache===r){h=u[o.sizset];break}if(o.nodeType===1)if(e||(o.sizcache=r,o.sizset=s),typeof i!="string"){if(o===i){h=!0;break}}else if(n.filter(i,[o]).length>0){h=o;break}o=o[t]}u[s]=h}}function w(n,t,i,r,u,f){for(var e,s,o=0,h=r.length;o<h;o++)if(e=r[o],e){for(s=!1,e=e[n];e;){if(e.sizcache===i){s=r[e.sizset];break}if(e.nodeType!==1||f||(e.sizcache=i,e.sizset=o),e.nodeName.toLowerCase()===t){s=e;break}e=e[n]}r[o]=s}}var a=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,v=0,b=Object.prototype.toString,h=!1,k=!0,e=/\\/g,c=/\W/,n,o,f,l,s,y;[0,0].sort(function(){return k=!1,0});n=function(t,i,e,o){var tt;if(e=e||[],i=i||r,tt=i,i.nodeType!==1&&i.nodeType!==9)return[];if(!t||typeof t!="string")return e;var p,v,h,nt,l,w,k,c,it=!0,g=n.isXML(i),s=[],rt=t;do if(a.exec(""),p=a.exec(rt),p&&(rt=p[3],s.push(p[1]),p[2])){nt=p[3];break}while(p);if(s.length>1&&d.exec(t))if(s.length===2&&u.relative[s[0]])v=y(s[0]+s[1],i);else for(v=u.relative[s[0]]?[i]:n(s.shift(),i);s.length;)t=s.shift(),u.relative[t]&&(t+=s.shift()),v=y(t,v);else if(!o&&s.length>1&&i.nodeType===9&&!g&&u.match.ID.test(s[0])&&!u.match.ID.test(s[s.length-1])&&(l=n.find(s.shift(),i,g),i=l.expr?n.filter(l.expr,l.set)[0]:l.set[0]),i)for(l=o?{expr:s.pop(),set:f(o)}:n.find(s.pop(),s.length===1&&(s[0]==="~"||s[0]==="+")&&i.parentNode?i.parentNode:i,g),v=l.expr?n.filter(l.expr,l.set):l.set,s.length>0?h=f(v):it=!1;s.length;)w=s.pop(),k=w,u.relative[w]?k=s.pop():w="",k==null&&(k=i),u.relative[w](h,k,g);else h=s=[];if(h||(h=v),h||n.error(w||t),b.call(h)==="[object Array]")if(it)if(i&&i.nodeType===1)for(c=0;h[c]!=null;c++)h[c]&&(h[c]===!0||h[c].nodeType===1&&n.contains(i,h[c]))&&e.push(v[c]);else for(c=0;h[c]!=null;c++)h[c]&&h[c].nodeType===1&&e.push(v[c]);else e.push.apply(e,h);else f(h,e);return nt&&(n(nt,tt,e,o),n.uniqueSort(e)),e};n.uniqueSort=function(n){if(l&&(h=k,n.sort(l),h))for(var t=1;t<n.length;t++)n[t]===n[t-1]&&n.splice(t--,1);return n};n.matches=function(t,i){return n(t,null,null,i)};n.matchesSelector=function(t,i){return n(i,null,null,[t]).length>0};n.find=function(n,t,i){var f,o,c,r,s,h;if(!n)return[];for(o=0,c=u.order.length;o<c;o++)if(s=u.order[o],(r=u.leftMatch[s].exec(n))&&(h=r[1],r.splice(1,1),h.substr(h.length-1)!=="\\"&&(r[1]=(r[1]||"").replace(e,""),f=u.find[s](r,t,i),f!=null))){n=n.replace(u.match[s],"");break}return f||(f=typeof t.getElementsByTagName!="undefined"?t.getElementsByTagName("*"):[]),{set:f,expr:n}};n.filter=function(i,r,f,e){for(var o,h,b=i,l=[],s=r,d=r&&r[0]&&n.isXML(r[0]),c,a,y,k,p,v,w;i&&r.length;){for(c in u.filter)if((o=u.leftMatch[c].exec(i))!=null&&o[2]){if(k=u.filter[c],p=o[1],h=!1,o.splice(1,1),p.substr(p.length-1)==="\\")continue;if(s===l&&(l=[]),u.preFilter[c])if(o=u.preFilter[c](o,s,f,l,e,d),o){if(o===!0)continue}else h=a=!0;if(o)for(v=0;(y=s[v])!=null;v++)y&&(a=k(y,o,v,s),w=e^!!a,f&&a!=null?w?h=!0:s[v]=!1:w&&(l.push(y),h=!0));if(a!==t){if(f||(s=l),i=i.replace(u.match[c],""),!h)return[];break}}if(i===b)if(h==null)n.error(i);else break;b=i}return s};n.error=function(n){throw"Syntax error, unrecognized expression: "+n;};var u=n.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(n){return n.getAttribute("href")},type:function(n){return n.getAttribute("type")}},relative:{"+":function(t,i){var f=typeof i=="string",e=f&&!c.test(i),o=f&&!e,u,s,r;for(e&&(i=i.toLowerCase()),u=0,s=t.length;u<s;u++)if(r=t[u]){while((r=r.previousSibling)&&r.nodeType!==1);t[u]=o||r&&r.nodeName.toLowerCase()===i?r||!1:r===i}o&&n.filter(i,t,!0)},">":function(t,i){var u,f=typeof i=="string",r=0,o=t.length,e;if(f&&!c.test(i))for(i=i.toLowerCase();r<o;r++)u=t[r],u&&(e=u.parentNode,t[r]=e.nodeName.toLowerCase()===i?e:!1);else{for(;r<o;r++)u=t[r],u&&(t[r]=f?u.parentNode:u.parentNode===i);f&&n.filter(i,t,!0)}},"":function(n,t,i){var r,f=v++,u=p;typeof t!="string"||c.test(t)||(t=t.toLowerCase(),r=t,u=w);u("parentNode",t,f,n,r,i)},"~":function(n,t,i){var r,f=v++,u=p;typeof t!="string"||c.test(t)||(t=t.toLowerCase(),r=t,u=w);u("previousSibling",t,f,n,r,i)}},find:{ID:function(n,t,i){if(typeof t.getElementById!="undefined"&&!i){var r=t.getElementById(n[1]);return r&&r.parentNode?[r]:[]}},NAME:function(n,t){var r,u,i,f;if(typeof t.getElementsByName!="undefined"){for(r=[],u=t.getElementsByName(n[1]),i=0,f=u.length;i<f;i++)u[i].getAttribute("name")===n[1]&&r.push(u[i]);return r.length===0?null:r}},TAG:function(n,t){if(typeof t.getElementsByTagName!="undefined")return t.getElementsByTagName(n[1])}},preFilter:{CLASS:function(n,t,i,r,u,f){if(n=" "+n[1].replace(e,"")+" ",f)return n;for(var s=0,o;(o=t[s])!=null;s++)o&&(u^(o.className&&(" "+o.className+" ").replace(/[\t\n\r]/g," ").indexOf(n)>=0)?i||r.push(o):i&&(t[s]=!1));return!1},ID:function(n){return n[1].replace(e,"")},TAG:function(n){return n[1].replace(e,"").toLowerCase()},CHILD:function(t){if(t[1]==="nth"){t[2]||n.error(t[0]);t[2]=t[2].replace(/^\+|\s*/g,"");var i=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(t[2]==="even"&&"2n"||t[2]==="odd"&&"2n+1"||!/\D/.test(t[2])&&"0n+"+t[2]||t[2]);t[2]=i[1]+(i[2]||1)-0;t[3]=i[3]-0}else t[2]&&n.error(t[0]);return t[0]=v++,t},ATTR:function(n,t,i,r,f,o){var s=n[1]=n[1].replace(e,"");return!o&&u.attrMap[s]&&(n[1]=u.attrMap[s]),n[4]=(n[4]||n[5]||"").replace(e,""),n[2]==="~="&&(n[4]=" "+n[4]+" "),n},PSEUDO:function(t,i,r,f,e){if(t[1]==="not")if((a.exec(t[3])||"").length>1||/^\w/.test(t[3]))t[3]=n(t[3],null,null,i);else{var o=n.filter(t[3],i,r,!0^e);return r||f.push.apply(f,o),!1}else if(u.match.POS.test(t[0])||u.match.CHILD.test(t[0]))return!0;return t},POS:function(n){return n.unshift(!0),n}},filters:{enabled:function(n){return n.disabled===!1&&n.type!=="hidden"},disabled:function(n){return n.disabled===!0},checked:function(n){return n.checked===!0},selected:function(n){return n.parentNode&&n.parentNode.selectedIndex,n.selected===!0},parent:function(n){return!!n.firstChild},empty:function(n){return!n.firstChild},has:function(t,i,r){return!!n(r[3],t).length},header:function(n){return/h\d/i.test(n.nodeName)},text:function(n){return"text"===n.getAttribute("type")},radio:function(n){return"radio"===n.type},checkbox:function(n){return"checkbox"===n.type},file:function(n){return"file"===n.type},password:function(n){return"password"===n.type},submit:function(n){return"submit"===n.type},image:function(n){return"image"===n.type},reset:function(n){return"reset"===n.type},button:function(n){return"button"===n.type||n.nodeName.toLowerCase()==="button"},input:function(n){return/input|select|textarea|button/i.test(n.nodeName)}},setFilters:{first:function(n,t){return t===0},last:function(n,t,i,r){return t===r.length-1},even:function(n,t){return t%2==0},odd:function(n,t){return t%2==1},lt:function(n,t,i){return t<i[3]-0},gt:function(n,t,i){return t>i[3]-0},nth:function(n,t,i){return i[3]-0===t},eq:function(n,t,i){return i[3]-0===t}},filter:{PSEUDO:function(t,i,r,f){var e=i[1],h=u.filters[e],s,o,c;if(h)return h(t,r,i,f);if(e==="contains")return(t.textContent||t.innerText||n.getText([t])||"").indexOf(i[3])>=0;if(e==="not"){for(s=i[3],o=0,c=s.length;o<c;o++)if(s[o]===t)return!1;return!0}n.error(e)},CHILD:function(n,t){var s=t[1],i=n,r,e,o,u,h,f;switch(s){case"only":case"first":while(i=i.previousSibling)if(i.nodeType===1)return!1;if(s==="first")return!0;i=n;case"last":while(i=i.nextSibling)if(i.nodeType===1)return!1;return!0;case"nth":if(r=t[2],e=t[3],r===1&&e===0)return!0;if(o=t[0],u=n.parentNode,u&&(u.sizcache!==o||!n.nodeIndex)){for(h=0,i=u.firstChild;i;i=i.nextSibling)i.nodeType===1&&(i.nodeIndex=++h);u.sizcache=o}return f=n.nodeIndex-e,r===0?f===0:f%r==0&&f/r>=0}},ID:function(n,t){return n.nodeType===1&&n.getAttribute("id")===t},TAG:function(n,t){return t==="*"&&n.nodeType===1||n.nodeName.toLowerCase()===t},CLASS:function(n,t){return(" "+(n.className||n.getAttribute("class"))+" ").indexOf(t)>-1},ATTR:function(n,t){var e=t[1],o=u.attrHandle[e]?u.attrHandle[e](n):n[e]!=null?n[e]:n.getAttribute(e),r=o+"",f=t[2],i=t[4];return o==null?f==="!=":f==="="?r===i:f==="*="?r.indexOf(i)>=0:f==="~="?(" "+r+" ").indexOf(i)>=0:i?f==="!="?r!==i:f==="^="?r.indexOf(i)===0:f==="$="?r.substr(r.length-i.length)===i:f==="|="?r===i||r.substr(0,i.length+1)===i+"-":!1:r&&o!==!1},POS:function(n,t,i,r){var e=t[2],f=u.setFilters[e];if(f)return f(n,i,t,r)}}},d=u.match.POS,g=function(n,t){return"\\"+(+t+1)};for(o in u.match)u.match[o]=new RegExp(u.match[o].source+/(?![^\[]*\])(?![^\(]*\))/.source),u.leftMatch[o]=new RegExp(/(^(?:.|\r|\n)*?)/.source+u.match[o].source.replace(/\\(\d+)/g,g));f=function(n,t){return(n=Array.prototype.slice.call(n,0),t)?(t.push.apply(t,n),t):n};try{Array.prototype.slice.call(r.documentElement.childNodes,0)[0].nodeType}catch(nt){f=function(n,t){var i=0,r=t||[],u;if(b.call(n)==="[object Array]")Array.prototype.push.apply(r,n);else if(typeof n.length=="number")for(u=n.length;i<u;i++)r.push(n[i]);else for(;n[i];i++)r.push(n[i]);return r}}r.documentElement.compareDocumentPosition?l=function(n,t){return n===t?(h=!0,0):!n.compareDocumentPosition||!t.compareDocumentPosition?n.compareDocumentPosition?-1:1:n.compareDocumentPosition(t)&4?-1:1}:(l=function(n,t){var e,l,u=[],f=[],o=n.parentNode,c=t.parentNode,r=o,i;if(n===t)return h=!0,0;if(o===c)return s(n,t);if(!o)return-1;if(!c)return 1;while(r)u.unshift(r),r=r.parentNode;for(r=c;r;)f.unshift(r),r=r.parentNode;for(e=u.length,l=f.length,i=0;i<e&&i<l;i++)if(u[i]!==f[i])return s(u[i],f[i]);return i===e?s(n,f[i],-1):s(u[i],t,1)},s=function(n,t,i){if(n===t)return i;for(var r=n.nextSibling;r;){if(r===t)return-1;r=r.nextSibling}return 1});n.getText=function(t){for(var u="",i,r=0;t[r];r++)i=t[r],i.nodeType===3||i.nodeType===4?u+=i.nodeValue:i.nodeType!==8&&(u+=n.getText(i.childNodes));return u},function(){var n=r.createElement("div"),f="script"+(new Date).getTime(),i=r.documentElement;n.innerHTML="<a name='"+f+"'/>";i.insertBefore(n,i.firstChild);r.getElementById(f)&&(u.find.ID=function(n,i,r){if(typeof i.getElementById!="undefined"&&!r){var u=i.getElementById(n[1]);return u?u.id===n[1]||typeof u.getAttributeNode!="undefined"&&u.getAttributeNode("id").nodeValue===n[1]?[u]:t:[]}},u.filter.ID=function(n,t){var i=typeof n.getAttributeNode!="undefined"&&n.getAttributeNode("id");return n.nodeType===1&&i&&i.nodeValue===t});i.removeChild(n);i=n=null}(),function(){var n=r.createElement("div");n.appendChild(r.createComment(""));n.getElementsByTagName("*").length>0&&(u.find.TAG=function(n,t){var i=t.getElementsByTagName(n[1]),u,r;if(n[1]==="*"){for(u=[],r=0;i[r];r++)i[r].nodeType===1&&u.push(i[r]);i=u}return i});n.innerHTML="<a href='#'><\/a>";n.firstChild&&typeof n.firstChild.getAttribute!="undefined"&&n.firstChild.getAttribute("href")!=="#"&&(u.attrHandle.href=function(n){return n.getAttribute("href",2)});n=null}();r.querySelectorAll&&function(){var i=n,t=r.createElement("div"),o="__sizzle__",e;if(t.innerHTML="<p class='TEST'><\/p>",!t.querySelectorAll||t.querySelectorAll(".TEST").length!==0){n=function(t,e,s,h){var c,l;if(e=e||r,!h&&!n.isXML(e)){if(c=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(t),c&&(e.nodeType===1||e.nodeType===9)){if(c[1])return f(e.getElementsByTagName(t),s);if(c[2]&&u.find.CLASS&&e.getElementsByClassName)return f(e.getElementsByClassName(c[2]),s)}if(e.nodeType===9){if(t==="body"&&e.body)return f([e.body],s);if(c&&c[3]){if(l=e.getElementById(c[3]),!l||!l.parentNode)return f([],s);if(l.id===c[3])return f([l],s)}try{return f(e.querySelectorAll(t),s)}catch(b){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var w=e,v=e.getAttribute("id"),a=v||o,y=e.parentNode,p=/^\s*[+~]/.test(t);v?a=a.replace(/'/g,"\\$&"):e.setAttribute("id",a);p&&y&&(e=e.parentNode);try{if(!p||y)return f(e.querySelectorAll("[id='"+a+"'] "+t),s)}catch(k){}finally{v||w.removeAttribute("id")}}}return i(t,e,s,h)};for(e in i)n[e]=i[e];t=null}}(),function(){var t=r.documentElement,i=t.matchesSelector||t.mozMatchesSelector||t.webkitMatchesSelector||t.msMatchesSelector,f=!1;try{i.call(r.documentElement,"[test!='']:sizzle")}catch(e){f=!0}i&&(n.matchesSelector=function(t,r){if(r=r.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']"),!n.isXML(t))try{if(f||!u.match.PSEUDO.test(r)&&!/!=/.test(r))return i.call(t,r)}catch(e){}return n(r,null,null,[t]).length>0})}(),function(){var n=r.createElement("div");if(n.innerHTML="<div class='test e'><\/div><div class='test'><\/div>",n.getElementsByClassName&&n.getElementsByClassName("e").length!==0){if(n.lastChild.className="e",n.getElementsByClassName("e").length===1)return;u.order.splice(1,0,"CLASS");u.find.CLASS=function(n,t,i){if(typeof t.getElementsByClassName!="undefined"&&!i)return t.getElementsByClassName(n[1])};n=null}}();n.contains=r.documentElement.contains?function(n,t){return n!==t&&(n.contains?n.contains(t):!0)}:r.documentElement.compareDocumentPosition?function(n,t){return!!(n.compareDocumentPosition(t)&16)}:function(){return!1};n.isXML=function(n){var t=(n?n.ownerDocument||n:0).documentElement;return t?t.nodeName!=="HTML":!1};y=function(t,i){for(var f,e=[],o="",s=i.nodeType?[i]:i,r,h;f=u.match.PSEUDO.exec(t);)o+=f[0],t=t.replace(u.match.PSEUDO,"");for(t=u.relative[t]?t+"*":t,r=0,h=s.length;r<h;r++)n(t,s[r],e);return n.filter(o,e)};i.find=n;i.expr=n.selectors;i.expr[":"]=i.expr.filters;i.unique=n.uniqueSort;i.text=n.getText;i.isXMLDoc=n.isXML;i.contains=n.contains}();var kr=/Until$/,dr=/^(?:parents|prevUntil|prevAll)/,gr=/,/,nu=/^.[^:#\[\.,]*$/,tu=Array.prototype.slice,iu=i.expr.match.POS,ru={children:!0,contents:!0,next:!0,prev:!0};i.fn.extend({find:function(n){for(var t=this.pushStack("","find",n),e=0,u,f,r=0,o=this.length;r<o;r++)if(e=t.length,i.find(n,this[r],t),r>0)for(u=e;u<t.length;u++)for(f=0;f<e;f++)if(t[f]===t[u]){t.splice(u--,1);break}return t},has:function(n){var t=i(n);return this.filter(function(){for(var n=0,r=t.length;n<r;n++)if(i.contains(this,t[n]))return!0})},not:function(n){return this.pushStack(gt(this,n,!1),"not",n)},filter:function(n){return this.pushStack(gt(this,n,!0),"filter",n)},is:function(n){return!!n&&i.filter(n,this).length>0},closest:function(n,t){var f=[],e,s,r=this[0],h,u,o,c,l;if(i.isArray(n)){if(o={},c=1,r&&n.length){for(e=0,s=n.length;e<s;e++)u=n[e],o[u]||(o[u]=i.expr.match.POS.test(u)?i(u,t||this.context):u);while(r&&r.ownerDocument&&r!==t){for(u in o)h=o[u],(h.jquery?h.index(r)>-1:i(r).is(h))&&f.push({selector:u,elem:r,level:c});r=r.parentNode;c++}}return f}for(l=iu.test(n)?i(n,t||this.context):null,e=0,s=this.length;e<s;e++)for(r=this[e];r;){if(l?l.index(r)>-1:i.find.matchesSelector(r,n)){f.push(r);break}if(r=r.parentNode,!r||!r.ownerDocument||r===t)break}return f=f.length>1?i.unique(f):f,this.pushStack(f,"closest",n)},index:function(n){return!n||typeof n=="string"?i.inArray(this[0],n?i(n):this.parent().children()):i.inArray(n.jquery?n[0]:n,this)},add:function(n,t){var u=typeof n=="string"?i(n,t):i.makeArray(n),r=i.merge(this.get(),u);return this.pushStack(ni(u[0])||ni(r[0])?r:i.unique(r))},andSelf:function(){return this.add(this.prevObject)}});i.each({parent:function(n){var t=n.parentNode;return t&&t.nodeType!==11?t:null},parents:function(n){return i.dir(n,"parentNode")},parentsUntil:function(n,t,r){return i.dir(n,"parentNode",r)},next:function(n){return i.nth(n,2,"nextSibling")},prev:function(n){return i.nth(n,2,"previousSibling")},nextAll:function(n){return i.dir(n,"nextSibling")},prevAll:function(n){return i.dir(n,"previousSibling")},nextUntil:function(n,t,r){return i.dir(n,"nextSibling",r)},prevUntil:function(n,t,r){return i.dir(n,"previousSibling",r)},siblings:function(n){return i.sibling(n.parentNode.firstChild,n)},children:function(n){return i.sibling(n.firstChild)},contents:function(n){return i.nodeName(n,"iframe")?n.contentDocument||n.contentWindow.document:i.makeArray(n.childNodes)}},function(n,t){i.fn[n]=function(r,u){var f=i.map(this,t,r),e=tu.call(arguments);return kr.test(n)||(u=r),u&&typeof u=="string"&&(f=i.filter(u,f)),f=this.length>1&&!ru[n]?i.unique(f):f,(this.length>1||gr.test(u))&&dr.test(n)&&(f=f.reverse()),this.pushStack(f,n,e.join(","))}});i.extend({filter:function(n,t,r){return r&&(n=":not("+n+")"),t.length===1?i.find.matchesSelector(t[0],n)?[t[0]]:[]:i.find.matches(n,t)},dir:function(n,r,u){for(var e=[],f=n[r];f&&f.nodeType!==9&&(u===t||f.nodeType!==1||!i(f).is(u));)f.nodeType===1&&e.push(f),f=f[r];return e},nth:function(n,t,i){t=t||1;for(var r=0;n;n=n[i])if(n.nodeType===1&&++r===t)break;return n},sibling:function(n,t){for(var i=[];n;n=n.nextSibling)n.nodeType===1&&n!==t&&i.push(n);return i}});var uu=/ jQuery\d+="(?:\d+|null)"/g,ct=/^\s+/,ei=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,oi=/<([\w:]+)/,fu=/<tbody/i,eu=/<|&#?\w+;/,si=/<(?:script|object|embed|option|style)/i,hi=/checked\s*(?:[^=]|=\s*.checked.)/i,u={option:[1,"<select multiple='multiple'>","<\/select>"],legend:[1,"<fieldset>","<\/fieldset>"],thead:[1,"<table>","<\/table>"],tr:[2,"<table><tbody>","<\/tbody><\/table>"],td:[3,"<table><tbody><tr>","<\/tr><\/tbody><\/table>"],col:[2,"<table><tbody><\/tbody><colgroup>","<\/colgroup><\/table>"],area:[1,"<map>","<\/map>"],_default:[0,"",""]};u.optgroup=u.option;u.tbody=u.tfoot=u.colgroup=u.caption=u.thead;u.th=u.td;i.support.htmlSerialize||(u._default=[1,"div<div>","<\/div>"]);i.fn.extend({text:function(n){return i.isFunction(n)?this.each(function(t){var r=i(this);r.text(n.call(this,t,r.text()))}):typeof n!="object"&&n!==t?this.empty().append((this[0]&&this[0].ownerDocument||r).createTextNode(n)):i.text(this)},wrapAll:function(n){if(i.isFunction(n))return this.each(function(t){i(this).wrapAll(n.call(this,t))});if(this[0]){var t=i(n,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]);t.map(function(){for(var n=this;n.firstChild&&n.firstChild.nodeType===1;)n=n.firstChild;return n}).append(this)}return this},wrapInner:function(n){return i.isFunction(n)?this.each(function(t){i(this).wrapInner(n.call(this,t))}):this.each(function(){var t=i(this),r=t.contents();r.length?r.wrapAll(n):t.append(n)})},wrap:function(n){return this.each(function(){i(this).wrapAll(n)})},unwrap:function(){return this.parent().each(function(){i.nodeName(this,"body")||i(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(n){this.nodeType===1&&this.appendChild(n)})},prepend:function(){return this.domManip(arguments,!0,function(n){this.nodeType===1&&this.insertBefore(n,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(n){this.parentNode.insertBefore(n,this)});if(arguments.length){var n=i(arguments[0]);return n.push.apply(n,this.toArray()),this.pushStack(n,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(n){this.parentNode.insertBefore(n,this.nextSibling)});if(arguments.length){var n=this.pushStack(this,"after",arguments);return n.push.apply(n,i(arguments[0]).toArray()),n}},remove:function(n,t){for(var u=0,r;(r=this[u])!=null;u++)(!n||i.filter(n,[r]).length)&&(t||r.nodeType!==1||(i.cleanData(r.getElementsByTagName("*")),i.cleanData([r])),r.parentNode&&r.parentNode.removeChild(r));return this},empty:function(){for(var t=0,n;(n=this[t])!=null;t++)for(n.nodeType===1&&i.cleanData(n.getElementsByTagName("*"));n.firstChild;)n.removeChild(n.firstChild);return this},clone:function(n,t){return n=n==null?!1:n,t=t==null?n:t,this.map(function(){return i.clone(this,n,t)})},html:function(n){if(n===t)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(uu,""):null;if(typeof n!="string"||si.test(n)||!i.support.leadingWhitespace&&ct.test(n)||u[(oi.exec(n)||["",""])[1].toLowerCase()])i.isFunction(n)?this.each(function(t){var r=i(this);r.html(n.call(this,t,r.html()))}):this.empty().append(n);else{n=n.replace(ei,"<$1><\/$2>");try{for(var r=0,f=this.length;r<f;r++)this[r].nodeType===1&&(i.cleanData(this[r].getElementsByTagName("*")),this[r].innerHTML=n)}catch(e){this.empty().append(n)}}return this},replaceWith:function(n){return this[0]&&this[0].parentNode?i.isFunction(n)?this.each(function(t){var r=i(this),u=r.html();r.replaceWith(n.call(this,t,u))}):(typeof n!="string"&&(n=i(n).detach()),this.each(function(){var t=this.nextSibling,r=this.parentNode;i(this).remove();t?i(t).before(n):i(r).append(n)})):this.pushStack(i(i.isFunction(n)?n():n),"replaceWith",n)},detach:function(n){return this.remove(n,!0)},domManip:function(n,r,u){var c,h,f,o,e=n[0],l=[];if(!i.support.checkClone&&arguments.length===3&&typeof e=="string"&&hi.test(e))return this.each(function(){i(this).domManip(n,r,u,!0)});if(i.isFunction(e))return this.each(function(f){var o=i(this);n[0]=e.call(this,f,r?o.html():t);o.domManip(n,r,u)});if(this[0]){if(o=e&&e.parentNode,c=i.support.parentNode&&o&&o.nodeType===11&&o.childNodes.length===this.length?{fragment:o}:i.buildFragment(n,this,l),f=c.fragment,h=f.childNodes.length===1?f=f.firstChild:f.firstChild,h){r=r&&i.nodeName(h,"tr");for(var s=0,a=this.length,v=a-1;s<a;s++)u.call(r?or(this[s],h):this[s],c.cacheable||a>1&&s<v?i.clone(f,!0,!0):f)}l.length&&i.each(l,er)}return this}});i.buildFragment=function(n,t,u){var f,o,e,s=t&&t[0]?t[0].ownerDocument||t[0]:r;return n.length===1&&typeof n[0]=="string"&&n[0].length<512&&s===r&&n[0].charAt(0)==="<"&&!si.test(n[0])&&(i.support.checkClone||!hi.test(n[0]))&&(o=!0,e=i.fragments[n[0]],e&&e!==1&&(f=e)),f||(f=s.createDocumentFragment(),i.clean(n,s,f,u)),o&&(i.fragments[n[0]]=e?f:1),{fragment:f,cacheable:o}};i.fragments={};i.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(n,t){i.fn[n]=function(r){var e=[],u=i(r),o=this.length===1&&this[0].parentNode,f,h,s;if(o&&o.nodeType===11&&o.childNodes.length===1&&u.length===1)return u[t](this[0]),this;for(f=0,h=u.length;f<h;f++)s=(f>0?this.clone(!0):this).get(),i(u[f])[t](s),e=e.concat(s);return this.pushStack(e,n,u.selector)}});i.extend({clone:function(n,t,r){var e=n.cloneNode(!0),f,o,u;if((!i.support.noCloneEvent||!i.support.noCloneChecked)&&(n.nodeType===1||n.nodeType===11)&&!i.isXMLDoc(n))for(kt(n,e),f=w(n),o=w(e),u=0;f[u];++u)kt(f[u],o[u]);if(t&&(dt(n,e),r))for(f=w(n),o=w(e),u=0;f[u];++u)dt(f[u],o[u]);return e},clean:function(n,t,f,e){var s,h,o,y,a,l;for(t=t||r,typeof t.createElement=="undefined"&&(t=t.ownerDocument||t[0]&&t[0].ownerDocument||r),s=[],h=0;(o=n[h])!=null;h++)if(typeof o=="number"&&(o+=""),o){if(typeof o!="string"||eu.test(o)){if(typeof o=="string"){o=o.replace(ei,"<$1><\/$2>");var p=(oi.exec(o)||["",""])[1].toLowerCase(),v=u[p]||u._default,w=v[0],c=t.createElement("div");for(c.innerHTML=v[1]+o+v[2];w--;)c=c.lastChild;if(!i.support.tbody)for(y=fu.test(o),a=p==="table"&&!y?c.firstChild&&c.firstChild.childNodes:v[1]==="<table>"&&!y?c.childNodes:[],l=a.length-1;l>=0;--l)i.nodeName(a[l],"tbody")&&!a[l].childNodes.length&&a[l].parentNode.removeChild(a[l]);!i.support.leadingWhitespace&&ct.test(o)&&c.insertBefore(t.createTextNode(ct.exec(o)[0]),c.firstChild);o=c.childNodes}}else o=t.createTextNode(o);o.nodeType?s.push(o):s=i.merge(s,o)}if(f)for(h=0;s[h];h++)!e||!i.nodeName(s[h],"script")||s[h].type&&s[h].type.toLowerCase()!=="text/javascript"?(s[h].nodeType===1&&s.splice.apply(s,[h+1,0].concat(i.makeArray(s[h].getElementsByTagName("script")))),f.appendChild(s[h])):e.push(s[h].parentNode?s[h].parentNode.removeChild(s[h]):s[h]);return s},cleanData:function(n){for(var r,u,e=i.cache,s=i.expando,h=i.event.special,c=i.support.deleteExpando,t,f,o=0;(t=n[o])!=null;o++)if((!t.nodeName||!i.noData[t.nodeName.toLowerCase()])&&(u=t[i.expando],u)){if(r=e[u]&&e[u][s],r&&r.events){for(f in r.events)h[f]?i.event.remove(t,f):i.removeEvent(t,f,r.handle);r.handle&&(r.handle.elem=null)}c?delete t[i.expando]:t.removeAttribute&&t.removeAttribute(i.expando);delete e[u]}}});var ci=/alpha\([^)]*\)/i,ou=/opacity=([^)]*)/,su=/-([a-z])/ig,hu=/([A-Z])/g,li=/^-?\d+(?:px)?$/i,cu=/^-?\d/,lu={position:"absolute",visibility:"hidden",display:"block"},au=["Left","Right"],vu=["Top","Bottom"],a,ai,g,yu=function(n,t){return t.toUpperCase()};i.fn.css=function(n,r){return arguments.length===2&&r===t?this:i.access(this,n,r,!0,function(n,r,u){return u!==t?i.style(n,r,u):i.css(n,r)})};i.extend({cssHooks:{opacity:{get:function(n,t){if(t){var i=a(n,"opacity","opacity");return i===""?"1":i}return n.style.opacity}}},cssNumber:{zIndex:!0,fontWeight:!0,opacity:!0,zoom:!0,lineHeight:!0},cssProps:{float:i.support.cssFloat?"cssFloat":"styleFloat"},style:function(n,r,u,f){if(n&&n.nodeType!==3&&n.nodeType!==8&&n.style){var s,o=i.camelCase(r),h=n.style,e=i.cssHooks[o];if(r=i.cssProps[o]||o,u===t)return e&&"get"in e&&(s=e.get(n,!1,f))!==t?s:h[r];if(typeof u=="number"&&isNaN(u)||u==null)return;if(typeof u!="number"||i.cssNumber[o]||(u+="px"),!e||!("set"in e)||(u=e.set(n,u))!==t)try{h[r]=u}catch(c){}}},css:function(n,r,u){var o,f=i.camelCase(r),e=i.cssHooks[f];return(r=i.cssProps[f]||f,e&&"get"in e&&(o=e.get(n,!0,u))!==t)?o:a?a(n,r,f):void 0},swap:function(n,t,i){var u={},r;for(r in t)u[r]=n.style[r],n.style[r]=t[r];i.call(n);for(r in t)n.style[r]=u[r]},camelCase:function(n){return n.replace(su,yu)}});i.curCSS=i.css;i.each(["height","width"],function(n,t){i.cssHooks[t]={get:function(n,r,u){var f;if(r)return(n.offsetWidth!==0?f=bt(n,t,u):i.swap(n,lu,function(){f=bt(n,t,u)}),f<=0&&(f=a(n,t,t),f==="0px"&&g&&(f=g(n,t,t)),f!=null))?f===""||f==="auto"?"0px":f:f<0||f==null?(f=n.style[t],f===""||f==="auto"?"0px":f):typeof f=="string"?f:f+"px"},set:function(n,t){return li.test(t)?(t=parseFloat(t),t>=0?t+"px":void 0):t}}});i.support.opacity||(i.cssHooks.opacity={get:function(n,t){return ou.test((t&&n.currentStyle?n.currentStyle.filter:n.style.filter)||"")?parseFloat(RegExp.$1)/100+"":t?"1":""},set:function(n,t){var r=n.style,u,f;r.zoom=1;u=i.isNaN(t)?"":"alpha(opacity="+t*100+")";f=r.filter||"";r.filter=ci.test(f)?f.replace(ci,u):r.filter+" "+u}});r.defaultView&&r.defaultView.getComputedStyle&&(ai=function(n,r,u){var f,e,o;return(u=u.replace(hu,"-$1").toLowerCase(),!(e=n.ownerDocument.defaultView))?t:((o=e.getComputedStyle(n,null))&&(f=o.getPropertyValue(u),f!==""||i.contains(n.ownerDocument.documentElement,n)||(f=i.style(n,u))),f)});r.documentElement.currentStyle&&(g=function(n,t){var f,i=n.currentStyle&&n.currentStyle[t],u=n.runtimeStyle&&n.runtimeStyle[t],r=n.style;return!li.test(i)&&cu.test(i)&&(f=r.left,u&&(n.runtimeStyle.left=n.currentStyle.left),r.left=t==="fontSize"?"1em":i||0,i=r.pixelLeft+"px",r.left=f,u&&(n.runtimeStyle.left=u)),i===""?"auto":i});a=ai||g;i.expr&&i.expr.filters&&(i.expr.filters.hidden=function(n){var t=n.offsetWidth,r=n.offsetHeight;return t===0&&r===0||!i.support.reliableHiddenOffsets&&(n.style.display||i.css(n,"display"))==="none"},i.expr.filters.visible=function(n){return!i.expr.filters.hidden(n)});var pu=/%20/g,wu=/\[\]$/,vi=/\r?\n/g,bu=/#.*$/,ku=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,du=/^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,gu=/^(?:GET|HEAD)$/,nf=/^\/\//,yi=/\?/,tf=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,rf=/^(?:select|textarea)/i,pi=/\s+/,uf=/([?&])_=[^&]*/,ff=/(^|\-)([a-z])/g,ef=function(n,t,i){return t+i.toUpperCase()},wi=/^([\w\+\.\-]+:)\/\/([^\/?#:]*)(?::(\d+))?/,bi=i.fn.load,lt={},ki={},f,e;try{f=r.location.href}catch(hf){f=r.createElement("a");f.href="";f=f.href}e=wi.exec(f.toLowerCase());i.fn.extend({load:function(n,r,u){var f,e,o,s;return typeof n!="string"&&bi?bi.apply(this,arguments):this.length?(f=n.indexOf(" "),f>=0&&(e=n.slice(f,n.length),n=n.slice(0,f)),o="GET",r&&(i.isFunction(r)?(u=r,r=t):typeof r=="object"&&(r=i.param(r,i.ajaxSettings.traditional),o="POST")),s=this,i.ajax({url:n,type:o,dataType:"html",data:r,complete:function(n,t,r){r=n.responseText;n.isResolved()&&(n.done(function(n){r=n}),s.html(e?i("<div>").append(r.replace(tf,"")).find(e):r));u&&s.each(u,[r,t,n])}}),this):this},serialize:function(){return i.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?i.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||rf.test(this.nodeName)||du.test(this.type))}).map(function(n,t){var r=i(this).val();return r==null?null:i.isArray(r)?i.map(r,function(n){return{name:t.name,value:n.replace(vi,"\r\n")}}):{name:t.name,value:r.replace(vi,"\r\n")}}).get()}});i.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(n,t){i.fn[t]=function(n){return this.bind(t,n)}});i.each(["get","post"],function(n,r){i[r]=function(n,u,f,e){return i.isFunction(u)&&(e=e||f,f=u,u=t),i.ajax({type:r,url:n,data:u,success:f,dataType:e})}});i.extend({getScript:function(n,r){return i.get(n,t,r,"script")},getJSON:function(n,t,r){return i.get(n,t,r,"json")},ajaxSetup:function(n,t){t?i.extend(!0,n,i.ajaxSettings,t):(t=n,n=i.extend(!0,i.ajaxSettings,t));for(var r in{context:1,url:1})r in t?n[r]=t[r]:r in i.ajaxSettings&&(n[r]=i.ajaxSettings[r]);return n},ajaxSettings:{url:f,isLocal:/(?:^file|^widget|\-extension):$/.test(e[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":"*/*"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":n.String,"text html":!0,"text json":i.parseJSON,"text xml":i.parseXML}},ajaxPrefilter:wt(lt),ajaxTransport:wt(ki),ajax:function(n,r){function w(n,r,e,c){if(o!==2){o=2;tt&&clearTimeout(tt);l=t;nt=c||"";f.readyState=n?4:0;var a,p,v,it=e?fr(u,f,e):t,w,k;if(n>=200&&n<300||n===304)if(u.ifModified&&((w=f.getResponseHeader("Last-Modified"))&&(i.lastModified[s]=w),(k=f.getResponseHeader("Etag"))&&(i.etag[s]=k)),n===304)r="notmodified",a=!0;else try{p=ur(u,it);r="success";a=!0}catch(rt){r="parsererror";v=rt}else v=r,(!r||n)&&(r="error",n<0&&(n=0));f.status=n;f.statusText=r;a?g.resolveWith(h,[p,r,f]):g.rejectWith(h,[f,r,v]);f.statusCode(b);b=t;y&&d.trigger("ajax"+(a?"Success":"Error"),[f,u,a?p:v]);ut.resolveWith(h,[f,r]);y&&(d.trigger("ajaxComplete",[f,u]),--i.active||i.event.trigger("ajaxStop"))}}var it,rt;typeof n=="object"&&(r=n,n=t);r=r||{};var u=i.ajaxSetup({},r),h=u.context||u,d=h!==u&&(h.nodeType||h instanceof i)?i(h):i.event,g=i.Deferred(),ut=i._Deferred(),b=u.statusCode||{},s,c={},nt,k,l,tt,a,o=0,y,v,f={readyState:0,setRequestHeader:function(n,t){return o||(c[n.toLowerCase().replace(ff,ef)]=t),this},getAllResponseHeaders:function(){return o===2?nt:null},getResponseHeader:function(n){var i;if(o===2){if(!k)for(k={};i=ku.exec(nt);)k[i[1].toLowerCase()]=i[2];i=k[n.toLowerCase()]}return i===t?null:i},overrideMimeType:function(n){return o||(u.mimeType=n),this},abort:function(n){return n=n||"abort",l&&l.abort(n),w(0,n),this}};if(g.promise(f),f.success=f.done,f.error=f.fail,f.complete=ut.done,f.statusCode=function(n){if(n){var t;if(o<2)for(t in n)b[t]=[b[t],n[t]];else t=n[f.status],f.then(t,t)}return this},u.url=((n||u.url)+"").replace(bu,"").replace(nf,e[1]+"//"),u.dataTypes=i.trim(u.dataType||"*").toLowerCase().split(pi),u.crossDomain||(a=wi.exec(u.url.toLowerCase()),u.crossDomain=a&&(a[1]!=e[1]||a[2]!=e[2]||(a[3]||(a[1]==="http:"?80:443))!=(e[3]||(e[1]==="http:"?80:443)))),u.data&&u.processData&&typeof u.data!="string"&&(u.data=i.param(u.data,u.traditional)),p(lt,u,r,f),o===2)return!1;y=u.global;u.type=u.type.toUpperCase();u.hasContent=!gu.test(u.type);y&&i.active++==0&&i.event.trigger("ajaxStart");u.hasContent||(u.data&&(u.url+=(yi.test(u.url)?"&":"?")+u.data),s=u.url,u.cache===!1&&(it=i.now(),rt=u.url.replace(uf,"$1_="+it),u.url=rt+(rt===u.url?(yi.test(u.url)?"&":"?")+"_="+it:"")));(u.data&&u.hasContent&&u.contentType!==!1||r.contentType)&&(c["Content-Type"]=u.contentType);u.ifModified&&(s=s||u.url,i.lastModified[s]&&(c["If-Modified-Since"]=i.lastModified[s]),i.etag[s]&&(c["If-None-Match"]=i.etag[s]));c.Accept=u.dataTypes[0]&&u.accepts[u.dataTypes[0]]?u.accepts[u.dataTypes[0]]+(u.dataTypes[0]!=="*"?", */*; q=0.01":""):u.accepts["*"];for(v in u.headers)f.setRequestHeader(v,u.headers[v]);if(u.beforeSend&&(u.beforeSend.call(h,f,u)===!1||o===2))return f.abort(),!1;for(v in{success:1,error:1,complete:1})f[v](u[v]);if(l=p(ki,u,r,f),l){f.readyState=1;y&&d.trigger("ajaxSend",[f,u]);u.async&&u.timeout>0&&(tt=setTimeout(function(){f.abort("timeout")},u.timeout));try{o=1;l.send(c,w)}catch(ft){status<2?w(-1,ft):i.error(ft)}}else w(-1,"No Transport");return f},param:function(n,r){var u=[],e=function(n,t){t=i.isFunction(t)?t():t;u[u.length]=encodeURIComponent(n)+"="+encodeURIComponent(t)},f;if(r===t&&(r=i.ajaxSettings.traditional),i.isArray(n)||n.jquery&&!i.isPlainObject(n))i.each(n,function(){e(this.name,this.value)});else for(f in n)it(f,n[f],r,e);return u.join("&").replace(pu,"+")}});i.extend({active:0,lastModified:{},etag:{}});di=i.now();v=/(\=)\?(&|$)|()\?\?()/i;i.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return i.expando+"_"+di++}});i.ajaxPrefilter("json jsonp",function(t,r,u){var h=typeof t.data=="string";if(t.dataTypes[0]==="jsonp"||r.jsonpCallback||r.jsonp!=null||t.jsonp!==!1&&(v.test(t.url)||h&&v.test(t.data))){var o,f=t.jsonpCallback=i.isFunction(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,c=n[f],e=t.url,s=t.data,l="$1"+f+"$2",a=function(){n[f]=c;o&&i.isFunction(c)&&n[f](o[0])};return t.jsonp!==!1&&(e=e.replace(v,l),t.url===e&&(h&&(s=s.replace(v,l)),t.data===s&&(e+=(/\?/.test(e)?"&":"?")+t.jsonp+"="+f))),t.url=e,t.data=s,n[f]=function(n){o=[n]},u.then(a,a),t.converters["script json"]=function(){return o||i.error(f+" was not called"),o[0]},t.dataTypes[0]="json","script"}});i.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(n){return i.globalEval(n),n}}});i.ajaxPrefilter("script",function(n){n.cache===t&&(n.cache=!1);n.crossDomain&&(n.type="GET",n.global=!1)});i.ajaxTransport("script",function(n){if(n.crossDomain){var i,u=r.head||r.getElementsByTagName("head")[0]||r.documentElement;return{send:function(f,e){i=r.createElement("script");i.async="async";n.scriptCharset&&(i.charset=n.scriptCharset);i.src=n.url;i.onload=i.onreadystatechange=function(n,r){(!i.readyState||/loaded|complete/.test(i.readyState))&&(i.onload=i.onreadystatechange=null,u&&i.parentNode&&u.removeChild(i),i=t,r||e(200,"success"))};u.insertBefore(i,u.firstChild)},abort:function(){i&&i.onload(0,1)}}}});gi=i.now();i.ajaxSettings.xhr=n.ActiveXObject?function(){return!this.isLocal&&pt()||ir()}:pt;y=i.ajaxSettings.xhr();i.support.ajax=!!y;i.support.cors=y&&"withCredentials"in y;y=t;i.support.ajax&&i.ajaxTransport(function(n){if(!n.crossDomain||i.support.cors){var r;return{send:function(u,f){var e=n.xhr(),s,o;if(n.username?e.open(n.type,n.url,n.async,n.username,n.password):e.open(n.type,n.url,n.async),n.xhrFields)for(o in n.xhrFields)e[o]=n.xhrFields[o];n.mimeType&&e.overrideMimeType&&e.overrideMimeType(n.mimeType);n.crossDomain&&!n.hasContent||u["X-Requested-With"]||(u["X-Requested-With"]="XMLHttpRequest");try{for(o in u)e.setRequestHeader(o,u[o])}catch(c){}e.send(n.hasContent&&n.data||null);r=function(u,o){var c,v,y,l,a;try{if(r&&(o||e.readyState===4))if(r=t,s&&(e.onreadystatechange=i.noop,delete h[s]),o)e.readyState!==4&&e.abort();else{c=e.status;y=e.getAllResponseHeaders();l={};a=e.responseXML;a&&a.documentElement&&(l.xml=a);l.text=e.responseText;try{v=e.statusText}catch(w){v=""}c||!n.isLocal||n.crossDomain?c===1223&&(c=204):c=l.text?200:404}}catch(p){o||f(-1,p)}l&&f(c,v,l,y)};n.async&&e.readyState!==4?(h||(h={},rr()),s=gi++,e.onreadystatechange=h[s]=r):r()},abort:function(){r&&r(0,1)}}}});var at={},of=/^(?:toggle|show|hide)$/,sf=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,nt,nr=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];i.fn.extend({show:function(n,t,r){var u,e,f,s;if(n||n===0)return this.animate(o("show",3),n,t,r);for(f=0,s=this.length;f<s;f++)u=this[f],e=u.style.display,!i._data(u,"olddisplay")&&e==="none"&&(e=u.style.display=""),e===""&&i.css(u,"display")==="none"&&i._data(u,"olddisplay",yt(u.nodeName));for(f=0;f<s;f++)u=this[f],e=u.style.display,(e===""||e==="none")&&(u.style.display=i._data(u,"olddisplay")||"");return this},hide:function(n,t,r){var u,f,e;if(n||n===0)return this.animate(o("hide",3),n,t,r);for(u=0,f=this.length;u<f;u++)e=i.css(this[u],"display"),e==="none"||i._data(this[u],"olddisplay")||i._data(this[u],"olddisplay",e);for(u=0;u<f;u++)this[u].style.display="none";return this},_toggle:i.fn.toggle,toggle:function(n,t,r){var u=typeof n=="boolean";return i.isFunction(n)&&i.isFunction(t)?this._toggle.apply(this,arguments):n==null||u?this.each(function(){var t=u?n:i(this).is(":hidden");i(this)[t?"show":"hide"]()}):this.animate(o("toggle",3),n,t,r),this},fadeTo:function(n,t,i,r){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:t},n,i,r)},animate:function(n,t,r,u){var f=i.speed(t,r,u);return i.isEmptyObject(n)?this.each(f.complete):this[f.queue===!1?"each":"queue"](function(){var r=i.extend({},f),t,s=this.nodeType===1,e=s&&i(this).is(":hidden"),o=this,u,h;for(t in n){if(u=i.camelCase(t),t!==u&&(n[u]=n[t],delete n[t],t=u),n[t]==="hide"&&e||n[t]==="show"&&!e)return r.complete.call(this);s&&(t==="height"||t==="width")&&(r.overflow=[this.style.overflow,this.style.overflowX,this.style.overflowY],i.css(this,"display")==="inline"&&i.css(this,"float")==="none"&&(i.support.inlineBlockNeedsLayout?(h=yt(this.nodeName),h==="inline"?this.style.display="inline-block":(this.style.display="inline",this.style.zoom=1)):this.style.display="inline-block"));i.isArray(n[t])&&((r.specialEasing=r.specialEasing||{})[t]=n[t][1],n[t]=n[t][0])}return r.overflow!=null&&(this.style.overflow="hidden"),r.curAnim=i.extend({},n),i.each(n,function(t,u){var c=new i.fx(o,r,t),s,f,h,l;of.test(u)?c[u==="toggle"?e?"show":"hide":u](n):(s=sf.exec(u),f=c.cur(),s?(h=parseFloat(s[2]),l=s[3]||(i.cssNumber[t]?"":"px"),l!=="px"&&(i.style(o,t,(h||1)+l),f=(h||1)/c.cur()*f,i.style(o,t,f+l)),s[1]&&(h=(s[1]==="-="?-1:1)*h+f),c.custom(f,h,l)):c.custom(f,u,""))}),!0})},stop:function(n,t){var r=i.timers;return n&&this.queue([]),this.each(function(){for(var n=r.length-1;n>=0;n--)r[n].elem===this&&(t&&r[n](!0),r.splice(n,1))}),t||this.dequeue(),this}});i.each({slideDown:o("show",1),slideUp:o("hide",1),slideToggle:o("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(n,t){i.fn[n]=function(n,i,r){return this.animate(t,n,i,r)}});i.extend({speed:function(n,t,r){var u=n&&typeof n=="object"?i.extend({},n):{complete:r||!r&&t||i.isFunction(n)&&n,duration:n,easing:r&&t||t&&!i.isFunction(t)&&t};return u.duration=i.fx.off?0:typeof u.duration=="number"?u.duration:u.duration in i.fx.speeds?i.fx.speeds[u.duration]:i.fx.speeds._default,u.old=u.complete,u.complete=function(){u.queue!==!1&&i(this).dequeue();i.isFunction(u.old)&&u.old.call(this)},u},easing:{linear:function(n,t,i,r){return i+r*n},swing:function(n,t,i,r){return(-Math.cos(n*Math.PI)/2+.5)*r+i}},timers:[],fx:function(n,t,i){this.options=t;this.elem=n;this.prop=i;t.orig||(t.orig={})}});i.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this);(i.fx.step[this.prop]||i.fx.step._default)(this)},cur:function(){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];var t,n=i.css(this.elem,this.prop);return isNaN(t=parseFloat(n))?!n||n==="auto"?0:n:t},custom:function(n,t,r){function u(n){return e.step(n)}var e=this,f=i.fx;this.startTime=i.now();this.start=n;this.end=t;this.unit=r||this.unit||(i.cssNumber[this.prop]?"":"px");this.now=this.start;this.pos=this.state=0;u.elem=this.elem;u()&&i.timers.push(u)&&!nt&&(nt=setInterval(f.tick,f.interval))},show:function(){this.options.orig[this.prop]=i.style(this.elem,this.prop);this.options.show=!0;this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur());i(this.elem).show()},hide:function(){this.options.orig[this.prop]=i.style(this.elem,this.prop);this.options.hide=!0;this.custom(this.cur(),0)},step:function(n){var u=i.now(),f=!0,e,o,s,t,r,h,c;if(n||u>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=!0;for(e in this.options.curAnim)this.options.curAnim[e]!==!0&&(f=!1);if(f){if(this.options.overflow==null||i.support.shrinkWrapBlocks||(o=this.elem,s=this.options,i.each(["","X","Y"],function(n,t){o.style["overflow"+t]=s.overflow[n]})),this.options.hide&&i(this.elem).hide(),this.options.hide||this.options.show)for(t in this.options.curAnim)i.style(this.elem,t,this.options.orig[t]);this.options.complete.call(this.elem)}return!1}return r=u-this.startTime,this.state=r/this.options.duration,h=this.options.specialEasing&&this.options.specialEasing[this.prop],c=this.options.easing||(i.easing.swing?"swing":"linear"),this.pos=i.easing[h||c](this.state,r,0,1,this.options.duration),this.now=this.start+(this.end-this.start)*this.pos,this.update(),!0}};i.extend(i.fx,{tick:function(){for(var t=i.timers,n=0;n<t.length;n++)t[n]()||t.splice(n--,1);t.length||i.fx.stop()},interval:13,stop:function(){clearInterval(nt);nt=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(n){i.style(n.elem,"opacity",n.now)},_default:function(n){n.elem.style&&n.elem.style[n.prop]!=null?n.elem.style[n.prop]=(n.prop==="width"||n.prop==="height"?Math.max(0,n.now):n.now)+n.unit:n.elem[n.prop]=n.now}}});i.expr&&i.expr.filters&&(i.expr.filters.animated=function(n){return i.grep(i.timers,function(t){return n===t.elem}).length});tr=/^t(?:able|d|h)$/i;vt=/^(?:body|html)$/i;i.fn.offset="getBoundingClientRect"in r.documentElement?function(n){var t=this[0],r,f,u;if(n)return this.each(function(t){i.offset.setOffset(this,n,t)});if(!t||!t.ownerDocument)return null;if(t===t.ownerDocument.body)return i.offset.bodyOffset(t);try{r=t.getBoundingClientRect()}catch(y){}if(f=t.ownerDocument,u=f.documentElement,!r||!i.contains(u,t))return r?{top:r.top,left:r.left}:{top:0,left:0};var e=f.body,o=tt(f),s=u.clientTop||e.clientTop||0,h=u.clientLeft||e.clientLeft||0,c=o.pageYOffset||i.support.boxModel&&u.scrollTop||e.scrollTop,l=o.pageXOffset||i.support.boxModel&&u.scrollLeft||e.scrollLeft,a=r.top+c-s,v=r.left+l-h;return{top:a,left:v}}:function(n){var t=this[0];if(n)return this.each(function(t){i.offset.setOffset(this,n,t)});if(!t||!t.ownerDocument)return null;if(t===t.ownerDocument.body)return i.offset.bodyOffset(t);i.offset.initialize();for(var r,h=t.offsetParent,a=t,c=t.ownerDocument,l=c.documentElement,e=c.body,s=c.defaultView,o=s?s.getComputedStyle(t,null):t.currentStyle,u=t.offsetTop,f=t.offsetLeft;(t=t.parentNode)&&t!==e&&t!==l;){if(i.offset.supportsFixedPosition&&o.position==="fixed")break;r=s?s.getComputedStyle(t,null):t.currentStyle;u-=t.scrollTop;f-=t.scrollLeft;t===h&&(u+=t.offsetTop,f+=t.offsetLeft,i.offset.doesNotAddBorder&&(!i.offset.doesAddBorderForTableAndCells||!tr.test(t.nodeName))&&(u+=parseFloat(r.borderTopWidth)||0,f+=parseFloat(r.borderLeftWidth)||0),a=h,h=t.offsetParent);i.offset.subtractsBorderForOverflowNotVisible&&r.overflow!=="visible"&&(u+=parseFloat(r.borderTopWidth)||0,f+=parseFloat(r.borderLeftWidth)||0);o=r}return(o.position==="relative"||o.position==="static")&&(u+=e.offsetTop,f+=e.offsetLeft),i.offset.supportsFixedPosition&&o.position==="fixed"&&(u+=Math.max(l.scrollTop,e.scrollTop),f+=Math.max(l.scrollLeft,e.scrollLeft)),{top:u,left:f}};i.offset={initialize:function(){var t=r.body,u=r.createElement("div"),f,n,o,e,s=parseFloat(i.css(t,"marginTop"))||0;i.extend(u.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"});u.innerHTML="<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div><\/div><\/div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td><\/td><\/tr><\/table>";t.insertBefore(u,t.firstChild);f=u.firstChild;n=f.firstChild;e=f.nextSibling.firstChild.firstChild;this.doesNotAddBorder=n.offsetTop!==5;this.doesAddBorderForTableAndCells=e.offsetTop===5;n.style.position="fixed";n.style.top="20px";this.supportsFixedPosition=n.offsetTop===20||n.offsetTop===15;n.style.position=n.style.top="";f.style.overflow="hidden";f.style.position="relative";this.subtractsBorderForOverflowNotVisible=n.offsetTop===-5;this.doesNotIncludeMarginInBodyOffset=t.offsetTop!==s;t.removeChild(u);t=u=f=n=o=e=null;i.offset.initialize=i.noop},bodyOffset:function(n){var t=n.offsetTop,r=n.offsetLeft;return i.offset.initialize(),i.offset.doesNotIncludeMarginInBodyOffset&&(t+=parseFloat(i.css(n,"marginTop"))||0,r+=parseFloat(i.css(n,"marginLeft"))||0),{top:t,left:r}},setOffset:function(n,t,r){var h=i.css(n,"position");h==="static"&&(n.style.position="relative");var f=i(n),e=f.offset(),c=i.css(n,"top"),l=i.css(n,"left"),o=h==="absolute"&&i.inArray("auto",[c,l])>-1,u={},s={},a,v;o&&(s=f.position());a=o?s.top:parseInt(c,10)||0;v=o?s.left:parseInt(l,10)||0;i.isFunction(t)&&(t=t.call(n,r,e));t.top!=null&&(u.top=t.top-e.top+a);t.left!=null&&(u.left=t.left-e.left+v);"using"in t?t.using.call(n,u):f.css(u)}};i.fn.extend({position:function(){if(!this[0])return null;var u=this[0],n=this.offsetParent(),t=this.offset(),r=vt.test(n[0].nodeName)?{top:0,left:0}:n.offset();return t.top-=parseFloat(i.css(u,"marginTop"))||0,t.left-=parseFloat(i.css(u,"marginLeft"))||0,r.top+=parseFloat(i.css(n[0],"borderTopWidth"))||0,r.left+=parseFloat(i.css(n[0],"borderLeftWidth"))||0,{top:t.top-r.top,left:t.left-r.left}},offsetParent:function(){return this.map(function(){for(var n=this.offsetParent||r.body;n&&!vt.test(n.nodeName)&&i.css(n,"position")==="static";)n=n.offsetParent;return n})}});i.each(["Left","Top"],function(n,r){var u="scroll"+r;i.fn[u]=function(r){var e=this[0],f;return e?r!==t?this.each(function(){f=tt(this);f?f.scrollTo(n?i(f).scrollLeft():r,n?r:i(f).scrollTop()):this[u]=r}):(f=tt(e),f?"pageXOffset"in f?f[n?"pageYOffset":"pageXOffset"]:i.support.boxModel&&f.document.documentElement[u]||f.document.body[u]:e[u]):null}});i.each(["Height","Width"],function(n,r){var u=r.toLowerCase();i.fn["inner"+r]=function(){return this[0]?parseFloat(i.css(this[0],u,"padding")):null};i.fn["outer"+r]=function(n){return this[0]?parseFloat(i.css(this[0],u,n?"margin":"border")):null};i.fn[u]=function(n){var f=this[0],e,o,s;return f?i.isFunction(n)?this.each(function(t){var r=i(this);r[u](n.call(this,t,r[u]()))}):i.isWindow(f)?(e=f.document.documentElement["client"+r],f.document.compatMode==="CSS1Compat"&&e||f.document.body["client"+r]||e):f.nodeType===9?Math.max(f.documentElement["client"+r],f.body["scroll"+r],f.documentElement["scroll"+r],f.body["offset"+r],f.documentElement["offset"+r]):n===t?(o=i.css(f,u),s=parseFloat(o),i.isNaN(s)?o:s):this.css(u,typeof n=="string"?n:n+"px"):n==null?null:this}});n.jQuery=n.$=i})(window);jQuery.cookie=function(n,t,i){var f,r,e,o,u,s;if(typeof t!="undefined"){i=i||{};t===null&&(t="",i.expires=-1);f="";i.expires&&(typeof i.expires=="number"||i.expires.toUTCString)&&(typeof i.expires=="number"?(r=new Date,r.setTime(r.getTime()+i.expires*864e5)):r=i.expires,f="; expires="+r.toUTCString());var h=i.path?"; path="+i.path:"",c=i.domain?"; domain="+i.domain:"",l=i.secure?"; secure":"";document.cookie=[n,"=",t,f,h,c,l].join("")}else{if(e=null,document.cookie&&document.cookie!="")for(o=document.cookie.split(";"),u=0;u<o.length;u++)if(s=jQuery.trim(o[u]),s.substring(0,n.length+1)==n+"="){e=s.substring(n.length+1);break}return e}},function(n,t){function i(t,i){var u=t.nodeName.toLowerCase();return"area"===u?(i=t.parentNode,u=i.name,!t.href||!u||i.nodeName.toLowerCase()!=="map")?!1:(t=n("img[usemap=#"+u+"]")[0],!!t&&r(t)):(/input|select|textarea|button|object/.test(u)?!t.disabled:"a"==u?t.href||i:i)&&r(t)}function r(t){return!n(t).parents().andSelf().filter(function(){return n.curCSS(this,"visibility")==="hidden"||n.expr.filters.hidden(this)}).length}n.ui=n.ui||{};n.ui.version||(n.extend(n.ui,{version:"1.8.16",keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}}),n.fn.extend({propAttr:n.fn.prop||n.fn.attr,_focus:n.fn.focus,focus:function(t,i){return typeof t=="number"?this.each(function(){var r=this;setTimeout(function(){n(r).focus();i&&i.call(r)},t)}):this._focus.apply(this,arguments)},scrollParent:function(){var t;return t=n.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(n.curCSS(this,"position",1))&&/(auto|scroll)/.test(n.curCSS(this,"overflow",1)+n.curCSS(this,"overflow-y",1)+n.curCSS(this,"overflow-x",1))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(n.curCSS(this,"overflow",1)+n.curCSS(this,"overflow-y",1)+n.curCSS(this,"overflow-x",1))}).eq(0),/fixed/.test(this.css("position"))||!t.length?n(document):t},zIndex:function(i){if(i!==t)return this.css("zIndex",i);if(this.length){i=n(this[0]);for(var r;i.length&&i[0]!==document;){if(r=i.css("position"),(r==="absolute"||r==="relative"||r==="fixed")&&(r=parseInt(i.css("zIndex"),10),!isNaN(r)&&r!==0))return r;i=i.parent()}}return 0},disableSelection:function(){return this.bind((n.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(n){n.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}}),n.each(["Width","Height"],function(i,r){function u(t,i,r,u){return n.each(o,function(){i-=parseFloat(n.curCSS(t,"padding"+this,!0))||0;r&&(i-=parseFloat(n.curCSS(t,"border"+this+"Width",!0))||0);u&&(i-=parseFloat(n.curCSS(t,"margin"+this,!0))||0)}),i}var o=r==="Width"?["Left","Right"]:["Top","Bottom"],f=r.toLowerCase(),e={innerWidth:n.fn.innerWidth,innerHeight:n.fn.innerHeight,outerWidth:n.fn.outerWidth,outerHeight:n.fn.outerHeight};n.fn["inner"+r]=function(i){return i===t?e["inner"+r].call(this):this.each(function(){n(this).css(f,u(this,i)+"px")})};n.fn["outer"+r]=function(t,i){return typeof t!="number"?e["outer"+r].call(this,t):this.each(function(){n(this).css(f,u(this,t,!0,i)+"px")})}}),n.extend(n.expr[":"],{data:function(t,i,r){return!!n.data(t,r[3])},focusable:function(t){return i(t,!isNaN(n.attr(t,"tabindex")))},tabbable:function(t){var r=n.attr(t,"tabindex"),u=isNaN(r);return(u||r>=0)&&i(t,!u)}}),n(function(){var i=document.body,t=i.appendChild(t=document.createElement("div"));n.extend(t.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0});n.support.minHeight=t.offsetHeight===100;n.support.selectstart="onselectstart"in t;i.removeChild(t).style.display="none"}),n.extend(n.ui,{plugin:{add:function(t,i,r){t=n.ui[t].prototype;for(var u in r)t.plugins[u]=t.plugins[u]||[],t.plugins[u].push([i,r[u]])},call:function(n,t,i){if((t=n.plugins[t])&&n.element[0].parentNode)for(var r=0;r<t.length;r++)n.options[t[r][0]]&&t[r][1].apply(n.element,i)}},contains:function(n,t){return document.compareDocumentPosition?n.compareDocumentPosition(t)&16:n!==t&&n.contains(t)},hasScroll:function(t,i){if(n(t).css("overflow")==="hidden")return!1;i=i&&i==="left"?"scrollLeft":"scrollTop";var r=!1;return t[i]>0?!0:(t[i]=1,r=t[i]>0,t[i]=0,r)},isOverAxis:function(n,t,i){return n>t&&n<t+i},isOver:function(t,i,r,u,f,e){return n.ui.isOverAxis(t,r,f)&&n.ui.isOverAxis(i,u,e)}}))}(jQuery),function(n,t){var i,r;n.cleanData?(i=n.cleanData,n.cleanData=function(t){for(var r=0,u;(u=t[r])!=null;r++)try{n(u).triggerHandler("remove")}catch(f){}i(t)}):(r=n.fn.remove,n.fn.remove=function(t,i){return this.each(function(){return i||(!t||n.filter(t,[this]).length)&&n("*",this).add([this]).each(function(){try{n(this).triggerHandler("remove")}catch(t){}}),r.call(n(this),t,i)})});n.widget=function(t,i,r){var u=t.split(".")[0],f;t=t.split(".")[1];f=u+"-"+t;r||(r=i,i=n.Widget);n.expr[":"][f]=function(i){return!!n.data(i,t)};n[u]=n[u]||{};n[u][t]=function(n,t){arguments.length&&this._createWidget(n,t)};i=new i;i.options=n.extend(!0,{},i.options);n[u][t].prototype=n.extend(!0,i,{namespace:u,widgetName:t,widgetEventPrefix:n[u][t].prototype.widgetEventPrefix||t,widgetBaseClass:f},r);n.widget.bridge(t,n[u][t])};n.widget.bridge=function(i,r){n.fn[i]=function(u){var f=typeof u=="string",e=Array.prototype.slice.call(arguments,1),o=this;return(u=!f&&e.length?n.extend.apply(null,[!0,u].concat(e)):u,f&&u.charAt(0)==="_")?o:(f?this.each(function(){var r=n.data(this,i),f=r&&n.isFunction(r[u])?r[u].apply(r,e):r;if(f!==r&&f!==t)return o=f,!1}):this.each(function(){var t=n.data(this,i);t?t.option(u||{})._init():n.data(this,i,new r(u,this))}),o)}};n.Widget=function(n,t){arguments.length&&this._createWidget(n,t)};n.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:!1},_createWidget:function(t,i){n.data(i,this.widgetName,this);this.element=n(i);this.options=n.extend(!0,{},this.options,this._getCreateOptions(),t);var r=this;this.element.bind("remove."+this.widgetName,function(){r.destroy()});this._create();this._trigger("create");this._init()},_getCreateOptions:function(){return n.metadata&&n.metadata.get(this.element[0])[this.widgetName]},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName);this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+"-disabled ui-state-disabled")},widget:function(){return this.element},option:function(i,r){var u=i;if(arguments.length===0)return n.extend({},this.options);if(typeof i=="string"){if(r===t)return this.options[i];u={};u[i]=r}return this._setOptions(u),this},_setOptions:function(t){var i=this;return n.each(t,function(n,t){i._setOption(n,t)}),this},_setOption:function(n,t){return this.options[n]=t,n==="disabled"&&this.widget()[t?"addClass":"removeClass"](this.widgetBaseClass+"-disabled ui-state-disabled").attr("aria-disabled",t),this},enable:function(){return this._setOption("disabled",!1)},disable:function(){return this._setOption("disabled",!0)},_trigger:function(t,i,r){var f=this.options[t],u;if(i=n.Event(i),i.type=(t===this.widgetEventPrefix?t:this.widgetEventPrefix+t).toLowerCase(),r=r||{},i.originalEvent)for(t=n.event.props.length;t;)u=n.event.props[--t],i[u]=i.originalEvent[u];return this.element.trigger(i,r),!(n.isFunction(f)&&f.call(this.element[0],i,r)===!1||i.isDefaultPrevented())}}}(jQuery),function(n){n.ui=n.ui||{};var t=/left|center|right/,i=/top|center|bottom/,r=n.fn.position,u=n.fn.offset;n.fn.position=function(u){if(!u||!u.of)return r.apply(this,arguments);u=n.extend({},u);var e=n(u.of),l=e[0],c=(u.collision||"flip").split(" "),o=u.offset?u.offset.split(" "):[0,0],s,h,f;return l.nodeType===9?(s=e.width(),h=e.height(),f={top:0,left:0}):l.setTimeout?(s=e.width(),h=e.height(),f={top:e.scrollTop(),left:e.scrollLeft()}):l.preventDefault?(u.at="left top",s=h=0,f={top:u.of.pageY,left:u.of.pageX}):(s=e.outerWidth(),h=e.outerHeight(),f=e.offset()),n.each(["my","at"],function(){var n=(u[this]||"").split(" ");n.length===1&&(n=t.test(n[0])?n.concat(["center"]):i.test(n[0])?["center"].concat(n):["center","center"]);n[0]=t.test(n[0])?n[0]:"center";n[1]=i.test(n[1])?n[1]:"center";u[this]=n}),c.length===1&&(c[1]=c[0]),o[0]=parseInt(o[0],10)||0,o.length===1&&(o[1]=o[0]),o[1]=parseInt(o[1],10)||0,u.at[0]==="right"?f.left+=s:u.at[0]==="center"&&(f.left+=s/2),u.at[1]==="bottom"?f.top+=h:u.at[1]==="center"&&(f.top+=h/2),f.left+=o[0],f.top+=o[1],this.each(function(){var i=n(this),r=i.outerWidth(),e=i.outerHeight(),l=parseInt(n.curCSS(this,"marginLeft",!0))||0,a=parseInt(n.curCSS(this,"marginTop",!0))||0,y=r+l+(parseInt(n.curCSS(this,"marginRight",!0))||0),p=e+a+(parseInt(n.curCSS(this,"marginBottom",!0))||0),t=n.extend({},f),v;u.my[0]==="right"?t.left-=r:u.my[0]==="center"&&(t.left-=r/2);u.my[1]==="bottom"?t.top-=e:u.my[1]==="center"&&(t.top-=e/2);t.left=Math.round(t.left);t.top=Math.round(t.top);v={left:t.left-l,top:t.top-a};n.each(["left","top"],function(i,f){n.ui.position[c[i]]&&n.ui.position[c[i]][f](t,{targetWidth:s,targetHeight:h,elemWidth:r,elemHeight:e,collisionPosition:v,collisionWidth:y,collisionHeight:p,offset:o,my:u.my,at:u.at})});n.fn.bgiframe&&i.bgiframe();i.offset(n.extend(t,{using:u.using}))})};n.ui.position={fit:{left:function(t,i){var r=n(window);r=i.collisionPosition.left+i.collisionWidth-r.width()-r.scrollLeft();t.left=r>0?t.left-r:Math.max(t.left-i.collisionPosition.left,t.left)},top:function(t,i){var r=n(window);r=i.collisionPosition.top+i.collisionHeight-r.height()-r.scrollTop();t.top=r>0?t.top-r:Math.max(t.top-i.collisionPosition.top,t.top)}},flip:{left:function(t,i){var r;if(i.at[0]!=="center"){r=n(window);r=i.collisionPosition.left+i.collisionWidth-r.width()-r.scrollLeft();var u=i.my[0]==="left"?-i.elemWidth:i.my[0]==="right"?i.elemWidth:0,f=i.at[0]==="left"?i.targetWidth:-i.targetWidth,e=-2*i.offset[0];t.left+=i.collisionPosition.left<0?u+f+e:r>0?u+f+e:0}},top:function(t,i){var r;if(i.at[1]!=="center"){r=n(window);r=i.collisionPosition.top+i.collisionHeight-r.height()-r.scrollTop();var u=i.my[1]==="top"?-i.elemHeight:i.my[1]==="bottom"?i.elemHeight:0,f=i.at[1]==="top"?i.targetHeight:-i.targetHeight,e=-2*i.offset[1];t.top+=i.collisionPosition.top<0?u+f+e:r>0?u+f+e:0}}}};n.offset.setOffset||(n.offset.setOffset=function(t,i){/static/.test(n.curCSS(t,"position"))&&(t.style.position="relative");var u=n(t),r=u.offset(),f=parseInt(n.curCSS(t,"top",!0),10)||0,e=parseInt(n.curCSS(t,"left",!0),10)||0;r={top:i.top-r.top+f,left:i.left-r.left+e};"using"in i?i.using.call(t,r):u.css(r)},n.fn.offset=function(t){var i=this[0];return!i||!i.ownerDocument?null:t?this.each(function(){n.offset.setOffset(this,t)}):u.call(this)})}(jQuery),function(n){var t=0;n.widget("ui.autocomplete",{options:{appendTo:"body",autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null},pending:0,_create:function(){var t=this,r=this.element[0].ownerDocument,i;this.element.addClass("ui-autocomplete-input").attr("autocomplete","off").attr({role:"textbox","aria-autocomplete":"list","aria-haspopup":"true"}).bind("keydown.autocomplete",function(r){if(!(t.options.disabled||t.element.propAttr("readOnly"))){i=!1;var u=n.ui.keyCode;switch(r.keyCode){case u.PAGE_UP:t._move("previousPage",r);break;case u.PAGE_DOWN:t._move("nextPage",r);break;case u.UP:t._move("previous",r);r.preventDefault();break;case u.DOWN:t._move("next",r);r.preventDefault();break;case u.ENTER:case u.NUMPAD_ENTER:t.menu.active&&(i=!0,r.preventDefault());case u.TAB:if(!t.menu.active)return;t.menu.select(r);break;case u.ESCAPE:t.element.val(t.term);t.close(r);break;default:clearTimeout(t.searching);t.searching=setTimeout(function(){t.term!=t.element.val()&&(t.selectedItem=null,t.search(null,r))},t.options.delay)}}}).bind("keypress.autocomplete",function(n){i&&(i=!1,n.preventDefault())}).bind("focus.autocomplete",function(){t.options.disabled||(t.selectedItem=null,t.previous=t.element.val())}).bind("blur.autocomplete",function(n){t.options.disabled||(clearTimeout(t.searching),t.closing=setTimeout(function(){t.close(n);t._change(n)},150))});this._initSource();this.response=function(){return t._response.apply(t,arguments)};this.menu=n("<ul><\/ul>").addClass("ui-autocomplete").appendTo(n(this.options.appendTo||"body",r)[0]).mousedown(function(i){var r=t.menu.element[0];n(i.target).closest(".ui-menu-item").length||setTimeout(function(){n(document).one("mousedown",function(i){i.target===t.element[0]||i.target===r||n.ui.contains(r,i.target)||t.close()})},1);setTimeout(function(){clearTimeout(t.closing)},13)}).menu({focus:function(n,i){i=i.item.data("item.autocomplete");!1!==t._trigger("focus",n,{item:i})&&/^key/.test(n.originalEvent.type)&&t.element.val(i.value)},selected:function(n,i){var u=i.item.data("item.autocomplete"),f=t.previous;t.element[0]!==r.activeElement&&(t.element.focus(),t.previous=f,setTimeout(function(){t.previous=f;t.selectedItem=u},1));!1!==t._trigger("select",n,{item:u})&&t.element.val(u.value);t.term=t.element.val();t.close(n);t.selectedItem=u},blur:function(){t.menu.element.is(":visible")&&t.element.val()!==t.term&&t.element.val(t.term)}}).zIndex(this.element.zIndex()+1).css({top:0,left:0}).hide().data("menu");n.fn.bgiframe&&this.menu.element.bgiframe()},destroy:function(){this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete").removeAttr("role").removeAttr("aria-autocomplete").removeAttr("aria-haspopup");this.menu.element.remove();n.Widget.prototype.destroy.call(this)},_setOption:function(t,i){n.Widget.prototype._setOption.apply(this,arguments);t==="source"&&this._initSource();t==="appendTo"&&this.menu.element.appendTo(n(i||"body",this.element[0].ownerDocument)[0]);t==="disabled"&&i&&this.xhr&&this.xhr.abort()},_initSource:function(){var i=this,r,u;n.isArray(this.options.source)?(r=this.options.source,this.source=function(t,i){i(n.ui.autocomplete.filter(r,t.term))}):typeof this.options.source=="string"?(u=this.options.source,this.source=function(r,f){i.xhr&&i.xhr.abort();i.xhr=n.ajax({url:u,data:r,dataType:"json",autocompleteRequest:++t,success:function(n){this.autocompleteRequest===t&&f(n)},error:function(){this.autocompleteRequest===t&&f([])}})}):this.source=this.options.source},search:function(n,t){return(n=n!=null?n:this.element.val(),this.term=this.element.val(),n.length<this.options.minLength)?this.close(t):(clearTimeout(this.closing),this._trigger("search",t)!==!1?this._search(n):void 0)},_search:function(n){this.pending++;this.element.addClass("ui-autocomplete-loading");this.source({term:n},this.response)},_response:function(n){!this.options.disabled&&n&&n.length?(n=this._normalize(n),this._suggest(n),this._trigger("open")):this.close();this.pending--;this.pending||this.element.removeClass("ui-autocomplete-loading")},close:function(n){clearTimeout(this.closing);this.menu.element.is(":visible")&&(this.menu.element.hide(),this.menu.deactivate(),this._trigger("close",n))},_change:function(n){this.previous!==this.element.val()&&this._trigger("change",n,{item:this.selectedItem})},_normalize:function(t){return t.length&&t[0].label&&t[0].value?t:n.map(t,function(t){return typeof t=="string"?{label:t,value:t}:n.extend({label:t.label||t.value,value:t.value||t.label},t)})},_suggest:function(t){var i=this.menu.element.empty().zIndex(this.element.zIndex()+1);this._renderMenu(i,t);this.menu.deactivate();this.menu.refresh();i.show();this._resizeMenu();i.position(n.extend({of:this.element},this.options.position));this.options.autoFocus&&this.menu.next(new n.Event("mouseover"))},_resizeMenu:function(){var n=this.menu.element;n.outerWidth(Math.max(n.width("").outerWidth(),this.element.outerWidth()))},_renderMenu:function(t,i){var r=this;n.each(i,function(n,i){r._renderItem(t,i)})},_renderItem:function(t,i){return n("<li><\/li>").data("item.autocomplete",i).append(n("<a><\/a>").text(i.label)).appendTo(t)},_move:function(n,t){this.menu.element.is(":visible")?this.menu.first()&&/^previous/.test(n)||this.menu.last()&&/^next/.test(n)?(this.element.val(this.term),this.menu.deactivate()):this.menu[n](t):this.search(null,t)},widget:function(){return this.menu.element}});n.extend(n.ui.autocomplete,{escapeRegex:function(n){return n.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")},filter:function(t,i){var r=new RegExp(n.ui.autocomplete.escapeRegex(i),"i");return n.grep(t,function(n){return r.test(n.label||n.value||n)})}})}(jQuery),function(n){n.widget("ui.menu",{_create:function(){var t=this;this.element.addClass("ui-menu ui-widget ui-widget-content ui-corner-all").attr({role:"listbox","aria-activedescendant":"ui-active-menuitem"}).click(function(i){n(i.target).closest(".ui-menu-item a").length&&(i.preventDefault(),t.select(i))});this.refresh()},refresh:function(){var t=this;this.element.children("li:not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role","menuitem").children("a").addClass("ui-corner-all").attr("tabindex",-1).mouseenter(function(i){t.activate(i,n(this).parent())}).mouseleave(function(){t.deactivate()})},activate:function(n,t){if(this.deactivate(),this.hasScroll()){var i=t.offset().top-this.element.offset().top,r=this.element.scrollTop(),u=this.element.height();i<0?this.element.scrollTop(r+i):i>=u&&this.element.scrollTop(r+i-u+t.height())}this.active=t.eq(0).children("a").addClass("ui-state-hover").attr("id","ui-active-menuitem").end();this._trigger("focus",n,{item:t})},deactivate:function(){this.active&&(this.active.children("a").removeClass("ui-state-hover").removeAttr("id"),this._trigger("blur"),this.active=null)},next:function(n){this.move("next",".ui-menu-item:first",n)},previous:function(n){this.move("prev",".ui-menu-item:last",n)},first:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},last:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},move:function(n,t,i){this.active?(n=this.active[n+"All"](".ui-menu-item").eq(0),n.length?this.activate(i,n):this.activate(i,this.element.children(t))):this.activate(i,this.element.children(t))},nextPage:function(t){if(this.hasScroll())if(!this.active||this.last())this.activate(t,this.element.children(".ui-menu-item:first"));else{var r=this.active.offset().top,u=this.element.height(),i=this.element.children(".ui-menu-item").filter(function(){var t=n(this).offset().top-r-u+n(this).height();return t<10&&t>-10});i.length||(i=this.element.children(".ui-menu-item:last"));this.activate(t,i)}else this.activate(t,this.element.children(".ui-menu-item").filter(!this.active||this.last()?":first":":last"))},previousPage:function(t){if(this.hasScroll())if(!this.active||this.first())this.activate(t,this.element.children(".ui-menu-item:last"));else{var i=this.active.offset().top,r=this.element.height();result=this.element.children(".ui-menu-item").filter(function(){var t=n(this).offset().top-i+r-n(this).height();return t<10&&t>-10});result.length||(result=this.element.children(".ui-menu-item:first"));this.activate(t,result)}else this.activate(t,this.element.children(".ui-menu-item").filter(!this.active||this.first()?":last":":first"))},hasScroll:function(){return this.element.height()<this.element[n.fn.prop?"prop":"attr"]("scrollHeight")},select:function(n){this._trigger("selected",n,{item:this.active})}})}(jQuery),function(n,i){function r(){return++f}function u(){return++e}var f=0,e=0;n.widget("ui.tabs",{options:{add:null,ajaxOptions:null,cache:!1,cookie:null,collapsible:!1,disable:null,disabled:[],enable:null,event:"click",fx:null,idPrefix:"ui-tabs-",load:null,panelTemplate:"<div><\/div>",remove:null,select:null,show:null,spinner:"<em>Loading&#8230;<\/em>",tabTemplate:"<li><a href='#{href}'><span>#{label}<\/span><\/a><\/li>"},_create:function(){this._tabify(!0)},_setOption:function(n,t){n=="selected"?this.options.collapsible&&t==this.options.selected||this.select(t):(this.options[n]=t,this._tabify())},_tabId:function(n){return n.title&&n.title.replace(/\s/g,"_").replace(/[^\w\u00c0-\uFFFF-]/g,"")||this.options.idPrefix+r()},_sanitizeSelector:function(n){return n.replace(/:/g,"\\:")},_cookie:function(){var t=this.cookie||(this.cookie=this.options.cookie.name||"ui-tabs-"+u());return n.cookie.apply(null,[t].concat(n.makeArray(arguments)))},_ui:function(n,t){return{tab:n,panel:t,index:this.anchors.index(n)}},_cleanup:function(){this.lis.filter(".ui-state-processing").removeClass("ui-state-processing").find("span:data(label.tabs)").each(function(){var t=n(this);t.html(t.data("label.tabs")).removeData("label.tabs")})},_tabify:function(t){function a(t,i){t.css("display","");!n.support.opacity&&i.opacity&&t[0].style.removeAttribute("filter")}var u=this,r=this.options,v=/^#.+/,o,s,h,f,e,c,l;for(this.list=this.element.find("ol,ul").eq(0),this.lis=n(" > li:has(a[href])",this.list),this.anchors=this.lis.map(function(){return n("a",this)[0]}),this.panels=n([]),this.anchors.each(function(t,i){var f=n(i).attr("href"),e=f.split("#")[0],o;e&&(e===location.toString().split("#")[0]||(o=n("base")[0])&&e===o.href)&&(f=i.hash,i.href=f);v.test(f)?u.panels=u.panels.add(u.element.find(u._sanitizeSelector(f))):f&&f!=="#"?(n.data(i,"href.tabs",f),n.data(i,"load.tabs",f.replace(/#.*$/,"")),f=u._tabId(i),i.href="#"+f,i=u.element.find("#"+f),i.length||(i=n(r.panelTemplate).attr("id",f).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").insertAfter(u.panels[t-1]||u.list),i.data("destroy.tabs",!0)),u.panels=u.panels.add(i)):r.disabled.push(t)}),t?(this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all"),this.list.addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all"),this.lis.addClass("ui-state-default ui-corner-top"),this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom"),r.selected===i?(location.hash&&this.anchors.each(function(n,t){if(t.hash==location.hash)return r.selected=n,!1}),typeof r.selected!="number"&&r.cookie&&(r.selected=parseInt(u._cookie(),10)),typeof r.selected!="number"&&this.lis.filter(".ui-tabs-selected").length&&(r.selected=this.lis.index(this.lis.filter(".ui-tabs-selected"))),r.selected=r.selected||(this.lis.length?0:-1)):r.selected===null&&(r.selected=-1),r.selected=r.selected>=0&&this.anchors[r.selected]||r.selected<0?r.selected:0,r.disabled=n.unique(r.disabled.concat(n.map(this.lis.filter(".ui-state-disabled"),function(n){return u.lis.index(n)}))).sort(),n.inArray(r.selected,r.disabled)!=-1&&r.disabled.splice(n.inArray(r.selected,r.disabled),1),this.panels.addClass("ui-tabs-hide"),this.lis.removeClass("ui-tabs-selected ui-state-active"),r.selected>=0&&this.anchors.length&&(u.element.find(u._sanitizeSelector(u.anchors[r.selected].hash)).removeClass("ui-tabs-hide"),this.lis.eq(r.selected).addClass("ui-tabs-selected ui-state-active"),u.element.queue("tabs",function(){u._trigger("show",null,u._ui(u.anchors[r.selected],u.element.find(u._sanitizeSelector(u.anchors[r.selected].hash))[0]))}),this.load(r.selected)),n(window).bind("unload",function(){u.lis.add(u.anchors).unbind(".tabs");u.lis=u.anchors=u.panels=null})):r.selected=this.lis.index(this.lis.filter(".ui-tabs-selected")),this.element[r.collapsible?"addClass":"removeClass"]("ui-tabs-collapsible"),r.cookie&&this._cookie(r.selected,r.cookie),t=0;o=this.lis[t];t++)n(o)[n.inArray(t,r.disabled)!=-1&&!n(o).hasClass("ui-tabs-selected")?"addClass":"removeClass"]("ui-state-disabled");r.cache===!1&&this.anchors.removeData("cache.tabs");this.lis.add(this.anchors).unbind(".tabs");r.event!=="mouseover"&&(s=function(n,t){t.is(":not(.ui-state-disabled)")&&t.addClass("ui-state-"+n)},h=function(n,t){t.removeClass("ui-state-"+n)},this.lis.bind("mouseover.tabs",function(){s("hover",n(this))}),this.lis.bind("mouseout.tabs",function(){h("hover",n(this))}),this.anchors.bind("focus.tabs",function(){s("focus",n(this).closest("li"))}),this.anchors.bind("blur.tabs",function(){h("focus",n(this).closest("li"))}));r.fx&&(n.isArray(r.fx)?(f=r.fx[0],e=r.fx[1]):f=e=r.fx);c=e?function(t,i){n(t).closest("li").addClass("ui-tabs-selected ui-state-active");i.hide().removeClass("ui-tabs-hide").animate(e,e.duration||"normal",function(){a(i,e);u._trigger("show",null,u._ui(t,i[0]))})}:function(t,i){n(t).closest("li").addClass("ui-tabs-selected ui-state-active");i.removeClass("ui-tabs-hide");u._trigger("show",null,u._ui(t,i[0]))};l=f?function(n,t){t.animate(f,f.duration||"normal",function(){u.lis.removeClass("ui-tabs-selected ui-state-active");t.addClass("ui-tabs-hide");a(t,f);u.element.dequeue("tabs")})}:function(n,t){u.lis.removeClass("ui-tabs-selected ui-state-active");t.addClass("ui-tabs-hide");u.element.dequeue("tabs")};this.anchors.bind(r.event+".tabs",function(){var t=this,i=n(t).closest("li"),f=u.panels.filter(":not(.ui-tabs-hide)"),e=u.element.find(u._sanitizeSelector(t.hash));if(i.hasClass("ui-tabs-selected")&&!r.collapsible||i.hasClass("ui-state-disabled")||i.hasClass("ui-state-processing")||u.panels.filter(":animated").length||u._trigger("select",null,u._ui(this,e[0]))===!1)return this.blur(),!1;if(r.selected=u.anchors.index(this),u.abort(),r.collapsible){if(i.hasClass("ui-tabs-selected"))return r.selected=-1,r.cookie&&u._cookie(r.selected,r.cookie),u.element.queue("tabs",function(){l(t,f)}).dequeue("tabs"),this.blur(),!1;if(!f.length)return r.cookie&&u._cookie(r.selected,r.cookie),u.element.queue("tabs",function(){c(t,e)}),u.load(u.anchors.index(this)),this.blur(),!1}if(r.cookie&&u._cookie(r.selected,r.cookie),e.length)f.length&&u.element.queue("tabs",function(){l(t,f)}),u.element.queue("tabs",function(){c(t,e)}),u.load(u.anchors.index(this));else throw"jQuery UI Tabs: Mismatching fragment identifier.";n.browser.msie&&this.blur()});this.anchors.bind("click.tabs",function(){return!1})},_getIndex:function(n){return typeof n=="string"&&(n=this.anchors.index(this.anchors.filter("[href$="+n+"]"))),n},destroy:function(){var t=this.options;return this.abort(),this.element.unbind(".tabs").removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible").removeData("tabs"),this.list.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all"),this.anchors.each(function(){var t=n.data(this,"href.tabs"),i;t&&(this.href=t);i=n(this).unbind(".tabs");n.each(["href","load","cache"],function(n,t){i.removeData(t+".tabs")})}),this.lis.unbind(".tabs").add(this.panels).each(function(){n.data(this,"destroy.tabs")?n(this).remove():n(this).removeClass("ui-state-default ui-corner-top ui-tabs-selected ui-state-active ui-state-hover ui-state-focus ui-state-disabled ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide")}),t.cookie&&this._cookie(null,t.cookie),this},add:function(t,r,u){var e,o,f;return u===i&&(u=this.anchors.length),e=this,o=this.options,r=n(o.tabTemplate.replace(/#\{href\}/g,t).replace(/#\{label\}/g,r)),t=t.indexOf("#")?this._tabId(n("a",r)[0]):t.replace("#",""),r.addClass("ui-state-default ui-corner-top").data("destroy.tabs",!0),f=e.element.find("#"+t),f.length||(f=n(o.panelTemplate).attr("id",t).data("destroy.tabs",!0)),f.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide"),u>=this.lis.length?(r.appendTo(this.list),f.appendTo(this.list[0].parentNode)):(r.insertBefore(this.lis[u]),f.insertBefore(this.panels[u])),o.disabled=n.map(o.disabled,function(n){return n>=u?++n:n}),this._tabify(),this.anchors.length==1&&(o.selected=0,r.addClass("ui-tabs-selected ui-state-active"),f.removeClass("ui-tabs-hide"),this.element.queue("tabs",function(){e._trigger("show",null,e._ui(e.anchors[0],e.panels[0]))}),this.load(0)),this._trigger("add",null,this._ui(this.anchors[u],this.panels[u])),this},remove:function(t){t=this._getIndex(t);var i=this.options,r=this.lis.eq(t).remove(),u=this.panels.eq(t).remove();return r.hasClass("ui-tabs-selected")&&this.anchors.length>1&&this.select(t+(t+1<this.anchors.length?1:-1)),i.disabled=n.map(n.grep(i.disabled,function(n){return n!=t}),function(n){return n>=t?--n:n}),this._tabify(),this._trigger("remove",null,this._ui(r.find("a")[0],u[0])),this},enable:function(t){t=this._getIndex(t);var i=this.options;if(n.inArray(t,i.disabled)!=-1)return this.lis.eq(t).removeClass("ui-state-disabled"),i.disabled=n.grep(i.disabled,function(n){return n!=t}),this._trigger("enable",null,this._ui(this.anchors[t],this.panels[t])),this},disable:function(n){n=this._getIndex(n);var t=this.options;return n!=t.selected&&(this.lis.eq(n).addClass("ui-state-disabled"),t.disabled.push(n),t.disabled.sort(),this._trigger("disable",null,this._ui(this.anchors[n],this.panels[n]))),this},select:function(n){if(n=this._getIndex(n),n==-1)if(this.options.collapsible&&this.options.selected!=-1)n=this.options.selected;else return this;return this.anchors.eq(n).trigger(this.options.event+".tabs"),this},load:function(t){var f;t=this._getIndex(t);var i=this,r=this.options,u=this.anchors.eq(t)[0],e=n.data(u,"load.tabs");if(this.abort(),!e||this.element.queue("tabs").length!==0&&n.data(u,"cache.tabs"))this.element.dequeue("tabs");else return this.lis.eq(t).addClass("ui-state-processing"),r.spinner&&(f=n("span",u),f.data("label.tabs",f.html()).html(r.spinner)),this.xhr=n.ajax(n.extend({},r.ajaxOptions,{url:e,success:function(f,e){i.element.find(i._sanitizeSelector(u.hash)).html(f);i._cleanup();r.cache&&n.data(u,"cache.tabs",!0);i._trigger("load",null,i._ui(i.anchors[t],i.panels[t]));try{r.ajaxOptions.success(f,e)}catch(o){}},error:function(n,f){i._cleanup();i._trigger("load",null,i._ui(i.anchors[t],i.panels[t]));try{r.ajaxOptions.error(n,f,t,u)}catch(e){}}})),i.element.dequeue("tabs"),this},abort:function(){return this.element.queue([]),this.panels.stop(!1,!0),this.element.queue("tabs",this.element.queue("tabs").splice(-2,2)),this.xhr&&(this.xhr.abort(),delete this.xhr),this._cleanup(),this},url:function(n,t){return this.anchors.eq(n).removeData("cache.tabs").data("load.tabs",t),this},length:function(){return this.anchors.length}});n.extend(n.ui.tabs,{version:"1.8.16"});n.extend(n.ui.tabs.prototype,{rotation:null,rotate:function(n,i){var r=this,u=this.options,f=r._rotate||(r._rotate=function(t){clearTimeout(r.rotation);r.rotation=setTimeout(function(){var n=u.selected;r.select(++n<r.anchors.length?n:0)},n);t&&t.stopPropagation()});return i=r._unrotate||(r._unrotate=i?function(){t=u.selected;f()}:function(n){n.clientX&&r.rotate(null)}),n?(this.element.bind("tabsshow",f),this.anchors.bind(u.event+".tabs",i),f()):(clearTimeout(r.rotation),this.element.unbind("tabsshow",f),this.anchors.unbind(u.event+".tabs",i),delete this._rotate,delete this._unrotate),this}})}(jQuery),function(n,t){function f(){this.debug=!1;this._curInst=null;this._keyEvent=!1;this._disabledInputs=[];this._inDialog=this._datepickerShowing=!1;this._mainDivId="ui-datepicker-div";this._inlineClass="ui-datepicker-inline";this._appendClass="ui-datepicker-append";this._triggerClass="ui-datepicker-trigger";this._dialogClass="ui-datepicker-dialog";this._disableClass="ui-datepicker-disabled";this._unselectableClass="ui-datepicker-unselectable";this._currentClass="ui-datepicker-current-day";this._dayOverClass="ui-datepicker-days-cell-over";this.regional=[];this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""};this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:!1,hideIfNoPrevNext:!1,navigationAsDateFormat:!1,gotoCurrent:!1,changeMonth:!1,changeYear:!1,yearRange:"c-10:c+10",showOtherMonths:!1,selectOtherMonths:!1,showWeek:!1,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:!0,showButtonPanel:!1,autoSize:!1,disabled:!1};n.extend(this._defaults,this.regional[""]);this.dpDiv=e(n('<div id="'+this._mainDivId+'" class="ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"><\/div>'))}function e(t){return t.bind("mouseout",function(t){t=n(t.target).closest("button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a");t.length&&t.removeClass("ui-state-hover ui-datepicker-prev-hover ui-datepicker-next-hover")}).bind("mouseover",function(i){i=n(i.target).closest("button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a");n.datepicker._isDisabledDatepicker(u.inline?t.parent()[0]:u.input[0])||!i.length||(i.parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"),i.addClass("ui-state-hover"),i.hasClass("ui-datepicker-prev")&&i.addClass("ui-datepicker-prev-hover"),i.hasClass("ui-datepicker-next")&&i.addClass("ui-datepicker-next-hover"))})}function r(i,r){n.extend(i,r);for(var u in r)(r[u]==null||r[u]==t)&&(i[u]=r[u]);return i}n.extend(n.ui,{datepicker:{version:"1.8.16"}});var i=(new Date).getTime(),u;n.extend(f.prototype,{markerClassName:"hasDatepicker",maxRows:4,log:function(){this.debug&&console.log.apply("",arguments)},_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(n){return r(this._defaults,n||{}),this},_attachDatepicker:function(a,b){var c=null,e,f,i;for(e in this._defaults)if(f=a.getAttribute("date:"+e),f){c=c||{};try{c[e]=eval(f)}catch(h){c[e]=f}}e=a.nodeName.toLowerCase();f=e=="div"||e=="span";a.id||(this.uuid+=1,a.id="dp"+this.uuid);i=this._newInst(n(a),f);i.settings=n.extend({},b||{},c||{});e=="input"?this._connectDatepicker(a,i):f&&this._inlineDatepicker(a,i)},_newInst:function(t,i){return{id:t[0].id.replace(/([^A-Za-z0-9_-])/g,"\\\\$1"),input:t,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:i,dpDiv:i?e(n('<div class="'+this._inlineClass+' ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"><\/div>')):this.dpDiv}},_connectDatepicker:function(t,i){var r=n(t);i.append=n([]);i.trigger=n([]);r.hasClass(this.markerClassName)||(this._attachments(r,i),r.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp).bind("setData.datepicker",function(n,t,r){i.settings[t]=r}).bind("getData.datepicker",function(n,t){return this._get(i,t)}),this._autoSize(i),n.data(t,"datepicker",i),i.settings.disabled&&this._disableDatepicker(t))},_attachments:function(t,i){var r=this._get(i,"appendText"),f=this._get(i,"isRTL"),u;i.append&&i.append.remove();r&&(i.append=n('<span class="'+this._appendClass+'">'+r+"<\/span>"),t[f?"before":"after"](i.append));t.unbind("focus",this._showDatepicker);i.trigger&&i.trigger.remove();r=this._get(i,"showOn");(r=="focus"||r=="both")&&t.focus(this._showDatepicker);(r=="button"||r=="both")&&(r=this._get(i,"buttonText"),u=this._get(i,"buttonImage"),i.trigger=n(this._get(i,"buttonImageOnly")?n("<img/>").addClass(this._triggerClass).attr({src:u,alt:r,title:r}):n('<button type="button"><\/button>').addClass(this._triggerClass).html(u==""?r:n("<img/>").attr({src:u,alt:r,title:r}))),t[f?"before":"after"](i.trigger),i.trigger.click(function(){return n.datepicker._datepickerShowing&&n.datepicker._lastInput==t[0]?n.datepicker._hideDatepicker():n.datepicker._showDatepicker(t[0]),!1}))},_autoSize:function(n){var t,i,r;this._get(n,"autoSize")&&!n.inline&&(t=new Date(2009,11,20),i=this._get(n,"dateFormat"),i.match(/[DM]/)&&(r=function(n){for(var i=0,r=0,t=0;t<n.length;t++)n[t].length>i&&(i=n[t].length,r=t);return r},t.setMonth(r(this._get(n,i.match(/MM/)?"monthNames":"monthNamesShort"))),t.setDate(r(this._get(n,i.match(/DD/)?"dayNames":"dayNamesShort"))+20-t.getDay())),n.input.attr("size",this._formatDate(n,t).length))},_inlineDatepicker:function(t,i){var r=n(t);r.hasClass(this.markerClassName)||(r.addClass(this.markerClassName).append(i.dpDiv).bind("setData.datepicker",function(n,t,r){i.settings[t]=r}).bind("getData.datepicker",function(n,t){return this._get(i,t)}),n.data(t,"datepicker",i),this._setDate(i,this._getDefaultDate(i),!0),this._updateDatepicker(i),this._updateAlternate(i),i.settings.disabled&&this._disableDatepicker(t),i.dpDiv.css("display","block"))},_dialogDatepicker:function(t,i,u,f,e){return t=this._dialogInst,t||(this.uuid+=1,this._dialogInput=n('<input type="text" id="dp'+this.uuid+'" style="position: absolute; top: -100px; width: 0px; z-index: -10;"/>'),this._dialogInput.keydown(this._doKeyDown),n("body").append(this._dialogInput),t=this._dialogInst=this._newInst(this._dialogInput,!1),t.settings={},n.data(this._dialogInput[0],"datepicker",t)),r(t.settings,f||{}),i=i&&i.constructor==Date?this._formatDate(t,i):i,this._dialogInput.val(i),this._pos=e?e.length?e:[e.pageX,e.pageY]:null,this._pos||(this._pos=[document.documentElement.clientWidth/2-100+(document.documentElement.scrollLeft||document.body.scrollLeft),document.documentElement.clientHeight/2-150+(document.documentElement.scrollTop||document.body.scrollTop)]),this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),t.settings.onSelect=u,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),n.blockUI&&n.blockUI(this.dpDiv),n.data(this._dialogInput[0],"datepicker",t),this},_destroyDatepicker:function(t){var r=n(t),u=n.data(t,"datepicker"),i;r.hasClass(this.markerClassName)&&(i=t.nodeName.toLowerCase(),n.removeData(t,"datepicker"),i=="input"?(u.append.remove(),u.trigger.remove(),r.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)):(i=="div"||i=="span")&&r.removeClass(this.markerClassName).empty())},_enableDatepicker:function(t){var i=n(t),u=n.data(t,"datepicker"),r;i.hasClass(this.markerClassName)&&(r=t.nodeName.toLowerCase(),r=="input"?(t.disabled=!1,u.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""})):(r=="div"||r=="span")&&(i=i.children("."+this._inlineClass),i.children().removeClass("ui-state-disabled"),i.find("select.ui-datepicker-month, select.ui-datepicker-year").removeAttr("disabled")),this._disabledInputs=n.map(this._disabledInputs,function(n){return n==t?null:n}))},_disableDatepicker:function(t){var i=n(t),u=n.data(t,"datepicker"),r;i.hasClass(this.markerClassName)&&(r=t.nodeName.toLowerCase(),r=="input"?(t.disabled=!0,u.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"})):(r=="div"||r=="span")&&(i=i.children("."+this._inlineClass),i.children().addClass("ui-state-disabled"),i.find("select.ui-datepicker-month, select.ui-datepicker-year").attr("disabled","disabled")),this._disabledInputs=n.map(this._disabledInputs,function(n){return n==t?null:n}),this._disabledInputs[this._disabledInputs.length]=t)},_isDisabledDatepicker:function(n){if(!n)return!1;for(var t=0;t<this._disabledInputs.length;t++)if(this._disabledInputs[t]==n)return!0;return!1},_getInst:function(t){try{return n.data(t,"datepicker")}catch(i){throw"Missing instance data for this datepicker";}},_optionDatepicker:function(i,u,f){var e=this._getInst(i),o;if(arguments.length==2&&typeof u=="string")return u=="defaults"?n.extend({},n.datepicker._defaults):e?u=="all"?n.extend({},e.settings):this._get(e,u):null;if(o=u||{},typeof u=="string"&&(o={},o[u]=f),e){this._curInst==e&&this._hideDatepicker();var c=this._getDateDatepicker(i,!0),s=this._getMinMaxDate(e,"min"),h=this._getMinMaxDate(e,"max");r(e.settings,o);s!==null&&o.dateFormat!==t&&o.minDate===t&&(e.settings.minDate=this._formatDate(e,s));h!==null&&o.dateFormat!==t&&o.maxDate===t&&(e.settings.maxDate=this._formatDate(e,h));this._attachments(n(i),e);this._autoSize(e);this._setDate(e,c);this._updateAlternate(e);this._updateDatepicker(e)}},_changeDatepicker:function(n,t,i){this._optionDatepicker(n,t,i)},_refreshDatepicker:function(n){(n=this._getInst(n))&&this._updateDatepicker(n)},_setDateDatepicker:function(n,t){(n=this._getInst(n))&&(this._setDate(n,t),this._updateDatepicker(n),this._updateAlternate(n))},_getDateDatepicker:function(n,t){return(n=this._getInst(n))&&!n.inline&&this._setDateFromField(n,t),n?this._getDate(n):null},_doKeyDown:function(t){var i=n.datepicker._getInst(t.target),r=!0,u=i.dpDiv.is(".ui-datepicker-rtl");if(i._keyEvent=!0,n.datepicker._datepickerShowing)switch(t.keyCode){case 9:n.datepicker._hideDatepicker();r=!1;break;case 13:return r=n("td."+n.datepicker._dayOverClass+":not(."+n.datepicker._currentClass+")",i.dpDiv),r[0]&&n.datepicker._selectDay(t.target,i.selectedMonth,i.selectedYear,r[0]),(t=n.datepicker._get(i,"onSelect"))?(r=n.datepicker._formatDate(i),t.apply(i.input?i.input[0]:null,[r,i])):n.datepicker._hideDatepicker(),!1;case 27:n.datepicker._hideDatepicker();break;case 33:n.datepicker._adjustDate(t.target,t.ctrlKey?-n.datepicker._get(i,"stepBigMonths"):-n.datepicker._get(i,"stepMonths"),"M");break;case 34:n.datepicker._adjustDate(t.target,t.ctrlKey?+n.datepicker._get(i,"stepBigMonths"):+n.datepicker._get(i,"stepMonths"),"M");break;case 35:(t.ctrlKey||t.metaKey)&&n.datepicker._clearDate(t.target);r=t.ctrlKey||t.metaKey;break;case 36:(t.ctrlKey||t.metaKey)&&n.datepicker._gotoToday(t.target);r=t.ctrlKey||t.metaKey;break;case 37:(t.ctrlKey||t.metaKey)&&n.datepicker._adjustDate(t.target,u?1:-1,"D");r=t.ctrlKey||t.metaKey;t.originalEvent.altKey&&n.datepicker._adjustDate(t.target,t.ctrlKey?-n.datepicker._get(i,"stepBigMonths"):-n.datepicker._get(i,"stepMonths"),"M");break;case 38:(t.ctrlKey||t.metaKey)&&n.datepicker._adjustDate(t.target,-7,"D");r=t.ctrlKey||t.metaKey;break;case 39:(t.ctrlKey||t.metaKey)&&n.datepicker._adjustDate(t.target,u?-1:1,"D");r=t.ctrlKey||t.metaKey;t.originalEvent.altKey&&n.datepicker._adjustDate(t.target,t.ctrlKey?+n.datepicker._get(i,"stepBigMonths"):+n.datepicker._get(i,"stepMonths"),"M");break;case 40:(t.ctrlKey||t.metaKey)&&n.datepicker._adjustDate(t.target,7,"D");r=t.ctrlKey||t.metaKey;break;default:r=!1}else t.keyCode==36&&t.ctrlKey?n.datepicker._showDatepicker(this):r=!1;r&&(t.preventDefault(),t.stopPropagation())},_doKeyPress:function(i){var r=n.datepicker._getInst(i.target),u;if(n.datepicker._get(r,"constrainInput"))return r=n.datepicker._possibleChars(n.datepicker._get(r,"dateFormat")),u=String.fromCharCode(i.charCode==t?i.keyCode:i.charCode),i.ctrlKey||i.metaKey||u<" "||!r||r.indexOf(u)>-1},_doKeyUp:function(t){if(t=n.datepicker._getInst(t.target),t.input.val()!=t.lastVal)try{n.datepicker.parseDate(n.datepicker._get(t,"dateFormat"),t.input?t.input.val():null,n.datepicker._getFormatConfig(t))&&(n.datepicker._setDateFromField(t),n.datepicker._updateAlternate(t),n.datepicker._updateDatepicker(t))}catch(i){n.datepicker.log(i)}return!0},_showDatepicker:function(t){var i,u,f,e,o;t=t.target||t;t.nodeName.toLowerCase()!="input"&&(t=n("input",t.parentNode)[0]);n.datepicker._isDisabledDatepicker(t)||n.datepicker._lastInput==t||(i=n.datepicker._getInst(t),n.datepicker._curInst&&n.datepicker._curInst!=i&&(n.datepicker._datepickerShowing&&n.datepicker._triggerOnClose(n.datepicker._curInst),n.datepicker._curInst.dpDiv.stop(!0,!0)),u=n.datepicker._get(i,"beforeShow"),u=u?u.apply(t,[t,i]):{},u!==!1&&(r(i.settings,u),i.lastVal=null,n.datepicker._lastInput=t,n.datepicker._setDateFromField(i),n.datepicker._inDialog&&(t.value=""),n.datepicker._pos||(n.datepicker._pos=n.datepicker._findPos(t),n.datepicker._pos[1]+=t.offsetHeight),f=!1,n(t).parents().each(function(){return f|=n(this).css("position")=="fixed",!f}),f&&n.browser.opera&&(n.datepicker._pos[0]-=document.documentElement.scrollLeft,n.datepicker._pos[1]-=document.documentElement.scrollTop),u={left:n.datepicker._pos[0],top:n.datepicker._pos[1]},n.datepicker._pos=null,i.dpDiv.empty(),i.dpDiv.css({position:"absolute",display:"block",top:"-1000px"}),n.datepicker._updateDatepicker(i),u=n.datepicker._checkOffset(i,u,f),i.dpDiv.css({position:n.datepicker._inDialog&&n.blockUI?"static":f?"fixed":"absolute",display:"none",left:u.left+"px",top:u.top+"px"}),i.inline||(u=n.datepicker._get(i,"showAnim"),e=n.datepicker._get(i,"duration"),o=function(){var r=i.dpDiv.find("iframe.ui-datepicker-cover"),t;r.length&&(t=n.datepicker._getBorders(i.dpDiv),r.css({left:-t[0],top:-t[1],width:i.dpDiv.outerWidth(),height:i.dpDiv.outerHeight()}))},i.dpDiv.zIndex(n(t).zIndex()+1),n.datepicker._datepickerShowing=!0,n.effects&&n.effects[u]?i.dpDiv.show(u,n.datepicker._get(i,"showOptions"),e,o):i.dpDiv[u||"show"](u?e:null,o),u&&e||o(),i.input.is(":visible")&&!i.input.is(":disabled")&&i.input.focus(),n.datepicker._curInst=i)))},_updateDatepicker:function(t){var i,r,f;this.maxRows=4;i=n.datepicker._getBorders(t.dpDiv);u=t;t.dpDiv.empty().append(this._generateHTML(t));r=t.dpDiv.find("iframe.ui-datepicker-cover");r.length&&r.css({left:-i[0],top:-i[1],width:t.dpDiv.outerWidth(),height:t.dpDiv.outerHeight()});t.dpDiv.find("."+this._dayOverClass+" a").mouseover();i=this._getNumberOfMonths(t);r=i[1];t.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width("");r>1&&t.dpDiv.addClass("ui-datepicker-multi-"+r).css("width",17*r+"em");t.dpDiv[(i[0]!=1||i[1]!=1?"add":"remove")+"Class"]("ui-datepicker-multi");t.dpDiv[(this._get(t,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl");t==n.datepicker._curInst&&n.datepicker._datepickerShowing&&t.input&&t.input.is(":visible")&&!t.input.is(":disabled")&&t.input[0]!=document.activeElement&&t.input.focus();t.yearshtml&&(f=t.yearshtml,setTimeout(function(){f===t.yearshtml&&t.yearshtml&&t.dpDiv.find("select.ui-datepicker-year:first").replaceWith(t.yearshtml);f=t.yearshtml=null},0))},_getBorders:function(n){var t=function(n){return{thin:1,medium:2,thick:3}[n]||n};return[parseFloat(t(n.css("border-left-width"))),parseFloat(t(n.css("border-top-width")))]},_checkOffset:function(t,i,r){var u=t.dpDiv.outerWidth(),f=t.dpDiv.outerHeight(),h=t.input?t.input.outerWidth():0,o=t.input?t.input.outerHeight():0,e=document.documentElement.clientWidth+n(document).scrollLeft(),s=document.documentElement.clientHeight+n(document).scrollTop();return i.left-=this._get(t,"isRTL")?u-h:0,i.left-=r&&i.left==t.input.offset().left?n(document).scrollLeft():0,i.top-=r&&i.top==t.input.offset().top+o?n(document).scrollTop():0,i.left-=Math.min(i.left,i.left+u>e&&e>u?Math.abs(i.left+u-e):0),i.top-=Math.min(i.top,i.top+f>s&&s>f?Math.abs(f+o):0),i},_findPos:function(t){for(var i=this._get(this._getInst(t),"isRTL");t&&(t.type=="hidden"||t.nodeType!=1||n.expr.filters.hidden(t));)t=t[i?"previousSibling":"nextSibling"];return t=n(t).offset(),[t.left,t.top]},_triggerOnClose:function(n){var t=this._get(n,"onClose");t&&t.apply(n.input?n.input[0]:null,[n.input?n.input.val():"",n])},_hideDatepicker:function(t){var i=this._curInst,u,r;!i||t&&i!=n.data(t,"datepicker")||this._datepickerShowing&&(t=this._get(i,"showAnim"),u=this._get(i,"duration"),r=function(){n.datepicker._tidyDialog(i);this._curInst=null},n.effects&&n.effects[t]?i.dpDiv.hide(t,n.datepicker._get(i,"showOptions"),u,r):i.dpDiv[t=="slideDown"?"slideUp":t=="fadeIn"?"fadeOut":"hide"](t?u:null,r),t||r(),n.datepicker._triggerOnClose(i),this._datepickerShowing=!1,this._lastInput=null,this._inDialog&&(this._dialogInput.css({position:"absolute",left:"0",top:"-100px"}),n.blockUI&&(n.unblockUI(),n("body").append(this.dpDiv))),this._inDialog=!1)},_tidyDialog:function(n){n.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(t){n.datepicker._curInst&&(t=n(t.target),t[0].id==n.datepicker._mainDivId||t.parents("#"+n.datepicker._mainDivId).length!=0||t.hasClass(n.datepicker.markerClassName)||t.hasClass(n.datepicker._triggerClass)||!n.datepicker._datepickerShowing||n.datepicker._inDialog&&n.blockUI||n.datepicker._hideDatepicker())},_adjustDate:function(t,i,r){t=n(t);var u=this._getInst(t[0]);this._isDisabledDatepicker(t[0])||(this._adjustInstDate(u,i+(r=="M"?this._get(u,"showCurrentAtPos"):0),r),this._updateDatepicker(u))},_gotoToday:function(t){var i,r;t=n(t);i=this._getInst(t[0]);this._get(i,"gotoCurrent")&&i.currentDay?(i.selectedDay=i.currentDay,i.drawMonth=i.selectedMonth=i.currentMonth,i.drawYear=i.selectedYear=i.currentYear):(r=new Date,i.selectedDay=r.getDate(),i.drawMonth=i.selectedMonth=r.getMonth(),i.drawYear=i.selectedYear=r.getFullYear());this._notifyChange(i);this._adjustDate(t)},_selectMonthYear:function(t,i,r){t=n(t);var u=this._getInst(t[0]);u["selected"+(r=="M"?"Month":"Year")]=u["draw"+(r=="M"?"Month":"Year")]=parseInt(i.options[i.selectedIndex].value,10);this._notifyChange(u);this._adjustDate(t)},_selectDay:function(t,i,r,u){var f=n(t);n(u).hasClass(this._unselectableClass)||this._isDisabledDatepicker(f[0])||(f=this._getInst(f[0]),f.selectedDay=f.currentDay=n("a",u).html(),f.selectedMonth=f.currentMonth=i,f.selectedYear=f.currentYear=r,this._selectDate(t,this._formatDate(f,f.currentDay,f.currentMonth,f.currentYear)))},_clearDate:function(t){t=n(t);this._getInst(t[0]);this._selectDate(t,"")},_selectDate:function(t,i){t=this._getInst(n(t)[0]);i=i!=null?i:this._formatDate(t);t.input&&t.input.val(i);this._updateAlternate(t);var r=this._get(t,"onSelect");r?r.apply(t.input?t.input[0]:null,[i,t]):t.input&&t.input.trigger("change");t.inline?this._updateDatepicker(t):(this._hideDatepicker(),this._lastInput=t.input[0],typeof t.input[0]!="object"&&t.input.focus(),this._lastInput=null)},_updateAlternate:function(t){var i=this._get(t,"altField");if(i){var r=this._get(t,"altFormat")||this._get(t,"dateFormat"),u=this._getDate(t),f=this.formatDate(r,u,this._getFormatConfig(t));n(i).each(function(){n(this).val(f)})}},noWeekends:function(n){return n=n.getDay(),[n>0&&n<6,""]},iso8601Week:function(n){n=new Date(n.getTime());n.setDate(n.getDate()+4-(n.getDay()||7));var t=n.getTime();return n.setMonth(0),n.setDate(1),Math.floor(Math.round((t-n)/864e5)/7)+1},parseDate:function(t,i,r){var e,u;if(t==null||i==null)throw"Invalid arguments";if(i=typeof i=="object"?i.toString():i+"",i=="")return null;e=(r?r.shortYearCutoff:null)||this._defaults.shortYearCutoff;e=typeof e!="string"?e:(new Date).getFullYear()%100+parseInt(e,10);for(var w=(r?r.dayNamesShort:null)||this._defaults.dayNamesShort,b=(r?r.dayNames:null)||this._defaults.dayNames,k=(r?r.monthNamesShort:null)||this._defaults.monthNamesShort,d=(r?r.monthNames:null)||this._defaults.monthNames,o=r=-1,s=-1,a=-1,v=!1,l=function(n){return(n=h+1<t.length&&t.charAt(h+1)==n)&&h++,n},c=function(n){var t=l(n);if(n=new RegExp("^\\d{1,"+(n=="@"?14:n=="!"?20:n=="y"&&t?4:n=="o"?3:2)+"}"),n=i.substring(f).match(n),!n)throw"Missing number at position "+f;return f+=n[0].length,parseInt(n[0],10)},p=function(t,r,u){t=n.map(l(t)?u:r,function(n,t){return[[t,n]]}).sort(function(n,t){return-(n[1].length-t[1].length)});var e=-1;if(n.each(t,function(n,t){return n=t[1],i.substr(f,n.length).toLowerCase()==n.toLowerCase()?(e=t[0],f+=n.length,!1):void 0}),e!=-1)return e+1;throw"Unknown name at position "+f;},y=function(){if(i.charAt(f)!=t.charAt(h))throw"Unexpected literal at position "+f;f++},f=0,h=0;h<t.length;h++)if(v)t.charAt(h)!="'"||l("'")?y():v=!1;else switch(t.charAt(h)){case"d":s=c("d");break;case"D":p("D",w,b);break;case"o":a=c("o");break;case"m":o=c("m");break;case"M":o=p("M",k,d);break;case"y":r=c("y");break;case"@":u=new Date(c("@"));r=u.getFullYear();o=u.getMonth()+1;s=u.getDate();break;case"!":u=new Date((c("!")-this._ticksTo1970)/1e4);r=u.getFullYear();o=u.getMonth()+1;s=u.getDate();break;case"'":l("'")?y():v=!0;break;default:y()}if(f<i.length)throw"Extra/unparsed characters found in date: "+i.substring(f);if(r==-1?r=(new Date).getFullYear():r<100&&(r+=(new Date).getFullYear()-(new Date).getFullYear()%100+(r<=e?0:-100)),a>-1){o=1;s=a;do{if(e=this._getDaysInMonth(r,o-1),s<=e)break;o++;s-=e}while(1)}if(u=this._daylightSavingAdjust(new Date(r,o-1,s)),u.getFullYear()!=r||u.getMonth()+1!=o||u.getDate()!=s)throw"Invalid date";return u},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925))*864e9,formatDate:function(n,t,i){var u;if(!t)return"";var h=(i?i.dayNamesShort:null)||this._defaults.dayNamesShort,c=(i?i.dayNames:null)||this._defaults.dayNames,l=(i?i.monthNamesShort:null)||this._defaults.monthNamesShort;i=(i?i.monthNames:null)||this._defaults.monthNames;var f=function(t){return(t=u+1<n.length&&n.charAt(u+1)==t)&&u++,t},e=function(n,t,i){if(t=""+t,f(n))for(;t.length<i;)t="0"+t;return t},s=function(n,t,i,r){return f(n)?r[t]:i[t]},r="",o=!1;if(t)for(u=0;u<n.length;u++)if(o)n.charAt(u)!="'"||f("'")?r+=n.charAt(u):o=!1;else switch(n.charAt(u)){case"d":r+=e("d",t.getDate(),2);break;case"D":r+=s("D",t.getDay(),h,c);break;case"o":r+=e("o",Math.round((new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime()-new Date(t.getFullYear(),0,0).getTime())/864e5),3);break;case"m":r+=e("m",t.getMonth()+1,2);break;case"M":r+=s("M",t.getMonth(),l,i);break;case"y":r+=f("y")?t.getFullYear():(t.getYear()%100<10?"0":"")+t.getYear()%100;break;case"@":r+=t.getTime();break;case"!":r+=t.getTime()*1e4+this._ticksTo1970;break;case"'":f("'")?r+="'":o=!0;break;default:r+=n.charAt(u)}return r},_possibleChars:function(n){for(var i="",r=!1,u=function(i){return(i=t+1<n.length&&n.charAt(t+1)==i)&&t++,i},t=0;t<n.length;t++)if(r)n.charAt(t)!="'"||u("'")?i+=n.charAt(t):r=!1;else switch(n.charAt(t)){case"d":case"m":case"y":case"@":i+="0123456789";break;case"D":case"M":return null;case"'":u("'")?i+="'":r=!0;break;default:i+=n.charAt(t)}return i},_get:function(n,i){return n.settings[i]!==t?n.settings[i]:this._defaults[i]},_setDateFromField:function(n,t){var u,r,i,f,e;if(n.input.val()!=n.lastVal){u=this._get(n,"dateFormat");r=n.lastVal=n.input?n.input.val():null;i=f=this._getDefaultDate(n);e=this._getFormatConfig(n);try{i=this.parseDate(u,r,e)||f}catch(o){this.log(o);r=t?"":r}n.selectedDay=i.getDate();n.drawMonth=n.selectedMonth=i.getMonth();n.drawYear=n.selectedYear=i.getFullYear();n.currentDay=r?i.getDate():0;n.currentMonth=r?i.getMonth():0;n.currentYear=r?i.getFullYear():0;this._adjustInstDate(n)}},_getDefaultDate:function(n){return this._restrictMinMax(n,this._determineDate(n,this._get(n,"defaultDate"),new Date))},_determineDate:function(t,i,r){var u=function(n){var t=new Date;return t.setDate(t.getDate()+n),t},f=function(i){var o,u;try{return n.datepicker.parseDate(n.datepicker._get(t,"dateFormat"),i,n.datepicker._getFormatConfig(t))}catch(s){}var r=(i.toLowerCase().match(/^c/)?n.datepicker._getDate(t):null)||new Date,f=r.getFullYear(),e=r.getMonth();for(r=r.getDate(),o=/([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,u=o.exec(i);u;){switch(u[2]||"d"){case"d":case"D":r+=parseInt(u[1],10);break;case"w":case"W":r+=parseInt(u[1],10)*7;break;case"m":case"M":e+=parseInt(u[1],10);r=Math.min(r,n.datepicker._getDaysInMonth(f,e));break;case"y":case"Y":f+=parseInt(u[1],10);r=Math.min(r,n.datepicker._getDaysInMonth(f,e))}u=o.exec(i)}return new Date(f,e,r)};return(i=(i=i==null||i===""?r:typeof i=="string"?f(i):typeof i=="number"?isNaN(i)?r:u(i):new Date(i.getTime()))&&i.toString()=="Invalid Date"?r:i)&&(i.setHours(0),i.setMinutes(0),i.setSeconds(0),i.setMilliseconds(0)),this._daylightSavingAdjust(i)},_daylightSavingAdjust:function(n){return n?(n.setHours(n.getHours()>12?n.getHours()+2:0),n):null},_setDate:function(n,t,i){var r=!t,u=n.selectedMonth,f=n.selectedYear;t=this._restrictMinMax(n,this._determineDate(n,t,new Date));n.selectedDay=n.currentDay=t.getDate();n.drawMonth=n.selectedMonth=n.currentMonth=t.getMonth();n.drawYear=n.selectedYear=n.currentYear=t.getFullYear();u==n.selectedMonth&&f==n.selectedYear||i||this._notifyChange(n);this._adjustInstDate(n);n.input&&n.input.val(r?"":this._formatDate(n))},_getDate:function(n){return!n.currentYear||n.input&&n.input.val()==""?null:this._daylightSavingAdjust(new Date(n.currentYear,n.currentMonth,n.currentDay))},_generateHTML:function(t){var p=new Date,e,o,h,ot,k,l,u,st,ht;p=this._daylightSavingAdjust(new Date(p.getFullYear(),p.getMonth(),p.getDate()));var v=this._get(t,"isRTL"),it=this._get(t,"showButtonPanel"),g=this._get(t,"hideIfNoPrevNext"),s=this._get(t,"navigationAsDateFormat"),y=this._getNumberOfMonths(t),r=this._get(t,"showCurrentAtPos"),c=this._get(t,"stepMonths"),rt=y[0]!=1||y[1]!=1,ut=this._daylightSavingAdjust(t.currentDay?new Date(t.currentYear,t.currentMonth,t.currentDay):new Date(9999,9,9)),b=this._getMinMaxDate(t,"min"),w=this._getMinMaxDate(t,"max");if(r=t.drawMonth-r,e=t.drawYear,r<0&&(r+=12,e--),w)for(o=this._daylightSavingAdjust(new Date(w.getFullYear(),w.getMonth()-y[0]*y[1]+1,w.getDate())),o=b&&o<b?b:o;this._daylightSavingAdjust(new Date(e,r,1))>o;)r--,r<0&&(r=11,e--);t.drawMonth=r;t.drawYear=e;o=this._get(t,"prevText");o=s?this.formatDate(o,this._daylightSavingAdjust(new Date(e,r-c,1)),this._getFormatConfig(t)):o;o=this._canAdjustMonth(t,-1,e,r)?'<a class="ui-datepicker-prev ui-corner-all" onclick="DP_jQuery_'+i+".datepicker._adjustDate('#"+t.id+"', -"+c+", 'M');\" title=\""+o+'"><span class="ui-icon ui-icon-circle-triangle-'+(v?"e":"w")+'">'+o+"<\/span><\/a>":g?"":'<a class="ui-datepicker-prev ui-corner-all ui-state-disabled" title="'+o+'"><span class="ui-icon ui-icon-circle-triangle-'+(v?"e":"w")+'">'+o+"<\/span><\/a>";h=this._get(t,"nextText");h=s?this.formatDate(h,this._daylightSavingAdjust(new Date(e,r+c,1)),this._getFormatConfig(t)):h;g=this._canAdjustMonth(t,1,e,r)?'<a class="ui-datepicker-next ui-corner-all" onclick="DP_jQuery_'+i+".datepicker._adjustDate('#"+t.id+"', +"+c+", 'M');\" title=\""+h+'"><span class="ui-icon ui-icon-circle-triangle-'+(v?"w":"e")+'">'+h+"<\/span><\/a>":g?"":'<a class="ui-datepicker-next ui-corner-all ui-state-disabled" title="'+h+'"><span class="ui-icon ui-icon-circle-triangle-'+(v?"w":"e")+'">'+h+"<\/span><\/a>";c=this._get(t,"currentText");h=this._get(t,"gotoCurrent")&&t.currentDay?ut:p;c=s?this.formatDate(c,h,this._getFormatConfig(t)):c;s=t.inline?"":'<button type="button" class="ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all" onclick="DP_jQuery_'+i+'.datepicker._hideDatepicker();">'+this._get(t,"closeText")+"<\/button>";it=it?'<div class="ui-datepicker-buttonpane ui-widget-content">'+(v?s:"")+(this._isInRange(t,h)?'<button type="button" class="ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all" onclick="DP_jQuery_'+i+".datepicker._gotoToday('#"+t.id+"');\">"+c+"<\/button>":"")+(v?"":s)+"<\/div>":"";s=parseInt(this._get(t,"firstDay"),10);s=isNaN(s)?0:s;c=this._get(t,"showWeek");h=this._get(t,"dayNames");this._get(t,"dayNamesShort");var yt=this._get(t,"dayNamesMin"),pt=this._get(t,"monthNames"),wt=this._get(t,"monthNamesShort"),lt=this._get(t,"beforeShowDay"),ft=this._get(t,"showOtherMonths"),bt=this._get(t,"selectOtherMonths");this._get(t,"calculateWeek");for(var at=this._getDefaultDate(t),et="",nt=0;nt<y[0];nt++){for(ot="",this.maxRows=4,k=0;k<y[1];k++){var vt=this._daylightSavingAdjust(new Date(e,r,t.selectedDay)),f=" ui-corner-all",a="";if(rt){if(a+='<div class="ui-datepicker-group',y[1]>1)switch(k){case 0:a+=" ui-datepicker-group-first";f=" ui-corner-"+(v?"right":"left");break;case y[1]-1:a+=" ui-datepicker-group-last";f=" ui-corner-"+(v?"left":"right");break;default:a+=" ui-datepicker-group-middle";f=""}a+='">'}for(a+='<div class="ui-datepicker-header ui-widget-header ui-helper-clearfix'+f+'">'+(/all|left/.test(f)&&nt==0?v?g:o:"")+(/all|right/.test(f)&&nt==0?v?o:g:"")+this._generateMonthYearHeader(t,r,e,b,w,nt>0||k>0,pt,wt)+'<\/div><table class="ui-datepicker-calendar"><thead><tr>',l=c?'<th class="ui-datepicker-week-col">'+this._get(t,"weekHeader")+"<\/th>":"",f=0;f<7;f++)u=(f+s)%7,l+="<th"+((f+s+6)%7>=5?' class="ui-datepicker-week-end"':"")+'><span title="'+h[u]+'">'+yt[u]+"<\/span><\/th>";for(a+=l+"<\/tr><\/thead><tbody>",l=this._getDaysInMonth(e,r),e==t.selectedYear&&r==t.selectedMonth&&(t.selectedDay=Math.min(t.selectedDay,l)),f=(this._getFirstDayOfMonth(e,r)-s+7)%7,l=Math.ceil((f+l)/7),this.maxRows=l=rt?this.maxRows>l?this.maxRows:l:l,u=this._daylightSavingAdjust(new Date(e,r,1-f)),st=0;st<l;st++){for(a+="<tr>",ht=c?'<td class="ui-datepicker-week-col">'+this._get(t,"calculateWeek")(u)+"<\/td>":"",f=0;f<7;f++){var tt=lt?lt.apply(t.input?t.input[0]:null,[u]):[!0,""],d=u.getMonth()!=r,ct=d&&!bt||!tt[0]||b&&u<b||w&&u>w;ht+='<td class="'+((f+s+6)%7>=5?" ui-datepicker-week-end":"")+(d?" ui-datepicker-other-month":"")+(u.getTime()==vt.getTime()&&r==t.selectedMonth&&t._keyEvent||at.getTime()==u.getTime()&&at.getTime()==vt.getTime()?" "+this._dayOverClass:"")+(ct?" "+this._unselectableClass+" ui-state-disabled":"")+(d&&!ft?"":" "+tt[1]+(u.getTime()==ut.getTime()?" "+this._currentClass:"")+(u.getTime()==p.getTime()?" ui-datepicker-today":""))+'"'+((!d||ft)&&tt[2]?' title="'+tt[2]+'"':"")+(ct?"":' onclick="DP_jQuery_'+i+".datepicker._selectDay('#"+t.id+"',"+u.getMonth()+","+u.getFullYear()+', this);return false;"')+">"+(d&&!ft?"&#xa0;":ct?'<span class="ui-state-default">'+u.getDate()+"<\/span>":'<a class="ui-state-default'+(u.getTime()==p.getTime()?" ui-state-highlight":"")+(u.getTime()==ut.getTime()?" ui-state-active":"")+(d?" ui-priority-secondary":"")+'" href="#">'+u.getDate()+"<\/a>")+"<\/td>";u.setDate(u.getDate()+1);u=this._daylightSavingAdjust(u)}a+=ht+"<\/tr>"}r++;r>11&&(r=0,e++);a+="<\/tbody><\/table>"+(rt?"<\/div>"+(y[0]>0&&k==y[1]-1?'<div class="ui-datepicker-row-break"><\/div>':""):"");ot+=a}et+=ot}return et+=it+(n.browser.msie&&parseInt(n.browser.version,10)<7&&!t.inline?'<iframe src="javascript:false;" class="ui-datepicker-cover" frameborder="0"><\/iframe>':""),t._keyEvent=!1,et},_generateMonthYearHeader:function(n,t,r,u,f,e,o,s){var a=this._get(n,"changeMonth"),v=this._get(n,"changeYear"),p=this._get(n,"showMonthAfterYear"),c='<div class="ui-datepicker-title">',l="",w,h,y;if(e||!a)l+='<span class="ui-datepicker-month">'+o[t]+"<\/span>";else{for(o=u&&u.getFullYear()==r,w=f&&f.getFullYear()==r,l+='<select class="ui-datepicker-month" onchange="DP_jQuery_'+i+".datepicker._selectMonthYear('#"+n.id+"', this, 'M');\" >",h=0;h<12;h++)(!o||h>=u.getMonth())&&(!w||h<=f.getMonth())&&(l+='<option value="'+h+'"'+(h==t?' selected="selected"':"")+">"+s[h]+"<\/option>");l+="<\/select>"}if(p||(c+=l+(e||!(a&&v)?"&#xa0;":"")),!n.yearshtml)if(n.yearshtml="",e||!v)c+='<span class="ui-datepicker-year">'+r+"<\/span>";else{for(s=this._get(n,"yearRange").split(":"),y=(new Date).getFullYear(),o=function(n){return n=n.match(/c[+-].*/)?r+parseInt(n.substring(1),10):n.match(/[+-].*/)?y+parseInt(n,10):parseInt(n,10),isNaN(n)?y:n},t=o(s[0]),s=Math.max(t,o(s[1]||"")),t=u?Math.max(t,u.getFullYear()):t,s=f?Math.min(s,f.getFullYear()):s,n.yearshtml+='<select class="ui-datepicker-year" onchange="DP_jQuery_'+i+".datepicker._selectMonthYear('#"+n.id+"', this, 'Y');\" >";t<=s;t++)n.yearshtml+='<option value="'+t+'"'+(t==r?' selected="selected"':"")+">"+t+"<\/option>";n.yearshtml+="<\/select>";c+=n.yearshtml;n.yearshtml=null}return c+=this._get(n,"yearSuffix"),p&&(c+=(e||!(a&&v)?"&#xa0;":"")+l),c+"<\/div>"},_adjustInstDate:function(n,t,i){var r=n.drawYear+(i=="Y"?t:0),u=n.drawMonth+(i=="M"?t:0);t=Math.min(n.selectedDay,this._getDaysInMonth(r,u))+(i=="D"?t:0);r=this._restrictMinMax(n,this._daylightSavingAdjust(new Date(r,u,t)));n.selectedDay=r.getDate();n.drawMonth=n.selectedMonth=r.getMonth();n.drawYear=n.selectedYear=r.getFullYear();(i=="M"||i=="Y")&&this._notifyChange(n)},_restrictMinMax:function(n,t){var i=this._getMinMaxDate(n,"min");return n=this._getMinMaxDate(n,"max"),t=i&&t<i?i:t,n&&t>n?n:t},_notifyChange:function(n){var t=this._get(n,"onChangeMonthYear");t&&t.apply(n.input?n.input[0]:null,[n.selectedYear,n.selectedMonth+1,n])},_getNumberOfMonths:function(n){return n=this._get(n,"numberOfMonths"),n==null?[1,1]:typeof n=="number"?[1,n]:n},_getMinMaxDate:function(n,t){return this._determineDate(n,this._get(n,t+"Date"),null)},_getDaysInMonth:function(n,t){return 32-this._daylightSavingAdjust(new Date(n,t,32)).getDate()},_getFirstDayOfMonth:function(n,t){return new Date(n,t,1).getDay()},_canAdjustMonth:function(n,t,i,r){var u=this._getNumberOfMonths(n);return i=this._daylightSavingAdjust(new Date(i,r+(t<0?t:u[0]*u[1]),1)),t<0&&i.setDate(this._getDaysInMonth(i.getFullYear(),i.getMonth())),this._isInRange(n,i)},_isInRange:function(n,t){var i=this._getMinMaxDate(n,"min");return n=this._getMinMaxDate(n,"max"),(!i||t.getTime()>=i.getTime())&&(!n||t.getTime()<=n.getTime())},_getFormatConfig:function(n){var t=this._get(n,"shortYearCutoff");return t=typeof t!="string"?t:(new Date).getFullYear()%100+parseInt(t,10),{shortYearCutoff:t,dayNamesShort:this._get(n,"dayNamesShort"),dayNames:this._get(n,"dayNames"),monthNamesShort:this._get(n,"monthNamesShort"),monthNames:this._get(n,"monthNames")}},_formatDate:function(n,t,i,r){return t||(n.currentDay=n.selectedDay,n.currentMonth=n.selectedMonth,n.currentYear=n.selectedYear),t=t?typeof t=="object"?t:this._daylightSavingAdjust(new Date(r,i,t)):this._daylightSavingAdjust(new Date(n.currentYear,n.currentMonth,n.currentDay)),this.formatDate(this._get(n,"dateFormat"),t,this._getFormatConfig(n))}});n.fn.datepicker=function(t){if(!this.length)return this;n.datepicker.initialized||(n(document).mousedown(n.datepicker._checkExternalClick).find("body").append(n.datepicker.dpDiv),n.datepicker.initialized=!0);var i=Array.prototype.slice.call(arguments,1);return typeof t=="string"&&(t=="isDisabled"||t=="getDate"||t=="widget")?n.datepicker["_"+t+"Datepicker"].apply(n.datepicker,[this[0]].concat(i)):t=="option"&&arguments.length==2&&typeof arguments[1]=="string"?n.datepicker["_"+t+"Datepicker"].apply(n.datepicker,[this[0]].concat(i)):this.each(function(){typeof t=="string"?n.datepicker["_"+t+"Datepicker"].apply(n.datepicker,[this].concat(i)):n.datepicker._attachDatepicker(this,t)})};n.datepicker=new f;n.datepicker.initialized=!1;n.datepicker.uuid=(new Date).getTime();n.datepicker.version="1.8.16";window["DP_jQuery_"+i]=n}(jQuery);jQuery.effects||function(n,t){function u(t){var i;return t&&t.constructor==Array&&t.length==3?t:(i=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(t))?[parseInt(i[1],10),parseInt(i[2],10),parseInt(i[3],10)]:(i=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(t))?[parseFloat(i[1])*2.55,parseFloat(i[2])*2.55,parseFloat(i[3])*2.55]:(i=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(t))?[parseInt(i[1],16),parseInt(i[2],16),parseInt(i[3],16)]:(i=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(t))?[parseInt(i[1]+i[1],16),parseInt(i[2]+i[2],16),parseInt(i[3]+i[3],16)]:/rgba\(0, 0, 0, 0\)/.exec(t)?o.transparent:o[n.trim(t).toLowerCase()]}function h(t,i){var r;do{if(r=n.curCSS(t,i),r!=""&&r!="transparent"||n.nodeName(t,"body"))break;i="backgroundColor"}while(t=t.parentNode);return u(r)}function f(){var n=document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle,i={},t,u,r;if(n&&n.length&&n[0]&&n[n[0]])for(r=n.length;r--;)t=n[r],typeof n[t]=="string"&&(u=t.replace(/\-(\w)/g,function(n,t){return t.toUpperCase()}),i[u]=n[t]);else for(t in n)typeof n[t]=="string"&&(i[t]=n[t]);return i}function e(t){var i,r;for(i in t)r=t[i],(r==null||n.isFunction(r)||i in l||/scrollbar/.test(i)||!/color/i.test(i)&&isNaN(parseFloat(r)))&&delete t[i];return t}function c(n,t){var r={_:0},i;for(i in t)n[i]!=t[i]&&(r[i]=t[i]);return r}function i(t,i,r,u){return typeof t=="object"&&(u=i,r=null,i=t,t=i.effect),n.isFunction(i)&&(u=i,r=null,i={}),(typeof i=="number"||n.fx.speeds[i])&&(u=r,r=i,i={}),n.isFunction(r)&&(u=r,r=null),i=i||{},r=r||i.duration,r=n.fx.off?0:typeof r=="number"?r:r in n.fx.speeds?n.fx.speeds[r]:n.fx.speeds._default,u=u||i.complete,[t,i,r,u]}function r(t){return!t||typeof t=="number"||n.fx.speeds[t]?!0:typeof t=="string"&&!n.effects[t]?!0:!1}n.effects={};n.each(["backgroundColor","borderBottomColor","borderLeftColor","borderRightColor","borderTopColor","borderColor","color","outlineColor"],function(t,i){n.fx.step[i]=function(n){n.colorInit||(n.start=h(n.elem,i),n.end=u(n.end),n.colorInit=!0);n.elem.style[i]="rgb("+Math.max(Math.min(parseInt(n.pos*(n.end[0]-n.start[0])+n.start[0],10),255),0)+","+Math.max(Math.min(parseInt(n.pos*(n.end[1]-n.start[1])+n.start[1],10),255),0)+","+Math.max(Math.min(parseInt(n.pos*(n.end[2]-n.start[2])+n.start[2],10),255),0)+")"}});var o={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0],transparent:[255,255,255]},s=["add","remove","toggle"],l={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};n.effects.animateClass=function(t,i,r,u){return n.isFunction(r)&&(u=r,r=null),this.queue(function(){var o=n(this),h=o.attr("style")||" ",a=e(f.call(this)),l,v=o.attr("class");n.each(s,function(n,i){t[i]&&o[i+"Class"](t[i])});l=e(f.call(this));o.attr("class",v);o.animate(c(a,l),{queue:!1,duration:i,easing:r,complete:function(){n.each(s,function(n,i){t[i]&&o[i+"Class"](t[i])});typeof o.attr("style")=="object"?(o.attr("style").cssText="",o.attr("style").cssText=h):o.attr("style",h);u&&u.apply(this,arguments);n.dequeue(this)}})})};n.fn.extend({_addClass:n.fn.addClass,addClass:function(t,i,r,u){return i?n.effects.animateClass.apply(this,[{add:t},i,r,u]):this._addClass(t)},_removeClass:n.fn.removeClass,removeClass:function(t,i,r,u){return i?n.effects.animateClass.apply(this,[{remove:t},i,r,u]):this._removeClass(t)},_toggleClass:n.fn.toggleClass,toggleClass:function(i,r,u,f,e){return typeof r=="boolean"||r===t?u?n.effects.animateClass.apply(this,[r?{add:i}:{remove:i},u,f,e]):this._toggleClass(i,r):n.effects.animateClass.apply(this,[{toggle:i},r,u,f])},switchClass:function(t,i,r,u,f){return n.effects.animateClass.apply(this,[{add:i,remove:t},r,u,f])}});n.extend(n.effects,{version:"1.8.14",save:function(n,t){for(var i=0;i<t.length;i++)t[i]!==null&&n.data("ec.storage."+t[i],n[0].style[t[i]])},restore:function(n,t){for(var i=0;i<t.length;i++)t[i]!==null&&n.css(t[i],n.data("ec.storage."+t[i]))},setMode:function(n,t){return t=="toggle"&&(t=n.is(":hidden")?"show":"hide"),t},getBaseline:function(n,t){var i;switch(n[0]){case"top":i=0;break;case"middle":i=.5;break;case"bottom":i=1;break;default:i=n[0]/t.height}switch(n[1]){case"left":n=0;break;case"center":n=.5;break;case"right":n=1;break;default:n=n[1]/t.width}return{x:n,y:i}},createWrapper:function(t){if(t.parent().is(".ui-effects-wrapper"))return t.parent();var i={width:t.outerWidth(!0),height:t.outerHeight(!0),float:t.css("float")},r=n("<div><\/div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0});return t.wrap(r),r=t.parent(),t.css("position")=="static"?(r.css({position:"relative"}),t.css({position:"relative"})):(n.extend(i,{position:t.css("position"),zIndex:t.css("z-index")}),n.each(["top","left","bottom","right"],function(n,r){i[r]=t.css(r);isNaN(parseInt(i[r],10))&&(i[r]="auto")}),t.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),r.css(i).show()},removeWrapper:function(n){return n.parent().is(".ui-effects-wrapper")?n.parent().replaceWith(n):n},setTransition:function(t,i,r,u){return u=u||{},n.each(i,function(n,i){unit=t.cssUnit(i);unit[0]>0&&(u[i]=unit[0]*r+unit[1])}),u}});n.fn.extend({effect:function(t){var r=i.apply(this,arguments),u={options:r[1],duration:r[2],callback:r[3]},f;return(r=u.options.mode,f=n.effects[t],n.fx.off||!f)?r?this[r](u.duration,u.callback):this.each(function(){u.callback&&u.callback.call(this)}):f.call(this,u)},_show:n.fn.show,show:function(n){if(r(n))return this._show.apply(this,arguments);var t=i.apply(this,arguments);return t[1].mode="show",this.effect.apply(this,t)},_hide:n.fn.hide,hide:function(n){if(r(n))return this._hide.apply(this,arguments);var t=i.apply(this,arguments);return t[1].mode="hide",this.effect.apply(this,t)},__toggle:n.fn.toggle,toggle:function(t){if(r(t)||typeof t=="boolean"||n.isFunction(t))return this.__toggle.apply(this,arguments);var u=i.apply(this,arguments);return u[1].mode="toggle",this.effect.apply(this,u)},cssUnit:function(t){var i=this.css(t),r=[];return n.each(["em","px","%","pt"],function(n,t){i.indexOf(t)>0&&(r=[parseFloat(i),t])}),r}});n.easing.jswing=n.easing.swing;n.extend(n.easing,{def:"easeOutQuad",swing:function(t,i,r,u,f){return n.easing[n.easing.def](t,i,r,u,f)},easeInQuad:function(n,t,i,r,u){return r*(t/=u)*t+i},easeOutQuad:function(n,t,i,r,u){return-r*(t/=u)*(t-2)+i},easeInOutQuad:function(n,t,i,r,u){return(t/=u/2)<1?r/2*t*t+i:-r/2*(--t*(t-2)-1)+i},easeInCubic:function(n,t,i,r,u){return r*(t/=u)*t*t+i},easeOutCubic:function(n,t,i,r,u){return r*((t=t/u-1)*t*t+1)+i},easeInOutCubic:function(n,t,i,r,u){return(t/=u/2)<1?r/2*t*t*t+i:r/2*((t-=2)*t*t+2)+i},easeInQuart:function(n,t,i,r,u){return r*(t/=u)*t*t*t+i},easeOutQuart:function(n,t,i,r,u){return-r*((t=t/u-1)*t*t*t-1)+i},easeInOutQuart:function(n,t,i,r,u){return(t/=u/2)<1?r/2*t*t*t*t+i:-r/2*((t-=2)*t*t*t-2)+i},easeInQuint:function(n,t,i,r,u){return r*(t/=u)*t*t*t*t+i},easeOutQuint:function(n,t,i,r,u){return r*((t=t/u-1)*t*t*t*t+1)+i},easeInOutQuint:function(n,t,i,r,u){return(t/=u/2)<1?r/2*t*t*t*t*t+i:r/2*((t-=2)*t*t*t*t+2)+i},easeInSine:function(n,t,i,r,u){return-r*Math.cos(t/u*(Math.PI/2))+r+i},easeOutSine:function(n,t,i,r,u){return r*Math.sin(t/u*(Math.PI/2))+i},easeInOutSine:function(n,t,i,r,u){return-r/2*(Math.cos(Math.PI*t/u)-1)+i},easeInExpo:function(n,t,i,r,u){return t==0?i:r*Math.pow(2,10*(t/u-1))+i},easeOutExpo:function(n,t,i,r,u){return t==u?i+r:r*(-Math.pow(2,-10*t/u)+1)+i},easeInOutExpo:function(n,t,i,r,u){return t==0?i:t==u?i+r:(t/=u/2)<1?r/2*Math.pow(2,10*(t-1))+i:r/2*(-Math.pow(2,-10*--t)+2)+i},easeInCirc:function(n,t,i,r,u){return-r*(Math.sqrt(1-(t/=u)*t)-1)+i},easeOutCirc:function(n,t,i,r,u){return r*Math.sqrt(1-(t=t/u-1)*t)+i},easeInOutCirc:function(n,t,i,r,u){return(t/=u/2)<1?-r/2*(Math.sqrt(1-t*t)-1)+i:r/2*(Math.sqrt(1-(t-=2)*t)+1)+i},easeInElastic:function(n,t,i,r,u){n=1.70158;var f=0,e=r;return t==0?i:(t/=u)==1?i+r:(f||(f=u*.3),e<Math.abs(r)?(e=r,n=f/4):n=f/(2*Math.PI)*Math.asin(r/e),-(e*Math.pow(2,10*(t-=1))*Math.sin((t*u-n)*2*Math.PI/f))+i)},easeOutElastic:function(n,t,i,r,u){n=1.70158;var f=0,e=r;return t==0?i:(t/=u)==1?i+r:(f||(f=u*.3),e<Math.abs(r)?(e=r,n=f/4):n=f/(2*Math.PI)*Math.asin(r/e),e*Math.pow(2,-10*t)*Math.sin((t*u-n)*2*Math.PI/f)+r+i)},easeInOutElastic:function(n,t,i,r,u){n=1.70158;var f=0,e=r;return t==0?i:(t/=u/2)==2?i+r:(f||(f=u*.3*1.5),e<Math.abs(r)?(e=r,n=f/4):n=f/(2*Math.PI)*Math.asin(r/e),t<1)?-.5*e*Math.pow(2,10*(t-=1))*Math.sin((t*u-n)*2*Math.PI/f)+i:e*Math.pow(2,-10*(t-=1))*Math.sin((t*u-n)*2*Math.PI/f)*.5+r+i},easeInBack:function(n,i,r,u,f,e){return e==t&&(e=1.70158),u*(i/=f)*i*((e+1)*i-e)+r},easeOutBack:function(n,i,r,u,f,e){return e==t&&(e=1.70158),u*((i=i/f-1)*i*((e+1)*i+e)+1)+r},easeInOutBack:function(n,i,r,u,f,e){return(e==t&&(e=1.70158),(i/=f/2)<1)?u/2*i*i*(((e*=1.525)+1)*i-e)+r:u/2*((i-=2)*i*(((e*=1.525)+1)*i+e)+2)+r},easeInBounce:function(t,i,r,u,f){return u-n.easing.easeOutBounce(t,f-i,0,u,f)+r},easeOutBounce:function(n,t,i,r,u){return(t/=u)<1/2.75?r*7.5625*t*t+i:t<2/2.75?r*(7.5625*(t-=1.5/2.75)*t+.75)+i:t<2.5/2.75?r*(7.5625*(t-=2.25/2.75)*t+.9375)+i:r*(7.5625*(t-=2.625/2.75)*t+.984375)+i},easeInOutBounce:function(t,i,r,u,f){return i<f/2?n.easing.easeInBounce(t,i*2,0,u,f)*.5+r:n.easing.easeOutBounce(t,i*2-f,0,u,f)*.5+u*.5+r}})}(jQuery);String.prototype.format=function(n){for(var u="0#-,.",r="",f=!1,i,t=0;t<n.length;t++)if(u.indexOf(n.charAt(t))==-1)r=r+n.charAt(t);else if(t==0&&n.charAt(t)=="-"){f=!0;continue}else break;for(i="",t=n.length-1;t>=0;t--)if(u.indexOf(n.charAt(t))==-1)i=n.charAt(t)+i;else break;return n=n.substring(r.length),n=n.substring(0,n.length-i.length),this._format(this,n,i,r,f,!0)};String.prototype._format=function(n,t,i,r,u,f){var nt=".",tt=",",it="-",h,a,l,v,rt,c,ut,y,o,s,b,k,p,e,d,ft,g,w;if(i=="%"&&(n=n*100),h="",t.indexOf(".")>-1){for(a=nt,l=t.substring(t.lastIndexOf(".")+1),f==!0?(n=new Number(n),n=n.toFixed(l.length)):(v=n.toString(),v=v.substring(0,v.lastIndexOf(".")+l.length+1),n=new Number(v)),rt=n%1,c=new String(rt.toFixed(l.length)),c=c.substring(c.lastIndexOf(".")+1),e=0;e<l.length;e++)if(l.charAt(e)=="#"&&c.charAt(e)!="0"){a+=c.charAt(e);continue}else if(l.charAt(e)=="#"&&c.charAt(e)=="0")if(ut=c.substring(e),ut.match("[1-9]")){a+=c.charAt(e);continue}else break;else l.charAt(e)=="0"&&(a+=c.charAt(e));h+=a}else n=Math.round(n);if(y=Math.floor(n),n<0&&(y=Math.ceil(n)),o="",o=t.indexOf(".")==-1?t:t.substring(0,t.indexOf(".")),s="",!(y==0&&o.substr(o.length-1)=="#")||!1){for(b=new String(Math.abs(y)),k=9999,o.lastIndexOf(",")!=-1&&(k=o.length-o.lastIndexOf(",")-1),p=0,e=b.length-1;e>-1;e--)s=b.charAt(e)+s,p++,p==k&&e!=0&&(s=tt+s,p=0);if(o.length>s.length&&(d=o.indexOf("0"),d!=-1))for(ft=o.length-d,g=o.length-s.length-1;s.length<ft;)w=o.charAt(g),w==","&&(w=tt),s=w+s,g--}return s||o.indexOf("0",o.length-1)===-1||(s="0"),h=s+h,n<0&&u&&r.length>0?r=it+r:n<0&&(h=it+h),h.lastIndexOf(nt)==h.length-1&&(h=h.substring(0,h.length-1)),r+h+i};$(function(){$.ajaxTransport("+*",function(n){var i=navigator.userAgent,r=99,t;return i.indexOf("MSIE")>1&&(r=parseInt(i.substr(i.indexOf("MSIE")+5,5))),jQuery.browser.msie&&window.XDomainRequest&&r<10?{send:function(i,r){t=new XDomainRequest;t.open("get",n.url);t.onload=function(){if(this.contentType.match(/\/xml/)){var n=new ActiveXObject("Microsoft.XMLDOM");n.async=!1;n.loadXML(this.responseText);r(200,"success",[n])}else r(200,"success",[this.responseText])};t.ontimeout=function(){r(408,"error",["The request timed out."])};t.onerror=function(){r(404,"error",["The requested resource could not be found."])};t.send()},abort:function(){t&&t.abort()}}:void 0});$.fn.AADistBar=function(n){function u(){var n=$("#AADisBar");n.length==0&&(n=$("<div id='AADisBar'><\/div>"),n.css("width",t.width+"px"),t.cssClass!=""&&n.addClass(t.cssClass));$("body").append(n)}function f(n,t,i,r,u){var f=n;return t>f&&(f=t),i>f&&(f=i),r>f&&(f=r),u>f&&(f=u),f}function i(n,t,i){return(n*i/t).toFixed(10)}var r=this,t=$.extend({width:300,title:"",height:13,maxBarWidth:100,cssClass:""},n);return u(),this.ShowLayout=function(n,r){var u;$("#AADisBar").css("top",n.pageY+20);$("#AADisBar").css("left",n.pageX-t.width-5);$("#AADisBar").css("z-index",999);var y=r.attr("def"),e=y.split(","),s=parseFloat(e[0]),h=parseFloat(e[1]),c=parseFloat(e[2]),l=parseFloat(e[3]),a=parseFloat(e[4]),o=f(s,h,c,l,a),v=$("<table/>");v.addClass("txt_l").addClass("PerformanceChart").attr("cellpadding","0").attr("cellspacing","0").attr("width","100%").css("margin-bottom","5px");u="<tr><td colspan='6' style='padding-left:5px;padding-top:3px;padding-bottom:3px;'>"+t.title+"<\/td><\/tr>";u+="<tr><td style='height:5px;line-height:5px;' colspan='6'><\/td>";u+="<tr><td width='6px;'><\/td><td width='50px' class='PecentageCol'><span class='up_greater_2p_text'><\/span><\/td><td width='"+t.maxBarWidth+"' class='ChartLeftBorder NoPaddingMargin'><div class='TwoPercentGradientBar' style='height: "+t.height+"px; width: "+i(s,o,t.maxBarWidth)+"px;'>&nbsp;<div><\/td><td class='txt_r'>"+s+"<\/td><td width='6px;'><\/td><\/tr>";u+="<tr><td width='6px;'><\/td><td width='50px' class='PecentageCol'><span class='up_less_2p_text'><\/span><\/td><td width='"+t.maxBarWidth+"' class='ChartLeftBorder NoPaddingMargin'><div class='ZeroToTwoPercentGradientBar' style='height: "+t.height+"px; width: "+i(h,o,t.maxBarWidth)+"px;'>&nbsp;<div><\/td><td class='txt_r'>"+h+"<\/td><td width='6px;'><\/td><\/tr>";u+="<tr><td width='6px;'><\/td><td width='50px' class='PecentageCol'><span class='no_chg_text'><\/span><\/td><td width='"+t.maxBarWidth+"' class='ChartLeftBorder NoPaddingMargin'><div class='ZeroPercentGradientBar' style='height: "+t.height+"px; width: "+i(c,o,t.maxBarWidth)+"px;'>&nbsp;<div><\/td><td class='txt_r'>"+c+"<\/td><td width='6x;'><\/td><\/tr>";u+="<tr><td width='6px;'><\/td><td width='50px' class='PecentageCol'><span class='down_less_2p_text'><\/span><\/td><td width='"+t.maxBarWidth+"'  class='ChartLeftBorder NoPaddingMargin'><div class='NegativeZeroToTwoPercentGradientBar' style='height: "+t.height+"px; width: "+i(l,o,t.maxBarWidth)+"px;'>&nbsp;<div><\/td><td class='txt_r'>"+l+"<\/td><td width='6px;'><\/td><\/tr>";u+="<tr><td width='6px;'><\/td><td width='50px' class='PecentageCol'><span class='down_greater_2p_text'><\/span><\/td><td width='"+t.maxBarWidth+"'  class='ChartLeftBorder NoPaddingMargin ChartBottomBorder'><div class='NegativeTwoPercentGradientBar' style='height: "+t.height+"px; width: "+i(a,o,t.maxBarWidth)+"px;'>&nbsp;<div><\/td><td class='ChartBottomBorder txt_r'>"+a+"<\/td><td width='6px;'><\/td><\/tr>";v.html(u);$("#AADisBar").html(v);$("#AADisBar").show()},this.HideLayout=function(){$("#AADisBar").hide()},this.each(function(){var n=$(this);$(this).bind("mouseover",function(t){r.ShowLayout(t,n)});$(this).bind("mousemove",function(t){r.ShowLayout(t,n)});$(this).bind("mouseout",function(){r.HideLayout()})})};$.fn.EnlargeImage=function(n){function r(){var n=$("#AAEnlargeImage");n.length==0&&(n=$("<div id='AAEnlargeImage'><\/div>"),n.css("width",i.width+"px"));$("body").append(n)}var t=this,i=$.extend({src:""},n);return r(),this.ShowLayout=function(n){if(i.src!=""){$("#AAEnlargeImage").css("position","absolute");$("#AAEnlargeImage").css("top",n.pageY+20);$("#AAEnlargeImage").css("left",n.pageX);$("#AAEnlargeImage").css("z-index",999);var t=$("<img />");t.attr("src",i.src);t.css("height","339px");$("#AAEnlargeImage").html(t);$("#AAEnlargeImage").show()}},this.HideLayout=function(){$("#AAEnlargeImage").hide()},this.each(function(){var n=$(this);$(this).bind("mouseover",function(i){t.ShowLayout(i,n)});$(this).bind("mousemove",function(i){t.ShowLayout(i,n)});$(this).bind("mouseout",function(){t.HideLayout()})})};$.fn.AAToolTips=function(n){function r(){var n=$("#AAToolTips");n.length==0&&(n=$("<div id='AAToolTips'><\/div>"),n.css("width",t.width+"px"));$("body").append(n)}var i=this,t=$.extend({src:"",width:"",position:"E",outputFormat:null},n);return r(),this.ShowLayout=function(n,i){var r="";r=typeof t.outputFormat=="function"?t.outputFormat.apply(this,[i]):t.Text;r!=""&&($("#AAToolTips").css("position","absolute"),$("#AAToolTips").css("top",n.pageY+20),$("#AAToolTips").css("left",n.pageX),$("#AAToolTips").css("z-index",999),$("#AAToolTips").css({"background-color":"#FFFFE1",padding:"3px",border:"solid 1px #AAAAAA",color:"black"}),t.width!=""&&($("#AAToolTips").css("width",t.width),t.position!=""&&(t.position=="E"?$("#AAToolTips").css("left",n.pageX):t.position=="W"&&$("#AAToolTips").css("left",n.pageX-parseInt(t.width.replace("px",""))))),$("#AAToolTips").html(r),$("#AAToolTips").show())},this.HideLayout=function(){$("#AAToolTips").hide()},this.each(function(){var n=$(this);$(this).bind("mouseover",function(t){i.ShowLayout(t,n)});$(this).bind("mousemove",function(t){i.ShowLayout(t,n)});$(this).bind("mouseout",function(){i.HideLayout()})})};$.fn.AAToolTips2=function(n){function r(){var f="",n,r,u;i.find("div.PopupContent").length>0&&(f=i.find("div.PopupContent").html());n=$("<div/>").addClass("AAToolTips2_Popup").addClass(t.Direction);t.Style!=""&&n.attr("style",t.Style);r=$("<div/>").addClass("AAToolTips2_Arrow_Back");t.ArrowBackStyle!=""&&r.attr("style",t.ArrowBackStyle);u=$("<div/>").addClass("AAToolTips2_Arrow_Top");t.ArrowTopStyle!=""&&u.attr("style",t.ArrowTopStyle);n.append(r);n.append(u);n.append($("<div/>").html(f));i.empty().append(n);$(i).bind("mouseover",function(){$(this).find(".AAToolTips2_Popup").show()});$(i).bind("mouseout",function(){$(this).find(".AAToolTips2_Popup").hide()});t.PreloadImage!=""&&($("<img/>")[0].src=t.PreloadImage)}var i=this,t=$.extend({Direction:"left",Style:"",ArrowBackStyle:"",ArrowTopStyle:"",PreloadImage:""},n);r()};$.fn.AAToolTips3=function(n){function r(){var n=$("#AAToolTips3");n.length==0&&(n=$("<div id='AAToolTips3'><\/div>"),n.css("width",t.width+"px"));$("body").append(n)}var i=this,t=$.extend({src:"",width:"",outputFormat:null},n);return r(),this.ShowLayout=function(n,i){var r="",u,f;r=typeof t.outputFormat=="function"?t.outputFormat.apply(this,[i]):t.Text;r!=""&&($("#AAToolTips3").html(r),t.width!=""&&$("#AAToolTips3").css("width",t.width),u=$(i).offset().left+$(i).outerWidth()+10,f=$(i).offset().top-$("#AAToolTips3").outerHeight()/2+$(i).outerHeight()/2,$("#AAToolTips3").css("left",u),$("#AAToolTips3").css("top",f),$("#AAToolTips3").show())},this.HideLayout=function(){$("#AAToolTips3").hide()},this.each(function(){var n=$(this);$(this).bind("mouseover",function(t){i.ShowLayout(t,n)});$(this).bind("mouseout",function(){i.HideLayout()})})};$.fn.cusToolTip=function(n){function u(){if($("#ui-tooltip").length==0){var n=$("<div />");n.attr("id","ui-tooltip");n.css("position","absolute");n.css("display","none");n.addClass("font-c");$("body").append(n)}}function i(n,t){$("#ui-tooltip").text(n);$("#ui-tooltip").css("left",t.pageX);$("#ui-tooltip").css("top",t.pageY+23);r?$("#ui-tooltip").css("font-weight","bold"):$("#ui-tooltip").css("font-weight","normal");$("#ui-tooltip").show()}function f(){$("#ui-tooltip").hide()}var t=this,r=n;u();$(t).mouseover(function(n){var t=$(this).attr("cusToolTip");t==undefined&&(t=$(this).text());i(t,n)});$(t).mousemove(function(n){var t=$(this).attr("cusToolTip");t==undefined&&(t=$(this).text());i(t,n)});$(t).mouseout(function(){f()})};$.fn.AANewsToolTips=function(n){function u(){clearTimeout(e);e=null;clearTimeout(f);f=null}function o(){var n=$(t);n.length==0&&(n=$("<div id='"+t.slice(1)+"' class='tooltips pn'><\/div>"),n.css("background-color","transparent"));n.hide().appendTo($("body"))}function s(n){switch(i.type){case"popularNews":case"popularPopupNews":case"popularCommentary":return $(n).find(".tooltips-target");case"top50":return $(n);default:return $(n)}}function h(n){var r,u,f,e,o,s,h;$(t).empty();$(t).removeClass("pn ppn pc t50");switch(i.type){case"popularNews":r=n.clone().empty();u=n.clone().attr("class","ratio-circle r0");r.css({position:"absolute",top:29,left:42});u.css({position:"absolute",top:i.lang=="eng"?147:124,left:43});$(t).addClass("pn");$(t).append(r);$(t).append(u);break;case"popularPopupNews":f=n.clone().empty();e=n.clone().attr("class","ratio-circle r0");f.css({position:"absolute",top:29,left:42});e.css({position:"absolute",top:i.lang=="eng"?147:124,left:43});$(t).addClass("ppn");$(t).append(f);$(t).append(e);break;case"popularCommentary":o=n.clone().empty();s=n.clone().attr("class","ratio-circle r0");o.css({position:"absolute",top:29,left:42});s.css({position:"absolute",top:i.lang=="eng"?161:124,left:43});$(t).addClass("pc");$(t).append(o);$(t).append(s);break;case"top50":h=$("<div/>").addClass("arrow");h.css({position:"absolute",bottom:29});$(t).addClass("t50");$(t).append(h)}}function c(n){$(t).unbind("mouseout").bind("mouseout",function(){var e=event.toElement||event.relatedTarget;$(e).closest(".tooltips").length==0&&e!=n&&(u(),f=setTimeout(function(){u();$(t).is(":visible")&&r.HideLayoutWithAnimation()},i.delay.hide))});i.clickCallback!=null&&typeof i.clickCallback=="function"&&($(t).hasClass("pt")||$(t).addClass("pt"),$(t).unbind("click").bind("click",i.clickCallback))}function l(n){switch(i.position.dir){case"E":$(t).css("top",i.position.y+n.offset().top);$(t).css("left",i.position.x+n.offset().left+n.outerWidth());break;case"W":$(t).css("top",i.position.y+n.offset().top);$(t).css("left",i.position.x+n.offset().left-i.width);break;case"N":$(t).css("top",i.position.y+n.offset().top-i.height);$(t).css("left",i.position.x+n.offset().left);break;case"S":$(t).css("top",i.position.y+n.offset().top+n.outerHeight());$(t).css("left",i.position.x+n.offset().left)}if(i.type=="top50"&&i.position.dir=="N"){var r=-25,u=$(t).find("div.arrow");i.position.x+n.offset().left<r?($(t).css("left",r),u.css("left",n.offset().left+n.outerWidth()/2-u.outerWidth()/2-r)):u.css("left",130+n.outerWidth()/2)}}function a(){i.width=$(t).outerWidth();i.height=$(t).outerHeight()}var r=this,t="#AANewsToolTips",i=$.extend(!0,{},{type:"",lang:"chi",position:{dir:"",x:0,y:0},delay:{show:0,hide:0},animate:{show:0,hide:0,delta:0},clickCallback:null},n),e=null,f=null;return o(),this.ShowLayout=function(n,i){$(t).css("position","absolute");$(t).css("z-index",999);c(i);h(i);a();l(i);$(t).show()},this.HideLayout=function(){$(t).hide();r.removeClass("hover")},this.ShowLayoutWithAnimation=function(n,u){r.ShowLayout(n,u);var f=$(t).offset().top,e=$(t).offset().left,o=i.animate.delta,s=i.animate.show;switch(i.position.dir){case"E":$(t).css({opacity:0,left:e+o}).animate({opacity:1,left:e},s);break;case"W":$(t).css({opacity:0,left:e-o}).animate({opacity:1,left:e},s);break;case"N":$(t).css({opacity:0,top:f-o}).animate({opacity:1,top:f},s);break;case"S":$(t).css({opacity:0,top:f+o}).animate({opacity:1,top:f},s)}},this.HideLayoutWithAnimation=function(){var n=$(t).offset().top,u=$(t).offset().left,f=i.animate.delta,e=i.animate.hide;switch(i.position.dir){case"E":$(t).css({opacity:1,left:u}).animate({opacity:0,left:u+f},e,r.HideLayout);break;case"W":$(t).css({opacity:1,left:u}).animate({opacity:0,left:u-f},e,r.HideLayout);break;case"N":$(t).css({opacity:1,top:n}).animate({opacity:0,top:n-f},e,r.HideLayout);break;case"S":$(t).css({opacity:1,top:n}).animate({opacity:0,top:n+f},e,r.HideLayout)}},this.each(function(){function h(o){o.stopPropagation();r.removeClass("hover");n.addClass("hover");f!=null?(u(),$(t).is(":visible")?r.ShowLayout(o,n):r.ShowLayoutWithAnimation(o,n)):(u(),e=setTimeout(function(){u();$(t).is(":visible")||r.ShowLayoutWithAnimation(o,n)},i.delay.show))}function c(n){var e=n.toElement||n.relatedTarget;e.parentNode==this||e==this||$(e).hasClass("tooltips")||(u(),f=setTimeout(function(){u();$(t).is(":visible")&&r.HideLayoutWithAnimation()},i.delay.hide))}var n=$(this),o=s(this);o.unbind("mouseover mouseout");o.bind("mouseover",h);o.bind("mouseout",c)})};$.fn.EnlargeImageWithButton=function(n){function s(){var n=$("<img />");n.attr("src",t.src).css({height:"339px",border:t.cssborder,"box-shadow":"0px 0px 8px #222","-moz-box-shadow":"0px 0px 8px #222","-webkit-box-shadow":"0px 0px 8px #222",filter:"progid:DXImageTransform.Microsoft.Shadow(color='#222', Direction=135, Strength=10)","-ms-filter":"progid:DXImageTransform.Microsoft.Shadow(color='#222', Direction=135, Strength=10)",cursor:"pointer"}).bind("click",function(){o()});r.appendTo(f.parent());f.css("cursor","pointer").appendTo(r);i.hide();i.append(n);$("body").append(i);u.bind("click",o).addClass(t.cssclass.open).css("z-index","99999");u.appendTo(r)}function o(){if(t.src!="")if(e)i.hide(),u.removeClass(t.cssclass.close).addClass(t.cssclass.open).detach().appendTo(r),e=!1;else{var n=f.offset();e=!0;i.css({position:"absolute",left:n.left+"px",top:n.top+"px"});u.removeClass(t.cssclass.open).addClass(t.cssclass.close).detach().appendTo(i);i.show()}}var f=this,i=jQuery("<div />"),r=jQuery("<div />",{style:"position:relative"}),u=jQuery("<div />"),e=!1,t=$.extend({src:"",cssclass:{open:"",close:""},cssborder:"1px #333 solid"},n);return s(),this.each(function(){var n=$(this);$(this).bind("click",function(){o()})})};$.fn.StockNewsMiniChart=function(n){function fi(){a.attr("style",r.style.mainDiv);t.append(vt);vt.append(a);a.empty();st("+");rt.attr("class",r.cssclass.quote.quotecore).attr("style",r.style.quote.quotecore);rt.appendTo(a);ni.appendTo(a);r.showRollingbar&&ti.appendTo(a)}function ii(n){var t=ut("sym",n);if(t==undefined)rt.empty();else try{rt.empty();ei(t);hi(t);c.appendTo(rt)}catch(i){alert(i)}}function ei(n){var i=r.chartLink,u=r.symbolLink,e=r.topbarwordlen,o,h,f,s,t;n.m=="US"?(i=r.chartLinkUS,u=r.symbolLinkUS,e=r.topbarwordlenUS):(n.m=="SH"||n.m=="SZ")&&(i=r.chartLinkCN,u=r.symbolLinkCN,e=r.topbarwordlen);c=$("<div />");c.addClass("rel-stock-chart");o="";o=n.m=="US"?r.chart.img+"?showlabel=1&width="+r.chart.width+"&height="+r.chart.height+"&symbol="+n.s+"."+n.m+((n.q||"")=="0"?"&real=1":""):r.chart.img+"?showlabel=1&width="+r.chart.width+"&height="+r.chart.height+"&symbol="+n.s+"."+n.m;h=$("<img/>").addClass("stock-chart").attr("src",o);c.append($("<a/>").attr("href",i=="#"?"#":i.replace("{0}",n.s)).append(h));f="";n.cs==="pos"?f="<span class='stock-last-arrow'>▲<\/span>":n.cs==="neg"&&(f="<span class='stock-last-arrow'>▼<\/span>");s=$("<a/>").addClass("stock-name-symbol-href").attr("href",u=="#"?"#":u.replace("{0}",n.s));t=$("<div/>").addClass("stock-value").addClass(n.cs);t.append($("<div/>").addClass("stock-name").html(n.n.substring(0,e)));t.append($("<div/>").addClass("clear"));t.append($("<div/>").addClass("stock-last").html(f+ri(n.l.replace(/\,/g,""),3,"-","-",!1)));typeof n.Prepost!="undefined"&&n.Prepost!=null&&(t.addClass("inprepost"),t.append($("<div/>").addClass("stock-prepost").html(n.Prepost)));t.append($("<div/>").addClass("stock-change").html($(n.c).text().replace("(","&nbsp;&nbsp;").replace(")","")));t.append($("<div/>").addClass("clear"));s.append(t);c.append(s)}function oi(n){var t="";n.cs==="pos"?t="<span class='stock-last-arrow'>▲<\/span>":n.cs==="neg"&&(t="<span class='stock-last-arrow'>▼<\/span>");c.find(".stock-value").removeClass("pos neg unc").addClass(n.cs);c.find(".stock-last").html(t+ri(n.l.replace(/\,/g,""),3,"-","-",!1));c.find(".stock-change").html($(n.c).text().replace("(","&nbsp;&nbsp;").replace(")",""));typeof n.Prepost!="undefined"&&n.Prepost!=null?(c.find(".stock-value").removeClass("inprepost").addClass("inprepost"),c.find(".stock-prepost").html(n.Prepost).show()):(c.find(".stock-value").removeClass("inprepost"),c.find(".stock-prepost").html("").hide())}function st(n){var u,t,o;if(r.showRollingbar){if(f!=-999)if(n=="+"){if(f++,e.length<4){f=f>e.length-1?0:f;return}if(f<4)return}else{if(f--,e.length<4){f=f<0?e.length-1:f;return}if(f>-1)return}for(v.empty(),e.length>4?(h=n=="-"?h-1:h+1,f=f<-990?0:f,f<0?(h=h>0?h:e.length-1,t=h,f=0):f>3?(f=3,h=h>e.length-1?0:h,t=h):t=h):(t=0,f=n=="-"?f-1:f+1,f<0?f=e.length-1:f>e.length-1&&(f=0)),at="",i=0;i<4&&i<e.length;i++)t>e.length-1&&(t=0),u=ut("pos",t),at+=u.s+";",o=$("<div/>",{html:u.n.substring(0,u.m=="US"?r.topbarwordlenUS:r.topbarwordlen),style:r.style.scrollsym.quote,idx:i,sym:u.s}).addClass("sqminscrol "+r.cssclass.scrollsym.quote).bind("mouseover",function(){f!=parseInt($(this).attr("idx"))&&(ht(),g($(this).attr("idx")))}).prepend($("<div />",{style:r.style.scrollsym.sel}).addClass("pt "+r.cssclass.scrollsym.sel)),o.appendTo(v),t++;v.addClass(r.cssclass.scrollsym.main);e.length<4&&$("<div/>",{style:"width:1px"}).addClass(r.cssclass.scrollsym.quote).appendTo(v);e.length==1?v.css("border-top","none"):($("<div/>").addClass(r.cssclass.scrollsym.l).bind("click",function(){ht();ui()}).prependTo(v),$("<div/>").addClass(r.cssclass.scrollsym.r).bind("click",function(){ht();kt()}).appendTo(v))}}function si(n){var t,u;for(b.hide(),b.appendTo(vt),b.empty(),b.addClass(r.cssclass.scrollimg.maindiv),b.attr("style",r.style.scrollimg.maindiv),i=0;i<e.length;i++)t=ut("pos",i),t!=undefined&&(u=$("<div />",{sym:t.s}).addClass(r.cssclass.scrollimg.nonsel),n==t.s&&u.addClass(r.cssclass.scrollimg.sel),u.appendTo(b));b.width(r.style.scrollimg.width*e.length).appendTo(ti)}function wt(n){if(r.showRollingbar){var t,u=-1;dt();do{for(t=at.split(";"),i=0;i<t.length;i++)if(t[i]!=""&&t[i]==n&&i==f){u=i;break}u==-1&&st("+")}while(u==-1);g(u);gt()}else ii(n)}function g(n){var t;v.find(".sqminscrol > .pt").removeClass(r.cssclass.scrollsym.sel);v.find(".sqminscrol").each(function(i){$(this).removeClass("sel");i==parseInt(n)&&($(this).find(".pt").addClass(r.cssclass.scrollsym.sel),t=$(this).attr("sym"),$(this).addClass("sel"))});ii(t);r.showRollingbar&&si(t);f=parseInt(n)}function hi(n){function r(n){var i=0,f,r;if(n.status=="S")for(x in n.data)isNaN(x)||(f=n.data[x],i<2&&(u(n.data[x]),i++));ft.appendTo(ni);r=bt();t.css("top",r)}function u(t){var e=$("<tr/>"),h=$("<td class='npad'/>"),o=$("<div/>"),s=$("<div/>").addClass("date-format"),r=$("<div/>").addClass("news-headline4"),c=$("<div/>").addClass("fix2Row"),u,f;u=n.m=="US"?"<a href='javascript:gotousaafn(\""+t.id+'","'+n.s+"\")' title='"+t.c+"'>"+$("<div>").text(t.c).html()+"<\/a>":"<a href='javascript:gotoaafnind(\""+t.id+'","'+t.s+"\")' title='"+t.c+"'>"+$("<div>").text(t.c).html()+"<\/a>";s.html("<div class='d'>"+t.dt.d+"<\/div><div class='m'>"+t.dt.m+"<\/div><div class='y'>"+t.dt.y+"<\/div>");r.append(c.append(u));f=GetNewsSourceLabel(t.id,t.ns,0);f!=""&&r.append("<div class='news-content-source'>"+f+"<\/div>");o.append(s).append(r);e.append(h.append(o));i.append(e)}if(ft.empty(),n.m=="SH"||n.m=="SZ")return!1;ft.addClass("ns1").css("width","100%");var i=$("<tbody/>");ft.append(i);AADataCenter.GetNews({param:{t:n.m=="US"?9:4,s:n.s}},function(n){r(n)})}function ri(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))}function ut(n,t){for(var i=null,i=0;i<e.length;i+=1)if(n=="sym"){if(e[i].s==t)return e[i]}else if(n=="pos"&&i==t)return e[i];return}function ci(){try{if(r.symbollst==""){ct=!1;return}e=$.parseJSON(r.symbollst)}catch(n){ct=!1}}function bt(){var n,i=$(k).find("span"),r=i.position();return pt?u=="top"?n="auto":u=="bottom"?n=r.top+$(i).outerHeight()+o+$(ot).scrollTop():(u=="left"||u=="right")&&(n=r.top+$(i).outerHeight()/2-t.outerHeight()/2+$(ot).scrollTop(),n<0&&(n=0)):u=="top"?n="auto":u=="bottom"?n=r.top+$(i).outerHeight()+o:(u=="left"||u=="right")&&(n=r.top+$(i).outerHeight()/2-t.outerHeight()/2),n}function nt(){clearTimeout(et);et=null;clearTimeout(yt);yt=null}function kt(){st("+");g(f)}function ui(){st("-");g(f)}function dt(){clearInterval(lt)}function gt(){clearInterval(lt);e.length>1?r.autoscroll&&(lt=setInterval(function(){kt()},r.scrollduration)):r.autoscroll=!1}function ht(){dt();r.autoscroll=!1}function li(n,i){pt=!1;ot=i;k=n;n=$(n).find("span");var h=n.position(),rt=$(window).width(),ut=$(window).height(),ft=n.offset(),f=0,b=0,e=0,v=ft.left-$(window).scrollLeft(),w=ft.top-$(window).scrollTop(),c=$("<div/>");a.addClass(r.cssclass.arrow.bgcolor).css("border-radius","3px").css("border","1px solid #dddddd");var lt=w+$(n).outerHeight()+o+p<ut,at=w>p+o,g=v+$(n).outerWidth()/2>y/2,st=v+$(n).outerWidth()/2+y/2<rt,ht=w+$(n).outerHeight()/2+p/2<ut,ct=w+$(n).outerHeight()/2>p/2,vt=v>y+l,yt=v+$(n).outerWidth()+l+y<rt;t.removeClass("postop posbottom posleft posright");lt&&g&&st?(u="bottom",t.addClass("posbottom")):at&&g&&st?(u="top",t.addClass("postop")):vt&&ct&&ht?(u="left",t.addClass("posleft")):yt&&ct&&ht?(u="right",t.addClass("posright")):g?(u="bottom",t.addClass("posbottom")):(u="right",t.addClass("posright"));t.css({position:"absolute"});s.empty().removeClass().attr("style","");u=="top"?(e=$(i).height()-h.top+o,f=h.left+$(n).outerWidth()/2-t.outerWidth()/2,s.attr("style","position:absolute; bottom:"+(-o+6)+"px; left:50%;"),c.addClass(r.cssclass.arrow.down).attr("style","position:relative;left:"+-l/2+"px").detach()):u=="bottom"?(f=h.left+$(n).outerWidth()/2-t.outerWidth()/2,e="auto",s.attr("style","position:absolute; top:"+(-o+6)+"px; left:50%;"),c.addClass(r.cssclass.arrow.up).attr("style","position:relative;left:"+-l/2+"px").detach()):u=="left"?(f=h.left-t.outerWidth()-o,e="auto",s.attr("style","position:absolute; top:50%; right:"+(-o+4)+"px;"),c.addClass(r.cssclass.arrow.right).attr("style","position:relative;top:"+-l/2+"px").detach()):u=="right"&&(f=h.left+$(n).outerWidth()+o,e="auto",s.attr("style","position:absolute; top:50%; left:"+(-o+6)+"px;"),c.addClass(r.cssclass.arrow.left).attr("style","position:relative;top:"+-l/2+"px").detach());b=bt();t.css("top",b);t.css("bottom",e);t.css("left",f);t.css("right","auto");c.appendTo(s);s.appendTo(t);$(t).data({pos:u,top:b,bottom:e,left:f});t.hide();nt();et=setTimeout(function(){nt();t.showWithAnimation()},r.delay.show);it=!0;clearInterval(d);$(k).bind("mouseleave mouseenter",tt);$(t).bind("mouseleave mouseenter",tt)}function ai(n,i){pt=!0;ot=i;k=n;n=$(n).find("span");var f=n.position(),ut=$(i).width(),ft=$(i).height(),v=f.left,w=f.top,e=0,g=0,h=0,c=$("<div/>");a.addClass(r.cssclass.arrow.bgcolor).css("border-radius","3px").css("border","1px solid #dddddd");var ct=w+$(n).outerHeight()+o+p<ft,lt=w>p+o,b=v+$(n).outerWidth()/2>y/2,rt=v+$(n).outerWidth()/2+y/2<ut,st=w+$(n).outerHeight()/2+p/2<ft,ht=w+$(n).outerHeight()/2>p/2,at=v>y+l,vt=v+$(n).outerWidth()+l+y<ut;ct&&b&&rt?(u="bottom",t.removeClass("postop posbottom posleft posright").addClass("posbottom")):lt&&b&&rt?(u="top",t.removeClass("postop posbottom posleft posright").addClass("postop")):at&&ht&&st?(u="left",t.removeClass("postop posbottom posleft posright").addClass("posleft")):vt&&ht&&st?(u="right",t.removeClass("postop posbottom posleft posright").addClass("posright")):b&&rt?(u="bottom",t.removeClass("postop posbottom posleft posright").addClass("posbottom")):b?(u="left",t.removeClass("postop posbottom posleft posright").addClass("posleft")):(u="right",t.removeClass("postop posbottom posleft posright").addClass("posright"));t.css({position:"absolute"});s.empty().removeClass().attr("style","");u=="top"?(h=$(i).height()-$(i).scrollTop()-f.top+$(n).outerHeight()+o,e=f.left+$(n).outerWidth()/2-t.outerWidth()/2,s.attr("style","position:absolute; bottom:"+(-o+6)+"px; left:50%;"),c.addClass(r.cssclass.arrow.down).attr("style","position:relative;left:"+-l/2+"px").detach()):u=="bottom"?(e=f.left+$(n).outerWidth()/2-t.outerWidth()/2,h="auto",s.attr("style","position:absolute; top:"+(-o+6)+"px; left:50%;"),c.addClass(r.cssclass.arrow.up).attr("style","position:relative;left:"+-l/2+"px").detach()):u=="left"?(e=f.left-t.outerWidth()-o,h="auto",s.attr("style","position:absolute; top:50%; right:"+(-o+4)+"px;"),c.addClass(r.cssclass.arrow.right).attr("style","position:relative;top:"+-l/2+"px").detach()):u=="right"&&(e=f.left+$(n).outerWidth()+o,h="auto",s.attr("style","position:absolute; top:50%; left:"+(-o+6)+"px;"),c.addClass(r.cssclass.arrow.left).attr("style","position:relative;top:"+-l/2+"px").detach());g=bt();t.css("top",g);t.css("bottom",h);t.css("left",e);t.css("right","auto");c.appendTo(s);s.appendTo(t);$(t).data({pos:u,top:g,bottom:h,left:e});t.hide();nt();et=setTimeout(function(){nt();t.showWithAnimation()},r.delay.show);it=!0;clearInterval(d);$(k).bind("mouseleave mouseenter",tt);$(t).bind("mouseleave mouseenter",tt)}function tt(n){n.type=="mouseleave"?it=!1:n.type=="mouseenter"&&(it=!0);clearTimeout(d);d=setTimeout(function(){vi()},200)}function vi(){it?clearTimeout(d):(nt(),yt=setTimeout(function(){nt();t.hideWithAnimation();$(k).unbind("mouseleave mouseenter",tt);$(t).unbind("mouseleave mouseenter",tt);clearTimeout(d)},r.delay.hide))}var t=this,r=$.extend(!0,{},{name:"miniChartCore",autoscroll:!1,scrollduration:7e3,symbollst:[{n:"",s:"",l:"",c:"",d:"",cur:""}],topbarwordlen:"4",topbarwordlenUS:"8",qwordlen:"5",chart:{img:"",tar:'javascript:hkchart("{0}")',width:"",height:""},news:{getnews:"",currentnews:"",tar:'javascript:gotoaafnind("{0}","{1}")',para:{t:"4",s:""},showmaxnews:3},quote:{tar:'javascript:gotobmp("{0}")'},cssclass:{mainDiv:"",chart:"imgchart",scrollsym:{quote:"topquote",main:"scrollmain",sel:"topquotesel",l:"scrL",r:"scrR"},quote:{quotecore:"quotecore",qname:"quote",qcurr:"quotecurr",qlast:"quotelast",qchange:"quotechange",qupdate:"quotedt"},quotenewsspacing:"sep",news:{maindiv:"newsmain",newsdate:"newsdt",newstitle:"newslnk"},scrollimg:{maindiv:"scrmain",nonsel:"scrimg",sel:"scrimgsel"},arrow:{up:"arrup",down:"arrdown",left:"arrleft",right:"arrright",bgcolor:"bgColor",overlaybg:"overlay",border:{left:"border_L",right:"border_R",top:"border_T",bottom:"border_B"}}},style:{mainDiv:"width:300px;height:223px",chart:"",scrollsym:{quote:"",main:"",sel:"",l:"",r:""},quote:{quotecore:"",qname:"",qcurr:"",qlast:"",qchange:"",qupdate:""},quotenewsspacing:"",news:{newsdate:"",newstitle:""},scrollimg:{maindiv:"",nonsel:"",sel:"",width:"16"},arrow:{width:14,height:21,divheight:2}},wording:{LastPrice:"",LastUpdate:"",NoRelatedNews:""},showRollingbar:!0,chartLink:"#",chartLinkUS:"#",chartLinkCN:"#",symbolLink:"#",symbolLinkUS:"#",symbolLinkCN:"#",delay:{show:0,hide:0},animate:{show:0,hide:0,delta:0}},n),ct=!0,f=-999,h=-1,e={},lt,at,k=!0,it=!1,d,vt=$("<div/>",{id:r.name}),a=$("<div/>"),v=$("<div/>"),rt=$("<div/>"),ni=$("<div/>"),w=$("<div/>"),ti=$("<div/>"),yi=$("<div/>"),c=$("<div/>"),ft=$("<table/>"),b=$("<div/>"),pi=$("<div/>"),wi=$("<div/>"),bi=$("<div/>"),ki=$("<div/>"),s=$("<div/>"),di=$("<div/>",{style:"clear:both"}),u,et=null,yt=null,pt=!1,ot,y=320,p=370,l=14,o=15;return this.init=function(){ci();t.css("z-index","999999");ct&&(fi(),g(0));r.autoscroll&&gt()},this.showWithAnimation=function(){var n=$(t).data(),i,u;if(t.stop().clearQueue(),!t.is(":visible")){i=r.animate.delta;u=r.animate.show;switch(n.pos){case"top":t.css({opacity:0,bottom:n.bottom+i}).show().animate({opacity:1,bottom:n.bottom},u);break;case"bottom":t.css({opacity:0,top:n.top+i}).show().animate({opacity:1,top:n.top},u);break;case"left":t.css({opacity:0,left:n.left-i}).show().animate({opacity:1,left:n.left},u);break;case"right":t.css({opacity:0,left:n.left+i}).show().animate({opacity:1,left:n.left},u)}}},this.hideWithAnimation=function(){var n=$(t).data(),i,u;if(t.stop().clearQueue(),t.is(":visible")){i=r.animate.delta;u=r.animate.hide;switch(n.pos){case"top":t.css({opacity:1,bottom:n.bottom}).animate({opacity:0,bottom:n.bottom+i},u,function(){t.hide()});break;case"bottom":t.css({opacity:1,top:n.top}).animate({opacity:0,top:n.top+i},u,function(){t.hide()});break;case"left":t.css({opacity:1,left:n.left}).animate({opacity:0,left:n.left-i},u,function(){t.hide()});break;case"right":t.css({opacity:1,left:n.left}).animate({opacity:0,left:n.left+i},u,function(){t.hide()})}}},this.setBasicQuote=function(n,t){var i=ut("sym",n);i=$.extend(!0,i,t)},this.bindBasicQuote=function(n){var t=ut("sym",n);oi(t)},this.init(),this.SelectDiv=function(n){g(n)},this.RollNext=function(){kt()},this.RollBack=function(){ui()},this.StopRoll=function(){dt()},this.StartRoll=function(){gt()},this.DisableScroll=function(){ht()},this.GotoSymbol=function(n){wt(n)},this.FocusSymbol=function(n,t,i){wt(t);li(n,i)},this.FocusSymbolWithSkinner=function(n,t,i){wt(t);ai(n,i)},t};$.fn.AARTQuote=function(n){function u(n){t.symbol!==""&&setTimeout(function(){$.ajax({url:n,async:!0,dataType:"text",error:function(){},success:function(n){s(n)}})},1)}function s(n){var u,s,i,h,e;if(n=f(n),u=n.split(String.fromCharCode(28)),s=null,u!=null&&u.length>0)for(i=0;i<u.length;i++)h=u[i].split(String.fromCharCode(29)),h!=null&&h.length>0&&(e=h[0].split(String.fromCharCode(31)),i==0?s=e.length>1?r(1,e):r(0,e):i==1&&o(s,e));typeof t.callback=="function"&&t.callback.apply(this,[s])}function f(n){return $("<div><\/div>").html(n).text()}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:(t==-3?f=f+".000":n<100?f=t==2?f+".00":f+".000":n>=100&&n<1e3&&(f=f+".00"),n.toString().format(f))}function e(n,r){var f={},u,o,s,e;return n==0?f={s:null,status:n}:(u=3,u=r.find("s11").text()=="SHEx"||r.find("s11").text()=="SZEx"?-3:3,e=r.find("r1").text()=="N/A"?"N/A":i(r.find("r1").text(),u,"N/A","N/A",!0),o=r.find("r3").text()=="N/A"?"N/A":i(r.find("r3").text(),u,"N/A","N/A",!0),s=r.find("r4").text()=="N/A"?"N/A":i(r.find("r4").text(),u,"N/A","N/A",!0),f={status:n,s:r.find("s1").text(),name:r.find("s2").text(),currency:r.find("s5").text(),exchangeMarket:r.find("s11").text(),dp:function(){return this.exchangeMarket=="SHEx"||this.exchangeMarket=="SZEx"?3:3},industry:function(){var t=r.find("s20").text(),n;return t!=""?(n=t.split("|"),{code:n[0],name:n[1]}):null},index:function(){var i=r.find("s23").text(),t;if(i!=""){var u=i.split(";"),f=[],n=null;for(t=0;t<u.length;t++)n=u[t].split("|"),(n[0]=="000010.SH"||n[0]=="000009.SH"||n[0]=="399001.SZ"||n[0]=="399015.SZ")&&f.push({code:n[0],name:n[1]});return f}return null},hkindex:function(){var u=r.find("s23").text(),t;if(u!=""){var f=u.split(";"),i=[],n=null;for(t=0;t<f.length;t++)n=f[t].split("|"),n[0]=="HSI.HK"||n[0]=="HSCCI.HK"||n[0]=="HSCEI.HK"||n[0]=="GEM.HK"||n[0]=="HSF.HK"||n[0]=="HSU.HK"||n[0]=="HSP.HK"||n[0]=="HSC.HK"||n[0]=="VHSI.HK"?i.push({code:n[0],name:n[1],link:"Y"}):i.push({code:n[0],name:n[1],link:"N"});return i}return null},othermarketsymbol:r.find("26").text(),hkmarketsymbol:function(){var t,n;if(this.othermarketsymbol!="")for(t=this.othermarketsymbol.split(";"),n=0;n<t.length;n++)if(t[n].indexOf(".HK")>0)return t[n];return null},shmarketsymbol:function(){var t,n;if(this.othermarketsymbol!="")for(t=this.othermarketsymbol.split(";"),n=0;n<t.length;n++)if(t[n].indexOf(".SH")>0)return t[n];return null},szmarketsymbol:function(){var t,n;if(this.othermarketsymbol!="")for(t=this.othermarketsymbol.split(";"),n=0;n<t.length;n++)if(t[n].indexOf(".SZ")>0)return t[n];return null},eventcountdown:function(){return""},eventcountdown_detail:function(){return{}},outbound_eligible:r.find("s81").text(),outbound_eligible_szhk:r.find("s113").text(),last_update:r.find("r0").text(),prev_close:r.find("r1").text(),last:e,open:r.find("r3").text(),high:o,low:s,highlow_Indicator:t.group0.indexOf(",34")>=0?r.find("r132").text():r.find("r105").text(),news_counter_chi:r.find("r108").text(),news_counter_chn:r.find("r109").text(),news_counter_eng:r.find("r110").text(),change:function(){var n=null,t=null,i="";return!isNaN(this.prev_close)&&!isNaN(this.last)&&parseFloat(this.last)>0&&parseFloat(this.prev_close)>0?(n=parseFloat(this.last)-parseFloat(this.prev_close),t=n/parseFloat(this.prev_close)*100,n=n.toFixed(this.dp()),t=Math.abs(t).toFixed(3)+"%",i=n>0?"+":n<0?"-":"=",{c:n,pc:t,cs:i}):{c:"N/A",pc:"N/A",cs:""}},range:function(){return!isNaN(this.high)&&!isNaN(this.low)&&parseFloat(this.high)>0&&parseFloat(this.low)>0?this.low+"-"+this.high:"N/A"}}),f}function r(n,t){var r={},f,e,o,u;if(n==0)r={s:null,status:n};else if(f=3,f=t[4]=="SHEx"||t[4]=="SZEx"?-3:3,r={status:n,s:"",name:"",currency:"",exchangeMarket:"",dp:function(){return this.exchangeMarket=="SHEx"||this.exchangeMarket=="SZEx"?3:3},_industry:"",industry:function(){var t=this._industry,n;return t!=""?(n=t.split("|"),{code:n[0],name:n[1]}):null},_index:"",index:function(){var i=this._index,t;if(i!=""){var r=i.split(";"),u=[],n=null;for(t=0;t<r.length;t++)n=r[t].split("|"),(n[0]=="000010.SH"||n[0]=="000009.SH"||n[0]=="399001.SZ"||n[0]=="399015.SZ")&&u.push({code:n[0],name:n[1]});return u}return null},_hkIndex:"",hkindex:function(){var r=this._hkIndex,t;if(r!=""){var u=r.split(";"),i=[],n=null;for(t=0;t<u.length;t++)n=u[t].split("|"),n[0]=="HSI.HK"||n[0]=="HSCCI.HK"||n[0]=="HSCEI.HK"||n[0]=="GEM.HK"||n[0]=="HSF.HK"||n[0]=="HSU.HK"||n[0]=="HSP.HK"||n[0]=="HSC.HK"||n[0]=="VHSI.HK"?i.push({code:n[0],name:n[1],link:"Y"}):i.push({code:n[0],name:n[1],link:"N"});return i}return null},othermarketsymbol:"",hkmarketsymbol:function(){var t,n;if(this.othermarketsymbol!="")for(t=this.othermarketsymbol.split(";"),n=0;n<t.length;n++)if(t[n].indexOf(".HK")>0)return t[n];return null},shmarketsymbol:function(){var t,n;if(this.othermarketsymbol!="")for(t=this.othermarketsymbol.split(";"),n=0;n<t.length;n++)if(t[n].indexOf(".SH")>0)return t[n];return null},szmarketsymbol:function(){var t,n;if(this.othermarketsymbol!="")for(t=this.othermarketsymbol.split(";"),n=0;n<t.length;n++)if(t[n].indexOf(".SZ")>0)return t[n];return null},eventcountdown:function(){return""},eventcountdown_detail:function(){return{}},outbound_eligible:"",outbound_eligible_szhk:"",last_update:"",prev_close:"",last:"",open:"",high:"",low:"",highlow_Indicator:"",news_counter_chi:"",news_counter_chn:"",news_counter_eng:"",anue_news_counter_chi:"",anue_news_counter_chn:"",glh_news_counter_chi:"",glh_news_counter_chn:"",change:function(){var n=null,t=null,u="",i=this.getPrevClose(),r=this.last.replace(",","");return!isNaN(i)&&!isNaN(r)&&parseFloat(r)>0&&parseFloat(i)>0?(n=parseFloat(r)-parseFloat(i),t=n/parseFloat(i)*100,n=n.toFixed(this.dp()),t=Math.abs(t).toFixed(3)+"%",u=n>0?"+":n<0?"-":"=",{c:n,pc:t,cs:u}):{c:"N/A",pc:"N/A",cs:""}},range:function(){return this.low!="N/A"||this.high!="N/A"?this.low+"-"+this.high:"N/A"},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(",","")}},t.length==23)for(u=0;u<t.length;u++)switch(u){case 1:r.s=t[u];break;case 2:r.name=t[u];break;case 3:r.currency=t[u];break;case 4:r.exchangeMarket=t[u];break;case 5:r._industry=t[u];break;case 6:r._index=t[u];r._hkIndex=t[u];break;case 7:r.othermarketsymbol=t[u];break;case 8:r.outbound_eligible=t[u];break;case 9:r.outbound_eligible_szhk=t[u];break;case 10:r.ipoOfferingPrice=t[u];break;case 11:r.listingDate=t[u];break;case 12:r.last_update=t[u];break;case 13:r.prev_close=t[u];break;case 14:r.last=t[u]=="N/A"?"N/A":i(t[u],f,"N/A","N/A",!0);break;case 15:r.open=t[u]=="N/A"?"N/A":i(t[u],f,"N/A","N/A",!0);break;case 16:r.high=t[u]=="N/A"?"N/A":i(t[u],f,"N/A","N/A",!0);break;case 17:r.low=t[u]=="N/A"?"N/A":i(t[u],f,"N/A","N/A",!0);break;case 19:r.news_counter_chi=t[u];break;case 20:r.news_counter_chn=t[u];break;case 21:r.news_counter_eng=t[u];break;case 22:r.highlow_Indicator=t[u]}else if(t.length==25){for(u=0;u<t.length;u++)switch(u){case 1:r.s=t[u];break;case 2:r.name=t[u];break;case 3:r.currency=t[u];break;case 4:r.exchangeMarket=t[u];break;case 5:r._industry=t[u];break;case 6:r._index=t[u];r._hkIndex=t[u];break;case 7:r.othermarketsymbol=t[u];break;case 8:r.outbound_eligible=t[u];break;case 9:r.outbound_eligible_szhk=t[u];break;case 10:r.ipoOfferingPrice=t[u];break;case 11:r.listingDate=t[u];break;case 12:r.last_update=t[u];break;case 13:r.prev_close=t[u];break;case 14:r.last=t[u]=="N/A"?"N/A":i(t[u],f,"N/A","N/A",!0);break;case 15:r.open=t[u]=="N/A"?"N/A":i(t[u],f,"N/A","N/A",!0);break;case 16:r.high=t[u]=="N/A"?"N/A":i(t[u],f,"N/A","N/A",!0);break;case 17:r.low=t[u]=="N/A"?"N/A":i(t[u],f,"N/A","N/A",!0);break;case 19:r.news_counter_chi=t[u];break;case 20:r.news_counter_chn=t[u];break;case 21:r.news_counter_eng=t[u];break;case 22:r.highlow_Indicator=t[u];break;case 23:r.anue_news_counter_chi=t[u];break;case 24:r.anue_news_counter_chn=t[u]}(parseFloat(r.news_counter_chi)>=0||parseFloat(r.anue_news_counter_chi)>=0)&&(e=parseFloat(r.news_counter_chi),o=parseFloat(r.anue_news_counter_chi),r.news_counter_chi=(isNaN(e)?0:e)+(isNaN(o)?0:o));(parseFloat(r.news_counter_chn)>=0||parseFloat(r.anue_news_counter_chn)>=0)&&(e=parseFloat(r.news_counter_chn),o=parseFloat(r.anue_news_counter_chn),r.news_counter_chn=(isNaN(e)?0:e)+(isNaN(o)?0:o))}else if(t.length==27){for(u=0;u<t.length;u++)switch(u){case 1:r.s=t[u];break;case 2:r.name=t[u];break;case 3:r.currency=t[u];break;case 4:r.exchangeMarket=t[u];break;case 5:r._industry=t[u];break;case 6:r._index=t[u];r._hkIndex=t[u];break;case 7:r.othermarketsymbol=t[u];break;case 8:r.outbound_eligible=t[u];break;case 9:r.outbound_eligible_szhk=t[u];break;case 10:r.ipoOfferingPrice=t[u];break;case 11:r.listingDate=t[u];break;case 12:r.last_update=t[u];break;case 13:r.prev_close=t[u];break;case 14:r.last=t[u]=="N/A"?"N/A":i(t[u],f,"N/A","N/A",!0);break;case 15:r.open=t[u]=="N/A"?"N/A":i(t[u],f,"N/A","N/A",!0);break;case 16:r.high=t[u]=="N/A"?"N/A":i(t[u],f,"N/A","N/A",!0);break;case 17:r.low=t[u]=="N/A"?"N/A":i(t[u],f,"N/A","N/A",!0);break;case 19:r.news_counter_chi=t[u];break;case 20:r.news_counter_chn=t[u];break;case 21:r.news_counter_eng=t[u];break;case 22:r.highlow_Indicator=t[u];break;case 23:r.anue_news_counter_chi=t[u];break;case 24:r.anue_news_counter_chn=t[u];break;case 25:r.glh_news_counter_chi=t[u];break;case 26:r.glh_news_counter_chn=t[u]}if(parseFloat(r.news_counter_chi)>=0||parseFloat(r.anue_news_counter_chi)>=0||parseFloat(r.glh_news_counter_chi)>=0){var e=parseFloat(r.news_counter_chi),o=parseFloat(r.anue_news_counter_chi),s=parseFloat(r.glh_news_counter_chi);r.news_counter_chi=(isNaN(e)?0:e)+(isNaN(o)?0:o)+(isNaN(s)?0:s)}if(parseFloat(r.news_counter_chn)>=0||parseFloat(r.anue_news_counter_chn)>=0||parseFloat(r.glh_news_counter_chn)>=0){var e=parseFloat(r.news_counter_chn),o=parseFloat(r.anue_news_counter_chn),s=parseFloat(r.glh_news_counter_chn);r.news_counter_chn=(isNaN(e)?0:e)+(isNaN(o)?0:o)+(isNaN(s)?0:s)}}return r}function o(n,t){n.eventcountdown=function(){var r=t[0],n,i;return r!=""&&(n=r.split("#"),n.length>=2&&(i=n[1].split(";"),i.length>=2))?i[0]:""};n.eventcountdown_detail=function(){var f=t[0],r={symbol:"",desp:"",announceDate:"",event:"",yearEnd:"",type:"",particular:"",exDate:"",bookCloseDate:"",payableDate:""},u,i,n;if(f!=""&&(u=f.split("#"),u.length>=3))for(i=u[2].split(";"),n=0,n=0;n<i.length;n++)switch(n){case 0:r.symbol=i[n];break;case 1:r.desp=i[n];break;case 2:r.announceDate=i[n];break;case 3:r.event=i[n];break;case 4:r.yearEnd=i[n];break;case 5:r.type=i[n];break;case 6:r.particular=i[n];break;case 7:r.exDate=i[n];break;case 8:r.bookCloseDate=i[n];break;case 9:r.payableDate=i[n]}return r}}function h(n,t){var i="";t.find("r118").length==1?i=t.find("r118").text():t.find("r119").length==1?i=t.find("r119").text():t.find("r120").length==1&&(i=t.find("r120").text());n.eventcountdown=function(){var r=i,n,t;return r!=""&&(n=r.split("#"),n.length>=2&&(t=n[1].split(";"),t.length>=2))?t[0]:""};n.eventcountdown_detail=function(){var f=i,r={symbol:"",desp:"",announceDate:"",event:"",yearEnd:"",type:"",particular:"",exDate:"",bookCloseDate:"",payableDate:""},u,t,n;if(f!=""&&(u=f.split("#"),u.length>=3))for(t=u[2].split(";"),n=0,n=0;n<t.length;n++)switch(n){case 0:r.symbol=t[n];break;case 1:r.desp=t[n];break;case 2:r.announceDate=t[n];break;case 3:r.event=t[n];break;case 4:r.yearEnd=t[n];break;case 5:r.type=t[n];break;case 6:r.particular=t[n];break;case 7:r.exDate=t[n];break;case 8:r.bookCloseDate=t[n];break;case 9:r.payableDate=t[n]}return r}}var t=$.extend({symbol:"",url:"",token:"",group0:"",group1:"",callback:null},n),c=this;return this.url=function(){return t.url+"/g2ce/Quote/getQuote?format=text&grp0="+t.symbol+"|"+t.group0+"&grp1="+t.symbol+"|"+t.group1+""+t.token},this.changeSymbol=function(n){t.symbol=n;u(this.url())},u(this.url()),this};$.fn.AAAutoComplete=function(n){function ut(){r.Market=="USHKSHSZFXCT"&&r.DisplayType==1&&u.length>0&&(t.addClass("notrans"),t.val(u[0].symbol+"  "+u[0].desp),t.data("ls-sym",u[0].symwoex),t.data("ls-txt",t.val()),r.Select&&t.select())}function y(){r.initUSHistory&&$.ajax({url:r.USHistoryUrl,async:!0,dataType:"json",error:function(){u="";$.each(r.USHistoryCallback,function(n,t){typeof t=="function"?t.apply(this,1):""})},success:function(n){n==1||n==""?u="":(u=n,ut());r.USHistoryCallback.length>0&&$.each(r.USHistoryCallback,function(t,i){typeof i=="function"?i.apply(this,[n]):""})}});r.Market!="USHKSHSZFXCT"&&(t.autocomplete().data("autocomplete")._resizeMenu=function(){var n=this.menu.element,t=0;$.browser.msie&&parseInt($.browser.version,10)<7?(n.find("li a table").each(function(){t=Math.max(this.offsetWidth+20,t)}),n.width(t),$(n).css({"overflow-x":"hidden","overflow-y":"hidden","z-index":"-1"})):(n.outerWidth(Math.max(n.width("").outerWidth(),this.element.outerWidth())),t=n.outerWidth());this.menu.element.last().children(".ui-Result").children("a").children("table").css("width",t-20+"px")},t.autocomplete().data("autocomplete")._renderMenu=function(n,t){var i=this;$.each(t,function(t,r){if(r.id=="_search_"){var u="";u="<div class='ui-Header'><table><tr><td style='width:120px' nowrap>"+r.label+"<\/td><\/tr><\/table><\/div>";n.append(u)}else i._renderItem(n,r)})})}function p(){var n=new AAPageData.fxHistory;n.load();u=n.getHistoryJSON(r.FXSymbolNames,r.CTSymbolNames);r.Market=="FXCTHKSHSZUS"&&r.DisplayType==1&&u.length>0&&(t.addClass("notrans"),t.val(r.Lang=="eng"&&u[0].type=="FX"?u[0].symbol:u[0].symbol+"  "+u[0].desp),t.data("ls-sym",u[0].symbol),t.data("ls-txt",t.val()),r.Select&&t.select())}function w(){var n=AAUtility.GetHKSymbolListCookie(),i={keyword:n.slice(0,9).join(","),market_id:"HK",categoryid:4,lang:r.Lang};$.ajax({url:r.HKHistoryUrl,data:i,async:!0,dataType:"json",error:function(){u=""},success:function(i){var f,e;if(i==1||i=="")u="";else{if(u=[],typeof i.Stock!="undefined"&&i.Stock.length>0)for(f=0;f<n.length;f++)e=i.Stock.filter(function(t){return parseInt(t.Symbol)==parseInt(n[f])}),e!=null&&e.length>0&&(d=e[0],u.push({symbol:d.Symbol+".HK",symwoex:d.Symbol,desp:d.Desp}));r.Market=="HKSHSZUSFXCT"&&r.DisplayType==1&&u.length>0&&(t.addClass("notrans"),t.val(u[0].symbol+"  "+u[0].desp),t.data("ls-sym",u[0].symwoex),t.data("ls-txt",t.val()),r.Select&&t.select())}}})}function b(){$.ajax({url:r.CNHistoryUrl,data:{mk:"sh"},async:!0,dataType:"json",error:function(){u=""},success:function(n){if(n==1||n=="")u="";else{if(u=[],typeof n!="undefined"&&n.length>0)for(var i=0;i<n.length;i++)d=n[i],u.push({symbol:d.symbol,symwoex:d.symbol.split(".")[0],desp:d.desp});r.Market=="SHSZHKUSFXCT"&&r.DisplayType==1&&u.length>0&&(t.addClass("notrans"),t.val(u[0].symbol+"  "+u[0].desp),t.data("ls-sym",u[0].symwoex),t.data("ls-txt",t.val()),r.Select&&t.select())}}})}function l(n){var t=n;return t=t.replace(new RegExp("%u([0-9A-Fa-f]{4})","g"),"__$1__"),t=encodeURIComponent(decodeURIComponent(t)),t.replace(new RegExp("__([0-9A-Fa-f]{4})__","g"),"%u$1")}var t=this;if($(this).length!=0){var k={Name:"",Market:"HK",DisplayType:1,PositionOffset:"0 0",Url:"",HKUrl:"",CNUrl:"",USUrl:"",FXUrl:"",HKHistoryUrl:"",CNHistoryUrl:"",USHistoryUrl:"",FXHistoryUrl:"",HKMarketToolTips:"",CNMarketToolTips:"",USMarketToolTips:"",FXMarketToolTips:"",HKIconImage:"",CNIconImage:"",USIconImage:"",FXIconImage:"",CTIconImage:"",initUSHistory:!0,USHistoryCallback:[],Lang:"chi",MarketType:function(){switch(r.Market){case"HK":return"1";case"SH":return"2";case"SHHK":return"3";case"SHSZHK":return"4";case"SHSZ":return"5";case"USHKSHSZFXCT":return"6";case"US2":return"7";case"HKSHSZUSFXCT":return"8";case"HK2":return"9";case"FXCTHKSHSZUS":return"10";case"SHSZHKUSFXCT":return"11";case"SHSZ2":return"12";default:return""}},Enable:!0,ETFOnly:!1,Delay:600,Select:!0,MaxKeywordLength:40},r=$.extend(k,n),f="",e=n.bindSelectFunction,s=!1,a=!1,h="quote",o="";this.GetSymbol=function(){return u.length>0?u[0].symwoex||u[0].symbol||"":""};this.Submit=function(){c({keyCode:13,preventDefault:function(){}})};this.Market=function(n){r.Market=n;n=="US"||n=="USHKSHSZFXCT"?y():n=="FXCTHKSHSZUS"?p():n=="HKSHSZUSFXCT"?w():n=="SHSZHKUSFXCT"&&b()};this.Enable=function(n){r.Enable=n;n||t.autocomplete("close")};this.Reload=function(){this.Market(r.Market)};this.Close=function(){t.autocomplete("disable");setTimeout(function(){t.autocomplete("enable")},1e3)};this.GetHistory=function(){return u};this.BindUSHistory=function(n){typeof n!="object"||n.length<=0||typeof n[0].symbol=="undefined"||(u=n)};var v=function(n){var i=n.keyCode?n.keyCode:0;if(i==13)return(n.preventDefault(),t.autocomplete("close"),t.val()==r.HKMarketToolTips&&t.val(""),t.val()!=""&&typeof e=="function")?e.apply(this,[t.val()]):!1},g=function(n){var i=n.keyCode?n.keyCode:n.which?n.which:n.charCode;if(i==13)return(n.preventDefault(),t.autocomplete("close"),t.val()==r.USMarketToolTips&&t.val(""),t.val()!=""&&typeof e=="function")?e.apply(this,[t.val(),"quote","US"]):!1},nt=function(n){var f=n.keyCode?n.keyCode:n.which?n.which:n.charCode,l,y,p,a;if(f==13){n.preventDefault();t.val()==r.USMarketToolTips&&t.val("");var i="",o="",c="",v=$(t.autocomplete("widget")).find(".ui-state-hover"),u=v.find(".sb-item");return(u.length>0?(i=u.attr("data-symbol"),o=u.attr("data-market"),c=u.find(".sb-button.sel").attr("data-action")||""):v.hasClass("sb-search")||v.find(".sb-search").length>0?(i=t.val().trim().toUpperCase(),o="",c="advanced"):t.val()==t.data("ls-txt")?(i=t.data("ls-sym").toUpperCase(),o="US",c="quote"):(u=$(t.autocomplete("widget")).find(".sb-list").first().find(".sb-item"),u.length>0?(i=t.val().trim().toUpperCase(),o=u.attr("data-market"),c=""):(i=t.val().trim().toUpperCase(),o="",c="")),t.autocomplete("close"),i!=""&&typeof e=="function")?e.apply(this,[i,o,c]):!1}f==37||f==39?(s=!0,l=$(t.autocomplete("widget")).find(".ui-state-hover .sb-button.sel"),f==37?(y=l.prevAll(".sb-button:not(.disabled)").first(),y.length>0&&(l.removeClass("sel"),y.addClass("sel"))):(p=l.nextAll(".sb-button:not(.disabled)").first(),p.length>0&&(l.removeClass("sel"),p.addClass("sel")))):f==38||f==40?(a=$(t.autocomplete("widget")).find(".sb-button[data-action='"+h+"']"),a.length>0&&(a.addClass("sel"),a.siblings().removeClass("sel"))):s=!1},tt=function(n){var u=n.keyCode?n.keyCode:n.which?n.which:n.charCode,l,v,y,a;if(u==13){n.preventDefault();t.val()==r.FXMarketToolTips&&t.val("");var f="",o="",c="",p=$(t.autocomplete("widget")).find(".ui-state-hover"),i=p.find(".sb-item");return(i.length>0?(f=i.attr("data-symbol"),o=i.attr("data-market"),c=i.find(".sb-button.sel").attr("data-action")||""):t.val()==t.data("ls-txt")?(f=t.data("ls-sym").toUpperCase(),o="FX",c="quote"):(i=$(t.autocomplete("widget")).find(".sb-list").first().find(".sb-item"),i.length>0?(f=t.val().trim().toUpperCase(),o=i.attr("data-market"),c=""):(f=t.val().trim().toUpperCase(),o="",c="")),t.autocomplete("close"),f!=""&&typeof e=="function")?e.apply(this,[f,o,c]):!1}u==37||u==39?(s=!0,l=$(t.autocomplete("widget")).find(".ui-state-hover .sb-button.sel"),u==37?(v=l.prevAll(".sb-button:not(.disabled)").first(),v.length>0&&(l.removeClass("sel"),v.addClass("sel"))):(y=l.nextAll(".sb-button:not(.disabled)").first(),y.length>0&&(l.removeClass("sel"),y.addClass("sel")))):u==38||u==40?(a=$(t.autocomplete("widget")).find(".sb-button[data-action='"+h+"']"),a.length>0&&(a.addClass("sel"),a.siblings().removeClass("sel"))):s=!1},it=function(n){var f=n.keyCode?n.keyCode:n.which?n.which:n.charCode,l,y,p,a;if(f==13){n.preventDefault();t.val()==r.HKMarketToolTips&&t.val("");var i="",o="",c="",v=$(t.autocomplete("widget")).find(".ui-state-hover"),u=v.find(".sb-item");return(u.length>0?(i=u.attr("data-symbol"),o=u.attr("data-market"),c=u.find(".sb-button.sel").attr("data-action")||""):v.hasClass("sb-search")||v.find(".sb-search").length>0?(i=t.val().trim().toUpperCase(),o="",c="advanced"):t.val()==t.data("ls-txt")?(i=t.data("ls-sym").toUpperCase(),o="HK",c="quote"):(u=$(t.autocomplete("widget")).find(".sb-list").first().find(".sb-item"),u.length>0?(i=t.val().trim().toUpperCase(),o=u.attr("data-market"),c=""):(i=t.val().trim().toUpperCase(),o="",c="")),t.autocomplete("close"),i!=""&&typeof e=="function")?e.apply(this,[i,o,c]):!1}f==37||f==39?(s=!0,l=$(t.autocomplete("widget")).find(".ui-state-hover .sb-button.sel"),f==37?(y=l.prevAll(".sb-button:not(.disabled)").first(),y.length>0&&(l.removeClass("sel"),y.addClass("sel"))):(p=l.nextAll(".sb-button:not(.disabled)").first(),p.length>0&&(l.removeClass("sel"),p.addClass("sel")))):f==38||f==40?(a=$(t.autocomplete("widget")).find(".sb-button[data-action='"+h+"']"),a.length>0&&(a.addClass("sel"),a.siblings().removeClass("sel"))):s=!1},rt=function(n){var f=n.keyCode?n.keyCode:n.which?n.which:n.charCode,l,y,p,a;if(f==13){n.preventDefault();t.val()==r.HKMarketToolTips&&t.val("");var i="",o="",c="",v=$(t.autocomplete("widget")).find(".ui-state-hover"),u=v.find(".sb-item");return(u.length>0?(i=u.attr("data-symbol"),o=u.attr("data-market"),c=u.find(".sb-button.sel").attr("data-action")||""):v.hasClass("sb-search")||v.find(".sb-search").length>0?(i=t.val().trim().toUpperCase(),o="",c="advanced"):t.val()==t.data("ls-txt")?(i=t.data("ls-sym").toUpperCase(),o="CN",c="quote"):(u=$(t.autocomplete("widget")).find(".sb-list").first().find(".sb-item"),u.length>0?(i=t.val().trim().toUpperCase(),o=u.attr("data-market"),c=""):(i=t.val().trim().toUpperCase(),o="",c="")),t.autocomplete("close"),i!=""&&typeof e=="function")?e.apply(this,[i,o,c]):!1}f==37||f==39?(s=!0,l=$(t.autocomplete("widget")).find(".ui-state-hover .sb-button.sel"),f==37?(y=l.prevAll(".sb-button:not(.disabled)").first(),y.length>0&&(l.removeClass("sel"),y.addClass("sel"))):(p=l.nextAll(".sb-button:not(.disabled)").first(),p.length>0&&(l.removeClass("sel"),p.addClass("sel")))):f==38||f==40?(a=$(t.autocomplete("widget")).find(".sb-button[data-action='"+h+"']"),a.length>0&&(a.addClass("sel"),a.siblings().removeClass("sel"))):s=!1},c=function(n){switch(r.Market){case"SHHK":case"SHSZHK":v(n);break;case"HK":v(n);break;case"SH":case"SHSZ":v(n);break;case"US":g(n);break;case"USHKSHSZFXCT":case"US2":nt(n);break;case"FXCTHKSHSZUS":tt(n);break;case"HKSHSZUSFXCT":case"HK2":it(n);break;case"SHSZHKUSFXCT":case"SHSZ2":rt(n)}},u="";return r.Market=="USHKSHSZFXCT"?(t.unbind("keydown").bind("keydown",c).bind("click",function(){$(this).select();setTimeout(function(){$(this).val().length==0&&t.autocomplete("search")},200)}),t.unbind("keyup").bind("keyup",function(){t.val().length==0&&(f=null,t.autocomplete("search"))}),t.unbind("input").bind("input",function(){t.autocomplete("search")}),t.unbind("focusout").bind("focusout",function(){$(this).val().trim()==0&&u.length>0&&(r.DisplayType==1?(t.addClass("notrans"),t.val(u[0].symbol+"  "+u[0].desp)):t.val(u[0].symwoex))})):r.Market=="US2"?(t.unbind("keydown").bind("keydown",c).bind("click",function(){$(this).select();setTimeout(function(){$(this).val().length==0&&t.autocomplete("search")},200)}),t.unbind("keyup").bind("keyup",function(){t.val().length==0&&(f=null,t.autocomplete("search"))}),t.unbind("input").bind("input",function(){t.autocomplete("search")})):r.Market=="FXCTHKSHSZUS"?(t.unbind("keydown").bind("keydown",c).bind("click",function(){$(this).select();setTimeout(function(){$(this).val().length==0&&t.autocomplete("search")},200)}),t.unbind("keyup").bind("keyup",function(){t.val().length==0&&(f=null,t.autocomplete("search"))}),t.unbind("input").bind("input",function(){t.autocomplete("search")}),t.unbind("focusout").bind("focusout",function(){$(this).val().trim()==0&&u.length>0&&(r.DisplayType==1?(t.addClass("notrans"),t.val(r.Lang=="eng"&&u[0].type=="FX"?u[0].symbol:u[0].symbol+"  "+u[0].desp)):t.val(u[0].symbol))})):r.Market=="HKSHSZUSFXCT"?(t.unbind("keydown").bind("keydown",c).bind("click",function(){$(this).select();setTimeout(function(){$(this).val().length==0&&t.autocomplete("search")},200)}),t.unbind("keyup").bind("keyup",function(){t.val().length==0&&(f=null,t.autocomplete("search"))}),t.unbind("input").bind("input",function(){t.autocomplete("search")}),t.unbind("focusout").bind("focusout",function(){$(this).val().trim()==0&&u.length>0&&(r.DisplayType==1?(t.addClass("notrans"),t.val(u[0].symbol+"  "+u[0].desp)):t.val(u[0].symwoex))})):r.Market=="HK2"?(t.unbind("keydown").bind("keydown",c).bind("click",function(){$(this).select();setTimeout(function(){$(this).val().length==0&&t.autocomplete("search")},200)}),t.unbind("keyup").bind("keyup",function(){t.val().length==0&&(f=null,t.autocomplete("search"))}),t.unbind("input").bind("input",function(){t.autocomplete("search")})):r.Market=="SHSZHKUSFXCT"?(t.unbind("keydown").bind("keydown",c).bind("click",function(){$(this).select();setTimeout(function(){$(this).val().length==0&&t.autocomplete("search")},200)}),t.unbind("keyup").bind("keyup",function(){t.val().length==0&&(f=null,t.autocomplete("search"))}),t.unbind("input").bind("input",function(){t.autocomplete("search")}),t.unbind("focusout").bind("focusout",function(){$(this).val().trim()==0&&u.length>0&&(r.DisplayType==1?(t.addClass("notrans"),t.val(u[0].symbol+"  "+u[0].desp)):t.val(u[0].symwoex))})):r.Market=="SHSZ2"?(t.unbind("keydown").bind("keydown",c).bind("click",function(){$(this).select();setTimeout(function(){$(this).val().length==0&&t.autocomplete("search")},200)}),t.unbind("keyup").bind("keyup",function(){t.val().length==0&&(f=null,t.autocomplete("search"))}),t.unbind("input").bind("input",function(){t.autocomplete("search")})):t.unbind("keydown").bind("keydown",c).bind("click",function(){$(this).select()}),t.autocomplete({autoFocus:!0,delay:r.Delay,position:{offset:r.PositionOffset},source:function(n,e){var v,c;if(a=n.term!=""&&escape(n.term)==o,n.term.length>r.MaxKeywordLength){t.val(n.term.substr(0,r.MaxKeywordLength));e([]);return}if(r.Market=="USHKSHSZFXCT"||r.Market=="FXCTHKSHSZUS"||r.Market=="HKSHSZUSFXCT"||r.Market=="SHSZHKUSFXCT"){if(r.DisplayType==1&&(t.removeClass("notrans"),n.term==t.data("ls-txt"))){t.val("");return}if(s)return;if(a)return}else if(r.Market=="US2"||r.Market=="HK2"||r.Market=="SHSZ2"){if(s)return;if(a)return}if(o=escape(n.term),r.Market=="US")f=$.ajax({url:r.USUrl+"?term="+o+"&lang="+r.Lang,async:!0,dataType:"json",crossdomain:!0,error:function(){},success:function(n){var f=[],t;if(u!=""&&u.length>0)for(t={},t.id="_search_",t.label=r.USAutocompLatestSearches,t.label2="",t.value="",f[f.length]=t,i=0;i<u.length&&i<5;i++)t={},t.id=u[i].symbol,t.label=u[i].symbol,t.label2=u[i].desp,t.value=u[i].symwoex,f[f.length]=t;n!=null&&n!="1"&&(t={},t.id="_search_",t.label=r.USAutocompRelatedResults,t.label2="",t.value="",f[f.length]=t,$.each(n,function(n,t){var i={};i.id=t.id;i.label=t.label;i.label2=t.label2;i.value=t.value;i.type="search";f[f.length]=i}));t={};t.id="_result_";t.label=r.USAutocompViewAllResult;t.label2="";t.value=o;f[f.length]=t;e(f)}});else if(r.Market=="USHKSHSZFXCT")if(h="quote",o.trim().length==0)if(v=[],u!=""&&u.length>0){for(v=[],c={},c.id="_top_",c.label=r.USAutocompLatestSearchUSQ,c.label2=r.USAutocompWebsiteLocation,c.value="",v[v.length]=c,i=0;i<u.length&&i<9;i++)c={},c.id=u[i].symbol,c.label=u[i].symbol,c.label2=u[i].desp,c.value=u[i].symwoex,c.value2="US",v[v.length]=c;e(v)}else v=[],c={},c.id="_hidden_",c.label="",c.label2="",c.value="",c.value2="",v[v.length]=c,e(v),t.autocomplete("widget").css("visibility","hidden");else t.autocomplete("widget").css("visibility","visible"),f!=null&&f!=""&&f.abort(),f=$.ajax({url:r.USUrl+"?t="+r.MarketType()+"&term="+l(o.toLowerCase())+"&lang="+r.Lang,async:!0,dataType:"json",crossdomain:!0,error:function(){},success:function(t,i,u){var s=[],o={};o.id="_top_";o.label=r.USAutocompSuggestedList;o.label2=r.USAutocompWebsiteLocation;o.value="";s[s.length]=o;t!=null&&t!="1"&&t.length>0?($.each(t,function(n,t){var i={};i.id=t.s;i.label=t.s+(t.ex!=""?"."+t.ex:"");i.label2=t.n;i.value=t.s;i.value2=t.m;s[s.length]=i}),o={},o.id="_bottom_",o.label=r.USAutocompAdvancedSearch,o.label2="",o.value=n.term,o.value2="advanced",s[s.length]=o):(o={},o.id="_bottom2_",o.label=r.USAutocompNoRelatedInformation,o.label2=r.USAutocompAdvancedSearch,o.value=n.term,o.value2="advanced",s[s.length]=o);u===f&&e(s)}});else if(r.Market=="US2")h="quote",o.trim().length==0?(v=[],c={},c.id="_hidden_",c.label="",c.label2="",c.value="",c.value2="",v[v.length]=c,e(v),t.autocomplete("widget").css("visibility","hidden")):(t.autocomplete("widget").css("visibility","visible"),f!=null&&f!=""&&f.abort(),f=$.ajax({url:r.USUrl+"?t="+r.MarketType()+"&term="+l(o.toLowerCase())+"&lang="+r.Lang,async:!0,dataType:"json",crossdomain:!0,error:function(){},success:function(n,t,i){var u=[],r={};r.id="_hidden_";r.label="";r.label2="";r.value="";r.value2="";u[u.length]=r;n!=null&&n!="1"&&n.length>0&&$.each(n,function(n,t){var i={};i.id=t.s;i.label=t.s+(t.ex!=""?"."+t.ex:"");i.label2=t.n;i.value=t.s;i.value2=t.m;u[u.length]=i});i===f&&e(u)}}));else if(r.Market=="FXCTHKSHSZUS")if(h="quote",o.trim().length==0)if(v=[],u!=""&&u.length>0){for(v=[],c={},c.id="_top_",c.label=r.FXAutocompLatestSearchFX,c.label2=r.FXAutocompWebsiteLocation,c.value="",v[v.length]=c,i=0;i<u.length&&i<9;i++)c={},c.id=u[i].symbol,c.label=u[i].symbol,c.label2=u[i].desp,c.value=u[i].symbol,c.value2=u[i].type,v[v.length]=c;e(v)}else v=[],c={},c.id="_hidden_",c.label="",c.label2="",c.value="",c.value2="",v[v.length]=c,e(v),t.autocomplete("widget").css("visibility","hidden");else t.autocomplete("widget").css("visibility","visible"),f!=null&&f!=""&&f.abort(),f=$.ajax({url:r.FXUrl+"?t="+r.MarketType()+"&term="+l(o.toLowerCase())+"&lang="+r.Lang,async:!0,dataType:"json",crossdomain:!0,error:function(){},success:function(t,i,u){var s=[],o={};o.id="_top_";o.label=r.FXAutocompSuggestedList;o.label2=r.FXAutocompWebsiteLocation;o.value="";s[s.length]=o;t!=null&&t!="1"&&t.length>0?$.each(t,function(n,t){var i={};i.id=t.s;i.label=t.s+(t.ex!=""?"."+t.ex:"");i.label2=t.n;i.value=t.s;i.value2=t.m;s[s.length]=i}):(o={},o.id="_bottom2_",o.label=r.FXAutocompNoRelatedInformationFX,o.label2="",o.value=n.term,o.value2="",s[s.length]=o);u===f&&e(s)}});else if(r.Market=="HKSHSZUSFXCT")if(h="quote",o.trim().length==0)if(v=[],u!=""&&u.length>0){for(v=[],c={},c.id="_top_",c.label=r.HKAutocompLatestSearchHK,c.label2=r.HKAutocompWebsiteLocation,c.value="",v[v.length]=c,i=0;i<u.length&&i<9;i++)c={},c.id=u[i].symbol,c.label=u[i].symbol,c.label2=u[i].desp,c.value=u[i].symwoex,c.value2="HK",v[v.length]=c;e(v)}else v=[],c={},c.id="_hidden_",c.label="",c.label2="",c.value="",c.value2="",v[v.length]=c,e(v),t.autocomplete("widget").css("visibility","hidden");else t.autocomplete("widget").css("visibility","visible"),f!=null&&f!=""&&f.abort(),f=$.ajax({url:r.HKUrl+"?t="+r.MarketType()+"&term="+l(o.toLowerCase())+"&lang="+r.Lang,async:!0,dataType:"json",crossdomain:!0,error:function(){},success:function(t,i,u){var s=[],o={};o.id="_top_";o.label=r.HKAutocompSuggestedList;o.label2=r.HKAutocompWebsiteLocation;o.value="";s[s.length]=o;t!=null&&t!="1"&&t.length>0?($.each(t,function(n,t){var i={};i.id=t.s;i.label=t.s+(t.ex!=""?"."+t.ex:"");i.label2=t.n;i.value=t.s;i.value2=t.m;s[s.length]=i}),o={},o.id="_bottom_",o.label=r.HKAutocompAdvancedSearch,o.label2="",o.value=n.term,o.value2="advanced",s[s.length]=o):(o={},o.id="_bottom2_",o.label=r.HKAutocompNoRelatedInformation,o.label2=r.HKAutocompAdvancedSearch,o.value=n.term,o.value2="advanced",s[s.length]=o);u===f&&e(s)}});else if(r.Market=="HK2")h="quote",o.trim().length==0?(v=[],c={},c.id="_hidden_",c.label="",c.label2="",c.value="",c.value2="",v[v.length]=c,e(v),t.autocomplete("widget").css("visibility","hidden")):(t.autocomplete("widget").css("visibility","visible"),f!=null&&f!=""&&f.abort(),f=$.ajax({url:r.HKUrl+"?t="+r.MarketType()+"&term="+l(o.toLowerCase())+"&lang="+r.Lang,async:!0,dataType:"json",crossdomain:!0,error:function(){},success:function(n,t,i){var u=[],r={};r.id="_hidden_";r.label="";r.label2="";r.value="";r.value2="";u[u.length]=r;n!=null&&n!="1"&&n.length>0&&$.each(n,function(n,t){var i={};i.id=t.s;i.label=t.s+(t.ex!=""?"."+t.ex:"");i.label2=t.n;i.value=t.s;i.value2=t.m;u[u.length]=i});i===f&&e(u)}}));else if(r.Market=="SHSZHKUSFXCT")if(h="quote",o.trim().length==0)if(v=[],u!=""&&u.length>0){for(v=[],c={},c.id="_top_",c.label=r.CNAutocompLatestSearchCN,c.label2=r.CNAutocompWebsiteLocation,c.value="",v[v.length]=c,i=0;i<u.length&&i<9;i++)c={},c.id=u[i].symbol,c.label=u[i].symbol,c.label2=u[i].desp,c.value=u[i].symwoex,c.value2="CN",v[v.length]=c;e(v)}else v=[],c={},c.id="_hidden_",c.label="",c.label2="",c.value="",c.value2="",v[v.length]=c,e(v),t.autocomplete("widget").css("visibility","hidden");else t.autocomplete("widget").css("visibility","visible"),f!=null&&f!=""&&f.abort(),f=$.ajax({url:r.CNUrl+"?t="+r.MarketType()+"&term="+l(o.toLowerCase())+"&lang="+r.Lang,async:!0,dataType:"json",crossdomain:!0,error:function(){},success:function(t,i,u){var s=[],o={};o.id="_top_";o.label=r.CNAutocompSuggestedList;o.label2=r.CNAutocompWebsiteLocation;o.value="";s[s.length]=o;t!=null&&t!="1"&&t.length>0?($.each(t,function(n,t){var i={};i.id=t.s;i.label=t.s+(t.ex!=""?"."+t.ex:"");i.label2=t.n;i.value=t.s;i.value2=t.m;s[s.length]=i}),o={},o.id="_bottom_",o.label=r.CNAutocompAdvancedSearch,o.label2="",o.value=n.term,o.value2="advanced",s[s.length]=o):(o={},o.id="_bottom2_",o.label=r.CNAutocompNoRelatedInformation,o.label2=r.CNAutocompAdvancedSearch,o.value=n.term,o.value2="advanced",s[s.length]=o);u===f&&e(s)}});else r.Market=="SHSZ2"?(h="quote",o.trim().length==0?(v=[],c={},c.id="_hidden_",c.label="",c.label2="",c.value="",c.value2="",v[v.length]=c,e(v),t.autocomplete("widget").css("visibility","hidden")):(t.autocomplete("widget").css("visibility","visible"),f!=null&&f!=""&&f.abort(),f=$.ajax({url:r.CNUrl+"?t="+r.MarketType()+"&term="+l(o.toLowerCase())+"&lang="+r.Lang,async:!0,dataType:"json",crossdomain:!0,error:function(){},success:function(n,t,i){var u=[],r={};r.id="_hidden_";r.label="";r.label2="";r.value="";r.value2="";u[u.length]=r;n!=null&&n!="1"&&n.length>0&&$.each(n,function(n,t){var i={};i.id=t.s;i.label=t.s+(t.ex!=""?"."+t.ex:"");i.label2=t.n;i.value=t.s;i.value2=t.m;u[u.length]=i});i===f&&e(u)}}))):f=$.ajax({url:r.Url+"?t="+r.MarketType()+"&term="+o+"&lang="+r.Lang+"&ex=1"+(r.ETFOnly?"&etf=1":""),async:!0,dataType:"json",crossdomain:!0,error:function(){},success:function(n,t,i){i===f&&e(n)}})},search:function(n){var i,u;if(a=$(n.target).val()!=""&&escape($(n.target).val())==o,!s&&!a&&$(t.autocomplete("widget")).find(".load").length==0){var f=!1,l=!1,e="",h="",c=!0;switch(r.Market){case"USHKSHSZFXCT":f=!0;c=!0;e=r.USAutocompSuggestedList;h=r.USAutocompWebsiteLocation;break;case"FXCTHKSHSZUS":f=!0;c=!0;e=r.FXAutocompSuggestedList;h=r.FXAutocompWebsiteLocation;break;case"HKSHSZUSFXCT":f=!0;c=!0;e=r.HKAutocompSuggestedList;h=r.HKAutocompWebsiteLocation;break;case"SHSZHKUSFXCT":f=!0;c=!0;e=r.CNAutocompSuggestedList;h=r.CNAutocompWebsiteLocation;break;case"US2":l=!0;break;case"HK2":l=!0;break;case"SHSZ2":l=!0}if(f)for($(t.autocomplete("widget")).find("li").remove(),i="",i+='<div class="sb-head">',i+='<div class="sb-label float_l">'+e+"<\/div>",i+='<div class="sb-label float_r">'+(r.DisplayType==1?h:"")+"<\/div>",i+='<div class="clear"><\/div>',i+="<\/div>",$(t.autocomplete("widget")).append('<li class="sb-list">'+i+"<\/li>"),u=0;u<9;u++)i="",i+='<div class="float_l sb-item load '+(r.DisplayType==2?"v2":"v1")+'">',c&&(i+='<div class="float_l sb-flag"><\/div>'),i+='<div class="float_l sb-stock">',i+='<div class="cls sb-name"><\/div>',i+='<div class="cls sb-symbol"><\/div>',i+="<\/div>",r.DisplayType==1&&(i+='<div class="float_r sb-button-group">',i+='<div class="float_l sb-button"><\/div>',i+='<div class="float_l sb-sep"><\/div>',i+='<div class="float_l sb-button"><\/div>',i+='<div class="float_l sb-sep"><\/div>',i+='<div class="float_l sb-button"><\/div>',i+='<div class="clear"><\/div>',i+="<\/div>"),i+='<div class="clear"><\/div>',i+="<\/div>",i+='<div class="clear"><\/div>',$(t.autocomplete("widget")).append('<li class="sb-list">'+i+"<\/li>");else if(l)for($(t.autocomplete("widget")).find("li").remove(),i="",u=0;u<10;u++)i="",i+='<div class="float_l sb-item load v1">',i+='<div class="float_l sb-stock c1">',i+='<div class="cls sb-symbol"><\/div>',i+="<\/div>",i+='<div class="float_l sb-stock c2">',i+='<div class="cls sb-name"><\/div>',i+="<\/div>",i+='<div class="float_r sb-button-group">',i+='<div class="float_l sb-button"><\/div>',i+='<div class="clear"><\/div>',i+="<\/div>",i+='<div class="clear"><\/div>',i+="<\/div>",i+='<div class="clear"><\/div>',$(t.autocomplete("widget")).append('<li class="sb-list">'+i+"<\/li>")}},select:function(n,i){if(r.Market=="USHKSHSZFXCT"){var u=$(t.autocomplete("widget")).find(".ui-state-hover .sb-item"),f=i.item.value2=="advanced"?t.val().toUpperCase().trim():i.item.value.toUpperCase(),o=i.item.value2=="advanced"?"":i.item.value2,s=u.length>0?u.find(".sb-button.sel").data("action")||"":i.item.value2=="advanced"?i.item.value2:"quote";if(typeof e=="function")return e.apply(this,[f,o,s])}else if(r.Market=="US2"){var u=$(t.autocomplete("widget")).find(".ui-state-hover .sb-item"),f=u.length>0?i.item.value.toUpperCase():t.val().toUpperCase().trim(),o=u.length>0?i.item.value2:"US",s=u.length>0?u.find(".sb-button.sel").data("action")||"":"quote";if(typeof e=="function")return e.apply(this,[f,o,s])}else if(r.Market=="FXCTHKSHSZUS"){var u=$(t.autocomplete("widget")).find(".ui-state-hover .sb-item"),f=i.item.value.toUpperCase(),o=i.item.value2,s=u.length>0?u.find(".sb-button.sel").data("action")||"":"quote";if(typeof e=="function")return e.apply(this,[f,o,s])}else if(r.Market=="HKSHSZUSFXCT"){var u=$(t.autocomplete("widget")).find(".ui-state-hover .sb-item"),f=i.item.value2=="advanced"?t.val().toUpperCase().trim():i.item.value.toUpperCase(),o=i.item.value2=="advanced"?"":i.item.value2,s=u.length>0?u.find(".sb-button.sel").data("action")||"":i.item.value2=="advanced"?i.item.value2:"quote";if(typeof e=="function")return e.apply(this,[f,o,s])}else if(r.Market=="HK2"){var u=$(t.autocomplete("widget")).find(".ui-state-hover .sb-item"),f=u.length>0?i.item.value.toUpperCase():t.val().toUpperCase().trim(),o=u.length>0?i.item.value2:"HK",s=u.length>0?u.find(".sb-button.sel").data("action")||"":"quote";if(typeof e=="function")return e.apply(this,[f,o,s])}else if(r.Market=="SHSZHKUSFXCT"){var u=$(t.autocomplete("widget")).find(".ui-state-hover .sb-item"),f=i.item.value2=="advanced"?t.val().toUpperCase().trim():i.item.value.toUpperCase(),o=i.item.value2=="advanced"?"":i.item.value2,s=u.length>0?u.find(".sb-button.sel").data("action")||"":i.item.value2=="advanced"?i.item.value2:"quote";if(typeof e=="function")return e.apply(this,[f,o,s])}else if(r.Market=="SHSZ2"){var u=$(t.autocomplete("widget")).find(".ui-state-hover .sb-item"),f=u.length>0?i.item.value.toUpperCase():t.val().toUpperCase().trim(),o=u.length>0?i.item.value2:"CN",s=u.length>0?u.find(".sb-button.sel").data("action")||"":"quote";if(typeof e=="function")return e.apply(this,[f,o,s])}else if(typeof e=="function")return e.apply(this,[i.item.value])},open:function(){var n=$("#"+r.Name+" .ui-autocomplete");n.width(n.width()+100);$("#hkinsideframe").css("width",n.width()+10);$("#hkinsideframe").css("height",n.css("height"));$("#hkinsideframe").css("top",n.css("top"));$("#hkinsideframe").css("left",n.css("left"));$("#hkinsideframe").css("display","block")},close:function(){$("#hkinsideframe").css("display","none");r.Market=="USHKSHSZFXCT"?$(this).val().trim()==0&&u.length>0&&(r.DisplayType==1?(t.addClass("notrans"),t.val(u[0].symbol+"  "+u[0].desp)):t.val(u[0].symwoex),t.blur()):r.Market=="FXCTHKSHSZUS"?$(this).val().trim()==0&&u.length>0&&(r.DisplayType==1?(t.addClass("notrans"),t.val(r.Lang=="eng"&&u[0].type=="FX"?u[0].symbol:u[0].symbol+"  "+u[0].desp)):t.val(u[0].symbol),t.blur()):r.Market=="HKSHSZUSFXCT"?$(this).val().trim()==0&&u.length>0&&(r.DisplayType==1?(t.addClass("notrans"),t.val(u[0].symbol+"  "+u[0].desp)):t.val(u[0].symwoex),t.blur()):r.Market=="SHSZHKUSFXCT"&&$(this).val().trim()==0&&u.length>0&&(r.DisplayType==1?(t.addClass("notrans"),t.val(u[0].symbol+"  "+u[0].desp)):t.val(u[0].symwoex),t.blur())},create:function(){typeof r.Class!="undefined"&&t.autocomplete("widget").addClass(r.Class);r.Market=="USHKSHSZFXCT"?(t.autocomplete("option","minLength",0),y()):r.Market=="US2"?t.autocomplete("option","minLength",0):r.Market=="FXCTHKSHSZUS"?(t.autocomplete("option","minLength",0),p()):r.Market=="HKSHSZUSFXCT"?(t.autocomplete("option","minLength",0),w()):r.Market=="HK2"?t.autocomplete("option","minLength",0):r.Market=="SHSZHKUSFXCT"?(t.autocomplete("option","minLength",0),b()):r.Market=="SHSZ2"&&t.autocomplete("option","minLength",0)}}).data("autocomplete")._renderItem=function(n,i){var s=!1,a=!1,e="",h="",o="",c=!0,l=!0,v,u,f,y,p;switch(r.Market){case"USHKSHSZFXCT":s=!0;c=!0;l=!0;e=r.USAutocompQuote;h=r.USAutocompChart;o=r.USAutocompNews;break;case"FXCTHKSHSZUS":s=!0;c=!0;l=!1;e=r.FXAutocompQuote;h=r.FXAutocompChart;o=r.FXAutocompNews;break;case"HKSHSZUSFXCT":s=!0;c=!0;l=!0;e=r.HKAutocompQuote;h=r.HKAutocompChart;o=r.HKAutocompNews;break;case"SHSZHKUSFXCT":s=!0;c=!0;l=!0;e=r.CNAutocompQuote;h=r.CNAutocompChart;o=r.CNAutocompNews;break;case"US2":a=!0;e=r.USAutocompQuote;break;case"HK2":a=!0;e=r.HKAutocompQuote;break;case"SHSZ2":a=!0;e=r.CNAutocompQuote}if(s){if(i.id=="_top_")return u="",u+='<div class="float_l sb-label">'+i.label+"<\/div>",u+='<div class="float_r sb-label">'+(r.DisplayType==1?i.label2:"")+"<\/div>",u+='<div class="clear"><\/div>',$('<li class="sb-head"><\/li>').data("item.autocomplete",i).append(u).appendTo(n);if(i.id=="_bottom_")return u="",u+="<a>",u+='<div class="sb-search">'+i.label+"<\/div>",u+="<\/a>",$('<li class="sb-foot"><\/li>').data("item.autocomplete",i).append(u).appendTo(n);if(i.id=="_bottom2_")return u="",u+="",u+='<div class="float_l sb-msg">'+i.label+"<\/div>",u+=l?'<a class="float_r sb-search">'+i.label2+"<\/a>":'<a class="float_r sb-search" style="visibility:hidden;">'+i.label2+"<\/a>",u+='<div class="clear"><\/div>',u+="",$('<li class="sb-foot2"><\/li>').data("item.autocomplete",i).append(u).appendTo(n);if(i.id=="_hidden_")return u="",u+="<a><\/a>",$("<li><\/li>").data("item.autocomplete",i).append(u).appendTo(n);if(v=AAUtility.IsEngName(i.label2)?"eng":"chi",u="",u+="<a>",u+='<div class="float_l sb-item '+(r.DisplayType==2?"v2":"v1")+'" data-symbol="'+i.value+'" data-market="'+i.value2+'">',c){u+='<div class="float_l sb-flag">';switch(i.value2){case"HK":u+='<img src="'+r.HKIconImage+'">';break;case"CN":u+='<img src="'+r.CNIconImage+'">';break;case"US":u+='<img src="'+r.USIconImage+'">';break;case"FX":u+='<img src="'+r.FXIconImage+'">';break;case"CT":u+='<img src="'+r.CTIconImage+'">'}u+="<\/div>"}u+='<div class="float_l sb-stock">';switch(i.value2){case"US":case"CT":u+='<div class="cls sb-name '+v+'">'+(this.term==""?"<span>"+i.label2+"<\/span>":i.label2.replace(new RegExp("^"+$.ui.autocomplete.escapeRegex(this.term),"i"),"<span>$&<\/span>").replace(new RegExp("(-| )("+$.ui.autocomplete.escapeRegex(this.term)+")","gi"),"$1<span>$2<\/span>"))+"<\/div>";break;case"HK":case"CN":case"FX":default:u+=r.Lang=="eng"?'<div class="cls sb-name '+v+'">'+(this.term==""?"<span>"+i.label2+"<\/span>":i.label2.replace(new RegExp("^"+$.ui.autocomplete.escapeRegex(this.term),"i"),"<span>$&<\/span>").replace(new RegExp("(-| )("+$.ui.autocomplete.escapeRegex(this.term)+")","gi"),"$1<span>$2<\/span>"))+"<\/div>":'<div class="cls sb-name '+v+'">'+(this.term==""?"<span>"+i.label2+"<\/span>":i.label2.replace(new RegExp($.ui.autocomplete.escapeRegex(this.term),"gi"),"<span>$&<\/span>"))+"<\/div>"}if(u+='<div class="cls sb-symbol">'+i.label+"<\/div>",u+="<\/div>",r.DisplayType==1){u+='<div class="float_r sb-button-group">';u+='<div class="float_l sb-button sel" data-action="quote">'+e+"<\/div>";u+='<div class="float_l sb-sep"><\/div>';u+='<div class="float_l sb-button" data-action="chart">'+h+"<\/div>";switch(i.value2){case"HK":case"CN":case"US":u+='<div class="float_l sb-sep"><\/div>';u+='<div class="float_l sb-button" data-action="news">'+o+"<\/div>";break;case"FX":case"CT":u+='<div class="float_l sb-sep"><\/div>';u+='<div class="float_l sb-button disabled" data-action="">'+o+"<\/div>"}u+='<div class="clear"><\/div>';u+="<\/div>"}return u+='<div class="clear"><\/div>',u+="<\/div>",u+='<div class="clear"><\/div>',u+="<\/a>",f=$('<li class="sb-list"><\/li>').data("item.autocomplete",i).append(u).appendTo(n),f.find(".sb-button:not(.disabled)").bind("mouseover",function(){$(this).siblings().removeClass("sel");$(this).addClass("sel")}),f.find(".sb-button.disabled").bind("mouseover",function(){$(this).siblings(".sb-button:not(.disabled)").first().siblings().removeClass("sel");$(this).siblings(".sb-button:not(.disabled)").first().addClass("sel")}),f.bind("mouseover",function(n){$(n.target).hasClass("sb-button-group")||$(n.target).parent().hasClass("sb-button-group")||($(this).find(".sb-button:not(.disabled)").first().siblings().removeClass("sel"),$(this).find(".sb-button:not(.disabled)").first().addClass("sel"))}),f}if(a){if(i.id=="_hidden_")return t.autocomplete("widget").css("visibility","hidden"),u="",u+="<a><\/a>",$("<li><\/li>").data("item.autocomplete",i).append(u).appendTo(n);t.autocomplete("widget").css("visibility","visible");u="";u+="<a>";u+='<div class="float_l sb-item v1" data-symbol="'+i.value+'" data-market="'+i.value2+'">';u+='<div class="float_l sb-stock c1">';u+='<div class="cls sb-symbol">'+i.label+"<\/div>";u+="<\/div>";u+='<div class="float_l sb-stock c2">';switch(i.value2){case"US":case"CT":u+='<div class="cls sb-name">'+(this.term==""?"<span>"+i.label2+"<\/span>":i.label2.replace(new RegExp("^"+$.ui.autocomplete.escapeRegex(this.term),"i"),"<span>$&<\/span>").replace(new RegExp("(-| )("+$.ui.autocomplete.escapeRegex(this.term)+")","gi"),"$1<span>$2<\/span>"))+"<\/div>";break;case"HK":case"CN":case"FX":default:u+=r.Lang=="eng"?'<div class="cls sb-name">'+(this.term==""?"<span>"+i.label2+"<\/span>":i.label2.replace(new RegExp("^"+$.ui.autocomplete.escapeRegex(this.term),"i"),"<span>$&<\/span>").replace(new RegExp("(-| )("+$.ui.autocomplete.escapeRegex(this.term)+")","gi"),"$1<span>$2<\/span>"))+"<\/div>":'<div class="cls sb-name">'+(this.term==""?"<span>"+i.label2+"<\/span>":i.label2.replace(new RegExp($.ui.autocomplete.escapeRegex(this.term),"gi"),"<span>$&<\/span>"))+"<\/div>"}return u+="<\/div>",u+='<div class="float_r sb-button-group">',u+='<div class="float_l sb-button sel" data-action="quote">'+e+"<\/div>",u+='<div class="clear"><\/div>',u+="<\/div>",u+='<div class="clear"><\/div>',u+="<\/div>",u+='<div class="clear"><\/div>',u+="<\/a>",f=$('<li class="sb-list"><\/li>').data("item.autocomplete",i).append(u).appendTo(n),f.find(".sb-button").bind("mouseover",function(){$(this).siblings().removeClass("sel");$(this).addClass("sel")}),f.bind("mouseover",function(n){$(n.target).hasClass("sb-button-group")||$(n.target).parent().hasClass("sb-button-group")||($(this).find(".sb-button").first().siblings().removeClass("sel"),$(this).find(".sb-button").first().addClass("sel"))}),f}return r.Market=="US"?i.id=="_result_"?$("<li class='ui-Result'><\/li>").data("item.autocomplete",i).append("<a><table><tr><td nowrap><div class='float_r' style='padding-right:12px;background:url(\""+r.USArrowImage+"\") no-repeat center right'>"+i.label+"<\/div><\/td><\/tr><\/table><\/a>").appendTo(n):(y=new RegExp("^"+this.term.toUpperCase()),p=i.type=="search"?i.label.replace(y,"<span style='color:red'>"+this.term.toUpperCase()+"<\/span>"):i.label,$("<li><\/li>").data("item.autocomplete",i).append("<a><table><tr><td style='width:110px'>"+p+"<\/td><td nowrap>"+i.label2+"<\/td><\/tr><\/table><\/a>").appendTo(n)):$("<li><\/li>").data("item.autocomplete",i).append("<a><table><tr><td style='width:100px' nowrap>"+i.label+"."+i.ex+"<\/td><td nowrap>"+i.label2+"<\/td><\/table><\/a>").appendTo(n)},this}};$.fn.WeChatShare=function(n){function r(){var n=$("#AAWeChatShare");n.length==0&&(n=$("<div id='AAWeChatShare'><\/div>"),n.css("width",t.width+"px"));$("body").append(n)}var i=this,t=$.extend({url:"",width:"380",title:"",footer:"",escaped:!1},n);return r(),this.ShowLayout=function(n,r){var c=$(r).attr("wechat-share"),u=$("<div/>"),e,f,l,o,s,h;c!=""&&($("#AAWeChatShare").html(""),$("#AAWeChatShare").css("position","absolute"),$("#AAWeChatShare").css("top",n.pageY+20),$("#AAWeChatShare").css("left",n.pageX),$("#AAWeChatShare").css("z-index",999),$("#AAWeChatShare").css({"background-color":"#fff",padding:"3px 3px 0px 3px",border:"solid 1px #CDCDCD",color:"black"}),t.width!=""&&($("#AAWeChatShare").css("width",t.width),t.position!=""&&(t.position=="E"?$("#AAWeChatShare").css("left",n.pageX):t.position=="W"&&$("#AAWeChatShare").css("left",n.pageX-parseInt(t.width.replace("px",""))))),e=u.clone(),e.css({height:"44px","line-height":"44px","text-align":"left","padding-left":"10px","font-size":"15px","font-weight":"bold"}),e.html(t.title),$("#AAWeChatShare").append(e),f=u.clone(),f.attr("id","AAWeChatShare_close"),f.css({height:"15px",width:"16px","line-height":"17px","text-align":"center","font-size":"12px",position:"absolute",top:"10px",right:"10px",background:"#ffffff",background:"url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPGxpbmVhckdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIwJSIgeTI9IjEwMCUiPgogICAgPHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2ZmZmZmZiIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiNlYWVhZWEiIHN0b3Atb3BhY2l0eT0iMSIvPgogIDwvbGluZWFyR3JhZGllbnQ+CiAgPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEiIGhlaWdodD0iMSIgZmlsbD0idXJsKCNncmFkLXVjZ2ctZ2VuZXJhdGVkKSIgLz4KPC9zdmc+)",background:"-moz-linear-gradient(top,  #ffffff 0%, #eaeaea 100%)",background:"-webkit-gradient(linear, left top, left bottom, color-stop(0%,#ffffff), color-stop(100%,#eaeaea))",background:"-webkit-linear-gradient(top,  #ffffff 0%,#eaeaea 100%)",background:"-o-linear-gradient(top,  #ffffff 0%,#eaeaea 100%)",background:"-ms-linear-gradient(top,  #ffffff 0%,#eaeaea 100%)",background:"linear-gradient(to bottom,  #ffffff 0%,#eaeaea 100%)",filter:"progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#eaeaea',GradientType=0 )",border:"solid 1px #CCCCCC",color:"#717171",cursor:"pointer"}),f.html("X"),$("#AAWeChatShare").append(f),l=u.clone(),l.css({background:"#fcfdfd",background:"url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPGxpbmVhckdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIxMDAlIiB5Mj0iMCUiPgogICAgPHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2ZjZmRmZCIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjUxJSIgc3RvcC1jb2xvcj0iI2Q3ZDdkNyIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiNmY2ZkZmQiIHN0b3Atb3BhY2l0eT0iMSIvPgogIDwvbGluZWFyR3JhZGllbnQ+CiAgPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEiIGhlaWdodD0iMSIgZmlsbD0idXJsKCNncmFkLXVjZ2ctZ2VuZXJhdGVkKSIgLz4KPC9zdmc+)",background:"-moz-linear-gradient(left,  #fcfdfd 0%, #d7d7d7 51%, #fcfdfd 100%)",background:"-webkit-gradient(linear, left top, right top, color-stop(0%,#fcfdfd), color-stop(51%,#d7d7d7), color-stop(100%,#fcfdfd))",background:"-webkit-linear-gradient(left,  #fcfdfd 0%,#d7d7d7 51%,#fcfdfd 100%)",background:"-o-linear-gradient(left,  #fcfdfd 0%,#d7d7d7 51%,#fcfdfd 100%)",background:"-ms-linear-gradient(left,  #fcfdfd 0%,#d7d7d7 51%,#fcfdfd 100%)",background:"linear-gradient(to right,  #fcfdfd 0%,#d7d7d7 51%,#fcfdfd 100%)",filter:"progid:DXImageTransform.Microsoft.gradient( startColorstr='#fcfdfd', endColorstr='#fcfdfd',GradientType=1 )",height:"1px"}),$("#AAWeChatShare").append(l),o=u.clone(),o.css({"text-align":"center",padding:"20px"}),s=$("<img />"),s.css({height:"200px",width:"200px"}),s.attr("src","http://chart.apis.google.com/chart?cht=qr&chs=200x200&chld=H|0&chl="+(t.escaped?c:escape(c))),o.append(s),$("#AAWeChatShare").append(o),h=u.clone(),h.css({height:"50px","line-height":"20px","text-align":"left",padding:"0px 10px","font-size":"12px",color:"#5e5e5e"}),h.html(t.footer),$("#AAWeChatShare").append(h),$("#AAWeChatShare").show(),$("#AAWeChatShare_close").unbind("click").bind("click",function(){i.HideLayout()}))},this.HideLayout=function(){$("#AAWeChatShare").html("");$("#AAWeChatShare").hide()},this.each(function(){var n=$(this);$(this).bind("click",function(t){i.ShowLayout(t,n)});$(this).bind("mouseout",function(){})})};$.fn.mask=function(n){function u(){var n=$("#AAMask");n.length==0&&(n=$("<div id='AAMask'><\/div>"),$("body").prepend(n),$(window).resize(function(){r()}),t.enableCloseOnClickMask&&n.bind("click",function(){i.Hide()}))}function r(){var f=$(window).width(),e=$(window).height(),h=$.extend({"background-color":"#000",position:"fixed",top:0,left:0,"z-index":900,width:f,height:e,opacity:.4,filter:"alpha(opacity=40)"},t.style),n,o,s,r,u;$("#AAMask").css(h);t.frameName!=""&&(n=$("#"+t.frameName),n&&(o=n.width(),s=n.height(),t.dynamicScrollFrame?(r=e,u=f):(r=i.height(),u=i.width()),n.css($.extend({top:(r-s)/2,left:(u-o)/2},t.frameStyle))))}var i=this,t=$.extend({frameName:"",closeBtnClass:"",style:{},frameStyle:{},dynamicScrollFrame:!0,enableCloseOnClickMask:!0},n);return u(),this.Show=function(){var n,u;r();$("#AAMask").show();t.frameName!=""&&(n=$("#"+t.frameName),n&&(n.insertAfter($("#AAMask")),n.show(),t.closeBtnClass!=""&&(u=n.find("."+t.closeBtnClass),u&&u.unbind("click").bind("click",function(){i.Hide()}))))},this.Hide=function(){if(t.frameName!=""){var n=$("#"+t.frameName);n&&n.hide()}$("#AAMask").hide()},this};$.fn.cusBigToolTip=function(){function i(n){switch(n){case"S":return{width:0,height:0,"border-left":"6px solid transparent","border-right":"6px solid transparent","border-bottom":"8px solid white"};case"N":return{width:0,height:0,"border-left":"6px solid transparent","border-right":"6px solid transparent","border-top":"8px solid white"}}return{}}function r(){var n,t;$("#ui-tooltip-fix").length==0&&(n=$("<div />"),n.attr("id","ui-tooltip-fix"),n.css("position","absolute"),n.css("display","none"),n.addClass("font-c"),t=$("<div />"),t.addClass("ui-tooltip-fix-msg"),n.append(t),$("body").append(n))}function u(r){var f,u;$("#ui-tooltip-fix .ui-tooltip-fix-msg").text(r);$("#ui-tooltip-fix .ui-tooltip-fix-arrow").remove();f=$("#ui-tooltip-fix").outerWidth();u=$("<div />");u.addClass("ui-tooltip-fix-arrow");n.indexOf("E")>=0?u.css({"margin-left":20}):n.indexOf("W")>=0&&u.css({"margin-left":f-20});n.indexOf("S")>=0?(u.css(i("S")),$("#ui-tooltip-fix").prepend(u)):n.indexOf("N")>=0&&(u.css(i("N")),$("#ui-tooltip-fix").append(u));var o=$("#ui-tooltip-fix").outerHeight(),s=t.outerHeight(),e=t.outerWidth();n.indexOf("S")>=0?$("#ui-tooltip-fix").css("top",t.offset().top+s):n.indexOf("N")>=0&&$("#ui-tooltip-fix").css("top",t.offset().top-o);n.indexOf("E")>=0?$("#ui-tooltip-fix").css("left",t.offset().left+e):n.indexOf("W")>=0&&$("#ui-tooltip-fix").css("left",t.offset().left-f+e);$("#ui-tooltip-fix").show()}function f(){$("#ui-tooltip-fix").fadeOut(2e3)}var t=this,n="WS";return r(),this.FadeOutShow=function(){u($(this).attr("title"));setTimeout(f,5e3)},this};$.fn.CAS_VCMTips=function(n){function u(){var i="#"+t.id,n=$(i);n.length==0&&(n=$("<div/>").attr("id",t.id).addClass("layerCASVCM-container"));typeof t.container=="undefined"?$("body").append(n):$(t.container).append(n)}function f(){r.unbind("click").click(function(n){n.stopPropagation();i?r.HideLayout():r.ShowLayout(n)})}var r=this,i=!1,t=$.extend(!0,{id:"tip1",container:null,TS:null,POS:{enable:!1,data:{IepIev:"",refPrice:"",buyLowerLimit:"",buyUpperLimit:"",sellLowerLimit:"",sellUpperLimit:"",imbalance:"",imbalanceSide:""},remarkLink:""},CAS:{enable:!1,data:{IepIev:"",refPrice:"",lowerLimit:"",upperLimit:"",imbalance:"",imbalanceSide:""},remarkLink:""},VCM:{enable:!1,title:"",data:[{refPrice:null,lowerLimit:null,upperLimit:null,coolOffStart:null,coolOffEnd:null}],remarkLink:""}},n);return this.UpdatePOS=function(n){t.POS.data=$.extend(!0,t.POS.data,n);t.POS.dataEnable=!0;t.POS.enable&&i&&this.ShowLayout()},this.UpdateCAS=function(n){t.CAS.data=$.extend(!0,t.CAS.data,n);t.CAS.dataEnable=!0;t.CAS.enable&&i&&this.ShowLayout()},this.UpdateVCM=function(n){t.VCM.data=$.extend(!0,t.VCM.data,n);t.VCM.dataEnable=!0;t.VCM.enable&&i&&this.ShowLayout()},this.UpdateCAS_IEVIEP=function(n){if(t.CAS.data=$.extend(!0,t.CAS.data,n),t.CAS.enable&&i){var r=$("#"+t.id).find(".data-cas-ieviep");r!=undefined&&r.html(t.CAS.data.IepIev)}},this.UpdatePOS_IEVIEP=function(n){if(t.POS.data=$.extend(!0,t.POS.data,n),t.POS.enable&&i){var r=$("#"+t.id).find(".data-pos-ieviep");r!=undefined&&r.html(t.POS.data.IepIev)}},this.ShowLayout=function(){var p,c,s,h,l;i=!0;r.removeClass("casvcm-open").addClass("casvcm-open");p="#"+t.id;c=$(p);c.html("");var a=$("<div/>").addClass("arrow-container"),w=$("<div/>").addClass("back-arrow"),b=$("<div/>").addClass("top-arrow");if(a.append(w),a.append(b),c.append(a),s=$("<div/>").addClass("layerCASVCM"),s.html(""),t.TS=="NO"||t.TS=="POS"){var e=$("<table/>"),f=$("<tr/>"),u=$("<td/>"),n=f.clone(),v=u.clone().attr("colspan",2);if(v.append(POSLabel.Title+"&nbsp;"),t.POS.remarkLink!=""&&v.append($("<a/>").css("float","right").html(POSLabel.Detail).attr({href:t.POS.remarkLink})),n.append(v),e.append(n),t.POS.enable==="Y")if(t.POS.dataEnable&&t.TS=="POS"){n=f.clone();n.append(u.clone().addClass("border-top").html(POSLabel.F1));n.append(u.clone().addClass("border-top data-pos-ieviep").html(t.POS.data.IepIev==""?"&nbsp;":t.POS.data.IepIev));e.append(n);n=f.clone();n.append(u.clone().html(POSLabel.F2));n.append(u.clone().addClass().html(t.POS.data.refPrice));e.append(n);n=f.clone();n.append(u.clone().html(POSLabel.F3));t.POS.data.buyLowerLimit==""||t.POS.data.buyUpperLimit==""?n.append(u.clone().html("")):n.append(u.clone().html(t.POS.data.buyLowerLimit+" - "+t.POS.data.buyUpperLimit));e.append(n);n=f.clone();n.append(u.clone().html(POSLabel.F4));t.POS.data.sellLowerLimit==""||t.POS.data.sellUpperLimit==""?n.append(u.clone().html("")):n.append(u.clone().html(t.POS.data.sellLowerLimit+" - "+t.POS.data.sellUpperLimit));e.append(n);n=f.clone();n.append(u.clone().html(POSLabel.F5));n.append(u.clone().addClass().html(t.POS.data.imbalance));e.append(n);n=f.clone();n.append(u.clone().html(POSLabel.F6));switch(t.POS.data.imbalanceSide){case"N":case"B":case"S":n.append(u.clone().addClass().html(POSLabel.SideType[t.POS.data.imbalanceSide]));break;default:n.append(u.clone().addClass().html(""))}e.append(n)}else n=f.clone(),n.append(u.clone().addClass("border-top").attr("colspan",2).html(POSLabel.M2)),e.append(n);else n=f.clone(),n.append(u.clone().addClass("border-top").attr("colspan",2).html(POSLabel.M1)),e.append(n);s.append(e);s.append($("<div />").addClass("sep-h"))}else{var o=$("<table/>"),f=$("<tr/>"),u=$("<td/>"),n=f.clone(),y=u.clone().attr("colspan",2);if(y.append(CASLabel.Title+"&nbsp;"),t.CAS.remarkLink!=""&&y.append($("<a/>").css("float","right").html(CASLabel.Detail).attr({href:t.CAS.remarkLink})),n.append(y),o.append(n),t.CAS.enable==="Y")if(t.CAS.dataEnable){n=f.clone();n.append(u.clone().addClass("border-top").html(CASLabel.F1));n.append(u.clone().addClass("border-top data-cas-ieviep").html(t.CAS.data.IepIev==""?"&nbsp;":t.CAS.data.IepIev));o.append(n);n=f.clone();n.append(u.clone().html(CASLabel.F2));n.append(u.clone().addClass().html(t.CAS.data.refPrice));o.append(n);n=f.clone();n.append(u.clone().html(CASLabel.F3));t.CAS.data.lowerLimit==""||t.CAS.data.upperLimit==""?n.append(u.clone().html("")):n.append(u.clone().html(t.CAS.data.lowerLimit+" - "+t.CAS.data.upperLimit));o.append(n);n=f.clone();n.append(u.clone().html(CASLabel.F4));n.append(u.clone().addClass().html(t.CAS.data.imbalance));o.append(n);n=f.clone();n.append(u.clone().html(CASLabel.F5));switch(t.CAS.data.imbalanceSide){case"N":case"B":case"S":n.append(u.clone().addClass().html(CASLabel.SideType[t.CAS.data.imbalanceSide]));break;default:n.append(u.clone().addClass().html(""))}o.append(n)}else n=f.clone(),n.append(u.clone().addClass("border-top").attr("colspan",2).html(CASLabel.M2)),o.append(n);else n=f.clone(),n.append(u.clone().addClass("border-top").attr("colspan",2).html(CASLabel.M1)),o.append(n);s.append(o);s.append($("<div />").addClass("sep-h"))}h=$("<table/>");n=f.clone();l=u.clone().attr("colspan",2);l.append(VCMLabel.Title+"&nbsp;");t.VCM.remarkLink!=""&&l.append($("<a/>").css("float","right").html(VCMLabel.Detail).attr({href:t.VCM.remarkLink}));n.append(l);h.append(n);t.VCM.enable==="Y"?t.VCM.dataEnable&&t.VCM.data.length>0?$.isArray(t.VCM.data)&&$.each(t.VCM.data,function(t,i){n=f.clone();n.append(u.clone().addClass("border-top").html(VCMLabel.F1));n.append(u.clone().addClass("border-top").html(i.refPrice));h.append(n);n=f.clone();n.append(u.clone().html(VCMLabel.F2));i.lowerLimit==""||i.upperLimit==""?n.append(u.clone().html("")):n.append(u.clone().html(i.lowerLimit+" - "+i.upperLimit));h.append(n);n=f.clone();n.append(u.clone().html(VCMLabel.F3));n.append(u.clone().addClass("").html(i.coolOffStart+" - "+i.coolOffEnd));h.append(n)}):(n=f.clone(),n.append(u.clone().addClass("border-top").attr("colspan",2).html(VCMLabel.M2)),h.append(n)):(n=f.clone(),n.append(u.clone().addClass("border-top").attr("colspan",2).html(VCMLabel.M1)),h.append(n));s.append(h);c.append(s);c.show()},this.HideLayout=function(){i=!1;r.removeClass("casvcm-open");$("#"+t.id).hide()},u(),f(),this};$.fn.Future_VCMTips=function(n){function u(){var i="#"+t.id,n=$(i);n.length==0&&(n=$("<div/>").attr("id",t.id).addClass("layerCASVCM-container"));typeof t.container=="undefined"?$("body").append(n):$(t.container).append(n)}function f(){i.unbind("click").click(function(n){n.stopPropagation();r?i.HideLayout():i.ShowLayout(n)})}var i=this,r=!1,t=$.extend(!0,{id:"tip1",container:null,VCM:{enable:!1,title:"",data:[{refPrice:null,lowerLimit:null,upperLimit:null,coolOffStart:null,coolOffEnd:null}],remarkLink:""}},n);return this.UpdateVCM=function(n){t.VCM.data=$.extend(!0,t.VCM.data,n);t.VCM.dataEnable=!0;t.VCM.enable&&r&&this.ShowLayout()},this.ShowLayout=function(){var c,f,e,s;r=!0;i.removeClass("casvcm-open").addClass("casvcm-open");c="#"+t.id;f=$(c);f.html("");var h=$("<div/>").addClass("arrow-container"),l=$("<div/>").addClass("back-arrow"),a=$("<div/>").addClass("top-arrow");h.append(l);h.append(a);f.append(h);e=$("<div/>").addClass("layerCASVCM");e.html("");var o=$("<tr/>"),n=$("<td/>"),u=$("<table/>");tr=o.clone();s=n.clone().attr("colspan",2);t.VCM.enable==="Y"&&t.VCM.dataEnable&&t.VCM.data.length>0?s.append(VCMLabel.Title+"&nbsp;"):s.append(VCMLabel.Title+"*&nbsp;");t.VCM.remarkLink!=""&&s.append($("<a/>").css("float","right").html(VCMLabel.Detail).attr({href:t.VCM.remarkLink}));tr.append(s);u.append(tr);t.VCM.enable==="Y"&&t.VCM.dataEnable&&t.VCM.data.length>0?$.isArray(t.VCM.data)&&$.each(t.VCM.data,function(t,i){tr=o.clone();tr.append(n.clone().addClass("border-top").html(VCMLabel.F1));tr.append(n.clone().addClass("border-top").html(i.refPrice));u.append(tr);tr=o.clone();tr.append(n.clone().html(VCMLabel.F2));i.lowerLimit==""||i.upperLimit==""?tr.append(n.clone().html("")):tr.append(n.clone().html(i.lowerLimit+" - "+i.upperLimit));u.append(tr);tr=o.clone();tr.append(n.clone().html(VCMLabel.F3));tr.append(n.clone().addClass("").html(i.coolOffStart+" - "+i.coolOffEnd));u.append(tr)}):(tr=o.clone(),tr.append(n.clone().addClass("border-top").attr("colspan",2).html(VCMLabel.M1)),u.append(tr));e.append(u);t.VCM.enable==="Y"&&t.VCM.dataEnable&&t.VCM.data.length>0||e.append($("<div/>").addClass("vcm-remark").html(VCMLabel.Remark));f.append(e);f.show()},this.HideLayout=function(){r=!1;i.removeClass("casvcm-open");$("#"+t.id).hide()},u(),f(),this};$.fn.RollingDisplay=function(n){function c(){if(typeof t.fpPresentVideo!="undefined"){var n=u.find(".videoNewsList-Container > div:nth-child(2)").clone();n.addClass("specVideo");n.empty();u.find(".videoNewsList-Container > div:nth-child(1)").after(n);t.max++}}function l(){if(typeof t.fpPresentVideo!="undefined"){var n=u.find(".videoNewsList-Container > div:nth-child(2)").clone();n.addClass("specVideo");n.find(" > a").attr("href",t.fpPresentVideo.url);n.find("div.video-image > img").attr("src",t.fpPresentVideo.photo);n.find("div.video-desc").html(t.fpPresentVideo.title);n.find("div.video-catg-icon > img").attr("src",t.fpPresentVideo.catg);n.SnapPreview();u.find(".videoNewsList-Container > div:nth-child(1)").after(n);t.max++}}function o(){f.unbind("click",o);t.index++;t.index>t.max&&(t.index=1);t.index==1?r.hide():r.show();i.css("width",(t.max+2)*t.videoBoxWidth);var n=i.find("div.videoBox:nth-child(2)");i.append(n.clone().addClass("fake"));i.animate({left:t.videoBoxWidth*-2},500,function(){i.find("div.videoBox.fake").replaceWith(n);i.find("div.videoBox:first").replaceWith(n.clone().addClass("clone"));i.css("left",t.videoBoxWidth*-1);i.find("div.videoBox:first video").length>0&&i.find("div.videoBox:first video").css("visibility","hidden");f.bind("click",o)})}function s(){r.unbind("click",s);t.index--;t.index<1&&(t.index=t.max);t.index==1?r.hide():r.show();i.css("width",(t.max+2)*t.videoBoxWidth);var n=i.find("div.videoBox:last");i.animate({left:0},500,function(){i.find("div.videoBox.clone").replaceWith(n);i.prepend(i.find("div.videoBox:last").clone().addClass("clone"));i.css("left",t.videoBoxWidth*-1);i.find("div.videoBox:first video").length>0&&i.find("div.videoBox:first video").css("visibility","hidden");var u=i.find("div.videoBox:nth-child(2) video");u.length>0&&(u[0].onended=function(){e=!0;console.log("onended",e)},u[0].onplaying=function(){e=!1;console.log("onplaying",e)},e||u[0].play());r.bind("click",s)})}function a(){var e,n;i=u.find("> div:nth-child(1)");r=u.find("div.left-arrow-panel");f=u.find("div.right-arrow-panel");e=i.find(" > div.videoBox");t.videoBoxWidth=parseInt(e.outerWidth());t.containerWidth=parseInt(u.outerWidth());r.append($("<div/>"));f.append($("<div/>"));r.bind("click",s);f.bind("click",o);n=i.find(" > div.videoBox").length;t.max=n;t.index=1;i.find("div.videoBox:first").attr("ref","1");t.max>=Math.ceil(t.containerWidth/t.videoBoxWidth)?(i.css("width",(n+2)*t.videoBoxWidth),i.prepend(i.find("div.videoBox:last").clone().addClass("clone")),i.css("left",t.videoBoxWidth*-1),r.hide(),f.show()):(i.css("width",n*t.videoBoxWidth),i.css("left",0),r.hide(),f.hide())}var h={index:1,max:0,containerWidth:0,videoBoxWidth:0,leftPosition:function(){return this.index*this.videoBoxWidth*-1},fpPresentVideo:null},u=this,i=null,r=null,f=null,e=!1,t=$.extend(!0,h,n);return this.addSpecVideo=function(){l()},this.addSpecVideo2=function(){c()},this.removeSpecVideo=function(){u.find(".videoNewsList-Container > .specVideo").length>0&&(u.find(".videoNewsList-Container > .specVideo").remove(),t.max--)},a(),$(window).resize(function(){var o,n,e;for(i.find("div.videoBox.clone").remove(),o=i.find(" > div.videoBox"),n=i.find(" > div.videoBox").length,t.max=n,t.index=1,t.videoBoxWidth=parseInt(o.outerWidth()),t.containerWidth=parseInt(u.outerWidth()),e=0;e<t.max&&i.find("div.videoBox:first").attr("ref")!="1";e++)i.append(i.find("div.videoBox:first"));t.max>=Math.ceil(t.containerWidth/t.videoBoxWidth)?(i.css("width",(n+2)*t.videoBoxWidth),i.prepend(i.find("div.videoBox:last").clone().addClass("clone")),i.css("left",t.videoBoxWidth*-1),r.hide(),f.show()):(i.css("width",n*t.videoBoxWidth),i.find("div.videoBox.clone").remove(),i.css("left",0),r.hide(),f.hide())}),this};$.fn.LiveVideo=function(n){function s(){AADataCenter.GetServerTime({},function(n){n.status=="S"&&(i=n.data.timeDiff);AADataCenter.GetLiveVideoConfig({},r);o=setInterval(function(){AADataCenter.GetLiveVideoConfig({},r)},t.interval*1e3)})}function r(n){if(n.status=="S"){var i=$.extend(!0,{},f,n.data),r=h(new Date),o=u(i.liveTime),s=u(i.notific_end),e=GetCookiesValue("AALive","");i.enable&&r.getTime()>=o.getTime()&&r.getTime()<s.getTime()&&(!e||i.liveID!=e)&&(i.redir2=="AA"&&t.aaLiveSupport||i.redir2=="FB"||i.redir2=="YT")?c(i):l()}}function u(n){if(!n||n.length!=14)return new Date(0);var i=n.substr(0,4),r=n.substr(4,2),u=n.substr(6,2),f=n.substr(8,2),e=n.substr(10,2),o=n.substr(12,2),t=new Date;return t.setYear(i),t.setMonth(r-1),t.setDate(u),t.setHours(f),t.setMinutes(e),t.setSeconds(o),t}function h(n){var t=new Date(n.getTime());return t.setTime(t.getTime()+i),t}function c(n){var i;if($("#liveVideoPanel").length==0){var u="",f="",o="",r=$("<div/>");r.attr("id","liveVideoPanel");i="";i+='<div class="btnClose live-icon-map live-icon-close "><\/div>';i+="<table>";i+='<tr><td class="imgBox">';n.redir2=="FB"||n.redir2=="YT"?(u=n.videoUrl,f="_blank"):(u=t.aaUrl.replace(/\{0\}/g,n.liveID),f="_self");i+=n.redir2=="FB"||n.redir2=="YT"?'<a class="imgLink" href="'+u+'" target="'+f+'">':'<a class="imgLink" href="javascript:void(0);">';i+='<img src="'+n.videoImg+'"/>';i+='<table><tr><td><div class="btnPlay live-icon-map live-icon-play"><\/div><\/td><\/tr><\/table>';i+="<\/a>";i+="<\/td><td>";(n.redir2=="FB"||n.redir2=="YT")&&(i+='<a href="'+u+'" target="'+f+'">');i+='<div class="liveLabel live-icon-map live-icon-liveLabel "><div class="live-icon-volume "><\/div><\/div>';(n.redir2=="FB"||n.redir2=="YT")&&(i+="<\/a>");i+='<div class="titleBox">';o=APP_LANG=="chn"?n.title.sc:n.title.tc;i+=n.redir2=="FB"||n.redir2=="YT"?'<a href="'+u+'" target="'+f+'">'+o+"<\/a>":'<a href="javascript:void(0);">'+o+"<\/a>";i+="<\/div>";i+="<\/td><\/tr>";i+="<\/table>";r.append(i);r.find(".btnClose").unbind("click").bind("click",function(){r.hide();r.remove();$.cookie("AALive",n.liveID,{path:"/",domain:t.cookiesDomain})});r.find(".liveLabel, .titleBox > a, .imgLink").unbind("click").bind("click",function(){function i(){t||(t=!0,window.location.href=u)}var t=!1;n.redir2!="FB"&&n.redir2!="YT"&&i()});e.append(r)}}function l(){$("#liveVideoPanel").length>0&&$("#liveVideoPanel").remove()}var f={enable:!1},e=this,o=null,i=0,t=$.extend(!0,{interval:60,cookiesDomain:"",aaUrl:"",aaLiveSupport:!1},n);return s(),this};$.fn.LiveVideoFrontPage=function(n){function v(){AADataCenter.GetServerTime({},function(n){n.status=="S"&&(_timeDiff=n.data.timeDiff);AADataCenter.GetLiveVideoConfig({},s);a=setInterval(function(){AADataCenter.GetLiveVideoConfig({},s)},t.interval*1e3)})}function s(n){if(n.status=="S"){var i=$.extend(!0,{},l,n.data),r=y(new Date),u=h(i.liveTime),e=h(i.notific_end);i.enable&&(i.redir2=="AA"&&t.aaLiveSupport||i.redir2=="FB"||i.redir2=="YT")?p(i):b();i.promotion!=null&&typeof i.promotion!="undefined"?k(i):d();f={enable:i.enable,promotion:i.promotion}}}function h(n){if(!n||n.length!=14)return new Date(0);var i=n.substr(0,4),r=n.substr(4,2),u=n.substr(6,2),f=n.substr(8,2),e=n.substr(10,2),o=n.substr(12,2),t=new Date;return t.setYear(i),t.setMonth(r-1),t.setDate(u),t.setHours(f),t.setMinutes(e),t.setSeconds(o),t}function y(n){var t=new Date(n.getTime());return t.setTime(t.getTime()+_timeDiff),t}function p(n){var f;if($("#liveVideoPanelFP").length==0){typeof t.preLiveHandle=="function"&&t.preLiveHandle();var s="",l="",h=$("<div/>");h.attr("id","liveVideoPanelFP");f='<div class="nsLV">';f+='<div class="liveIcon live-icon-liveLabel2"><\/div><\/div>';f+='<div style="position:relative;">';n.redir2=="FB"||n.redir2=="YT"?(s=n.videoUrl,l="_blank"):(s=t.aaUrl.replace(/\{0\}/g,n.liveID),l="_self");n.redir2=="AA"&&AAUtility.EnableVideo()?f+='<div class="video_live_fp"><\/div>':(f+='<a class="imgLink" href="'+s+'" target="'+l+'">',f+="<div class='img-con'><img src=\""+n.videoImg+"\"/><div class='img-bor'><\/div><\/div>",f+='<table><tr><td><div class="btnPlay live-icon-map live-icon-play"><\/div><\/td><\/tr><\/table>',f+="<\/a>");f+='<div id="Video_Title" class="newshead6">';r=APP_LANG=="chn"?n.title.sc:n.title.tc;f+=n.redir2=="FB"||n.redir2=="YT"?'<div><a href="'+s+'" target="'+l+'">'+r+"<\/a><\/div>":'<div><a href="javascript:void(0);">'+r+"<\/a><\/div>";f+="<\/div>";f+="<\/div>";h.append(f);i.find(".specVideo").append(h);i.find("#Video_Title a, .imgLink").unbind("click").bind("click",function(){e(n.redir2,r,s)});h.find(".video_live_fp").length>=0&&(u=w(h.find(".video_live_fp"),n,s));frontpagePl!=null&&frontpagePl.GetPlayer()!=null&&(o=frontpagePl.GetPlayer().paused())}c(frontpagePl,!1)}function w(n,t,i){return n.empty(),n.AAVideo({videoOption:{src:t.videoUrl,type:"application/x-mpegURL",live:!0,withCredentials:!1,muted:!0,html5:{hls:{withCredentials:!1},nativeAudioTracks:!1},plugins:{AAEvent:{Resume:{isEnable:!1},GAPush:{isEnable:!1}}},url:function(){e(t.redir2,r,i)}},adMode:"",adOption:{}})}function b(){$("#liveVideoPanelFP").length>0&&($("#liveVideoPanelFP").remove(),u!=null&&(u.GetPlayer()!=null&&u.GetPlayer().dispose(),u=null),o||c(frontpagePl,!0),typeof t.postLiveHandle=="function"&&t.postLiveHandle())}function c(n,t){n!=null&&n.GetPlayer()!=null&&(t&&n.GetPlayer().paused()?n.GetPlayer().play():t||n.GetPlayer().paused()||n.GetPlayer().pause())}function k(n){function y(n,t){return n==null||n.enable==null||n.promotion==null||n.promotion.title==null||n.promotion.img==null?!1:t==null||t.enable==null||t.promotion==null||t.promotion.title==null||t.promotion.img==null?!1:n.promotion.title.tc!=t.promotion.title.tc||n.promotion.title.sc!=t.promotion.title.sc?!1:n.promotion.img.v980!=t.promotion.img.v980||n.promotion.img.v1200!=t.promotion.img.v1200?!1:!0}var a={enable:n.enable,promotion:n.promotion},o=n.promotion,c=n.enable?"LIVE":"PRELIVE",s="",l="",v="",r,h,u;c=="LIVE"&&(n.redir2=="FB"||n.redir2=="YT"?(s=n.videoUrl,l="_blank"):(s=t.aaUrl.replace(/\{0\}/g,n.liveID),l="_self"),v=APP_LANG=="chn"?n.title.sc:n.title.tc);i.hasClass("livepromo")||(i.addClass("livepromo"),r="",r+='<div id="LivePromoBanner">',r+="<a data-key='redirect'>",r+='<div class="banner">',r+="   <div class=\"img hide980\" data-key='img1200'><\/div>",r+="   <div class=\"img hide1200\" data-key='img980'><\/div>",r+="   <div class=\"title\"><div><div data-key='title'><\/div><\/div><\/div>",r+="<\/div>",r+="<\/a>",r+="<\/div>",i.append(r));h=!1;try{h=JSON.stringify(f)!==JSON.stringify(a)}catch(p){h=!y(f,a)}h&&(u=$("#LivePromoBanner"),u.attr("data-type",c),u.find("[data-key='title']").html(APP_LANG=="chn"?o.title.sc:o.title.tc),u.find("[data-key='img1200']").css("background-image","url('"+o.img.v1200+"')"),u.find("[data-key='img980']").css("background-image","url('"+o.img.v980+"')"),u.find("[data-key='redirect']").attr({href:"javascript:void(0);",target:""}),u.unbind("click"),c=="LIVE"&&(n.redir2=="FB"||n.redir2=="YT"?u.find("[data-key='redirect']").attr({href:s,target:l}):u.find("[data-key='redirect']").attr({href:"javascript:void(0);",target:""}),u.bind("click",function(){e(n.redir2,v,s)})))}function d(){i.hasClass("livepromo")&&(i.removeClass("livepromo"),$("#LivePromoBanner").remove())}function e(n,t,i){function u(){r||(r=!0,window.location.href=i)}var r=!1;n!="FB"&&n!="YT"&&u()}var l={enable:!1},i=this,a=null,u=null,o=!1,r="",f=null,t=$.extend(!0,{interval:60,aaUrl:"",aaLiveSupport:!1,preLiveHandle:null,postLiveHandle:null},n);return v(),this};$.fn.SnapPreview=function(n){function f(){var n=$(this);n.hasClass("sel")||i||(i=!0,n.find(".icon-play").hide(),o(n),clearTimeout(t),t=setTimeout(function(){u(n);n.find(".icon-play").show()},r.duration))}function e(){var n=$(this);i=!1;clearTimeout(t);n.find(".icon-play").hide();u(n)}function o(n){var t,i,u,f;n.find(".snap").length==0&&(t=n.find(".snap-container"),t.length==0&&(t=n),i=$("<img/>"),u={width:"100%",height:"100%",position:"absolute",left:"0px",top:"0px",cursor:"pointer","z-index":"9"},u=$.extend(!0,{},u,r.style),i.addClass("snap"),i.css(u),f=i.appendTo(t).show(),setTimeout(function(){f.attr("src",t.data("snap"))},0))}function u(n){n.find(".snap").length>0&&n.find(".snap").remove()}function s(){}var h=this,r=$.extend(!0,{},{duration:3e3,style:{}},n),t=null,i=!1;return s(),this.each(function(){var n=$(this);n.bind("mouseover",f);n.bind("mouseleave",e)})};$.fn.CookiePolicy=function(n){function u(){var u=$.cookie("CookiePolicy"),n,r;u!="1"&&(n=$.cookie("CookiePolicyCheck"),n=="0"||n=="1"||n=="2"?n!="0"&&i():(r=t.dataDomain+"/datafeed/CheckCountryEU.ashx",setTimeout(function(){$.ajax({url:r,async:!0,dataType:"text",error:function(){i()},success:function(n){$.cookie("CookiePolicyCheck",n,{expires:1,path:"/",domain:t.cookiesDomain});n!="0"&&i()}})},1)))}function i(){var i=$("<div/>"),n;i.attr("style","width:56px; height:28px; border:2px solid #9E9E9E; color:#9E9E9E; border-radius:5px; font-size:16px; font-weight:900; line-height:28px; text-align:center; cursor:pointer; font-family:arial;");i.html("X");n="";n+='<div id="CookiePolicyMessage" style="position:fixed; bottom:0px; left:0px; width:100%; padding:15px 0px; background-color:#363636; z-index:9999999999;">';n+='<div style="margin:0px auto; width:100%; max-width:1100px;">';n+='<table cellpadding="0" cellspacing="0" border="0" align="center" style="width:100%;"><tr>';n+='<td style="padding-left:5px;">';n+='<div style="font-size:12px; line-height:16px; font-weight:bold; text-align:center; color:#9E9E9E; font-family:arial; letter-spacing:0;">';n+="AASTOCKS uses cookies to optimise and improve the website, as well as enable the availability of certain functions.<br />";n+='By continuing to use this website, you agree to our use of cookies. For further information on how we use cookies, please <a href="'+t.policyDetail+'" target="_blank" style="text-decoration:none;"><span style="text-decoration:none; font-size:14px; color:#00A5DF; white-space:nowrap;">CLICK HERE<\/span><\/a>.';n+="<\/div>";n+="<\/td>";n+='<td id="CookiePolicyButton" style="padding-left:5px; padding-right:5px; text-align:center;"><\/td>';n+="<\/tr><\/table>";n+="<\/div>";n+="<\/div>";r.append(n);$("#CookiePolicyButton").append(i);i.bind("click",function(){f()})}function f(){$.cookie("CookiePolicy","1",{expires:t.duration,path:"/",domain:t.cookiesDomain});$("#CookiePolicyMessage").hide()}var r=this,t=$.extend(!0,{duration:90,dataDomain:"",cookiesDomain:"",policyDetail:"#"},n);return u(),this};$.fn.StockIndustryBarChart=function(n){function e(){i.StockPerformance==""&&i.IndustryPerformance==""?r.remove():$.ajax({url:i.WDataDomain+"/datafeed/getstockindustryperformance.ashx",data:{symbol:i.StockPerformance,ind:i.IndustryPerformance,lang:i.Language},async:!0,dataType:"json",error:function(){r.remove()},success:function(n){o(n)}})}function o(n){var e=0,i,o,s,t;r.html("");i="<br /><table><tr>";o=$.grep(n,function(n){return n.Type=="STOCK"});o!=null&&o.length>0&&(t=u(o[0]),t!=""&&(i+="<td width='50%'>"+t+"<\/td>",e++));s=$.grep(n,function(n){return n.Type=="INDUSTRY"});s!=null&&s.length>0&&(t=u(s[0]),t!=""&&(i+="<td width='50%'>"+t+"<\/td>",e++));i+="<\/tr><\/table>";e==0?r.remove():(r.addClass("record"+e),r.append(i),f(),$(window).resize(function(){f()}))}function u(n){var u=parseFloat(n.PerfYTD.replace(/,/g,"")),f=parseFloat(n.Perf1M.replace(/,/g,"")),h,r;if(isNaN(u)||isNaN(f))return"";var e=63,o=63,s=37,c=100,l=100;return u>=0&&f>=0||u<=0&&f<=0?(h=Math.max(Math.abs(u),Math.abs(f)),c=Math.round(Math.abs(u*100/h)),l=Math.round(Math.abs(f*100/h))):(h=Math.abs(u)+Math.abs(f),e=Math.round(Math.abs(u*100/h)),o=Math.round(Math.abs(f*100/h)),e<s?(c=Math.round(e*100/(e+s)),e+=s):o<s&&(l=Math.round(o*100/(o+s)),o+=s)),e=e*10,o=o*10,s=s*10,r="",r+="<div class='newsPerformanceItem' onclick=\""+(n.Type=="STOCK"?i.StockPerformanceLanding:i.IndustryPerformanceLanding)+'">',r+="<div class='newsPerformanceData'>"+t("PerformanceData")+"<\/div>",r+="<div class='newsPerformanceCursor'><div><\/div><\/div>",n.LastUpdate!=""&&(r+="<div class='newsPerformanceLastUpdate'>"+t("PerformanceLastUpdate")+" "+n.LastUpdate+"<\/div>"),n.Type=="STOCK"?r+="<div class='newsPerformanceTitle'>"+n.Desp+"<br />"+t("PerformanceTitleStock")+"<\/div>":n.Type=="INDUSTRY"&&(r+="<div class='newsPerformanceTitle'>"+n.Desp+t("PerformanceTitleIndustrySuffix")+"<br />"+t("PerformanceTitleIndustry")+"<\/div>"),r+="<div class='newsPerformanceBar'>",r+="<table>",u==0?(r+="<tr class='zero'>",r+="<td class='npbTitle' width='0'>"+t("PerformanceYTD")+"<\/td>",r+="<td class='npbValue' width='0'><div>0%<\/div><\/td>",r+="<\/tr>"):u>0?(r+="<tr class='pos'>",r+="<td class='npbTitle' width='0'>"+t("PerformanceYTD")+"<\/td>",r+="<td class='npbValue' width='"+e+"'><div class='bar' style='width:"+c+"%'>&nbsp;<div class='text'>+"+n.PerfYTD+"%<\/div><\/div><\/td>",r+="<\/tr>"):(r+="<tr class='neg'>",r+="<td class='npbValue' width='"+e+"'><div class='bar' style='width:"+c+"%'>&nbsp;<div class='text'>"+n.PerfYTD+"%<\/div><\/div><\/td>",r+="<td class='npbTitle' width='0'>"+t("PerformanceYTD")+"<\/td>",r+="<\/tr>"),f==0?(r+="<tr class='zero'>",r+="<td class='npbTitle' width='0'>"+t("Performance1M")+"<\/td>",r+="<td class='npbValue' width='0'><div>0%<\/div><\/td>",r+="<\/tr>"):f>0?(r+="<tr class='pos'>",r+="<td class='npbTitle' width='0'>"+t("Performance1M")+"<\/td>",r+="<td class='npbValue' width='"+o+"'><div class='bar' style='width:"+l+"%'>&nbsp;<div class='text'>+"+n.Perf1M+"%<\/div><\/div><\/td>",r+="<\/tr>"):(r+="<tr class='neg'>",r+="<td class='npbValue' width='"+o+"'><div class='bar' style='width:"+l+"%'>&nbsp;<div class='text'>"+n.Perf1M+"%<\/div><\/div><\/td>",r+="<td class='npbTitle' width='0'>"+t("Performance1M")+"<\/td>",r+="<\/tr>"),r+="<\/table>",r+="<\/div>",r+"<\/div>"}function t(n){switch(i.Language.toLowerCase()){case"chn":return n=="PerformanceTitleStock"?"累积表现":n=="PerformanceTitleIndustry"?"同业平均累积表现":n=="Performance1M"?"1个月":n=="PerformanceYTD"?"年初至今":n=="PerformanceData"?"数据":n=="PerformanceTitleIndustrySuffix"?"类":n=="PerformanceLastUpdate"?"更新於":"";case"eng":return n=="PerformanceTitleStock"?"Cumulative performance":n=="PerformanceTitleIndustry"?"Industry average cumulative performance":n=="Performance1M"?"1-Month":n=="PerformanceYTD"?"YTD":n=="PerformanceData"?"Data":n=="PerformanceTitleIndustrySuffix"?"":n=="PerformanceLastUpdate"?"Last Update:":"";default:return n=="PerformanceTitleStock"?"累積表現":n=="PerformanceTitleIndustry"?"同業平均累積表現":n=="Performance1M"?"1個月":n=="PerformanceYTD"?"年初至今":n=="PerformanceData"?"數據":n=="PerformanceTitleIndustrySuffix"?"類":n=="PerformanceLastUpdate"?"更新於":""}}function f(){$("#newsPerformance .npbValue .bar").each(function(){$(this).removeClass("outside");var n=$(this).width(),t=$(this).find(".text").outerWidth();t>n&&$(this).addClass("outside")})}var r=this,i=$.extend(!0,{WDataDomain:"",StockPerformance:"",IndustryPerformance:"",Language:"chi",StockPerformanceLanding:"",IndustryPerformanceLanding:""},n);return e(),this};$.fn.Placeholder=function(n){function r(){i.text!=""&&(t.val()==""&&(t.val(i.text),t.addClass("placeholder")),t.focus(function(){t.removeClass("placeholder");t.val()==i.text&&t.val("")}),t.blur(function(){t.removeClass("placeholder");(t.val()==""||t.val()==i.text)&&(t.val(i.text),t.addClass("placeholder"))}))}var t=this,i=$.extend(!0,{text:""},n);return r(),this};$.fn.NewsVotingPanel=function(n){function o(){t.type=="normal"?(i.empty(),i.append(s()),r=new e({bCanVote:t.bCanVote,Wdata:t.Wdata,tk:t.tk,nid:t.nid,ns:t.ns,nt:t.nt,VoteEnd:t.VoteEnd,maxVoteDayLimit:t.maxVoteDayLimit,withAni:!1}),r.init(),i.find("#div_Recommend, #div_Bullish, #div_Bearish").bind("click",r.clickVote)):t.type=="simple"&&(r=new e({bCanVote:t.bCanVote,Wdata:t.Wdata,tk:t.tk,nid:t.nid,ns:t.ns,nt:t.nt,VoteEnd:t.VoteEnd,maxVoteDayLimit:t.maxVoteDayLimit,withAni:!1}),r.init(),i.find(".clickable").addClass("enable"),i.find(".divRecommend .clickable").data("ref","rec"),i.find(".divBullish .clickable").data("ref","bull"),i.find(".divBearish .clickable").data("ref","bear"),i.find(".clickable").bind("click",r.clickVote))}function s(){var n="";return n+="<div>",n+="<table>",n+='<tr class="question"><td class="first">'+t.lblRecommendTitle+"<\/td><td>"+t.lblBullishBearishTitle+"<\/td><\/tr>",n+='<tr class="choice"><td class="first"><div id="div_Recommend" data-ref="rec">',n+='<div class="nonselect"><div class="icon-heart_4a iconVote"><\/div>'+t.lblRecommend+"<\/div>",n+='<div class="selected"><div class="icon-heart_4c iconVote"><\/div>'+t.lblRecommendSuccess+"<\/div>",n+="<\/div><\/td>",n+='<td><div id="div_Bullish" data-ref="bull"><div class="icon-greenarrow_4a iconVote"><\/div>'+t.lblBullish+"<\/div>",n+='<div id="div_Bearish" data-ref="bear"><div class="icon-redarrow_4a iconVote"><\/div>'+t.lblBearish+"<\/div><\/td><\/tr>",n+="<\/table>",n+"<\/div>"}function e(n){var e=this,r=$.extend(!0,{bCanVote:!1,Wdata:"",tk:"",nid:"",nt:"",ns:"hk6",VoteEnd:"",maxVoteDayLimit:0,withAni:!1,aniTimeout:null,aniDuration:2e3,bInit:!0},n);r.currentVote={bull:0,bear:0,rec:0};var s=function(n){var i={},u={err:0,msg:""},f,e;if(typeof n!="object"){u={err:1,msg:"Invalid Param"};o(u);return}isNaN(n.bull)||r.currentVote.bull==n.bull||(i.bull=parseInt(n.bull),r.currentVote.bear>0&&(i.bear=-1));isNaN(n.bear)||r.currentVote.bear==n.bear||(i.bear=parseInt(n.bear),r.currentVote.bull>0&&(i.bull=-1));isNaN(n.rec)||r.currentVote.rec==n.rec||(i.rec=parseInt(n.rec));n.db==1?r.bCanVote?(f=[],e={},typeof i.bull!="undefined"&&(f.push("bull,"+(i.bull==1?1:-1)),e.bull=i.bull==1?1:0),typeof i.bear!="undefined"&&(f.push("bear,"+(i.bear==1?1:-1)),e.bear=i.bear==1?1:0),typeof i.rec!="undefined"&&(f.push("rec,"+(i.rec==1?1:-1)),e.rec=i.rec==1?1:0),f.length>0?(t.tk==""&&(r.tk=AAUtility.GetNewsVotingToken(r.nid,r.nt)),$.ajax({url:r.Wdata+"/datafeed/lognewsvote.ashx",data:{sid:1,val:f.join("_"),nid:r.nid,src:r.ns,token:r.tk,nt:r.nt},async:!0,dataType:"json",success:function(t){t==1?(r.currentVote=$.extend(!0,r.currentVote,e),l(n),h(i,!0,r.withAni),o(u)):t==-2&&o({err:1,msg:r.VoteEnd})}})):o(u)):(u={err:1,msg:r.VoteEnd},o(u)):(r.currentVote=$.extend(!0,r.currentVote,i),l(n),h(r.currentVote,!0,r.withAni),o(u))},o=function(){},c=function(n){var t=new Date(0),i=n.substr(0,4),u=n.substr(4,2),f=n.substr(6,2),e=n.substr(8,2),o=n.substr(10,2);return t.setYear(i),t.setMonth(u-1),t.setDate(f),t.setTime(t.getTime()+(r.maxVoteDayLimit+1)*864e5),t},a=function(){var n=new Date,t,r,i;if(n.setHours(0),n.setMinutes(0),n.setSeconds(0),n.setMilliseconds(0),t=AAUtility.getLocalStorage("AANewsVoteCheck"),t==null||new Date(parseInt(t))<n){r=AAUtility.getLocalStorage("AANewsVote");for(i in r)new Date(parseInt(i))<=n&&AAUtility.clearLocalStorage("AANewsVote",i);AAUtility.setLocalStorage("AANewsVoteCheck",n.getTime())}},v=function(){if(r.nt&&r.nt.length==12){var t=c(r.nt),n=AAUtility.getLocalStorage("AANewsVote",t.getTime());n&&n[r.nid]?(r.currentVote={rec:n[r.nid].r,bull:n[r.nid].bu,bear:n[r.nid].be},s(r.currentVote)):r.bInit=!1}},l=function(n){var t;if(r.nt&&r.nt.length==12){var o=c(r.nt),e=r.currentVote.rec,i=r.currentVote.bull,f=r.currentVote.bear;n.rec==1?e=1:(n.rec==0||n.rec==-1)&&(e=0);n.bull==1?(i=1,f=0):(n.bull==0||n.bull==-1)&&(i=0);n.bear==1?(f=1,i=0):(n.bear==0||n.bear==-1)&&(f=0);t=AAUtility.getLocalStorage("AANewsVote",o.getTime());t||(t={});t[r.nid]={r:e,bu:i,be:f};AAUtility.setLocalStorage("AANewsVote",o.getTime(),t);u.update()}},h=function(n,i,u){t.type=="normal"?y(n,u):t.type=="simple"&&p(n,u);f!=null&&(f.updateCurrentVote(r.currentVote),i&&f.updateLayout(n))},y=function(n,t){var i=typeof t!="undefined"?t:!0,u=hostUrl+"resources/images/news/recommend/";clearTimeout(r.aniTimeout);n.bull==1?($("#div_Bullish").addClass("sel"),!r.bInit&&i&&($("#div_Bullish .iconVote").css("background","url('"+u+"green_arrow_animation.gif?v="+Date.now()+"') no-repeat"),r.aniTimeout=setTimeout(function(){$("#div_Bullish .iconVote").removeAttr("style")},r.aniDuration))):(n.bull==0||n.bull==-1)&&($("#div_Bullish .iconVote").removeAttr("style"),$("#div_Bullish").removeClass("sel"));n.bear==1?($("#div_Bearish").addClass("sel"),!r.bInit&&i&&($("#div_Bearish .iconVote").css("background","url('"+u+"red_arrow_animation.gif?v="+Date.now()+"') no-repeat"),r.aniTimeout=setTimeout(function(){$("#div_Bearish .iconVote").removeAttr("style")},r.aniDuration))):(n.bear==0||n.bear==-1)&&($("#div_Bearish .iconVote").removeAttr("style"),$("#div_Bearish").removeClass("sel"));n.rec==1?($("#div_Recommend").addClass("sel"),!r.bInit&&i&&($("#div_Recommend .iconVote").css("background","url('"+u+"heart_animation.gif?v="+Date.now()+"') no-repeat"),r.aniTimeout=setTimeout(function(){$("#div_Recommend .iconVote").removeAttr("style")},r.aniDuration))):(n.rec==0||n.rec==-1)&&($("#div_Recommend .iconVote").removeAttr("style"),$("#div_Recommend").removeClass("sel"));r.bInit=!1},p=function(n,t){var s=typeof t!="undefined"?t:!0,u=hostUrl+"resources/images/news/recommend/",f,e,o;clearTimeout(r.aniTimeout);n.bull==1?(i.find(".divBullish .clickable").addClass("sel"),!r.bInit&&s&&(f=i.find(".divBullish .clickable .iconVoteMini"),f.hasClass("icon-greenarrow_1")?f.css("background","url('"+u+"green_arrow_animation_1.gif?v="+Date.now()+"') no-repeat"):f.hasClass("icon-greenarrow_2")?f.css("background","url('"+u+"green_arrow_animation_2.gif?v="+Date.now()+"') no-repeat"):f.hasClass("icon-greenarrow_3")&&f.css("background","url('"+u+"green_arrow_animation_3.gif?v="+Date.now()+"') no-repeat"),r.aniTimeout=setTimeout(function(){f.removeAttr("style")},r.aniDuration))):(n.bull==0||n.bull==-1)&&(i.find(".divBullish .clickable .iconVoteMini").removeAttr("style"),i.find(".divBullish .clickable").removeClass("sel"));n.bear==1?(i.find(".divBearish .clickable").addClass("sel"),!r.bInit&&s&&(e=i.find(".divBearish .clickable .iconVoteMini"),e.hasClass("icon-redarrow_1")?e.css("background","url('"+u+"red_arrow_animation_1.gif?v="+Date.now()+"') no-repeat"):e.hasClass("icon-redarrow_2")?e.css("background","url('"+u+"red_arrow_animation_2.gif?v="+Date.now()+"') no-repeat"):e.hasClass("icon-redarrow_3")&&e.css("background","url('"+u+"red_arrow_animation_3.gif?v="+Date.now()+"') no-repeat"),r.aniTimeout=setTimeout(function(){e.removeAttr("style")},r.aniDuration))):(n.bear==0||n.bear==-1)&&(i.find(".divBearish .clickable .iconVoteMini").removeAttr("style"),i.find(".divBearish .clickable").removeClass("sel"));n.rec==1?(i.find(".divRecommend .clickable").addClass("sel"),!r.bInit&&s&&(o=i.find(".divRecommend .clickable .iconVoteMini"),o.hasClass("icon-heart_1")?o.css("background","url('"+u+"heart_animation_1.gif?v="+Date.now()+"') no-repeat"):o.hasClass("icon-heart_2")?o.css("background","url('"+u+"heart_animation_2.gif?v="+Date.now()+"') no-repeat"):o.hasClass("icon-heart_3")&&o.css("background","url('"+u+"heart_animation_3.gif?v="+Date.now()+"') no-repeat"),r.aniTimeout=setTimeout(function(){o.removeAttr("style")},r.aniDuration))):(n.rec==0||n.rec==-1)&&(i.find(".divRecommend .clickable .iconVoteMini").removeAttr("style"),i.find(".divRecommend .clickable").removeClass("sel"));r.bInit=!1};e.getVote=function(n){var t={};typeof n.rec!="undefined"&&(t.rec=n.rec);typeof n.bull!="undefined"&&(t.bull=n.bull);typeof n.bear!="undefined"&&(t.bear=n.bear);s(t)};e.setVote=function(n){var t={db:1};typeof n.rec!="undefined"&&(t.rec=n.rec);typeof n.bull!="undefined"&&(t.bull=n.bull);typeof n.bear!="undefined"&&(t.bear=n.bear);s(t)};e.clickVote=function(){var n={db:1};n[$(this).data("ref")]=$(this).hasClass("sel")?-1:1;s(n)};e.updateLayout=function(n){h(n,!1,!1)};e.updateCurrentVote=function(n){r.currentVote=n};e.init=function(){t.type=="normal"?u=$(".div_VoteTotal").NewsVotingCounter({maxVoteDayLimit:r.maxVoteDayLimit}):t.type=="simple"&&(u=t.counter);a();v()}}var i=this,t=$.extend(!0,{},{type:"normal",counter:null,bCanVote:!1,Wdata:"",tk:"",nid:"",nt:"",ns:"hk6",VoteEnd:"",maxVoteDayLimit:0,lblRecommendTitle:"",lblBullishBearishTitle:"",lblRecommend:"",lblRecommendSuccess:"",lblBullish:"",lblBearish:"",withAni:!1},n),r=null,u=null,f=null;return this.getCounterControl=function(){return u},this.setConnectedNVP=function(n){f=n},this.updateCurrentVote=function(n){r.updateCurrentVote(n)},this.updateLayout=function(n){r.updateLayout(n)},o(),this};$.fn.NewsVotingCounter=function(n){var t=this,r=$.extend(!0,{},{maxVoteDayLimit:0},n);this.init=function(n){var t=n.find(".divRecommend .value").text(),i=n.find(".divBullish .value").text(),r=n.find(".divBearish .value").text();n.data("base")==null&&n.data("base",{rec:t,bull:i,bear:r})};this.update=function(n){n==null&&(n=$(t));var r=n.data("base"),e=n.find(".divRecommend .value"),o=n.find(".divBullish .value"),s=n.find(".divBearish .value"),a=(n.data("nt")||"").toString(),v=(n.data("nid")||"").toString(),f=u(a,v),y=e.text(),p=o.text(),w=s.text(),h=i(r.rec,f.r),c=i(r.bull,f.bu),l=i(r.bear,f.be);y.toString()!=h.toString()&&e.html(h);p.toString()!=c.toString()&&o.html(c);w.toString()!=l.toString()&&s.html(l)};var i=function(n,t){if(n.match(/^\-*\d{1,3}$/)){var i=parseFloat(n)+parseFloat(t);if(i>999)switch(APP_LANG){case"eng":return"1K";case"chi":case"chn":default:return"1千"}else if(i<0)return 0;return i}return n},u=function(n,t){if(n.length==12){var r=f(n),i=AAUtility.getLocalStorage("AANewsVote",r.getTime());if(i&&i[t])return i[t]}return{r:0,bu:0,be:0}},f=function(n){var t=new Date(0),i=n.substr(0,4),u=n.substr(4,2),f=n.substr(6,2);return t.setYear(i),t.setMonth(u-1),t.setDate(f),t.setTime(t.getTime()+(r.maxVoteDayLimit+1)*864e5),t};return this.each(function(){var n=$(this);t.init(n);t.update(n)})};$.fn.IPOInfoOverlay=function(n){function r(){var n=$("#AAIPOInfoOverlay");n.length==0&&(n=$("<div id='AAIPOInfoOverlay'><\/div>"),n.css("width",t.width+"px"));$("body").append(n)}function u(n){var r="",i,f,e,u;if(r+='<div class="header">',r+='<div><span class="cls" data-key="symbol"><\/span>&nbsp;<span data-key="desp"><\/span><\/div>',r+='<div class="event">'+t.label.Event+'&nbsp;:&nbsp;<span data-key="event"><\/span><\/div>',r+='<div class="dayBox txt_c rel"><\/div>',r+="<\/div>",r+="<table><tbody>",r+='<tr><td class="first">'+t.label.AppPeriod+'<\/td><td class="font-num cls">:&nbsp;<span data-key="appList"><\/span><\/td><\/tr>',r+='<tr><td class="first">'+t.label.FixedDate+'<\/td><td class="font-num cls">:&nbsp;<span data-key="fixedDate"><\/span><\/td><\/tr>',r+='<tr><td class="first">'+t.label.AnnDate+'<\/td><td class="font-num cls">:&nbsp;<span data-key="annDate"><\/span><\/td><\/tr>',r+='<tr><td class="first">'+t.label.RefundDate+'<\/td><td class="font-num cls">:&nbsp;<span data-key="refundDate"><\/span><\/td><\/tr>',r+='<tr><td class="first">'+t.label.ListingDate+'<\/td><td class="font-num cls">:&nbsp;<span data-key="listingDate"><\/span><\/td><\/tr>',r+="<\/tbody><\/table>",t.info){if(i=$(r),t.date&&t.date.split("-").length==3&&(i.find(".dayBox").append(n.closest("table").find('th[ref="'+t.date+'"] .dayBox').clone().html()),i.find(".dayBox img").attr("src",t.img.replace(/\{0\}/g,parseInt(t.date.split("-")[1],10)))),i.find('span[data-key="symbol"]').html(t.info.Symbol),i.find('span[data-key="desp"]').html(t.info.Desp),t.event&&t.event.split(",").length>0){for(f=t.event.split(","),e=[],u=0;u<f.length;u++)t.label[f[u]]&&e.push(t.label[f[u]]);i.find('span[data-key="event"]').html(e.join(", "))}t.info.ApplicationOpen&&t.info.ApplicationClose?i.find('span[data-key="appList"]').html(t.info.ApplicationOpen+" - "+t.info.ApplicationClose):i.find('span[data-key="appList"]').html("N/A");i.find('span[data-key="fixedDate"]').html(t.info.FixedDate||"N/A");i.find('span[data-key="annDate"]').html(t.info.AnnouncementDate||"N/A");i.find('span[data-key="refundDate"]').html(t.info.RefundDate||"N/A");t.info.ListingDate&&t.info.ListingLabel?i.find('span[data-key="listingDate"]').html(t.info.ListingDate+'<div class="inline_block"><div class="labelList">'+t.info.ListingLabel+"<\/div><\/div>"):t.info.ListingDate?i.find('span[data-key="listingDate"]').html(t.info.ListingDate):i.find('span[data-key="listingDate"]').html("N/A")}return i}var i=this,t=$.extend(!0,{},{width:315,position:"S",symbol:"",date:"",info:null,img:"",label:null},n);return r(),this.ShowLayout=function(n,i){var r=$("#AAIPOInfoOverlay"),f;r.css("position","absolute");r.css("z-index","10");r.empty();f=$('<div class="conn"><\/div>');r.append(f);r.append(u(i));r.css("left",Math.min($(i).offset().left,$("body").width()-t.width));t.position=="S"?(r.css("top",$(i).offset().top+$(i).outerHeight()+"px"),f.css({position:"absolute",top:"-5px",left:$(i).offset().left-r.offset().left+"px",width:$(i).outerWidth(),height:"5px",background:"#fff"})):t.position=="N"&&r.css("top",$(i).offset().top-r.outerHeight()+"px");r.show();r.unbind("mouseover").bind("mouseover",function(){i.addClass("hover");r.show()});r.unbind("mouseout").bind("mouseout",function(){i.removeClass("hover");r.hide()})},this.HideLayout=function(){var n=$("#AAIPOInfoOverlay");n.hide()},this.each(function(){var n=$(this);$(this).bind("mouseover",function(t){i.ShowLayout(t,n)});$(this).bind("mousemove",function(t){i.ShowLayout(t,n)});$(this).bind("mouseout",function(){i.HideLayout()})})};$.fn.aaDropDownList=function(n){if($(this).length!=0){var t=$.extend({width:100,selectedIndex:0,selectedValue:0,defaultBy:"index",enable:!0,position:"S",data:null,maxshow:10,onSelectedChange:null,onMouseOverItem:null,layoutStyle:{},menuType:0},n);return this.each(function(){function u(){n.find("ul").hide();f=!1}function y(){n.find("ul").show();f=!0;s&&h();s=!1;p()}function p(){var t=n.find("ul"),r=t.find("li").eq(i),u;r.length>=0&&(r.addClass("hover"),u=t.css("top"),t.css({top:t.scrollTop()+r.position().top+"px"}),t.scrollTop(t.scrollTop()+r.position().top),t.css({top:u}))}function h(){var r=n.find("ul"),s=n.height(),v=$(r.find("li")[i]).html(),h,c,u;if(r.css("transform","translateZ(0)"),t.position=="G"){var u=0,s=n.outerHeight(),f=n.position(),e=r.find("li").length,o=e>0?r.find("li")[0].offsetHeight:0;u=e>t.maxshow?o*t.maxshow:o*e;r.css({position:"absolute","z-index":9999999,background:"#fff",height:u+"px"});r.css("top",f.top-r.outerHeight()+1+"px");(n.outerHeight()-n.innerHeight())/2==1&&r.css({left:f.left+"px"});r.css(t.layoutStyle)}else if(t.position=="S")r.css({position:"relative",top:"0px",left:"-1px","z-index":9999999,background:"#fff"});else if(t.position=="SL")r.css({position:"relative",top:"0px",left:"-1px","z-index":9999999,background:"#fff"}),r.css(t.layoutStyle);else if(t.position=="SR")r.css({position:"relative",top:"0px",right:"1px","z-index":9999999,background:"#fff"}),r.css(t.layoutStyle),t.layoutStyle.width&&(h=t.width,c=t.layoutStyle.width,r.css("right",c-h+1));else if(t.position=="A"){var a=n.outerWidth()-2,l,f=n.offset(),e=r.find("li").length,o=e>0?r.find("li")[0].offsetHeight:0;u=e>t.maxshow?o*t.maxshow:o*e;l=f.top+u+s>$(window).height()?f.top-u-s-7:f.top-5;r.css({position:"fixed",left:f.left+"px",top:l+"px","z-index":9999999,background:"#fff",width:a+"px",height:u+"px"})}else u=r.outerHeight()*-1,r.css({position:"relative",top:u-s+"px","z-index":9999999,background:"#fff"})}function e(t){o=t;n.find("div.text").html(t)}function c(){var o=n.find("ul");n.unbind("click").bind("click",function(n){n.stopPropagation();f?u():y()});n.unbind("mousemove").bind("mousemove",function(n){n.stopPropagation()});t.menuType==1?$("body").unbind("click").bind("click",function(){f&&u()}):n.unbind("mouseleave").bind("mouseleave",function(){u()});o.find("li").unbind("mouseover").bind("mouseover",function(){o.find("li").removeClass("hover");$(this).addClass("hover");typeof t.onMouseOverItem=="function"&&t.onMouseOverItem.apply(this,[{value:$(this).val(),ref:$(this).attr("ref")}])}).unbind("mouseout").bind("mouseout",function(){$(this).removeClass("hover")}).unbind("click").bind("click",function(f){var o,s,h;f.stopPropagation();o=$(this).attr("val");r=o;i=$(this).index();s=$(this).html();e(s);h=$(this).attr("ref");u();typeof t.onSelectedChange=="function"&&t.onSelectedChange.apply(this,[{ID:n.attr("id"),text:s,value:o,data:t.data,ref:h}])})}function l(){var t=n.find("ul");n.unbind("mouseover").unbind("mouseleave").unbind("click");t.find("li").unbind("mouseover").unbind("mouseout").unbind("click")}function w(){var f=n.find("ul"),y,o,e;f.css("width",t.width);y=n.height();o="";t.defaultBy=="value"?(o=$(f.find("li[val='"+t.selectedValue+"']")).html(),e=$(f.find("li[val='"+t.selectedValue+"']"))):t.defaultBy=="selected"?(o=$(f.find("li[selected]")).html(),e=$(f.find("li[selected]"))):(o=$(f.find("li")[i]).html(),e=$(f.find("li")[i]));e.length>0&&(r=$(e).attr("val"),i=$(e).index());h();n.css({width:t.width});var l=$("<div />"),s=$("<div />").addClass("text").html(o),v=$("<div />").addClass("arrow"),p=$("<div />").css({clear:"both",height:"0"});l.append(s).append(v).append(p);n.prepend(l);s.css("width",n.width()-v.outerWidth()-(s.outerWidth()-s.width())-2);a?c():n.removeClass("disable").addClass("disable");u()}var n=$(this),f=!1,i=t.selectedIndex,r=t.selectedValue,o="",a=t.enable,s=!0,v=!1;this.clear=function(){l();i=0;r=0;e("");var t=n.find("ul");t.html("")};this.removeItem=function(t){var r=n.find("ul"),i=r.find("li[val='"+t+"']");i.length>=0&&i.remove()};this.addItem=function(t,i){var r=n.find("ul");i!=undefined?r.find("li:eq("+i+")").before(t):r.append(t)};this.getItemSize=function(){return n.find("ul > li").length};this.getSelectedIndex=function(){return i};this.getSelectedText=function(){return o};this.getSelectedValue=function(){var r=i,u=n.find("ul"),t=u.find("li").eq(r);return t.length>0?t.attr("val"):null};this.getSelectedItem=function(){var r=i,u=n.find("ul"),t=u.find("li").eq(r);return t.length>0?t:null};this.getPrevSelectedValue=function(t){for(var f=i,e=n.find("ul"),r=e.find("li").eq(f),u=0;u>t;)if(r=r.prev(),u--,r.length==0)return null;return r.attr("val")};this.getNextSelectedValue=function(t){for(var f=i,e=n.find("ul"),r=e.find("li").eq(f),u=0;u<t;)if(r=r.next(),u++,r.length==0)return null;return r.attr("val")};this.enable=function(t){t?(c(),n.removeClass("disable")):(l(),n.removeClass("disable").addClass("disable"))};this.setSelectedIndex=function(u,f){var c=n.find("ul"),o=c.find("li").eq(u);if(o.length>=0){i=u;var l=o.attr("ref"),s=o.html(),h=o.attr("val");e(s);r=h;f=f==undefined?!0:f;typeof t.onSelectedChange=="function"&&f&&t.onSelectedChange.apply(this,[{ID:n.attr("id"),text:s,value:h,data:t.data,ref:l}])}};this.setSelectedValue=function(u,f){var h,o,s,c;r=u;h=n.find("ul");o=h.find("li[val='"+u+"']");o.length>=0&&(s=o.html(),c=o.attr("ref"),e(s),i=$(o).index(),f=f==undefined?!0:f,typeof t.onSelectedChange=="function"&&f&&t.onSelectedChange.apply(this,[{ID:n.attr("id"),text:s,value:u,data:t.data,ref:c}]))};this.isContainItemValue=function(t){var i=n.find("ul");return i.find("li[val='"+t+"']").length==1};this.isShowMenu=function(){return v};w()})}};$.fn.EduKeywordSearchBox=function(n){function u(n){var r=t.dataDomain+"/json/edukeyword.json?v="+t.lastUpdate;$.ajax({url:r,async:!0,dataType:"json",success:function(t){i=t;typeof n=="function"&&n(t)},error:function(){i=null}})}function r(n){var e,a,l,s,f,y,h;if(i==null)u(function(){r(n)});else{var o=[],w="[\\/\\!\\@\\#\\$\\%\\^\\&\\*\\(\\)\\.\\,\\?\\<\\>\\:\\;\\\"\\'\\{\\}\\|\\+\\-\\_\\=\\\\]",b=new RegExp(w,"g");if(i.keyword!=null&&n.trim().length>0)if(e=Object.keys(i.keyword),/[a-zA-Z]/.test(n.substr(0,1))){for(f=0;f<e.length;f++)a=i.keyword[e[f]],l=i.details["k"+a],(APP_LANG!="eng"||APP_LANG=="eng"&&l.key_en==e[f])&&(e[f].toLowerCase().indexOf(n.toLowerCase())>=0||e[f].toLowerCase().replace(b,"").indexOf(n.toLowerCase())>=0)&&o.push(e[f]);o=o.sort(function(t,i){var r=t.toLowerCase().indexOf(n.toLowerCase()),u=i.toLowerCase().indexOf(n.toLowerCase());return r==u?t<i?-1:t>i?1:0:r-u})}else{for(f=0;f<e.length;f++)a=i.keyword[e[f]],l=i.details["k"+a],(APP_LANG=="chi"&&l.key==e[f]||APP_LANG=="chn"&&l.key_sc==e[f])&&(e[f].toLowerCase().indexOf(n.toLowerCase())>=0||e[f].toLowerCase().replace(b,"").indexOf(n.toLowerCase())>=0)&&o.push(e[f]);o=o.sort(function(t,i){return t.toLowerCase().indexOf(n.toLowerCase())-i.toLowerCase().indexOf(n.toLowerCase())})}if(s=t.layout.suggestList.find("ul"),s.empty(),o.length>0){for(f=0;f<Math.min(o.length,t.maxCount);f++){var c=i.keyword[o[f]],h=$("<li/>"),v="";for(y=0;y<n.length;y++)v+=n.substr(y,1).replace(/[.*+?^${}()|[\]\\]/g,"\\$&")+w+"{0,1}";v="("+v+")";var k=new RegExp(v,"gi"),p=o[f].replace(k,"<b>$&<\/b>");if(i.details["k"+c]!=null&&o[f]==i.details["k"+c].key_en)switch(APP_LANG){case"chi":p+=" ("+i.details["k"+c].key+")";break;case"chn":p+=" ("+i.details["k"+c].key_sc+")"}h.html(p);i.details["k"+c]!=null&&(h.attr("data-key",i.details["k"+c].key_en.toLowerCase().replace(/ /g,"-").replace(/\&/g,"and")),h.attr("data-catg",i.details["k"+c].catg_en.toLowerCase().replace(/ /g,"-").replace(/\&/g,"and")));s.append(h)}s.find("li").bind("click",function(){window.location.href=t.eduUrl+"/"+encodeURIComponent($(this).data("catg"))+"/?k="+encodeURIComponent($(this).data("key"))});s.find("li").bind("mouseover",function(){$(this).siblings().removeClass("sel");$(this).addClass("sel")});s.find("li").bind("mouseleave",function(){$(this).removeClass("sel")});s.find("li").first().addClass("sel");t.layout.suggestList.show()}else h=$("<li/>"),h.addClass("noData"),h.html(t.label.noData),s.append(h),s.find("li").bind("click",function(n){n.stopPropagation()}),t.layout.suggestList.show()}}function f(n){n.stopPropagation();t.layout.iconSearch.show();t.layout.btnSearchPanel.hide();t.layout.btnSearchPanel.removeClass("sel");t.layout.suggestList.hide();t.layout.inputBoxPanel.show();setTimeout(function(){t.layout.inputBoxPanel.addClass("sel");t.layout.inputBox.focus()},10)}function e(n){var u=$(this).val(),i=n.keyCode||n.which;i!=13&&i!=40&&i!=38&&(u.length>0?(t.layout.iconSearch.hide(),t.layout.iconClose.show(),r(u)):(t.layout.suggestList.hide(),t.layout.iconSearch.show(),t.layout.iconClose.hide()))}function o(n){var u=n.keyCode||n.which,r,i;u==13?(n.preventDefault(),t.layout.suggestList.is(":visible")&&(i=t.layout.suggestList.find("ul > li.sel"),i.length>0&&(window.location.href=t.eduUrl+"/"+encodeURIComponent(i.data("catg"))+"/?k="+encodeURIComponent(i.data("key"))))):u==40?(n.preventDefault(),t.layout.suggestList.is(":visible")&&(r=t.layout.suggestList.find("ul > li"),i=t.layout.suggestList.find("ul > li.sel"),i.length>0?i.next().length>0&&(r.removeClass("sel"),i.next().addClass("sel")):(r.removeClass("sel"),r.first().addClass("sel")))):u==38&&(n.preventDefault(),t.layout.suggestList.is(":visible")&&(r=t.layout.suggestList.find("ul > li"),i=t.layout.suggestList.find("ul > li.sel"),i.length>0?i.prev().length>0&&(r.removeClass("sel"),i.prev().addClass("sel")):(r.removeClass("sel"),r.last().addClass("sel"))))}function s(n){n.stopPropagation()}function h(n){n.stopPropagation()}function c(n){n.stopPropagation();t.layout.inputBox.val("");t.layout.suggestList.hide();t.layout.iconSearch.show();t.layout.iconClose.hide();setTimeout(function(){t.layout.inputBox.focus()},10)}function l(){t.layout.inputBoxPanel.is(":visible")&&(t.layout.iconSearch.hide(),t.layout.iconClose.hide(),t.layout.suggestList.hide(),t.layout.inputBoxPanel.removeClass("sel"),t.layout.btnSearchPanel.show(),setTimeout(function(){t.layout.btnSearchPanel.addClass("sel")},10),setTimeout(function(){t.layout.inputBox.val("");t.layout.inputBoxPanel.hide()},500))}function a(){Object.keys||(Object.keys=function(n){var i=[],t;for(t in n)n.hasOwnProperty(t)&&i.push(t);return i})}function v(){a();t.layout.btnSearchPanel.bind("click",f);t.layout.inputBox.bind("click",s);t.layout.inputBox.bind("keyup",e);t.layout.inputBox.bind("keydown",o);t.layout.iconSearch.bind("click",h);t.layout.iconClose.bind("click",c);t.layout.body.bind("click",l)}var y=this,t=$.extend(!0,{},{maxCount:5,dataDomain:"",eduUrl:"",layout:{btnSearchPanel:null,inputBoxPanel:null,inputBox:null,suggestList:null,iconSearch:null,iconClose:null,body:null},label:{noData:""},lastUpdate:""},n),i=null;return v(),this};$.fn.EduKeywordInjection=function(n,t){function f(n){var t=i.dataDomain+"/json/edukeyword.json?v="+i.lastUpdate;$.ajax({url:t,async:!0,dataType:"json",timeout:5e3,success:function(t){r=t;typeof n=="function"&&n(t)},error:function(t){r=null;typeof n=="function"&&n(t)}})}function e(n){var l,o,s,t,u;if(r!=null&&r.keyword!=null&&r.synonym!=null){for(l=[],o=[],s=0;s<n.children().length;s++)l.push(n.children()[s]),$(n.children()[s]).replaceWith('<fix ref="'+s+'" />');var f=n.html(),w=Object.keys(r.keyword),b=Object.keys(r.synonym),e=w.concat(b);e=e.sort(function(n,t){return t.length-n.length});var a=e.length,h=0,v="<div class='icon-news-edu inline_block'><\/div>",c="<div class='inline_block' style='width:"+(APP_LANG=="eng"?"1px":"5px")+";'><\/div>",y=".,()[] ".replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),p="-@.%/".replace(/[.*+?^${}()|[\]\\]/g,"\\$&");if(a>0){for(;h<a;h++)t=e[h].replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),/^[\w\/\&\-\+\(\)\%\' ]+$/.test(e[h])?(t=APP_LANG=="eng"?"(["+y+"])("+t+")(["+y+"])":"((?=[^"+p+"])\\W)("+t+")((?=[^"+p+"])\\W)",u=f.match(new RegExp(t,"i")),u!=null&&u.length>0&&(o.push(u[0].replace(new RegExp(t,"i"),c+"<a href='javascript:void(0)' class='keyword' data-key=\""+e[h]+'">$2'+v+c+"<\/a>")),f=f.replace(new RegExp(t,"i"),'$1<keyword ref="'+(o.length-1)+'" />$3'))):(t="("+t+")",u=f.match(new RegExp(t,"i")),u!=null&&u.length>0&&(o.push(u[0].replace(new RegExp(t,"i"),c+"<a href='javascript:void(0)' class='keyword' data-key=\""+e[h]+'">$1'+v+c+"<\/a>")),f=f.replace(new RegExp(t,"i"),'<keyword ref="'+(o.length-1)+'" />')));n.html(f)}$.each($(n).find("fix[ref]"),function(n,t){$(t).replaceWith(l[parseInt($(t).attr("ref"))])});$.each($(n).find("keyword[ref]"),function(n,t){$(t).replaceWith(o[parseInt($(t).attr("ref"))])});$("a.keyword").EduKeywordOverlay({data:r,hideIfNotFound:!1,eduUrl:i.eduUrl,videoCoverPath:i.videoCoverPath,videoIcon:i.videoIcon,videoPath:i.videoPath,label:i.label,isPopUpNews:i.isPopUpNews,isNewsContent:!0})}}function o(){Object.keys||(Object.keys=function(n){var i=[],t;for(t in n)n.hasOwnProperty(t)&&i.push(t);return i})}function s(){o();f(function(){e($(u));typeof t!="undefined"&&t()},function(){typeof t!="undefined"&&t()})}var u=this,i=$.extend(!0,{},{dataDomain:"",eduUrl:"",videoCoverPath:"",videoIcon:"",videoPath:"",label:{},isPopUpNews:!1,lastUpdate:""},n),r=null;return s(),this};$.fn.EduKeywordOverlay=function(n){function u(){var r=$("#AAEduOverlayMask",window.top.document),n,i;r.length==0&&(r=$("<div id='AAEduOverlayMask'><\/div>"));$("body",window.top.document).append(r);n=$("#AAEduOverlay",window.top.document);n.length==0&&(i=$("<div id='AAEduOverlayContainer'><\/div>"),n=$("<div id='AAEduOverlay'><\/div>"),n.append(i),i.css("width",t.width+"px"),i.css("height",t.height+"px"));$("body",window.top.document).append(n)}function f(){_gaq.push(["edu._setAccount","UA-141513670-1"])}function e(){var n=$("#AAEduOverlayContainer",window.top.document),r=$("#AAEduOverlay",window.top.document),u=$("#AAEduOverlayMask",window.top.document);n.find(".btnClose").unbind("click").bind("click",i.HideLayout);n.find(".scrollcontent").unbind("scroll").bind("scroll",o);n.find(".scrollcontent")[0].scrollHeight>n.find(".scrollcontent").outerHeight()&&(n.append('<div id="AAEduOverlayBottomMask" />'),n.find("#AAEduOverlayBottomMask").css("width",t.width-30+"px"));r.unbind("click").bind("click",i.HideLayout);u.unbind("click").bind("click",i.HideLayout);n.unbind("click").bind("click",function(n){n.stopPropagation()})}function o(){$(this).scrollTop()+$(this).outerHeight()==$(this)[0].scrollHeight?$("#AAEduOverlayBottomMask",window.top.document).hide():$("#AAEduOverlayBottomMask",window.top.document).show()}function s(n){var i="",f=n.data("key"),e=t.data.keyword[f]||t.data.synonym[f],r=t.data.details["k"+e],u;return typeof r=="undefined"?i:(u={eduUrl:function(){var n=t.eduUrl;return t.isPopUpNews?"javascript:gotoOpenerUrl('"+n+"')":n},keyword:function(){switch(APP_LANG){case"eng":return r.key_en;case"chn":return r.key_sc;case"chi":default:return r.key}},keyword_en:r.key_en,desp:function(){switch(APP_LANG){case"eng":return r.desp_en;case"chn":return r.desp_sc;case"chi":default:return r.desp}},desp_en:r.desp_en,formula_type:function(){switch(APP_LANG){case"eng":return r.formula_type_en;case"chn":case"chi":default:return r.formula_type}},formula:function(){switch(APP_LANG){case"eng":if(r.formula_type_en!=null){if(r.formula_type_en.toLowerCase()=="text")return r.formula_en;if(r.formula_type_en.toLowerCase()=="image")return'<img src="'+r.formula_en+'" />'}return null;case"chn":if(r.formula_type!=null){if(r.formula_type.toLowerCase()=="text")return r.formula_sc;if(r.formula_type.toLowerCase()=="image")return'<img src="'+r.formula+'" />'}return null;case"chi":default:if(r.formula_type!=null){if(r.formula_type.toLowerCase()=="text")return r.formula;if(r.formula_type.toLowerCase()=="image")return'<img src="'+r.formula+'" />'}return null}},videoCover:function(){return r.video!=null?t.videoCoverPath+r.video:null},videoUrl:function(){return r.video_id!=null?t.videoPath+r.video_id:null}},i+='<div class="title"> ',i+='    <div class="float_l">',i+='        <div class="keyword tc">'+u.keyword()+"<\/div>",APP_LANG!="eng"&&(i+='        <div class="keyword en">'+u.keyword_en+"<\/div>"),i+="    <\/div>",i+='    <div class="float_r txt_r">',i+='        <div class="edu_icon icon-edu-close-2 inline_block btnClose"><\/div>',i+='        <div class="btnEdu"><a href="'+u.eduUrl()+'">'+t.label.edu+'<div class="edu_icon icon-edu-goto inline_block"><\/div><\/a><\/div>',i+="    <\/div>",i+='    <div class="clear"><\/div> ',i+="<\/div>",i+='<div class="sepline"><\/div>',i+='<div class="scrollcontent">',i+='    <div class="content">'+u.desp()+"<\/div>",u.formula_type()!=null&&u.formula()!=null&&(i+='    <div class="formula"> ',i+='        <div class="note-top"> ',i+='            <div class="text1">'+t.label.formula+"<\/div>",i+='            <div class="text2">'+u.formula()+"<\/div>",i+="        <\/div>",i+='        <div class="note-bottom"><\/div>',i+="    <\/div>"),APP_LANG!="eng"&&u.videoUrl()!=null&&u.videoCover()!=null&&(i+='    <div class="video">',i+='        <div class="vn-box inline_block">',i+=t.isPopUpNews?"            <a onclick=\"return gotoAATVUrl('"+u.videoUrl()+'\');" href="'+u.videoUrl()+'" target="AATV"> ':"            <a onclick=\"return gotoAATV('"+u.videoUrl()+'\');" href="'+u.videoUrl()+'" target="AATV"> ',i+='                <div class="vn-image"><img src="'+u.videoCover()+'"><\/div>',i+='                <div class="vn-desp">'+t.label.video+"<\/div>",i+='                <div class="vn-icon"><img src="'+t.videoIcon+'"><\/div>',i+="            <\/a>",i+="        <\/div>",i+="    <\/div>"),i+"<\/div>")}function r(){var t=$("#AAEduOverlayMask",window.top.document),i=$("#AAEduOverlayContainer",window.top.document),f=$(window.top).width(),r=$(window.top).height(),e=$(window.top.document).width(),o=$(window.top.document).height(),u,n;t.width(Math.max(f,e));t.height(Math.max(r,o));u=i.height();n=(r-u)/2;n<0&&(n=0);n+=$(window.top).scrollTop();i.css("margin-top",n+"px")}var i=this,t=$.extend(!0,{},{data:null,width:800,height:450,hideIfNotFound:!0,eduUrl:"",videoCoverPath:"",videoIcon:"",videoPath:"",label:{},isPopUpNews:!1,isNewsContent:!1,enableGA:!0},n);return u(),t.enableGA&&f(),this.ShowLayout=function(n,t){var i=$("#AAEduOverlayContainer",window.top.document),f=$("#AAEduOverlay",window.top.document),o=$("#AAEduOverlayMask",window.top.document),u=s(t);u!=""&&(i.empty(),i.html(u),o.show(),f.show(),e(),r(),$(window.top).bind("resize",r))},this.HideLayout=function(){var n=$("#AAEduOverlay",window.top.document),t=$("#AAEduOverlayMask",window.top.document);t.hide();n.hide();$(window.top).unbind("resize",r)},this.GAPush=function(){t.isNewsContent?_gaq.push(["edu._trackEvent","Education Center","Keyword Overlay","News Content"]):_gaq.push(["edu._trackEvent","Education Center","Keyword Overlay","Other Pages"])},this.each(function(){var n=$(this),r=n.data("key"),u=t.data.keyword[r]||t.data.synonym[r],f=t.data.details["k"+u];typeof f=="undefined"&&t.hideIfNotFound?n.hide():(n.show(),$(this).bind("click",function(r){r.stopPropagation();i.ShowLayout(r,n);t.enableGA&&i.GAPush()}))})};$.fn.DrawMiniChart=function(n){var t=$.extend({width:60,height:40,datatype:"D"},n);return this.each(function(){function c(n){$.ajax({url:"http://uschartdata1.internet.aastocks.com/servlet/iDataServlet/getdaily?type=24&market=1&level=-250&period=10&encoding=utf8&id="+u,async:!0,success:function(f){var e=new h;e.BindData(u,f,t.datatype,10);e.prevClose!=null&&(r=e.prevClose,i.attr("data-prev-close",e.prevClose));n(e)}})}function l(){i.css({width:e,height:o});var t=i;c(function(i){setTimeout(function(){n.series[0].data=i.dataPoint;var u=null;typeof r!="undefined"&&r!=""&&(u=parseFloat(r));s=="1"?(n.series[0].negativeColor="#e85e5f",n.series[0].color="#22ab55",n.chart.type="line",isNaN(u)||(n.series[0].threshold=u,n.yAxis.plotLines[0].value=u,f=="1"&&(n.yAxis.plotLines[0].label.text=u))):(n.series[0].borderColor="#0473A8",n.series[0].borderWidth=1,n.series[0].color="#0473A8",n.series[0].lineWidth=1.5,n.series[0].fillColor={linearGradient:{x1:0,x2:0,y1:0,y2:1},stops:[[0,"#3193B8"],[1,"#FFFFFF"]]},n.chart.type="area",isNaN(u)||(n.yAxis.plotLines[0].value=u,n.yAxis.plotLines[0].zIndex=55,f=="1"&&(n.yAxis.plotLines[0].label.text=u)));t.highcharts(n)},100)})}var i=$(this),e=i.attr("data-width")||t.width,o=i.attr("data-height")||t.height,u=i.attr("data-symbol"),s=i.attr("data-mode")||"1",f=i.attr("data-show-label")||"0",r=i.attr("data-prev-close"),n={chart:{marginLeft:0,marginRight:0,marginTop:0,marginBottom:0,backgroundColor:"transparent",type:"area"},rangeSelector:{selected:1},credits:{enabled:!1},legend:{enabled:!1},title:{text:null},plotOptions:{area:{borderColor:"#0473A8",color:"#0473A8",threshold:null,fillColor:{linearGradient:{x1:0,x2:0,y1:0,y2:1},stops:[[0,"#3193B8"],[1,"#FFFFFF"]]}}},xAxis:{labels:{enabled:!1},title:{text:null},gridLineWidth:0,lineWidth:0,tickWidth:0,plotLines:[{label:{enabled:!1},title:{text:null}}]},yAxis:{labels:{enabled:!1},title:{text:null},gridLineWidth:0,plotLines:[{label:{enabled:!0,align:"left",style:{fontSize:12,fontFamily:"arial"},x:5},color:"#c8c8c8",width:1,value:10,dashStyle:"Dot",title:{text:null}}]},tooltip:{enabled:!1},series:[{marker:{enabled:!1},enableMouseTracking:!1,color:"green",tooltip:{valueDecimals:2},lineWidth:1,data:null}]},h=function(){function u(t,i){var u=new r;u.x=i;u.d=t.DateString();u.t=t.TimeString();u.y=t.C;n.dataPoint.push(u);n._rawDataPoint.push(t)}function f(f,o,s){var rt=o.split("!"),k=0,p=new t,c,h,it,w;if(rt.length>0){c=rt[0].split("|");c.shift();c.shift();var b=e(i(f)),nt=new Date(b.valueOf()+(b.getTimezoneOffset()+480)*6e4),ut=new Date(nt.getTime()-9e5),ot=("0"+parseInt(nt.getMonth()+1)).slice(-2)+"/"+("0"+nt.getDate()).slice(-2),st=parseInt(("0"+ut.getHours()).slice(-2)+("0"+ut.getMinutes()).slice(-2)+"00"),d,tt="";if(c.length>0){for(h=c.length-1;h>=0;h--)if(c[h]!=""&&tt==""){tt=c[h].split(";")[0];break}for(h=0;h<c.length;h++)c[h]!=""&&(d=c[h].split(";"),h==4&&(p=new t,p.parsePoint(c[h]),n.prevClose=p.C),tt==d[0]&&(s=="D"&&ot==d[0]&&parseInt(d[1].replace(/:/g,""))>st||(p=new t,p.parsePoint(c[h]),u(p,k),k++)))}}n._rawDataPoint.length>0&&n._rawDataPoint[0].Hour()>=13&&(n._rawDataPoint=[],n.dataPoint=[]);var a=b.getFullYear(),v=b.getMonth(),y=b.getDate(),l=null;n._rawDataPoint.length>0?(it=n._rawDataPoint[n._rawDataPoint.length-1],l=new Date(a,v,y,it.Hour(),it.Minute(),0)):l=new Date(a,v,y,9,30,0);var g=new Date(a,v,y,12,5,0),ft=new Date(a,v,y,13,5,0),et=new Date(a,v,y,16,0,0);for(i(f)=="SH"||i(f)=="SZ"?(g=new Date(a,v,y,11,35,0),et=new Date(a,v,y,15,0,0)):i(f)=="US"&&(g=new Date(a,v,y,16,0,0),ft=new Date(a,v,y,16,0,0));l<et;)l=new Date(l.getTime()+3e5),l.getHours()==g.getHours()&&l.getMinutes()==g.getMinutes()&&(l=ft),w=new r,w.x=k,w.d=l.mmdd(),w.t=l.hhmmss(),w.y=null,n.dataPoint.push(w),k++}function i(n){return n.indexOf(".")>=0?n.split(".")[1]:""}function e(n){return n=="US"?new Date(ServerDate.getTime()+(-8+US_TIMEZONE)*36e5):new Date(ServerDate)}Array.prototype.max=function(){return Math.max.apply({},this)};Array.prototype.min=function(){return Math.min.apply({},this)};var n=this,r=function(){this.d=null;this.t=null;this.x=null;this.y=null},t=function(){this.Year=function(){return this.Date.split("/").length==3?this.Date.split("/")[2]:""};this.Month=function(){return this.Date.split("/")[0]};this.Day=function(){return this.Date.split("/")[1]};this.DateString=function(){return this.Date};this.FullDateTimeString=function(){return this.Year()==""?this.Date+" "+this.Time.split(":")[0]+":"+this.Time.split(":")[1]+":00":this.Date};this.TimeString=function(){return this.Time};this.Hour=function(){return this.Time&&this.Time.split(":").length==3?this.Time.split(":")[0]:""};this.Minute=function(){return this.Time.split(":").length==3?this.Time.split(":")[1]:""};this.Second=function(){return this.Time.split(":").length==3?this.Time.split(":")[2]:""};this.Diff=function(n){var t,i,u,f;if(this.Year()==""&&n.Year()==""||this.Year()!=""&&n.Year()!=""){if(i="",this.Year()==""){var r=new Date,u=new Date(r.getFullYear(),r.getMonth(),r.getDay(),this.Hour(),this.Minute(),this.Second()),f=new Date(r.getFullYear(),r.getMonth(),r.getDay(),n.Hour(),n.Minute(),n.Second());t=u.dateDiffFormat(f)}else u=new Date(this.Year(),parseInt(this.Month())-1,this.Day()),f=new Date(n.Year(),parseInt(n.Month())-1,n.Day()),t=u.dateDiffFormat(f);return t.d>0&&(i+=t.d+"d"),t.h>0&&(i+=t.h+"h"),t.m>0&&(i+=t.m+"m"),t.s>0&&(i+=t.s+"s"),i}return""}};t.prototype.splitData=function(n){return arguments.length==1?n.split(";"):n.split(arguments[1])};t.prototype._parseRawData=function(n,t){for(var i=0;i<n.length;i++)switch(n[i]){case"O":case"H":case"L":case"C":case"V":case"T":this[n[i]]=t[i]==undefined?null:parseFloat(t[i]);break;default:this[n[i]]=t[i]==undefined?"":t[i]}};t.prototype.parsePoint=function(n){n=this.splitData(n);n.length==8?this._parseRawData(["Date","Time","O","H","L","C","V","T"],n):this._parseRawData(["Date","O","H","L","C","V","T"],n);this.Pct=null};Date.prototype.mmdd=function(){var n=this.getMonth()+1,t=this.getDate();return[(n>9?"":"0")+n,(t>9?"":"0")+t].join("/")};Date.prototype.hhmmss=function(){var n=this.getHours(),t=this.getMinutes(),i=this.getSeconds();return[(n>9?"":"0")+n,(t>9?"":"0")+t,(i>9?"":"0")+i].join(":")};this.symbol="";this.dataPoint=[];this.isReady=!1;this.period=53;this._rawDataPoint=[];this.prevClose=null;this.BindData=function(n,t,i,r){f(n,t,i,r)}};i.attr("data-ready","1");typeof u!="undefined"&&l()})};$.fn.DrawIndexChart=function(n){function b(){var o,h,w,e;if(u.css({width:y,height:p}),o=u,r==undefined){o.empty();return}t.series[0].data=r.data;var n=null,b=null,k=null,i=null,f=null,d=0;iLowestX=0;iLength=r.data.length;typeof s!="undefined"&&s!=""&&(n=parseFloat(s));i=r.h;f=r.l;b=r.hv;k=r.lv;d=r.hIndex;iLowestX=r.lIndex;t.series[0].negativeColor="#eb8392";t.series[0].color="#5ec47e";t.chart.type="area";t.yAxis.maxPadding=0;h=Math.max(i,f);w=Math.min(i,f);isNaN(n)||(e=n,i!=null&&(t.yAxis.plotLines[1].value=i,l&&(t.yAxis.plotLines[1].label.text=parseInt(i).toLocaleString("en"),t.yAxis.plotLines[1].label.style.color=i>=n?a:v,t.yAxis.plotLines[1].label.y=10),t.yAxis.max=h,n>i&&(e=i)),f!=null&&(t.yAxis.plotLines[2].value=f,l&&(t.yAxis.plotLines[2].label.text=parseInt(f).toLocaleString("en"),t.yAxis.plotLines[2].label.style.color=f>=n?a:v,t.yAxis.plotLines[2].label.y=-3),t.yAxis.min=w,n<f&&(e=f)),t.series[0].threshold=e,t.yAxis.plotLines[0].value=e,c&&(t.yAxis.plotLines[0].label.text=parseInt(n)));t.series[0].fillColor={linearGradient:{x1:0,x2:0,y1:0,y2:1},stops:[[0,Highcharts.Color("#8cd6a3").setOpacity(.8).get("rgba")],[.4,Highcharts.Color("#8cd6a3").setOpacity(.03).get("rgba")]]};t.series[0].negativeFillColor={linearGradient:{x1:0,x2:0,y1:0,y2:1},stops:[[.6,Highcharts.Color("#f58797").setOpacity(.03).get("rgba")],[1,Highcharts.Color("#f58797").setOpacity(.8).get("rgba")]]};try{o.highcharts(t,function(){c&&!isNaN(n)&&this.yAxis.length>0&&this.yAxis[0].plotLinesAndBands.length>0&&this.yAxis[0].plotLinesAndBands[0].label!=null&&$(this.yAxis[0].plotLinesAndBands[0].label.element).html("<div style='background:#000; font-family:helvetica; padding:0px 5px !important; height:20px; line-height:20px; border-radius:10px; opacity:0.28; color:#fff;'>"+parseInt(this.yAxis[0].plotLinesAndBands[0].label.textStr).toLocaleString("en")+"<\/div>")})}catch(g){console.log(g.message)}}var e={width:60,height:40,tick:3,enablePrevCloseLabel:!0,enableHighLowLabel:!0,enableXAxisLabel:!0},u=$(this),y=u.attr("data-width")||e.width,p=u.attr("data-height")||e.height,o=u.attr("data-symbol"),s=u.attr("data-prev-close"),k=u.attr("data-high"),d=u.attr("data-low"),h=n.label&&n.label.x||115,i=n.tick||e.tick,c=typeof n.enablePrevCloseLabel=="boolean"?n.enablePrevCloseLabel:e.enablePrevCloseLabel,l=typeof n.enableHighLowLabel=="boolean"?n.enableHighLowLabel:e.enableHighLowLabel,w=typeof n.enableXAxisLabel=="boolean"?n.enableXAxisLabel:e.enableXAxisLabel,f;if(i==5){f=[0,29,65];switch(o){case"000001.SH":case"000300.SH":case"399001.SZ":f=[0,23,47];case"GDAXI":case"FTSE":case"FCHI":f=[0,101]}}else if(i==3){f=[0,49,109];switch(o){case"000001.SH":case"000300.SH":case"399001.SZ":f=[0,39,79];break;case"NDX.US":case"DJIA.US":case"SPX.US":f=[0,129]}}var a="#118a5b",v="#ec6579",r=n.data,t={chart:{marginRight:5,marginLeft:5,marginTop:7,marginBottom:20,spacing:[0,0,0,0],backgroundColor:"transparent",type:"area"},rangeSelector:{selected:1},credits:{enabled:!1},legend:{enabled:!1},title:{text:null},plotOptions:{area:{borderColor:"#0473A8",color:"#0473A8",threshold:null,startOnTick:!1,endOnTick:!1,fillColor:{linearGradient:{x1:0,x2:0,y1:0,y2:1},stops:[[0,"#3193B8"],[1,"#FFFFFF"]]}},series:{connectNulls:!0,animation:{duration:500}}},xAxis:{labels:{enabled:!0,formatter:function(){switch(o){case"110000":case"110010":case"110078":if(i==5){if(this.value==0)return"9:30";if(this.value==29)return"12:00";if(this.value==65)return"16:00"}else if(i==3){if(this.value==0)return"9:30";if(this.value==49)return"12:00";if(this.value==109)return"16:00"}break;case"000001.SH":case"000300.SH":case"399001.SZ":if(i==5){if(this.value==0)return"9:30";if(this.value==23)return"11:30";if(this.value==47)return"15:00"}else if(i==3){if(this.value==0)return"9:30";if(this.value==39)return"11:30";if(this.value==79)return"15:00"}break;case"NDX.US":case"DJIA.US":case"SPX.US":if(i==3){if(this.value==0)return"9:30";if(this.value==129)return"16:00"}break;case"GDAXI":case"FCHI":if(i==5){if(this.value==0)return"9:00";if(this.value==101)return"17:30"}break;case"FTSE":if(i==5){if(this.value==0)return"8:00";if(this.value==101)return"16:30"}}return""},style:{fontSize:12,fontFamily:"arial",color:"#a0a0a0"},y:14},title:{text:null},gridLineWidth:0,lineWidth:1,lineColor:"#e9e9e9",tickWidth:0,tickPositions:f,plotLines:[{label:{enabled:!1},title:{text:null}}]},yAxis:{labels:{enabled:!1},title:{text:null},gridLineWidth:0,startOnTick:!1,endOnTick:!1,plotLines:[{label:{enabled:!1,x:0,y:3,useHTML:!0,style:{fontSize:12,fontFamily:"helvetica",color:"#000"},formatter:function(){return this.options.label.text}},color:"#999999",width:1,value:10,dashStyle:"dot",title:{text:null},zIndex:999},{label:{enabled:!0,style:{fontSize:12,fontFamily:"helvetica",color:"#5ec47e"},x:h,y:0},color:"transparent",width:1,title:{text:null},zIndex:999},{label:{enabled:!0,style:{fontSize:12,fontFamily:"helvetica",color:"#5ec47e"},y:0,x:h},color:"transparent",width:1,title:{text:null},zIndex:999}]},tooltip:{enabled:!1},series:[{marker:{enabled:!1},enableMouseTracking:!1,color:"green",tooltip:{valueDecimals:2},lineWidth:1,data:null}]};t=$.extend(!0,{},t,n.chartOption);w||(t.chart.marginBottom=5,t.xAxis.lineWidth=0,t.xAxis.labels.enabled=!1);b()};$.fn.DrawQuotaChart=function(n){function a(){var f;if(r.css({width:h,height:c}),f=r,i==undefined){f.empty();return}t.series[0].data=i.data;var n=null,u=null,e=null,o=null,s=0;iLowestX=0;iLength=i.data.length;e=i.h;o=i.l;n=i.hv;u=i.lv;s=i.hIndex;iLowestX=i.lIndex;t.series[0].negativeColor="#FF7F95";t.series[0].color="#70D99E";t.chart.type="line";t.yAxis.maxPadding=0;t.series[0].threshold=0;u>0?t.yAxis.min=Math.abs((n-u)/10)*-1:n<0&&(t.yAxis.max=Math.abs((n-u)/10));f.highcharts(t)}var e={width:60,height:40,lang:"chi",bgImage:""},r=$(this),h=r.attr("data-width")||e.width,c=r.attr("data-height")||e.height,o=r.attr("data-symbol"),v=r.attr("data-prev-close"),s=n.lang||e.lang,l=n.bgImage||e.bgImage,u=3,f;if(u==5){f=[0,29,65];switch(o){case"999996.SH":case"999998.SH":case"999997.SZ":f=[0,23,47]}}else if(u==3){f=[0,49,109];switch(o){case"999996.SH":case"999998.SH":case"999997.SZ":f=[0,39,79]}}var i=n.data,t={chart:{marginLeft:5,marginTop:7,marginBottom:20,spacing:[0,0,0,0],backgroundColor:"transparent",type:"line",events:{load:function(){var n=(this.plotWidth-240)/2,t=(this.plotHeight-30)/2;this.renderer.image(l,n,t,240,30).add()}}},rangeSelector:{selected:1},credits:{enabled:!1},legend:{enabled:!1},title:{text:null},plotOptions:{series:{connectNulls:!0,animation:{duration:500}}},xAxis:{labels:{enabled:!0,formatter:function(){switch(o){case"999992.HK":case"999994.HK":case"999993.HK":if(u==5){if(this.value==0)return"9:30";if(this.value==29)return"12:00";if(this.value==65)return"16:00"}else if(u==3){if(this.value==0)return"9:30";if(this.value==49)return"12:00";if(this.value==109)return"16:00"}break;case"999996.SH":case"999998.SH":case"999997.SZ":if(u==5){if(this.value==0)return"9:30";if(this.value==23)return"11:30";if(this.value==47)return"15:00"}else if(u==3){if(this.value==0)return"9:30";if(this.value==39)return"11:30";if(this.value==79)return"15:00"}}return""},style:{fontSize:11,fontFamily:"arial",color:"#bcbcbc"},y:14},title:{text:null},gridLineWidth:0,lineWidth:1,lineColor:"#e9e9e9",tickWidth:0,tickPositions:f,plotLines:[{label:{enabled:!1},title:{text:null}}]},yAxis:{opposite:!0,lineWidth:0,lineColor:"#ccc",labels:{enabled:!0,formatter:function(){return this.value==0?'<span style="font-size:14px; color:#969DA3;">0<\/span>':s=="chi"?this.value/100+"億":s=="chn"?this.value/100+"亿":this.value/1e3+"B"},style:{fontSize:"12px",fontFamily:"arial",color:"#969DA3",textAlign:"center",minWidth:"40px",whiteSpace:"nowrap"},useHTML:!0},title:{text:null},gridLineWidth:0,startOnTick:!1,endOnTick:!0,tickWidth:0,tickAmount:4,plotLines:[{label:{x:0,y:3,useHTML:!0},color:"#cecece",width:1,value:0,title:{text:null},zIndex:999}]},tooltip:{enabled:!1},series:[{marker:{enabled:!1},enableMouseTracking:!1,color:"green",tooltip:{valueDecimals:2},lineWidth:2,data:null}]};t=$.extend(!0,{},t,n.chartOption);a()};$.fn.BrowseHistory=function(n){function o(){s()&&h()}function s(){switch(t.lang.toUpperCase()){case"SC":case"CHN":t.lang="CHN";i=1;break;case"EN":case"ENG":t.lang="ENG";i=2;break;default:t.lang="CHI";i=0}switch(t.market.toUpperCase()){}return t.target=$(f).find("tbody[ref-content='quoteHisContent']"),!0}function h(){$.ajax({url:t.url,async:!0,dataType:"json",error:function(){t.target.empty();t.target.append('<tr><td colspan="3" class="txt_c">'+r.errorMsg[i]+"<\/td><\/tr>")},success:function(n){if(n==1||n=="")$(f).remove();else switch(t.market){case"HK":c(n);e();break;case"CN":l(n);e()}}})}function e(){var i={rows:function(){return t.target.find("tr")},rowMasks:t.target.find("td > .rowMask"),btnRemoveOne_onclick:function(){u.push($(this).closest("tr").prev().attr("ref"));$(this).closest("tr").prev().remove();$(this).closest("tr").remove()},init:function(){for(var n=0;n<this.rowMasks.length;n++)$(this.rowMasks[n]).find("> .icon-ls-remove").bind("click",this.btnRemoveOne_onclick);return this.rowMasks.hide(),this}}.init(),r={container:t.target.find(".mode1"),btnEdit:t.target.find(".mode1 > .edit"),btnEdit_onclick:function(){r.container.hide();n.container.show();i.rowMasks.show()},init:function(){return this.container.show(),this.btnEdit.bind("click",this.btnEdit_onclick),this}}.init(),n={container:t.target.find(".mode2"),btnClearAll:t.target.find(".mode2 > .clearAll"),btnComplete:t.target.find(".mode2 > .complete"),btnClearAll_onclick:function(){n.container.hide();r.container.show();i.rowMasks.hide();i.rows().remove();n.setLsCookies("")},btnComplete_onclick:function(){n.container.hide();r.container.show();i.rowMasks.hide();n.saveSetting()},saveSetting:function(){var i=[],f="",r;switch(t.market){case"HK":i=AAUtility.GetHKSymbolListCookie();break;case"CN":i=AAUtility.GetCNSymbolListCookie()}for(r=0;r<u.length;r++){const n=i.indexOf(u[r]);n>-1&&i.splice(n,1)}switch(t.market){case"HK":i.reverse();f=i.join("%3B");break;case"CN":f="BrowserHistory="+i.join(",")}n.setLsCookies(f)},setLsCookies:function(n){var r=new Date,i;r.setTime(r.getTime()+31536e6);i="";switch(t.market){case"HK":i="LatestRTQuotedStocks";$.cookie(i,n,{expires:r,path:"/",domain:subCookiesDomain});break;case"CN":i="CNHK";$.cookie(i,n,{expires:r,path:"/",domain:fullCookiesDomain})}},init:function(){return this.container.hide(),this.btnClearAll.bind("click",this.btnClearAll_onclick),this.btnComplete.bind("click",this.btnComplete_onclick),this}}.init()}function c(n){var e=0,u="",f;t.target.empty();$.each(n,function(n,i){if(!i.symbol||i.symbol==""||e>=t.count)return!1;e++;u="";u+='<tr ref="'+encodeURIComponent(i.symwoex)+'">';u+="<td>";u+='<div class="rf1"><a class="cls name" title="'+i.desp+" "+i.symbol+'" href="javascript:hkquote(\''+encodeURIComponent(i.symwoex)+"')\" >"+i.desp+'<\/a><div class="clear"><\/div><\/div>';u+='<div><a class="cls sym" title="'+i.desp+" "+i.symbol+'" href="javascript:hkquote(\''+encodeURIComponent(i.symwoex)+"')\" >"+i.symbol+"<\/a><\/div>";u+="<\/td>";u+='<td class="txt_r cls bold nowrap">'+i.last+"<br/>&nbsp;<\/td>";u+='<td class="txt_r cls nowrap">'+i.chgwithpctchg+"<br/>"+i.wchg+"<\/td>";u+="<\/tr>";u+='<tr><td colspan="3" class="npad rel">';u+='<div class="rowMask"><div class="icon-ls-remove"><\/div><\/div>';u+="<\/td><\/tr>";f=i.lastupd;t.target.append(u)});f=r.lastUpdate[i]+':&nbsp;<span class="cls">'+f+"<\/span>";u="";u+="<tr>";u+='<td colspan="3" class="last" style="padding-top: 12px;">';u+='<div class="float_l std-remark99" style="line-height:26px;">'+f+"<\/div>";u+='<div class="float_r mode1"><div class="btn-std-round edit">'+r.edit[i]+"<\/div><\/div>";u+='<div class="float_r mode2"><div class="float_r btn-std-round complete">'+r.complete[i]+'<\/div><div class="float_r btn-std-round clearAll" style="margin-left:0px;">'+r.clearAll[i]+'<\/div><div class="clear"><\/div><\/div>';u+='<div class="clear"><\/div>';u+="<\/td>";u+="<\/tr>";t.target.append(u)}function l(n){var e=0,u="",f;t.target.empty();$.each(n,function(n,i){if(!i.symbol||i.symbol==""||e>=t.count)return!1;e++;u="";u+='<tr ref="'+encodeURIComponent(i.symbol)+'">';u+="<td>";u+='<div class="rf1"><a class="cls name" title="'+i.desp+" "+i.symbol+'" href="javascript:cnquote(\''+encodeURIComponent(i.symwoex)+"')\" >"+i.desp+'<\/a><div class="clear"><\/div><\/div>';u+='<div><a class="cls sym" title="'+i.desp+" "+i.symbol+'" href="javascript:cnquote(\''+encodeURIComponent(i.symwoex)+"')\" >"+i.symbol+"<\/a><\/div>";u+="<\/td>";u+='<td class="txt_r cls bold nowrap">'+i.last+"<br/>&nbsp;<\/td>";u+='<td class="txt_r cls nowrap">'+i.chgwithpctchg+"<br/>"+i.wchg+"<\/td>";u+="<\/tr>";u+='<tr><td colspan="3" class="npad rel">';u+='<div class="rowMask"><div class="icon-ls-remove"><\/div><\/div>';u+="<\/td><\/tr>";f=i.lastupd;t.target.append(u)});f=r.lastUpdate[i]+':&nbsp;<span class="cls">'+f+"<\/span>";u="";u+="<tr>";u+='<td colspan="3" class="last" style="padding-top: 12px;">';u+='<div class="float_l std-remark99" style="line-height:26px;">'+f+"<\/div>";u+='<div class="float_r mode1"><div class="btn-std-round edit">'+r.edit[i]+"<\/div><\/div>";u+='<div class="float_r mode2"><div class="float_r btn-std-round complete">'+r.complete[i]+'<\/div><div class="float_r btn-std-round clearAll" style="margin-left:0px;">'+r.clearAll[i]+'<\/div><div class="clear"><\/div><\/div>';u+='<div class="clear"><\/div>';u+="<\/td>";u+="<\/tr>";t.target.append(u)}var r={edit:["修改","修改","Edit"],complete:["完成","完成","Done"],clearAll:["清除所有","清除所有","Clear All"],lastUpdate:["更新","更新","Last Update"],errorMsg:["請稍後再試。","请稍后再试。","Please try again later."]},t=$.extend(!0,{market:"",url:"",count:10,lang:""},n),i=0,f=this,u=[];return o(),this};$.fn.FXCTBrowseHistory=function(n){function f(){var n={},f=AAUtility.GetCurrentTimeStr();t.SectionType=="FX"?(n.t=2,n.s=r,n.ts=f,n.h=MD5("t="+n.t+"&s="+n.s+"&ts="+n.ts)):(n.s=r,n.ts=f,n.h=MD5("s="+n.s+"&ts="+n.ts));$.ajax({url:t.datafeedUrl,data:n,async:!0,dataType:"json",error:function(){i.empty();t.SectionType=="FX"?i.append('<tr><td colspan="3" class="txt_c">'+t.errorMsg+"<\/td><\/tr>"):i.append('<tr><td colspan="4" class="txt_c">'+t.errorMsg+"<\/td><\/tr>");typeof t.callback=="function"&&t.callback([])},success:function(n){if(n==1||n=="")$(u).remove(),typeof t.callback=="function"&&t.callback([]);else{var r="",f;i.empty();typeof n.Data!="undefined"&&n.Data.length>0&&($.each(n.Data,function(n,u){if(n>=t.Count)return!1;r=t.SectionType=="CT"?o(u):e(u);i.append(r)}),f=t.LastUpdate+':&nbsp;<span class="BrowserHistoryLastUpdate cls">&nbsp;<\/span>',r="",r+="<tr>",r+='<td colspan="4" class="last" style="padding-top: 12px;">',r+='<div class="float_l std-remark99" style="line-height:26px;">'+f+(t.SectionType=="CT"?'<br/><span style="line-height:14px;">'+t.Hours24Data+"<\/span>":"")+"<\/div>",r+='<div class="float_r mode1"><div class="btn-std-round edit">'+t.Edit+"<\/div><\/div>",r+='<div class="float_r mode2"><div class="float_r btn-std-round complete">'+t.Complete+'<\/div><div class="float_r btn-std-round clearAll" style="margin-left:0px;">'+t.ClearAll+'<\/div><div class="clear"><\/div><\/div>',r+='<div class="clear"><\/div>',r+="<\/td>",r+="<\/tr>",i.append(r),s());typeof t.callback=="function"&&(t.SectionType=="CT"?t.callback(FXUtility.GetStreamingSymbols("divBrowseHistory_CT")):t.callback(FXUtility.GetStreamingSymbols("divBrowseHistory_FX")))}}})}function e(n){var r=n.Symbol.replace("/",""),i="";return i+='<tr class="_fxstream" data-symbol="'+r+'.IX" ref="'+encodeURIComponent(r)+'">',i+='<td class="cls">',i+=t.Lang=="eng"?'<div class="rf1"><a class="float_l name" title="'+r+'" href="javascript:fxquote(\''+r+"')\">"+r+"<\/a>":'<div class="rf1"><a class="float_l name" title="'+n.Desp+'" href="javascript:fxquote(\''+r+"')\">"+n.Desp+"<\/a>",i+='<div class="clear"><\/div><\/div>',i+="<\/td>",i+='<td class="txt_r cls bold nowrap"><div class="fxsq_last stream-flashing stream-last">&nbsp;<\/div><\/td>',i+='<td class="txt_r cls bold nowrap rel">',t.DisplayType==1&&(i+='<span class="fxsq_chg">&nbsp;<\/span><br />'),i+='<span class="fxsq_pctchg">&nbsp;<\/span>',i+="<\/td>",i+="<\/tr>",i+'<tr><td colspan="3" class="rel npad"><div class="rowMask"><div class="icon-ls-remove"><\/div><\/div><\/td><\/tr>'}function o(n){var i=n.Symbol.replace("/",""),t="";return t="",t+='<tr class="_fxstream" data-symbol="'+i.toLowerCase()+'.CT" ref="'+encodeURIComponent(i)+'">',t+='<td class="cls nborder" style="padding-bottom:0px;"><div class="rf1"><a class="float_l cls name" title="'+n.Desp+'" href="javascript:ctquote(\''+encodeURIComponent(i)+"')\" >"+i+'<\/a><div class="clear"><\/div><\/div><\/td>',t+='<td class="txt_r cls bold nborder nowrap" style="padding-bottom:0px;"><div class="fxsq_last stream-flashing stream-last">&nbsp;<\/div><\/td>',t+='<td class="txt_r cls nborder nowrap" style="padding-bottom:0px;"><span class="fxsq_pctchg">&nbsp;<\/span><\/td>',t+='<td class="txt_r cls bold nborder nowrap" style="padding-bottom:0px;"><span class="fxsq_turnover">&nbsp;<\/span><\/td>',t+="<\/tr>",t+='<tr><td colspan="4" class="font12 cls rel grey92" style="padding-top:0px;">',t+='<div class="rf1s" title="'+n.Desp+'">'+n.Desp+"<\/div>",t+='<div class="rowMask"><div class="icon-ls-remove"><\/div><\/div>',t+"<\/td><\/tr>"}function s(){var n,r={rows:function(){return i.find("tr")},rowMasks:i.find("td > .rowMask"),btnRemoveOne_onclick:function(){var t=$(this).closest("tr").prev("tr[ref]").attr("ref");$(this).closest("tr").prev("tr[ref]").remove();$(this).closest("tr").remove();n.removeHistory(t)},init:function(){for(var n=0;n<this.rowMasks.length;n++)$(this.rowMasks[n]).find("> .icon-ls-remove").bind("click",this.btnRemoveOne_onclick);return this.rowMasks.hide(),this}}.init(),u={container:i.find(".mode1"),btnEdit:i.find(".mode1 > .edit"),btnEdit_onclick:function(){u.container.hide();f.container.show();r.rowMasks.show();n=new AAPageData.fxHistory;n.load()},init:function(){return this.container.show(),this.btnEdit.bind("click",this.btnEdit_onclick),this}}.init(),f={container:i.find(".mode2"),btnClearAll:i.find(".mode2 > .clearAll"),btnComplete:i.find(".mode2 > .complete"),btnClearAll_onclick:function(){f.container.hide();u.container.show();r.rowMasks.hide();r.rows().remove();fxHistory=n;fxHistory.clearHistory(t.SectionType);fxHistory.save();typeof t.callback=="function"&&t.callback(FXUtility.GetStreamingSymbols("divBrowseHistory_FX"))},btnComplete_onclick:function(){f.container.hide();u.container.show();r.rowMasks.hide();fxHistory=n;fxHistory.save();typeof t.callback=="function"&&t.callback(FXUtility.GetStreamingSymbols("divBrowseHistory_FX"))},init:function(){return this.container.hide(),this.btnClearAll.bind("click",this.btnClearAll_onclick),this.btnComplete.bind("click",this.btnComplete_onclick),this}}.init()}function h(){var n=new AAPageData.fxHistory;return(n.load(),r=n.getHistoryParamString(t.SectionType),t.SkipSymbol!=""&&r!=""&&(r=(","+r).replace(","+t.SkipSymbol+",",","),r=r.substr(1,r.length-1)),r=="")?($(u).remove(),!1):!0}function c(){h()&&(i=$(u).find("tbody.quoteHisContent"),f())}var t=$.extend(!0,{datafeedUrl:"",DisplayType:"",SectionType:"",count:10,SkipSymbol:"",Lang:"",LastUpdate:"",Hours24Data:"",Edit:"",Complete:"",ClearAll:"",errorMsg:"",callback:null},n),u=this,i=null,r="";return c(),this};$.fn.InfoOverlay=function(n){function e(){var u,n,e;i.show();u=t.offset().top-i.outerHeight()-10;n=t.offset().left-i.outerWidth()/2+t.width()/2;r.alignLeftElement!=null&&(n=Math.max(n,$(r.alignLeftElement).offset().left));i.css({top:u,left:n});e=t.offset().left-n+t.width()/2-3.5;f.css("left",e)}function o(){i.hide()}function s(){if(r.content=="")t.hide();else{var n='<div class="InfoOverlay">';n+='<div class="InfoOverlay_Content"><\/div>';n+='<div class="InfoOverlay_arrow1"><div class="InfoOverlay_arrow2"><\/div><\/div>';n+="<\/div>";i=$(n).appendTo($("body"));u=i.find(".InfoOverlay_Content");u.html(r.content);u.css("text-align",r.textAlign);f=i.find(".InfoOverlay_arrow1");t.bind("mouseover",e);t.bind("mouseleave",o)}}var r=$.extend(!0,{textAlign:"center",content:"",alignLeftElement:null},n),t=this,i,u,f;return this.SetContent=function(n){u.html(n)},s(),this};$.fn.TradingHourNotice=function(n){function r(){var n='<div class="thNotice">';return n+='<div class="thNoticeBar">',n+='<div class="thNoticeTitle">'+i.title+"<\/div>",n+='<div class="thNoticeClose"><\/div>',n+='<div class="thNoticeMore">'+i.more+"<\/div>",n+="<\/div>",n+='<div class="thNoticeContent" style="display:none;">'+i.content+"<\/div>",n+"<\/div>"}function u(){t.find(".thNoticeContent").show();t.find(".thNoticeMore").text(i.less)}function f(){t.find(".thNoticeContent").hide();t.find(".thNoticeMore").text(i.more)}function e(){$.cookie("AATradingHourNotice")!=i.timestamp&&(t.html(r()),t.find(".thNoticeMore").bind("click",function(){t.find(".thNoticeContent").is(":visible")?f():u()}),t.find(".thNoticeClose").bind("click",function(){$.cookie("AATradingHourNotice",i.timestamp,{path:"/",domain:i.cookiesDomain});t.hideNotice()}))}var i=$.extend(!0,{title:"",content:"",more:"",less:"",timestamp:"",cookiesDomain:""},n),t=this;return this.showNotice=function(){$.cookie("AATradingHourNotice")==i.timestamp?t.hide():t.show()},this.hideNotice=function(){t.hide()},e(),this}}),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}})});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})}},GetCNSymbolListCookie:function(){var n=$.cookie("CNHK"),t="",r=[];if(n!=null&&n!=undefined&&n.length!="")for(n=n.split("&"),i=0;i<n.length;i++)if(n[i].split("=")[0].toUpperCase()=="BROWSERHISTORY"){t=n[i].split("=")[1];r=t.split(",");break}return r},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),isTablet:/(ipad|tablet|(android(?!.*mobile))|(windows(?!.*phone)(.*touch))|kindle|playbook|silk|(puffin(?!.*(IP|AP|WP))))/.test(window.navigator.userAgent.toLowerCase()),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)},isNumber:function(n){return!isNaN(parseFloat(n))&&isFinite(n)},GetNumber:function(n){return typeof n=="undefined"||n==null?NaN:parseFloat(n.toString().replace(/[\+\,\%\$]/g,""))},CheckIsNull:function(n,t){return typeof n=="undefined"||n==null||n==""?t:n},FormatPrice:function(n,t,i,r,u,f){var e,o;if(!this.isNumber(n)||!this.isNumber(t))return r;if(n==0&&(n=i,!this.isNumber(n)))return n;if(e=u?"#,##0":"###0",t==-1)n<100?e=e+".000":n>=100&&n<1e3&&(e=e+".00");else if(t==-5)n<100?e=e+".000":n>=100&&n<1e4&&(e=e+".00");else for(e=e+".",o=0;o<t;o++)e=e+"0";return n.toString().format(e)+f},FormatUnit:function(n,t,i,r,u,f){var o,e,s;if(!this.isNumber(n)||!this.isNumber(i))return u;if(n==0)return r;if(o="",n<0&&(o="-",n=Math.abs(n)),e=f?"#,##0":"###0",i==-1)n<100?e=e+".000":n>=100&&n<1e3&&(e=e+".00");else for(e=e+".",s=0;s<i;s++)e=e+"0";return o+this.FormatUnitLang(n,t,e)},FormatUnitLang:function(n,t,i){function r(n){return'<span class="unit">'+n+"<\/span>"}switch(t){case"chi":n=n>=1e8?(n/1e8).toString().format(i)+r("億"):n>=1e7?(n/1e7).toString().format(i)+r("千萬"):n>=1e6?(n/1e6).toString().format(i)+r("百萬"):n>=1e4?(n/1e4).toString().format(i)+r("萬"):n>=1e3?(n/1e3).toString().format(i)+r("千"):n;break;case"chn":n=n>=1e8?(n/1e8).toString().format(i)+r("亿"):n>=1e7?(n/1e7).toString().format(i)+r("千万"):n>=1e6?(n/1e6).toString().format(i)+r("百万"):n>=1e4?(n/1e4).toString().format(i)+r("万"):n>=1e3?(n/1e3).toString().format(i)+r("千"):n;break;case"eng":n=n>=1e9?(n/1e9).toString().format(i)+r("B"):n>=1e6?(n/1e6).toString().format(i)+r("M"):n>=1e3?(n/1e3).toString().format(i)+r("K"):n}return n},FormatPERatio:function(n,t,i,r,u,f){if(!this.isNumber(n)||!this.isNumber(i))return u;if(n<0)switch(t){case"chn":return"无盈利";case"eng":return"No Profit";default:return"無盈利"}else return n==0?u:this.FormatPrice(n,i,r,u,f,"")},FormatThousandSeparator:function(n){var r=n.toString().split("."),t=0,u="",i;if(r.length==2)for(t=r[1].length,i=0;i<t;i++)u+="0";return t>0?n.toString().format("#,##0."+u):n.toString().format("#,##0")},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)},PadLeft:function(n,t,i){for(var u="",r=n.toString().length;r<t;r++)u+=i;return u+n},IsEngName:function(n){var t=new RegExp(/^[a-zA-Z]/);return t.test(n)}},AADataCenter={GetStockRecentNews:function(n,t){var i=n.recordCount||10,r=n.isDefault||"",u=n.showImage?"Y":"N",f=n.mk||"hk",e=hostUrl;$.ajax({url:e+"resources/datafeed/getstockrecentnews.ashx",data:{rc:i,"default":r,img:u,mk:f},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 t={},u=3,r;if(u=n[3]=="SHEx"?2:3,t={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:"",anue_news_counter_chi:"",anue_news_counter_chn:"",glh_news_counter_chi:"",glh_news_counter_chn:"",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(r=0;r<n.length;r++)switch(r){case 0:t.id=n[r];break;case 1:t.s=n[r];break;case 2:t.name=n[r];break;case 3:t.exchangeMarket=n[r];break;case 4:t.weeklychg=n[r]=="N/A"?"-":i(n[r],u,"-","-",!0);break;case 5:t.exDate=n[r];break;case 6:t.ipoOfferingPrice=n[r];break;case 7:t.listingDate=n[r];break;case 8:t.last_update=n[r];break;case 9:t.prev_close=n[r];break;case 10:t.last=n[r]=="N/A"?"-":i(n[r],u,"-","-",!0);break;case 13:t.highlow_Indicator=n[r];break;case 14:t.news_counter_chi=n[r];break;case 15:t.news_counter_chn=n[r];break;case 16:t.news_counter_eng=n[r];break;case 17:t.highlow_Indicator=n[r]}else if(n.length==22){for(r=0;r<n.length;r++)switch(r){case 0:t.id=n[r];break;case 1:t.s=n[r];break;case 2:t.name=n[r];break;case 3:t.exchangeMarket=n[r];break;case 4:t.weeklychg=n[r]=="N/A"?"-":i(n[r],u,"-","-",!0);break;case 5:t.exDate=n[r];break;case 6:t.ipoOfferingPrice=n[r];break;case 7:t.listingDate=n[r];break;case 8:t.last_update=n[r];break;case 9:t.prev_close=n[r];break;case 10:t.last=n[r]=="N/A"?"-":i(n[r],u,"-","-",!0);break;case 13:t.highlow_Indicator=n[r];break;case 14:t.news_counter_chi=n[r];break;case 15:t.news_counter_chn=n[r];break;case 16:t.news_counter_eng=n[r];break;case 17:t.highlow_Indicator=n[r];break;case 18:t.anue_news_counter_chi=n[r];break;case 19:t.anue_news_counter_chn=n[r];break;case 20:t.glh_news_counter_chi=n[r];break;case 21:t.glh_news_counter_chn=n[r]}if(parseFloat(t.news_counter_chi)>=0||parseFloat(t.anue_news_counter_chi)>=0||parseFloat(t.glh_news_counter_chi)>=0){var f=parseFloat(t.news_counter_chi),e=parseFloat(t.anue_news_counter_chi),o=parseFloat(t.glh_news_counter_chi);t.news_counter_chi=(isNaN(f)?0:f)+(isNaN(e)?0:e)+(isNaN(o)?0:o)}if(parseFloat(t.news_counter_chn)>=0||parseFloat(t.anue_news_counter_chn)>=0||parseFloat(t.glh_news_counter_chn)>=0){var f=parseFloat(t.news_counter_chn),e=parseFloat(t.anue_news_counter_chn),o=parseFloat(t.glh_news_counter_chn);t.news_counter_chn=(isNaN(f)?0:f)+(isNaN(e)?0:e)+(isNaN(o)?0:o)}}return t}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()!=""},isPaidUser:function(){return this.isLoginUser()&&!(GetCookiesValue("Login","ucalc")=="0"&&GetCookiesValue("Login","broker")=="AASTOCKS")}},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},cnTopIndex:function(){function i(){AAUtility.setLocalStorage("AACNTopIndex",n)}function r(){var i=AAUtility.getLocalStorage("AACNTopIndex");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},usTopIndex:function(){function i(){AAUtility.setLocalStorage("AAUSTopIndex",n)}function r(){var i=AAUtility.getLocalStorage("AAUSTopIndex");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}};$.fn.AAMessage=function(n){function b(){var n="";r.hasClass("chi")?n="chi":r.hasClass("chn")?n="chn":r.hasClass("eng")&&(n="eng");n!=""&&(i.lang=n)}function k(){var n="";i.mode=="mobile"?(n+="<div id='aamessage' style='position:relative; padding:15px 15px 10px 15px; background-color:#d5dce1; display:none;'>",n+="<div id='aamessage_box' style='color:#47535c; font-size:14px; line-height:18px; text-align:left;'><\/div>",n+="<div id='aamessage_close' style='margin:10px auto 5px auto; width:110px; text-align:center; font-size:16px; line-height:28px; letter-spacing:1px; font-weight:500; color:#48535c; border:1px solid #48535c; border-radius:4px;'>"+l.close[i.lang]+"<\/div>",n+="<\/div>"):(n+="<div id='aamessage' style='position:relative; background-color:#d6dbe0; display:none;'>",n+="<div id='aamessage_box' style='position:relative; margin:0px auto; padding-top:10px; width:980px; color:#4a535b; font-size:13px; line-height:14px; text-align:center;'><\/div>",n+="<div style='position:absolute; top:calc(50% - 15px); left:0px; width:100%; height:30px; z-index:1;'>",n+="<div style='position:relative; margin:0px auto; width:980px;'>",n+="<div id='aamessage_close' style='float:right; padding:0px 10px; min-width:48px; text-align:center; font-size:15px; line-height:28px; color:#4a535b; border:1px solid #4a535b; border-radius:4px; cursor:pointer; z-index:1;'>"+l.close[i.lang]+"<\/div>",n+="<div style='clear:both;'><\/div>",n+="<\/div>",n+="<\/div>",n+="<\/div>");r.prepend(n);s=$("#aamessage");f=$("#aamessage #aamessage_box");$("#aamessage #aamessage_close").bind("click",g)}function v(){var n=AAUtility.getLocalStorage("AAMessage","msgread");n==null&&(n=[]);f.children().each(function(){var t=$(this).attr("data-id");$.inArray(t,n)==-1&&n.push(t)});AAUtility.setLocalStorage("AAMessage","msgread",n);$.each(t,function(n,t){typeof t.Open!="undefined"&&(t.Open.Read=!0);typeof t.Close!="undefined"&&(t.Close.Read=!0)})}function d(){var n=AAUtility.getLocalStorage("AAMessage","msgclosed");n==null&&(n=[]);f.children().each(function(){var t=$(this).attr("data-id");$.inArray(t,n)==-1&&n.push(t)});AAUtility.setLocalStorage("AAMessage","msgclosed",n);t={}}function g(){v();d();s.slideUp(400,"linear",function(){f.empty()})}function c(){var n=i.domain+i.url;$.ajax({url:n,async:!0,dataType:"json",error:function(){},success:function(n){tt(n)}})}function y(n){var t=n.split(/,/);return t.length==6?new Date(t[0],t[1]-1,t[2],t[3],t[4],t[5]):new Date}function p(n,t){var i=new Date(n.getTime()+t*1e3);return a>i}function h(n,t,i){var r=t+(i=="Close"?"c":"o");return $.inArray(r,n)>=0}function nt(n,t){return n.time>t.time?-1:n.time<t.time?1:0}function w(n){return n=""+n,n==""&&(n="00"),n.length==1&&(n="0"+n),n}function tt(n){var g,c,tt,l,e,b,it,o,r,k,d;if(a=y(n.ServerTime),g="TC",i.lang=="chn"&&(g="SC"),i.lang=="eng"&&(g="EN"),c=$.grep(n.Config,function(n){return n.Platform=="WEBSITE"}),c!=null&&c.length>0&&(u.Threshold=c[0].Threshold,u.ExpTime=c[0].ExpTime,u.LifeTime=c[0].LifeTime),tt=AAUtility.getLocalStorage("AAMessage","msgread"),tt==null&&(tt=[]),l=AAUtility.getLocalStorage("AAMessage","msgclosed"),l==null&&(l=[]),e=$.grep(n.Case,function(n){return n.IsWebsite}),e!=null&&e.length>0)for(r=0;r<e.length;r++)b=e[r].ID,it=e[r].Type,typeof t[b]=="undefined"&&(t[b]={}),typeof t[b][it]=="undefined"&&(t[b][it]={Time:y(e[r].Time),Message:e[r].Message[g],Read:h(tt,b,it)});for($.each(t,function(n,i){typeof i.Close!="undefined"?p(i.Close.Time,u.ExpTime)?delete t[n]:h(l,n,"Close")?delete t[n]:typeof i.Open!="undefined"&&(i.Open.Read?h(l,n,"Open")&&delete t[n].Open:(delete t[n].Open,p(i.Close.Time,u.LifeTime)&&delete t[n])):typeof i.Open!="undefined"&&h(l,n,"Open")&&delete t[n]}),o=[],$.each(t,function(n,t){typeof t.Open!="undefined"&&o.push({key:n+"o",time:t.Open.Time,text:t.Open.Message});typeof t.Close!="undefined"&&o.push({key:n+"c",time:t.Close.Time,text:t.Close.Message})}),o.sort(nt),f.empty(),r=0;r<o.length;r++)k=o[r],d="",d+=i.mode=="mobile"?"<div data-id='"+k.key+"' style='padding-bottom:10px; text-align:center;'>":"<div data-id='"+k.key+"' style='padding-bottom:10px; width:840px; margin:0px auto; text-align:center;'>",d+=k.text+" ("+w(k.time.getHours())+":"+w(k.time.getMinutes())+")",d+="<\/div>",f.append(d);o.length>0?s.show():s.hide();setTimeout(v,u.Threshold*1e3)}function it(){o._t!=null&&(clearTimeout(o._t),o._t=null);var n=!document.hidden||document.visibilityState=="visible";n?(c(),r.StartCheck()):o._t=setTimeout(function(){r.StopCheck()},o.int)}function rt(){b();k();c();r.StartCheck();var n,t,i={hidden:"visibilitychange",webkitHidden:"webkitvisibilitychange",mozHidden:"mozvisibilitychange",msHidden:"msvisibilitychange"};for(n in i)if(n in document){t=i[n];break}document.addEventListener(t,it)}var l={close:{chi:"關閉",chn:"关闭",eng:"Close"}},u={Threshold:10,ExpTime:86400,LifeTime:900},r=this,i=$.extend(!0,{},{domain:"http://wdata-dev.aastocks.com",url:"/apps/aamessage.json",lang:"chi",interval:120,mode:"website"},n),e=null,a=null,s=null,f=null,t={},o={int:2e3,_t:null};return this.StartCheck=function(){e!=null&&clearInterval(e);e=setInterval(c,i.interval*1e3)},this.StopCheck=function(){e!=null&&clearInterval(e)},rt(),this}