/*! (c) 2017 Jagex Limited */ document.domain="runescape.com";var OSRS=OSRS||{};OSRS.global={trackingPixel:function(a){return $.ajax({url:"https://www.runescape.com/track/"+a,dataType:"jsonp",success:function(){}}),!1},init:function(){}},OSRS.home={init:function(){}},OSRS.accountCreation={trackForm:function(){$("#submit").on("click",function(){$("#create-account-form")[0].checkValidity()?$("#news-updates").hasClass("checked")?OSRS.global.trackingPixel(OS_TRACKING_ACCOUNT_CREATION_REQUESTED_VALID_OPT_IN):OSRS.global.trackingPixel(OS_TRACKING_ACCOUNT_CREATION_REQUESTED_VALID_OPT_OUT):$("#news-updates").hasClass("checked")?OSRS.global.trackingPixel(OS_TRACKING_ACCOUNT_CREATION_REQUESTED_INVALID_OPT_IN):OSRS.global.trackingPixel(OS_TRACKING_ACCOUNT_CREATION_REQUESTED_INVALID_OPT_OUT)})},trackCongratulations:function(){OSRS.global.trackingPixel(OS_TRACKING_SUCCESS_PAGE_LOADED),$("#account-resend").on("click",function(a){a.preventDefault(),OSRS.global.trackingPixel(OS_TRACKING_RESEND_EMAIL_CLICKED),window.location=$(this).attr("href")}),$("#account-wrong").on("click",function(a){a.preventDefault(),OSRS.global.trackingPixel(OS_TRACKING_CHANGE_EMAIL_CLICKED),window.location=$(this).attr("href")})},nameSuggestions:function(){$("#charactername").on("change",function(){displayNameValid=!1,OSRS.accountCreation.validateName($(this).val())}),$("#characternameAltsMore").on("click",function(){cachedNameSuggestions=null,$(this).removeClass("account-form__suggestions-more--show"),OSRS.accountCreation.validateName($("#charactername").val())}),$("#characternameAltsClose").on("click",function(){OSRS.accountCreation.hideNameSuggestions()})},exists:function(a){return null!=a&&void 0!=a&&0!=a.length},isValid:function(a){return!(!OSRS.accountCreation.exists(a)||"true"!=a)},validateName:function(a){if(a||""!=a){var b={};b.displayname=encodeURIComponent(a),null!=cachedNameSuggestions&&void 0!=cachedNameSuggestions&&cachedNameSuggestions.length>0&&(b.noNameSuggestions=!0),$.ajax({type:"POST",cache:!1,url:accountCreationUrl+"g=oldscape/check_displayname.ajax",data:b,success:OSRS.accountCreation.handleResults,dataType:"json"})}},handleResults:function(a){if(OSRS.accountCreation.exists(a.displayNameIsValid)&&!OSRS.accountCreation.isValid(a.displayNameIsValid))if(OSRS.accountCreation.exists(cachedNameSuggestions)&&cachedNameSuggestions.length>0)OSRS.accountCreation.showNameSuggestions(cachedNameSuggestions);else if(OSRS.accountCreation.exists(a.nameSuggestions)&&a.nameSuggestions.length>0){var b=a.nameSuggestions;OSRS.accountCreation.showNameSuggestions(b),cachedNameSuggestions=b}else OSRS.accountCreation.hideNameSuggestions(),displayNameValid=!0;else OSRS.accountCreation.hideNameSuggestions(),displayNameValid=!0},showNameSuggestions:function(a){var b=$("#characternameAltsInner"),c="";$("#characternameAlts").addClass("account-form__suggestions--show"),$.each(a,function(a,b){c+=''+b+""}),b.html(c),$(".account-form__suggestions-name").on("click",function(){$("#charactername").val($(this).text()),displayNameValid=!0,OSRS.accountCreation.hideNameSuggestions()}),$("#characternameAltsMore").addClass("account-form__suggestions-more--show")},hideNameSuggestions:function(){$("#characternameAlts").removeClass("account-form__suggestions--show")},checkPasswordsMatch:function(){var a=$("#password1"),b=$("#password2");b.on("change",function(){a.val()!=b.val()&&""!=a.val()&&""!=b.val()?b[0].setCustomValidity(passwordMatchString):b[0].setCustomValidity("")})},confirmCaptcha:function(){var a=$("#create-account-form"),b=$("#g-recaptcha");b.length&&"undefined"!=typeof grecaptcha&&a.on("submit",function(a){return""!=grecaptcha.getResponse()?(b.removeClass("account-form__captcha--error"),!0):(b.addClass("account-form__captcha--error"),!1)})},init:function(a){switch(a){case"create-account--congratulations":this.trackCongratulations();break;case"create-account--create":this.trackForm(),this.nameSuggestions(),this.checkPasswordsMatch(),this.confirmCaptcha()}}},OSRS.gamePage={javaVersion:"1.6.0_10+",hasJava:!1,hasMac:!1,isChrome:!1,showThanksScreen:function(){$("#thanksScreen").addClass("thanks-screen--show"),$("#launchingScreen,#unsupportedScreen").remove()},showInstallScreen:function(){var a=JXGLOBAL.user.os();if($("#installScreen").addClass("install-screen--show"),$("#launchingScreen,#thanksScreen,#unsupportedScreen").remove(),a.isMac){var b=_.filter(JXGLOBAL.client,function(a){return a.platform.indexOf("OSX")>-1});$("#downloadClientBtn").attr("href",baseClientURL+b[0].filename+"?"+b[0].version),$("#fileSize").html(b[0].filename+"?"+b[0].size)}else{var c=_.filter(JXGLOBAL.client,function(a){return a.platform.indexOf("Windows")>-1});$("#downloadClientBtn").attr("href",baseClientURL+c[0].filename+"?"+c[0].version),$("#fileSize").html(c[0].filename+"?"+c[0].size)}},showUnsupportedScreen:function(){$("#unsupportedScreen").addClass("unsupported-screen--show"),$("#launchingScreen,#thanksScreen,#installScreen").remove()},showGame:function(){var a=$("#gameFrame");a.attr("src",worldLink),a.addClass("game-frame--show"),$("#noJavaScreens").remove(),$("#chromeError").remove()},init:function(){$("#noJsError").remove(),$(".not-loading").addClass("not-loading--show");var a=JXGLOBAL.user.os();if(OSRS.gamePage.hasJava=deployJava.versionCheck(OSRS.gamePage.javaVersion),OSRS.gamePage.hasJava&&!a.isMac)OSRS.gamePage.showGame();else{$("#gameFrame").remove(),$(".not-loading__link").on("click",function(){OSRS.gamePage.showInstallScreen()});var b=JXGLOBAL.user.browser(),c=null;if(b.isChrome?(c="chrome",$("#chromeError").addClass("chrome-error--show")):b.isFirefox?c="mozilla":b.isIE?c="msie":b.isEdge&&(c="edge"),b.isEdge)OSRS.gamePage.showInstallScreen();else{checkProtocol(gameProtocol,c);setTimeout(function(){if(protocolSupport[gameProtocol])OSRS.gamePage.showThanksScreen();else{var a=JXGLOBAL.user.os(),b=a.installerMatch();null!==b?OSRS.gamePage.showInstallScreen():RS3.gamePage.showUnsupportedScreen()}},7e3)}}}},OSRS.grandExchange={data:null,options:null,chartObj:null,formatter:null,tradeData:null,tradeOptions:null,tradeChartObj:null,ticker:function(){var a=$("#ticker"),b=a.find(".ticker-wrap");b.webTicker({speed:50,direction:"left",moving:!0,startEmpty:!1,duplicate:!1,rssurl:!1,rssfrequency:0,updatetype:"reset"})},chart:function(){OSRS.grandExchange.formatter=new google.visualization.NumberFormat({pattern:"#,###"}),this.drawChart(average30,trade30),$("#filter a").on("click",function(a){a.preventDefault();var b,c,d=$(this),e=d.parent(),f=d.parents("ul");e.hasClass("active")||(f.find(".active").removeClass("active"),e.addClass("active"),b=window["average"+d[0].hash.substr(1)],c=window["trade"+d[0].hash.substr(1)],OSRS.grandExchange.data=google.visualization.arrayToDataTable(b),OSRS.grandExchange.tradeData=google.visualization.arrayToDataTable(c),b==average30?OSRS.grandExchange.options.pointSize=5:OSRS.grandExchange.options.pointSize=3,OSRS.grandExchange.formatter.format(OSRS.grandExchange.data,1),OSRS.grandExchange.formatter.format(OSRS.grandExchange.tradeData,1),$("#toggleTrend").is(":checked")?OSRS.grandExchange.formatter.format(OSRS.grandExchange.data,2):OSRS.grandExchange.data.removeColumn(2),OSRS.grandExchange.renderChart(),OSRS.grandExchange.renderTradeChart())}),$("#toggleTrend").on("change",function(){if($(this).is(":checked")){var a=window["average"+$("#filter .active a")[0].hash.substr(1)];OSRS.grandExchange.data=google.visualization.arrayToDataTable(a),OSRS.grandExchange.formatter.format(OSRS.grandExchange.data,1),OSRS.grandExchange.formatter.format(OSRS.grandExchange.data,2)}else OSRS.grandExchange.data.removeColumn(2);OSRS.grandExchange.renderChart()})},drawChart:function(a,b){var c=JXGLOBAL.user.browser();OSRS.grandExchange.data=google.visualization.arrayToDataTable(a),OSRS.grandExchange.tradeData=google.visualization.arrayToDataTable(b),OSRS.grandExchange.data.removeColumn(2),OSRS.grandExchange.formatter.format(OSRS.grandExchange.data,1),OSRS.grandExchange.formatter.format(OSRS.grandExchange.tradeData,1),OSRS.grandExchange.options={animation:{duration:1e3,startup:!0},chartArea:{left:60,height:"90%",width:"85%",backgroundColor:{stroke:"#382418",strokeWidth:2}},backgroundColor:"transparent",legend:{position:"none"},pointSize:5,pointShape:"circle",pointsVisible:!0,series:{0:{color:"#78adff"},1:{color:"#ff6100"}},hAxis:{baselineColor:"#382418",textStyle:{color:"white"},gridlines:{color:"#382418",count:-1},minorGridlines:{color:"transparent",count:0},titleTextStyle:{color:"transparent"}},vAxis:{baselineColor:"#382418",format:"short",textStyle:{color:"white"},gridlines:{color:"#382418",count:-1},title:"GP",titleTextStyle:{color:"white"}},width:587},OSRS.grandExchange.tradeOptions={animation:{duration:1e3,startup:!0},backgroundColor:"transparent",chartArea:{left:60,height:"90%",width:"85%",backgroundColor:{stroke:"#382418",strokeWidth:2}},legend:{position:"none"},hAxis:{baselineColor:"#382418",textStyle:{color:"white"},gridlines:{color:"transparent",count:-1},minorGridlines:{color:"transparent",count:0},titleTextStyle:{color:"transparent"}},series:{0:{color:"#78adff"}},vAxis:{baselineColor:"#382418",format:"short",textStyle:{color:"white"},gridlines:{color:"#382418",count:-1},title:"Total",titleTextStyle:{color:"white"},minValue:0,viewWindow:{min:0}},width:587},c.isChrome||(OSRS.grandExchange.options.hAxis.gridlines.color="transparent"),OSRS.grandExchange.chartObj=new google.visualization.LineChart(document.getElementById("itemchart")),this.renderChart(),showTradeVolumes&&(OSRS.grandExchange.tradeChartObj=new google.visualization.ColumnChart(document.getElementById("countchart")),this.renderTradeChart())},renderChart:function(){OSRS.grandExchange.chartObj.draw(OSRS.grandExchange.data,OSRS.grandExchange.options)},renderTradeChart:function(){OSRS.grandExchange.tradeChartObj.draw(OSRS.grandExchange.tradeData,OSRS.grandExchange.tradeOptions)},init:function(){$("#ticker").length&&this.ticker(),"undefined"!=typeof average30&&this.chart()}},OSRS.login={init:function(){"use strict";$("#login-form").on("submit",function(a){var b=$("#google-recaptcha"),c=$("#google-recaptcha-error");b.length&&"undefined"!=typeof grecaptcha&&""==grecaptcha.getResponse()&&(a.preventDefault(),c.addClass("c-google-recaptcha-error--visibility-show"),""!=$("#login-username").val()&&""!=$("#login-password").val()?$(".login-error").remove():c.removeClass("c-google-recaptcha-error--visibility-show"))})}},OSRS.logout={redirect:function(){"use strict";"undefined"!=typeof homeRedirect&&(location.href=homeRedirect)},init:function(){"use strict";setTimeout("OSRS.logout.redirect()",15e3)}},OSRS.openJDK={init:function(){$("#play-btn").on("click",function(){$("#failed-launch").addClass("failed-launch--show")})}},OSRS.premierClub={getPrices:function(){$.ajax({url:billingStoreUrl,timeout:3e3,dataType:"json",success:function(a){for(var b,c,d,e=0;e