var SharkGame=SharkGame||{};$.extend(SharkGame,{GAME_NAMES:["Five Seconds A Shark","Next Shark Game","Next Shark Game: Barkfest","Sharky Clicker","Weird Oceans","Angry Sharks","Super Shark Bros.","Grand Shark Auto V","Sharky the Hedgehog","Shark Crush Saga","You Have To Name The Shark Game","Shark A Lark","Sharknite","Sharkcraft","Mineshark","CS Shark","Among Shark","League of Sharks","Apex Sharks","Shark world","Bark Shark","Fin Idle","Ray of Dreams","Shark Saver","Shoal Sharker","Shark Souls","Saucy Sharks","Sharkfall","Heart of Sharkness","Sharks and Recreation","Alone in the Shark","Sharkpocalypse","Shark of Darkness","Strange Oceans"],GAME_NAME:null,ACTUAL_GAME_NAME:"Idle Shark",VERSION:.71,VERSION_NAME:"Stranger Oceans",EPSILON:1e-6,INTERVAL:100,dt:.1,before:new Date,timestampLastSave:!1,timestampGameStart:!1,timestampRunStart:!1,timestampRunEnd:!1,sidebarHidden:!0,paneGenerated:!1,gameOver:!1,wonGame:!1,credits:"

This game was originally created for my dear friend Sach.
(Rest in peace sach)

It was made by who has a cool website
Thank you for playing

",ending:"

Congratulations! You did it.
You saved the sharks!

The gate leads away from this strange ocean...

Back home to the oceans you came from!

Or are they?

",help:'

This game is a game about discovery, resources, and does not demand your full attention. You are free to pay as much attention to the game as you want. It will happily run in the background, and works even while closed.

To begin, you should catch fish. Once you have some fish, more actions will become available. If you have no idea what these actions do, click the "Toggle descriptions" button for more information.

If you are ever stuck, try actions you haven\'t yet tried. Remember, though, that sometimes patience is the only way forward. Patience and ever escalating numbers.

',donate:"

You can donate to help save sharks and mantas!

Seems only fitting, given this game was made for a charity.

Please help the sharkies

",spriteIconPath:"img/sharksprites.png",spriteHomeEventPath:"img/sharkeventsprites.png",choose:function(e){return e[Math.floor(Math.random()*e.length)]},log10:function(e){return Math.log(e)/Math.LN10},plural:function(e){return 1===e?"":"s"},colorLum:function(e,a){(e=String(e).replace(/[^0-9a-f]/gi,"")).length<6&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]),a=a||0;var t,r,n="#";for(r=0;r<3;r++)t=parseInt(e.substr(2*r,2),16),n+=("00"+(t=Math.round(Math.min(Math.max(0,t+t*a),255)).toString(16))).substr(t.length);return n},getImageIconHTML:function(e,a,t){e||(e="http://placekitten.com/g/"+Math.floor(a)+"/"+Math.floor(t));var r="";return"off"!==SharkGame.Settings.current.iconPositions&&(r+=""),r},changeSprite:function(e,a,t,r){var n=SharkGame.Sprites[a];return t||(t=$("
")),n||(n=SharkGame.Sprites[r]),n?(t.css("background-image","url("+e+")"),t.css("background-position","-"+n.frame.x+"px -"+n.frame.y+"px"),t.width(n.frame.w),t.height(n.frame.h)):(t.css("background-image",'url("//placehold.it/50x50")'),t.width(50),t.height(50)),t}}),SharkGame.TitleBar={saveLink:{name:"save",main:!0,onClick:function(){try{try{SharkGame.Save.saveGame()}catch(e){SharkGame.Log.addError(e),console.log(e)}SharkGame.Log.addMessage("Saved game.")}catch(e){SharkGame.Log.addError(e.message)}}},optionsLink:{name:"options",main:!0,onClick:function(){SharkGame.Main.showOptions()}},changelogLink:{name:"changelog",main:!1,onClick:function(){SharkGame.Main.showChangelog()}},helpLink:{name:"help",main:!0,onClick:function(){SharkGame.Main.showHelp()}},skipLink:{name:"skip",main:!0,onClick:function(){SharkGame.Main.isFirstTime()?confirm("Do you want to reset your game?")&&SharkGame.Main.init():confirm("Is this world causing you too much trouble? Want to go back to the gateway?")&&(SharkGame.wonGame=!1,SharkGame.Main.endGame())}},creditsLink:{name:"credits",main:!1,onClick:function(){SharkGame.Main.showPane("Credits",SharkGame.credits)}},donateLink:{name:"donate",main:!1,onClick:function(){SharkGame.Main.showPane("Donate",SharkGame.donate)}}},SharkGame.Tabs={current:"home"},SharkGame.Main={tickHandler:-1,autosaveHandler:-1,beautify:function(e,a){var t;if(e===Number.POSITIVE_INFINITY)t="infinite";else if(e<1&&e>=0)t=a?"0":e>.001?e.toFixed(2)+"":e>1e-4?e.toFixed(3)+"":0;else{var r=!1;e<0&&(r=!0,e*=-1);var n=["","K","M","B","T","Qa","Qi","Sx","Sp","Oc"],o=Math.floor(SharkGame.log10(e)),i=2-Math.floor(SharkGame.log10(e))%3;i=Math.max(0,i);var s,h=Math.floor(o/3);h>=n.length?t="lots":(s=n[h],h>0&&(e/=Math.pow(1e3,h)),t=0===h?(r?"-":"")+Math.floor(e)+s:h>0?(r?"-":"")+e.toFixed(i)+s:(r?"-":"")+e.toFixed(i))}return t},formatTime:function(e){var a=e/1e3,t="";if(a>60){var r=Math.floor(a/60);if(r>60){var n=Math.floor(a/3600);if(n>24){var o=Math.floor(n/24);if(o>7){var i=Math.floor(o/7);if(i>4){var s=Math.floor(i/4);if(s>12)t+=Math.floor(s/12)+"Y, ";t+=(s%=12)+"M, "}t+=(i%=4)+"W, "}t+=(o%=7)+"D, "}t+=(n%=24)+":"}t+=((r%=60)<10?"0"+r:r)+":"}return a%=60,t+=(a=Math.floor(a))<10?"0"+a:a},toTitleCase:function(e){return e.replace(/\w\S*/g,(function(e){return e.charAt(0).toUpperCase()+e.substr(1).toLowerCase()}))},init:function(){var e=new Date;SharkGame.before=e,null===SharkGame.GAME_NAME&&(SharkGame.GAME_NAME=SharkGame.choose(SharkGame.GAME_NAMES),document.title=SharkGame.ACTUAL_GAME_NAME+": "+SharkGame.GAME_NAME),$("#sidebar").hide();var a=$("#overlay");if(a.hide(),$("#gameName").html("- "+SharkGame.GAME_NAME+" -"),$("#versionNumber").html("v "+SharkGame.VERSION+" — "+SharkGame.VERSION_NAME),SharkGame.sidebarHidden=!0,SharkGame.gameOver=!1,$("#pane").removeClass("gateway"),a.removeClass("gateway"),SharkGame.timestampLastSave=SharkGame.timestampLastSave||e.getTime(),SharkGame.timestampGameStart=SharkGame.timestampGameStart||e.getTime(),SharkGame.timestampRunStart=SharkGame.timestampRunStart||e.getTime(),$.each(SharkGame.Settings,(function(e,a){"current"!==e&&(void 0===SharkGame.Settings.current[e]&&(SharkGame.Settings.current[e]=a.defaultSetting))})),SharkGame.Resources.init(),SharkGame.World.init(),SharkGame.World.apply(),SharkGame.Gateway.init(),SharkGame.Gateway.applyArtifacts(),SharkGame.Log.clearMessages(),SharkGame.Home.init(),SharkGame.Lab.init(),SharkGame.Stats.init(),SharkGame.Recycler.init(),SharkGame.Gate.init(),SharkGame.Reflection.init(),SharkGame.Main.setUpTitleBar(),SharkGame.Tabs.current="home",SharkGame.Save.savedGameExists())try{SharkGame.Save.loadGame(),SharkGame.Log.addMessage("Loaded game.")}catch(e){SharkGame.Log.addError(e.message)}SharkGame.Main.isFirstTime()&&(SharkGame.TitleBar.skipLink.name="reset",SharkGame.Main.setUpTitleBar()),SharkGame.Home.discoverActions(),SharkGame.Main.setUpTab(),-1===SharkGame.Main.tickHandler&&(SharkGame.Main.tickHandler=setInterval(SharkGame.Main.tick,SharkGame.INTERVAL)),-1===SharkGame.Main.autosaveHandler&&(SharkGame.Main.autosaveHandler=setInterval(SharkGame.Main.autosave,6e4*SharkGame.Settings.current.autosaveFrequency))},tick:function(){if(SharkGame.gameOver)SharkGame.Gateway.update();else{var e=(new Date).getTime()-SharkGame.before.getTime(),a=SharkGame.Resources,t=SharkGame.Main;SharkGame.sidebarHidden&&t.showSidebarIfNeeded(),e>SharkGame.INTERVAL?t.processSimTime(SharkGame.dt*(e/SharkGame.INTERVAL)):t.processSimTime(SharkGame.dt),a.updateResourcesTable(),SharkGame.Tabs[SharkGame.Tabs.current].code.update(),t.checkTabUnlocks(),SharkGame.before=new Date}},checkTabUnlocks:function(){$.each(SharkGame.Tabs,(function(e,a){if("current"!==e&&!a.discovered){var t=!0;a.discoverReq.resource&&(t=t&&SharkGame.Resources.checkResources(a.discoverReq.resource,!0)),a.discoverReq.upgrade&&$.each(a.discoverReq.upgrade,(function(e,a){t=!!SharkGame.Upgrades[a]&&(t&&SharkGame.Upgrades[a].purchased)})),t&&(SharkGame.Main.discoverTab(e),SharkGame.Log.addDiscovery("Discovered "+a.name+"!"))}}))},processSimTime:function(e){SharkGame.Resources.processIncomes(e)},autosave:function(){try{SharkGame.Save.saveGame(),SharkGame.Log.addMessage("Autosaved.")}catch(e){SharkGame.Log.addError(e.message),console.log(e.trace)}},setUpTitleBar:function(){var e=$("#titlemenu"),a=$("#subtitlemenu");e.empty(),a.empty(),$.each(SharkGame.TitleBar,(function(t,r){var n="
  • "+r.name+"
  • ";r.main?e.append(n):a.append(n),$("#"+t).click(r.onClick)}))},setUpTab:function(){var e=SharkGame.Tabs,a=$("#content");a.empty(),a.append('
    '),SharkGame.Main.createTabNavigation(),SharkGame.Main.createBuyButtons(),e[e.current].code.switchTo()},createTabMenu:function(){SharkGame.Main.createTabNavigation(),SharkGame.Main.createBuyButtons()},createTabNavigation:function(){var e=SharkGame.Tabs,a=$("#tabList");a.empty();var t=0;$.each(e,(function(e,a){a.discovered&&t++})),t>1&&$.each(e,(function(e,t){var r=SharkGame.Tabs.current===e;if(t.discovered){var n=$("
  • ");r?n.html(t.name):n.append($("").attr("id","tab-"+e).attr("href","javascript:;").html(t.name).click((function(){var e=$(this).attr("id").split("-")[1];SharkGame.Main.changeTab(e)}))),a.append(n)}}))},createBuyButtons:function(e){var a=$("#tabButtons");a.empty(),$.each(SharkGame.Settings.buyAmount.options,(function(t,r){var n=r,o=r===SharkGame.Settings.current.buyAmount;a.prepend($("
  • ").append($("