jquery.js 242 KB

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