jquery-1.5.1-vsdoc.js 256 KB

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