SharkGame.Lab={tabId:"lab",tabDiscovered:!1,tabName:"Laboratory",tabBg:"img/bg/bg-lab.png",sceneImage:"img/events/misc/scene-lab.png",sceneDoneImage:"img/events/misc/scene-lab-done.png",discoverReq:{resource:{science:10}},message:"Sort of just off to the side, the science sharks congregate and discuss things with words you've never heard before.",messageDone:"Sort of just off to the side, the science sharks quietly wrap up their badly disguised party and pretend to work.
Looks like that's it! No more things to figure out.",init:function(){var e=SharkGame.Lab;SharkGame.Tabs[e.tabId]={id:e.tabId,name:e.tabName,discovered:e.tabDiscovered,discoverReq:e.discoverReq,code:e},$.each(SharkGame.Upgrades,(function(e,a){SharkGame.Upgrades[e].purchased=!1}))},switchTo:function(){var e=SharkGame.Lab,a=$("#content"),r=e.allResearchDone(),s=r?e.messageDone:e.message,t=r?e.sceneDoneImage:e.sceneImage,i=$("
").html("All clear here!"))},update:function(){var e=SharkGame.Lab,a=$("#buttonList");$.each(SharkGame.Upgrades,(function(r,s){if(!s.purchased)if(0===$("#"+r).length){var t=!0;if(s.required&&(s.required.upgrades&&$.each(s.required.upgrades,(function(e,a){t=!!SharkGame.Upgrades[a]&&(t&&SharkGame.Upgrades[a].purchased)})),t=t&&e.isUpgradePossible(r)),t){var i=SharkGame.Lab.getResearchEffects(s),n=SharkGame.Button.makeButton(r,s.name+"
"+s.desc+"
"+i,a,e.onLabButton);e.updateLabButton(r),SharkGame.Settings.current.showAnimations&&n.hide().css("opacity",0).slideDown(50).animate({opacity:1},50)}}else e.updateLabButton(r)}))},updateLabButton:function(e){var a,r=SharkGame.Resources,s=$("#"+e),t=SharkGame.Upgrades[e],i=t.cost;a=!!$.isEmptyObject(i)||r.checkResources(i);var n=SharkGame.Lab.getResearchEffects(t,!a),c=t.name+"
"+t.desc+"
"+n,d=r.resourceListToString(i,!a);""!=d&&(c+="
Cost: "+d),s.prop("disabled",!a).html(c);var o="technologies/"+e;if("off"!==SharkGame.Settings.current.iconPositions){var h=SharkGame.changeSprite(SharkGame.spriteIconPath,o,null,"general/missing-technology");h&&(h.addClass("button-icon-"+SharkGame.Settings.current.iconPositions),a?s.prepend(h):s.prepend($("