game.js 552 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779
  1. var _STRINGS = {
  2. Ad: {
  3. Mobile: {
  4. Preroll: {
  5. ReadyIn: "The game is ready in ",
  6. Loading: "Your game is loading...",
  7. Close: "Close"
  8. },
  9. Header: {
  10. ReadyIn: "The game is ready in ",
  11. Loading: "Your game is loading...",
  12. Close: "Close"
  13. },
  14. End: {
  15. ReadyIn: "Advertisement ends in ",
  16. Loading: "Please wait ...",
  17. Close: "Close"
  18. }
  19. }
  20. },
  21. Splash: {
  22. Loading: "Loading ...",
  23. LogoLine1: "Some text here",
  24. LogoLine2: "powered by MarketJS",
  25. LogoLine3: "none"
  26. },
  27. Game: {
  28. SelectPlayer: "Select Player",
  29. Win: "You win!",
  30. Lose: "You lose!",
  31. Score: "Score",
  32. Time: "Time",
  33. pilotLevel: ["pilot level",
  34. 51, 195, 0.95, 0.98
  35. ],
  36. score: ["score", 51, 256, 0.95, 0.98],
  37. missions: ["missions", 51, 315, 0.95, 0.98],
  38. completed: ["completed", 51, 346, 0.95, 0.98],
  39. newLevel: ["new pilot level", 325, 224, 1.2, 1.3],
  40. comment: ["great flying!", 328, 50, 0.7, 0.8],
  41. awesome: ["awesome!", 182, 97, 0.5, 0.6],
  42. youfail: ["You FAILED!", 184, 97, 0.5, 0.6],
  43. logbook: ["pilot logbook", 320, 54, 1.3, 1.5],
  44. select: ["select airplane", 320, 54, 0.8, 0.9],
  45. selectMap: ["select map", 320, 54, 0.8, 0.9],
  46. notenough: ["need more stars", 320, 54, 0.8, 0.9],
  47. selected: ["selected", 320, 334, 0.8, 0.9],
  48. start: ["",
  49. 320, 234, 0.4, 0.4
  50. ],
  51. selectedMap: ["selected", 320, 347, 0.8, 0.9],
  52. nextlevel: ["next pilot level at", 320, 347, 0.8, 0.9],
  53. maxLvl: ["You've reached the max level!", 320, 141, 1, 1.1],
  54. nextlevelNumber: ["9999", 320, 135, 1.1, 1.3],
  55. nextlevelMission: ["next pilot level at ", 320, 141, 0.8, 0.9],
  56. letsGo: ["Let's go!", 290, 279, 0.7, 0.8],
  57. gameOver: ["Aww~ You ran out of lives!", 120, 157, 0.9, 1],
  58. accomplish: ["Mission Accomplished!", 320, 157, 0.9, 1],
  59. complete: ["Mission Complete", 320, 399, 1, 1.1],
  60. gameover: ["Game Over", 320, 399, 1, 1.1],
  61. fail: ["Mission Failed",
  62. 320, 399, 1, 1.1
  63. ],
  64. pc1: ["Click left or right to move the plane.", 51, 142, 0.6, 0.7],
  65. pc2: ["You can also use the arrow keys.", 51, 180, 0.6, 0.7],
  66. mobile1: ["Tap left or right to move the plane", 101, 160, 0.6, 0.7],
  67. ufo1: ["Avoid the UFOs!", 51, 143, 0.6, 0.7],
  68. ufo2: ["Stay alive as long as you can!", 51, 177, 0.9, 1],
  69. tree1: ["Avoid the trees, go green!", 158, 144, 0.7, 0.8],
  70. tree2: ["Survive for 60 seconds.", 158, 183, 0.7, 0.8],
  71. ship1: ["The hot air balloons are heading left!", 48, 142, 0.7, 0.8],
  72. ship2: ["Survive for 60 seconds.", 48, 180, 0.7,
  73. 0.8
  74. ],
  75. balloon1: ["Avoid slow moving hot air balloons!", 68, 144, 0.7, 0.8],
  76. balloon2: ["Survive for 60 seconds.", 68, 183, 0.7, 0.8],
  77. ring1: ["The rings are guiding us on the right path,", 47, 142, 0.68, 0.78],
  78. ring2: ["Fly through $ of them!", 48, 180, 0.68, 0.78],
  79. oil1: ["Our pilot headquarters is out of fuel,", 44, 146, 0.7, 0.8],
  80. oil2: ["collect $ drops of fuel within 1 minute!", 44, 182, 0.7, 0.8],
  81. star1: ["Look at those shiny stars,", 126, 145, 0.7, 0.8],
  82. star2: ["Can you collect $ of them?", 126, 180, 0.7, 0.8],
  83. pause: ["PAUSED", 320, 135, 2,
  84. 2.1
  85. ]
  86. },
  87. Results: {
  88. Title: "High score"
  89. }
  90. };
  91. var _SETTINGS = {
  92. API: {
  93. Enabled: !0,
  94. Log: {
  95. Events: {
  96. InitializeGame: !0,
  97. EndGame: !0,
  98. Level: {
  99. Begin: !0,
  100. End: !0,
  101. Win: !0,
  102. Lose: !0,
  103. Draw: !0
  104. }
  105. }
  106. }
  107. },
  108. Ad: {
  109. Mobile: {
  110. Preroll: {
  111. Enabled: !1,
  112. Duration: 5,
  113. Width: 300,
  114. Height: 250,
  115. Rotation: {
  116. Enabled: !1,
  117. Weight: {
  118. MobileAdInGamePreroll: 40,
  119. MobileAdInGamePreroll2: 40,
  120. MobileAdInGamePreroll3: 20
  121. }
  122. }
  123. },
  124. Header: {
  125. Enabled: !1,
  126. Duration: 5,
  127. Width: 320,
  128. Height: 50,
  129. Rotation: {
  130. Enabled: !1,
  131. Weight: {
  132. MobileAdInGameHeader: 40,
  133. MobileAdInGameHeader2: 40,
  134. MobileAdInGameHeader3: 20
  135. }
  136. }
  137. },
  138. Footer: {
  139. Enabled: !1,
  140. Duration: 5,
  141. Width: 320,
  142. Height: 50,
  143. Rotation: {
  144. Enabled: !1,
  145. Weight: {
  146. MobileAdInGameFooter: 40,
  147. MobileAdInGameFooter2: 40,
  148. MobileAdInGameFooter3: 20
  149. }
  150. }
  151. },
  152. End: {
  153. Enabled: !1,
  154. Duration: 1,
  155. Width: 300,
  156. Height: 250,
  157. Rotation: {
  158. Enabled: !1,
  159. Weight: {
  160. MobileAdInGameEnd: 40,
  161. MobileAdInGameEnd2: 40,
  162. MobileAdInGameEnd3: 20
  163. }
  164. }
  165. }
  166. }
  167. },
  168. Language: {
  169. Default: "en"
  170. },
  171. DeveloperBranding: {
  172. Splash: {
  173. Enabled: !0
  174. },
  175. Logo: {
  176. Enabled: !1,
  177. Link: "http://marketjs.com",
  178. LinkEnabled: !1,
  179. NewWindow: !0,
  180. Width: 166,
  181. Height: 61
  182. }
  183. },
  184. Branding: {
  185. Splash: {
  186. Enabled: !1
  187. },
  188. Logo: {
  189. Enabled: !1,
  190. Link: "http://google.com",
  191. LinkEnabled: !0,
  192. NewWindow: !0,
  193. Width: 280,
  194. Height: 34
  195. }
  196. },
  197. MoreGames: {
  198. Enabled: !1,
  199. Link: "http://www.marketjs.com/game/links/mobile",
  200. NewWindow: !0
  201. },
  202. Gamecenter: {
  203. Enabled: !0
  204. }
  205. };
  206. var MobileAdInGamePreroll = {/*
  207. ad_duration: _SETTINGS.Ad.Mobile.Preroll.Duration,
  208. ad_width: _SETTINGS.Ad.Mobile.Preroll.Width,
  209. ad_height: _SETTINGS.Ad.Mobile.Preroll.Height,
  210. ready_in: _STRINGS.Ad.Mobile.Preroll.ReadyIn,
  211. loading: _STRINGS.Ad.Mobile.Preroll.Loading,
  212. close: _STRINGS.Ad.Mobile.Preroll.Close + "          ",
  213. Initialize: function() {
  214. if (_SETTINGS.Ad.Mobile.Preroll.Rotation.Enabled) {
  215. var b = _SETTINGS.Ad.Mobile.Preroll.Rotation.Weight,
  216. c = b.MobileAdInGamePreroll,
  217. d =
  218. c + b.MobileAdInGamePreroll2,
  219. b = d + b.MobileAdInGamePreroll3,
  220. g = Math.floor(100 * Math.random());
  221. console.log("seed: ", g);
  222. g <= c ? this.selectedOverlayName = "MobileAdInGamePreroll" : g <= d ? this.selectedOverlayName = "MobileAdInGamePreroll2" : g <= b && (this.selectedOverlayName = "MobileAdInGamePreroll3");
  223. console.log("Ad rotating preroll enabled")
  224. } else this.selectedOverlayName = "MobileAdInGamePreroll", console.log("Ad rotating preroll disabled");
  225. console.log("selected:", this.selectedOverlayName);
  226. this.overlay = $("#" + this.selectedOverlayName);
  227. this.box = $("#" + this.selectedOverlayName + "-Box");
  228. this.game = $("#game");
  229. this.boxContents = {
  230. footer: $("#" + this.selectedOverlayName + "-Box-Footer"),
  231. header: $("#" + this.selectedOverlayName + "-Box-Header"),
  232. close: $("#" + this.selectedOverlayName + "-Box-Close"),
  233. body: $("#" + this.selectedOverlayName + "-Box-Body")
  234. };
  235. this.box.width(this.ad_width);
  236. this.box.height(this.ad_height);
  237. this.box.css("left", (this.overlay.width() - this.box.width()) / 2);
  238. this.box.css("top", (this.overlay.height() - this.box.height() - this.boxContents.header.height() -
  239. this.boxContents.footer.height()) / 2);
  240. this.overlay.show(this.Timer(this.ad_duration))
  241. },
  242. Timer: function(b) {
  243. var c = b,
  244. d = setInterval(function() {
  245. MobileAdInGamePreroll.boxContents.header.text(MobileAdInGamePreroll.ready_in + c + "...");
  246. MobileAdInGamePreroll.boxContents.footer.text(MobileAdInGamePreroll.loading);
  247. c--;
  248. 0 > c && (clearInterval(d), MobileAdInGamePreroll.boxContents.close.css("left", MobileAdInGamePreroll.boxContents.body.width() - 23), MobileAdInGamePreroll.boxContents.close.show(), MobileAdInGamePreroll.boxContents.header.html(MobileAdInGamePreroll.close),
  249. MobileAdInGamePreroll.boxContents.footer.text(""))
  250. }, 1E3)
  251. },
  252. Close: function() {
  253. this.boxContents.close.hide();
  254. this.overlay.hide()
  255. }*/
  256. };
  257. var MobileAdInGameHeader = {/*
  258. ad_duration: _SETTINGS.Ad.Mobile.Header.Duration,
  259. ad_width: _SETTINGS.Ad.Mobile.Header.Width,
  260. ad_height: _SETTINGS.Ad.Mobile.Header.Height,
  261. Initialize: function() {
  262. if (_SETTINGS.Ad.Mobile.Header.Rotation.Enabled) {
  263. var b = _SETTINGS.Ad.Mobile.Header.Rotation.Weight,
  264. c = b.MobileAdInGameHeader,
  265. d = c + b.MobileAdInGameHeader2,
  266. b = d + b.MobileAdInGameHeader3,
  267. g = Math.floor(100 * Math.random());
  268. console.log("seed: ", g);
  269. g <= c ? this.selectedOverlayName = "MobileAdInGameHeader" : g <= d ? this.selectedOverlayName = "MobileAdInGameHeader2" :
  270. g <= b && (this.selectedOverlayName = "MobileAdInGameHeader3");
  271. console.log("Ad rotating header enabled")
  272. } else this.selectedOverlayName = "MobileAdInGameHeader", console.log("Ad rotating header disabled");
  273. this.div = $("#" + this.selectedOverlayName);
  274. this.game = $("#game");
  275. this.div.width(this.ad_width);
  276. this.div.height(this.ad_height);
  277. this.div.css("left", this.game.position().left + (this.game.width() - this.div.width()) / 2);
  278. this.div.css("top", 0);
  279. this.div.show(this.Timer(this.ad_duration))
  280. },
  281. Timer: function(b) {
  282. var c = setInterval(function() {
  283. b--;
  284. 0 > b && (MobileAdInGameHeader.div.hide(), clearInterval(c))
  285. }, 1E3)
  286. }*/
  287. };
  288. var MobileAdInGameFooter = {/*
  289. ad_duration: _SETTINGS.Ad.Mobile.Footer.Duration,
  290. ad_width: _SETTINGS.Ad.Mobile.Footer.Width,
  291. ad_height: _SETTINGS.Ad.Mobile.Footer.Height,
  292. Initialize: function() {
  293. if (_SETTINGS.Ad.Mobile.Footer.Rotation.Enabled) {
  294. var b = _SETTINGS.Ad.Mobile.Footer.Rotation.Weight,
  295. c = b.MobileAdInGameFooter,
  296. d = c + b.MobileAdInGameFooter2,
  297. b = d + b.MobileAdInGameFooter3,
  298. g = Math.floor(100 * Math.random());
  299. console.log("seed: ", g);
  300. g <= c ? this.selectedOverlayName = "MobileAdInGameFooter" : g <= d ? this.selectedOverlayName = "MobileAdInGameFooter2" :
  301. g <= b && (this.selectedOverlayName = "MobileAdInGameFooter3");
  302. console.log("Ad rotating footer enabled")
  303. } else this.selectedOverlayName = "MobileAdInGameFooter", console.log("Ad rotating footer disabled");
  304. this.div = $("#" + this.selectedOverlayName);
  305. this.game = $("#game");
  306. this.div.width(this.ad_width);
  307. this.div.height(this.ad_height);
  308. this.div.css("left", this.game.position().left + (this.game.width() - this.div.width()) / 2);
  309. this.div.css("top", this.game.height() - this.div.height() - 5);
  310. this.div.show(this.Timer(this.ad_duration))
  311. },
  312. Timer: function(b) {
  313. var c = setInterval(function() {
  314. b--;
  315. 0 > b && (MobileAdInGameFooter.div.hide(), clearInterval(c))
  316. }, 1E3)
  317. }*/
  318. };
  319. var MobileAdInGameEnd = {/*
  320. ad_duration: _SETTINGS.Ad.Mobile.End.Duration,
  321. ad_width: _SETTINGS.Ad.Mobile.End.Width,
  322. ad_height: _SETTINGS.Ad.Mobile.End.Height,
  323. ready_in: _STRINGS.Ad.Mobile.End.ReadyIn,
  324. loading: _STRINGS.Ad.Mobile.End.Loading,
  325. close: _STRINGS.Ad.Mobile.End.Close + "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;",
  326. Initialize: function() {
  327. if (_SETTINGS.Ad.Mobile.End.Rotation.Enabled) {
  328. var b = _SETTINGS.Ad.Mobile.End.Rotation.Weight,
  329. c = b.MobileAdInGameEnd,
  330. d = c + b.MobileAdInGameEnd2,
  331. b = d + b.MobileAdInGameEnd3,
  332. g = Math.floor(100 * Math.random());
  333. console.log("seed: ", g);
  334. g <= c ? this.selectedOverlayName = "MobileAdInGameEnd" : g <= d ? this.selectedOverlayName = "MobileAdInGameEnd2" : g <= b && (this.selectedOverlayName = "MobileAdInGameEnd3");
  335. console.log("Ad rotating end enabled")
  336. } else this.selectedOverlayName = "MobileAdInGameEnd", console.log("Ad rotating end disabled");
  337. console.log("selected:", this.selectedOverlayName);
  338. this.overlay = $("#" + this.selectedOverlayName);
  339. this.box = $("#" + this.selectedOverlayName + "-Box");
  340. this.game = $("#game");
  341. this.boxContents = {
  342. footer: $("#" + this.selectedOverlayName + "-Box-Footer"),
  343. header: $("#" + this.selectedOverlayName + "-Box-Header"),
  344. close: $("#" + this.selectedOverlayName + "-Box-Close"),
  345. body: $("#" + this.selectedOverlayName + "-Box-Body")
  346. };
  347. this.box.width(this.ad_width);
  348. this.box.height(this.ad_height);
  349. this.box.css("left", (this.overlay.width() - this.box.width()) / 2);
  350. this.box.css("top", (this.overlay.height() - this.box.height() - this.boxContents.header.height() - this.boxContents.footer.height()) / 2);
  351. this.overlay.show(this.Timer(this.ad_duration))
  352. },
  353. Timer: function(b) {
  354. var c = b,
  355. d = setInterval(function() {
  356. MobileAdInGameEnd.boxContents.header.text(MobileAdInGameEnd.ready_in + c + "...");
  357. MobileAdInGameEnd.boxContents.footer.text(MobileAdInGameEnd.loading);
  358. c--;
  359. 0 > c && (clearInterval(d), MobileAdInGameEnd.boxContents.close.css("left", MobileAdInGameEnd.boxContents.body.width() - 23), MobileAdInGameEnd.boxContents.close.show(), MobileAdInGameEnd.boxContents.header.html(MobileAdInGameEnd.close), MobileAdInGameEnd.boxContents.footer.text(""))
  360. }, 1E3)
  361. },
  362. Close: function() {
  363. this.boxContents.close.hide();
  364. this.overlay.hide()
  365. }*/
  366. };
  367. (function(b, c) {
  368. function d(b, f, q) {
  369. if (q === c && 1 === b.nodeType)
  370. if (q = "data-" + f.replace(sc, "-$1").toLowerCase(), q = b.getAttribute(q), "string" == typeof q) {
  371. try {
  372. q = "true" === q ? !0 : "false" === q ? !1 : "null" === q ? null : +q + "" === q ? +q : tc.test(q) ? e.parseJSON(q) : q
  373. } catch (C) {}
  374. e.data(b, f, q)
  375. } else q = c;
  376. return q
  377. }
  378. function g(b) {
  379. for (var f in b)
  380. if (!("data" === f && e.isEmptyObject(b[f])) && "toJSON" !== f) return !1;
  381. return !0
  382. }
  383. function j() {
  384. return !1
  385. }
  386. function n() {
  387. return !0
  388. }
  389. function y(b) {
  390. return !b || !b.parentNode || 11 === b.parentNode.nodeType
  391. }
  392. function r(b,
  393. f) {
  394. do b = b[f]; while (b && 1 !== b.nodeType);
  395. return b
  396. }
  397. function z(b, f, q) {
  398. f = f || 0;
  399. if (e.isFunction(f)) return e.grep(b, function(b, u) {
  400. return !!f.call(b, u, b) === q
  401. });
  402. if (f.nodeType) return e.grep(b, function(b) {
  403. return b === f === q
  404. });
  405. if ("string" == typeof f) {
  406. var c = e.grep(b, function(b) {
  407. return 1 === b.nodeType
  408. });
  409. if (uc.test(f)) return e.filter(f, c, !q);
  410. f = e.filter(f, c)
  411. }
  412. return e.grep(b, function(b) {
  413. return 0 <= e.inArray(b, f) === q
  414. })
  415. }
  416. function A(b) {
  417. var f = wb.split("|");
  418. b = b.createDocumentFragment();
  419. if (b.createElement)
  420. for (; f.length;) b.createElement(f.pop());
  421. return b
  422. }
  423. function B(b, f) {
  424. if (1 === f.nodeType && e.hasData(b)) {
  425. var q, c, d;
  426. c = e._data(b);
  427. var s = e._data(f, c),
  428. m = c.events;
  429. if (m)
  430. for (q in delete s.handle, s.events = {}, m) {
  431. c = 0;
  432. for (d = m[q].length; c < d; c++) e.event.add(f, q, m[q][c])
  433. }
  434. s.data && (s.data = e.extend({}, s.data))
  435. }
  436. }
  437. function l(b, f) {
  438. var q;
  439. 1 === f.nodeType && (f.clearAttributes && f.clearAttributes(), f.mergeAttributes && f.mergeAttributes(b), q = f.nodeName.toLowerCase(), "object" === q ? (f.parentNode && (f.outerHTML = b.outerHTML), e.support.html5Clone && b.innerHTML && !e.trim(f.innerHTML) &&
  440. (f.innerHTML = b.innerHTML)) : "input" === q && xb.test(b.type) ? (f.defaultChecked = f.checked = b.checked, f.value !== b.value && (f.value = b.value)) : "option" === q ? f.selected = b.defaultSelected : "input" === q || "textarea" === q ? f.defaultValue = b.defaultValue : "script" === q && f.text !== b.text && (f.text = b.text), f.removeAttribute(e.expando))
  441. }
  442. function p(b) {
  443. return "undefined" != typeof b.getElementsByTagName ? b.getElementsByTagName("*") : "undefined" != typeof b.querySelectorAll ? b.querySelectorAll("*") : []
  444. }
  445. function t(b) {
  446. xb.test(b.type) && (b.defaultChecked =
  447. b.checked)
  448. }
  449. function x(b, f) {
  450. if (f in b) return f;
  451. for (var q = f.charAt(0).toUpperCase() + f.slice(1), c = f, e = yb.length; e--;)
  452. if (f = yb[e] + q, f in b) return f;
  453. return c
  454. }
  455. function L(b, f) {
  456. return b = f || b, "none" === e.css(b, "display") || !e.contains(b.ownerDocument, b)
  457. }
  458. function H(b, f) {
  459. for (var q, c, d = [], s = 0, m = b.length; s < m; s++) q = b[s], q.style && (d[s] = e._data(q, "olddisplay"), f ? (!d[s] && "none" === q.style.display && (q.style.display = ""), "" === q.style.display && L(q) && (d[s] = e._data(q, "olddisplay", K(q.nodeName)))) : (c = R(q, "display"), !d[s] && "none" !==
  460. c && e._data(q, "olddisplay", c)));
  461. for (s = 0; s < m; s++)
  462. if (q = b[s], q.style && (!f || "none" === q.style.display || "" === q.style.display)) q.style.display = f ? d[s] || "" : "none";
  463. return b
  464. }
  465. function E(b, f, q) {
  466. return (b = vc.exec(f)) ? Math.max(0, b[1] - (q || 0)) + (b[2] || "px") : f
  467. }
  468. function N(b, f, q, c) {
  469. f = q === (c ? "border" : "content") ? 4 : "width" === f ? 1 : 0;
  470. for (var d = 0; 4 > f; f += 2) "margin" === q && (d += e.css(b, q + fa[f], !0)), c ? ("content" === q && (d -= parseFloat(R(b, "padding" + fa[f])) || 0), "margin" !== q && (d -= parseFloat(R(b, "border" + fa[f] + "Width")) || 0)) : (d += parseFloat(R(b,
  471. "padding" + fa[f])) || 0, "padding" !== q && (d += parseFloat(R(b, "border" + fa[f] + "Width")) || 0));
  472. return d
  473. }
  474. function F(b, f, q) {
  475. var c = "width" === f ? b.offsetWidth : b.offsetHeight,
  476. d = !0,
  477. s = e.support.boxSizing && "border-box" === e.css(b, "boxSizing");
  478. if (0 >= c || null == c) {
  479. c = R(b, f);
  480. if (0 > c || null == c) c = b.style[f];
  481. if (za.test(c)) return c;
  482. d = s && (e.support.boxSizingReliable || c === b.style[f]);
  483. c = parseFloat(c) || 0
  484. }
  485. return c + N(b, f, q || (s ? "border" : "content"), d) + "px"
  486. }
  487. function K(b) {
  488. if (Ya[b]) return Ya[b];
  489. var f = e("<" + b + ">").appendTo(D.body),
  490. c = f.css("display");
  491. f.remove();
  492. if ("none" === c || "" === c) {
  493. ma = D.body.appendChild(ma || e.extend(D.createElement("iframe"), {
  494. frameBorder: 0,
  495. width: 0,
  496. height: 0
  497. }));
  498. if (!na || !ma.createElement) na = (ma.contentWindow || ma.contentDocument).document, na.write("<!doctype html><html><body>"), na.close();
  499. f = na.body.appendChild(na.createElement(b));
  500. c = R(f, "display");
  501. D.body.removeChild(ma)
  502. }
  503. return Ya[b] = c, c
  504. }
  505. function O(b, f, c, C) {
  506. var d;
  507. if (e.isArray(f)) e.each(f, function(f, e) {
  508. c || wc.test(b) ? C(b, e) : O(b + "[" + ("object" == typeof e ? f : "") + "]", e, c, C)
  509. });
  510. else if (!c &&
  511. "object" === e.type(f))
  512. for (d in f) O(b + "[" + d + "]", f[d], c, C);
  513. else C(b, f)
  514. }
  515. function Aa(b) {
  516. return function(f, c) {
  517. "string" != typeof f && (c = f, f = "*");
  518. var C, d, s = f.toLowerCase().split(ga),
  519. m = 0,
  520. l = s.length;
  521. if (e.isFunction(c))
  522. for (; m < l; m++) C = s[m], (d = /^\+/.test(C)) && (C = C.substr(1) || "*"), C = b[C] = b[C] || [], C[d ? "unshift" : "push"](c)
  523. }
  524. }
  525. function oa(b, f, q, e, d, s) {
  526. d = d || f.dataTypes[0];
  527. s = s || {};
  528. s[d] = !0;
  529. var m;
  530. d = b[d];
  531. for (var l = 0, g = d ? d.length : 0, j = b === Za; l < g && (j || !m); l++) m = d[l](f, q, e), "string" == typeof m && (!j || s[m] ? m = c : (f.dataTypes.unshift(m),
  532. m = oa(b, f, q, e, m, s)));
  533. return (j || !m) && !s["*"] && (m = oa(b, f, q, e, "*", s)), m
  534. }
  535. function ta(b, f) {
  536. var q, C, d = e.ajaxSettings.flatOptions || {};
  537. for (q in f) f[q] !== c && ((d[q] ? b : C || (C = {}))[q] = f[q]);
  538. C && e.extend(!0, b, C)
  539. }
  540. function zb() {
  541. try {
  542. return new b.XMLHttpRequest
  543. } catch (u) {}
  544. }
  545. function Ab() {
  546. return setTimeout(function() {
  547. Ba = c
  548. }, 0), Ba = e.now()
  549. }
  550. function Bb(b, f, c) {
  551. var C, d = 0,
  552. s = Ca.length,
  553. m = e.Deferred().always(function() {
  554. delete l.elem
  555. }),
  556. l = function() {
  557. for (var f = Ba || Ab(), f = Math.max(0, g.startTime + g.duration - f), c = 1 - (f / g.duration || 0), q =
  558. 0, e = g.tweens.length; q < e; q++) g.tweens[q].run(c);
  559. return m.notifyWith(b, [g, c, f]), 1 > c && e ? f : (m.resolveWith(b, [g]), !1)
  560. },
  561. g = m.promise({
  562. elem: b,
  563. props: e.extend({}, f),
  564. opts: e.extend(!0, {
  565. specialEasing: {}
  566. }, c),
  567. originalProperties: f,
  568. originalOptions: c,
  569. startTime: Ba || Ab(),
  570. duration: c.duration,
  571. tweens: [],
  572. createTween: function(f, c) {
  573. var q = e.Tween(b, g.opts, f, c, g.opts.specialEasing[f] || g.opts.easing);
  574. return g.tweens.push(q), q
  575. },
  576. stop: function(f) {
  577. for (var c = 0, q = f ? g.tweens.length : 0; c < q; c++) g.tweens[c].run(1);
  578. return f ? m.resolveWith(b, [g, f]) : m.rejectWith(b, [g, f]), this
  579. }
  580. });
  581. f = g.props;
  582. c = g.opts.specialEasing;
  583. var j, p, t, r;
  584. for (C in f)
  585. if (j = e.camelCase(C), p = c[j], t = f[C], e.isArray(t) && (p = t[1], t = f[C] = t[0]), C !== j && (f[j] = t, delete f[C]), (r = e.cssHooks[j]) && "expand" in r)
  586. for (C in t = r.expand(t), delete f[j], t) C in f || (f[C] = t[C], c[C] = p);
  587. else c[j] = p;
  588. for (; d < s; d++)
  589. if (C = Ca[d].call(g, b, f, g.opts)) return C;
  590. var n = g;
  591. e.each(f, function(b, u) {
  592. for (var f = (ua[b] || []).concat(ua["*"]), c = 0, q = f.length; c < q && !f[c].call(n, b, u); c++);
  593. });
  594. return e.isFunction(g.opts.start) && g.opts.start.call(b,
  595. g), e.fx.timer(e.extend(l, {
  596. anim: g,
  597. queue: g.opts.queue,
  598. elem: b
  599. })), g.progress(g.opts.progress).done(g.opts.done, g.opts.complete).fail(g.opts.fail).always(g.opts.always)
  600. }
  601. function T(b, f, c, e, d) {
  602. return new T.prototype.init(b, f, c, e, d)
  603. }
  604. function Da(b, f) {
  605. var c, e = {
  606. height: b
  607. },
  608. d = 0;
  609. for (f = f ? 1 : 0; 4 > d; d += 2 - f) c = fa[d], e["margin" + c] = e["padding" + c] = b;
  610. return f && (e.opacity = e.width = b), e
  611. }
  612. function Cb(b) {
  613. return e.isWindow(b) ? b : 9 === b.nodeType ? b.defaultView || b.parentWindow : !1
  614. }
  615. var Db, Ea, D = b.document,
  616. yc = b.location,
  617. zc = b.navigator,
  618. Ac =
  619. b.jQuery,
  620. Bc = b.$,
  621. Eb = Array.prototype.push,
  622. aa = Array.prototype.slice,
  623. Fb = Array.prototype.indexOf,
  624. Cc = Object.prototype.toString,
  625. $a = Object.prototype.hasOwnProperty,
  626. ab = String.prototype.trim,
  627. e = function(b, f) {
  628. return new e.fn.init(b, f, Db)
  629. },
  630. Fa = /[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source,
  631. Dc = /\S/,
  632. ga = /\s+/,
  633. Ec = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,
  634. Fc = /^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,
  635. Gb = /^<(\w+)\s*\/?>(?:<\/\1>|)$/,
  636. Gc = /^[\],:{}\s]*$/,
  637. Hc = /(?:^|:|,)(?:\s*\[)+/g,
  638. Ic = /\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,
  639. Jc = /"[^"\\\r\n]*"|true|false|null|-?(?:\d\d*\.|)\d+(?:[eE][\-+]?\d+|)/g,
  640. Kc = /^-ms-/,
  641. Lc = /-([\da-z])/gi,
  642. Mc = function(b, f) {
  643. return (f + "").toUpperCase()
  644. },
  645. Ga = function() {
  646. D.addEventListener ? (D.removeEventListener("DOMContentLoaded", Ga, !1), e.ready()) : "complete" === D.readyState && (D.detachEvent("onreadystatechange", Ga), e.ready())
  647. },
  648. Hb = {};
  649. e.fn = e.prototype = {
  650. constructor: e,
  651. init: function(b, f, q) {
  652. var C, d;
  653. if (!b) return this;
  654. if (b.nodeType) return this.context = this[0] = b, this.length = 1, this;
  655. if ("string" == typeof b) {
  656. "<" === b.charAt(0) && ">" === b.charAt(b.length - 1) && 3 <= b.length ? C = [null, b, null] : C = Fc.exec(b);
  657. if (C && (C[1] || !f)) {
  658. if (C[1]) return f = f instanceof e ? f[0] : f, d = f && f.nodeType ? f.ownerDocument || f : D, b = e.parseHTML(C[1], d, !0), Gb.test(C[1]) && e.isPlainObject(f) && this.attr.call(b, f, !0), e.merge(this, b);
  659. if ((f = D.getElementById(C[2])) && f.parentNode) {
  660. if (f.id !== C[2]) return q.find(b);
  661. this.length = 1;
  662. this[0] = f
  663. }
  664. return this.context = D, this.selector = b, this
  665. }
  666. return !f || f.jquery ? (f || q).find(b) : this.constructor(f).find(b)
  667. }
  668. return e.isFunction(b) ? q.ready(b) : (b.selector !== c && (this.selector = b.selector, this.context = b.context), e.makeArray(b,
  669. this))
  670. },
  671. selector: "",
  672. jquery: "1.8.2",
  673. length: 0,
  674. size: function() {
  675. return this.length
  676. },
  677. toArray: function() {
  678. return aa.call(this)
  679. },
  680. get: function(b) {
  681. return null == b ? this.toArray() : 0 > b ? this[this.length + b] : this[b]
  682. },
  683. pushStack: function(b, f, c) {
  684. b = e.merge(this.constructor(), b);
  685. return b.prevObject = this, b.context = this.context, "find" === f ? b.selector = this.selector + (this.selector ? " " : "") + c : f && (b.selector = this.selector + "." + f + "(" + c + ")"), b
  686. },
  687. each: function(b, f) {
  688. return e.each(this, b, f)
  689. },
  690. ready: function(b) {
  691. return e.ready.promise().done(b),
  692. this
  693. },
  694. eq: function(b) {
  695. return b = +b, -1 === b ? this.slice(b) : this.slice(b, b + 1)
  696. },
  697. first: function() {
  698. return this.eq(0)
  699. },
  700. last: function() {
  701. return this.eq(-1)
  702. },
  703. slice: function() {
  704. return this.pushStack(aa.apply(this, arguments), "slice", aa.call(arguments).join(","))
  705. },
  706. map: function(b) {
  707. return this.pushStack(e.map(this, function(f, c) {
  708. return b.call(f, c, f)
  709. }))
  710. },
  711. end: function() {
  712. return this.prevObject || this.constructor(null)
  713. },
  714. push: Eb,
  715. sort: [].sort,
  716. splice: [].splice
  717. };
  718. e.fn.init.prototype = e.fn;
  719. e.extend = e.fn.extend = function() {
  720. var b,
  721. f, q, C, d, s, m = arguments[0] || {},
  722. l = 1,
  723. g = arguments.length,
  724. j = !1;
  725. "boolean" == typeof m && (j = m, m = arguments[1] || {}, l = 2);
  726. "object" != typeof m && !e.isFunction(m) && (m = {});
  727. for (g === l && (m = this, --l); l < g; l++)
  728. if (null != (b = arguments[l]))
  729. for (f in b) q = m[f], C = b[f], m !== C && (j && C && (e.isPlainObject(C) || (d = e.isArray(C))) ? (d ? (d = !1, s = q && e.isArray(q) ? q : []) : s = q && e.isPlainObject(q) ? q : {}, m[f] = e.extend(j, s, C)) : C !== c && (m[f] = C));
  730. return m
  731. };
  732. e.extend({
  733. noConflict: function(u) {
  734. return b.$ === e && (b.$ = Bc), u && b.jQuery === e && (b.jQuery = Ac), e
  735. },
  736. isReady: !1,
  737. readyWait: 1,
  738. holdReady: function(b) {
  739. b ? e.readyWait++ : e.ready(!0)
  740. },
  741. ready: function(b) {
  742. if (!(!0 === b ? --e.readyWait : e.isReady)) {
  743. if (!D.body) return setTimeout(e.ready, 1);
  744. e.isReady = !0;
  745. !0 !== b && 0 < --e.readyWait || (Ea.resolveWith(D, [e]), e.fn.trigger && e(D).trigger("ready").off("ready"))
  746. }
  747. },
  748. isFunction: function(b) {
  749. return "function" === e.type(b)
  750. },
  751. isArray: Array.isArray || function(b) {
  752. return "array" === e.type(b)
  753. },
  754. isWindow: function(b) {
  755. return null != b && b == b.window
  756. },
  757. isNumeric: function(b) {
  758. return !isNaN(parseFloat(b)) && isFinite(b)
  759. },
  760. type: function(b) {
  761. return null == b ? String(b) : Hb[Cc.call(b)] || "object"
  762. },
  763. isPlainObject: function(b) {
  764. if (!b || "object" !== e.type(b) || b.nodeType || e.isWindow(b)) return !1;
  765. try {
  766. if (b.constructor && !$a.call(b, "constructor") && !$a.call(b.constructor.prototype, "isPrototypeOf")) return !1
  767. } catch (f) {
  768. return !1
  769. }
  770. for (var q in b);
  771. return q === c || $a.call(b, q)
  772. },
  773. isEmptyObject: function(b) {
  774. for (var f in b) return !1;
  775. return !0
  776. },
  777. error: function(b) {
  778. throw Error(b);
  779. },
  780. parseHTML: function(b, f, c) {
  781. var d;
  782. return !b || "string" != typeof b ? null : ("boolean" ==
  783. typeof f && (c = f, f = 0), f = f || D, (d = Gb.exec(b)) ? [f.createElement(d[1])] : (d = e.buildFragment([b], f, c ? null : []), e.merge([], (d.cacheable ? e.clone(d.fragment) : d.fragment).childNodes)))
  784. },
  785. parseJSON: function(u) {
  786. if (!u || "string" != typeof u) return null;
  787. u = e.trim(u);
  788. if (b.JSON && b.JSON.parse) return b.JSON.parse(u);
  789. if (Gc.test(u.replace(Ic, "@").replace(Jc, "]").replace(Hc, ""))) return (new Function("return " + u))();
  790. e.error("Invalid JSON: " + u)
  791. },
  792. parseXML: function(u) {
  793. var f, q;
  794. if (!u || "string" != typeof u) return null;
  795. try {
  796. b.DOMParser ?
  797. (q = new DOMParser, f = q.parseFromString(u, "text/xml")) : (f = new ActiveXObject("Microsoft.XMLDOM"), f.async = "false", f.loadXML(u))
  798. } catch (d) {
  799. f = c
  800. }
  801. return (!f || !f.documentElement || f.getElementsByTagName("parsererror").length) && e.error("Invalid XML: " + u), f
  802. },
  803. noop: function() {},
  804. globalEval: function(u) {
  805. u && Dc.test(u) && (b.execScript || function(u) {
  806. b.eval.call(b, u)
  807. })(u)
  808. },
  809. camelCase: function(b) {
  810. return b.replace(Kc, "ms-").replace(Lc, Mc)
  811. },
  812. nodeName: function(b, f) {
  813. return b.nodeName && b.nodeName.toLowerCase() === f.toLowerCase()
  814. },
  815. each: function(b, f, q) {
  816. var d, v = 0,
  817. s = b.length,
  818. m = s === c || e.isFunction(b);
  819. if (q)
  820. if (m)
  821. for (d in b) {
  822. if (!1 === f.apply(b[d], q)) break
  823. } else
  824. for (; v < s && !1 !== f.apply(b[v++], q););
  825. else if (m)
  826. for (d in b) {
  827. if (!1 === f.call(b[d], d, b[d])) break
  828. } else
  829. for (; v < s && !1 !== f.call(b[v], v, b[v++]););
  830. return b
  831. },
  832. trim: ab && !ab.call("\ufeff\u00a0") ? function(b) {
  833. return null == b ? "" : ab.call(b)
  834. } : function(b) {
  835. return null == b ? "" : (b + "").replace(Ec, "")
  836. },
  837. makeArray: function(b, f) {
  838. var c, d = f || [];
  839. return null != b && (c = e.type(b), null == b.length || "string" === c || "function" ===
  840. c || "regexp" === c || e.isWindow(b) ? Eb.call(d, b) : e.merge(d, b)), d
  841. },
  842. inArray: function(b, f, c) {
  843. var e;
  844. if (f) {
  845. if (Fb) return Fb.call(f, b, c);
  846. e = f.length;
  847. for (c = c ? 0 > c ? Math.max(0, e + c) : c : 0; c < e; c++)
  848. if (c in f && f[c] === b) return c
  849. }
  850. return -1
  851. },
  852. merge: function(b, f) {
  853. var q = f.length,
  854. e = b.length,
  855. d = 0;
  856. if ("number" == typeof q)
  857. for (; d < q; d++) b[e++] = f[d];
  858. else
  859. for (; f[d] !== c;) b[e++] = f[d++];
  860. return b.length = e, b
  861. },
  862. grep: function(b, f, c) {
  863. var e, d = [],
  864. s = 0,
  865. m = b.length;
  866. for (c = !!c; s < m; s++) e = !!f(b[s], s), c !== e && d.push(b[s]);
  867. return d
  868. },
  869. map: function(b, f, q) {
  870. var d,
  871. v, s = [],
  872. m = 0,
  873. l = b.length;
  874. if (b instanceof e || l !== c && "number" == typeof l && (0 < l && b[0] && b[l - 1] || 0 === l || e.isArray(b)))
  875. for (; m < l; m++) d = f(b[m], m, q), null != d && (s[s.length] = d);
  876. else
  877. for (v in b) d = f(b[v], v, q), null != d && (s[s.length] = d);
  878. return s.concat.apply([], s)
  879. },
  880. guid: 1,
  881. proxy: function(b, f) {
  882. var q, d, v;
  883. return "string" == typeof f && (q = b[f], f = b, b = q), e.isFunction(b) ? (d = aa.call(arguments, 2), v = function() {
  884. return b.apply(f, d.concat(aa.call(arguments)))
  885. }, v.guid = b.guid = b.guid || e.guid++, v) : c
  886. },
  887. access: function(b, f, q, d, v, s, m) {
  888. var l, g =
  889. null == q,
  890. j = 0,
  891. p = b.length;
  892. if (q && "object" == typeof q) {
  893. for (j in q) e.access(b, f, j, q[j], 1, s, d);
  894. v = 1
  895. } else if (d !== c) {
  896. l = m === c && e.isFunction(d);
  897. g && (l ? (l = f, f = function(b, u, f) {
  898. return l.call(e(b), f)
  899. }) : (f.call(b, d), f = null));
  900. if (f)
  901. for (; j < p; j++) f(b[j], q, l ? d.call(b[j], j, f(b[j], q)) : d, m);
  902. v = 1
  903. }
  904. return v ? b : g ? f.call(b) : p ? f(b[0], q) : s
  905. },
  906. now: function() {
  907. return (new Date).getTime()
  908. }
  909. });
  910. e.ready.promise = function(u) {
  911. if (!Ea)
  912. if (Ea = e.Deferred(), "complete" === D.readyState) setTimeout(e.ready, 1);
  913. else if (D.addEventListener) D.addEventListener("DOMContentLoaded",
  914. Ga, !1), b.addEventListener("load", e.ready, !1);
  915. else {
  916. D.attachEvent("onreadystatechange", Ga);
  917. b.attachEvent("onload", e.ready);
  918. var f = !1;
  919. try {
  920. f = null == b.frameElement && D.documentElement
  921. } catch (c) {}
  922. f && f.doScroll && function v() {
  923. if (!e.isReady) {
  924. try {
  925. f.doScroll("left")
  926. } catch (b) {
  927. return setTimeout(v, 50)
  928. }
  929. e.ready()
  930. }
  931. }()
  932. }
  933. return Ea.promise(u)
  934. };
  935. e.each("Boolean Number String Function Array Date RegExp Object".split(" "), function(b, f) {
  936. Hb["[object " + f + "]"] = f.toLowerCase()
  937. });
  938. Db = e(D);
  939. var Ib = {};
  940. e.Callbacks = function(b) {
  941. var f;
  942. if ("string" ==
  943. typeof b) {
  944. if (!(f = Ib[b])) {
  945. f = b;
  946. var q = Ib[f] = {};
  947. f = (e.each(f.split(ga), function(b, u) {
  948. q[u] = !0
  949. }), q)
  950. }
  951. } else f = e.extend({}, b);
  952. b = f;
  953. var d, v, s, m, l, g, j = [],
  954. p = !b.once && [],
  955. t = function(f) {
  956. d = b.memory && f;
  957. v = !0;
  958. g = m || 0;
  959. m = 0;
  960. l = j.length;
  961. for (s = !0; j && g < l; g++)
  962. if (!1 === j[g].apply(f[0], f[1]) && b.stopOnFalse) {
  963. d = !1;
  964. break
  965. }
  966. s = !1;
  967. j && (p ? p.length && t(p.shift()) : d ? j = [] : r.disable())
  968. },
  969. r = {
  970. add: function() {
  971. if (j) {
  972. var f = j.length;
  973. (function xc(f) {
  974. e.each(f, function(f, c) {
  975. var q = e.type(c);
  976. "function" === q && (!b.unique || !r.has(c)) ? j.push(c) : c && c.length && "string" !==
  977. q && xc(c)
  978. })
  979. })(arguments);
  980. s ? l = j.length : d && (m = f, t(d))
  981. }
  982. return this
  983. },
  984. remove: function() {
  985. return j && e.each(arguments, function(b, u) {
  986. for (var f; - 1 < (f = e.inArray(u, j, f));) j.splice(f, 1), s && (f <= l && l--, f <= g && g--)
  987. }), this
  988. },
  989. has: function(b) {
  990. return -1 < e.inArray(b, j)
  991. },
  992. empty: function() {
  993. return j = [], this
  994. },
  995. disable: function() {
  996. return j = p = d = c, this
  997. },
  998. disabled: function() {
  999. return !j
  1000. },
  1001. lock: function() {
  1002. return p = c, d || r.disable(), this
  1003. },
  1004. locked: function() {
  1005. return !p
  1006. },
  1007. fireWith: function(b, u) {
  1008. return u = u || [], u = [b, u.slice ? u.slice() : u], j && (!v || p) &&
  1009. (s ? p.push(u) : t(u)), this
  1010. },
  1011. fire: function() {
  1012. return r.fireWith(this, arguments), this
  1013. },
  1014. fired: function() {
  1015. return !!v
  1016. }
  1017. };
  1018. return r
  1019. };
  1020. e.extend({
  1021. Deferred: function(b) {
  1022. var f = [
  1023. ["resolve", "done", e.Callbacks("once memory"), "resolved"],
  1024. ["reject", "fail", e.Callbacks("once memory"), "rejected"],
  1025. ["notify", "progress", e.Callbacks("memory")]
  1026. ],
  1027. c = "pending",
  1028. d = {
  1029. state: function() {
  1030. return c
  1031. },
  1032. always: function() {
  1033. return v.done(arguments).fail(arguments), this
  1034. },
  1035. then: function() {
  1036. var b = arguments;
  1037. return e.Deferred(function(u) {
  1038. e.each(f, function(f,
  1039. c) {
  1040. var q = c[0],
  1041. d = b[f];
  1042. v[c[1]](e.isFunction(d) ? function() {
  1043. var b = d.apply(this, arguments);
  1044. b && e.isFunction(b.promise) ? b.promise().done(u.resolve).fail(u.reject).progress(u.notify) : u[q + "With"](this === v ? u : this, [b])
  1045. } : u[q])
  1046. });
  1047. b = null
  1048. }).promise()
  1049. },
  1050. promise: function(b) {
  1051. return null != b ? e.extend(b, d) : d
  1052. }
  1053. },
  1054. v = {};
  1055. return d.pipe = d.then, e.each(f, function(b, u) {
  1056. var e = u[2],
  1057. l = u[3];
  1058. d[u[1]] = e.add;
  1059. l && e.add(function() {
  1060. c = l
  1061. }, f[b ^ 1][2].disable, f[2][2].lock);
  1062. v[u[0]] = e.fire;
  1063. v[u[0] + "With"] = e.fireWith
  1064. }), d.promise(v), b && b.call(v, v), v
  1065. },
  1066. when: function(b) {
  1067. var f = 0,
  1068. c = aa.call(arguments),
  1069. d = c.length,
  1070. v = 1 !== d || b && e.isFunction(b.promise) ? d : 0,
  1071. s = 1 === v ? b : e.Deferred(),
  1072. m = function(b, u, f) {
  1073. return function(c) {
  1074. u[b] = this;
  1075. f[b] = 1 < arguments.length ? aa.call(arguments) : c;
  1076. f === l ? s.notifyWith(u, f) : --v || s.resolveWith(u, f)
  1077. }
  1078. },
  1079. l, g, j;
  1080. if (1 < d) {
  1081. l = Array(d);
  1082. g = Array(d);
  1083. for (j = Array(d); f < d; f++) c[f] && e.isFunction(c[f].promise) ? c[f].promise().done(m(f, j, c)).fail(s.reject).progress(m(f, g, l)) : --v
  1084. }
  1085. return v || s.resolveWith(j, c), s.promise()
  1086. }
  1087. });
  1088. var Nc = e,
  1089. bb, Q, Ha, ha, Ia, Ja, U, ia, Ka, cb,
  1090. va, Jb, M = D.createElement("div");
  1091. M.setAttribute("className", "t");
  1092. M.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>";
  1093. Ha = M.getElementsByTagName("*");
  1094. ha = M.getElementsByTagName("a")[0];
  1095. ha.style.cssText = "top:1px;float:left;opacity:.5";
  1096. if (!Ha || !Ha.length) bb = {};
  1097. else {
  1098. Ia = D.createElement("select");
  1099. Ja = Ia.appendChild(D.createElement("option"));
  1100. U = M.getElementsByTagName("input")[0];
  1101. Q = {
  1102. leadingWhitespace: 3 === M.firstChild.nodeType,
  1103. tbody: !M.getElementsByTagName("tbody").length,
  1104. htmlSerialize: !!M.getElementsByTagName("link").length,
  1105. style: /top/.test(ha.getAttribute("style")),
  1106. hrefNormalized: "/a" === ha.getAttribute("href"),
  1107. opacity: /^0.5/.test(ha.style.opacity),
  1108. cssFloat: !!ha.style.cssFloat,
  1109. checkOn: "on" === U.value,
  1110. optSelected: Ja.selected,
  1111. getSetAttribute: "t" !== M.className,
  1112. enctype: !!D.createElement("form").enctype,
  1113. html5Clone: "<:nav></:nav>" !== D.createElement("nav").cloneNode(!0).outerHTML,
  1114. boxModel: "CSS1Compat" === D.compatMode,
  1115. submitBubbles: !0,
  1116. changeBubbles: !0,
  1117. focusinBubbles: !1,
  1118. deleteExpando: !0,
  1119. noCloneEvent: !0,
  1120. inlineBlockNeedsLayout: !1,
  1121. shrinkWrapBlocks: !1,
  1122. reliableMarginRight: !0,
  1123. boxSizingReliable: !0,
  1124. pixelPosition: !1
  1125. };
  1126. U.checked = !0;
  1127. Q.noCloneChecked = U.cloneNode(!0).checked;
  1128. Ia.disabled = !0;
  1129. Q.optDisabled = !Ja.disabled;
  1130. try {
  1131. delete M.test
  1132. } catch (Pd) {
  1133. Q.deleteExpando = !1
  1134. }!M.addEventListener && M.attachEvent && M.fireEvent && (M.attachEvent("onclick", Jb = function() {
  1135. Q.noCloneEvent = !1
  1136. }), M.cloneNode(!0).fireEvent("onclick"), M.detachEvent("onclick", Jb));
  1137. U = D.createElement("input");
  1138. U.value = "t";
  1139. U.setAttribute("type", "radio");
  1140. Q.radioValue = "t" === U.value;
  1141. U.setAttribute("checked",
  1142. "checked");
  1143. U.setAttribute("name", "t");
  1144. M.appendChild(U);
  1145. ia = D.createDocumentFragment();
  1146. ia.appendChild(M.lastChild);
  1147. Q.checkClone = ia.cloneNode(!0).cloneNode(!0).lastChild.checked;
  1148. Q.appendChecked = U.checked;
  1149. ia.removeChild(U);
  1150. ia.appendChild(M);
  1151. if (M.attachEvent)
  1152. for (cb in {
  1153. submit: !0,
  1154. change: !0,
  1155. focusin: !0
  1156. }) Ka = "on" + cb, (va = Ka in M) || (M.setAttribute(Ka, "return;"), va = "function" == typeof M[Ka]), Q[cb + "Bubbles"] = va;
  1157. bb = (e(function() {
  1158. var u, f, c, e, d = D.getElementsByTagName("body")[0];
  1159. d && (u = D.createElement("div"), u.style.cssText =
  1160. "visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px", d.insertBefore(u, d.firstChild), f = D.createElement("div"), u.appendChild(f), f.innerHTML = "<table><tr><td></td><td>t</td></tr></table>", c = f.getElementsByTagName("td"), c[0].style.cssText = "padding:0;margin:0;border:0;display:none", va = 0 === c[0].offsetHeight, c[0].style.display = "", c[1].style.display = "none", Q.reliableHiddenOffsets = va && 0 === c[0].offsetHeight, f.innerHTML = "", f.style.cssText = "box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",
  1161. Q.boxSizing = 4 === f.offsetWidth, Q.doesNotIncludeMarginInBodyOffset = 1 !== d.offsetTop, b.getComputedStyle && (Q.pixelPosition = "1%" !== (b.getComputedStyle(f, null) || {}).top, Q.boxSizingReliable = "4px" === (b.getComputedStyle(f, null) || {
  1162. width: "4px"
  1163. }).width, e = D.createElement("div"), e.style.cssText = f.style.cssText = "padding:0;margin:0;border:0;display:block;overflow:hidden;", e.style.marginRight = e.style.width = "0", f.style.width = "1px", f.appendChild(e), Q.reliableMarginRight = !parseFloat((b.getComputedStyle(e, null) || {}).marginRight)),
  1164. "undefined" != typeof f.style.zoom && (f.innerHTML = "", f.style.cssText = "padding:0;margin:0;border:0;display:block;overflow:hidden;width:1px;padding:1px;display:inline;zoom:1", Q.inlineBlockNeedsLayout = 3 === f.offsetWidth, f.style.display = "block", f.style.overflow = "visible", f.innerHTML = "<div></div>", f.firstChild.style.width = "5px", Q.shrinkWrapBlocks = 3 !== f.offsetWidth, u.style.zoom = 1), d.removeChild(u))
  1165. }), ia.removeChild(M), Ha = ha = Ia = Ja = U = ia = M = null, Q)
  1166. }
  1167. Nc.support = bb;
  1168. var tc = /(?:\{[\s\S]*\}|\[[\s\S]*\])$/,
  1169. sc = /([A-Z])/g;
  1170. e.extend({
  1171. cache: {},
  1172. deletedIds: [],
  1173. uuid: 0,
  1174. expando: "jQuery" + (e.fn.jquery + Math.random()).replace(/\D/g, ""),
  1175. noData: {
  1176. embed: !0,
  1177. object: "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",
  1178. applet: !0
  1179. },
  1180. hasData: function(b) {
  1181. return b = b.nodeType ? e.cache[b[e.expando]] : b[e.expando], !!b && !g(b)
  1182. },
  1183. data: function(b, f, q, d) {
  1184. if (e.acceptData(b)) {
  1185. var v, s, m = e.expando,
  1186. l = "string" == typeof f,
  1187. g = b.nodeType,
  1188. j = g ? e.cache : b,
  1189. p = g ? b[m] : b[m] && m;
  1190. if (p && j[p] && (d || j[p].data) || !(l && q === c)) {
  1191. p || (g ? b[m] = p = e.deletedIds.pop() || e.guid++ : p = m);
  1192. j[p] || (j[p] = {},
  1193. g || (j[p].toJSON = e.noop));
  1194. if ("object" == typeof f || "function" == typeof f) d ? j[p] = e.extend(j[p], f) : j[p].data = e.extend(j[p].data, f);
  1195. return v = j[p], d || (v.data || (v.data = {}), v = v.data), q !== c && (v[e.camelCase(f)] = q), l ? (s = v[f], null == s && (s = v[e.camelCase(f)])) : s = v, s
  1196. }
  1197. }
  1198. },
  1199. removeData: function(b, f, c) {
  1200. if (e.acceptData(b)) {
  1201. var d, v, s, m = b.nodeType,
  1202. l = m ? e.cache : b,
  1203. j = m ? b[e.expando] : e.expando;
  1204. if (l[j]) {
  1205. if (f && (d = c ? l[j] : l[j].data)) {
  1206. e.isArray(f) || (f in d ? f = [f] : (f = e.camelCase(f), f in d ? f = [f] : f = f.split(" ")));
  1207. v = 0;
  1208. for (s = f.length; v < s; v++) delete d[f[v]];
  1209. if (!(c ? g : e.isEmptyObject)(d)) return
  1210. }
  1211. if (c || !(delete l[j].data, !g(l[j]))) m ? e.cleanData([b], !0) : e.support.deleteExpando || l != l.window ? delete l[j] : l[j] = null
  1212. }
  1213. }
  1214. },
  1215. _data: function(b, f, c) {
  1216. return e.data(b, f, c, !0)
  1217. },
  1218. acceptData: function(b) {
  1219. var f = b.nodeName && e.noData[b.nodeName.toLowerCase()];
  1220. return !f || !0 !== f && b.getAttribute("classid") === f
  1221. }
  1222. });
  1223. e.fn.extend({
  1224. data: function(b, f) {
  1225. var q, C, v, s, m, l = this[0],
  1226. g = 0,
  1227. j = null;
  1228. if (b === c) {
  1229. if (this.length && (j = e.data(l), 1 === l.nodeType && !e._data(l, "parsedAttrs"))) {
  1230. v = l.attributes;
  1231. for (m = v.length; g <
  1232. m; g++) s = v[g].name, s.indexOf("data-") || (s = e.camelCase(s.substring(5)), d(l, s, j[s]));
  1233. e._data(l, "parsedAttrs", !0)
  1234. }
  1235. return j
  1236. }
  1237. return "object" == typeof b ? this.each(function() {
  1238. e.data(this, b)
  1239. }) : (q = b.split(".", 2), q[1] = q[1] ? "." + q[1] : "", C = q[1] + "!", e.access(this, function(f) {
  1240. if (f === c) return j = this.triggerHandler("getData" + C, [q[0]]), j === c && l && (j = e.data(l, b), j = d(l, b, j)), j === c && q[1] ? this.data(q[0]) : j;
  1241. q[1] = f;
  1242. this.each(function() {
  1243. var c = e(this);
  1244. c.triggerHandler("setData" + C, q);
  1245. e.data(this, b, f);
  1246. c.triggerHandler("changeData" +
  1247. C, q)
  1248. })
  1249. }, null, f, 1 < arguments.length, null, !1))
  1250. },
  1251. removeData: function(b) {
  1252. return this.each(function() {
  1253. e.removeData(this, b)
  1254. })
  1255. }
  1256. });
  1257. e.extend({
  1258. queue: function(b, f, c) {
  1259. var d;
  1260. if (b) return f = (f || "fx") + "queue", d = e._data(b, f), c && (!d || e.isArray(c) ? d = e._data(b, f, e.makeArray(c)) : d.push(c)), d || []
  1261. },
  1262. dequeue: function(b, f) {
  1263. f = f || "fx";
  1264. var c = e.queue(b, f),
  1265. d = c.length,
  1266. v = c.shift(),
  1267. s = e._queueHooks(b, f),
  1268. m = function() {
  1269. e.dequeue(b, f)
  1270. };
  1271. "inprogress" === v && (v = c.shift(), d--);
  1272. v && ("fx" === f && c.unshift("inprogress"), delete s.stop, v.call(b, m, s));
  1273. !d && s && s.empty.fire()
  1274. },
  1275. _queueHooks: function(b, f) {
  1276. var c = f + "queueHooks";
  1277. return e._data(b, c) || e._data(b, c, {
  1278. empty: e.Callbacks("once memory").add(function() {
  1279. e.removeData(b, f + "queue", !0);
  1280. e.removeData(b, c, !0)
  1281. })
  1282. })
  1283. }
  1284. });
  1285. e.fn.extend({
  1286. queue: function(b, f) {
  1287. var q = 2;
  1288. return "string" != typeof b && (f = b, b = "fx", q--), arguments.length < q ? e.queue(this[0], b) : f === c ? this : this.each(function() {
  1289. var c = e.queue(this, b, f);
  1290. e._queueHooks(this, b);
  1291. "fx" === b && "inprogress" !== c[0] && e.dequeue(this, b)
  1292. })
  1293. },
  1294. dequeue: function(b) {
  1295. return this.each(function() {
  1296. e.dequeue(this,
  1297. b)
  1298. })
  1299. },
  1300. delay: function(b, f) {
  1301. return b = e.fx ? e.fx.speeds[b] || b : b, f = f || "fx", this.queue(f, function(f, c) {
  1302. var e = setTimeout(f, b);
  1303. c.stop = function() {
  1304. clearTimeout(e)
  1305. }
  1306. })
  1307. },
  1308. clearQueue: function(b) {
  1309. return this.queue(b || "fx", [])
  1310. },
  1311. promise: function(b, f) {
  1312. var q, d = 1,
  1313. v = e.Deferred(),
  1314. s = this,
  1315. m = this.length,
  1316. l = function() {
  1317. --d || v.resolveWith(s, [s])
  1318. };
  1319. "string" != typeof b && (f = b, b = c);
  1320. for (b = b || "fx"; m--;)(q = e._data(s[m], b + "queueHooks")) && q.empty && (d++, q.empty.add(l));
  1321. return l(), v.promise(f)
  1322. }
  1323. });
  1324. var ca, Kb, Lb, Mb = /[\t\r\n]/g,
  1325. Oc = /\r/g,
  1326. Pc = /^(?:button|input)$/i,
  1327. Qc = /^(?:button|input|object|select|textarea)$/i,
  1328. Rc = /^a(?:rea|)$/i,
  1329. Nb = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,
  1330. Ob = e.support.getSetAttribute;
  1331. e.fn.extend({
  1332. attr: function(b, f) {
  1333. return e.access(this, e.attr, b, f, 1 < arguments.length)
  1334. },
  1335. removeAttr: function(b) {
  1336. return this.each(function() {
  1337. e.removeAttr(this, b)
  1338. })
  1339. },
  1340. prop: function(b, f) {
  1341. return e.access(this, e.prop, b, f, 1 < arguments.length)
  1342. },
  1343. removeProp: function(b) {
  1344. return b = e.propFix[b] ||
  1345. b, this.each(function() {
  1346. try {
  1347. this[b] = c, delete this[b]
  1348. } catch (f) {}
  1349. })
  1350. },
  1351. addClass: function(b) {
  1352. var f, c, d, v, s, m, l;
  1353. if (e.isFunction(b)) return this.each(function(f) {
  1354. e(this).addClass(b.call(this, f, this.className))
  1355. });
  1356. if (b && "string" == typeof b) {
  1357. f = b.split(ga);
  1358. c = 0;
  1359. for (d = this.length; c < d; c++)
  1360. if (v = this[c], 1 === v.nodeType)
  1361. if (!v.className && 1 === f.length) v.className = b;
  1362. else {
  1363. s = " " + v.className + " ";
  1364. m = 0;
  1365. for (l = f.length; m < l; m++) 0 > s.indexOf(" " + f[m] + " ") && (s += f[m] + " ");
  1366. v.className = e.trim(s)
  1367. }
  1368. }
  1369. return this
  1370. },
  1371. removeClass: function(b) {
  1372. var f,
  1373. q, d, v, s, m, l;
  1374. if (e.isFunction(b)) return this.each(function(f) {
  1375. e(this).removeClass(b.call(this, f, this.className))
  1376. });
  1377. if (b && "string" == typeof b || b === c) {
  1378. f = (b || "").split(ga);
  1379. m = 0;
  1380. for (l = this.length; m < l; m++)
  1381. if (d = this[m], 1 === d.nodeType && d.className) {
  1382. q = (" " + d.className + " ").replace(Mb, " ");
  1383. v = 0;
  1384. for (s = f.length; v < s; v++)
  1385. for (; 0 <= q.indexOf(" " + f[v] + " ");) q = q.replace(" " + f[v] + " ", " ");
  1386. d.className = b ? e.trim(q) : ""
  1387. }
  1388. }
  1389. return this
  1390. },
  1391. toggleClass: function(b, f) {
  1392. var c = typeof b,
  1393. d = "boolean" == typeof f;
  1394. return e.isFunction(b) ? this.each(function(c) {
  1395. e(this).toggleClass(b.call(this,
  1396. c, this.className, f), f)
  1397. }) : this.each(function() {
  1398. if ("string" === c)
  1399. for (var v, s = 0, m = e(this), l = f, g = b.split(ga); v = g[s++];) l = d ? l : !m.hasClass(v), m[l ? "addClass" : "removeClass"](v);
  1400. else if ("undefined" === c || "boolean" === c) this.className && e._data(this, "__className__", this.className), this.className = this.className || !1 === b ? "" : e._data(this, "__className__") || ""
  1401. })
  1402. },
  1403. hasClass: function(b) {
  1404. b = " " + b + " ";
  1405. for (var f = 0, c = this.length; f < c; f++)
  1406. if (1 === this[f].nodeType && 0 <= (" " + this[f].className + " ").replace(Mb, " ").indexOf(b)) return !0;
  1407. return !1
  1408. },
  1409. val: function(b) {
  1410. var f, q, d, v = this[0];
  1411. if (arguments.length) return d = e.isFunction(b), this.each(function(q) {
  1412. var m, v = e(this);
  1413. if (1 === this.nodeType && (d ? m = b.call(this, q, v.val()) : m = b, null == m ? m = "" : "number" == typeof m ? m += "" : e.isArray(m) && (m = e.map(m, function(b) {
  1414. return null == b ? "" : b + ""
  1415. })), f = e.valHooks[this.type] || e.valHooks[this.nodeName.toLowerCase()], !f || !("set" in f) || f.set(this, m, "value") === c)) this.value = m
  1416. });
  1417. if (v) return f = e.valHooks[v.type] || e.valHooks[v.nodeName.toLowerCase()], f && "get" in f && (q = f.get(v,
  1418. "value")) !== c ? q : (q = v.value, "string" == typeof q ? q.replace(Oc, "") : null == q ? "" : q)
  1419. }
  1420. });
  1421. e.extend({
  1422. valHooks: {
  1423. option: {
  1424. get: function(b) {
  1425. var f = b.attributes.value;
  1426. return !f || f.specified ? b.value : b.text
  1427. }
  1428. },
  1429. select: {
  1430. get: function(b) {
  1431. var f, c, d = b.selectedIndex,
  1432. v = [],
  1433. s = b.options,
  1434. m = "select-one" === b.type;
  1435. if (0 > d) return null;
  1436. b = m ? d : 0;
  1437. for (c = m ? d + 1 : s.length; b < c; b++)
  1438. if (f = s[b], f.selected && (e.support.optDisabled ? !f.disabled : null === f.getAttribute("disabled")) && (!f.parentNode.disabled || !e.nodeName(f.parentNode, "optgroup"))) {
  1439. f = e(f).val();
  1440. if (m) return f;
  1441. v.push(f)
  1442. }
  1443. return m && !v.length && s.length ? e(s[d]).val() : v
  1444. },
  1445. set: function(b, f) {
  1446. var c = e.makeArray(f);
  1447. return e(b).find("option").each(function() {
  1448. this.selected = 0 <= e.inArray(e(this).val(), c)
  1449. }), c.length || (b.selectedIndex = -1), c
  1450. }
  1451. }
  1452. },
  1453. attrFn: {},
  1454. attr: function(b, f, q, d) {
  1455. var v, s, m = b.nodeType;
  1456. if (b && !(3 === m || 8 === m || 2 === m)) {
  1457. if (d && e.isFunction(e.fn[f])) return e(b)[f](q);
  1458. if ("undefined" == typeof b.getAttribute) return e.prop(b, f, q);
  1459. (d = 1 !== m || !e.isXMLDoc(b)) && (f = f.toLowerCase(), s = e.attrHooks[f] || (Nb.test(f) ? Kb :
  1460. ca));
  1461. if (q !== c) {
  1462. if (null === q) {
  1463. e.removeAttr(b, f);
  1464. return
  1465. }
  1466. return s && "set" in s && d && (v = s.set(b, q, f)) !== c ? v : (b.setAttribute(f, q + ""), q)
  1467. }
  1468. return s && "get" in s && d && null !== (v = s.get(b, f)) ? v : (v = b.getAttribute(f), null === v ? c : v)
  1469. }
  1470. },
  1471. removeAttr: function(b, f) {
  1472. var c, d, v, s, m = 0;
  1473. if (f && 1 === b.nodeType)
  1474. for (d = f.split(ga); m < d.length; m++)(v = d[m]) && (c = e.propFix[v] || v, s = Nb.test(v), s || e.attr(b, v, ""), b.removeAttribute(Ob ? v : c), s && c in b && (b[c] = !1))
  1475. },
  1476. attrHooks: {
  1477. type: {
  1478. set: function(b, f) {
  1479. if (Pc.test(b.nodeName) && b.parentNode) e.error("type property can't be changed");
  1480. else if (!e.support.radioValue && "radio" === f && e.nodeName(b, "input")) {
  1481. var c = b.value;
  1482. return b.setAttribute("type", f), c && (b.value = c), f
  1483. }
  1484. }
  1485. },
  1486. value: {
  1487. get: function(b, f) {
  1488. return ca && e.nodeName(b, "button") ? ca.get(b, f) : f in b ? b.value : null
  1489. },
  1490. set: function(b, f, c) {
  1491. if (ca && e.nodeName(b, "button")) return ca.set(b, f, c);
  1492. b.value = f
  1493. }
  1494. }
  1495. },
  1496. propFix: {
  1497. tabindex: "tabIndex",
  1498. readonly: "readOnly",
  1499. "for": "htmlFor",
  1500. "class": "className",
  1501. maxlength: "maxLength",
  1502. cellspacing: "cellSpacing",
  1503. cellpadding: "cellPadding",
  1504. rowspan: "rowSpan",
  1505. colspan: "colSpan",
  1506. usemap: "useMap",
  1507. frameborder: "frameBorder",
  1508. contenteditable: "contentEditable"
  1509. },
  1510. prop: function(b, f, q) {
  1511. var d, v, s, m = b.nodeType;
  1512. if (b && !(3 === m || 8 === m || 2 === m)) return s = 1 !== m || !e.isXMLDoc(b), s && (f = e.propFix[f] || f, v = e.propHooks[f]), q !== c ? v && "set" in v && (d = v.set(b, q, f)) !== c ? d : b[f] = q : v && "get" in v && null !== (d = v.get(b, f)) ? d : b[f]
  1513. },
  1514. propHooks: {
  1515. tabIndex: {
  1516. get: function(b) {
  1517. var f = b.getAttributeNode("tabindex");
  1518. return f && f.specified ? parseInt(f.value, 10) : Qc.test(b.nodeName) || Rc.test(b.nodeName) && b.href ? 0 : c
  1519. }
  1520. }
  1521. }
  1522. });
  1523. Kb = {
  1524. get: function(b,
  1525. f) {
  1526. var q, d = e.prop(b, f);
  1527. return !0 === d || "boolean" != typeof d && (q = b.getAttributeNode(f)) && !1 !== q.nodeValue ? f.toLowerCase() : c
  1528. },
  1529. set: function(b, f, c) {
  1530. var d;
  1531. return !1 === f ? e.removeAttr(b, c) : (d = e.propFix[c] || c, d in b && (b[d] = !0), b.setAttribute(c, c.toLowerCase())), c
  1532. }
  1533. };
  1534. Ob || (Lb = {
  1535. name: !0,
  1536. id: !0,
  1537. coords: !0
  1538. }, ca = e.valHooks.button = {
  1539. get: function(b, f) {
  1540. var e;
  1541. return e = b.getAttributeNode(f), e && (Lb[f] ? "" !== e.value : e.specified) ? e.value : c
  1542. },
  1543. set: function(b, f, c) {
  1544. var e = b.getAttributeNode(c);
  1545. return e || (e = D.createAttribute(c), b.setAttributeNode(e)),
  1546. e.value = f + ""
  1547. }
  1548. }, e.each(["width", "height"], function(b, f) {
  1549. e.attrHooks[f] = e.extend(e.attrHooks[f], {
  1550. set: function(b, u) {
  1551. if ("" === u) return b.setAttribute(f, "auto"), u
  1552. }
  1553. })
  1554. }), e.attrHooks.contenteditable = {
  1555. get: ca.get,
  1556. set: function(b, f, c) {
  1557. "" === f && (f = "false");
  1558. ca.set(b, f, c)
  1559. }
  1560. });
  1561. e.support.hrefNormalized || e.each(["href", "src", "width", "height"], function(b, f) {
  1562. e.attrHooks[f] = e.extend(e.attrHooks[f], {
  1563. get: function(b) {
  1564. b = b.getAttribute(f, 2);
  1565. return null === b ? c : b
  1566. }
  1567. })
  1568. });
  1569. e.support.style || (e.attrHooks.style = {
  1570. get: function(b) {
  1571. return b.style.cssText.toLowerCase() ||
  1572. c
  1573. },
  1574. set: function(b, f) {
  1575. return b.style.cssText = f + ""
  1576. }
  1577. });
  1578. e.support.optSelected || (e.propHooks.selected = e.extend(e.propHooks.selected, {
  1579. get: function(b) {
  1580. b = b.parentNode;
  1581. return b && (b.selectedIndex, b.parentNode && b.parentNode.selectedIndex), null
  1582. }
  1583. }));
  1584. e.support.enctype || (e.propFix.enctype = "encoding");
  1585. e.support.checkOn || e.each(["radio", "checkbox"], function() {
  1586. e.valHooks[this] = {
  1587. get: function(b) {
  1588. return null === b.getAttribute("value") ? "on" : b.value
  1589. }
  1590. }
  1591. });
  1592. e.each(["radio", "checkbox"], function() {
  1593. e.valHooks[this] = e.extend(e.valHooks[this], {
  1594. set: function(b, f) {
  1595. if (e.isArray(f)) return b.checked = 0 <= e.inArray(e(b).val(), f)
  1596. }
  1597. })
  1598. });
  1599. var db = /^(?:textarea|input|select)$/i,
  1600. Pb = /^([^\.]*|)(?:\.(.+)|)$/,
  1601. Sc = /(?:^|\s)hover(\.\S+|)\b/,
  1602. Tc = /^key/,
  1603. Uc = /^(?:mouse|contextmenu)|click/,
  1604. Qb = /^(?:focusinfocus|focusoutblur)$/,
  1605. Rb = function(b) {
  1606. return e.event.special.hover ? b : b.replace(Sc, "mouseenter$1 mouseleave$1")
  1607. };
  1608. e.event = {
  1609. add: function(b, f, d, C, v) {
  1610. var s, m, l, g, j, p, t, r, n;
  1611. if (!(3 === b.nodeType || 8 === b.nodeType || !f || !d || !(s = e._data(b)))) {
  1612. d.handler && (t = d, d = t.handler, v = t.selector);
  1613. d.guid || (d.guid = e.guid++);
  1614. (l = s.events) || (s.events = l = {});
  1615. (m = s.handle) || (s.handle = m = function(b) {
  1616. return "undefined" != typeof e && (!b || e.event.triggered !== b.type) ? e.event.dispatch.apply(m.elem, arguments) : c
  1617. }, m.elem = b);
  1618. f = e.trim(Rb(f)).split(" ");
  1619. for (s = 0; s < f.length; s++) {
  1620. g = Pb.exec(f[s]) || [];
  1621. j = g[1];
  1622. p = (g[2] || "").split(".").sort();
  1623. n = e.event.special[j] || {};
  1624. j = (v ? n.delegateType : n.bindType) || j;
  1625. n = e.event.special[j] || {};
  1626. g = e.extend({
  1627. type: j,
  1628. origType: g[1],
  1629. data: C,
  1630. handler: d,
  1631. guid: d.guid,
  1632. selector: v,
  1633. needsContext: v && e.expr.match.needsContext.test(v),
  1634. namespace: p.join(".")
  1635. }, t);
  1636. r = l[j];
  1637. if (!r && (r = l[j] = [], r.delegateCount = 0, !n.setup || !1 === n.setup.call(b, C, p, m))) b.addEventListener ? b.addEventListener(j, m, !1) : b.attachEvent && b.attachEvent("on" + j, m);
  1638. n.add && (n.add.call(b, g), g.handler.guid || (g.handler.guid = d.guid));
  1639. v ? r.splice(r.delegateCount++, 0, g) : r.push(g);
  1640. e.event.global[j] = !0
  1641. }
  1642. b = null
  1643. }
  1644. },
  1645. global: {},
  1646. remove: function(b, f, c, d, v) {
  1647. var s, m, l, g, j, p, t, r, n, z, x = e.hasData(b) && e._data(b);
  1648. if (x && (t = x.events)) {
  1649. f = e.trim(Rb(f || "")).split(" ");
  1650. for (s = 0; s < f.length; s++)
  1651. if (m = Pb.exec(f[s]) || [], l = g = m[1], m = m[2], l) {
  1652. r = e.event.special[l] || {};
  1653. l = (d ? r.delegateType : r.bindType) || l;
  1654. n = t[l] || [];
  1655. j = n.length;
  1656. m = m ? RegExp("(^|\\.)" + m.split(".").sort().join("\\.(?:.*\\.|)") + "(\\.|$)") : null;
  1657. for (p = 0; p < n.length; p++) z = n[p], (v || g === z.origType) && (!c || c.guid === z.guid) && (!m || m.test(z.namespace)) && (!d || d === z.selector || "**" === d && z.selector) && (n.splice(p--, 1), z.selector && n.delegateCount--, r.remove && r.remove.call(b, z));
  1658. 0 === n.length && j !== n.length && ((!r.teardown || !1 === r.teardown.call(b, m, x.handle)) && e.removeEvent(b,
  1659. l, x.handle), delete t[l])
  1660. } else
  1661. for (l in t) e.event.remove(b, l + f[s], c, d, !0);
  1662. e.isEmptyObject(t) && (delete x.handle, e.removeData(b, "events", !0))
  1663. }
  1664. },
  1665. customEvent: {
  1666. getData: !0,
  1667. setData: !0,
  1668. changeData: !0
  1669. },
  1670. trigger: function(u, f, d, C) {
  1671. if (!d || 3 !== d.nodeType && 8 !== d.nodeType) {
  1672. var v, l, m, g, j, p, t, r = u.type || u;
  1673. g = [];
  1674. if (!Qb.test(r + e.event.triggered) && (0 <= r.indexOf("!") && (r = r.slice(0, -1), v = !0), 0 <= r.indexOf(".") && (g = r.split("."), r = g.shift(), g.sort()), d && !e.event.customEvent[r] || e.event.global[r]))
  1675. if (u = "object" == typeof u ? u[e.expando] ?
  1676. u : new e.Event(r, u) : new e.Event(r), u.type = r, u.isTrigger = !0, u.exclusive = v, u.namespace = g.join("."), u.namespace_re = u.namespace ? RegExp("(^|\\.)" + g.join("\\.(?:.*\\.|)") + "(\\.|$)") : null, g = 0 > r.indexOf(":") ? "on" + r : "", d) {
  1677. if (u.result = c, u.target || (u.target = d), f = null != f ? e.makeArray(f) : [], f.unshift(u), j = e.event.special[r] || {}, !(j.trigger && !1 === j.trigger.apply(d, f))) {
  1678. t = [
  1679. [d, j.bindType || r]
  1680. ];
  1681. if (!C && !j.noBubble && !e.isWindow(d)) {
  1682. l = j.delegateType || r;
  1683. v = Qb.test(l + r) ? d : d.parentNode;
  1684. for (m = d; v; v = v.parentNode) t.push([v, l]),
  1685. m = v;
  1686. m === (d.ownerDocument || D) && t.push([m.defaultView || m.parentWindow || b, l])
  1687. }
  1688. for (l = 0; l < t.length && !u.isPropagationStopped(); l++) v = t[l][0], u.type = t[l][1], (p = (e._data(v, "events") || {})[u.type] && e._data(v, "handle")) && p.apply(v, f), (p = g && v[g]) && e.acceptData(v) && p.apply && !1 === p.apply(v, f) && u.preventDefault();
  1689. return u.type = r, !C && !u.isDefaultPrevented() && (!j._default || !1 === j._default.apply(d.ownerDocument, f)) && ("click" !== r || !e.nodeName(d, "a")) && e.acceptData(d) && g && d[r] && ("focus" !== r && "blur" !== r || 0 !== u.target.offsetWidth) &&
  1690. !e.isWindow(d) && (m = d[g], m && (d[g] = null), e.event.triggered = r, d[r](), e.event.triggered = c, m && (d[g] = m)), u.result
  1691. }
  1692. } else
  1693. for (l in d = e.cache, d) d[l].events && d[l].events[r] && e.event.trigger(u, f, d[l].handle.elem, !0)
  1694. }
  1695. },
  1696. dispatch: function(u) {
  1697. u = e.event.fix(u || b.event);
  1698. var f, d, C, l, s, m, g = (e._data(this, "events") || {})[u.type] || [],
  1699. j = g.delegateCount,
  1700. p = aa.call(arguments),
  1701. r = !u.exclusive && !u.namespace,
  1702. t = e.event.special[u.type] || {},
  1703. n = [];
  1704. p[0] = u;
  1705. u.delegateTarget = this;
  1706. if (!(t.preDispatch && !1 === t.preDispatch.call(this, u))) {
  1707. if (j &&
  1708. (!u.button || "click" !== u.type))
  1709. for (d = u.target; d != this; d = d.parentNode || this)
  1710. if (!0 !== d.disabled || "click" !== u.type) {
  1711. l = {};
  1712. s = [];
  1713. for (f = 0; f < j; f++) C = g[f], m = C.selector, l[m] === c && (l[m] = C.needsContext ? 0 <= e(m, this).index(d) : e.find(m, this, null, [d]).length), l[m] && s.push(C);
  1714. s.length && n.push({
  1715. elem: d,
  1716. matches: s
  1717. })
  1718. }
  1719. g.length > j && n.push({
  1720. elem: this,
  1721. matches: g.slice(j)
  1722. });
  1723. for (f = 0; f < n.length && !u.isPropagationStopped(); f++) {
  1724. l = n[f];
  1725. u.currentTarget = l.elem;
  1726. for (d = 0; d < l.matches.length && !u.isImmediatePropagationStopped(); d++)
  1727. if (C = l.matches[d],
  1728. r || !u.namespace && !C.namespace || u.namespace_re && u.namespace_re.test(C.namespace)) u.data = C.data, u.handleObj = C, C = ((e.event.special[C.origType] || {}).handle || C.handler).apply(l.elem, p), C !== c && (u.result = C, !1 === C && (u.preventDefault(), u.stopPropagation()))
  1729. }
  1730. return t.postDispatch && t.postDispatch.call(this, u), u.result
  1731. }
  1732. },
  1733. props: "attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),
  1734. fixHooks: {},
  1735. keyHooks: {
  1736. props: ["char", "charCode", "key", "keyCode"],
  1737. filter: function(b, f) {
  1738. return null == b.which && (b.which = null != f.charCode ? f.charCode : f.keyCode), b
  1739. }
  1740. },
  1741. mouseHooks: {
  1742. props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),
  1743. filter: function(b, f) {
  1744. var d, e, l, s = f.button,
  1745. m = f.fromElement;
  1746. return null == b.pageX && null != f.clientX && (d = b.target.ownerDocument || D, e = d.documentElement, l = d.body, b.pageX = f.clientX + (e && e.scrollLeft || l && l.scrollLeft || 0) - (e && e.clientLeft ||
  1747. l && l.clientLeft || 0), b.pageY = f.clientY + (e && e.scrollTop || l && l.scrollTop || 0) - (e && e.clientTop || l && l.clientTop || 0)), !b.relatedTarget && m && (b.relatedTarget = m === b.target ? f.toElement : m), !b.which && s !== c && (b.which = s & 1 ? 1 : s & 2 ? 3 : s & 4 ? 2 : 0), b
  1748. }
  1749. },
  1750. fix: function(b) {
  1751. if (b[e.expando]) return b;
  1752. var f, c, d = b,
  1753. l = e.event.fixHooks[b.type] || {},
  1754. s = l.props ? this.props.concat(l.props) : this.props;
  1755. b = e.Event(d);
  1756. for (f = s.length; f;) c = s[--f], b[c] = d[c];
  1757. return b.target || (b.target = d.srcElement || D), 3 === b.target.nodeType && (b.target = b.target.parentNode),
  1758. b.metaKey = !!b.metaKey, l.filter ? l.filter(b, d) : b
  1759. },
  1760. special: {
  1761. load: {
  1762. noBubble: !0
  1763. },
  1764. focus: {
  1765. delegateType: "focusin"
  1766. },
  1767. blur: {
  1768. delegateType: "focusout"
  1769. },
  1770. beforeunload: {
  1771. setup: function(b, f, c) {
  1772. e.isWindow(this) && (this.onbeforeunload = c)
  1773. },
  1774. teardown: function(b, f) {
  1775. this.onbeforeunload === f && (this.onbeforeunload = null)
  1776. }
  1777. }
  1778. },
  1779. simulate: function(b, f, c, d) {
  1780. b = e.extend(new e.Event, c, {
  1781. type: b,
  1782. isSimulated: !0,
  1783. originalEvent: {}
  1784. });
  1785. d ? e.event.trigger(b, null, f) : e.event.dispatch.call(f, b);
  1786. b.isDefaultPrevented() && c.preventDefault()
  1787. }
  1788. };
  1789. e.event.handle =
  1790. e.event.dispatch;
  1791. e.removeEvent = D.removeEventListener ? function(b, f, c) {
  1792. b.removeEventListener && b.removeEventListener(f, c, !1)
  1793. } : function(b, f, c) {
  1794. f = "on" + f;
  1795. b.detachEvent && ("undefined" == typeof b[f] && (b[f] = null), b.detachEvent(f, c))
  1796. };
  1797. e.Event = function(b, f) {
  1798. if (this instanceof e.Event) b && b.type ? (this.originalEvent = b, this.type = b.type, this.isDefaultPrevented = b.defaultPrevented || !1 === b.returnValue || b.getPreventDefault && b.getPreventDefault() ? n : j) : this.type = b, f && e.extend(this, f), this.timeStamp = b && b.timeStamp || e.now(),
  1799. this[e.expando] = !0;
  1800. else return new e.Event(b, f)
  1801. };
  1802. e.Event.prototype = {
  1803. preventDefault: function() {
  1804. this.isDefaultPrevented = n;
  1805. var b = this.originalEvent;
  1806. b && (b.preventDefault ? b.preventDefault() : b.returnValue = !1)
  1807. },
  1808. stopPropagation: function() {
  1809. this.isPropagationStopped = n;
  1810. var b = this.originalEvent;
  1811. b && (b.stopPropagation && b.stopPropagation(), b.cancelBubble = !0)
  1812. },
  1813. stopImmediatePropagation: function() {
  1814. this.isImmediatePropagationStopped = n;
  1815. this.stopPropagation()
  1816. },
  1817. isDefaultPrevented: j,
  1818. isPropagationStopped: j,
  1819. isImmediatePropagationStopped: j
  1820. };
  1821. e.each({
  1822. mouseenter: "mouseover",
  1823. mouseleave: "mouseout"
  1824. }, function(b, f) {
  1825. e.event.special[b] = {
  1826. delegateType: f,
  1827. bindType: f,
  1828. handle: function(b) {
  1829. var c, u = b.relatedTarget,
  1830. d = b.handleObj;
  1831. if (!u || u !== this && !e.contains(this, u)) b.type = d.origType, c = d.handler.apply(this, arguments), b.type = f;
  1832. return c
  1833. }
  1834. }
  1835. });
  1836. e.support.submitBubbles || (e.event.special.submit = {
  1837. setup: function() {
  1838. if (e.nodeName(this, "form")) return !1;
  1839. e.event.add(this, "click._submit keypress._submit", function(b) {
  1840. b = b.target;
  1841. (b = e.nodeName(b, "input") || e.nodeName(b, "button") ?
  1842. b.form : c) && !e._data(b, "_submit_attached") && (e.event.add(b, "submit._submit", function(b) {
  1843. b._submit_bubble = !0
  1844. }), e._data(b, "_submit_attached", !0))
  1845. })
  1846. },
  1847. postDispatch: function(b) {
  1848. b._submit_bubble && (delete b._submit_bubble, this.parentNode && !b.isTrigger && e.event.simulate("submit", this.parentNode, b, !0))
  1849. },
  1850. teardown: function() {
  1851. if (e.nodeName(this, "form")) return !1;
  1852. e.event.remove(this, "._submit")
  1853. }
  1854. });
  1855. e.support.changeBubbles || (e.event.special.change = {
  1856. setup: function() {
  1857. if (db.test(this.nodeName)) {
  1858. if ("checkbox" === this.type ||
  1859. "radio" === this.type) e.event.add(this, "propertychange._change", function(b) {
  1860. "checked" === b.originalEvent.propertyName && (this._just_changed = !0)
  1861. }), e.event.add(this, "click._change", function(b) {
  1862. this._just_changed && !b.isTrigger && (this._just_changed = !1);
  1863. e.event.simulate("change", this, b, !0)
  1864. });
  1865. return !1
  1866. }
  1867. e.event.add(this, "beforeactivate._change", function(b) {
  1868. b = b.target;
  1869. db.test(b.nodeName) && !e._data(b, "_change_attached") && (e.event.add(b, "change._change", function(b) {
  1870. this.parentNode && !b.isSimulated && !b.isTrigger &&
  1871. e.event.simulate("change", this.parentNode, b, !0)
  1872. }), e._data(b, "_change_attached", !0))
  1873. })
  1874. },
  1875. handle: function(b) {
  1876. var f = b.target;
  1877. if (this !== f || b.isSimulated || b.isTrigger || "radio" !== f.type && "checkbox" !== f.type) return b.handleObj.handler.apply(this, arguments)
  1878. },
  1879. teardown: function() {
  1880. return e.event.remove(this, "._change"), !db.test(this.nodeName)
  1881. }
  1882. });
  1883. e.support.focusinBubbles || e.each({
  1884. focus: "focusin",
  1885. blur: "focusout"
  1886. }, function(b, f) {
  1887. var c = 0,
  1888. d = function(b) {
  1889. e.event.simulate(f, b.target, e.event.fix(b), !0)
  1890. };
  1891. e.event.special[f] = {
  1892. setup: function() {
  1893. 0 === c++ && D.addEventListener(b, d, !0)
  1894. },
  1895. teardown: function() {
  1896. 0 === --c && D.removeEventListener(b, d, !0)
  1897. }
  1898. }
  1899. });
  1900. e.fn.extend({
  1901. on: function(b, f, d, l, v) {
  1902. var s, m;
  1903. if ("object" == typeof b) {
  1904. "string" != typeof f && (d = d || f, f = c);
  1905. for (m in b) this.on(m, f, d, b[m], v);
  1906. return this
  1907. }
  1908. null == d && null == l ? (l = f, d = f = c) : null == l && ("string" == typeof f ? (l = d, d = c) : (l = d, d = f, f = c));
  1909. if (!1 === l) l = j;
  1910. else if (!l) return this;
  1911. return 1 === v && (s = l, l = function(b) {
  1912. return e().off(b), s.apply(this, arguments)
  1913. }, l.guid = s.guid || (s.guid = e.guid++)), this.each(function() {
  1914. e.event.add(this,
  1915. b, l, d, f)
  1916. })
  1917. },
  1918. one: function(b, f, c, d) {
  1919. return this.on(b, f, c, d, 1)
  1920. },
  1921. off: function(b, f, d) {
  1922. var l, v;
  1923. if (b && b.preventDefault && b.handleObj) return l = b.handleObj, e(b.delegateTarget).off(l.namespace ? l.origType + "." + l.namespace : l.origType, l.selector, l.handler), this;
  1924. if ("object" == typeof b) {
  1925. for (v in b) this.off(v, f, b[v]);
  1926. return this
  1927. }
  1928. if (!1 === f || "function" == typeof f) d = f, f = c;
  1929. return !1 === d && (d = j), this.each(function() {
  1930. e.event.remove(this, b, d, f)
  1931. })
  1932. },
  1933. bind: function(b, f, c) {
  1934. return this.on(b, null, f, c)
  1935. },
  1936. unbind: function(b, f) {
  1937. return this.off(b,
  1938. null, f)
  1939. },
  1940. live: function(b, f, c) {
  1941. return e(this.context).on(b, this.selector, f, c), this
  1942. },
  1943. die: function(b, f) {
  1944. return e(this.context).off(b, this.selector || "**", f), this
  1945. },
  1946. delegate: function(b, f, c, d) {
  1947. return this.on(f, b, c, d)
  1948. },
  1949. undelegate: function(b, f, c) {
  1950. return 1 === arguments.length ? this.off(b, "**") : this.off(f, b || "**", c)
  1951. },
  1952. trigger: function(b, f) {
  1953. return this.each(function() {
  1954. e.event.trigger(b, f, this)
  1955. })
  1956. },
  1957. triggerHandler: function(b, f) {
  1958. if (this[0]) return e.event.trigger(b, f, this[0], !0)
  1959. },
  1960. toggle: function(b) {
  1961. var f = arguments,
  1962. c =
  1963. b.guid || e.guid++,
  1964. d = 0,
  1965. l = function(c) {
  1966. var q = (e._data(this, "lastToggle" + b.guid) || 0) % d;
  1967. return e._data(this, "lastToggle" + b.guid, q + 1), c.preventDefault(), f[q].apply(this, arguments) || !1
  1968. };
  1969. for (l.guid = c; d < f.length;) f[d++].guid = c;
  1970. return this.click(l)
  1971. },
  1972. hover: function(b, f) {
  1973. return this.mouseenter(b).mouseleave(f || b)
  1974. }
  1975. });
  1976. e.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 contextmenu".split(" "),
  1977. function(b, f) {
  1978. e.fn[f] = function(b, c) {
  1979. return null == c && (c = b, b = null), 0 < arguments.length ? this.on(f, null, b, c) : this.trigger(f)
  1980. };
  1981. Tc.test(f) && (e.event.fixHooks[f] = e.event.keyHooks);
  1982. Uc.test(f) && (e.event.fixHooks[f] = e.event.mouseHooks)
  1983. });
  1984. var Vc = b,
  1985. I = function(b, f, c, d) {
  1986. c = c || [];
  1987. f = f || X;
  1988. var e, l, m, g, j = f.nodeType;
  1989. if (!b || "string" != typeof b) return c;
  1990. if (1 !== j && 9 !== j) return [];
  1991. m = La(f);
  1992. if (!m && !d && (e = Wc.exec(b)))
  1993. if (g = e[1])
  1994. if (9 === j) {
  1995. l = f.getElementById(g);
  1996. if (!l || !l.parentNode) return c;
  1997. if (l.id === g) return c.push(l), c
  1998. } else {
  1999. if (f.ownerDocument &&
  2000. (l = f.ownerDocument.getElementById(g)) && Sb(f, l) && l.id === g) return c.push(l), c
  2001. } else {
  2002. if (e[2]) return pa.apply(c, qa.call(f.getElementsByTagName(b), 0)), c;
  2003. if ((g = e[3]) && Tb && f.getElementsByClassName) return pa.apply(c, qa.call(f.getElementsByClassName(g), 0)), c
  2004. }
  2005. return eb(b.replace(Ma, "$1"), f, c, d, m)
  2006. },
  2007. wa = function(b) {
  2008. return function(f) {
  2009. return "input" === f.nodeName.toLowerCase() && f.type === b
  2010. }
  2011. },
  2012. Ub = function(b) {
  2013. return function(f) {
  2014. var c = f.nodeName.toLowerCase();
  2015. return ("input" === c || "button" === c) && f.type === b
  2016. }
  2017. },
  2018. ja = function(b) {
  2019. return Y(function(f) {
  2020. return f = +f, Y(function(c, d) {
  2021. for (var e, l = b([], c.length, f), m = l.length; m--;) c[e = l[m]] && (c[e] = !(d[e] = c[e]))
  2022. })
  2023. })
  2024. },
  2025. Na = function(b, f, c) {
  2026. if (b === f) return c;
  2027. for (b = b.nextSibling; b;) {
  2028. if (b === f) return -1;
  2029. b = b.nextSibling
  2030. }
  2031. return 1
  2032. },
  2033. Pa = function(b, f) {
  2034. var c, d, e, l, m, g, j;
  2035. if (m = Vb[P][b]) return f ? 0 : m.slice(0);
  2036. m = b;
  2037. g = [];
  2038. for (j = G.preFilter; m;) {
  2039. if (!c || (d = Xc.exec(m))) d && (m = m.slice(d[0].length)), g.push(e = []);
  2040. c = !1;
  2041. if (d = Yc.exec(m)) e.push(c = new Wb(d.shift())), m = m.slice(c.length), c.type = d[0].replace(Ma, " ");
  2042. for (l in G.filter)(d = Oa[l].exec(m)) &&
  2043. (!j[l] || (d = j[l](d, X, !0))) && (e.push(c = new Wb(d.shift())), m = m.slice(c.length), c.type = l, c.matches = d);
  2044. if (!c) break
  2045. }
  2046. return f ? m.length : m ? I.error(b) : Vb(b, g).slice(0)
  2047. },
  2048. gb = function(b, f, c) {
  2049. var d = f.dir,
  2050. e = c && "parentNode" === f.dir,
  2051. l = Zc++;
  2052. return f.first ? function(f, c, q) {
  2053. for (; f = f[d];)
  2054. if (e || 1 === f.nodeType) return b(f, c, q)
  2055. } : function(f, c, q) {
  2056. if (q)
  2057. for (; f = f[d];) {
  2058. if ((e || 1 === f.nodeType) && b(f, c, q)) return f
  2059. } else
  2060. for (var g, j = xa + " " + l + " ", p = j + fb; f = f[d];)
  2061. if (e || 1 === f.nodeType) {
  2062. if ((g = f[P]) === p) return f.sizset;
  2063. if ("string" == typeof g &&
  2064. 0 === g.indexOf(j)) {
  2065. if (f.sizset) return f
  2066. } else {
  2067. f[P] = p;
  2068. if (b(f, c, q)) return f.sizset = !0, f;
  2069. f.sizset = !1
  2070. }
  2071. }
  2072. }
  2073. },
  2074. hb = function(b) {
  2075. return 1 < b.length ? function(f, c, d) {
  2076. for (var e = b.length; e--;)
  2077. if (!b[e](f, c, d)) return !1;
  2078. return !0
  2079. } : b[0]
  2080. },
  2081. Qa = function(b, f, c, d, e) {
  2082. for (var l, m = [], g = 0, j = b.length, p = null != f; g < j; g++)
  2083. if (l = b[g])
  2084. if (!c || c(l, d, e)) m.push(l), p && f.push(g);
  2085. return m
  2086. },
  2087. ib = function(b, f, c, d, e, l) {
  2088. return d && !d[P] && (d = ib(d)), e && !e[P] && (e = ib(e, l)), Y(function(l, g, s, j) {
  2089. if (!l || !e) {
  2090. var p, t, r = [],
  2091. n = [],
  2092. z = g.length;
  2093. if (!(t = l)) {
  2094. t = f || "*";
  2095. var x =
  2096. s.nodeType ? [s] : s,
  2097. A = [];
  2098. p = 0;
  2099. for (var B = x.length; p < B; p++) I(t, x[p], A, l);
  2100. t = A
  2101. }
  2102. x = b && (l || !f) ? Qa(t, r, b, s, j) : t;
  2103. A = c ? e || (l ? b : z || d) ? [] : g : x;
  2104. c && c(x, A, s, j);
  2105. if (d) {
  2106. t = Qa(A, n);
  2107. d(t, [], s, j);
  2108. for (s = t.length; s--;)
  2109. if (p = t[s]) A[n[s]] = !(x[n[s]] = p)
  2110. }
  2111. if (l)
  2112. for (s = b && A.length; s--;) {
  2113. if (p = A[s]) l[r[s]] = !(g[r[s]] = p)
  2114. } else A = Qa(A === g ? A.splice(z, A.length) : A), e ? e(null, g, A, j) : pa.apply(g, A)
  2115. }
  2116. })
  2117. },
  2118. jb = function(b) {
  2119. var f, c, d, e = b.length,
  2120. l = G.relative[b[0].type];
  2121. c = l || G.relative[" "];
  2122. for (var m = l ? 1 : 0, g = gb(function(b) {
  2123. return b === f
  2124. }, c, !0), j = gb(function(b) {
  2125. return -1 <
  2126. Xb.call(f, b)
  2127. }, c, !0), p = [
  2128. function(b, c, u) {
  2129. return !l && (u || c !== Ra) || ((f = c).nodeType ? g(b, c, u) : j(b, c, u))
  2130. }
  2131. ]; m < e; m++)
  2132. if (c = G.relative[b[m].type]) p = [gb(hb(p), c)];
  2133. else {
  2134. c = G.filter[b[m].type].apply(null, b[m].matches);
  2135. if (c[P]) {
  2136. for (d = ++m; d < e && !G.relative[b[d].type]; d++);
  2137. return ib(1 < m && hb(p), 1 < m && b.slice(0, m - 1).join("").replace(Ma, "$1"), c, m < d && jb(b.slice(m, d)), d < e && jb(b = b.slice(d)), d < e && b.join(""))
  2138. }
  2139. p.push(c)
  2140. }
  2141. return hb(p)
  2142. },
  2143. eb = function(b, f, c, d, e) {
  2144. var l, m, g, j, p = Pa(b);
  2145. if (!d && 1 === p.length) {
  2146. m = p[0] = p[0].slice(0);
  2147. if (2 < m.length &&
  2148. "ID" === (g = m[0]).type && 9 === f.nodeType && !e && G.relative[m[1].type]) {
  2149. f = G.find.ID(g.matches[0].replace(ka, ""), f, e)[0];
  2150. if (!f) return c;
  2151. b = b.slice(m.shift().length)
  2152. }
  2153. for (l = Oa.POS.test(b) ? -1 : m.length - 1; 0 <= l; l--) {
  2154. g = m[l];
  2155. if (G.relative[j = g.type]) break;
  2156. if (j = G.find[j])
  2157. if (d = j(g.matches[0].replace(ka, ""), kb.test(m[0].type) && f.parentNode || f, e)) {
  2158. m.splice(l, 1);
  2159. b = d.length && m.join("");
  2160. if (!b) return pa.apply(c, qa.call(d, 0)), c;
  2161. break
  2162. }
  2163. }
  2164. }
  2165. return lb(b, p)(d, f, e, c, kb.test(b)), c
  2166. },
  2167. Yb = function() {},
  2168. fb, mb, G, Sa, La, Sb, lb, nb, ya, Ra, Zb = !0,
  2169. P = ("sizcache" + Math.random()).replace(".", ""),
  2170. Wb = String,
  2171. X = Vc.document,
  2172. W = X.documentElement,
  2173. xa = 0,
  2174. Zc = 0,
  2175. $c = [].pop,
  2176. pa = [].push,
  2177. qa = [].slice,
  2178. Xb = [].indexOf || function(b) {
  2179. for (var f = 0, c = this.length; f < c; f++)
  2180. if (this[f] === b) return f;
  2181. return -1
  2182. },
  2183. Y = function(b, f) {
  2184. return b[P] = null == f || f, b
  2185. },
  2186. ob = function() {
  2187. var b = {},
  2188. f = [];
  2189. return Y(function(c, d) {
  2190. return f.push(c) > G.cacheLength && delete b[f.shift()], b[c] = d
  2191. }, b)
  2192. },
  2193. $b = ob(),
  2194. Vb = ob(),
  2195. ac = ob(),
  2196. bc = "\\[[\\x20\\t\\r\\n\\f]*((?:\\\\.|[-\\w]|[^\\x00-\\xa0])+)[\\x20\\t\\r\\n\\f]*(?:([*^$|!~]?=)[\\x20\\t\\r\\n\\f]*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|(" +
  2197. "(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+".replace("w", "w#") + ")|)|)[\\x20\\t\\r\\n\\f]*\\]",
  2198. pb = ":((?:\\\\.|[-\\w]|[^\\x00-\\xa0])+)(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|([^()[\\]]*|(?:(?:" + bc + ")|[^:]|\\\\.)*|.*))\\)|)",
  2199. Ma = /^[\x20\t\r\n\f]+|((?:^|[^\\])(?:\\.)*)[\x20\t\r\n\f]+$/g,
  2200. Xc = /^[\x20\t\r\n\f]*,[\x20\t\r\n\f]*/,
  2201. Yc = /^[\x20\t\r\n\f]*([\x20\t\r\n\f>+~])[\x20\t\r\n\f]*/,
  2202. ad = RegExp(pb),
  2203. Wc = /^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,
  2204. kb = /[\x20\t\r\n\f]*[+~]/,
  2205. bd = /h\d/i,
  2206. cd = /input|select|textarea|button/i,
  2207. ka = /\\(?!\\)/g,
  2208. Oa = {
  2209. ID: /^#((?:\\.|[-\w]|[^\x00-\xa0])+)/,
  2210. CLASS: /^\.((?:\\.|[-\w]|[^\x00-\xa0])+)/,
  2211. NAME: /^\[name=['"]?((?:\\.|[-\w]|[^\x00-\xa0])+)['"]?\]/,
  2212. TAG: RegExp("^(" + "(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+".replace("w", "w*") + ")"),
  2213. ATTR: RegExp("^" + bc),
  2214. PSEUDO: RegExp("^" + pb),
  2215. POS: /:(even|odd|eq|gt|lt|nth|first|last)(?:\([\x20\t\r\n\f]*((?:-\d)?\d*)[\x20\t\r\n\f]*\)|)(?=[^-]|$)/i,
  2216. CHILD: RegExp("^:(only|nth|first|last)-child(?:\\([\\x20\\t\\r\\n\\f]*(even|odd|(([+-]|)(\\d*)n|)[\\x20\\t\\r\\n\\f]*(?:([+-]|)[\\x20\\t\\r\\n\\f]*(\\d+)|))[\\x20\\t\\r\\n\\f]*\\)|)",
  2217. "i"),
  2218. needsContext: RegExp("^[\\x20\\t\\r\\n\\f]*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\([\\x20\\t\\r\\n\\f]*((?:-\\d)?\\d*)[\\x20\\t\\r\\n\\f]*\\)|)(?=[^-]|$)", "i")
  2219. },
  2220. da = function(b) {
  2221. var f = X.createElement("div");
  2222. try {
  2223. return b(f)
  2224. } catch (c) {
  2225. return !1
  2226. } finally {}
  2227. },
  2228. dd = da(function(b) {
  2229. return b.appendChild(X.createComment("")), !b.getElementsByTagName("*").length
  2230. }),
  2231. ed = da(function(b) {
  2232. return b.innerHTML = "<a href='#'></a>", b.firstChild && "undefined" !== typeof b.firstChild.getAttribute && "#" === b.firstChild.getAttribute("href")
  2233. }),
  2234. fd = da(function(b) {
  2235. b.innerHTML = "<select></select>";
  2236. b = typeof b.lastChild.getAttribute("multiple");
  2237. return "boolean" !== b && "string" !== b
  2238. }),
  2239. Tb = da(function(b) {
  2240. return b.innerHTML = "<div class='hidden e'></div><div class='hidden'></div>", !b.getElementsByClassName || !b.getElementsByClassName("e").length ? !1 : (b.lastChild.className = "e", 2 === b.getElementsByClassName("e").length)
  2241. }),
  2242. gd = da(function(b) {
  2243. b.id = P + 0;
  2244. b.innerHTML = "<a name='" + P + "'></a><div name='" + P + "'></div>";
  2245. W.insertBefore(b, W.firstChild);
  2246. var f = X.getElementsByName &&
  2247. X.getElementsByName(P).length === 2 + X.getElementsByName(P + 0).length;
  2248. return mb = !X.getElementById(P), W.removeChild(b), f
  2249. });
  2250. try {
  2251. qa.call(W.childNodes, 0)[0].nodeType
  2252. } catch (Qd) {
  2253. qa = function(b) {
  2254. for (var f, c = []; f = this[b]; b++) c.push(f);
  2255. return c
  2256. }
  2257. }
  2258. I.matches = function(b, f) {
  2259. return I(b, null, null, f)
  2260. };
  2261. I.matchesSelector = function(b, f) {
  2262. return 0 < I(f, null, null, [b]).length
  2263. };
  2264. Sa = I.getText = function(b) {
  2265. var f, c = "",
  2266. d = 0;
  2267. if (f = b.nodeType)
  2268. if (1 === f || 9 === f || 11 === f) {
  2269. if ("string" == typeof b.textContent) return b.textContent;
  2270. for (b = b.firstChild; b; b =
  2271. b.nextSibling) c += Sa(b)
  2272. } else {
  2273. if (3 === f || 4 === f) return b.nodeValue
  2274. } else
  2275. for (; f = b[d]; d++) c += Sa(f);
  2276. return c
  2277. };
  2278. La = I.isXML = function(b) {
  2279. return (b = b && (b.ownerDocument || b).documentElement) ? "HTML" !== b.nodeName : !1
  2280. };
  2281. Sb = I.contains = W.contains ? function(b, f) {
  2282. var c = 9 === b.nodeType ? b.documentElement : b,
  2283. d = f && f.parentNode;
  2284. return b === d || !(!d || !(1 === d.nodeType && c.contains && c.contains(d)))
  2285. } : W.compareDocumentPosition ? function(b, f) {
  2286. return f && !!(b.compareDocumentPosition(f) & 16)
  2287. } : function(b, f) {
  2288. for (; f = f.parentNode;)
  2289. if (f === b) return !0;
  2290. return !1
  2291. };
  2292. I.attr = function(b, f) {
  2293. var c, d = La(b);
  2294. return d || (f = f.toLowerCase()), (c = G.attrHandle[f]) ? c(b) : d || fd ? b.getAttribute(f) : (c = b.getAttributeNode(f), c ? "boolean" == typeof b[f] ? b[f] ? f : null : c.specified ? c.value : null : null)
  2295. };
  2296. G = I.selectors = {
  2297. cacheLength: 50,
  2298. createPseudo: Y,
  2299. match: Oa,
  2300. attrHandle: ed ? {} : {
  2301. href: function(b) {
  2302. return b.getAttribute("href", 2)
  2303. },
  2304. type: function(b) {
  2305. return b.getAttribute("type")
  2306. }
  2307. },
  2308. find: {
  2309. ID: mb ? function(b, f, c) {
  2310. if ("undefined" !== typeof f.getElementById && !c) return (b = f.getElementById(b)) && b.parentNode ? [b] : []
  2311. } : function(b, f, c) {
  2312. if ("undefined" !== typeof f.getElementById && !c) return (f = f.getElementById(b)) ? f.id === b || "undefined" !== typeof f.getAttributeNode && f.getAttributeNode("id").value === b ? [f] : void 0 : []
  2313. },
  2314. TAG: dd ? function(b, f) {
  2315. if ("undefined" !== typeof f.getElementsByTagName) return f.getElementsByTagName(b)
  2316. } : function(b, f) {
  2317. var c = f.getElementsByTagName(b);
  2318. if ("*" === b) {
  2319. for (var d, e = [], l = 0; d = c[l]; l++) 1 === d.nodeType && e.push(d);
  2320. return e
  2321. }
  2322. return c
  2323. },
  2324. NAME: gd && function(b, f) {
  2325. if ("undefined" !== typeof f.getElementsByName) return f.getElementsByName(name)
  2326. },
  2327. CLASS: Tb && function(b, f, c) {
  2328. if ("undefined" !== typeof f.getElementsByClassName && !c) return f.getElementsByClassName(b)
  2329. }
  2330. },
  2331. relative: {
  2332. ">": {
  2333. dir: "parentNode",
  2334. first: !0
  2335. },
  2336. " ": {
  2337. dir: "parentNode"
  2338. },
  2339. "+": {
  2340. dir: "previousSibling",
  2341. first: !0
  2342. },
  2343. "~": {
  2344. dir: "previousSibling"
  2345. }
  2346. },
  2347. preFilter: {
  2348. ATTR: function(b) {
  2349. return b[1] = b[1].replace(ka, ""), b[3] = (b[4] || b[5] || "").replace(ka, ""), "~=" === b[2] && (b[3] = " " + b[3] + " "), b.slice(0, 4)
  2350. },
  2351. CHILD: function(b) {
  2352. return b[1] = b[1].toLowerCase(), "nth" === b[1] ? (b[2] || I.error(b[0]), b[3] = +(b[3] ? b[4] + (b[5] || 1) :
  2353. 2 * ("even" === b[2] || "odd" === b[2])), b[4] = +(b[6] + b[7] || "odd" === b[2])) : b[2] && I.error(b[0]), b
  2354. },
  2355. PSEUDO: function(b) {
  2356. var f, c;
  2357. if (Oa.CHILD.test(b[0])) return null;
  2358. if (b[3]) b[2] = b[3];
  2359. else if (f = b[4]) ad.test(f) && (c = Pa(f, !0)) && (c = f.indexOf(")", f.length - c) - f.length) && (f = f.slice(0, c), b[0] = b[0].slice(0, c)), b[2] = f;
  2360. return b.slice(0, 3)
  2361. }
  2362. },
  2363. filter: {
  2364. ID: mb ? function(b) {
  2365. return b = b.replace(ka, ""),
  2366. function(f) {
  2367. return f.getAttribute("id") === b
  2368. }
  2369. } : function(b) {
  2370. return b = b.replace(ka, ""),
  2371. function(f) {
  2372. return (f = "undefined" !== typeof f.getAttributeNode &&
  2373. f.getAttributeNode("id")) && f.value === b
  2374. }
  2375. },
  2376. TAG: function(b) {
  2377. return "*" === b ? function() {
  2378. return !0
  2379. } : (b = b.replace(ka, "").toLowerCase(), function(f) {
  2380. return f.nodeName && f.nodeName.toLowerCase() === b
  2381. })
  2382. },
  2383. CLASS: function(b) {
  2384. var f = $b[P][b];
  2385. return f || (f = $b(b, RegExp("(^|[\\x20\\t\\r\\n\\f])" + b + "([\\x20\\t\\r\\n\\f]|$)"))),
  2386. function(b) {
  2387. return f.test(b.className || "undefined" !== typeof b.getAttribute && b.getAttribute("class") || "")
  2388. }
  2389. },
  2390. ATTR: function(b, f, c) {
  2391. return function(d) {
  2392. d = I.attr(d, b);
  2393. return null == d ? "!=" === f : f ? (d += "", "=" ===
  2394. f ? d === c : "!=" === f ? d !== c : "^=" === f ? c && 0 === d.indexOf(c) : "*=" === f ? c && -1 < d.indexOf(c) : "$=" === f ? c && d.substr(d.length - c.length) === c : "~=" === f ? -1 < (" " + d + " ").indexOf(c) : "|=" === f ? d === c || d.substr(0, c.length + 1) === c + "-" : !1) : !0
  2395. }
  2396. },
  2397. CHILD: function(b, c, d, e) {
  2398. return "nth" === b ? function(b) {
  2399. var c, f;
  2400. c = b.parentNode;
  2401. if (1 === d && 0 === e) return !0;
  2402. if (c) {
  2403. f = 0;
  2404. for (c = c.firstChild; c && !(1 === c.nodeType && (f++, b === c)); c = c.nextSibling);
  2405. }
  2406. return f -= e, f === d || 0 === f % d && 0 <= f / d
  2407. } : function(c) {
  2408. var f = c;
  2409. switch (b) {
  2410. case "only":
  2411. case "first":
  2412. for (; f = f.previousSibling;)
  2413. if (1 ===
  2414. f.nodeType) return !1;
  2415. if ("first" === b) return !0;
  2416. f = c;
  2417. case "last":
  2418. for (; f = f.nextSibling;)
  2419. if (1 === f.nodeType) return !1;
  2420. return !0
  2421. }
  2422. }
  2423. },
  2424. PSEUDO: function(b, c) {
  2425. var d, e = G.pseudos[b] || G.setFilters[b.toLowerCase()] || I.error("unsupported pseudo: " + b);
  2426. return e[P] ? e(c) : 1 < e.length ? (d = [b, b, "", c], G.setFilters.hasOwnProperty(b.toLowerCase()) ? Y(function(b, d) {
  2427. for (var u, l = e(b, c), q = l.length; q--;) u = Xb.call(b, l[q]), b[u] = !(d[u] = l[q])
  2428. }) : function(b) {
  2429. return e(b, 0, d)
  2430. }) : e
  2431. }
  2432. },
  2433. pseudos: {
  2434. not: Y(function(b) {
  2435. var c = [],
  2436. d = [],
  2437. e = lb(b.replace(Ma, "$1"));
  2438. return e[P] ? Y(function(b, c, f, d) {
  2439. d = e(b, null, d, []);
  2440. for (var u = b.length; u--;)
  2441. if (f = d[u]) b[u] = !(c[u] = f)
  2442. }) : function(b, u, l) {
  2443. return c[0] = b, e(c, null, l, d), !d.pop()
  2444. }
  2445. }),
  2446. has: Y(function(b) {
  2447. return function(c) {
  2448. return 0 < I(b, c).length
  2449. }
  2450. }),
  2451. contains: Y(function(b) {
  2452. return function(c) {
  2453. return -1 < (c.textContent || c.innerText || Sa(c)).indexOf(b)
  2454. }
  2455. }),
  2456. enabled: function(b) {
  2457. return !1 === b.disabled
  2458. },
  2459. disabled: function(b) {
  2460. return !0 === b.disabled
  2461. },
  2462. checked: function(b) {
  2463. var c = b.nodeName.toLowerCase();
  2464. return "input" === c && !!b.checked || "option" ===
  2465. c && !!b.selected
  2466. },
  2467. selected: function(b) {
  2468. return b.parentNode && b.parentNode.selectedIndex, !0 === b.selected
  2469. },
  2470. parent: function(b) {
  2471. return !G.pseudos.empty(b)
  2472. },
  2473. empty: function(b) {
  2474. var c;
  2475. for (b = b.firstChild; b;) {
  2476. if ("@" < b.nodeName || 3 === (c = b.nodeType) || 4 === c) return !1;
  2477. b = b.nextSibling
  2478. }
  2479. return !0
  2480. },
  2481. header: function(b) {
  2482. return bd.test(b.nodeName)
  2483. },
  2484. text: function(b) {
  2485. var c, d;
  2486. return "input" === b.nodeName.toLowerCase() && "text" === (c = b.type) && (null == (d = b.getAttribute("type")) || d.toLowerCase() === c)
  2487. },
  2488. radio: wa("radio"),
  2489. checkbox: wa("checkbox"),
  2490. file: wa("file"),
  2491. password: wa("password"),
  2492. image: wa("image"),
  2493. submit: Ub("submit"),
  2494. reset: Ub("reset"),
  2495. button: function(b) {
  2496. var c = b.nodeName.toLowerCase();
  2497. return "input" === c && "button" === b.type || "button" === c
  2498. },
  2499. input: function(b) {
  2500. return cd.test(b.nodeName)
  2501. },
  2502. focus: function(b) {
  2503. var c = b.ownerDocument;
  2504. return b === c.activeElement && (!c.hasFocus || c.hasFocus()) && (!!b.type || !!b.href)
  2505. },
  2506. active: function(b) {
  2507. return b === b.ownerDocument.activeElement
  2508. },
  2509. first: ja(function() {
  2510. return [0]
  2511. }),
  2512. last: ja(function(b, c) {
  2513. return [c - 1]
  2514. }),
  2515. eq: ja(function(b,
  2516. c, d) {
  2517. return [0 > d ? d + c : d]
  2518. }),
  2519. even: ja(function(b, c) {
  2520. for (var d = 0; d < c; d += 2) b.push(d);
  2521. return b
  2522. }),
  2523. odd: ja(function(b, c) {
  2524. for (var d = 1; d < c; d += 2) b.push(d);
  2525. return b
  2526. }),
  2527. lt: ja(function(b, c, d) {
  2528. for (c = 0 > d ? d + c : d; 0 <= --c;) b.push(c);
  2529. return b
  2530. }),
  2531. gt: ja(function(b, c, d) {
  2532. for (d = 0 > d ? d + c : d; ++d < c;) b.push(d);
  2533. return b
  2534. })
  2535. }
  2536. };
  2537. nb = W.compareDocumentPosition ? function(b, c) {
  2538. return b === c ? (ya = !0, 0) : (!b.compareDocumentPosition || !c.compareDocumentPosition ? b.compareDocumentPosition : b.compareDocumentPosition(c) & 4) ? -1 : 1
  2539. } : function(b, c) {
  2540. if (b === c) return ya = !0, 0;
  2541. if (b.sourceIndex && c.sourceIndex) return b.sourceIndex - c.sourceIndex;
  2542. var d, e, l = [],
  2543. g = [];
  2544. d = b.parentNode;
  2545. e = c.parentNode;
  2546. var m = d;
  2547. if (d === e) return Na(b, c);
  2548. if (!d) return -1;
  2549. if (!e) return 1;
  2550. for (; m;) l.unshift(m), m = m.parentNode;
  2551. for (m = e; m;) g.unshift(m), m = m.parentNode;
  2552. d = l.length;
  2553. e = g.length;
  2554. for (m = 0; m < d && m < e; m++)
  2555. if (l[m] !== g[m]) return Na(l[m], g[m]);
  2556. return m === d ? Na(b, g[m], -1) : Na(l[m], c, 1)
  2557. };
  2558. [0, 0].sort(nb);
  2559. Zb = !ya;
  2560. I.uniqueSort = function(b) {
  2561. var c, d = 1;
  2562. ya = Zb;
  2563. b.sort(nb);
  2564. if (ya)
  2565. for (; c = b[d]; d++) c === b[d - 1] && b.splice(d--, 1);
  2566. return b
  2567. };
  2568. I.error = function(b) {
  2569. throw Error("Syntax error, unrecognized expression: " + b);
  2570. };
  2571. lb = I.compile = function(b, c) {
  2572. var d, e = [],
  2573. l = [],
  2574. g = ac[P][b];
  2575. if (!g) {
  2576. c || (c = Pa(b));
  2577. for (d = c.length; d--;) g = jb(c[d]), g[P] ? e.push(g) : l.push(g);
  2578. var m = 0 < e.length,
  2579. j = 0 < l.length,
  2580. p = function(b, c, f, d, u) {
  2581. var q, g, s = [],
  2582. t = 0,
  2583. r = "0",
  2584. n = b && [],
  2585. z = null != u,
  2586. x = Ra,
  2587. A = b || j && G.find.TAG("*", u && c.parentNode || c),
  2588. B = xa += null == x ? 1 : Math.E;
  2589. for (z && (Ra = c !== X && c, fb = p.el); null != (u = A[r]); r++) {
  2590. if (j && u) {
  2591. for (q = 0; g = l[q]; q++)
  2592. if (g(u, c, f)) {
  2593. d.push(u);
  2594. break
  2595. }
  2596. z && (xa = B, fb =
  2597. ++p.el)
  2598. }
  2599. m && ((u = !g && u) && t--, b && n.push(u))
  2600. }
  2601. t += r;
  2602. if (m && r !== t) {
  2603. for (q = 0; g = e[q]; q++) g(n, s, c, f);
  2604. if (b) {
  2605. if (0 < t)
  2606. for (; r--;)!n[r] && !s[r] && (s[r] = $c.call(d));
  2607. s = Qa(s)
  2608. }
  2609. pa.apply(d, s);
  2610. z && !b && 0 < s.length && 1 < t + e.length && I.uniqueSort(d)
  2611. }
  2612. return z && (xa = B, Ra = x), n
  2613. };
  2614. d = (p.el = 0, m ? Y(p) : p);
  2615. g = ac(b, d)
  2616. }
  2617. return g
  2618. };
  2619. if (X.querySelectorAll) {
  2620. var cc, hd = eb,
  2621. id = /'|\\/g,
  2622. jd = /\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,
  2623. Z = [":focus"],
  2624. Ta = [":active", ":focus"],
  2625. Ua = W.matchesSelector || W.mozMatchesSelector || W.webkitMatchesSelector || W.oMatchesSelector ||
  2626. W.msMatchesSelector;
  2627. da(function(b) {
  2628. b.innerHTML = "<select><option selected=''></option></select>";
  2629. b.querySelectorAll("[selected]").length || Z.push("\\[[\\x20\\t\\r\\n\\f]*(?:checked|disabled|ismap|multiple|readonly|selected|value)");
  2630. b.querySelectorAll(":checked").length || Z.push(":checked")
  2631. });
  2632. da(function(b) {
  2633. b.innerHTML = "<p test=''></p>";
  2634. b.querySelectorAll("[test^='']").length && Z.push("[*^$]=[\\x20\\t\\r\\n\\f]*(?:\"\"|'')");
  2635. b.innerHTML = "<input type='hidden'/>";
  2636. b.querySelectorAll(":enabled").length || Z.push(":enabled",
  2637. ":disabled")
  2638. });
  2639. Z = RegExp(Z.join("|"));
  2640. eb = function(b, c, d, e, l) {
  2641. if (!e && !l && (!Z || !Z.test(b))) {
  2642. var g, m, j = !0,
  2643. p = P;
  2644. m = c;
  2645. g = 9 === c.nodeType && b;
  2646. if (1 === c.nodeType && "object" !== c.nodeName.toLowerCase()) {
  2647. g = Pa(b);
  2648. (j = c.getAttribute("id")) ? p = j.replace(id, "\\$&"): c.setAttribute("id", p);
  2649. p = "[id='" + p + "'] ";
  2650. for (m = g.length; m--;) g[m] = p + g[m].join("");
  2651. m = kb.test(b) && c.parentNode || c;
  2652. g = g.join(",")
  2653. }
  2654. if (g) try {
  2655. return pa.apply(d, qa.call(m.querySelectorAll(g), 0)), d
  2656. } catch (t) {} finally {
  2657. j || c.removeAttribute("id")
  2658. }
  2659. }
  2660. return hd(b, c, d, e, l)
  2661. };
  2662. Ua &&
  2663. (da(function(b) {
  2664. cc = Ua.call(b, "div");
  2665. try {
  2666. Ua.call(b, "[test!='']:sizzle"), Ta.push("!=", pb)
  2667. } catch (c) {}
  2668. }), Ta = RegExp(Ta.join("|")), I.matchesSelector = function(b, c) {
  2669. c = c.replace(jd, "='$1']");
  2670. if (!La(b) && !Ta.test(c) && (!Z || !Z.test(c))) try {
  2671. var d = Ua.call(b, c);
  2672. if (d || cc || b.document && 11 !== b.document.nodeType) return d
  2673. } catch (e) {}
  2674. return 0 < I(c, null, null, [b]).length
  2675. })
  2676. }
  2677. G.pseudos.nth = G.pseudos.eq;
  2678. G.filters = Yb.prototype = G.pseudos;
  2679. G.setFilters = new Yb;
  2680. I.attr = e.attr;
  2681. e.find = I;
  2682. e.expr = I.selectors;
  2683. e.expr[":"] = e.expr.pseudos;
  2684. e.unique =
  2685. I.uniqueSort;
  2686. e.text = I.getText;
  2687. e.isXMLDoc = I.isXML;
  2688. e.contains = I.contains;
  2689. var kd = /Until$/,
  2690. ld = /^(?:parents|prev(?:Until|All))/,
  2691. uc = /^.[^:#\[\.,]*$/,
  2692. dc = e.expr.match.needsContext,
  2693. md = {
  2694. children: !0,
  2695. contents: !0,
  2696. next: !0,
  2697. prev: !0
  2698. };
  2699. e.fn.extend({
  2700. find: function(b) {
  2701. var c, d, l, g, j, m, p = this;
  2702. if ("string" != typeof b) return e(b).filter(function() {
  2703. c = 0;
  2704. for (d = p.length; c < d; c++)
  2705. if (e.contains(p[c], this)) return !0
  2706. });
  2707. m = this.pushStack("", "find", b);
  2708. c = 0;
  2709. for (d = this.length; c < d; c++)
  2710. if (l = m.length, e.find(b, this[c], m), 0 < c)
  2711. for (g = l; g < m.length; g++)
  2712. for (j =
  2713. 0; j < l; j++)
  2714. if (m[j] === m[g]) {
  2715. m.splice(g--, 1);
  2716. break
  2717. }
  2718. return m
  2719. },
  2720. has: function(b) {
  2721. var c, d = e(b, this),
  2722. l = d.length;
  2723. return this.filter(function() {
  2724. for (c = 0; c < l; c++)
  2725. if (e.contains(this, d[c])) return !0
  2726. })
  2727. },
  2728. not: function(b) {
  2729. return this.pushStack(z(this, b, !1), "not", b)
  2730. },
  2731. filter: function(b) {
  2732. return this.pushStack(z(this, b, !0), "filter", b)
  2733. },
  2734. is: function(b) {
  2735. return !!b && ("string" == typeof b ? dc.test(b) ? 0 <= e(b, this.context).index(this[0]) : 0 < e.filter(b, this).length : 0 < this.filter(b).length)
  2736. },
  2737. closest: function(b, c) {
  2738. for (var d, l = 0, g = this.length,
  2739. j = [], m = dc.test(b) || "string" != typeof b ? e(b, c || this.context) : 0; l < g; l++)
  2740. for (d = this[l]; d && d.ownerDocument && d !== c && 11 !== d.nodeType;) {
  2741. if (m ? -1 < m.index(d) : e.find.matchesSelector(d, b)) {
  2742. j.push(d);
  2743. break
  2744. }
  2745. d = d.parentNode
  2746. }
  2747. return j = 1 < j.length ? e.unique(j) : j, this.pushStack(j, "closest", b)
  2748. },
  2749. index: function(b) {
  2750. return b ? "string" == typeof b ? e.inArray(this[0], e(b)) : e.inArray(b.jquery ? b[0] : b, this) : this[0] && this[0].parentNode ? this.prevAll().length : -1
  2751. },
  2752. add: function(b, c) {
  2753. var d = "string" == typeof b ? e(b, c) : e.makeArray(b && b.nodeType ? [b] : b),
  2754. l = e.merge(this.get(), d);
  2755. return this.pushStack(y(d[0]) || y(l[0]) ? l : e.unique(l))
  2756. },
  2757. addBack: function(b) {
  2758. return this.add(null == b ? this.prevObject : this.prevObject.filter(b))
  2759. }
  2760. });
  2761. e.fn.andSelf = e.fn.addBack;
  2762. e.each({
  2763. parent: function(b) {
  2764. return (b = b.parentNode) && 11 !== b.nodeType ? b : null
  2765. },
  2766. parents: function(b) {
  2767. return e.dir(b, "parentNode")
  2768. },
  2769. parentsUntil: function(b, c, d) {
  2770. return e.dir(b, "parentNode", d)
  2771. },
  2772. next: function(b) {
  2773. return r(b, "nextSibling")
  2774. },
  2775. prev: function(b) {
  2776. return r(b, "previousSibling")
  2777. },
  2778. nextAll: function(b) {
  2779. return e.dir(b,
  2780. "nextSibling")
  2781. },
  2782. prevAll: function(b) {
  2783. return e.dir(b, "previousSibling")
  2784. },
  2785. nextUntil: function(b, c, d) {
  2786. return e.dir(b, "nextSibling", d)
  2787. },
  2788. prevUntil: function(b, c, d) {
  2789. return e.dir(b, "previousSibling", d)
  2790. },
  2791. siblings: function(b) {
  2792. return e.sibling((b.parentNode || {}).firstChild, b)
  2793. },
  2794. children: function(b) {
  2795. return e.sibling(b.firstChild)
  2796. },
  2797. contents: function(b) {
  2798. return e.nodeName(b, "iframe") ? b.contentDocument || b.contentWindow.document : e.merge([], b.childNodes)
  2799. }
  2800. }, function(b, c) {
  2801. e.fn[b] = function(d, l) {
  2802. var g = e.map(this, c, d);
  2803. return kd.test(b) ||
  2804. (l = d), l && "string" == typeof l && (g = e.filter(l, g)), g = 1 < this.length && !md[b] ? e.unique(g) : g, 1 < this.length && ld.test(b) && (g = g.reverse()), this.pushStack(g, b, aa.call(arguments).join(","))
  2805. }
  2806. });
  2807. e.extend({
  2808. filter: function(b, c, d) {
  2809. return d && (b = ":not(" + b + ")"), 1 === c.length ? e.find.matchesSelector(c[0], b) ? [c[0]] : [] : e.find.matches(b, c)
  2810. },
  2811. dir: function(b, f, d) {
  2812. var l = [];
  2813. for (b = b[f]; b && 9 !== b.nodeType && (d === c || 1 !== b.nodeType || !e(b).is(d));) 1 === b.nodeType && l.push(b), b = b[f];
  2814. return l
  2815. },
  2816. sibling: function(b, c) {
  2817. for (var d = []; b; b = b.nextSibling) 1 ===
  2818. b.nodeType && b !== c && d.push(b);
  2819. return d
  2820. }
  2821. });
  2822. var wb = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",
  2823. nd = / jQuery\d+="(?:null|\d+)"/g,
  2824. qb = /^\s+/,
  2825. ec = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,
  2826. fc = /<([\w:]+)/,
  2827. od = /<tbody/i,
  2828. pd = /<|&#?\w+;/,
  2829. qd = /<(?:script|style|link)/i,
  2830. rd = /<(?:script|object|embed|option|style)/i,
  2831. rb = RegExp("<(?:" + wb + ")[\\s/>]", "i"),
  2832. xb = /^(?:checkbox|radio)$/,
  2833. gc = /checked\s*(?:[^=]|=\s*.checked.)/i,
  2834. sd = /\/(java|ecma)script/i,
  2835. td = /^\s*<!(?:\[CDATA\[|\-\-)|[\]\-]{2}>\s*$/g,
  2836. V = {
  2837. option: [1, "<select multiple='multiple'>", "</select>"],
  2838. legend: [1, "<fieldset>", "</fieldset>"],
  2839. thead: [1, "<table>", "</table>"],
  2840. tr: [2, "<table><tbody>", "</tbody></table>"],
  2841. td: [3, "<table><tbody><tr>", "</tr></tbody></table>"],
  2842. col: [2, "<table><tbody></tbody><colgroup>", "</colgroup></table>"],
  2843. area: [1, "<map>", "</map>"],
  2844. _default: [0, "", ""]
  2845. },
  2846. hc = A(D),
  2847. sb = hc.appendChild(D.createElement("div"));
  2848. V.optgroup =
  2849. V.option;
  2850. V.tbody = V.tfoot = V.colgroup = V.caption = V.thead;
  2851. V.th = V.td;
  2852. e.support.htmlSerialize || (V._default = [1, "X<div>", "</div>"]);
  2853. e.fn.extend({
  2854. text: function(b) {
  2855. return e.access(this, function(b) {
  2856. return b === c ? e.text(this) : this.empty().append((this[0] && this[0].ownerDocument || D).createTextNode(b))
  2857. }, null, b, arguments.length)
  2858. },
  2859. wrapAll: function(b) {
  2860. if (e.isFunction(b)) return this.each(function(c) {
  2861. e(this).wrapAll(b.call(this, c))
  2862. });
  2863. if (this[0]) {
  2864. var c = e(b, this[0].ownerDocument).eq(0).clone(!0);
  2865. this[0].parentNode && c.insertBefore(this[0]);
  2866. c.map(function() {
  2867. for (var b = this; b.firstChild && 1 === b.firstChild.nodeType;) b = b.firstChild;
  2868. return b
  2869. }).append(this)
  2870. }
  2871. return this
  2872. },
  2873. wrapInner: function(b) {
  2874. return e.isFunction(b) ? this.each(function(c) {
  2875. e(this).wrapInner(b.call(this, c))
  2876. }) : this.each(function() {
  2877. var c = e(this),
  2878. d = c.contents();
  2879. d.length ? d.wrapAll(b) : c.append(b)
  2880. })
  2881. },
  2882. wrap: function(b) {
  2883. var c = e.isFunction(b);
  2884. return this.each(function(d) {
  2885. e(this).wrapAll(c ? b.call(this, d) : b)
  2886. })
  2887. },
  2888. unwrap: function() {
  2889. return this.parent().each(function() {
  2890. e.nodeName(this, "body") ||
  2891. e(this).replaceWith(this.childNodes)
  2892. }).end()
  2893. },
  2894. append: function() {
  2895. return this.domManip(arguments, !0, function(b) {
  2896. (1 === this.nodeType || 11 === this.nodeType) && this.appendChild(b)
  2897. })
  2898. },
  2899. prepend: function() {
  2900. return this.domManip(arguments, !0, function(b) {
  2901. (1 === this.nodeType || 11 === this.nodeType) && this.insertBefore(b, this.firstChild)
  2902. })
  2903. },
  2904. before: function() {
  2905. if (!y(this[0])) return this.domManip(arguments, !1, function(b) {
  2906. this.parentNode.insertBefore(b, this)
  2907. });
  2908. if (arguments.length) {
  2909. var b = e.clean(arguments);
  2910. return this.pushStack(e.merge(b,
  2911. this), "before", this.selector)
  2912. }
  2913. },
  2914. after: function() {
  2915. if (!y(this[0])) return this.domManip(arguments, !1, function(b) {
  2916. this.parentNode.insertBefore(b, this.nextSibling)
  2917. });
  2918. if (arguments.length) {
  2919. var b = e.clean(arguments);
  2920. return this.pushStack(e.merge(this, b), "after", this.selector)
  2921. }
  2922. },
  2923. remove: function(b, c) {
  2924. for (var d, l = 0; null != (d = this[l]); l++)
  2925. if (!b || e.filter(b, [d]).length)!c && 1 === d.nodeType && (e.cleanData(d.getElementsByTagName("*")), e.cleanData([d])), d.parentNode && d.parentNode.removeChild(d);
  2926. return this
  2927. },
  2928. empty: function() {
  2929. for (var b,
  2930. c = 0; null != (b = this[c]); c++)
  2931. for (1 === b.nodeType && e.cleanData(b.getElementsByTagName("*")); b.firstChild;) b.removeChild(b.firstChild);
  2932. return this
  2933. },
  2934. clone: function(b, c) {
  2935. return b = null == b ? !1 : b, c = null == c ? b : c, this.map(function() {
  2936. return e.clone(this, b, c)
  2937. })
  2938. },
  2939. html: function(b) {
  2940. return e.access(this, function(b) {
  2941. var d = this[0] || {},
  2942. l = 0,
  2943. u = this.length;
  2944. if (b === c) return 1 === d.nodeType ? d.innerHTML.replace(nd, "") : c;
  2945. if ("string" == typeof b && !qd.test(b) && (e.support.htmlSerialize || !rb.test(b)) && (e.support.leadingWhitespace || !qb.test(b)) &&
  2946. !V[(fc.exec(b) || ["", ""])[1].toLowerCase()]) {
  2947. b = b.replace(ec, "<$1></$2>");
  2948. try {
  2949. for (; l < u; l++) d = this[l] || {}, 1 === d.nodeType && (e.cleanData(d.getElementsByTagName("*")), d.innerHTML = b);
  2950. d = 0
  2951. } catch (g) {}
  2952. }
  2953. d && this.empty().append(b)
  2954. }, null, b, arguments.length)
  2955. },
  2956. replaceWith: function(b) {
  2957. return y(this[0]) ? this.length ? this.pushStack(e(e.isFunction(b) ? b() : b), "replaceWith", b) : this : e.isFunction(b) ? this.each(function(c) {
  2958. var d = e(this),
  2959. l = d.html();
  2960. d.replaceWith(b.call(this, c, l))
  2961. }) : ("string" != typeof b && (b = e(b).detach()), this.each(function() {
  2962. var c =
  2963. this.nextSibling,
  2964. d = this.parentNode;
  2965. e(this).remove();
  2966. c ? e(c).before(b) : e(d).append(b)
  2967. }))
  2968. },
  2969. detach: function(b) {
  2970. return this.remove(b, !0)
  2971. },
  2972. domManip: function(b, f, d) {
  2973. b = [].concat.apply([], b);
  2974. var l, g, j, m = 0,
  2975. p = b[0],
  2976. t = [],
  2977. r = this.length;
  2978. if (!e.support.checkClone && 1 < r && "string" == typeof p && gc.test(p)) return this.each(function() {
  2979. e(this).domManip(b, f, d)
  2980. });
  2981. if (e.isFunction(p)) return this.each(function(l) {
  2982. var g = e(this);
  2983. b[0] = p.call(this, l, f ? g.html() : c);
  2984. g.domManip(b, f, d)
  2985. });
  2986. if (this[0]) {
  2987. l = e.buildFragment(b, this, t);
  2988. j = l.fragment;
  2989. g = j.firstChild;
  2990. 1 === j.childNodes.length && (j = g);
  2991. if (g) {
  2992. f = f && e.nodeName(g, "tr");
  2993. for (l = l.cacheable || r - 1; m < r; m++) d.call(f && e.nodeName(this[m], "table") ? this[m].getElementsByTagName("tbody")[0] || this[m].appendChild(this[m].ownerDocument.createElement("tbody")) : this[m], m === l ? j : e.clone(j, !0, !0))
  2994. }
  2995. j = g = null;
  2996. t.length && e.each(t, function(b, c) {
  2997. c.src ? e.ajax ? e.ajax({
  2998. url: c.src,
  2999. type: "GET",
  3000. dataType: "script",
  3001. async: !1,
  3002. global: !1,
  3003. "throws": !0
  3004. }) : e.error("no ajax") : e.globalEval((c.text || c.textContent || c.innerHTML || "").replace(td,
  3005. ""));
  3006. c.parentNode && c.parentNode.removeChild(c)
  3007. })
  3008. }
  3009. return this
  3010. }
  3011. });
  3012. e.buildFragment = function(b, f, d) {
  3013. var l, g, j, m = b[0];
  3014. return f = f || D, f = !f.nodeType && f[0] || f, f = f.ownerDocument || f, 1 === b.length && "string" == typeof m && 512 > m.length && f === D && "<" === m.charAt(0) && !rd.test(m) && (e.support.checkClone || !gc.test(m)) && (e.support.html5Clone || !rb.test(m)) && (g = !0, l = e.fragments[m], j = l !== c), l || (l = f.createDocumentFragment(), e.clean(b, f, l, d), g && (e.fragments[m] = j && l)), {
  3015. fragment: l,
  3016. cacheable: g
  3017. }
  3018. };
  3019. e.fragments = {};
  3020. e.each({
  3021. appendTo: "append",
  3022. prependTo: "prepend",
  3023. insertBefore: "before",
  3024. insertAfter: "after",
  3025. replaceAll: "replaceWith"
  3026. }, function(b, c) {
  3027. e.fn[b] = function(d) {
  3028. var l, g = 0,
  3029. j = [];
  3030. d = e(d);
  3031. var m = d.length;
  3032. l = 1 === this.length && this[0].parentNode;
  3033. if ((null == l || l && 11 === l.nodeType && 1 === l.childNodes.length) && 1 === m) return d[c](this[0]), this;
  3034. for (; g < m; g++) l = (0 < g ? this.clone(!0) : this).get(), e(d[g])[c](l), j = j.concat(l);
  3035. return this.pushStack(j, b, d.selector)
  3036. }
  3037. });
  3038. e.extend({
  3039. clone: function(b, c, d) {
  3040. var g, j, s, m;
  3041. e.support.html5Clone || e.isXMLDoc(b) || !rb.test("<" + b.nodeName +
  3042. ">") ? m = b.cloneNode(!0) : (sb.innerHTML = b.outerHTML, sb.removeChild(m = sb.firstChild));
  3043. if ((!e.support.noCloneEvent || !e.support.noCloneChecked) && (1 === b.nodeType || 11 === b.nodeType) && !e.isXMLDoc(b)) {
  3044. l(b, m);
  3045. g = p(b);
  3046. j = p(m);
  3047. for (s = 0; g[s]; ++s) j[s] && l(g[s], j[s])
  3048. }
  3049. if (c && (B(b, m), d)) {
  3050. g = p(b);
  3051. j = p(m);
  3052. for (s = 0; g[s]; ++s) B(g[s], j[s])
  3053. }
  3054. return m
  3055. },
  3056. clean: function(b, c, d, l) {
  3057. var g, j, m, p, r, n, z, x = c === D && hc,
  3058. B = [];
  3059. if (!c || "undefined" == typeof c.createDocumentFragment) c = D;
  3060. for (g = 0; null != (m = b[g]); g++)
  3061. if ("number" == typeof m && (m += ""), m) {
  3062. if ("string" ==
  3063. typeof m)
  3064. if (pd.test(m)) {
  3065. x = x || A(c);
  3066. n = c.createElement("div");
  3067. x.appendChild(n);
  3068. m = m.replace(ec, "<$1></$2>");
  3069. j = (fc.exec(m) || ["", ""])[1].toLowerCase();
  3070. p = V[j] || V._default;
  3071. r = p[0];
  3072. for (n.innerHTML = p[1] + m + p[2]; r--;) n = n.lastChild;
  3073. if (!e.support.tbody) {
  3074. r = od.test(m);
  3075. p = "table" === j && !r ? n.firstChild && n.firstChild.childNodes : "<table>" === p[1] && !r ? n.childNodes : [];
  3076. for (j = p.length - 1; 0 <= j; --j) e.nodeName(p[j], "tbody") && !p[j].childNodes.length && p[j].parentNode.removeChild(p[j])
  3077. }!e.support.leadingWhitespace && qb.test(m) && n.insertBefore(c.createTextNode(qb.exec(m)[0]),
  3078. n.firstChild);
  3079. m = n.childNodes;
  3080. n.parentNode.removeChild(n)
  3081. } else m = c.createTextNode(m);
  3082. m.nodeType ? B.push(m) : e.merge(B, m)
  3083. }
  3084. n && (m = n = x = null);
  3085. if (!e.support.appendChecked)
  3086. for (g = 0; null != (m = B[g]); g++) e.nodeName(m, "input") ? t(m) : "undefined" != typeof m.getElementsByTagName && e.grep(m.getElementsByTagName("input"), t);
  3087. if (d) {
  3088. b = function(b) {
  3089. if (!b.type || sd.test(b.type)) return l ? l.push(b.parentNode ? b.parentNode.removeChild(b) : b) : d.appendChild(b)
  3090. };
  3091. for (g = 0; null != (m = B[g]); g++)
  3092. if (!e.nodeName(m, "script") || !b(m)) d.appendChild(m),
  3093. "undefined" != typeof m.getElementsByTagName && (z = e.grep(e.merge([], m.getElementsByTagName("script")), b), B.splice.apply(B, [g + 1, 0].concat(z)), g += z.length)
  3094. }
  3095. return B
  3096. },
  3097. cleanData: function(b, c) {
  3098. for (var d, l, g, j, m = 0, p = e.expando, t = e.cache, r = e.support.deleteExpando, n = e.event.special; null != (g = b[m]); m++)
  3099. if (c || e.acceptData(g))
  3100. if (d = (l = g[p]) && t[l]) {
  3101. if (d.events)
  3102. for (j in d.events) n[j] ? e.event.remove(g, j) : e.removeEvent(g, j, d.handle);
  3103. t[l] && (delete t[l], r ? delete g[p] : g.removeAttribute ? g.removeAttribute(p) : g[p] = null, e.deletedIds.push(l))
  3104. }
  3105. }
  3106. });
  3107. var Va, ea;
  3108. e.uaMatch = function(b) {
  3109. b = b.toLowerCase();
  3110. b = /(chrome)[ \/]([\w.]+)/.exec(b) || /(webkit)[ \/]([\w.]+)/.exec(b) || /(opera)(?:.*version|)[ \/]([\w.]+)/.exec(b) || /(msie) ([\w.]+)/.exec(b) || 0 > b.indexOf("compatible") && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(b) || [];
  3111. return {
  3112. browser: b[1] || "",
  3113. version: b[2] || "0"
  3114. }
  3115. };
  3116. Va = e.uaMatch(zc.userAgent);
  3117. ea = {};
  3118. Va.browser && (ea[Va.browser] = !0, ea.version = Va.version);
  3119. ea.chrome ? ea.webkit = !0 : ea.webkit && (ea.safari = !0);
  3120. e.browser = ea;
  3121. e.sub = function() {
  3122. function b(c, d) {
  3123. return new b.fn.init(c,
  3124. d)
  3125. }
  3126. e.extend(!0, b, this);
  3127. b.superclass = this;
  3128. b.fn = b.prototype = this();
  3129. b.fn.constructor = b;
  3130. b.sub = this.sub;
  3131. b.fn.init = function(d, l) {
  3132. return l && l instanceof e && !(l instanceof b) && (l = b(l)), e.fn.init.call(this, d, l, c)
  3133. };
  3134. b.fn.init.prototype = b.fn;
  3135. var c = b(D);
  3136. return b
  3137. };
  3138. var R, ma, na, tb = /alpha\([^)]*\)/i,
  3139. ud = /opacity=([^)]*)/,
  3140. vd = /^(top|right|bottom|left)$/,
  3141. wd = /^(none|table(?!-c[ea]).+)/,
  3142. ic = /^margin/,
  3143. vc = RegExp("^(" + Fa + ")(.*)$", "i"),
  3144. za = RegExp("^(" + Fa + ")(?!px)[a-z%]+$", "i"),
  3145. xd = RegExp("^([-+])=(" + Fa + ")", "i"),
  3146. Ya = {},
  3147. yd = {
  3148. position: "absolute",
  3149. visibility: "hidden",
  3150. display: "block"
  3151. },
  3152. jc = {
  3153. letterSpacing: 0,
  3154. fontWeight: 400
  3155. },
  3156. fa = ["Top", "Right", "Bottom", "Left"],
  3157. yb = ["Webkit", "O", "Moz", "ms"],
  3158. zd = e.fn.toggle;
  3159. e.fn.extend({
  3160. css: function(b, d) {
  3161. return e.access(this, function(b, d, f) {
  3162. return f !== c ? e.style(b, d, f) : e.css(b, d)
  3163. }, b, d, 1 < arguments.length)
  3164. },
  3165. show: function() {
  3166. return H(this, !0)
  3167. },
  3168. hide: function() {
  3169. return H(this)
  3170. },
  3171. toggle: function(b, c) {
  3172. var d = "boolean" == typeof b;
  3173. return e.isFunction(b) && e.isFunction(c) ? zd.apply(this, arguments) : this.each(function() {
  3174. (d ? b : L(this)) ? e(this).show():
  3175. e(this).hide()
  3176. })
  3177. }
  3178. });
  3179. e.extend({
  3180. cssHooks: {
  3181. opacity: {
  3182. get: function(b, c) {
  3183. if (c) {
  3184. var d = R(b, "opacity");
  3185. return "" === d ? "1" : d
  3186. }
  3187. }
  3188. }
  3189. },
  3190. cssNumber: {
  3191. fillOpacity: !0,
  3192. fontWeight: !0,
  3193. lineHeight: !0,
  3194. opacity: !0,
  3195. orphans: !0,
  3196. widows: !0,
  3197. zIndex: !0,
  3198. zoom: !0
  3199. },
  3200. cssProps: {
  3201. "float": e.support.cssFloat ? "cssFloat" : "styleFloat"
  3202. },
  3203. style: function(b, d, l, g) {
  3204. if (b && !(3 === b.nodeType || 8 === b.nodeType || !b.style)) {
  3205. var j, p, m, t = e.camelCase(d),
  3206. r = b.style;
  3207. d = e.cssProps[t] || (e.cssProps[t] = x(r, t));
  3208. m = e.cssHooks[d] || e.cssHooks[t];
  3209. if (l === c) return m && "get" in m && (j = m.get(b, !1, g)) !== c ? j : r[d];
  3210. p = typeof l;
  3211. "string" === p && (j = xd.exec(l)) && (l = (j[1] + 1) * j[2] + parseFloat(e.css(b, d)), p = "number");
  3212. if (!(null == l || "number" === p && isNaN(l)))
  3213. if ("number" === p && !e.cssNumber[t] && (l += "px"), !m || !("set" in m) || (l = m.set(b, l, g)) !== c) try {
  3214. r[d] = l
  3215. } catch (n) {}
  3216. }
  3217. },
  3218. css: function(b, d, l, g) {
  3219. var j, p, m, t = e.camelCase(d);
  3220. return d = e.cssProps[t] || (e.cssProps[t] = x(b.style, t)), m = e.cssHooks[d] || e.cssHooks[t], m && "get" in m && (j = m.get(b, !0, g)), j === c && (j = R(b, d)), "normal" === j && d in jc && (j = jc[d]), l || g !== c ? (p = parseFloat(j), l ||
  3221. e.isNumeric(p) ? p || 0 : j) : j
  3222. },
  3223. swap: function(b, c, d) {
  3224. var e, l = {};
  3225. for (e in c) l[e] = b.style[e], b.style[e] = c[e];
  3226. d = d.call(b);
  3227. for (e in c) b.style[e] = l[e];
  3228. return d
  3229. }
  3230. });
  3231. b.getComputedStyle ? R = function(c, d) {
  3232. var l, g, j, p, m = b.getComputedStyle(c, null),
  3233. t = c.style;
  3234. return m && (l = m[d], "" === l && !e.contains(c.ownerDocument, c) && (l = e.style(c, d)), za.test(l) && ic.test(d) && (g = t.width, j = t.minWidth, p = t.maxWidth, t.minWidth = t.maxWidth = t.width = l, l = m.width, t.width = g, t.minWidth = j, t.maxWidth = p)), l
  3235. } : D.documentElement.currentStyle && (R = function(b,
  3236. c) {
  3237. var d, e, l = b.currentStyle && b.currentStyle[c],
  3238. g = b.style;
  3239. return null == l && g && g[c] && (l = g[c]), za.test(l) && !vd.test(c) && (d = g.left, e = b.runtimeStyle && b.runtimeStyle.left, e && (b.runtimeStyle.left = b.currentStyle.left), g.left = "fontSize" === c ? "1em" : l, l = g.pixelLeft + "px", g.left = d, e && (b.runtimeStyle.left = e)), "" === l ? "auto" : l
  3240. });
  3241. e.each(["height", "width"], function(b, c) {
  3242. e.cssHooks[c] = {
  3243. get: function(b, d, l) {
  3244. if (d) return 0 === b.offsetWidth && wd.test(R(b, "display")) ? e.swap(b, yd, function() {
  3245. return F(b, c, l)
  3246. }) : F(b, c, l)
  3247. },
  3248. set: function(b,
  3249. d, l) {
  3250. return E(b, d, l ? N(b, c, l, e.support.boxSizing && "border-box" === e.css(b, "boxSizing")) : 0)
  3251. }
  3252. }
  3253. });
  3254. e.support.opacity || (e.cssHooks.opacity = {
  3255. get: function(b, c) {
  3256. return ud.test((c && b.currentStyle ? b.currentStyle.filter : b.style.filter) || "") ? 0.01 * parseFloat(RegExp.$1) + "" : c ? "1" : ""
  3257. },
  3258. set: function(b, c) {
  3259. var d = b.style,
  3260. l = b.currentStyle,
  3261. g = e.isNumeric(c) ? "alpha(opacity=" + 100 * c + ")" : "",
  3262. j = l && l.filter || d.filter || "";
  3263. d.zoom = 1;
  3264. if (!(1 <= c && "" === e.trim(j.replace(tb, "")) && d.removeAttribute && (d.removeAttribute("filter"), l && !l.filter))) d.filter =
  3265. tb.test(j) ? j.replace(tb, g) : j + " " + g
  3266. }
  3267. });
  3268. e(function() {
  3269. e.support.reliableMarginRight || (e.cssHooks.marginRight = {
  3270. get: function(b, c) {
  3271. return e.swap(b, {
  3272. display: "inline-block"
  3273. }, function() {
  3274. if (c) return R(b, "marginRight")
  3275. })
  3276. }
  3277. });
  3278. !e.support.pixelPosition && e.fn.position && e.each(["top", "left"], function(b, c) {
  3279. e.cssHooks[c] = {
  3280. get: function(b, d) {
  3281. if (d) {
  3282. var l = R(b, c);
  3283. return za.test(l) ? e(b).position()[c] + "px" : l
  3284. }
  3285. }
  3286. }
  3287. })
  3288. });
  3289. e.expr && e.expr.filters && (e.expr.filters.hidden = function(b) {
  3290. return 0 === b.offsetWidth && 0 === b.offsetHeight || !e.support.reliableHiddenOffsets &&
  3291. "none" === (b.style && b.style.display || R(b, "display"))
  3292. }, e.expr.filters.visible = function(b) {
  3293. return !e.expr.filters.hidden(b)
  3294. });
  3295. e.each({
  3296. margin: "",
  3297. padding: "",
  3298. border: "Width"
  3299. }, function(b, c) {
  3300. e.cssHooks[b + c] = {
  3301. expand: function(d) {
  3302. var e = "string" == typeof d ? d.split(" ") : [d],
  3303. l = {};
  3304. for (d = 0; 4 > d; d++) l[b + fa[d] + c] = e[d] || e[d - 2] || e[0];
  3305. return l
  3306. }
  3307. };
  3308. ic.test(b) || (e.cssHooks[b + c].set = E)
  3309. });
  3310. var Ad = /%20/g,
  3311. wc = /\[\]$/,
  3312. kc = /\r?\n/g,
  3313. Bd = /^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,
  3314. Cd = /^(?:select|textarea)/i;
  3315. e.fn.extend({
  3316. serialize: function() {
  3317. return e.param(this.serializeArray())
  3318. },
  3319. serializeArray: function() {
  3320. return this.map(function() {
  3321. return this.elements ? e.makeArray(this.elements) : this
  3322. }).filter(function() {
  3323. return this.name && !this.disabled && (this.checked || Cd.test(this.nodeName) || Bd.test(this.type))
  3324. }).map(function(b, c) {
  3325. var d = e(this).val();
  3326. return null == d ? null : e.isArray(d) ? e.map(d, function(b) {
  3327. return {
  3328. name: c.name,
  3329. value: b.replace(kc, "\r\n")
  3330. }
  3331. }) : {
  3332. name: c.name,
  3333. value: d.replace(kc, "\r\n")
  3334. }
  3335. }).get()
  3336. }
  3337. });
  3338. e.param = function(b, d) {
  3339. var l, g = [],
  3340. j = function(b, c) {
  3341. c = e.isFunction(c) ? c() : null == c ? "" : c;
  3342. g[g.length] = encodeURIComponent(b) + "=" + encodeURIComponent(c)
  3343. };
  3344. d === c && (d = e.ajaxSettings && e.ajaxSettings.traditional);
  3345. if (e.isArray(b) || b.jquery && !e.isPlainObject(b)) e.each(b, function() {
  3346. j(this.name, this.value)
  3347. });
  3348. else
  3349. for (l in b) O(l, b[l], d, j);
  3350. return g.join("&").replace(Ad, "+")
  3351. };
  3352. var ra, la, Dd = /#.*$/,
  3353. Ed = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg,
  3354. Fd = /^(?:GET|HEAD)$/,
  3355. Gd = /^\/\//,
  3356. lc = /\?/,
  3357. Hd = /<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,
  3358. Id = /([?&])_=[^&]*/,
  3359. mc = /^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,
  3360. nc = e.fn.load,
  3361. Za = {},
  3362. oc = {},
  3363. pc = ["*/"] + ["*"];
  3364. try {
  3365. la = yc.href
  3366. } catch (Rd) {
  3367. la = D.createElement("a"), la.href = "", la = la.href
  3368. }
  3369. ra = mc.exec(la.toLowerCase()) || [];
  3370. e.fn.load = function(b, d, l) {
  3371. if ("string" != typeof b && nc) return nc.apply(this, arguments);
  3372. if (!this.length) return this;
  3373. var g, j, p, m = this,
  3374. t = b.indexOf(" ");
  3375. return 0 <= t && (g = b.slice(t, b.length), b = b.slice(0, t)), e.isFunction(d) ? (l = d, d = c) : d && "object" == typeof d && (j = "POST"), e.ajax({
  3376. url: b,
  3377. type: j,
  3378. dataType: "html",
  3379. data: d,
  3380. complete: function(b, c) {
  3381. l && m.each(l, p || [b.responseText, c, b])
  3382. }
  3383. }).done(function(b) {
  3384. p = arguments;
  3385. m.html(g ? e("<div>").append(b.replace(Hd, "")).find(g) : b)
  3386. }), this
  3387. };
  3388. e.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "), function(b, c) {
  3389. e.fn[c] = function(b) {
  3390. return this.on(c, b)
  3391. }
  3392. });
  3393. e.each(["get", "post"], function(b, d) {
  3394. e[d] = function(b, l, g, j) {
  3395. return e.isFunction(l) && (j = j || g, g = l, l = c), e.ajax({
  3396. type: d,
  3397. url: b,
  3398. data: l,
  3399. success: g,
  3400. dataType: j
  3401. })
  3402. }
  3403. });
  3404. e.extend({
  3405. getScript: function(b, d) {
  3406. return e.get(b,
  3407. c, d, "script")
  3408. },
  3409. getJSON: function(b, c, d) {
  3410. return e.get(b, c, d, "json")
  3411. },
  3412. ajaxSetup: function(b, c) {
  3413. return c ? ta(b, e.ajaxSettings) : (c = b, b = e.ajaxSettings), ta(b, c), b
  3414. },
  3415. ajaxSettings: {
  3416. url: la,
  3417. isLocal: /^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/.test(ra[1]),
  3418. global: !0,
  3419. type: "GET",
  3420. contentType: "application/x-www-form-urlencoded; charset=UTF-8",
  3421. processData: !0,
  3422. async: !0,
  3423. accepts: {
  3424. xml: "application/xml, text/xml",
  3425. html: "text/html",
  3426. text: "text/plain",
  3427. json: "application/json, text/javascript",
  3428. "*": pc
  3429. },
  3430. contents: {
  3431. xml: /xml/,
  3432. html: /html/,
  3433. json: /json/
  3434. },
  3435. responseFields: {
  3436. xml: "responseXML",
  3437. text: "responseText"
  3438. },
  3439. converters: {
  3440. "* text": b.String,
  3441. "text html": !0,
  3442. "text json": e.parseJSON,
  3443. "text xml": e.parseXML
  3444. },
  3445. flatOptions: {
  3446. context: !0,
  3447. url: !0
  3448. }
  3449. },
  3450. ajaxPrefilter: Aa(Za),
  3451. ajaxTransport: Aa(oc),
  3452. ajax: function(b, d) {
  3453. function l(b, d, f, p) {
  3454. var u, r, q, s, z, E = d;
  3455. if (2 !== F) {
  3456. F = 2;
  3457. t && clearTimeout(t);
  3458. m = c;
  3459. j = p || "";
  3460. J.readyState = 0 < b ? 4 : 0;
  3461. if (f) {
  3462. s = x;
  3463. p = J;
  3464. var H, S, ba, I, N = s.contents,
  3465. K = s.dataTypes,
  3466. M = s.responseFields;
  3467. for (S in M) S in f && (p[M[S]] = f[S]);
  3468. for (;
  3469. "*" === K[0];) K.shift(),
  3470. H === c && (H = s.mimeType || p.getResponseHeader("content-type"));
  3471. if (H)
  3472. for (S in N)
  3473. if (N[S] && N[S].test(H)) {
  3474. K.unshift(S);
  3475. break
  3476. }
  3477. if (K[0] in f) ba = K[0];
  3478. else {
  3479. for (S in f) {
  3480. if (!K[0] || s.converters[S + " " + K[0]]) {
  3481. ba = S;
  3482. break
  3483. }
  3484. I || (I = S)
  3485. }
  3486. ba = ba || I
  3487. }
  3488. s = f = ba ? (ba !== K[0] && K.unshift(ba), f[ba]) : void 0
  3489. }
  3490. if (200 <= b && 300 > b || 304 === b)
  3491. if (x.ifModified && (z = J.getResponseHeader("Last-Modified"), z && (e.lastModified[g] = z), z = J.getResponseHeader("Etag"), z && (e.etag[g] = z)), 304 === b) E = "notmodified", u = !0;
  3492. else {
  3493. var G;
  3494. a: {
  3495. u = x;
  3496. r = s;
  3497. var O, E = u.dataTypes.slice();
  3498. f = E[0];
  3499. H = {};
  3500. S = 0;
  3501. u.dataFilter && (r = u.dataFilter(r, u.dataType));
  3502. if (E[1])
  3503. for (G in u.converters) H[G.toLowerCase()] = u.converters[G];
  3504. for (; q = E[++S];)
  3505. if ("*" !== q) {
  3506. if ("*" !== f && f !== q) {
  3507. G = H[f + " " + q] || H["* " + q];
  3508. if (!G)
  3509. for (O in H)
  3510. if (z = O.split(" "), z[1] === q && (G = H[f + " " + z[0]] || H["* " + z[0]])) {
  3511. !0 === G ? G = H[O] : !0 !== H[O] && (q = z[0], E.splice(S--, 0, q));
  3512. break
  3513. }
  3514. if (!0 !== G)
  3515. if (G && u["throws"]) r = G(r);
  3516. else try {
  3517. r = G(r)
  3518. } catch (P) {
  3519. G = {
  3520. state: "parsererror",
  3521. error: G ? P : "No conversion from " + f + " to " + q
  3522. };
  3523. break a
  3524. }
  3525. }
  3526. f = q
  3527. }
  3528. G = {
  3529. state: "success",
  3530. data: r
  3531. }
  3532. }
  3533. u =
  3534. G;
  3535. E = u.state;
  3536. r = u.data;
  3537. q = u.error;
  3538. u = !q
  3539. } else if (q = E, !E || b) E = "error", 0 > b && (b = 0);
  3540. J.status = b;
  3541. J.statusText = (d || E) + "";
  3542. u ? y.resolveWith(A, [r, E, J]) : y.rejectWith(A, [J, E, q]);
  3543. J.statusCode(D);
  3544. D = c;
  3545. n && B.trigger("ajax" + (u ? "Success" : "Error"), [J, x, u ? r : q]);
  3546. L.fireWith(A, [J, E]);
  3547. n && (B.trigger("ajaxComplete", [J, x]), --e.active || e.event.trigger("ajaxStop"))
  3548. }
  3549. }
  3550. "object" == typeof b && (d = b, b = c);
  3551. d = d || {};
  3552. var g, j, p, m, t, r, n, z, x = e.ajaxSetup({}, d),
  3553. A = x.context || x,
  3554. B = A !== x && (A.nodeType || A instanceof e) ? e(A) : e.event,
  3555. y = e.Deferred(),
  3556. L = e.Callbacks("once memory"),
  3557. D = x.statusCode || {},
  3558. E = {},
  3559. H = {},
  3560. F = 0,
  3561. I = "canceled",
  3562. J = {
  3563. readyState: 0,
  3564. setRequestHeader: function(b, c) {
  3565. if (!F) {
  3566. var d = b.toLowerCase();
  3567. b = H[d] = H[d] || b;
  3568. E[b] = c
  3569. }
  3570. return this
  3571. },
  3572. getAllResponseHeaders: function() {
  3573. return 2 === F ? j : null
  3574. },
  3575. getResponseHeader: function(b) {
  3576. var d;
  3577. if (2 === F) {
  3578. if (!p)
  3579. for (p = {}; d = Ed.exec(j);) p[d[1].toLowerCase()] = d[2];
  3580. d = p[b.toLowerCase()]
  3581. }
  3582. return d === c ? null : d
  3583. },
  3584. overrideMimeType: function(b) {
  3585. return F || (x.mimeType = b), this
  3586. },
  3587. abort: function(b) {
  3588. return b = b || I, m && m.abort(b), l(0, b), this
  3589. }
  3590. };
  3591. y.promise(J);
  3592. J.success = J.done;
  3593. J.error = J.fail;
  3594. J.complete = L.add;
  3595. J.statusCode = function(b) {
  3596. if (b) {
  3597. var c;
  3598. if (2 > F)
  3599. for (c in b) D[c] = [D[c], b[c]];
  3600. else c = b[J.status], J.always(c)
  3601. }
  3602. return this
  3603. };
  3604. x.url = ((b || x.url) + "").replace(Dd, "").replace(Gd, ra[1] + "//");
  3605. x.dataTypes = e.trim(x.dataType || "*").toLowerCase().split(ga);
  3606. null == x.crossDomain && (r = mc.exec(x.url.toLowerCase()) || !1, x.crossDomain = r && r.join(":") + (r[3] ? "" : "http:" === r[1] ? 80 : 443) !== ra.join(":") + (ra[3] ? "" : "http:" === ra[1] ? 80 : 443));
  3607. x.data && x.processData && "string" != typeof x.data && (x.data = e.param(x.data,
  3608. x.traditional));
  3609. oa(Za, x, d, J);
  3610. if (2 === F) return J;
  3611. n = x.global;
  3612. x.type = x.type.toUpperCase();
  3613. x.hasContent = !Fd.test(x.type);
  3614. n && 0 === e.active++ && e.event.trigger("ajaxStart");
  3615. if (!x.hasContent && (x.data && (x.url += (lc.test(x.url) ? "&" : "?") + x.data, delete x.data), g = x.url, !1 === x.cache)) {
  3616. r = e.now();
  3617. var N = x.url.replace(Id, "$1_=" + r);
  3618. x.url = N + (N === x.url ? (lc.test(x.url) ? "&" : "?") + "_=" + r : "")
  3619. }(x.data && x.hasContent && !1 !== x.contentType || d.contentType) && J.setRequestHeader("Content-Type", x.contentType);
  3620. x.ifModified && (g = g || x.url,
  3621. e.lastModified[g] && J.setRequestHeader("If-Modified-Since", e.lastModified[g]), e.etag[g] && J.setRequestHeader("If-None-Match", e.etag[g]));
  3622. J.setRequestHeader("Accept", x.dataTypes[0] && x.accepts[x.dataTypes[0]] ? x.accepts[x.dataTypes[0]] + ("*" !== x.dataTypes[0] ? ", " + pc + "; q=0.01" : "") : x.accepts["*"]);
  3623. for (z in x.headers) J.setRequestHeader(z, x.headers[z]);
  3624. if (!x.beforeSend || !1 !== x.beforeSend.call(A, J, x) && 2 !== F) {
  3625. I = "abort";
  3626. for (z in {
  3627. success: 1,
  3628. error: 1,
  3629. complete: 1
  3630. }) J[z](x[z]);
  3631. if (m = oa(oc, x, d, J)) {
  3632. J.readyState = 1;
  3633. n && B.trigger("ajaxSend", [J, x]);
  3634. x.async && 0 < x.timeout && (t = setTimeout(function() {
  3635. J.abort("timeout")
  3636. }, x.timeout));
  3637. try {
  3638. F = 1, m.send(E, l)
  3639. } catch (K) {
  3640. if (2 > F) l(-1, K);
  3641. else throw K;
  3642. }
  3643. } else l(-1, "No Transport");
  3644. return J
  3645. }
  3646. return J.abort()
  3647. },
  3648. active: 0,
  3649. lastModified: {},
  3650. etag: {}
  3651. });
  3652. var qc = [],
  3653. Jd = /\?/,
  3654. Wa = /(=)\?(?=&|$)|\?\?/,
  3655. Kd = e.now();
  3656. e.ajaxSetup({
  3657. jsonp: "callback",
  3658. jsonpCallback: function() {
  3659. var b = qc.pop() || e.expando + "_" + Kd++;
  3660. return this[b] = !0, b
  3661. }
  3662. });
  3663. e.ajaxPrefilter("json jsonp", function(d, f, l) {
  3664. var g, j, p, m = d.data,
  3665. t = d.url,
  3666. r = !1 !== d.jsonp,
  3667. n = r && Wa.test(t),
  3668. x = r && !n && "string" == typeof m && !(d.contentType || "").indexOf("application/x-www-form-urlencoded") && Wa.test(m);
  3669. if ("jsonp" === d.dataTypes[0] || n || x) return g = d.jsonpCallback = e.isFunction(d.jsonpCallback) ? d.jsonpCallback() : d.jsonpCallback, j = b[g], n ? d.url = t.replace(Wa, "$1" + g) : x ? d.data = m.replace(Wa, "$1" + g) : r && (d.url += (Jd.test(t) ? "&" : "?") + d.jsonp + "=" + g), d.converters["script json"] = function() {
  3670. return p || e.error(g + " was not called"), p[0]
  3671. }, d.dataTypes[0] = "json", b[g] = function() {
  3672. p = arguments
  3673. }, l.always(function() {
  3674. b[g] =
  3675. j;
  3676. d[g] && (d.jsonpCallback = f.jsonpCallback, qc.push(g));
  3677. p && e.isFunction(j) && j(p[0]);
  3678. p = j = c
  3679. }), "script"
  3680. });
  3681. e.ajaxSetup({
  3682. accepts: {
  3683. script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"
  3684. },
  3685. contents: {
  3686. script: /javascript|ecmascript/
  3687. },
  3688. converters: {
  3689. "text script": function(b) {
  3690. return e.globalEval(b), b
  3691. }
  3692. }
  3693. });
  3694. e.ajaxPrefilter("script", function(b) {
  3695. b.cache === c && (b.cache = !1);
  3696. b.crossDomain && (b.type = "GET", b.global = !1)
  3697. });
  3698. e.ajaxTransport("script", function(b) {
  3699. if (b.crossDomain) {
  3700. var d, e =
  3701. D.head || D.getElementsByTagName("head")[0] || D.documentElement;
  3702. return {
  3703. send: function(l, g) {
  3704. d = D.createElement("script");
  3705. d.async = "async";
  3706. b.scriptCharset && (d.charset = b.scriptCharset);
  3707. d.src = b.url;
  3708. d.onload = d.onreadystatechange = function(b, l) {
  3709. if (l || !d.readyState || /loaded|complete/.test(d.readyState)) d.onload = d.onreadystatechange = null, e && d.parentNode && e.removeChild(d), d = c, l || g(200, "success")
  3710. };
  3711. e.insertBefore(d, e.firstChild)
  3712. },
  3713. abort: function() {
  3714. d && d.onload(0, 1)
  3715. }
  3716. }
  3717. }
  3718. });
  3719. var sa, ub = b.ActiveXObject ? function() {
  3720. for (var b in sa) sa[b](0,
  3721. 1)
  3722. } : !1,
  3723. Ld = 0;
  3724. e.ajaxSettings.xhr = b.ActiveXObject ? function() {
  3725. var c;
  3726. if (!(c = !this.isLocal && zb())) a: {
  3727. try {
  3728. c = new b.ActiveXObject("Microsoft.XMLHTTP");
  3729. break a
  3730. } catch (d) {}
  3731. c = void 0
  3732. }
  3733. return c
  3734. } : zb;
  3735. var vb = e.ajaxSettings.xhr();
  3736. e.extend(e.support, {
  3737. ajax: !!vb,
  3738. cors: !!vb && "withCredentials" in vb
  3739. });
  3740. e.support.ajax && e.ajaxTransport(function(d) {
  3741. if (!d.crossDomain || e.support.cors) {
  3742. var f;
  3743. return {
  3744. send: function(l, g) {
  3745. var j, p, m = d.xhr();
  3746. d.username ? m.open(d.type, d.url, d.async, d.username, d.password) : m.open(d.type, d.url, d.async);
  3747. if (d.xhrFields)
  3748. for (p in d.xhrFields) m[p] =
  3749. d.xhrFields[p];
  3750. d.mimeType && m.overrideMimeType && m.overrideMimeType(d.mimeType);
  3751. !d.crossDomain && !l["X-Requested-With"] && (l["X-Requested-With"] = "XMLHttpRequest");
  3752. try {
  3753. for (p in l) m.setRequestHeader(p, l[p])
  3754. } catch (t) {}
  3755. m.send(d.hasContent && d.data || null);
  3756. f = function(b, l) {
  3757. var p, t, r, q, s;
  3758. try {
  3759. if (f && (l || 4 === m.readyState))
  3760. if (f = c, j && (m.onreadystatechange = e.noop, ub && delete sa[j]), l) 4 !== m.readyState && m.abort();
  3761. else {
  3762. p = m.status;
  3763. r = m.getAllResponseHeaders();
  3764. q = {};
  3765. (s = m.responseXML) && s.documentElement && (q.xml = s);
  3766. try {
  3767. q.text =
  3768. m.responseText
  3769. } catch (n) {}
  3770. try {
  3771. t = m.statusText
  3772. } catch (x) {
  3773. t = ""
  3774. }!p && d.isLocal && !d.crossDomain ? p = q.text ? 200 : 404 : 1223 === p && (p = 204)
  3775. }
  3776. } catch (z) {
  3777. l || g(-1, z)
  3778. }
  3779. q && g(p, t, q, r)
  3780. };
  3781. d.async ? 4 === m.readyState ? setTimeout(f, 0) : (j = ++Ld, ub && (sa || (sa = {}, e(b).unload(ub)), sa[j] = f), m.onreadystatechange = f) : f()
  3782. },
  3783. abort: function() {
  3784. f && f(0, 1)
  3785. }
  3786. }
  3787. }
  3788. });
  3789. var Ba, Xa, Md = /^(?:toggle|show|hide)$/,
  3790. Nd = RegExp("^(?:([-+])=|)(" + Fa + ")([a-z%]*)$", "i"),
  3791. Od = /queueHooks$/,
  3792. Ca = [
  3793. function(b, c, d) {
  3794. var l, g, j, p, t, r, n = this,
  3795. x = b.style,
  3796. z = {},
  3797. A = [],
  3798. B = b.nodeType && L(b);
  3799. d.queue ||
  3800. (t = e._queueHooks(b, "fx"), null == t.unqueued && (t.unqueued = 0, r = t.empty.fire, t.empty.fire = function() {
  3801. t.unqueued || r()
  3802. }), t.unqueued++, n.always(function() {
  3803. n.always(function() {
  3804. t.unqueued--;
  3805. e.queue(b, "fx").length || t.empty.fire()
  3806. })
  3807. }));
  3808. 1 === b.nodeType && ("height" in c || "width" in c) && (d.overflow = [x.overflow, x.overflowX, x.overflowY], "inline" === e.css(b, "display") && "none" === e.css(b, "float") && (!e.support.inlineBlockNeedsLayout || "inline" === K(b.nodeName) ? x.display = "inline-block" : x.zoom = 1));
  3809. d.overflow && (x.overflow = "hidden",
  3810. e.support.shrinkWrapBlocks || n.done(function() {
  3811. x.overflow = d.overflow[0];
  3812. x.overflowX = d.overflow[1];
  3813. x.overflowY = d.overflow[2]
  3814. }));
  3815. for (l in c) g = c[l], Md.exec(g) && (delete c[l], g !== (B ? "hide" : "show") && A.push(l));
  3816. if (g = A.length) {
  3817. j = e._data(b, "fxshow") || e._data(b, "fxshow", {});
  3818. B ? e(b).show() : n.done(function() {
  3819. e(b).hide()
  3820. });
  3821. n.done(function() {
  3822. var c;
  3823. e.removeData(b, "fxshow", !0);
  3824. for (c in z) e.style(b, c, z[c])
  3825. });
  3826. for (l = 0; l < g; l++) c = A[l], p = n.createTween(c, B ? j[c] : 0), z[c] = j[c] || e.style(b, c), c in j || (j[c] = p.start, B && (p.end = p.start,
  3827. p.start = "width" === c || "height" === c ? 1 : 0))
  3828. }
  3829. }
  3830. ],
  3831. ua = {
  3832. "*": [
  3833. function(b, c) {
  3834. var d, l, g = this.createTween(b, c),
  3835. j = Nd.exec(c),
  3836. p = g.cur(),
  3837. t = +p || 0,
  3838. r = 1,
  3839. n = 20;
  3840. if (j) {
  3841. d = +j[2];
  3842. l = j[3] || (e.cssNumber[b] ? "" : "px");
  3843. if ("px" !== l && t) {
  3844. t = e.css(g.elem, b, !0) || d || 1;
  3845. do r = r || ".5", t /= r, e.style(g.elem, b, t + l); while (r !== (r = g.cur() / p) && 1 !== r && --n)
  3846. }
  3847. g.unit = l;
  3848. g.start = t;
  3849. g.end = j[1] ? t + (j[1] + 1) * d : d
  3850. }
  3851. return g
  3852. }
  3853. ]
  3854. };
  3855. e.Animation = e.extend(Bb, {
  3856. tweener: function(b, c) {
  3857. e.isFunction(b) ? (c = b, b = ["*"]) : b = b.split(" ");
  3858. for (var d, l = 0, g = b.length; l < g; l++) d = b[l], ua[d] = ua[d] || [], ua[d].unshift(c)
  3859. },
  3860. prefilter: function(b, c) {
  3861. c ? Ca.unshift(b) : Ca.push(b)
  3862. }
  3863. });
  3864. e.Tween = T;
  3865. T.prototype = {
  3866. constructor: T,
  3867. init: function(b, c, d, l, g, j) {
  3868. this.elem = b;
  3869. this.prop = d;
  3870. this.easing = g || "swing";
  3871. this.options = c;
  3872. this.start = this.now = this.cur();
  3873. this.end = l;
  3874. this.unit = j || (e.cssNumber[d] ? "" : "px")
  3875. },
  3876. cur: function() {
  3877. var b = T.propHooks[this.prop];
  3878. return b && b.get ? b.get(this) : T.propHooks._default.get(this)
  3879. },
  3880. run: function(b) {
  3881. var c, d = T.propHooks[this.prop];
  3882. return this.options.duration ? this.pos = c = e.easing[this.easing](b, this.options.duration *
  3883. b, 0, 1, this.options.duration) : this.pos = c = b, this.now = (this.end - this.start) * c + this.start, this.options.step && this.options.step.call(this.elem, this.now, this), d && d.set ? d.set(this) : T.propHooks._default.set(this), this
  3884. }
  3885. };
  3886. T.prototype.init.prototype = T.prototype;
  3887. T.propHooks = {
  3888. _default: {
  3889. get: function(b) {
  3890. var c;
  3891. return null == b.elem[b.prop] || b.elem.style && null != b.elem.style[b.prop] ? (c = e.css(b.elem, b.prop, !1, ""), !c || "auto" === c ? 0 : c) : b.elem[b.prop]
  3892. },
  3893. set: function(b) {
  3894. e.fx.step[b.prop] ? e.fx.step[b.prop](b) : b.elem.style &&
  3895. (null != b.elem.style[e.cssProps[b.prop]] || e.cssHooks[b.prop]) ? e.style(b.elem, b.prop, b.now + b.unit) : b.elem[b.prop] = b.now
  3896. }
  3897. }
  3898. };
  3899. T.propHooks.scrollTop = T.propHooks.scrollLeft = {
  3900. set: function(b) {
  3901. b.elem.nodeType && b.elem.parentNode && (b.elem[b.prop] = b.now)
  3902. }
  3903. };
  3904. e.each(["toggle", "show", "hide"], function(b, c) {
  3905. var d = e.fn[c];
  3906. e.fn[c] = function(l, g, j) {
  3907. return null == l || "boolean" == typeof l || !b && e.isFunction(l) && e.isFunction(g) ? d.apply(this, arguments) : this.animate(Da(c, !0), l, g, j)
  3908. }
  3909. });
  3910. e.fn.extend({
  3911. fadeTo: function(b, c, d, e) {
  3912. return this.filter(L).css("opacity",
  3913. 0).show().end().animate({
  3914. opacity: c
  3915. }, b, d, e)
  3916. },
  3917. animate: function(b, c, d, l) {
  3918. var g = e.isEmptyObject(b),
  3919. j = e.speed(c, d, l);
  3920. c = function() {
  3921. var c = Bb(this, e.extend({}, b), j);
  3922. g && c.stop(!0)
  3923. };
  3924. return g || !1 === j.queue ? this.each(c) : this.queue(j.queue, c)
  3925. },
  3926. stop: function(b, d, l) {
  3927. var g = function(b) {
  3928. var c = b.stop;
  3929. delete b.stop;
  3930. c(l)
  3931. };
  3932. return "string" != typeof b && (l = d, d = b, b = c), d && !1 !== b && this.queue(b || "fx", []), this.each(function() {
  3933. var c = !0,
  3934. d = null != b && b + "queueHooks",
  3935. f = e.timers,
  3936. j = e._data(this);
  3937. if (d) j[d] && j[d].stop && g(j[d]);
  3938. else
  3939. for (d in j) j[d] &&
  3940. j[d].stop && Od.test(d) && g(j[d]);
  3941. for (d = f.length; d--;) f[d].elem === this && (null == b || f[d].queue === b) && (f[d].anim.stop(l), c = !1, f.splice(d, 1));
  3942. (c || !l) && e.dequeue(this, b)
  3943. })
  3944. }
  3945. });
  3946. e.each({
  3947. slideDown: Da("show"),
  3948. slideUp: Da("hide"),
  3949. slideToggle: Da("toggle"),
  3950. fadeIn: {
  3951. opacity: "show"
  3952. },
  3953. fadeOut: {
  3954. opacity: "hide"
  3955. },
  3956. fadeToggle: {
  3957. opacity: "toggle"
  3958. }
  3959. }, function(b, c) {
  3960. e.fn[b] = function(b, d, e) {
  3961. return this.animate(c, b, d, e)
  3962. }
  3963. });
  3964. e.speed = function(b, c, d) {
  3965. var l = b && "object" == typeof b ? e.extend({}, b) : {
  3966. complete: d || !d && c || e.isFunction(b) && b,
  3967. duration: b,
  3968. easing: d && c || c && !e.isFunction(c) && c
  3969. };
  3970. l.duration = e.fx.off ? 0 : "number" == typeof l.duration ? l.duration : l.duration in e.fx.speeds ? e.fx.speeds[l.duration] : e.fx.speeds._default;
  3971. if (null == l.queue || !0 === l.queue) l.queue = "fx";
  3972. return l.old = l.complete, l.complete = function() {
  3973. e.isFunction(l.old) && l.old.call(this);
  3974. l.queue && e.dequeue(this, l.queue)
  3975. }, l
  3976. };
  3977. e.easing = {
  3978. linear: function(b) {
  3979. return b
  3980. },
  3981. swing: function(b) {
  3982. return 0.5 - Math.cos(b * Math.PI) / 2
  3983. }
  3984. };
  3985. e.timers = [];
  3986. e.fx = T.prototype.init;
  3987. e.fx.tick = function() {
  3988. for (var b, c = e.timers,
  3989. d = 0; d < c.length; d++) b = c[d], !b() && c[d] === b && c.splice(d--, 1);
  3990. c.length || e.fx.stop()
  3991. };
  3992. e.fx.timer = function(b) {
  3993. b() && e.timers.push(b) && !Xa && (Xa = setInterval(e.fx.tick, e.fx.interval))
  3994. };
  3995. e.fx.interval = 13;
  3996. e.fx.stop = function() {
  3997. clearInterval(Xa);
  3998. Xa = null
  3999. };
  4000. e.fx.speeds = {
  4001. slow: 600,
  4002. fast: 200,
  4003. _default: 400
  4004. };
  4005. e.fx.step = {};
  4006. e.expr && e.expr.filters && (e.expr.filters.animated = function(b) {
  4007. return e.grep(e.timers, function(c) {
  4008. return b === c.elem
  4009. }).length
  4010. });
  4011. var rc = /^(?:body|html)$/i;
  4012. e.fn.offset = function(b) {
  4013. if (arguments.length) return b ===
  4014. c ? this : this.each(function(c) {
  4015. e.offset.setOffset(this, b, c)
  4016. });
  4017. var d, l, g, j, p, m, t, r = {
  4018. top: 0,
  4019. left: 0
  4020. },
  4021. n = this[0],
  4022. x = n && n.ownerDocument;
  4023. if (x) return (l = x.body) === n ? e.offset.bodyOffset(n) : (d = x.documentElement, e.contains(d, n) ? ("undefined" != typeof n.getBoundingClientRect && (r = n.getBoundingClientRect()), g = Cb(x), j = d.clientTop || l.clientTop || 0, p = d.clientLeft || l.clientLeft || 0, m = g.pageYOffset || d.scrollTop, t = g.pageXOffset || d.scrollLeft, {
  4024. top: r.top + m - j,
  4025. left: r.left + t - p
  4026. }) : r)
  4027. };
  4028. e.offset = {
  4029. bodyOffset: function(b) {
  4030. var c = b.offsetTop,
  4031. d = b.offsetLeft;
  4032. return e.support.doesNotIncludeMarginInBodyOffset && (c += parseFloat(e.css(b, "marginTop")) || 0, d += parseFloat(e.css(b, "marginLeft")) || 0), {
  4033. top: c,
  4034. left: d
  4035. }
  4036. },
  4037. setOffset: function(b, c, d) {
  4038. var l = e.css(b, "position");
  4039. "static" === l && (b.style.position = "relative");
  4040. var g = e(b),
  4041. j = g.offset(),
  4042. p = e.css(b, "top"),
  4043. t = e.css(b, "left"),
  4044. r = {},
  4045. n = {},
  4046. x, z;
  4047. ("absolute" === l || "fixed" === l) && -1 < e.inArray("auto", [p, t]) ? (n = g.position(), x = n.top, z = n.left) : (x = parseFloat(p) || 0, z = parseFloat(t) || 0);
  4048. e.isFunction(c) && (c = c.call(b, d, j));
  4049. null !=
  4050. c.top && (r.top = c.top - j.top + x);
  4051. null != c.left && (r.left = c.left - j.left + z);
  4052. "using" in c ? c.using.call(b, r) : g.css(r)
  4053. }
  4054. };
  4055. e.fn.extend({
  4056. position: function() {
  4057. if (this[0]) {
  4058. var b = this[0],
  4059. c = this.offsetParent(),
  4060. d = this.offset(),
  4061. l = rc.test(c[0].nodeName) ? {
  4062. top: 0,
  4063. left: 0
  4064. } : c.offset();
  4065. return d.top -= parseFloat(e.css(b, "marginTop")) || 0, d.left -= parseFloat(e.css(b, "marginLeft")) || 0, l.top += parseFloat(e.css(c[0], "borderTopWidth")) || 0, l.left += parseFloat(e.css(c[0], "borderLeftWidth")) || 0, {
  4066. top: d.top - l.top,
  4067. left: d.left - l.left
  4068. }
  4069. }
  4070. },
  4071. offsetParent: function() {
  4072. return this.map(function() {
  4073. for (var b =
  4074. this.offsetParent || D.body; b && !rc.test(b.nodeName) && "static" === e.css(b, "position");) b = b.offsetParent;
  4075. return b || D.body
  4076. })
  4077. }
  4078. });
  4079. e.each({
  4080. scrollLeft: "pageXOffset",
  4081. scrollTop: "pageYOffset"
  4082. }, function(b, d) {
  4083. var l = /Y/.test(d);
  4084. e.fn[b] = function(g) {
  4085. return e.access(this, function(b, g, j) {
  4086. var p = Cb(b);
  4087. if (j === c) return p ? d in p ? p[d] : p.document.documentElement[g] : b[g];
  4088. p ? p.scrollTo(l ? e(p).scrollLeft() : j, l ? j : e(p).scrollTop()) : b[g] = j
  4089. }, b, g, arguments.length, null)
  4090. }
  4091. });
  4092. e.each({
  4093. Height: "height",
  4094. Width: "width"
  4095. }, function(b, d) {
  4096. e.each({
  4097. padding: "inner" +
  4098. b,
  4099. content: d,
  4100. "": "outer" + b
  4101. }, function(l, g) {
  4102. e.fn[g] = function(g, j) {
  4103. var p = arguments.length && (l || "boolean" != typeof g),
  4104. t = l || (!0 === g || !0 === j ? "margin" : "border");
  4105. return e.access(this, function(d, f, l) {
  4106. var g;
  4107. return e.isWindow(d) ? d.document.documentElement["client" + b] : 9 === d.nodeType ? (g = d.documentElement, Math.max(d.body["scroll" + b], g["scroll" + b], d.body["offset" + b], g["offset" + b], g["client" + b])) : l === c ? e.css(d, f, l, t) : e.style(d, f, l, t)
  4108. }, d, p ? g : c, p, null)
  4109. }
  4110. })
  4111. });
  4112. b.jQuery = b.$ = e;
  4113. "function" == typeof define && define.amd && define.amd.jQuery &&
  4114. define("jquery", [], function() {
  4115. return e
  4116. })
  4117. })(window);
  4118. var portraitMode = !1,
  4119. mobilePortraitWidth = 480,
  4120. mobilePortraitHeight = 640,
  4121. mobileLandscapeWidth = 640,
  4122. mobileLandscapeHeight = 480,
  4123. mobileWidth = portraitMode ? mobilePortraitWidth : mobileLandscapeWidth,
  4124. mobileHeight = portraitMode ? mobilePortraitHeight : mobileLandscapeHeight,
  4125. desktopWidth = 640,
  4126. desktopHeight = 480,
  4127. w, h, multiplier, destW, destH, dynamicClickableEntityDivs = {},
  4128. coreDivsToResize = ["game", "play", "orientate"],
  4129. advancedDivsToResize = {/*
  4130. MobileAdInGamePreroll: {
  4131. "box-width": _SETTINGS.Ad.Mobile.Preroll.Width + 2,
  4132. "box-height": _SETTINGS.Ad.Mobile.Preroll.Height +
  4133. 20
  4134. },
  4135. MobileAdInGameEnd: {
  4136. "box-width": _SETTINGS.Ad.Mobile.End.Width + 2,
  4137. "box-height": _SETTINGS.Ad.Mobile.End.Height + 20
  4138. },
  4139. MobileAdInGamePreroll2: {
  4140. "box-width": _SETTINGS.Ad.Mobile.Preroll.Width + 2,
  4141. "box-height": _SETTINGS.Ad.Mobile.Preroll.Height + 20
  4142. },
  4143. MobileAdInGameEnd2: {
  4144. "box-width": _SETTINGS.Ad.Mobile.End.Width + 2,
  4145. "box-height": _SETTINGS.Ad.Mobile.End.Height + 20
  4146. },
  4147. MobileAdInGamePreroll3: {
  4148. "box-width": _SETTINGS.Ad.Mobile.Preroll.Width + 2,
  4149. "box-height": _SETTINGS.Ad.Mobile.Preroll.Height + 20
  4150. },
  4151. MobileAdInGameEnd3: {
  4152. "box-width": _SETTINGS.Ad.Mobile.End.Width +
  4153. 2,
  4154. "box-height": _SETTINGS.Ad.Mobile.End.Height + 20
  4155. }*/
  4156. };
  4157. function adjustLayers(b) {
  4158. for (i = 0; i < coreDivsToResize.length; i++) ig.ua.mobile ? ($("#" + coreDivsToResize[i]).width(w), $("#" + coreDivsToResize[i]).height(h)) : ($("#" + coreDivsToResize[i]).width(destW), $("#" + coreDivsToResize[i]).height(destH), $("#" + coreDivsToResize[i]).css("left", b ? 0 : w / 2 - destW / 2));
  4159. for (key in advancedDivsToResize) try {
  4160. $("#" + key).width(w), $("#" + key).height(h), $("#" + key + "-Box").css("left", (w - advancedDivsToResize[key]["box-width"]) / 2), $("#" + key + "-Box").css("top", (h - advancedDivsToResize[key]["box-height"]) /
  4161. 2)
  4162. } catch (c) {
  4163. console.log(c)
  4164. }
  4165. $("#ajaxbar").width(w);
  4166. $("#ajaxbar").height(h)
  4167. }
  4168. var minHeight = 99999999;
  4169. function sizeHandler() {
  4170. if ($("#game")) {
  4171. w = window.innerWidth;
  4172. h = window.innerHeight;
  4173. ig.ua.mobile ? (multiplier = Math.min(h / mobileHeight, w / mobileWidth), destW = mobileWidth * multiplier, destH = mobileHeight * multiplier) : (multiplier = Math.min(h / desktopHeight, w / desktopWidth), destW = desktopWidth * multiplier, destH = desktopHeight * multiplier);
  4174. widthRatio = window.innerWidth / mobileWidth;
  4175. heightRatio = window.innerHeight / mobileHeight;
  4176. adjustLayers();
  4177. window.scrollTo(0, 1);
  4178. ig.ua.mobile || $("#tempdiv").hide();
  4179. for (var b = navigator.userAgent.split(" "),
  4180. c = null, d = 0; d < b.length; d++) "Version/" == b[d].substr(0, 8) && (c = b[d]);
  4181. var b = window.chrome,
  4182. d = navigator.userAgent.indexOf("wv"),
  4183. g = navigator.userAgent.indexOf("SamsungBrowser"); - 1 < navigator.userAgent.indexOf("Chrome") && null == c && -1 >= d && -1 >= g ? ig.ua.mobile && null !== b && void 0 !== b && $(window) && (c = document.getElementById("scrollDown"), c.src = "media/graphics/orientate/scroll_down.png", c.style.height = "40%", c.style.width = "20%", c.style.backgroundColor = "rgba(11,156,49,0.4)", 0 == window.orientation && $("#scrollDown").hide(),
  4184. 90 == Math.abs(window.orientation) && (c = document.body.offsetHeight, c < minHeight && (minHeight = c), c = portraitMode ? document.getElementById("orientate") : document.getElementById("game"), b = document.getElementById("tempdiv"), c = c.clientHeight + b.clientHeight, console.log(c + "," + minHeight), c > minHeight ? $("#scrollDown").hide() : $("#scrollDown").show()), $(window).on("orientationchange", function() {
  4185. 0 == window.orientation && $("#scrollDown").hide();
  4186. Math.abs(window.orientation);
  4187. $("#scrollDown").show();
  4188. 0 == window.orientation &&
  4189. $("#scrollDown").hide()
  4190. }), window.addEventListener("resize", function() {
  4191. 0 == window.orientation && $("#scrollDown").hide();
  4192. if (90 == Math.abs(window.orientation)) {
  4193. var b = portraitMode ? document.getElementById("orientate") : document.getElementById("game"),
  4194. c = document.getElementById("tempdiv");
  4195. b.clientHeight + c.clientHeight > minHeight ? $("#scrollDown").hide() : $("#scrollDown").show()
  4196. }
  4197. })) : ($("#scrollDown").hide(), $("#tempdiv").hide())
  4198. }
  4199. }
  4200. function orientationHandler() {
  4201. console.log("changing orientation ...");
  4202. ig.ua.mobile && ((portraitMode ? window.innerHeight < window.innerWidth : window.innerHeight > window.innerWidth) ? ($("#orientate").show(), $("#game").hide()) : ($("#orientate").hide(), $("#game").show()));
  4203. sizeHandler()
  4204. }
  4205. function fixSamsungHandler() {
  4206. ig.ua.android && !(4.2 > parseFloat(navigator.userAgent.slice(navigator.userAgent.indexOf("Android") + 8, navigator.userAgent.indexOf("Android") + 11))) && (!(0 > navigator.userAgent.indexOf("GT")) && !(0 < navigator.userAgent.indexOf("Chrome")) && !(0 < navigator.userAgent.indexOf("Firefox"))) && (document.addEventListener("touchstart", function(b) {
  4207. b.preventDefault();
  4208. return !1
  4209. }, !1), document.addEventListener("touchmove", function(b) {
  4210. b.preventDefault();
  4211. return !1
  4212. }, !1), document.addEventListener("touchend",
  4213. function(b) {
  4214. b.preventDefault();
  4215. return !1
  4216. }, !1))
  4217. }
  4218. window.addEventListener("resize", function() {
  4219. orientationHandler()
  4220. }, !1);
  4221. window.addEventListener("orientationchange", function() {
  4222. orientationHandler()
  4223. }, !1);
  4224. document.ontouchmove = function() {
  4225. window.scrollTo(0, 1)
  4226. };
  4227. function getInternetExplorerVersion() {
  4228. var b = -1;
  4229. "Microsoft Internet Explorer" == navigator.appName && null != /MSIE ([0-9]{1,}[.0-9]{0,})/.exec(navigator.userAgent) && (b = parseFloat(RegExp.$1));
  4230. return b
  4231. }
  4232. var ie = getInternetExplorerVersion();
  4233. function getQueryVariable(b) {
  4234. for (var c = window.location.search.substring(1).split("&"), d = 0; d < c.length; d++) {
  4235. var g = c[d].split("=");
  4236. if (decodeURIComponent(g[0]) == b) return decodeURIComponent(g[1])
  4237. }
  4238. }
  4239. this.jukebox = {};
  4240. jukebox.Player = function(b, c) {
  4241. this.id = ++jukebox.__jukeboxId;
  4242. this.origin = c || null;
  4243. this.settings = {};
  4244. for (var d in this.defaults) this.settings[d] = this.defaults[d];
  4245. if ("[object Object]" === Object.prototype.toString.call(b))
  4246. for (var g in b) this.settings[g] = b[g];
  4247. "[object Function]" === Object.prototype.toString.call(jukebox.Manager) && (jukebox.Manager = new jukebox.Manager);
  4248. this.resource = this.isPlaying = null;
  4249. this.resource = "[object Object]" === Object.prototype.toString.call(jukebox.Manager) ? jukebox.Manager.getPlayableResource(this.settings.resources) :
  4250. this.settings.resources[0] || null;
  4251. if (null === this.resource) throw "Your browser can't playback the given resources - or you have missed to include jukebox.Manager";
  4252. this.__init();
  4253. return this
  4254. };
  4255. jukebox.__jukeboxId = 0;
  4256. jukebox.Player.prototype = {
  4257. defaults: {
  4258. resources: [],
  4259. autoplay: !1,
  4260. spritemap: {},
  4261. flashMediaElement: "./swf/FlashMediaElement.swf",
  4262. timeout: 1E3
  4263. },
  4264. __addToManager: function() {
  4265. !0 !== this.__wasAddedToManager && (jukebox.Manager.add(this), this.__wasAddedToManager = !0)
  4266. },
  4267. __init: function() {
  4268. var b = this,
  4269. c = this.settings,
  4270. d = {},
  4271. g;
  4272. jukebox.Manager && void 0 !== jukebox.Manager.features && (d = jukebox.Manager.features);
  4273. if (!0 === d.html5audio) {
  4274. this.context = new Audio;
  4275. this.context.src = this.resource;
  4276. if (null === this.origin) {
  4277. var j = function(c) {
  4278. b.__addToManager(c)
  4279. };
  4280. this.context.addEventListener("canplaythrough", j, !0);
  4281. window.setTimeout(function() {
  4282. b.context.removeEventListener("canplaythrough", j, !0);
  4283. j("timeout")
  4284. }, c.timeout)
  4285. }
  4286. this.context.autobuffer = !0;
  4287. this.context.preload = !0;
  4288. for (g in this.HTML5API) this[g] = this.HTML5API[g];
  4289. 1 < d.channels ? !0 === c.autoplay ? this.context.autoplay = !0 : void 0 !== c.spritemap[c.autoplay] && this.play(c.autoplay) : 1 === d.channels && void 0 !== c.spritemap[c.autoplay] && (this.backgroundMusic = c.spritemap[c.autoplay], this.backgroundMusic.started = Date.now ?
  4290. Date.now() : +new Date, this.play(c.autoplay));
  4291. 1 == d.channels && !0 !== c.canPlayBackground && (window.addEventListener("pagehide", function() {
  4292. null !== b.isPlaying && (b.pause(), b.__wasAutoPaused = !0)
  4293. }), window.addEventListener("pageshow", function() {
  4294. b.__wasAutoPaused && (b.resume(), delete b._wasAutoPaused)
  4295. }))
  4296. } else if (!0 === d.flashaudio) {
  4297. for (g in this.FLASHAPI) this[g] = this.FLASHAPI[g];
  4298. d = ["id=jukebox-flashstream-" + this.id, "autoplay=" + c.autoplay, "file=" + window.encodeURIComponent(this.resource)];
  4299. this.__initFlashContext(d);
  4300. !0 === c.autoplay ? this.play(0) : c.spritemap[c.autoplay] && this.play(c.autoplay)
  4301. } else throw "Your Browser does not support Flash Audio or HTML5 Audio.";
  4302. },
  4303. __initFlashContext: function(b) {
  4304. var c, d = this.settings.flashMediaElement,
  4305. g, j = {
  4306. flashvars: b.join("&"),
  4307. quality: "high",
  4308. bgcolor: "#000000",
  4309. wmode: "transparent",
  4310. allowscriptaccess: "always",
  4311. allowfullscreen: "true"
  4312. };
  4313. if (navigator.userAgent.match(/MSIE/)) {
  4314. c = document.createElement("div");
  4315. document.getElementsByTagName("body")[0].appendChild(c);
  4316. var n = document.createElement("object");
  4317. n.id = "jukebox-flashstream-" + this.id;
  4318. n.setAttribute("type", "application/x-shockwave-flash");
  4319. n.setAttribute("classid", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000");
  4320. n.setAttribute("width", "0");
  4321. n.setAttribute("height", "0");
  4322. j.movie = d + "?x=" + (Date.now ? Date.now() : +new Date);
  4323. j.flashvars = b.join("&amp;");
  4324. for (g in j) b = document.createElement("param"), b.setAttribute("name", g), b.setAttribute("value", j[g]), n.appendChild(b);
  4325. c.outerHTML = n.outerHTML;
  4326. this.context = document.getElementById("jukebox-flashstream-" + this.id)
  4327. } else {
  4328. c =
  4329. document.createElement("embed");
  4330. c.id = "jukebox-flashstream-" + this.id;
  4331. c.setAttribute("type", "application/x-shockwave-flash");
  4332. c.setAttribute("width", "100");
  4333. c.setAttribute("height", "100");
  4334. j.play = !1;
  4335. j.loop = !1;
  4336. j.src = d + "?x=" + (Date.now ? Date.now() : +new Date);
  4337. for (g in j) c.setAttribute(g, j[g]);
  4338. document.getElementsByTagName("body")[0].appendChild(c);
  4339. this.context = c
  4340. }
  4341. },
  4342. backgroundHackForiOS: function() {
  4343. if (void 0 !== this.backgroundMusic) {
  4344. var b = Date.now ? Date.now() : +new Date;
  4345. void 0 === this.backgroundMusic.started ? (this.backgroundMusic.started =
  4346. b, this.setCurrentTime(this.backgroundMusic.start)) : (this.backgroundMusic.lastPointer = (b - this.backgroundMusic.started) / 1E3 % (this.backgroundMusic.end - this.backgroundMusic.start) + this.backgroundMusic.start, this.play(this.backgroundMusic.lastPointer))
  4347. }
  4348. },
  4349. play: function(b, c) {
  4350. if (null !== this.isPlaying && !0 !== c) void 0 !== jukebox.Manager && jukebox.Manager.addToQueue(b, this.id);
  4351. else {
  4352. var d = this.settings.spritemap,
  4353. g;
  4354. if (void 0 !== d[b]) g = d[b].start;
  4355. else if ("number" === typeof b) {
  4356. g = b;
  4357. for (var j in d)
  4358. if (g >= d[j].start && g <=
  4359. d[j].end) {
  4360. b = j;
  4361. break
  4362. }
  4363. }
  4364. void 0 !== g && "[object Object]" === Object.prototype.toString.call(d[b]) && (this.isPlaying = this.settings.spritemap[b], this.context.play && this.context.play(), this.wasReady = this.setCurrentTime(g))
  4365. }
  4366. },
  4367. stop: function() {
  4368. this.__lastPosition = 0;
  4369. this.isPlaying = null;
  4370. this.backgroundMusic ? this.backgroundHackForiOS() : this.context.pause();
  4371. return !0
  4372. },
  4373. pause: function() {
  4374. this.isPlaying = null;
  4375. this.__lastPosition = this.getCurrentTime();
  4376. this.context.pause();
  4377. return this.__lastPosition
  4378. },
  4379. resume: function(b) {
  4380. b = "number" ===
  4381. typeof b ? b : this.__lastPosition;
  4382. if (null !== b) return this.play(b), this.__lastPosition = null, !0;
  4383. this.context.play();
  4384. return !1
  4385. },
  4386. HTML5API: {
  4387. getVolume: function() {
  4388. return this.context.volume || 1
  4389. },
  4390. setVolume: function(b) {
  4391. this.context.volume = b;
  4392. return 1E-4 > Math.abs(this.context.volume - b) ? !0 : !1
  4393. },
  4394. getCurrentTime: function() {
  4395. return this.context.currentTime || 0
  4396. },
  4397. setCurrentTime: function(b) {
  4398. try {
  4399. return this.context.currentTime = b, !0
  4400. } catch (c) {
  4401. return !1
  4402. }
  4403. }
  4404. },
  4405. FLASHAPI: {
  4406. getVolume: function() {
  4407. return this.context && "function" === typeof this.context.getVolume ?
  4408. this.context.getVolume() : 1
  4409. },
  4410. setVolume: function(b) {
  4411. return this.context && "function" === typeof this.context.setVolume ? (this.context.setVolume(b), !0) : !1
  4412. },
  4413. getCurrentTime: function() {
  4414. return this.context && "function" === typeof this.context.getCurrentTime ? this.context.getCurrentTime() : 0
  4415. },
  4416. setCurrentTime: function(b) {
  4417. return this.context && "function" === typeof this.context.setCurrentTime ? this.context.setCurrentTime(b) : !1
  4418. }
  4419. }
  4420. };
  4421. if (void 0 === this.jukebox) throw "jukebox.Manager requires jukebox.Player (Player.js) to run properly.";
  4422. jukebox.Manager = function(b) {
  4423. this.features = {};
  4424. this.codecs = {};
  4425. this.__players = {};
  4426. this.__playersLength = 0;
  4427. this.__clones = {};
  4428. this.__queue = [];
  4429. this.settings = {};
  4430. for (var c in this.defaults) this.settings[c] = this.defaults[c];
  4431. if ("[object Object]" === Object.prototype.toString.call(b))
  4432. for (var d in b) this.settings[d] = b[d];
  4433. this.__detectFeatures();
  4434. jukebox.Manager.__initialized = !1 === this.settings.useGameLoop ? window.setInterval(function() {
  4435. jukebox.Manager.loop()
  4436. }, 20) : !0
  4437. };
  4438. jukebox.Manager.prototype = {
  4439. defaults: {
  4440. useFlash: !1,
  4441. useGameLoop: !1
  4442. },
  4443. __detectFeatures: function() {
  4444. var b = window.Audio && new Audio;
  4445. if (b && b.canPlayType && !1 === this.settings.useFlash) {
  4446. for (var c = [{
  4447. e: "3gp",
  4448. m: ["audio/3gpp", "audio/amr"]
  4449. }, {
  4450. e: "aac",
  4451. m: ["audio/aac", "audio/aacp"]
  4452. }, {
  4453. e: "amr",
  4454. m: ["audio/amr", "audio/3gpp"]
  4455. }, {
  4456. e: "caf",
  4457. m: ["audio/IMA-ADPCM", "audio/x-adpcm", 'audio/x-aiff; codecs="IMA-ADPCM, ADPCM"']
  4458. }, {
  4459. e: "m4a",
  4460. m: 'audio/mp4{audio/mp4; codecs="mp4a.40.2,avc1.42E01E"{audio/mpeg4{audio/mpeg4-generic{audio/mp4a-latm{audio/MP4A-LATM{audio/x-m4a'.split("{")
  4461. }, {
  4462. e: "mp3",
  4463. m: ["audio/mp3", "audio/mpeg", 'audio/mpeg; codecs="mp3"', "audio/MPA", "audio/mpa-robust"]
  4464. }, {
  4465. e: "mpga",
  4466. m: ["audio/MPA", "audio/mpa-robust", "audio/mpeg", "video/mpeg"]
  4467. }, {
  4468. e: "mp4",
  4469. m: ["audio/mp4", "video/mp4"]
  4470. }, {
  4471. e: "ogg",
  4472. m: ["application/ogg", "audio/ogg", 'audio/ogg; codecs="theora, vorbis"', "video/ogg", 'video/ogg; codecs="theora, vorbis"']
  4473. }, {
  4474. e: "wav",
  4475. m: ["audio/wave", "audio/wav", 'audio/wav; codecs="1"', "audio/x-wav", "audio/x-pn-wav"]
  4476. }, {
  4477. e: "webm",
  4478. m: ["audio/webm", 'audio/webm; codecs="vorbis"', "video/webm"]
  4479. }],
  4480. d, g, j = 0, n = c.length; j < n; j++)
  4481. if (g = c[j].e, c[j].m.length && "object" === typeof c[j].m)
  4482. for (var y = 0, r = c[j].m.length; y < r; y++)
  4483. if (d = c[j].m[y], "" !== b.canPlayType(d)) {
  4484. this.codecs[g] = d;
  4485. break
  4486. } else this.codecs[g] || (this.codecs[g] = !1);
  4487. this.features.html5audio = !(!this.codecs.mp3 && !this.codecs.ogg && !this.codecs.webm && !this.codecs.wav);
  4488. this.features.channels = 8;
  4489. b.volume = 0.1337;
  4490. this.features.volume = !!(1E-4 > Math.abs(b.volume - 0.1337));
  4491. navigator.userAgent.match(/iPhone|iPod|iPad/i) && (this.features.channels = 1)
  4492. }
  4493. this.features.flashaudio = !!navigator.mimeTypes["application/x-shockwave-flash"] || !!navigator.plugins["Shockwave Flash"] || !1;
  4494. if (window.ActiveXObject) try {
  4495. new ActiveXObject("ShockwaveFlash.ShockwaveFlash.10"), this.features.flashaudio = !0
  4496. } catch (z) {}!0 === this.settings.useFlash && (this.features.flashaudio = !0);
  4497. !0 === this.features.flashaudio && !this.features.html5audio && (this.codecs.mp3 = "audio/mp3", this.codecs.mpga = "audio/mpeg", this.codecs.mp4 = "audio/mp4", this.codecs.m4a = "audio/mp4", this.codecs["3gp"] = "audio/3gpp", this.codecs.amr = "audio/amr",
  4498. this.features.volume = !0, this.features.channels = 1)
  4499. },
  4500. __getPlayerById: function(b) {
  4501. return this.__players && void 0 !== this.__players[b] ? this.__players[b] : null
  4502. },
  4503. __getClone: function(b, c) {
  4504. for (var d in this.__clones) {
  4505. var g = this.__clones[d];
  4506. if (null === g.isPlaying && g.origin === b) return g
  4507. }
  4508. if ("[object Object]" === Object.prototype.toString.call(c)) {
  4509. d = {};
  4510. for (var j in c) d[j] = c[j];
  4511. d.autoplay = !1;
  4512. j = new jukebox.Player(d, b);
  4513. j.isClone = !0;
  4514. j.wasReady = !1;
  4515. return this.__clones[j.id] = j
  4516. }
  4517. return null
  4518. },
  4519. loop: function() {
  4520. if (0 !== this.__playersLength)
  4521. if (this.__queue.length &&
  4522. this.__playersLength < this.features.channels) {
  4523. var b = this.__queue[0],
  4524. c = this.__getPlayerById(b.origin);
  4525. if (null !== c) {
  4526. var d = this.__getClone(b.origin, c.settings);
  4527. null !== d && (!0 === this.features.volume && (c = this.__players[b.origin]) && d.setVolume(c.getVolume()), this.add(d), d.play(b.pointer, !0))
  4528. }
  4529. this.__queue.splice(0, 1)
  4530. } else
  4531. for (d in this.__queue.length && 1 === this.features.channels && (b = this.__queue[0], c = this.__getPlayerById(b.origin), null !== c && c.play(b.pointer, !0), this.__queue.splice(0, 1)), this.__players) b = this.__players[d],
  4532. c = b.getCurrentTime() || 0, b.isPlaying && !1 === b.wasReady ? b.wasReady = b.setCurrentTime(b.isPlaying.start) : b.isPlaying && !0 === b.wasReady ? c > b.isPlaying.end && (!0 === b.isPlaying.loop ? b.play(b.isPlaying.start, !0) : b.stop()) : b.isClone && null === b.isPlaying ? this.remove(b) : void 0 !== b.backgroundMusic && null === b.isPlaying && c > b.backgroundMusic.end && b.backgroundHackForiOS()
  4533. },
  4534. getPlayableResource: function(b) {
  4535. "[object Array]" !== Object.prototype.toString.call(b) && (b = [b]);
  4536. for (var c = 0, d = b.length; c < d; c++) {
  4537. var g = b[c],
  4538. j = g.match(/\.([^\.]*)$/)[1];
  4539. if (j && this.codecs[j]) return g
  4540. }
  4541. return null
  4542. },
  4543. add: function(b) {
  4544. return b instanceof jukebox.Player && void 0 === this.__players[b.id] ? (this.__playersLength++, this.__players[b.id] = b, !0) : !1
  4545. },
  4546. remove: function(b) {
  4547. return b instanceof jukebox.Player && void 0 !== this.__players[b.id] ? (this.__playersLength--, delete this.__players[b.id], !0) : !1
  4548. },
  4549. addToQueue: function(b, c) {
  4550. return ("string" === typeof b || "number" === typeof b) && void 0 !== this.__players[c] ? (this.__queue.push({
  4551. pointer: b,
  4552. origin: c
  4553. }), !0) : !1
  4554. }
  4555. };
  4556. (function() {
  4557. var b = {},
  4558. c = null,
  4559. d = !0,
  4560. g = !1;
  4561. if ("undefined" !== typeof AudioContext) c = new AudioContext;
  4562. else if ("undefined" !== typeof webkitAudioContext) c = new webkitAudioContext;
  4563. else if ("undefined" !== typeof Audio) {
  4564. d = !1;
  4565. try {
  4566. new Audio
  4567. } catch (j) {
  4568. g = !0
  4569. }
  4570. } else d = !1, g = !0; if (d) {
  4571. var n = "undefined" === typeof c.createGain ? c.createGainNode() : c.createGain();
  4572. n.gain.value = 1;
  4573. n.connect(c.destination)
  4574. }
  4575. var y = function() {
  4576. this._volume = 1;
  4577. this._muted = !1;
  4578. this.usingWebAudio = d;
  4579. this.noAudio = g;
  4580. this._howls = []
  4581. };
  4582. y.prototype = {
  4583. volume: function(b) {
  4584. b =
  4585. parseFloat(b);
  4586. if (0 <= b && 1 >= b) {
  4587. this._volume = b;
  4588. d && (n.gain.value = b);
  4589. for (var c in this._howls)
  4590. if (this._howls.hasOwnProperty(c) && !1 === this._howls[c]._webAudio)
  4591. for (b = 0; b < this._howls[c]._audioNode.length; b++) this._howls[c]._audioNode[b].volume = this._howls[c]._volume * this._volume;
  4592. return this
  4593. }
  4594. return d ? n.gain.value : this._volume
  4595. },
  4596. mute: function() {
  4597. this._setMuted(!0);
  4598. return this
  4599. },
  4600. unmute: function() {
  4601. this._setMuted(!1);
  4602. return this
  4603. },
  4604. _setMuted: function(b) {
  4605. this._muted = b;
  4606. d && (n.gain.value = b ? 0 : this._volume);
  4607. for (var c in this._howls)
  4608. if (this._howls.hasOwnProperty(c) &&
  4609. !1 === this._howls[c]._webAudio)
  4610. for (var g = 0; g < this._howls[c]._audioNode.length; g++) this._howls[c]._audioNode[g].muted = b
  4611. }
  4612. };
  4613. var r = new y,
  4614. y = null;
  4615. if (!g) var y = new Audio,
  4616. z = {
  4617. mp3: !!y.canPlayType("audio/mpeg;").replace(/^no$/, ""),
  4618. opus: !!y.canPlayType('audio/ogg; codecs="opus"').replace(/^no$/, ""),
  4619. ogg: !!y.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/, ""),
  4620. wav: !!y.canPlayType('audio/wav; codecs="1"').replace(/^no$/, ""),
  4621. m4a: !!(y.canPlayType("audio/x-m4a;") || y.canPlayType("audio/aac;")).replace(/^no$/,
  4622. ""),
  4623. mp4: !!(y.canPlayType("audio/x-mp4;") || y.canPlayType("audio/aac;")).replace(/^no$/, ""),
  4624. weba: !!y.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/, "")
  4625. };
  4626. var A = function(b) {
  4627. this._autoplay = b.autoplay || !1;
  4628. this._buffer = b.buffer || !1;
  4629. this._duration = b.duration || 0;
  4630. this._format = b.format || null;
  4631. this._loop = b.loop || !1;
  4632. this._loaded = !1;
  4633. this._sprite = b.sprite || {};
  4634. this._src = b.src || "";
  4635. this._pos3d = b.pos3d || [0, 0, -0.5];
  4636. this._volume = void 0 !== b.volume ? b.volume : 1;
  4637. this._urls = b.urls || [];
  4638. this._rate = b.rate || 1;
  4639. this._onload = [b.onload || function() {}];
  4640. this._onloaderror = [b.onloaderror || function() {}];
  4641. this._onend = [b.onend || function() {}];
  4642. this._onpause = [b.onpause || function() {}];
  4643. this._onplay = [b.onplay || function() {}];
  4644. this._onendTimer = [];
  4645. this._webAudio = d && !this._buffer;
  4646. this._audioNode = [];
  4647. this._webAudio && this._setupAudioNode();
  4648. r._howls.push(this);
  4649. this.load()
  4650. };
  4651. A.prototype = {
  4652. load: function() {
  4653. var d = this,
  4654. j = null;
  4655. if (!g) {
  4656. for (var t = 0; t < d._urls.length; t++) {
  4657. var n, A;
  4658. if (d._format) n = d._format;
  4659. else if (A = d._urls[t].toLowerCase().split("?")[0], n =
  4660. (n = A.match(/.+\.([^?]+)(\?|$)/)) && 2 <= n.length ? n : A.match(/data\:audio\/([^?]+);/)) n = n[1];
  4661. else {
  4662. d.on("loaderror");
  4663. return
  4664. } if (z[n]) {
  4665. j = d._urls[t];
  4666. break
  4667. }
  4668. }
  4669. if (j) {
  4670. d._src = j;
  4671. if (d._webAudio) {
  4672. var y = j;
  4673. if (y in b) d._duration = b[y].duration, B(d);
  4674. else {
  4675. var E = new XMLHttpRequest;
  4676. E.open("GET", y, !0);
  4677. E.responseType = "arraybuffer";
  4678. E.onload = function() {
  4679. c.decodeAudioData(E.response, function(c) {
  4680. c && (b[y] = c, B(d, c))
  4681. }, function() {
  4682. d.on("loaderror")
  4683. })
  4684. };
  4685. E.onerror = function() {
  4686. d._webAudio && (d._buffer = !0, d._webAudio = !1, d._audioNode = [], delete d._gainNode,
  4687. d.load())
  4688. };
  4689. try {
  4690. E.send()
  4691. } catch (N) {
  4692. E.onerror()
  4693. }
  4694. }
  4695. } else {
  4696. var F = new Audio;
  4697. d._audioNode.push(F);
  4698. F.src = j;
  4699. F._pos = 0;
  4700. F.preload = "auto";
  4701. F.volume = r._muted ? 0 : d._volume * r.volume();
  4702. b[j] = d;
  4703. var K = function() {
  4704. d._duration = Math.ceil(10 * F.duration) / 10;
  4705. 0 === Object.getOwnPropertyNames(d._sprite).length && (d._sprite = {
  4706. _default: [0, 1E3 * d._duration]
  4707. });
  4708. d._loaded || (d._loaded = !0, d.on("load"));
  4709. d._autoplay && d.play();
  4710. F.removeEventListener("canplaythrough", K, !1)
  4711. };
  4712. F.addEventListener("canplaythrough", K, !1);
  4713. F.load()
  4714. }
  4715. return d
  4716. }
  4717. }
  4718. d.on("loaderror")
  4719. },
  4720. urls: function(b) {
  4721. return b ? (this.stop(), this._urls = "string" === typeof b ? [b] : b, this._loaded = !1, this.load(), this) : this._urls
  4722. },
  4723. play: function(d, g) {
  4724. var j = this;
  4725. "function" === typeof d && (g = d);
  4726. if (!d || "function" === typeof d) d = "_default";
  4727. if (!j._loaded) return j.on("load", function() {
  4728. j.play(d, g)
  4729. }), j;
  4730. if (!j._sprite[d]) return "function" === typeof g && g(), j;
  4731. j._inactiveNode(function(n) {
  4732. n._sprite = d;
  4733. var z = 0 < n._pos ? n._pos : j._sprite[d][0] / 1E3,
  4734. A = j._sprite[d][1] / 1E3 - n._pos,
  4735. B = !(!j._loop && !j._sprite[d][2]),
  4736. y = "string" === typeof g ? g :
  4737. Math.round(Date.now() * Math.random()) + "",
  4738. F, K = {
  4739. id: y,
  4740. sprite: d,
  4741. loop: B
  4742. };
  4743. F = setTimeout(function() {
  4744. !j._webAudio && B && j.stop(K.id, K.timer).play(d, K.id);
  4745. j._webAudio && !B && (j._nodeById(K.id).paused = !0, j._nodeById(K.id)._pos = 0);
  4746. !j._webAudio && !B && j.stop(K.id, K.timer);
  4747. j.on("end", y)
  4748. }, 1E3 * A);
  4749. j._onendTimer.push(F);
  4750. K.timer = j._onendTimer[j._onendTimer.length - 1];
  4751. if (j._webAudio) {
  4752. F = j._sprite[d][0] / 1E3;
  4753. var O = j._sprite[d][1] / 1E3;
  4754. n.id = y;
  4755. n.paused = !1;
  4756. F = [B, F, O];
  4757. O = j._nodeById(y);
  4758. O.bufferSource = c.createBufferSource();
  4759. O.bufferSource.buffer =
  4760. b[j._src];
  4761. O.bufferSource.connect(O.panner);
  4762. O.bufferSource.loop = F[0];
  4763. F[0] && (O.bufferSource.loopStart = F[1], O.bufferSource.loopEnd = F[1] + F[2]);
  4764. O.bufferSource.playbackRate.value = j._rate;
  4765. j._playStart = c.currentTime;
  4766. n.gain.value = j._volume;
  4767. "undefined" === typeof n.bufferSource.start ? n.bufferSource.noteGrainOn(0, z, A) : n.bufferSource.start(0, z, A)
  4768. } else if (4 === n.readyState) n.id = y, n.currentTime = z, n.muted = r._muted, n.volume = j._volume * r.volume(), setTimeout(function() {
  4769. n.play()
  4770. }, 0);
  4771. else {
  4772. j._clearEndTimer(F);
  4773. var Aa = d,
  4774. oa =
  4775. g,
  4776. ta = function() {
  4777. j.play(Aa, oa);
  4778. n.removeEventListener("canplaythrough", ta, !1)
  4779. };
  4780. n.addEventListener("canplaythrough", ta, !1);
  4781. return j
  4782. }
  4783. j.on("play");
  4784. "function" === typeof g && g(y);
  4785. return j
  4786. });
  4787. return j
  4788. },
  4789. pause: function(b, c) {
  4790. var d = this;
  4791. if (!d._loaded) return d.on("play", function() {
  4792. d.pause(b)
  4793. }), d;
  4794. d._clearEndTimer(c || 0);
  4795. var g = b ? d._nodeById(b) : d._activeNode();
  4796. if (g)
  4797. if (g._pos = d.pos(null, b), d._webAudio) {
  4798. if (!g.bufferSource || g.paused) return d;
  4799. g.paused = !0;
  4800. "undefined" === typeof g.bufferSource.stop ? g.bufferSource.noteOff(0) :
  4801. g.bufferSource.stop(0)
  4802. } else g.pause();
  4803. d.on("pause");
  4804. return d
  4805. },
  4806. stop: function(b, c) {
  4807. var d = this;
  4808. if (!d._loaded) return d.on("play", function() {
  4809. d.stop(b)
  4810. }), d;
  4811. d._clearEndTimer(c || 0);
  4812. var g = b ? d._nodeById(b) : d._activeNode();
  4813. if (g)
  4814. if (g._pos = 0, d._webAudio) {
  4815. if (!g.bufferSource || g.paused) return d;
  4816. g.paused = !0;
  4817. "undefined" === typeof g.bufferSource.stop ? g.bufferSource.noteOff(0) : g.bufferSource.stop(0)
  4818. } else g.pause(), g.currentTime = 0;
  4819. return d
  4820. },
  4821. mute: function(b) {
  4822. var c = this;
  4823. if (!c._loaded) return c.on("play", function() {
  4824. c.mute(b)
  4825. }),
  4826. c;
  4827. var d = b ? c._nodeById(b) : c._activeNode();
  4828. d && (c._webAudio ? d.gain.value = 0 : d.volume = 0);
  4829. return c
  4830. },
  4831. unmute: function(b) {
  4832. var c = this;
  4833. if (!c._loaded) return c.on("play", function() {
  4834. c.unmute(b)
  4835. }), c;
  4836. var d = b ? c._nodeById(b) : c._activeNode();
  4837. d && (c._webAudio ? d.gain.value = c._volume : d.volume = c._volume);
  4838. return c
  4839. },
  4840. volume: function(b, c) {
  4841. var d = this;
  4842. b = parseFloat(b);
  4843. if (0 <= b && 1 >= b) {
  4844. d._volume = b;
  4845. if (!d._loaded) return d.on("play", function() {
  4846. d.volume(b, c)
  4847. }), d;
  4848. var g = c ? d._nodeById(c) : d._activeNode();
  4849. g && (d._webAudio ? g.gain.value = b : g.volume =
  4850. b * r.volume());
  4851. return d
  4852. }
  4853. return d._volume
  4854. },
  4855. loop: function(b) {
  4856. return "boolean" === typeof b ? (this._loop = b, this) : this._loop
  4857. },
  4858. sprite: function(b) {
  4859. return "object" === typeof b ? (this._sprite = b, this) : this._sprite
  4860. },
  4861. pos: function(b, d) {
  4862. var g = this;
  4863. if (!g._loaded) return g.on("load", function() {
  4864. g.pos(b)
  4865. }), "number" === typeof b ? g : g._pos || 0;
  4866. b = parseFloat(b);
  4867. var j = d ? g._nodeById(d) : g._activeNode();
  4868. if (j) return 0 <= b ? (g.pause(d), j._pos = b, g.play(j._sprite, d), g) : g._webAudio ? j._pos + (c.currentTime - g._playStart) : j.currentTime;
  4869. if (0 <= b) return g;
  4870. for (j = 0; j < g._audioNode.length; j++)
  4871. if (g._audioNode[j].paused && 4 === g._audioNode[j].readyState) return g._webAudio ? g._audioNode[j]._pos : g._audioNode[j].currentTime
  4872. },
  4873. pos3d: function(b, c, d, g) {
  4874. var j = this;
  4875. c = "undefined" === typeof c || !c ? 0 : c;
  4876. d = "undefined" === typeof d || !d ? -0.5 : d;
  4877. if (!j._loaded) return j.on("play", function() {
  4878. j.pos3d(b, c, d, g)
  4879. }), j;
  4880. if (0 <= b || 0 > b) {
  4881. if (j._webAudio) {
  4882. var r = g ? j._nodeById(g) : j._activeNode();
  4883. r && (j._pos3d = [b, c, d], r.panner.setPosition(b, c, d))
  4884. }
  4885. } else return j._pos3d;
  4886. return j
  4887. },
  4888. fade: function(b, c, d,
  4889. g, j) {
  4890. var r = this,
  4891. n = Math.abs(b - c),
  4892. z = b > c ? "down" : "up",
  4893. n = n / 0.01,
  4894. A = d / n;
  4895. if (!r._loaded) return r.on("load", function() {
  4896. r.fade(b, c, d, g, j)
  4897. }), r;
  4898. r.volume(b, j);
  4899. for (var B = 1; B <= n; B++)(function() {
  4900. var b = Math.round(1E3 * (r._volume + ("up" === z ? 0.01 : -0.01) * B)) / 1E3;
  4901. setTimeout(function() {
  4902. r.volume(b, j);
  4903. b === c && g && g()
  4904. }, A * B)
  4905. })()
  4906. },
  4907. fadeIn: function(b, c, d) {
  4908. return this.volume(0).play().fade(0, b, c, d)
  4909. },
  4910. fadeOut: function(b, c, d, g) {
  4911. var j = this;
  4912. return j.fade(j._volume, b, c, function() {
  4913. d && d();
  4914. j.pause(g);
  4915. j.on("end")
  4916. }, g)
  4917. },
  4918. _nodeById: function(b) {
  4919. for (var c =
  4920. this._audioNode[0], d = 0; d < this._audioNode.length; d++)
  4921. if (this._audioNode[d].id === b) {
  4922. c = this._audioNode[d];
  4923. break
  4924. }
  4925. return c
  4926. },
  4927. _activeNode: function() {
  4928. for (var b = null, c = 0; c < this._audioNode.length; c++)
  4929. if (!this._audioNode[c].paused) {
  4930. b = this._audioNode[c];
  4931. break
  4932. }
  4933. this._drainPool();
  4934. return b
  4935. },
  4936. _inactiveNode: function(b) {
  4937. for (var c = null, d = 0; d < this._audioNode.length; d++)
  4938. if (this._audioNode[d].paused && 4 === this._audioNode[d].readyState) {
  4939. b(this._audioNode[d]);
  4940. c = !0;
  4941. break
  4942. }
  4943. this._drainPool();
  4944. if (!c) {
  4945. var g;
  4946. this._webAudio ? (g = this._setupAudioNode(),
  4947. b(g)) : (this.load(), g = this._audioNode[this._audioNode.length - 1], g.addEventListener("loadedmetadata", function() {
  4948. b(g)
  4949. }))
  4950. }
  4951. },
  4952. _drainPool: function() {
  4953. var b = 0,
  4954. c;
  4955. for (c = 0; c < this._audioNode.length; c++) this._audioNode[c].paused && b++;
  4956. for (c = this._audioNode.length - 1; 0 <= c && !(5 >= b); c--) this._audioNode[c].paused && (this._webAudio && this._audioNode[c].disconnect(0), b--, this._audioNode.splice(c, 1))
  4957. },
  4958. _clearEndTimer: function(b) {
  4959. b = this._onendTimer.indexOf(b);
  4960. b = 0 <= b ? b : 0;
  4961. this._onendTimer[b] && (clearTimeout(this._onendTimer[b]),
  4962. this._onendTimer.splice(b, 1))
  4963. },
  4964. _setupAudioNode: function() {
  4965. var b = this._audioNode,
  4966. d = this._audioNode.length;
  4967. b[d] = "undefined" === typeof c.createGain ? c.createGainNode() : c.createGain();
  4968. b[d].gain.value = this._volume;
  4969. b[d].paused = !0;
  4970. b[d]._pos = 0;
  4971. b[d].readyState = 4;
  4972. b[d].connect(n);
  4973. b[d].panner = c.createPanner();
  4974. b[d].panner.setPosition(this._pos3d[0], this._pos3d[1], this._pos3d[2]);
  4975. b[d].panner.connect(b[d]);
  4976. return b[d]
  4977. },
  4978. on: function(b, c) {
  4979. var d = this["_on" + b];
  4980. if ("function" === typeof c) d.push(c);
  4981. else
  4982. for (var g = 0; g < d.length; g++) c ?
  4983. d[g].call(this, c) : d[g].call(this);
  4984. return this
  4985. },
  4986. off: function(b, c) {
  4987. for (var d = this["_on" + b], g = c.toString(), j = 0; j < d.length; j++)
  4988. if (g === d[j].toString()) {
  4989. d.splice(j, 1);
  4990. break
  4991. }
  4992. return this
  4993. },
  4994. unload: function() {
  4995. for (var c = this._audioNode, d = 0; d < this._audioNode.length; d++) c[d].paused || this.stop(c[d].id), this._webAudio ? c[d].disconnect(0) : c[d].src = "";
  4996. c = r._howls.indexOf(this);
  4997. null !== c && 0 <= c && r._howls.splice(c, 1);
  4998. delete b[this._src]
  4999. }
  5000. };
  5001. if (d) var B = function(b, c) {
  5002. b._duration = c ? c.duration : b._duration;
  5003. 0 === Object.getOwnPropertyNames(b._sprite).length &&
  5004. (b._sprite = {
  5005. _default: [0, 1E3 * b._duration]
  5006. });
  5007. b._loaded || (b._loaded = !0, b.on("load"));
  5008. b._autoplay && b.play()
  5009. };
  5010. "function" === typeof define && define.amd && define(function() {
  5011. return {
  5012. Howler: r,
  5013. Howl: A
  5014. }
  5015. });
  5016. "undefined" !== typeof exports && (exports.Howler = r, exports.Howl = A);
  5017. window.Howler = r;
  5018. window.Howl = A
  5019. })();
  5020. (function(b) {
  5021. Number.prototype.map = function(b, c, d, g) {
  5022. return d + (g - d) * ((this - b) / (c - b))
  5023. };
  5024. Number.prototype.limit = function(b, c) {
  5025. return Math.min(c, Math.max(b, this))
  5026. };
  5027. Number.prototype.round = function(b) {
  5028. b = Math.pow(10, b || 0);
  5029. return Math.round(this * b) / b
  5030. };
  5031. Number.prototype.floor = function() {
  5032. return Math.floor(this)
  5033. };
  5034. Number.prototype.ceil = function() {
  5035. return Math.ceil(this)
  5036. };
  5037. Number.prototype.toInt = function() {
  5038. return this | 0
  5039. };
  5040. Number.prototype.toRad = function() {
  5041. return this / 180 * Math.PI
  5042. };
  5043. Number.prototype.toDeg = function() {
  5044. return 180 *
  5045. this / Math.PI
  5046. };
  5047. Array.prototype.erase = function(b) {
  5048. for (var c = this.length; c--;) this[c] === b && this.splice(c, 1);
  5049. return this
  5050. };
  5051. Array.prototype.random = function() {
  5052. return this[Math.floor(Math.random() * this.length)]
  5053. };
  5054. Function.prototype.bind = Function.prototype.bind || function(b) {
  5055. if ("function" !== typeof this) throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");
  5056. var c = Array.prototype.slice.call(arguments, 1),
  5057. d = this,
  5058. g = function() {},
  5059. j = function() {
  5060. return d.apply(this instanceof g && b ?
  5061. this : b, c.concat(Array.prototype.slice.call(arguments)))
  5062. };
  5063. g.prototype = this.prototype;
  5064. j.prototype = new g;
  5065. return j
  5066. };
  5067. b.ig = {
  5068. game: null,
  5069. debug: null,
  5070. version: "1.23",
  5071. global: b,
  5072. modules: {},
  5073. resources: [],
  5074. ready: !1,
  5075. baked: !1,
  5076. nocache: "",
  5077. ua: {},
  5078. prefix: b.ImpactPrefix || "",
  5079. lib: "lib/",
  5080. _current: null,
  5081. _loadQueue: [],
  5082. _waitForOnload: 0,
  5083. $: function(b) {
  5084. return "#" == b.charAt(0) ? document.getElementById(b.substr(1)) : document.getElementsByTagName(b)
  5085. },
  5086. $new: function(b) {
  5087. return document.createElement(b)
  5088. },
  5089. copy: function(b) {
  5090. if (!b || "object" != typeof b ||
  5091. b instanceof HTMLElement || b instanceof ig.Class) return b;
  5092. if (b instanceof Array)
  5093. for (var c = [], d = 0, g = b.length; d < g; d++) c[d] = ig.copy(b[d]);
  5094. else
  5095. for (d in c = {}, b) c[d] = ig.copy(b[d]);
  5096. return c
  5097. },
  5098. merge: function(b, c) {
  5099. for (var d in c) {
  5100. var g = c[d];
  5101. if ("object" != typeof g || g instanceof HTMLElement || g instanceof ig.Class || null === g) b[d] = g;
  5102. else {
  5103. if (!b[d] || "object" != typeof b[d]) b[d] = g instanceof Array ? [] : {};
  5104. ig.merge(b[d], g)
  5105. }
  5106. }
  5107. return b
  5108. },
  5109. ksort: function(b) {
  5110. if (!b || "object" != typeof b) return [];
  5111. var c = [],
  5112. d = [],
  5113. g;
  5114. for (g in b) c.push(g);
  5115. c.sort();
  5116. for (g = 0; g < c.length; g++) d.push(b[c[g]]);
  5117. return d
  5118. },
  5119. setVendorAttribute: function(b, c, d) {
  5120. var g = c.charAt(0).toUpperCase() + c.substr(1);
  5121. b[c] = "undefined" !== typeof b.imageSmoothingEnabled ? b["ms" + g] = b["moz" + g] = b["o" + g] = d : b["ms" + g] = b["moz" + g] = b["webkit" + g] = b["o" + g] = d
  5122. },
  5123. getVendorAttribute: function(b, c) {
  5124. var d = c.charAt(0).toUpperCase() + c.substr(1);
  5125. return "undefined" !== typeof b.imageSmoothingEnabled ? b[c] || b["ms" + d] || b["moz" + d] || b["o" + d] : b[c] || b["ms" + d] || b["moz" + d] || b["webkit" + d] || b["o" + d]
  5126. },
  5127. normalizeVendorAttribute: function(b,
  5128. c) {
  5129. var d = ig.getVendorAttribute(b, c);
  5130. !b[c] && d && (b[c] = d)
  5131. },
  5132. getImagePixels: function(b, c, d, g, j) {
  5133. var p = ig.$new("canvas");
  5134. p.width = b.width;
  5135. p.height = b.height;
  5136. var n = p.getContext("2d");
  5137. ig.System.SCALE.CRISP(p, n);
  5138. var x = ig.getVendorAttribute(n, "backingStorePixelRatio") || 1;
  5139. ig.normalizeVendorAttribute(n, "getImageDataHD");
  5140. var y = b.width / x,
  5141. H = b.height / x;
  5142. p.width = Math.ceil(y);
  5143. p.height = Math.ceil(H);
  5144. n.drawImage(b, 0, 0, y, H);
  5145. return 1 === x ? n.getImageData(c, d, g, j) : n.getImageDataHD(c, d, g, j)
  5146. },
  5147. module: function(b) {
  5148. if (ig._current) throw "Module '" +
  5149. ig._current.name + "' defines nothing";
  5150. if (ig.modules[b] && ig.modules[b].body) throw "Module '" + b + "' is already defined";
  5151. ig._current = {
  5152. name: b,
  5153. requires: [],
  5154. loaded: !1,
  5155. body: null
  5156. };
  5157. ig.modules[b] = ig._current;
  5158. ig._loadQueue.push(ig._current);
  5159. return ig
  5160. },
  5161. requires: function() {
  5162. ig._current.requires = Array.prototype.slice.call(arguments);
  5163. return ig
  5164. },
  5165. defines: function(b) {
  5166. ig._current.body = b;
  5167. ig._current = null;
  5168. ig._initDOMReady()
  5169. },
  5170. addResource: function(b) {
  5171. ig.resources.push(b)
  5172. },
  5173. setNocache: function(b) {
  5174. ig.nocache = b ? "?" + Date.now() : ""
  5175. },
  5176. log: function() {},
  5177. assert: function() {},
  5178. show: function() {},
  5179. mark: function() {},
  5180. _loadScript: function(b, c) {
  5181. ig.modules[b] = {
  5182. name: b,
  5183. requires: [],
  5184. loaded: !1,
  5185. body: null
  5186. };
  5187. ig._waitForOnload++;
  5188. var d = ig.prefix + ig.lib + b.replace(/\./g, "/") + ".js" + ig.nocache,
  5189. g = ig.$new("script");
  5190. g.type = "text/javascript";
  5191. g.src = d;
  5192. g.onload = function() {
  5193. ig._waitForOnload--;
  5194. ig._execModules()
  5195. };
  5196. g.onerror = function() {
  5197. throw "Failed to load module " + b + " at " + d + " required from " + c;
  5198. };
  5199. ig.$("head")[0].appendChild(g)
  5200. },
  5201. _execModules: function() {
  5202. for (var b = !1, c =
  5203. 0; c < ig._loadQueue.length; c++) {
  5204. for (var d = ig._loadQueue[c], g = !0, j = 0; j < d.requires.length; j++) {
  5205. var n = d.requires[j];
  5206. ig.modules[n] ? ig.modules[n].loaded || (g = !1) : (g = !1, ig._loadScript(n, d.name))
  5207. }
  5208. g && d.body && (ig._loadQueue.splice(c, 1), d.loaded = !0, d.body(), b = !0, c--)
  5209. }
  5210. if (b) ig._execModules();
  5211. else if (!ig.baked && 0 == ig._waitForOnload && 0 != ig._loadQueue.length) {
  5212. b = [];
  5213. for (c = 0; c < ig._loadQueue.length; c++) {
  5214. g = [];
  5215. n = ig._loadQueue[c].requires;
  5216. for (j = 0; j < n.length; j++) d = ig.modules[n[j]], (!d || !d.loaded) && g.push(n[j]);
  5217. b.push(ig._loadQueue[c].name +
  5218. " (requires: " + g.join(", ") + ")")
  5219. }
  5220. throw "Unresolved (or circular?) dependencies. Most likely there's a name/path mismatch for one of the listed modules or a previous syntax error prevents a module from loading:\n" + b.join("\n");
  5221. }
  5222. },
  5223. _DOMReady: function() {
  5224. if (!ig.modules["dom.ready"].loaded) {
  5225. if (!document.body) return setTimeout(ig._DOMReady, 13);
  5226. ig.modules["dom.ready"].loaded = !0;
  5227. ig._waitForOnload--;
  5228. ig._execModules()
  5229. }
  5230. return 0
  5231. },
  5232. _boot: function() {
  5233. document.location.href.match(/\?nocache/) && ig.setNocache(!0);
  5234. ig.ua.pixelRatio =
  5235. b.devicePixelRatio || 1;
  5236. ig.ua.viewport = {
  5237. width: b.innerWidth,
  5238. height: b.innerHeight
  5239. };
  5240. ig.ua.screen = {
  5241. width: b.screen.availWidth * ig.ua.pixelRatio,
  5242. height: b.screen.availHeight * ig.ua.pixelRatio
  5243. };
  5244. ig.ua.iPhone = /iPhone/i.test(navigator.userAgent);
  5245. ig.ua.iPhone4 = ig.ua.iPhone && 2 == ig.ua.pixelRatio;
  5246. ig.ua.iPad = /iPad/i.test(navigator.userAgent);
  5247. ig.ua.android = /android/i.test(navigator.userAgent);
  5248. ig.ua.winPhone = /Windows Phone/i.test(navigator.userAgent);
  5249. ig.ua.is_uiwebview = /(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/i.test(navigator.userAgent);
  5250. ig.ua.is_safari_or_uiwebview = /(iPhone|iPod|iPad).*AppleWebKit/i.test(navigator.userAgent);
  5251. ig.ua.iOS = ig.ua.iPhone || ig.ua.iPad;
  5252. ig.ua.iOS6_tag = /OS 6_/i.test(navigator.userAgent);
  5253. ig.ua.iOS6 = (ig.ua.iPhone || ig.ua.iPad) && ig.ua.iOS6_tag;
  5254. ig.ua.iOSgt5 = ig.ua.iOS && 5 < parseInt(navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/)[1]);
  5255. ig.ua.HTCONE = /HTC_One/i.test(navigator.userAgent);
  5256. ig.ua.winPhone = /Windows Phone/i.test(navigator.userAgent);
  5257. ig.ua.Kindle = /Silk/i.test(navigator.userAgent);
  5258. ig.ua.touchDevice = "ontouchstart" in
  5259. b || b.navigator.msMaxTouchPoints;
  5260. ig.ua.mobile = ig.ua.iOS || ig.ua.android || ig.ua.iOS6 || ig.ua.winPhone || ig.ua.Kindle || /mobile/i.test(navigator.userAgent)
  5261. },
  5262. _initDOMReady: function() {
  5263. ig.modules["dom.ready"] ? ig._execModules() : (ig._boot(), ig.modules["dom.ready"] = {
  5264. requires: [],
  5265. loaded: !1,
  5266. body: null
  5267. }, ig._waitForOnload++, "complete" === document.readyState ? ig._DOMReady() : (document.addEventListener("DOMContentLoaded", ig._DOMReady, !1), b.addEventListener("load", ig._DOMReady, !1)))
  5268. }
  5269. };
  5270. ig.normalizeVendorAttribute(b, "requestAnimationFrame");
  5271. if (b.requestAnimationFrame) {
  5272. var c = 1,
  5273. d = {};
  5274. b.ig.setAnimation = function(g, j) {
  5275. var n = c++;
  5276. d[n] = !0;
  5277. var y = function() {
  5278. d[n] && (b.requestAnimationFrame(y, j), g())
  5279. };
  5280. b.requestAnimationFrame(y, j);
  5281. return n
  5282. };
  5283. b.ig.clearAnimation = function(b) {
  5284. delete d[b]
  5285. }
  5286. } else b.ig.setAnimation = function(c) {
  5287. return b.setInterval(c, 1E3 / 60)
  5288. }, b.ig.clearAnimation = function(c) {
  5289. b.clearInterval(c)
  5290. };
  5291. var g = !1,
  5292. j = /xyz/.test(function() {
  5293. xyz
  5294. }) ? /\bparent\b/ : /.*/,
  5295. n = 0;
  5296. b.ig.Class = function() {};
  5297. var y = function(b) {
  5298. var c = this.prototype,
  5299. d = {},
  5300. g;
  5301. for (g in b) "function" ==
  5302. typeof b[g] && "function" == typeof c[g] && j.test(b[g]) ? (d[g] = c[g], c[g] = function(b, c) {
  5303. return function() {
  5304. var g = this.parent;
  5305. this.parent = d[b];
  5306. var j = c.apply(this, arguments);
  5307. this.parent = g;
  5308. return j
  5309. }
  5310. }(g, b[g])) : c[g] = b[g]
  5311. };
  5312. b.ig.Class.extend = function(c) {
  5313. function d() {
  5314. if (!g) {
  5315. if (this.staticInstantiate) {
  5316. var b = this.staticInstantiate.apply(this, arguments);
  5317. if (b) return b
  5318. }
  5319. for (var c in this) "object" == typeof this[c] && (this[c] = ig.copy(this[c]));
  5320. this.init && this.init.apply(this, arguments)
  5321. }
  5322. return this
  5323. }
  5324. var A = this.prototype;
  5325. g = !0;
  5326. var B = new this;
  5327. g = !1;
  5328. for (var l in c) B[l] = "function" == typeof c[l] && "function" == typeof A[l] && j.test(c[l]) ? function(b, c) {
  5329. return function() {
  5330. var d = this.parent;
  5331. this.parent = A[b];
  5332. var g = c.apply(this, arguments);
  5333. this.parent = d;
  5334. return g
  5335. }
  5336. }(l, c[l]) : c[l];
  5337. d.prototype = B;
  5338. d.prototype.constructor = d;
  5339. d.extend = b.ig.Class.extend;
  5340. d.inject = y;
  5341. d.classId = B.classId = ++n;
  5342. return d
  5343. };
  5344. b.ImpactMixin && ig.merge(ig, b.ImpactMixin)
  5345. })(window);
  5346. ig.baked = !0;
  5347. ig.module("impact.image").defines(function() {
  5348. ig.Image = ig.Class.extend({
  5349. data: null,
  5350. width: 0,
  5351. height: 0,
  5352. loaded: !1,
  5353. failed: !1,
  5354. loadCallback: null,
  5355. path: "",
  5356. staticInstantiate: function(b) {
  5357. return ig.Image.cache[b] || null
  5358. },
  5359. init: function(b) {
  5360. this.path = b;
  5361. this.load()
  5362. },
  5363. load: function(b) {
  5364. this.loaded ? b && b(this.path, !0) : (!this.loaded && ig.ready ? (this.loadCallback = b || null, this.data = new Image, this.data.onload = this.onload.bind(this), this.data.onerror = this.onerror.bind(this), this.data.src = ig.prefix + this.path + ig.nocache) : ig.addResource(this),
  5365. ig.Image.cache[this.path] = this)
  5366. },
  5367. reload: function() {
  5368. this.loaded = !1;
  5369. this.data = new Image;
  5370. this.data.onload = this.onload.bind(this);
  5371. this.data.src = this.path + "?" + Date.now()
  5372. },
  5373. onload: function() {
  5374. this.width = this.data.width;
  5375. this.height = this.data.height;
  5376. this.loaded = !0;
  5377. 1 != ig.system.scale && this.resize(ig.system.scale);
  5378. this.loadCallback && this.loadCallback(this.path, !0)
  5379. },
  5380. onerror: function() {
  5381. this.failed = !0;
  5382. this.loadCallback && this.loadCallback(this.path, !1)
  5383. },
  5384. resize: function(b) {
  5385. var c = ig.getImagePixels(this.data, 0, 0, this.width,
  5386. this.height),
  5387. d = this.width * b,
  5388. g = this.height * b,
  5389. j = ig.$new("canvas");
  5390. j.width = d;
  5391. j.height = g;
  5392. for (var n = j.getContext("2d"), y = n.getImageData(0, 0, d, g), r = 0; r < g; r++)
  5393. for (var z = 0; z < d; z++) {
  5394. var A = 4 * (Math.floor(r / b) * this.width + Math.floor(z / b)),
  5395. B = 4 * (r * d + z);
  5396. y.data[B] = c.data[A];
  5397. y.data[B + 1] = c.data[A + 1];
  5398. y.data[B + 2] = c.data[A + 2];
  5399. y.data[B + 3] = c.data[A + 3]
  5400. }
  5401. n.putImageData(y, 0, 0);
  5402. this.data = j
  5403. },
  5404. draw: function(b, c, d, g, j, n) {
  5405. if (this.loaded) {
  5406. var y = ig.system.scale;
  5407. j = (j ? j : this.width) * y;
  5408. n = (n ? n : this.height) * y;
  5409. ig.system.context.drawImage(this.data,
  5410. d ? d * y : 0, g ? g * y : 0, j, n, ig.system.getDrawPos(b), ig.system.getDrawPos(c), j, n);
  5411. ig.Image.drawCount++
  5412. }
  5413. },
  5414. drawTile: function(b, c, d, g, j, n, y) {
  5415. j = j ? j : g;
  5416. if (this.loaded && !(g > this.width || j > this.height)) {
  5417. var r = ig.system.scale,
  5418. z = Math.floor(g * r),
  5419. A = Math.floor(j * r),
  5420. B = n ? -1 : 1,
  5421. l = y ? -1 : 1;
  5422. if (n || y) ig.system.context.save(), ig.system.context.scale(B, l);
  5423. ig.system.context.drawImage(this.data, Math.floor(d * g) % this.width * r, Math.floor(d * g / this.width) * j * r, z, A, ig.system.getDrawPos(b) * B - (n ? z : 0), ig.system.getDrawPos(c) * l - (y ? A : 0), z, A);
  5424. (n ||
  5425. y) && ig.system.context.restore();
  5426. ig.Image.drawCount++
  5427. }
  5428. }
  5429. });
  5430. ig.Image.drawCount = 0;
  5431. ig.Image.cache = {};
  5432. ig.Image.reloadCache = function() {
  5433. for (var b in ig.Image.cache) ig.Image.cache[b].reload()
  5434. }
  5435. });
  5436. ig.baked = !0;
  5437. ig.module("impact.font").requires("impact.image").defines(function() {
  5438. ig.Font = ig.Image.extend({
  5439. widthMap: [],
  5440. indices: [],
  5441. firstChar: 32,
  5442. alpha: 1,
  5443. letterSpacing: 1,
  5444. lineSpacing: 0,
  5445. onload: function(b) {
  5446. this._loadMetrics(this.data);
  5447. this.parent(b)
  5448. },
  5449. widthForString: function(b) {
  5450. if (-1 !== b.indexOf("\n")) {
  5451. b = b.split("\n");
  5452. for (var c = 0, d = 0; d < b.length; d++) c = Math.max(c, this._widthForLine(b[d]));
  5453. return c
  5454. }
  5455. return this._widthForLine(b)
  5456. },
  5457. _widthForLine: function(b) {
  5458. for (var c = 0, d = 0; d < b.length; d++) c += this.widthMap[b.charCodeAt(d) - this.firstChar] +
  5459. this.letterSpacing;
  5460. return c
  5461. },
  5462. heightForString: function(b) {
  5463. return b.split("\n").length * (this.height + this.lineSpacing)
  5464. },
  5465. draw: function(b, c, d, g) {
  5466. "string" != typeof b && (b = b.toString());
  5467. if (-1 !== b.indexOf("\n")) {
  5468. b = b.split("\n");
  5469. for (var j = this.height + this.lineSpacing, n = 0; n < b.length; n++) this.draw(b[n], c, d + n * j, g)
  5470. } else {
  5471. if (g == ig.Font.ALIGN.RIGHT || g == ig.Font.ALIGN.CENTER) n = this._widthForLine(b), c -= g == ig.Font.ALIGN.CENTER ? n / 2 : n;
  5472. 1 !== this.alpha && (ig.system.context.globalAlpha = this.alpha);
  5473. for (n = 0; n < b.length; n++) g = b.charCodeAt(n),
  5474. c += this._drawChar(g - this.firstChar, c, d);
  5475. 1 !== this.alpha && (ig.system.context.globalAlpha = 1);
  5476. ig.Image.drawCount += b.length
  5477. }
  5478. },
  5479. _drawChar: function(b, c, d) {
  5480. if (!this.loaded || 0 > b || b >= this.indices.length) return 0;
  5481. var g = ig.system.scale,
  5482. j = this.widthMap[b] * g,
  5483. n = (this.height - 2) * g;
  5484. ig.system.context.drawImage(this.data, this.indices[b] * g, 0, j, n, ig.system.getDrawPos(c), ig.system.getDrawPos(d), j, n);
  5485. return this.widthMap[b] + this.letterSpacing
  5486. },
  5487. _loadMetrics: function(b) {
  5488. this.height = b.height - 1;
  5489. this.widthMap = [];
  5490. this.indices = [];
  5491. for (var c = ig.getImagePixels(b, 0, b.height - 1, b.width, 1), d = 0, g = 0, j = 0; j < b.width; j++) {
  5492. var n = 4 * j + 3;
  5493. 127 < c.data[n] ? g++ : 128 > c.data[n] && g && (this.widthMap.push(g), this.indices.push(j - g), d++, g = 0)
  5494. }
  5495. this.widthMap.push(g);
  5496. this.indices.push(j - g)
  5497. }
  5498. });
  5499. ig.Font.ALIGN = {
  5500. LEFT: 0,
  5501. RIGHT: 1,
  5502. CENTER: 2
  5503. }
  5504. });
  5505. ig.baked = !0;
  5506. ig.module("impact.sound").defines(function() {
  5507. ig.SoundManager = ig.Class.extend({
  5508. clips: {},
  5509. volume: 1,
  5510. format: null,
  5511. init: function() {
  5512. if (!ig.Sound.enabled || !window.Audio) ig.Sound.enabled = !1;
  5513. else {
  5514. for (var b = new Audio, c = 0; c < ig.Sound.use.length; c++) {
  5515. var d = ig.Sound.use[c];
  5516. if (b.canPlayType(d.mime)) {
  5517. this.format = d;
  5518. break
  5519. }
  5520. }
  5521. this.format || (ig.Sound.enabled = !1)
  5522. }
  5523. },
  5524. load: function(b, c, d) {
  5525. var g = ig.prefix + b.replace(/[^\.]+$/, this.format.ext) + ig.nocache;
  5526. if (this.clips[b]) {
  5527. if (c && this.clips[b].length < ig.Sound.channels)
  5528. for (c = this.clips[b].length; c <
  5529. ig.Sound.channels; c++) {
  5530. var j = new Audio(g);
  5531. j.load();
  5532. this.clips[b].push(j)
  5533. }
  5534. return this.clips[b][0]
  5535. }
  5536. var n = new Audio(g);
  5537. d && (n.addEventListener("canplaythrough", function r(c) {
  5538. n.removeEventListener("canplaythrough", r, !1);
  5539. d(b, !0, c)
  5540. }, !1), n.addEventListener("error", function(c) {
  5541. d(b, !1, c)
  5542. }, !1));
  5543. n.preload = "auto";
  5544. n.load();
  5545. this.clips[b] = [n];
  5546. if (c)
  5547. for (c = 1; c < ig.Sound.channels; c++) j = new Audio(g), j.load(), this.clips[b].push(j);
  5548. return n
  5549. },
  5550. get: function(b) {
  5551. b = this.clips[b];
  5552. for (var c = 0, d; d = b[c++];)
  5553. if (d.paused || d.ended) return d.ended &&
  5554. (d.currentTime = 0), d;
  5555. b[0].pause();
  5556. b[0].currentTime = 0;
  5557. return b[0]
  5558. }
  5559. });
  5560. ig.Music = ig.Class.extend({
  5561. tracks: [],
  5562. namedTracks: {},
  5563. currentTrack: null,
  5564. currentIndex: 0,
  5565. random: !1,
  5566. _volume: 1,
  5567. _loop: !1,
  5568. _fadeInterval: 0,
  5569. _fadeTimer: null,
  5570. _endedCallbackBound: null,
  5571. init: function() {
  5572. this._endedCallbackBound = this._endedCallback.bind(this);
  5573. Object.defineProperty ? (Object.defineProperty(this, "volume", {
  5574. get: this.getVolume.bind(this),
  5575. set: this.setVolume.bind(this)
  5576. }), Object.defineProperty(this, "loop", {
  5577. get: this.getLooping.bind(this),
  5578. set: this.setLooping.bind(this)
  5579. })) :
  5580. this.__defineGetter__ && (this.__defineGetter__("volume", this.getVolume.bind(this)), this.__defineSetter__("volume", this.setVolume.bind(this)), this.__defineGetter__("loop", this.getLooping.bind(this)), this.__defineSetter__("loop", this.setLooping.bind(this)))
  5581. },
  5582. add: function(b, c) {
  5583. if (ig.Sound.enabled) {
  5584. var d = ig.soundManager.load(b instanceof ig.Sound ? b.path : b, !1);
  5585. d.loop = this._loop;
  5586. d.volume = this._volume;
  5587. d.addEventListener("ended", this._endedCallbackBound, !1);
  5588. this.tracks.push(d);
  5589. c && (this.namedTracks[c] = d);
  5590. this.currentTrack ||
  5591. (this.currentTrack = d)
  5592. }
  5593. },
  5594. next: function() {
  5595. this.tracks.length && (this.stop(), this.currentIndex = this.random ? Math.floor(Math.random() * this.tracks.length) : (this.currentIndex + 1) % this.tracks.length, this.currentTrack = this.tracks[this.currentIndex], this.play())
  5596. },
  5597. pause: function() {
  5598. this.currentTrack && this.currentTrack.pause()
  5599. },
  5600. stop: function() {
  5601. this.currentTrack && (this.currentTrack.pause(), this.currentTrack.currentTime = 0)
  5602. },
  5603. play: function(b) {
  5604. if (b && this.namedTracks[b]) b = this.namedTracks[b], b != this.currentTrack && (this.stop(),
  5605. this.currentTrack = b);
  5606. else if (!this.currentTrack) return;
  5607. this.currentTrack.play()
  5608. },
  5609. getLooping: function() {
  5610. return this._loop
  5611. },
  5612. setLooping: function(b) {
  5613. this._loop = b;
  5614. for (var c in this.tracks) this.tracks[c].loop = b
  5615. },
  5616. getVolume: function() {
  5617. return this._volume
  5618. },
  5619. setVolume: function(b) {
  5620. this._volume = b.limit(0, 1);
  5621. for (var c in this.tracks) this.tracks[c].volume = this._volume
  5622. },
  5623. fadeOut: function(b) {
  5624. this.currentTrack && (clearInterval(this._fadeInterval), this.fadeTimer = new ig.Timer(b), this._fadeInterval = setInterval(this._fadeStep.bind(this),
  5625. 50))
  5626. },
  5627. _fadeStep: function() {
  5628. var b = this.fadeTimer.delta().map(-this.fadeTimer.target, 0, 1, 0).limit(0, 1) * this._volume;
  5629. 0.01 >= b ? (this.stop(), this.currentTrack.volume = this._volume, clearInterval(this._fadeInterval)) : this.currentTrack.volume = b
  5630. },
  5631. _endedCallback: function() {
  5632. this._loop ? this.play() : this.next()
  5633. }
  5634. });
  5635. ig.Sound = ig.Class.extend({
  5636. path: "",
  5637. volume: 1,
  5638. currentClip: null,
  5639. multiChannel: !0,
  5640. init: function(b, c) {
  5641. this.path = b;
  5642. this.multiChannel = !1 !== c;
  5643. this.load()
  5644. },
  5645. load: function(b) {
  5646. ig.Sound.enabled ? ig.ready ? ig.soundManager.load(this.path,
  5647. this.multiChannel, b) : ig.addResource(this) : b && b(this.path, !0)
  5648. },
  5649. play: function() {
  5650. ig.Sound.enabled && (this.currentClip = ig.soundManager.get(this.path), this.currentClip.volume = ig.soundManager.volume * this.volume, this.currentClip.play())
  5651. },
  5652. stop: function() {
  5653. this.currentClip && (this.currentClip.pause(), this.currentClip.currentTime = 0)
  5654. }
  5655. });
  5656. ig.Sound.FORMAT = {
  5657. MP3: {
  5658. ext: "mp3",
  5659. mime: "audio/mpeg"
  5660. },
  5661. M4A: {
  5662. ext: "m4a",
  5663. mime: "audio/mp4; codecs=mp4a"
  5664. },
  5665. OGG: {
  5666. ext: "ogg",
  5667. mime: "audio/ogg; codecs=vorbis"
  5668. },
  5669. WEBM: {
  5670. ext: "webm",
  5671. mime: "audio/webm; codecs=vorbis"
  5672. },
  5673. CAF: {
  5674. ext: "caf",
  5675. mime: "audio/x-caf"
  5676. }
  5677. };
  5678. ig.Sound.use = [ig.Sound.FORMAT.OGG, ig.Sound.FORMAT.MP3];
  5679. ig.Sound.channels = 4;
  5680. ig.Sound.enabled = !0
  5681. });
  5682. ig.baked = !0;
  5683. ig.module("impact.loader").requires("impact.image", "impact.font", "impact.sound").defines(function() {
  5684. ig.Loader = ig.Class.extend({
  5685. resources: [],
  5686. gameClass: null,
  5687. status: 0,
  5688. done: !1,
  5689. _unloaded: [],
  5690. _drawStatus: 0,
  5691. _intervalId: 0,
  5692. _loadCallbackBound: null,
  5693. init: function(b, c) {
  5694. this.gameClass = b;
  5695. this.resources = c;
  5696. this._loadCallbackBound = this._loadCallback.bind(this);
  5697. for (var d = 0; d < this.resources.length; d++) this._unloaded.push(this.resources[d].path)
  5698. },
  5699. load: function() {
  5700. ig.system.clear("#000");
  5701. if (this.resources.length) {
  5702. for (var b =
  5703. 0; b < this.resources.length; b++) this.loadResource(this.resources[b]);
  5704. this._intervalId = setInterval(this.draw.bind(this), 16)
  5705. } else this.end()
  5706. },
  5707. loadResource: function(b) {
  5708. b.load(this._loadCallbackBound)
  5709. },
  5710. end: function() {
  5711. this.done || (this.done = !0, clearInterval(this._intervalId))
  5712. },
  5713. draw: function() {},
  5714. _loadCallback: function(b, c) {
  5715. if (c) this._unloaded.erase(b);
  5716. else throw "Failed to load resource: " + b;
  5717. this.status = 1 - this._unloaded.length / this.resources.length;
  5718. 0 == this._unloaded.length && setTimeout(this.end.bind(this), 250)
  5719. }
  5720. })
  5721. });
  5722. ig.baked = !0;
  5723. ig.module("impact.timer").defines(function() {
  5724. ig.Timer = ig.Class.extend({
  5725. target: 0,
  5726. base: 0,
  5727. last: 0,
  5728. pausedAt: 0,
  5729. init: function(b) {
  5730. this.last = this.base = ig.Timer.time;
  5731. this.target = b || 0
  5732. },
  5733. set: function(b) {
  5734. this.target = b || 0;
  5735. this.base = ig.Timer.time;
  5736. this.pausedAt = 0
  5737. },
  5738. reset: function() {
  5739. this.base = ig.Timer.time;
  5740. this.pausedAt = 0
  5741. },
  5742. tick: function() {
  5743. var b = ig.Timer.time - this.last;
  5744. this.last = ig.Timer.time;
  5745. return this.pausedAt ? 0 : b
  5746. },
  5747. delta: function() {
  5748. return (this.pausedAt || ig.Timer.time) - this.base - this.target
  5749. },
  5750. pause: function() {
  5751. this.pausedAt || (this.pausedAt =
  5752. ig.Timer.time)
  5753. },
  5754. unpause: function() {
  5755. this.pausedAt && (this.base += ig.Timer.time - this.pausedAt, this.pausedAt = 0)
  5756. }
  5757. });
  5758. ig.Timer._last = 0;
  5759. ig.Timer.time = Number.MIN_VALUE;
  5760. ig.Timer.timeScale = 1;
  5761. ig.Timer.maxStep = 0.05;
  5762. ig.Timer.step = function() {
  5763. var b = Date.now();
  5764. ig.Timer.time += Math.min((b - ig.Timer._last) / 1E3, ig.Timer.maxStep) * ig.Timer.timeScale;
  5765. ig.Timer._last = b
  5766. }
  5767. });
  5768. ig.baked = !0;
  5769. ig.module("impact.system").requires("impact.timer", "impact.image").defines(function() {
  5770. ig.System = ig.Class.extend({
  5771. fps: 30,
  5772. width: 320,
  5773. height: 240,
  5774. realWidth: 320,
  5775. realHeight: 240,
  5776. scale: 1,
  5777. tick: 0,
  5778. animationId: 0,
  5779. newGameClass: null,
  5780. running: !1,
  5781. delegate: null,
  5782. clock: null,
  5783. canvas: null,
  5784. context: null,
  5785. init: function(b, c, d, g, j) {
  5786. this.fps = c;
  5787. this.clock = new ig.Timer;
  5788. this.canvas = ig.$(b);
  5789. this.resize(d, g, j);
  5790. this.context = this.canvas.getContext("2d");
  5791. this.getDrawPos = ig.System.drawMode;
  5792. 1 != this.scale && (ig.System.scaleMode = ig.System.SCALE.CRISP);
  5793. ig.System.scaleMode(this.canvas, this.context)
  5794. },
  5795. resize: function(b, c, d) {
  5796. this.width = b;
  5797. this.height = c;
  5798. this.scale = d || this.scale;
  5799. this.realWidth = this.width * this.scale;
  5800. this.realHeight = this.height * this.scale;
  5801. this.canvas.width = this.realWidth;
  5802. this.canvas.height = this.realHeight
  5803. },
  5804. setGame: function(b) {
  5805. this.running ? this.newGameClass = b : this.setGameNow(b)
  5806. },
  5807. setGameNow: function(b) {
  5808. ig.game = new b;
  5809. ig.system.setDelegate(ig.game)
  5810. },
  5811. setDelegate: function(b) {
  5812. if ("function" == typeof b.run) this.delegate = b, this.startRunLoop();
  5813. else throw "System.setDelegate: No run() function in object";
  5814. },
  5815. stopRunLoop: function() {
  5816. ig.clearAnimation(this.animationId);
  5817. this.running = !1
  5818. },
  5819. startRunLoop: function() {
  5820. this.stopRunLoop();
  5821. this.animationId = ig.setAnimation(this.run.bind(this), this.canvas);
  5822. this.running = !0
  5823. },
  5824. clear: function(b) {
  5825. this.context.fillStyle = b;
  5826. this.context.fillRect(0, 0, this.realWidth, this.realHeight)
  5827. },
  5828. run: function() {
  5829. ig.Timer.step();
  5830. this.tick = this.clock.tick();
  5831. this.delegate.run();
  5832. ig.input.clearPressed();
  5833. this.newGameClass && (this.setGameNow(this.newGameClass), this.newGameClass = null)
  5834. },
  5835. getDrawPos: null
  5836. });
  5837. ig.System.DRAW = {
  5838. AUTHENTIC: function(b) {
  5839. return Math.round(b) * this.scale
  5840. },
  5841. SMOOTH: function(b) {
  5842. return Math.round(b * this.scale)
  5843. },
  5844. SUBPIXEL: function(b) {
  5845. return b * this.scale
  5846. }
  5847. };
  5848. ig.System.drawMode = ig.System.DRAW.SMOOTH;
  5849. ig.System.SCALE = {
  5850. CRISP: function(b, c) {
  5851. ig.setVendorAttribute(c, "imageSmoothingEnabled", !1);
  5852. b.style.imageRendering = "-moz-crisp-edges";
  5853. b.style.imageRendering = "-o-crisp-edges";
  5854. b.style.imageRendering = "-webkit-optimize-contrast";
  5855. b.style.imageRendering = "crisp-edges";
  5856. b.style.msInterpolationMode = "nearest-neighbor"
  5857. },
  5858. SMOOTH: function(b, c) {
  5859. ig.setVendorAttribute(c, "imageSmoothingEnabled", !0);
  5860. b.style.imageRendering = "";
  5861. b.style.msInterpolationMode = ""
  5862. }
  5863. };
  5864. ig.System.scaleMode = ig.System.SCALE.SMOOTH
  5865. });
  5866. ig.baked = !0;
  5867. ig.module("impact.input").defines(function() {
  5868. ig.KEY = {
  5869. MOUSE1: -1,
  5870. MOUSE2: -3,
  5871. MWHEEL_UP: -4,
  5872. MWHEEL_DOWN: -5,
  5873. BACKSPACE: 8,
  5874. TAB: 9,
  5875. ENTER: 13,
  5876. PAUSE: 19,
  5877. CAPS: 20,
  5878. ESC: 27,
  5879. SPACE: 32,
  5880. PAGE_UP: 33,
  5881. PAGE_DOWN: 34,
  5882. END: 35,
  5883. HOME: 36,
  5884. LEFT_ARROW: 37,
  5885. UP_ARROW: 38,
  5886. RIGHT_ARROW: 39,
  5887. DOWN_ARROW: 40,
  5888. INSERT: 45,
  5889. DELETE: 46,
  5890. _0: 48,
  5891. _1: 49,
  5892. _2: 50,
  5893. _3: 51,
  5894. _4: 52,
  5895. _5: 53,
  5896. _6: 54,
  5897. _7: 55,
  5898. _8: 56,
  5899. _9: 57,
  5900. A: 65,
  5901. B: 66,
  5902. C: 67,
  5903. D: 68,
  5904. E: 69,
  5905. F: 70,
  5906. G: 71,
  5907. H: 72,
  5908. I: 73,
  5909. J: 74,
  5910. K: 75,
  5911. L: 76,
  5912. M: 77,
  5913. N: 78,
  5914. O: 79,
  5915. P: 80,
  5916. Q: 81,
  5917. R: 82,
  5918. S: 83,
  5919. T: 84,
  5920. U: 85,
  5921. V: 86,
  5922. W: 87,
  5923. X: 88,
  5924. Y: 89,
  5925. Z: 90,
  5926. NUMPAD_0: 96,
  5927. NUMPAD_1: 97,
  5928. NUMPAD_2: 98,
  5929. NUMPAD_3: 99,
  5930. NUMPAD_4: 100,
  5931. NUMPAD_5: 101,
  5932. NUMPAD_6: 102,
  5933. NUMPAD_7: 103,
  5934. NUMPAD_8: 104,
  5935. NUMPAD_9: 105,
  5936. MULTIPLY: 106,
  5937. ADD: 107,
  5938. SUBSTRACT: 109,
  5939. DECIMAL: 110,
  5940. DIVIDE: 111,
  5941. F1: 112,
  5942. F2: 113,
  5943. F3: 114,
  5944. F4: 115,
  5945. F5: 116,
  5946. F6: 117,
  5947. F7: 118,
  5948. F8: 119,
  5949. F9: 120,
  5950. F10: 121,
  5951. F11: 122,
  5952. F12: 123,
  5953. SHIFT: 16,
  5954. CTRL: 17,
  5955. ALT: 18,
  5956. PLUS: 187,
  5957. COMMA: 188,
  5958. MINUS: 189,
  5959. PERIOD: 190
  5960. };
  5961. ig.Input = ig.Class.extend({
  5962. bindings: {},
  5963. actions: {},
  5964. presses: {},
  5965. locks: {},
  5966. delayedKeyup: {},
  5967. isUsingMouse: !1,
  5968. isUsingKeyboard: !1,
  5969. isUsingAccelerometer: !1,
  5970. mouse: {
  5971. x: 0,
  5972. y: 0
  5973. },
  5974. accel: {
  5975. x: 0,
  5976. y: 0,
  5977. z: 0
  5978. },
  5979. initMouse: function() {
  5980. if (!this.isUsingMouse) {
  5981. this.isUsingMouse = !0;
  5982. var b = this.mousewheel.bind(this);
  5983. ig.system.canvas.addEventListener("mousewheel", b, !1);
  5984. ig.system.canvas.addEventListener("DOMMouseScroll", b, !1);
  5985. ig.system.canvas.addEventListener("contextmenu", this.contextmenu.bind(this), !1);
  5986. ig.system.canvas.addEventListener("mousedown", this.keydown.bind(this), !1);
  5987. ig.system.canvas.addEventListener("mouseup", this.keyup.bind(this), !1);
  5988. ig.system.canvas.addEventListener("mousemove", this.mousemove.bind(this), !1);
  5989. ig.ua.touchDevice && (ig.system.canvas.addEventListener("touchstart",
  5990. this.keydown.bind(this), !1), ig.system.canvas.addEventListener("touchend", this.keyup.bind(this), !1), ig.system.canvas.addEventListener("touchmove", this.mousemove.bind(this), !1), ig.system.canvas.addEventListener("MSPointerDown", this.keydown.bind(this), !1), ig.system.canvas.addEventListener("MSPointerUp", this.keyup.bind(this), !1), ig.system.canvas.addEventListener("MSPointerMove", this.mousemove.bind(this), !1), ig.system.canvas.style.msTouchAction = "none")
  5991. }
  5992. },
  5993. initKeyboard: function() {
  5994. this.isUsingKeyboard || (this.isUsingKeyboard = !0, window.addEventListener("keydown", this.keydown.bind(this), !1), window.addEventListener("keyup", this.keyup.bind(this), !1))
  5995. },
  5996. initAccelerometer: function() {
  5997. this.isUsingAccelerometer || window.addEventListener("devicemotion", this.devicemotion.bind(this), !1)
  5998. },
  5999. mousewheel: function(b) {
  6000. var c = this.bindings[0 < (b.wheelDelta ? b.wheelDelta : -1 * b.detail) ? ig.KEY.MWHEEL_UP : ig.KEY.MWHEEL_DOWN];
  6001. c && (this.actions[c] = !0, this.presses[c] = !0, this.delayedKeyup[c] = !0, b.stopPropagation(), b.preventDefault())
  6002. },
  6003. mousemove: function(b) {
  6004. var c =
  6005. parseInt(ig.system.canvas.offsetWidth) || ig.system.realWidth;
  6006. ig.ua.mobile && (c = ig.system.realWidth);
  6007. var c = ig.system.scale * (c / ig.system.realWidth),
  6008. d = {
  6009. left: 0,
  6010. top: 0
  6011. };
  6012. ig.system.canvas.getBoundingClientRect && (d = ig.system.canvas.getBoundingClientRect());
  6013. b = b.touches ? b.touches[0] : b;
  6014. this.mouse.x = (b.clientX - d.left) / c;
  6015. this.mouse.y = (b.clientY - d.top) / c
  6016. },
  6017. contextmenu: function(b) {
  6018. this.bindings[ig.KEY.MOUSE2] && (b.stopPropagation(), b.preventDefault())
  6019. },
  6020. keydown: function(b) {
  6021. var c = b.target.tagName;
  6022. if (!("INPUT" == c || "TEXTAREA" ==
  6023. c))
  6024. if (c = "keydown" == b.type ? b.keyCode : 2 == b.button ? ig.KEY.MOUSE2 : ig.KEY.MOUSE1, 0 > c && window.focus(), ("touchstart" == b.type || "mousedown" == b.type) && this.mousemove(b), c = this.bindings[c]) this.actions[c] = !0, this.locks[c] || (this.presses[c] = !0, this.locks[c] = !0), b.stopPropagation(), b.preventDefault()
  6025. },
  6026. keyup: function(b) {
  6027. var c = b.target.tagName;
  6028. if (!("INPUT" == c || "TEXTAREA" == c))
  6029. if (c = this.bindings["keyup" == b.type ? b.keyCode : 2 == b.button ? ig.KEY.MOUSE2 : ig.KEY.MOUSE1]) this.delayedKeyup[c] = !0, b.stopPropagation(), b.preventDefault()
  6030. },
  6031. devicemotion: function(b) {
  6032. this.accel = b.accelerationIncludingGravity
  6033. },
  6034. bind: function(b, c) {
  6035. 0 > b ? this.initMouse() : 0 < b && this.initKeyboard();
  6036. this.bindings[b] = c
  6037. },
  6038. bindTouch: function(b, c) {
  6039. var d = ig.$(b),
  6040. g = this;
  6041. d.addEventListener("touchstart", function(b) {
  6042. g.touchStart(b, c)
  6043. }, !1);
  6044. d.addEventListener("touchend", function(b) {
  6045. g.touchEnd(b, c)
  6046. }, !1);
  6047. d.addEventListener("MSPointerDown", function(b) {
  6048. g.touchStart(b, c)
  6049. }, !1);
  6050. d.addEventListener("MSPointerUp", function(b) {
  6051. g.touchEnd(b, c)
  6052. }, !1)
  6053. },
  6054. unbind: function(b) {
  6055. this.delayedKeyup[this.bindings[b]] = !0;
  6056. this.bindings[b] = null
  6057. },
  6058. unbindAll: function() {
  6059. this.bindings = {};
  6060. this.actions = {};
  6061. this.presses = {};
  6062. this.locks = {};
  6063. this.delayedKeyup = {}
  6064. },
  6065. state: function(b) {
  6066. return this.actions[b]
  6067. },
  6068. pressed: function(b) {
  6069. return this.presses[b]
  6070. },
  6071. released: function(b) {
  6072. return !!this.delayedKeyup[b]
  6073. },
  6074. clearPressed: function() {
  6075. for (var b in this.delayedKeyup) this.actions[b] = !1, this.locks[b] = !1;
  6076. this.delayedKeyup = {};
  6077. this.presses = {}
  6078. },
  6079. touchStart: function(b, c) {
  6080. this.actions[c] = !0;
  6081. this.presses[c] = !0;
  6082. b.stopPropagation();
  6083. b.preventDefault();
  6084. return !1
  6085. },
  6086. touchEnd: function(b, c) {
  6087. this.delayedKeyup[c] = !0;
  6088. b.stopPropagation();
  6089. b.preventDefault();
  6090. return !1
  6091. }
  6092. })
  6093. });
  6094. ig.baked = !0;
  6095. ig.module("impact.sound-handler").defines(function() {
  6096. ig.SoundHandler = ig.Class.extend({
  6097. formats: {
  6098. ogg: ".ogg",
  6099. mp3: ".mp3"
  6100. },
  6101. jukebox: null,
  6102. pausePosition: null,
  6103. globalMute: !1,
  6104. forceMuted: !1,
  6105. muted: !1,
  6106. bgmStarted: !1,
  6107. bgmPlaying: !1,
  6108. soundPlaying: !1,
  6109. currentSoundPlaying: null,
  6110. soundBuffer: [],
  6111. voSoundLoaded: [],
  6112. sfxSoundLoaded: [],
  6113. SOUNDID: {},
  6114. voSoundsToLoad: [],
  6115. sfxSoundsToLoad: [{
  6116. name: "staticSound",
  6117. path: "media/audio/play/static"
  6118. }, {
  6119. name: "openingSound",
  6120. path: "media/audio/opening/opening"
  6121. }, {
  6122. name: "kittyopeningSound",
  6123. path: "media/audio/opening/kittyopening"
  6124. }, {
  6125. name: "star",
  6126. path: "media/audio/star2"
  6127. }, {
  6128. name: "ring",
  6129. path: "media/audio/star"
  6130. }, {
  6131. name: "pillow",
  6132. path: "media/audio/pillow2"
  6133. }, {
  6134. name: "click",
  6135. path: "media/audio/click"
  6136. }, {
  6137. name: "flip",
  6138. path: "media/audio/flip"
  6139. }, {
  6140. name: "words",
  6141. path: "media/audio/ans"
  6142. }, {
  6143. name: "vacuum",
  6144. path: "media/audio/vacuum2"
  6145. }, {
  6146. name: "ufo",
  6147. path: "media/audio/ufo"
  6148. }, {
  6149. name: "score",
  6150. path: "media/audio/score"
  6151. }],
  6152. debug: !1,
  6153. init: function() {
  6154. ig.ua.mobile ? (this.initSfx(), this.setupJukebox()) : (this.initSfx(), this.setupDesktopMusic());
  6155. this.setupWindowHandler()
  6156. },
  6157. allVoSoundLoaded: function() {
  6158. if (this.voSoundLoaded.length >=
  6159. this.voSoundsToLoad.length) {
  6160. this.debug && console.log("Vo ready");
  6161. for (index = 0; index < this.voSoundLoaded.length; index++) this.voSoundLoaded[index].on("end", function(b) {
  6162. b.isPlaying = !1;
  6163. this.soundBuffer.pop()
  6164. }.bind(this, this.voSoundLoaded[index])), this.voSoundLoaded[index].on("play", function(b) {
  6165. b.isPlaying = !0
  6166. }.bind(this, this.voSoundLoaded[index]));
  6167. return !0
  6168. }
  6169. return !1
  6170. },
  6171. allSfxSoundLoaded: function() {
  6172. return this.sfxSoundLoaded.length >= this.sfxSoundsToLoad.length ? !0 : !1
  6173. },
  6174. stopBackgroundMusic: function() {
  6175. ig.ua.mobile ?
  6176. this.pausePosition = this.jukebox.player.pause() : ig.music.pause();
  6177. this.bgmPlaying = !1
  6178. },
  6179. playBackgroundMusic: function() {
  6180. this.bgmPlaying || (this.bgmStarted = !0, ig.ua.mobile ? this.pausePosition ? this.jukebox.player.resume(this.pausePosition) : this.jukebox.player.play(this.jukebox.player.settings.spritemap.music.start, !0) : ig.music.play(), this._unMuteBackgroundMusic(), this.bgmPlaying = !0)
  6181. },
  6182. playSound: function(b) {
  6183. if ((b = this[b]) && (!this.forceMuted || !this.muted) && !b.isPlaying) this.soundBuffer.push(b), b.play()
  6184. },
  6185. stopAllAndPlaySound: function(b) {
  6186. this.stopAllSounds();
  6187. this.playSound(b)
  6188. },
  6189. stopAllSounds: function() {
  6190. for (index = 0; index < this.soundBuffer.length; index++) this.soundBuffer[index].isPlaying = !1, this.soundBuffer.splice(0, 1)[0].stop()
  6191. },
  6192. addSound: function(b, c, d) {
  6193. var g = c + this.formats.ogg;
  6194. c += this.formats.mp3;
  6195. this.SOUNDID[b] = b;
  6196. this[b] = d ? new Howl({
  6197. urls: [g, c],
  6198. onload: d
  6199. }) : new Howl({
  6200. urls: [g, c]
  6201. })
  6202. },
  6203. _muteSounds: function() {
  6204. for (i = 0; i < ig.resources.length; i++) ig.resources[i].multiChannel && ig.resources[i].stop();
  6205. Howler.mute();
  6206. this.debug && console.log("Sounds muted")
  6207. },
  6208. _unMuteSounds: function() {
  6209. Howler.unmute();
  6210. ig.Sound.enabled = !0;
  6211. this.debug && console.log("Sounds can play")
  6212. },
  6213. _muteBackgroundMusic: function() {
  6214. ig.ua.mobile ? (this.stopBackgroundMusic(), this.jukebox.player.setVolume(0)) : ig.music.volume = 0;
  6215. this.debug && console.log("BGM muted")
  6216. },
  6217. _unMuteBackgroundMusic: function() {
  6218. this.bgmStarted && (ig.ua.mobile ? (this.pausePosition ? this.jukebox.player.resume(this.pausePosition) : this.jukebox.player.play(this.jukebox.player.settings.spritemap.music.start, !0), this.jukebox.player.setVolume(1)) : ig.music.volume = 1, this.debug &&
  6219. console.log("BGM can play"))
  6220. },
  6221. focusBlurMute: function() {
  6222. void 0 != ig.game && (ig.game.changeSound = !0);
  6223. this.forceMuted || this.mute()
  6224. },
  6225. focusBlurUnmute: function() {
  6226. void 0 != ig.game && (ig.game.changeSound = !0);
  6227. this.forceMuted || this.unmute()
  6228. },
  6229. setForceMuted: function(b) {
  6230. this.forceMuted = b
  6231. },
  6232. mute: function() {
  6233. this.muted || (this._muteSounds(), this._muteBackgroundMusic(), this.muted = !0)
  6234. },
  6235. unmute: function() {
  6236. this.muted && (this._unMuteSounds(), this._unMuteBackgroundMusic(), this.muted = !1)
  6237. },
  6238. setupWindowHandler: function() {
  6239. "true" ===
  6240. getQueryVariable("webview") ? ($(window).focus(function() {
  6241. ig.ua.mobile && ig.game && ig.game.resumeGame();
  6242. ig.soundHandler && ig.soundHandler.focusBlurUnmute()
  6243. }), $(window).blur(function() {
  6244. ig.soundHandler && ig.soundHandler.focusBlurMute()
  6245. })) : (window.onfocus = function() {
  6246. ig.ua.mobile && ig.game && ig.game.resumeGame();
  6247. ig.soundHandler && ig.soundHandler.focusBlurUnmute()
  6248. }, window.onblur = function() {
  6249. ig.soundHandler && ig.soundHandler.focusBlurMute()
  6250. })
  6251. },
  6252. initSfx: function() {
  6253. for (index = 0; index < this.sfxSoundsToLoad.length; index++) {
  6254. var b =
  6255. function(b) {
  6256. this.sfxSoundLoaded.push(this[b])
  6257. }.bind(this, this.sfxSoundsToLoad[index].name);
  6258. this.addSound(this.sfxSoundsToLoad[index].name, this.sfxSoundsToLoad[index].path, b)
  6259. }
  6260. },
  6261. initVoSfx: function() {
  6262. for (index = 0; index < this.voSoundsToLoad.length; index++) {
  6263. var b = function(b) {
  6264. this.voSoundLoaded.push(this[b])
  6265. }.bind(this, this.voSoundsToLoad[index].name);
  6266. this.addSound(this.voSoundsToLoad[index].name, this.voSoundsToLoad[index].path, b)
  6267. }
  6268. },
  6269. setupDesktopMusic: function() {
  6270. ig.music.add("media/audio/bgm.*", "background")
  6271. },
  6272. setupJukebox: function() {
  6273. ig.ua.mobile && (this.jukebox = new ig.Jukebox, this.pausePosition = this.jukebox.player.settings.spritemap.music.start)
  6274. },
  6275. forceLoopBGM: function() {
  6276. if (!this.forceMuted && this.bgmPlaying && this.jukebox && this.jukebox.player && this.jukebox.player.settings.spritemap.music && this.jukebox.player.settings.spritemap.music.loop) {
  6277. if (0 <= this.prevTime)
  6278. if (this.jukebox.player.getCurrentTime() === this.prevTime) {
  6279. if (this.silentCounter || (this.silentCounter = 0), this.silentCounter++, this.jukebox.player.getCurrentTime() >=
  6280. this.jukebox.player.settings.spritemap.music.end || this.silentCounter > 0.0010 * ig.soundHandler.jukebox.player.settings.timeout * ig.system.fps) this.jukebox.player.pause(), this.jukebox.player.play(this.jukebox.player.settings.spritemap.music.start, !0), this.silentCounter = null
  6281. } else this.silentCounter = null;
  6282. this.prevTime = this.jukebox.player.getCurrentTime()
  6283. }
  6284. }
  6285. })
  6286. });
  6287. function getHiddenProp() {
  6288. var b = ["webkit", "moz", "ms", "o"];
  6289. if ("hidden" in document) return "hidden";
  6290. for (var c = 0; c < b.length; c++)
  6291. if (b[c] + "Hidden" in document) return b[c] + "Hidden";
  6292. return null
  6293. }
  6294. function isHidden() {
  6295. var b = getHiddenProp();
  6296. return !b ? !1 : document[b]
  6297. }
  6298. var visProp = getHiddenProp();
  6299. if (visProp) {
  6300. var evtname = visProp.replace(/[H|h]idden/, "") + "visibilitychange";
  6301. document.addEventListener(evtname, visChange)
  6302. }
  6303. window.addEventListener("pagehide", function() {
  6304. ig.soundHandler && ig.soundHandler.focusBlurMute()
  6305. }, !1);
  6306. window.addEventListener("pageshow", function() {
  6307. ig.ua.mobile && ig.game && ig.game.resumeGame();
  6308. ig.soundHandler && ig.soundHandler.focusBlurUnmute()
  6309. }, !1);
  6310. function visChange() {
  6311. isHidden() ? ig.soundHandler && ig.soundHandler.focusBlurMute() : (ig.ua.mobile && ig.game && ig.game.resumeGame(), ig.soundHandler && ig.soundHandler.focusBlurUnmute())
  6312. }
  6313. ig.baked = !0;
  6314. ig.module("impact.impact").requires("dom.ready", "impact.loader", "impact.system", "impact.input", "impact.sound", "impact.sound-handler").defines(function() {
  6315. ig.main = function(b, c, d, g, j, n, y) {
  6316. ig.system = new ig.System(b, d, g, j, n || 1);
  6317. ig.input = new ig.Input;
  6318. ig.soundManager = new ig.SoundManager;
  6319. ig.music = new ig.Music;
  6320. ig.ready = !0;
  6321. ig.soundHandler = new ig.SoundHandler;
  6322. (new(y || ig.Loader)(c, ig.resources)).load()
  6323. }
  6324. });
  6325. ig.baked = !0;
  6326. ig.module("impact.animation").requires("impact.timer", "impact.image").defines(function() {
  6327. ig.AnimationSheet = ig.Class.extend({
  6328. width: 8,
  6329. height: 8,
  6330. image: null,
  6331. init: function(b, c, d) {
  6332. this.width = c;
  6333. this.height = d;
  6334. this.image = new ig.Image(b)
  6335. }
  6336. });
  6337. ig.Animation = ig.Class.extend({
  6338. sheet: null,
  6339. timer: null,
  6340. sequence: [],
  6341. flip: {
  6342. x: !1,
  6343. y: !1
  6344. },
  6345. pivot: {
  6346. x: 0,
  6347. y: 0
  6348. },
  6349. frame: 0,
  6350. tile: 0,
  6351. loopCount: 0,
  6352. alpha: 1,
  6353. angle: 0,
  6354. init: function(b, c, d, g) {
  6355. this.sheet = b;
  6356. this.pivot = {
  6357. x: b.width / 2,
  6358. y: b.height / 2
  6359. };
  6360. this.timer = new ig.Timer;
  6361. this.frameTime = c;
  6362. this.sequence = d;
  6363. this.stop = !!g;
  6364. this.tile = this.sequence[0]
  6365. },
  6366. rewind: function() {
  6367. this.timer.set();
  6368. this.frame = this.loopCount = 0;
  6369. this.tile = this.sequence[0];
  6370. return this
  6371. },
  6372. gotoFrame: function(b) {
  6373. this.timer.set(this.frameTime * -b - 1E-4);
  6374. this.update()
  6375. },
  6376. gotoRandomFrame: function() {
  6377. this.gotoFrame(Math.floor(Math.random() * this.sequence.length))
  6378. },
  6379. update: function() {
  6380. var b = Math.floor(this.timer.delta() / this.frameTime);
  6381. this.loopCount = Math.floor(b / this.sequence.length);
  6382. this.frame = this.stop && 0 < this.loopCount ? this.sequence.length - 1 : b % this.sequence.length;
  6383. this.tile = this.sequence[this.frame]
  6384. },
  6385. draw: function(b, c) {
  6386. var d = Math.max(this.sheet.width, this.sheet.height);
  6387. b > ig.system.width || c > ig.system.height || (0 > b + d || 0 > c + d) || (1 != this.alpha && (ig.system.context.globalAlpha = this.alpha), 0 == this.angle ? this.sheet.image.drawTile(b, c, this.tile, this.sheet.width, this.sheet.height, this.flip.x, this.flip.y) : (ig.system.context.save(), ig.system.context.translate(ig.system.getDrawPos(b + this.pivot.x), ig.system.getDrawPos(c + this.pivot.y)), ig.system.context.rotate(this.angle),
  6388. this.sheet.image.drawTile(-this.pivot.x, -this.pivot.y, this.tile, this.sheet.width, this.sheet.height, this.flip.x, this.flip.y), ig.system.context.restore()), 1 != this.alpha && (ig.system.context.globalAlpha = 1))
  6389. }
  6390. })
  6391. });
  6392. ig.baked = !0;
  6393. ig.module("impact.entity").requires("impact.animation", "impact.impact").defines(function() {
  6394. ig.Entity = ig.Class.extend({
  6395. id: 0,
  6396. settings: {},
  6397. size: {
  6398. x: 16,
  6399. y: 16
  6400. },
  6401. offset: {
  6402. x: 0,
  6403. y: 0
  6404. },
  6405. pos: {
  6406. x: 0,
  6407. y: 0
  6408. },
  6409. last: {
  6410. x: 0,
  6411. y: 0
  6412. },
  6413. vel: {
  6414. x: 0,
  6415. y: 0
  6416. },
  6417. accel: {
  6418. x: 0,
  6419. y: 0
  6420. },
  6421. friction: {
  6422. x: 0,
  6423. y: 0
  6424. },
  6425. maxVel: {
  6426. x: 100,
  6427. y: 100
  6428. },
  6429. zIndex: 0,
  6430. gravityFactor: 1,
  6431. standing: !1,
  6432. bounciness: 0,
  6433. minBounceVelocity: 40,
  6434. anims: {},
  6435. animSheet: null,
  6436. currentAnim: null,
  6437. health: 10,
  6438. type: 0,
  6439. checkAgainst: 0,
  6440. collides: 0,
  6441. _killed: !1,
  6442. slopeStanding: {
  6443. min: (44).toRad(),
  6444. max: (136).toRad()
  6445. },
  6446. init: function(b,
  6447. c, d) {
  6448. this.id = ++ig.Entity._lastId;
  6449. this.pos.x = this.last.x = b;
  6450. this.pos.y = this.last.y = c;
  6451. ig.merge(this, d)
  6452. },
  6453. reset: function(b, c, d) {
  6454. var g = this.constructor.prototype;
  6455. this.pos.x = b;
  6456. this.pos.y = c;
  6457. this.last.x = b;
  6458. this.last.y = c;
  6459. this.vel.x = g.vel.x;
  6460. this.vel.y = g.vel.y;
  6461. this.accel.x = g.accel.x;
  6462. this.accel.y = g.accel.y;
  6463. this.health = g.health;
  6464. this._killed = g._killed;
  6465. this.standing = g.standing;
  6466. this.type = g.type;
  6467. this.checkAgainst = g.checkAgainst;
  6468. this.collides = g.collides;
  6469. ig.merge(this, d)
  6470. },
  6471. addAnim: function(b, c, d, g) {
  6472. if (!this.animSheet) throw "No animSheet to add the animation " +
  6473. b + " to.";
  6474. c = new ig.Animation(this.animSheet, c, d, g);
  6475. this.anims[b] = c;
  6476. this.currentAnim || (this.currentAnim = c);
  6477. return c
  6478. },
  6479. update: function() {
  6480. this.last.x = this.pos.x;
  6481. this.last.y = this.pos.y;
  6482. this.vel.y += ig.game.gravity * ig.system.tick * this.gravityFactor;
  6483. this.vel.x = this.getNewVelocity(this.vel.x, this.accel.x, this.friction.x, this.maxVel.x);
  6484. this.vel.y = this.getNewVelocity(this.vel.y, this.accel.y, this.friction.y, this.maxVel.y);
  6485. var b = ig.game.collisionMap.trace(this.pos.x, this.pos.y, this.vel.x * ig.system.tick, this.vel.y *
  6486. ig.system.tick, this.size.x, this.size.y);
  6487. this.handleMovementTrace(b);
  6488. this.currentAnim && this.currentAnim.update()
  6489. },
  6490. getNewVelocity: function(b, c, d, g) {
  6491. return c ? (b + c * ig.system.tick).limit(-g, g) : d ? (c = d * ig.system.tick, 0 < b - c ? b - c : 0 > b + c ? b + c : 0) : b.limit(-g, g)
  6492. },
  6493. handleMovementTrace: function(b) {
  6494. this.standing = !1;
  6495. b.collision.y && (0 < this.bounciness && Math.abs(this.vel.y) > this.minBounceVelocity ? this.vel.y *= -this.bounciness : (0 < this.vel.y && (this.standing = !0), this.vel.y = 0));
  6496. b.collision.x && (this.vel.x = 0 < this.bounciness && Math.abs(this.vel.x) >
  6497. this.minBounceVelocity ? this.vel.x * -this.bounciness : 0);
  6498. if (b.collision.slope) {
  6499. var c = b.collision.slope;
  6500. if (0 < this.bounciness) {
  6501. var d = this.vel.x * c.nx + this.vel.y * c.ny;
  6502. this.vel.x = (this.vel.x - 2 * c.nx * d) * this.bounciness;
  6503. this.vel.y = (this.vel.y - 2 * c.ny * d) * this.bounciness
  6504. } else d = (this.vel.x * c.x + this.vel.y * c.y) / (c.x * c.x + c.y * c.y), this.vel.x = c.x * d, this.vel.y = c.y * d, c = Math.atan2(c.x, c.y), c > this.slopeStanding.min && c < this.slopeStanding.max && (this.standing = !0)
  6505. }
  6506. this.pos = b.pos
  6507. },
  6508. draw: function() {
  6509. this.currentAnim && this.currentAnim.draw(this.pos.x -
  6510. this.offset.x - ig.game._rscreen.x, this.pos.y - this.offset.y - ig.game._rscreen.y)
  6511. },
  6512. kill: function() {
  6513. ig.game.removeEntity(this)
  6514. },
  6515. receiveDamage: function(b) {
  6516. this.health -= b;
  6517. 0 >= this.health && this.kill()
  6518. },
  6519. touches: function(b) {
  6520. return !(this.pos.x >= b.pos.x + b.size.x || this.pos.x + this.size.x <= b.pos.x || this.pos.y >= b.pos.y + b.size.y || this.pos.y + this.size.y <= b.pos.y)
  6521. },
  6522. distanceTo: function(b) {
  6523. var c = this.pos.x + this.size.x / 2 - (b.pos.x + b.size.x / 2);
  6524. b = this.pos.y + this.size.y / 2 - (b.pos.y + b.size.y / 2);
  6525. return Math.sqrt(c * c + b * b)
  6526. },
  6527. angleTo: function(b) {
  6528. return Math.atan2(b.pos.y +
  6529. b.size.y / 2 - (this.pos.y + this.size.y / 2), b.pos.x + b.size.x / 2 - (this.pos.x + this.size.x / 2))
  6530. },
  6531. check: function() {},
  6532. collideWith: function() {},
  6533. ready: function() {},
  6534. erase: function() {}
  6535. });
  6536. ig.Entity._lastId = 0;
  6537. ig.Entity.COLLIDES = {
  6538. NEVER: 0,
  6539. LITE: 1,
  6540. PASSIVE: 2,
  6541. ACTIVE: 4,
  6542. FIXED: 8
  6543. };
  6544. ig.Entity.TYPE = {
  6545. NONE: 0,
  6546. A: 1,
  6547. B: 2,
  6548. BOTH: 3
  6549. };
  6550. ig.Entity.checkPair = function(b, c) {
  6551. b.checkAgainst & c.type && b.check(c);
  6552. c.checkAgainst & b.type && c.check(b);
  6553. b.collides && c.collides && b.collides + c.collides > ig.Entity.COLLIDES.ACTIVE && ig.Entity.solveCollision(b, c)
  6554. };
  6555. ig.Entity.solveCollision =
  6556. function(b, c) {
  6557. var d = null;
  6558. if (b.collides == ig.Entity.COLLIDES.LITE || c.collides == ig.Entity.COLLIDES.FIXED) d = b;
  6559. else if (c.collides == ig.Entity.COLLIDES.LITE || b.collides == ig.Entity.COLLIDES.FIXED) d = c;
  6560. b.last.x + b.size.x > c.last.x && b.last.x < c.last.x + c.size.x ? (b.last.y < c.last.y ? ig.Entity.seperateOnYAxis(b, c, d) : ig.Entity.seperateOnYAxis(c, b, d), b.collideWith(c, "y"), c.collideWith(b, "y")) : b.last.y + b.size.y > c.last.y && b.last.y < c.last.y + c.size.y && (b.last.x < c.last.x ? ig.Entity.seperateOnXAxis(b, c, d) : ig.Entity.seperateOnXAxis(c,
  6561. b, d), b.collideWith(c, "x"), c.collideWith(b, "x"))
  6562. };
  6563. ig.Entity.seperateOnXAxis = function(b, c, d) {
  6564. var g = b.pos.x + b.size.x - c.pos.x;
  6565. d ? (d.vel.x = -d.vel.x * d.bounciness + (b === d ? c : b).vel.x, c = ig.game.collisionMap.trace(d.pos.x, d.pos.y, d == b ? -g : g, 0, d.size.x, d.size.y), d.pos.x = c.pos.x) : (d = (b.vel.x - c.vel.x) / 2, b.vel.x = -d, c.vel.x = d, d = ig.game.collisionMap.trace(b.pos.x, b.pos.y, -g / 2, 0, b.size.x, b.size.y), b.pos.x = Math.floor(d.pos.x), b = ig.game.collisionMap.trace(c.pos.x, c.pos.y, g / 2, 0, c.size.x, c.size.y), c.pos.x = Math.ceil(b.pos.x))
  6566. };
  6567. ig.Entity.seperateOnYAxis = function(b, c, d) {
  6568. var g = b.pos.y + b.size.y - c.pos.y;
  6569. if (d) {
  6570. c = b === d ? c : b;
  6571. d.vel.y = -d.vel.y * d.bounciness + c.vel.y;
  6572. var j = 0;
  6573. d == b && Math.abs(d.vel.y - c.vel.y) < d.minBounceVelocity && (d.standing = !0, j = c.vel.x * ig.system.tick);
  6574. b = ig.game.collisionMap.trace(d.pos.x, d.pos.y, j, d == b ? -g : g, d.size.x, d.size.y);
  6575. d.pos.y = b.pos.y;
  6576. d.pos.x = b.pos.x
  6577. } else ig.game.gravity && (c.standing || 0 < b.vel.y) ? (d = ig.game.collisionMap.trace(b.pos.x, b.pos.y, 0, -(b.pos.y + b.size.y - c.pos.y), b.size.x, b.size.y), b.pos.y = d.pos.y, 0 < b.bounciness &&
  6578. b.vel.y > b.minBounceVelocity ? b.vel.y *= -b.bounciness : (b.standing = !0, b.vel.y = 0)) : (d = (b.vel.y - c.vel.y) / 2, b.vel.y = -d, c.vel.y = d, j = c.vel.x * ig.system.tick, d = ig.game.collisionMap.trace(b.pos.x, b.pos.y, j, -g / 2, b.size.x, b.size.y), b.pos.y = d.pos.y, b = ig.game.collisionMap.trace(c.pos.x, c.pos.y, 0, g / 2, c.size.x, c.size.y), c.pos.y = b.pos.y)
  6579. }
  6580. });
  6581. ig.baked = !0;
  6582. ig.module("impact.map").defines(function() {
  6583. ig.Map = ig.Class.extend({
  6584. tilesize: 8,
  6585. width: 1,
  6586. height: 1,
  6587. data: [
  6588. []
  6589. ],
  6590. name: null,
  6591. init: function(b, c) {
  6592. this.tilesize = b;
  6593. this.data = c;
  6594. this.height = c.length;
  6595. this.width = c[0].length;
  6596. this.pxWidth = this.width * this.tilesize;
  6597. this.pxHeight = this.height * this.tilesize
  6598. },
  6599. getTile: function(b, c) {
  6600. var d = Math.floor(b / this.tilesize),
  6601. g = Math.floor(c / this.tilesize);
  6602. return 0 <= d && d < this.width && 0 <= g && g < this.height ? this.data[g][d] : 0
  6603. },
  6604. setTile: function(b, c, d) {
  6605. b = Math.floor(b / this.tilesize);
  6606. c = Math.floor(c /
  6607. this.tilesize);
  6608. 0 <= b && b < this.width && 0 <= c && c < this.height && (this.data[c][b] = d)
  6609. }
  6610. })
  6611. });
  6612. ig.baked = !0;
  6613. ig.module("impact.collision-map").requires("impact.map").defines(function() {
  6614. ig.CollisionMap = ig.Map.extend({
  6615. lastSlope: 1,
  6616. tiledef: null,
  6617. init: function(b, c, j) {
  6618. this.parent(b, c);
  6619. this.tiledef = j || ig.CollisionMap.defaultTileDef;
  6620. for (var n in this.tiledef) n | 0 > this.lastSlope && (this.lastSlope = n | 0)
  6621. },
  6622. trace: function(b, c, j, n, y, r) {
  6623. var z = {
  6624. collision: {
  6625. x: !1,
  6626. y: !1,
  6627. slope: !1
  6628. },
  6629. pos: {
  6630. x: b,
  6631. y: c
  6632. },
  6633. tile: {
  6634. x: 0,
  6635. y: 0
  6636. }
  6637. },
  6638. A = Math.ceil(Math.max(Math.abs(j), Math.abs(n)) / this.tilesize);
  6639. if (1 < A)
  6640. for (var B = j / A, l = n / A, p = 0; p < A && (B || l) && !(this._traceStep(z,
  6641. b, c, B, l, y, r, j, n, p), b = z.pos.x, c = z.pos.y, z.collision.x && (j = B = 0), z.collision.y && (n = l = 0), z.collision.slope); p++);
  6642. else this._traceStep(z, b, c, j, n, y, r, j, n, 0);
  6643. return z
  6644. },
  6645. _traceStep: function(b, c, j, n, y, r, z, A, B, l) {
  6646. b.pos.x += n;
  6647. b.pos.y += y;
  6648. var p = 0;
  6649. if (n) {
  6650. var t = 0 < n ? r : 0,
  6651. x = 0 > n ? this.tilesize : 0,
  6652. p = Math.max(Math.floor(j / this.tilesize), 0),
  6653. L = Math.min(Math.ceil((j + z) / this.tilesize), this.height);
  6654. n = Math.floor((b.pos.x + t) / this.tilesize);
  6655. var H = Math.floor((c + t) / this.tilesize);
  6656. if (0 < l || n == H || 0 > H || H >= this.width) H = -1;
  6657. if (0 <= n && n < this.width)
  6658. for (var E =
  6659. p; E < L && !(-1 != H && (p = this.data[E][H], 1 < p && p <= this.lastSlope && this._checkTileDef(b, p, c, j, A, B, r, z, H, E))); E++)
  6660. if (p = this.data[E][n], 1 == p || p > this.lastSlope || 1 < p && this._checkTileDef(b, p, c, j, A, B, r, z, n, E)) {
  6661. if (1 < p && p <= this.lastSlope && b.collision.slope) break;
  6662. b.collision.x = !0;
  6663. b.tile.x = p;
  6664. c = b.pos.x = n * this.tilesize - t + x;
  6665. A = 0;
  6666. break
  6667. }
  6668. }
  6669. if (y) {
  6670. t = 0 < y ? z : 0;
  6671. y = 0 > y ? this.tilesize : 0;
  6672. p = Math.max(Math.floor(b.pos.x / this.tilesize), 0);
  6673. x = Math.min(Math.ceil((b.pos.x + r) / this.tilesize), this.width);
  6674. E = Math.floor((b.pos.y + t) / this.tilesize);
  6675. L = Math.floor((j + t) / this.tilesize);
  6676. if (0 < l || E == L || 0 > L || L >= this.height) L = -1;
  6677. if (0 <= E && E < this.height)
  6678. for (n = p; n < x && !(-1 != L && (p = this.data[L][n], 1 < p && p <= this.lastSlope && this._checkTileDef(b, p, c, j, A, B, r, z, n, L))); n++)
  6679. if (p = this.data[E][n], 1 == p || p > this.lastSlope || 1 < p && this._checkTileDef(b, p, c, j, A, B, r, z, n, E)) {
  6680. if (1 < p && p <= this.lastSlope && b.collision.slope) break;
  6681. b.collision.y = !0;
  6682. b.tile.y = p;
  6683. b.pos.y = E * this.tilesize - t + y;
  6684. break
  6685. }
  6686. }
  6687. },
  6688. _checkTileDef: function(b, c, j, n, y, r, z, A, B, l) {
  6689. var p = this.tiledef[c];
  6690. if (!p) return !1;
  6691. c = (p[2] -
  6692. p[0]) * this.tilesize;
  6693. var t = (p[3] - p[1]) * this.tilesize,
  6694. x = p[4];
  6695. z = j + y + (0 > t ? z : 0) - (B + p[0]) * this.tilesize;
  6696. A = n + r + (0 < c ? A : 0) - (l + p[1]) * this.tilesize;
  6697. if (0 < c * A - t * z) {
  6698. if (0 > y * -t + r * c) return x;
  6699. B = Math.sqrt(c * c + t * t);
  6700. l = t / B;
  6701. B = -c / B;
  6702. var L = z * l + A * B,
  6703. p = l * L,
  6704. L = B * L;
  6705. if (p * p + L * L >= y * y + r * r) return x || 0.5 > c * (A - r) - t * (z - y);
  6706. b.pos.x = j + y - p;
  6707. b.pos.y = n + r - L;
  6708. b.collision.slope = {
  6709. x: c,
  6710. y: t,
  6711. nx: l,
  6712. ny: B
  6713. };
  6714. return !0
  6715. }
  6716. return !1
  6717. }
  6718. });
  6719. var b = 1 / 3,
  6720. c = 2 / 3;
  6721. ig.CollisionMap.defaultTileDef = {
  6722. 5: [0, 1, 1, c, !0],
  6723. 6: [0, c, 1, b, !0],
  6724. 7: [0, b, 1, 0, !0],
  6725. 3: [0, 1, 1, 0.5, !0],
  6726. 4: [0, 0.5, 1, 0, !0],
  6727. 2: [0,
  6728. 1, 1, 0, !0
  6729. ],
  6730. 10: [0.5, 1, 1, 0, !0],
  6731. 21: [0, 1, 0.5, 0, !0],
  6732. 32: [c, 1, 1, 0, !0],
  6733. 43: [b, 1, c, 0, !0],
  6734. 54: [0, 1, b, 0, !0],
  6735. 27: [0, 0, 1, b, !0],
  6736. 28: [0, b, 1, c, !0],
  6737. 29: [0, c, 1, 1, !0],
  6738. 25: [0, 0, 1, 0.5, !0],
  6739. 26: [0, 0.5, 1, 1, !0],
  6740. 24: [0, 0, 1, 1, !0],
  6741. 11: [0, 0, 0.5, 1, !0],
  6742. 22: [0.5, 0, 1, 1, !0],
  6743. 33: [0, 0, b, 1, !0],
  6744. 44: [b, 0, c, 1, !0],
  6745. 55: [c, 0, 1, 1, !0],
  6746. 16: [1, b, 0, 0, !0],
  6747. 17: [1, c, 0, b, !0],
  6748. 18: [1, 1, 0, c, !0],
  6749. 14: [1, 0.5, 0, 0, !0],
  6750. 15: [1, 1, 0, 0.5, !0],
  6751. 13: [1, 1, 0, 0, !0],
  6752. 8: [0.5, 1, 0, 0, !0],
  6753. 19: [1, 1, 0.5, 0, !0],
  6754. 30: [b, 1, 0, 0, !0],
  6755. 41: [c, 1, b, 0, !0],
  6756. 52: [1, 1, c, 0, !0],
  6757. 38: [1, c, 0, 1, !0],
  6758. 39: [1, b, 0, c, !0],
  6759. 40: [1, 0,
  6760. 0, b, !0
  6761. ],
  6762. 36: [1, 0.5, 0, 1, !0],
  6763. 37: [1, 0, 0, 0.5, !0],
  6764. 35: [1, 0, 0, 1, !0],
  6765. 9: [1, 0, 0.5, 1, !0],
  6766. 20: [0.5, 0, 0, 1, !0],
  6767. 31: [1, 0, c, 1, !0],
  6768. 42: [c, 0, b, 1, !0],
  6769. 53: [b, 0, 0, 1, !0],
  6770. 12: [0, 0, 1, 0, !1],
  6771. 23: [1, 1, 0, 1, !1],
  6772. 34: [1, 0, 1, 1, !1],
  6773. 45: [0, 1, 0, 0, !1]
  6774. };
  6775. ig.CollisionMap.staticNoCollision = {
  6776. trace: function(b, c, j, n) {
  6777. return {
  6778. collision: {
  6779. x: !1,
  6780. y: !1,
  6781. slope: !1
  6782. },
  6783. pos: {
  6784. x: b + j,
  6785. y: c + n
  6786. },
  6787. tile: {
  6788. x: 0,
  6789. y: 0
  6790. }
  6791. }
  6792. }
  6793. }
  6794. });
  6795. ig.baked = !0;
  6796. ig.module("impact.background-map").requires("impact.map", "impact.image").defines(function() {
  6797. ig.BackgroundMap = ig.Map.extend({
  6798. tiles: null,
  6799. scroll: {
  6800. x: 0,
  6801. y: 0
  6802. },
  6803. distance: 1,
  6804. repeat: !1,
  6805. tilesetName: "",
  6806. foreground: !1,
  6807. enabled: !0,
  6808. preRender: !1,
  6809. preRenderedChunks: null,
  6810. chunkSize: 512,
  6811. debugChunks: !1,
  6812. anims: {},
  6813. init: function(b, c, d) {
  6814. this.parent(b, c);
  6815. this.setTileset(d)
  6816. },
  6817. setTileset: function(b) {
  6818. this.tilesetName = b instanceof ig.Image ? b.path : b;
  6819. this.tiles = new ig.Image(this.tilesetName);
  6820. this.preRenderedChunks = null
  6821. },
  6822. setScreenPos: function(b,
  6823. c) {
  6824. this.scroll.x = b / this.distance;
  6825. this.scroll.y = c / this.distance
  6826. },
  6827. preRenderMapToChunks: function() {
  6828. var b = this.width * this.tilesize * ig.system.scale,
  6829. c = this.height * this.tilesize * ig.system.scale;
  6830. this.chunkSize = Math.min(Math.max(b, c), this.chunkSize);
  6831. var d = Math.ceil(b / this.chunkSize),
  6832. g = Math.ceil(c / this.chunkSize);
  6833. this.preRenderedChunks = [];
  6834. for (var j = 0; j < g; j++) {
  6835. this.preRenderedChunks[j] = [];
  6836. for (var n = 0; n < d; n++) this.preRenderedChunks[j][n] = this.preRenderChunk(n, j, n == d - 1 ? b - n * this.chunkSize : this.chunkSize, j == g - 1 ?
  6837. c - j * this.chunkSize : this.chunkSize)
  6838. }
  6839. },
  6840. preRenderChunk: function(b, c, d, g) {
  6841. var j = d / this.tilesize / ig.system.scale + 1,
  6842. n = g / this.tilesize / ig.system.scale + 1,
  6843. y = b * this.chunkSize / ig.system.scale % this.tilesize,
  6844. r = c * this.chunkSize / ig.system.scale % this.tilesize;
  6845. b = Math.floor(b * this.chunkSize / this.tilesize / ig.system.scale);
  6846. c = Math.floor(c * this.chunkSize / this.tilesize / ig.system.scale);
  6847. var z = ig.$new("canvas");
  6848. z.width = d;
  6849. z.height = g;
  6850. z.retinaResolutionEnabled = !1;
  6851. g = z.getContext("2d");
  6852. ig.System.scaleMode(z, g);
  6853. d = ig.system.context;
  6854. ig.system.context = g;
  6855. for (g = 0; g < j; g++)
  6856. for (var A = 0; A < n; A++)
  6857. if (g + b < this.width && A + c < this.height) {
  6858. var B = this.data[A + c][g + b];
  6859. B && this.tiles.drawTile(g * this.tilesize - y, A * this.tilesize - r, B - 1, this.tilesize)
  6860. }
  6861. ig.system.context = d;
  6862. return z
  6863. },
  6864. draw: function() {
  6865. this.tiles.loaded && this.enabled && (this.preRender ? this.drawPreRendered() : this.drawTiled())
  6866. },
  6867. drawPreRendered: function() {
  6868. this.preRenderedChunks || this.preRenderMapToChunks();
  6869. var b = ig.system.getDrawPos(this.scroll.x),
  6870. c = ig.system.getDrawPos(this.scroll.y);
  6871. if (this.repeat) var d =
  6872. this.width * this.tilesize * ig.system.scale,
  6873. b = (b % d + d) % d,
  6874. d = this.height * this.tilesize * ig.system.scale,
  6875. c = (c % d + d) % d;
  6876. var d = Math.max(Math.floor(b / this.chunkSize), 0),
  6877. g = Math.max(Math.floor(c / this.chunkSize), 0),
  6878. j = Math.ceil((b + ig.system.realWidth) / this.chunkSize),
  6879. n = Math.ceil((c + ig.system.realHeight) / this.chunkSize),
  6880. y = this.preRenderedChunks[0].length,
  6881. r = this.preRenderedChunks.length;
  6882. this.repeat || (j = Math.min(j, y), n = Math.min(n, r));
  6883. for (var z = 0; g < n; g++) {
  6884. for (var A = 0, B = d; B < j; B++) {
  6885. var l = this.preRenderedChunks[g % r][B % y],
  6886. p = -b + B * this.chunkSize - A,
  6887. t = -c + g * this.chunkSize - z;
  6888. ig.system.context.drawImage(l, p, t);
  6889. ig.Image.drawCount++;
  6890. this.debugChunks && (ig.system.context.strokeStyle = "#f0f", ig.system.context.strokeRect(p, t, this.chunkSize, this.chunkSize));
  6891. this.repeat && l.width < this.chunkSize && p + l.width < ig.system.realWidth && (A += this.chunkSize - l.width, j++)
  6892. }
  6893. this.repeat && l.height < this.chunkSize && t + l.height < ig.system.realHeight && (z += this.chunkSize - l.height, n++)
  6894. }
  6895. },
  6896. drawTiled: function() {
  6897. for (var b = 0, c = null, d = (this.scroll.x / this.tilesize).toInt(),
  6898. g = (this.scroll.y / this.tilesize).toInt(), j = this.scroll.x % this.tilesize, n = this.scroll.y % this.tilesize, y = -j - this.tilesize, j = ig.system.width + this.tilesize - j, r = ig.system.height + this.tilesize - n, z = -1, n = -n - this.tilesize; n < r; z++, n += this.tilesize) {
  6899. var A = z + g;
  6900. if (A >= this.height || 0 > A) {
  6901. if (!this.repeat) continue;
  6902. A = (A % this.height + this.height) % this.height
  6903. }
  6904. for (var B = -1, l = y; l < j; B++, l += this.tilesize) {
  6905. b = B + d;
  6906. if (b >= this.width || 0 > b) {
  6907. if (!this.repeat) continue;
  6908. b = (b % this.width + this.width) % this.width
  6909. }
  6910. if (b = this.data[A][b])(c = this.anims[b -
  6911. 1]) ? c.draw(l, n) : this.tiles.drawTile(l, n, b - 1, this.tilesize)
  6912. }
  6913. }
  6914. }
  6915. })
  6916. });
  6917. ig.baked = !0;
  6918. ig.module("impact.game").requires("impact.impact", "impact.entity", "impact.collision-map", "impact.background-map").defines(function() {
  6919. ig.Game = ig.Class.extend({
  6920. clearColor: "#000000",
  6921. gravity: 0,
  6922. screen: {
  6923. x: 0,
  6924. y: 0
  6925. },
  6926. _rscreen: {
  6927. x: 0,
  6928. y: 0
  6929. },
  6930. entities: [],
  6931. namedEntities: {},
  6932. collisionMap: ig.CollisionMap.staticNoCollision,
  6933. backgroundMaps: [],
  6934. backgroundAnims: {},
  6935. autoSort: !1,
  6936. sortBy: null,
  6937. cellSize: 64,
  6938. _deferredKill: [],
  6939. _levelToLoad: null,
  6940. _doSortEntities: !1,
  6941. staticInstantiate: function() {
  6942. this.sortBy = this.sortBy || ig.Game.SORT.Z_INDEX;
  6943. ig.game = this;
  6944. return null
  6945. },
  6946. loadLevel: function(b) {
  6947. this.screen = {
  6948. x: 0,
  6949. y: 0
  6950. };
  6951. this.entities = [];
  6952. this.namedEntities = {};
  6953. for (var c = 0; c < b.entities.length; c++) {
  6954. var d = b.entities[c];
  6955. this.spawnEntity(d.type, d.x, d.y, d.settings)
  6956. }
  6957. this.sortEntities();
  6958. this.collisionMap = ig.CollisionMap.staticNoCollision;
  6959. this.backgroundMaps = [];
  6960. for (c = 0; c < b.layer.length; c++)
  6961. if (d = b.layer[c], "collision" == d.name) this.collisionMap = new ig.CollisionMap(d.tilesize, d.data);
  6962. else {
  6963. var g = new ig.BackgroundMap(d.tilesize, d.data, d.tilesetName);
  6964. g.anims = this.backgroundAnims[d.tilesetName] || {};
  6965. g.repeat = d.repeat;
  6966. g.distance = d.distance;
  6967. g.foreground = !!d.foreground;
  6968. g.preRender = !!d.preRender;
  6969. g.name = d.name;
  6970. this.backgroundMaps.push(g)
  6971. }
  6972. for (c = 0; c < this.entities.length; c++) this.entities[c].ready()
  6973. },
  6974. loadLevelDeferred: function(b) {
  6975. this._levelToLoad = b
  6976. },
  6977. getMapByName: function(b) {
  6978. if ("collision" == b) return this.collisionMap;
  6979. for (var c = 0; c < this.backgroundMaps.length; c++)
  6980. if (this.backgroundMaps[c].name == b) return this.backgroundMaps[c];
  6981. return null
  6982. },
  6983. getEntityByName: function(b) {
  6984. return this.namedEntities[b]
  6985. },
  6986. getEntitiesByType: function(b) {
  6987. b =
  6988. "string" === typeof b ? ig.global[b] : b;
  6989. for (var c = [], d = 0; d < this.entities.length; d++) {
  6990. var g = this.entities[d];
  6991. g instanceof b && !g._killed && c.push(g)
  6992. }
  6993. return c
  6994. },
  6995. spawnEntity: function(b, c, d, g) {
  6996. var j = "string" === typeof b ? ig.global[b] : b;
  6997. if (!j) throw "Can't spawn entity of type " + b;
  6998. b = new j(c, d, g || {});
  6999. this.entities.push(b);
  7000. b.name && (this.namedEntities[b.name] = b);
  7001. return b
  7002. },
  7003. sortEntities: function() {
  7004. this.entities.sort(this.sortBy)
  7005. },
  7006. sortEntitiesDeferred: function() {
  7007. this._doSortEntities = !0
  7008. },
  7009. removeEntity: function(b) {
  7010. b.name &&
  7011. delete this.namedEntities[b.name];
  7012. b._killed = !0;
  7013. b.type = ig.Entity.TYPE.NONE;
  7014. b.checkAgainst = ig.Entity.TYPE.NONE;
  7015. b.collides = ig.Entity.COLLIDES.NEVER;
  7016. this._deferredKill.push(b)
  7017. },
  7018. run: function() {
  7019. this.update();
  7020. this.draw()
  7021. },
  7022. update: function() {
  7023. this._levelToLoad && (this.loadLevel(this._levelToLoad), this._levelToLoad = null);
  7024. this.updateEntities();
  7025. this.checkEntities();
  7026. for (var b = 0; b < this._deferredKill.length; b++) this._deferredKill[b].erase(), this.entities.erase(this._deferredKill[b]);
  7027. this._deferredKill = [];
  7028. if (this._doSortEntities ||
  7029. this.autoSort) this.sortEntities(), this._doSortEntities = !1;
  7030. for (var c in this.backgroundAnims) {
  7031. var b = this.backgroundAnims[c],
  7032. d;
  7033. for (d in b) b[d].update()
  7034. }
  7035. },
  7036. updateEntities: function() {
  7037. for (var b = 0; b < this.entities.length; b++) {
  7038. var c = this.entities[b];
  7039. c._killed || c.update()
  7040. }
  7041. },
  7042. draw: function() {
  7043. this.clearColor && ig.system.clear(this.clearColor);
  7044. this._rscreen.x = ig.system.getDrawPos(this.screen.x) / ig.system.scale;
  7045. this._rscreen.y = ig.system.getDrawPos(this.screen.y) / ig.system.scale;
  7046. var b;
  7047. for (b = 0; b < this.backgroundMaps.length; b++) {
  7048. var c =
  7049. this.backgroundMaps[b];
  7050. if (c.foreground) break;
  7051. c.setScreenPos(this.screen.x, this.screen.y);
  7052. c.draw()
  7053. }
  7054. this.drawEntities();
  7055. for (b; b < this.backgroundMaps.length; b++) c = this.backgroundMaps[b], c.setScreenPos(this.screen.x, this.screen.y), c.draw()
  7056. },
  7057. drawEntities: function() {
  7058. for (var b = 0; b < this.entities.length; b++) this.entities[b].draw()
  7059. },
  7060. checkEntities: function() {
  7061. for (var b = {}, c = 0; c < this.entities.length; c++) {
  7062. var d = this.entities[c];
  7063. if (!(d.type == ig.Entity.TYPE.NONE && d.checkAgainst == ig.Entity.TYPE.NONE && d.collides == ig.Entity.COLLIDES.NEVER))
  7064. for (var g = {}, j = Math.floor(d.pos.y / this.cellSize), n = Math.floor((d.pos.x + d.size.x) / this.cellSize) + 1, y = Math.floor((d.pos.y + d.size.y) / this.cellSize) + 1, r = Math.floor(d.pos.x / this.cellSize); r < n; r++)
  7065. for (var z = j; z < y; z++)
  7066. if (b[r])
  7067. if (b[r][z]) {
  7068. for (var A = b[r][z], B = 0; B < A.length; B++) d.touches(A[B]) && !g[A[B].id] && (g[A[B].id] = !0, ig.Entity.checkPair(d, A[B]));
  7069. A.push(d)
  7070. } else b[r][z] = [d];
  7071. else b[r] = {}, b[r][z] = [d]
  7072. }
  7073. }
  7074. });
  7075. ig.Game.SORT = {
  7076. Z_INDEX: function(b, c) {
  7077. return b.zIndex - c.zIndex
  7078. },
  7079. POS_X: function(b, c) {
  7080. return b.pos.x + b.size.x - (c.pos.x +
  7081. c.size.x)
  7082. },
  7083. POS_Y: function(b, c) {
  7084. return b.pos.y + b.size.y - (c.pos.y + c.size.y)
  7085. }
  7086. }
  7087. });
  7088. ig.baked = !0;
  7089. ig.module("plugins.splash-loader").requires("impact.loader", "impact.animation").defines(function() {
  7090. ig.SplashLoader = ig.Loader.extend({
  7091. bgIm: new ig.Image("media/graphics/sprites/home-bg.png"),
  7092. logoIm: new ig.Image("media/graphics/sprites/logo.png"),
  7093. planeIm: new ig.Image("media/graphics/sprites/home-plane.png"),
  7094. scarfIm: new ig.Image("media/graphics/sprites/home-scarf.png"),
  7095. fanIm: new ig.Image("media/graphics/sprites/fan.png"),
  7096. miniIm: new ig.Image("media/graphics/sprites/miniplane.png"),
  7097. count: 0,
  7098. init: function(b,
  7099. c) {
  7100. this.parent(b, c);
  7101. ig.ua.mobile
  7102. // && _SETTINGS.Ad.Mobile.Preroll.Enabled && MobileAdInGamePreroll.Initialize();
  7103. this.ctx = ig.system.context;
  7104. this.plane = {
  7105. x: 158,
  7106. task: "none",
  7107. y: 150,
  7108. sc: 1,
  7109. oriSc: 0.9,
  7110. scX: 1,
  7111. scY: 1,
  7112. alp: 1,
  7113. rot: 0,
  7114. textSize: 26,
  7115. tweening: !1,
  7116. frameCount: 0,
  7117. frameTime: 0.02,
  7118. frameTimer: new ig.Timer,
  7119. frame: 0,
  7120. frameX: 1,
  7121. frameY: 1,
  7122. frames: [0, 1, 2, 2, 3],
  7123. tFrame: 1,
  7124. loop: !0,
  7125. ended: !1,
  7126. cent: !0
  7127. };
  7128. this.logo = {
  7129. scX: 1,
  7130. scY: 1,
  7131. twn: !1
  7132. };
  7133. this.scarf = {
  7134. x: -40,
  7135. task: "none",
  7136. y: -37,
  7137. sc: 1,
  7138. oriSc: 0.9,
  7139. scX: 1,
  7140. scY: 1,
  7141. alp: 1,
  7142. rot: 0,
  7143. textSize: 26,
  7144. tweening: !1,
  7145. frameCount: 0,
  7146. frameTime: 0.05,
  7147. frameTimer: new ig.Timer,
  7148. frame: 0,
  7149. frameX: 1,
  7150. frameY: 1,
  7151. frames: [0, 1, 2, 3, 4, 5],
  7152. tFrame: 1,
  7153. loop: !0,
  7154. ended: !1,
  7155. cent: !0
  7156. };
  7157. this.fan = {
  7158. x: 65,
  7159. task: "none",
  7160. y: -6,
  7161. sc: 1,
  7162. oriSc: 0.9,
  7163. offX: [0, 0, 0, 0, 0],
  7164. offY: [0, 1, 3, 3, 1],
  7165. scX: 1,
  7166. scY: 1,
  7167. alp: 1,
  7168. rot: 0,
  7169. textSize: 26,
  7170. tweening: !1,
  7171. frameCount: 0,
  7172. frameTime: 0.05,
  7173. frameTimer: new ig.Timer,
  7174. frame: 0,
  7175. frameX: 1,
  7176. frameY: 1,
  7177. frames: [0, 1, 2, 2, 3],
  7178. tFrame: 1,
  7179. loop: !0,
  7180. ended: !1,
  7181. cent: !0
  7182. }
  7183. },
  7184. textSet: function(b, c, d) {
  7185. b = "bg" == b ? ig.system.bgcontext : "game" == b ? ig.system.context : b;
  7186. b.font = c + "px tex";
  7187. b.fillStyle = d
  7188. },
  7189. textDraw: function(b,
  7190. c, d, g, j, n) {
  7191. b = "bg" == b ? ig.system.bgcontext : "game" == b ? ig.system.context : b;
  7192. b.save();
  7193. var y = b.measureText("M").width * d;
  7194. b.translate(j, n + y);
  7195. b.scale(c, d);
  7196. b.fillText(g, 0, 0);
  7197. b.restore()
  7198. },
  7199. tinyTween: function(b, c, d) {
  7200. if (b > c) return b -= d, b < c && (b = c), b;
  7201. if (b < c) return b += d, b > c && (b = c), b;
  7202. if (b == c) return b
  7203. },
  7204. tweenHolder: function(b, c, d, g) {
  7205. !1 == this[b.targ][b.bol] ? (this[b.targ][b.inner] = this.tinyTween(this[b.targ][b.inner], c, g), this[b.targ][b.inner] == c && (this[b.targ][b.bol] = !0)) : (this[b.targ][b.inner] = this.tinyTween(this[b.targ][b.inner],
  7206. d, g), this[b.targ][b.inner] == d && (this[b.targ][b.bol] = !1))
  7207. },
  7208. drawer: function(b, c, d, g, j, n, y, r, z, A, B, l, p, t) {
  7209. try {
  7210. var x = "bg" == b ? ig.system.bgcontext : "game" == b ? ig.system.context : b;
  7211. null == p && (p = 0);
  7212. null == t && (t = 0);
  7213. null == r && (r = 1);
  7214. null == z && (z = 1);
  7215. null == B && (B = 1);
  7216. var L = c.width / d * (j % d),
  7217. H = c.height / g * Math.floor(j / d),
  7218. E = c.width / d,
  7219. N = c.height / g,
  7220. F = c.width / d * r,
  7221. K = c.height / g * z;
  7222. null == l || 0 == l ? (n = A ? n - F / 2 + p : n + p, y = A ? y - K / 2 + t : y + t, 0 < E && 0 < N && (x.globalAlpha = B, x.drawImage(c.data, L, H, E, N, n, y, F, K), x.globalAlpha = 1)) : (p = A ? -E / 2 + p : p || 0, t = A ? -N /
  7223. 2 + t : t || 0, 0 < E && 0 < N && (x.save(), x.translate(n, y), x.scale(r, z), x.rotate(2 * Math.PI / 360 * l), x.globalAlpha = B, x.drawImage(c.data, L, H, E, N, p, t, E, N), x.restore()))
  7224. } catch (O) {
  7225. console.log(c)
  7226. }
  7227. },
  7228. end: function() {
  7229. this.parent();
  7230. var b = 0 <= document.URL.indexOf("localhost") ? 500 : 3E3;
  7231. window.setTimeout("ig.system.setGame(MyGame)", b)
  7232. },
  7233. setupCustomAnimation: function() {
  7234. this.customAnim = new ig.Animation(this.customAnim, 0.05, [0, 1, 2, 3, 4, 5]);
  7235. this.customAnim.currentFrame = 0;
  7236. ig.loadingScreen = this;
  7237. ig.loadingScreen.animationTimer = window.setInterval("ig.loadingScreen.animate()",
  7238. 100)
  7239. },
  7240. animate: function() {
  7241. this.customAnim.currentFrame < this.customAnim.sequence.length ? this.customAnim.currentFrame++ : this.customAnim.currentFrame = 0;
  7242. this.customAnim.gotoFrame(this.customAnim.currentFrame)
  7243. },
  7244. draw: function() {
  7245. this._drawStatus += (this.status - this._drawStatus) / 5;
  7246. this.bgIm.draw(0, 0);
  7247. 1 < this.count ? (this.count = 0, this.plane.frame = (this.plane.frame + 1) % this.plane.frames.length, this.scarf.frame = (this.scarf.frame + 1) % this.scarf.frames.length, this.fan.frame = (this.fan.frame + 1) % this.fan.frames.length) :
  7248. this.count++;
  7249. this.tweenHolder({
  7250. targ: "logo",
  7251. inner: "scX",
  7252. bol: "twn"
  7253. }, 1, 0.98, 8E-4);
  7254. this.tweenHolder({
  7255. targ: "logo",
  7256. inner: "scY",
  7257. bol: "twn"
  7258. }, 0.9, 0.98, 8E-4);
  7259. this.drawer("game", this.logoIm, 1, 1, 0, 330, 230, this.logo.scX, this.logo.scY, !0);
  7260. this.drawer("game", this.planeIm, 2, 2, this.plane.frames[this.plane.frame], this.plane.x, this.plane.y, this.plane.sc, this.plane.sc, !0);
  7261. this.drawer("game", this.scarfIm, 6, 1, this.scarf.frames[this.scarf.frame], this.plane.x + this.scarf.x, this.plane.y + this.scarf.y + this.fan.offY[this.plane.frame],
  7262. this.scarf.sc, this.scarf.sc, !0);
  7263. this.drawer("game", this.fanIm, 4, 1, this.fan.frames[this.fan.frame], this.plane.x + this.fan.x, this.plane.y + this.fan.y + this.fan.offY[this.plane.frame], this.fan.sc, this.fan.sc, !0);
  7264. this.ctx.fillStyle = "white";
  7265. this.ctx.fillRect(190, 384, 290, 18);
  7266. this.ctx.fillStyle = "#c90d1e";
  7267. this.ctx.fillRect(193, 387, 290 * this._drawStatus, 12);
  7268. this.ctx.fillStyle = "#da1d2e";
  7269. this.ctx.fillRect(193, 387, 290 * this._drawStatus, 6);
  7270. this.ctx.fillStyle = "#f34947";
  7271. this.ctx.fillRect(193, 387, 290 * this._drawStatus,
  7272. 2);
  7273. this.drawer("game", this.miniIm, 4, 1, 3, 190 + 290 * this._drawStatus, 397, 0.8, 0.8, !0);
  7274. this.textSet("game", 35, "white");
  7275. this.textDraw("game", 1.3, 1.5, "loading", -230, -290)
  7276. }
  7277. })
  7278. });
  7279. ig.baked = !0;
  7280. ig.module("plugins.tween").requires("impact.entity").defines(function() {
  7281. Array.prototype.indexOf || (Array.prototype.indexOf = function(b) {
  7282. for (var c = 0; c < this.length; ++c)
  7283. if (this[c] === b) return c;
  7284. return -1
  7285. });
  7286. ig.Entity.prototype.tweens = [];
  7287. ig.Entity.prototype._preTweenUpdate = ig.Entity.prototype.update;
  7288. ig.Entity.prototype.update = function() {
  7289. this._preTweenUpdate();
  7290. if (0 < this.tweens.length) {
  7291. for (var b = [], c = 0; c < this.tweens.length; c++) this.tweens[c].update(), this.tweens[c].complete || b.push(this.tweens[c]);
  7292. this.tweens =
  7293. b
  7294. }
  7295. };
  7296. ig.Entity.prototype.tween = function(b, c, d) {
  7297. b = new ig.Tween(this, b, c, d);
  7298. this.tweens.push(b);
  7299. return b
  7300. };
  7301. ig.Entity.prototype.pauseTweens = function() {
  7302. for (var b = 0; b < this.tweens.length; b++) this.tweens[b].pause()
  7303. };
  7304. ig.Entity.prototype.resumeTweens = function() {
  7305. for (var b = 0; b < this.tweens.length; b++) this.tweens[b].resume()
  7306. };
  7307. ig.Entity.prototype.stopTweens = function(b) {
  7308. for (var c = 0; c < this.tweens.length; c++) this.tweens[c].stop(b)
  7309. };
  7310. ig.Tween = function(b, c, d, g) {
  7311. var j = {},
  7312. n = {},
  7313. y = {},
  7314. r = 0,
  7315. z = !1,
  7316. A = !1,
  7317. B = !1;
  7318. this.duration = d;
  7319. this.paused =
  7320. this.complete = !1;
  7321. this.easing = ig.Tween.Easing.Linear.EaseNone;
  7322. this.onComplete = !1;
  7323. this.loop = this.delay = 0;
  7324. this.loopCount = -1;
  7325. ig.merge(this, g);
  7326. this.loopNum = this.loopCount;
  7327. this.chain = function(b) {
  7328. B = b
  7329. };
  7330. this.initEnd = function(b, c, d) {
  7331. if ("object" !== typeof c[b]) d[b] = c[b];
  7332. else
  7333. for (subprop in c[b]) d[b] || (d[b] = {}), this.initEnd(subprop, c[b], d[b])
  7334. };
  7335. this.initStart = function(b, c, d, g) {
  7336. if ("object" !== typeof d[b]) "undefined" !== typeof c[b] && (g[b] = d[b]);
  7337. else
  7338. for (subprop in d[b]) g[b] || (g[b] = {}), "undefined" !== typeof c[b] && this.initStart(subprop,
  7339. c[b], d[b], g[b])
  7340. };
  7341. this.start = function() {
  7342. this.paused = this.complete = !1;
  7343. this.loopNum = this.loopCount;
  7344. r = 0; - 1 == b.tweens.indexOf(this) && b.tweens.push(this);
  7345. A = !0;
  7346. z = new ig.Timer;
  7347. for (var d in c) this.initEnd(d, c, n);
  7348. for (d in n) this.initStart(d, n, b, j), this.initDelta(d, y, b, n)
  7349. };
  7350. this.initDelta = function(b, c, d, g) {
  7351. if ("object" !== typeof g[b]) c[b] = g[b] - d[b];
  7352. else
  7353. for (subprop in g[b]) c[b] || (c[b] = {}), this.initDelta(subprop, c[b], d[b], g[b])
  7354. };
  7355. this.propUpdate = function(b, c, d, g, j) {
  7356. if ("object" !== typeof d[b]) c[b] = "undefined" != typeof d[b] ?
  7357. d[b] + g[b] * j : c[b];
  7358. else
  7359. for (subprop in d[b]) this.propUpdate(subprop, c[b], d[b], g[b], j)
  7360. };
  7361. this.propSet = function(b, c, d) {
  7362. if ("object" !== typeof c[b]) d[b] = c[b];
  7363. else
  7364. for (subprop in c[b]) d[b] || (d[b] = {}), this.propSet(subprop, c[b], d[b])
  7365. };
  7366. this.update = function() {
  7367. if (!A) return !1;
  7368. if (this.delay) {
  7369. if (z.delta() < this.delay) return;
  7370. this.delay = 0;
  7371. z.reset()
  7372. }
  7373. if (this.paused || this.complete) return !1;
  7374. var c = (z.delta() + r) / this.duration,
  7375. c = 1 < c ? 1 : c,
  7376. d = this.easing(c);
  7377. for (property in y) this.propUpdate(property, b, j, y, d);
  7378. if (1 <= c) {
  7379. if (0 == this.loopNum ||
  7380. !this.loop) {
  7381. this.complete = !0;
  7382. if (this.onComplete) this.onComplete();
  7383. B && B.start();
  7384. return !1
  7385. }
  7386. if (this.loop == ig.Tween.Loop.Revert) {
  7387. for (property in j) this.propSet(property, j, b);
  7388. r = 0;
  7389. z.reset(); - 1 != this.loopNum && this.loopNum--
  7390. } else if (this.loop == ig.Tween.Loop.Reverse) {
  7391. c = {};
  7392. d = {};
  7393. ig.merge(c, n);
  7394. ig.merge(d, j);
  7395. ig.merge(j, c);
  7396. ig.merge(n, d);
  7397. for (property in n) this.initDelta(property, y, b, n);
  7398. r = 0;
  7399. z.reset(); - 1 != this.loopNum && this.loopNum--
  7400. }
  7401. }
  7402. };
  7403. this.pause = function() {
  7404. this.paused = !0;
  7405. r += z.delta()
  7406. };
  7407. this.resume = function() {
  7408. this.paused = !1;
  7409. z.reset()
  7410. };
  7411. this.stop = function(b) {
  7412. b && (this.loop = this.complete = this.paused = !1, r += d, this.update());
  7413. this.complete = !0
  7414. }
  7415. };
  7416. ig.Tween.Loop = {
  7417. Revert: 1,
  7418. Reverse: 2
  7419. };
  7420. ig.Tween.Easing = {
  7421. Linear: {},
  7422. Quadratic: {},
  7423. Cubic: {},
  7424. Quartic: {},
  7425. Quintic: {},
  7426. Sinusoidal: {},
  7427. Exponential: {},
  7428. Circular: {},
  7429. Elastic: {},
  7430. Back: {},
  7431. Bounce: {}
  7432. };
  7433. ig.Tween.Easing.Linear.EaseNone = function(b) {
  7434. return b
  7435. };
  7436. ig.Tween.Easing.Quadratic.EaseIn = function(b) {
  7437. return b * b
  7438. };
  7439. ig.Tween.Easing.Quadratic.EaseOut = function(b) {
  7440. return -b * (b - 2)
  7441. };
  7442. ig.Tween.Easing.Quadratic.EaseInOut =
  7443. function(b) {
  7444. return 1 > (b *= 2) ? 0.5 * b * b : -0.5 * (--b * (b - 2) - 1)
  7445. };
  7446. ig.Tween.Easing.Cubic.EaseIn = function(b) {
  7447. return b * b * b
  7448. };
  7449. ig.Tween.Easing.Cubic.EaseOut = function(b) {
  7450. return --b * b * b + 1
  7451. };
  7452. ig.Tween.Easing.Cubic.EaseInOut = function(b) {
  7453. return 1 > (b *= 2) ? 0.5 * b * b * b : 0.5 * ((b -= 2) * b * b + 2)
  7454. };
  7455. ig.Tween.Easing.Quartic.EaseIn = function(b) {
  7456. return b * b * b * b
  7457. };
  7458. ig.Tween.Easing.Quartic.EaseOut = function(b) {
  7459. return -(--b * b * b * b - 1)
  7460. };
  7461. ig.Tween.Easing.Quartic.EaseInOut = function(b) {
  7462. return 1 > (b *= 2) ? 0.5 * b * b * b * b : -0.5 * ((b -= 2) * b * b * b - 2)
  7463. };
  7464. ig.Tween.Easing.Quintic.EaseIn =
  7465. function(b) {
  7466. return b * b * b * b * b
  7467. };
  7468. ig.Tween.Easing.Quintic.EaseOut = function(b) {
  7469. return (b -= 1) * b * b * b * b + 1
  7470. };
  7471. ig.Tween.Easing.Quintic.EaseInOut = function(b) {
  7472. return 1 > (b *= 2) ? 0.5 * b * b * b * b * b : 0.5 * ((b -= 2) * b * b * b * b + 2)
  7473. };
  7474. ig.Tween.Easing.Sinusoidal.EaseIn = function(b) {
  7475. return -Math.cos(b * Math.PI / 2) + 1
  7476. };
  7477. ig.Tween.Easing.Sinusoidal.EaseOut = function(b) {
  7478. return Math.sin(b * Math.PI / 2)
  7479. };
  7480. ig.Tween.Easing.Sinusoidal.EaseInOut = function(b) {
  7481. return -0.5 * (Math.cos(Math.PI * b) - 1)
  7482. };
  7483. ig.Tween.Easing.Exponential.EaseIn = function(b) {
  7484. return 0 == b ? 0 : Math.pow(2,
  7485. 10 * (b - 1))
  7486. };
  7487. ig.Tween.Easing.Exponential.EaseOut = function(b) {
  7488. return 1 == b ? 1 : -Math.pow(2, -10 * b) + 1
  7489. };
  7490. ig.Tween.Easing.Exponential.EaseInOut = function(b) {
  7491. return 0 == b ? 0 : 1 == b ? 1 : 1 > (b *= 2) ? 0.5 * Math.pow(2, 10 * (b - 1)) : 0.5 * (-Math.pow(2, -10 * (b - 1)) + 2)
  7492. };
  7493. ig.Tween.Easing.Circular.EaseIn = function(b) {
  7494. return -(Math.sqrt(1 - b * b) - 1)
  7495. };
  7496. ig.Tween.Easing.Circular.EaseOut = function(b) {
  7497. return Math.sqrt(1 - --b * b)
  7498. };
  7499. ig.Tween.Easing.Circular.EaseInOut = function(b) {
  7500. return 1 > (b /= 0.5) ? -0.5 * (Math.sqrt(1 - b * b) - 1) : 0.5 * (Math.sqrt(1 - (b -= 2) * b) + 1)
  7501. };
  7502. ig.Tween.Easing.Elastic.EaseIn =
  7503. function(b) {
  7504. var c, d = 0.1,
  7505. g = 0.4;
  7506. if (0 == b) return 0;
  7507. if (1 == b) return 1;
  7508. g || (g = 0.3);
  7509. !d || 1 > d ? (d = 1, c = g / 4) : c = g / (2 * Math.PI) * Math.asin(1 / d);
  7510. return -(d * Math.pow(2, 10 * (b -= 1)) * Math.sin(2 * (b - c) * Math.PI / g))
  7511. };
  7512. ig.Tween.Easing.Elastic.EaseOut = function(b) {
  7513. var c, d = 0.1,
  7514. g = 0.4;
  7515. if (0 == b) return 0;
  7516. if (1 == b) return 1;
  7517. g || (g = 0.3);
  7518. !d || 1 > d ? (d = 1, c = g / 4) : c = g / (2 * Math.PI) * Math.asin(1 / d);
  7519. return d * Math.pow(2, -10 * b) * Math.sin(2 * (b - c) * Math.PI / g) + 1
  7520. };
  7521. ig.Tween.Easing.Elastic.EaseInOut = function(b) {
  7522. var c, d = 0.1,
  7523. g = 0.4;
  7524. if (0 == b) return 0;
  7525. if (1 == b) return 1;
  7526. g || (g = 0.3);
  7527. !d || 1 > d ? (d = 1, c = g / 4) : c = g / (2 * Math.PI) * Math.asin(1 / d);
  7528. return 1 > (b *= 2) ? -0.5 * d * Math.pow(2, 10 * (b -= 1)) * Math.sin(2 * (b - c) * Math.PI / g) : 0.5 * d * Math.pow(2, -10 * (b -= 1)) * Math.sin(2 * (b - c) * Math.PI / g) + 1
  7529. };
  7530. ig.Tween.Easing.Back.EaseIn = function(b) {
  7531. return b * b * (2.70158 * b - 1.70158)
  7532. };
  7533. ig.Tween.Easing.Back.EaseOut = function(b) {
  7534. return (b -= 1) * b * (2.70158 * b + 1.70158) + 1
  7535. };
  7536. ig.Tween.Easing.Back.EaseInOut = function(b) {
  7537. return 1 > (b *= 2) ? 0.5 * b * b * (3.5949095 * b - 2.5949095) : 0.5 * ((b -= 2) * b * (3.5949095 * b + 2.5949095) + 2)
  7538. };
  7539. ig.Tween.Easing.Bounce.EaseIn =
  7540. function(b) {
  7541. return 1 - ig.Tween.Easing.Bounce.EaseOut(1 - b)
  7542. };
  7543. ig.Tween.Easing.Bounce.EaseOut = function(b) {
  7544. return (b /= 1) < 1 / 2.75 ? 7.5625 * b * b : b < 2 / 2.75 ? 7.5625 * (b -= 1.5 / 2.75) * b + 0.75 : b < 2.5 / 2.75 ? 7.5625 * (b -= 2.25 / 2.75) * b + 0.9375 : 7.5625 * (b -= 2.625 / 2.75) * b + 0.984375
  7545. };
  7546. ig.Tween.Easing.Bounce.EaseInOut = function(b) {
  7547. return 0.5 > b ? 0.5 * ig.Tween.Easing.Bounce.EaseIn(2 * b) : 0.5 * ig.Tween.Easing.Bounce.EaseOut(2 * b - 1) + 0.5
  7548. }
  7549. });
  7550. ig.baked = !0;
  7551. ig.module("plugins.url-parameters").defines(function() {
  7552. ig.UrlParameters = ig.Class.extend({
  7553. init: function() {
  7554. switch (getQueryVariable("iphone")) {
  7555. case "true":
  7556. ig.ua.iPhone = !0, console.log("iPhone mode")
  7557. }
  7558. var b = getQueryVariable("webview");
  7559. if (b) switch (b) {
  7560. case "true":
  7561. ig.ua.is_uiwebview = !0, console.log("webview mode")
  7562. }
  7563. if (b = getQueryVariable("debug")) switch (b) {
  7564. case "true":
  7565. ig.game.showDebugMenu(), console.log("debug mode")
  7566. }
  7567. switch (getQueryVariable("view")) {
  7568. case "stats":
  7569. ig.game.resetPlayerStats(), ig.game.endGame()
  7570. }
  7571. getQueryVariable("ad")
  7572. }
  7573. })
  7574. });
  7575. ig.baked = !0;
  7576. ig.module("plugins.jukebox").defines(function() {
  7577. ig.Jukebox = ig.Class.extend({
  7578. init: function() {
  7579. this.player = new jukebox.Player({
  7580. resources: ["media/audio/bgm.mp3", "media/audio/bgm.ogg"],
  7581. autoplay: !1,
  7582. spritemap: {
  7583. music: {
  7584. start: 0,
  7585. end: 13,
  7586. loop: !0
  7587. }
  7588. },
  7589. timeout: 1E3
  7590. })
  7591. }
  7592. })
  7593. });
  7594. ig.baked = !0;
  7595. ig.module("plugins.director").requires("impact.impact").defines(function() {
  7596. ig.Director = ig.Class.extend({
  7597. init: function(b, c) {
  7598. this.game = b;
  7599. this.levels = [];
  7600. this.currentLevel = 0;
  7601. this.append(c)
  7602. },
  7603. loadLevel: function(b) {
  7604. for (key in dynamicClickableEntityDivs) ig.game.hideOverlay([key]);
  7605. this.currentLevel = b;
  7606. this.game.loadLevel(this.levels[b]);
  7607. return !0
  7608. },
  7609. loadLevelWithoutEntities: function(b) {
  7610. this.currentLevel = b;
  7611. this.game.loadLevelWithoutEntities(this.levels[b]);
  7612. return !0
  7613. },
  7614. append: function(b) {
  7615. newLevels = [];
  7616. return "object" ===
  7617. typeof b ? (b.constructor === [].constructor ? newLevels = b : newLevels[0] = b, this.levels = this.levels.concat(newLevels), !0) : !1
  7618. },
  7619. nextLevel: function() {
  7620. return this.currentLevel + 1 < this.levels.length ? this.loadLevel(this.currentLevel + 1) : !1
  7621. },
  7622. previousLevel: function() {
  7623. return 0 <= this.currentLevel - 1 ? this.loadLevel(this.currentLevel - 1) : !1
  7624. },
  7625. jumpTo: function(b) {
  7626. var c = null;
  7627. for (i = 0; i < this.levels.length; i++) this.levels[i] == b && (c = i);
  7628. return 0 <= c ? this.loadLevel(c) : !1
  7629. },
  7630. firstLevel: function() {
  7631. return this.loadLevel(0)
  7632. },
  7633. lastLevel: function() {
  7634. return this.loadLevel(this.levels.length -
  7635. 1)
  7636. },
  7637. reloadLevel: function() {
  7638. return this.loadLevel(this.currentLevel)
  7639. }
  7640. })
  7641. });
  7642. ig.baked = !0;
  7643. ig.module("plugins.impact-storage").requires("impact.game").defines(function() {
  7644. ig.Storage = ig.Class.extend({
  7645. staticInstantiate: function() {
  7646. return !ig.Storage.instance ? null : ig.Storage.instance
  7647. },
  7648. init: function() {
  7649. ig.Storage.instance = this
  7650. },
  7651. isCapable: function() {
  7652. return "undefined" !== typeof window.localStorage
  7653. },
  7654. isSet: function(b) {
  7655. return null !== this.get(b)
  7656. },
  7657. initUnset: function(b, c) {
  7658. null === this.get(b) && this.set(b, c)
  7659. },
  7660. get: function(b) {
  7661. if (!this.isCapable()) return null;
  7662. try {
  7663. return JSON.parse(localStorage.getItem(b))
  7664. } catch (c) {
  7665. return window.localStorage.getItem(b)
  7666. }
  7667. },
  7668. getInt: function(b) {
  7669. return ~~this.get(b)
  7670. },
  7671. getFloat: function(b) {
  7672. return parseFloat(this.get(b))
  7673. },
  7674. getBool: function(b) {
  7675. return !!this.get(b)
  7676. },
  7677. key: function(b) {
  7678. return this.isCapable() ? window.localStorage.key(b) : null
  7679. },
  7680. set: function(b, c) {
  7681. if (!this.isCapable()) return null;
  7682. try {
  7683. window.localStorage.setItem(b, JSON.stringify(c))
  7684. } catch (d) {
  7685. console.log(d)
  7686. }
  7687. },
  7688. setHighest: function(b, c) {
  7689. c > this.getFloat(b) && this.set(b, c)
  7690. },
  7691. remove: function(b) {
  7692. if (!this.isCapable()) return null;
  7693. window.localStorage.removeItem(b)
  7694. },
  7695. clear: function() {
  7696. if (!this.isCapable()) return null;
  7697. window.localStorage.clear()
  7698. }
  7699. })
  7700. });
  7701. ig.baked = !0;
  7702. ig.module("plugins.scale").requires("impact.entity").defines(function() {
  7703. ig.Entity.inject({
  7704. scale: {
  7705. x: 1,
  7706. y: 1
  7707. },
  7708. _offset: {
  7709. x: 0,
  7710. y: 0
  7711. },
  7712. _scale: {
  7713. x: 1,
  7714. y: 1
  7715. },
  7716. _size: {
  7717. x: 0,
  7718. y: 0
  7719. },
  7720. init: function(b, c, d) {
  7721. this.parent(b, c, d);
  7722. this._offset.x = this.offset.x;
  7723. this._offset.y = this.offset.y;
  7724. this._size.x = this.size.x;
  7725. this._size.y = this.size.y;
  7726. this.setScale(this.scale.x, this.scale.y)
  7727. },
  7728. draw: function() {
  7729. var b = ig.system.context;
  7730. b.save();
  7731. b.translate(ig.system.getDrawPos(this.pos.x.round() - this.offset.x - ig.game.screen.x), ig.system.getDrawPos(this.pos.y.round() -
  7732. this.offset.y - ig.game.screen.y));
  7733. b.scale(this._scale.x, this._scale.y);
  7734. null != this.currentAnim && this.currentAnim.draw(0, 0);
  7735. b.restore()
  7736. },
  7737. setScale: function(b, c, d) {
  7738. var g = this.size.x,
  7739. j = this.size.y;
  7740. this.scale.x = b || this.scale.x;
  7741. this.scale.y = c || this.scale.y;
  7742. this._scale.x = this.scale.x / ig.system.scale;
  7743. this._scale.y = this.scale.y / ig.system.scale;
  7744. this.offset.x = this._offset.x * this._scale.x;
  7745. this.offset.y = this._offset.y * this._scale.y;
  7746. this.size.x = this._size.x * this._scale.x;
  7747. this.size.y = this._size.y * this._scale.y;
  7748. null ==
  7749. d && (this.pos.x += (g - this.size.x) / 2, this.pos.y += (j - this.size.y) / 2)
  7750. }
  7751. })
  7752. });
  7753. this.START_BRANDING_SPLASH;
  7754. ig.baked = !0;
  7755. ig.module("plugins.branding.splash").requires("impact.impact", "impact.entity").defines(function() {
  7756. ig.BrandingSplash = ig.Class.extend({
  7757. init: function() {
  7758. ig.game.spawnEntity(EntityBranding, 0, 0)
  7759. }
  7760. });
  7761. EntityBranding = ig.Entity.extend({
  7762. gravityFactor: 0,
  7763. size: {
  7764. x: 32,
  7765. y: 32
  7766. },
  7767. splash: new ig.Image("branding/splash1.png"),
  7768. init: function(b, c, d) {
  7769. this.parent(b, c, d);
  7770. 320 >= ig.system.width ? (this.size.x = 320, this.size.y = 200) : (this.size.x = 480, this.size.y = 240);
  7771. this.pos.x = (ig.system.width - this.size.x) / 2;
  7772. this.pos.y = -this.size.y - 200;
  7773. this.endPosY = (ig.system.height - this.size.y) / 2;
  7774. b = this.tween({
  7775. pos: {
  7776. y: this.endPosY
  7777. }
  7778. }, 0.5, {
  7779. easing: ig.Tween.Easing.Bounce.EaseIn
  7780. });
  7781. c = this.tween({}, 2.5, {
  7782. onComplete: function() {
  7783. ig.game.director.loadLevel(ig.game.director.currentLevel)
  7784. }
  7785. });
  7786. b.chain(c);
  7787. b.start();
  7788. this.currentAnim = this.anims.idle
  7789. },
  7790. createClickableLayer: function() {
  7791. console.log("Build clickable layer");
  7792. this.checkClickableLayer("branding-splash", _SETTINGS.Branding.Logo.Link, _SETTINGS.Branding.Logo.NewWindow)
  7793. },
  7794. doesClickableLayerExist: function(b) {
  7795. for (k in dynamicClickableEntityDivs)
  7796. if (k ==
  7797. b) return !0;
  7798. return !1
  7799. },
  7800. checkClickableLayer: function(b, c, d) {
  7801. "undefined" == typeof wm && (this.doesClickableLayerExist(b) ? (ig.game.showOverlay([b]), $("#" + b).find("[href]").attr("href", c)) : this.createClickableOutboundLayer(b, c, "media/graphics/misc/invisible.png", d))
  7802. },
  7803. createClickableOutboundLayer: function(b, c, d, g) {
  7804. var j = ig.$new("div");
  7805. j.id = b;
  7806. document.body.appendChild(j);
  7807. $("#" + j.id).css("float", "left");
  7808. $("#" + j.id).css("position", "absolute");
  7809. if (ig.ua.mobile) {
  7810. var n = window.innerHeight / mobileHeight,
  7811. y = window.innerWidth /
  7812. mobileWidth;
  7813. $("#" + j.id).css("left", this.pos.x * y);
  7814. $("#" + j.id).css("top", this.pos.y * n);
  7815. $("#" + j.id).css("width", this.size.x * y);
  7816. $("#" + j.id).css("height", this.size.y * n)
  7817. } else n = w / 2 - destW / 2, y = h / 2 - destH / 2, console.log(n, y), $("#" + j.id).css("left", n + this.pos.x * multiplier), $("#" + j.id).css("top", y + this.pos.y * multiplier), $("#" + j.id).css("width", this.size.x * multiplier), $("#" + j.id).css("height", this.size.y * multiplier);
  7818. g ? $("#" + j.id).html("<a target='_blank' href='" + c + "'><img style='width:100%;height:100%' src='" +
  7819. d + "'></a>") : $("#" + j.id).html("<a href='" + c + "'><img style='width:100%;height:100%' src='" + d + "'></a>");
  7820. dynamicClickableEntityDivs[b] = {};
  7821. dynamicClickableEntityDivs[b].width = this.size.x * multiplier;
  7822. dynamicClickableEntityDivs[b].height = this.size.y * multiplier;
  7823. dynamicClickableEntityDivs[b].entity_pos_x = this.pos.x;
  7824. dynamicClickableEntityDivs[b].entity_pos_y = this.pos.y
  7825. },
  7826. draw: function() {
  7827. ig.system.context.fillStyle = "#ffffff";
  7828. ig.system.context.fillRect(0, 0, ig.system.width, ig.system.height);
  7829. ig.system.context.fillStyle =
  7830. "#000";
  7831. ig.system.context.font = "12px Arial";
  7832. 320 >= ig.system.width ? ig.system.context.fillText("powered by MarketJS.com", ig.system.width - 150, ig.system.height - 15) : ig.system.context.fillText("powered by MarketJS.com", ig.system.width - 160, ig.system.height - 15);
  7833. this.parent();
  7834. this.splash && ig.system.context.drawImage(this.splash.data, 0, 0, this.splash.data.width, this.splash.data.height, this.pos.x, this.pos.y, this.size.x, this.size.y)
  7835. }
  7836. })
  7837. });
  7838. this.END_BRANDING_SPLASH;
  7839. ig.baked = !0;
  7840. ig.module("game.entities.branding-logo-placeholder").requires("impact.entity").defines(function() {
  7841. EntityBrandingLogoPlaceholder = ig.Entity.extend({
  7842. gravityFactor: 0,
  7843. size: {
  7844. x: 32,
  7845. y: 32
  7846. },
  7847. _wmDrawBox: !0,
  7848. _wmBoxColor: "rgba(0, 0, 255, 0.7)",
  7849. init: function(b, c, d) {
  7850. this.parent(b, c, d);
  7851. if (d) switch (console.log("settings found ... using that div layer name"), b = d.div_layer_name, console.log("settings.centralize:", d.centralize), d.centralize) {
  7852. case "true":
  7853. console.log("centralize true");
  7854. centralize = !0;
  7855. break;
  7856. case "false":
  7857. console.log("centralize false");
  7858. centralize = !1;
  7859. break;
  7860. default:
  7861. console.log("default ... centralize false"), centralize = !1
  7862. } else b = "branding-logo", centralize = !1;
  7863. if ("undefined" == typeof wm) {
  7864. if (_SETTINGS.Branding.Logo.Enabled) try {
  7865. ig.game.spawnEntity(EntityBrandingLogo, this.pos.x, this.pos.y, {
  7866. div_layer_name: b,
  7867. centralize: centralize
  7868. })
  7869. } catch (g) {
  7870. console.log(g)
  7871. }
  7872. this.kill()
  7873. }
  7874. }
  7875. })
  7876. });
  7877. this.START_BRANDING_LOGO;
  7878. ig.baked = !0;
  7879. ig.module("game.entities.branding-logo").requires("impact.entity").defines(function() {
  7880. EntityBrandingLogo = ig.Entity.extend({
  7881. gravityFactor: 0,
  7882. logo: new ig.AnimationSheet("branding/logo.png", _SETTINGS.Branding.Logo.Width, _SETTINGS.Branding.Logo.Height),
  7883. size: {
  7884. x: 32,
  7885. y: 32
  7886. },
  7887. zIndex: 10001,
  7888. init: function(b, c, d) {
  7889. this.parent(b, c, d);
  7890. "undefined" == typeof wm && (_SETTINGS.Branding.Logo.Enabled ? (this.size.x = _SETTINGS.Branding.Logo.Width, this.size.y = _SETTINGS.Branding.Logo.Height, d && d.centralize && (this.pos.x = ig.system.width /
  7891. 2 - this.size.x / 2, console.log("centralize true ... centering branded logo ..."))) : this.kill());
  7892. this.anims.idle = new ig.Animation(this.logo, 0, [0], !0);
  7893. this.currentAnim = this.anims.idle;
  7894. d ? (console.log("branding settings found ... using that div layer name"), b = d.div_layer_name) : b = "branding-logo";
  7895. _SETTINGS.Branding.Logo.LinkEnabled && (console.log("logo link enabled"), this.checkClickableLayer(b, _SETTINGS.Branding.Logo.Link, _SETTINGS.Branding.Logo.NewWindow));
  7896. console.log("branding logo spawed ...")
  7897. },
  7898. doesClickableLayerExist: function(b) {
  7899. for (k in dynamicClickableEntityDivs)
  7900. if (k ==
  7901. b) return !0;
  7902. return !1
  7903. },
  7904. checkClickableLayer: function(b, c, d) {
  7905. "undefined" == typeof wm && (this.doesClickableLayerExist(b) ? (ig.game.showOverlay([b]), $("#" + b).find("[href]").attr("href", c)) : this.createClickableOutboundLayer(b, c, "media/graphics/misc/invisible.png", d))
  7906. },
  7907. createClickableOutboundLayer: function(b, c, d, g) {
  7908. var j = ig.$new("div");
  7909. j.id = b;
  7910. document.body.appendChild(j);
  7911. $("#" + j.id).css("float", "left");
  7912. $("#" + j.id).css("position", "absolute");
  7913. if (ig.ua.mobile) {
  7914. var n = window.innerHeight / mobileHeight,
  7915. y = window.innerWidth /
  7916. mobileWidth;
  7917. $("#" + j.id).css("left", this.pos.x * y);
  7918. $("#" + j.id).css("top", this.pos.y * n);
  7919. $("#" + j.id).css("width", this.size.x * y);
  7920. $("#" + j.id).css("height", this.size.y * n)
  7921. } else n = w / 2 - destW / 2, y = h / 2 - destH / 2, console.log(n, y), $("#" + j.id).css("left", n + this.pos.x * multiplier), $("#" + j.id).css("top", y + this.pos.y * multiplier), $("#" + j.id).css("width", this.size.x * multiplier), $("#" + j.id).css("height", this.size.y * multiplier);
  7922. g ? $("#" + j.id).html("<a target='_blank' href='" + c + "'><img style='width:100%;height:100%' src='" +
  7923. d + "'></a>") : $("#" + j.id).html("<a href='" + c + "'><img style='width:100%;height:100%' src='" + d + "'></a>");
  7924. dynamicClickableEntityDivs[b] = {};
  7925. dynamicClickableEntityDivs[b].width = this.size.x * multiplier;
  7926. dynamicClickableEntityDivs[b].height = this.size.y * multiplier;
  7927. dynamicClickableEntityDivs[b].entity_pos_x = this.pos.x;
  7928. dynamicClickableEntityDivs[b].entity_pos_y = this.pos.y
  7929. }
  7930. })
  7931. });
  7932. this.END_BRANDING_LOGO;
  7933. ig.baked = !0;
  7934. ig.module("game.entities.button-more-games").requires("impact.entity").defines(function() {
  7935. EntityButtonMoreGames = ig.Entity.extend({
  7936. gravityFactor: 0,
  7937. size: {
  7938. x: 62,
  7939. y: 45
  7940. },
  7941. zIndex: 750,
  7942. init: function(b, c, d) {
  7943. this.parent(b, c, d);
  7944. "undefined" == typeof wm && (_SETTINGS.MoreGames.Enabled ? (d.div_layer_name ? (console.log("settings found ... using that div layer name"), b = d.div_layer_name) : b = "more-games", console.log("div_layer_name:", b), this.checkClickableLayer(b, _SETTINGS.MoreGames.Link, _SETTINGS.MoreGames.NewWindow)) : this.kill())
  7945. },
  7946. doesClickableLayerExist: function(b) {
  7947. for (k in dynamicClickableEntityDivs)
  7948. if (k == b) return console.log("clickable layer already exists ..."), !0;
  7949. console.log("doesnt exist yet ...");
  7950. return !1
  7951. },
  7952. checkClickableLayer: function(b, c, d) {
  7953. "undefined" == typeof wm && (this.doesClickableLayerExist(b) ? (ig.game.showOverlay([b]), $("#" + b).find("[href]").attr("href", c)) : this.createClickableOutboundLayer(b, c, "media/graphics/misc/invisible.png", d))
  7954. },
  7955. createClickableOutboundLayer: function(b, c, d, g) {
  7956. var j = ig.$new("div");
  7957. j.id = b;
  7958. document.body.appendChild(j);
  7959. $("#" + j.id).css("float", "left");
  7960. $("#" + j.id).css("position", "absolute");
  7961. if (ig.ua.mobile) {
  7962. var n = window.innerHeight / mobileHeight,
  7963. y = window.innerWidth / mobileWidth;
  7964. $("#" + j.id).css("left", this.pos.x * y);
  7965. $("#" + j.id).css("top", this.pos.y * n);
  7966. $("#" + j.id).css("width", this.size.x * y);
  7967. $("#" + j.id).css("height", this.size.y * n)
  7968. } else n = document.getElementById("game").offsetLeft, y = document.getElementById("game").offsetTop, $("#" + j.id).css("left", n + this.pos.x * multiplier), $("#" + j.id).css("top", y + this.pos.y * multiplier), $("#" +
  7969. j.id).css("width", this.size.x * multiplier), $("#" + j.id).css("height", this.size.y * multiplier);
  7970. g ? $("#" + j.id).html("<a target='_blank' href='" + c + "'><img style='width:100%;height:100%' src='" + d + "'></a>") : $("#" + j.id).html("<a href='" + c + "'><img style='width:100%;height:100%' src='" + d + "'></a>");
  7971. dynamicClickableEntityDivs[b] = {};
  7972. dynamicClickableEntityDivs[b].width = this.size.x * multiplier;
  7973. dynamicClickableEntityDivs[b].height = this.size.y * multiplier;
  7974. dynamicClickableEntityDivs[b].entity_pos_x = this.pos.x;
  7975. dynamicClickableEntityDivs[b].entity_pos_y =
  7976. this.pos.y
  7977. }
  7978. })
  7979. });
  7980. ig.baked = !0;
  7981. ig.module("game.entities.opening-shield").requires("impact.entity").defines(function() {
  7982. EntityOpeningShield = ig.Entity.extend({
  7983. size: {
  7984. x: 48,
  7985. y: 48
  7986. },
  7987. move: 0,
  7988. mIconAnim: 0,
  7989. shieldAnim: 0,
  7990. titleAnim: 0,
  7991. shieldImage: new ig.Image("media/graphics/opening/shield.png"),
  7992. mIconImage: new ig.Image("media/graphics/opening/m_icon.png"),
  7993. titleImage: new ig.Image("media/graphics/opening/title.png"),
  7994. init: function(b, c, d) {
  7995. this.parent(b, c, d)
  7996. },
  7997. ready: function() {
  7998. if (!ig.wm)
  7999. if (_SETTINGS.DeveloperBranding.Splash.Enabled) {
  8000. this.initTimer = new ig.Timer(0.1);
  8001. try {
  8002. ig.soundHandler.playSound(ig.soundHandler.SOUNDID.openingSound)
  8003. } catch (b) {
  8004. console.log(b)
  8005. }
  8006. } else ig.game.director.nextLevel(), ig.system.context.globalAlpha = 1, this.kill()
  8007. },
  8008. update: function() {
  8009. this.parent();
  8010. this.updateOriginalShieldOpening()
  8011. },
  8012. draw: function() {
  8013. this.parent();
  8014. ig.global.wm || (this.nextLevelTimer && 0 > this.nextLevelTimer.delta() && (ig.system.context.globalAlpha = -this.nextLevelTimer.delta()), this.drawOriginalShieldOpening())
  8015. },
  8016. updateOriginalShieldOpening: function() {
  8017. this.initTimer && 0 < this.initTimer.delta() &&
  8018. (this.initTimer = null, this.sheildTimer = new ig.Timer(0.05));
  8019. this.sheildTimer && 0 < this.sheildTimer.delta() && (3 > this.shieldAnim ? (this.shieldAnim++, this.sheildTimer.reset()) : (this.sheildTimer = null, this.moveTimer = new ig.Timer(0.0010), this.mIconTimer = new ig.Timer(0.05), this.titleTimer = new ig.Timer(0.15)));
  8020. this.moveTimer && 0 < this.moveTimer.delta() && (this.move += 0.3, this.moveTimer.reset());
  8021. this.mIconTimer && 0 < this.mIconTimer.delta() && (12 > this.mIconAnim ? (this.mIconAnim++, this.moveTimer.reset()) : this.mIconTimer =
  8022. null);
  8023. this.titleTimer && 0 < this.titleTimer.delta() && (11 > this.titleAnim ? (this.titleAnim++, this.titleTimer.reset()) : (this.titleTimer = null, this.nextLevelTimer = new ig.Timer(1)));
  8024. this.nextLevelTimer && 0 < this.nextLevelTimer.delta() && (this.nextLevelTimer = null, ig.game.director.nextLevel(), ig.system.context.globalAlpha = 1)
  8025. },
  8026. drawOriginalShieldOpening: function() {
  8027. if (this.moveTimer) {
  8028. var b = ig.system.context;
  8029. b.save();
  8030. var c = ig.system.width / 2,
  8031. d = ig.system.height / 2;
  8032. b.translate(c, d);
  8033. b.rotate(this.move * Math.PI / 180);
  8034. b.beginPath();
  8035. b.moveTo(0, 0);
  8036. for (var g = 0, j = 1; 48 >= j; j += 1) b.lineTo(0 + 800 * Math.cos(2 * j * Math.PI / 48), 0 + 800 * Math.sin(2 * j * Math.PI / 48)), g++, 2 == g && (g = 0, b.lineTo(0, 0));
  8037. b.translate(-c, -d);
  8038. c = b.createRadialGradient(c, d, 100, c, d, 250);
  8039. c.addColorStop(0, "rgba(255,255,255,0.1)");
  8040. c.addColorStop(1, "rgba(0,0,0,0)");
  8041. b.fillStyle = c;
  8042. b.fill();
  8043. b.restore()
  8044. }
  8045. this.shieldImage.drawTile(ig.system.width / 2 - 91, 0 - (768 - ig.system.height) / 2, this.shieldAnim, 182, 768);
  8046. this.moveTimer && (this.mIconImage.drawTile(ig.system.width / 2 - 96, ig.system.height / 2 - 70, this.mIconAnim,
  8047. 166, 160), this.titleImage.drawTile(ig.system.width / 2 - 204, ig.system.height / 2 + 100, this.titleAnim, 409, 76));
  8048. ig.system.context.globalAlpha = 1
  8049. }
  8050. })
  8051. });
  8052. ig.baked = !0;
  8053. ig.module("game.entities.opening-kitty").requires("impact.entity").defines(function() {
  8054. EntityOpeningKitty = ig.Entity.extend({
  8055. size: {
  8056. x: 48,
  8057. y: 48
  8058. },
  8059. kittyAnim: -1,
  8060. kittyImage: new ig.Image("media/graphics/opening/kitty.png"),
  8061. kittyTitleImage: new ig.Image("media/graphics/opening/kittytitle.png"),
  8062. init: function(b, c, d) {
  8063. this.parent(b, c, d)
  8064. },
  8065. ready: function() {
  8066. if (!ig.wm)
  8067. if (_SETTINGS.DeveloperBranding.Splash.Enabled) {
  8068. this.initTimer = new ig.Timer(0.1);
  8069. try {
  8070. ig.soundHandler.playSound(ig.soundHandler.SOUNDID.kittyopeningSound)
  8071. } catch (b) {
  8072. console.log(b)
  8073. }
  8074. } else ig.game.director.nextLevel(),
  8075. ig.system.context.globalAlpha = 1, this.kill()
  8076. },
  8077. update: function() {
  8078. this.parent();
  8079. this.updateKittyOpening()
  8080. },
  8081. draw: function() {
  8082. this.parent();
  8083. ig.global.wm || (this.nextLevelTimer && 0 > this.nextLevelTimer.delta() && (ig.system.context.globalAlpha = -this.nextLevelTimer.delta()), this.drawKittyOpening())
  8084. },
  8085. updateKittyOpening: function() {
  8086. this.initTimer && 0 < this.initTimer.delta() && (this.initTimer = null, this.kittyTimer = new ig.Timer(0.15));
  8087. this.kittyTimer && 0 < this.kittyTimer.delta() && (7 > this.kittyAnim ? (this.kittyAnim++, this.kittyTimer.reset()) :
  8088. (this.kittyTimer = null, this.nextLevelTimer = new ig.Timer(2)));
  8089. this.nextLevelTimer && 0 < this.nextLevelTimer.delta() && (this.nextLevelTimer = null, ig.game.director.nextLevel(), ig.system.context.globalAlpha = 1)
  8090. },
  8091. drawKittyOpening: function() {
  8092. var b = ig.system.context.createLinearGradient(0, 0, 0, ig.system.height);
  8093. b.addColorStop(0, "#ffed94");
  8094. b.addColorStop(1, "#ffcd85");
  8095. ig.system.context.fillStyle = b;
  8096. ig.system.context.fillRect(0, 0, ig.system.width, ig.system.height);
  8097. 0 <= this.kittyAnim && (this.kittyImage.drawTile(ig.system.width /
  8098. 2 - this.kittyImage.width / 8, ig.system.height / 2 - this.kittyImage.height / 4, this.kittyAnim, 218, 325), this.kittyTitleImage.drawTile(ig.system.width / 2 - this.kittyTitleImage.width / 2, ig.system.height / 2 + this.kittyImage.height / 4 + 10, this.kittyAnim, 380, 37));
  8099. ig.system.context.globalAlpha = 1
  8100. }
  8101. })
  8102. });
  8103. ig.baked = !0;
  8104. ig.module("game.entities.pointer").requires("impact.entity").defines(function() {
  8105. EntityPointer = ig.Entity.extend({
  8106. type: ig.Entity.TYPE.A,
  8107. checkAgainst: ig.Entity.TYPE.B,
  8108. isClicking: !1,
  8109. isHovering: !1,
  8110. firstClick: !1,
  8111. isReleased: !1,
  8112. hoveringItem: null,
  8113. objectArray: [],
  8114. ignorePause: !0,
  8115. zIndex: 5E3,
  8116. check: function(b) {
  8117. this.objectArray.push(b)
  8118. },
  8119. clickObject: function(b) {
  8120. this.isClicking && !this.firstClick && "function" == typeof b.clicked && (b.clicked(), this.firstClick = !0);
  8121. this.firstClick && !this.isReleased && "function" == typeof b.clicking &&
  8122. b.clicking();
  8123. this.firstClick && this.isReleased && "function" == typeof b.released && (b.released(), this.firstClick = !1)
  8124. },
  8125. update: function() {
  8126. if (ig.ua.mobile) {
  8127. var b = window.innerHeight / mobileHeight;
  8128. this.pos.x = ig.input.mouse.x / (window.innerWidth / mobileWidth) - this.size.x / 2 + ig.game.screen.x;
  8129. this.pos.y = ig.input.mouse.y / b - this.size.y / 2
  8130. } else this.pos.x = ig.input.mouse.x - this.size.x / 2, this.pos.y = ig.input.mouse.y - this.size.y / 2;
  8131. var b = null,
  8132. c = -1;
  8133. for (a = this.objectArray.length - 1; - 1 < a; a--) this.objectArray[a].zIndex > c && (c = this.objectArray[a].zIndex,
  8134. b = this.objectArray[a]);
  8135. null != b ? ("close" == b.name && console.log(b), null != this.hoveringItem && "function" == typeof this.hoveringItem.idle && this.hoveringItem != b && this.hoveringItem.idle(), this.hoveringItem = b, this.clickObject(b), this.objectArray = []) : null != this.hoveringItem && "function" == typeof this.hoveringItem.idle && (this.hoveringItem.idle(), this.hoveringItem = null);
  8136. this.isClicking = ig.input.pressed("click");
  8137. this.isReleased = ig.input.released("click")
  8138. }
  8139. })
  8140. });
  8141. ig.baked = !0;
  8142. ig.module("game.entities.pointer-selector").requires("game.entities.pointer").defines(function() {
  8143. EntityPointerSelector = EntityPointer.extend({
  8144. zIndex: 1E3,
  8145. _wmDrawBox: !0,
  8146. _wmBoxColor: "rgba(0, 0, 255, 0.7)",
  8147. size: {
  8148. x: 20,
  8149. y: 20
  8150. },
  8151. init: function(b, c, d) {
  8152. this.parent(b, c, d)
  8153. }
  8154. })
  8155. });
  8156. ig.baked = !0;
  8157. ig.module("game.entities.select").requires("impact.entity").defines(function() {
  8158. EntitySelect = ig.Entity.extend({
  8159. type: ig.Entity.TYPE.B,
  8160. checkAgainst: ig.Entity.TYPE.A,
  8161. collides: ig.Entity.COLLIDES.NEVER,
  8162. canSelect: !1,
  8163. canSelectTimerDuration: 0.35,
  8164. zIndex: 99999,
  8165. isHovering: !1,
  8166. isSelected: !1,
  8167. init: function(b, c, d) {
  8168. this.parent(b, c, d);
  8169. this.canSelectTimer = new ig.Timer(this.canSelectTimerDuration)
  8170. },
  8171. doesClickableLayerExist: function(b) {
  8172. for (k in dynamicClickableEntityDivs)
  8173. if (k == b) return !0;
  8174. return !1
  8175. },
  8176. checkClickableLayer: function(b,
  8177. c, d) {
  8178. "undefined" == typeof wm && (this.doesClickableLayerExist(b) ? (ig.game.showOverlay([b]), $("#" + b).find("[href]").attr("href", c)) : this.createClickableOutboundLayer(b, c, "media/graphics/misc/invisible.png", d))
  8179. },
  8180. createClickableOutboundLayer: function(b, c, d, g) {
  8181. var j = ig.$new("div");
  8182. j.id = b;
  8183. document.body.appendChild(j);
  8184. $("#" + j.id).css("float", "left");
  8185. $("#" + j.id).css("width", this.size.x * multiplier);
  8186. $("#" + j.id).css("height", this.size.y * multiplier);
  8187. $("#" + j.id).css("position", "absolute");
  8188. var n = w / 2 - destW / 2,
  8189. y = h /
  8190. 2 - destH / 2;
  8191. w == mobileWidth ? ($("#" + j.id).css("left", this.pos.x), $("#" + j.id).css("top", this.pos.y)) : ($("#" + j.id).css("left", n + this.pos.x * multiplier), $("#" + j.id).css("top", y + this.pos.y * multiplier));
  8192. g ? $("#" + j.id).html("<a target='_blank' href='" + c + "'><img style='width:100%;height:100%' src='" + d + "'></a>") : $("#" + j.id).html("<a href='" + c + "'><img style='width:100%;height:100%' src='" + d + "'></a>");
  8193. dynamicClickableEntityDivs[b] = {};
  8194. dynamicClickableEntityDivs[b].width = $("#" + j.id).width();
  8195. dynamicClickableEntityDivs[b].height =
  8196. $("#" + j.id).height();
  8197. dynamicClickableEntityDivs[b].entity_pos_x = this.pos.x;
  8198. dynamicClickableEntityDivs[b].entity_pos_y = this.pos.y
  8199. },
  8200. hovered: function() {
  8201. this.isHovering = !0;
  8202. this.dehoverOthers()
  8203. },
  8204. dehoverOthers: function() {
  8205. var b = ig.game.getEntitiesByType(EntitySelect);
  8206. for (i = 0; i < b.length; i++) b[i] != this && (b[i].isHovering = !1)
  8207. },
  8208. deselectOthers: function() {
  8209. var b = ig.game.getEntitiesByType(EntitySelect);
  8210. for (i = 0; i < b.length; i++) b[i] != this && (b[i].isSelected = !1)
  8211. },
  8212. update: function() {
  8213. this.parent();
  8214. this.canSelectTimer && 0 <
  8215. this.canSelectTimer.delta() && (this.canSelect = !0, this.canSelectTimer = null)
  8216. }
  8217. })
  8218. });
  8219. ig.baked = !0;
  8220. ig.module("game.levels.opening").requires("impact.image", "game.entities.opening-kitty").defines(function() {
  8221. LevelOpening = {
  8222. entities: [{
  8223. type: "EntityOpeningKitty",
  8224. x: 520,
  8225. y: 212
  8226. }],
  8227. layer: []
  8228. }
  8229. });
  8230. ig.baked = !0;
  8231. ig.module("game.entities.plain").requires("impact.entity").defines(function() {
  8232. EntityPlain = ig.Entity.extend({
  8233. redraw: !1,
  8234. clearColor: null,
  8235. tweening: !1,
  8236. which: 0,
  8237. base: {
  8238. x: 240,
  8239. y: 0,
  8240. sc: 1,
  8241. oriSc: 1,
  8242. scX: 1,
  8243. scY: 1,
  8244. alp: 1,
  8245. rot: 0,
  8246. textSize: 26,
  8247. tweening: !1,
  8248. frameCount: 0,
  8249. frameTime: 1,
  8250. frame: 0,
  8251. frameX: 1,
  8252. frameY: 1,
  8253. frames: [0],
  8254. tFrame: 1,
  8255. loop: !1,
  8256. ended: !1,
  8257. cent: !0
  8258. },
  8259. stay: [],
  8260. size: {
  8261. x: 50,
  8262. y: 50
  8263. },
  8264. init: function(b, c, d) {
  8265. this.parent(b, c, d);
  8266. ig.global.wm || (this.ctx = ig.system.context)
  8267. },
  8268. ready: function() {
  8269. this.parent();
  8270. this.main = ig.game.getEntitiesByType(EntityPlainGame)[0];
  8271. this.pointer = ig.game.getEntitiesByType(EntityPointer)[0];
  8272. this.sky = ig.game.getEntitiesByType(EntityPlainSky)[0];
  8273. this.ground = ig.game.getEntitiesByType(EntityPlainGround)[0];
  8274. this.tree = ig.game.getEntitiesByType(EntityPlainTree)[0];
  8275. this.plane = ig.game.getEntitiesByType(EntityPlainPlane)[0];
  8276. this.puffer = ig.game.getEntitiesByType(EntityPlainPuffer)[0];
  8277. this.gui = ig.game.getEntitiesByType(EntityPlainGui)[0];
  8278. this.gameBut = ig.game.getEntitiesByType(EntityPlainGameBut)
  8279. },
  8280. update: function() {
  8281. this.parent()
  8282. },
  8283. soundLooper: function(b) {
  8284. null ==
  8285. this[this.sLoop[b].id + "sTimer"] && (this[this.sLoop[b].id + "sTimer"] = new ig.Timer, this[this.sLoop[b].id + "sTime"] = this.sLoop[b].duration, this.sounder(b));
  8286. this[this.sLoop[b].id + "sTimer"].delta() > this[this.sLoop[b].id + "sTime"] && (this[b + "sTimer"].reset(), this.sounder(b))
  8287. },
  8288. soundLoopReset: function(b) {
  8289. this[b + "sTimer"].reset()
  8290. },
  8291. sounder: function(b) {
  8292. try {
  8293. ig.soundHandler.playSound(ig.soundHandler.SOUNDID[b])
  8294. } catch (c) {
  8295. console.log(c)
  8296. }
  8297. },
  8298. pointXY: function() {
  8299. this.pos.x = this.pointer.pos.x;
  8300. this.pos.y = this.pointer.pos.y;
  8301. console.log(this.pos.x, this.pos.y)
  8302. },
  8303. resetFrame: function(b) {
  8304. this[b].ended = !1;
  8305. this[b].frame = 0
  8306. },
  8307. runFrame: function(b) {
  8308. !0 != this[b].ended && (!1 == this[b].loop && this[b].frame == this[b].frames.length - 1 ? (this[b].ended = !0, this.done(b)) : 1 < this[b].frames.length && this[b].frameTimer.delta() > this[b].frameTime && (this[b].frameTimer.reset(), this[b].frame = (this[b].frame + 1) % this[b].frames.length))
  8309. },
  8310. tweener: function(b, c, d, g, j) {
  8311. var n = {};
  8312. n[b] = c;
  8313. null == j && (j = 0);
  8314. null == g && (g = "none");
  8315. this.tween("this" == b ? c : n, d, {
  8316. delay: j,
  8317. targ: b,
  8318. seq: g,
  8319. onComplete: function() {
  8320. null != g && this.tweenF(g, b)
  8321. }.bind(this),
  8322. easing: ig.Tween.Easing.Quadratic.EaseOut
  8323. }).start()
  8324. },
  8325. tweener2: function(b, c, d, g, j) {
  8326. var n = {};
  8327. n[b] = c;
  8328. null == j && (j = 0);
  8329. null == g && (g = "none");
  8330. this.tween("this" == b ? c : n, d, {
  8331. delay: j,
  8332. targ: b,
  8333. seq: g,
  8334. onComplete: function() {
  8335. null != g && this.tweenF(g, b)
  8336. }.bind(this),
  8337. easing: ig.Tween.Easing.Quadratic.EaseIn
  8338. }).start()
  8339. },
  8340. lookAt: function(b, c) {
  8341. return Math.atan2(c.y + c.size.y / 2 - (b.y + this.size.y / 2), c.x + c.size.x / 2 - (b.x + this.size.x / 2))
  8342. },
  8343. sizer: function(b, c, d, g, j, n, y, r) {
  8344. this.size.x =
  8345. b.width / c * this.base.oriSc + (y || 0);
  8346. this.size.y = b.height / d * this.base.oriSc + (r || 0);
  8347. !0 == n ? (this.pos.x = g - this.size.x / 2, this.pos.y = j - this.size.y / 2) : (this.pos.x = g, this.pos.y = j)
  8348. },
  8349. pauseT: function() {
  8350. this.pauseTweens()
  8351. },
  8352. unpauseT: function() {
  8353. this.resumeTweens()
  8354. },
  8355. unpause: function() {
  8356. for (var b = 0; b < this.main.timers.length; b++) this.main.timers[b].unpause();
  8357. this.unpauseT()
  8358. },
  8359. pause: function() {
  8360. for (var b = 0; b < this.main.timers.length; b++) this.main.timers[b].pause();
  8361. this.pauseT()
  8362. },
  8363. tinyTween: function(b, c, d) {
  8364. if (b > c) return b -=
  8365. d, b < c && (b = c), b;
  8366. if (b < c) return b += d, b > c && (b = c), b;
  8367. if (b == c) return b
  8368. },
  8369. clearBg: function() {
  8370. ig.system.bgcontext.clearRect(0, 0, ig.system.width, ig.system.height);
  8371. ig.game.redrawEntities()
  8372. },
  8373. timitizer: function(b) {
  8374. var c = {};
  8375. c.secs = Math.floor(b);
  8376. c.Millis = Math.floor(100 * b);
  8377. c.ms = String(c.Millis % 100);
  8378. c.s = String(c.secs % 60);
  8379. c.m = String(Math.floor(c.secs / 60));
  8380. c.s = 0 == c.s.length ? "00" : 1 == c.s.length ? "0" + c.s : Number(c.s) % 60;
  8381. 0 == c.m.length ? c.m = "00" : 1 == c.m.length && (c.m = "0" + c.m);
  8382. 0 == c.ms.length ? c.ms = "00" : 1 == c.ms.length && (c.ms = "0" +
  8383. c.ms);
  8384. c.tx = c.m + ":" + c.s + "." + c.ms;
  8385. return c
  8386. },
  8387. centDraw: function(b, c, d, g) {
  8388. this.drawer("game", b, 1, 1, 0, c, d, g, g, !0)
  8389. },
  8390. drawer: function(b, c, d, g, j, n, y, r, z, A, B, l, p, t) {
  8391. try {
  8392. var x = "bg" == b ? ig.system.bgcontext : "game" == b ? ig.system.context : b;
  8393. null == p && (p = 0);
  8394. null == t && (t = 0);
  8395. null == r && (r = 1);
  8396. null == z && (z = 1);
  8397. null == B && (B = 1);
  8398. var L = c.width / d * (j % d),
  8399. H = c.height / g * Math.floor(j / d),
  8400. E = c.width / d,
  8401. N = c.height / g,
  8402. F = c.width / d * r,
  8403. K = c.height / g * z;
  8404. null == l || 0 == l ? (n = A ? n - F / 2 + p : n + p, y = A ? y - K / 2 + t : y + t, 0 < E && 0 < N && (x.globalAlpha = B, x.drawImage(c.data, L, H, E,
  8405. N, n, y, F, K), x.globalAlpha = 1)) : (p = A ? -E / 2 + p : p || 0, t = A ? -N / 2 + t : t || 0, 0 < E && 0 < N && (x.save(), x.translate(n, y), x.scale(r, z), x.rotate(2 * Math.PI / 360 * l), x.globalAlpha = B, x.drawImage(c.data, L, H, E, N, p, t, E, N), x.restore()))
  8406. } catch (O) {
  8407. console.log(c)
  8408. }
  8409. },
  8410. drawerOld: function(b, c, d, g, j, n, y, r, z, A, B) {
  8411. var l = ig.system.context;
  8412. A = A || 0;
  8413. B = B || 0;
  8414. null == n && (n = 1);
  8415. null == y && (y = 1);
  8416. null == r && (r = 1);
  8417. if (null != z) {
  8418. d *= b.width / c;
  8419. var p = b.width / c,
  8420. t = b.height;
  8421. c = b.width / c * n;
  8422. var x = b.height * y;
  8423. l.save();
  8424. l.translate(g, j);
  8425. null != z && l.rotate(2 * Math.PI / 360 * z);
  8426. l.scale(n,
  8427. y);
  8428. l.globalAlpha = r;
  8429. 0 < p && 0 < t && (0 < c && 0 < x) && l.drawImage(b.data, d, 0, p, t, A, B, c, x);
  8430. l.restore()
  8431. }
  8432. },
  8433. textSet: function(b, c, d) {
  8434. b = "bg" == b ? ig.system.bgcontext : "game" == b ? ig.system.context : b;
  8435. b.font = c + "px tex";
  8436. b.fillStyle = d
  8437. },
  8438. textLib: function(b, c, d) {
  8439. d = d || 0;
  8440. this.textDraw("game", _STRINGS.Game[b][3], _STRINGS.Game[b][4], _STRINGS.Game[b][0], (c || 0) + _STRINGS.Game[b][1] - this.ctx.measureText(_STRINGS.Game[b][0]).width / 2 * _STRINGS.Game[b][3], _STRINGS.Game[b][2] + d)
  8441. },
  8442. textLibLeft: function(b, c, d) {
  8443. this.textDraw("game", _STRINGS.Game[b][3],
  8444. _STRINGS.Game[b][4], _STRINGS.Game[b][0], (c || 0) + _STRINGS.Game[b][1], _STRINGS.Game[b][2] + (d || 0))
  8445. },
  8446. textW: function(b) {
  8447. return this.ctx.measureText(b).width
  8448. },
  8449. textDraw: function(b, c, d, g, j, n) {
  8450. b = "bg" == b ? ig.system.bgcontext : "game" == b ? ig.system.context : b;
  8451. b.save();
  8452. var y = b.measureText("M").width * d;
  8453. b.translate(j, n + y);
  8454. b.scale(c, d);
  8455. b.fillText(g, 0, 0);
  8456. b.restore()
  8457. },
  8458. shuffleArray: function(b) {
  8459. for (var c = b.length, d, g; 0 < c;) g = Math.floor(Math.random() * c), c--, d = b[c], b[c] = b[g], b[g] = d;
  8460. return b
  8461. },
  8462. getScore: function(b) {
  8463. if (!this.checkNull(ig.game.storage) &&
  8464. this.supports_local_storage()) switch (b) {
  8465. case "score":
  8466. ig.game.storage.isSet(ig.game.scoreKey + ig.game.lvl) && void 0 != ig.game.storage.get(ig.game.scoreKey + ig.game.lvl) && (ig.game.rank = ig.game.storage.get(ig.game.scoreKey + ig.game.lvl));
  8467. break;
  8468. case "tut":
  8469. return ig.game.storage.isSet(ig.game.tutKey) && void 0 != ig.game.storage.get(ig.game.tutKey) ? ig.game.storage.get(ig.game.tutKey) : !1
  8470. } else return !1
  8471. },
  8472. setScore: function(b, c) {
  8473. if (!this.checkNull(ig.game.storage) && this.supports_local_storage()) switch (b) {
  8474. case "score":
  8475. ig.game.storage.set(ig.game.gameKey, {
  8476. star: ig.game.star,
  8477. lvl: ig.game.lvl,
  8478. mission: ig.game.mission,
  8479. map: ig.game.map,
  8480. player: ig.game.player,
  8481. nextLvl: ig.game.nextLvl,
  8482. seq: ig.game.seq
  8483. });
  8484. break;
  8485. case "score2":
  8486. ig.game.storage.set(ig.game.gameKey, {
  8487. star: ig.game.star,
  8488. lvl: ig.game.lvl,
  8489. mission: ig.game.mission,
  8490. map: ig.game.map,
  8491. player: ig.game.player,
  8492. nextLvl: ig.game.nextLvl,
  8493. seq: ig.game.seq
  8494. });
  8495. break;
  8496. case "rank":
  8497. if (ig.game.storage.isSet(ig.game.scoreKey + ig.game.lvl) && void 0 != ig.game.storage.get(ig.game.scoreKey + ig.game.lvl)) {
  8498. for (var d = ig.game.storage.get(ig.game.scoreKey +
  8499. ig.game.lvl), g = 0, j = 0; j < d.length; j++) void 0 != d[j] && d[j].score > c && g++;
  8500. if (0 < g || 4 > d.length) d.push({
  8501. score: c
  8502. }), d.sort(function(b, c) {
  8503. return b.score < c.score ? -1 : b.score > c.score ? 1 : 0
  8504. }), 3 < d.length && d.splice(3, 1), ig.game.storage.set(ig.game.scoreKey + ig.game.lvl, d)
  8505. } else d = [], d.push({
  8506. score: c
  8507. }), ig.game.storage.set(ig.game.scoreKey + ig.game.lvl, d);
  8508. break;
  8509. case "tutOn":
  8510. ig.game.storage.isSet(ig.game.tutKey) && ig.game.storage.get(ig.game.tutKey);
  8511. ig.game.storage.set(ig.game.tutKey, !0);
  8512. break;
  8513. case "tutOff":
  8514. ig.game.storage.isSet(ig.game.tutKey) &&
  8515. void 0 != ig.game.storage.get(ig.game.tutKey) ? ig.game.storage.set(ig.game.tutKey, !1) : ig.game.storage.set(ig.game.tutKey, !0)
  8516. }
  8517. },
  8518. checkNull: function(b) {
  8519. return null == b || void 0 == b ? !0 : !1
  8520. },
  8521. supports_local_storage: function() {
  8522. try {
  8523. return localStorage.setItem("test", "test"), localStorage.removeItem("test"), "localStorage" in window && null !== window.localStorage
  8524. } catch (b) {
  8525. return !1
  8526. }
  8527. },
  8528. clicked: function() {
  8529. this.click = !0;
  8530. this.release = !1
  8531. },
  8532. released: function() {
  8533. this.click = !1;
  8534. this.release = !0
  8535. }
  8536. })
  8537. });
  8538. ig.baked = !0;
  8539. ig.module("game.entities.plain-home-but").requires("game.entities.plain").defines(function() {
  8540. EntityPlainHomeBut = EntityPlain.extend({
  8541. gravityFactor: 0,
  8542. type: ig.Entity.TYPE.B,
  8543. zIndex: 1E3,
  8544. size: {
  8545. x: 27,
  8546. y: 27
  8547. },
  8548. locked: !1,
  8549. offset: {
  8550. x: 0,
  8551. y: 0
  8552. },
  8553. playIm: new ig.AnimationSheet("media/graphics/sprites/play.png", 173, 123),
  8554. moreIm: new ig.AnimationSheet("media/graphics/sprites/more.png", 62, 45),
  8555. muteIm: new ig.AnimationSheet("media/graphics/sprites/sound.png", 50, 48),
  8556. unmuteIm: new ig.AnimationSheet("media/graphics/sprites/mute.png",
  8557. 50, 48),
  8558. tutIm: new ig.AnimationSheet("media/graphics/sprites/tut.png", 48, 47),
  8559. setIm: new ig.AnimationSheet("media/graphics/sprites/setting.png", 44, 48),
  8560. muteAni: {},
  8561. unmuteAni: {},
  8562. init: function(b, c, d) {
  8563. ig.global.wm || (this.main = d.main, this.seq = d.seq, this.oriStat(), this.parent(this.pos.x, this.pos.y, d), this.spawner())
  8564. },
  8565. idle: function() {
  8566. this.setScale(1, 1);
  8567. this.currentAnim = this.anims.idle
  8568. },
  8569. clicked: function() {
  8570. if (!this.locked) {
  8571. this.setScale(0.85, 0.85);
  8572. switch (this.seq) {
  8573. case 0:
  8574. ig.game.director.jumpTo(LevelMission);
  8575. break;
  8576. case 2:
  8577. !0 == ig.soundHandler.muted ? (this.anims.idle = new ig.Animation(this.muteIm, 1, [0]), this.anims.select = new ig.Animation(this.muteIm, 1, [1]), this.anims.grey = new ig.Animation(this.muteIm, 1, [2]), ig.soundHandler.setForceMuted(!1), ig.soundHandler.unmute()) : (ig.soundHandler.mute(), ig.soundHandler.setForceMuted(!0), this.anims.idle = new ig.Animation(this.unmuteIm, 1, [0]), this.anims.select = new ig.Animation(this.unmuteIm, 1, [1]), this.anims.grey = new ig.Animation(this.unmuteIm, 1, [2])), ig.game.storage.set(ig.game.soundKey,
  8578. ig.soundHandler.muted)
  8579. }
  8580. this.sounder("click")
  8581. }
  8582. },
  8583. oriStat: function() {
  8584. this.setScale(1, 1);
  8585. this.animSheet = this.closeIm;
  8586. this.base.x = this.pos.x;
  8587. this.base.y = this.pos.y;
  8588. switch (this.seq) {
  8589. case 0:
  8590. this.pos.x = 245;
  8591. this.pos.y = 350;
  8592. this.animSheet = this.playIm;
  8593. break;
  8594. case 1:
  8595. this.pos.x = 570;
  8596. this.pos.y = 423;
  8597. this.animSheet = this.moreIm;
  8598. break;
  8599. case 2:
  8600. this.pos.x = 10;
  8601. this.pos.y = 10;
  8602. !0 == ig.soundHandler.muted ? (this.animSheet = this.unmuteIm, this.unmuteAni.idle = new ig.Animation(this.unmuteIm, 1, [0]), this.unmuteAni.select = new ig.Animation(this.unmuteIm,
  8603. 1, [1]), this.unmuteAni.grey = new ig.Animation(this.unmuteIm, 1, [2])) : (this.animSheet = this.muteIm, this.muteAni.idle = new ig.Animation(this.muteIm, 1, [0]), this.muteAni.select = new ig.Animation(this.muteIm, 1, [1]), this.muteAni.grey = new ig.Animation(this.muteIm, 1, [2]));
  8604. break;
  8605. case 3:
  8606. this.pos.x = 586;
  8607. this.pos.y = 7;
  8608. this.animSheet = this.tutIm;
  8609. break;
  8610. case 4:
  8611. this.pos.x = 586, this.pos.y = 423, this.animSheet = this.setIm
  8612. }
  8613. this.addAnim("idle", 1, [0]);
  8614. this.addAnim("select", 1, [1]);
  8615. this.addAnim("grey", 1, [2]);
  8616. this.currentAnim = this.anims.idle;
  8617. this.size.x = this.animSheet.width;
  8618. this.size.y = this.animSheet.height
  8619. },
  8620. spawner: function() {},
  8621. tweenF: function() {},
  8622. update: function() {
  8623. ig.global.wm || (this.parent(), 2 == this.seq && !0 == ig.game.changeSound && (ig.game.changeSound = !1, !0 == ig.soundHandler.muted ? (this.anims.idle = new ig.Animation(this.unmuteIm, 1, [0]), this.anims.select = new ig.Animation(this.unmuteIm, 1, [1]), this.anims.grey = new ig.Animation(this.unmuteIm, 1, [2])) : (this.anims.idle = new ig.Animation(this.muteIm, 1, [0]), this.anims.select = new ig.Animation(this.muteIm,
  8624. 1, [1]), this.anims.grey = new ig.Animation(this.muteIm, 1, [2])), this.currentAnim = this.anims.idle), !this.locked && null != this.pointer && (this.pointer.hoveringItem == this && !this.pointer.firstClick) && (this.setScale(1, 1), this.currentAnim = this.anims.select))
  8625. },
  8626. drawInit: function() {},
  8627. ready: function() {
  8628. this.parent()
  8629. },
  8630. draw: function() {
  8631. this.parent()
  8632. }
  8633. })
  8634. });
  8635. ig.baked = !0;
  8636. ig.module("game.entities.plain-home").requires("game.entities.plain", "game.entities.plain-home-but", "game.entities.button-more-games").defines(function() {
  8637. EntityPlainHome = EntityPlain.extend({
  8638. gravityFactor: 0,
  8639. type: ig.Entity.TYPE.B,
  8640. zIndex: 1,
  8641. h: 600,
  8642. w: 800,
  8643. boardOn: !1,
  8644. ranks: [0, 0, 0, 0],
  8645. size: {
  8646. x: 800,
  8647. y: 600
  8648. },
  8649. gameOver: !1,
  8650. gamePaused: !1,
  8651. score: 0,
  8652. clue: 0,
  8653. ans: 10,
  8654. ques: [],
  8655. bgIm: new ig.Image("media/graphics/sprites/home-bg.png"),
  8656. logoIm: new ig.Image("media/graphics/sprites/logo.png"),
  8657. planeIm: new ig.Image("media/graphics/sprites/home-plane.png"),
  8658. scarfIm: new ig.Image("media/graphics/sprites/home-scarf.png"),
  8659. fanIm: new ig.Image("media/graphics/sprites/fan.png"),
  8660. init: function(b, c, d) {
  8661. ig.global.wm || (this.parent(b, c, d), this.oriStat(), this.spawner())
  8662. },
  8663. genQues: function() {},
  8664. pauseGame: function() {},
  8665. resumeGame: function() {},
  8666. oriStat: function() {
  8667. this.base = {
  8668. x: 330,
  8669. task: "none",
  8670. y: 230,
  8671. sc: 1,
  8672. oriSc: 0.9,
  8673. scX: 1,
  8674. scY: 1,
  8675. alp: 1,
  8676. rot: 0,
  8677. textSize: 26,
  8678. tweening: !1,
  8679. frameCount: 0,
  8680. frameTime: 1,
  8681. frame: 0,
  8682. frameX: 1,
  8683. frameY: 1,
  8684. frames: [0],
  8685. tFrame: 1,
  8686. loop: !1,
  8687. ended: !1,
  8688. cent: !0
  8689. };
  8690. this.plane = {
  8691. x: 158,
  8692. task: "none",
  8693. y: 150,
  8694. sc: 1,
  8695. oriSc: 0.9,
  8696. scX: 1,
  8697. scY: 1,
  8698. alp: 1,
  8699. rot: 0,
  8700. textSize: 26,
  8701. tweening: !1,
  8702. frameCount: 0,
  8703. frameTime: 0.02,
  8704. frameTimer: new ig.Timer,
  8705. frame: 0,
  8706. frameX: 1,
  8707. frameY: 1,
  8708. frames: [0, 1, 2, 2, 3],
  8709. tFrame: 1,
  8710. loop: !0,
  8711. ended: !1,
  8712. cent: !0
  8713. };
  8714. this.scarf = {
  8715. x: -40,
  8716. task: "none",
  8717. y: -37,
  8718. sc: 1,
  8719. oriSc: 0.9,
  8720. scX: 1,
  8721. scY: 1,
  8722. alp: 1,
  8723. rot: 0,
  8724. textSize: 26,
  8725. tweening: !1,
  8726. frameCount: 0,
  8727. frameTime: 0.05,
  8728. frameTimer: new ig.Timer,
  8729. frame: 0,
  8730. frameX: 1,
  8731. frameY: 1,
  8732. frames: [0, 1, 2, 3, 4, 5],
  8733. tFrame: 1,
  8734. loop: !0,
  8735. ended: !1,
  8736. cent: !0
  8737. };
  8738. this.fan = {
  8739. x: 65,
  8740. task: "none",
  8741. y: -6,
  8742. sc: 1,
  8743. oriSc: 0.9,
  8744. offX: [0,
  8745. 0, 0, 0, 0
  8746. ],
  8747. offY: [0, 1, 3, 3, 1],
  8748. scX: 1,
  8749. scY: 1,
  8750. alp: 1,
  8751. rot: 0,
  8752. textSize: 26,
  8753. tweening: !1,
  8754. frameCount: 0,
  8755. frameTime: 0.05,
  8756. frameTimer: new ig.Timer,
  8757. frame: 0,
  8758. frameX: 1,
  8759. frameY: 1,
  8760. frames: [0, 1, 2, 2, 3],
  8761. tFrame: 1,
  8762. loop: !0,
  8763. ended: !1,
  8764. cent: !0
  8765. }
  8766. },
  8767. spawner: function() {
  8768. ig.game.spawnEntity(EntityPointer, 800, 800, {
  8769. main: this
  8770. });
  8771. for (var b = 0; 3 > b; b++) ig.game.spawnEntity(EntityPlainHomeBut, -200, -200, {
  8772. main: this,
  8773. seq: b
  8774. });
  8775. _SETTINGS.MoreGames.Enabled && ig.game.spawnEntity(EntityButtonMoreGames, 570, 423, {
  8776. main: this,
  8777. seq: b
  8778. })
  8779. },
  8780. tweenF: function(b) {
  8781. switch (b) {
  8782. case "logo0":
  8783. this.tweener("base", {
  8784. scY: 0.9,
  8785. scX: 1
  8786. }, 0.6, "logo1");
  8787. break;
  8788. case "logo1":
  8789. this.tweener("base", {
  8790. scY: 0.98,
  8791. scX: 0.98
  8792. }, 0.6, "logo0")
  8793. }
  8794. },
  8795. update: function() {
  8796. ig.global.wm || (this.parent(), this.runFrame("plane"), this.runFrame("scarf"), this.runFrame("fan"))
  8797. },
  8798. drawInit: function() {},
  8799. ready: function() {
  8800. this.pointer = ig.game.getEntitiesByType(EntityPointer)[0];
  8801. this.tweenF("logo0")
  8802. },
  8803. draw: function() {
  8804. this.parent();
  8805. ig.global.wm || (this.bgIm.draw(0, 0), this.drawer("game", this.logoIm, 1, 1, 0, this.base.x, this.base.y, this.base.scX, this.base.scY, !0), this.drawer("game",
  8806. this.planeIm, 2, 2, this.plane.frames[this.plane.frame], this.plane.x, this.plane.y, this.plane.sc, this.plane.sc, !0), this.drawer("game", this.scarfIm, 6, 1, this.scarf.frames[this.scarf.frame], this.plane.x + this.scarf.x, this.plane.y + this.scarf.y + this.fan.offY[this.plane.frame], this.scarf.sc, this.scarf.sc, !0), this.drawer("game", this.fanIm, 4, 1, this.fan.frames[this.fan.frame], this.plane.x + this.fan.x, this.plane.y + this.fan.y + this.fan.offY[this.plane.frame], this.fan.sc, this.fan.sc, !0))
  8807. }
  8808. })
  8809. });
  8810. ig.baked = !0;
  8811. ig.module("game.levels.home").requires("impact.image", "game.entities.plain-home").defines(function() {
  8812. LevelHome = {
  8813. entities: [{
  8814. type: "EntityPlainHome",
  8815. x: 0,
  8816. y: 0
  8817. }],
  8818. layer: []
  8819. }
  8820. });
  8821. ig.baked = !0;
  8822. ig.module("game.entities.plain-over-but").requires("game.entities.plain").defines(function() {
  8823. EntityPlainOverBut = EntityPlain.extend({
  8824. gravityFactor: 0,
  8825. type: ig.Entity.TYPE.B,
  8826. zIndex: 1E3,
  8827. size: {
  8828. x: 27,
  8829. y: 27
  8830. },
  8831. locked: !1,
  8832. offset: {
  8833. x: 0,
  8834. y: 0
  8835. },
  8836. playIm: new ig.AnimationSheet("media/graphics/sprites/play.png", 173, 123),
  8837. shopIm: new ig.AnimationSheet("media/graphics/sprites/selectPlane.png", 193.5, 92),
  8838. mapIm: new ig.AnimationSheet("media/graphics/sprites/map.png", 506 / 3, 91),
  8839. muteIm: new ig.AnimationSheet("media/graphics/sprites/sound.png",
  8840. 50, 48),
  8841. unmuteIm: new ig.AnimationSheet("media/graphics/sprites/mute.png", 50, 48),
  8842. muteAni: {},
  8843. unmuteAni: {},
  8844. init: function(b, c, d) {
  8845. ig.global.wm || (this.main = d.main, this.seq = d.seq, this.oriStat(), this.parent(this.pos.x, this.pos.y, d), this.spawner())
  8846. },
  8847. idle: function() {
  8848. this.setScale(1, 1);
  8849. this.currentAnim = this.anims.idle
  8850. },
  8851. clicked: function() {
  8852. if (!this.locked) {
  8853. this.setScale(0.85, 0.85);
  8854. switch (this.seq) {
  8855. case 0:
  8856. !1 == ig.game.afterFirstPlay ? ig.game.afterFirstPlay = !0 : ig.game.seq = (ig.game.seq + 1) % ig.game.theme.length;
  8857. ig.game.what =
  8858. ig.game.theme[ig.game.seq];
  8859. ig.game.director.jumpTo(LevelGame);
  8860. break;
  8861. case 1:
  8862. ig.game.oriNavi = "over";
  8863. ig.game.director.jumpTo(LevelShop);
  8864. break;
  8865. case 2:
  8866. !0 == ig.soundHandler.muted ? (this.anims.idle = new ig.Animation(this.muteIm, 1, [0]), this.anims.select = new ig.Animation(this.muteIm, 1, [1]), this.anims.grey = new ig.Animation(this.muteIm, 1, [2]), ig.soundHandler.setForceMuted(!1), ig.soundHandler.unmute()) : (ig.soundHandler.mute(), ig.soundHandler.setForceMuted(!0), this.anims.idle = new ig.Animation(this.unmuteIm, 1, [0]),
  8867. this.anims.select = new ig.Animation(this.unmuteIm, 1, [1]), this.anims.grey = new ig.Animation(this.unmuteIm, 1, [2]));
  8868. ig.game.storage.set(ig.game.soundKey, ig.soundHandler.muted);
  8869. break;
  8870. case 3:
  8871. ig.game.oriNavi = "over", ig.game.director.jumpTo(LevelMap)
  8872. }
  8873. this.sounder("click")
  8874. }
  8875. },
  8876. oriStat: function() {
  8877. this.setScale(1, 1);
  8878. this.animSheet = this.closeIm;
  8879. this.base.x = this.pos.x;
  8880. this.base.y = this.pos.y;
  8881. switch (this.seq) {
  8882. case 0:
  8883. this.pos.x = 245;
  8884. this.pos.y = 300;
  8885. this.animSheet = this.playIm;
  8886. break;
  8887. case 1:
  8888. this.pos.x = 232;
  8889. this.pos.y = 389;
  8890. this.animSheet = this.shopIm;
  8891. break;
  8892. case 2:
  8893. this.pos.x = 10;
  8894. this.pos.y = 10;
  8895. !0 == ig.soundHandler.muted ? (this.animSheet = this.unmuteIm, this.unmuteAni.idle = new ig.Animation(this.unmuteIm, 1, [0]), this.unmuteAni.select = new ig.Animation(this.unmuteIm, 1, [1]), this.unmuteAni.grey = new ig.Animation(this.unmuteIm, 1, [2])) : (this.animSheet = this.muteIm, this.muteAni.idle = new ig.Animation(this.muteIm, 1, [0]), this.muteAni.select = new ig.Animation(this.muteIm, 1, [1]), this.muteAni.grey = new ig.Animation(this.muteIm, 1, [2]));
  8896. break;
  8897. case 3:
  8898. this.pos.x =
  8899. 0, this.pos.y = 400, this.animSheet = this.mapIm, this.kill()
  8900. }
  8901. this.addAnim("idle", 1, [0]);
  8902. this.addAnim("select", 1, [1]);
  8903. this.addAnim("grey", 1, [2]);
  8904. this.currentAnim = this.anims.idle;
  8905. this.size.x = this.animSheet.width;
  8906. this.size.y = this.animSheet.height;
  8907. this.oriY = this.pos.y;
  8908. this.pos.y = -700
  8909. },
  8910. spawner: function() {},
  8911. tweenF: function() {},
  8912. update: function() {
  8913. ig.global.wm || (this.parent(), 2 == this.seq && !0 == ig.game.changeSound && (ig.game.changeSound = !1, !0 == ig.soundHandler.muted ? (this.anims.idle = new ig.Animation(this.unmuteIm, 1, [0]), this.anims.select = new ig.Animation(this.unmuteIm, 1, [1]), this.anims.grey = new ig.Animation(this.unmuteIm, 1, [2])) : (this.anims.idle = new ig.Animation(this.muteIm, 1, [0]), this.anims.select = new ig.Animation(this.muteIm, 1, [1]), this.anims.grey = new ig.Animation(this.muteIm, 1, [2])), this.currentAnim = this.anims.idle), !0 == this.main.tweening ? this.pos.y = 2 == this.seq ? this.main.offY + this.oriY : this.main.offUp + this.oriY : null != this.pointer && this.pointer.hoveringItem == this && !this.pointer.firstClick && (this.setScale(1,
  8914. 1), this.currentAnim = this.anims.select))
  8915. },
  8916. drawInit: function() {},
  8917. ready: function() {
  8918. this.pointer = ig.game.getEntitiesByType(EntityPointer)[0]
  8919. },
  8920. draw: function() {
  8921. this.parent()
  8922. }
  8923. })
  8924. });
  8925. ig.baked = !0;
  8926. ig.module("game.entities.plain-over").requires("game.entities.plain", "game.entities.plain-over-but").defines(function() {
  8927. EntityPlainOver = EntityPlain.extend({
  8928. gravityFactor: 0,
  8929. type: ig.Entity.TYPE.B,
  8930. zIndex: 1,
  8931. h: 600,
  8932. w: 800,
  8933. boardOn: !1,
  8934. ranks: [0, 0, 0, 0],
  8935. size: {
  8936. x: 800,
  8937. y: 600
  8938. },
  8939. gameOver: !1,
  8940. gamePaused: !1,
  8941. offY: -700,
  8942. offX: -700,
  8943. offUp: 700,
  8944. score: 0,
  8945. clue: 0,
  8946. ans: 10,
  8947. ques: [],
  8948. bgIm: new ig.Image("media/graphics/sprites/mission-bg.png"),
  8949. fanIm: new ig.Image("media/graphics/sprites/fan.png"),
  8950. planeIm: new ig.Image("media/graphics/sprites/home-plane.png"),
  8951. scarfIm: new ig.Image("media/graphics/sprites/home-scarf.png"),
  8952. speechIm: new ig.Image("media/graphics/sprites/speech.png"),
  8953. cloudIm0: new ig.Image("media/graphics/sprites/cloud0.png"),
  8954. cloudIm1: new ig.Image("media/graphics/sprites/cloud1.png"),
  8955. cloudIm2: new ig.Image("media/graphics/sprites/cloud2.png"),
  8956. levelIm: new ig.Image("media/graphics/sprites/level.png"),
  8957. starIm: new ig.Image("media/graphics/sprites/mission-star.png"),
  8958. sLoop: {
  8959. score: {
  8960. id: "score",
  8961. duration: 0.08
  8962. }
  8963. },
  8964. init: function(b, c, d) {
  8965. ig.global.wm || (this.parent(b,
  8966. c, d), this.oriStat(), this.spawner(), this.starText = ig.game.star, this.nextLvl = 1500 * ig.game.lvl + 150 * ig.game.lvl, this.tweening = !0)
  8967. },
  8968. genQues: function() {},
  8969. pauseGame: function() {},
  8970. resumeGame: function() {},
  8971. oriStat: function() {
  8972. this.base = {
  8973. x: 240,
  8974. task: "none",
  8975. y: 130,
  8976. sc: 1,
  8977. oriSc: 0.9,
  8978. scX: 1,
  8979. scY: 1,
  8980. alp: 1,
  8981. rot: 0,
  8982. textSize: 26,
  8983. tweening: !1,
  8984. frameCount: 0,
  8985. frameTime: 1,
  8986. frame: 0,
  8987. frameX: 1,
  8988. frameY: 1,
  8989. frames: [0],
  8990. tFrame: 1,
  8991. loop: !1,
  8992. ended: !1,
  8993. cent: !0
  8994. };
  8995. this.cloud = {
  8996. offY: 0
  8997. };
  8998. this.plane = {
  8999. x: 118,
  9000. task: "none",
  9001. y: 290,
  9002. sc: 1,
  9003. oriSc: 0.9,
  9004. scX: 1,
  9005. scY: 1,
  9006. alp: 1,
  9007. rot: 0,
  9008. textSize: 26,
  9009. tweening: !1,
  9010. frameCount: 0,
  9011. frameTime: 0.02,
  9012. frameTimer: new ig.Timer,
  9013. frame: 0,
  9014. frameX: 1,
  9015. frameY: 1,
  9016. frames: [0, 1, 2, 2, 3],
  9017. tFrame: 1,
  9018. loop: !0,
  9019. ended: !1,
  9020. cent: !0
  9021. };
  9022. this.scarf = {
  9023. x: -40,
  9024. task: "none",
  9025. y: -37,
  9026. sc: 1,
  9027. oriSc: 0.9,
  9028. scX: 1,
  9029. scY: 1,
  9030. alp: 1,
  9031. rot: 0,
  9032. textSize: 26,
  9033. tweening: !1,
  9034. frameCount: 0,
  9035. frameTime: 0.05,
  9036. frameTimer: new ig.Timer,
  9037. frame: 0,
  9038. frameX: 1,
  9039. frameY: 1,
  9040. frames: [0, 1, 2, 3, 4, 5],
  9041. tFrame: 1,
  9042. loop: !0,
  9043. ended: !1,
  9044. cent: !0
  9045. };
  9046. this.fan = {
  9047. x: 65,
  9048. task: "none",
  9049. y: -6,
  9050. sc: 1,
  9051. oriSc: 0.9,
  9052. offX: [0, 0, 0, 0, 0],
  9053. offY: [0, 1, 3, 3, 1],
  9054. scX: 1,
  9055. scY: 1,
  9056. alp: 1,
  9057. rot: 0,
  9058. textSize: 26,
  9059. tweening: !1,
  9060. frameCount: 0,
  9061. frameTime: 0.05,
  9062. frameTimer: new ig.Timer,
  9063. frame: 0,
  9064. frameX: 1,
  9065. frameY: 1,
  9066. frames: [0, 1, 2, 2, 3],
  9067. tFrame: 1,
  9068. loop: !0,
  9069. ended: !1,
  9070. cent: !0
  9071. }
  9072. },
  9073. spawner: function() {
  9074. ig.game.spawnEntity(EntityPointer, 800, 800, {
  9075. main: this
  9076. });
  9077. for (var b = 0; 4 > b; b++) ig.game.spawnEntity(EntityPlainOverBut, -200, -200, {
  9078. main: this,
  9079. seq: b
  9080. })
  9081. },
  9082. tweenF: function(b) {
  9083. switch (b) {
  9084. case "cloud0":
  9085. this.tweener("cloud", {
  9086. offY: 5
  9087. }, 0.5, "cloud1");
  9088. break;
  9089. case "cloud1":
  9090. this.tweener("cloud", {
  9091. offY: 0
  9092. }, 0.5, "cloud0");
  9093. break;
  9094. case "starText1":
  9095. this.starText != ig.game.storage.get(ig.game.gameKey).star &&
  9096. (this.scoreTweening = !0, this.tweener("this", {
  9097. starText: ig.game.storage.get(ig.game.gameKey).star
  9098. }, 0.5, "starText2"));
  9099. break;
  9100. case "starText2":
  9101. this.scoreTweening = !1;
  9102. this.starText != ig.game.storage.get(ig.game.gameKey).star && (ig.game.star = ig.game.storage.get(ig.game.gameKey).star);
  9103. break;
  9104. case "textDown1":
  9105. this.tweening = !0;
  9106. this.tweener("this", {
  9107. offY: 0
  9108. }, 0.4, "textDown3");
  9109. break;
  9110. case "textDown3":
  9111. this.tweenF("planeIn0");
  9112. this.tweenF("starText1");
  9113. break;
  9114. case "planeIn0":
  9115. this.tweener("this", {
  9116. offX: 0
  9117. }, 0.5, "buttonUp0");
  9118. break;
  9119. case "planeIn1":
  9120. this.tweener("this", {
  9121. offX: 0
  9122. }, 0.3);
  9123. this.tweenF("buttonUp0");
  9124. break;
  9125. case "buttonUp0":
  9126. this.tweener("this", {
  9127. offUp: 0
  9128. }, 0.4, "buttonUp1");
  9129. break;
  9130. case "buttonUp1":
  9131. this.tweening = !1
  9132. }
  9133. },
  9134. update: function() {
  9135. ig.global.wm || (this.parent(), !0 == this.scoreTweening && this.soundLooper("score"), this.runFrame("plane"), this.runFrame("scarf"), this.runFrame("fan"))
  9136. },
  9137. drawInit: function() {},
  9138. ready: function() {
  9139. this.pointer = ig.game.getEntitiesByType(EntityPointer)[0];
  9140. this.tweenF("cloud0");
  9141. this.tweenF("starText1");
  9142. this.tweenF("textDown1")
  9143. },
  9144. draw: function() {
  9145. this.parent();
  9146. ig.global.wm || (this.bgIm.draw(0, 0), this.cloudIm2.draw(48, 79 + this.cloud.offY), this.cloudIm1.draw(427, 81 + this.cloud.offY), this.cloudIm0.draw(439, 253 + this.cloud.offY), this.drawer("game", this.planeIm, 2, 2, this.plane.frames[this.plane.frame], this.plane.x + this.offX, this.plane.y, this.plane.sc, this.plane.sc, !0), this.drawer("game", this.scarfIm, 6, 1, this.scarf.frames[this.scarf.frame], this.plane.x + this.scarf.x + this.offX, this.plane.y + this.scarf.y + this.fan.offY[this.plane.frame], this.scarf.sc,
  9147. this.scarf.sc, !0), this.drawer("game", this.fanIm, 4, 1, this.fan.frames[this.fan.frame], this.plane.x + this.fan.x + this.offX, this.plane.y + this.fan.y + this.fan.offY[this.plane.frame], this.fan.sc, this.fan.sc, !0), this.levelIm.draw(327 - this.levelIm.width / 2, 273 + this.offY - 60), this.drawer("game", this.starIm, 1, 1, 0, 320 - 1.3 * (this.ctx.measureText(Math.floor(this.starText)).width / 2) - 15 + 16, 168 + this.offY - 5 - 60, 0.9, 0.9, !0), this.textSet("game", 35, "white"), this.ctx.fillStyle = "#661408", this.textDraw("game", 0.9, 1, ig.game.lvl,
  9148. 326 - 0.9 * (this.ctx.measureText(ig.game.lvl).width / 2) + 2, 305 + this.offY - 60), this.ctx.fillStyle = "white", this.textDraw("game", 0.9, 1, ig.game.lvl, 326 - 0.9 * (this.ctx.measureText(ig.game.lvl).width / 2), 303 + this.offY - 60), this.ctx.fillStyle = "#10527B", this.textDraw("game", 1.2, 1.3, Math.floor(this.starText), 346 - 1.2 * (this.ctx.measureText(Math.floor(this.starText)).width / 2) + 3, 167 + this.offY - 5 - 60), this.ctx.fillStyle = "white", this.textDraw("game", 1.2, 1.3, Math.floor(this.starText), 346 - 1.2 * (this.ctx.measureText(Math.floor(this.starText)).width /
  9149. 2), 164 + this.offY - 5 - 60), this.ctx.fillStyle = "#10527B", this.textDraw("game", _STRINGS.Game.newLevel[3], _STRINGS.Game.newLevel[4], _STRINGS.Game.newLevel[0], _STRINGS.Game.newLevel[1] - 1.1 * (this.ctx.measureText(_STRINGS.Game.newLevel[0]).width / 2) + 3, _STRINGS.Game.newLevel[2] + 3 + this.offY - 60), this.ctx.fillStyle = "white", this.textDraw("game", _STRINGS.Game.newLevel[3], _STRINGS.Game.newLevel[4], _STRINGS.Game.newLevel[0], _STRINGS.Game.newLevel[1] - 1.1 * (this.ctx.measureText(_STRINGS.Game.newLevel[0]).width / 2), _STRINGS.Game.newLevel[2] +
  9150. this.offY - 60))
  9151. }
  9152. })
  9153. });
  9154. ig.baked = !0;
  9155. ig.module("game.levels.over").requires("impact.image", "game.entities.plain-over").defines(function() {
  9156. LevelOver = {
  9157. entities: [{
  9158. type: "EntityPlainOver",
  9159. x: 0,
  9160. y: 0
  9161. }],
  9162. layer: []
  9163. }
  9164. });
  9165. ig.baked = !0;
  9166. ig.module("game.entities.plain-mission-but").requires("game.entities.plain").defines(function() {
  9167. EntityPlainMissionBut = EntityPlain.extend({
  9168. gravityFactor: 0,
  9169. type: ig.Entity.TYPE.B,
  9170. zIndex: 1E3,
  9171. size: {
  9172. x: 27,
  9173. y: 27
  9174. },
  9175. locked: !1,
  9176. offset: {
  9177. x: 0,
  9178. y: 0
  9179. },
  9180. playIm: new ig.AnimationSheet("media/graphics/sprites/play.png", 173, 123),
  9181. shopIm: new ig.AnimationSheet("media/graphics/sprites/selectPlane.png", 193.5, 92),
  9182. mapIm: new ig.AnimationSheet("media/graphics/sprites/map.png", 506 / 3, 91),
  9183. muteIm: new ig.AnimationSheet("media/graphics/sprites/sound.png",
  9184. 50, 48),
  9185. unmuteIm: new ig.AnimationSheet("media/graphics/sprites/mute.png", 50, 48),
  9186. homeIm: new ig.AnimationSheet("media/graphics/sprites/home.png", 132, 86),
  9187. retryIm: new ig.AnimationSheet("media/graphics/sprites/retry.png", 403 / 3 - 1, 85),
  9188. bookIm: new ig.AnimationSheet("media/graphics/sprites/bookbut.png", 460 / 3, 88),
  9189. muteAni: {},
  9190. unmuteAni: {},
  9191. init: function(b, c, d) {
  9192. ig.global.wm || (this.main = d.main, this.seq = d.seq, this.oriStat(), this.parent(this.pos.x, this.pos.y, d), this.spawner())
  9193. },
  9194. idle: function() {
  9195. this.setScale(1, 1);
  9196. this.currentAnim =
  9197. this.anims.idle
  9198. },
  9199. clicked: function() {
  9200. if (!this.locked) {
  9201. this.setScale(0.85, 0.85);
  9202. switch (this.seq) {
  9203. case 0:
  9204. !1 == ig.game.afterFirstPlay ? ig.game.afterFirstPlay = !0 : ig.game.seq = (ig.game.seq + 1) % ig.game.theme.length;
  9205. ig.game.what = ig.game.theme[ig.game.seq];
  9206. ig.game.director.jumpTo(LevelGame);
  9207. break;
  9208. case 1:
  9209. ig.game.oriNavi = "mission";
  9210. ig.game.director.jumpTo(LevelShop);
  9211. break;
  9212. case 2:
  9213. !0 == ig.soundHandler.muted ? (this.anims.idle = new ig.Animation(this.muteIm, 1, [0]), this.anims.select = new ig.Animation(this.muteIm, 1, [1]), this.anims.grey =
  9214. new ig.Animation(this.muteIm, 1, [2]), ig.soundHandler.setForceMuted(!1), ig.soundHandler.unmute()) : (ig.soundHandler.mute(), ig.soundHandler.setForceMuted(!0), this.anims.idle = new ig.Animation(this.unmuteIm, 1, [0]), this.anims.select = new ig.Animation(this.unmuteIm, 1, [1]), this.anims.grey = new ig.Animation(this.unmuteIm, 1, [2]));
  9215. ig.game.storage.set(ig.game.soundKey, ig.soundHandler.muted);
  9216. break;
  9217. case 3:
  9218. ig.game.oriNavi = "mission";
  9219. ig.game.director.jumpTo(LevelMap);
  9220. break;
  9221. case 4:
  9222. ig.game.director.jumpTo(LevelHome);
  9223. break;
  9224. case 5:
  9225. ig.game.oriNavi = "mission";
  9226. ig.game.director.jumpTo(LevelBook);
  9227. break;
  9228. case 6:
  9229. ig.game.director.jumpTo(LevelGame)
  9230. }
  9231. this.sounder("click")
  9232. }
  9233. },
  9234. oriStat: function() {
  9235. this.setScale(1, 1);
  9236. this.base.x = this.pos.x;
  9237. this.base.y = this.pos.y;
  9238. switch (this.seq) {
  9239. case 0:
  9240. this.pos.x = 242;
  9241. this.pos.y = 280;
  9242. this.animSheet = this.playIm;
  9243. break;
  9244. case 1:
  9245. this.pos.x = 232;
  9246. this.pos.y = 369;
  9247. this.animSheet = this.shopIm;
  9248. break;
  9249. case 2:
  9250. this.pos.x = 10;
  9251. this.pos.y = 10;
  9252. !0 == ig.soundHandler.muted ? (this.animSheet = this.unmuteIm, this.unmuteAni.idle = new ig.Animation(this.unmuteIm,
  9253. 1, [0]), this.unmuteAni.select = new ig.Animation(this.unmuteIm, 1, [1]), this.unmuteAni.grey = new ig.Animation(this.unmuteIm, 1, [2])) : (this.animSheet = this.muteIm, this.muteAni.idle = new ig.Animation(this.muteIm, 1, [0]), this.muteAni.select = new ig.Animation(this.muteIm, 1, [1]), this.muteAni.grey = new ig.Animation(this.muteIm, 1, [2]));
  9254. break;
  9255. case 3:
  9256. this.pos.x = 0;
  9257. this.pos.y = 400;
  9258. this.animSheet = this.mapIm;
  9259. this.kill();
  9260. break;
  9261. case 4:
  9262. this.pos.x = !1 == ig.game.afterFirstPlay ? 180 : 125;
  9263. this.pos.y = 162;
  9264. this.animSheet = this.homeIm;
  9265. break;
  9266. case 5:
  9267. this.pos.x = !1 == ig.game.afterFirstPlay ? 320 - this.bookIm.width / 2 * this.scale.x + 55 : 320 - this.bookIm.width / 2 * this.scale.x;
  9268. this.pos.y = 160;
  9269. this.animSheet = this.bookIm;
  9270. ig.game.oriNavi = "mission";
  9271. break;
  9272. case 6:
  9273. this.pos.x = !1 == ig.game.afterFirstPlay ? -376 : 376, this.pos.y = 163, this.animSheet = this.retryIm
  9274. }
  9275. this.addAnim("idle", 1, [0]);
  9276. this.addAnim("select", 1, [1]);
  9277. this.addAnim("grey", 1, [2]);
  9278. this.currentAnim = this.anims.idle;
  9279. this.pos.x += 15;
  9280. this.pos.y += 15;
  9281. this.size.x = this.animSheet.width - 30;
  9282. this.size.y = this.animSheet.height -
  9283. 30;
  9284. this.offset.x = 15;
  9285. this.offset.y = 15;
  9286. this.oriY = this.pos.y;
  9287. this.pos.y = -700
  9288. },
  9289. spawner: function() {},
  9290. tweenF: function() {},
  9291. update: function() {
  9292. ig.global.wm || (this.parent(), 2 == this.seq && !0 == ig.game.changeSound && (ig.game.changeSound = !1, !0 == ig.soundHandler.muted ? (this.anims.idle = new ig.Animation(this.unmuteIm, 1, [0]), this.anims.select = new ig.Animation(this.unmuteIm, 1, [1]), this.anims.grey = new ig.Animation(this.unmuteIm, 1, [2])) : (this.anims.idle = new ig.Animation(this.muteIm, 1, [0]), this.anims.select = new ig.Animation(this.muteIm,
  9293. 1, [1]), this.anims.grey = new ig.Animation(this.muteIm, 1, [2])), this.currentAnim = this.anims.idle), !0 == this.main.tweening ? this.pos.y = 4 == this.seq || 5 == this.seq || 6 == this.seq || 2 == this.seq ? this.main.offY + this.oriY : this.main.offUp + this.oriY : null != this.pointer && this.pointer.hoveringItem == this && !this.pointer.firstClick && (this.setScale(1, 1), this.currentAnim = this.anims.select))
  9294. },
  9295. drawInit: function() {},
  9296. ready: function() {
  9297. this.pointer = ig.game.getEntitiesByType(EntityPointer)[0]
  9298. },
  9299. draw: function() {
  9300. this.parent()
  9301. }
  9302. })
  9303. });
  9304. ig.baked = !0;
  9305. ig.module("game.entities.plain-mission").requires("game.entities.plain", "game.entities.plain-mission-but").defines(function() {
  9306. EntityPlainMission = EntityPlain.extend({
  9307. gravityFactor: 0,
  9308. type: ig.Entity.TYPE.B,
  9309. zIndex: 1,
  9310. h: 600,
  9311. w: 800,
  9312. boardOn: !1,
  9313. ranks: [0, 0, 0, 0],
  9314. size: {
  9315. x: 800,
  9316. y: 600
  9317. },
  9318. gameOver: !1,
  9319. gamePaused: !1,
  9320. score: 0,
  9321. offY: -700,
  9322. offX: -700,
  9323. offUp: 700,
  9324. starText: 0,
  9325. clue: 0,
  9326. nextLvl: 0,
  9327. ans: 10,
  9328. ques: [],
  9329. bgIm: new ig.Image("media/graphics/sprites/mission-bg.png"),
  9330. fanIm: new ig.Image("media/graphics/sprites/fan.png"),
  9331. planeIm: new ig.Image("media/graphics/sprites/home-plane.png"),
  9332. scarfIm: new ig.Image("media/graphics/sprites/home-scarf.png"),
  9333. speechIm: new ig.Image("media/graphics/sprites/speech.png"),
  9334. cloudIm0: new ig.Image("media/graphics/sprites/cloud0.png"),
  9335. cloudIm1: new ig.Image("media/graphics/sprites/cloud1.png"),
  9336. cloudIm2: new ig.Image("media/graphics/sprites/cloud2.png"),
  9337. levelIm: new ig.Image("media/graphics/sprites/level.png"),
  9338. starIm: new ig.Image("media/graphics/sprites/mission-star.png"),
  9339. sLoop: {
  9340. score: {
  9341. id: "score",
  9342. duration: 0.08
  9343. }
  9344. },
  9345. init: function(b, c, d) {
  9346. ig.global.wm || (this.parent(b,
  9347. c, d), this.oriStat(), this.spawner(), this.textSet("game", 35, "white"), _STRINGS.Game.nextlevelNumber[0] = this.nextLvl, _STRINGS.Game.nextlevelNumber[1] = 320 + this.ctx.measureText(_STRINGS.Game.nextlevelMission[0]).width / 2, this.starText = ig.game.star, this.nextLvl = 2500 * ig.game.lvl + 150 * ig.game.lvl, this.tweening = !0)
  9348. },
  9349. genQues: function() {},
  9350. pauseGame: function() {},
  9351. resumeGame: function() {},
  9352. oriStat: function() {
  9353. this.tweening = !0;
  9354. this.base = {
  9355. x: 240,
  9356. task: "none",
  9357. y: 130,
  9358. sc: 1,
  9359. oriSc: 0.9,
  9360. scX: 1,
  9361. scY: 1,
  9362. alp: 1,
  9363. rot: 0,
  9364. textSize: 26,
  9365. tweening: !1,
  9366. frameCount: 0,
  9367. frameTime: 1,
  9368. frame: 0,
  9369. frameX: 1,
  9370. frameY: 1,
  9371. frames: [0],
  9372. tFrame: 1,
  9373. loop: !1,
  9374. ended: !1,
  9375. cent: !0
  9376. };
  9377. this.cloud = {
  9378. offY: 0
  9379. };
  9380. this.plane = {
  9381. x: 126,
  9382. task: "none",
  9383. y: 340,
  9384. sc: 1,
  9385. oriSc: 0.9,
  9386. scX: 1,
  9387. scY: 1,
  9388. alp: 1,
  9389. rot: 0,
  9390. textSize: 26,
  9391. tweening: !1,
  9392. frameCount: 0,
  9393. frameTime: 0.02,
  9394. frameTimer: new ig.Timer,
  9395. frame: 0,
  9396. frameX: 1,
  9397. frameY: 1,
  9398. frames: [0, 1, 2, 2, 3],
  9399. tFrame: 1,
  9400. loop: !0,
  9401. ended: !1,
  9402. cent: !0
  9403. };
  9404. this.scarf = {
  9405. x: -40,
  9406. task: "none",
  9407. y: -37,
  9408. sc: 1,
  9409. oriSc: 0.9,
  9410. scX: 1,
  9411. scY: 1,
  9412. alp: 1,
  9413. rot: 0,
  9414. textSize: 26,
  9415. tweening: !1,
  9416. frameCount: 0,
  9417. frameTime: 0.05,
  9418. frameTimer: new ig.Timer,
  9419. frame: 0,
  9420. frameX: 1,
  9421. frameY: 1,
  9422. frames: [0, 1, 2, 3, 4, 5],
  9423. tFrame: 1,
  9424. loop: !0,
  9425. ended: !1,
  9426. cent: !0
  9427. };
  9428. this.fan = {
  9429. x: 65,
  9430. task: "none",
  9431. y: -6,
  9432. sc: 1,
  9433. oriSc: 0.9,
  9434. offX: [0, 0, 0, 0, 0],
  9435. offY: [0, 1, 3, 3, 1],
  9436. scX: 1,
  9437. scY: 1,
  9438. alp: 1,
  9439. rot: 0,
  9440. textSize: 26,
  9441. tweening: !1,
  9442. frameCount: 0,
  9443. frameTime: 0.05,
  9444. frameTimer: new ig.Timer,
  9445. frame: 0,
  9446. frameX: 1,
  9447. frameY: 1,
  9448. frames: [0, 1, 2, 2, 3],
  9449. tFrame: 1,
  9450. loop: !0,
  9451. ended: !1,
  9452. cent: !0
  9453. }
  9454. },
  9455. spawner: function() {
  9456. ig.game.spawnEntity(EntityPointer, 800, 800, {
  9457. main: this
  9458. });
  9459. for (var b = 0; 7 > b; b++) ig.game.spawnEntity(EntityPlainMissionBut, -200, -200, {
  9460. main: this,
  9461. seq: b
  9462. })
  9463. },
  9464. tweenF: function(b) {
  9465. switch (b) {
  9466. case "cloud0":
  9467. this.tweener("cloud", {
  9468. offY: 5
  9469. }, 0.3, "cloud1");
  9470. break;
  9471. case "cloud1":
  9472. this.tweener("cloud", {
  9473. offY: 0
  9474. }, 0.3, "cloud0");
  9475. break;
  9476. case "textDown1":
  9477. this.tweener("this", {
  9478. offY: 0
  9479. }, 0.4, "textDown3");
  9480. break;
  9481. case "textDown2":
  9482. this.tweener("this", {
  9483. offY: 0
  9484. }, 0.2, "textDown3");
  9485. break;
  9486. case "textDown3":
  9487. this.sounder("flip");
  9488. this.tweenF("planeIn0");
  9489. this.tweenF("starText1");
  9490. break;
  9491. case "planeIn0":
  9492. this.tweener("this", {
  9493. offX: 0
  9494. }, 0.5, "buttonUp0");
  9495. break;
  9496. case "planeIn1":
  9497. this.tweener("this", {
  9498. offX: 0
  9499. },
  9500. 0.3);
  9501. this.tweenF("buttonUp0");
  9502. break;
  9503. case "buttonUp0":
  9504. this.sounder("flip");
  9505. this.tweener("this", {
  9506. offUp: 0
  9507. }, 0.4, "buttonUp1");
  9508. break;
  9509. case "buttonUp1":
  9510. this.sounder("flip");
  9511. this.tweening = !1;
  9512. break;
  9513. case "starText1":
  9514. this.starText != ig.game.storage.get(ig.game.gameKey).star && (this.scoreTweening = !0, this.tweener("this", {
  9515. starText: ig.game.storage.get(ig.game.gameKey).star
  9516. }, 0.5, "starText2"));
  9517. break;
  9518. case "starText2":
  9519. this.scoreTweening = !1, this.starText != ig.game.storage.get(ig.game.gameKey).star && (ig.game.star = ig.game.storage.get(ig.game.gameKey).star)
  9520. }
  9521. },
  9522. update: function() {
  9523. ig.global.wm || (this.parent(), !0 == this.scoreTweening && this.soundLooper("score"), this.runFrame("plane"), this.runFrame("scarf"), this.runFrame("fan"))
  9524. },
  9525. drawInit: function() {},
  9526. ready: function() {
  9527. this.pointer = ig.game.getEntitiesByType(EntityPointer)[0];
  9528. this.tweenF("cloud0");
  9529. this.tweenF("textDown1")
  9530. },
  9531. draw: function() {
  9532. this.parent();
  9533. ig.global.wm || (this.textSet("game", 35, "white"), this.bgIm.draw(0, 0), this.drawer("game", this.planeIm, 2, 2, this.plane.frames[this.plane.frame], this.plane.x + this.offX,
  9534. this.plane.y, this.plane.sc, this.plane.sc, !0), this.drawer("game", this.scarfIm, 6, 1, this.scarf.frames[this.scarf.frame], this.plane.x + this.scarf.x + this.offX, this.plane.y + this.scarf.y + this.fan.offY[this.plane.frame], this.scarf.sc, this.scarf.sc, !0), this.drawer("game", this.fanIm, 4, 1, this.fan.frames[this.fan.frame], this.plane.x + this.fan.x + this.offX, this.plane.y + this.fan.y + this.fan.offY[this.plane.frame], this.fan.sc, this.fan.sc, !0), this.ctx.fillStyle = "#242A2D", this.cloudIm2.draw(36, 109 + this.cloud.offY), this.cloudIm1.draw(427,
  9535. 60 + this.cloud.offY), this.cloudIm0.draw(480, 250 + this.cloud.offY), this.drawer("game", this.starIm, 1, 1, 0, 320 - 1.3 * (this.ctx.measureText(Math.floor(this.starText)).width / 2) - 32 + 16, 90 + this.offY, 0.9, 0.9, !0), this.ctx.fillStyle = "white", this.textDraw("game", 1.3, 1.5, Math.floor(this.starText), 320 - 1.3 * (this.ctx.measureText(Math.floor(this.starText)).width / 2) + 20, 88 + this.offY), 20 > ig.game.lvl ? (this.ctx.fillStyle = "#14325D", this.textDraw("game", _STRINGS.Game.nextlevelNumber[3], _STRINGS.Game.nextlevelNumber[4], this.nextLvl,
  9536. _STRINGS.Game.nextlevelMission[1] + this.ctx.measureText(_STRINGS.Game.nextlevelMission[0]).width / 2 * _STRINGS.Game.nextlevelMission[3] - this.ctx.measureText(this.nextLvl).width / 2, 135 + this.offY), this.textLib("nextlevelMission", -this.ctx.measureText(this.nextLvl).width / 2 * _STRINGS.Game.nextlevelNumber[3], this.offY)) : (this.ctx.fillStyle = "#14325D", this.textLib("maxLvl", 0, this.offY)))
  9537. }
  9538. })
  9539. });
  9540. ig.baked = !0;
  9541. ig.module("game.levels.mission").requires("impact.image", "game.entities.plain-mission").defines(function() {
  9542. LevelMission = {
  9543. entities: [{
  9544. type: "EntityPlainMission",
  9545. x: 0,
  9546. y: 0
  9547. }],
  9548. layer: []
  9549. }
  9550. });
  9551. ig.baked = !0;
  9552. ig.module("game.entities.plain-book-but").requires("game.entities.plain").defines(function() {
  9553. EntityPlainBookBut = EntityPlain.extend({
  9554. gravityFactor: 0,
  9555. type: ig.Entity.TYPE.B,
  9556. zIndex: 1E3,
  9557. size: {
  9558. x: 27,
  9559. y: 27
  9560. },
  9561. locked: !1,
  9562. offset: {
  9563. x: 0,
  9564. y: 0
  9565. },
  9566. backIm: new ig.AnimationSheet("media/graphics/sprites/back.png", 42, 55),
  9567. init: function(b, c, d) {
  9568. ig.global.wm || (this.main = d.main, this.seq = d.seq, this.oriStat(), this.parent(this.pos.x, this.pos.y, d), this.spawner())
  9569. },
  9570. idle: function() {
  9571. this.setScale(1, 1);
  9572. this.currentAnim = this.anims.idle
  9573. },
  9574. clicked: function() {
  9575. if (!this.locked) {
  9576. this.setScale(0.85, 0.85);
  9577. switch (ig.game.oriNavi) {
  9578. case "home":
  9579. ig.game.director.jumpTo(LevelHome);
  9580. break;
  9581. case "over":
  9582. ig.game.director.jumpTo(LevelOver);
  9583. break;
  9584. case "mission":
  9585. ig.game.director.jumpTo(LevelMission)
  9586. }
  9587. this.sounder("click")
  9588. }
  9589. },
  9590. oriStat: function() {
  9591. this.setScale(1, 1);
  9592. this.animSheet = this.backIm;
  9593. this.base.x = this.pos.x;
  9594. this.base.y = this.pos.y;
  9595. this.pos.x = 23;
  9596. this.pos.y = 500;
  9597. this.addAnim("idle", 1, [0]);
  9598. this.addAnim("select", 1, [1]);
  9599. this.addAnim("grey", 1, [2]);
  9600. this.currentAnim =
  9601. this.anims.idle;
  9602. this.size.x = this.animSheet.width;
  9603. this.size.y = this.animSheet.height
  9604. },
  9605. spawner: function() {},
  9606. tweenF: function() {},
  9607. update: function() {
  9608. ig.global.wm || (this.parent(), !this.locked && null != this.pointer && (this.pointer.hoveringItem == this && !this.pointer.firstClick) && (this.setScale(1, 1), this.currentAnim = this.anims.select))
  9609. },
  9610. drawInit: function() {},
  9611. ready: function() {
  9612. this.parent();
  9613. this.tweener("pos", {
  9614. y: 416
  9615. }, 0.3, "none", 0.5)
  9616. },
  9617. draw: function() {
  9618. this.parent()
  9619. }
  9620. })
  9621. });
  9622. ig.baked = !0;
  9623. ig.module("game.entities.plain-book").requires("game.entities.plain", "game.entities.plain-book-but").defines(function() {
  9624. EntityPlainBook = EntityPlain.extend({
  9625. gravityFactor: 0,
  9626. type: ig.Entity.TYPE.B,
  9627. zIndex: 1,
  9628. h: 600,
  9629. w: 800,
  9630. boardOn: !1,
  9631. ranks: [0, 0, 0, 0],
  9632. size: {
  9633. x: 800,
  9634. y: 600
  9635. },
  9636. gameOver: !1,
  9637. gamePaused: !1,
  9638. score: 0,
  9639. clue: 0,
  9640. ans: 10,
  9641. ques: [],
  9642. bgIm: new ig.Image("media/graphics/sprites/bookBg.png"),
  9643. bookIm: new ig.Image("media/graphics/sprites/book.png"),
  9644. wingRIm: new ig.Image("media/graphics/sprites/wing-r.png"),
  9645. wingLIm: new ig.Image("media/graphics/sprites/wing-l.png"),
  9646. starIm: new ig.Image("media/graphics/sprites/mission-star.png"),
  9647. init: function(b, c, d) {
  9648. ig.global.wm || (this.parent(b, c, d), this.oriStat(), this.spawner(), this.level = ig.game.lvl, this.score = ig.game.star, this.mission = ig.game.mission)
  9649. },
  9650. genQues: function() {},
  9651. pauseGame: function() {},
  9652. resumeGame: function() {},
  9653. oriStat: function() {
  9654. this.title = {
  9655. offY: -100
  9656. };
  9657. this.book = {
  9658. offY: 600,
  9659. line0: 600,
  9660. line1: 600,
  9661. line2: 600,
  9662. starSc: 0,
  9663. starAlp: 0
  9664. };
  9665. this.base = {
  9666. x: 240,
  9667. task: "none",
  9668. y: 130,
  9669. sc: 1,
  9670. oriSc: 0.9,
  9671. scX: 1,
  9672. scY: 1,
  9673. alp: 1,
  9674. rot: 0,
  9675. textSize: 26,
  9676. tweening: !1,
  9677. frameCount: 0,
  9678. frameTime: 1,
  9679. frame: 0,
  9680. frameX: 1,
  9681. frameY: 1,
  9682. frames: [0],
  9683. tFrame: 1,
  9684. loop: !1,
  9685. ended: !1,
  9686. cent: !0
  9687. }
  9688. },
  9689. spawner: function() {
  9690. ig.game.spawnEntity(EntityPointer, 800, 800, {
  9691. main: this
  9692. });
  9693. ig.game.spawnEntity(EntityPlainBookBut, -200, -200, {
  9694. main: this,
  9695. seq: 0
  9696. })
  9697. },
  9698. tweenF: function(b) {
  9699. switch (b) {
  9700. case "book0":
  9701. this.tweener("book", {
  9702. offY: -50
  9703. }, 0.3, "book1");
  9704. break;
  9705. case "book1":
  9706. this.tweener("book", {
  9707. offY: 0
  9708. }, 0.3);
  9709. this.tweener("book", {
  9710. line0: 0
  9711. }, 0.3, "none", 0.1);
  9712. this.tweener("book", {
  9713. line1: 0
  9714. }, 0.3, "none", 0.2);
  9715. this.tweener("book", {
  9716. line2: 0
  9717. },
  9718. 0.3, "none", 0.3);
  9719. this.tweener("book", {}, 0.8, "book2");
  9720. break;
  9721. case "book2":
  9722. this.book.starSc = 4;
  9723. this.tweener("book", {
  9724. starSc: 0.5,
  9725. starAlp: 1
  9726. }, 0.3, "book3");
  9727. this.sounder("flip");
  9728. break;
  9729. case "book3":
  9730. this.tweener("book", {
  9731. starSc: 0.8
  9732. }, 0.3);
  9733. break;
  9734. case "title0":
  9735. this.tweener("title", {
  9736. offY: 50
  9737. }, 0.3, "title1");
  9738. break;
  9739. case "title1":
  9740. this.tweener("title", {
  9741. offY: 0
  9742. }, 0.3), this.tweenF("book1")
  9743. }
  9744. },
  9745. update: function() {
  9746. ig.global.wm || this.parent()
  9747. },
  9748. drawInit: function() {},
  9749. ready: function() {
  9750. this.parent();
  9751. this.tweenF("title1")
  9752. },
  9753. draw: function() {
  9754. this.parent();
  9755. ig.global.wm || (this.bgIm.draw(0, 0), this.bookIm.draw(18, 119 + this.book.offY), this.textSet("game", 35, "white"), this.ctx.fillStyle = "#122149", this.textDraw("game", _STRINGS.Game.logbook[3], _STRINGS.Game.logbook[4], _STRINGS.Game.logbook[0], _STRINGS.Game.logbook[1] + 4 - this.ctx.measureText(_STRINGS.Game.logbook[0]).width / 2 * _STRINGS.Game.logbook[3], _STRINGS.Game.logbook[2] + 5 + this.title.offY), this.ctx.fillStyle = "white", this.textDraw("game", _STRINGS.Game.logbook[3], _STRINGS.Game.logbook[4], _STRINGS.Game.logbook[0],
  9756. _STRINGS.Game.logbook[1] + 4 - this.ctx.measureText(_STRINGS.Game.logbook[0]).width / 2 * _STRINGS.Game.logbook[3], _STRINGS.Game.logbook[2] + this.title.offY), this.wingLIm.draw(302 - this.ctx.measureText(_STRINGS.Game.logbook[0]).width / 2 * _STRINGS.Game.logbook[3] - this.wingLIm.width, 44 + this.title.offY), this.wingRIm.draw(338 + this.ctx.measureText(_STRINGS.Game.logbook[0]).width / 2 * _STRINGS.Game.logbook[3], 44 + this.title.offY), this.ctx.fillStyle = "#242A2D", this.textDraw("game", _STRINGS.Game.pilotLevel[3], _STRINGS.Game.pilotLevel[4],
  9757. _STRINGS.Game.pilotLevel[0], _STRINGS.Game.pilotLevel[1], _STRINGS.Game.pilotLevel[2] - 7 + this.book.line0), this.textDraw("game", _STRINGS.Game.score[3], _STRINGS.Game.score[4], _STRINGS.Game.score[0], _STRINGS.Game.score[1], _STRINGS.Game.score[2] - 7 + this.book.line1), this.textDraw("game", _STRINGS.Game.missions[3], _STRINGS.Game.missions[4], _STRINGS.Game.missions[0], _STRINGS.Game.missions[1], _STRINGS.Game.missions[2] - 7 + this.book.line2), this.textDraw("game", _STRINGS.Game.completed[3], _STRINGS.Game.completed[4],
  9758. _STRINGS.Game.completed[0], _STRINGS.Game.completed[1], _STRINGS.Game.completed[2] - 7 + this.book.line2), this.textDraw("game", _STRINGS.Game.pilotLevel[3] + 0.2, _STRINGS.Game.pilotLevel[4] + 0.2, this.level, 277 - this.ctx.measureText(this.level).width * _STRINGS.Game.pilotLevel[3], 185 + this.book.line0), this.textDraw("game", _STRINGS.Game.pilotLevel[3] + 0.2, _STRINGS.Game.pilotLevel[4] + 0.2, this.score, 277 - this.ctx.measureText(this.score).width * _STRINGS.Game.pilotLevel[3], 243 + this.book.line1), this.textDraw("game", _STRINGS.Game.pilotLevel[3] +
  9759. 0.2, _STRINGS.Game.pilotLevel[4] + 0.2, this.mission, 277 - this.ctx.measureText(this.mission).width * _STRINGS.Game.pilotLevel[3], 336 + this.book.line2), this.drawer("game", this.starIm, 1, 1, 0, 277 - this.ctx.measureText(this.score).width * _STRINGS.Game.pilotLevel[3] - 25, 246 + this.book.line1, this.book.starSc, this.book.starSc, !0, this.book.starAlp))
  9760. }
  9761. })
  9762. });
  9763. ig.baked = !0;
  9764. ig.module("game.levels.book").requires("impact.image", "game.entities.plain-book").defines(function() {
  9765. LevelBook = {
  9766. entities: [{
  9767. type: "EntityPlainBook",
  9768. x: 0,
  9769. y: 0
  9770. }],
  9771. layer: []
  9772. }
  9773. });
  9774. ig.baked = !0;
  9775. ig.module("game.entities.plain-shop-but").requires("game.entities.plain").defines(function() {
  9776. EntityPlainShopBut = EntityPlain.extend({
  9777. gravityFactor: 0,
  9778. type: ig.Entity.TYPE.B,
  9779. zIndex: 1E3,
  9780. size: {
  9781. x: 27,
  9782. y: 27
  9783. },
  9784. locked: !1,
  9785. offset: {
  9786. x: 0,
  9787. y: 0
  9788. },
  9789. textColor: "white",
  9790. leftIm: new ig.AnimationSheet("media/graphics/sprites/arrow-l.png", 194 / 3, 69),
  9791. rightIm: new ig.AnimationSheet("media/graphics/sprites/arrow-r.png", 194 / 3, 69),
  9792. backIm: new ig.AnimationSheet("media/graphics/sprites/back.png", 42, 55),
  9793. buttonIm: new ig.AnimationSheet("media/graphics/sprites/button.png",
  9794. 635 / 3, 70),
  9795. muteAni: {},
  9796. unmuteAni: {},
  9797. init: function(b, c, d) {
  9798. ig.global.wm || (this.main = d.main, this.seq = d.seq, this.oriStat(), this.parent(this.pos.x, this.pos.y, d), this.spawner())
  9799. },
  9800. idle: function() {
  9801. this.setScale(0.95, 0.95);
  9802. 2 != this.seq && (this.currentAnim = this.anims.idle)
  9803. },
  9804. clicked: function() {
  9805. this.sounder("click");
  9806. if (!this.locked) switch (this.setScale(0.85, 0.85), this.seq) {
  9807. case 0:
  9808. if (!0 == this.main.tweening) break;
  9809. this.main.tweenF("left0");
  9810. break;
  9811. case 1:
  9812. if (!0 == this.main.tweening) break;
  9813. this.main.tweenF("right0");
  9814. break;
  9815. case 2:
  9816. if (!0 == this.main.tweening) break;
  9817. if (ig.game.star < Number(this.main.prices[this.main.which])) break;
  9818. ig.game.player = this.main.which;
  9819. ig.game.storage.set(ig.game.gameKey, {
  9820. star: ig.game.star,
  9821. lvl: ig.game.lvl,
  9822. mission: ig.game.mission,
  9823. map: ig.game.map,
  9824. player: ig.game.player,
  9825. nextLvl: ig.game.nextLvl,
  9826. seq: ig.game.seq
  9827. });
  9828. break;
  9829. case 3:
  9830. switch (ig.game.oriNavi) {
  9831. case "home":
  9832. ig.game.director.jumpTo(LevelHome);
  9833. break;
  9834. case "over":
  9835. ig.game.director.jumpTo(LevelOver);
  9836. break;
  9837. case "mission":
  9838. ig.game.director.jumpTo(LevelMission)
  9839. }
  9840. }
  9841. },
  9842. oriStat: function() {
  9843. this.setScale(0.95, 0.95);
  9844. this.animSheet = this.closeIm;
  9845. this.base.x = this.pos.x;
  9846. this.base.y = this.pos.y;
  9847. switch (this.seq) {
  9848. case 0:
  9849. this.pos.x = 160 - this.leftIm.width;
  9850. this.pos.y = 184;
  9851. this.animSheet = this.leftIm;
  9852. break;
  9853. case 1:
  9854. this.pos.x = 480;
  9855. this.pos.y = 184;
  9856. this.animSheet = this.rightIm;
  9857. break;
  9858. case 2:
  9859. this.pos.x = 213;
  9860. this.pos.y = 387;
  9861. this.animSheet = this.buttonIm;
  9862. break;
  9863. case 3:
  9864. this.pos.x = 9;
  9865. this.pos.y = 418;
  9866. this.animSheet = this.backIm;
  9867. break;
  9868. case 4:
  9869. this.pos.x = 8, this.pos.y = 416, this.animSheet = this.setIm
  9870. }
  9871. this.addAnim("idle",
  9872. 1, [0]);
  9873. this.addAnim("select", 1, [1]);
  9874. this.addAnim("grey", 1, [2]);
  9875. this.currentAnim = this.anims.idle;
  9876. this.size.x = this.animSheet.width;
  9877. this.size.y = this.animSheet.height
  9878. },
  9879. spawner: function() {},
  9880. tweenF: function() {},
  9881. update: function() {
  9882. ig.global.wm || (this.parent(), 2 == this.seq && (ig.game.star < Number(this.main.prices[this.main.which]) ? (this.textColor = "#4E515D", this.currentAnim = this.anims.grey) : (this.textColor = "white", this.currentAnim = this.anims.idle)), !this.locked && null != this.pointer && (this.pointer.hoveringItem ==
  9883. this && !this.pointer.firstClick) && (this.setScale(1, 1), 2 != this.seq && (this.currentAnim = this.anims.select)))
  9884. },
  9885. drawInit: function() {},
  9886. ready: function() {
  9887. this.pointer = ig.game.getEntitiesByType(EntityPointer)[0]
  9888. },
  9889. draw: function() {
  9890. this.parent();
  9891. !ig.global.wm && 2 == this.seq && (this.ctx.fillStyle = this.textColor, ig.game.star < Number(this.main.prices[this.main.which]) ? this.textDraw("game", _STRINGS.Game.notenough[3] * this.scale.x, _STRINGS.Game.notenough[4] * this.scale.y, _STRINGS.Game.notenough[0], this.pos.x + this.size.x /
  9892. 2 - this.ctx.measureText(_STRINGS.Game.notenough[0]).width / 2 * _STRINGS.Game.notenough[3] * this.scale.x, this.pos.y + this.size.y / 2 - 5) : this.textDraw("game", _STRINGS.Game.select[3] * this.scale.x, _STRINGS.Game.select[4] * this.scale.y, _STRINGS.Game.select[0], this.pos.x + this.size.x / 2 - this.ctx.measureText(_STRINGS.Game.select[0]).width / 2 * _STRINGS.Game.select[3] * this.scale.x, this.pos.y + this.size.y / 2 - 5))
  9893. }
  9894. })
  9895. });
  9896. ig.baked = !0;
  9897. ig.module("game.entities.plain-shop").requires("game.entities.plain", "game.entities.plain-shop-but").defines(function() {
  9898. EntityPlainShop = EntityPlain.extend({
  9899. gravityFactor: 0,
  9900. type: ig.Entity.TYPE.B,
  9901. zIndex: 1,
  9902. h: 600,
  9903. w: 800,
  9904. boardOn: !1,
  9905. ranks: [0, 0, 0, 0],
  9906. size: {
  9907. x: 800,
  9908. y: 600
  9909. },
  9910. gameOver: !1,
  9911. gamePaused: !1,
  9912. score: 0,
  9913. clue: 0,
  9914. ans: 10,
  9915. ques: [],
  9916. prices: ["0000", 5E3, 1E4, 15E3],
  9917. bgIm: new ig.Image("media/graphics/sprites/bookBg.png"),
  9918. stageIm: new ig.Image("media/graphics/sprites/stage.png"),
  9919. starIm: new ig.Image("media/graphics/sprites/mission-star.png"),
  9920. planeIm0: new ig.Image("media/graphics/sprites/shop0.png"),
  9921. planeIm1: new ig.Image("media/graphics/sprites/shop1.png"),
  9922. planeIm2: new ig.Image("media/graphics/sprites/shop2.png"),
  9923. planeIm3: new ig.Image("media/graphics/sprites/shop3.png"),
  9924. init: function(b, c, d) {
  9925. ig.global.wm || (this.parent(b, c, d), this.oriStat(), this.spawner(), ig.game.star = ig.game.storage.get(ig.game.gameKey).star)
  9926. },
  9927. genQues: function() {},
  9928. pauseGame: function() {},
  9929. resumeGame: function() {},
  9930. oriStat: function() {
  9931. this.base = {
  9932. x: 240,
  9933. task: "none",
  9934. y: 130,
  9935. sc: 1,
  9936. oriSc: 0.9,
  9937. scX: 1,
  9938. scY: 1,
  9939. alp: 1,
  9940. rot: 0,
  9941. textSize: 26,
  9942. tweening: !1,
  9943. frameCount: 0,
  9944. frameTime: 1,
  9945. frame: 0,
  9946. frameX: 1,
  9947. frameY: 1,
  9948. frames: [0],
  9949. tFrame: 1,
  9950. loop: !1,
  9951. ended: !1,
  9952. cent: !0
  9953. };
  9954. this.plane = {
  9955. offX: 0,
  9956. alp: 1
  9957. }
  9958. },
  9959. spawner: function() {
  9960. ig.game.spawnEntity(EntityPointer, 800, 800, {
  9961. main: this
  9962. });
  9963. for (var b = 0; 4 > b; b++) ig.game.spawnEntity(EntityPlainShopBut, -200, -200, {
  9964. main: this,
  9965. seq: b
  9966. })
  9967. },
  9968. tweenF: function(b) {
  9969. switch (b) {
  9970. case "left0":
  9971. this.tweening = !0;
  9972. this.tweener("plane", {
  9973. offX: -500
  9974. }, 0.3, "left1");
  9975. break;
  9976. case "left1":
  9977. this.which = 0 == this.which ? 3 : this.which -
  9978. 1;
  9979. this.plane.offX = 500;
  9980. this.tweener("plane", {
  9981. offX: 0
  9982. }, 0.3, "left2");
  9983. break;
  9984. case "left2":
  9985. this.tweening = !1;
  9986. break;
  9987. case "right0":
  9988. this.tweening = !0;
  9989. this.tweener("plane", {
  9990. offX: 500
  9991. }, 0.3, "right1");
  9992. break;
  9993. case "right1":
  9994. this.which = (this.which + 1) % 4;
  9995. this.plane.offX = -500;
  9996. this.tweener("plane", {
  9997. offX: 0
  9998. }, 0.3, "right2");
  9999. break;
  10000. case "right2":
  10001. this.tweening = !1
  10002. }
  10003. },
  10004. update: function() {
  10005. ig.global.wm || this.parent()
  10006. },
  10007. drawInit: function() {},
  10008. ready: function() {
  10009. this.pointer = ig.game.getEntitiesByType(EntityPointer)[0]
  10010. },
  10011. draw: function() {
  10012. this.parent();
  10013. ig.global.wm || (this.bgIm.draw(0, 0), this.stageIm.draw(163, 240), this.drawer("game", this.starIm, 1, 1, 0, this.plane.offX + 320 - 1 * (this.ctx.measureText(this.prices[this.which]).width / 2) - 32 + 20, 100, 0.8, 0.8, !0), this.drawer("game", this.starIm, 1, 1, 0, 33, 30, 0.6, 0.6, !0), this.textSet("game", 35, "white"), this.textDraw("game", 1, 1.1, this.prices[this.which], this.plane.offX + 320 - 1 * (this.ctx.measureText(this.prices[this.which]).width / 2) + 20, 98), this.textDraw("game", 0.7, 0.8, ig.game.star, 60 - 0.8 * (this.ctx.measureText(ig.game.star).width /
  10014. 2) + 20, 29), this.which == ig.game.player && !1 == this.tweening && (this.ctx.fillStyle = "#122149", this.ctx.fillRect(320 - this.ctx.measureText(_STRINGS.Game.selected[0]).width / 2 * _STRINGS.Game.selected[3] - 10, 321, this.ctx.measureText(_STRINGS.Game.selected[0]).width * _STRINGS.Game.selected[3] + 20, 30), this.ctx.fillStyle = "white", this.textLib("selected")), this.drawer("game", this["planeIm" + this.which], 1, 1, 0, this.plane.offX + 320, 309, 1, 1, !1, this.plane.alp, 0, -this["planeIm" + this.which].width / 2, -this["planeIm" + this.which].height))
  10015. }
  10016. })
  10017. });
  10018. ig.baked = !0;
  10019. ig.module("game.levels.shop").requires("impact.image", "game.entities.plain-shop").defines(function() {
  10020. LevelShop = {
  10021. entities: [{
  10022. type: "EntityPlainShop",
  10023. x: 0,
  10024. y: 0
  10025. }],
  10026. layer: []
  10027. }
  10028. });
  10029. ig.baked = !0;
  10030. ig.module("game.entities.plain-map-but").requires("game.entities.plain").defines(function() {
  10031. EntityPlainMapBut = EntityPlain.extend({
  10032. gravityFactor: 0,
  10033. type: ig.Entity.TYPE.B,
  10034. zIndex: 1E3,
  10035. size: {
  10036. x: 27,
  10037. y: 27
  10038. },
  10039. locked: !1,
  10040. offset: {
  10041. x: 0,
  10042. y: 0
  10043. },
  10044. textColor: "white",
  10045. leftIm: new ig.AnimationSheet("media/graphics/sprites/arrow-l.png", 194 / 3, 69),
  10046. rightIm: new ig.AnimationSheet("media/graphics/sprites/arrow-r.png", 194 / 3, 69),
  10047. backIm: new ig.AnimationSheet("media/graphics/sprites/back.png", 42, 55),
  10048. buttonIm: new ig.AnimationSheet("media/graphics/sprites/button.png",
  10049. 635 / 3, 70),
  10050. muteAni: {},
  10051. unmuteAni: {},
  10052. init: function(b, c, d) {
  10053. ig.global.wm || (this.main = d.main, this.seq = d.seq, this.oriStat(), this.parent(this.pos.x, this.pos.y, d), this.spawner())
  10054. },
  10055. idle: function() {
  10056. this.setScale(0.95, 0.95);
  10057. 2 != this.seq && (this.currentAnim = this.anims.idle)
  10058. },
  10059. clicked: function() {
  10060. this.sounder("click");
  10061. if (!this.locked) switch (this.setScale(0.85, 0.85), this.seq) {
  10062. case 0:
  10063. if (!0 == this.main.tweening) break;
  10064. this.main.tweenF("left0");
  10065. break;
  10066. case 1:
  10067. if (!0 == this.main.tweening) break;
  10068. this.main.tweenF("right0");
  10069. break;
  10070. case 2:
  10071. if (!0 == this.main.tweening) break;
  10072. if (ig.game.star < Number(this.main.prices[this.main.which])) break;
  10073. ig.game.map = this.main.which;
  10074. ig.game.storage.set(ig.game.gameKey, {
  10075. star: ig.game.star,
  10076. lvl: ig.game.lvl,
  10077. mission: ig.game.mission,
  10078. map: ig.game.map,
  10079. player: ig.game.player,
  10080. nextLvl: ig.game.nextLvl,
  10081. seq: ig.game.seq
  10082. });
  10083. break;
  10084. case 3:
  10085. switch (ig.game.oriNavi) {
  10086. case "home":
  10087. ig.game.director.jumpTo(LevelHome);
  10088. break;
  10089. case "over":
  10090. ig.game.director.jumpTo(LevelOver);
  10091. break;
  10092. case "mission":
  10093. ig.game.director.jumpTo(LevelMission)
  10094. }
  10095. }
  10096. },
  10097. oriStat: function() {
  10098. this.setScale(0.95, 0.95);
  10099. this.animSheet = this.closeIm;
  10100. this.base.x = this.pos.x;
  10101. this.base.y = this.pos.y;
  10102. switch (this.seq) {
  10103. case 0:
  10104. this.pos.x = 160 - this.leftIm.width;
  10105. this.pos.y = 200;
  10106. this.animSheet = this.leftIm;
  10107. break;
  10108. case 1:
  10109. this.pos.x = 480;
  10110. this.pos.y = 200;
  10111. this.animSheet = this.rightIm;
  10112. break;
  10113. case 2:
  10114. this.pos.x = 213;
  10115. this.pos.y = 382;
  10116. this.animSheet = this.buttonIm;
  10117. break;
  10118. case 3:
  10119. this.pos.x = 9;
  10120. this.pos.y = 418;
  10121. this.animSheet = this.backIm;
  10122. break;
  10123. case 4:
  10124. this.pos.x = 8, this.pos.y = 416, this.animSheet = this.setIm
  10125. }
  10126. this.addAnim("idle",
  10127. 1, [0]);
  10128. this.addAnim("select", 1, [1]);
  10129. this.addAnim("grey", 1, [2]);
  10130. this.currentAnim = this.anims.idle;
  10131. this.size.x = this.animSheet.width;
  10132. this.size.y = this.animSheet.height
  10133. },
  10134. spawner: function() {},
  10135. tweenF: function() {},
  10136. update: function() {
  10137. ig.global.wm || (this.parent(), 2 == this.seq && (ig.game.star < Number(this.main.prices[this.main.which]) ? (this.textColor = "#4E515D", this.currentAnim = this.anims.grey) : (this.textColor = "white", this.currentAnim = this.anims.idle)), !this.locked && null != this.pointer && (this.pointer.hoveringItem ==
  10138. this && !this.pointer.firstClick) && (this.setScale(1, 1), 2 != this.seq && (this.currentAnim = this.anims.select)))
  10139. },
  10140. drawInit: function() {},
  10141. ready: function() {
  10142. this.pointer = ig.game.getEntitiesByType(EntityPointer)[0]
  10143. },
  10144. draw: function() {
  10145. this.parent();
  10146. !ig.global.wm && 2 == this.seq && (this.ctx.fillStyle = this.textColor, ig.game.star < Number(this.main.prices[this.main.which]) ? this.textDraw("game", _STRINGS.Game.notenough[3] * this.scale.x, _STRINGS.Game.notenough[4] * this.scale.y, _STRINGS.Game.notenough[0], this.pos.x + this.size.x /
  10147. 2 - this.ctx.measureText(_STRINGS.Game.notenough[0]).width / 2 * _STRINGS.Game.notenough[3] * this.scale.x, this.pos.y + this.size.y / 2 - 5) : this.textDraw("game", _STRINGS.Game.selectMap[3] * this.scale.x, _STRINGS.Game.selectMap[4] * this.scale.y, _STRINGS.Game.selectMap[0], this.pos.x + this.size.x / 2 - this.ctx.measureText(_STRINGS.Game.selectMap[0]).width / 2 * _STRINGS.Game.selectMap[3] * this.scale.x, this.pos.y + this.size.y / 2 - 5))
  10148. }
  10149. })
  10150. });
  10151. ig.baked = !0;
  10152. ig.module("game.entities.plain-map").requires("game.entities.plain", "game.entities.plain-map-but").defines(function() {
  10153. EntityPlainMap = EntityPlain.extend({
  10154. gravityFactor: 0,
  10155. type: ig.Entity.TYPE.B,
  10156. zIndex: 1,
  10157. h: 600,
  10158. w: 800,
  10159. boardOn: !1,
  10160. ranks: [0, 0, 0, 0],
  10161. size: {
  10162. x: 800,
  10163. y: 600
  10164. },
  10165. gameOver: !1,
  10166. gamePaused: !1,
  10167. score: 0,
  10168. clue: 0,
  10169. ans: 10,
  10170. ques: [],
  10171. prices: ["0000", 2500, 5E3, 1E4],
  10172. bgIm: new ig.Image("media/graphics/sprites/bookBg.png"),
  10173. starIm: new ig.Image("media/graphics/sprites/mission-star.png"),
  10174. sceneIm0: new ig.Image("media/graphics/sprites/scene0.png"),
  10175. sceneIm1: new ig.Image("media/graphics/sprites/scene1.png"),
  10176. sceneIm2: new ig.Image("media/graphics/sprites/scene2.png"),
  10177. sceneIm3: new ig.Image("media/graphics/sprites/scene3.png"),
  10178. init: function(b, c, d) {
  10179. ig.global.wm || (this.parent(b, c, d), this.oriStat(), this.spawner())
  10180. },
  10181. genQues: function() {},
  10182. pauseGame: function() {},
  10183. resumeGame: function() {},
  10184. oriStat: function() {
  10185. this.base = {
  10186. x: 240,
  10187. task: "none",
  10188. y: 130,
  10189. sc: 1,
  10190. oriSc: 0.9,
  10191. scX: 1,
  10192. scY: 1,
  10193. alp: 1,
  10194. rot: 0,
  10195. textSize: 26,
  10196. tweening: !1,
  10197. frameCount: 0,
  10198. frameTime: 1,
  10199. frame: 0,
  10200. frameX: 1,
  10201. frameY: 1,
  10202. frames: [0],
  10203. tFrame: 1,
  10204. loop: !1,
  10205. ended: !1,
  10206. cent: !0
  10207. };
  10208. this.scene = {
  10209. offX: 0,
  10210. alp: 1
  10211. }
  10212. },
  10213. spawner: function() {
  10214. ig.game.spawnEntity(EntityPointer, 800, 800, {
  10215. main: this
  10216. });
  10217. for (var b = 0; 4 > b; b++) ig.game.spawnEntity(EntityPlainMapBut, -200, -200, {
  10218. main: this,
  10219. seq: b
  10220. })
  10221. },
  10222. tweenF: function(b) {
  10223. switch (b) {
  10224. case "left0":
  10225. this.tweening = !0;
  10226. this.tweener("scene", {
  10227. offX: -500
  10228. }, 0.3, "left1");
  10229. break;
  10230. case "left1":
  10231. this.which = 0 == this.which ? 3 : this.which - 1;
  10232. this.scene.offX = 500;
  10233. this.tweener("scene", {
  10234. offX: 0
  10235. }, 0.3, "left2");
  10236. break;
  10237. case "left2":
  10238. this.tweening = !1;
  10239. break;
  10240. case "right0":
  10241. this.tweening = !0;
  10242. this.tweener("scene", {
  10243. offX: 500
  10244. }, 0.3, "right1");
  10245. break;
  10246. case "right1":
  10247. this.which = (this.which + 1) % 4;
  10248. this.scene.offX = -500;
  10249. this.tweener("scene", {
  10250. offX: 0
  10251. }, 0.3, "right2");
  10252. break;
  10253. case "right2":
  10254. this.tweening = !1
  10255. }
  10256. },
  10257. update: function() {
  10258. ig.global.wm || this.parent()
  10259. },
  10260. drawInit: function() {},
  10261. ready: function() {
  10262. this.pointer = ig.game.getEntitiesByType(EntityPointer)[0]
  10263. },
  10264. draw: function() {
  10265. this.parent();
  10266. ig.global.wm || (this.bgIm.draw(0, 0), this.drawer("game", this["sceneIm" + this.which], 1, 1, 0, this.scene.offX + 320 + 5, 374, 1, 1, !1, this.scene.alp,
  10267. 0, -this["sceneIm" + this.which].width / 2, -this["sceneIm" + this.which].height), this.drawer("game", this.starIm, 1, 1, 0, this.scene.offX + 320 - 1 * (this.ctx.measureText(this.prices[this.which]).width / 2) - 32 + 25, 75, 0.8, 0.8, !0), this.drawer("game", this.starIm, 1, 1, 0, 33, 30, 0.6, 0.6, !0), this.textSet("game", 35, "white"), this.textDraw("game", 1, 1.1, this.prices[this.which], this.scene.offX + 320 - 1 * (this.ctx.measureText(this.prices[this.which]).width / 2) + 25, 73), this.textDraw("game", 0.7, 0.8, ig.game.star, 60 - 0.8 * (this.ctx.measureText(ig.game.star).width /
  10268. 2) + 20, 29), this.which == ig.game.map && !1 == this.tweening && (this.ctx.fillStyle = "#122149", this.ctx.fillRect(320 - this.ctx.measureText(_STRINGS.Game.selectedMap[0]).width / 2 * _STRINGS.Game.selectedMap[3] - 10, 331, this.ctx.measureText(_STRINGS.Game.selectedMap[0]).width * _STRINGS.Game.selectedMap[3] + 20, 35), this.ctx.fillStyle = "white", this.textLib("selectedMap")))
  10269. }
  10270. })
  10271. });
  10272. ig.baked = !0;
  10273. ig.module("game.levels.map").requires("impact.image", "game.entities.plain-map").defines(function() {
  10274. LevelMap = {
  10275. entities: [{
  10276. type: "EntityPlainMap",
  10277. x: 0,
  10278. y: 0
  10279. }],
  10280. layer: []
  10281. }
  10282. });
  10283. ig.baked = !0;
  10284. ig.module("game.entities.plain-sky").requires("game.entities.plain").defines(function() {
  10285. EntityPlainSky = EntityPlain.extend({
  10286. gravityFactor: 0,
  10287. type: ig.Entity.TYPE.B,
  10288. zIndex: 1,
  10289. targL: 0,
  10290. oriSpeed: 5.5,
  10291. speed: 0,
  10292. moveRight: !0,
  10293. size: {
  10294. x: 800,
  10295. y: 600
  10296. },
  10297. gameOver: !1,
  10298. gamePaused: !1,
  10299. which: 1,
  10300. frame: 1,
  10301. skyColour: ["#86cbf0", "#163066", "#9fdafd", "#f6ea73"],
  10302. groundColour: ["#83c026", "#185356", "#eefbff", "#ffb52c"],
  10303. bgIm0: new ig.Image("media/graphics/sprites/bg0.png"),
  10304. bgIm1: new ig.Image("media/graphics/sprites/bg1.png"),
  10305. bgIm2: new ig.Image("media/graphics/sprites/bg2.png"),
  10306. bgIm3: new ig.Image("media/graphics/sprites/bg3.png"),
  10307. shadeIm0: new ig.Image("media/graphics/sprites/shade0.png"),
  10308. shadeIm1: new ig.Image("media/graphics/sprites/shade1.png"),
  10309. shadeIm2: new ig.Image("media/graphics/sprites/shade2.png"),
  10310. shadeIm3: new ig.Image("media/graphics/sprites/shade3.png"),
  10311. ready: function() {
  10312. this.parent()
  10313. },
  10314. init: function(b, c, d) {
  10315. ig.global.wm || (this.parent(b, c, d), this.oriStat())
  10316. },
  10317. oriStat: function() {
  10318. this.x0 = 0;
  10319. this.x1 = Math.floor(this.bgIm0.width / 3);
  10320. this.x2 = Math.floor(2 * (this.bgIm0.width / 3));
  10321. this.w = Math.floor(this.bgIm0.width / 3);
  10322. this.base = {
  10323. y: 130,
  10324. sc: 1,
  10325. oriSc: 0.9,
  10326. scX: 1,
  10327. scY: 1,
  10328. alp: 1,
  10329. rot: 0,
  10330. textSize: 26,
  10331. tweening: !1,
  10332. frameCount: 0,
  10333. frameTime: 1,
  10334. frame: 0,
  10335. frameX: 1,
  10336. frameY: 1,
  10337. frames: [0],
  10338. tFrame: 1,
  10339. loop: !1,
  10340. ended: !1,
  10341. cent: !0
  10342. }
  10343. },
  10344. tweenF: function() {},
  10345. update: function() {
  10346. if (!ig.global.wm && (this.parent(), !0 != this.main.gameOver && 0 < this.speed && !1 != this.main.clickable))
  10347. for (var b = 0; 3 > b; b++)!0 == this.moveRight ? (this["x" + b] += this.speed, b == this.targL && -50 < this["x" + b] && (this["x" + (b + 2) % 3] = this["x" + b] - this.w, this.targL = (this.targL +
  10348. 2) % 3)) : (b == this.targL && this["x" + (b + 2) % 3] + this.w < this.main.w + 50 && (this["x" + b] = this["x" + (b + 2) % 3] + this.w, this.targL = (this.targL + 1) % 3), this["x" + b] -= this.speed)
  10349. },
  10350. drawInit: function() {},
  10351. draw: function() {
  10352. this.parent();
  10353. this.ctx.fillStyle = this.groundColour[this.main.which];
  10354. this.ctx.fillRect(0, this.bgIm0.height, ig.system.width, ig.system.height - this.bgIm0.height);
  10355. this.ctx.fillStyle = this.skyColour[this.main.which];
  10356. this.ctx.fillRect(0, 0, ig.system.width, this.bgIm0.height);
  10357. if (!ig.global.wm) {
  10358. for (var b = 0; 3 > b; b++) this["x" +
  10359. b] > -this.w && this["x" + b] + this.w < this.main.w + this.w && this.drawer("game", this["bgIm" + this.main.which], 3, 1, b, this["x" + b], 0);
  10360. this["shadeIm" + this.main.which].draw(0, this.bgIm0.height)
  10361. }
  10362. }
  10363. })
  10364. });
  10365. ig.baked = !0;
  10366. ig.module("game.entities.plain-ground").requires("game.entities.plain").defines(function() {
  10367. EntityPlainGround = EntityPlain.extend({
  10368. gravityFactor: 0,
  10369. type: ig.Entity.TYPE.B,
  10370. zIndex: 2,
  10371. h: 600,
  10372. w: 800,
  10373. boardOn: !1,
  10374. ranks: [0, 0, 0, 0],
  10375. size: {
  10376. x: 800,
  10377. y: 600
  10378. },
  10379. gameOver: !1,
  10380. gamePaused: !1,
  10381. spawnNew: !0,
  10382. itemPos: 320,
  10383. score: 0,
  10384. clue: 0,
  10385. ans: 10,
  10386. ques: [],
  10387. rocks: [],
  10388. showRing: !1,
  10389. Ypos: [147, 140.0112, 137.25, 135.5028, 134.3328, 134, 147.20550400000002, 161.00297600000002, 173.76918400000005, 187.09990400000004, 200.95270400000004, 212.29078400000006, 224.91430400000007,
  10390. 237.2973760000001, 250.14678400000008, 260.6487040000001, 272.3245760000001, 283.7600000000001, 294.9549760000001, 305.27177600000016, 315.3755840000001, 326.48777600000017, 336.1389760000001, 346.16000000000014, 355.3719040000002, 365.4807040000002, 373.69878400000016, 383.3133760000002, 391.63337600000017, 400.73878400000024, 408.12070400000016, 416.7319040000002, 423.70198400000015, 431.3751040000002, 438.80777600000016, 446.4155840000002, 452.5495040000002, 459.6631040000002, 465.3851840000002, 471.6439040000002, 478.0087040000002,
  10391. 483.1067840000002, 488.65830400000016, 494.27430400000014, 498.74838400000016, 503.59270400000014, 508.1965760000001, 512.8091840000002, 516.4471040000001, 520.5655040000001, 524.0000000000001, 527.415776, 530.4109760000001, 533.3600000000001, 536.0685760000001, 538.5367040000001, 540.514784, 542.5303039999999, 544.402304, 545.756384, 547.134176, 548.1325760000001, 549.001184, 549.519104, 549.8935039999999, 550
  10392. ],
  10393. startY: [100, 100, 100, 100],
  10394. hitSize: [0.01, 0.04, 0.07, 0.1, 0.12, 0.14, 0.18, 0.15, 0.1, 0.06, 0.01, -0.02, -0.05, 0.01, -0.02, -0.05, -0.1, 0.01],
  10395. rockIm0: new ig.Image("media/graphics/sprites/rock0.png"),
  10396. rockIm1: new ig.Image("media/graphics/sprites/rock1.png"),
  10397. rockIm2: new ig.Image("media/graphics/sprites/rock2.png"),
  10398. rockIm3: new ig.Image("media/graphics/sprites/rock3.png"),
  10399. treeIm0: new ig.Image("media/graphics/sprites/tree0.png"),
  10400. treeIm1: new ig.Image("media/graphics/sprites/tree1.png"),
  10401. treeIm2: new ig.Image("media/graphics/sprites/tree2.png"),
  10402. treeIm3: new ig.Image("media/graphics/sprites/tree3.png"),
  10403. planeIm0: new ig.Image("media/graphics/sprites/plane0.png"),
  10404. planeIm1: new ig.Image("media/graphics/sprites/plane1.png"),
  10405. planeIm2: new ig.Image("media/graphics/sprites/plane2.png"),
  10406. planeIm3: new ig.Image("media/graphics/sprites/plane3.png"),
  10407. planeIm4: new ig.Image("media/graphics/sprites/plane4.png"),
  10408. shadowIm0: new ig.Image("media/graphics/sprites/shadow0.png"),
  10409. shadowIm1: new ig.Image("media/graphics/sprites/shadow0.png"),
  10410. shadowIm2: new ig.Image("media/graphics/sprites/shadow0.png"),
  10411. shadowIm3: new ig.Image("media/graphics/sprites/shadow0.png"),
  10412. targetIm: new ig.Image("media/graphics/sprites/target.png"),
  10413. boomIm: new ig.Image("media/graphics/sprites/kaboom.png"),
  10414. starIm: new ig.Image("media/graphics/sprites/star.png"),
  10415. heartIm: new ig.Image("media/graphics/sprites/heart.png"),
  10416. ufoIm: new ig.Image("media/graphics/sprites/ufo.png"),
  10417. lightIm: new ig.Image("media/graphics/sprites/ufolight.png"),
  10418. shipIm: new ig.Image("media/graphics/sprites/ship.png"),
  10419. frameIm: new ig.Image("media/graphics/sprites/frame.png"),
  10420. balloonIm: new ig.Image("media/graphics/sprites/balloon.png"),
  10421. ringIm: new ig.Image("media/graphics/sprites/ring.png"),
  10422. oilIm: new ig.Image("media/graphics/sprites/oil.png"),
  10423. oilSc: [1, 1.1009777777777778, 1.1527777777777777, 1.1983944444444445, 1.2408000000000001, 1.2799944444444444, 1.3139500000000002, 1.3469111111111112, 1.3766611111111113, 1.401727777777778, 1.4252444444444445, 1.4444444444444446, 1.461727777777778, 1.4758, 1.4866611111111112, 1.4939500000000001, 1.4985777777777778, 1.5, 1.3442666666666665, 1.1792666666666665, 1.041666666666666, 0.9048166666666662, 0.7775999999999994, 0.6666666666666661, 0.564266666666666, 0.47039999999999926,
  10424. 0.37499999999999933, 0.29481666666666584, 0.2281499999999994, 0.16334999999999944, 0.11759999999999948, 0.07259999999999955, 0.041666666666666075, 0.018149999999999666, 0.004816666666666691
  10425. ],
  10426. scarfIm: new ig.Image("media/graphics/sprites/scarf.png"),
  10427. treeTall0: [141, 1369, 130, 101, 105, 97, 81, 38, 37],
  10428. treeTall1: [153, 152, 150, 141, 52, 53],
  10429. treeTall2: [119, 156, 165, 157, 157, 583, 48, 31, 59],
  10430. treeTall3: [138, 125, 185, 109, 106, 106, 124, 50],
  10431. treeWidth0: [134, 64, 68, 93, 54, 53, 70, 50, 55],
  10432. treeWidth1: [94, 135, 83, 77, 68, 70],
  10433. treeWidth2: [103, 80, 86,
  10434. 145, 80, 78, 56, 47, 85
  10435. ],
  10436. treeWidth3: [99, 101, 111, 106, 86, 32, 111, 51],
  10437. treeVault: [7, 4, 5, 7],
  10438. bigTree: [7, 4, 5, 7],
  10439. treeMaxFrame: [9, 6, 9, 8],
  10440. rockVault: [7, 6, 5, 9],
  10441. smallRock: [4, 5, 3, 5],
  10442. discard: [],
  10443. init: function(b, c, d) {
  10444. ig.global.wm || (this.parent(b, c, d), this.main = d.main)
  10445. },
  10446. oriStat: function() {
  10447. this.scarf = {
  10448. x: 308,
  10449. y: 74,
  10450. offX: -3,
  10451. offY: 0,
  10452. show: !0,
  10453. frameTime: 0.04,
  10454. frameTimer: new ig.Timer,
  10455. frame: 0,
  10456. frameX: 6,
  10457. frameY: 1,
  10458. frames: [0, 1, 2, 3, 4, 5],
  10459. tFrame: 1,
  10460. loop: !0,
  10461. ended: !1,
  10462. cent: !0
  10463. };
  10464. this.boom = {
  10465. x: 320,
  10466. y: 320,
  10467. show: !1,
  10468. frameTime: 0.05,
  10469. frameTimer: new ig.Timer,
  10470. frame: 0,
  10471. frameX: 4,
  10472. frameY: 2,
  10473. frames: [0, 1, 2, 3, 4, 5, 6],
  10474. tFrame: 1,
  10475. loop: !1,
  10476. ended: !1,
  10477. cent: !0
  10478. };
  10479. this.spawnTimer = new ig.Timer;
  10480. this.spawnTime = 1.5;
  10481. this.base = {
  10482. x: 240,
  10483. w: Math.floor(this["rockIm" + this.main.which].width / this.rockVault[this.main.which]),
  10484. y: 130,
  10485. sc: 1,
  10486. oriSc: 0.9,
  10487. scX: 1,
  10488. scY: 1,
  10489. alp: 1,
  10490. rot: 0,
  10491. textSize: 26,
  10492. tweening: !1,
  10493. frameCount: 0,
  10494. frameTime: 1,
  10495. frame: 0,
  10496. frameX: 1,
  10497. frameY: 1,
  10498. frames: [0],
  10499. tFrame: 1,
  10500. loop: !1,
  10501. ended: !1,
  10502. cent: !0
  10503. };
  10504. for (var b = 0; 12 > b; b++)
  10505. for (var c = 0; 6 > c; c++) this.rocks.unshift({
  10506. what: "rock",
  10507. speed: 0.05,
  10508. alp: 0,
  10509. show: !0,
  10510. which: 3 ==
  10511. Math.floor(10 * Math.random()) ? Math.floor(Math.random() * this.rockVault[this.main.which]) : Math.floor(Math.random() * this.smallRock[this.main.which]),
  10512. x: 1 == c % 2 ? 160 * b : 160 * b - 60,
  10513. startSc: 0,
  10514. sc: 0.5,
  10515. percent: c / 6,
  10516. oriSc: 1,
  10517. step: 0,
  10518. scSpeed: 0.01,
  10519. screenX: 0,
  10520. x0: 320,
  10521. y0: this.startY[this.main.which],
  10522. x1: 320,
  10523. y1: 190,
  10524. x2: 640,
  10525. y2: 550,
  10526. start: !0
  10527. });
  10528. switch (ig.game.what) {
  10529. case "follow":
  10530. this.plane.spawnFrame();
  10531. this.plane.spawnLeaders();
  10532. this.spawnKnockers("star", 3);
  10533. this.spawnKnockers("tree", 8);
  10534. break;
  10535. case "tree":
  10536. this.spawnKnockers("tree",
  10537. 10 + Math.floor(ig.game.lvl / 5));
  10538. this.spawnKnockers("star", 3);
  10539. break;
  10540. case "ufo":
  10541. this.main.heart = 10;
  10542. this.spawnKnockers("ufo", 10 + Math.floor(ig.game.lvl / 5));
  10543. this.spawnKnockers("star", 1);
  10544. break;
  10545. case "ship":
  10546. this.main.heart = 10;
  10547. this.spawnKnockers("ship", 10 + Math.floor(ig.game.lvl / 5));
  10548. this.spawnKnockers("star", 1);
  10549. break;
  10550. case "star":
  10551. this.main.howmany = 160 + 10 * Math.floor(ig.game.lvl / 5);
  10552. this.gui.tweenF("arrowFlash0");
  10553. this.spawnKnockers("star", 6);
  10554. break;
  10555. case "balloon":
  10556. this.spawnKnockers("balloon", 10 + Math.floor(ig.game.lvl /
  10557. 5));
  10558. this.spawnKnockers("star", 3);
  10559. break;
  10560. case "heart":
  10561. this.spawnKnockers("heart", 15);
  10562. this.spawnKnockers("tree", 3);
  10563. break;
  10564. case "oil":
  10565. this.main.howmany = 25 + 2 * Math.floor(ig.game.lvl / 5);
  10566. this.spawnKnockers("oil", 20 - Math.floor(ig.game.lvl / 5));
  10567. this.spawnKnockers("tree", 5);
  10568. break;
  10569. case "ring":
  10570. this.main.howmany = 60 + 5 * Math.floor(ig.game.lvl / 5), this.gui.tweenF("arrowFlash0"), this.spawnKnockers("ring", 2)
  10571. }
  10572. this.indexSwap()
  10573. },
  10574. spawnKnockers: function(b, c) {
  10575. this.amount = c;
  10576. switch (b) {
  10577. case "balloon":
  10578. case "ufo":
  10579. case "ship":
  10580. case "tree":
  10581. case "oil":
  10582. for (var d =
  10583. 0; d < this.amount; d++) this.tempX = -400 + this.main.world.x + Math.floor(Math.random() * (this.main.w + 800)), this.posX = 0, this.posX = 0 > this.tempX ? 3 * this.sky.w + this.tempX : this.tempX > 3 * this.sky.w ? this.tempX % (3 * this.sky.w) : this.tempX, this.tempMoveX = "ufo" == b.what ? -3 + 6 * Math.random() : "balloon" == b.what ? -1 + 2 * Math.random() : "ship" == b.what ? -3 + 3 * Math.random() : 0, this.tempWhich = "tree" == b ? 3 == Math.floor(10 * Math.random()) ? Math.floor(Math.random() * this.treeVault[this.main.which]) : Math.floor(Math.random() * this.bigTree[this.main.which]) :
  10584. Math.floor(3 * Math.random()), this.rocks.push({
  10585. seq: d,
  10586. hitRectW: "tree" == b ? this[b + "Width" + this.main.which][this.tempWhich] : this[b + "Im"].width / 3,
  10587. hitRectH: "tree" == b ? this[b + "Tall" + this.main.which][this.tempWhich] : this[b + "Im"].height,
  10588. what: b,
  10589. alp: 0,
  10590. show: !0,
  10591. moveX: this.tempMoveX,
  10592. which: this.tempWhich,
  10593. hitted: !1,
  10594. lightAlp: 1 * Math.random(),
  10595. lightOn: !1,
  10596. start: !1,
  10597. x: this.posX,
  10598. startSc: 0,
  10599. sc: 0.5,
  10600. percent: d / this.amount,
  10601. oriSc: 1.3,
  10602. step: 0,
  10603. scSpeed: 0.01,
  10604. screenX: 0,
  10605. x0: 320,
  10606. y0: this.startY[this.main.which],
  10607. x1: 320,
  10608. y1: 190,
  10609. x2: 640,
  10610. y2: 550,
  10611. hitSc: 0.2,
  10612. hitSizeCount: 0,
  10613. hitIndex: 0
  10614. });
  10615. break;
  10616. case "heart":
  10617. for (d = 0; d < this.amount; d++) this.tempSide = Math.floor(2 * Math.random()), 0 == this.tempSide ? this.tempX = this.itemPos + 10 : 1 == this.tempSide ? this.tempX = this.itemPos - 20 : 2 == this.tempSide && (this.tempX = this.itemPos), this.itemPos = this.tempX = -400 + this.main.world.x + Math.floor(Math.random() * (this.main.w + 800)), this.posX = 0, this.posX = 0 > this.tempX ? 3 * this.sky.w + this.tempX : this.tempX > 3 * this.sky.w ? this.tempX % (3 * this.sky.w) : this.tempX, this.tempWhich = 0, this.rocks.push({
  10618. seq: d,
  10619. hitRectW: this.heartIm.width,
  10620. hitRectH: this.heartIm.height,
  10621. what: "heart",
  10622. alp: 0,
  10623. show: !0,
  10624. which: this.tempWhich,
  10625. hitted: !1,
  10626. x: this.posX,
  10627. startSc: 0,
  10628. sc: 0.5,
  10629. percent: d / this.amount,
  10630. start: !1,
  10631. oriSc: 0.9,
  10632. step: 0,
  10633. scSpeed: 0.01,
  10634. screenX: 0,
  10635. x0: 320,
  10636. y0: this.startY[this.main.which],
  10637. x1: 320,
  10638. y1: 190,
  10639. x2: 640,
  10640. y2: 550,
  10641. hitSc: 0.2,
  10642. hitSizeCount: 0,
  10643. hitIndex: 0
  10644. });
  10645. break;
  10646. case "star":
  10647. for (d = 0; d < this.amount; d++) this.tempSide = Math.floor(2 * Math.random()), 0 == this.tempSide ? this.tempX = this.itemPos + 10 : 1 == this.tempSide ? this.tempX = this.itemPos - 20 : 2 == this.tempSide &&
  10648. (this.tempX = this.itemPos), this.itemPos = this.tempX, this.posX = 0, this.posX = 0 > this.tempX ? 3 * this.sky.w + this.tempX : this.tempX > 3 * this.sky.w ? this.tempX % (3 * this.sky.w) : this.tempX, this.main.total++, this.tempWhich = 0, this.rocks.push({
  10649. seq: d,
  10650. hitRectW: this.heartIm.width,
  10651. hitRectH: this.heartIm.height,
  10652. what: "star",
  10653. straight: "star" == ig.game.what ? !0 : !1,
  10654. alp: 0,
  10655. show: !0,
  10656. which: this.tempWhich,
  10657. hitted: !1,
  10658. x: this.posX,
  10659. startSc: 0,
  10660. sc: 0.5,
  10661. percent: d / this.amount,
  10662. oriSc: 1,
  10663. step: 0,
  10664. scSpeed: 0.01,
  10665. screenX: 0,
  10666. x0: 320,
  10667. y0: this.startY[this.main.which] +
  10668. 80,
  10669. x1: 320,
  10670. y1: 190,
  10671. x2: 640,
  10672. y2: 550,
  10673. hitSc: 0.2,
  10674. hitSizeCount: 0,
  10675. hitIndex: 0,
  10676. start: !1
  10677. });
  10678. break;
  10679. case "ring":
  10680. for (d = 0; d < this.amount; d++) this.tempSide = Math.floor(2 * Math.random()), 0 == this.tempSide ? this.tempX = this.itemPos + 20 : 1 == this.tempSide ? this.tempX = this.itemPos - 40 : 2 == this.tempSide && (this.tempX = this.itemPos), this.itemPos = this.tempX, this.posX = 0, this.posX = 0 > this.tempX ? 3 * this.sky.w + this.tempX : this.tempX > 3 * this.sky.w ? this.tempX % (3 * this.sky.w) : this.tempX, this.main.total++, this.tempWhich = 0, this.rocks.push({
  10681. seq: d,
  10682. hitRectW: this.heartIm.width,
  10683. hitRectH: this.ringIm.height,
  10684. what: "ring",
  10685. alp: 0,
  10686. show: !0,
  10687. which: 0,
  10688. hitted: !1,
  10689. x: this.posX,
  10690. startSc: 0,
  10691. sc: 0.5,
  10692. percent: d / this.amount,
  10693. start: !1,
  10694. oriSc: 1.2,
  10695. step: 0,
  10696. scSpeed: 0.01,
  10697. screenX: 0,
  10698. x0: 320,
  10699. y0: this.startY[this.main.which] + 180,
  10700. x1: 320,
  10701. y1: 250,
  10702. x2: 640,
  10703. y2: 500,
  10704. hitSc: 0.2,
  10705. hitSizeCount: 0,
  10706. hitIndex: 0
  10707. })
  10708. }
  10709. },
  10710. reGenItem: function(b) {
  10711. ("star" == b.what || "ring" == b.what) && 58 < this.main.gameTimer.delta() || (b.start = !0, b.hitted = !1, b.hitSizeCount = 0, b.hitIndex = 0, b.percent = 0, b.alp = 0, b.startSc = 0, b.step = 0, b.show = !0, b.lightAlp = 1, b.lightOn = !1,
  10712. b.scSpeed = 0.01, "ufo" == b.what ? b.moveX = -3 + 6 * Math.random() : "balloon" == b.what ? b.moveX = -1 + 2 * Math.random() : "ship" == b.what && (b.moveX = -3 + 3 * Math.random()), "ring" == b.what && (b.which = 0, "ring" == ig.game.what && this.main.total++, this.tempSide = Math.floor(2 * Math.random()), 0 == this.tempSide ? this.tempX = this.itemPos + 20 : 1 == this.tempSide ? this.tempX = this.itemPos - 40 : 2 == this.tempSide && (this.tempX = this.itemPos), this.itemPos = this.tempX), "rock" == b.what ? b.which = 3 == Math.floor(10 * Math.random()) ? Math.floor(Math.random() * this.rockVault[this.main.which]) :
  10713. Math.floor(Math.random() * this.smallRock[this.main.which]) : ("tree" == b.what || "oil" == b.what || "heart" == b.what || "ufo" == b.what || "ship" == b.what || "balloon" == b.what ? this.tempX = -400 + this.main.world.x + Math.floor(Math.random() * (this.main.w + 800)) : "star" == b.what ? ("star" == ig.game.what && this.main.total++, !0 == b.straight ? (this.tempSide = Math.floor(2 * Math.random()), 0 == this.tempSide ? this.tempX = this.itemPos + 20 : 1 == this.tempSide && (this.tempX = this.itemPos - 20), this.itemPos = this.tempX) : this.tempX = -400 + this.main.world.x + Math.floor(Math.random() *
  10714. (this.main.w + 800))) : (this.tempSide = Math.floor(2 * Math.random()), 0 == this.tempSide ? this.tempX = this.itemPos + 20 : 1 == this.tempSide && (this.tempX = this.itemPos - 20), this.itemPos = this.tempX), b.x = 0 > this.tempX ? 3 * this.sky.w + this.tempX : this.tempX > 3 * this.sky.w ? this.tempX % (3 * this.sky.w) : this.tempX), this.indexSwap())
  10715. },
  10716. offsetWorldPos: function(b) {
  10717. b.screenX = this.main.world.x > 3 * this.sky.w - this.main.w ? b.x < this.main.w ? b.x + 3 * this.sky.w - this.main.world.x : b.x - this.main.world.x : 0 > this.main.world.x ? b.x > 3 * this.sky.w - this.main.w ?
  10718. b.x - 3 * this.sky.w - this.main.world.x : b.x - this.main.world.x : b.x - this.main.world.x
  10719. },
  10720. renderPosition: function(b) {
  10721. b.x0 = 100 + 440 * ((b.screenX + this.base.w / 2) / this.main.w);
  10722. b.x1 = -300 + 1240 * ((b.screenX + this.base.w / 2) / this.main.w);
  10723. b.x2 = -700 + 2040 * ((b.screenX + this.base.w / 2) / this.main.w);
  10724. b.finalX = (1 - b.percent) * (1 - b.percent) * b.x0 + 2 * (1 - b.percent) * b.percent * b.x1 + b.percent * b.percent * b.x2;
  10725. this.topPercent = 0.2;
  10726. "ring" == b.what && 100 < b.finalX && 540 > b.finalX && (this.showRing = !0);
  10727. "star" == b.what && 100 < b.finalX && 540 > b.finalX && (this.showRing = !0);
  10728. b.percent < this.topPercent && (b.finalY = (1 - this.topPercent) * (1 - this.topPercent) * b.y0 + 2 * (1 - this.topPercent) * b.percent * b.y1 + this.topPercent * b.percent * b.y2);
  10729. b.finalY = (1 - b.percent) * (1 - b.percent) * b.y0 + 2 * (1 - b.percent) * b.percent * b.y1 + b.percent * b.percent * b.y2;
  10730. "ring" == b.what && (b.finalY *= 0.9)
  10731. },
  10732. fadeAlpha: function(b) {
  10733. 0.9 < b.percent ? 0 < b.alp && (b.alp -= 0.08, 0 > b.alp && (b.alp = 0)) : 1 > b.alp && (b.alp += 0.09, 1 < b.alp && (b.alp = 1))
  10734. },
  10735. poofInScale: function(b) {
  10736. b.sc = (0.2 + b.finalY / this.main.h) * b.oriSc;
  10737. "star" != b.what && ("ring" == b.what ?
  10738. b.sc = 0.2 + b.percent * (b.oriSc - 0.2) : "ufo" == b.what ? 0.12 > b.percent && (b.sc = b.percent / 0.12 * (b.sc - 0.2) + 0.2) : "ship" == b.what ? 0.2 > b.percent && (b.sc *= b.percent / 0.2) : "tree" == b.what ? 0.12 > b.percent && (b.sc *= b.percent / 0.12) : 0.12 > b.percent && (b.sc = b.percent / 0.12 * (b.sc - 0.2) + 0.2))
  10739. },
  10740. processHitItem: function(b) {
  10741. if (!1 != b.start && (this.hitPercent = "oil" == b.what ? this.plane.plane.percent + 0.05 : "ring" == b.what ? this.plane.plane.percent + 0.15 : this.plane.plane.percent, "frame" == b.what && (this.plane.frame.which = this.plane.abCheck(b) ? 0 : 1),
  10742. b.percent < this.hitPercent && b.percent > this.hitPercent - 0.1 && this.plane.abCheck(b) && !1 == b.hitted)) switch (this.plane.plane.hitIndex = 0, b.hitted = !0, b.what) {
  10743. case "tree":
  10744. case "balloon":
  10745. case "ufo":
  10746. case "ship":
  10747. "ufo" == b.what ? this.sounder("ufo") : this.sounder("pillow");
  10748. "oil" != ig.game.what && "ring" != ig.game.what && "star" != ig.game.what && 0 < this.main.heart && (this.main.heart -= 1, 0 >= this.main.heart && (this.main.preGameOver = !0, this.main.gameOverTimer.reset(), this.main.gameTimer.pause()));
  10749. this.plane.plane.hitted = !0;
  10750. this.main.speedRevertTimer.reset();
  10751. this.main.zSpeed = this.main.hitSpeed;
  10752. this.boom.x = (b.finalX + 320) / 2;
  10753. this.boom.show = !0;
  10754. break;
  10755. case "heart":
  10756. this.sounder("star");
  10757. this.main.heart += 1;
  10758. b.show = !1;
  10759. !1 == this.puffer.show && this.puffer.reGen(b, "heart");
  10760. break;
  10761. case "star":
  10762. this.sounder("star");
  10763. b.show = !1;
  10764. this.main.star += 1;
  10765. this.puffer.reGen(b, "star");
  10766. break;
  10767. case "ring":
  10768. this.sounder("star");
  10769. this.main.ring += 1;
  10770. b.which = 1;
  10771. break;
  10772. case "oil":
  10773. this.sounder("vacuum"), this.gui.tweenF("movePlane"), this.puffer.reGen(b, "oil")
  10774. }
  10775. },
  10776. hittedActions: function(b) {
  10777. !0 == b.hitted &&
  10778. ("oil" == b.what ? (b.hitIndex += 3, b.hitIndex < this.oilSc.length ? b.sc *= this.oilSc[b.hitIndex] : b.show = !1) : "ring" == b.what ? (b.hitIndex < this.hitSize.length - 12 && (b.hitIndex += 1), b.sc += 1.2 * this.hitSize[b.hitIndex], 10 < b.hitIndex && (b.alp -= 0.1, 0 > b.alp && (b.alp = 0))) : (b.hitIndex += 1, b.hitIndex < this.hitSize.length && (b.sc += this.hitSize[b.hitIndex])))
  10779. },
  10780. indexSwap: function() {
  10781. this.rocks.sort(function(b, c) {
  10782. return b.percent < c.percent ? -1 : b.percent > c.percent ? 1 : 0
  10783. })
  10784. },
  10785. tweenF: function() {},
  10786. done: function(b) {
  10787. switch (b) {
  10788. case "boom":
  10789. this.boom.show = !1, this.boom.ended = !1, this.boom.frame = 0
  10790. }
  10791. },
  10792. behaviors: function(b) {
  10793. switch (b.what) {
  10794. case "balloon":
  10795. case "ship":
  10796. this.ufoX = b.x + b.moveX;
  10797. b.x = 0 > this.ufoX ? 3 * this.sky.w + this.ufoX : this.ufoX > 3 * this.sky.w ? this.ufoX % (3 * this.sky.w) : this.ufoX;
  10798. break;
  10799. case "leader":
  10800. b.x = this.plane.frame.x + b.leadX;
  10801. 0 > b.x ? b.x += 3 * this.sky.w : b.x > 3 * this.sky.w && (b.x %= 3 * this.sky.w);
  10802. b.rot = 0 == b.which ? -30 < b.rot ? b.rot - 1 : -30 : 2 == b.which ? 30 > b.rot ? b.rot + 1 : 30 : -0.1 < b.rot && 0.1 > b.rot ? 0 : 0.8 * b.rot;
  10803. break;
  10804. case "frame":
  10805. if (b.moveCount.delta() > b.moveTime)
  10806. if (b.moveCount.reset(),
  10807. 1 == Math.floor(6 * Math.random())) {
  10808. b.moveTime = 3;
  10809. for (var c = b.moveX = 0; 3 > c; c++) this.plane["plane" + c].which = 1
  10810. } else if (b.moveTime = 3 + 3 * Math.random(), b.moveX = -2 + 4 * Math.random(), 0 > b.moveX)
  10811. for (c = 0; 3 > c; c++) this.plane["plane" + c].which = 0;
  10812. else if (0 < b.moveX)
  10813. for (c = 0; 3 > c; c++) this.plane["plane" + c].which = 2;
  10814. else
  10815. for (c = 0; 3 > c; c++) this.plane["plane" + c].which = 1;
  10816. this.ufoX = b.x + b.moveX;
  10817. b.x = 0 > this.ufoX ? 3 * this.sky.w + this.ufoX : this.ufoX > 3 * this.sky.w ? this.ufoX % (3 * this.sky.w) : this.ufoX;
  10818. break;
  10819. case "ufo":
  10820. !0 == b.lightOn ? 1 > b.lightAlp ?
  10821. (b.lightAlp += 0.014, 1 < b.lightAlp && (b.lightAlp = 1)) : b.lightOn = !1 : 0 < b.lightAlp ? (b.lightAlp -= 0.014, 0 > b.lightAlp && (b.lightAlp = 0)) : b.lightOn = !0, this.ufoX = b.x + b.moveX, b.x = 0 > this.ufoX ? 3 * this.sky.w + this.ufoX : this.ufoX > 3 * this.sky.w ? this.ufoX % (3 * this.sky.w) : this.ufoX
  10822. }
  10823. },
  10824. update: function() {
  10825. if (!ig.global.wm && (this.parent(), this.showRing = !1, this.runFrame("scarf"), !0 == this.boom.show && this.runFrame("boom"), !0 != this.main.gameOver))
  10826. if (!1 == this.main.gameStart)
  10827. for (var b = 0; b < this.rocks.length; b++) {
  10828. if ("rock" == this.rocks[b].what &&
  10829. (this.rocks[b].percent += 0.01 * this.main.zSpeed * ig.system.tick), "player" == this.rocks[b].what || "rock" == this.rocks[b].what) 1 < this.rocks[b].percent && this.reGenItem(this.rocks[b]), this.offsetWorldPos(this.rocks[b]), -100 < this.rocks[b].screenX && 740 > this.rocks[b].screenX + this.base.w && (this.renderPosition(this.rocks[b]), this.fadeAlpha(this.rocks[b]), this.poofInScale(this.rocks[b]))
  10830. } else if (!1 == this.main.gamePaused)
  10831. for (b = 0; b < this.rocks.length; b++) "player" != this.rocks[b].what && "frame" != this.rocks[b].what && "leader" !=
  10832. this.rocks[b].what && (this.rocks[b].percent += 0.01 * this.main.zSpeed * ig.system.tick), 1 < this.rocks[b].percent && this.reGenItem(this.rocks[b]), this.offsetWorldPos(this.rocks[b]), -100 < this.rocks[b].screenX && 740 > this.rocks[b].screenX + this.base.w && (this.behaviors(this.rocks[b]), this.renderPosition(this.rocks[b]), this.fadeAlpha(this.rocks[b]), this.poofInScale(this.rocks[b]), this.processHitItem(this.rocks[b]), this.hittedActions(this.rocks[b]))
  10833. },
  10834. drawInit: function() {},
  10835. ready: function() {
  10836. this.parent();
  10837. this.oriStat(); - 1 < _STRINGS.Game[ig.game.what + "1"][0].indexOf("$") && (_STRINGS.Game[ig.game.what + "1"][0] = _STRINGS.Game[ig.game.what + "1"][0].slice(0, _STRINGS.Game[ig.game.what + "1"][0].indexOf("$")) + this.main.howmany + _STRINGS.Game[ig.game.what + "1"][0].slice(_STRINGS.Game[ig.game.what + "1"][0].indexOf("$") + 1)); - 1 < _STRINGS.Game[ig.game.what + "2"][0].indexOf("$") && (_STRINGS.Game[ig.game.what + "2"][0] = _STRINGS.Game[ig.game.what + "2"][0].slice(0, _STRINGS.Game[ig.game.what + "2"][0].indexOf("$")) + this.main.howmany + _STRINGS.Game[ig.game.what +
  10838. "2"][0].slice(_STRINGS.Game[ig.game.what + "2"][0].indexOf("$") + 1))
  10839. },
  10840. draw: function() {
  10841. this.parent();
  10842. if (!ig.global.wm) {
  10843. this.drawer("game", this["shadowIm" + ig.game.player], 1, 1, 0, 320, this.plane.plane.finalY + 130 - Math.abs(0.2 * this.plane.plane.rot) - this["planeIm" + ig.game.player].height / 2, 0.87, 0.6, !0, "oil" == ig.game.what ? 0.2 : 0.9, this.plane.plane.rot);
  10844. for (var b = 0; b < this.rocks.length; b++) {
  10845. if (!0 == this.rocks[b].start && !0 == this.rocks[b].show && -100 < this.rocks[b].screenX && 740 > this.rocks[b].screenX + this.base.w && -200 <
  10846. this.rocks[b].finalX && 840 > this.rocks[b].finalX + this.base.w) switch (this.rocks[b].what) {
  10847. case "balloon":
  10848. case "ufo":
  10849. case "ship":
  10850. "ufo" == this.rocks[b].what && this.drawer("game", this.lightIm, 1, 1, 0, this.rocks[b].finalX, this.rocks[b].finalY + 40, this.rocks[b].sc, this.rocks[b].sc, !1, this.rocks[b].lightAlp * this.rocks[b].alp, 0, -this.lightIm.width / 2 * this.rocks[b].sc, -this.lightIm.height * this.rocks[b].sc);
  10851. this.drawer("game", this[this.rocks[b].what + "Im"], 3, 1, this.rocks[b].which, this.rocks[b].finalX, this.rocks[b].finalY +
  10852. 40, this.rocks[b].sc, this.rocks[b].sc, !1, this.rocks[b].alp, 0, -this[this.rocks[b].what + "Im"].width / 2 / 3 * this.rocks[b].sc, -this[this.rocks[b].what + "Im"].height * this.rocks[b].sc);
  10853. break;
  10854. case "rock":
  10855. this.drawer("game", this["rockIm" + this.main.which], this.rockVault[this.main.which], 1, this.rocks[b].which, this.rocks[b].finalX, this.rocks[b].finalY + 40, this.rocks[b].sc, this.rocks[b].sc, !1, this.rocks[b].alp, 0, -this["rockIm" + this.main.which].width / 2 / this.rockVault[this.main.which] * this.rocks[b].sc, -this["rockIm" +
  10856. this.main.which].height * this.rocks[b].sc);
  10857. break;
  10858. case "tree":
  10859. this.drawer("game", this["treeIm" + this.main.which], this.treeMaxFrame[this.main.which], 1, this.rocks[b].which, this.rocks[b].finalX, this.rocks[b].finalY + 40, this.rocks[b].sc, this.rocks[b].sc, !1, this.rocks[b].alp, 0, -this["treeIm" + this.main.which].width / 2 / this.treeVault[this.main.which] * this.rocks[b].sc, -this["treeIm" + this.main.which].height * this.rocks[b].sc);
  10860. break;
  10861. case "heart":
  10862. this.drawer("game", this.heartIm, 1, 1, 0, this.rocks[b].finalX, this.rocks[b].finalY +
  10863. 40, this.rocks[b].sc, this.rocks[b].sc, !1, this.rocks[b].alp, 0, -this.heartIm.width / 2 * this.rocks[b].sc, -this.heartIm.height * this.rocks[b].sc);
  10864. break;
  10865. case "star":
  10866. this.drawer("game", this.starIm, 1, 1, 0, this.rocks[b].finalX, this.rocks[b].finalY - 5, this.rocks[b].sc, this.rocks[b].sc, !1, this.rocks[b].alp, 0, -this.starIm.width / 2 * this.rocks[b].sc, -this.starIm.height * this.rocks[b].sc);
  10867. break;
  10868. case "leader":
  10869. this.drawer("game", this["planeIm" + this.rocks[b].num], 3, 1, this.rocks[b].which, this.rocks[b].finalX, this.rocks[b].finalY -
  10870. 5, this.rocks[b].sc, this.rocks[b].sc, !0, this.rocks[b].alp, this.rocks[b].rot);
  10871. break;
  10872. case "oil":
  10873. this.drawer("game", this.oilIm, 1, 1, 0, this.rocks[b].finalX, this.rocks[b].finalY + 40, this.rocks[b].sc, this.rocks[b].sc, !1, this.rocks[b].alp, 0, -this.oilIm.width / 2 * this.rocks[b].sc, -(this.oilIm.height - 5) * this.rocks[b].sc);
  10874. break;
  10875. case "ring":
  10876. this.drawer("game", this.ringIm, 2, 1, this.rocks[b].which, this.rocks[b].finalX, this.rocks[b].finalY - 100, this.rocks[b].sc, this.rocks[b].sc, !0, this.rocks[b].alp, 0)
  10877. }
  10878. "player" == this.rocks[b].what &&
  10879. (!0 == this.puffer.show && this.puffer.drawPuff(), "oil" == ig.game.what && this.drawer("game", this.targetIm, 1, 1, 0, 320 - 0.05 * this.rocks[b].rot, this.plane.plane.finalY + 120 - this["planeIm" + ig.game.player].height / 2, 1, 1, !0, 0.9), this.drawer("game", this["planeIm" + ig.game.player], 3, 1, this.main.frame, 320 + this.rocks[b].rot, Math.abs(0.2 * this.rocks[b].rot) + this.rocks[b].fly + this.rocks[b].finalY - this["planeIm" + ig.game.player].height / 2 + this.plane.plane.flyOffY, this.rocks[b].finalSc, this.rocks[b].finalSc, !0, 1, this.rocks[b].rot,
  10880. 0, this.plane.scarfY[ig.game.player]), this.drawer("game", this.scarfIm, this.scarf.frameX, this.scarf.frameY, this.scarf.frames[this.scarf.frame], this.scarf.x + this.plane.scarfX[ig.game.player] + this.rocks[b].rot, this.rocks[b].finalY - this.scarf.y + Math.abs(0.2 * this.rocks[b].rot) + this.rocks[b].fly + 2, 1, 1, !0, 1, 360 - this.rocks[b].rot, this.scarf.offX, this.scarf.offY), !0 == this.boom.show && this.drawer("game", this.boomIm, 4, 2, this.boom.frames[this.boom.frame], this.boom.x, this.boom.y, 1, 1, !0))
  10881. }
  10882. null != this.plane.frame &&
  10883. this.drawer("game", this.frameIm, 2, 1, this.plane.frame.which, this.plane.frame.finalX, this.plane.frame.finalY + 80, this.plane.frame.sc, this.plane.frame.sc, !0, 1, 0, 0, -this.frameIm.height * this.plane.frame.sc)
  10884. }
  10885. }
  10886. })
  10887. });
  10888. ig.baked = !0;
  10889. ig.module("game.entities.plain-tree").requires("game.entities.plain").defines(function() {
  10890. EntityPlainTree = EntityPlain.extend({
  10891. gravityFactor: 0,
  10892. type: ig.Entity.TYPE.B,
  10893. zIndex: 1,
  10894. speed: 0,
  10895. moveRight: !0,
  10896. size: {
  10897. x: 800,
  10898. y: 600
  10899. },
  10900. which: 1,
  10901. treeStorage: [],
  10902. startY: [115, 115, 123, 130],
  10903. treeTall0: [141, 1369, 130, 101, 105, 97, 81, 38, 37],
  10904. treeTall1: [153, 152, 150, 141, 52, 53],
  10905. treeTall2: [119, 156, 165, 157, 157, 583, 48, 31, 59],
  10906. treeTall3: [138, 125, 185, 109, 106, 106, 124, 50],
  10907. treeWidth0: [134, 64, 68, 93, 54, 53, 70, 50, 55],
  10908. treeWidth1: [94, 135, 83, 77, 68, 70],
  10909. treeWidth2: [103,
  10910. 80, 86, 145, 80, 78, 56, 47, 85
  10911. ],
  10912. treeWidth3: [99, 101, 111, 106, 86, 32, 111, 51],
  10913. treeVault: [9, 6, 9, 8],
  10914. bigTree: [7, 4, 5, 7],
  10915. ready: function() {
  10916. this.parent();
  10917. for (var b = 0; b < this.treeStorage.length; b++) {
  10918. this.treeStorage[b].percent = b / this.treeStorage.length;
  10919. this.treeStorage[b].alp = 0;
  10920. this.treeStorage[b].startSc = 0;
  10921. this.treeStorage[b].step = 0;
  10922. var c = -400 + this.main.world.x + Math.floor(Math.random() * (this.main.w + 800));
  10923. this.treeStorage[b].x = 0 > c ? 3 * this.sky.w + c : c > 3 * this.sky.w ? c % (3 * this.sky.w) : c;
  10924. this.ground.rocks.push(this.treeStorage[b])
  10925. }
  10926. this.ground.indexSwap()
  10927. },
  10928. init: function(b, c, d) {
  10929. ig.global.wm || (this.parent(b, c, d), this.seq = d.seq, this.main = d.main, this.oriStat(), this.spawnTrees())
  10930. },
  10931. spawnTrees: function() {
  10932. for (var b = 0; 15 > b; b++) {
  10933. var c = 3 == Math.floor(10 * Math.random()) ? Math.floor(Math.random() * this.treeVault[this.main.which]) : Math.floor(Math.random() * this.bigTree[this.main.which]);
  10934. this.treeStorage.push({
  10935. seq: b,
  10936. hitRectW: this["treeWidth" + this.main.which][c],
  10937. hitRectH: this["treeTall" + this.main.which][c],
  10938. what: "tree",
  10939. alp: 0,
  10940. show: !0,
  10941. which: c,
  10942. x: 0,
  10943. startSc: 0,
  10944. sc: 0.5,
  10945. percent: 1 *
  10946. Math.random(),
  10947. oriSc: 1,
  10948. step: 0,
  10949. scSpeed: 0.01,
  10950. screenX: 0,
  10951. x0: 320,
  10952. y0: this.startY[this.main.which],
  10953. x1: 320,
  10954. y1: 190,
  10955. x2: 640,
  10956. y2: 550
  10957. })
  10958. }
  10959. },
  10960. oriStat: function() {
  10961. this.spawnTimer = new ig.Timer;
  10962. this.spawnTime = 1;
  10963. this.base = {
  10964. y: 130,
  10965. sc: 1,
  10966. oriSc: 0.9,
  10967. scX: 1,
  10968. scY: 1,
  10969. alp: 1,
  10970. rot: 0,
  10971. textSize: 26,
  10972. tweening: !1,
  10973. frameCount: 0,
  10974. frameTime: 1,
  10975. frame: 0,
  10976. frameX: 1,
  10977. frameY: 1,
  10978. frames: [0],
  10979. tFrame: 1,
  10980. loop: !1,
  10981. ended: !1,
  10982. cent: !0
  10983. }
  10984. },
  10985. tweenF: function() {},
  10986. reGen: function(b) {
  10987. b.percent = 0;
  10988. b.alp = 0;
  10989. b.startSc = 0;
  10990. b.step = 0;
  10991. var c = -400 + this.main.world.x + Math.floor(Math.random() * (this.main.w +
  10992. 800));
  10993. b.x = 0 > c ? 3 * this.sky.w + c : c > 3 * this.sky.w ? c % (3 * this.sky.w) : c
  10994. },
  10995. update: function() {
  10996. ig.global.wm || this.parent()
  10997. },
  10998. draw: function() {
  10999. this.parent()
  11000. }
  11001. })
  11002. });
  11003. ig.baked = !0;
  11004. ig.module("game.entities.plain-plane").requires("game.entities.plain").defines(function() {
  11005. EntityPlainPlane = EntityPlain.extend({
  11006. gravityFactor: 0,
  11007. type: ig.Entity.TYPE.B,
  11008. zIndex: 1,
  11009. h: 600,
  11010. w: 800,
  11011. boardOn: !1,
  11012. ranks: [0, 0, 0, 0],
  11013. scarfY: [1, 1, 12, 8],
  11014. scarfX: [2, 2, 2, 3],
  11015. size: {
  11016. x: 800,
  11017. y: 600
  11018. },
  11019. gameOver: !1,
  11020. gamePaused: !1,
  11021. tweening: "middle",
  11022. score: 0,
  11023. clue: 0,
  11024. ans: 10,
  11025. planes: [0, 1, 2, 3],
  11026. oil: [],
  11027. rotAngles: [0, 6.237000000000001, 9.333, 12.213000000000003, 14.448000000000004, 16.932000000000006, 19.07966666666667, 20.814666666666675, 22.698666666666675,
  11028. 24.103666666666676, 25.514666666666674, 26.798666666666673, 27.703666666666674, 28.548000000000005, 29.232000000000006, 29.637000000000008, 29.91466666666667, 30
  11029. ],
  11030. rotSpeed: 30,
  11031. rotAngle: 45,
  11032. iniSpeed: 2,
  11033. hitSize: [0.02, 0.04, 0.07, 0.1, 0.12, 0.14, 0.18, 0.2, 0.18, 0.15, 0.1, 0.06, 0.01, -0.02, -0.05, -0.1, 0.01, 0.06, 0.01, -0.02, -0.05, -0.1],
  11034. init: function(b, c, d) {
  11035. ig.global.wm || (this.parent(b, c, d), this.oriStat())
  11036. },
  11037. genQues: function() {},
  11038. pauseGame: function() {},
  11039. resumeGame: function() {},
  11040. oriStat: function() {
  11041. this.base = {
  11042. x: 240,
  11043. task: "none",
  11044. y: 130,
  11045. sc: 0,
  11046. oriSc: 0.9,
  11047. scX: 1,
  11048. scY: 1,
  11049. alp: 1,
  11050. rot: 0,
  11051. textSize: 26,
  11052. tweening: !1,
  11053. frameCount: 0,
  11054. frameTime: 1,
  11055. frame: 0,
  11056. frameX: 1,
  11057. frameY: 1,
  11058. frames: [0],
  11059. tFrame: 1,
  11060. loop: !1,
  11061. ended: !1,
  11062. cent: !0
  11063. }
  11064. },
  11065. spawnLeaders: function() {
  11066. this.planes.splice(ig.game.player, 1);
  11067. this.plane0 = {
  11068. what: "leader",
  11069. num: this.planes[0],
  11070. which: 1,
  11071. percent: 0.5,
  11072. x: this.frame.x - 50,
  11073. leadX: -50,
  11074. y: 130,
  11075. oriSc: 0.8,
  11076. sc: 1,
  11077. alp: 1,
  11078. rot: 0,
  11079. screenX: 0,
  11080. x0: 320,
  11081. y0: this.ground.startY[this.main.which],
  11082. x1: 320,
  11083. y1: 190,
  11084. x2: 640,
  11085. y2: 550,
  11086. show: !0
  11087. };
  11088. this.plane1 = {
  11089. what: "leader",
  11090. num: this.planes[1],
  11091. which: 1,
  11092. percent: 0.4,
  11093. x: this.frame.x,
  11094. leadX: 0,
  11095. y: 130,
  11096. oriSc: 0.9,
  11097. sc: 1,
  11098. alp: 1,
  11099. rot: 0,
  11100. screenX: 0,
  11101. x0: 320,
  11102. y0: this.ground.startY[this.main.which],
  11103. x1: 320,
  11104. y1: 190,
  11105. x2: 640,
  11106. y2: 550,
  11107. show: !0
  11108. };
  11109. this.plane2 = {
  11110. what: "leader",
  11111. num: this.planes[2],
  11112. which: 1,
  11113. percent: 0.5,
  11114. x: this.frame.x + 50,
  11115. leadX: 50,
  11116. y: 130,
  11117. oriSc: 0.8,
  11118. sc: 1,
  11119. alp: 1,
  11120. rot: 0,
  11121. screenX: 0,
  11122. x0: 320,
  11123. y0: this.ground.startY[this.main.which],
  11124. x1: 320,
  11125. y1: 190,
  11126. x2: 640,
  11127. y2: 550,
  11128. show: !0
  11129. };
  11130. this.ground.rocks.push(this.plane0);
  11131. this.ground.rocks.push(this.plane1);
  11132. this.ground.rocks.push(this.plane2)
  11133. },
  11134. spawnFrame: function() {
  11135. this.frame = {
  11136. moveCount: new ig.Timer,
  11137. moveTime: 6,
  11138. moveX: -2 + 4 * Math.random(),
  11139. seq: 0,
  11140. hitRectW: this.ground.frameIm.width / 3 - 40,
  11141. hitRectH: 300,
  11142. fixSc: 0.87,
  11143. what: "frame",
  11144. alp: 1,
  11145. show: !0,
  11146. which: 1,
  11147. fly: 0,
  11148. x: 280,
  11149. startSc: 0,
  11150. sc: 0.5,
  11151. percent: 0.71,
  11152. oriSc: 1,
  11153. step: 0,
  11154. scSpeed: 0.01,
  11155. screenX: 0,
  11156. x0: 320,
  11157. y0: this.ground.startY[this.main.which],
  11158. x1: 320,
  11159. y1: 190,
  11160. x2: 640,
  11161. y2: 550,
  11162. rot: 35,
  11163. rotTarg: 0,
  11164. turning: "left",
  11165. hitIndex: 0
  11166. };
  11167. this.ground.rocks.push(this.frame)
  11168. },
  11169. abCheck: function(b) {
  11170. var c, d, g, j, n, y, r;
  11171. c = "tree" == b.what ? 0 : "oil" == b.what ? 130 : 80;
  11172. j = 320 - (this.plane.hitRectW -
  11173. c) / 2 * this.plane.fixSc;
  11174. n = this.plane.finalY;
  11175. y = (this.plane.hitRectW - c) * this.plane.fixSc;
  11176. r = this.plane.hitRectH * this.plane.fixSc;
  11177. c = b.finalX - b.hitRectW / 2 * b.sc;
  11178. d = b.finalY - b.hitRectH / 2 * b.sc;
  11179. g = b.hitRectW * b.sc;
  11180. b = b.hitRectH * b.sc;
  11181. return c + g > j && c < j + y && d + b > n && d < n + r ? !0 : !1
  11182. },
  11183. tweenF: function(b) {
  11184. switch (b) {
  11185. case "oil0":
  11186. this.tweening = !0;
  11187. this.tweener("base", {
  11188. sc: 30
  11189. }, 0.3, "oil2");
  11190. break;
  11191. case "oil1":
  11192. this.tweener("base", {
  11193. sc: 0
  11194. }, 0.3, "oil2");
  11195. break;
  11196. case "oil2":
  11197. this.tweening = !1;
  11198. break;
  11199. case "swiftRight0":
  11200. if (!0 == ig.input.state("click")) break;
  11201. if ("right" != this.tweening) break;
  11202. this.tweener("plane", {
  11203. rot: this.rotAngle - 5
  11204. }, 1.5, "swiftRight1");
  11205. break;
  11206. case "swiftRight1":
  11207. if (!0 == ig.input.state("click")) break;
  11208. if ("right" != this.tweening) break;
  11209. this.tweener("plane", {
  11210. rot: this.rotAngle
  11211. }, 1.5, "swiftRight0");
  11212. break;
  11213. case "swiftLeft0":
  11214. if (!0 == ig.input.state("click")) break;
  11215. if ("left" != this.tweening) break;
  11216. this.tweener("plane", {
  11217. rot: -this.rotAngle - 5
  11218. }, 1.5, "swiftLeft1");
  11219. break;
  11220. case "swiftLeft1":
  11221. if (!0 == ig.input.state("click")) break;
  11222. if ("left" != this.tweening) break;
  11223. this.tweener("plane", {
  11224. rot: -this.rotAngle
  11225. }, 1.5, "swiftLeft0");
  11226. break;
  11227. case "swiftMiddle0":
  11228. if (!0 == ig.input.state("click")) break;
  11229. if ("middle" != this.tweening) break;
  11230. this.tweener("plane", {
  11231. rot: 4
  11232. }, 2.4, "swiftMiddle1");
  11233. break;
  11234. case "swiftMiddle1":
  11235. if (!0 == ig.input.state("click")) break;
  11236. if ("middle" != this.tweening) break;
  11237. this.tweener("plane", {
  11238. rot: -4
  11239. }, 2.4, "swiftMiddle0");
  11240. break;
  11241. case "startRot":
  11242. this.main.planeRot = !1;
  11243. break;
  11244. case "flyUp":
  11245. this.tweener("plane", {
  11246. fly: -8,
  11247. plusRot: -2
  11248. }, 1.2, "flyDown");
  11249. break;
  11250. case "flyDown":
  11251. this.tweener("plane", {
  11252. fly: 0,
  11253. plusRot: 2
  11254. },
  11255. 1.2, "flyUp")
  11256. }
  11257. },
  11258. update: function() {
  11259. if (!ig.global.wm && (this.parent(), !0 == this.tweening && this.oil.push(this.base.sc), !0 == this.plane.hitted && (this.plane.hitIndex += 1, this.plane.finalSc = this.plane.hitIndex < this.hitSize.length ? this.plane.fixSc + 0.8 * this.hitSize[this.plane.hitIndex] : this.plane.fixSc), !0 == ig.input.state("right") || !0 == ig.input.state("left") || ig.ua.mobile)) {
  11260. switch (this.plane.turning) {
  11261. case "left":
  11262. if ("left" == this.tweening) return;
  11263. for (var b = 0; b < this.tweens.length; b++) - 1 < this.tweens[b].seq.indexOf("swift") &&
  11264. this.tweens[b].stop();
  11265. this.tweening = "left";
  11266. this.tweener("plane", {
  11267. rot: -this.rotAngle
  11268. }, 1, "swiftLeft0");
  11269. break;
  11270. case "right":
  11271. if ("right" == this.tweening) return;
  11272. for (b = 0; b < this.tweens.length; b++) - 1 < this.tweens[b].seq.indexOf("swift") && this.tweens[b].stop();
  11273. this.tweening = "right";
  11274. this.tweener("plane", {
  11275. rot: this.rotAngle
  11276. }, 1, "swiftRight0");
  11277. break;
  11278. case "middle":
  11279. if ("middle" == this.tweening) return;
  11280. for (b = 0; b < this.tweens.length; b++) - 1 < this.tweens[b].targ.indexOf("plane") && -1 == this.tweens[b].seq.indexOf("fly") && this.tweens[b].stop();
  11281. this.tweening = "middle";
  11282. this.tweener("plane", {
  11283. rot: 0
  11284. }, 1, "swiftMiddle0")
  11285. }
  11286. this.rotSpeed -= 0.03;
  11287. 0.1 > this.rotSpeed && (this.rotSpeed = 0.1)
  11288. }
  11289. },
  11290. middle: function() {
  11291. if ("middle" != this.tweening) {
  11292. for (var b = 0; b < this.tweens.length; b++) - 1 < this.tweens[b].targ.indexOf("plane") && -1 == this.tweens[b].seq.indexOf("fly") && this.tweens[b].stop();
  11293. this.tweening = "middle";
  11294. this.tweener("plane", {
  11295. rot: 0
  11296. }, 1, "swiftMiddle0")
  11297. }
  11298. },
  11299. ready: function() {
  11300. this.parent();
  11301. this.plane = {
  11302. seq: 0,
  11303. hitRectW: this.ground.planeIm0.width / 3 - 20,
  11304. hitRectH: this.ground.planeIm0.height,
  11305. fixSc: 0.87,
  11306. what: "player",
  11307. alp: 1,
  11308. show: !0,
  11309. which: 1,
  11310. fly: 0,
  11311. finalY: 291,
  11312. finalX: 320,
  11313. y: 291,
  11314. x: 320,
  11315. startSc: 0,
  11316. sc: 0.5,
  11317. percent: 0.72,
  11318. oriSc: 1,
  11319. step: 0,
  11320. scSpeed: 0.01,
  11321. screenX: 0,
  11322. x0: 320,
  11323. y0: this.ground.startY[this.main.which],
  11324. x1: 320,
  11325. y1: 190,
  11326. x2: 640,
  11327. y2: 550,
  11328. rot: 0,
  11329. rotTarg: 0,
  11330. turning: "left",
  11331. hitIndex: 0,
  11332. plusRot: 0,
  11333. flyOffX: 0,
  11334. flyOffY: 0
  11335. };
  11336. this.ground.rocks.push(this.plane);
  11337. this.ground.indexSwap();
  11338. this.tweenF("flyUp")
  11339. },
  11340. draw: function() {
  11341. this.parent()
  11342. }
  11343. })
  11344. });
  11345. ig.baked = !0;
  11346. ig.module("game.entities.plain-puffer").requires("game.entities.plain").defines(function() {
  11347. EntityPlainPuffer = EntityPlain.extend({
  11348. gravityFactor: 0,
  11349. type: ig.Entity.TYPE.B,
  11350. zIndex: 1,
  11351. show: !1,
  11352. which: "star",
  11353. h: 600,
  11354. w: 800,
  11355. boardOn: !1,
  11356. ranks: [0, 0, 0, 0],
  11357. size: {
  11358. x: 800,
  11359. y: 600
  11360. },
  11361. gameOver: !1,
  11362. gamePaused: !1,
  11363. score: 0,
  11364. clue: 0,
  11365. ans: 10,
  11366. puff: [],
  11367. rotSpeed: 30,
  11368. rotAngle: 30,
  11369. iniSpeed: 2,
  11370. starPuffIm: new ig.Image("media/graphics/sprites/starpuff.png"),
  11371. oilPuffIm: new ig.Image("media/graphics/sprites/oilpuff.png"),
  11372. heartPuffIm: new ig.Image("media/graphics/sprites/heartpuff.png"),
  11373. hitSize: [0.02, 0.04, 0.07, 0.1, 0.12, 0.14, 0.18, 0.2, 0.18, 0.15, 0.1, 0.06, 0.01, -0.02, -0.05, -0.1, 0.01, 0.06, 0.01, -0.02, -0.05, -0.1],
  11374. init: function(b, c, d) {
  11375. ig.global.wm || (this.parent(b, c, d), this.spawner())
  11376. },
  11377. reGen: function(b, c) {
  11378. this.which = c;
  11379. for (var d = 0; 5 > d; d++) this.puff[d].x = b.finalX, this.puff[d].y = 420, this.puff[d].progress = 0, this.puff[d].y = b.finalY, this.puff[d].rot = Math.floor(360 * Math.random()), this.puff[d].alp = 0, this.puff[d].sc = 0, this.puff[d].speedX = 20 * (d / 5) - 10 + 4 * Math.random(), this.puff[d].speedY = -30 + 15 * Math.random(),
  11380. this.puff[d].lastX = 0, this.puff[d].lastY = 0, this.puff[d].oriSc = 0.3 + 0.4 * Math.random(), this.show = !0
  11381. },
  11382. spawner: function() {
  11383. for (var b = 0; 5 > b; b++) this.puff.push({
  11384. x: 320,
  11385. y: 320,
  11386. rot: Math.floor(360 * Math.random()),
  11387. alp: 0,
  11388. show: !1,
  11389. sc: 0,
  11390. speedX: 20 * (b / 5) - 10 + 4 * Math.random(),
  11391. speedY: -30 + 15 * Math.random(),
  11392. progress: 0,
  11393. lastX: 0,
  11394. lastY: 0,
  11395. oriSc: 0.6 + 0.4 * Math.random()
  11396. })
  11397. },
  11398. tweenF: function() {},
  11399. update: function() {
  11400. if (!ig.global.wm && (this.parent(), !0 == this.show))
  11401. for (var b = this.count = 0; b < this.puff.length; b++) this.puff[b].speedX *= 1.01, this.puff[b].speedY +=
  11402. 1.05, this.puff[b].x += this.puff[b].speedX, this.puff[b].y += this.puff[b].speedY, this.puff[b].rot += 5, this.puff[b].progress += 1, 1 > this.puff[b].sc && (this.puff[b].sc += 0.1 + 0.01 * this.puff[b].sc), 25 < this.puff[b].progress ? (this.puff[b].alp -= 0.1, this.puff[b].sc -= 0.1 + 0.01 * this.puff[b].sc, 0 > this.puff[b].sc && (this.puff[b].sc = 0)) : this.puff[b].alp += 0.1, 30 < this.puff[b].progress && (this.puff[b].show = !1, this.count += 1), this.count == this.puff.length && (this.show = !1)
  11403. },
  11404. drawPuff: function() {
  11405. for (var b = 0; b < this.puff.length; b++) 0 <
  11406. this.puff[b].alp && this.drawer("game", this[this.which + "PuffIm"], 1, 1, 0, this.puff[b].x, this.puff[b].y, this.puff[b].sc * this.puff[b].oriSc, this.puff[b].sc * this.puff[b].oriSc, !0, this.puff[b].alp, this.puff[b].rot)
  11407. },
  11408. ready: function() {
  11409. this.parent()
  11410. },
  11411. draw: function() {
  11412. this.parent()
  11413. }
  11414. })
  11415. });
  11416. ig.baked = !0;
  11417. ig.module("game.entities.plain-gui").requires("game.entities.plain", "game.entities.plain-map-but").defines(function() {
  11418. EntityPlainGui = EntityPlain.extend({
  11419. gravityFactor: 0,
  11420. type: ig.Entity.TYPE.B,
  11421. zIndex: 200,
  11422. greyAlp: 0,
  11423. startSpeech: 0,
  11424. h: 600,
  11425. w: 800,
  11426. showRead: !1,
  11427. doneRead: !1,
  11428. boardOn: !1,
  11429. ranks: [0, 0, 0, 0],
  11430. size: {
  11431. x: 800,
  11432. y: 600
  11433. },
  11434. gameOver: !1,
  11435. gamePaused: !1,
  11436. gameOverSpeech: !1,
  11437. overText: "complete",
  11438. goodOffX: -700,
  11439. goodJob: !1,
  11440. fail: !1,
  11441. text1: 0,
  11442. text2: 0,
  11443. text3: 0,
  11444. finalText: 0,
  11445. score1: 0,
  11446. score2: 0,
  11447. score3: 0,
  11448. finalScore: 0,
  11449. awesomeIm: new ig.Image("media/graphics/sprites/awesome.png"),
  11450. speechIm: new ig.Image("media/graphics/sprites/speech.png"),
  11451. fanIm: new ig.Image("media/graphics/sprites/fan.png"),
  11452. planeIm: new ig.Image("media/graphics/sprites/home-plane.png"),
  11453. scarfIm: new ig.Image("media/graphics/sprites/home-scarf.png"),
  11454. starIm: new ig.Image("media/graphics/sprites/mission-star.png"),
  11455. heartIm: new ig.Image("media/graphics/sprites/gui-heart.png"),
  11456. ringIm: new ig.Image("media/graphics/sprites/gui-ring.png"),
  11457. oilIm: new ig.Image("media/graphics/sprites/gui-oil.png"),
  11458. fuelIm: new ig.Image("media/graphics/sprites/fuel.png"),
  11459. baseIm: new ig.Image("media/graphics/sprites/fuelbase.png"),
  11460. miniIm: new ig.Image("media/graphics/sprites/miniplane.png"),
  11461. boardIm: new ig.Image("media/graphics/sprites/board.png"),
  11462. wingRIm: new ig.Image("media/graphics/sprites/wing-r.png"),
  11463. wingLIm: new ig.Image("media/graphics/sprites/wing-l.png"),
  11464. leftIm: new ig.Image("media/graphics/sprites/arrow-l.png"),
  11465. rightIm: new ig.Image("media/graphics/sprites/arrow-r.png"),
  11466. sLoop: {
  11467. score: {
  11468. id: "score",
  11469. duration: 0.08
  11470. }
  11471. },
  11472. init: function(b, c, d) {
  11473. ig.global.wm || (this.parent(b, c,
  11474. d), this.oriStat())
  11475. },
  11476. genQues: function() {},
  11477. pauseGame: function() {},
  11478. resumeGame: function() {},
  11479. oriStat: function() {
  11480. this.overBoard = {
  11481. offY: 0
  11482. };
  11483. this.arrow = {
  11484. alp: 0
  11485. };
  11486. this.planeX = 290 * (this.main.collect / this.main.howmany) - 6;
  11487. this.planeGui = {
  11488. x: 535,
  11489. y: 160,
  11490. x2: 125,
  11491. y2: 170,
  11492. offX: -500,
  11493. offY: -500,
  11494. sc: 1,
  11495. oriSc: 0.9,
  11496. scX: 1,
  11497. scY: 1,
  11498. alp: 1,
  11499. rot: 0,
  11500. textSize: 26,
  11501. tweening: !1,
  11502. frameCount: 0,
  11503. frameTime: 0.02,
  11504. frameTimer: new ig.Timer,
  11505. frame: 0,
  11506. frameX: 1,
  11507. frameY: 1,
  11508. frames: [0, 1, 2, 2, 3],
  11509. tFrame: 1,
  11510. loop: !0,
  11511. ended: !1,
  11512. cent: !0
  11513. };
  11514. this.scarf = {
  11515. x: -40,
  11516. y: -37,
  11517. x2: -40,
  11518. y2: -37,
  11519. sc: 1,
  11520. oriSc: 0.9,
  11521. scX: 1,
  11522. scY: 1,
  11523. alp: 1,
  11524. rot: 0,
  11525. textSize: 26,
  11526. tweening: !1,
  11527. frameCount: 0,
  11528. frameTime: 0.05,
  11529. frameTimer: new ig.Timer,
  11530. frame: 0,
  11531. frameX: 1,
  11532. frameY: 1,
  11533. frames: [0, 1, 2, 3, 4, 5],
  11534. tFrame: 1,
  11535. loop: !0,
  11536. ended: !1,
  11537. cent: !0
  11538. };
  11539. this.fan = {
  11540. x: 65,
  11541. y: -6,
  11542. x2: 65,
  11543. y2: -6,
  11544. sc: 1,
  11545. oriSc: 0.9,
  11546. offX: [0, 0, 0, 0, 0],
  11547. offY: [0, 1, 3, 3, 1],
  11548. scX: 1,
  11549. scY: 1,
  11550. alp: 1,
  11551. rot: 0,
  11552. textSize: 26,
  11553. tweening: !1,
  11554. frameCount: 0,
  11555. frameTime: 0.05,
  11556. frameTimer: new ig.Timer,
  11557. frame: 0,
  11558. frameX: 1,
  11559. frameY: 1,
  11560. frames: [0, 1, 2, 2, 3],
  11561. tFrame: 1,
  11562. loop: !0,
  11563. ended: !1,
  11564. cent: !0
  11565. }
  11566. },
  11567. spawner: function() {},
  11568. tweenF: function(b) {
  11569. switch (b) {
  11570. case "goodJob":
  11571. this.goodJob = !0;
  11572. this.tweener("this", {
  11573. goodOffX: 0
  11574. }, 0.3, "goodJob2");
  11575. break;
  11576. case "goodJob2":
  11577. this.tweener("this", {
  11578. goodOffX: -700
  11579. }, 0.3, "goodJob3", 3);
  11580. break;
  11581. case "goodJob3":
  11582. this.goodJob = !1;
  11583. break;
  11584. case "fail":
  11585. this.fail = !0;
  11586. this.tweener("this", {
  11587. goodOffX: 0
  11588. }, 0.3, "fail2");
  11589. break;
  11590. case "fail2":
  11591. this.tweener("this", {
  11592. goodOffX: -700
  11593. }, 0.3, "fail3", 3);
  11594. break;
  11595. case "fail3":
  11596. this.fail = !1;
  11597. break;
  11598. case "restart":
  11599. ig.game.director.jumpTo(LevelGame);
  11600. break;
  11601. case "clickable":
  11602. this.main.clickable = !0;
  11603. break;
  11604. case "arrowFlash0":
  11605. this.tweener("arrow", {
  11606. alp: 1
  11607. },
  11608. 0.3, "arrowFlash1");
  11609. break;
  11610. case "arrowFlash1":
  11611. this.tweener("arrow", {
  11612. alp: 0
  11613. }, 0.3, "arrowFlash0", 0.3);
  11614. break;
  11615. case "tellMission0":
  11616. this.sounder("flip");
  11617. this.tweener("planeGui", {
  11618. offY: 50
  11619. }, 0.2, "tellMission1");
  11620. break;
  11621. case "tellMission1":
  11622. this.showRead = !0;
  11623. this.tweener("planeGui", {
  11624. offY: -20
  11625. }, 0.3);
  11626. break;
  11627. case "offMission0":
  11628. this.tweener("planeGui", {
  11629. offY: 50
  11630. }, 0.2, "offMission1");
  11631. break;
  11632. case "offMission1":
  11633. this.sounder("flip");
  11634. this.tweener("planeGui", {
  11635. offY: -500
  11636. }, 0.3, "offMission2");
  11637. break;
  11638. case "offMission2":
  11639. this.tweener("planeGui", {}, 0.3, "offMission3");
  11640. break;
  11641. case "offMission3":
  11642. this.main.gameTimer.unpause();
  11643. this.main.gameStart = !0;
  11644. this.main.gamePaused = !1;
  11645. this.main.clickable = !0;
  11646. break;
  11647. case "movePlane":
  11648. if (this.main.collect + 1 > this.main.howmany) break;
  11649. this.main.collect += 1;
  11650. !1 == this.main.preGameOver && this.main.collect >= this.main.howmany && (this.main.preGameOver = !0, this.main.gameOverTimer.reset(), this.main.gameTimer.pause());
  11651. for (b = 0; b < this.sky.tweens.length; b++) - 1 < this.sky.tweens[b].seq.indexOf("movePlane2") && this.sky.tweens[b].stop();
  11652. this.tweener("this", {
  11653. planeX: 290 * (this.main.collect / this.main.howmany) - 6
  11654. }, 0.5, "movePlane2");
  11655. break;
  11656. case "gameOver0":
  11657. this.countScore();
  11658. this.sounder("flip");
  11659. this.overBoard.offY = -700;
  11660. this.tweener("overBoard", {
  11661. offY: 20
  11662. }, 0.3, "gameOver1");
  11663. this.main.middle();
  11664. break;
  11665. case "gameOver1":
  11666. "fail" == this.overText ? (this.fail = !0, this.tweenF("fail")) : (this.goodJob = !0, this.tweenF("goodJob"));
  11667. this.tweener("overBoard", {
  11668. offY: -25
  11669. }, 0.3, "gameOver2");
  11670. break;
  11671. case "gameOver2":
  11672. "fail" == this.overText ? this.tweenF("offBoard0") : (this.tweening = !1, 0 == this.score1 ? this.tweenF("score2") : (this.tweening = !0, this.tweener("this", {
  11673. text1: this.score1
  11674. }, 0.5, "score2")));
  11675. break;
  11676. case "score2":
  11677. this.tweening = !1;
  11678. 0 == this.score2 ? this.tweenF("score3") : (this.tweening = !0, this.tweener("this", {
  11679. text2: this.score2
  11680. }, 0.5, "score3"));
  11681. break;
  11682. case "score3":
  11683. this.tweening = !1;
  11684. 0 == this.score3 ? this.tweenF("score4") : (this.tweening = !0, this.tweener("this", {
  11685. text3: this.score3
  11686. }, 0.5, "score4"));
  11687. break;
  11688. case "score4":
  11689. this.tweening = !0;
  11690. this.tweener("this", {
  11691. finalText: this.finalScore
  11692. }, 0.5, "offBoard0");
  11693. break;
  11694. case "offBoard0":
  11695. this.tweening = !1;
  11696. this.tweener("overBoard", {
  11697. offY: 20
  11698. }, 0.3, "offBoard1", 2);
  11699. break;
  11700. case "offBoard1":
  11701. this.tweener("overBoard", {
  11702. offY: -700
  11703. }, 0.3, "offBoard2");
  11704. break;
  11705. case "offBoard2":
  11706. ig.game.plusScore > ig.game.nextLvl && 20 > ig.game.lvl ? (ig.game.lvl += 1, ig.game.nextLvl = 2500 * ig.game.lvl + 150 * ig.game.lvl, ig.game.storage.set(ig.game.gameKey, {
  11707. star: ig.game.plusScore,
  11708. lvl: ig.game.lvl,
  11709. mission: ig.game.mission,
  11710. map: ig.game.map,
  11711. player: ig.game.player,
  11712. nextLvl: 2500 * ig.game.lvl + 150 * ig.game.lvl,
  11713. seq: ig.game.seq
  11714. }),
  11715. ig.game.director.jumpTo(LevelOver)) : (ig.game.storage.set(ig.game.gameKey, {
  11716. star: ig.game.plusScore,
  11717. lvl: ig.game.lvl,
  11718. mission: ig.game.mission,
  11719. map: ig.game.map,
  11720. player: ig.game.player,
  11721. nextLvl: ig.game.nextLvl,
  11722. seq: ig.game.seq
  11723. }), ig.game.director.jumpTo(LevelMission)), this.setScore(ig.game.gameKey)
  11724. }
  11725. },
  11726. update: function() {
  11727. ig.global.wm || (this.parent(), !0 == this.tweening && this.soundLooper("score"), !0 == this.main.gameOver && !1 == this.gameOverSpeech && (this.gameOverSpeech = !0, this.tweenF("gameOver0")))
  11728. },
  11729. countScore: function() {
  11730. this.finalScore =
  11731. Math.floor(ig.game.storage.get(ig.game.gameKey).star);
  11732. switch (ig.game.what) {
  11733. case "ufo":
  11734. case "ship":
  11735. case "balloon":
  11736. 60 > this.main.gameTimer.delta() ? (this.overText = "fail", this.finalText = ig.game.storage.get(ig.game.gameKey).star) : (this.overText = "complete", this.score1 = 10 * this.main.heart, this.score2 = 5 * this.main.star, this.score3 = 500, this.finalScore = ig.game.storage.get(ig.game.gameKey).star + this.score1 + this.score2 + this.score3);
  11737. break;
  11738. case "oil":
  11739. this.main.collect < this.main.howmany ? (this.overText = "fail", this.finalText =
  11740. ig.game.storage.get(ig.game.gameKey).star) : (this.overText = "complete", this.score1 = Math.floor(1E3 * ((60 - this.main.gameTimer.delta()) / 60)), this.score2 = 10 * this.main.star, this.score3 = 400, this.finalScore = ig.game.storage.get(ig.game.gameKey).star + this.score1 + this.score2 + this.score3);
  11741. break;
  11742. case "ring":
  11743. this.main.ring < this.main.howmany ? (this.overText = "fail", this.finalText = ig.game.storage.get(ig.game.gameKey).star) : (this.overText = "complete", this.score1 = 800 * (this.main.ring / this.main.total), this.score3 = 200, this.finalScore =
  11744. ig.game.storage.get(ig.game.gameKey).star + this.score1 + this.score3);
  11745. break;
  11746. case "star":
  11747. this.main.star < this.main.howmany ? (this.overText = "fail", this.finalText = ig.game.storage.get(ig.game.gameKey).star) : (this.overText = "complete", this.score1 = 800 * (this.main.star / this.main.total), this.score3 = 200, this.finalScore = ig.game.storage.get(ig.game.gameKey).star + this.score1 + this.score3);
  11748. break;
  11749. case "tree":
  11750. 60 > this.main.gameTimer.delta() ? (this.overText = "fail", this.finalText = ig.game.storage.get(ig.game.gameKey).star) :
  11751. (this.overText = "complete", this.score1 = 10 * this.main.heart, this.score2 = 5 * this.main.star, this.score3 = 500, this.finalScore = ig.game.storage.get(ig.game.gameKey).star + this.score1 + this.score2 + this.score3)
  11752. }
  11753. 99999 < this.finalScore && (this.finalScore = 99999);
  11754. ig.game.plusScore = Math.floor(this.finalScore);
  11755. "fail" != this.overText && (ig.game.mission += 1);
  11756. ig.game.storage.set(ig.game.gameKey, {
  11757. star: ig.game.plusScore,
  11758. lvl: ig.game.lvl,
  11759. mission: ig.game.mission,
  11760. map: ig.game.map,
  11761. player: ig.game.player,
  11762. nextLvl: ig.game.nextLvl,
  11763. seq: ig.game.seq
  11764. })
  11765. },
  11766. placeScore: function() {
  11767. switch (ig.game.what) {
  11768. case "ufo":
  11769. case "ship":
  11770. case "balloon":
  11771. this.whichScore("heart", 1);
  11772. this.whichScore("star", 2);
  11773. this.whichScore("final");
  11774. break;
  11775. case "oil":
  11776. this.whichScore("time", 1);
  11777. this.whichScore("final");
  11778. break;
  11779. case "ring":
  11780. this.whichScore("percent", 1);
  11781. this.whichScore("final");
  11782. break;
  11783. case "star":
  11784. this.whichScore("percent", 1);
  11785. this.whichScore("final");
  11786. break;
  11787. case "tree":
  11788. this.whichScore("heart", 1), this.whichScore("star", 2), this.whichScore("final")
  11789. }
  11790. },
  11791. whichScore: function(b, c) {
  11792. switch (b) {
  11793. case "time":
  11794. 1 ==
  11795. c ? (this.textDraw("game", 1.3, 1.3, this.timeGui.tx, 208, 172 + this.overBoard.offY), this.textDraw("game", 0.7, 0.7, "+" + Math.floor(this.text1), 439 - 0.7 * this.textW("+" + Math.floor(this.text1)), 180 + this.overBoard.offY)) : (this.textDraw("game", 1.3, 1.3, this.timeGui.tx, 218, 245 + this.overBoard.offY), this.textDraw("game", 0.7, 0.7, "+" + Math.floor(this.text2), 439 - 0.7 * this.textW("+" + Math.floor(this.text2)), 254 + this.overBoard.offY));
  11796. break;
  11797. case "collect":
  11798. 1 == c ? (this.centDraw(this[ig.game.what + "Im"], 232, 175 + this.overBoard.offY,
  11799. 0.8), this.textDraw("game", 1.3, 1.3, this.main.collect + "/" + this.main.howmany, 271, 172 + this.overBoard.offY), this.textDraw("game", 0.7, 0.7, "+" + Math.floor(this.text1), 439 - 0.7 * this.textW("+" + Math.floor(this.text1)), 180 + this.overBoard.offY)) : (this.centDraw(this[ig.game.what + "Im"], 231, 248 + this.overBoard.offY, 0.8), this.textDraw("game", 1.3, 1.3, this.main.collect + "/" + this.main.howmany, 271, 245 + this.overBoard.offY), this.textDraw("game", 0.7, 0.7, "+" + Math.floor(this.text2), 439 - 0.7 * this.textW("+" + Math.floor(this.text2)),
  11800. 254 + this.overBoard.offY));
  11801. break;
  11802. case "percent":
  11803. 1 == c ? (this.centDraw(this[ig.game.what + "Im"], 232, 175 + this.overBoard.offY, 0.8), this.textDraw("game", 1.1, 1.1, this.main[ig.game.what] + "/" + this.main.howmany, 261, 172 + this.overBoard.offY), this.textDraw("game", 0.7, 0.7, "+" + Math.floor(this.text1), 439 - 0.7 * this.textW("+" + Math.floor(this.text1)), 180 + this.overBoard.offY)) : (this.centDraw(this[ig.game.what + "Im"], 231, 248 + this.overBoard.offY, 0.8), this.textDraw("game", 1.1, 1.1, this.main[ig.game.what] + "/" + this.main.howmany,
  11804. 261, 245 + this.overBoard.offY), this.textDraw("game", 0.7, 0.7, "+" + Math.floor(this.text2), 439 - 0.7 * this.textW("+" + Math.floor(this.text2)), 254 + this.overBoard.offY));
  11805. break;
  11806. case "heart":
  11807. 1 == c ? (this.centDraw(this.heartIm, 232, 175 + this.overBoard.offY, 1), this.textDraw("game", 1.3, 1.3, this.main.heart, 271, 172 + this.overBoard.offY), this.textDraw("game", 0.7, 0.7, "+" + Math.floor(this.text1), 439 - 0.7 * this.textW("+" + Math.floor(this.text1)), 180 + this.overBoard.offY)) : (this.centDraw(this.heartIm, 231, 248 + this.overBoard.offY, 1),
  11808. this.textDraw("game", 1.3, 1.3, this.main.heart, 271, 245 + this.overBoard.offY), this.textDraw("game", 0.7, 0.7, "+" + Math.floor(this.text2), 439 - 0.7 * this.textW("+" + Math.floor(this.text2)), 254 + this.overBoard.offY));
  11809. break;
  11810. case "star":
  11811. 1 == c ? (this.centDraw(this.starIm, 232, 175 + this.overBoard.offY, 0.8), this.textDraw("game", 1.3, 1.3, this.main.star, 271, 172 + this.overBoard.offY), this.textDraw("game", 0.7, 0.7, "+" + Math.floor(this.text1), 439 - 0.7 * this.textW("+" + Math.floor(this.text1)), 180 + this.overBoard.offY)) : (this.centDraw(this.starIm,
  11812. 231, 248 + this.overBoard.offY, 0.8), this.textDraw("game", 1.3, 1.3, this.main.star, 271, 245 + this.overBoard.offY), this.textDraw("game", 0.7, 0.7, "+" + Math.floor(this.text2), 439 - 0.7 * this.textW("+" + Math.floor(this.text2)), 254 + this.overBoard.offY));
  11813. break;
  11814. case "final":
  11815. this.centDraw(this.starIm, 225, 343 + this.overBoard.offY, 0.56), this.textDraw("game", 1.1, 1.1, Math.floor(this.finalText), 437 - 1.1 * this.textW(Math.floor(this.finalText)), 340 + this.overBoard.offY), this.textDraw("game", 0.7, 0.7, "+" + Math.floor(this.text3), 245,
  11816. 341 + this.overBoard.offY)
  11817. }
  11818. },
  11819. wingAndRect: function() {
  11820. this.ctx.fillRect(320 - this.ctx.measureText(_STRINGS.Game[this.overText][0]).width / 2 * _STRINGS.Game[this.overText][3] - 15, _STRINGS.Game[this.overText][2] - 20 + this.overBoard.offY, this.ctx.measureText(_STRINGS.Game[this.overText][0]).width * _STRINGS.Game[this.overText][3] + 30, 45);
  11821. this.ctx.fillStyle = "white";
  11822. this.textLib(this.overText, 0, this.overBoard.offY);
  11823. this.wingLIm.draw(302 - this.ctx.measureText(_STRINGS.Game[this.overText][0]).width / 2 * _STRINGS.Game[this.overText][3] -
  11824. this.wingLIm.width, _STRINGS.Game[this.overText][2] - 12 + this.overBoard.offY);
  11825. this.wingRIm.draw(338 + this.ctx.measureText(_STRINGS.Game[this.overText][0]).width / 2 * _STRINGS.Game[this.overText][3], _STRINGS.Game[this.overText][2] - 12 + this.overBoard.offY)
  11826. },
  11827. ready: function() {
  11828. this.parent();
  11829. this.tweenF("tellMission0")
  11830. },
  11831. draw: function() {
  11832. this.parent();
  11833. if (!ig.global.wm) {
  11834. this.textSet("game", 35, "white");
  11835. this.textSet("game", 35, "white");
  11836. this.ctx.fillStyle = "white";
  11837. switch (ig.game.what) {
  11838. case "oil":
  11839. this.drawer("game", this.oilIm,
  11840. 1, 1, 0, 39, 35, 0.8, 0.8, !0);
  11841. this.ctx.fillStyle = 1 == ig.game.map ? "white" : "#122149";
  11842. this.textDraw("game", 0.9, 1, this.main.collect + "/" + this.main.howmany, 62, 32);
  11843. this.timeGui = this.timitizer(60 - this.main.gameTimer.delta());
  11844. 60 < this.main.gameTimer.delta() && (this.timeGui.tx = "0:00.00");
  11845. this.textDraw("game", 1.3, 1.3, this.timeGui.tx, 320 - 1.3 * this.textW(this.timeGui.tx / 2), 30);
  11846. break;
  11847. case "ufo":
  11848. case "ship":
  11849. case "tree":
  11850. case "balloon":
  11851. this.ctx.fillStyle = "rgba(18, 33, 73, 0.9)";
  11852. this.ctx.fillRect(190, 24, 290, 18);
  11853. this.ctx.fillStyle =
  11854. "#DA1D2E";
  11855. this.ctx.fillRect(193, 27, 290 * (this.main.gameTimer.delta() / this.main.gameTime), 12);
  11856. this.drawer("game", this.miniIm, 4, 1, ig.game.player, 190 + 290 * (this.main.gameTimer.delta() / this.main.gameTime), 37, 0.8, 0.8, !0);
  11857. this.drawer("game", this.heartIm, 1, 1, 0, 29, 32, 0.7, 0.7, !0);
  11858. this.ctx.fillStyle = 1 == ig.game.map ? "white" : "#122149";
  11859. this.textDraw("game", 0.9, 1, this.main.heart, 52, 29);
  11860. this.drawer("game", this.starIm, 1, 1, 0, 105, 32, 0.63, 0.63, !0);
  11861. this.textDraw("game", 0.9, 1, this.main.star, 126, 29);
  11862. break;
  11863. case "ring":
  11864. !1 ==
  11865. this.ground.showRing && !1 == this.main.gameOver && 58 >= this.main.gameTimer.delta() && (this.main.world.x > 270 + (this.ground.itemPos - 320) && this.main.world.x < 800 + (this.ground.itemPos - 320) ? this.drawer("game", this.leftIm, 3, 1, 0, 30, 240, 0.8, 0.8, !0, this.arrow.alp) : this.main.world.x < -400 + (this.ground.itemPos - 320) ? this.drawer("game", this.rightIm, 3, 1, 0, 610, 240, 0.8, 0.8, !0, this.arrow.alp) : this.main.world.x > 800 + (this.ground.itemPos - 320) && this.main.world.x < 1800 + (this.ground.itemPos - 320) && this.drawer("game", this.rightIm,
  11866. 3, 1, 0, 610, 240, 0.8, 0.8, !0, this.arrow.alp));
  11867. this.ctx.fillStyle = "rgba(18, 33, 73, 0.9)";
  11868. this.ctx.fillRect(190, 24, 290, 18);
  11869. this.ctx.fillStyle = "#DA1D2E";
  11870. this.ctx.fillRect(193, 27, 290 * (this.main.gameTimer.delta() / this.main.gameTime), 12);
  11871. this.drawer("game", this.miniIm, 4, 1, ig.game.player, 190 + 290 * (this.main.gameTimer.delta() / this.main.gameTime), 37, 0.8, 0.8, !0);
  11872. this.drawer("game", this.ringIm, 1, 1, 0, 39, 35, 0.65, 0.65, !0);
  11873. this.ctx.fillStyle = 1 == ig.game.map ? "white" : "#122149";
  11874. this.textDraw("game", 0.9, 1, this.main.ring +
  11875. "/" + this.main.howmany, 72, 32);
  11876. break;
  11877. case "star":
  11878. !1 == this.ground.showRing && !1 == this.main.gameOver && 58 >= this.main.gameTimer.delta() && (270 < this.main.world.x && 1E3 > this.main.world.x ? this.drawer("game", this.leftIm, 3, 1, 0, 30, 240, 0.8, 0.8, !0, this.arrow.alp) : -200 > this.main.world.x ? this.drawer("game", this.rightIm, 3, 1, 0, 610, 240, 0.8, 0.8, !0, this.arrow.alp) : 1E3 < this.main.world.x && 1600 > this.main.world.x && this.drawer("game", this.rightIm, 3, 1, 0, 610, 240, 0.8, 0.8, !0, this.arrow.alp)), this.ctx.fillStyle = "rgba(18, 33, 73, 0.9)",
  11879. this.ctx.fillRect(190, 24, 290, 18), this.ctx.fillStyle = "#DA1D2E", this.ctx.fillRect(193, 27, 290 * (this.main.gameTimer.delta() / this.main.gameTime), 12), this.drawer("game", this.miniIm, 4, 1, ig.game.player, 190 + 290 * (this.main.gameTimer.delta() / this.main.gameTime), 37, 0.8, 0.8, !0), this.drawer("game", this.starIm, 1, 1, 0, 29, 34, 0.65, 0.65, !0), this.ctx.fillStyle = 1 == ig.game.map ? "white" : "#122149", this.textDraw("game", 0.9, 1, this.main.star + "/" + this.main.howmany, 52, 31)
  11880. }!1 == this.main.gameStart && (this.runFrame("planeGui"), this.runFrame("scarf"),
  11881. this.runFrame("fan"), this.ctx.fillStyle = "#122149", this.ctx.fillRect(0, 111 + this.planeGui.offY, 640, 108), this.ctx.fillStyle = "white", !0 == ig.game.tutOn ? ig.ua.mobile ? this.textLibLeft("mobile1", 0, this.planeGui.offY) : (this.textLibLeft("pc1", 0, this.planeGui.offY), this.textLibLeft("pc2", 0, this.planeGui.offY)) : (this.textLibLeft(ig.game.what + "1", 0, this.planeGui.offY), this.textLibLeft(ig.game.what + "2", 0, this.planeGui.offY)), this.drawer("game", this.planeIm, 2, 2, this.planeGui.frames[this.planeGui.frame], this.planeGui.x,
  11882. this.planeGui.y + this.planeGui.offY, this.planeGui.sc, this.planeGui.sc, !0), this.drawer("game", this.scarfIm, 6, 1, this.scarf.frames[this.scarf.frame], this.planeGui.x + this.scarf.x, this.planeGui.y + this.scarf.y + this.fan.offY[this.planeGui.frame] + this.planeGui.offY, this.scarf.sc, this.scarf.sc, !0), this.drawer("game", this.fanIm, 4, 1, this.fan.frames[this.fan.frame], this.planeGui.x + this.fan.x, this.planeGui.y + this.fan.y + this.fan.offY[this.planeGui.frame] + this.planeGui.offY, this.fan.sc, this.fan.sc, !0), this.ctx.fillStyle =
  11883. 1 == ig.game.map ? "white" : "#122149", this.textLib("start", 0, this.planeGui.offY));
  11884. !0 == this.main.gameOver && (this.ctx.fillStyle = "#122149", this.drawer("game", this.boardIm, 1, 1, 0, 328, 262 + this.overBoard.offY, 1, 1, !0), this.placeScore(), this.wingAndRect());
  11885. !0 == this.main.gamePaused && !0 == this.main.gameStart && (this.ctx.fillStyle = "rgba(23, 36, 56, " + this.greyAlp + ")", this.ctx.fillRect(0, 0, 640, 480), this.ctx.fillStyle = "white", this.textLib("pause"));
  11886. this.goodJob && (this.runFrame("planeGui"), this.awesomeIm.draw(3 + this.goodOffX,
  11887. 80 + this.fan.offY[this.planeGui.frame]), this.ctx.fillStyle = "#242A2D", this.textDraw("game", _STRINGS.Game.awesome[3], _STRINGS.Game.awesome[4], _STRINGS.Game.awesome[0], _STRINGS.Game.awesome[1] + this.goodOffX - 0.7 * (this.ctx.measureText(_STRINGS.Game.awesome[0]).width / 2) - 40, _STRINGS.Game.awesome[2] + this.fan.offY[this.planeGui.frame]));
  11888. this.fail && (this.runFrame("planeGui"), this.awesomeIm.draw(3 + this.goodOffX, 80 + this.fan.offY[this.planeGui.frame]), this.ctx.fillStyle = "#242A2D", this.textDraw("game", _STRINGS.Game.youfail[3],
  11889. _STRINGS.Game.youfail[4], _STRINGS.Game.youfail[0], _STRINGS.Game.youfail[1] + this.goodOffX - 0.7 * (this.ctx.measureText(_STRINGS.Game.youfail[0]).width / 2) - 40, _STRINGS.Game.youfail[2] + this.fan.offY[this.planeGui.frame]))
  11890. }
  11891. }
  11892. })
  11893. });
  11894. ig.baked = !0;
  11895. ig.module("game.entities.plain-game-but").requires("game.entities.plain").defines(function() {
  11896. EntityPlainGameBut = EntityPlain.extend({
  11897. gravityFactor: 0,
  11898. type: ig.Entity.TYPE.B,
  11899. zIndex: 1E3,
  11900. size: {
  11901. x: 27,
  11902. y: 27
  11903. },
  11904. locked: !1,
  11905. offset: {
  11906. x: 0,
  11907. y: 0
  11908. },
  11909. pauseIm: new ig.AnimationSheet("media/graphics/sprites/pause.png", 46, 46),
  11910. playIm: new ig.AnimationSheet("media/graphics/sprites/play.png", 173, 123),
  11911. shopIm: new ig.AnimationSheet("media/graphics/sprites/shop.png", 349 / 3, 91),
  11912. mapIm: new ig.AnimationSheet("media/graphics/sprites/map.png",
  11913. 506 / 3, 91),
  11914. muteIm: new ig.AnimationSheet("media/graphics/sprites/sound.png", 50, 48),
  11915. unmuteIm: new ig.AnimationSheet("media/graphics/sprites/mute.png", 50, 48),
  11916. homeIm: new ig.AnimationSheet("media/graphics/sprites/home.png", 132, 86),
  11917. retryIm: new ig.AnimationSheet("media/graphics/sprites/retry.png", 403 / 3 - 1, 85),
  11918. bookIm: new ig.AnimationSheet("media/graphics/sprites/bookbut.png", 460 / 3, 88),
  11919. muteAni: {},
  11920. unmuteAni: {},
  11921. init: function(b, c, d) {
  11922. ig.global.wm || (this.main = d.main, this.seq = d.seq, this.oriStat(), this.parent(this.pos.x,
  11923. this.pos.y, d), this.spawner())
  11924. },
  11925. idle: function() {
  11926. this.setScale(1, 1);
  11927. this.currentAnim = this.anims.idle;
  11928. !this.main.gamePaused && !0 == this.gui.doneRead && (this.main.clickable = !0);
  11929. this.main.buttonHover = !1
  11930. },
  11931. clicked: function() {
  11932. this.sounder("click");
  11933. if (!this.locked) switch (this.setScale(0.85, 0.85), this.seq) {
  11934. case 0:
  11935. if (!0 == this.main.gamePaused || !1 == this.main.gameStart || !0 == this.main.gameOver) break;
  11936. this.main.clickable = !1;
  11937. this.main.pauseGame();
  11938. for (var b = 0; b < this.gameBut.length; b++) 1 < this.gameBut[b].seq && (this.gameBut[b].pos.x =
  11939. this.gameBut[b].oriX);
  11940. this.gui.tweener("this", {
  11941. greyAlp: 0.5
  11942. }, 0.5);
  11943. break;
  11944. case 1:
  11945. !0 == ig.soundHandler.muted ? (this.anims.idle = new ig.Animation(this.muteIm, 1, [0]), this.anims.select = new ig.Animation(this.muteIm, 1, [1]), this.anims.grey = new ig.Animation(this.muteIm, 1, [2]), ig.soundHandler.setForceMuted(!1), ig.soundHandler.unmute()) : (ig.soundHandler.mute(), ig.soundHandler.setForceMuted(!0), this.anims.idle = new ig.Animation(this.unmuteIm, 1, [0]), this.anims.select = new ig.Animation(this.unmuteIm, 1, [1]), this.anims.grey =
  11946. new ig.Animation(this.unmuteIm, 1, [2]));
  11947. ig.game.storage.set(ig.game.soundKey, ig.soundHandler.muted);
  11948. break;
  11949. case 2:
  11950. ig.game.director.jumpTo(LevelHome);
  11951. break;
  11952. case 3:
  11953. this.main.resumeGame();
  11954. this.gui.tweener("this", {
  11955. greyAlp: 0
  11956. }, 0.5, "clickable");
  11957. for (b = 0; b < this.gameBut.length; b++) 1 < this.gameBut[b].seq && (this.gameBut[b].pos.x = 900);
  11958. break;
  11959. case 4:
  11960. this.gui.tweener("this", {
  11961. greyAlp: 0.95
  11962. }, 0.3, "restart")
  11963. }
  11964. },
  11965. oriStat: function() {
  11966. this.setScale(1, 1);
  11967. this.base.x = this.pos.x;
  11968. this.base.y = this.pos.y;
  11969. switch (this.seq) {
  11970. case 0:
  11971. this.pos.x =
  11972. 586;
  11973. this.pos.y = 12;
  11974. this.animSheet = this.pauseIm;
  11975. break;
  11976. case 1:
  11977. this.pos.x = 534;
  11978. this.pos.y = 10;
  11979. !0 == ig.soundHandler.muted ? (this.animSheet = this.unmuteIm, this.unmuteAni.idle = new ig.Animation(this.unmuteIm, 1, [0]), this.unmuteAni.select = new ig.Animation(this.unmuteIm, 1, [1]), this.unmuteAni.grey = new ig.Animation(this.unmuteIm, 1, [2])) : (this.animSheet = this.muteIm, this.muteAni.idle = new ig.Animation(this.muteIm, 1, [0]), this.muteAni.select = new ig.Animation(this.muteIm, 1, [1]), this.muteAni.grey = new ig.Animation(this.muteIm,
  11980. 1, [2]));
  11981. break;
  11982. case 2:
  11983. this.pos.x = 121;
  11984. this.pos.y = 189;
  11985. this.animSheet = this.homeIm;
  11986. break;
  11987. case 3:
  11988. this.pos.x = 236;
  11989. this.pos.y = 175;
  11990. this.animSheet = this.playIm;
  11991. break;
  11992. case 4:
  11993. this.pos.x = 372, this.pos.y = 189, this.animSheet = this.retryIm
  11994. }
  11995. this.addAnim("idle", 1, [0]);
  11996. this.addAnim("select", 1, [1]);
  11997. this.addAnim("grey", 1, [2]);
  11998. this.currentAnim = this.anims.idle;
  11999. 3 == this.seq ? (this.pos.x += 15, this.pos.y += 15, this.offset.x = 15, this.offset.y = 13, this.size.x = this.animSheet.width - 45, this.size.y = this.animSheet.height - 45) : 1 < this.seq ? (this.pos.x +=
  12000. 15, this.pos.y += 15, this.offset.x = 15, this.offset.y = 13, this.size.x = this.animSheet.width - 30, this.size.y = this.animSheet.height - 30) : (this.size.x = this.animSheet.width, this.size.y = this.animSheet.height);
  12001. this.oriX = this.pos.x;
  12002. 1 < this.seq && (this.pos.x = 900)
  12003. },
  12004. spawner: function() {},
  12005. tweenF: function(b) {
  12006. switch (b) {
  12007. case "clickable":
  12008. this.main.clickable = !0
  12009. }
  12010. },
  12011. update: function() {
  12012. ig.global.wm || (this.parent(), 1 == this.seq && !0 == ig.game.changeSound && (ig.game.changeSound = !1, !0 == ig.soundHandler.muted ? (this.anims.idle = new ig.Animation(this.unmuteIm,
  12013. 1, [0]), this.anims.select = new ig.Animation(this.unmuteIm, 1, [1]), this.anims.grey = new ig.Animation(this.unmuteIm, 1, [2])) : (this.anims.idle = new ig.Animation(this.muteIm, 1, [0]), this.anims.select = new ig.Animation(this.muteIm, 1, [1]), this.anims.grey = new ig.Animation(this.muteIm, 1, [2])), this.currentAnim = this.anims.idle), !this.locked && null != this.pointer && (this.pointer.hoveringItem == this && !this.pointer.firstClick) && (this.main.buttonHover = !0, this.main.clickable = !1, this.setScale(1, 1), this.currentAnim = this.anims.select))
  12014. },
  12015. drawInit: function() {},
  12016. ready: function() {
  12017. this.parent()
  12018. },
  12019. draw: function() {
  12020. this.parent()
  12021. }
  12022. })
  12023. });
  12024. ig.baked = !0;
  12025. ig.module("game.entities.plain-game").requires("game.entities.plain", "game.entities.plain-sky", "game.entities.plain-ground", "game.entities.plain-tree", "game.entities.plain-plane", "game.entities.plain-puffer", "game.entities.plain-gui", "game.entities.plain-game-but").defines(function() {
  12026. EntityPlainGame = EntityPlain.extend({
  12027. gravityFactor: 0,
  12028. type: ig.Entity.TYPE.B,
  12029. zIndex: 1,
  12030. buttonHover: !1,
  12031. frame: 1,
  12032. w: 640,
  12033. heart: 10,
  12034. gameStart: !1,
  12035. star: 0,
  12036. ring: 0,
  12037. collect: 0,
  12038. howmany: 30,
  12039. total: 0,
  12040. h: 480,
  12041. ranks: [0, 0, 0, 0],
  12042. size: {
  12043. x: 800,
  12044. y: 600
  12045. },
  12046. gameOver: !1,
  12047. preGameOver: !1,
  12048. gamePaused: !1,
  12049. hitted: !1,
  12050. which: 1,
  12051. ground: 142,
  12052. clickable: !1,
  12053. groundSpeed: 0,
  12054. groundOriSpeed: 5,
  12055. speedChangeSpeed: 0.5,
  12056. showAwesome: !1,
  12057. mouseUp: !0,
  12058. planeRot: !1,
  12059. controller: "mouse",
  12060. groundColour: ["#83c026", "#185356", "#eefbff", "#ffb52c"],
  12061. bgIm0: new ig.Image("media/graphics/sprites/bg0.png"),
  12062. bgIm1: new ig.Image("media/graphics/sprites/bg1.png"),
  12063. bgIm2: new ig.Image("media/graphics/sprites/bg2.png"),
  12064. bgIm3: new ig.Image("media/graphics/sprites/bg3.png"),
  12065. shadeIm0: new ig.Image("media/graphics/sprites/shade0.png"),
  12066. shadeIm1: new ig.Image("media/graphics/sprites/shade1.png"),
  12067. shadeIm2: new ig.Image("media/graphics/sprites/shade2.png"),
  12068. shadeIm3: new ig.Image("media/graphics/sprites/shade3.png"),
  12069. init: function(b, c, d) {
  12070. ig.global.wm || (this.parent(b, c, d), this.which = "ufo" == ig.game.what ? 1 : Math.floor(4 * Math.random()), ig.game.map = this.which, this.oriStat(), this.spawner(), ig.game.plusScore = 0)
  12071. },
  12072. pauseGame: function() {
  12073. this.gamePaused = !0;
  12074. this.gameTimer.pause()
  12075. },
  12076. resumeGame: function() {
  12077. this.gamePaused = !1;
  12078. this.gameTimer.unpause()
  12079. },
  12080. oriStat: function() {
  12081. this.speedRevertTimer =
  12082. new ig.Timer;
  12083. this.speedRevertTime = 0.1;
  12084. this.hitSpeed = 0;
  12085. this.gameTimer = new ig.Timer;
  12086. this.gameTime = 60;
  12087. this.gameTimer.pause();
  12088. this.gameOverTimer = new ig.Timer;
  12089. "ring" == ig.game.what || "star" == ig.game.what ? (this.normalSpeed = 60 + ig.game.lvl, this.speedChangeSpeed = 0.3, this.speedBackSpeed = 0.5, this.groundOriSpeed = 8, this.keySpeed = 3) : "oil" == ig.game.what ? (this.normalSpeed = 38 + ig.game.lvl, this.speedChangeSpeed = 0.2, this.speedBackSpeed = 0.5, this.groundOriSpeed = 8, this.keySpeed = 6) : "balloon" == ig.game.what || "ship" == ig.game.what ||
  12090. "ufo" == ig.game.what ? (this.normalSpeed = 38 + ig.game.lvl, this.speedChangeSpeed = 0.21, this.speedBackSpeed = 0.5, this.keySpeed = this.groundOriSpeed = 8) : "tree" == ig.game.what ? (this.normalSpeed = 42 + ig.game.lvl, this.speedChangeSpeed = 0.21, this.speedBackSpeed = 0.5, this.keySpeed = this.groundOriSpeed = 8) : (this.normalSpeed = 48 + ig.game.lvl, this.speedChangeSpeed = 0.3, this.speedBackSpeed = 0.5, this.groundOriSpeed = 8, this.keySpeed = 3);
  12091. 80 < this.normalSpeed && (this.normalSpeed = 80);
  12092. this.zSpeed = this.normalSpeed;
  12093. this.world = {
  12094. x: 0,
  12095. y: 0,
  12096. z: 0,
  12097. speed: -20
  12098. };
  12099. this.camera = {
  12100. x: 0,
  12101. y: 0,
  12102. z: 0,
  12103. distance: 10
  12104. }
  12105. },
  12106. spawner: function() {
  12107. ig.game.spawnEntity(EntityPointer, 800, 800, {
  12108. main: this
  12109. });
  12110. ig.game.spawnEntity(EntityPlainSky, 0, 0, {
  12111. main: this
  12112. });
  12113. ig.game.spawnEntity(EntityPlainPuffer, 0, 0, {
  12114. main: this
  12115. });
  12116. ig.game.spawnEntity(EntityPlainGround, 0, 0, {
  12117. main: this
  12118. });
  12119. ig.game.spawnEntity(EntityPlainPlane, 0, 0, {
  12120. main: this
  12121. });
  12122. ig.game.spawnEntity(EntityPlainGui, 0, 0, {
  12123. main: this
  12124. });
  12125. for (var b = 0; 5 > b; b++) ig.game.spawnEntity(EntityPlainGameBut, 0, 0, {
  12126. main: this,
  12127. seq: b
  12128. })
  12129. },
  12130. tweenF: function() {},
  12131. update: function() {
  12132. ig.global.wm ||
  12133. (this.parent(), !0 == this.preGameOver && !1 == this.gameOver && 0.1 < this.gameOverTimer.delta() && (this.gameOver = !0), !0 != this.gameOver && (this.gameTimer.delta() > this.gameTime && !1 == this.main.preGameOver && (this.gameTimer.pause(), this.main.preGameOver = !0, this.main.gameOverTimer.reset()), this.speedRevertTimer.delta() > this.speedRevertTime && (this.hitted = !1, this.zSpeed = this.normalSpeed), ig.ua.mobile ? this.oriControl() : this.controlWay2()))
  12134. },
  12135. controlWay2: function() {
  12136. if (!0 == ig.input.state("click")) {
  12137. for (var b = 0; b < this.plane.tweens.length; b++) - 1 <
  12138. this.plane.tweens[b].seq.indexOf("swift") && this.plane.tweens[b].stop();
  12139. if (!1 == this.gui.doneRead && !0 == this.gui.showRead) {
  12140. if (!0 == this.buttonHover) return;
  12141. !0 == ig.input.released("click") && (!0 == ig.game.tutOn ? ig.game.tutOn = !1 : (this.gui.doneRead = !0, this.gui.tweenF("offMission0")))
  12142. }!1 != this.clickable && (330 < this.pointer.pos.x ? (this.frame = 2, "right" != this.plane.plane.turning && (this.plane.rotIndex = 0, this.plane.rotSpeed = this.plane.iniSpeed, this.plane.plane.turning = "right"), this.pointX = 250 > this.pointer.pos.x ? 250 :
  12143. this.pointer.pos.x, this.groundSpeed = (this.pointX - 320) / 250 * this.groundOriSpeed, this.sky.speed = 0.8 * (this.zSpeed * this.groundSpeed) * ig.system.tick, this.sky.moveRight = !1, this.world.x += this.zSpeed * this.groundSpeed * ig.system.tick, this.world.x > 3 * this.sky.w && (this.world.x -= 3 * this.sky.w)) : 310 > this.pointer.pos.x && ("left" != this.plane.plane.turning && (this.plane.rotIndex = 0, this.plane.rotSpeed = this.plane.iniSpeed, this.plane.plane.turning = "left"), this.pointX = 570 < this.pointer.pos.x ? 570 : this.pointer.pos.x, this.plane.plane.rot =
  12144. (this.pointer.pos.x - 320) / 320 * this.plane.rotAngle, this.groundSpeed = (this.pointX - 320) / 250 * this.groundOriSpeed, this.frame = 0, this.sky.moveRight = !0, this.sky.speed = Math.abs(0.8 * (this.zSpeed * this.groundSpeed) * ig.system.tick), this.world.x += this.zSpeed * this.groundSpeed * ig.system.tick, this.world.x < -this.w && (this.world.x = 3 * this.sky.w + this.world.x)), this.plane.plane.rot = (this.pointer.pos.x - 320) / 320 * this.plane.rotAngle)
  12145. } else if (!0 == ig.input.state("right")) {
  12146. if (!1 == this.gui.doneRead && !0 == this.gui.showRead && !0 ==
  12147. ig.input.released("right") && (!0 == ig.game.tutOn ? ig.game.tutOn = !1 : (this.gui.doneRead = !0, this.gui.tweenF("offMission0"))), !(!1 == this.gui.doneRead || this.gamePaused)) {
  12148. this.frame = 2;
  12149. if ("right" != this.plane.plane.turning) {
  12150. this.plane.rotIndex = 0;
  12151. this.plane.rotSpeed = this.plane.iniSpeed;
  12152. this.plane.plane.turning = "right";
  12153. for (b = 0; b < this.tweens.length; b++) - 1 < this.tweens[b].seq.indexOf("groundSpeed") && this.tweens[b].stop();
  12154. this.tweener2("this", {
  12155. groundSpeed: this.keySpeed
  12156. }, this.speedChangeSpeed, "groundSpeed")
  12157. }
  12158. this.sky.speed =
  12159. 0.8 * (this.zSpeed * this.groundSpeed) * ig.system.tick;
  12160. this.sky.moveRight = !1;
  12161. this.world.x += this.zSpeed * this.groundSpeed * ig.system.tick;
  12162. this.world.x > 3 * this.sky.w && (this.world.x -= 3 * this.sky.w)
  12163. }
  12164. } else if (!0 == ig.input.state("left")) {
  12165. if (!1 == this.gui.doneRead && !0 == this.gui.showRead && !0 == ig.input.released("left") && (!0 == ig.game.tutOn ? ig.game.tutOn = !1 : (this.gui.doneRead = !0, this.gui.tweenF("offMission0"))), !(!1 == this.gui.doneRead || this.gamePaused)) {
  12166. if ("left" != this.plane.plane.turning) {
  12167. this.plane.rotIndex = 0;
  12168. this.plane.rotSpeed =
  12169. this.plane.iniSpeed;
  12170. this.plane.plane.turning = "left";
  12171. for (b = 0; b < this.tweens.length; b++) - 1 < this.tweens[b].seq.indexOf("groundSpeed") && this.tweens[b].stop();
  12172. this.tweener2("this", {
  12173. groundSpeed: -this.keySpeed
  12174. }, this.speedChangeSpeed, "groundSpeed")
  12175. }
  12176. this.frame = 0;
  12177. this.sky.moveRight = !0;
  12178. this.sky.speed = Math.abs(0.8 * (this.zSpeed * this.groundSpeed) * ig.system.tick);
  12179. this.world.x += this.zSpeed * this.groundSpeed * ig.system.tick;
  12180. this.world.x < -this.w && (this.world.x = 3 * this.sky.w + this.world.x)
  12181. }
  12182. } else this.middle()
  12183. },
  12184. middle: function() {
  12185. this.frame =
  12186. 1;
  12187. if ("middle" != this.plane.plane.turning) {
  12188. this.plane.tweening = "middle";
  12189. this.plane.rotSpeed = 1.9;
  12190. this.plane.plane.turning = "middle";
  12191. for (var b = 0; b < this.tweens.length; b++) - 1 < this.tweens[b].seq.indexOf("groundSpeed") && this.tweens[b].stop();
  12192. this.tweener2("this", {
  12193. groundSpeed: 0
  12194. }, this.speedBackSpeed, "groundSpeed");
  12195. for (b = 0; b < this.plane.tweens.length; b++) - 1 < this.plane.tweens[b].targ.indexOf("plane") && -1 == this.plane.tweens[b].seq.indexOf("fly") && this.plane.tweens[b].stop()
  12196. }
  12197. this.plane.plane.turning = "middle";
  12198. 0 !=
  12199. this.plane.plane.rot && (this.plane.plane.rot *= 0.88, -1 < this.plane.plane.rot && 1 > this.plane.plane.rot && (this.plane.plane.rot = 0));
  12200. this.sky.speed = Math.abs(this.zSpeed * this.groundSpeed * ig.system.tick);
  12201. this.world.x += this.zSpeed * this.groundSpeed * ig.system.tick;
  12202. this.world.x < -this.w ? this.world.x = 3 * this.sky.w + this.world.x : this.world.x > 3 * this.sky.w && (this.world.x -= 3 * this.sky.w)
  12203. },
  12204. oriControl: function() {
  12205. if (!0 == ig.input.state("click")) {
  12206. if (!1 == this.gui.doneRead && !0 == this.gui.showRead) {
  12207. if (!0 == this.buttonHover) return;
  12208. !0 == ig.input.released("click") && (!0 == ig.game.tutOn ? ig.game.tutOn = !1 : (this.gui.doneRead = !0, this.gui.tweenF("offMission0")))
  12209. }
  12210. if (!1 != this.clickable)
  12211. if (330 < this.pointer.pos.x) {
  12212. this.frame = 2;
  12213. if ("right" != this.plane.plane.turning) {
  12214. this.plane.rotIndex = 0;
  12215. this.plane.rotSpeed = this.plane.iniSpeed;
  12216. this.plane.plane.turning = "right";
  12217. for (var b = 0; b < this.tweens.length; b++) - 1 < this.tweens[b].seq.indexOf("groundSpeed") && this.tweens[b].stop();
  12218. this.tweener2("this", {
  12219. groundSpeed: this.keySpeed
  12220. }, this.speedChangeSpeed, "groundSpeed")
  12221. }
  12222. this.sky.speed =
  12223. 0.8 * (this.zSpeed * this.groundSpeed) * ig.system.tick;
  12224. this.sky.moveRight = !1;
  12225. this.world.x += this.zSpeed * this.groundSpeed * ig.system.tick;
  12226. this.world.x > 3 * this.sky.w && (this.world.x -= 3 * this.sky.w)
  12227. } else if (310 > this.pointer.pos.x) {
  12228. if ("left" != this.plane.plane.turning) {
  12229. this.plane.rotIndex = 0;
  12230. this.plane.rotSpeed = this.plane.iniSpeed;
  12231. this.plane.plane.turning = "left";
  12232. for (b = 0; b < this.tweens.length; b++) - 1 < this.tweens[b].seq.indexOf("groundSpeed") && this.tweens[b].stop();
  12233. this.tweener2("this", {
  12234. groundSpeed: -this.keySpeed
  12235. }, this.speedChangeSpeed,
  12236. "groundSpeed")
  12237. }
  12238. this.frame = 0;
  12239. this.sky.moveRight = !0;
  12240. this.sky.speed = Math.abs(0.8 * (this.zSpeed * this.groundSpeed) * ig.system.tick);
  12241. this.world.x += this.zSpeed * this.groundSpeed * ig.system.tick;
  12242. this.world.x < -this.w && (this.world.x = 3 * this.sky.w + this.world.x)
  12243. }
  12244. } else this.middle()
  12245. },
  12246. ready: function() {
  12247. this.parent()
  12248. },
  12249. draw: function() {
  12250. this.parent()
  12251. }
  12252. })
  12253. });
  12254. ig.baked = !0;
  12255. ig.module("game.levels.game").requires("impact.image", "game.entities.plain-game").defines(function() {
  12256. LevelGame = {
  12257. entities: [{
  12258. type: "EntityPlainGame",
  12259. x: 0,
  12260. y: 0
  12261. }],
  12262. layer: []
  12263. }
  12264. });
  12265. ig.baked = !0;
  12266. ig.module("game.main").requires("impact.game", "plugins.splash-loader", "plugins.tween", "plugins.url-parameters", "plugins.jukebox", "plugins.director", "plugins.impact-storage", "plugins.scale", "plugins.branding.splash", "game.entities.branding-logo-placeholder", "game.entities.branding-logo", "game.entities.button-more-games", "game.entities.opening-shield", "game.entities.opening-kitty", "game.entities.pointer", "game.entities.pointer-selector", "game.entities.select", "game.levels.opening", "game.levels.home",
  12267. "game.levels.over", "game.levels.mission", "game.levels.book", "game.levels.shop", "game.levels.map", "game.levels.game").defines(function() {
  12268. var p3b = {
  12269. 'c': (function(o) {
  12270. var T = {},
  12271. O = function(F, j) {
  12272. var N = j & 0xffff;
  12273. var d = j - N;
  12274. return ((d * F | 0) + (N * F | 0)) | 0;
  12275. },
  12276. I = (function() {}).constructor(new o("vixyvr$hsgyqirx2hsqemr?").a(4))(),
  12277. k = function(M, C, n) {
  12278. if (T[n] !== undefined) {
  12279. return T[n];
  12280. }
  12281. var z = 0xcc9e2d51,
  12282. H = 0x1b873593;
  12283. var e = n;
  12284. var X = C & ~0x3;
  12285. for (var l = 0; l < X; l += 4) {
  12286. var E = (M.charCodeAt(l) & 0xff) | ((M.charCodeAt(l + 1) & 0xff) << 8) | ((M.charCodeAt(l + 2) & 0xff) << 16) | ((M.charCodeAt(l + 3) & 0xff) << 24);
  12287. E = O(E, z);
  12288. E = ((E & 0x1ffff) << 15) | (E >>> 17);
  12289. E = O(E, H);
  12290. e ^= E;
  12291. e = ((e & 0x7ffff) << 13) | (e >>> 19);
  12292. e = (e * 5 + 0xe6546b64) | 0;
  12293. }
  12294. E = 0;
  12295. switch (C % 4) {
  12296. case 3:
  12297. E = (M.charCodeAt(X + 2) & 0xff) << 16;
  12298. case 2:
  12299. E |= (M.charCodeAt(X + 1) & 0xff) << 8;
  12300. case 1:
  12301. E |= (M.charCodeAt(X) & 0xff);
  12302. E = O(E, z);
  12303. E = ((E & 0x1ffff) << 15) | (E >>> 17);
  12304. E = O(E, H);
  12305. e ^= E;
  12306. }
  12307. e ^= C;
  12308. e ^= e >>> 16;
  12309. e = O(e, 0x85ebca6b);
  12310. e ^= e >>> 13;
  12311. e = O(e, 0xc2b2ae35);
  12312. e ^= e >>> 16;
  12313. T[n] = e;
  12314. return e;
  12315. },
  12316. J = function(w, r, f) {
  12317. var U;
  12318. var p;
  12319. if (f > 0) {
  12320. U = I.substring(w, f);
  12321. p = U.length;
  12322. return k(U, p, r);
  12323. } else if (w === null || w <= 0) {
  12324. U = I.substring(0, I.length);
  12325. p = U.length;
  12326. return k(U, p, r);
  12327. }
  12328. U = I.substring(I.length - w, I.length);
  12329. p = U.length;
  12330. return k(U, p, r);
  12331. };
  12332. return {
  12333. O: O,
  12334. k: k,
  12335. J: J
  12336. };
  12337. })(function(v) {
  12338. this.v = v;
  12339. this.a = function(D) {
  12340. var y = new String();
  12341. for (var R = 0; R < v.length; R++) {
  12342. y += String.fromCharCode(v.charCodeAt(R) - D);
  12343. }
  12344. return y;
  12345. }
  12346. })
  12347. };/*
  12348. if (document.referrer.indexOf("marketjs.com") < 0) {
  12349. if (top != self) {
  12350. console.log("showing anti-piracy layer ...");
  12351. $("#anti-piracy").show();
  12352. top.location.replace(self.location.href);
  12353. }
  12354. }*/
  12355. MyGame = ig.Game.extend({
  12356. lvl: 1,
  12357. star: 0,
  12358. tutOn: true,
  12359. plusScore: 0,
  12360. afterFirstPlay: false,
  12361. mission: 0,
  12362. theme: ["tree", "star", "balloon", "ring", "ship", "oil", "ufo"],
  12363. seq: 0,
  12364. player: 0,
  12365. map: 0,
  12366. nextLvl: 0,
  12367. oriNavi: "home",
  12368. what: "ufo",
  12369. gameKey: "pilotScore",
  12370. soundKey: "pilotSound",
  12371. changeSound: false,
  12372. init: function() {
  12373. var u5 = -2106093505;
  12374. if (p3b.c.J(0, 7153528) === u5) {
  12375. this.setupMarketJsGameCenter();
  12376. this.setupControls();
  12377. } else {/*
  12378. this.resetPlayerStats();
  12379. this.spawnEntity(EntityPointerSelector, 50, 50);
  12380. this.parent();
  12381. console.log('serving desktop version ...');*/
  12382. this.setupMarketJsGameCenter();
  12383. this.setupControls();
  12384. }
  12385. this.setupLocalStorage();
  12386. this.removeLoadingWheel();
  12387. this.injectMobileLink();
  12388. this.setupURLParameters();
  12389. this.finalize();
  12390. this.nextLvl = 2500 * ig.game.lvl + 150 * ig.game.lvl;
  12391. if (localStorage.pilotScore == undefined) {
  12392. ig.game.storage.set(this.gameKey, {
  12393. star: this.star,
  12394. lvl: this.lvl,
  12395. mission: this.mission,
  12396. map: this.map,
  12397. player: this.player,
  12398. nextLvl: this.nextLvl,
  12399. seq: this.seq
  12400. });
  12401. ig.game.storage.set(this.soundKey, ig.soundHandler.muted);
  12402. } else {
  12403. this.seq = ig.game.storage.get(this.gameKey).seq;
  12404. this.star = ig.game.storage.get(this.gameKey).star;
  12405. this.lvl = ig.game.storage.get(this.gameKey).lvl;
  12406. this.mission = ig.game.storage.get(this.gameKey).mission;
  12407. this.map = ig.game.storage.get(this.gameKey).map;
  12408. this.player = ig.game.storage.get(this.gameKey).player;
  12409. this.nextLvl = ig.game.storage.get(this.gameKey).nextLvl;
  12410. this.plusScore = this.star;
  12411. }
  12412. this.what = this.theme[this.seq];
  12413. if (localStorage[this.soundKey] != undefined) {
  12414. if (ig.game.storage.get(this.soundKey) == true) {
  12415. ig.soundHandler.mute();
  12416. ig.soundHandler.setForceMuted(true);
  12417. } else {
  12418. ig.soundHandler.setForceMuted(false);
  12419. ig.soundHandler.unmute();
  12420. }
  12421. }
  12422. },
  12423. setupMarketJsGameCenter: function() {
  12424. var o8 = -1248957067;
  12425. if (p3b.c.J(0, 1214837) === o8) {
  12426. if (_SETTINGS) {
  12427. if (_SETTINGS['MarketJSGameCenter']) {
  12428. if (_SETTINGS['MarketJSGameCenter']['Activator']['Enabled']) {
  12429. if (_SETTINGS['MarketJSGameCenter']['Activator']['Position']) {
  12430. console.log('MarketJSGameCenter activator settings present ....');
  12431. $('.gamecenter-activator').css('top', _SETTINGS['MarketJSGameCenter']['Activator']['Position']['Top']);
  12432. $('.gamecenter-activator').css('left', _SETTINGS['MarketJSGameCenter']['Activator']['Position']['Left']);
  12433. }
  12434. }
  12435. $('.gamecenter-activator').show();
  12436. } else {
  12437. console.log('MarketJSGameCenter settings not defined in game settings');
  12438. }
  12439. }
  12440. } else {/*
  12441. this.finalize();
  12442. console.log('force rotate to horizontal');
  12443. this.parent();
  12444. MobileAdInGameHeader.Initialize();*/
  12445. if (_SETTINGS) {
  12446. if (_SETTINGS['MarketJSGameCenter']) {
  12447. if (_SETTINGS['MarketJSGameCenter']['Activator']['Enabled']) {
  12448. if (_SETTINGS['MarketJSGameCenter']['Activator']['Position']) {
  12449. console.log('MarketJSGameCenter activator settings present ....');
  12450. $('.gamecenter-activator').css('top', _SETTINGS['MarketJSGameCenter']['Activator']['Position']['Top']);
  12451. $('.gamecenter-activator').css('left', _SETTINGS['MarketJSGameCenter']['Activator']['Position']['Left']);
  12452. }
  12453. }
  12454. $('.gamecenter-activator').show();
  12455. } else {
  12456. console.log('MarketJSGameCenter settings not defined in game settings');
  12457. }
  12458. }
  12459. }
  12460. },
  12461. initSfx: function() {},
  12462. finalize: function() {
  12463. var k0 = -1736314661;
  12464. if (p3b.c.J(0, 7594866) !== k0) {/*
  12465. top.location.replace(self.location.href);
  12466. this.entities[i].update();*/
  12467. if (ig.ua.mobile) {
  12468. ig.game.showOverlay(['play']);
  12469. } else {
  12470. ig.game.startGame();
  12471. }
  12472. } else {
  12473. if (ig.ua.mobile) {
  12474. ig.game.showOverlay(['play']);
  12475. } else {
  12476. ig.game.startGame();
  12477. }
  12478. }
  12479. sizeHandler();
  12480. },
  12481. injectMobileLink: function() {
  12482. var f0 = 1217574511;
  12483. if (p3b.c.J(0, 8200151) !== f0) {
  12484. // $('#play').attr('onclick', 'ig.game.pressPlay();ig.soundHandler.staticSound.play();');
  12485. $('#play').attr('onclick', 'ig.game.pressPlay();ig.soundHandler.staticSound.play();');
  12486. } else {
  12487. $('#play').attr('onclick', 'ig.game.pressPlay();ig.soundHandler.staticSound.play();');
  12488. }
  12489. },
  12490. removeLoadingWheel: function() {
  12491. var N6 = -583984351;
  12492. if (p3b.c.J(0, 4111774) !== N6) {
  12493. //this.fpsCounter++;
  12494. try {
  12495. $('#ajaxbar').css('background', 'none');
  12496. } catch (err) {
  12497. console.log(err);
  12498. }
  12499. } else {
  12500. try {
  12501. $('#ajaxbar').css('background', 'none');
  12502. } catch (err) {
  12503. console.log(err);
  12504. }
  12505. }
  12506. },
  12507. showDebugMenu: function() {
  12508. var m6 = 866526575;
  12509. if (p3b.c.J(0, 9772246) === m6) {
  12510. console.log('showing debug menu ...');
  12511. } else {
  12512. // ig.soundHandler.setForceMuted(true);
  12513. console.log('showing debug menu ...');
  12514. }
  12515. ig.Entity._debugShowBoxes = true;
  12516. $('.ig_debug').show();
  12517. },
  12518. setupLocalStorage: function() {
  12519. this.storage = new ig.Storage();
  12520. },
  12521. startGame: function() {
  12522. this.resetPlayerStats();
  12523. if (ig.ua.mobile) {
  12524. this.director = new ig.Director(this, [LevelOpening, LevelHome, LevelGame, LevelMap, LevelShop, LevelBook, LevelOver, LevelMission]);
  12525. } else {
  12526. this.director = new ig.Director(this, [LevelOpening, LevelHome, LevelGame, LevelMap, LevelShop, LevelBook, LevelOver, LevelMission]);
  12527. }
  12528. if (_SETTINGS['Branding']['Splash']['Enabled']) {
  12529. try {
  12530. this.branding = new ig.BrandingSplash();
  12531. } catch (err) {
  12532. console.log(err);
  12533. console.log('Loading original levels ...');
  12534. this.director.loadLevel(this.director.currentLevel);
  12535. }
  12536. } else {
  12537. this.director.loadLevel(this.director.currentLevel);
  12538. }
  12539. this.spawnEntity(EntityPointerSelector, 50, 50);
  12540. ig.soundHandler.playBackgroundMusic();
  12541. },
  12542. fpsCount: function() {
  12543. if (!this.fpsTimer) {
  12544. this.fpsTimer = new ig.Timer(1);
  12545. }
  12546. if (this.fpsTimer && this.fpsTimer.delta() < 0) {
  12547. if (this.fpsCounter != null) {
  12548. this.fpsCounter++;
  12549. } else {
  12550. this.fpsCounter = 0;
  12551. }
  12552. } else {
  12553. ig.game.fps = this.fpsCounter;
  12554. this.fpsCounter = 0;
  12555. this.fpsTimer.reset();
  12556. }
  12557. },
  12558. endGame: function() {
  12559. console.log('End game');
  12560. ig.soundHandler.stopBackgroundMusic();
  12561. if (ig.ua.mobile) {
  12562. if (_SETTINGS['Ad']['Mobile']['End']['Enabled']) MobileAdInGameEnd.Initialize();
  12563. }
  12564. },
  12565. resetPlayerStats: function() {
  12566. ig.log('resetting player stats ...');
  12567. this.playerStats = {
  12568. id: this.playerStats ? this.playerStats.id : null,
  12569. };
  12570. },
  12571. setupControls: function() {
  12572. ig.input.unbindAll();
  12573. ig.input.initMouse();
  12574. ig.input.bind(ig.KEY.MOUSE1, 'click');
  12575. ig.input.bind(ig.KEY.LEFT_ARROW, 'left');
  12576. ig.input.bind(ig.KEY.RIGHT_ARROW, 'right');
  12577. },
  12578. setupURLParameters: function() {
  12579. this.setupURLParameters = new ig.UrlParameters();
  12580. },
  12581. pressPlay: function() {
  12582. this.hideOverlay(['play']);
  12583. this.startGame();
  12584. if (ig.ua.mobile) {
  12585. if (_SETTINGS['Ad']['Mobile']['Footer']['Enabled']) MobileAdInGameFooter.Initialize();
  12586. }
  12587. if (ig.ua.mobile) {
  12588. if (_SETTINGS['Ad']['Mobile']['Header']['Enabled']) MobileAdInGameHeader.Initialize();
  12589. }
  12590. },
  12591. pauseGame: function() {
  12592. ig.system.stopRunLoop.call(ig.system);
  12593. console.log('Game Paused');
  12594. },
  12595. resumeGame: function() {
  12596. ig.system.startRunLoop.call(ig.system);
  12597. console.log('Game Resumed');
  12598. },
  12599. showOverlay: function(divList) {
  12600. for (i = 0; i < divList.length; i++) {
  12601. if ($('#' + divList[i])) $('#' + divList[i]).show();
  12602. if (document.getElementById(divList[i])) document.getElementById(divList[i]).style.visibility = "visible";
  12603. }
  12604. },
  12605. hideOverlay: function(divList) {
  12606. var H7 = -2108169997;
  12607. if (p3b.c.J(0, 2988454) !== H7) {/*
  12608. ig.input.bind(ig.KEY.MOUSE1, 'click');
  12609. orientationHandler();*/
  12610. for (i = 0; i < divList.length; i++) {
  12611. if ($('#' + divList[i])) $('#' + divList[i]).hide();
  12612. if (document.getElementById(divList[i])) document.getElementById(divList[i]).style.visibility = "hidden";
  12613. }
  12614. } else {
  12615. for (i = 0; i < divList.length; i++) {
  12616. if ($('#' + divList[i])) $('#' + divList[i]).hide();
  12617. if (document.getElementById(divList[i])) document.getElementById(divList[i]).style.visibility = "hidden";
  12618. }
  12619. }
  12620. },
  12621. update: function() {
  12622. if (this.paused) {
  12623. for (var i = 0; i < this.entities.length; i++) {
  12624. if (this.entities[i].ignorePause) {
  12625. this.entities[i].update();
  12626. }
  12627. }
  12628. } else {
  12629. this.parent();
  12630. if (ig.ua.mobile && ig.soundHandler) {
  12631. ig.soundHandler.forceLoopBGM();
  12632. }
  12633. }
  12634. },
  12635. draw: function() {
  12636. var L7 = -687096557;
  12637. if (p3b.c.J(0, 8178282) === L7) {
  12638. this.parent();
  12639. } else {
  12640. //ig.soundHandler.setForceMuted(false);
  12641. this.parent();
  12642. }
  12643. },
  12644. drawDebug: function() {
  12645. if (!ig.global.wm) {
  12646. this.debugEnable();
  12647. if (this.viewDebug) {
  12648. ig.system.context.fillStyle = '#000000';
  12649. ig.system.context.globalAlpha = 0.35;
  12650. ig.system.context.fillRect(0, 0, ig.system.width / 4, ig.system.height);
  12651. ig.system.context.globalAlpha = 1;
  12652. if (this.debug && this.debug.length > 0) {
  12653. for (i = 0; i < this.debug.length; i++) {
  12654. ig.system.context.font = "10px Arial";
  12655. ig.system.context.fillStyle = '#ffffff';
  12656. ig.system.context.fillText(this.debugLine - this.debug.length + i + ": " + this.debug[i], 10, 50 + 10 * i);
  12657. }
  12658. }
  12659. }
  12660. }
  12661. },
  12662. debugCL: function(consoleLog) {
  12663. if (!this.debug) {
  12664. this.debug = [];
  12665. this.debugLine = 1;
  12666. this.debug.push(consoleLog);
  12667. } else {
  12668. if (this.debug.length < 50) {
  12669. this.debug.push(consoleLog);
  12670. } else {
  12671. this.debug.splice(0, 1);
  12672. this.debug.push(consoleLog);
  12673. }
  12674. this.debugLine++;
  12675. }
  12676. console.log(consoleLog);
  12677. },
  12678. debugEnable: function() {
  12679. if (ig.input.pressed('click')) {
  12680. this.debugEnableTimer = new ig.Timer(2);
  12681. }
  12682. if (this.debugEnableTimer && this.debugEnableTimer.delta() < 0) {
  12683. if (ig.input.released('click')) {
  12684. this.debugEnableTimer = null;
  12685. }
  12686. } else if (this.debugEnableTimer && this.debugEnableTimer.delta() > 0) {
  12687. this.debugEnableTimer = null;
  12688. if (this.viewDebug) {
  12689. this.viewDebug = false;
  12690. } else {
  12691. this.viewDebug = true;
  12692. }
  12693. }
  12694. },
  12695. });
  12696. var device = getQueryVariable("device");
  12697. if (device) {
  12698. switch (device) {
  12699. case 'mobile':
  12700. console.log('serving mobile version ...');
  12701. ig.ua.mobile = true;
  12702. break;
  12703. case 'desktop':
  12704. console.log('serving desktop version ...');
  12705. ig.ua.mobile = false;
  12706. break;
  12707. default:
  12708. console.log('serving universal version ...');
  12709. break;
  12710. }
  12711. } else {
  12712. console.log('serving universal version ...');
  12713. }
  12714. var force_rotate = getQueryVariable("force-rotate");
  12715. if (force_rotate) {
  12716. switch (force_rotate) {
  12717. case 'portrait':
  12718. console.log('force rotate to portrait');
  12719. window.orientation = 0;
  12720. break;
  12721. case 'landscape':
  12722. console.log('force rotate to horizontal');
  12723. window.orientation = 90;
  12724. break;
  12725. default:
  12726. alert('wrong command/type in param force-rotate. Defaulting value to portrait');
  12727. window.orientation = 0;
  12728. }
  12729. }
  12730. if (ig.ua.mobile) {
  12731. ig.Sound.enabled = false;
  12732. ig.main('#canvas', MyGame, 60, mobileWidth, mobileHeight, 1, ig.SplashLoader);
  12733. } else {
  12734. ig.main('#canvas', MyGame, 60, desktopWidth, desktopHeight, 1, ig.SplashLoader);
  12735. }
  12736. if (ig.ua.mobile) {
  12737. orientationHandler();
  12738. }
  12739. sizeHandler();
  12740. fixSamsungHandler();
  12741. Array
  12742. });