You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

jquery-1.7.1.min.js 242 KiB

3 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270
  1. /*
  2. * Downloaded from http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.js, 2012-02-04 23:26
  3. */
  4. /*!
  5. * jQuery JavaScript Library v1.7.1
  6. * http://jquery.com/
  7. *
  8. * Copyright 2011, John Resig
  9. * Dual licensed under the MIT or GPL Version 2 licenses.
  10. * http://jquery.org/license
  11. *
  12. * Includes Sizzle.js
  13. * http://sizzlejs.com/
  14. * Copyright 2011, The Dojo Foundation
  15. * Released under the MIT, BSD, and GPL Licenses.
  16. *
  17. * Date: Mon Nov 21 21:11:03 2011 -0500
  18. */
  19. (function( window, undefined ) {
  20. // Use the correct document accordingly with window argument (sandbox)
  21. var document = window.document,
  22. navigator = window.navigator,
  23. location = window.location;
  24. var jQuery = (function() {
  25. // Define a local copy of jQuery
  26. var jQuery = function( selector, context ) {
  27. // The jQuery object is actually just the init constructor 'enhanced'
  28. return new jQuery.fn.init( selector, context, rootjQuery );
  29. },
  30. // Map over jQuery in case of overwrite
  31. _jQuery = window.jQuery,
  32. // Map over the $ in case of overwrite
  33. _$ = window.$,
  34. // A central reference to the root jQuery(document)
  35. rootjQuery,
  36. // A simple way to check for HTML strings or ID strings
  37. // Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
  38. quickExpr = /^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,
  39. // Check if a string has a non-whitespace character in it
  40. rnotwhite = /\S/,
  41. // Used for trimming whitespace
  42. trimLeft = /^\s+/,
  43. trimRight = /\s+$/,
  44. // Match a standalone tag
  45. rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>)?$/,
  46. // JSON RegExp
  47. rvalidchars = /^[\],:{}\s]*$/,
  48. rvalidescape = /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,
  49. rvalidtokens = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
  50. rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g,
  51. // Useragent RegExp
  52. rwebkit = /(webkit)[ \/]([\w.]+)/,
  53. ropera = /(opera)(?:.*version)?[ \/]([\w.]+)/,
  54. rmsie = /(msie) ([\w.]+)/,
  55. rmozilla = /(mozilla)(?:.*? rv:([\w.]+))?/,
  56. // Matches dashed string for camelizing
  57. rdashAlpha = /-([a-z]|[0-9])/ig,
  58. rmsPrefix = /^-ms-/,
  59. // Used by jQuery.camelCase as callback to replace()
  60. fcamelCase = function( all, letter ) {
  61. return ( letter + "" ).toUpperCase();
  62. },
  63. // Keep a UserAgent string for use with jQuery.browser
  64. userAgent = navigator.userAgent,
  65. // For matching the engine and version of the browser
  66. browserMatch,
  67. // The deferred used on DOM ready
  68. readyList,
  69. // The ready event handler
  70. DOMContentLoaded,
  71. // Save a reference to some core methods
  72. toString = Object.prototype.toString,
  73. hasOwn = Object.prototype.hasOwnProperty,
  74. push = Array.prototype.push,
  75. slice = Array.prototype.slice,
  76. trim = String.prototype.trim,
  77. indexOf = Array.prototype.indexOf,
  78. // [[Class]] -> type pairs
  79. class2type = {};
  80. jQuery.fn = jQuery.prototype = {
  81. constructor: jQuery,
  82. init: function( selector, context, rootjQuery ) {
  83. var match, elem, ret, doc;
  84. // Handle $(""), $(null), or $(undefined)
  85. if ( !selector ) {
  86. return this;
  87. }
  88. // Handle $(DOMElement)
  89. if ( selector.nodeType ) {
  90. this.context = this[0] = selector;
  91. this.length = 1;
  92. return this;
  93. }
  94. // The body element only exists once, optimize finding it
  95. if ( selector === "body" && !context && document.body ) {
  96. this.context = document;
  97. this[0] = document.body;
  98. this.selector = selector;
  99. this.length = 1;
  100. return this;
  101. }
  102. // Handle HTML strings
  103. if ( typeof selector === "string" ) {
  104. // Are we dealing with HTML string or an ID?
  105. if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) {
  106. // Assume that strings that start and end with <> are HTML and skip the regex check
  107. match = [ null, selector, null ];
  108. } else {
  109. match = quickExpr.exec( selector );
  110. }
  111. // Verify a match, and that no context was specified for #id
  112. if ( match && (match[1] || !context) ) {
  113. // HANDLE: $(html) -> $(array)
  114. if ( match[1] ) {
  115. context = context instanceof jQuery ? context[0] : context;
  116. doc = ( context ? context.ownerDocument || context : document );
  117. // If a single string is passed in and it's a single tag
  118. // just do a createElement and skip the rest
  119. ret = rsingleTag.exec( selector );
  120. if ( ret ) {
  121. if ( jQuery.isPlainObject( context ) ) {
  122. selector = [ document.createElement( ret[1] ) ];
  123. jQuery.fn.attr.call( selector, context, true );
  124. } else {
  125. selector = [ doc.createElement( ret[1] ) ];
  126. }
  127. } else {
  128. ret = jQuery.buildFragment( [ match[1] ], [ doc ] );
  129. selector = ( ret.cacheable ? jQuery.clone(ret.fragment) : ret.fragment ).childNodes;
  130. }
  131. return jQuery.merge( this, selector );
  132. // HANDLE: $("#id")
  133. } else {
  134. elem = document.getElementById( match[2] );
  135. // Check parentNode to catch when Blackberry 4.6 returns
  136. // nodes that are no longer in the document #6963
  137. if ( elem && elem.parentNode ) {
  138. // Handle the case where IE and Opera return items
  139. // by name instead of ID
  140. if ( elem.id !== match[2] ) {
  141. return rootjQuery.find( selector );
  142. }
  143. // Otherwise, we inject the element directly into the jQuery object
  144. this.length = 1;
  145. this[0] = elem;
  146. }
  147. this.context = document;
  148. this.selector = selector;
  149. return this;
  150. }
  151. // HANDLE: $(expr, $(...))
  152. } else if ( !context || context.jquery ) {
  153. return ( context || rootjQuery ).find( selector );
  154. // HANDLE: $(expr, context)
  155. // (which is just equivalent to: $(context).find(expr)
  156. } else {
  157. return this.constructor( context ).find( selector );
  158. }
  159. // HANDLE: $(function)
  160. // Shortcut for document ready
  161. } else if ( jQuery.isFunction( selector ) ) {
  162. return rootjQuery.ready( selector );
  163. }
  164. if ( selector.selector !== undefined ) {
  165. this.selector = selector.selector;
  166. this.context = selector.context;
  167. }
  168. return jQuery.makeArray( selector, this );
  169. },
  170. // Start with an empty selector
  171. selector: "",
  172. // The current version of jQuery being used
  173. jquery: "1.7.1",
  174. // The default length of a jQuery object is 0
  175. length: 0,
  176. // The number of elements contained in the matched element set
  177. size: function() {
  178. return this.length;
  179. },
  180. toArray: function() {
  181. return slice.call( this, 0 );
  182. },
  183. // Get the Nth element in the matched element set OR
  184. // Get the whole matched element set as a clean array
  185. get: function( num ) {
  186. return num == null ?
  187. // Return a 'clean' array
  188. this.toArray() :
  189. // Return just the object
  190. ( num < 0 ? this[ this.length + num ] : this[ num ] );
  191. },
  192. // Take an array of elements and push it onto the stack
  193. // (returning the new matched element set)
  194. pushStack: function( elems, name, selector ) {
  195. // Build a new jQuery matched element set
  196. var ret = this.constructor();
  197. if ( jQuery.isArray( elems ) ) {
  198. push.apply( ret, elems );
  199. } else {
  200. jQuery.merge( ret, elems );
  201. }
  202. // Add the old object onto the stack (as a reference)
  203. ret.prevObject = this;
  204. ret.context = this.context;
  205. if ( name === "find" ) {
  206. ret.selector = this.selector + ( this.selector ? " " : "" ) + selector;
  207. } else if ( name ) {
  208. ret.selector = this.selector + "." + name + "(" + selector + ")";
  209. }
  210. // Return the newly-formed element set
  211. return ret;
  212. },
  213. // Execute a callback for every element in the matched set.
  214. // (You can seed the arguments with an array of args, but this is
  215. // only used internally.)
  216. each: function( callback, args ) {
  217. return jQuery.each( this, callback, args );
  218. },
  219. ready: function( fn ) {
  220. // Attach the listeners
  221. jQuery.bindReady();
  222. // Add the callback
  223. readyList.add( fn );
  224. return this;
  225. },
  226. eq: function( i ) {
  227. i = +i;
  228. return i === -1 ?
  229. this.slice( i ) :
  230. this.slice( i, i + 1 );
  231. },
  232. first: function() {
  233. return this.eq( 0 );
  234. },
  235. last: function() {
  236. return this.eq( -1 );
  237. },
  238. slice: function() {
  239. return this.pushStack( slice.apply( this, arguments ),
  240. "slice", slice.call(arguments).join(",") );
  241. },
  242. map: function( callback ) {
  243. return this.pushStack( jQuery.map(this, function( elem, i ) {
  244. return callback.call( elem, i, elem );
  245. }));
  246. },
  247. end: function() {
  248. return this.prevObject || this.constructor(null);
  249. },
  250. // For internal use only.
  251. // Behaves like an Array's method, not like a jQuery method.
  252. push: push,
  253. sort: [].sort,
  254. splice: [].splice
  255. };
  256. // Give the init function the jQuery prototype for later instantiation
  257. jQuery.fn.init.prototype = jQuery.fn;
  258. jQuery.extend = jQuery.fn.extend = function() {
  259. var options, name, src, copy, copyIsArray, clone,
  260. target = arguments[0] || {},
  261. i = 1,
  262. length = arguments.length,
  263. deep = false;
  264. // Handle a deep copy situation
  265. if ( typeof target === "boolean" ) {
  266. deep = target;
  267. target = arguments[1] || {};
  268. // skip the boolean and the target
  269. i = 2;
  270. }
  271. // Handle case when target is a string or something (possible in deep copy)
  272. if ( typeof target !== "object" && !jQuery.isFunction(target) ) {
  273. target = {};
  274. }
  275. // extend jQuery itself if only one argument is passed
  276. if ( length === i ) {
  277. target = this;
  278. --i;
  279. }
  280. for ( ; i < length; i++ ) {
  281. // Only deal with non-null/undefined values
  282. if ( (options = arguments[ i ]) != null ) {
  283. // Extend the base object
  284. for ( name in options ) {
  285. src = target[ name ];
  286. copy = options[ name ];
  287. // Prevent never-ending loop
  288. if ( target === copy ) {
  289. continue;
  290. }
  291. // Recurse if we're merging plain objects or arrays
  292. if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) {
  293. if ( copyIsArray ) {
  294. copyIsArray = false;
  295. clone = src && jQuery.isArray(src) ? src : [];
  296. } else {
  297. clone = src && jQuery.isPlainObject(src) ? src : {};
  298. }
  299. // Never move original objects, clone them
  300. target[ name ] = jQuery.extend( deep, clone, copy );
  301. // Don't bring in undefined values
  302. } else if ( copy !== undefined ) {
  303. target[ name ] = copy;
  304. }
  305. }
  306. }
  307. }
  308. // Return the modified object
  309. return target;
  310. };
  311. jQuery.extend({
  312. noConflict: function( deep ) {
  313. if ( window.$ === jQuery ) {
  314. window.$ = _$;
  315. }
  316. if ( deep && window.jQuery === jQuery ) {
  317. window.jQuery = _jQuery;
  318. }
  319. return jQuery;
  320. },
  321. // Is the DOM ready to be used? Set to true once it occurs.
  322. isReady: false,
  323. // A counter to track how many items to wait for before
  324. // the ready event fires. See #6781
  325. readyWait: 1,
  326. // Hold (or release) the ready event
  327. holdReady: function( hold ) {
  328. if ( hold ) {
  329. jQuery.readyWait++;
  330. } else {
  331. jQuery.ready( true );
  332. }
  333. },
  334. // Handle when the DOM is ready
  335. ready: function( wait ) {
  336. // Either a released hold or an DOMready/load event and not yet ready
  337. if ( (wait === true && !--jQuery.readyWait) || (wait !== true && !jQuery.isReady) ) {
  338. // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
  339. if ( !document.body ) {
  340. return setTimeout( jQuery.ready, 1 );
  341. }
  342. // Remember that the DOM is ready
  343. jQuery.isReady = true;
  344. // If a normal DOM Ready event fired, decrement, and wait if need be
  345. if ( wait !== true && --jQuery.readyWait > 0 ) {
  346. return;
  347. }
  348. // If there are functions bound, to execute
  349. readyList.fireWith( document, [ jQuery ] );
  350. // Trigger any bound ready events
  351. if ( jQuery.fn.trigger ) {
  352. jQuery( document ).trigger( "ready" ).off( "ready" );
  353. }
  354. }
  355. },
  356. bindReady: function() {
  357. if ( readyList ) {
  358. return;
  359. }
  360. readyList = jQuery.Callbacks( "once memory" );
  361. // Catch cases where $(document).ready() is called after the
  362. // browser event has already occurred.
  363. if ( document.readyState === "complete" ) {
  364. // Handle it asynchronously to allow scripts the opportunity to delay ready
  365. return setTimeout( jQuery.ready, 1 );
  366. }
  367. // Mozilla, Opera and webkit nightlies currently support this event
  368. if ( document.addEventListener ) {
  369. // Use the handy event callback
  370. document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false );
  371. // A fallback to window.onload, that will always work
  372. window.addEventListener( "load", jQuery.ready, false );
  373. // If IE event model is used
  374. } else if ( document.attachEvent ) {
  375. // ensure firing before onload,
  376. // maybe late but safe also for iframes
  377. document.attachEvent( "onreadystatechange", DOMContentLoaded );
  378. // A fallback to window.onload, that will always work
  379. window.attachEvent( "onload", jQuery.ready );
  380. // If IE and not a frame
  381. // continually check to see if the document is ready
  382. var toplevel = false;
  383. try {
  384. toplevel = window.frameElement == null;
  385. } catch(e) {}
  386. if ( document.documentElement.doScroll && toplevel ) {
  387. doScrollCheck();
  388. }
  389. }
  390. },
  391. // See test/unit/core.js for details concerning isFunction.
  392. // Since version 1.3, DOM methods and functions like alert
  393. // aren't supported. They return false on IE (#2968).
  394. isFunction: function( obj ) {
  395. return jQuery.type(obj) === "function";
  396. },
  397. isArray: Array.isArray || function( obj ) {
  398. return jQuery.type(obj) === "array";
  399. },
  400. // A crude way of determining if an object is a window
  401. isWindow: function( obj ) {
  402. return obj && typeof obj === "object" && "setInterval" in obj;
  403. },
  404. isNumeric: function( obj ) {
  405. return !isNaN( parseFloat(obj) ) && isFinite( obj );
  406. },
  407. type: function( obj ) {
  408. return obj == null ?
  409. String( obj ) :
  410. class2type[ toString.call(obj) ] || "object";
  411. },
  412. isPlainObject: function( obj ) {
  413. // Must be an Object.
  414. // Because of IE, we also have to check the presence of the constructor property.
  415. // Make sure that DOM nodes and window objects don't pass through, as well
  416. if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) {
  417. return false;
  418. }
  419. try {
  420. // Not own constructor property must be Object
  421. if ( obj.constructor &&
  422. !hasOwn.call(obj, "constructor") &&
  423. !hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) {
  424. return false;
  425. }
  426. } catch ( e ) {
  427. // IE8,9 Will throw exceptions on certain host objects #9897
  428. return false;
  429. }
  430. // Own properties are enumerated firstly, so to speed up,
  431. // if last one is own, then all properties are own.
  432. var key;
  433. for ( key in obj ) {}
  434. return key === undefined || hasOwn.call( obj, key );
  435. },
  436. isEmptyObject: function( obj ) {
  437. for ( var name in obj ) {
  438. return false;
  439. }
  440. return true;
  441. },
  442. error: function( msg ) {
  443. throw new Error( msg );
  444. },
  445. parseJSON: function( data ) {
  446. if ( typeof data !== "string" || !data ) {
  447. return null;
  448. }
  449. // Make sure leading/trailing whitespace is removed (IE can't handle it)
  450. data = jQuery.trim( data );
  451. // Attempt to parse using the native JSON parser first
  452. if ( window.JSON && window.JSON.parse ) {
  453. return window.JSON.parse( data );
  454. }
  455. // Make sure the incoming data is actual JSON
  456. // Logic borrowed from http://json.org/json2.js
  457. if ( rvalidchars.test( data.replace( rvalidescape, "@" )
  458. .replace( rvalidtokens, "]" )
  459. .replace( rvalidbraces, "")) ) {
  460. return ( new Function( "return " + data ) )();
  461. }
  462. jQuery.error( "Invalid JSON: " + data );
  463. },
  464. // Cross-browser xml parsing
  465. parseXML: function( data ) {
  466. var xml, tmp;
  467. try {
  468. if ( window.DOMParser ) { // Standard
  469. tmp = new DOMParser();
  470. xml = tmp.parseFromString( data , "text/xml" );
  471. } else { // IE
  472. xml = new ActiveXObject( "Microsoft.XMLDOM" );
  473. xml.async = "false";
  474. xml.loadXML( data );
  475. }
  476. } catch( e ) {
  477. xml = undefined;
  478. }
  479. if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) {
  480. jQuery.error( "Invalid XML: " + data );
  481. }
  482. return xml;
  483. },
  484. noop: function() {},
  485. // Evaluates a script in a global context
  486. // Workarounds based on findings by Jim Driscoll
  487. // http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context
  488. globalEval: function( data ) {
  489. if ( data && rnotwhite.test( data ) ) {
  490. // We use execScript on Internet Explorer
  491. // We use an anonymous function so that context is window
  492. // rather than jQuery in Firefox
  493. ( window.execScript || function( data ) {
  494. window[ "eval" ].call( window, data );
  495. } )( data );
  496. }
  497. },
  498. // Convert dashed to camelCase; used by the css and data modules
  499. // Microsoft forgot to hump their vendor prefix (#9572)
  500. camelCase: function( string ) {
  501. return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
  502. },
  503. nodeName: function( elem, name ) {
  504. return elem.nodeName && elem.nodeName.toUpperCase() === name.toUpperCase();
  505. },
  506. // args is for internal usage only
  507. each: function( object, callback, args ) {
  508. var name, i = 0,
  509. length = object.length,
  510. isObj = length === undefined || jQuery.isFunction( object );
  511. if ( args ) {
  512. if ( isObj ) {
  513. for ( name in object ) {
  514. if ( callback.apply( object[ name ], args ) === false ) {
  515. break;
  516. }
  517. }
  518. } else {
  519. for ( ; i < length; ) {
  520. if ( callback.apply( object[ i++ ], args ) === false ) {
  521. break;
  522. }
  523. }
  524. }
  525. // A special, fast, case for the most common use of each
  526. } else {
  527. if ( isObj ) {
  528. for ( name in object ) {
  529. if ( callback.call( object[ name ], name, object[ name ] ) === false ) {
  530. break;
  531. }
  532. }
  533. } else {
  534. for ( ; i < length; ) {
  535. if ( callback.call( object[ i ], i, object[ i++ ] ) === false ) {
  536. break;
  537. }
  538. }
  539. }
  540. }
  541. return object;
  542. },
  543. // Use native String.trim function wherever possible
  544. trim: trim ?
  545. function( text ) {
  546. return text == null ?
  547. "" :
  548. trim.call( text );
  549. } :
  550. // Otherwise use our own trimming functionality
  551. function( text ) {
  552. return text == null ?
  553. "" :
  554. text.toString().replace( trimLeft, "" ).replace( trimRight, "" );
  555. },
  556. // results is for internal usage only
  557. makeArray: function( array, results ) {
  558. var ret = results || [];
  559. if ( array != null ) {
  560. // The window, strings (and functions) also have 'length'
  561. // Tweaked logic slightly to handle Blackberry 4.7 RegExp issues #6930
  562. var type = jQuery.type( array );
  563. if ( array.length == null || type === "string" || type === "function" || type === "regexp" || jQuery.isWindow( array ) ) {
  564. push.call( ret, array );
  565. } else {
  566. jQuery.merge( ret, array );
  567. }
  568. }
  569. return ret;
  570. },
  571. inArray: function( elem, array, i ) {
  572. var len;
  573. if ( array ) {
  574. if ( indexOf ) {
  575. return indexOf.call( array, elem, i );
  576. }
  577. len = array.length;
  578. i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0;
  579. for ( ; i < len; i++ ) {
  580. // Skip accessing in sparse arrays
  581. if ( i in array && array[ i ] === elem ) {
  582. return i;
  583. }
  584. }
  585. }
  586. return -1;
  587. },
  588. merge: function( first, second ) {
  589. var i = first.length,
  590. j = 0;
  591. if ( typeof second.length === "number" ) {
  592. for ( var l = second.length; j < l; j++ ) {
  593. first[ i++ ] = second[ j ];
  594. }
  595. } else {
  596. while ( second[j] !== undefined ) {
  597. first[ i++ ] = second[ j++ ];
  598. }
  599. }
  600. first.length = i;
  601. return first;
  602. },
  603. grep: function( elems, callback, inv ) {
  604. var ret = [], retVal;
  605. inv = !!inv;
  606. // Go through the array, only saving the items
  607. // that pass the validator function
  608. for ( var i = 0, length = elems.length; i < length; i++ ) {
  609. retVal = !!callback( elems[ i ], i );
  610. if ( inv !== retVal ) {
  611. ret.push( elems[ i ] );
  612. }
  613. }
  614. return ret;
  615. },
  616. // arg is for internal usage only
  617. map: function( elems, callback, arg ) {
  618. var value, key, ret = [],
  619. i = 0,
  620. length = elems.length,
  621. // jquery objects are treated as arrays
  622. isArray = elems instanceof jQuery || length !== undefined && typeof length === "number" && ( ( length > 0 && elems[ 0 ] && elems[ length -1 ] ) || length === 0 || jQuery.isArray( elems ) ) ;
  623. // Go through the array, translating each of the items to their
  624. if ( isArray ) {
  625. for ( ; i < length; i++ ) {
  626. value = callback( elems[ i ], i, arg );
  627. if ( value != null ) {
  628. ret[ ret.length ] = value;
  629. }
  630. }
  631. // Go through every key on the object,
  632. } else {
  633. for ( key in elems ) {
  634. value = callback( elems[ key ], key, arg );
  635. if ( value != null ) {
  636. ret[ ret.length ] = value;
  637. }
  638. }
  639. }
  640. // Flatten any nested arrays
  641. return ret.concat.apply( [], ret );
  642. },
  643. // A global GUID counter for objects
  644. guid: 1,
  645. // Bind a function to a context, optionally partially applying any
  646. // arguments.
  647. proxy: function( fn, context ) {
  648. if ( typeof context === "string" ) {
  649. var tmp = fn[ context ];
  650. context = fn;
  651. fn = tmp;
  652. }
  653. // Quick check to determine if target is callable, in the spec
  654. // this throws a TypeError, but we will just return undefined.
  655. if ( !jQuery.isFunction( fn ) ) {
  656. return undefined;
  657. }
  658. // Simulated bind
  659. var args = slice.call( arguments, 2 ),
  660. proxy = function() {
  661. return fn.apply( context, args.concat( slice.call( arguments ) ) );
  662. };
  663. // Set the guid of unique handler to the same of original handler, so it can be removed
  664. proxy.guid = fn.guid = fn.guid || proxy.guid || jQuery.guid++;
  665. return proxy;
  666. },
  667. // Mutifunctional method to get and set values to a collection
  668. // The value/s can optionally be executed if it's a function
  669. access: function( elems, key, value, exec, fn, pass ) {
  670. var length = elems.length;
  671. // Setting many attributes
  672. if ( typeof key === "object" ) {
  673. for ( var k in key ) {
  674. jQuery.access( elems, k, key[k], exec, fn, value );
  675. }
  676. return elems;
  677. }
  678. // Setting one attribute
  679. if ( value !== undefined ) {
  680. // Optionally, function values get executed if exec is true
  681. exec = !pass && exec && jQuery.isFunction(value);
  682. for ( var i = 0; i < length; i++ ) {
  683. fn( elems[i], key, exec ? value.call( elems[i], i, fn( elems[i], key ) ) : value, pass );
  684. }
  685. return elems;
  686. }
  687. // Getting an attribute
  688. return length ? fn( elems[0], key ) : undefined;
  689. },
  690. now: function() {
  691. return ( new Date() ).getTime();
  692. },
  693. // Use of jQuery.browser is frowned upon.
  694. // More details: http://docs.jquery.com/Utilities/jQuery.browser
  695. uaMatch: function( ua ) {
  696. ua = ua.toLowerCase();
  697. var match = rwebkit.exec( ua ) ||
  698. ropera.exec( ua ) ||
  699. rmsie.exec( ua ) ||
  700. ua.indexOf("compatible") < 0 && rmozilla.exec( ua ) ||
  701. [];
  702. return { browser: match[1] || "", version: match[2] || "0" };
  703. },
  704. sub: function() {
  705. function jQuerySub( selector, context ) {
  706. return new jQuerySub.fn.init( selector, context );
  707. }
  708. jQuery.extend( true, jQuerySub, this );
  709. jQuerySub.superclass = this;
  710. jQuerySub.fn = jQuerySub.prototype = this();
  711. jQuerySub.fn.constructor = jQuerySub;
  712. jQuerySub.sub = this.sub;
  713. jQuerySub.fn.init = function init( selector, context ) {
  714. if ( context && context instanceof jQuery && !(context instanceof jQuerySub) ) {
  715. context = jQuerySub( context );
  716. }
  717. return jQuery.fn.init.call( this, selector, context, rootjQuerySub );
  718. };
  719. jQuerySub.fn.init.prototype = jQuerySub.fn;
  720. var rootjQuerySub = jQuerySub(document);
  721. return jQuerySub;
  722. },
  723. browser: {}
  724. });
  725. // Populate the class2type map
  726. jQuery.each("Boolean Number String Function Array Date RegExp Object".split(" "), function(i, name) {
  727. class2type[ "[object " + name + "]" ] = name.toLowerCase();
  728. });
  729. browserMatch = jQuery.uaMatch( userAgent );
  730. if ( browserMatch.browser ) {
  731. jQuery.browser[ browserMatch.browser ] = true;
  732. jQuery.browser.version = browserMatch.version;
  733. }
  734. // Deprecated, use jQuery.browser.webkit instead
  735. if ( jQuery.browser.webkit ) {
  736. jQuery.browser.safari = true;
  737. }
  738. // IE doesn't match non-breaking spaces with \s
  739. if ( rnotwhite.test( "\xA0" ) ) {
  740. trimLeft = /^[\s\xA0]+/;
  741. trimRight = /[\s\xA0]+$/;
  742. }
  743. // All jQuery objects should point back to these
  744. rootjQuery = jQuery(document);
  745. // Cleanup functions for the document ready method
  746. if ( document.addEventListener ) {
  747. DOMContentLoaded = function() {
  748. document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false );
  749. jQuery.ready();
  750. };
  751. } else if ( document.attachEvent ) {
  752. DOMContentLoaded = function() {
  753. // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
  754. if ( document.readyState === "complete" ) {
  755. document.detachEvent( "onreadystatechange", DOMContentLoaded );
  756. jQuery.ready();
  757. }
  758. };
  759. }
  760. // The DOM ready check for Internet Explorer
  761. function doScrollCheck() {
  762. if ( jQuery.isReady ) {
  763. return;
  764. }
  765. try {
  766. // If IE is used, use the trick by Diego Perini
  767. // http://javascript.nwbox.com/IEContentLoaded/
  768. document.documentElement.doScroll("left");
  769. } catch(e) {
  770. setTimeout( doScrollCheck, 1 );
  771. return;
  772. }
  773. // and execute any waiting functions
  774. jQuery.ready();
  775. }
  776. return jQuery;
  777. })();
  778. // String to Object flags format cache
  779. var flagsCache = {};
  780. // Convert String-formatted flags into Object-formatted ones and store in cache
  781. function createFlags( flags ) {
  782. var object = flagsCache[ flags ] = {},
  783. i, length;
  784. flags = flags.split( /\s+/ );
  785. for ( i = 0, length = flags.length; i < length; i++ ) {
  786. object[ flags[i] ] = true;
  787. }
  788. return object;
  789. }
  790. /*
  791. * Create a callback list using the following parameters:
  792. *
  793. * flags: an optional list of space-separated flags that will change how
  794. * the callback list behaves
  795. *
  796. * By default a callback list will act like an event callback list and can be
  797. * "fired" multiple times.
  798. *
  799. * Possible flags:
  800. *
  801. * once: will ensure the callback list can only be fired once (like a Deferred)
  802. *
  803. * memory: will keep track of previous values and will call any callback added
  804. * after the list has been fired right away with the latest "memorized"
  805. * values (like a Deferred)
  806. *
  807. * unique: will ensure a callback can only be added once (no duplicate in the list)
  808. *
  809. * stopOnFalse: interrupt callings when a callback returns false
  810. *
  811. */
  812. jQuery.Callbacks = function( flags ) {
  813. // Convert flags from String-formatted to Object-formatted
  814. // (we check in cache first)
  815. flags = flags ? ( flagsCache[ flags ] || createFlags( flags ) ) : {};
  816. var // Actual callback list
  817. list = [],
  818. // Stack of fire calls for repeatable lists
  819. stack = [],
  820. // Last fire value (for non-forgettable lists)
  821. memory,
  822. // Flag to know if list is currently firing
  823. firing,
  824. // First callback to fire (used internally by add and fireWith)
  825. firingStart,
  826. // End of the loop when firing
  827. firingLength,
  828. // Index of currently firing callback (modified by remove if needed)
  829. firingIndex,
  830. // Add one or several callbacks to the list
  831. add = function( args ) {
  832. var i,
  833. length,
  834. elem,
  835. type,
  836. actual;
  837. for ( i = 0, length = args.length; i < length; i++ ) {
  838. elem = args[ i ];
  839. type = jQuery.type( elem );
  840. if ( type === "array" ) {
  841. // Inspect recursively
  842. add( elem );
  843. } else if ( type === "function" ) {
  844. // Add if not in unique mode and callback is not in
  845. if ( !flags.unique || !self.has( elem ) ) {
  846. list.push( elem );
  847. }
  848. }
  849. }
  850. },
  851. // Fire callbacks
  852. fire = function( context, args ) {
  853. args = args || [];
  854. memory = !flags.memory || [ context, args ];
  855. firing = true;
  856. firingIndex = firingStart || 0;
  857. firingStart = 0;
  858. firingLength = list.length;
  859. for ( ; list && firingIndex < firingLength; firingIndex++ ) {
  860. if ( list[ firingIndex ].apply( context, args ) === false && flags.stopOnFalse ) {
  861. memory = true; // Mark as halted
  862. break;
  863. }
  864. }
  865. firing = false;
  866. if ( list ) {
  867. if ( !flags.once ) {
  868. if ( stack && stack.length ) {
  869. memory = stack.shift();
  870. self.fireWith( memory[ 0 ], memory[ 1 ] );
  871. }
  872. } else if ( memory === true ) {
  873. self.disable();
  874. } else {
  875. list = [];
  876. }
  877. }
  878. },
  879. // Actual Callbacks object
  880. self = {
  881. // Add a callback or a collection of callbacks to the list
  882. add: function() {
  883. if ( list ) {
  884. var length = list.length;
  885. add( arguments );
  886. // Do we need to add the callbacks to the
  887. // current firing batch?
  888. if ( firing ) {
  889. firingLength = list.length;
  890. // With memory, if we're not firing then
  891. // we should call right away, unless previous
  892. // firing was halted (stopOnFalse)
  893. } else if ( memory && memory !== true ) {
  894. firingStart = length;
  895. fire( memory[ 0 ], memory[ 1 ] );
  896. }
  897. }
  898. return this;
  899. },
  900. // Remove a callback from the list
  901. remove: function() {
  902. if ( list ) {
  903. var args = arguments,
  904. argIndex = 0,
  905. argLength = args.length;
  906. for ( ; argIndex < argLength ; argIndex++ ) {
  907. for ( var i = 0; i < list.length; i++ ) {
  908. if ( args[ argIndex ] === list[ i ] ) {
  909. // Handle firingIndex and firingLength
  910. if ( firing ) {
  911. if ( i <= firingLength ) {
  912. firingLength--;
  913. if ( i <= firingIndex ) {
  914. firingIndex--;
  915. }
  916. }
  917. }
  918. // Remove the element
  919. list.splice( i--, 1 );
  920. // If we have some unicity property then
  921. // we only need to do this once
  922. if ( flags.unique ) {
  923. break;
  924. }
  925. }
  926. }
  927. }
  928. }
  929. return this;
  930. },
  931. // Control if a given callback is in the list
  932. has: function( fn ) {
  933. if ( list ) {
  934. var i = 0,
  935. length = list.length;
  936. for ( ; i < length; i++ ) {
  937. if ( fn === list[ i ] ) {
  938. return true;
  939. }
  940. }
  941. }
  942. return false;
  943. },
  944. // Remove all callbacks from the list
  945. empty: function() {
  946. list = [];
  947. return this;
  948. },
  949. // Have the list do nothing anymore
  950. disable: function() {
  951. list = stack = memory = undefined;
  952. return this;
  953. },
  954. // Is it disabled?
  955. disabled: function() {
  956. return !list;
  957. },
  958. // Lock the list in its current state
  959. lock: function() {
  960. stack = undefined;
  961. if ( !memory || memory === true ) {
  962. self.disable();
  963. }
  964. return this;
  965. },
  966. // Is it locked?
  967. locked: function() {
  968. return !stack;
  969. },
  970. // Call all callbacks with the given context and arguments
  971. fireWith: function( context, args ) {
  972. if ( stack ) {
  973. if ( firing ) {
  974. if ( !flags.once ) {
  975. stack.push( [ context, args ] );
  976. }
  977. } else if ( !( flags.once && memory ) ) {
  978. fire( context, args );
  979. }
  980. }
  981. return this;
  982. },
  983. // Call all the callbacks with the given arguments
  984. fire: function() {
  985. self.fireWith( this, arguments );
  986. return this;
  987. },
  988. // To know if the callbacks have already been called at least once
  989. fired: function() {
  990. return !!memory;
  991. }
  992. };
  993. return self;
  994. };
  995. var // Static reference to slice
  996. sliceDeferred = [].slice;
  997. jQuery.extend({
  998. Deferred: function( func ) {
  999. var doneList = jQuery.Callbacks( "once memory" ),
  1000. failList = jQuery.Callbacks( "once memory" ),
  1001. progressList = jQuery.Callbacks( "memory" ),
  1002. state = "pending",
  1003. lists = {
  1004. resolve: doneList,
  1005. reject: failList,
  1006. notify: progressList
  1007. },
  1008. promise = {
  1009. done: doneList.add,
  1010. fail: failList.add,
  1011. progress: progressList.add,
  1012. state: function() {
  1013. return state;
  1014. },
  1015. // Deprecated
  1016. isResolved: doneList.fired,
  1017. isRejected: failList.fired,
  1018. then: function( doneCallbacks, failCallbacks, progressCallbacks ) {
  1019. deferred.done( doneCallbacks ).fail( failCallbacks ).progress( progressCallbacks );
  1020. return this;
  1021. },
  1022. always: function() {
  1023. deferred.done.apply( deferred, arguments ).fail.apply( deferred, arguments );
  1024. return this;
  1025. },
  1026. pipe: function( fnDone, fnFail, fnProgress ) {
  1027. return jQuery.Deferred(function( newDefer ) {
  1028. jQuery.each( {
  1029. done: [ fnDone, "resolve" ],
  1030. fail: [ fnFail, "reject" ],
  1031. progress: [ fnProgress, "notify" ]
  1032. }, function( handler, data ) {
  1033. var fn = data[ 0 ],
  1034. action = data[ 1 ],
  1035. returned;
  1036. if ( jQuery.isFunction( fn ) ) {
  1037. deferred[ handler ](function() {
  1038. returned = fn.apply( this, arguments );
  1039. if ( returned && jQuery.isFunction( returned.promise ) ) {
  1040. returned.promise().then( newDefer.resolve, newDefer.reject, newDefer.notify );
  1041. } else {
  1042. newDefer[ action + "With" ]( this === deferred ? newDefer : this, [ returned ] );
  1043. }
  1044. });
  1045. } else {
  1046. deferred[ handler ]( newDefer[ action ] );
  1047. }
  1048. });
  1049. }).promise();
  1050. },
  1051. // Get a promise for this deferred
  1052. // If obj is provided, the promise aspect is added to the object
  1053. promise: function( obj ) {
  1054. if ( obj == null ) {
  1055. obj = promise;
  1056. } else {
  1057. for ( var key in promise ) {
  1058. obj[ key ] = promise[ key ];
  1059. }
  1060. }
  1061. return obj;
  1062. }
  1063. },
  1064. deferred = promise.promise({}),
  1065. key;
  1066. for ( key in lists ) {
  1067. deferred[ key ] = lists[ key ].fire;
  1068. deferred[ key + "With" ] = lists[ key ].fireWith;
  1069. }
  1070. // Handle state
  1071. deferred.done( function() {
  1072. state = "resolved";
  1073. }, failList.disable, progressList.lock ).fail( function() {
  1074. state = "rejected";
  1075. }, doneList.disable, progressList.lock );
  1076. // Call given func if any
  1077. if ( func ) {
  1078. func.call( deferred, deferred );
  1079. }
  1080. // All done!
  1081. return deferred;
  1082. },
  1083. // Deferred helper
  1084. when: function( firstParam ) {
  1085. var args = sliceDeferred.call( arguments, 0 ),
  1086. i = 0,
  1087. length = args.length,
  1088. pValues = new Array( length ),
  1089. count = length,
  1090. pCount = length,
  1091. deferred = length <= 1 && firstParam && jQuery.isFunction( firstParam.promise ) ?
  1092. firstParam :
  1093. jQuery.Deferred(),
  1094. promise = deferred.promise();
  1095. function resolveFunc( i ) {
  1096. return function( value ) {
  1097. args[ i ] = arguments.length > 1 ? sliceDeferred.call( arguments, 0 ) : value;
  1098. if ( !( --count ) ) {
  1099. deferred.resolveWith( deferred, args );
  1100. }
  1101. };
  1102. }
  1103. function progressFunc( i ) {
  1104. return function( value ) {
  1105. pValues[ i ] = arguments.length > 1 ? sliceDeferred.call( arguments, 0 ) : value;
  1106. deferred.notifyWith( promise, pValues );
  1107. };
  1108. }
  1109. if ( length > 1 ) {
  1110. for ( ; i < length; i++ ) {
  1111. if ( args[ i ] && args[ i ].promise && jQuery.isFunction( args[ i ].promise ) ) {
  1112. args[ i ].promise().then( resolveFunc(i), deferred.reject, progressFunc(i) );
  1113. } else {
  1114. --count;
  1115. }
  1116. }
  1117. if ( !count ) {
  1118. deferred.resolveWith( deferred, args );
  1119. }
  1120. } else if ( deferred !== firstParam ) {
  1121. deferred.resolveWith( deferred, length ? [ firstParam ] : [] );
  1122. }
  1123. return promise;
  1124. }
  1125. });
  1126. jQuery.support = (function() {
  1127. var support,
  1128. all,
  1129. a,
  1130. select,
  1131. opt,
  1132. input,
  1133. marginDiv,
  1134. fragment,
  1135. tds,
  1136. events,
  1137. eventName,
  1138. i,
  1139. isSupported,
  1140. div = document.createElement( "div" ),
  1141. documentElement = document.documentElement;
  1142. // Preliminary tests
  1143. div.setAttribute("className", "t");
  1144. div.innerHTML = " <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>";
  1145. all = div.getElementsByTagName( "*" );
  1146. a = div.getElementsByTagName( "a" )[ 0 ];
  1147. // Can't get basic test support
  1148. if ( !all || !all.length || !a ) {
  1149. return {};
  1150. }
  1151. // First batch of supports tests
  1152. select = document.createElement( "select" );
  1153. opt = select.appendChild( document.createElement("option") );
  1154. input = div.getElementsByTagName( "input" )[ 0 ];
  1155. support = {
  1156. // IE strips leading whitespace when .innerHTML is used
  1157. leadingWhitespace: ( div.firstChild.nodeType === 3 ),
  1158. // Make sure that tbody elements aren't automatically inserted
  1159. // IE will insert them into empty tables
  1160. tbody: !div.getElementsByTagName("tbody").length,
  1161. // Make sure that link elements get serialized correctly by innerHTML
  1162. // This requires a wrapper element in IE
  1163. htmlSerialize: !!div.getElementsByTagName("link").length,
  1164. // Get the style information from getAttribute
  1165. // (IE uses .cssText instead)
  1166. style: /top/.test( a.getAttribute("style") ),
  1167. // Make sure that URLs aren't manipulated
  1168. // (IE normalizes it by default)
  1169. hrefNormalized: ( a.getAttribute("href") === "/a" ),
  1170. // Make sure that element opacity exists
  1171. // (IE uses filter instead)
  1172. // Use a regex to work around a WebKit issue. See #5145
  1173. opacity: /^0.55/.test( a.style.opacity ),
  1174. // Verify style float existence
  1175. // (IE uses styleFloat instead of cssFloat)
  1176. cssFloat: !!a.style.cssFloat,
  1177. // Make sure that if no value is specified for a checkbox
  1178. // that it defaults to "on".
  1179. // (WebKit defaults to "" instead)
  1180. checkOn: ( input.value === "on" ),
  1181. // Make sure that a selected-by-default option has a working selected property.
  1182. // (WebKit defaults to false instead of true, IE too, if it's in an optgroup)
  1183. optSelected: opt.selected,
  1184. // Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7)
  1185. getSetAttribute: div.className !== "t",
  1186. // Tests for enctype support on a form(#6743)
  1187. enctype: !!document.createElement("form").enctype,
  1188. // Makes sure cloning an html5 element does not cause problems
  1189. // Where outerHTML is undefined, this still works
  1190. html5Clone: document.createElement("nav").cloneNode( true ).outerHTML !== "<:nav></:nav>",
  1191. // Will be defined later
  1192. submitBubbles: true,
  1193. changeBubbles: true,
  1194. focusinBubbles: false,
  1195. deleteExpando: true,
  1196. noCloneEvent: true,
  1197. inlineBlockNeedsLayout: false,
  1198. shrinkWrapBlocks: false,
  1199. reliableMarginRight: true
  1200. };
  1201. // Make sure checked status is properly cloned
  1202. input.checked = true;
  1203. support.noCloneChecked = input.cloneNode( true ).checked;
  1204. // Make sure that the options inside disabled selects aren't marked as disabled
  1205. // (WebKit marks them as disabled)
  1206. select.disabled = true;
  1207. support.optDisabled = !opt.disabled;
  1208. // Test to see if it's possible to delete an expando from an element
  1209. // Fails in Internet Explorer
  1210. try {
  1211. delete div.test;
  1212. } catch( e ) {
  1213. support.deleteExpando = false;
  1214. }
  1215. if ( !div.addEventListener && div.attachEvent && div.fireEvent ) {
  1216. div.attachEvent( "onclick", function() {
  1217. // Cloning a node shouldn't copy over any
  1218. // bound event handlers (IE does this)
  1219. support.noCloneEvent = false;
  1220. });
  1221. div.cloneNode( true ).fireEvent( "onclick" );
  1222. }
  1223. // Check if a radio maintains its value
  1224. // after being appended to the DOM
  1225. input = document.createElement("input");
  1226. input.value = "t";
  1227. input.setAttribute("type", "radio");
  1228. support.radioValue = input.value === "t";
  1229. input.setAttribute("checked", "checked");
  1230. div.appendChild( input );
  1231. fragment = document.createDocumentFragment();
  1232. fragment.appendChild( div.lastChild );
  1233. // WebKit doesn't clone checked state correctly in fragments
  1234. support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked;
  1235. // Check if a disconnected checkbox will retain its checked
  1236. // value of true after appended to the DOM (IE6/7)
  1237. support.appendChecked = input.checked;
  1238. fragment.removeChild( input );
  1239. fragment.appendChild( div );
  1240. div.innerHTML = "";
  1241. // Check if div with explicit width and no margin-right incorrectly
  1242. // gets computed margin-right based on width of container. For more
  1243. // info see bug #3333
  1244. // Fails in WebKit before Feb 2011 nightlies
  1245. // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
  1246. if ( window.getComputedStyle ) {
  1247. marginDiv = document.createElement( "div" );
  1248. marginDiv.style.width = "0";
  1249. marginDiv.style.marginRight = "0";
  1250. div.style.width = "2px";
  1251. div.appendChild( marginDiv );
  1252. support.reliableMarginRight =
  1253. ( parseInt( ( window.getComputedStyle( marginDiv, null ) || { marginRight: 0 } ).marginRight, 10 ) || 0 ) === 0;
  1254. }
  1255. // Technique from Juriy Zaytsev
  1256. // http://perfectionkills.com/detecting-event-support-without-browser-sniffing/
  1257. // We only care about the case where non-standard event systems
  1258. // are used, namely in IE. Short-circuiting here helps us to
  1259. // avoid an eval call (in setAttribute) which can cause CSP
  1260. // to go haywire. See: https://developer.mozilla.org/en/Security/CSP
  1261. if ( div.attachEvent ) {
  1262. for( i in {
  1263. submit: 1,
  1264. change: 1,
  1265. focusin: 1
  1266. }) {
  1267. eventName = "on" + i;
  1268. isSupported = ( eventName in div );
  1269. if ( !isSupported ) {
  1270. div.setAttribute( eventName, "return;" );
  1271. isSupported = ( typeof div[ eventName ] === "function" );
  1272. }
  1273. support[ i + "Bubbles" ] = isSupported;
  1274. }
  1275. }
  1276. fragment.removeChild( div );
  1277. // Null elements to avoid leaks in IE
  1278. fragment = select = opt = marginDiv = div = input = null;
  1279. // Run tests that need a body at doc ready
  1280. jQuery(function() {
  1281. var container, outer, inner, table, td, offsetSupport,
  1282. conMarginTop, ptlm, vb, style, html,
  1283. body = document.getElementsByTagName("body")[0];
  1284. if ( !body ) {
  1285. // Return for frameset docs that don't have a body
  1286. return;
  1287. }
  1288. conMarginTop = 1;
  1289. ptlm = "position:absolute;top:0;left:0;width:1px;height:1px;margin:0;";
  1290. vb = "visibility:hidden;border:0;";
  1291. style = "style='" + ptlm + "border:5px solid #000;padding:0;'";
  1292. html = "<div " + style + "><div></div></div>" +
  1293. "<table " + style + " cellpadding='0' cellspacing='0'>" +
  1294. "<tr><td></td></tr></table>";
  1295. container = document.createElement("div");
  1296. container.style.cssText = vb + "width:0;height:0;position:static;top:0;margin-top:" + conMarginTop + "px";
  1297. body.insertBefore( container, body.firstChild );
  1298. // Construct the test element
  1299. div = document.createElement("div");
  1300. container.appendChild( div );
  1301. // Check if table cells still have offsetWidth/Height when they are set
  1302. // to display:none and there are still other visible table cells in a
  1303. // table row; if so, offsetWidth/Height are not reliable for use when
  1304. // determining if an element has been hidden directly using
  1305. // display:none (it is still safe to use offsets if a parent element is
  1306. // hidden; don safety goggles and see bug #4512 for more information).
  1307. // (only IE 8 fails this test)
  1308. div.innerHTML = "<table><tr><td style='padding:0;border:0;display:none'></td><td>t</td></tr></table>";
  1309. tds = div.getElementsByTagName( "td" );
  1310. isSupported = ( tds[ 0 ].offsetHeight === 0 );
  1311. tds[ 0 ].style.display = "";
  1312. tds[ 1 ].style.display = "none";
  1313. // Check if empty table cells still have offsetWidth/Height
  1314. // (IE <= 8 fail this test)
  1315. support.reliableHiddenOffsets = isSupported && ( tds[ 0 ].offsetHeight === 0 );
  1316. // Figure out if the W3C box model works as expected
  1317. div.innerHTML = "";
  1318. div.style.width = div.style.paddingLeft = "1px";
  1319. jQuery.boxModel = support.boxModel = div.offsetWidth === 2;
  1320. if ( typeof div.style.zoom !== "undefined" ) {
  1321. // Check if natively block-level elements act like inline-block
  1322. // elements when setting their display to 'inline' and giving
  1323. // them layout
  1324. // (IE < 8 does this)
  1325. div.style.display = "inline";
  1326. div.style.zoom = 1;
  1327. support.inlineBlockNeedsLayout = ( div.offsetWidth === 2 );
  1328. // Check if elements with layout shrink-wrap their children
  1329. // (IE 6 does this)
  1330. div.style.display = "";
  1331. div.innerHTML = "<div style='width:4px;'></div>";
  1332. support.shrinkWrapBlocks = ( div.offsetWidth !== 2 );
  1333. }
  1334. div.style.cssText = ptlm + vb;
  1335. div.innerHTML = html;
  1336. outer = div.firstChild;
  1337. inner = outer.firstChild;
  1338. td = outer.nextSibling.firstChild.firstChild;
  1339. offsetSupport = {
  1340. doesNotAddBorder: ( inner.offsetTop !== 5 ),
  1341. doesAddBorderForTableAndCells: ( td.offsetTop === 5 )
  1342. };
  1343. inner.style.position = "fixed";
  1344. inner.style.top = "20px";
  1345. // safari subtracts parent border width here which is 5px
  1346. offsetSupport.fixedPosition = ( inner.offsetTop === 20 || inner.offsetTop === 15 );
  1347. inner.style.position = inner.style.top = "";
  1348. outer.style.overflow = "hidden";
  1349. outer.style.position = "relative";
  1350. offsetSupport.subtractsBorderForOverflowNotVisible = ( inner.offsetTop === -5 );
  1351. offsetSupport.doesNotIncludeMarginInBodyOffset = ( body.offsetTop !== conMarginTop );
  1352. body.removeChild( container );
  1353. div = container = null;
  1354. jQuery.extend( support, offsetSupport );
  1355. });
  1356. return support;
  1357. })();
  1358. var rbrace = /^(?:\{.*\}|\[.*\])$/,
  1359. rmultiDash = /([A-Z])/g;
  1360. jQuery.extend({
  1361. cache: {},
  1362. // Please use with caution
  1363. uuid: 0,
  1364. // Unique for each copy of jQuery on the page
  1365. // Non-digits removed to match rinlinejQuery
  1366. expando: "jQuery" + ( jQuery.fn.jquery + Math.random() ).replace( /\D/g, "" ),
  1367. // The following elements throw uncatchable exceptions if you
  1368. // attempt to add expando properties to them.
  1369. noData: {
  1370. "embed": true,
  1371. // Ban all objects except for Flash (which handle expandos)
  1372. "object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",
  1373. "applet": true
  1374. },
  1375. hasData: function( elem ) {
  1376. elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ];
  1377. return !!elem && !isEmptyDataObject( elem );
  1378. },
  1379. data: function( elem, name, data, pvt /* Internal Use Only */ ) {
  1380. if ( !jQuery.acceptData( elem ) ) {
  1381. return;
  1382. }
  1383. var privateCache, thisCache, ret,
  1384. internalKey = jQuery.expando,
  1385. getByName = typeof name === "string",
  1386. // We have to handle DOM nodes and JS objects differently because IE6-7
  1387. // can't GC object references properly across the DOM-JS boundary
  1388. isNode = elem.nodeType,
  1389. // Only DOM nodes need the global jQuery cache; JS object data is
  1390. // attached directly to the object so GC can occur automatically
  1391. cache = isNode ? jQuery.cache : elem,
  1392. // Only defining an ID for JS objects if its cache already exists allows
  1393. // the code to shortcut on the same path as a DOM node with no cache
  1394. id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey,
  1395. isEvents = name === "events";
  1396. // Avoid doing any more work than we need to when trying to get data on an
  1397. // object that has no data at all
  1398. if ( (!id || !cache[id] || (!isEvents && !pvt && !cache[id].data)) && getByName && data === undefined ) {
  1399. return;
  1400. }
  1401. if ( !id ) {
  1402. // Only DOM nodes need a new unique ID for each element since their data
  1403. // ends up in the global cache
  1404. if ( isNode ) {
  1405. elem[ internalKey ] = id = ++jQuery.uuid;
  1406. } else {
  1407. id = internalKey;
  1408. }
  1409. }
  1410. if ( !cache[ id ] ) {
  1411. cache[ id ] = {};
  1412. // Avoids exposing jQuery metadata on plain JS objects when the object
  1413. // is serialized using JSON.stringify
  1414. if ( !isNode ) {
  1415. cache[ id ].toJSON = jQuery.noop;
  1416. }
  1417. }
  1418. // An object can be passed to jQuery.data instead of a key/value pair; this gets
  1419. // shallow copied over onto the existing cache
  1420. if ( typeof name === "object" || typeof name === "function" ) {
  1421. if ( pvt ) {
  1422. cache[ id ] = jQuery.extend( cache[ id ], name );
  1423. } else {
  1424. cache[ id ].data = jQuery.extend( cache[ id ].data, name );
  1425. }
  1426. }
  1427. privateCache = thisCache = cache[ id ];
  1428. // jQuery data() is stored in a separate object inside the object's internal data
  1429. // cache in order to avoid key collisions between internal data and user-defined
  1430. // data.
  1431. if ( !pvt ) {
  1432. if ( !thisCache.data ) {
  1433. thisCache.data = {};
  1434. }
  1435. thisCache = thisCache.data;
  1436. }
  1437. if ( data !== undefined ) {
  1438. thisCache[ jQuery.camelCase( name ) ] = data;
  1439. }
  1440. // Users should not attempt to inspect the internal events object using jQuery.data,
  1441. // it is undocumented and subject to change. But does anyone listen? No.
  1442. if ( isEvents && !thisCache[ name ] ) {
  1443. return privateCache.events;
  1444. }
  1445. // Check for both converted-to-camel and non-converted data property names
  1446. // If a data property was specified
  1447. if ( getByName ) {
  1448. // First Try to find as-is property data
  1449. ret = thisCache[ name ];
  1450. // Test for null|undefined property data
  1451. if ( ret == null ) {
  1452. // Try to find the camelCased property
  1453. ret = thisCache[ jQuery.camelCase( name ) ];
  1454. }
  1455. } else {
  1456. ret = thisCache;
  1457. }
  1458. return ret;
  1459. },
  1460. removeData: function( elem, name, pvt /* Internal Use Only */ ) {
  1461. if ( !jQuery.acceptData( elem ) ) {
  1462. return;
  1463. }
  1464. var thisCache, i, l,
  1465. // Reference to internal data cache key
  1466. internalKey = jQuery.expando,
  1467. isNode = elem.nodeType,
  1468. // See jQuery.data for more information
  1469. cache = isNode ? jQuery.cache : elem,
  1470. // See jQuery.data for more information
  1471. id = isNode ? elem[ internalKey ] : internalKey;
  1472. // If there is already no cache entry for this object, there is no
  1473. // purpose in continuing
  1474. if ( !cache[ id ] ) {
  1475. return;
  1476. }
  1477. if ( name ) {
  1478. thisCache = pvt ? cache[ id ] : cache[ id ].data;
  1479. if ( thisCache ) {
  1480. // Support array or space separated string names for data keys
  1481. if ( !jQuery.isArray( name ) ) {
  1482. // try the string as a key before any manipulation
  1483. if ( name in thisCache ) {
  1484. name = [ name ];
  1485. } else {
  1486. // split the camel cased version by spaces unless a key with the spaces exists
  1487. name = jQuery.camelCase( name );
  1488. if ( name in thisCache ) {
  1489. name = [ name ];
  1490. } else {
  1491. name = name.split( " " );
  1492. }
  1493. }
  1494. }
  1495. for ( i = 0, l = name.length; i < l; i++ ) {
  1496. delete thisCache[ name[i] ];
  1497. }
  1498. // If there is no data left in the cache, we want to continue
  1499. // and let the cache object itself get destroyed
  1500. if ( !( pvt ? isEmptyDataObject : jQuery.isEmptyObject )( thisCache ) ) {
  1501. return;
  1502. }
  1503. }
  1504. }
  1505. // See jQuery.data for more information
  1506. if ( !pvt ) {
  1507. delete cache[ id ].data;
  1508. // Don't destroy the parent cache unless the internal data object
  1509. // had been the only thing left in it
  1510. if ( !isEmptyDataObject(cache[ id ]) ) {
  1511. return;
  1512. }
  1513. }
  1514. // Browsers that fail expando deletion also refuse to delete expandos on
  1515. // the window, but it will allow it on all other JS objects; other browsers
  1516. // don't care
  1517. // Ensure that `cache` is not a window object #10080
  1518. if ( jQuery.support.deleteExpando || !cache.setInterval ) {
  1519. delete cache[ id ];
  1520. } else {
  1521. cache[ id ] = null;
  1522. }
  1523. // We destroyed the cache and need to eliminate the expando on the node to avoid
  1524. // false lookups in the cache for entries that no longer exist
  1525. if ( isNode ) {
  1526. // IE does not allow us to delete expando properties from nodes,
  1527. // nor does it have a removeAttribute function on Document nodes;
  1528. // we must handle all of these cases
  1529. if ( jQuery.support.deleteExpando ) {
  1530. delete elem[ internalKey ];
  1531. } else if ( elem.removeAttribute ) {
  1532. elem.removeAttribute( internalKey );
  1533. } else {
  1534. elem[ internalKey ] = null;
  1535. }
  1536. }
  1537. },
  1538. // For internal use only.
  1539. _data: function( elem, name, data ) {
  1540. return jQuery.data( elem, name, data, true );
  1541. },
  1542. // A method for determining if a DOM node can handle the data expando
  1543. acceptData: function( elem ) {
  1544. if ( elem.nodeName ) {
  1545. var match = jQuery.noData[ elem.nodeName.toLowerCase() ];
  1546. if ( match ) {
  1547. return !(match === true || elem.getAttribute("classid") !== match);
  1548. }
  1549. }
  1550. return true;
  1551. }
  1552. });
  1553. jQuery.fn.extend({
  1554. data: function( key, value ) {
  1555. var parts, attr, name,
  1556. data = null;
  1557. if ( typeof key === "undefined" ) {
  1558. if ( this.length ) {
  1559. data = jQuery.data( this[0] );
  1560. if ( this[0].nodeType === 1 && !jQuery._data( this[0], "parsedAttrs" ) ) {
  1561. attr = this[0].attributes;
  1562. for ( var i = 0, l = attr.length; i < l; i++ ) {
  1563. name = attr[i].name;
  1564. if ( name.indexOf( "data-" ) === 0 ) {
  1565. name = jQuery.camelCase( name.substring(5) );
  1566. dataAttr( this[0], name, data[ name ] );
  1567. }
  1568. }
  1569. jQuery._data( this[0], "parsedAttrs", true );
  1570. }
  1571. }
  1572. return data;
  1573. } else if ( typeof key === "object" ) {
  1574. return this.each(function() {
  1575. jQuery.data( this, key );
  1576. });
  1577. }
  1578. parts = key.split(".");
  1579. parts[1] = parts[1] ? "." + parts[1] : "";
  1580. if ( value === undefined ) {
  1581. data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]);
  1582. // Try to fetch any internally stored data first
  1583. if ( data === undefined && this.length ) {
  1584. data = jQuery.data( this[0], key );
  1585. data = dataAttr( this[0], key, data );
  1586. }
  1587. return data === undefined && parts[1] ?
  1588. this.data( parts[0] ) :
  1589. data;
  1590. } else {
  1591. return this.each(function() {
  1592. var self = jQuery( this ),
  1593. args = [ parts[0], value ];
  1594. self.triggerHandler( "setData" + parts[1] + "!", args );
  1595. jQuery.data( this, key, value );
  1596. self.triggerHandler( "changeData" + parts[1] + "!", args );
  1597. });
  1598. }
  1599. },
  1600. removeData: function( key ) {
  1601. return this.each(function() {
  1602. jQuery.removeData( this, key );
  1603. });
  1604. }
  1605. });
  1606. function dataAttr( elem, key, data ) {
  1607. // If nothing was found internally, try to fetch any
  1608. // data from the HTML5 data-* attribute
  1609. if ( data === undefined && elem.nodeType === 1 ) {
  1610. var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase();
  1611. data = elem.getAttribute( name );
  1612. if ( typeof data === "string" ) {
  1613. try {
  1614. data = data === "true" ? true :
  1615. data === "false" ? false :
  1616. data === "null" ? null :
  1617. jQuery.isNumeric( data ) ? parseFloat( data ) :
  1618. rbrace.test( data ) ? jQuery.parseJSON( data ) :
  1619. data;
  1620. } catch( e ) {}
  1621. // Make sure we set the data so it isn't changed later
  1622. jQuery.data( elem, key, data );
  1623. } else {
  1624. data = undefined;
  1625. }
  1626. }
  1627. return data;
  1628. }
  1629. // checks a cache object for emptiness
  1630. function isEmptyDataObject( obj ) {
  1631. for ( var name in obj ) {
  1632. // if the public data object is empty, the private is still empty
  1633. if ( name === "data" && jQuery.isEmptyObject( obj[name] ) ) {
  1634. continue;
  1635. }
  1636. if ( name !== "toJSON" ) {
  1637. return false;
  1638. }
  1639. }
  1640. return true;
  1641. }
  1642. function handleQueueMarkDefer( elem, type, src ) {
  1643. var deferDataKey = type + "defer",
  1644. queueDataKey = type + "queue",
  1645. markDataKey = type + "mark",
  1646. defer = jQuery._data( elem, deferDataKey );
  1647. if ( defer &&
  1648. ( src === "queue" || !jQuery._data(elem, queueDataKey) ) &&
  1649. ( src === "mark" || !jQuery._data(elem, markDataKey) ) ) {
  1650. // Give room for hard-coded callbacks to fire first
  1651. // and eventually mark/queue something else on the element
  1652. setTimeout( function() {
  1653. if ( !jQuery._data( elem, queueDataKey ) &&
  1654. !jQuery._data( elem, markDataKey ) ) {
  1655. jQuery.removeData( elem, deferDataKey, true );
  1656. defer.fire();
  1657. }
  1658. }, 0 );
  1659. }
  1660. }
  1661. jQuery.extend({
  1662. _mark: function( elem, type ) {
  1663. if ( elem ) {
  1664. type = ( type || "fx" ) + "mark";
  1665. jQuery._data( elem, type, (jQuery._data( elem, type ) || 0) + 1 );
  1666. }
  1667. },
  1668. _unmark: function( force, elem, type ) {
  1669. if ( force !== true ) {
  1670. type = elem;
  1671. elem = force;
  1672. force = false;
  1673. }
  1674. if ( elem ) {
  1675. type = type || "fx";
  1676. var key = type + "mark",
  1677. count = force ? 0 : ( (jQuery._data( elem, key ) || 1) - 1 );
  1678. if ( count ) {
  1679. jQuery._data( elem, key, count );
  1680. } else {
  1681. jQuery.removeData( elem, key, true );
  1682. handleQueueMarkDefer( elem, type, "mark" );
  1683. }
  1684. }
  1685. },
  1686. queue: function( elem, type, data ) {
  1687. var q;
  1688. if ( elem ) {
  1689. type = ( type || "fx" ) + "queue";
  1690. q = jQuery._data( elem, type );
  1691. // Speed up dequeue by getting out quickly if this is just a lookup
  1692. if ( data ) {
  1693. if ( !q || jQuery.isArray(data) ) {
  1694. q = jQuery._data( elem, type, jQuery.makeArray(data) );
  1695. } else {
  1696. q.push( data );
  1697. }
  1698. }
  1699. return q || [];
  1700. }
  1701. },
  1702. dequeue: function( elem, type ) {
  1703. type = type || "fx";
  1704. var queue = jQuery.queue( elem, type ),
  1705. fn = queue.shift(),
  1706. hooks = {};
  1707. // If the fx queue is dequeued, always remove the progress sentinel
  1708. if ( fn === "inprogress" ) {
  1709. fn = queue.shift();
  1710. }
  1711. if ( fn ) {
  1712. // Add a progress sentinel to prevent the fx queue from being
  1713. // automatically dequeued
  1714. if ( type === "fx" ) {
  1715. queue.unshift( "inprogress" );
  1716. }
  1717. jQuery._data( elem, type + ".run", hooks );
  1718. fn.call( elem, function() {
  1719. jQuery.dequeue( elem, type );
  1720. }, hooks );
  1721. }
  1722. if ( !queue.length ) {
  1723. jQuery.removeData( elem, type + "queue " + type + ".run", true );
  1724. handleQueueMarkDefer( elem, type, "queue" );
  1725. }
  1726. }
  1727. });
  1728. jQuery.fn.extend({
  1729. queue: function( type, data ) {
  1730. if ( typeof type !== "string" ) {
  1731. data = type;
  1732. type = "fx";
  1733. }
  1734. if ( data === undefined ) {
  1735. return jQuery.queue( this[0], type );
  1736. }
  1737. return this.each(function() {
  1738. var queue = jQuery.queue( this, type, data );
  1739. if ( type === "fx" && queue[0] !== "inprogress" ) {
  1740. jQuery.dequeue( this, type );
  1741. }
  1742. });
  1743. },
  1744. dequeue: function( type ) {
  1745. return this.each(function() {
  1746. jQuery.dequeue( this, type );
  1747. });
  1748. },
  1749. // Based off of the plugin by Clint Helfers, with permission.
  1750. // http://blindsignals.com/index.php/2009/07/jquery-delay/
  1751. delay: function( time, type ) {
  1752. time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;
  1753. type = type || "fx";
  1754. return this.queue( type, function( next, hooks ) {
  1755. var timeout = setTimeout( next, time );
  1756. hooks.stop = function() {
  1757. clearTimeout( timeout );
  1758. };
  1759. });
  1760. },
  1761. clearQueue: function( type ) {
  1762. return this.queue( type || "fx", [] );
  1763. },
  1764. // Get a promise resolved when queues of a certain type
  1765. // are emptied (fx is the type by default)
  1766. promise: function( type, object ) {
  1767. if ( typeof type !== "string" ) {
  1768. object = type;
  1769. type = undefined;
  1770. }
  1771. type = type || "fx";
  1772. var defer = jQuery.Deferred(),
  1773. elements = this,
  1774. i = elements.length,
  1775. count = 1,
  1776. deferDataKey = type + "defer",
  1777. queueDataKey = type + "queue",
  1778. markDataKey = type + "mark",
  1779. tmp;
  1780. function resolve() {
  1781. if ( !( --count ) ) {
  1782. defer.resolveWith( elements, [ elements ] );
  1783. }
  1784. }
  1785. while( i-- ) {
  1786. if (( tmp = jQuery.data( elements[ i ], deferDataKey, undefined, true ) ||
  1787. ( jQuery.data( elements[ i ], queueDataKey, undefined, true ) ||
  1788. jQuery.data( elements[ i ], markDataKey, undefined, true ) ) &&
  1789. jQuery.data( elements[ i ], deferDataKey, jQuery.Callbacks( "once memory" ), true ) )) {
  1790. count++;
  1791. tmp.add( resolve );
  1792. }
  1793. }
  1794. resolve();
  1795. return defer.promise();
  1796. }
  1797. });
  1798. var rclass = /[\n\t\r]/g,
  1799. rspace = /\s+/,
  1800. rreturn = /\r/g,
  1801. rtype = /^(?:button|input)$/i,
  1802. rfocusable = /^(?:button|input|object|select|textarea)$/i,
  1803. rclickable = /^a(?:rea)?$/i,
  1804. rboolean = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,
  1805. getSetAttribute = jQuery.support.getSetAttribute,
  1806. nodeHook, boolHook, fixSpecified;
  1807. jQuery.fn.extend({
  1808. attr: function( name, value ) {
  1809. return jQuery.access( this, name, value, true, jQuery.attr );
  1810. },
  1811. removeAttr: function( name ) {
  1812. return this.each(function() {
  1813. jQuery.removeAttr( this, name );
  1814. });
  1815. },
  1816. prop: function( name, value ) {
  1817. return jQuery.access( this, name, value, true, jQuery.prop );
  1818. },
  1819. removeProp: function( name ) {
  1820. name = jQuery.propFix[ name ] || name;
  1821. return this.each(function() {
  1822. // try/catch handles cases where IE balks (such as removing a property on window)
  1823. try {
  1824. this[ name ] = undefined;
  1825. delete this[ name ];
  1826. } catch( e ) {}
  1827. });
  1828. },
  1829. addClass: function( value ) {
  1830. var classNames, i, l, elem,
  1831. setClass, c, cl;
  1832. if ( jQuery.isFunction( value ) ) {
  1833. return this.each(function( j ) {
  1834. jQuery( this ).addClass( value.call(this, j, this.className) );
  1835. });
  1836. }
  1837. if ( value && typeof value === "string" ) {
  1838. classNames = value.split( rspace );
  1839. for ( i = 0, l = this.length; i < l; i++ ) {
  1840. elem = this[ i ];
  1841. if ( elem.nodeType === 1 ) {
  1842. if ( !elem.className && classNames.length === 1 ) {
  1843. elem.className = value;
  1844. } else {
  1845. setClass = " " + elem.className + " ";
  1846. for ( c = 0, cl = classNames.length; c < cl; c++ ) {
  1847. if ( !~setClass.indexOf( " " + classNames[ c ] + " " ) ) {
  1848. setClass += classNames[ c ] + " ";
  1849. }
  1850. }
  1851. elem.className = jQuery.trim( setClass );
  1852. }
  1853. }
  1854. }
  1855. }
  1856. return this;
  1857. },
  1858. removeClass: function( value ) {
  1859. var classNames, i, l, elem, className, c, cl;
  1860. if ( jQuery.isFunction( value ) ) {
  1861. return this.each(function( j ) {
  1862. jQuery( this ).removeClass( value.call(this, j, this.className) );
  1863. });
  1864. }
  1865. if ( (value && typeof value === "string") || value === undefined ) {
  1866. classNames = ( value || "" ).split( rspace );
  1867. for ( i = 0, l = this.length; i < l; i++ ) {
  1868. elem = this[ i ];
  1869. if ( elem.nodeType === 1 && elem.className ) {
  1870. if ( value ) {
  1871. className = (" " + elem.className + " ").replace( rclass, " " );
  1872. for ( c = 0, cl = classNames.length; c < cl; c++ ) {
  1873. className = className.replace(" " + classNames[ c ] + " ", " ");
  1874. }
  1875. elem.className = jQuery.trim( className );
  1876. } else {
  1877. elem.className = "";
  1878. }
  1879. }
  1880. }
  1881. }
  1882. return this;
  1883. },
  1884. toggleClass: function( value, stateVal ) {
  1885. var type = typeof value,
  1886. isBool = typeof stateVal === "boolean";
  1887. if ( jQuery.isFunction( value ) ) {
  1888. return this.each(function( i ) {
  1889. jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal );
  1890. });
  1891. }
  1892. return this.each(function() {
  1893. if ( type === "string" ) {
  1894. // toggle individual class names
  1895. var className,
  1896. i = 0,
  1897. self = jQuery( this ),
  1898. state = stateVal,
  1899. classNames = value.split( rspace );
  1900. while ( (className = classNames[ i++ ]) ) {
  1901. // check each className given, space seperated list
  1902. state = isBool ? state : !self.hasClass( className );
  1903. self[ state ? "addClass" : "removeClass" ]( className );
  1904. }
  1905. } else if ( type === "undefined" || type === "boolean" ) {
  1906. if ( this.className ) {
  1907. // store className if set
  1908. jQuery._data( this, "__className__", this.className );
  1909. }
  1910. // toggle whole className
  1911. this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || "";
  1912. }
  1913. });
  1914. },
  1915. hasClass: function( selector ) {
  1916. var className = " " + selector + " ",
  1917. i = 0,
  1918. l = this.length;
  1919. for ( ; i < l; i++ ) {
  1920. if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) > -1 ) {
  1921. return true;
  1922. }
  1923. }
  1924. return false;
  1925. },
  1926. val: function( value ) {
  1927. var hooks, ret, isFunction,
  1928. elem = this[0];
  1929. if ( !arguments.length ) {
  1930. if ( elem ) {
  1931. hooks = jQuery.valHooks[ elem.nodeName.toLowerCase() ] || jQuery.valHooks[ elem.type ];
  1932. if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) {
  1933. return ret;
  1934. }
  1935. ret = elem.value;
  1936. return typeof ret === "string" ?
  1937. // handle most common string cases
  1938. ret.replace(rreturn, "") :
  1939. // handle cases where value is null/undef or number
  1940. ret == null ? "" : ret;
  1941. }
  1942. return;
  1943. }
  1944. isFunction = jQuery.isFunction( value );
  1945. return this.each(function( i ) {
  1946. var self = jQuery(this), val;
  1947. if ( this.nodeType !== 1 ) {
  1948. return;
  1949. }
  1950. if ( isFunction ) {
  1951. val = value.call( this, i, self.val() );
  1952. } else {
  1953. val = value;
  1954. }
  1955. // Treat null/undefined as ""; convert numbers to string
  1956. if ( val == null ) {
  1957. val = "";
  1958. } else if ( typeof val === "number" ) {
  1959. val += "";
  1960. } else if ( jQuery.isArray( val ) ) {
  1961. val = jQuery.map(val, function ( value ) {
  1962. return value == null ? "" : value + "";
  1963. });
  1964. }
  1965. hooks = jQuery.valHooks[ this.nodeName.toLowerCase() ] || jQuery.valHooks[ this.type ];
  1966. // If set returns undefined, fall back to normal setting
  1967. if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) {
  1968. this.value = val;
  1969. }
  1970. });
  1971. }
  1972. });
  1973. jQuery.extend({
  1974. valHooks: {
  1975. option: {
  1976. get: function( elem ) {
  1977. // attributes.value is undefined in Blackberry 4.7 but
  1978. // uses .value. See #6932
  1979. var val = elem.attributes.value;
  1980. return !val || val.specified ? elem.value : elem.text;
  1981. }
  1982. },
  1983. select: {
  1984. get: function( elem ) {
  1985. var value, i, max, option,
  1986. index = elem.selectedIndex,
  1987. values = [],
  1988. options = elem.options,
  1989. one = elem.type === "select-one";
  1990. // Nothing was selected
  1991. if ( index < 0 ) {
  1992. return null;
  1993. }
  1994. // Loop through all the selected options
  1995. i = one ? index : 0;
  1996. max = one ? index + 1 : options.length;
  1997. for ( ; i < max; i++ ) {
  1998. option = options[ i ];
  1999. // Don't return options that are disabled or in a disabled optgroup
  2000. if ( option.selected && (jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null) &&
  2001. (!option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" )) ) {
  2002. // Get the specific value for the option
  2003. value = jQuery( option ).val();
  2004. // We don't need an array for one selects
  2005. if ( one ) {
  2006. return value;
  2007. }
  2008. // Multi-Selects return an array
  2009. values.push( value );
  2010. }
  2011. }
  2012. // Fixes Bug #2551 -- select.val() broken in IE after form.reset()
  2013. if ( one && !values.length && options.length ) {
  2014. return jQuery( options[ index ] ).val();
  2015. }
  2016. return values;
  2017. },
  2018. set: function( elem, value ) {
  2019. var values = jQuery.makeArray( value );
  2020. jQuery(elem).find("option").each(function() {
  2021. this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0;
  2022. });
  2023. if ( !values.length ) {
  2024. elem.selectedIndex = -1;
  2025. }
  2026. return values;
  2027. }
  2028. }
  2029. },
  2030. attrFn: {
  2031. val: true,
  2032. css: true,
  2033. html: true,
  2034. text: true,
  2035. data: true,
  2036. width: true,
  2037. height: true,
  2038. offset: true
  2039. },
  2040. attr: function( elem, name, value, pass ) {
  2041. var ret, hooks, notxml,
  2042. nType = elem.nodeType;
  2043. // don't get/set attributes on text, comment and attribute nodes
  2044. if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
  2045. return;
  2046. }
  2047. if ( pass && name in jQuery.attrFn ) {
  2048. return jQuery( elem )[ name ]( value );
  2049. }
  2050. // Fallback to prop when attributes are not supported
  2051. if ( typeof elem.getAttribute === "undefined" ) {
  2052. return jQuery.prop( elem, name, value );
  2053. }
  2054. notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
  2055. // All attributes are lowercase
  2056. // Grab necessary hook if one is defined
  2057. if ( notxml ) {
  2058. name = name.toLowerCase();
  2059. hooks = jQuery.attrHooks[ name ] || ( rboolean.test( name ) ? boolHook : nodeHook );
  2060. }
  2061. if ( value !== undefined ) {
  2062. if ( value === null ) {
  2063. jQuery.removeAttr( elem, name );
  2064. return;
  2065. } else if ( hooks && "set" in hooks && notxml && (ret = hooks.set( elem, value, name )) !== undefined ) {
  2066. return ret;
  2067. } else {
  2068. elem.setAttribute( name, "" + value );
  2069. return value;
  2070. }
  2071. } else if ( hooks && "get" in hooks && notxml && (ret = hooks.get( elem, name )) !== null ) {
  2072. return ret;
  2073. } else {
  2074. ret = elem.getAttribute( name );
  2075. // Non-existent attributes return null, we normalize to undefined
  2076. return ret === null ?
  2077. undefined :
  2078. ret;
  2079. }
  2080. },
  2081. removeAttr: function( elem, value ) {
  2082. var propName, attrNames, name, l,
  2083. i = 0;
  2084. if ( value && elem.nodeType === 1 ) {
  2085. attrNames = value.toLowerCase().split( rspace );
  2086. l = attrNames.length;
  2087. for ( ; i < l; i++ ) {
  2088. name = attrNames[ i ];
  2089. if ( name ) {
  2090. propName = jQuery.propFix[ name ] || name;
  2091. // See #9699 for explanation of this approach (setting first, then removal)
  2092. jQuery.attr( elem, name, "" );
  2093. elem.removeAttribute( getSetAttribute ? name : propName );
  2094. // Set corresponding property to false for boolean attributes
  2095. if ( rboolean.test( name ) && propName in elem ) {
  2096. elem[ propName ] = false;
  2097. }
  2098. }
  2099. }
  2100. }
  2101. },
  2102. attrHooks: {
  2103. type: {
  2104. set: function( elem, value ) {
  2105. // We can't allow the type property to be changed (since it causes problems in IE)
  2106. if ( rtype.test( elem.nodeName ) && elem.parentNode ) {
  2107. jQuery.error( "type property can't be changed" );
  2108. } else if ( !jQuery.support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) {
  2109. // Setting the type on a radio button after the value resets the value in IE6-9
  2110. // Reset value to it's default in case type is set after value
  2111. // This is for element creation
  2112. var val = elem.value;
  2113. elem.setAttribute( "type", value );
  2114. if ( val ) {
  2115. elem.value = val;
  2116. }
  2117. return value;
  2118. }
  2119. }
  2120. },
  2121. // Use the value property for back compat
  2122. // Use the nodeHook for button elements in IE6/7 (#1954)
  2123. value: {
  2124. get: function( elem, name ) {
  2125. if ( nodeHook && jQuery.nodeName( elem, "button" ) ) {
  2126. return nodeHook.get( elem, name );
  2127. }
  2128. return name in elem ?
  2129. elem.value :
  2130. null;
  2131. },
  2132. set: function( elem, value, name ) {
  2133. if ( nodeHook && jQuery.nodeName( elem, "button" ) ) {
  2134. return nodeHook.set( elem, value, name );
  2135. }
  2136. // Does not return so that setAttribute is also used
  2137. elem.value = value;
  2138. }
  2139. }
  2140. },
  2141. propFix: {
  2142. tabindex: "tabIndex",
  2143. readonly: "readOnly",
  2144. "for": "htmlFor",
  2145. "class": "className",
  2146. maxlength: "maxLength",
  2147. cellspacing: "cellSpacing",
  2148. cellpadding: "cellPadding",
  2149. rowspan: "rowSpan",
  2150. colspan: "colSpan",
  2151. usemap: "useMap",
  2152. frameborder: "frameBorder",
  2153. contenteditable: "contentEditable"
  2154. },
  2155. prop: function( elem, name, value ) {
  2156. var ret, hooks, notxml,
  2157. nType = elem.nodeType;
  2158. // don't get/set properties on text, comment and attribute nodes
  2159. if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
  2160. return;
  2161. }
  2162. notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
  2163. if ( notxml ) {
  2164. // Fix name and attach hooks
  2165. name = jQuery.propFix[ name ] || name;
  2166. hooks = jQuery.propHooks[ name ];
  2167. }
  2168. if ( value !== undefined ) {
  2169. if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) {
  2170. return ret;
  2171. } else {
  2172. return ( elem[ name ] = value );
  2173. }
  2174. } else {
  2175. if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) {
  2176. return ret;
  2177. } else {
  2178. return elem[ name ];
  2179. }
  2180. }
  2181. },
  2182. propHooks: {
  2183. tabIndex: {
  2184. get: function( elem ) {
  2185. // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set
  2186. // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
  2187. var attributeNode = elem.getAttributeNode("tabindex");
  2188. return attributeNode && attributeNode.specified ?
  2189. parseInt( attributeNode.value, 10 ) :
  2190. rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ?
  2191. 0 :
  2192. undefined;
  2193. }
  2194. }
  2195. }
  2196. });
  2197. // Add the tabIndex propHook to attrHooks for back-compat (different case is intentional)
  2198. jQuery.attrHooks.tabindex = jQuery.propHooks.tabIndex;
  2199. // Hook for boolean attributes
  2200. boolHook = {
  2201. get: function( elem, name ) {
  2202. // Align boolean attributes with corresponding properties
  2203. // Fall back to attribute presence where some booleans are not supported
  2204. var attrNode,
  2205. property = jQuery.prop( elem, name );
  2206. return property === true || typeof property !== "boolean" && ( attrNode = elem.getAttributeNode(name) ) && attrNode.nodeValue !== false ?
  2207. name.toLowerCase() :
  2208. undefined;
  2209. },
  2210. set: function( elem, value, name ) {
  2211. var propName;
  2212. if ( value === false ) {
  2213. // Remove boolean attributes when set to false
  2214. jQuery.removeAttr( elem, name );
  2215. } else {
  2216. // value is true since we know at this point it's type boolean and not false
  2217. // Set boolean attributes to the same name and set the DOM property
  2218. propName = jQuery.propFix[ name ] || name;
  2219. if ( propName in elem ) {
  2220. // Only set the IDL specifically if it already exists on the element
  2221. elem[ propName ] = true;
  2222. }
  2223. elem.setAttribute( name, name.toLowerCase() );
  2224. }
  2225. return name;
  2226. }
  2227. };
  2228. // IE6/7 do not support getting/setting some attributes with get/setAttribute
  2229. if ( !getSetAttribute ) {
  2230. fixSpecified = {
  2231. name: true,
  2232. id: true
  2233. };
  2234. // Use this for any attribute in IE6/7
  2235. // This fixes almost every IE6/7 issue
  2236. nodeHook = jQuery.valHooks.button = {
  2237. get: function( elem, name ) {
  2238. var ret;
  2239. ret = elem.getAttributeNode( name );
  2240. return ret && ( fixSpecified[ name ] ? ret.nodeValue !== "" : ret.specified ) ?
  2241. ret.nodeValue :
  2242. undefined;
  2243. },
  2244. set: function( elem, value, name ) {
  2245. // Set the existing or create a new attribute node
  2246. var ret = elem.getAttributeNode( name );
  2247. if ( !ret ) {
  2248. ret = document.createAttribute( name );
  2249. elem.setAttributeNode( ret );
  2250. }
  2251. return ( ret.nodeValue = value + "" );
  2252. }
  2253. };
  2254. // Apply the nodeHook to tabindex
  2255. jQuery.attrHooks.tabindex.set = nodeHook.set;
  2256. // Set width and height to auto instead of 0 on empty string( Bug #8150 )
  2257. // This is for removals
  2258. jQuery.each([ "width", "height" ], function( i, name ) {
  2259. jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], {
  2260. set: function( elem, value ) {
  2261. if ( value === "" ) {
  2262. elem.setAttribute( name, "auto" );
  2263. return value;
  2264. }
  2265. }
  2266. });
  2267. });
  2268. // Set contenteditable to false on removals(#10429)
  2269. // Setting to empty string throws an error as an invalid value
  2270. jQuery.attrHooks.contenteditable = {
  2271. get: nodeHook.get,
  2272. set: function( elem, value, name ) {
  2273. if ( value === "" ) {
  2274. value = "false";
  2275. }
  2276. nodeHook.set( elem, value, name );
  2277. }
  2278. };
  2279. }
  2280. // Some attributes require a special call on IE
  2281. if ( !jQuery.support.hrefNormalized ) {
  2282. jQuery.each([ "href", "src", "width", "height" ], function( i, name ) {
  2283. jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], {
  2284. get: function( elem ) {
  2285. var ret = elem.getAttribute( name, 2 );
  2286. return ret === null ? undefined : ret;
  2287. }
  2288. });
  2289. });
  2290. }
  2291. if ( !jQuery.support.style ) {
  2292. jQuery.attrHooks.style = {
  2293. get: function( elem ) {
  2294. // Return undefined in the case of empty string
  2295. // Normalize to lowercase since IE uppercases css property names
  2296. return elem.style.cssText.toLowerCase() || undefined;
  2297. },
  2298. set: function( elem, value ) {
  2299. return ( elem.style.cssText = "" + value );
  2300. }
  2301. };
  2302. }
  2303. // Safari mis-reports the default selected property of an option
  2304. // Accessing the parent's selectedIndex property fixes it
  2305. if ( !jQuery.support.optSelected ) {
  2306. jQuery.propHooks.selected = jQuery.extend( jQuery.propHooks.selected, {
  2307. get: function( elem ) {
  2308. var parent = elem.parentNode;
  2309. if ( parent ) {
  2310. parent.selectedIndex;
  2311. // Make sure that it also works with optgroups, see #5701
  2312. if ( parent.parentNode ) {
  2313. parent.parentNode.selectedIndex;
  2314. }
  2315. }
  2316. return null;
  2317. }
  2318. });
  2319. }
  2320. // IE6/7 call enctype encoding
  2321. if ( !jQuery.support.enctype ) {
  2322. jQuery.propFix.enctype = "encoding";
  2323. }
  2324. // Radios and checkboxes getter/setter
  2325. if ( !jQuery.support.checkOn ) {
  2326. jQuery.each([ "radio", "checkbox" ], function() {
  2327. jQuery.valHooks[ this ] = {
  2328. get: function( elem ) {
  2329. // Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified
  2330. return elem.getAttribute("value") === null ? "on" : elem.value;
  2331. }
  2332. };
  2333. });
  2334. }
  2335. jQuery.each([ "radio", "checkbox" ], function() {
  2336. jQuery.valHooks[ this ] = jQuery.extend( jQuery.valHooks[ this ], {
  2337. set: function( elem, value ) {
  2338. if ( jQuery.isArray( value ) ) {
  2339. return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 );
  2340. }
  2341. }
  2342. });
  2343. });
  2344. var rformElems = /^(?:textarea|input|select)$/i,
  2345. rtypenamespace = /^([^\.]*)?(?:\.(.+))?$/,
  2346. rhoverHack = /\bhover(\.\S+)?\b/,
  2347. rkeyEvent = /^key/,
  2348. rmouseEvent = /^(?:mouse|contextmenu)|click/,
  2349. rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,
  2350. rquickIs = /^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,
  2351. quickParse = function( selector ) {
  2352. var quick = rquickIs.exec( selector );
  2353. if ( quick ) {
  2354. // 0 1 2 3
  2355. // [ _, tag, id, class ]
  2356. quick[1] = ( quick[1] || "" ).toLowerCase();
  2357. quick[3] = quick[3] && new RegExp( "(?:^|\\s)" + quick[3] + "(?:\\s|$)" );
  2358. }
  2359. return quick;
  2360. },
  2361. quickIs = function( elem, m ) {
  2362. var attrs = elem.attributes || {};
  2363. return (
  2364. (!m[1] || elem.nodeName.toLowerCase() === m[1]) &&
  2365. (!m[2] || (attrs.id || {}).value === m[2]) &&
  2366. (!m[3] || m[3].test( (attrs[ "class" ] || {}).value ))
  2367. );
  2368. },
  2369. hoverHack = function( events ) {
  2370. return jQuery.event.special.hover ? events : events.replace( rhoverHack, "mouseenter$1 mouseleave$1" );
  2371. };
  2372. /*
  2373. * Helper functions for managing events -- not part of the public interface.
  2374. * Props to Dean Edwards' addEvent library for many of the ideas.
  2375. */
  2376. jQuery.event = {
  2377. add: function( elem, types, handler, data, selector ) {
  2378. var elemData, eventHandle, events,
  2379. t, tns, type, namespaces, handleObj,
  2380. handleObjIn, quick, handlers, special;
  2381. // Don't attach events to noData or text/comment nodes (allow plain objects tho)
  2382. if ( elem.nodeType === 3 || elem.nodeType === 8 || !types || !handler || !(elemData = jQuery._data( elem )) ) {
  2383. return;
  2384. }
  2385. // Caller can pass in an object of custom data in lieu of the handler
  2386. if ( handler.handler ) {
  2387. handleObjIn = handler;
  2388. handler = handleObjIn.handler;
  2389. }
  2390. // Make sure that the handler has a unique ID, used to find/remove it later
  2391. if ( !handler.guid ) {
  2392. handler.guid = jQuery.guid++;
  2393. }
  2394. // Init the element's event structure and main handler, if this is the first
  2395. events = elemData.events;
  2396. if ( !events ) {
  2397. elemData.events = events = {};
  2398. }
  2399. eventHandle = elemData.handle;
  2400. if ( !eventHandle ) {
  2401. elemData.handle = eventHandle = function( e ) {
  2402. // Discard the second event of a jQuery.event.trigger() and
  2403. // when an event is called after a page has unloaded
  2404. return typeof jQuery !== "undefined" && (!e || jQuery.event.triggered !== e.type) ?
  2405. jQuery.event.dispatch.apply( eventHandle.elem, arguments ) :
  2406. undefined;
  2407. };
  2408. // Add elem as a property of the handle fn to prevent a memory leak with IE non-native events
  2409. eventHandle.elem = elem;
  2410. }
  2411. // Handle multiple events separated by a space
  2412. // jQuery(...).bind("mouseover mouseout", fn);
  2413. types = jQuery.trim( hoverHack(types) ).split( " " );
  2414. for ( t = 0; t < types.length; t++ ) {
  2415. tns = rtypenamespace.exec( types[t] ) || [];
  2416. type = tns[1];
  2417. namespaces = ( tns[2] || "" ).split( "." ).sort();
  2418. // If event changes its type, use the special event handlers for the changed type
  2419. special = jQuery.event.special[ type ] || {};
  2420. // If selector defined, determine special event api type, otherwise given type
  2421. type = ( selector ? special.delegateType : special.bindType ) || type;
  2422. // Update special based on newly reset type
  2423. special = jQuery.event.special[ type ] || {};
  2424. // handleObj is passed to all event handlers
  2425. handleObj = jQuery.extend({
  2426. type: type,
  2427. origType: tns[1],
  2428. data: data,
  2429. handler: handler,
  2430. guid: handler.guid,
  2431. selector: selector,
  2432. quick: quickParse( selector ),
  2433. namespace: namespaces.join(".")
  2434. }, handleObjIn );
  2435. // Init the event handler queue if we're the first
  2436. handlers = events[ type ];
  2437. if ( !handlers ) {
  2438. handlers = events[ type ] = [];
  2439. handlers.delegateCount = 0;
  2440. // Only use addEventListener/attachEvent if the special events handler returns false
  2441. if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
  2442. // Bind the global event handler to the element
  2443. if ( elem.addEventListener ) {
  2444. elem.addEventListener( type, eventHandle, false );
  2445. } else if ( elem.attachEvent ) {
  2446. elem.attachEvent( "on" + type, eventHandle );
  2447. }
  2448. }
  2449. }
  2450. if ( special.add ) {
  2451. special.add.call( elem, handleObj );
  2452. if ( !handleObj.handler.guid ) {
  2453. handleObj.handler.guid = handler.guid;
  2454. }
  2455. }
  2456. // Add to the element's handler list, delegates in front
  2457. if ( selector ) {
  2458. handlers.splice( handlers.delegateCount++, 0, handleObj );
  2459. } else {
  2460. handlers.push( handleObj );
  2461. }
  2462. // Keep track of which events have ever been used, for event optimization
  2463. jQuery.event.global[ type ] = true;
  2464. }
  2465. // Nullify elem to prevent memory leaks in IE
  2466. elem = null;
  2467. },
  2468. global: {},
  2469. // Detach an event or set of events from an element
  2470. remove: function( elem, types, handler, selector, mappedTypes ) {
  2471. var elemData = jQuery.hasData( elem ) && jQuery._data( elem ),
  2472. t, tns, type, origType, namespaces, origCount,
  2473. j, events, special, handle, eventType, handleObj;
  2474. if ( !elemData || !(events = elemData.events) ) {
  2475. return;
  2476. }
  2477. // Once for each type.namespace in types; type may be omitted
  2478. types = jQuery.trim( hoverHack( types || "" ) ).split(" ");
  2479. for ( t = 0; t < types.length; t++ ) {
  2480. tns = rtypenamespace.exec( types[t] ) || [];
  2481. type = origType = tns[1];
  2482. namespaces = tns[2];
  2483. // Unbind all events (on this namespace, if provided) for the element
  2484. if ( !type ) {
  2485. for ( type in events ) {
  2486. jQuery.event.remove( elem, type + types[ t ], handler, selector, true );
  2487. }
  2488. continue;
  2489. }
  2490. special = jQuery.event.special[ type ] || {};
  2491. type = ( selector? special.delegateType : special.bindType ) || type;
  2492. eventType = events[ type ] || [];
  2493. origCount = eventType.length;
  2494. namespaces = namespaces ? new RegExp("(^|\\.)" + namespaces.split(".").sort().join("\\.(?:.*\\.)?") + "(\\.|$)") : null;
  2495. // Remove matching events
  2496. for ( j = 0; j < eventType.length; j++ ) {
  2497. handleObj = eventType[ j ];
  2498. if ( ( mappedTypes || origType === handleObj.origType ) &&
  2499. ( !handler || handler.guid === handleObj.guid ) &&
  2500. ( !namespaces || namespaces.test( handleObj.namespace ) ) &&
  2501. ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) {
  2502. eventType.splice( j--, 1 );
  2503. if ( handleObj.selector ) {
  2504. eventType.delegateCount--;
  2505. }
  2506. if ( special.remove ) {
  2507. special.remove.call( elem, handleObj );
  2508. }
  2509. }
  2510. }
  2511. // Remove generic event handler if we removed something and no more handlers exist
  2512. // (avoids potential for endless recursion during removal of special event handlers)
  2513. if ( eventType.length === 0 && origCount !== eventType.length ) {
  2514. if ( !special.teardown || special.teardown.call( elem, namespaces ) === false ) {
  2515. jQuery.removeEvent( elem, type, elemData.handle );
  2516. }
  2517. delete events[ type ];
  2518. }
  2519. }
  2520. // Remove the expando if it's no longer used
  2521. if ( jQuery.isEmptyObject( events ) ) {
  2522. handle = elemData.handle;
  2523. if ( handle ) {
  2524. handle.elem = null;
  2525. }
  2526. // removeData also checks for emptiness and clears the expando if empty
  2527. // so use it instead of delete
  2528. jQuery.removeData( elem, [ "events", "handle" ], true );
  2529. }
  2530. },
  2531. // Events that are safe to short-circuit if no handlers are attached.
  2532. // Native DOM events should not be added, they may have inline handlers.
  2533. customEvent: {
  2534. "getData": true,
  2535. "setData": true,
  2536. "changeData": true
  2537. },
  2538. trigger: function( event, data, elem, onlyHandlers ) {
  2539. // Don't do events on text and comment nodes
  2540. if ( elem && (elem.nodeType === 3 || elem.nodeType === 8) ) {
  2541. return;
  2542. }
  2543. // Event object or event type
  2544. var type = event.type || event,
  2545. namespaces = [],
  2546. cache, exclusive, i, cur, old, ontype, special, handle, eventPath, bubbleType;
  2547. // focus/blur morphs to focusin/out; ensure we're not firing them right now
  2548. if ( rfocusMorph.test( type + jQuery.event.triggered ) ) {
  2549. return;
  2550. }
  2551. if ( type.indexOf( "!" ) >= 0 ) {
  2552. // Exclusive events trigger only for the exact event (no namespaces)
  2553. type = type.slice(0, -1);
  2554. exclusive = true;
  2555. }
  2556. if ( type.indexOf( "." ) >= 0 ) {
  2557. // Namespaced trigger; create a regexp to match event type in handle()
  2558. namespaces = type.split(".");
  2559. type = namespaces.shift();
  2560. namespaces.sort();
  2561. }
  2562. if ( (!elem || jQuery.event.customEvent[ type ]) && !jQuery.event.global[ type ] ) {
  2563. // No jQuery handlers for this event type, and it can't have inline handlers
  2564. return;
  2565. }
  2566. // Caller can pass in an Event, Object, or just an event type string
  2567. event = typeof event === "object" ?
  2568. // jQuery.Event object
  2569. event[ jQuery.expando ] ? event :
  2570. // Object literal
  2571. new jQuery.Event( type, event ) :
  2572. // Just the event type (string)
  2573. new jQuery.Event( type );
  2574. event.type = type;
  2575. event.isTrigger = true;
  2576. event.exclusive = exclusive;
  2577. event.namespace = namespaces.join( "." );
  2578. event.namespace_re = event.namespace? new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.)?") + "(\\.|$)") : null;
  2579. ontype = type.indexOf( ":" ) < 0 ? "on" + type : "";
  2580. // Handle a global trigger
  2581. if ( !elem ) {
  2582. // TODO: Stop taunting the data cache; remove global events and always attach to document
  2583. cache = jQuery.cache;
  2584. for ( i in cache ) {
  2585. if ( cache[ i ].events && cache[ i ].events[ type ] ) {
  2586. jQuery.event.trigger( event, data, cache[ i ].handle.elem, true );
  2587. }
  2588. }
  2589. return;
  2590. }
  2591. // Clean up the event in case it is being reused
  2592. event.result = undefined;
  2593. if ( !event.target ) {
  2594. event.target = elem;
  2595. }
  2596. // Clone any incoming data and prepend the event, creating the handler arg list
  2597. data = data != null ? jQuery.makeArray( data ) : [];
  2598. data.unshift( event );
  2599. // Allow special events to draw outside the lines
  2600. special = jQuery.event.special[ type ] || {};
  2601. if ( special.trigger && special.trigger.apply( elem, data ) === false ) {
  2602. return;
  2603. }
  2604. // Determine event propagation path in advance, per W3C events spec (#9951)
  2605. // Bubble up to document, then to window; watch for a global ownerDocument var (#9724)
  2606. eventPath = [[ elem, special.bindType || type ]];
  2607. if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) {
  2608. bubbleType = special.delegateType || type;
  2609. cur = rfocusMorph.test( bubbleType + type ) ? elem : elem.parentNode;
  2610. old = null;
  2611. for ( ; cur; cur = cur.parentNode ) {
  2612. eventPath.push([ cur, bubbleType ]);
  2613. old = cur;
  2614. }
  2615. // Only add window if we got to document (e.g., not plain obj or detached DOM)
  2616. if ( old && old === elem.ownerDocument ) {
  2617. eventPath.push([ old.defaultView || old.parentWindow || window, bubbleType ]);
  2618. }
  2619. }
  2620. // Fire handlers on the event path
  2621. for ( i = 0; i < eventPath.length && !event.isPropagationStopped(); i++ ) {
  2622. cur = eventPath[i][0];
  2623. event.type = eventPath[i][1];
  2624. handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] && jQuery._data( cur, "handle" );
  2625. if ( handle ) {
  2626. handle.apply( cur, data );
  2627. }
  2628. // Note that this is a bare JS function and not a jQuery handler
  2629. handle = ontype && cur[ ontype ];
  2630. if ( handle && jQuery.acceptData( cur ) && handle.apply( cur, data ) === false ) {
  2631. event.preventDefault();
  2632. }
  2633. }
  2634. event.type = type;
  2635. // If nobody prevented the default action, do it now
  2636. if ( !onlyHandlers && !event.isDefaultPrevented() ) {
  2637. if ( (!special._default || special._default.apply( elem.ownerDocument, data ) === false) &&
  2638. !(type === "click" && jQuery.nodeName( elem, "a" )) && jQuery.acceptData( elem ) ) {
  2639. // Call a native DOM method on the target with the same name name as the event.
  2640. // Can't use an .isFunction() check here because IE6/7 fails that test.
  2641. // Don't do default actions on window, that's where global variables be (#6170)
  2642. // IE<9 dies on focus/blur to hidden element (#1486)
  2643. if ( ontype && elem[ type ] && ((type !== "focus" && type !== "blur") || event.target.offsetWidth !== 0) && !jQuery.isWindow( elem ) ) {
  2644. // Don't re-trigger an onFOO event when we call its FOO() method
  2645. old = elem[ ontype ];
  2646. if ( old ) {
  2647. elem[ ontype ] = null;
  2648. }
  2649. // Prevent re-triggering of the same event, since we already bubbled it above
  2650. jQuery.event.triggered = type;
  2651. elem[ type ]();
  2652. jQuery.event.triggered = undefined;
  2653. if ( old ) {
  2654. elem[ ontype ] = old;
  2655. }
  2656. }
  2657. }
  2658. }
  2659. return event.result;
  2660. },
  2661. dispatch: function( event ) {
  2662. // Make a writable jQuery.Event from the native event object
  2663. event = jQuery.event.fix( event || window.event );
  2664. var handlers = ( (jQuery._data( this, "events" ) || {} )[ event.type ] || []),
  2665. delegateCount = handlers.delegateCount,
  2666. args = [].slice.call( arguments, 0 ),
  2667. run_all = !event.exclusive && !event.namespace,
  2668. handlerQueue = [],
  2669. i, j, cur, jqcur, ret, selMatch, matched, matches, handleObj, sel, related;
  2670. // Use the fix-ed jQuery.Event rather than the (read-only) native event
  2671. args[0] = event;
  2672. event.delegateTarget = this;
  2673. // Determine handlers that should run if there are delegated events
  2674. // Avoid disabled elements in IE (#6911) and non-left-click bubbling in Firefox (#3861)
  2675. if ( delegateCount && !event.target.disabled && !(event.button && event.type === "click") ) {
  2676. // Pregenerate a single jQuery object for reuse with .is()
  2677. jqcur = jQuery(this);
  2678. jqcur.context = this.ownerDocument || this;
  2679. for ( cur = event.target; cur != this; cur = cur.parentNode || this ) {
  2680. selMatch = {};
  2681. matches = [];
  2682. jqcur[0] = cur;
  2683. for ( i = 0; i < delegateCount; i++ ) {
  2684. handleObj = handlers[ i ];
  2685. sel = handleObj.selector;
  2686. if ( selMatch[ sel ] === undefined ) {
  2687. selMatch[ sel ] = (
  2688. handleObj.quick ? quickIs( cur, handleObj.quick ) : jqcur.is( sel )
  2689. );
  2690. }
  2691. if ( selMatch[ sel ] ) {
  2692. matches.push( handleObj );
  2693. }
  2694. }
  2695. if ( matches.length ) {
  2696. handlerQueue.push({ elem: cur, matches: matches });
  2697. }
  2698. }
  2699. }
  2700. // Add the remaining (directly-bound) handlers
  2701. if ( handlers.length > delegateCount ) {
  2702. handlerQueue.push({ elem: this, matches: handlers.slice( delegateCount ) });
  2703. }
  2704. // Run delegates first; they may want to stop propagation beneath us
  2705. for ( i = 0; i < handlerQueue.length && !event.isPropagationStopped(); i++ ) {
  2706. matched = handlerQueue[ i ];
  2707. event.currentTarget = matched.elem;
  2708. for ( j = 0; j < matched.matches.length && !event.isImmediatePropagationStopped(); j++ ) {
  2709. handleObj = matched.matches[ j ];
  2710. // Triggered event must either 1) be non-exclusive and have no namespace, or
  2711. // 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace).
  2712. if ( run_all || (!event.namespace && !handleObj.namespace) || event.namespace_re && event.namespace_re.test( handleObj.namespace ) ) {
  2713. event.data = handleObj.data;
  2714. event.handleObj = handleObj;
  2715. ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler )
  2716. .apply( matched.elem, args );
  2717. if ( ret !== undefined ) {
  2718. event.result = ret;
  2719. if ( ret === false ) {
  2720. event.preventDefault();
  2721. event.stopPropagation();
  2722. }
  2723. }
  2724. }
  2725. }
  2726. }
  2727. return event.result;
  2728. },
  2729. // Includes some event props shared by KeyEvent and MouseEvent
  2730. // *** attrChange attrName relatedNode srcElement are not normalized, non-W3C, deprecated, will be removed in 1.8 ***
  2731. props: "attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),
  2732. fixHooks: {},
  2733. keyHooks: {
  2734. props: "char charCode key keyCode".split(" "),
  2735. filter: function( event, original ) {
  2736. // Add which for key events
  2737. if ( event.which == null ) {
  2738. event.which = original.charCode != null ? original.charCode : original.keyCode;
  2739. }
  2740. return event;
  2741. }
  2742. },
  2743. mouseHooks: {
  2744. props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),
  2745. filter: function( event, original ) {
  2746. var eventDoc, doc, body,
  2747. button = original.button,
  2748. fromElement = original.fromElement;
  2749. // Calculate pageX/Y if missing and clientX/Y available
  2750. if ( event.pageX == null && original.clientX != null ) {
  2751. eventDoc = event.target.ownerDocument || document;
  2752. doc = eventDoc.documentElement;
  2753. body = eventDoc.body;
  2754. event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 );
  2755. event.pageY = original.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && body.clientTop || 0 );
  2756. }
  2757. // Add relatedTarget, if necessary
  2758. if ( !event.relatedTarget && fromElement ) {
  2759. event.relatedTarget = fromElement === event.target ? original.toElement : fromElement;
  2760. }
  2761. // Add which for click: 1 === left; 2 === middle; 3 === right
  2762. // Note: button is not normalized, so don't use it
  2763. if ( !event.which && button !== undefined ) {
  2764. event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) );
  2765. }
  2766. return event;
  2767. }
  2768. },
  2769. fix: function( event ) {
  2770. if ( event[ jQuery.expando ] ) {
  2771. return event;
  2772. }
  2773. // Create a writable copy of the event object and normalize some properties
  2774. var i, prop,
  2775. originalEvent = event,
  2776. fixHook = jQuery.event.fixHooks[ event.type ] || {},
  2777. copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props;
  2778. event = jQuery.Event( originalEvent );
  2779. for ( i = copy.length; i; ) {
  2780. prop = copy[ --i ];
  2781. event[ prop ] = originalEvent[ prop ];
  2782. }
  2783. // Fix target property, if necessary (#1925, IE 6/7/8 & Safari2)
  2784. if ( !event.target ) {
  2785. event.target = originalEvent.srcElement || document;
  2786. }
  2787. // Target should not be a text node (#504, Safari)
  2788. if ( event.target.nodeType === 3 ) {
  2789. event.target = event.target.parentNode;
  2790. }
  2791. // For mouse/key events; add metaKey if it's not there (#3368, IE6/7/8)
  2792. if ( event.metaKey === undefined ) {
  2793. event.metaKey = event.ctrlKey;
  2794. }
  2795. return fixHook.filter? fixHook.filter( event, originalEvent ) : event;
  2796. },
  2797. special: {
  2798. ready: {
  2799. // Make sure the ready event is setup
  2800. setup: jQuery.bindReady
  2801. },
  2802. load: {
  2803. // Prevent triggered image.load events from bubbling to window.load
  2804. noBubble: true
  2805. },
  2806. focus: {
  2807. delegateType: "focusin"
  2808. },
  2809. blur: {
  2810. delegateType: "focusout"
  2811. },
  2812. beforeunload: {
  2813. setup: function( data, namespaces, eventHandle ) {
  2814. // We only want to do this special case on windows
  2815. if ( jQuery.isWindow( this ) ) {
  2816. this.onbeforeunload = eventHandle;
  2817. }
  2818. },
  2819. teardown: function( namespaces, eventHandle ) {
  2820. if ( this.onbeforeunload === eventHandle ) {
  2821. this.onbeforeunload = null;
  2822. }
  2823. }
  2824. }
  2825. },
  2826. simulate: function( type, elem, event, bubble ) {
  2827. // Piggyback on a donor event to simulate a different one.
  2828. // Fake originalEvent to avoid donor's stopPropagation, but if the
  2829. // simulated event prevents default then we do the same on the donor.
  2830. var e = jQuery.extend(
  2831. new jQuery.Event(),
  2832. event,
  2833. { type: type,
  2834. isSimulated: true,
  2835. originalEvent: {}
  2836. }
  2837. );
  2838. if ( bubble ) {
  2839. jQuery.event.trigger( e, null, elem );
  2840. } else {
  2841. jQuery.event.dispatch.call( elem, e );
  2842. }
  2843. if ( e.isDefaultPrevented() ) {
  2844. event.preventDefault();
  2845. }
  2846. }
  2847. };
  2848. // Some plugins are using, but it's undocumented/deprecated and will be removed.
  2849. // The 1.7 special event interface should provide all the hooks needed now.
  2850. jQuery.event.handle = jQuery.event.dispatch;
  2851. jQuery.removeEvent = document.removeEventListener ?
  2852. function( elem, type, handle ) {
  2853. if ( elem.removeEventListener ) {
  2854. elem.removeEventListener( type, handle, false );
  2855. }
  2856. } :
  2857. function( elem, type, handle ) {
  2858. if ( elem.detachEvent ) {
  2859. elem.detachEvent( "on" + type, handle );
  2860. }
  2861. };
  2862. jQuery.Event = function( src, props ) {
  2863. // Allow instantiation without the 'new' keyword
  2864. if ( !(this instanceof jQuery.Event) ) {
  2865. return new jQuery.Event( src, props );
  2866. }
  2867. // Event object
  2868. if ( src && src.type ) {
  2869. this.originalEvent = src;
  2870. this.type = src.type;
  2871. // Events bubbling up the document may have been marked as prevented
  2872. // by a handler lower down the tree; reflect the correct value.
  2873. this.isDefaultPrevented = ( src.defaultPrevented || src.returnValue === false ||
  2874. src.getPreventDefault && src.getPreventDefault() ) ? returnTrue : returnFalse;
  2875. // Event type
  2876. } else {
  2877. this.type = src;
  2878. }
  2879. // Put explicitly provided properties onto the event object
  2880. if ( props ) {
  2881. jQuery.extend( this, props );
  2882. }
  2883. // Create a timestamp if incoming event doesn't have one
  2884. this.timeStamp = src && src.timeStamp || jQuery.now();
  2885. // Mark it as fixed
  2886. this[ jQuery.expando ] = true;
  2887. };
  2888. function returnFalse() {
  2889. return false;
  2890. }
  2891. function returnTrue() {
  2892. return true;
  2893. }
  2894. // jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
  2895. // http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
  2896. jQuery.Event.prototype = {
  2897. preventDefault: function() {
  2898. this.isDefaultPrevented = returnTrue;
  2899. var e = this.originalEvent;
  2900. if ( !e ) {
  2901. return;
  2902. }
  2903. // if preventDefault exists run it on the original event
  2904. if ( e.preventDefault ) {
  2905. e.preventDefault();
  2906. // otherwise set the returnValue property of the original event to false (IE)
  2907. } else {
  2908. e.returnValue = false;
  2909. }
  2910. },
  2911. stopPropagation: function() {
  2912. this.isPropagationStopped = returnTrue;
  2913. var e = this.originalEvent;
  2914. if ( !e ) {
  2915. return;
  2916. }
  2917. // if stopPropagation exists run it on the original event
  2918. if ( e.stopPropagation ) {
  2919. e.stopPropagation();
  2920. }
  2921. // otherwise set the cancelBubble property of the original event to true (IE)
  2922. e.cancelBubble = true;
  2923. },
  2924. stopImmediatePropagation: function() {
  2925. this.isImmediatePropagationStopped = returnTrue;
  2926. this.stopPropagation();
  2927. },
  2928. isDefaultPrevented: returnFalse,
  2929. isPropagationStopped: returnFalse,
  2930. isImmediatePropagationStopped: returnFalse
  2931. };
  2932. // Create mouseenter/leave events using mouseover/out and event-time checks
  2933. jQuery.each({
  2934. mouseenter: "mouseover",
  2935. mouseleave: "mouseout"
  2936. }, function( orig, fix ) {
  2937. jQuery.event.special[ orig ] = {
  2938. delegateType: fix,
  2939. bindType: fix,
  2940. handle: function( event ) {
  2941. var target = this,
  2942. related = event.relatedTarget,
  2943. handleObj = event.handleObj,
  2944. selector = handleObj.selector,
  2945. ret;
  2946. // For mousenter/leave call the handler if related is outside the target.
  2947. // NB: No relatedTarget if the mouse left/entered the browser window
  2948. if ( !related || (related !== target && !jQuery.contains( target, related )) ) {
  2949. event.type = handleObj.origType;
  2950. ret = handleObj.handler.apply( this, arguments );
  2951. event.type = fix;
  2952. }
  2953. return ret;
  2954. }
  2955. };
  2956. });
  2957. // IE submit delegation
  2958. if ( !jQuery.support.submitBubbles ) {
  2959. jQuery.event.special.submit = {
  2960. setup: function() {
  2961. // Only need this for delegated form submit events
  2962. if ( jQuery.nodeName( this, "form" ) ) {
  2963. return false;
  2964. }
  2965. // Lazy-add a submit handler when a descendant form may potentially be submitted
  2966. jQuery.event.add( this, "click._submit keypress._submit", function( e ) {
  2967. // Node name check avoids a VML-related crash in IE (#9807)
  2968. var elem = e.target,
  2969. form = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? elem.form : undefined;
  2970. if ( form && !form._submit_attached ) {
  2971. jQuery.event.add( form, "submit._submit", function( event ) {
  2972. // If form was submitted by the user, bubble the event up the tree
  2973. if ( this.parentNode && !event.isTrigger ) {
  2974. jQuery.event.simulate( "submit", this.parentNode, event, true );
  2975. }
  2976. });
  2977. form._submit_attached = true;
  2978. }
  2979. });
  2980. // return undefined since we don't need an event listener
  2981. },
  2982. teardown: function() {
  2983. // Only need this for delegated form submit events
  2984. if ( jQuery.nodeName( this, "form" ) ) {
  2985. return false;
  2986. }
  2987. // Remove delegated handlers; cleanData eventually reaps submit handlers attached above
  2988. jQuery.event.remove( this, "._submit" );
  2989. }
  2990. };
  2991. }
  2992. // IE change delegation and checkbox/radio fix
  2993. if ( !jQuery.support.changeBubbles ) {
  2994. jQuery.event.special.change = {
  2995. setup: function() {
  2996. if ( rformElems.test( this.nodeName ) ) {
  2997. // IE doesn't fire change on a check/radio until blur; trigger it on click
  2998. // after a propertychange. Eat the blur-change in special.change.handle.
  2999. // This still fires onchange a second time for check/radio after blur.
  3000. if ( this.type === "checkbox" || this.type === "radio" ) {
  3001. jQuery.event.add( this, "propertychange._change", function( event ) {
  3002. if ( event.originalEvent.propertyName === "checked" ) {
  3003. this._just_changed = true;
  3004. }
  3005. });
  3006. jQuery.event.add( this, "click._change", function( event ) {
  3007. if ( this._just_changed && !event.isTrigger ) {
  3008. this._just_changed = false;
  3009. jQuery.event.simulate( "change", this, event, true );
  3010. }
  3011. });
  3012. }
  3013. return false;
  3014. }
  3015. // Delegated event; lazy-add a change handler on descendant inputs
  3016. jQuery.event.add( this, "beforeactivate._change", function( e ) {
  3017. var elem = e.target;
  3018. if ( rformElems.test( elem.nodeName ) && !elem._change_attached ) {
  3019. jQuery.event.add( elem, "change._change", function( event ) {
  3020. if ( this.parentNode && !event.isSimulated && !event.isTrigger ) {
  3021. jQuery.event.simulate( "change", this.parentNode, event, true );
  3022. }
  3023. });
  3024. elem._change_attached = true;
  3025. }
  3026. });
  3027. },
  3028. handle: function( event ) {
  3029. var elem = event.target;
  3030. // Swallow native change events from checkbox/radio, we already triggered them above
  3031. if ( this !== elem || event.isSimulated || event.isTrigger || (elem.type !== "radio" && elem.type !== "checkbox") ) {
  3032. return event.handleObj.handler.apply( this, arguments );
  3033. }
  3034. },
  3035. teardown: function() {
  3036. jQuery.event.remove( this, "._change" );
  3037. return rformElems.test( this.nodeName );
  3038. }
  3039. };
  3040. }
  3041. // Create "bubbling" focus and blur events
  3042. if ( !jQuery.support.focusinBubbles ) {
  3043. jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) {
  3044. // Attach a single capturing handler while someone wants focusin/focusout
  3045. var attaches = 0,
  3046. handler = function( event ) {
  3047. jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true );
  3048. };
  3049. jQuery.event.special[ fix ] = {
  3050. setup: function() {
  3051. if ( attaches++ === 0 ) {
  3052. document.addEventListener( orig, handler, true );
  3053. }
  3054. },
  3055. teardown: function() {
  3056. if ( --attaches === 0 ) {
  3057. document.removeEventListener( orig, handler, true );
  3058. }
  3059. }
  3060. };
  3061. });
  3062. }
  3063. jQuery.fn.extend({
  3064. on: function( types, selector, data, fn, /*INTERNAL*/ one ) {
  3065. var origFn, type;
  3066. // Types can be a map of types/handlers
  3067. if ( typeof types === "object" ) {
  3068. // ( types-Object, selector, data )
  3069. if ( typeof selector !== "string" ) {
  3070. // ( types-Object, data )
  3071. data = selector;
  3072. selector = undefined;
  3073. }
  3074. for ( type in types ) {
  3075. this.on( type, selector, data, types[ type ], one );
  3076. }
  3077. return this;
  3078. }
  3079. if ( data == null && fn == null ) {
  3080. // ( types, fn )
  3081. fn = selector;
  3082. data = selector = undefined;
  3083. } else if ( fn == null ) {
  3084. if ( typeof selector === "string" ) {
  3085. // ( types, selector, fn )
  3086. fn = data;
  3087. data = undefined;
  3088. } else {
  3089. // ( types, data, fn )
  3090. fn = data;
  3091. data = selector;
  3092. selector = undefined;
  3093. }
  3094. }
  3095. if ( fn === false ) {
  3096. fn = returnFalse;
  3097. } else if ( !fn ) {
  3098. return this;
  3099. }
  3100. if ( one === 1 ) {
  3101. origFn = fn;
  3102. fn = function( event ) {
  3103. // Can use an empty set, since event contains the info
  3104. jQuery().off( event );
  3105. return origFn.apply( this, arguments );
  3106. };
  3107. // Use same guid so caller can remove using origFn
  3108. fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );
  3109. }
  3110. return this.each( function() {
  3111. jQuery.event.add( this, types, fn, data, selector );
  3112. });
  3113. },
  3114. one: function( types, selector, data, fn ) {
  3115. return this.on.call( this, types, selector, data, fn, 1 );
  3116. },
  3117. off: function( types, selector, fn ) {
  3118. if ( types && types.preventDefault && types.handleObj ) {
  3119. // ( event ) dispatched jQuery.Event
  3120. var handleObj = types.handleObj;
  3121. jQuery( types.delegateTarget ).off(
  3122. handleObj.namespace? handleObj.type + "." + handleObj.namespace : handleObj.type,
  3123. handleObj.selector,
  3124. handleObj.handler
  3125. );
  3126. return this;
  3127. }
  3128. if ( typeof types === "object" ) {
  3129. // ( types-object [, selector] )
  3130. for ( var type in types ) {
  3131. this.off( type, selector, types[ type ] );
  3132. }
  3133. return this;
  3134. }
  3135. if ( selector === false || typeof selector === "function" ) {
  3136. // ( types [, fn] )
  3137. fn = selector;
  3138. selector = undefined;
  3139. }
  3140. if ( fn === false ) {
  3141. fn = returnFalse;
  3142. }
  3143. return this.each(function() {
  3144. jQuery.event.remove( this, types, fn, selector );
  3145. });
  3146. },
  3147. bind: function( types, data, fn ) {
  3148. return this.on( types, null, data, fn );
  3149. },
  3150. unbind: function( types, fn ) {
  3151. return this.off( types, null, fn );
  3152. },
  3153. live: function( types, data, fn ) {
  3154. jQuery( this.context ).on( types, this.selector, data, fn );
  3155. return this;
  3156. },
  3157. die: function( types, fn ) {
  3158. jQuery( this.context ).off( types, this.selector || "**", fn );
  3159. return this;
  3160. },
  3161. delegate: function( selector, types, data, fn ) {
  3162. return this.on( types, selector, data, fn );
  3163. },
  3164. undelegate: function( selector, types, fn ) {
  3165. // ( namespace ) or ( selector, types [, fn] )
  3166. return arguments.length == 1? this.off( selector, "**" ) : this.off( types, selector, fn );
  3167. },
  3168. trigger: function( type, data ) {
  3169. return this.each(function() {
  3170. jQuery.event.trigger( type, data, this );
  3171. });
  3172. },
  3173. triggerHandler: function( type, data ) {
  3174. if ( this[0] ) {
  3175. return jQuery.event.trigger( type, data, this[0], true );
  3176. }
  3177. },
  3178. toggle: function( fn ) {
  3179. // Save reference to arguments for access in closure
  3180. var args = arguments,
  3181. guid = fn.guid || jQuery.guid++,
  3182. i = 0,
  3183. toggler = function( event ) {
  3184. // Figure out which function to execute
  3185. var lastToggle = ( jQuery._data( this, "lastToggle" + fn.guid ) || 0 ) % i;
  3186. jQuery._data( this, "lastToggle" + fn.guid, lastToggle + 1 );
  3187. // Make sure that clicks stop
  3188. event.preventDefault();
  3189. // and execute the function
  3190. return args[ lastToggle ].apply( this, arguments ) || false;
  3191. };
  3192. // link all the functions, so any of them can unbind this click handler
  3193. toggler.guid = guid;
  3194. while ( i < args.length ) {
  3195. args[ i++ ].guid = guid;
  3196. }
  3197. return this.click( toggler );
  3198. },
  3199. hover: function( fnOver, fnOut ) {
  3200. return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
  3201. }
  3202. });
  3203. jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " +
  3204. "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
  3205. "change select submit keydown keypress keyup error contextmenu").split(" "), function( i, name ) {
  3206. // Handle event binding
  3207. jQuery.fn[ name ] = function( data, fn ) {
  3208. if ( fn == null ) {
  3209. fn = data;
  3210. data = null;
  3211. }
  3212. return arguments.length > 0 ?
  3213. this.on( name, null, data, fn ) :
  3214. this.trigger( name );
  3215. };
  3216. if ( jQuery.attrFn ) {
  3217. jQuery.attrFn[ name ] = true;
  3218. }
  3219. if ( rkeyEvent.test( name ) ) {
  3220. jQuery.event.fixHooks[ name ] = jQuery.event.keyHooks;
  3221. }
  3222. if ( rmouseEvent.test( name ) ) {
  3223. jQuery.event.fixHooks[ name ] = jQuery.event.mouseHooks;
  3224. }
  3225. });
  3226. /*!
  3227. * Sizzle CSS Selector Engine
  3228. * Copyright 2011, The Dojo Foundation
  3229. * Released under the MIT, BSD, and GPL Licenses.
  3230. * More information: http://sizzlejs.com/
  3231. */
  3232. (function(){
  3233. var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,
  3234. expando = "sizcache" + (Math.random() + '').replace('.', ''),
  3235. done = 0,
  3236. toString = Object.prototype.toString,
  3237. hasDuplicate = false,
  3238. baseHasDuplicate = true,
  3239. rBackslash = /\\/g,
  3240. rReturn = /\r\n/g,
  3241. rNonWord = /\W/;
  3242. // Here we check if the JavaScript engine is using some sort of
  3243. // optimization where it does not always call our comparision
  3244. // function. If that is the case, discard the hasDuplicate value.
  3245. // Thus far that includes Google Chrome.
  3246. [0, 0].sort(function() {
  3247. baseHasDuplicate = false;
  3248. return 0;
  3249. });
  3250. var Sizzle = function( selector, context, results, seed ) {
  3251. results = results || [];
  3252. context = context || document;
  3253. var origContext = context;
  3254. if ( context.nodeType !== 1 && context.nodeType !== 9 ) {
  3255. return [];
  3256. }
  3257. if ( !selector || typeof selector !== "string" ) {
  3258. return results;
  3259. }
  3260. var m, set, checkSet, extra, ret, cur, pop, i,
  3261. prune = true,
  3262. contextXML = Sizzle.isXML( context ),
  3263. parts = [],
  3264. soFar = selector;
  3265. // Reset the position of the chunker regexp (start from head)
  3266. do {
  3267. chunker.exec( "" );
  3268. m = chunker.exec( soFar );
  3269. if ( m ) {
  3270. soFar = m[3];
  3271. parts.push( m[1] );
  3272. if ( m[2] ) {
  3273. extra = m[3];
  3274. break;
  3275. }
  3276. }
  3277. } while ( m );
  3278. if ( parts.length > 1 && origPOS.exec( selector ) ) {
  3279. if ( parts.length === 2 && Expr.relative[ parts[0] ] ) {
  3280. set = posProcess( parts[0] + parts[1], context, seed );
  3281. } else {
  3282. set = Expr.relative[ parts[0] ] ?
  3283. [ context ] :
  3284. Sizzle( parts.shift(), context );
  3285. while ( parts.length ) {
  3286. selector = parts.shift();
  3287. if ( Expr.relative[ selector ] ) {
  3288. selector += parts.shift();
  3289. }
  3290. set = posProcess( selector, set, seed );
  3291. }
  3292. }
  3293. } else {
  3294. // Take a shortcut and set the context if the root selector is an ID
  3295. // (but not if it'll be faster if the inner selector is an ID)
  3296. if ( !seed && parts.length > 1 && context.nodeType === 9 && !contextXML &&
  3297. Expr.match.ID.test(parts[0]) && !Expr.match.ID.test(parts[parts.length - 1]) ) {
  3298. ret = Sizzle.find( parts.shift(), context, contextXML );
  3299. context = ret.expr ?
  3300. Sizzle.filter( ret.expr, ret.set )[0] :
  3301. ret.set[0];
  3302. }
  3303. if ( context ) {
  3304. ret = seed ?
  3305. { expr: parts.pop(), set: makeArray(seed) } :
  3306. Sizzle.find( parts.pop(), parts.length === 1 && (parts[0] === "~" || parts[0] === "+") && context.parentNode ? context.parentNode : context, contextXML );
  3307. set = ret.expr ?
  3308. Sizzle.filter( ret.expr, ret.set ) :
  3309. ret.set;
  3310. if ( parts.length > 0 ) {
  3311. checkSet = makeArray( set );
  3312. } else {
  3313. prune = false;
  3314. }
  3315. while ( parts.length ) {
  3316. cur = parts.pop();
  3317. pop = cur;
  3318. if ( !Expr.relative[ cur ] ) {
  3319. cur = "";
  3320. } else {
  3321. pop = parts.pop();
  3322. }
  3323. if ( pop == null ) {
  3324. pop = context;
  3325. }
  3326. Expr.relative[ cur ]( checkSet, pop, contextXML );
  3327. }
  3328. } else {
  3329. checkSet = parts = [];
  3330. }
  3331. }
  3332. if ( !checkSet ) {
  3333. checkSet = set;
  3334. }
  3335. if ( !checkSet ) {
  3336. Sizzle.error( cur || selector );
  3337. }
  3338. if ( toString.call(checkSet) === "[object Array]" ) {
  3339. if ( !prune ) {
  3340. results.push.apply( results, checkSet );
  3341. } else if ( context && context.nodeType === 1 ) {
  3342. for ( i = 0; checkSet[i] != null; i++ ) {
  3343. if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && Sizzle.contains(context, checkSet[i])) ) {
  3344. results.push( set[i] );
  3345. }
  3346. }
  3347. } else {
  3348. for ( i = 0; checkSet[i] != null; i++ ) {
  3349. if ( checkSet[i] && checkSet[i].nodeType === 1 ) {
  3350. results.push( set[i] );
  3351. }
  3352. }
  3353. }
  3354. } else {
  3355. makeArray( checkSet, results );
  3356. }
  3357. if ( extra ) {
  3358. Sizzle( extra, origContext, results, seed );
  3359. Sizzle.uniqueSort( results );
  3360. }
  3361. return results;
  3362. };
  3363. Sizzle.uniqueSort = function( results ) {
  3364. if ( sortOrder ) {
  3365. hasDuplicate = baseHasDuplicate;
  3366. results.sort( sortOrder );
  3367. if ( hasDuplicate ) {
  3368. for ( var i = 1; i < results.length; i++ ) {
  3369. if ( results[i] === results[ i - 1 ] ) {
  3370. results.splice( i--, 1 );
  3371. }
  3372. }
  3373. }
  3374. }
  3375. return results;
  3376. };
  3377. Sizzle.matches = function( expr, set ) {
  3378. return Sizzle( expr, null, null, set );
  3379. };
  3380. Sizzle.matchesSelector = function( node, expr ) {
  3381. return Sizzle( expr, null, null, [node] ).length > 0;
  3382. };
  3383. Sizzle.find = function( expr, context, isXML ) {
  3384. var set, i, len, match, type, left;
  3385. if ( !expr ) {
  3386. return [];
  3387. }
  3388. for ( i = 0, len = Expr.order.length; i < len; i++ ) {
  3389. type = Expr.order[i];
  3390. if ( (match = Expr.leftMatch[ type ].exec( expr )) ) {
  3391. left = match[1];
  3392. match.splice( 1, 1 );
  3393. if ( left.substr( left.length - 1 ) !== "\\" ) {
  3394. match[1] = (match[1] || "").replace( rBackslash, "" );
  3395. set = Expr.find[ type ]( match, context, isXML );
  3396. if ( set != null ) {
  3397. expr = expr.replace( Expr.match[ type ], "" );
  3398. break;
  3399. }
  3400. }
  3401. }
  3402. }
  3403. if ( !set ) {
  3404. set = typeof context.getElementsByTagName !== "undefined" ?
  3405. context.getElementsByTagName( "*" ) :
  3406. [];
  3407. }
  3408. return { set: set, expr: expr };
  3409. };
  3410. Sizzle.filter = function( expr, set, inplace, not ) {
  3411. var match, anyFound,
  3412. type, found, item, filter, left,
  3413. i, pass,
  3414. old = expr,
  3415. result = [],
  3416. curLoop = set,
  3417. isXMLFilter = set && set[0] && Sizzle.isXML( set[0] );
  3418. while ( expr && set.length ) {
  3419. for ( type in Expr.filter ) {
  3420. if ( (match = Expr.leftMatch[ type ].exec( expr )) != null && match[2] ) {
  3421. filter = Expr.filter[ type ];
  3422. left = match[1];
  3423. anyFound = false;
  3424. match.splice(1,1);
  3425. if ( left.substr( left.length - 1 ) === "\\" ) {
  3426. continue;
  3427. }
  3428. if ( curLoop === result ) {
  3429. result = [];
  3430. }
  3431. if ( Expr.preFilter[ type ] ) {
  3432. match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not, isXMLFilter );
  3433. if ( !match ) {
  3434. anyFound = found = true;
  3435. } else if ( match === true ) {
  3436. continue;
  3437. }
  3438. }
  3439. if ( match ) {
  3440. for ( i = 0; (item = curLoop[i]) != null; i++ ) {
  3441. if ( item ) {
  3442. found = filter( item, match, i, curLoop );
  3443. pass = not ^ found;
  3444. if ( inplace && found != null ) {
  3445. if ( pass ) {
  3446. anyFound = true;
  3447. } else {
  3448. curLoop[i] = false;
  3449. }
  3450. } else if ( pass ) {
  3451. result.push( item );
  3452. anyFound = true;
  3453. }
  3454. }
  3455. }
  3456. }
  3457. if ( found !== undefined ) {
  3458. if ( !inplace ) {
  3459. curLoop = result;
  3460. }
  3461. expr = expr.replace( Expr.match[ type ], "" );
  3462. if ( !anyFound ) {
  3463. return [];
  3464. }
  3465. break;
  3466. }
  3467. }
  3468. }
  3469. // Improper expression
  3470. if ( expr === old ) {
  3471. if ( anyFound == null ) {
  3472. Sizzle.error( expr );
  3473. } else {
  3474. break;
  3475. }
  3476. }
  3477. old = expr;
  3478. }
  3479. return curLoop;
  3480. };
  3481. Sizzle.error = function( msg ) {
  3482. throw new Error( "Syntax error, unrecognized expression: " + msg );
  3483. };
  3484. /**
  3485. * Utility function for retreiving the text value of an array of DOM nodes
  3486. * @param {Array|Element} elem
  3487. */
  3488. var getText = Sizzle.getText = function( elem ) {
  3489. var i, node,
  3490. nodeType = elem.nodeType,
  3491. ret = "";
  3492. if ( nodeType ) {
  3493. if ( nodeType === 1 || nodeType === 9 ) {
  3494. // Use textContent || innerText for elements
  3495. if ( typeof elem.textContent === 'string' ) {
  3496. return elem.textContent;
  3497. } else if ( typeof elem.innerText === 'string' ) {
  3498. // Replace IE's carriage returns
  3499. return elem.innerText.replace( rReturn, '' );
  3500. } else {
  3501. // Traverse it's children
  3502. for ( elem = elem.firstChild; elem; elem = elem.nextSibling) {
  3503. ret += getText( elem );
  3504. }
  3505. }
  3506. } else if ( nodeType === 3 || nodeType === 4 ) {
  3507. return elem.nodeValue;
  3508. }
  3509. } else {
  3510. // If no nodeType, this is expected to be an array
  3511. for ( i = 0; (node = elem[i]); i++ ) {
  3512. // Do not traverse comment nodes
  3513. if ( node.nodeType !== 8 ) {
  3514. ret += getText( node );
  3515. }
  3516. }
  3517. }
  3518. return ret;
  3519. };
  3520. var Expr = Sizzle.selectors = {
  3521. order: [ "ID", "NAME", "TAG" ],
  3522. match: {
  3523. ID: /#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,
  3524. CLASS: /\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,
  3525. NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,
  3526. ATTR: /\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,
  3527. TAG: /^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,
  3528. CHILD: /:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,
  3529. POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,
  3530. PSEUDO: /:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/
  3531. },
  3532. leftMatch: {},
  3533. attrMap: {
  3534. "class": "className",
  3535. "for": "htmlFor"
  3536. },
  3537. attrHandle: {
  3538. href: function( elem ) {
  3539. return elem.getAttribute( "href" );
  3540. },
  3541. type: function( elem ) {
  3542. return elem.getAttribute( "type" );
  3543. }
  3544. },
  3545. relative: {
  3546. "+": function(checkSet, part){
  3547. var isPartStr = typeof part === "string",
  3548. isTag = isPartStr && !rNonWord.test( part ),
  3549. isPartStrNotTag = isPartStr && !isTag;
  3550. if ( isTag ) {
  3551. part = part.toLowerCase();
  3552. }
  3553. for ( var i = 0, l = checkSet.length, elem; i < l; i++ ) {
  3554. if ( (elem = checkSet[i]) ) {
  3555. while ( (elem = elem.previousSibling) && elem.nodeType !== 1 ) {}
  3556. checkSet[i] = isPartStrNotTag || elem && elem.nodeName.toLowerCase() === part ?
  3557. elem || false :
  3558. elem === part;
  3559. }
  3560. }
  3561. if ( isPartStrNotTag ) {
  3562. Sizzle.filter( part, checkSet, true );
  3563. }
  3564. },
  3565. ">": function( checkSet, part ) {
  3566. var elem,
  3567. isPartStr = typeof part === "string",
  3568. i = 0,
  3569. l = checkSet.length;
  3570. if ( isPartStr && !rNonWord.test( part ) ) {
  3571. part = part.toLowerCase();
  3572. for ( ; i < l; i++ ) {
  3573. elem = checkSet[i];
  3574. if ( elem ) {
  3575. var parent = elem.parentNode;
  3576. checkSet[i] = parent.nodeName.toLowerCase() === part ? parent : false;
  3577. }
  3578. }
  3579. } else {
  3580. for ( ; i < l; i++ ) {
  3581. elem = checkSet[i];
  3582. if ( elem ) {
  3583. checkSet[i] = isPartStr ?
  3584. elem.parentNode :
  3585. elem.parentNode === part;
  3586. }
  3587. }
  3588. if ( isPartStr ) {
  3589. Sizzle.filter( part, checkSet, true );
  3590. }
  3591. }
  3592. },
  3593. "": function(checkSet, part, isXML){
  3594. var nodeCheck,
  3595. doneName = done++,
  3596. checkFn = dirCheck;
  3597. if ( typeof part === "string" && !rNonWord.test( part ) ) {
  3598. part = part.toLowerCase();
  3599. nodeCheck = part;
  3600. checkFn = dirNodeCheck;
  3601. }
  3602. checkFn( "parentNode", part, doneName, checkSet, nodeCheck, isXML );
  3603. },
  3604. "~": function( checkSet, part, isXML ) {
  3605. var nodeCheck,
  3606. doneName = done++,
  3607. checkFn = dirCheck;
  3608. if ( typeof part === "string" && !rNonWord.test( part ) ) {
  3609. part = part.toLowerCase();
  3610. nodeCheck = part;
  3611. checkFn = dirNodeCheck;
  3612. }
  3613. checkFn( "previousSibling", part, doneName, checkSet, nodeCheck, isXML );
  3614. }
  3615. },
  3616. find: {
  3617. ID: function( match, context, isXML ) {
  3618. if ( typeof context.getElementById !== "undefined" && !isXML ) {
  3619. var m = context.getElementById(match[1]);
  3620. // Check parentNode to catch when Blackberry 4.6 returns
  3621. // nodes that are no longer in the document #6963
  3622. return m && m.parentNode ? [m] : [];
  3623. }
  3624. },
  3625. NAME: function( match, context ) {
  3626. if ( typeof context.getElementsByName !== "undefined" ) {
  3627. var ret = [],
  3628. results = context.getElementsByName( match[1] );
  3629. for ( var i = 0, l = results.length; i < l; i++ ) {
  3630. if ( results[i].getAttribute("name") === match[1] ) {
  3631. ret.push( results[i] );
  3632. }
  3633. }
  3634. return ret.length === 0 ? null : ret;
  3635. }
  3636. },
  3637. TAG: function( match, context ) {
  3638. if ( typeof context.getElementsByTagName !== "undefined" ) {
  3639. return context.getElementsByTagName( match[1] );
  3640. }
  3641. }
  3642. },
  3643. preFilter: {
  3644. CLASS: function( match, curLoop, inplace, result, not, isXML ) {
  3645. match = " " + match[1].replace( rBackslash, "" ) + " ";
  3646. if ( isXML ) {
  3647. return match;
  3648. }
  3649. for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) {
  3650. if ( elem ) {
  3651. if ( not ^ (elem.className && (" " + elem.className + " ").replace(/[\t\n\r]/g, " ").indexOf(match) >= 0) ) {
  3652. if ( !inplace ) {
  3653. result.push( elem );
  3654. }
  3655. } else if ( inplace ) {
  3656. curLoop[i] = false;
  3657. }
  3658. }
  3659. }
  3660. return false;
  3661. },
  3662. ID: function( match ) {
  3663. return match[1].replace( rBackslash, "" );
  3664. },
  3665. TAG: function( match, curLoop ) {
  3666. return match[1].replace( rBackslash, "" ).toLowerCase();
  3667. },
  3668. CHILD: function( match ) {
  3669. if ( match[1] === "nth" ) {
  3670. if ( !match[2] ) {
  3671. Sizzle.error( match[0] );
  3672. }
  3673. match[2] = match[2].replace(/^\+|\s*/g, '');
  3674. // parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6'
  3675. var test = /(-?)(\d*)(?:n([+\-]?\d*))?/.exec(
  3676. match[2] === "even" && "2n" || match[2] === "odd" && "2n+1" ||
  3677. !/\D/.test( match[2] ) && "0n+" + match[2] || match[2]);
  3678. // calculate the numbers (first)n+(last) including if they are negative
  3679. match[2] = (test[1] + (test[2] || 1)) - 0;
  3680. match[3] = test[3] - 0;
  3681. }
  3682. else if ( match[2] ) {
  3683. Sizzle.error( match[0] );
  3684. }
  3685. // TODO: Move to normal caching system
  3686. match[0] = done++;
  3687. return match;
  3688. },
  3689. ATTR: function( match, curLoop, inplace, result, not, isXML ) {
  3690. var name = match[1] = match[1].replace( rBackslash, "" );
  3691. if ( !isXML && Expr.attrMap[name] ) {
  3692. match[1] = Expr.attrMap[name];
  3693. }
  3694. // Handle if an un-quoted value was used
  3695. match[4] = ( match[4] || match[5] || "" ).replace( rBackslash, "" );
  3696. if ( match[2] === "~=" ) {
  3697. match[4] = " " + match[4] + " ";
  3698. }
  3699. return match;
  3700. },
  3701. PSEUDO: function( match, curLoop, inplace, result, not ) {
  3702. if ( match[1] === "not" ) {
  3703. // If we're dealing with a complex expression, or a simple one
  3704. if ( ( chunker.exec(match[3]) || "" ).length > 1 || /^\w/.test(match[3]) ) {
  3705. match[3] = Sizzle(match[3], null, null, curLoop);
  3706. } else {
  3707. var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not);
  3708. if ( !inplace ) {
  3709. result.push.apply( result, ret );
  3710. }
  3711. return false;
  3712. }
  3713. } else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) {
  3714. return true;
  3715. }
  3716. return match;
  3717. },
  3718. POS: function( match ) {
  3719. match.unshift( true );
  3720. return match;
  3721. }
  3722. },
  3723. filters: {
  3724. enabled: function( elem ) {
  3725. return elem.disabled === false && elem.type !== "hidden";
  3726. },
  3727. disabled: function( elem ) {
  3728. return elem.disabled === true;
  3729. },
  3730. checked: function( elem ) {
  3731. return elem.checked === true;
  3732. },
  3733. selected: function( elem ) {
  3734. // Accessing this property makes selected-by-default
  3735. // options in Safari work properly
  3736. if ( elem.parentNode ) {
  3737. elem.parentNode.selectedIndex;
  3738. }
  3739. return elem.selected === true;
  3740. },
  3741. parent: function( elem ) {
  3742. return !!elem.firstChild;
  3743. },
  3744. empty: function( elem ) {
  3745. return !elem.firstChild;
  3746. },
  3747. has: function( elem, i, match ) {
  3748. return !!Sizzle( match[3], elem ).length;
  3749. },
  3750. header: function( elem ) {
  3751. return (/h\d/i).test( elem.nodeName );
  3752. },
  3753. text: function( elem ) {
  3754. var attr = elem.getAttribute( "type" ), type = elem.type;
  3755. // IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc)
  3756. // use getAttribute instead to test this case
  3757. return elem.nodeName.toLowerCase() === "input" && "text" === type && ( attr === type || attr === null );
  3758. },
  3759. radio: function( elem ) {
  3760. return elem.nodeName.toLowerCase() === "input" && "radio" === elem.type;
  3761. },
  3762. checkbox: function( elem ) {
  3763. return elem.nodeName.toLowerCase() === "input" && "checkbox" === elem.type;
  3764. },
  3765. file: function( elem ) {
  3766. return elem.nodeName.toLowerCase() === "input" && "file" === elem.type;
  3767. },
  3768. password: function( elem ) {
  3769. return elem.nodeName.toLowerCase() === "input" && "password" === elem.type;
  3770. },
  3771. submit: function( elem ) {
  3772. var name = elem.nodeName.toLowerCase();
  3773. return (name === "input" || name === "button") && "submit" === elem.type;
  3774. },
  3775. image: function( elem ) {
  3776. return elem.nodeName.toLowerCase() === "input" && "image" === elem.type;
  3777. },
  3778. reset: function( elem ) {
  3779. var name = elem.nodeName.toLowerCase();
  3780. return (name === "input" || name === "button") && "reset" === elem.type;
  3781. },
  3782. button: function( elem ) {
  3783. var name = elem.nodeName.toLowerCase();
  3784. return name === "input" && "button" === elem.type || name === "button";
  3785. },
  3786. input: function( elem ) {
  3787. return (/input|select|textarea|button/i).test( elem.nodeName );
  3788. },
  3789. focus: function( elem ) {
  3790. return elem === elem.ownerDocument.activeElement;
  3791. }
  3792. },
  3793. setFilters: {
  3794. first: function( elem, i ) {
  3795. return i === 0;
  3796. },
  3797. last: function( elem, i, match, array ) {
  3798. return i === array.length - 1;
  3799. },
  3800. even: function( elem, i ) {
  3801. return i % 2 === 0;
  3802. },
  3803. odd: function( elem, i ) {
  3804. return i % 2 === 1;
  3805. },
  3806. lt: function( elem, i, match ) {
  3807. return i < match[3] - 0;
  3808. },
  3809. gt: function( elem, i, match ) {
  3810. return i > match[3] - 0;
  3811. },
  3812. nth: function( elem, i, match ) {
  3813. return match[3] - 0 === i;
  3814. },
  3815. eq: function( elem, i, match ) {
  3816. return match[3] - 0 === i;
  3817. }
  3818. },
  3819. filter: {
  3820. PSEUDO: function( elem, match, i, array ) {
  3821. var name = match[1],
  3822. filter = Expr.filters[ name ];
  3823. if ( filter ) {
  3824. return filter( elem, i, match, array );
  3825. } else if ( name === "contains" ) {
  3826. return (elem.textContent || elem.innerText || getText([ elem ]) || "").indexOf(match[3]) >= 0;
  3827. } else if ( name === "not" ) {
  3828. var not = match[3];
  3829. for ( var j = 0, l = not.length; j < l; j++ ) {
  3830. if ( not[j] === elem ) {
  3831. return false;
  3832. }
  3833. }
  3834. return true;
  3835. } else {
  3836. Sizzle.error( name );
  3837. }
  3838. },
  3839. CHILD: function( elem, match ) {
  3840. var first, last,
  3841. doneName, parent, cache,
  3842. count, diff,
  3843. type = match[1],
  3844. node = elem;
  3845. switch ( type ) {
  3846. case "only":
  3847. case "first":
  3848. while ( (node = node.previousSibling) ) {
  3849. if ( node.nodeType === 1 ) {
  3850. return false;
  3851. }
  3852. }
  3853. if ( type === "first" ) {
  3854. return true;
  3855. }
  3856. node = elem;
  3857. case "last":
  3858. while ( (node = node.nextSibling) ) {
  3859. if ( node.nodeType === 1 ) {
  3860. return false;
  3861. }
  3862. }
  3863. return true;
  3864. case "nth":
  3865. first = match[2];
  3866. last = match[3];
  3867. if ( first === 1 && last === 0 ) {
  3868. return true;
  3869. }
  3870. doneName = match[0];
  3871. parent = elem.parentNode;
  3872. if ( parent && (parent[ expando ] !== doneName || !elem.nodeIndex) ) {
  3873. count = 0;
  3874. for ( node = parent.firstChild; node; node = node.nextSibling ) {
  3875. if ( node.nodeType === 1 ) {
  3876. node.nodeIndex = ++count;
  3877. }
  3878. }
  3879. parent[ expando ] = doneName;
  3880. }
  3881. diff = elem.nodeIndex - last;
  3882. if ( first === 0 ) {
  3883. return diff === 0;
  3884. } else {
  3885. return ( diff % first === 0 && diff / first >= 0 );
  3886. }
  3887. }
  3888. },
  3889. ID: function( elem, match ) {
  3890. return elem.nodeType === 1 && elem.getAttribute("id") === match;
  3891. },
  3892. TAG: function( elem, match ) {
  3893. return (match === "*" && elem.nodeType === 1) || !!elem.nodeName && elem.nodeName.toLowerCase() === match;
  3894. },
  3895. CLASS: function( elem, match ) {
  3896. return (" " + (elem.className || elem.getAttribute("class")) + " ")
  3897. .indexOf( match ) > -1;
  3898. },
  3899. ATTR: function( elem, match ) {
  3900. var name = match[1],
  3901. result = Sizzle.attr ?
  3902. Sizzle.attr( elem, name ) :
  3903. Expr.attrHandle[ name ] ?
  3904. Expr.attrHandle[ name ]( elem ) :
  3905. elem[ name ] != null ?
  3906. elem[ name ] :
  3907. elem.getAttribute( name ),
  3908. value = result + "",
  3909. type = match[2],
  3910. check = match[4];
  3911. return result == null ?
  3912. type === "!=" :
  3913. !type && Sizzle.attr ?
  3914. result != null :
  3915. type === "=" ?
  3916. value === check :
  3917. type === "*=" ?
  3918. value.indexOf(check) >= 0 :
  3919. type === "~=" ?
  3920. (" " + value + " ").indexOf(check) >= 0 :
  3921. !check ?
  3922. value && result !== false :
  3923. type === "!=" ?
  3924. value !== check :
  3925. type === "^=" ?
  3926. value.indexOf(check) === 0 :
  3927. type === "$=" ?
  3928. value.substr(value.length - check.length) === check :
  3929. type === "|=" ?
  3930. value === check || value.substr(0, check.length + 1) === check + "-" :
  3931. false;
  3932. },
  3933. POS: function( elem, match, i, array ) {
  3934. var name = match[2],
  3935. filter = Expr.setFilters[ name ];
  3936. if ( filter ) {
  3937. return filter( elem, i, match, array );
  3938. }
  3939. }
  3940. }
  3941. };
  3942. var origPOS = Expr.match.POS,
  3943. fescape = function(all, num){
  3944. return "\\" + (num - 0 + 1);
  3945. };
  3946. for ( var type in Expr.match ) {
  3947. Expr.match[ type ] = new RegExp( Expr.match[ type ].source + (/(?![^\[]*\])(?![^\(]*\))/.source) );
  3948. Expr.leftMatch[ type ] = new RegExp( /(^(?:.|\r|\n)*?)/.source + Expr.match[ type ].source.replace(/\\(\d+)/g, fescape) );
  3949. }
  3950. var makeArray = function( array, results ) {
  3951. array = Array.prototype.slice.call( array, 0 );
  3952. if ( results ) {
  3953. results.push.apply( results, array );
  3954. return results;
  3955. }
  3956. return array;
  3957. };
  3958. // Perform a simple check to determine if the browser is capable of
  3959. // converting a NodeList to an array using builtin methods.
  3960. // Also verifies that the returned array holds DOM nodes
  3961. // (which is not the case in the Blackberry browser)
  3962. try {
  3963. Array.prototype.slice.call( document.documentElement.childNodes, 0 )[0].nodeType;
  3964. // Provide a fallback method if it does not work
  3965. } catch( e ) {
  3966. makeArray = function( array, results ) {
  3967. var i = 0,
  3968. ret = results || [];
  3969. if ( toString.call(array) === "[object Array]" ) {
  3970. Array.prototype.push.apply( ret, array );
  3971. } else {
  3972. if ( typeof array.length === "number" ) {
  3973. for ( var l = array.length; i < l; i++ ) {
  3974. ret.push( array[i] );
  3975. }
  3976. } else {
  3977. for ( ; array[i]; i++ ) {
  3978. ret.push( array[i] );
  3979. }
  3980. }
  3981. }
  3982. return ret;
  3983. };
  3984. }
  3985. var sortOrder, siblingCheck;
  3986. if ( document.documentElement.compareDocumentPosition ) {
  3987. sortOrder = function( a, b ) {
  3988. if ( a === b ) {
  3989. hasDuplicate = true;
  3990. return 0;
  3991. }
  3992. if ( !a.compareDocumentPosition || !b.compareDocumentPosition ) {
  3993. return a.compareDocumentPosition ? -1 : 1;
  3994. }
  3995. return a.compareDocumentPosition(b) & 4 ? -1 : 1;
  3996. };
  3997. } else {
  3998. sortOrder = function( a, b ) {
  3999. // The nodes are identical, we can exit early
  4000. if ( a === b ) {
  4001. hasDuplicate = true;
  4002. return 0;
  4003. // Fallback to using sourceIndex (in IE) if it's available on both nodes
  4004. } else if ( a.sourceIndex && b.sourceIndex ) {
  4005. return a.sourceIndex - b.sourceIndex;
  4006. }
  4007. var al, bl,
  4008. ap = [],
  4009. bp = [],
  4010. aup = a.parentNode,
  4011. bup = b.parentNode,
  4012. cur = aup;
  4013. // If the nodes are siblings (or identical) we can do a quick check
  4014. if ( aup === bup ) {
  4015. return siblingCheck( a, b );
  4016. // If no parents were found then the nodes are disconnected
  4017. } else if ( !aup ) {
  4018. return -1;
  4019. } else if ( !bup ) {
  4020. return 1;
  4021. }
  4022. // Otherwise they're somewhere else in the tree so we need
  4023. // to build up a full list of the parentNodes for comparison
  4024. while ( cur ) {
  4025. ap.unshift( cur );
  4026. cur = cur.parentNode;
  4027. }
  4028. cur = bup;
  4029. while ( cur ) {
  4030. bp.unshift( cur );
  4031. cur = cur.parentNode;
  4032. }
  4033. al = ap.length;
  4034. bl = bp.length;
  4035. // Start walking down the tree looking for a discrepancy
  4036. for ( var i = 0; i < al && i < bl; i++ ) {
  4037. if ( ap[i] !== bp[i] ) {
  4038. return siblingCheck( ap[i], bp[i] );
  4039. }
  4040. }
  4041. // We ended someplace up the tree so do a sibling check
  4042. return i === al ?
  4043. siblingCheck( a, bp[i], -1 ) :
  4044. siblingCheck( ap[i], b, 1 );
  4045. };
  4046. siblingCheck = function( a, b, ret ) {
  4047. if ( a === b ) {
  4048. return ret;
  4049. }
  4050. var cur = a.nextSibling;
  4051. while ( cur ) {
  4052. if ( cur === b ) {
  4053. return -1;
  4054. }
  4055. cur = cur.nextSibling;
  4056. }
  4057. return 1;
  4058. };
  4059. }
  4060. // Check to see if the browser returns elements by name when
  4061. // querying by getElementById (and provide a workaround)
  4062. (function(){
  4063. // We're going to inject a fake input element with a specified name
  4064. var form = document.createElement("div"),
  4065. id = "script" + (new Date()).getTime(),
  4066. root = document.documentElement;
  4067. form.innerHTML = "<a name='" + id + "'/>";
  4068. // Inject it into the root element, check its status, and remove it quickly
  4069. root.insertBefore( form, root.firstChild );
  4070. // The workaround has to do additional checks after a getElementById
  4071. // Which slows things down for other browsers (hence the branching)
  4072. if ( document.getElementById( id ) ) {
  4073. Expr.find.ID = function( match, context, isXML ) {
  4074. if ( typeof context.getElementById !== "undefined" && !isXML ) {
  4075. var m = context.getElementById(match[1]);
  4076. return m ?
  4077. m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ?
  4078. [m] :
  4079. undefined :
  4080. [];
  4081. }
  4082. };
  4083. Expr.filter.ID = function( elem, match ) {
  4084. var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id");
  4085. return elem.nodeType === 1 && node && node.nodeValue === match;
  4086. };
  4087. }
  4088. root.removeChild( form );
  4089. // release memory in IE
  4090. root = form = null;
  4091. })();
  4092. (function(){
  4093. // Check to see if the browser returns only elements
  4094. // when doing getElementsByTagName("*")
  4095. // Create a fake element
  4096. var div = document.createElement("div");
  4097. div.appendChild( document.createComment("") );
  4098. // Make sure no comments are found
  4099. if ( div.getElementsByTagName("*").length > 0 ) {
  4100. Expr.find.TAG = function( match, context ) {
  4101. var results = context.getElementsByTagName( match[1] );
  4102. // Filter out possible comments
  4103. if ( match[1] === "*" ) {
  4104. var tmp = [];
  4105. for ( var i = 0; results[i]; i++ ) {
  4106. if ( results[i].nodeType === 1 ) {
  4107. tmp.push( results[i] );
  4108. }
  4109. }
  4110. results = tmp;
  4111. }
  4112. return results;
  4113. };
  4114. }
  4115. // Check to see if an attribute returns normalized href attributes
  4116. div.innerHTML = "<a href='#'></a>";
  4117. if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" &&
  4118. div.firstChild.getAttribute("href") !== "#" ) {
  4119. Expr.attrHandle.href = function( elem ) {
  4120. return elem.getAttribute( "href", 2 );
  4121. };
  4122. }
  4123. // release memory in IE
  4124. div = null;
  4125. })();
  4126. if ( document.querySelectorAll ) {
  4127. (function(){
  4128. var oldSizzle = Sizzle,
  4129. div = document.createElement("div"),
  4130. id = "__sizzle__";
  4131. div.innerHTML = "<p class='TEST'></p>";
  4132. // Safari can't handle uppercase or unicode characters when
  4133. // in quirks mode.
  4134. if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) {
  4135. return;
  4136. }
  4137. Sizzle = function( query, context, extra, seed ) {
  4138. context = context || document;
  4139. // Only use querySelectorAll on non-XML documents
  4140. // (ID selectors don't work in non-HTML documents)
  4141. if ( !seed && !Sizzle.isXML(context) ) {
  4142. // See if we find a selector to speed up
  4143. var match = /^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec( query );
  4144. if ( match && (context.nodeType === 1 || context.nodeType === 9) ) {
  4145. // Speed-up: Sizzle("TAG")
  4146. if ( match[1] ) {
  4147. return makeArray( context.getElementsByTagName( query ), extra );
  4148. // Speed-up: Sizzle(".CLASS")
  4149. } else if ( match[2] && Expr.find.CLASS && context.getElementsByClassName ) {
  4150. return makeArray( context.getElementsByClassName( match[2] ), extra );
  4151. }
  4152. }
  4153. if ( context.nodeType === 9 ) {
  4154. // Speed-up: Sizzle("body")
  4155. // The body element only exists once, optimize finding it
  4156. if ( query === "body" && context.body ) {
  4157. return makeArray( [ context.body ], extra );
  4158. // Speed-up: Sizzle("#ID")
  4159. } else if ( match && match[3] ) {
  4160. var elem = context.getElementById( match[3] );
  4161. // Check parentNode to catch when Blackberry 4.6 returns
  4162. // nodes that are no longer in the document #6963
  4163. if ( elem && elem.parentNode ) {
  4164. // Handle the case where IE and Opera return items
  4165. // by name instead of ID
  4166. if ( elem.id === match[3] ) {
  4167. return makeArray( [ elem ], extra );
  4168. }
  4169. } else {
  4170. return makeArray( [], extra );
  4171. }
  4172. }
  4173. try {
  4174. return makeArray( context.querySelectorAll(query), extra );
  4175. } catch(qsaError) {}
  4176. // qSA works strangely on Element-rooted queries
  4177. // We can work around this by specifying an extra ID on the root
  4178. // and working up from there (Thanks to Andrew Dupont for the technique)
  4179. // IE 8 doesn't work on object elements
  4180. } else if ( context.nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) {
  4181. var oldContext = context,
  4182. old = context.getAttribute( "id" ),
  4183. nid = old || id,
  4184. hasParent = context.parentNode,
  4185. relativeHierarchySelector = /^\s*[+~]/.test( query );
  4186. if ( !old ) {
  4187. context.setAttribute( "id", nid );
  4188. } else {
  4189. nid = nid.replace( /'/g, "\\$&" );
  4190. }
  4191. if ( relativeHierarchySelector && hasParent ) {
  4192. context = context.parentNode;
  4193. }
  4194. try {
  4195. if ( !relativeHierarchySelector || hasParent ) {
  4196. return makeArray( context.querySelectorAll( "[id='" + nid + "'] " + query ), extra );
  4197. }
  4198. } catch(pseudoError) {
  4199. } finally {
  4200. if ( !old ) {
  4201. oldContext.removeAttribute( "id" );
  4202. }
  4203. }
  4204. }
  4205. }
  4206. return oldSizzle(query, context, extra, seed);
  4207. };
  4208. for ( var prop in oldSizzle ) {
  4209. Sizzle[ prop ] = oldSizzle[ prop ];
  4210. }
  4211. // release memory in IE
  4212. div = null;
  4213. })();
  4214. }
  4215. (function(){
  4216. var html = document.documentElement,
  4217. matches = html.matchesSelector || html.mozMatchesSelector || html.webkitMatchesSelector || html.msMatchesSelector;
  4218. if ( matches ) {
  4219. // Check to see if it's possible to do matchesSelector
  4220. // on a disconnected node (IE 9 fails this)
  4221. var disconnectedMatch = !matches.call( document.createElement( "div" ), "div" ),
  4222. pseudoWorks = false;
  4223. try {
  4224. // This should fail with an exception
  4225. // Gecko does not error, returns false instead
  4226. matches.call( document.documentElement, "[test!='']:sizzle" );
  4227. } catch( pseudoError ) {
  4228. pseudoWorks = true;
  4229. }
  4230. Sizzle.matchesSelector = function( node, expr ) {
  4231. // Make sure that attribute selectors are quoted
  4232. expr = expr.replace(/\=\s*([^'"\]]*)\s*\]/g, "='$1']");
  4233. if ( !Sizzle.isXML( node ) ) {
  4234. try {
  4235. if ( pseudoWorks || !Expr.match.PSEUDO.test( expr ) && !/!=/.test( expr ) ) {
  4236. var ret = matches.call( node, expr );
  4237. // IE 9's matchesSelector returns false on disconnected nodes
  4238. if ( ret || !disconnectedMatch ||
  4239. // As well, disconnected nodes are said to be in a document
  4240. // fragment in IE 9, so check for that
  4241. node.document && node.document.nodeType !== 11 ) {
  4242. return ret;
  4243. }
  4244. }
  4245. } catch(e) {}
  4246. }
  4247. return Sizzle(expr, null, null, [node]).length > 0;
  4248. };
  4249. }
  4250. })();
  4251. (function(){
  4252. var div = document.createElement("div");
  4253. div.innerHTML = "<div class='test e'></div><div class='test'></div>";
  4254. // Opera can't find a second classname (in 9.6)
  4255. // Also, make sure that getElementsByClassName actually exists
  4256. if ( !div.getElementsByClassName || div.getElementsByClassName("e").length === 0 ) {
  4257. return;
  4258. }
  4259. // Safari caches class attributes, doesn't catch changes (in 3.2)
  4260. div.lastChild.className = "e";
  4261. if ( div.getElementsByClassName("e").length === 1 ) {
  4262. return;
  4263. }
  4264. Expr.order.splice(1, 0, "CLASS");
  4265. Expr.find.CLASS = function( match, context, isXML ) {
  4266. if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) {
  4267. return context.getElementsByClassName(match[1]);
  4268. }
  4269. };
  4270. // release memory in IE
  4271. div = null;
  4272. })();
  4273. function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
  4274. for ( var i = 0, l = checkSet.length; i < l; i++ ) {
  4275. var elem = checkSet[i];
  4276. if ( elem ) {
  4277. var match = false;
  4278. elem = elem[dir];
  4279. while ( elem ) {
  4280. if ( elem[ expando ] === doneName ) {
  4281. match = checkSet[elem.sizset];
  4282. break;
  4283. }
  4284. if ( elem.nodeType === 1 && !isXML ){
  4285. elem[ expando ] = doneName;
  4286. elem.sizset = i;
  4287. }
  4288. if ( elem.nodeName.toLowerCase() === cur ) {
  4289. match = elem;
  4290. break;
  4291. }
  4292. elem = elem[dir];
  4293. }
  4294. checkSet[i] = match;
  4295. }
  4296. }
  4297. }
  4298. function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
  4299. for ( var i = 0, l = checkSet.length; i < l; i++ ) {
  4300. var elem = checkSet[i];
  4301. if ( elem ) {
  4302. var match = false;
  4303. elem = elem[dir];
  4304. while ( elem ) {
  4305. if ( elem[ expando ] === doneName ) {
  4306. match = checkSet[elem.sizset];
  4307. break;
  4308. }
  4309. if ( elem.nodeType === 1 ) {
  4310. if ( !isXML ) {
  4311. elem[ expando ] = doneName;
  4312. elem.sizset = i;
  4313. }
  4314. if ( typeof cur !== "string" ) {
  4315. if ( elem === cur ) {
  4316. match = true;
  4317. break;
  4318. }
  4319. } else if ( Sizzle.filter( cur, [elem] ).length > 0 ) {
  4320. match = elem;
  4321. break;
  4322. }
  4323. }
  4324. elem = elem[dir];
  4325. }
  4326. checkSet[i] = match;
  4327. }
  4328. }
  4329. }
  4330. if ( document.documentElement.contains ) {
  4331. Sizzle.contains = function( a, b ) {
  4332. return a !== b && (a.contains ? a.contains(b) : true);
  4333. };
  4334. } else if ( document.documentElement.compareDocumentPosition ) {
  4335. Sizzle.contains = function( a, b ) {
  4336. return !!(a.compareDocumentPosition(b) & 16);
  4337. };
  4338. } else {
  4339. Sizzle.contains = function() {
  4340. return false;
  4341. };
  4342. }
  4343. Sizzle.isXML = function( elem ) {
  4344. // documentElement is verified for cases where it doesn't yet exist
  4345. // (such as loading iframes in IE - #4833)
  4346. var documentElement = (elem ? elem.ownerDocument || elem : 0).documentElement;
  4347. return documentElement ? documentElement.nodeName !== "HTML" : false;
  4348. };
  4349. var posProcess = function( selector, context, seed ) {
  4350. var match,
  4351. tmpSet = [],
  4352. later = "",
  4353. root = context.nodeType ? [context] : context;
  4354. // Position selectors must be done after the filter
  4355. // And so must :not(positional) so we move all PSEUDOs to the end
  4356. while ( (match = Expr.match.PSEUDO.exec( selector )) ) {
  4357. later += match[0];
  4358. selector = selector.replace( Expr.match.PSEUDO, "" );
  4359. }
  4360. selector = Expr.relative[selector] ? selector + "*" : selector;
  4361. for ( var i = 0, l = root.length; i < l; i++ ) {
  4362. Sizzle( selector, root[i], tmpSet, seed );
  4363. }
  4364. return Sizzle.filter( later, tmpSet );
  4365. };
  4366. // EXPOSE
  4367. // Override sizzle attribute retrieval
  4368. Sizzle.attr = jQuery.attr;
  4369. Sizzle.selectors.attrMap = {};
  4370. jQuery.find = Sizzle;
  4371. jQuery.expr = Sizzle.selectors;
  4372. jQuery.expr[":"] = jQuery.expr.filters;
  4373. jQuery.unique = Sizzle.uniqueSort;
  4374. jQuery.text = Sizzle.getText;
  4375. jQuery.isXMLDoc = Sizzle.isXML;
  4376. jQuery.contains = Sizzle.contains;
  4377. })();
  4378. var runtil = /Until$/,
  4379. rparentsprev = /^(?:parents|prevUntil|prevAll)/,
  4380. // Note: This RegExp should be improved, or likely pulled from Sizzle
  4381. rmultiselector = /,/,
  4382. isSimple = /^.[^:#\[\.,]*$/,
  4383. slice = Array.prototype.slice,
  4384. POS = jQuery.expr.match.POS,
  4385. // methods guaranteed to produce a unique set when starting from a unique set
  4386. guaranteedUnique = {
  4387. children: true,
  4388. contents: true,
  4389. next: true,
  4390. prev: true
  4391. };
  4392. jQuery.fn.extend({
  4393. find: function( selector ) {
  4394. var self = this,
  4395. i, l;
  4396. if ( typeof selector !== "string" ) {
  4397. return jQuery( selector ).filter(function() {
  4398. for ( i = 0, l = self.length; i < l; i++ ) {
  4399. if ( jQuery.contains( self[ i ], this ) ) {
  4400. return true;
  4401. }
  4402. }
  4403. });
  4404. }
  4405. var ret = this.pushStack( "", "find", selector ),
  4406. length, n, r;
  4407. for ( i = 0, l = this.length; i < l; i++ ) {
  4408. length = ret.length;
  4409. jQuery.find( selector, this[i], ret );
  4410. if ( i > 0 ) {
  4411. // Make sure that the results are unique
  4412. for ( n = length; n < ret.length; n++ ) {
  4413. for ( r = 0; r < length; r++ ) {
  4414. if ( ret[r] === ret[n] ) {
  4415. ret.splice(n--, 1);
  4416. break;
  4417. }
  4418. }
  4419. }
  4420. }
  4421. }
  4422. return ret;
  4423. },
  4424. has: function( target ) {
  4425. var targets = jQuery( target );
  4426. return this.filter(function() {
  4427. for ( var i = 0, l = targets.length; i < l; i++ ) {
  4428. if ( jQuery.contains( this, targets[i] ) ) {
  4429. return true;
  4430. }
  4431. }
  4432. });
  4433. },
  4434. not: function( selector ) {
  4435. return this.pushStack( winnow(this, selector, false), "not", selector);
  4436. },
  4437. filter: function( selector ) {
  4438. return this.pushStack( winnow(this, selector, true), "filter", selector );
  4439. },
  4440. is: function( selector ) {
  4441. return !!selector && (
  4442. typeof selector === "string" ?
  4443. // If this is a positional selector, check membership in the returned set
  4444. // so $("p:first").is("p:last") won't return true for a doc with two "p".
  4445. POS.test( selector ) ?
  4446. jQuery( selector, this.context ).index( this[0] ) >= 0 :
  4447. jQuery.filter( selector, this ).length > 0 :
  4448. this.filter( selector ).length > 0 );
  4449. },
  4450. closest: function( selectors, context ) {
  4451. var ret = [], i, l, cur = this[0];
  4452. // Array (deprecated as of jQuery 1.7)
  4453. if ( jQuery.isArray( selectors ) ) {
  4454. var level = 1;
  4455. while ( cur && cur.ownerDocument && cur !== context ) {
  4456. for ( i = 0; i < selectors.length; i++ ) {
  4457. if ( jQuery( cur ).is( selectors[ i ] ) ) {
  4458. ret.push({ selector: selectors[ i ], elem: cur, level: level });
  4459. }
  4460. }
  4461. cur = cur.parentNode;
  4462. level++;
  4463. }
  4464. return ret;
  4465. }
  4466. // String
  4467. var pos = POS.test( selectors ) || typeof selectors !== "string" ?
  4468. jQuery( selectors, context || this.context ) :
  4469. 0;
  4470. for ( i = 0, l = this.length; i < l; i++ ) {
  4471. cur = this[i];
  4472. while ( cur ) {
  4473. if ( pos ? pos.index(cur) > -1 : jQuery.find.matchesSelector(cur, selectors) ) {
  4474. ret.push( cur );
  4475. break;
  4476. } else {
  4477. cur = cur.parentNode;
  4478. if ( !cur || !cur.ownerDocument || cur === context || cur.nodeType === 11 ) {
  4479. break;
  4480. }
  4481. }
  4482. }
  4483. }
  4484. ret = ret.length > 1 ? jQuery.unique( ret ) : ret;
  4485. return this.pushStack( ret, "closest", selectors );
  4486. },
  4487. // Determine the position of an element within
  4488. // the matched set of elements
  4489. index: function( elem ) {
  4490. // No argument, return index in parent
  4491. if ( !elem ) {
  4492. return ( this[0] && this[0].parentNode ) ? this.prevAll().length : -1;
  4493. }
  4494. // index in selector
  4495. if ( typeof elem === "string" ) {
  4496. return jQuery.inArray( this[0], jQuery( elem ) );
  4497. }
  4498. // Locate the position of the desired element
  4499. return jQuery.inArray(
  4500. // If it receives a jQuery object, the first element is used
  4501. elem.jquery ? elem[0] : elem, this );
  4502. },
  4503. add: function( selector, context ) {
  4504. var set = typeof selector === "string" ?
  4505. jQuery( selector, context ) :
  4506. jQuery.makeArray( selector && selector.nodeType ? [ selector ] : selector ),
  4507. all = jQuery.merge( this.get(), set );
  4508. return this.pushStack( isDisconnected( set[0] ) || isDisconnected( all[0] ) ?
  4509. all :
  4510. jQuery.unique( all ) );
  4511. },
  4512. andSelf: function() {
  4513. return this.add( this.prevObject );
  4514. }
  4515. });
  4516. // A painfully simple check to see if an element is disconnected
  4517. // from a document (should be improved, where feasible).
  4518. function isDisconnected( node ) {
  4519. return !node || !node.parentNode || node.parentNode.nodeType === 11;
  4520. }
  4521. jQuery.each({
  4522. parent: function( elem ) {
  4523. var parent = elem.parentNode;
  4524. return parent && parent.nodeType !== 11 ? parent : null;
  4525. },
  4526. parents: function( elem ) {
  4527. return jQuery.dir( elem, "parentNode" );
  4528. },
  4529. parentsUntil: function( elem, i, until ) {
  4530. return jQuery.dir( elem, "parentNode", until );
  4531. },
  4532. next: function( elem ) {
  4533. return jQuery.nth( elem, 2, "nextSibling" );
  4534. },
  4535. prev: function( elem ) {
  4536. return jQuery.nth( elem, 2, "previousSibling" );
  4537. },
  4538. nextAll: function( elem ) {
  4539. return jQuery.dir( elem, "nextSibling" );
  4540. },
  4541. prevAll: function( elem ) {
  4542. return jQuery.dir( elem, "previousSibling" );
  4543. },
  4544. nextUntil: function( elem, i, until ) {
  4545. return jQuery.dir( elem, "nextSibling", until );
  4546. },
  4547. prevUntil: function( elem, i, until ) {
  4548. return jQuery.dir( elem, "previousSibling", until );
  4549. },
  4550. siblings: function( elem ) {
  4551. return jQuery.sibling( elem.parentNode.firstChild, elem );
  4552. },
  4553. children: function( elem ) {
  4554. return jQuery.sibling( elem.firstChild );
  4555. },
  4556. contents: function( elem ) {
  4557. return jQuery.nodeName( elem, "iframe" ) ?
  4558. elem.contentDocument || elem.contentWindow.document :
  4559. jQuery.makeArray( elem.childNodes );
  4560. }
  4561. }, function( name, fn ) {
  4562. jQuery.fn[ name ] = function( until, selector ) {
  4563. var ret = jQuery.map( this, fn, until );
  4564. if ( !runtil.test( name ) ) {
  4565. selector = until;
  4566. }
  4567. if ( selector && typeof selector === "string" ) {
  4568. ret = jQuery.filter( selector, ret );
  4569. }
  4570. ret = this.length > 1 && !guaranteedUnique[ name ] ? jQuery.unique( ret ) : ret;
  4571. if ( (this.length > 1 || rmultiselector.test( selector )) && rparentsprev.test( name ) ) {
  4572. ret = ret.reverse();
  4573. }
  4574. return this.pushStack( ret, name, slice.call( arguments ).join(",") );
  4575. };
  4576. });
  4577. jQuery.extend({
  4578. filter: function( expr, elems, not ) {
  4579. if ( not ) {
  4580. expr = ":not(" + expr + ")";
  4581. }
  4582. return elems.length === 1 ?
  4583. jQuery.find.matchesSelector(elems[0], expr) ? [ elems[0] ] : [] :
  4584. jQuery.find.matches(expr, elems);
  4585. },
  4586. dir: function( elem, dir, until ) {
  4587. var matched = [],
  4588. cur = elem[ dir ];
  4589. while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) {
  4590. if ( cur.nodeType === 1 ) {
  4591. matched.push( cur );
  4592. }
  4593. cur = cur[dir];
  4594. }
  4595. return matched;
  4596. },
  4597. nth: function( cur, result, dir, elem ) {
  4598. result = result || 1;
  4599. var num = 0;
  4600. for ( ; cur; cur = cur[dir] ) {
  4601. if ( cur.nodeType === 1 && ++num === result ) {
  4602. break;
  4603. }
  4604. }
  4605. return cur;
  4606. },
  4607. sibling: function( n, elem ) {
  4608. var r = [];
  4609. for ( ; n; n = n.nextSibling ) {
  4610. if ( n.nodeType === 1 && n !== elem ) {
  4611. r.push( n );
  4612. }
  4613. }
  4614. return r;
  4615. }
  4616. });
  4617. // Implement the identical functionality for filter and not
  4618. function winnow( elements, qualifier, keep ) {
  4619. // Can't pass null or undefined to indexOf in Firefox 4
  4620. // Set to 0 to skip string check
  4621. qualifier = qualifier || 0;
  4622. if ( jQuery.isFunction( qualifier ) ) {
  4623. return jQuery.grep(elements, function( elem, i ) {
  4624. var retVal = !!qualifier.call( elem, i, elem );
  4625. return retVal === keep;
  4626. });
  4627. } else if ( qualifier.nodeType ) {
  4628. return jQuery.grep(elements, function( elem, i ) {
  4629. return ( elem === qualifier ) === keep;
  4630. });
  4631. } else if ( typeof qualifier === "string" ) {
  4632. var filtered = jQuery.grep(elements, function( elem ) {
  4633. return elem.nodeType === 1;
  4634. });
  4635. if ( isSimple.test( qualifier ) ) {
  4636. return jQuery.filter(qualifier, filtered, !keep);
  4637. } else {
  4638. qualifier = jQuery.filter( qualifier, filtered );
  4639. }
  4640. }
  4641. return jQuery.grep(elements, function( elem, i ) {
  4642. return ( jQuery.inArray( elem, qualifier ) >= 0 ) === keep;
  4643. });
  4644. }
  4645. function createSafeFragment( document ) {
  4646. var list = nodeNames.split( "|" ),
  4647. safeFrag = document.createDocumentFragment();
  4648. if ( safeFrag.createElement ) {
  4649. while ( list.length ) {
  4650. safeFrag.createElement(
  4651. list.pop()
  4652. );
  4653. }
  4654. }
  4655. return safeFrag;
  4656. }
  4657. var nodeNames = "abbr|article|aside|audio|canvas|datalist|details|figcaption|figure|footer|" +
  4658. "header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",
  4659. rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g,
  4660. rleadingWhitespace = /^\s+/,
  4661. rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,
  4662. rtagName = /<([\w:]+)/,
  4663. rtbody = /<tbody/i,
  4664. rhtml = /<|&#?\w+;/,
  4665. rnoInnerhtml = /<(?:script|style)/i,
  4666. rnocache = /<(?:script|object|embed|option|style)/i,
  4667. rnoshimcache = new RegExp("<(?:" + nodeNames + ")", "i"),
  4668. // checked="checked" or checked
  4669. rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
  4670. rscriptType = /\/(java|ecma)script/i,
  4671. rcleanScript = /^\s*<!(?:\[CDATA\[|\-\-)/,
  4672. wrapMap = {
  4673. option: [ 1, "<select multiple='multiple'>", "</select>" ],
  4674. legend: [ 1, "<fieldset>", "</fieldset>" ],
  4675. thead: [ 1, "<table>", "</table>" ],
  4676. tr: [ 2, "<table><tbody>", "</tbody></table>" ],
  4677. td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
  4678. col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ],
  4679. area: [ 1, "<map>", "</map>" ],
  4680. _default: [ 0, "", "" ]
  4681. },
  4682. safeFragment = createSafeFragment( document );
  4683. wrapMap.optgroup = wrapMap.option;
  4684. wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
  4685. wrapMap.th = wrapMap.td;
  4686. // IE can't serialize <link> and <script> tags normally
  4687. if ( !jQuery.support.htmlSerialize ) {
  4688. wrapMap._default = [ 1, "div<div>", "</div>" ];
  4689. }
  4690. jQuery.fn.extend({
  4691. text: function( text ) {
  4692. if ( jQuery.isFunction(text) ) {
  4693. return this.each(function(i) {
  4694. var self = jQuery( this );
  4695. self.text( text.call(this, i, self.text()) );
  4696. });
  4697. }
  4698. if ( typeof text !== "object" && text !== undefined ) {
  4699. return this.empty().append( (this[0] && this[0].ownerDocument || document).createTextNode( text ) );
  4700. }
  4701. return jQuery.text( this );
  4702. },
  4703. wrapAll: function( html ) {
  4704. if ( jQuery.isFunction( html ) ) {
  4705. return this.each(function(i) {
  4706. jQuery(this).wrapAll( html.call(this, i) );
  4707. });
  4708. }
  4709. if ( this[0] ) {
  4710. // The elements to wrap the target around
  4711. var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone(true);
  4712. if ( this[0].parentNode ) {
  4713. wrap.insertBefore( this[0] );
  4714. }
  4715. wrap.map(function() {
  4716. var elem = this;
  4717. while ( elem.firstChild && elem.firstChild.nodeType === 1 ) {
  4718. elem = elem.firstChild;
  4719. }
  4720. return elem;
  4721. }).append( this );
  4722. }
  4723. return this;
  4724. },
  4725. wrapInner: function( html ) {
  4726. if ( jQuery.isFunction( html ) ) {
  4727. return this.each(function(i) {
  4728. jQuery(this).wrapInner( html.call(this, i) );
  4729. });
  4730. }
  4731. return this.each(function() {
  4732. var self = jQuery( this ),
  4733. contents = self.contents();
  4734. if ( contents.length ) {
  4735. contents.wrapAll( html );
  4736. } else {
  4737. self.append( html );
  4738. }
  4739. });
  4740. },
  4741. wrap: function( html ) {
  4742. var isFunction = jQuery.isFunction( html );
  4743. return this.each(function(i) {
  4744. jQuery( this ).wrapAll( isFunction ? html.call(this, i) : html );
  4745. });
  4746. },
  4747. unwrap: function() {
  4748. return this.parent().each(function() {
  4749. if ( !jQuery.nodeName( this, "body" ) ) {
  4750. jQuery( this ).replaceWith( this.childNodes );
  4751. }
  4752. }).end();
  4753. },
  4754. append: function() {
  4755. return this.domManip(arguments, true, function( elem ) {
  4756. if ( this.nodeType === 1 ) {
  4757. this.appendChild( elem );
  4758. }
  4759. });
  4760. },
  4761. prepend: function() {
  4762. return this.domManip(arguments, true, function( elem ) {
  4763. if ( this.nodeType === 1 ) {
  4764. this.insertBefore( elem, this.firstChild );
  4765. }
  4766. });
  4767. },
  4768. before: function() {
  4769. if ( this[0] && this[0].parentNode ) {
  4770. return this.domManip(arguments, false, function( elem ) {
  4771. this.parentNode.insertBefore( elem, this );
  4772. });
  4773. } else if ( arguments.length ) {
  4774. var set = jQuery.clean( arguments );
  4775. set.push.apply( set, this.toArray() );
  4776. return this.pushStack( set, "before", arguments );
  4777. }
  4778. },
  4779. after: function() {
  4780. if ( this[0] && this[0].parentNode ) {
  4781. return this.domManip(arguments, false, function( elem ) {
  4782. this.parentNode.insertBefore( elem, this.nextSibling );
  4783. });
  4784. } else if ( arguments.length ) {
  4785. var set = this.pushStack( this, "after", arguments );
  4786. set.push.apply( set, jQuery.clean(arguments) );
  4787. return set;
  4788. }
  4789. },
  4790. // keepData is for internal use only--do not document
  4791. remove: function( selector, keepData ) {
  4792. for ( var i = 0, elem; (elem = this[i]) != null; i++ ) {
  4793. if ( !selector || jQuery.filter( selector, [ elem ] ).length ) {
  4794. if ( !keepData && elem.nodeType === 1 ) {
  4795. jQuery.cleanData( elem.getElementsByTagName("*") );
  4796. jQuery.cleanData( [ elem ] );
  4797. }
  4798. if ( elem.parentNode ) {
  4799. elem.parentNode.removeChild( elem );
  4800. }
  4801. }
  4802. }
  4803. return this;
  4804. },
  4805. empty: function() {
  4806. for ( var i = 0, elem; (elem = this[i]) != null; i++ ) {
  4807. // Remove element nodes and prevent memory leaks
  4808. if ( elem.nodeType === 1 ) {
  4809. jQuery.cleanData( elem.getElementsByTagName("*") );
  4810. }
  4811. // Remove any remaining nodes
  4812. while ( elem.firstChild ) {
  4813. elem.removeChild( elem.firstChild );
  4814. }
  4815. }
  4816. return this;
  4817. },
  4818. clone: function( dataAndEvents, deepDataAndEvents ) {
  4819. dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
  4820. deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
  4821. return this.map( function () {
  4822. return jQuery.clone( this, dataAndEvents, deepDataAndEvents );
  4823. });
  4824. },
  4825. html: function( value ) {
  4826. if ( value === undefined ) {
  4827. return this[0] && this[0].nodeType === 1 ?
  4828. this[0].innerHTML.replace(rinlinejQuery, "") :
  4829. null;
  4830. // See if we can take a shortcut and just use innerHTML
  4831. } else if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&
  4832. (jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value )) &&
  4833. !wrapMap[ (rtagName.exec( value ) || ["", ""])[1].toLowerCase() ] ) {
  4834. value = value.replace(rxhtmlTag, "<$1></$2>");
  4835. try {
  4836. for ( var i = 0, l = this.length; i < l; i++ ) {
  4837. // Remove element nodes and prevent memory leaks
  4838. if ( this[i].nodeType === 1 ) {
  4839. jQuery.cleanData( this[i].getElementsByTagName("*") );
  4840. this[i].innerHTML = value;
  4841. }
  4842. }
  4843. // If using innerHTML throws an exception, use the fallback method
  4844. } catch(e) {
  4845. this.empty().append( value );
  4846. }
  4847. } else if ( jQuery.isFunction( value ) ) {
  4848. this.each(function(i){
  4849. var self = jQuery( this );
  4850. self.html( value.call(this, i, self.html()) );
  4851. });
  4852. } else {
  4853. this.empty().append( value );
  4854. }
  4855. return this;
  4856. },
  4857. replaceWith: function( value ) {
  4858. if ( this[0] && this[0].parentNode ) {
  4859. // Make sure that the elements are removed from the DOM before they are inserted
  4860. // this can help fix replacing a parent with child elements
  4861. if ( jQuery.isFunction( value ) ) {
  4862. return this.each(function(i) {
  4863. var self = jQuery(this), old = self.html();
  4864. self.replaceWith( value.call( this, i, old ) );
  4865. });
  4866. }
  4867. if ( typeof value !== "string" ) {
  4868. value = jQuery( value ).detach();
  4869. }
  4870. return this.each(function() {
  4871. var next = this.nextSibling,
  4872. parent = this.parentNode;
  4873. jQuery( this ).remove();
  4874. if ( next ) {
  4875. jQuery(next).before( value );
  4876. } else {
  4877. jQuery(parent).append( value );
  4878. }
  4879. });
  4880. } else {
  4881. return this.length ?
  4882. this.pushStack( jQuery(jQuery.isFunction(value) ? value() : value), "replaceWith", value ) :
  4883. this;
  4884. }
  4885. },
  4886. detach: function( selector ) {
  4887. return this.remove( selector, true );
  4888. },
  4889. domManip: function( args, table, callback ) {
  4890. var results, first, fragment, parent,
  4891. value = args[0],
  4892. scripts = [];
  4893. // We can't cloneNode fragments that contain checked, in WebKit
  4894. if ( !jQuery.support.checkClone && arguments.length === 3 && typeof value === "string" && rchecked.test( value ) ) {
  4895. return this.each(function() {
  4896. jQuery(this).domManip( args, table, callback, true );
  4897. });
  4898. }
  4899. if ( jQuery.isFunction(value) ) {
  4900. return this.each(function(i) {
  4901. var self = jQuery(this);
  4902. args[0] = value.call(this, i, table ? self.html() : undefined);
  4903. self.domManip( args, table, callback );
  4904. });
  4905. }
  4906. if ( this[0] ) {
  4907. parent = value && value.parentNode;
  4908. // If we're in a fragment, just use that instead of building a new one
  4909. if ( jQuery.support.parentNode && parent && parent.nodeType === 11 && parent.childNodes.length === this.length ) {
  4910. results = { fragment: parent };
  4911. } else {
  4912. results = jQuery.buildFragment( args, this, scripts );
  4913. }
  4914. fragment = results.fragment;
  4915. if ( fragment.childNodes.length === 1 ) {
  4916. first = fragment = fragment.firstChild;
  4917. } else {
  4918. first = fragment.firstChild;
  4919. }
  4920. if ( first ) {
  4921. table = table && jQuery.nodeName( first, "tr" );
  4922. for ( var i = 0, l = this.length, lastIndex = l - 1; i < l; i++ ) {
  4923. callback.call(
  4924. table ?
  4925. root(this[i], first) :
  4926. this[i],
  4927. // Make sure that we do not leak memory by inadvertently discarding
  4928. // the original fragment (which might have attached data) instead of
  4929. // using it; in addition, use the original fragment object for the last
  4930. // item instead of first because it can end up being emptied incorrectly
  4931. // in certain situations (Bug #8070).
  4932. // Fragments from the fragment cache must always be cloned and never used
  4933. // in place.
  4934. results.cacheable || ( l > 1 && i < lastIndex ) ?
  4935. jQuery.clone( fragment, true, true ) :
  4936. fragment
  4937. );
  4938. }
  4939. }
  4940. if ( scripts.length ) {
  4941. jQuery.each( scripts, evalScript );
  4942. }
  4943. }
  4944. return this;
  4945. }
  4946. });
  4947. function root( elem, cur ) {
  4948. return jQuery.nodeName(elem, "table") ?
  4949. (elem.getElementsByTagName("tbody")[0] ||
  4950. elem.appendChild(elem.ownerDocument.createElement("tbody"))) :
  4951. elem;
  4952. }
  4953. function cloneCopyEvent( src, dest ) {
  4954. if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) {
  4955. return;
  4956. }
  4957. var type, i, l,
  4958. oldData = jQuery._data( src ),
  4959. curData = jQuery._data( dest, oldData ),
  4960. events = oldData.events;
  4961. if ( events ) {
  4962. delete curData.handle;
  4963. curData.events = {};
  4964. for ( type in events ) {
  4965. for ( i = 0, l = events[ type ].length; i < l; i++ ) {
  4966. jQuery.event.add( dest, type + ( events[ type ][ i ].namespace ? "." : "" ) + events[ type ][ i ].namespace, events[ type ][ i ], events[ type ][ i ].data );
  4967. }
  4968. }
  4969. }
  4970. // make the cloned public data object a copy from the original
  4971. if ( curData.data ) {
  4972. curData.data = jQuery.extend( {}, curData.data );
  4973. }
  4974. }
  4975. function cloneFixAttributes( src, dest ) {
  4976. var nodeName;
  4977. // We do not need to do anything for non-Elements
  4978. if ( dest.nodeType !== 1 ) {
  4979. return;
  4980. }
  4981. // clearAttributes removes the attributes, which we don't want,
  4982. // but also removes the attachEvent events, which we *do* want
  4983. if ( dest.clearAttributes ) {
  4984. dest.clearAttributes();
  4985. }
  4986. // mergeAttributes, in contrast, only merges back on the
  4987. // original attributes, not the events
  4988. if ( dest.mergeAttributes ) {
  4989. dest.mergeAttributes( src );
  4990. }
  4991. nodeName = dest.nodeName.toLowerCase();
  4992. // IE6-8 fail to clone children inside object elements that use
  4993. // the proprietary classid attribute value (rather than the type
  4994. // attribute) to identify the type of content to display
  4995. if ( nodeName === "object" ) {
  4996. dest.outerHTML = src.outerHTML;
  4997. } else if ( nodeName === "input" && (src.type === "checkbox" || src.type === "radio") ) {
  4998. // IE6-8 fails to persist the checked state of a cloned checkbox
  4999. // or radio button. Worse, IE6-7 fail to give the cloned element
  5000. // a checked appearance if the defaultChecked value isn't also set
  5001. if ( src.checked ) {
  5002. dest.defaultChecked = dest.checked = src.checked;
  5003. }
  5004. // IE6-7 get confused and end up setting the value of a cloned
  5005. // checkbox/radio button to an empty string instead of "on"
  5006. if ( dest.value !== src.value ) {
  5007. dest.value = src.value;
  5008. }
  5009. // IE6-8 fails to return the selected option to the default selected
  5010. // state when cloning options
  5011. } else if ( nodeName === "option" ) {
  5012. dest.selected = src.defaultSelected;
  5013. // IE6-8 fails to set the defaultValue to the correct value when
  5014. // cloning other types of input fields
  5015. } else if ( nodeName === "input" || nodeName === "textarea" ) {
  5016. dest.defaultValue = src.defaultValue;
  5017. }
  5018. // Event data gets referenced instead of copied if the expando
  5019. // gets copied too
  5020. dest.removeAttribute( jQuery.expando );
  5021. }
  5022. jQuery.buildFragment = function( args, nodes, scripts ) {
  5023. var fragment, cacheable, cacheresults, doc,
  5024. first = args[ 0 ];
  5025. // nodes may contain either an explicit document object,
  5026. // a jQuery collection or context object.
  5027. // If nodes[0] contains a valid object to assign to doc
  5028. if ( nodes && nodes[0] ) {
  5029. doc = nodes[0].ownerDocument || nodes[0];
  5030. }
  5031. // Ensure that an attr object doesn't incorrectly stand in as a document object
  5032. // Chrome and Firefox seem to allow this to occur and will throw exception
  5033. // Fixes #8950
  5034. if ( !doc.createDocumentFragment ) {
  5035. doc = document;
  5036. }
  5037. // Only cache "small" (1/2 KB) HTML strings that are associated with the main document
  5038. // Cloning options loses the selected state, so don't cache them
  5039. // IE 6 doesn't like it when you put <object> or <embed> elements in a fragment
  5040. // Also, WebKit does not clone 'checked' attributes on cloneNode, so don't cache
  5041. // Lastly, IE6,7,8 will not correctly reuse cached fragments that were created from unknown elems #10501
  5042. if ( args.length === 1 && typeof first === "string" && first.length < 512 && doc === document &&
  5043. first.charAt(0) === "<" && !rnocache.test( first ) &&
  5044. (jQuery.support.checkClone || !rchecked.test( first )) &&
  5045. (jQuery.support.html5Clone || !rnoshimcache.test( first )) ) {
  5046. cacheable = true;
  5047. cacheresults = jQuery.fragments[ first ];
  5048. if ( cacheresults && cacheresults !== 1 ) {
  5049. fragment = cacheresults;
  5050. }
  5051. }
  5052. if ( !fragment ) {
  5053. fragment = doc.createDocumentFragment();
  5054. jQuery.clean( args, doc, fragment, scripts );
  5055. }
  5056. if ( cacheable ) {
  5057. jQuery.fragments[ first ] = cacheresults ? fragment : 1;
  5058. }
  5059. return { fragment: fragment, cacheable: cacheable };
  5060. };
  5061. jQuery.fragments = {};
  5062. jQuery.each({
  5063. appendTo: "append",
  5064. prependTo: "prepend",
  5065. insertBefore: "before",
  5066. insertAfter: "after",
  5067. replaceAll: "replaceWith"
  5068. }, function( name, original ) {
  5069. jQuery.fn[ name ] = function( selector ) {
  5070. var ret = [],
  5071. insert = jQuery( selector ),
  5072. parent = this.length === 1 && this[0].parentNode;
  5073. if ( parent && parent.nodeType === 11 && parent.childNodes.length === 1 && insert.length === 1 ) {
  5074. insert[ original ]( this[0] );
  5075. return this;
  5076. } else {
  5077. for ( var i = 0, l = insert.length; i < l; i++ ) {
  5078. var elems = ( i > 0 ? this.clone(true) : this ).get();
  5079. jQuery( insert[i] )[ original ]( elems );
  5080. ret = ret.concat( elems );
  5081. }
  5082. return this.pushStack( ret, name, insert.selector );
  5083. }
  5084. };
  5085. });
  5086. function getAll( elem ) {
  5087. if ( typeof elem.getElementsByTagName !== "undefined" ) {
  5088. return elem.getElementsByTagName( "*" );
  5089. } else if ( typeof elem.querySelectorAll !== "undefined" ) {
  5090. return elem.querySelectorAll( "*" );
  5091. } else {
  5092. return [];
  5093. }
  5094. }
  5095. // Used in clean, fixes the defaultChecked property
  5096. function fixDefaultChecked( elem ) {
  5097. if ( elem.type === "checkbox" || elem.type === "radio" ) {
  5098. elem.defaultChecked = elem.checked;
  5099. }
  5100. }
  5101. // Finds all inputs and passes them to fixDefaultChecked
  5102. function findInputs( elem ) {
  5103. var nodeName = ( elem.nodeName || "" ).toLowerCase();
  5104. if ( nodeName === "input" ) {
  5105. fixDefaultChecked( elem );
  5106. // Skip scripts, get other children
  5107. } else if ( nodeName !== "script" && typeof elem.getElementsByTagName !== "undefined" ) {
  5108. jQuery.grep( elem.getElementsByTagName("input"), fixDefaultChecked );
  5109. }
  5110. }
  5111. // Derived From: http://www.iecss.com/shimprove/javascript/shimprove.1-0-1.js
  5112. function shimCloneNode( elem ) {
  5113. var div = document.createElement( "div" );
  5114. safeFragment.appendChild( div );
  5115. div.innerHTML = elem.outerHTML;
  5116. return div.firstChild;
  5117. }
  5118. jQuery.extend({
  5119. clone: function( elem, dataAndEvents, deepDataAndEvents ) {
  5120. var srcElements,
  5121. destElements,
  5122. i,
  5123. // IE<=8 does not properly clone detached, unknown element nodes
  5124. clone = jQuery.support.html5Clone || !rnoshimcache.test( "<" + elem.nodeName ) ?
  5125. elem.cloneNode( true ) :
  5126. shimCloneNode( elem );
  5127. if ( (!jQuery.support.noCloneEvent || !jQuery.support.noCloneChecked) &&
  5128. (elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) {
  5129. // IE copies events bound via attachEvent when using cloneNode.
  5130. // Calling detachEvent on the clone will also remove the events
  5131. // from the original. In order to get around this, we use some
  5132. // proprietary methods to clear the events. Thanks to MooTools
  5133. // guys for this hotness.
  5134. cloneFixAttributes( elem, clone );
  5135. // Using Sizzle here is crazy slow, so we use getElementsByTagName instead
  5136. srcElements = getAll( elem );
  5137. destElements = getAll( clone );
  5138. // Weird iteration because IE will replace the length property
  5139. // with an element if you are cloning the body and one of the
  5140. // elements on the page has a name or id of "length"
  5141. for ( i = 0; srcElements[i]; ++i ) {
  5142. // Ensure that the destination node is not null; Fixes #9587
  5143. if ( destElements[i] ) {
  5144. cloneFixAttributes( srcElements[i], destElements[i] );
  5145. }
  5146. }
  5147. }
  5148. // Copy the events from the original to the clone
  5149. if ( dataAndEvents ) {
  5150. cloneCopyEvent( elem, clone );
  5151. if ( deepDataAndEvents ) {
  5152. srcElements = getAll( elem );
  5153. destElements = getAll( clone );
  5154. for ( i = 0; srcElements[i]; ++i ) {
  5155. cloneCopyEvent( srcElements[i], destElements[i] );
  5156. }
  5157. }
  5158. }
  5159. srcElements = destElements = null;
  5160. // Return the cloned set
  5161. return clone;
  5162. },
  5163. clean: function( elems, context, fragment, scripts ) {
  5164. var checkScriptType;
  5165. context = context || document;
  5166. // !context.createElement fails in IE with an error but returns typeof 'object'
  5167. if ( typeof context.createElement === "undefined" ) {
  5168. context = context.ownerDocument || context[0] && context[0].ownerDocument || document;
  5169. }
  5170. var ret = [], j;
  5171. for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
  5172. if ( typeof elem === "number" ) {
  5173. elem += "";
  5174. }
  5175. if ( !elem ) {
  5176. continue;
  5177. }
  5178. // Convert html string into DOM nodes
  5179. if ( typeof elem === "string" ) {
  5180. if ( !rhtml.test( elem ) ) {
  5181. elem = context.createTextNode( elem );
  5182. } else {
  5183. // Fix "XHTML"-style tags in all browsers
  5184. elem = elem.replace(rxhtmlTag, "<$1></$2>");
  5185. // Trim whitespace, otherwise indexOf won't work as expected
  5186. var tag = ( rtagName.exec( elem ) || ["", ""] )[1].toLowerCase(),
  5187. wrap = wrapMap[ tag ] || wrapMap._default,
  5188. depth = wrap[0],
  5189. div = context.createElement("div");
  5190. // Append wrapper element to unknown element safe doc fragment
  5191. if ( context === document ) {
  5192. // Use the fragment we've already created for this document
  5193. safeFragment.appendChild( div );
  5194. } else {
  5195. // Use a fragment created with the owner document
  5196. createSafeFragment( context ).appendChild( div );
  5197. }
  5198. // Go to html and back, then peel off extra wrappers
  5199. div.innerHTML = wrap[1] + elem + wrap[2];
  5200. // Move to the right depth
  5201. while ( depth-- ) {
  5202. div = div.lastChild;
  5203. }
  5204. // Remove IE's autoinserted <tbody> from table fragments
  5205. if ( !jQuery.support.tbody ) {
  5206. // String was a <table>, *may* have spurious <tbody>
  5207. var hasBody = rtbody.test(elem),
  5208. tbody = tag === "table" && !hasBody ?
  5209. div.firstChild && div.firstChild.childNodes :
  5210. // String was a bare <thead> or <tfoot>
  5211. wrap[1] === "<table>" && !hasBody ?
  5212. div.childNodes :
  5213. [];
  5214. for ( j = tbody.length - 1; j >= 0 ; --j ) {
  5215. if ( jQuery.nodeName( tbody[ j ], "tbody" ) && !tbody[ j ].childNodes.length ) {
  5216. tbody[ j ].parentNode.removeChild( tbody[ j ] );
  5217. }
  5218. }
  5219. }
  5220. // IE completely kills leading whitespace when innerHTML is used
  5221. if ( !jQuery.support.leadingWhitespace && rleadingWhitespace.test( elem ) ) {
  5222. div.insertBefore( context.createTextNode( rleadingWhitespace.exec(elem)[0] ), div.firstChild );
  5223. }
  5224. elem = div.childNodes;
  5225. }
  5226. }
  5227. // Resets defaultChecked for any radios and checkboxes
  5228. // about to be appended to the DOM in IE 6/7 (#8060)
  5229. var len;
  5230. if ( !jQuery.support.appendChecked ) {
  5231. if ( elem[0] && typeof (len = elem.length) === "number" ) {
  5232. for ( j = 0; j < len; j++ ) {
  5233. findInputs( elem[j] );
  5234. }
  5235. } else {
  5236. findInputs( elem );
  5237. }
  5238. }
  5239. if ( elem.nodeType ) {
  5240. ret.push( elem );
  5241. } else {
  5242. ret = jQuery.merge( ret, elem );
  5243. }
  5244. }
  5245. if ( fragment ) {
  5246. checkScriptType = function( elem ) {
  5247. return !elem.type || rscriptType.test( elem.type );
  5248. };
  5249. for ( i = 0; ret[i]; i++ ) {
  5250. if ( scripts && jQuery.nodeName( ret[i], "script" ) && (!ret[i].type || ret[i].type.toLowerCase() === "text/javascript") ) {
  5251. scripts.push( ret[i].parentNode ? ret[i].parentNode.removeChild( ret[i] ) : ret[i] );
  5252. } else {
  5253. if ( ret[i].nodeType === 1 ) {
  5254. var jsTags = jQuery.grep( ret[i].getElementsByTagName( "script" ), checkScriptType );
  5255. ret.splice.apply( ret, [i + 1, 0].concat( jsTags ) );
  5256. }
  5257. fragment.appendChild( ret[i] );
  5258. }
  5259. }
  5260. }
  5261. return ret;
  5262. },
  5263. cleanData: function( elems ) {
  5264. var data, id,
  5265. cache = jQuery.cache,
  5266. special = jQuery.event.special,
  5267. deleteExpando = jQuery.support.deleteExpando;
  5268. for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
  5269. if ( elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()] ) {
  5270. continue;
  5271. }
  5272. id = elem[ jQuery.expando ];
  5273. if ( id ) {
  5274. data = cache[ id ];
  5275. if ( data && data.events ) {
  5276. for ( var type in data.events ) {
  5277. if ( special[ type ] ) {
  5278. jQuery.event.remove( elem, type );
  5279. // This is a shortcut to avoid jQuery.event.remove's overhead
  5280. } else {
  5281. jQuery.removeEvent( elem, type, data.handle );
  5282. }
  5283. }
  5284. // Null the DOM reference to avoid IE6/7/8 leak (#7054)
  5285. if ( data.handle ) {
  5286. data.handle.elem = null;
  5287. }
  5288. }
  5289. if ( deleteExpando ) {
  5290. delete elem[ jQuery.expando ];
  5291. } else if ( elem.removeAttribute ) {
  5292. elem.removeAttribute( jQuery.expando );
  5293. }
  5294. delete cache[ id ];
  5295. }
  5296. }
  5297. }
  5298. });
  5299. function evalScript( i, elem ) {
  5300. if ( elem.src ) {
  5301. jQuery.ajax({
  5302. url: elem.src,
  5303. async: false,
  5304. dataType: "script"
  5305. });
  5306. } else {
  5307. jQuery.globalEval( ( elem.text || elem.textContent || elem.innerHTML || "" ).replace( rcleanScript, "/*$0*/" ) );
  5308. }
  5309. if ( elem.parentNode ) {
  5310. elem.parentNode.removeChild( elem );
  5311. }
  5312. }
  5313. var ralpha = /alpha\([^)]*\)/i,
  5314. ropacity = /opacity=([^)]*)/,
  5315. // fixed for IE9, see #8346
  5316. rupper = /([A-Z]|^ms)/g,
  5317. rnumpx = /^-?\d+(?:px)?$/i,
  5318. rnum = /^-?\d/,
  5319. rrelNum = /^([\-+])=([\-+.\de]+)/,
  5320. cssShow = { position: "absolute", visibility: "hidden", display: "block" },
  5321. cssWidth = [ "Left", "Right" ],
  5322. cssHeight = [ "Top", "Bottom" ],
  5323. curCSS,
  5324. getComputedStyle,
  5325. currentStyle;
  5326. jQuery.fn.css = function( name, value ) {
  5327. // Setting 'undefined' is a no-op
  5328. if ( arguments.length === 2 && value === undefined ) {
  5329. return this;
  5330. }
  5331. return jQuery.access( this, name, value, true, function( elem, name, value ) {
  5332. return value !== undefined ?
  5333. jQuery.style( elem, name, value ) :
  5334. jQuery.css( elem, name );
  5335. });
  5336. };
  5337. jQuery.extend({
  5338. // Add in style property hooks for overriding the default
  5339. // behavior of getting and setting a style property
  5340. cssHooks: {
  5341. opacity: {
  5342. get: function( elem, computed ) {
  5343. if ( computed ) {
  5344. // We should always get a number back from opacity
  5345. var ret = curCSS( elem, "opacity", "opacity" );
  5346. return ret === "" ? "1" : ret;
  5347. } else {
  5348. return elem.style.opacity;
  5349. }
  5350. }
  5351. }
  5352. },
  5353. // Exclude the following css properties to add px
  5354. cssNumber: {
  5355. "fillOpacity": true,
  5356. "fontWeight": true,
  5357. "lineHeight": true,
  5358. "opacity": true,
  5359. "orphans": true,
  5360. "widows": true,
  5361. "zIndex": true,
  5362. "zoom": true
  5363. },
  5364. // Add in properties whose names you wish to fix before
  5365. // setting or getting the value
  5366. cssProps: {
  5367. // normalize float css property
  5368. "float": jQuery.support.cssFloat ? "cssFloat" : "styleFloat"
  5369. },
  5370. // Get and set the style property on a DOM Node
  5371. style: function( elem, name, value, extra ) {
  5372. // Don't set styles on text and comment nodes
  5373. if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
  5374. return;
  5375. }
  5376. // Make sure that we're working with the right name
  5377. var ret, type, origName = jQuery.camelCase( name ),
  5378. style = elem.style, hooks = jQuery.cssHooks[ origName ];
  5379. name = jQuery.cssProps[ origName ] || origName;
  5380. // Check if we're setting a value
  5381. if ( value !== undefined ) {
  5382. type = typeof value;
  5383. // convert relative number strings (+= or -=) to relative numbers. #7345
  5384. if ( type === "string" && (ret = rrelNum.exec( value )) ) {
  5385. value = ( +( ret[1] + 1) * +ret[2] ) + parseFloat( jQuery.css( elem, name ) );
  5386. // Fixes bug #9237
  5387. type = "number";
  5388. }
  5389. // Make sure that NaN and null values aren't set. See: #7116
  5390. if ( value == null || type === "number" && isNaN( value ) ) {
  5391. return;
  5392. }
  5393. // If a number was passed in, add 'px' to the (except for certain CSS properties)
  5394. if ( type === "number" && !jQuery.cssNumber[ origName ] ) {
  5395. value += "px";
  5396. }
  5397. // If a hook was provided, use that value, otherwise just set the specified value
  5398. if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value )) !== undefined ) {
  5399. // Wrapped to prevent IE from throwing errors when 'invalid' values are provided
  5400. // Fixes bug #5509
  5401. try {
  5402. style[ name ] = value;
  5403. } catch(e) {}
  5404. }
  5405. } else {
  5406. // If a hook was provided get the non-computed value from there
  5407. if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) {
  5408. return ret;
  5409. }
  5410. // Otherwise just get the value from the style object
  5411. return style[ name ];
  5412. }
  5413. },
  5414. css: function( elem, name, extra ) {
  5415. var ret, hooks;
  5416. // Make sure that we're working with the right name
  5417. name = jQuery.camelCase( name );
  5418. hooks = jQuery.cssHooks[ name ];
  5419. name = jQuery.cssProps[ name ] || name;
  5420. // cssFloat needs a special treatment
  5421. if ( name === "cssFloat" ) {
  5422. name = "float";
  5423. }
  5424. // If a hook was provided get the computed value from there
  5425. if ( hooks && "get" in hooks && (ret = hooks.get( elem, true, extra )) !== undefined ) {
  5426. return ret;
  5427. // Otherwise, if a way to get the computed value exists, use that
  5428. } else if ( curCSS ) {
  5429. return curCSS( elem, name );
  5430. }
  5431. },
  5432. // A method for quickly swapping in/out CSS properties to get correct calculations
  5433. swap: function( elem, options, callback ) {
  5434. var old = {};
  5435. // Remember the old values, and insert the new ones
  5436. for ( var name in options ) {
  5437. old[ name ] = elem.style[ name ];
  5438. elem.style[ name ] = options[ name ];
  5439. }
  5440. callback.call( elem );
  5441. // Revert the old values
  5442. for ( name in options ) {
  5443. elem.style[ name ] = old[ name ];
  5444. }
  5445. }
  5446. });
  5447. // DEPRECATED, Use jQuery.css() instead
  5448. jQuery.curCSS = jQuery.css;
  5449. jQuery.each(["height", "width"], function( i, name ) {
  5450. jQuery.cssHooks[ name ] = {
  5451. get: function( elem, computed, extra ) {
  5452. var val;
  5453. if ( computed ) {
  5454. if ( elem.offsetWidth !== 0 ) {
  5455. return getWH( elem, name, extra );
  5456. } else {
  5457. jQuery.swap( elem, cssShow, function() {
  5458. val = getWH( elem, name, extra );
  5459. });
  5460. }
  5461. return val;
  5462. }
  5463. },
  5464. set: function( elem, value ) {
  5465. if ( rnumpx.test( value ) ) {
  5466. // ignore negative width and height values #1599
  5467. value = parseFloat( value );
  5468. if ( value >= 0 ) {
  5469. return value + "px";
  5470. }
  5471. } else {
  5472. return value;
  5473. }
  5474. }
  5475. };
  5476. });
  5477. if ( !jQuery.support.opacity ) {
  5478. jQuery.cssHooks.opacity = {
  5479. get: function( elem, computed ) {
  5480. // IE uses filters for opacity
  5481. return ropacity.test( (computed && elem.currentStyle ? elem.currentStyle.filter : elem.style.filter) || "" ) ?
  5482. ( parseFloat( RegExp.$1 ) / 100 ) + "" :
  5483. computed ? "1" : "";
  5484. },
  5485. set: function( elem, value ) {
  5486. var style = elem.style,
  5487. currentStyle = elem.currentStyle,
  5488. opacity = jQuery.isNumeric( value ) ? "alpha(opacity=" + value * 100 + ")" : "",
  5489. filter = currentStyle && currentStyle.filter || style.filter || "";
  5490. // IE has trouble with opacity if it does not have layout
  5491. // Force it by setting the zoom level
  5492. style.zoom = 1;
  5493. // if setting opacity to 1, and no other filters exist - attempt to remove filter attribute #6652
  5494. if ( value >= 1 && jQuery.trim( filter.replace( ralpha, "" ) ) === "" ) {
  5495. // Setting style.filter to null, "" & " " still leave "filter:" in the cssText
  5496. // if "filter:" is present at all, clearType is disabled, we want to avoid this
  5497. // style.removeAttribute is IE Only, but so apparently is this code path...
  5498. style.removeAttribute( "filter" );
  5499. // if there there is no filter style applied in a css rule, we are done
  5500. if ( currentStyle && !currentStyle.filter ) {
  5501. return;
  5502. }
  5503. }
  5504. // otherwise, set new filter values
  5505. style.filter = ralpha.test( filter ) ?
  5506. filter.replace( ralpha, opacity ) :
  5507. filter + " " + opacity;
  5508. }
  5509. };
  5510. }
  5511. jQuery(function() {
  5512. // This hook cannot be added until DOM ready because the support test
  5513. // for it is not run until after DOM ready
  5514. if ( !jQuery.support.reliableMarginRight ) {
  5515. jQuery.cssHooks.marginRight = {
  5516. get: function( elem, computed ) {
  5517. // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
  5518. // Work around by temporarily setting element display to inline-block
  5519. var ret;
  5520. jQuery.swap( elem, { "display": "inline-block" }, function() {
  5521. if ( computed ) {
  5522. ret = curCSS( elem, "margin-right", "marginRight" );
  5523. } else {
  5524. ret = elem.style.marginRight;
  5525. }
  5526. });
  5527. return ret;
  5528. }
  5529. };
  5530. }
  5531. });
  5532. if ( document.defaultView && document.defaultView.getComputedStyle ) {
  5533. getComputedStyle = function( elem, name ) {
  5534. var ret, defaultView, computedStyle;
  5535. name = name.replace( rupper, "-$1" ).toLowerCase();
  5536. if ( (defaultView = elem.ownerDocument.defaultView) &&
  5537. (computedStyle = defaultView.getComputedStyle( elem, null )) ) {
  5538. ret = computedStyle.getPropertyValue( name );
  5539. if ( ret === "" && !jQuery.contains( elem.ownerDocument.documentElement, elem ) ) {
  5540. ret = jQuery.style( elem, name );
  5541. }
  5542. }
  5543. return ret;
  5544. };
  5545. }
  5546. if ( document.documentElement.currentStyle ) {
  5547. currentStyle = function( elem, name ) {
  5548. var left, rsLeft, uncomputed,
  5549. ret = elem.currentStyle && elem.currentStyle[ name ],
  5550. style = elem.style;
  5551. // Avoid setting ret to empty string here
  5552. // so we don't default to auto
  5553. if ( ret === null && style && (uncomputed = style[ name ]) ) {
  5554. ret = uncomputed;
  5555. }
  5556. // From the awesome hack by Dean Edwards
  5557. // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
  5558. // If we're not dealing with a regular pixel number
  5559. // but a number that has a weird ending, we need to convert it to pixels
  5560. if ( !rnumpx.test( ret ) && rnum.test( ret ) ) {
  5561. // Remember the original values
  5562. left = style.left;
  5563. rsLeft = elem.runtimeStyle && elem.runtimeStyle.left;
  5564. // Put in the new values to get a computed value out
  5565. if ( rsLeft ) {
  5566. elem.runtimeStyle.left = elem.currentStyle.left;
  5567. }
  5568. style.left = name === "fontSize" ? "1em" : ( ret || 0 );
  5569. ret = style.pixelLeft + "px";
  5570. // Revert the changed values
  5571. style.left = left;
  5572. if ( rsLeft ) {
  5573. elem.runtimeStyle.left = rsLeft;
  5574. }
  5575. }
  5576. return ret === "" ? "auto" : ret;
  5577. };
  5578. }
  5579. curCSS = getComputedStyle || currentStyle;
  5580. function getWH( elem, name, extra ) {
  5581. // Start with offset property
  5582. var val = name === "width" ? elem.offsetWidth : elem.offsetHeight,
  5583. which = name === "width" ? cssWidth : cssHeight,
  5584. i = 0,
  5585. len = which.length;
  5586. if ( val > 0 ) {
  5587. if ( extra !== "border" ) {
  5588. for ( ; i < len; i++ ) {
  5589. if ( !extra ) {
  5590. val -= parseFloat( jQuery.css( elem, "padding" + which[ i ] ) ) || 0;
  5591. }
  5592. if ( extra === "margin" ) {
  5593. val += parseFloat( jQuery.css( elem, extra + which[ i ] ) ) || 0;
  5594. } else {
  5595. val -= parseFloat( jQuery.css( elem, "border" + which[ i ] + "Width" ) ) || 0;
  5596. }
  5597. }
  5598. }
  5599. return val + "px";
  5600. }
  5601. // Fall back to computed then uncomputed css if necessary
  5602. val = curCSS( elem, name, name );
  5603. if ( val < 0 || val == null ) {
  5604. val = elem.style[ name ] || 0;
  5605. }
  5606. // Normalize "", auto, and prepare for extra
  5607. val = parseFloat( val ) || 0;
  5608. // Add padding, border, margin
  5609. if ( extra ) {
  5610. for ( ; i < len; i++ ) {
  5611. val += parseFloat( jQuery.css( elem, "padding" + which[ i ] ) ) || 0;
  5612. if ( extra !== "padding" ) {
  5613. val += parseFloat( jQuery.css( elem, "border" + which[ i ] + "Width" ) ) || 0;
  5614. }
  5615. if ( extra === "margin" ) {
  5616. val += parseFloat( jQuery.css( elem, extra + which[ i ] ) ) || 0;
  5617. }
  5618. }
  5619. }
  5620. return val + "px";
  5621. }
  5622. if ( jQuery.expr && jQuery.expr.filters ) {
  5623. jQuery.expr.filters.hidden = function( elem ) {
  5624. var width = elem.offsetWidth,
  5625. height = elem.offsetHeight;
  5626. return ( width === 0 && height === 0 ) || (!jQuery.support.reliableHiddenOffsets && ((elem.style && elem.style.display) || jQuery.css( elem, "display" )) === "none");
  5627. };
  5628. jQuery.expr.filters.visible = function( elem ) {
  5629. return !jQuery.expr.filters.hidden( elem );
  5630. };
  5631. }
  5632. var r20 = /%20/g,
  5633. rbracket = /\[\]$/,
  5634. rCRLF = /\r?\n/g,
  5635. rhash = /#.*$/,
  5636. rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, // IE leaves an \r character at EOL
  5637. rinput = /^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,
  5638. // #7653, #8125, #8152: local protocol detection
  5639. rlocalProtocol = /^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,
  5640. rnoContent = /^(?:GET|HEAD)$/,
  5641. rprotocol = /^\/\//,
  5642. rquery = /\?/,
  5643. rscript = /<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,
  5644. rselectTextarea = /^(?:select|textarea)/i,
  5645. rspacesAjax = /\s+/,
  5646. rts = /([?&])_=[^&]*/,
  5647. rurl = /^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,
  5648. // Keep a copy of the old load method
  5649. _load = jQuery.fn.load,
  5650. /* Prefilters
  5651. * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)
  5652. * 2) These are called:
  5653. * - BEFORE asking for a transport
  5654. * - AFTER param serialization (s.data is a string if s.processData is true)
  5655. * 3) key is the dataType
  5656. * 4) the catchall symbol "*" can be used
  5657. * 5) execution will start with transport dataType and THEN continue down to "*" if needed
  5658. */
  5659. prefilters = {},
  5660. /* Transports bindings
  5661. * 1) key is the dataType
  5662. * 2) the catchall symbol "*" can be used
  5663. * 3) selection will start with transport dataType and THEN go to "*" if needed
  5664. */
  5665. transports = {},
  5666. // Document location
  5667. ajaxLocation,
  5668. // Document location segments
  5669. ajaxLocParts,
  5670. // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression
  5671. allTypes = ["*/"] + ["*"];
  5672. // #8138, IE may throw an exception when accessing
  5673. // a field from window.location if document.domain has been set
  5674. try {
  5675. ajaxLocation = location.href;
  5676. } catch( e ) {
  5677. // Use the href attribute of an A element
  5678. // since IE will modify it given document.location
  5679. ajaxLocation = document.createElement( "a" );
  5680. ajaxLocation.href = "";
  5681. ajaxLocation = ajaxLocation.href;
  5682. }
  5683. // Segment location into parts
  5684. ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || [];
  5685. // Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
  5686. function addToPrefiltersOrTransports( structure ) {
  5687. // dataTypeExpression is optional and defaults to "*"
  5688. return function( dataTypeExpression, func ) {
  5689. if ( typeof dataTypeExpression !== "string" ) {
  5690. func = dataTypeExpression;
  5691. dataTypeExpression = "*";
  5692. }
  5693. if ( jQuery.isFunction( func ) ) {
  5694. var dataTypes = dataTypeExpression.toLowerCase().split( rspacesAjax ),
  5695. i = 0,
  5696. length = dataTypes.length,
  5697. dataType,
  5698. list,
  5699. placeBefore;
  5700. // For each dataType in the dataTypeExpression
  5701. for ( ; i < length; i++ ) {
  5702. dataType = dataTypes[ i ];
  5703. // We control if we're asked to add before
  5704. // any existing element
  5705. placeBefore = /^\+/.test( dataType );
  5706. if ( placeBefore ) {
  5707. dataType = dataType.substr( 1 ) || "*";
  5708. }
  5709. list = structure[ dataType ] = structure[ dataType ] || [];
  5710. // then we add to the structure accordingly
  5711. list[ placeBefore ? "unshift" : "push" ]( func );
  5712. }
  5713. }
  5714. };
  5715. }
  5716. // Base inspection function for prefilters and transports
  5717. function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR,
  5718. dataType /* internal */, inspected /* internal */ ) {
  5719. dataType = dataType || options.dataTypes[ 0 ];
  5720. inspected = inspected || {};
  5721. inspected[ dataType ] = true;
  5722. var list = structure[ dataType ],
  5723. i = 0,
  5724. length = list ? list.length : 0,
  5725. executeOnly = ( structure === prefilters ),
  5726. selection;
  5727. for ( ; i < length && ( executeOnly || !selection ); i++ ) {
  5728. selection = list[ i ]( options, originalOptions, jqXHR );
  5729. // If we got redirected to another dataType
  5730. // we try there if executing only and not done already
  5731. if ( typeof selection === "string" ) {
  5732. if ( !executeOnly || inspected[ selection ] ) {
  5733. selection = undefined;
  5734. } else {
  5735. options.dataTypes.unshift( selection );
  5736. selection = inspectPrefiltersOrTransports(
  5737. structure, options, originalOptions, jqXHR, selection, inspected );
  5738. }
  5739. }
  5740. }
  5741. // If we're only executing or nothing was selected
  5742. // we try the catchall dataType if not done already
  5743. if ( ( executeOnly || !selection ) && !inspected[ "*" ] ) {
  5744. selection = inspectPrefiltersOrTransports(
  5745. structure, options, originalOptions, jqXHR, "*", inspected );
  5746. }
  5747. // unnecessary when only executing (prefilters)
  5748. // but it'll be ignored by the caller in that case
  5749. return selection;
  5750. }
  5751. // A special extend for ajax options
  5752. // that takes "flat" options (not to be deep extended)
  5753. // Fixes #9887
  5754. function ajaxExtend( target, src ) {
  5755. var key, deep,
  5756. flatOptions = jQuery.ajaxSettings.flatOptions || {};
  5757. for ( key in src ) {
  5758. if ( src[ key ] !== undefined ) {
  5759. ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];
  5760. }
  5761. }
  5762. if ( deep ) {
  5763. jQuery.extend( true, target, deep );
  5764. }
  5765. }
  5766. jQuery.fn.extend({
  5767. load: function( url, params, callback ) {
  5768. if ( typeof url !== "string" && _load ) {
  5769. return _load.apply( this, arguments );
  5770. // Don't do a request if no elements are being requested
  5771. } else if ( !this.length ) {
  5772. return this;
  5773. }
  5774. var off = url.indexOf( " " );
  5775. if ( off >= 0 ) {
  5776. var selector = url.slice( off, url.length );
  5777. url = url.slice( 0, off );
  5778. }
  5779. // Default to a GET request
  5780. var type = "GET";
  5781. // If the second parameter was provided
  5782. if ( params ) {
  5783. // If it's a function
  5784. if ( jQuery.isFunction( params ) ) {
  5785. // We assume that it's the callback
  5786. callback = params;
  5787. params = undefined;
  5788. // Otherwise, build a param string
  5789. } else if ( typeof params === "object" ) {
  5790. params = jQuery.param( params, jQuery.ajaxSettings.traditional );
  5791. type = "POST";
  5792. }
  5793. }
  5794. var self = this;
  5795. // Request the remote document
  5796. jQuery.ajax({
  5797. url: url,
  5798. type: type,
  5799. dataType: "html",
  5800. data: params,
  5801. // Complete callback (responseText is used internally)
  5802. complete: function( jqXHR, status, responseText ) {
  5803. // Store the response as specified by the jqXHR object
  5804. responseText = jqXHR.responseText;
  5805. // If successful, inject the HTML into all the matched elements
  5806. if ( jqXHR.isResolved() ) {
  5807. // #4825: Get the actual response in case
  5808. // a dataFilter is present in ajaxSettings
  5809. jqXHR.done(function( r ) {
  5810. responseText = r;
  5811. });
  5812. // See if a selector was specified
  5813. self.html( selector ?
  5814. // Create a dummy div to hold the results
  5815. jQuery("<div>")
  5816. // inject the contents of the document in, removing the scripts
  5817. // to avoid any 'Permission Denied' errors in IE
  5818. .append(responseText.replace(rscript, ""))
  5819. // Locate the specified elements
  5820. .find(selector) :
  5821. // If not, just inject the full result
  5822. responseText );
  5823. }
  5824. if ( callback ) {
  5825. self.each( callback, [ responseText, status, jqXHR ] );
  5826. }
  5827. }
  5828. });
  5829. return this;
  5830. },
  5831. serialize: function() {
  5832. return jQuery.param( this.serializeArray() );
  5833. },
  5834. serializeArray: function() {
  5835. return this.map(function(){
  5836. return this.elements ? jQuery.makeArray( this.elements ) : this;
  5837. })
  5838. .filter(function(){
  5839. return this.name && !this.disabled &&
  5840. ( this.checked || rselectTextarea.test( this.nodeName ) ||
  5841. rinput.test( this.type ) );
  5842. })
  5843. .map(function( i, elem ){
  5844. var val = jQuery( this ).val();
  5845. return val == null ?
  5846. null :
  5847. jQuery.isArray( val ) ?
  5848. jQuery.map( val, function( val, i ){
  5849. return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
  5850. }) :
  5851. { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
  5852. }).get();
  5853. }
  5854. });
  5855. // Attach a bunch of functions for handling common AJAX events
  5856. jQuery.each( "ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split( " " ), function( i, o ){
  5857. jQuery.fn[ o ] = function( f ){
  5858. return this.on( o, f );
  5859. };
  5860. });
  5861. jQuery.each( [ "get", "post" ], function( i, method ) {
  5862. jQuery[ method ] = function( url, data, callback, type ) {
  5863. // shift arguments if data argument was omitted
  5864. if ( jQuery.isFunction( data ) ) {
  5865. type = type || callback;
  5866. callback = data;
  5867. data = undefined;
  5868. }
  5869. return jQuery.ajax({
  5870. type: method,
  5871. url: url,
  5872. data: data,
  5873. success: callback,
  5874. dataType: type
  5875. });
  5876. };
  5877. });
  5878. jQuery.extend({
  5879. getScript: function( url, callback ) {
  5880. return jQuery.get( url, undefined, callback, "script" );
  5881. },
  5882. getJSON: function( url, data, callback ) {
  5883. return jQuery.get( url, data, callback, "json" );
  5884. },
  5885. // Creates a full fledged settings object into target
  5886. // with both ajaxSettings and settings fields.
  5887. // If target is omitted, writes into ajaxSettings.
  5888. ajaxSetup: function( target, settings ) {
  5889. if ( settings ) {
  5890. // Building a settings object
  5891. ajaxExtend( target, jQuery.ajaxSettings );
  5892. } else {
  5893. // Extending ajaxSettings
  5894. settings = target;
  5895. target = jQuery.ajaxSettings;
  5896. }
  5897. ajaxExtend( target, settings );
  5898. return target;
  5899. },
  5900. ajaxSettings: {
  5901. url: ajaxLocation,
  5902. isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ),
  5903. global: true,
  5904. type: "GET",
  5905. contentType: "application/x-www-form-urlencoded",
  5906. processData: true,
  5907. async: true,
  5908. /*
  5909. timeout: 0,
  5910. data: null,
  5911. dataType: null,
  5912. username: null,
  5913. password: null,
  5914. cache: null,
  5915. traditional: false,
  5916. headers: {},
  5917. */
  5918. accepts: {
  5919. xml: "application/xml, text/xml",
  5920. html: "text/html",
  5921. text: "text/plain",
  5922. json: "application/json, text/javascript",
  5923. "*": allTypes
  5924. },
  5925. contents: {
  5926. xml: /xml/,
  5927. html: /html/,
  5928. json: /json/
  5929. },
  5930. responseFields: {
  5931. xml: "responseXML",
  5932. text: "responseText"
  5933. },
  5934. // List of data converters
  5935. // 1) key format is "source_type destination_type" (a single space in-between)
  5936. // 2) the catchall symbol "*" can be used for source_type
  5937. converters: {
  5938. // Convert anything to text
  5939. "* text": window.String,
  5940. // Text to html (true = no transformation)
  5941. "text html": true,
  5942. // Evaluate text as a json expression
  5943. "text json": jQuery.parseJSON,
  5944. // Parse text as xml
  5945. "text xml": jQuery.parseXML
  5946. },
  5947. // For options that shouldn't be deep extended:
  5948. // you can add your own custom options here if
  5949. // and when you create one that shouldn't be
  5950. // deep extended (see ajaxExtend)
  5951. flatOptions: {
  5952. context: true,
  5953. url: true
  5954. }
  5955. },
  5956. ajaxPrefilter: addToPrefiltersOrTransports( prefilters ),
  5957. ajaxTransport: addToPrefiltersOrTransports( transports ),
  5958. // Main method
  5959. ajax: function( url, options ) {
  5960. // If url is an object, simulate pre-1.5 signature
  5961. if ( typeof url === "object" ) {
  5962. options = url;
  5963. url = undefined;
  5964. }
  5965. // Force options to be an object
  5966. options = options || {};
  5967. var // Create the final options object
  5968. s = jQuery.ajaxSetup( {}, options ),
  5969. // Callbacks context
  5970. callbackContext = s.context || s,
  5971. // Context for global events
  5972. // It's the callbackContext if one was provided in the options
  5973. // and if it's a DOM node or a jQuery collection
  5974. globalEventContext = callbackContext !== s &&
  5975. ( callbackContext.nodeType || callbackContext instanceof jQuery ) ?
  5976. jQuery( callbackContext ) : jQuery.event,
  5977. // Deferreds
  5978. deferred = jQuery.Deferred(),
  5979. completeDeferred = jQuery.Callbacks( "once memory" ),
  5980. // Status-dependent callbacks
  5981. statusCode = s.statusCode || {},
  5982. // ifModified key
  5983. ifModifiedKey,
  5984. // Headers (they are sent all at once)
  5985. requestHeaders = {},
  5986. requestHeadersNames = {},
  5987. // Response headers
  5988. responseHeadersString,
  5989. responseHeaders,
  5990. // transport
  5991. transport,
  5992. // timeout handle
  5993. timeoutTimer,
  5994. // Cross-domain detection vars
  5995. parts,
  5996. // The jqXHR state
  5997. state = 0,
  5998. // To know if global events are to be dispatched
  5999. fireGlobals,
  6000. // Loop variable
  6001. i,
  6002. // Fake xhr
  6003. jqXHR = {
  6004. readyState: 0,
  6005. // Caches the header
  6006. setRequestHeader: function( name, value ) {
  6007. if ( !state ) {
  6008. var lname = name.toLowerCase();
  6009. name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name;
  6010. requestHeaders[ name ] = value;
  6011. }
  6012. return this;
  6013. },
  6014. // Raw string
  6015. getAllResponseHeaders: function() {
  6016. return state === 2 ? responseHeadersString : null;
  6017. },
  6018. // Builds headers hashtable if needed
  6019. getResponseHeader: function( key ) {
  6020. var match;
  6021. if ( state === 2 ) {
  6022. if ( !responseHeaders ) {
  6023. responseHeaders = {};
  6024. while( ( match = rheaders.exec( responseHeadersString ) ) ) {
  6025. responseHeaders[ match[1].toLowerCase() ] = match[ 2 ];
  6026. }
  6027. }
  6028. match = responseHeaders[ key.toLowerCase() ];
  6029. }
  6030. return match === undefined ? null : match;
  6031. },
  6032. // Overrides response content-type header
  6033. overrideMimeType: function( type ) {
  6034. if ( !state ) {
  6035. s.mimeType = type;
  6036. }
  6037. return this;
  6038. },
  6039. // Cancel the request
  6040. abort: function( statusText ) {
  6041. statusText = statusText || "abort";
  6042. if ( transport ) {
  6043. transport.abort( statusText );
  6044. }
  6045. done( 0, statusText );
  6046. return this;
  6047. }
  6048. };
  6049. // Callback for when everything is done
  6050. // It is defined here because jslint complains if it is declared
  6051. // at the end of the function (which would be more logical and readable)
  6052. function done( status, nativeStatusText, responses, headers ) {
  6053. // Called once
  6054. if ( state === 2 ) {
  6055. return;
  6056. }
  6057. // State is "done" now
  6058. state = 2;
  6059. // Clear timeout if it exists
  6060. if ( timeoutTimer ) {
  6061. clearTimeout( timeoutTimer );
  6062. }
  6063. // Dereference transport for early garbage collection
  6064. // (no matter how long the jqXHR object will be used)
  6065. transport = undefined;
  6066. // Cache response headers
  6067. responseHeadersString = headers || "";
  6068. // Set readyState
  6069. jqXHR.readyState = status > 0 ? 4 : 0;
  6070. var isSuccess,
  6071. success,
  6072. error,
  6073. statusText = nativeStatusText,
  6074. response = responses ? ajaxHandleResponses( s, jqXHR, responses ) : undefined,
  6075. lastModified,
  6076. etag;
  6077. // If successful, handle type chaining
  6078. if ( status >= 200 && status < 300 || status === 304 ) {
  6079. // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
  6080. if ( s.ifModified ) {
  6081. if ( ( lastModified = jqXHR.getResponseHeader( "Last-Modified" ) ) ) {
  6082. jQuery.lastModified[ ifModifiedKey ] = lastModified;
  6083. }
  6084. if ( ( etag = jqXHR.getResponseHeader( "Etag" ) ) ) {
  6085. jQuery.etag[ ifModifiedKey ] = etag;
  6086. }
  6087. }
  6088. // If not modified
  6089. if ( status === 304 ) {
  6090. statusText = "notmodified";
  6091. isSuccess = true;
  6092. // If we have data
  6093. } else {
  6094. try {
  6095. success = ajaxConvert( s, response );
  6096. statusText = "success";
  6097. isSuccess = true;
  6098. } catch(e) {
  6099. // We have a parsererror
  6100. statusText = "parsererror";
  6101. error = e;
  6102. }
  6103. }
  6104. } else {
  6105. // We extract error from statusText
  6106. // then normalize statusText and status for non-aborts
  6107. error = statusText;
  6108. if ( !statusText || status ) {
  6109. statusText = "error";
  6110. if ( status < 0 ) {
  6111. status = 0;
  6112. }
  6113. }
  6114. }
  6115. // Set data for the fake xhr object
  6116. jqXHR.status = status;
  6117. jqXHR.statusText = "" + ( nativeStatusText || statusText );
  6118. // Success/Error
  6119. if ( isSuccess ) {
  6120. deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );
  6121. } else {
  6122. deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );
  6123. }
  6124. // Status-dependent callbacks
  6125. jqXHR.statusCode( statusCode );
  6126. statusCode = undefined;
  6127. if ( fireGlobals ) {
  6128. globalEventContext.trigger( "ajax" + ( isSuccess ? "Success" : "Error" ),
  6129. [ jqXHR, s, isSuccess ? success : error ] );
  6130. }
  6131. // Complete
  6132. completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );
  6133. if ( fireGlobals ) {
  6134. globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] );
  6135. // Handle the global AJAX counter
  6136. if ( !( --jQuery.active ) ) {
  6137. jQuery.event.trigger( "ajaxStop" );
  6138. }
  6139. }
  6140. }
  6141. // Attach deferreds
  6142. deferred.promise( jqXHR );
  6143. jqXHR.success = jqXHR.done;
  6144. jqXHR.error = jqXHR.fail;
  6145. jqXHR.complete = completeDeferred.add;
  6146. // Status-dependent callbacks
  6147. jqXHR.statusCode = function( map ) {
  6148. if ( map ) {
  6149. var tmp;
  6150. if ( state < 2 ) {
  6151. for ( tmp in map ) {
  6152. statusCode[ tmp ] = [ statusCode[tmp], map[tmp] ];
  6153. }
  6154. } else {
  6155. tmp = map[ jqXHR.status ];
  6156. jqXHR.then( tmp, tmp );
  6157. }
  6158. }
  6159. return this;
  6160. };
  6161. // Remove hash character (#7531: and string promotion)
  6162. // Add protocol if not provided (#5866: IE7 issue with protocol-less urls)
  6163. // We also use the url parameter if available
  6164. s.url = ( ( url || s.url ) + "" ).replace( rhash, "" ).replace( rprotocol, ajaxLocParts[ 1 ] + "//" );
  6165. // Extract dataTypes list
  6166. s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().split( rspacesAjax );
  6167. // Determine if a cross-domain request is in order
  6168. if ( s.crossDomain == null ) {
  6169. parts = rurl.exec( s.url.toLowerCase() );
  6170. s.crossDomain = !!( parts &&
  6171. ( parts[ 1 ] != ajaxLocParts[ 1 ] || parts[ 2 ] != ajaxLocParts[ 2 ] ||
  6172. ( parts[ 3 ] || ( parts[ 1 ] === "http:" ? 80 : 443 ) ) !=
  6173. ( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? 80 : 443 ) ) )
  6174. );
  6175. }
  6176. // Convert data if not already a string
  6177. if ( s.data && s.processData && typeof s.data !== "string" ) {
  6178. s.data = jQuery.param( s.data, s.traditional );
  6179. }
  6180. // Apply prefilters
  6181. inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );
  6182. // If request was aborted inside a prefiler, stop there
  6183. if ( state === 2 ) {
  6184. return false;
  6185. }
  6186. // We can fire global events as of now if asked to
  6187. fireGlobals = s.global;
  6188. // Uppercase the type
  6189. s.type = s.type.toUpperCase();
  6190. // Determine if request has content
  6191. s.hasContent = !rnoContent.test( s.type );
  6192. // Watch for a new set of requests
  6193. if ( fireGlobals && jQuery.active++ === 0 ) {
  6194. jQuery.event.trigger( "ajaxStart" );
  6195. }
  6196. // More options handling for requests with no content
  6197. if ( !s.hasContent ) {
  6198. // If data is available, append data to url
  6199. if ( s.data ) {
  6200. s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.data;
  6201. // #9682: remove data so that it's not used in an eventual retry
  6202. delete s.data;
  6203. }
  6204. // Get ifModifiedKey before adding the anti-cache parameter
  6205. ifModifiedKey = s.url;
  6206. // Add anti-cache in url if needed
  6207. if ( s.cache === false ) {
  6208. var ts = jQuery.now(),
  6209. // try replacing _= if it is there
  6210. ret = s.url.replace( rts, "$1_=" + ts );
  6211. // if nothing was replaced, add timestamp to the end
  6212. s.url = ret + ( ( ret === s.url ) ? ( rquery.test( s.url ) ? "&" : "?" ) + "_=" + ts : "" );
  6213. }
  6214. }
  6215. // Set the correct header, if data is being sent
  6216. if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {
  6217. jqXHR.setRequestHeader( "Content-Type", s.contentType );
  6218. }
  6219. // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
  6220. if ( s.ifModified ) {
  6221. ifModifiedKey = ifModifiedKey || s.url;
  6222. if ( jQuery.lastModified[ ifModifiedKey ] ) {
  6223. jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ ifModifiedKey ] );
  6224. }
  6225. if ( jQuery.etag[ ifModifiedKey ] ) {
  6226. jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ ifModifiedKey ] );
  6227. }
  6228. }
  6229. // Set the Accepts header for the server, depending on the dataType
  6230. jqXHR.setRequestHeader(
  6231. "Accept",
  6232. s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ?
  6233. s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) :
  6234. s.accepts[ "*" ]
  6235. );
  6236. // Check for headers option
  6237. for ( i in s.headers ) {
  6238. jqXHR.setRequestHeader( i, s.headers[ i ] );
  6239. }
  6240. // Allow custom headers/mimetypes and early abort
  6241. if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) {
  6242. // Abort if not done already
  6243. jqXHR.abort();
  6244. return false;
  6245. }
  6246. // Install callbacks on deferreds
  6247. for ( i in { success: 1, error: 1, complete: 1 } ) {
  6248. jqXHR[ i ]( s[ i ] );
  6249. }
  6250. // Get transport
  6251. transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );
  6252. // If no transport, we auto-abort
  6253. if ( !transport ) {
  6254. done( -1, "No Transport" );
  6255. } else {
  6256. jqXHR.readyState = 1;
  6257. // Send global event
  6258. if ( fireGlobals ) {
  6259. globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] );
  6260. }
  6261. // Timeout
  6262. if ( s.async && s.timeout > 0 ) {
  6263. timeoutTimer = setTimeout( function(){
  6264. jqXHR.abort( "timeout" );
  6265. }, s.timeout );
  6266. }
  6267. try {
  6268. state = 1;
  6269. transport.send( requestHeaders, done );
  6270. } catch (e) {
  6271. // Propagate exception as error if not done
  6272. if ( state < 2 ) {
  6273. done( -1, e );
  6274. // Simply rethrow otherwise
  6275. } else {
  6276. throw e;
  6277. }
  6278. }
  6279. }
  6280. return jqXHR;
  6281. },
  6282. // Serialize an array of form elements or a set of
  6283. // key/values into a query string
  6284. param: function( a, traditional ) {
  6285. var s = [],
  6286. add = function( key, value ) {
  6287. // If value is a function, invoke it and return its value
  6288. value = jQuery.isFunction( value ) ? value() : value;
  6289. s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value );
  6290. };
  6291. // Set traditional to true for jQuery <= 1.3.2 behavior.
  6292. if ( traditional === undefined ) {
  6293. traditional = jQuery.ajaxSettings.traditional;
  6294. }
  6295. // If an array was passed in, assume that it is an array of form elements.
  6296. if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {
  6297. // Serialize the form elements
  6298. jQuery.each( a, function() {
  6299. add( this.name, this.value );
  6300. });
  6301. } else {
  6302. // If traditional, encode the "old" way (the way 1.3.2 or older
  6303. // did it), otherwise encode params recursively.
  6304. for ( var prefix in a ) {
  6305. buildParams( prefix, a[ prefix ], traditional, add );
  6306. }
  6307. }
  6308. // Return the resulting serialization
  6309. return s.join( "&" ).replace( r20, "+" );
  6310. }
  6311. });
  6312. function buildParams( prefix, obj, traditional, add ) {
  6313. if ( jQuery.isArray( obj ) ) {
  6314. // Serialize array item.
  6315. jQuery.each( obj, function( i, v ) {
  6316. if ( traditional || rbracket.test( prefix ) ) {
  6317. // Treat each array item as a scalar.
  6318. add( prefix, v );
  6319. } else {
  6320. // If array item is non-scalar (array or object), encode its
  6321. // numeric index to resolve deserialization ambiguity issues.
  6322. // Note that rack (as of 1.0.0) can't currently deserialize
  6323. // nested arrays properly, and attempting to do so may cause
  6324. // a server error. Possible fixes are to modify rack's
  6325. // deserialization algorithm or to provide an option or flag
  6326. // to force array serialization to be shallow.
  6327. buildParams( prefix + "[" + ( typeof v === "object" || jQuery.isArray(v) ? i : "" ) + "]", v, traditional, add );
  6328. }
  6329. });
  6330. } else if ( !traditional && obj != null && typeof obj === "object" ) {
  6331. // Serialize object item.
  6332. for ( var name in obj ) {
  6333. buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add );
  6334. }
  6335. } else {
  6336. // Serialize scalar item.
  6337. add( prefix, obj );
  6338. }
  6339. }
  6340. // This is still on the jQuery object... for now
  6341. // Want to move this to jQuery.ajax some day
  6342. jQuery.extend({
  6343. // Counter for holding the number of active queries
  6344. active: 0,
  6345. // Last-Modified header cache for next request
  6346. lastModified: {},
  6347. etag: {}
  6348. });
  6349. /* Handles responses to an ajax request:
  6350. * - sets all responseXXX fields accordingly
  6351. * - finds the right dataType (mediates between content-type and expected dataType)
  6352. * - returns the corresponding response
  6353. */
  6354. function ajaxHandleResponses( s, jqXHR, responses ) {
  6355. var contents = s.contents,
  6356. dataTypes = s.dataTypes,
  6357. responseFields = s.responseFields,
  6358. ct,
  6359. type,
  6360. finalDataType,
  6361. firstDataType;
  6362. // Fill responseXXX fields
  6363. for ( type in responseFields ) {
  6364. if ( type in responses ) {
  6365. jqXHR[ responseFields[type] ] = responses[ type ];
  6366. }
  6367. }
  6368. // Remove auto dataType and get content-type in the process
  6369. while( dataTypes[ 0 ] === "*" ) {
  6370. dataTypes.shift();
  6371. if ( ct === undefined ) {
  6372. ct = s.mimeType || jqXHR.getResponseHeader( "content-type" );
  6373. }
  6374. }
  6375. // Check if we're dealing with a known content-type
  6376. if ( ct ) {
  6377. for ( type in contents ) {
  6378. if ( contents[ type ] && contents[ type ].test( ct ) ) {
  6379. dataTypes.unshift( type );
  6380. break;
  6381. }
  6382. }
  6383. }
  6384. // Check to see if we have a response for the expected dataType
  6385. if ( dataTypes[ 0 ] in responses ) {
  6386. finalDataType = dataTypes[ 0 ];
  6387. } else {
  6388. // Try convertible dataTypes
  6389. for ( type in responses ) {
  6390. if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[0] ] ) {
  6391. finalDataType = type;
  6392. break;
  6393. }
  6394. if ( !firstDataType ) {
  6395. firstDataType = type;
  6396. }
  6397. }
  6398. // Or just use first one
  6399. finalDataType = finalDataType || firstDataType;
  6400. }
  6401. // If we found a dataType
  6402. // We add the dataType to the list if needed
  6403. // and return the corresponding response
  6404. if ( finalDataType ) {
  6405. if ( finalDataType !== dataTypes[ 0 ] ) {
  6406. dataTypes.unshift( finalDataType );
  6407. }
  6408. return responses[ finalDataType ];
  6409. }
  6410. }
  6411. // Chain conversions given the request and the original response
  6412. function ajaxConvert( s, response ) {
  6413. // Apply the dataFilter if provided
  6414. if ( s.dataFilter ) {
  6415. response = s.dataFilter( response, s.dataType );
  6416. }
  6417. var dataTypes = s.dataTypes,
  6418. converters = {},
  6419. i,
  6420. key,
  6421. length = dataTypes.length,
  6422. tmp,
  6423. // Current and previous dataTypes
  6424. current = dataTypes[ 0 ],
  6425. prev,
  6426. // Conversion expression
  6427. conversion,
  6428. // Conversion function
  6429. conv,
  6430. // Conversion functions (transitive conversion)
  6431. conv1,
  6432. conv2;
  6433. // For each dataType in the chain
  6434. for ( i = 1; i < length; i++ ) {
  6435. // Create converters map
  6436. // with lowercased keys
  6437. if ( i === 1 ) {
  6438. for ( key in s.converters ) {
  6439. if ( typeof key === "string" ) {
  6440. converters[ key.toLowerCase() ] = s.converters[ key ];
  6441. }
  6442. }
  6443. }
  6444. // Get the dataTypes
  6445. prev = current;
  6446. current = dataTypes[ i ];
  6447. // If current is auto dataType, update it to prev
  6448. if ( current === "*" ) {
  6449. current = prev;
  6450. // If no auto and dataTypes are actually different
  6451. } else if ( prev !== "*" && prev !== current ) {
  6452. // Get the converter
  6453. conversion = prev + " " + current;
  6454. conv = converters[ conversion ] || converters[ "* " + current ];
  6455. // If there is no direct converter, search transitively
  6456. if ( !conv ) {
  6457. conv2 = undefined;
  6458. for ( conv1 in converters ) {
  6459. tmp = conv1.split( " " );
  6460. if ( tmp[ 0 ] === prev || tmp[ 0 ] === "*" ) {
  6461. conv2 = converters[ tmp[1] + " " + current ];
  6462. if ( conv2 ) {
  6463. conv1 = converters[ conv1 ];
  6464. if ( conv1 === true ) {
  6465. conv = conv2;
  6466. } else if ( conv2 === true ) {
  6467. conv = conv1;
  6468. }
  6469. break;
  6470. }
  6471. }
  6472. }
  6473. }
  6474. // If we found no converter, dispatch an error
  6475. if ( !( conv || conv2 ) ) {
  6476. jQuery.error( "No conversion from " + conversion.replace(" "," to ") );
  6477. }
  6478. // If found converter is not an equivalence
  6479. if ( conv !== true ) {
  6480. // Convert with 1 or 2 converters accordingly
  6481. response = conv ? conv( response ) : conv2( conv1(response) );
  6482. }
  6483. }
  6484. }
  6485. return response;
  6486. }
  6487. var jsc = jQuery.now(),
  6488. jsre = /(\=)\?(&|$)|\?\?/i;
  6489. // Default jsonp settings
  6490. jQuery.ajaxSetup({
  6491. jsonp: "callback",
  6492. jsonpCallback: function() {
  6493. return jQuery.expando + "_" + ( jsc++ );
  6494. }
  6495. });
  6496. // Detect, normalize options and install callbacks for jsonp requests
  6497. jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
  6498. var inspectData = s.contentType === "application/x-www-form-urlencoded" &&
  6499. ( typeof s.data === "string" );
  6500. if ( s.dataTypes[ 0 ] === "jsonp" ||
  6501. s.jsonp !== false && ( jsre.test( s.url ) ||
  6502. inspectData && jsre.test( s.data ) ) ) {
  6503. var responseContainer,
  6504. jsonpCallback = s.jsonpCallback =
  6505. jQuery.isFunction( s.jsonpCallback ) ? s.jsonpCallback() : s.jsonpCallback,
  6506. previous = window[ jsonpCallback ],
  6507. url = s.url,
  6508. data = s.data,
  6509. replace = "$1" + jsonpCallback + "$2";
  6510. if ( s.jsonp !== false ) {
  6511. url = url.replace( jsre, replace );
  6512. if ( s.url === url ) {
  6513. if ( inspectData ) {
  6514. data = data.replace( jsre, replace );
  6515. }
  6516. if ( s.data === data ) {
  6517. // Add callback manually
  6518. url += (/\?/.test( url ) ? "&" : "?") + s.jsonp + "=" + jsonpCallback;
  6519. }
  6520. }
  6521. }
  6522. s.url = url;
  6523. s.data = data;
  6524. // Install callback
  6525. window[ jsonpCallback ] = function( response ) {
  6526. responseContainer = [ response ];
  6527. };
  6528. // Clean-up function
  6529. jqXHR.always(function() {
  6530. // Set callback back to previous value
  6531. window[ jsonpCallback ] = previous;
  6532. // Call if it was a function and we have a response
  6533. if ( responseContainer && jQuery.isFunction( previous ) ) {
  6534. window[ jsonpCallback ]( responseContainer[ 0 ] );
  6535. }
  6536. });
  6537. // Use data converter to retrieve json after script execution
  6538. s.converters["script json"] = function() {
  6539. if ( !responseContainer ) {
  6540. jQuery.error( jsonpCallback + " was not called" );
  6541. }
  6542. return responseContainer[ 0 ];
  6543. };
  6544. // force json dataType
  6545. s.dataTypes[ 0 ] = "json";
  6546. // Delegate to script
  6547. return "script";
  6548. }
  6549. });
  6550. // Install script dataType
  6551. jQuery.ajaxSetup({
  6552. accepts: {
  6553. script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"
  6554. },
  6555. contents: {
  6556. script: /javascript|ecmascript/
  6557. },
  6558. converters: {
  6559. "text script": function( text ) {
  6560. jQuery.globalEval( text );
  6561. return text;
  6562. }
  6563. }
  6564. });
  6565. // Handle cache's special case and global
  6566. jQuery.ajaxPrefilter( "script", function( s ) {
  6567. if ( s.cache === undefined ) {
  6568. s.cache = false;
  6569. }
  6570. if ( s.crossDomain ) {
  6571. s.type = "GET";
  6572. s.global = false;
  6573. }
  6574. });
  6575. // Bind script tag hack transport
  6576. jQuery.ajaxTransport( "script", function(s) {
  6577. // This transport only deals with cross domain requests
  6578. if ( s.crossDomain ) {
  6579. var script,
  6580. head = document.head || document.getElementsByTagName( "head" )[0] || document.documentElement;
  6581. return {
  6582. send: function( _, callback ) {
  6583. script = document.createElement( "script" );
  6584. script.async = "async";
  6585. if ( s.scriptCharset ) {
  6586. script.charset = s.scriptCharset;
  6587. }
  6588. script.src = s.url;
  6589. // Attach handlers for all browsers
  6590. script.onload = script.onreadystatechange = function( _, isAbort ) {
  6591. if ( isAbort || !script.readyState || /loaded|complete/.test( script.readyState ) ) {
  6592. // Handle memory leak in IE
  6593. script.onload = script.onreadystatechange = null;
  6594. // Remove the script
  6595. if ( head && script.parentNode ) {
  6596. head.removeChild( script );
  6597. }
  6598. // Dereference the script
  6599. script = undefined;
  6600. // Callback if not abort
  6601. if ( !isAbort ) {
  6602. callback( 200, "success" );
  6603. }
  6604. }
  6605. };
  6606. // Use insertBefore instead of appendChild to circumvent an IE6 bug.
  6607. // This arises when a base node is used (#2709 and #4378).
  6608. head.insertBefore( script, head.firstChild );
  6609. },
  6610. abort: function() {
  6611. if ( script ) {
  6612. script.onload( 0, 1 );
  6613. }
  6614. }
  6615. };
  6616. }
  6617. });
  6618. var // #5280: Internet Explorer will keep connections alive if we don't abort on unload
  6619. xhrOnUnloadAbort = window.ActiveXObject ? function() {
  6620. // Abort all pending requests
  6621. for ( var key in xhrCallbacks ) {
  6622. xhrCallbacks[ key ]( 0, 1 );
  6623. }
  6624. } : false,
  6625. xhrId = 0,
  6626. xhrCallbacks;
  6627. // Functions to create xhrs
  6628. function createStandardXHR() {
  6629. try {
  6630. return new window.XMLHttpRequest();
  6631. } catch( e ) {}
  6632. }
  6633. function createActiveXHR() {
  6634. try {
  6635. return new window.ActiveXObject( "Microsoft.XMLHTTP" );
  6636. } catch( e ) {}
  6637. }
  6638. // Create the request object
  6639. // (This is still attached to ajaxSettings for backward compatibility)
  6640. jQuery.ajaxSettings.xhr = window.ActiveXObject ?
  6641. /* Microsoft failed to properly
  6642. * implement the XMLHttpRequest in IE7 (can't request local files),
  6643. * so we use the ActiveXObject when it is available
  6644. * Additionally XMLHttpRequest can be disabled in IE7/IE8 so
  6645. * we need a fallback.
  6646. */
  6647. function() {
  6648. return !this.isLocal && createStandardXHR() || createActiveXHR();
  6649. } :
  6650. // For all other browsers, use the standard XMLHttpRequest object
  6651. createStandardXHR;
  6652. // Determine support properties
  6653. (function( xhr ) {
  6654. jQuery.extend( jQuery.support, {
  6655. ajax: !!xhr,
  6656. cors: !!xhr && ( "withCredentials" in xhr )
  6657. });
  6658. })( jQuery.ajaxSettings.xhr() );
  6659. // Create transport if the browser can provide an xhr
  6660. if ( jQuery.support.ajax ) {
  6661. jQuery.ajaxTransport(function( s ) {
  6662. // Cross domain only allowed if supported through XMLHttpRequest
  6663. if ( !s.crossDomain || jQuery.support.cors ) {
  6664. var callback;
  6665. return {
  6666. send: function( headers, complete ) {
  6667. // Get a new xhr
  6668. var xhr = s.xhr(),
  6669. handle,
  6670. i;
  6671. // Open the socket
  6672. // Passing null username, generates a login popup on Opera (#2865)
  6673. if ( s.username ) {
  6674. xhr.open( s.type, s.url, s.async, s.username, s.password );
  6675. } else {
  6676. xhr.open( s.type, s.url, s.async );
  6677. }
  6678. // Apply custom fields if provided
  6679. if ( s.xhrFields ) {
  6680. for ( i in s.xhrFields ) {
  6681. xhr[ i ] = s.xhrFields[ i ];
  6682. }
  6683. }
  6684. // Override mime type if needed
  6685. if ( s.mimeType && xhr.overrideMimeType ) {
  6686. xhr.overrideMimeType( s.mimeType );
  6687. }
  6688. // X-Requested-With header
  6689. // For cross-domain requests, seeing as conditions for a preflight are
  6690. // akin to a jigsaw puzzle, we simply never set it to be sure.
  6691. // (it can always be set on a per-request basis or even using ajaxSetup)
  6692. // For same-domain requests, won't change header if already provided.
  6693. if ( !s.crossDomain && !headers["X-Requested-With"] ) {
  6694. headers[ "X-Requested-With" ] = "XMLHttpRequest";
  6695. }
  6696. // Need an extra try/catch for cross domain requests in Firefox 3
  6697. try {
  6698. for ( i in headers ) {
  6699. xhr.setRequestHeader( i, headers[ i ] );
  6700. }
  6701. } catch( _ ) {}
  6702. // Do send the request
  6703. // This may raise an exception which is actually
  6704. // handled in jQuery.ajax (so no try/catch here)
  6705. xhr.send( ( s.hasContent && s.data ) || null );
  6706. // Listener
  6707. callback = function( _, isAbort ) {
  6708. var status,
  6709. statusText,
  6710. responseHeaders,
  6711. responses,
  6712. xml;
  6713. // Firefox throws exceptions when accessing properties
  6714. // of an xhr when a network error occured
  6715. // http://helpful.knobs-dials.com/index.php/Component_returned_failure_code:_0x80040111_(NS_ERROR_NOT_AVAILABLE)
  6716. try {
  6717. // Was never called and is aborted or complete
  6718. if ( callback && ( isAbort || xhr.readyState === 4 ) ) {
  6719. // Only called once
  6720. callback = undefined;
  6721. // Do not keep as active anymore
  6722. if ( handle ) {
  6723. xhr.onreadystatechange = jQuery.noop;
  6724. if ( xhrOnUnloadAbort ) {
  6725. delete xhrCallbacks[ handle ];
  6726. }
  6727. }
  6728. // If it's an abort
  6729. if ( isAbort ) {
  6730. // Abort it manually if needed
  6731. if ( xhr.readyState !== 4 ) {
  6732. xhr.abort();
  6733. }
  6734. } else {
  6735. status = xhr.status;
  6736. responseHeaders = xhr.getAllResponseHeaders();
  6737. responses = {};
  6738. xml = xhr.responseXML;
  6739. // Construct response list
  6740. if ( xml && xml.documentElement /* #4958 */ ) {
  6741. responses.xml = xml;
  6742. }
  6743. responses.text = xhr.responseText;
  6744. // Firefox throws an exception when accessing
  6745. // statusText for faulty cross-domain requests
  6746. try {
  6747. statusText = xhr.statusText;
  6748. } catch( e ) {
  6749. // We normalize with Webkit giving an empty statusText
  6750. statusText = "";
  6751. }
  6752. // Filter status for non standard behaviors
  6753. // If the request is local and we have data: assume a success
  6754. // (success with no data won't get notified, that's the best we
  6755. // can do given current implementations)
  6756. if ( !status && s.isLocal && !s.crossDomain ) {
  6757. status = responses.text ? 200 : 404;
  6758. // IE - #1450: sometimes returns 1223 when it should be 204
  6759. } else if ( status === 1223 ) {
  6760. status = 204;
  6761. }
  6762. }
  6763. }
  6764. } catch( firefoxAccessException ) {
  6765. if ( !isAbort ) {
  6766. complete( -1, firefoxAccessException );
  6767. }
  6768. }
  6769. // Call complete if needed
  6770. if ( responses ) {
  6771. complete( status, statusText, responses, responseHeaders );
  6772. }
  6773. };
  6774. // if we're in sync mode or it's in cache
  6775. // and has been retrieved directly (IE6 & IE7)
  6776. // we need to manually fire the callback
  6777. if ( !s.async || xhr.readyState === 4 ) {
  6778. callback();
  6779. } else {
  6780. handle = ++xhrId;
  6781. if ( xhrOnUnloadAbort ) {
  6782. // Create the active xhrs callbacks list if needed
  6783. // and attach the unload handler
  6784. if ( !xhrCallbacks ) {
  6785. xhrCallbacks = {};
  6786. jQuery( window ).unload( xhrOnUnloadAbort );
  6787. }
  6788. // Add to list of active xhrs callbacks
  6789. xhrCallbacks[ handle ] = callback;
  6790. }
  6791. xhr.onreadystatechange = callback;
  6792. }
  6793. },
  6794. abort: function() {
  6795. if ( callback ) {
  6796. callback(0,1);
  6797. }
  6798. }
  6799. };
  6800. }
  6801. });
  6802. }
  6803. var elemdisplay = {},
  6804. iframe, iframeDoc,
  6805. rfxtypes = /^(?:toggle|show|hide)$/,
  6806. rfxnum = /^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,
  6807. timerId,
  6808. fxAttrs = [
  6809. // height animations
  6810. [ "height", "marginTop", "marginBottom", "paddingTop", "paddingBottom" ],
  6811. // width animations
  6812. [ "width", "marginLeft", "marginRight", "paddingLeft", "paddingRight" ],
  6813. // opacity animations
  6814. [ "opacity" ]
  6815. ],
  6816. fxNow;
  6817. jQuery.fn.extend({
  6818. show: function( speed, easing, callback ) {
  6819. var elem, display;
  6820. if ( speed || speed === 0 ) {
  6821. return this.animate( genFx("show", 3), speed, easing, callback );
  6822. } else {
  6823. for ( var i = 0, j = this.length; i < j; i++ ) {
  6824. elem = this[ i ];
  6825. if ( elem.style ) {
  6826. display = elem.style.display;
  6827. // Reset the inline display of this element to learn if it is
  6828. // being hidden by cascaded rules or not
  6829. if ( !jQuery._data(elem, "olddisplay") && display === "none" ) {
  6830. display = elem.style.display = "";
  6831. }
  6832. // Set elements which have been overridden with display: none
  6833. // in a stylesheet to whatever the default browser style is
  6834. // for such an element
  6835. if ( display === "" && jQuery.css(elem, "display") === "none" ) {
  6836. jQuery._data( elem, "olddisplay", defaultDisplay(elem.nodeName) );
  6837. }
  6838. }
  6839. }
  6840. // Set the display of most of the elements in a second loop
  6841. // to avoid the constant reflow
  6842. for ( i = 0; i < j; i++ ) {
  6843. elem = this[ i ];
  6844. if ( elem.style ) {
  6845. display = elem.style.display;
  6846. if ( display === "" || display === "none" ) {
  6847. elem.style.display = jQuery._data( elem, "olddisplay" ) || "";
  6848. }
  6849. }
  6850. }
  6851. return this;
  6852. }
  6853. },
  6854. hide: function( speed, easing, callback ) {
  6855. if ( speed || speed === 0 ) {
  6856. return this.animate( genFx("hide", 3), speed, easing, callback);
  6857. } else {
  6858. var elem, display,
  6859. i = 0,
  6860. j = this.length;
  6861. for ( ; i < j; i++ ) {
  6862. elem = this[i];
  6863. if ( elem.style ) {
  6864. display = jQuery.css( elem, "display" );
  6865. if ( display !== "none" && !jQuery._data( elem, "olddisplay" ) ) {
  6866. jQuery._data( elem, "olddisplay", display );
  6867. }
  6868. }
  6869. }
  6870. // Set the display of the elements in a second loop
  6871. // to avoid the constant reflow
  6872. for ( i = 0; i < j; i++ ) {
  6873. if ( this[i].style ) {
  6874. this[i].style.display = "none";
  6875. }
  6876. }
  6877. return this;
  6878. }
  6879. },
  6880. // Save the old toggle function
  6881. _toggle: jQuery.fn.toggle,
  6882. toggle: function( fn, fn2, callback ) {
  6883. var bool = typeof fn === "boolean";
  6884. if ( jQuery.isFunction(fn) && jQuery.isFunction(fn2) ) {
  6885. this._toggle.apply( this, arguments );
  6886. } else if ( fn == null || bool ) {
  6887. this.each(function() {
  6888. var state = bool ? fn : jQuery(this).is(":hidden");
  6889. jQuery(this)[ state ? "show" : "hide" ]();
  6890. });
  6891. } else {
  6892. this.animate(genFx("toggle", 3), fn, fn2, callback);
  6893. }
  6894. return this;
  6895. },
  6896. fadeTo: function( speed, to, easing, callback ) {
  6897. return this.filter(":hidden").css("opacity", 0).show().end()
  6898. .animate({opacity: to}, speed, easing, callback);
  6899. },
  6900. animate: function( prop, speed, easing, callback ) {
  6901. var optall = jQuery.speed( speed, easing, callback );
  6902. if ( jQuery.isEmptyObject( prop ) ) {
  6903. return this.each( optall.complete, [ false ] );
  6904. }
  6905. // Do not change referenced properties as per-property easing will be lost
  6906. prop = jQuery.extend( {}, prop );
  6907. function doAnimation() {
  6908. // XXX 'this' does not always have a nodeName when running the
  6909. // test suite
  6910. if ( optall.queue === false ) {
  6911. jQuery._mark( this );
  6912. }
  6913. var opt = jQuery.extend( {}, optall ),
  6914. isElement = this.nodeType === 1,
  6915. hidden = isElement && jQuery(this).is(":hidden"),
  6916. name, val, p, e,
  6917. parts, start, end, unit,
  6918. method;
  6919. // will store per property easing and be used to determine when an animation is complete
  6920. opt.animatedProperties = {};
  6921. for ( p in prop ) {
  6922. // property name normalization
  6923. name = jQuery.camelCase( p );
  6924. if ( p !== name ) {
  6925. prop[ name ] = prop[ p ];
  6926. delete prop[ p ];
  6927. }
  6928. val = prop[ name ];
  6929. // easing resolution: per property > opt.specialEasing > opt.easing > 'swing' (default)
  6930. if ( jQuery.isArray( val ) ) {
  6931. opt.animatedProperties[ name ] = val[ 1 ];
  6932. val = prop[ name ] = val[ 0 ];
  6933. } else {
  6934. opt.animatedProperties[ name ] = opt.specialEasing && opt.specialEasing[ name ] || opt.easing || 'swing';
  6935. }
  6936. if ( val === "hide" && hidden || val === "show" && !hidden ) {
  6937. return opt.complete.call( this );
  6938. }
  6939. if ( isElement && ( name === "height" || name === "width" ) ) {
  6940. // Make sure that nothing sneaks out
  6941. // Record all 3 overflow attributes because IE does not
  6942. // change the overflow attribute when overflowX and
  6943. // overflowY are set to the same value
  6944. opt.overflow = [ this.style.overflow, this.style.overflowX, this.style.overflowY ];
  6945. // Set display property to inline-block for height/width
  6946. // animations on inline elements that are having width/height animated
  6947. if ( jQuery.css( this, "display" ) === "inline" &&
  6948. jQuery.css( this, "float" ) === "none" ) {
  6949. // inline-level elements accept inline-block;
  6950. // block-level elements need to be inline with layout
  6951. if ( !jQuery.support.inlineBlockNeedsLayout || defaultDisplay( this.nodeName ) === "inline" ) {
  6952. this.style.display = "inline-block";
  6953. } else {
  6954. this.style.zoom = 1;
  6955. }
  6956. }
  6957. }
  6958. }
  6959. if ( opt.overflow != null ) {
  6960. this.style.overflow = "hidden";
  6961. }
  6962. for ( p in prop ) {
  6963. e = new jQuery.fx( this, opt, p );
  6964. val = prop[ p ];
  6965. if ( rfxtypes.test( val ) ) {
  6966. // Tracks whether to show or hide based on private
  6967. // data attached to the element
  6968. method = jQuery._data( this, "toggle" + p ) || ( val === "toggle" ? hidden ? "show" : "hide" : 0 );
  6969. if ( method ) {
  6970. jQuery._data( this, "toggle" + p, method === "show" ? "hide" : "show" );
  6971. e[ method ]();
  6972. } else {
  6973. e[ val ]();
  6974. }
  6975. } else {
  6976. parts = rfxnum.exec( val );
  6977. start = e.cur();
  6978. if ( parts ) {
  6979. end = parseFloat( parts[2] );
  6980. unit = parts[3] || ( jQuery.cssNumber[ p ] ? "" : "px" );
  6981. // We need to compute starting value
  6982. if ( unit !== "px" ) {
  6983. jQuery.style( this, p, (end || 1) + unit);
  6984. start = ( (end || 1) / e.cur() ) * start;
  6985. jQuery.style( this, p, start + unit);
  6986. }
  6987. // If a +=/-= token was provided, we're doing a relative animation
  6988. if ( parts[1] ) {
  6989. end = ( (parts[ 1 ] === "-=" ? -1 : 1) * end ) + start;
  6990. }
  6991. e.custom( start, end, unit );
  6992. } else {
  6993. e.custom( start, val, "" );
  6994. }
  6995. }
  6996. }
  6997. // For JS strict compliance
  6998. return true;
  6999. }
  7000. return optall.queue === false ?
  7001. this.each( doAnimation ) :
  7002. this.queue( optall.queue, doAnimation );
  7003. },
  7004. stop: function( type, clearQueue, gotoEnd ) {
  7005. if ( typeof type !== "string" ) {
  7006. gotoEnd = clearQueue;
  7007. clearQueue = type;
  7008. type = undefined;
  7009. }
  7010. if ( clearQueue && type !== false ) {
  7011. this.queue( type || "fx", [] );
  7012. }
  7013. return this.each(function() {
  7014. var index,
  7015. hadTimers = false,
  7016. timers = jQuery.timers,
  7017. data = jQuery._data( this );
  7018. // clear marker counters if we know they won't be
  7019. if ( !gotoEnd ) {
  7020. jQuery._unmark( true, this );
  7021. }
  7022. function stopQueue( elem, data, index ) {
  7023. var hooks = data[ index ];
  7024. jQuery.removeData( elem, index, true );
  7025. hooks.stop( gotoEnd );
  7026. }
  7027. if ( type == null ) {
  7028. for ( index in data ) {
  7029. if ( data[ index ] && data[ index ].stop && index.indexOf(".run") === index.length - 4 ) {
  7030. stopQueue( this, data, index );
  7031. }
  7032. }
  7033. } else if ( data[ index = type + ".run" ] && data[ index ].stop ){
  7034. stopQueue( this, data, index );
  7035. }
  7036. for ( index = timers.length; index--; ) {
  7037. if ( timers[ index ].elem === this && (type == null || timers[ index ].queue === type) ) {
  7038. if ( gotoEnd ) {
  7039. // force the next step to be the last
  7040. timers[ index ]( true );
  7041. } else {
  7042. timers[ index ].saveState();
  7043. }
  7044. hadTimers = true;
  7045. timers.splice( index, 1 );
  7046. }
  7047. }
  7048. // start the next in the queue if the last step wasn't forced
  7049. // timers currently will call their complete callbacks, which will dequeue
  7050. // but only if they were gotoEnd
  7051. if ( !( gotoEnd && hadTimers ) ) {
  7052. jQuery.dequeue( this, type );
  7053. }
  7054. });
  7055. }
  7056. });
  7057. // Animations created synchronously will run synchronously
  7058. function createFxNow() {
  7059. setTimeout( clearFxNow, 0 );
  7060. return ( fxNow = jQuery.now() );
  7061. }
  7062. function clearFxNow() {
  7063. fxNow = undefined;
  7064. }
  7065. // Generate parameters to create a standard animation
  7066. function genFx( type, num ) {
  7067. var obj = {};
  7068. jQuery.each( fxAttrs.concat.apply([], fxAttrs.slice( 0, num )), function() {
  7069. obj[ this ] = type;
  7070. });
  7071. return obj;
  7072. }
  7073. // Generate shortcuts for custom animations
  7074. jQuery.each({
  7075. slideDown: genFx( "show", 1 ),
  7076. slideUp: genFx( "hide", 1 ),
  7077. slideToggle: genFx( "toggle", 1 ),
  7078. fadeIn: { opacity: "show" },
  7079. fadeOut: { opacity: "hide" },
  7080. fadeToggle: { opacity: "toggle" }
  7081. }, function( name, props ) {
  7082. jQuery.fn[ name ] = function( speed, easing, callback ) {
  7083. return this.animate( props, speed, easing, callback );
  7084. };
  7085. });
  7086. jQuery.extend({
  7087. speed: function( speed, easing, fn ) {
  7088. var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : {
  7089. complete: fn || !fn && easing ||
  7090. jQuery.isFunction( speed ) && speed,
  7091. duration: speed,
  7092. easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing
  7093. };
  7094. opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :
  7095. opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default;
  7096. // normalize opt.queue - true/undefined/null -> "fx"
  7097. if ( opt.queue == null || opt.queue === true ) {
  7098. opt.queue = "fx";
  7099. }
  7100. // Queueing
  7101. opt.old = opt.complete;
  7102. opt.complete = function( noUnmark ) {
  7103. if ( jQuery.isFunction( opt.old ) ) {
  7104. opt.old.call( this );
  7105. }
  7106. if ( opt.queue ) {
  7107. jQuery.dequeue( this, opt.queue );
  7108. } else if ( noUnmark !== false ) {
  7109. jQuery._unmark( this );
  7110. }
  7111. };
  7112. return opt;
  7113. },
  7114. easing: {
  7115. linear: function( p, n, firstNum, diff ) {
  7116. return firstNum + diff * p;
  7117. },
  7118. swing: function( p, n, firstNum, diff ) {
  7119. return ( ( -Math.cos( p*Math.PI ) / 2 ) + 0.5 ) * diff + firstNum;
  7120. }
  7121. },
  7122. timers: [],
  7123. fx: function( elem, options, prop ) {
  7124. this.options = options;
  7125. this.elem = elem;
  7126. this.prop = prop;
  7127. options.orig = options.orig || {};
  7128. }
  7129. });
  7130. jQuery.fx.prototype = {
  7131. // Simple function for setting a style value
  7132. update: function() {
  7133. if ( this.options.step ) {
  7134. this.options.step.call( this.elem, this.now, this );
  7135. }
  7136. ( jQuery.fx.step[ this.prop ] || jQuery.fx.step._default )( this );
  7137. },
  7138. // Get the current size
  7139. cur: function() {
  7140. if ( this.elem[ this.prop ] != null && (!this.elem.style || this.elem.style[ this.prop ] == null) ) {
  7141. return this.elem[ this.prop ];
  7142. }
  7143. var parsed,
  7144. r = jQuery.css( this.elem, this.prop );
  7145. // Empty strings, null, undefined and "auto" are converted to 0,
  7146. // complex values such as "rotate(1rad)" are returned as is,
  7147. // simple values such as "10px" are parsed to Float.
  7148. return isNaN( parsed = parseFloat( r ) ) ? !r || r === "auto" ? 0 : r : parsed;
  7149. },
  7150. // Start an animation from one number to another
  7151. custom: function( from, to, unit ) {
  7152. var self = this,
  7153. fx = jQuery.fx;
  7154. this.startTime = fxNow || createFxNow();
  7155. this.end = to;
  7156. this.now = this.start = from;
  7157. this.pos = this.state = 0;
  7158. this.unit = unit || this.unit || ( jQuery.cssNumber[ this.prop ] ? "" : "px" );
  7159. function t( gotoEnd ) {
  7160. return self.step( gotoEnd );
  7161. }
  7162. t.queue = this.options.queue;
  7163. t.elem = this.elem;
  7164. t.saveState = function() {
  7165. if ( self.options.hide && jQuery._data( self.elem, "fxshow" + self.prop ) === undefined ) {
  7166. jQuery._data( self.elem, "fxshow" + self.prop, self.start );
  7167. }
  7168. };
  7169. if ( t() && jQuery.timers.push(t) && !timerId ) {
  7170. timerId = setInterval( fx.tick, fx.interval );
  7171. }
  7172. },
  7173. // Simple 'show' function
  7174. show: function() {
  7175. var dataShow = jQuery._data( this.elem, "fxshow" + this.prop );
  7176. // Remember where we started, so that we can go back to it later
  7177. this.options.orig[ this.prop ] = dataShow || jQuery.style( this.elem, this.prop );
  7178. this.options.show = true;
  7179. // Begin the animation
  7180. // Make sure that we start at a small width/height to avoid any flash of content
  7181. if ( dataShow !== undefined ) {
  7182. // This show is picking up where a previous hide or show left off
  7183. this.custom( this.cur(), dataShow );
  7184. } else {
  7185. this.custom( this.prop === "width" || this.prop === "height" ? 1 : 0, this.cur() );
  7186. }
  7187. // Start by showing the element
  7188. jQuery( this.elem ).show();
  7189. },
  7190. // Simple 'hide' function
  7191. hide: function() {
  7192. // Remember where we started, so that we can go back to it later
  7193. this.options.orig[ this.prop ] = jQuery._data( this.elem, "fxshow" + this.prop ) || jQuery.style( this.elem, this.prop );
  7194. this.options.hide = true;
  7195. // Begin the animation
  7196. this.custom( this.cur(), 0 );
  7197. },
  7198. // Each step of an animation
  7199. step: function( gotoEnd ) {
  7200. var p, n, complete,
  7201. t = fxNow || createFxNow(),
  7202. done = true,
  7203. elem = this.elem,
  7204. options = this.options;
  7205. if ( gotoEnd || t >= options.duration + this.startTime ) {
  7206. this.now = this.end;
  7207. this.pos = this.state = 1;
  7208. this.update();
  7209. options.animatedProperties[ this.prop ] = true;
  7210. for ( p in options.animatedProperties ) {
  7211. if ( options.animatedProperties[ p ] !== true ) {
  7212. done = false;
  7213. }
  7214. }
  7215. if ( done ) {
  7216. // Reset the overflow
  7217. if ( options.overflow != null && !jQuery.support.shrinkWrapBlocks ) {
  7218. jQuery.each( [ "", "X", "Y" ], function( index, value ) {
  7219. elem.style[ "overflow" + value ] = options.overflow[ index ];
  7220. });
  7221. }
  7222. // Hide the element if the "hide" operation was done
  7223. if ( options.hide ) {
  7224. jQuery( elem ).hide();
  7225. }
  7226. // Reset the properties, if the item has been hidden or shown
  7227. if ( options.hide || options.show ) {
  7228. for ( p in options.animatedProperties ) {
  7229. jQuery.style( elem, p, options.orig[ p ] );
  7230. jQuery.removeData( elem, "fxshow" + p, true );
  7231. // Toggle data is no longer needed
  7232. jQuery.removeData( elem, "toggle" + p, true );
  7233. }
  7234. }
  7235. // Execute the complete function
  7236. // in the event that the complete function throws an exception
  7237. // we must ensure it won't be called twice. #5684
  7238. complete = options.complete;
  7239. if ( complete ) {
  7240. options.complete = false;
  7241. complete.call( elem );
  7242. }
  7243. }
  7244. return false;
  7245. } else {
  7246. // classical easing cannot be used with an Infinity duration
  7247. if ( options.duration == Infinity ) {
  7248. this.now = t;
  7249. } else {
  7250. n = t - this.startTime;
  7251. this.state = n / options.duration;
  7252. // Perform the easing function, defaults to swing
  7253. this.pos = jQuery.easing[ options.animatedProperties[this.prop] ]( this.state, n, 0, 1, options.duration );
  7254. this.now = this.start + ( (this.end - this.start) * this.pos );
  7255. }
  7256. // Perform the next step of the animation
  7257. this.update();
  7258. }
  7259. return true;
  7260. }
  7261. };
  7262. jQuery.extend( jQuery.fx, {
  7263. tick: function() {
  7264. var timer,
  7265. timers = jQuery.timers,
  7266. i = 0;
  7267. for ( ; i < timers.length; i++ ) {
  7268. timer = timers[ i ];
  7269. // Checks the timer has not already been removed
  7270. if ( !timer() && timers[ i ] === timer ) {
  7271. timers.splice( i--, 1 );
  7272. }
  7273. }
  7274. if ( !timers.length ) {
  7275. jQuery.fx.stop();
  7276. }
  7277. },
  7278. interval: 13,
  7279. stop: function() {
  7280. clearInterval( timerId );
  7281. timerId = null;
  7282. },
  7283. speeds: {
  7284. slow: 600,
  7285. fast: 200,
  7286. // Default speed
  7287. _default: 400
  7288. },
  7289. step: {
  7290. opacity: function( fx ) {
  7291. jQuery.style( fx.elem, "opacity", fx.now );
  7292. },
  7293. _default: function( fx ) {
  7294. if ( fx.elem.style && fx.elem.style[ fx.prop ] != null ) {
  7295. fx.elem.style[ fx.prop ] = fx.now + fx.unit;
  7296. } else {
  7297. fx.elem[ fx.prop ] = fx.now;
  7298. }
  7299. }
  7300. }
  7301. });
  7302. // Adds width/height step functions
  7303. // Do not set anything below 0
  7304. jQuery.each([ "width", "height" ], function( i, prop ) {
  7305. jQuery.fx.step[ prop ] = function( fx ) {
  7306. jQuery.style( fx.elem, prop, Math.max(0, fx.now) + fx.unit );
  7307. };
  7308. });
  7309. if ( jQuery.expr && jQuery.expr.filters ) {
  7310. jQuery.expr.filters.animated = function( elem ) {
  7311. return jQuery.grep(jQuery.timers, function( fn ) {
  7312. return elem === fn.elem;
  7313. }).length;
  7314. };
  7315. }
  7316. // Try to restore the default display value of an element
  7317. function defaultDisplay( nodeName ) {
  7318. if ( !elemdisplay[ nodeName ] ) {
  7319. var body = document.body,
  7320. elem = jQuery( "<" + nodeName + ">" ).appendTo( body ),
  7321. display = elem.css( "display" );
  7322. elem.remove();
  7323. // If the simple way fails,
  7324. // get element's real default display by attaching it to a temp iframe
  7325. if ( display === "none" || display === "" ) {
  7326. // No iframe to use yet, so create it
  7327. if ( !iframe ) {
  7328. iframe = document.createElement( "iframe" );
  7329. iframe.frameBorder = iframe.width = iframe.height = 0;
  7330. }
  7331. body.appendChild( iframe );
  7332. // Create a cacheable copy of the iframe document on first call.
  7333. // IE and Opera will allow us to reuse the iframeDoc without re-writing the fake HTML
  7334. // document to it; WebKit & Firefox won't allow reusing the iframe document.
  7335. if ( !iframeDoc || !iframe.createElement ) {
  7336. iframeDoc = ( iframe.contentWindow || iframe.contentDocument ).document;
  7337. iframeDoc.write( ( document.compatMode === "CSS1Compat" ? "<!doctype html>" : "" ) + "<html><body>" );
  7338. iframeDoc.close();
  7339. }
  7340. elem = iframeDoc.createElement( nodeName );
  7341. iframeDoc.body.appendChild( elem );
  7342. display = jQuery.css( elem, "display" );
  7343. body.removeChild( iframe );
  7344. }
  7345. // Store the correct default display
  7346. elemdisplay[ nodeName ] = display;
  7347. }
  7348. return elemdisplay[ nodeName ];
  7349. }
  7350. var rtable = /^t(?:able|d|h)$/i,
  7351. rroot = /^(?:body|html)$/i;
  7352. if ( "getBoundingClientRect" in document.documentElement ) {
  7353. jQuery.fn.offset = function( options ) {
  7354. var elem = this[0], box;
  7355. if ( options ) {
  7356. return this.each(function( i ) {
  7357. jQuery.offset.setOffset( this, options, i );
  7358. });
  7359. }
  7360. if ( !elem || !elem.ownerDocument ) {
  7361. return null;
  7362. }
  7363. if ( elem === elem.ownerDocument.body ) {
  7364. return jQuery.offset.bodyOffset( elem );
  7365. }
  7366. try {
  7367. box = elem.getBoundingClientRect();
  7368. } catch(e) {}
  7369. var doc = elem.ownerDocument,
  7370. docElem = doc.documentElement;
  7371. // Make sure we're not dealing with a disconnected DOM node
  7372. if ( !box || !jQuery.contains( docElem, elem ) ) {
  7373. return box ? { top: box.top, left: box.left } : { top: 0, left: 0 };
  7374. }
  7375. var body = doc.body,
  7376. win = getWindow(doc),
  7377. clientTop = docElem.clientTop || body.clientTop || 0,
  7378. clientLeft = docElem.clientLeft || body.clientLeft || 0,
  7379. scrollTop = win.pageYOffset || jQuery.support.boxModel && docElem.scrollTop || body.scrollTop,
  7380. scrollLeft = win.pageXOffset || jQuery.support.boxModel && docElem.scrollLeft || body.scrollLeft,
  7381. top = box.top + scrollTop - clientTop,
  7382. left = box.left + scrollLeft - clientLeft;
  7383. return { top: top, left: left };
  7384. };
  7385. } else {
  7386. jQuery.fn.offset = function( options ) {
  7387. var elem = this[0];
  7388. if ( options ) {
  7389. return this.each(function( i ) {
  7390. jQuery.offset.setOffset( this, options, i );
  7391. });
  7392. }
  7393. if ( !elem || !elem.ownerDocument ) {
  7394. return null;
  7395. }
  7396. if ( elem === elem.ownerDocument.body ) {
  7397. return jQuery.offset.bodyOffset( elem );
  7398. }
  7399. var computedStyle,
  7400. offsetParent = elem.offsetParent,
  7401. prevOffsetParent = elem,
  7402. doc = elem.ownerDocument,
  7403. docElem = doc.documentElement,
  7404. body = doc.body,
  7405. defaultView = doc.defaultView,
  7406. prevComputedStyle = defaultView ? defaultView.getComputedStyle( elem, null ) : elem.currentStyle,
  7407. top = elem.offsetTop,
  7408. left = elem.offsetLeft;
  7409. while ( (elem = elem.parentNode) && elem !== body && elem !== docElem ) {
  7410. if ( jQuery.support.fixedPosition && prevComputedStyle.position === "fixed" ) {
  7411. break;
  7412. }
  7413. computedStyle = defaultView ? defaultView.getComputedStyle(elem, null) : elem.currentStyle;
  7414. top -= elem.scrollTop;
  7415. left -= elem.scrollLeft;
  7416. if ( elem === offsetParent ) {
  7417. top += elem.offsetTop;
  7418. left += elem.offsetLeft;
  7419. if ( jQuery.support.doesNotAddBorder && !(jQuery.support.doesAddBorderForTableAndCells && rtable.test(elem.nodeName)) ) {
  7420. top += parseFloat( computedStyle.borderTopWidth ) || 0;
  7421. left += parseFloat( computedStyle.borderLeftWidth ) || 0;
  7422. }
  7423. prevOffsetParent = offsetParent;
  7424. offsetParent = elem.offsetParent;
  7425. }
  7426. if ( jQuery.support.subtractsBorderForOverflowNotVisible && computedStyle.overflow !== "visible" ) {
  7427. top += parseFloat( computedStyle.borderTopWidth ) || 0;
  7428. left += parseFloat( computedStyle.borderLeftWidth ) || 0;
  7429. }
  7430. prevComputedStyle = computedStyle;
  7431. }
  7432. if ( prevComputedStyle.position === "relative" || prevComputedStyle.position === "static" ) {
  7433. top += body.offsetTop;
  7434. left += body.offsetLeft;
  7435. }
  7436. if ( jQuery.support.fixedPosition && prevComputedStyle.position === "fixed" ) {
  7437. top += Math.max( docElem.scrollTop, body.scrollTop );
  7438. left += Math.max( docElem.scrollLeft, body.scrollLeft );
  7439. }
  7440. return { top: top, left: left };
  7441. };
  7442. }
  7443. jQuery.offset = {
  7444. bodyOffset: function( body ) {
  7445. var top = body.offsetTop,
  7446. left = body.offsetLeft;
  7447. if ( jQuery.support.doesNotIncludeMarginInBodyOffset ) {
  7448. top += parseFloat( jQuery.css(body, "marginTop") ) || 0;
  7449. left += parseFloat( jQuery.css(body, "marginLeft") ) || 0;
  7450. }
  7451. return { top: top, left: left };
  7452. },
  7453. setOffset: function( elem, options, i ) {
  7454. var position = jQuery.css( elem, "position" );
  7455. // set position first, in-case top/left are set even on static elem
  7456. if ( position === "static" ) {
  7457. elem.style.position = "relative";
  7458. }
  7459. var curElem = jQuery( elem ),
  7460. curOffset = curElem.offset(),
  7461. curCSSTop = jQuery.css( elem, "top" ),
  7462. curCSSLeft = jQuery.css( elem, "left" ),
  7463. calculatePosition = ( position === "absolute" || position === "fixed" ) && jQuery.inArray("auto", [curCSSTop, curCSSLeft]) > -1,
  7464. props = {}, curPosition = {}, curTop, curLeft;
  7465. // need to be able to calculate position if either top or left is auto and position is either absolute or fixed
  7466. if ( calculatePosition ) {
  7467. curPosition = curElem.position();
  7468. curTop = curPosition.top;
  7469. curLeft = curPosition.left;
  7470. } else {
  7471. curTop = parseFloat( curCSSTop ) || 0;
  7472. curLeft = parseFloat( curCSSLeft ) || 0;
  7473. }
  7474. if ( jQuery.isFunction( options ) ) {
  7475. options = options.call( elem, i, curOffset );
  7476. }
  7477. if ( options.top != null ) {
  7478. props.top = ( options.top - curOffset.top ) + curTop;
  7479. }
  7480. if ( options.left != null ) {
  7481. props.left = ( options.left - curOffset.left ) + curLeft;
  7482. }
  7483. if ( "using" in options ) {
  7484. options.using.call( elem, props );
  7485. } else {
  7486. curElem.css( props );
  7487. }
  7488. }
  7489. };
  7490. jQuery.fn.extend({
  7491. position: function() {
  7492. if ( !this[0] ) {
  7493. return null;
  7494. }
  7495. var elem = this[0],
  7496. // Get *real* offsetParent
  7497. offsetParent = this.offsetParent(),
  7498. // Get correct offsets
  7499. offset = this.offset(),
  7500. parentOffset = rroot.test(offsetParent[0].nodeName) ? { top: 0, left: 0 } : offsetParent.offset();
  7501. // Subtract element margins
  7502. // note: when an element has margin: auto the offsetLeft and marginLeft
  7503. // are the same in Safari causing offset.left to incorrectly be 0
  7504. offset.top -= parseFloat( jQuery.css(elem, "marginTop") ) || 0;
  7505. offset.left -= parseFloat( jQuery.css(elem, "marginLeft") ) || 0;
  7506. // Add offsetParent borders
  7507. parentOffset.top += parseFloat( jQuery.css(offsetParent[0], "borderTopWidth") ) || 0;
  7508. parentOffset.left += parseFloat( jQuery.css(offsetParent[0], "borderLeftWidth") ) || 0;
  7509. // Subtract the two offsets
  7510. return {
  7511. top: offset.top - parentOffset.top,
  7512. left: offset.left - parentOffset.left
  7513. };
  7514. },
  7515. offsetParent: function() {
  7516. return this.map(function() {
  7517. var offsetParent = this.offsetParent || document.body;
  7518. while ( offsetParent && (!rroot.test(offsetParent.nodeName) && jQuery.css(offsetParent, "position") === "static") ) {
  7519. offsetParent = offsetParent.offsetParent;
  7520. }
  7521. return offsetParent;
  7522. });
  7523. }
  7524. });
  7525. // Create scrollLeft and scrollTop methods
  7526. jQuery.each( ["Left", "Top"], function( i, name ) {
  7527. var method = "scroll" + name;
  7528. jQuery.fn[ method ] = function( val ) {
  7529. var elem, win;
  7530. if ( val === undefined ) {
  7531. elem = this[ 0 ];
  7532. if ( !elem ) {
  7533. return null;
  7534. }
  7535. win = getWindow( elem );
  7536. // Return the scroll offset
  7537. return win ? ("pageXOffset" in win) ? win[ i ? "pageYOffset" : "pageXOffset" ] :
  7538. jQuery.support.boxModel && win.document.documentElement[ method ] ||
  7539. win.document.body[ method ] :
  7540. elem[ method ];
  7541. }
  7542. // Set the scroll offset
  7543. return this.each(function() {
  7544. win = getWindow( this );
  7545. if ( win ) {
  7546. win.scrollTo(
  7547. !i ? val : jQuery( win ).scrollLeft(),
  7548. i ? val : jQuery( win ).scrollTop()
  7549. );
  7550. } else {
  7551. this[ method ] = val;
  7552. }
  7553. });
  7554. };
  7555. });
  7556. function getWindow( elem ) {
  7557. return jQuery.isWindow( elem ) ?
  7558. elem :
  7559. elem.nodeType === 9 ?
  7560. elem.defaultView || elem.parentWindow :
  7561. false;
  7562. }
  7563. // Create width, height, innerHeight, innerWidth, outerHeight and outerWidth methods
  7564. jQuery.each([ "Height", "Width" ], function( i, name ) {
  7565. var type = name.toLowerCase();
  7566. // innerHeight and innerWidth
  7567. jQuery.fn[ "inner" + name ] = function() {
  7568. var elem = this[0];
  7569. return elem ?
  7570. elem.style ?
  7571. parseFloat( jQuery.css( elem, type, "padding" ) ) :
  7572. this[ type ]() :
  7573. null;
  7574. };
  7575. // outerHeight and outerWidth
  7576. jQuery.fn[ "outer" + name ] = function( margin ) {
  7577. var elem = this[0];
  7578. return elem ?
  7579. elem.style ?
  7580. parseFloat( jQuery.css( elem, type, margin ? "margin" : "border" ) ) :
  7581. this[ type ]() :
  7582. null;
  7583. };
  7584. jQuery.fn[ type ] = function( size ) {
  7585. // Get window width or height
  7586. var elem = this[0];
  7587. if ( !elem ) {
  7588. return size == null ? null : this;
  7589. }
  7590. if ( jQuery.isFunction( size ) ) {
  7591. return this.each(function( i ) {
  7592. var self = jQuery( this );
  7593. self[ type ]( size.call( this, i, self[ type ]() ) );
  7594. });
  7595. }
  7596. if ( jQuery.isWindow( elem ) ) {
  7597. // Everyone else use document.documentElement or document.body depending on Quirks vs Standards mode
  7598. // 3rd condition allows Nokia support, as it supports the docElem prop but not CSS1Compat
  7599. var docElemProp = elem.document.documentElement[ "client" + name ],
  7600. body = elem.document.body;
  7601. return elem.document.compatMode === "CSS1Compat" && docElemProp ||
  7602. body && body[ "client" + name ] || docElemProp;
  7603. // Get document width or height
  7604. } else if ( elem.nodeType === 9 ) {
  7605. // Either scroll[Width/Height] or offset[Width/Height], whichever is greater
  7606. return Math.max(
  7607. elem.documentElement["client" + name],
  7608. elem.body["scroll" + name], elem.documentElement["scroll" + name],
  7609. elem.body["offset" + name], elem.documentElement["offset" + name]
  7610. );
  7611. // Get or set width or height on the element
  7612. } else if ( size === undefined ) {
  7613. var orig = jQuery.css( elem, type ),
  7614. ret = parseFloat( orig );
  7615. return jQuery.isNumeric( ret ) ? ret : orig;
  7616. // Set the width or height on the element (default to pixels if value is unitless)
  7617. } else {
  7618. return this.css( type, typeof size === "string" ? size : size + "px" );
  7619. }
  7620. };
  7621. });
  7622. // Expose jQuery to the global object
  7623. window.jQuery = window.$ = jQuery;
  7624. // Expose jQuery as an AMD module, but only for AMD loaders that
  7625. // understand the issues with loading multiple versions of jQuery
  7626. // in a page that all might call define(). The loader will indicate
  7627. // they have special allowances for multiple jQuery versions by
  7628. // specifying define.amd.jQuery = true. Register as a named module,
  7629. // since jQuery can be concatenated with other files that may use define,
  7630. // but not use a proper concatenation script that understands anonymous
  7631. // AMD modules. A named AMD is safest and most robust way to register.
  7632. // Lowercase jquery is used because AMD module names are derived from
  7633. // file names, and jQuery is normally delivered in a lowercase file name.
  7634. // Do this after creating the global so that if an AMD module wants to call
  7635. // noConflict to hide this version of jQuery, it will work.
  7636. if ( typeof define === "function" && define.amd && define.amd.jQuery ) {
  7637. define( "jquery", [], function () { return jQuery; } );
  7638. }
  7639. })( window );